对接法规月报

This commit is contained in:
qq787203167
2022-07-04 15:31:32 +08:00
parent c9057a5370
commit a71e10b794
8 changed files with 374 additions and 125 deletions
+3
View File
@@ -1075,4 +1075,7 @@ module.exports = {
TheEngineerAndCertification:'The regulatory engineer and Certification Engineer of cannot be empty', TheEngineerAndCertification:'The regulatory engineer and Certification Engineer of cannot be empty',
bringInTheProjectInterface:'Bring in the project interface', bringInTheProjectInterface:'Bring in the project interface',
theCurrentListSaved:'The current list data has been submitted and cannot be temporarily saved', theCurrentListSaved:'The current list data has been submitted and cannot be temporarily saved',
defaultTemplate:'Default template',
newRequestCommentListTemplate:'New request for comment list template',
NewReleasedStandardTemplate:'New released standard template',
} }
+3
View File
@@ -1079,4 +1079,7 @@ module.exports = {
requiredParametersEmpty:'必填参数不能为空', requiredParametersEmpty:'必填参数不能为空',
bringInTheProjectInterface:'带入工程接口人', bringInTheProjectInterface:'带入工程接口人',
theCurrentListSaved:'当前列表数据已全部提交无法进行暂存', theCurrentListSaved:'当前列表数据已全部提交无法进行暂存',
defaultTemplate:'默认模板',
newRequestCommentListTemplate:'新征求意见清单模板',
NewReleasedStandardTemplate:'新发布标准模板',
} }
@@ -90,7 +90,8 @@
return { return {
//url传参严格按照当前命名 //url传参严格按照当前命名
url: { url: {
deleteBatch: '' deleteBatch: '/report/lawsMonthlyReportWriteEO/deleteBatch',
list:'/report/lawsMonthlyReportWriteEO/page',
}, },
loading: false, loading: false,
dataSource: [], dataSource: [],
@@ -103,7 +104,7 @@
{ {
title: this.$t('chapterContents'), title: this.$t('chapterContents'),
align: 'center', align: 'center',
dataIndex: 'chapterContents', dataIndex: 'memoriesChapterName',
width: 170 width: 170
}, },
{ {
@@ -124,21 +125,21 @@
align: 'center', align: 'center',
width: 170, width: 170,
ellipsis: true, ellipsis: true,
dataIndex: 'regulatoryContact' dataIndex: 'lawsContact'
}, },
{ {
title: this.$t('completedBy'), title: this.$t('completedBy'),
align: 'center', align: 'center',
ellipsis: true, ellipsis: true,
width: 170, width: 170,
dataIndex: 'completedBy' dataIndex: 'createBy'
}, },
{ {
title: this.$t('exportStatus'), title: this.$t('exportStatus'),
align: 'center', align: 'center',
ellipsis: true, ellipsis: true,
width: 170, width: 170,
dataIndex: 'exportStatus' dataIndex: 'exportStateName'
}, },
{ {
title: this.$t('operation'), title: this.$t('operation'),
@@ -183,7 +184,26 @@
this.getList() this.getList()
}, },
getList() { getList() {
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
...this.queryParam
}
this.loading = true
getAction(this.url.list, query).then((res) => {
if (res.success) {
if (res.result.current > 1 && res.result.records.length == 0) {
this.pageNo = res.result.current - 1
this.getList()
return
}
this.dataSource = res.result.records || []
this.total = res.result.total
this.loading = false
} else {
this.loading = false
}
})
}, },
monthlyTitleTemplateClick() { monthlyTitleTemplateClick() {
this.$refs.fillTableRef.getData() this.$refs.fillTableRef.getData()
@@ -7,10 +7,10 @@
<span class="title-text-text" <span class="title-text-text"
:title="$t('title')">{{$t('title')}}</span> :title="$t('title')">{{$t('title')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="titleCn">
<a-input class="box-input" <a-input class="box-input"
:disabled="false" :disabled="false"
v-model="formInline.title" v-model="formInline.titleCn"
:placeholder="$t('PleaseEnter')+$t('title')"/> :placeholder="$t('PleaseEnter')+$t('title')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -21,10 +21,10 @@
<span class="title-text-text" <span class="title-text-text"
:title="$t('englishTitle')">{{$t('englishTitle')}}</span> :title="$t('englishTitle')">{{$t('englishTitle')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="titleEn">
<a-input class="box-input" <a-input class="box-input"
:disabled="false" :disabled="false"
v-model="formInline.englishTitle" v-model="formInline.titleEn"
:placeholder="$t('PleaseEnter')+$t('englishTitle')"/> :placeholder="$t('PleaseEnter')+$t('englishTitle')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -59,7 +59,7 @@
:title="$t('vehicleType')">{{$t('vehicleType')}}</span> :title="$t('vehicleType')">{{$t('vehicleType')}}</span>
</div> </div>
<a-form-model-item class="itemModel-multi"> <a-form-model-item class="itemModel-multi">
<j-multi-select-tag class="box-input" v-model="formInline.vehicleType" <j-multi-select-tag class="box-input" v-model="formInline.applyCar"
:placeholder="$t('PleaseSelect')+$t('vehicleType')" :placeholder="$t('PleaseSelect')+$t('vehicleType')"
:type="'select'" :type="'select'"
:triggerChange="false" :dictCode="'car_type'"/> :triggerChange="false" :dictCode="'car_type'"/>
@@ -75,7 +75,7 @@
:title="$t('scopeOfApplication')">{{$t('scopeOfApplication')}}</span> :title="$t('scopeOfApplication')">{{$t('scopeOfApplication')}}</span>
</div> </div>
<a-form-model-item class="itemModel-multi"> <a-form-model-item class="itemModel-multi">
<j-multi-select-tag class="box-input" v-model="formInline.shi4_yong4_fan4_wei2" <j-multi-select-tag class="box-input" v-model="formInline.applyScope"
:placeholder="$t('PleaseSelect')+$t('scopeOfApplication')" :placeholder="$t('PleaseSelect')+$t('scopeOfApplication')"
:type="'select'" :type="'select'"
:triggerChange="false" :dictCode="'apply_scope'"/> :triggerChange="false" :dictCode="'apply_scope'"/>
@@ -89,7 +89,7 @@
:title="$t('status')">{{$t('status')}}</span> :title="$t('status')">{{$t('status')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel">
<j-dict-select-tag class="box-input" v-model="formInline.status" <j-dict-select-tag class="box-input" v-model="formInline.state"
@input="handleInput('status')" @input="handleInput('status')"
:placeholder="$t('PleaseSelect')+$t('status')" :placeholder="$t('PleaseSelect')+$t('status')"
:type="'select'" :type="'select'"
@@ -106,11 +106,11 @@
:title="$t('usage')">{{$t('usage')}}</span> :title="$t('usage')">{{$t('usage')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel">
<j-dict-select-tag class="box-input" v-model="formInline.usage" <j-dict-select-tag class="box-input" v-model="formInline.useMethod"
@input="handleInput('usage')" @input="handleInput('usage')"
:placeholder="$t('PleaseSelect')+$t('usage')" :placeholder="$t('PleaseSelect')+$t('usage')"
:type="'select'" :type="'select'"
:triggerChange="false" :dictCode="'usage'"/> :triggerChange="false" :dictCode="'yong4_fa3'"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -120,10 +120,10 @@
<span class="title-text-text" <span class="title-text-text"
:title="$t('implementationModel')">{{$t('implementationModel')}}</span> :title="$t('implementationModel')">{{$t('implementationModel')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="implementCar">
<a-input class="box-input" <a-input class="box-input"
:disabled="disabled" :disabled="disabled"
v-model="formInline.implementationModel" v-model="formInline.implementCar"
:placeholder="$t('PleaseEnter')+$t('implementationModel')"/> :placeholder="$t('PleaseEnter')+$t('implementationModel')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -136,10 +136,10 @@
<span class="title-text-text" <span class="title-text-text"
:title="$t('releaseDate')">{{$t('releaseDate')}}</span> :title="$t('releaseDate')">{{$t('releaseDate')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="issueTime">
<a-input class="box-input" <a-input class="box-input"
:disabled="disabled" :disabled="disabled"
v-model="formInline.releaseDate" v-model="formInline.issueTime"
:placeholder="$t('PleaseEnter')+$t('releaseDate')"/> :placeholder="$t('PleaseEnter')+$t('releaseDate')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -150,10 +150,10 @@
<span class="title-text-text" <span class="title-text-text"
:title="$t('ImplementationDate')">{{$t('ImplementationDate')}}</span> :title="$t('ImplementationDate')">{{$t('ImplementationDate')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="newCarImplementTime">
<a-input class="box-input" <a-input class="box-input"
:disabled="disabled" :disabled="disabled"
v-model="formInline.ImplementationDate" v-model="formInline.newCarImplementTime"
:placeholder="$t('PleaseEnter')+$t('ImplementationDate')"/> :placeholder="$t('PleaseEnter')+$t('ImplementationDate')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -166,10 +166,10 @@
<span class="title-text-text" <span class="title-text-text"
:title="$t('vehicleInProductionDate')">{{$t('vehicleInProductionDate')}}</span> :title="$t('vehicleInProductionDate')">{{$t('vehicleInProductionDate')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="productionCarImplementTime">
<a-input class="box-input" <a-input class="box-input"
:disabled="disabled" :disabled="disabled"
v-model="formInline.vehicleInProductionDate" v-model="formInline.productionCarImplementTime"
:placeholder="$t('PleaseEnter')+$t('vehicleInProductionDate')"/> :placeholder="$t('PleaseEnter')+$t('vehicleInProductionDate')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -181,10 +181,10 @@
<div class="title-text"> <div class="title-text">
<span class="title-text-text" :title="$t('primaryCoverageCn')">{{$t('primaryCoverageCn')}}</span> <span class="title-text-text" :title="$t('primaryCoverageCn')">{{$t('primaryCoverageCn')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="contentCn">
<a-textarea <a-textarea
:placeholder="$t('PleaseEnter')+$t('primaryCoverageCn')" :placeholder="$t('PleaseEnter')+$t('primaryCoverageCn')"
v-model.trim="formInline.useExplain" :rows="4"/> v-model.trim="formInline.contentCn" :rows="4"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -195,10 +195,10 @@
<div class="title-text"> <div class="title-text">
<span class="title-text-text" :title="$t('primaryCoverageEn')">{{$t('primaryCoverageEn')}}</span> <span class="title-text-text" :title="$t('primaryCoverageEn')">{{$t('primaryCoverageEn')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="contentEn">
<a-textarea <a-textarea
:placeholder="$t('PleaseEnter')+$t('primaryCoverageEn')" :placeholder="$t('PleaseEnter')+$t('primaryCoverageEn')"
v-model.trim="formInline.useExplain" :rows="4"/> v-model.trim="formInline.contentEn" :rows="4"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -209,10 +209,10 @@
<div class="title-text"> <div class="title-text">
<span class="title-text-text" :title="$t('workProgressCn')">{{$t('workProgressCn')}}</span> <span class="title-text-text" :title="$t('workProgressCn')">{{$t('workProgressCn')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="workProgressCn">
<a-textarea <a-textarea
:placeholder="$t('PleaseEnter')+$t('workProgressCn')" :placeholder="$t('PleaseEnter')+$t('workProgressCn')"
v-model.trim="formInline.useExplain" :rows="4"/> v-model.trim="formInline.workProgressCn" :rows="4"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -223,10 +223,10 @@
<div class="title-text"> <div class="title-text">
<span class="title-text-text" :title="$t('workProgressEn')">{{$t('workProgressEn')}}</span> <span class="title-text-text" :title="$t('workProgressEn')">{{$t('workProgressEn')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="workProgressEn">
<a-textarea <a-textarea
:placeholder="$t('PleaseEnter')+$t('workProgressEn')" :placeholder="$t('PleaseEnter')+$t('workProgressEn')"
v-model.trim="formInline.useExplain" :rows="4"/> v-model.trim="formInline.workProgressEn" :rows="4"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -238,10 +238,11 @@
<span class="title-text-text" :title="$t('regulatoryContact')">{{$t('regulatoryContact')}}</span> <span class="title-text-text" :title="$t('regulatoryContact')">{{$t('regulatoryContact')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel">
<a-input class="box-input" <PersonnelSelection
:disabled="false" :query="{db_field_name:'lawsContact',db_field_txt:$t('regulatoryContact')}"
v-model="formInline.regulatoryContact" :personneQuery="formInline"
:placeholder="$t('PleaseEnter')+$t('regulatoryContact')"/> @change="PersonnelSelectionChange"
v-model="formInline.lawsContactName"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -252,7 +253,7 @@
<div class="title-text"> <div class="title-text">
<span class="title-text-text" :title="$t('link')">{{$t('link')}}</span> <span class="title-text-text" :title="$t('link')">{{$t('link')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="link">
<a-input class="box-input" <a-input class="box-input"
:disabled="false" :disabled="false"
v-model="formInline.link" v-model="formInline.link"
@@ -265,32 +266,93 @@
</template> </template>
<script> <script>
import PersonnelSelection from '@/components/PersonnelSelection/index'
import { mapGetters } from 'vuex'
import { getAction, postAction, downloadFile } from '@/api/manage'
export default { export default {
name: 'defaultTemplate', name: 'defaultTemplate',
props: ['formInlineQuery'],
components: {
PersonnelSelection
},
data() { data() {
return { return {
rules: { rules: {
name: [ titleCn: [
{
required: true,
message: this.$t('VirtualListName') + this.$t('cannotEmpty'),
trigger: 'blur'
},
{ {
max: 100, max: 100,
message: this.$t('VirtualListName') + this.$t('cannotExceed') + 100 + this.$t('Characters'), message: this.$t('title') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur' trigger: 'blur'
} }
], ],
useExplain: [ titleEn: [
{ {
required: true, max: 100,
message: this.$t('instructionForUse') + this.$t('cannotEmpty'), message: this.$t('englishTitle') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur' trigger: 'blur'
}, }
],
productionCarImplementTime: [
{ {
max: 500, max: 100,
message: this.$t('instructionForUse') + this.$t('cannotExceed') + 500 + this.$t('Characters'), message: this.$t('vehicleInProductionDate') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur'
}
],
newCarImplementTime: [
{
max: 100,
message: this.$t('ImplementationDate') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur'
}
],
issueTime: [
{
max: 100,
message: this.$t('releaseDate') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur'
}
],
implementCar: [
{
max: 100,
message: this.$t('implementationModel') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur'
}
],
link: [
{
max: 100,
message: this.$t('link') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur'
}
],
workProgressEn: [
{
max: 300,
message: this.$t('workProgressEn') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
],
workProgressCn: [
{
max: 300,
message: this.$t('workProgressEn') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
],
contentEn: [
{
max: 300,
message: this.$t('primaryCoverageEn') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
],
contentCn: [
{
max: 300,
message: this.$t('primaryCoverageCn') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur' trigger: 'blur'
} }
] ]
@@ -301,14 +363,55 @@
} }
}, },
mounted() { mounted() {
this.getSysCategoryTree()
this.$nextTick(() => {
if (this.formInlineQuery.id) {
this.formInline = JSON.parse(JSON.stringify(this.formInlineQuery))
if(this.formInline.technologyTerritory){
this.formInline.technologyTerritory = this.formInline.technologyTerritory.split(',')
}
this.formInline = { ...this.formInline }
} else {
this.formInline = {}
this.formInline.lawsContactName = this.userInfo().username
this.formInline.lawsContact = this.userInfo().id
this.formInline = { ...this.formInline }
}
})
}, },
methods: { methods: {
...mapGetters(['userInfo']),
getSysCategoryTree() {
getAction('/sys/category/getSysCategoryTree', {}).then((res) => {
if (res.success) {
this.CategoryTreeList = res.result
} else {
this.CategoryTreeList = []
}
})
},
handleInput(value) { handleInput(value) {
this.$nextTick(() => { this.$nextTick(() => {
this.formInline = { ...this.formInline } this.formInline = { ...this.formInline }
this.$refs.ruleForm.validateField([value]) this.$refs.ruleForm.validateField([value])
}) })
},
PersonnelSelectionChange(value, id) {
this.formInline[value] = id
this.formInline = { ...this.formInline }
},
getData(callback) {
this.$refs.ruleForm.validate(valid => {
if (valid) {
let formInline = JSON.parse(JSON.stringify(this.formInline))
Object.keys(formInline).forEach(res => {
if (formInline[res] && formInline[res] instanceof Array) {
formInline[res] = formInline[res].join(',')
}
})
callback && callback(formInline)
}
})
} }
} }
} }
@@ -15,12 +15,13 @@
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="title-text-text" <span class="Required">*</span>
:title="$t('fillInTheMonth')">{{$t('fillInTheMonth')}}</span> <span class="title-text-text"
:title="$t('fillInTheMonth')">{{$t('fillInTheMonth')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="month">
<a-month-picker class="box-input" <a-month-picker class="box-input"
v-model="formInline.fillInTheMonth" v-model="formInline.month"
:placeholder="$t('fillInTheMonth')"/> :placeholder="$t('fillInTheMonth')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -35,34 +36,33 @@
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="title-text-text" <span class="Required">*</span>
:title="$t('chapterContents')">{{$t('chapterContents')}}</span> <span class="title-text-text"
:title="$t('chapterContents')">{{$t('chapterContents')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel-multi" prop="memoriesChapter">
<a-select :placeholder="$t('PleaseSelect')+$t('chapterContents')" <a-tree-select
:disabled="disabled" tree-node-filter-prop="title"
class="box-input" v-model="formInline.memoriesChapter"
:getPopupContainer="triggerNode=> triggerNode.parentNode" :maxTagCount="1"
allowClear :getPopupContainer="triggerNode=> triggerNode.parentNode"
v-model="formInline.chapterContents"> class="box-input"
<a-select-option v-for="(item, key) in chapterContentsList" style="width: 100%"
:key="key" :tree-data="chapterContentsList"
:value="item.value"> tree-checkable
<span style="display: inline-block;width: 100%" :title=" item.name "> :placeholder="$t('PleaseSelect')+$t('chapterContents')"
{{ item.name }} />
</span>
</a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="title-text-text" <span class="Required">*</span>
:title="$t('contentTemplate')">{{$t('contentTemplate')}}</span> <span class="title-text-text"
:title="$t('contentTemplate')">{{$t('contentTemplate')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="contentTemplate">
<a-select :placeholder="$t('PleaseSelect')+$t('contentTemplate')" <a-select :placeholder="$t('PleaseSelect')+$t('contentTemplate')"
:disabled="disabled" :disabled="disabled"
class="box-input" class="box-input"
@@ -81,9 +81,12 @@
</div> </div>
</a-col> </a-col>
</a-row> </a-row>
<defaultTemplate v-if="formInline.contentTemplate == 1"/> <defaultTemplate :formInlineQuery="formInline" ref="defaultTemplateRef"
<solicitOpinions v-else-if="formInline.contentTemplate == 2"/> v-if="formInline.contentTemplate == '1'"/>
<releaseStandard v-else-if="formInline.contentTemplate == 3"/> <solicitOpinions :formInlineQuery="formInline " ref="solicitOpinionsRef"
v-else-if="formInline.contentTemplate == '2'"/>
<releaseStandard :formInlineQuery="formInline" ref="releaseStandardRef"
v-else-if="formInline.contentTemplate == '3'"/>
</a-form-model> </a-form-model>
</a-spin> </a-spin>
<div class="drawer-bootom-button"> <div class="drawer-bootom-button">
@@ -98,6 +101,7 @@
import defaultTemplate from './defaultTemplate' import defaultTemplate from './defaultTemplate'
import solicitOpinions from './solicitOpinions' import solicitOpinions from './solicitOpinions'
import releaseStandard from './releaseStandard' import releaseStandard from './releaseStandard'
import { getAction, postAction, downloadFile } from '@/api/manage'
export default { export default {
name: 'fillAdd', name: 'fillAdd',
@@ -109,28 +113,25 @@
data() { data() {
return { return {
rules: { rules: {
name: [ month: [
{ {
required: true, required: true,
message: this.$t('VirtualListName') + this.$t('cannotEmpty'), message: this.$t('fillInTheMonth') + this.$t('cannotEmpty'),
trigger: 'blur' trigger: 'change'
},
{
max: 100,
message: this.$t('VirtualListName') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur'
} }
], ],
useExplain: [ memoriesChapter: [
{ {
required: true, required: true,
message: this.$t('instructionForUse') + this.$t('cannotEmpty'), message: this.$t('chapterContents') + this.$t('cannotEmpty'),
trigger: 'blur' trigger: 'change'
}, }
],
contentTemplate: [
{ {
max: 500, required: true,
message: this.$t('instructionForUse') + this.$t('cannotExceed') + 500 + this.$t('Characters'), message: this.$t('contentTemplate') + this.$t('cannotEmpty'),
trigger: 'blur' trigger: 'change'
} }
] ]
}, },
@@ -142,40 +143,66 @@
chapterContentsList: [], chapterContentsList: [],
contentTemplateList: [ contentTemplateList: [
{ {
id: 1, id: '1',
text: '默认模板' text: this.$t('defaultTemplate')
}, },
{ {
id: 2, id: '2',
text: '新征求意见清单模板' text: this.$t('newRequestCommentListTemplate')
}, },
{ {
id: 3, id: '3',
text: '新发布标准模板' text: this.$t('NewReleasedStandardTemplate')
} }
] ],
url: {
add: '/report/lawsMonthlyReportWriteEO/add',
edit: '/report/lawsMonthlyReportWriteEO/edit',
queryById: '/report/lawsMonthlyReportWriteEO/queryById'
}
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
getTree() {
let query = {
pageNo: this.pageNo,
pageSize: 1000
}
getAction('/report/lawsMonthlyReportTitleTemplateEO/page', query).then((res) => {
if (res.success) {
this.chapterContentsList = res.result.records || []
this.chapterContentsList.forEach(res => {
})
} else {
this.chapterContentsList = []
}
})
},
add() { add() {
this.getTree()
this.title = this.$t('addContent') this.title = this.$t('addContent')
this.visible = true this.visible = true
this.disabled = false this.disabled = false
this.$nextTick(() => { this.$nextTick(() => {
this.formInline = {} this.formInline = {}
this.formInline.contentTemplate = 1 this.formInline.contentTemplate = '1'
this.formInline = { ...this.formInline } this.formInline = { ...this.formInline }
this.$refs.ruleForm.clearValidate() this.$refs.ruleForm.clearValidate()
}) })
}, },
edit(row) { edit(row) {
this.getTree()
this.title = this.$t('editContent') this.title = this.$t('editContent')
this.visible = true this.visible = true
this.disabled = false this.disabled = false
this.$nextTick(() => { this.$nextTick(() => {
this.formInline = row this.formInline = row
if (this.formInline.memoriesChapter) {
this.formInline.memoriesChapter = this.formInline.memoriesChapter.split(',')
}
this.$refs.ruleForm.clearValidate() this.$refs.ruleForm.clearValidate()
}) })
}, },
@@ -192,7 +219,50 @@
this.visible = false this.visible = false
}, },
handleSubmit() { handleSubmit() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
let text = ''
if (this.$refs.defaultTemplateRef) {
text = 'defaultTemplateRef'
} else if (this.$refs.solicitOpinionsRef) {
text = 'solicitOpinionsRef'
} else if (this.$refs.releaseStandardRef) {
text = 'releaseStandardRef'
}
this.$refs[text].getData((val) => {
this.confirmLoading = true
let url = ''
if (this.formInline.id) {
url = this.url.edit
} else {
url = this.url.add
}
let formInline = JSON.parse(JSON.stringify(this.formInline))
Object.keys(formInline).forEach(res => {
if (formInline[res] && formInline[res] instanceof Array) {
formInline[res] = formInline[res].join(',')
}
})
let query = Object.assign(val, {
month: formInline.month,
memoriesChapter: formInline.memoriesChapter,
contentTemplate: formInline.contentTemplate
})
postAction(url, query).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.confirmLoading = false
this.$emit('fillTableAddForm')
} else {
this.confirmLoading = false
this.$message.warning(this.$t('operationFailed'))
}
})
})
}
})
} }
} }
} }
@@ -53,8 +53,8 @@
<a-select-option v-for="(item, key) in ParentList" <a-select-option v-for="(item, key) in ParentList"
:key="item.id" :key="item.id"
:value="item.id"> :value="item.id">
<span style="display: inline-block;width: 100%" :title="item.title "> <span style="display: inline-block;width: 100%" :title="item.titleCn ">
{{ item.title }} {{ item.titleCn }}
</span> </span>
</a-select-option> </a-select-option>
</a-select> </a-select>
@@ -21,7 +21,7 @@
<a-form-model-item class="itemModel" prop="standardNo"> <a-form-model-item class="itemModel" prop="standardNo">
<a-input class="box-input" <a-input class="box-input"
:disabled="false" :disabled="false"
v-model="formInline.standardNo" v-model="formInline.standardNumber"
:placeholder="$t('PleaseEnter')+$t('standardNo')"/> :placeholder="$t('PleaseEnter')+$t('standardNo')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -63,10 +63,10 @@
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel">
<a-date-picker class="box-input" <a-date-picker class="box-input"
:placeholder="$t('PleaseSelect')+$t('releaseDate')" :placeholder="$t('PleaseSelect')+$t('releaseDate')"
@change="dateChange('releaseDate')" @change="dateChange('issueTime',index)"
:getCalendarContainer="(trigger) => trigger.parentNode" :getCalendarContainer="(trigger) => trigger.parentNode"
format="YYYY-MM-DD" format="YYYY-MM-DD"
v-model="formInline['releaseDate']" v-model="formInline['issueTime']"
:disabled="disabled" :disabled="disabled"
style="width: 100%"/> style="width: 100%"/>
</a-form-model-item> </a-form-model-item>
@@ -82,10 +82,10 @@
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel">
<a-date-picker class="box-input" <a-date-picker class="box-input"
:placeholder="$t('PleaseSelect')+$t('implemenDate')" :placeholder="$t('PleaseSelect')+$t('implemenDate')"
@change="dateChange('implemenDate')" @change="dateChange('implementTime',index)"
:getCalendarContainer="(trigger) => trigger.parentNode" :getCalendarContainer="(trigger) => trigger.parentNode"
format="YYYY-MM-DD" format="YYYY-MM-DD"
v-model="formInline['implemenDate']" v-model="formInline['implementTime']"
:disabled="disabled" :disabled="disabled"
style="width: 100%"/> style="width: 100%"/>
</a-form-model-item> </a-form-model-item>
@@ -101,19 +101,34 @@
export default { export default {
name: 'releaseStandard', name: 'releaseStandard',
props:['formInlineQuery'],
data() { data() {
return { return {
rules: {}, rules: {},
formInline: {}, formInline: {},
CategoryTreeList: [], CategoryTreeList: [],
disabled: false, disabled: false,
dataList: [ dataList: []
{ id: 1 }
]
} }
}, },
mounted() { mounted() {
this.$nextTick(() => {
if (this.formInlineQuery.id) {
this.formInline = JSON.parse(JSON.stringify(this.formInlineQuery))
this.formInline = { ...this.formInline }
} else {
this.dataList = [
{
standardNumber: '',
standardNameCn: '',
standardNameEn: '',
issueTime: '',
implementTime:'',
}
]
this.dataList = [...this.dataList]
}
})
}, },
methods: { methods: {
handleInput(value) { handleInput(value) {
@@ -124,7 +139,11 @@
}, },
addData() { addData() {
this.dataList.push({ this.dataList.push({
id: 2 standardNumber: '',
standardNameCn: '',
standardNameEn: '',
issueTime: '',
implementTime:'',
}) })
this.dataList = [...this.dataList] this.dataList = [...this.dataList]
}, },
@@ -133,7 +152,14 @@
this.dataList = [...this.dataList] this.dataList = [...this.dataList]
}, },
dateChange(item) { dateChange(item) {
this.formInline[item] = this.formInline[item] ? moment(this.formInline[item]).format('YYYY-MM-DD') : '' this.dataList[index][item] = this.dataList[index][item] ? moment(this.dataList[index][item]).format('YYYY-MM-DD') : ''
},
getData(callback) {
this.$refs.ruleForm.validate(valid => {
if (valid) {
callback && callback(this.formInline)
}
})
} }
} }
} }
@@ -21,7 +21,7 @@
<a-form-model-item class="itemModel" prop="planNoChinese"> <a-form-model-item class="itemModel" prop="planNoChinese">
<a-input class="box-input" <a-input class="box-input"
:disabled="false" :disabled="false"
v-model="formInline.planNoChinese" v-model="item.planNumberCn"
:placeholder="$t('PleaseEnter')+$t('planNoChinese')"/> :placeholder="$t('PleaseEnter')+$t('planNoChinese')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -35,7 +35,7 @@
<a-form-model-item class="itemModel" prop="standardNameCn"> <a-form-model-item class="itemModel" prop="standardNameCn">
<a-input class="box-input" <a-input class="box-input"
:disabled="false" :disabled="false"
v-model="formInline.standardNameCn" v-model="item.standardNameCn"
:placeholder="$t('PleaseEnter')+$t('standardNameCn')"/> :placeholder="$t('PleaseEnter')+$t('standardNameCn')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -50,7 +50,7 @@
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel">
<a-input class="box-input" <a-input class="box-input"
:disabled="false" :disabled="false"
v-model="formInline.standardNameEn" v-model="item.standardNameEn"
:placeholder="$t('PleaseEnter')+$t('standardNameEn')"/> :placeholder="$t('PleaseEnter')+$t('standardNameEn')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -63,10 +63,10 @@
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel">
<a-date-picker class="box-input" <a-date-picker class="box-input"
:placeholder="$t('PleaseSelect')+$t('deadlineForComments')" :placeholder="$t('PleaseSelect')+$t('deadlineForComments')"
@change="dateChange('deadlineForComments')" @change="dateChange('expirationDate',index)"
:getCalendarContainer="(trigger) => trigger.parentNode" :getCalendarContainer="(trigger) => trigger.parentNode"
format="YYYY-MM-DD" format="YYYY-MM-DD"
v-model="formInline['deadlineForComments']" v-model="item['expirationDate']"
:disabled="disabled" :disabled="disabled"
style="width: 100%"/> style="width: 100%"/>
</a-form-model-item> </a-form-model-item>
@@ -82,19 +82,33 @@
export default { export default {
name: 'solicitOpinions', name: 'solicitOpinions',
props: ['formInlineQuery'],
data() { data() {
return { return {
rules: {}, rules: {},
formInline: {}, formInline: {},
CategoryTreeList: [], CategoryTreeList: [],
disabled: false, disabled: false,
dataList: [ dataList: []
{ id: 1 }
]
} }
}, },
mounted() { mounted() {
this.$nextTick(() => {
if (this.formInlineQuery.id) {
this.formInline = JSON.parse(JSON.stringify(this.formInlineQuery))
this.formInline = { ...this.formInline }
} else {
this.dataList = [
{
planNumberCn: '',
standardNameCn: '',
standardNameEn: '',
expirationDate: ''
}
]
this.dataList = [...this.dataList]
}
})
}, },
methods: { methods: {
handleInput(value) { handleInput(value) {
@@ -105,7 +119,10 @@
}, },
addData() { addData() {
this.dataList.push({ this.dataList.push({
id: 2 planNumberCn: '',
standardNameCn: '',
standardNameEn: '',
expirationDate: ''
}) })
this.dataList = [...this.dataList] this.dataList = [...this.dataList]
}, },
@@ -113,8 +130,15 @@
this.dataList.pop() this.dataList.pop()
this.dataList = [...this.dataList] this.dataList = [...this.dataList]
}, },
dateChange(item) { dateChange(item, index) {
this.formInline[item] = this.formInline[item] ? moment(this.formInline[item]).format('YYYY-MM-DD') : '' this.dataList[index][item] = this.dataList[index][item] ? moment(this.dataList[index][item]).format('YYYY-MM-DD') : ''
},
getData(callback) {
this.$refs.ruleForm.validate(valid => {
if (valid) {
callback && callback(this.formInline)
}
})
} }
} }
} }