[update] 修改bug87602
This commit is contained in:
@@ -60,19 +60,19 @@ export default {
|
||||
validatorRules: {
|
||||
clause: {
|
||||
rules: [
|
||||
{ required: true, message: this.$t('pleaseEnter') + this.$t('enterpriseStandardLibrary.standard.subjectToClause') }
|
||||
{ required: false, message: this.$t('pleaseEnter') + this.$t('enterpriseStandardLibrary.standard.subjectToClause') }
|
||||
],
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
rectificationDepartment: {
|
||||
rules: [
|
||||
{ required: true, message: this.$t('pleaseSelect') + this.$t('enterpriseStandardLibrary.standard.rectificationDepartment') }
|
||||
{ required: false, message: this.$t('pleaseSelect') + this.$t('enterpriseStandardLibrary.standard.rectificationDepartment') }
|
||||
],
|
||||
validateTrigger: 'change'
|
||||
},
|
||||
requirement: {
|
||||
rules: [
|
||||
{ required: true, message: this.$t('pleaseEnter') + this.$t('enterpriseStandardLibrary.standard.standardContentOrRequirements') }
|
||||
{ required: false, message: this.$t('pleaseEnter') + this.$t('enterpriseStandardLibrary.standard.standardContentOrRequirements') }
|
||||
],
|
||||
validateTrigger: 'blur'
|
||||
}
|
||||
@@ -91,7 +91,7 @@ export default {
|
||||
this.form.resetFields()
|
||||
this.model = Object.assign({}, record)
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model, 'clause', 'requirement'))
|
||||
this.form.setFieldsValue(pick(this.model, 'clause', 'rectificationDepartment', 'requirement'))
|
||||
})
|
||||
},
|
||||
// 整改部门返回
|
||||
|
||||
@@ -182,9 +182,18 @@ export default {
|
||||
console.log(value, index)
|
||||
if (index || index === 0) {
|
||||
// 有下标,说明是编辑
|
||||
this.dataSource.splice(index, 1, value)
|
||||
if (!value.clause && !value.rectificationDepartment && !value.requirement) {
|
||||
// 三个字段都没有数据,删除该行
|
||||
this.dataSource.splice(index, 1)
|
||||
} else {
|
||||
this.dataSource.splice(index, 1, value)
|
||||
}
|
||||
} else {
|
||||
// 没有下标, 是新增
|
||||
if (!value.clause && !value.rectificationDepartment && !value.requirement) {
|
||||
// 三个字段都没有数据不新增
|
||||
return
|
||||
}
|
||||
this.dataSource.push(value)
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user