diff --git a/src/components/customField/AddForm.vue b/src/components/customField/AddForm.vue index 2f7ad0e3..bb837871 100644 --- a/src/components/customField/AddForm.vue +++ b/src/components/customField/AddForm.vue @@ -763,8 +763,7 @@ export default { */ handleDomesticSpecialCheck () { if (this.domesticSpecialCheck) { - const fieldNameList = ['part_name', 'applicable_certification', 'applicable_vehicle'] - const fieldNameListOpposite = ['responsible_department'] // “推荐性”标准性质 下时, 责任部门改为非必填 + const fieldNameList = ['part_name', 'applicable_certification', 'applicable_vehicle', 'responsible_department'] const rules = JSON.parse(JSON.stringify(this.rules)) if (this.formInline.standard_property === StandardProperty.admittance.value) { fieldNameList.forEach(key => { @@ -775,14 +774,6 @@ export default { this.dataList[dataPart][index].fieldMustInput = '1' } }) - fieldNameListOpposite.forEach(key => { - if (rules[key] && rules[key].length > 0) { - rules[key][0].required = false - const dataPart = Object.keys(this.dataList).find(tt => this.dataList[tt].some(item => item.dbFieldName === key)) - const index = this.dataList[dataPart].findIndex(tt => tt.dbFieldName === key) - this.dataList[dataPart][index].fieldMustInput = '0' - } - }) } else { fieldNameList.forEach(key => { if (rules[key] && rules[key].length > 0) { @@ -792,14 +783,6 @@ export default { this.dataList[dataPart][index].fieldMustInput = '0' } }) - fieldNameListOpposite.forEach(key => { - if (rules[key] && rules[key].length > 0) { - rules[key][0].required = true - const dataPart = Object.keys(this.dataList).find(tt => this.dataList[tt].some(item => item.dbFieldName === key)) - const index = this.dataList[dataPart].findIndex(tt => tt.dbFieldName === key) - this.dataList[dataPart][index].fieldMustInput = '1' - } - }) } this.rules = Object.assign({}, rules) this.clearValidate(fieldNameList) diff --git a/src/views/workCenter/standardEntryOrChangeProcess/StandardEntryOrChangeProcess.vue b/src/views/workCenter/standardEntryOrChangeProcess/StandardEntryOrChangeProcess.vue index 318db560..96042233 100644 --- a/src/views/workCenter/standardEntryOrChangeProcess/StandardEntryOrChangeProcess.vue +++ b/src/views/workCenter/standardEntryOrChangeProcess/StandardEntryOrChangeProcess.vue @@ -1179,8 +1179,7 @@ export default { * 国内的特殊处理 */ handleDomesticSpecialCheck () { - const fieldNameList = ['part_name', 'applicable_certification', 'applicable_vehicle'] - const fieldNameListOpposite = ['responsible_department'] // “推荐性”标准性质 下时, 责任部门改为非必填 + const fieldNameList = ['part_name', 'applicable_certification', 'applicable_vehicle', 'responsible_department'] const rules = JSON.parse(JSON.stringify(this.rules)) if (this.formInline.standard_property === StandardProperty.admittance.value) { fieldNameList.forEach(key => { @@ -1191,14 +1190,6 @@ export default { this.formList[dataPart][index].fieldMustInput = '1' } }) - fieldNameListOpposite.forEach(key => { - if (rules[key] && rules[key].length > 0) { - rules[key][0].required = false - const dataPart = Object.keys(this.formList).find(tt => this.formList[tt].some(item => item.dbFieldName === key)) - const index = this.formList[dataPart].findIndex(tt => tt.dbFieldName === key) - this.formList[dataPart][index].fieldMustInput = '0' - } - }) } else { fieldNameList.forEach(key => { if (rules[key] && rules[key].length > 0) { @@ -1208,14 +1199,6 @@ export default { this.formList[dataPart][index].fieldMustInput = '0' } }) - fieldNameListOpposite.forEach(key => { - if (rules[key] && rules[key].length > 0) { - rules[key][0].required = true - const dataPart = Object.keys(this.formList).find(tt => this.formList[tt].some(item => item.dbFieldName === key)) - const index = this.formList[dataPart].findIndex(tt => tt.dbFieldName === key) - this.formList[dataPart][index].fieldMustInput = '1' - } - }) } this.rules = Object.assign({}, rules) this.$refs.ruleForm.clearValidate(fieldNameList)