bug 77990
This commit is contained in:
@@ -153,7 +153,7 @@ import JMultiSelectTag from '../dict/JMultiSelectTag'
|
|||||||
import UploadFile from '../UploadFile'
|
import UploadFile from '../UploadFile'
|
||||||
// 选择标准选择器
|
// 选择标准选择器
|
||||||
import StandardSelection from '../selection/StandardSelection'
|
import StandardSelection from '../selection/StandardSelection'
|
||||||
import { FieldType } from '../../enums/commonEnums'
|
import { FieldType, StandardProperty } from '../../enums/commonEnums'
|
||||||
import JMultipleDatePicker from '../JMultipleDatePicker'
|
import JMultipleDatePicker from '../JMultipleDatePicker'
|
||||||
import UserSelection from '../selection/UserSelection'
|
import UserSelection from '../selection/UserSelection'
|
||||||
import { getAction } from '../../api/manage.js'
|
import { getAction } from '../../api/manage.js'
|
||||||
@@ -256,6 +256,12 @@ export default {
|
|||||||
default: () => {
|
default: () => {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
// 是否需要进行国内标准的特殊校验
|
||||||
|
domesticSpecialCheck: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
@@ -274,6 +280,12 @@ export default {
|
|||||||
excludeStandardNumbers: '' // 不包含的标准号
|
excludeStandardNumbers: '' // 不包含的标准号
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
// 国内、海外的零部件名称、适用认证、适用车型和标准性质关联,准入标准必填,非准入标准不必填
|
||||||
|
'formInline.standard_property' () {
|
||||||
|
this.handleDomesticSpecialCheck()
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
add () {
|
add () {
|
||||||
this.formInline = Object.assign({}, this.defaultValue)
|
this.formInline = Object.assign({}, this.defaultValue)
|
||||||
@@ -316,7 +328,7 @@ export default {
|
|||||||
|
|
||||||
// 处理标准选择不能选自己
|
// 处理标准选择不能选自己
|
||||||
this.excludeStandardNumbers = this.formInline[this.excludeStandardValFormFields]
|
this.excludeStandardNumbers = this.formInline[this.excludeStandardValFormFields]
|
||||||
console.log('11111111111111', this.excludeStandardNumbers, this.excludeStandardFields)
|
this.handleDomesticSpecialCheck()
|
||||||
this.loading = false
|
this.loading = false
|
||||||
} else {
|
} else {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
@@ -459,6 +471,36 @@ export default {
|
|||||||
},
|
},
|
||||||
clearValidate () {
|
clearValidate () {
|
||||||
this.$refs.ruleForm.clearValidate()
|
this.$refs.ruleForm.clearValidate()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 国内海外的特殊处理
|
||||||
|
*/
|
||||||
|
handleDomesticSpecialCheck () {
|
||||||
|
if (this.domesticSpecialCheck) {
|
||||||
|
const fieldNameList = ['part_name', 'applicable_certification', 'applicable_vehicle']
|
||||||
|
const rules = JSON.parse(JSON.stringify(this.rules))
|
||||||
|
if (this.formInline.standard_property === StandardProperty.admittance.value) {
|
||||||
|
fieldNameList.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'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
fieldNameList.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'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.rules = Object.assign({}, rules)
|
||||||
|
this.clearValidate()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,3 +118,9 @@ export const InventoryType = {
|
|||||||
SPECIALTY: { text: '特点', value: '1' },
|
SPECIALTY: { text: '特点', value: '1' },
|
||||||
COMPARISON_ITEM: { text: '对比项', value: '2' }
|
COMPARISON_ITEM: { text: '对比项', value: '2' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 标准性质
|
||||||
|
export const StandardProperty = {
|
||||||
|
admittance: { text: '准入性', value: 'SN001' },
|
||||||
|
recommendation: { text: '推荐性', value: 'SN002' }
|
||||||
|
}
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
:default-value="defaultValue"
|
:default-value="defaultValue"
|
||||||
:disabled-field-list="disabledField"
|
:disabled-field-list="disabledField"
|
||||||
:exclude-standard-fields="excludeStandardFields"
|
:exclude-standard-fields="excludeStandardFields"
|
||||||
|
domestic-special-check
|
||||||
@submitFormData="submitFormData" />
|
@submitFormData="submitFormData" />
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user