标准性质为准入性时,责任部门改为非必填 国内标准页面和标准法规入库流程页面
This commit is contained in:
@@ -764,6 +764,7 @@ export default {
|
|||||||
handleDomesticSpecialCheck () {
|
handleDomesticSpecialCheck () {
|
||||||
if (this.domesticSpecialCheck) {
|
if (this.domesticSpecialCheck) {
|
||||||
const fieldNameList = ['part_name', 'applicable_certification', 'applicable_vehicle']
|
const fieldNameList = ['part_name', 'applicable_certification', 'applicable_vehicle']
|
||||||
|
const fieldNameListOpposite = ['responsible_department'] // “推荐性”标准性质 下时, 责任部门改为非必填
|
||||||
const rules = JSON.parse(JSON.stringify(this.rules))
|
const rules = JSON.parse(JSON.stringify(this.rules))
|
||||||
if (this.formInline.standard_property === StandardProperty.admittance.value) {
|
if (this.formInline.standard_property === StandardProperty.admittance.value) {
|
||||||
fieldNameList.forEach(key => {
|
fieldNameList.forEach(key => {
|
||||||
@@ -774,6 +775,14 @@ export default {
|
|||||||
this.dataList[dataPart][index].fieldMustInput = '1'
|
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 {
|
} else {
|
||||||
fieldNameList.forEach(key => {
|
fieldNameList.forEach(key => {
|
||||||
if (rules[key] && rules[key].length > 0) {
|
if (rules[key] && rules[key].length > 0) {
|
||||||
@@ -783,6 +792,14 @@ export default {
|
|||||||
this.dataList[dataPart][index].fieldMustInput = '0'
|
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.rules = Object.assign({}, rules)
|
||||||
this.clearValidate(fieldNameList)
|
this.clearValidate(fieldNameList)
|
||||||
|
|||||||
@@ -1180,6 +1180,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
handleDomesticSpecialCheck () {
|
handleDomesticSpecialCheck () {
|
||||||
const fieldNameList = ['part_name', 'applicable_certification', 'applicable_vehicle']
|
const fieldNameList = ['part_name', 'applicable_certification', 'applicable_vehicle']
|
||||||
|
const fieldNameListOpposite = ['responsible_department'] // “推荐性”标准性质 下时, 责任部门改为非必填
|
||||||
const rules = JSON.parse(JSON.stringify(this.rules))
|
const rules = JSON.parse(JSON.stringify(this.rules))
|
||||||
if (this.formInline.standard_property === StandardProperty.admittance.value) {
|
if (this.formInline.standard_property === StandardProperty.admittance.value) {
|
||||||
fieldNameList.forEach(key => {
|
fieldNameList.forEach(key => {
|
||||||
@@ -1190,6 +1191,14 @@ export default {
|
|||||||
this.formList[dataPart][index].fieldMustInput = '1'
|
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 {
|
} else {
|
||||||
fieldNameList.forEach(key => {
|
fieldNameList.forEach(key => {
|
||||||
if (rules[key] && rules[key].length > 0) {
|
if (rules[key] && rules[key].length > 0) {
|
||||||
@@ -1199,6 +1208,14 @@ export default {
|
|||||||
this.formList[dataPart][index].fieldMustInput = '0'
|
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.rules = Object.assign({}, rules)
|
||||||
this.$refs.ruleForm.clearValidate(fieldNameList)
|
this.$refs.ruleForm.clearValidate(fieldNameList)
|
||||||
|
|||||||
Reference in New Issue
Block a user