[update] 联调企标新增编辑和详情的稽查内容

This commit is contained in:
lideqin
2023-09-26 10:14:31 +08:00
parent 0a84ffb3e4
commit 7821fde0a9
4 changed files with 19 additions and 13 deletions
+2 -1
View File
@@ -376,7 +376,7 @@ export default {
this.$forceUpdate() this.$forceUpdate()
this.getForm() this.getForm()
}, },
edit (item) { edit (item, callback) {
this.loading = true this.loading = true
this.getForm(() => { this.getForm(() => {
if (!this.getDocumentInfoFunc || typeof this.getDocumentInfoFunc !== 'function') { if (!this.getDocumentInfoFunc || typeof this.getDocumentInfoFunc !== 'function') {
@@ -390,6 +390,7 @@ export default {
const formList = Object.values(this.dataList).reduce((acc, cur) => acc.concat(cur), []) const formList = Object.values(this.dataList).reduce((acc, cur) => acc.concat(cur), [])
const treeMultipleField = formList.filter(tt => tt.fieldShowType === FieldType.TREE.value) const treeMultipleField = formList.filter(tt => tt.fieldShowType === FieldType.TREE.value)
this.formInline = res.result this.formInline = res.result
callback && callback(this.formInline)
treeMultipleField.forEach(field => { treeMultipleField.forEach(field => {
const valueArr = [] const valueArr = []
if (this.formInline[field.dbFieldName]) { if (this.formInline[field.dbFieldName]) {
@@ -84,7 +84,7 @@
<div class="detail-page-part-title"> <div class="detail-page-part-title">
<span>稽查内容</span> <span>稽查内容</span>
</div> </div>
<div class=“detail-page-part-table> <div class="detail-page-part-table">
<a-table <a-table
:scroll="{x: 500}" :scroll="{x: 500}"
:columns="columns" :columns="columns"
@@ -159,13 +159,13 @@ export default {
title: this.$t('enterpriseStandardLibrary.standard.subjectToClause'), title: this.$t('enterpriseStandardLibrary.standard.subjectToClause'),
align: 'center', align: 'center',
width: 200, width: 200,
dataIndex: 'subjectToClause', dataIndex: 'clause',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ {
title: this.$t('enterpriseStandardLibrary.standard.standardContentOrRequirements'), title: this.$t('enterpriseStandardLibrary.standard.standardContentOrRequirements'),
align: 'center', align: 'center',
dataIndex: 'standardContentOrRequirements', dataIndex: 'requirement',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
} }
], // 稽查内容表格列参数 ], // 稽查内容表格列参数
@@ -203,6 +203,7 @@ export default {
getEnterpriseStandardInfoById(params).then(res => { getEnterpriseStandardInfoById(params).then(res => {
if (res.success) { if (res.success) {
this.detailData = res.result this.detailData = res.result
this.dataSource = this.detailData.checkList
this.fileField.forEach(item => { this.fileField.forEach(item => {
if (this.detailData[item]) { if (this.detailData[item]) {
const fileList = this.detailData[item].split(',') const fileList = this.detailData[item].split(',')
@@ -20,12 +20,12 @@
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('enterpriseStandardLibrary.standard.subjectToClause')"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('enterpriseStandardLibrary.standard.subjectToClause')">
<a-input :placeholder="$t('pleaseEnter') + $t('enterpriseStandardLibrary.standard.subjectToClause')" <a-input :placeholder="$t('pleaseEnter') + $t('enterpriseStandardLibrary.standard.subjectToClause')"
:maxLength="50" :maxLength="50"
v-decorator.trim="[ 'subjectToClause', validatorRules.subjectToClause ]" /> v-decorator.trim="[ 'clause', validatorRules.clause ]" />
</a-form-item> </a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('enterpriseStandardLibrary.standard.standardContentOrRequirements')"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('enterpriseStandardLibrary.standard.standardContentOrRequirements')">
<a-input :placeholder="$t('pleaseEnter') + $t('enterpriseStandardLibrary.standard.standardContentOrRequirements')" <a-input :placeholder="$t('pleaseEnter') + $t('enterpriseStandardLibrary.standard.standardContentOrRequirements')"
:maxLength="50" :maxLength="50"
v-decorator.trim="[ 'standardContentOrRequirements', validatorRules.standardContentOrRequirements ]" /> v-decorator.trim="[ 'requirement', validatorRules.requirement ]" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-spin> </a-spin>
@@ -58,13 +58,13 @@ export default {
sm: { span: 16 } sm: { span: 16 }
}, },
validatorRules: { validatorRules: {
subjectToClause: { clause: {
rules: [ rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('enterpriseStandardLibrary.standard.subjectToClause') } { required: true, message: this.$t('pleaseEnter') + this.$t('enterpriseStandardLibrary.standard.subjectToClause') }
], ],
validateTrigger: 'blur' validateTrigger: 'blur'
}, },
standardContentOrRequirements: { requirement: {
rules: [ rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('enterpriseStandardLibrary.standard.standardContentOrRequirements') } { required: true, message: this.$t('pleaseEnter') + this.$t('enterpriseStandardLibrary.standard.standardContentOrRequirements') }
], ],
@@ -92,7 +92,7 @@ export default {
this.form.resetFields() this.form.resetFields()
this.model = Object.assign({}, record) this.model = Object.assign({}, record)
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'subjectToClause', 'standardContentOrRequirements')) this.form.setFieldsValue(pick(this.model, 'clause', 'requirement'))
}) })
}, },
getFileInfo (fileId) { getFileInfo (fileId) {
@@ -115,6 +115,7 @@ export default {
close () { close () {
this.visible = false this.visible = false
this.model = {} this.model = {}
this.index = undefined
}, },
handleCancel () { handleCancel () {
this.close() this.close()
@@ -87,14 +87,14 @@ export default {
title: this.$t('enterpriseStandardLibrary.standard.subjectToClause'), title: this.$t('enterpriseStandardLibrary.standard.subjectToClause'),
align: 'center', align: 'center',
width: 180, width: 180,
dataIndex: 'subjectToClause', dataIndex: 'clause',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ {
title: this.$t('enterpriseStandardLibrary.standard.standardContentOrRequirements'), title: this.$t('enterpriseStandardLibrary.standard.standardContentOrRequirements'),
align: 'center', align: 'center',
width: 180, width: 180,
dataIndex: 'standardContentOrRequirements', dataIndex: 'requirement',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ {
@@ -124,7 +124,9 @@ export default {
this.visible = true this.visible = true
this.type = 'edit' this.type = 'edit'
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addForm.edit(record) this.$refs.addForm.edit(record, (res) => {
this.dataSource = res.checkList
})
}) })
}, },
// 稽查内容的添加 // 稽查内容的添加
@@ -175,7 +177,7 @@ export default {
url = this.url.add url = this.url.add
} }
const param = Object.assign({}, formInline) const param = Object.assign({}, formInline)
// param.checkList = this.dataSource param.checkList = this.dataSource
postAction(url, param).then((res) => { postAction(url, param).then((res) => {
if (res.success) { if (res.success) {
this.$message.success(this.$t('operationSuccessful')) this.$message.success(this.$t('operationSuccessful'))
@@ -193,6 +195,7 @@ export default {
}, },
close () { close () {
this.visible = false this.visible = false
this.dataSource = []
this.$refs.addForm.clearValidate() this.$refs.addForm.clearValidate()
} }
} }