[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.getForm()
},
edit (item) {
edit (item, callback) {
this.loading = true
this.getForm(() => {
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 treeMultipleField = formList.filter(tt => tt.fieldShowType === FieldType.TREE.value)
this.formInline = res.result
callback && callback(this.formInline)
treeMultipleField.forEach(field => {
const valueArr = []
if (this.formInline[field.dbFieldName]) {
@@ -84,7 +84,7 @@
<div class="detail-page-part-title">
<span>稽查内容</span>
</div>
<div class=detail-page-part-table>
<div class="detail-page-part-table">
<a-table
:scroll="{x: 500}"
:columns="columns"
@@ -159,13 +159,13 @@ export default {
title: this.$t('enterpriseStandardLibrary.standard.subjectToClause'),
align: 'center',
width: 200,
dataIndex: 'subjectToClause',
dataIndex: 'clause',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('enterpriseStandardLibrary.standard.standardContentOrRequirements'),
align: 'center',
dataIndex: 'standardContentOrRequirements',
dataIndex: 'requirement',
scopedSlots: { customRender: 'text' }
}
], // 稽查内容表格列参数
@@ -203,6 +203,7 @@ export default {
getEnterpriseStandardInfoById(params).then(res => {
if (res.success) {
this.detailData = res.result
this.dataSource = this.detailData.checkList
this.fileField.forEach(item => {
if (this.detailData[item]) {
const fileList = this.detailData[item].split(',')
@@ -20,12 +20,12 @@
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('enterpriseStandardLibrary.standard.subjectToClause')">
<a-input :placeholder="$t('pleaseEnter') + $t('enterpriseStandardLibrary.standard.subjectToClause')"
:maxLength="50"
v-decorator.trim="[ 'subjectToClause', validatorRules.subjectToClause ]" />
v-decorator.trim="[ 'clause', validatorRules.clause ]" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('enterpriseStandardLibrary.standard.standardContentOrRequirements')">
<a-input :placeholder="$t('pleaseEnter') + $t('enterpriseStandardLibrary.standard.standardContentOrRequirements')"
:maxLength="50"
v-decorator.trim="[ 'standardContentOrRequirements', validatorRules.standardContentOrRequirements ]" />
v-decorator.trim="[ 'requirement', validatorRules.requirement ]" />
</a-form-item>
</a-form>
</a-spin>
@@ -58,13 +58,13 @@ export default {
sm: { span: 16 }
},
validatorRules: {
subjectToClause: {
clause: {
rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('enterpriseStandardLibrary.standard.subjectToClause') }
],
validateTrigger: 'blur'
},
standardContentOrRequirements: {
requirement: {
rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('enterpriseStandardLibrary.standard.standardContentOrRequirements') }
],
@@ -92,7 +92,7 @@ export default {
this.form.resetFields()
this.model = Object.assign({}, record)
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'subjectToClause', 'standardContentOrRequirements'))
this.form.setFieldsValue(pick(this.model, 'clause', 'requirement'))
})
},
getFileInfo (fileId) {
@@ -115,6 +115,7 @@ export default {
close () {
this.visible = false
this.model = {}
this.index = undefined
},
handleCancel () {
this.close()
@@ -87,14 +87,14 @@ export default {
title: this.$t('enterpriseStandardLibrary.standard.subjectToClause'),
align: 'center',
width: 180,
dataIndex: 'subjectToClause',
dataIndex: 'clause',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('enterpriseStandardLibrary.standard.standardContentOrRequirements'),
align: 'center',
width: 180,
dataIndex: 'standardContentOrRequirements',
dataIndex: 'requirement',
scopedSlots: { customRender: 'text' }
},
{
@@ -124,7 +124,9 @@ export default {
this.visible = true
this.type = 'edit'
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
}
const param = Object.assign({}, formInline)
// param.checkList = this.dataSource
param.checkList = this.dataSource
postAction(url, param).then((res) => {
if (res.success) {
this.$message.success(this.$t('operationSuccessful'))
@@ -193,6 +195,7 @@ export default {
},
close () {
this.visible = false
this.dataSource = []
this.$refs.addForm.clearValidate()
}
}