Commit e9da982d authored by jingnan's avatar jingnan 👀

阿洛丁牌号带出并下拉

parent 19703862
<template> <template>
<div> <div>
<el-select <el-select
v-if="['certificateNo','modelNo','certificateNum'].includes(itemObj.attrKey)" v-if="['certificateNo','modelNo','certificateNum','baseModelNo'].includes(itemObj.attrKey)"
v-model="form[itemObj.attrKey]" v-model="form[itemObj.attrKey]"
filterable filterable
remote remote
...@@ -76,7 +76,8 @@ export default { ...@@ -76,7 +76,8 @@ export default {
typeEnum: { typeEnum: {
AssignCardPaint: 'ShellacCardPaint', AssignCardPaint: 'ShellacCardPaint',
AssignCardLacquer: 'ShellacCardLacquer', AssignCardLacquer: 'ShellacCardLacquer',
AssignCardItem: 'ShellacCardLacquer' AssignCardItem: 'ShellacCardLacquer',
AssignCardAlodine: 'ShellacCardAlodine'
}, },
subTypeName: '' subTypeName: ''
} }
...@@ -108,7 +109,18 @@ export default { ...@@ -108,7 +109,18 @@ export default {
return this.subTypeName return this.subTypeName
} }
}, },
watch: {}, watch: {
'form.assignCardDetails': {
immediate: true,
deep: true,
handler(val) {
if (!this.disabled) {
this.setFormDataAttr('baseModelNo', 'disabled', !!(val && val.length))
this.setFormDataAttr('modelNo', 'disabled', !!(val && val.length))
}
}
}
},
// 生命周期 - 创建完成(可以访问当前this 实例) // 生命周期 - 创建完成(可以访问当前this 实例)
created() { created() {
}, },
...@@ -126,6 +138,9 @@ export default { ...@@ -126,6 +138,9 @@ export default {
Object.keys(this.basicData.setAttrs).forEach(key => { Object.keys(this.basicData.setAttrs).forEach(key => {
this.$set(this.form, key, this.basicData.setAttrs[key]) this.$set(this.form, key, this.basicData.setAttrs[key])
}) })
if (this.itemObj.attrKey === 'baseModelNo') {
this.$set(this.form, 'baseModelNo', this.basicData.setAttrs['modelNo'])
}
} }
if (this.basicData.setAttrs) { if (this.basicData.setAttrs) {
this.initFn() this.initFn()
...@@ -168,6 +183,26 @@ export default { ...@@ -168,6 +183,26 @@ export default {
] ]
this.setOptions('modelNo', params) this.setOptions('modelNo', params)
} }
if (this.itemObj.attrKey === 'baseModelNo') {
params = [
{
'fieldName': 'modelNo',
'operator': 'LIKE',
'value': this.form.baseModelNo || ''
},
{
'fieldName': 'isValid',
'operator': 'EQ',
'value': '是'
},
{
'fieldName': 'subTypeName',
'operator': 'EQ',
'value': this.typeEnum[this.subTypeName]
}
]
this.setOptions('baseModelNo', params)
}
if (this.itemObj.attrKey === 'spec') { if (this.itemObj.attrKey === 'spec') {
if (this.form.modelNo) { if (this.form.modelNo) {
params = [ params = [
...@@ -256,6 +291,26 @@ export default { ...@@ -256,6 +291,26 @@ export default {
] ]
this.setOptions('modelNo', params) this.setOptions('modelNo', params)
} }
if (this.itemObj.attrKey === 'baseModelNo') {
const params = [
{
'fieldName': 'modelNo',
'operator': 'LIKE',
'value': ''
},
{
'fieldName': 'isValid',
'operator': 'EQ',
'value': '是'
},
{
'fieldName': 'subTypeName',
'operator': 'EQ',
'value': this.typeEnum[this.subTypeName]
}
]
this.setOptions('baseModelNo', params)
}
if (this.itemObj.attrKey === 'spec' && this.basicData.modelNo) { if (this.itemObj.attrKey === 'spec' && this.basicData.modelNo) {
const params = [ const params = [
{ {
...@@ -363,6 +418,8 @@ export default { ...@@ -363,6 +418,8 @@ export default {
} else if (this.itemObj.attrKey === 'certificateNum') { } else if (this.itemObj.attrKey === 'certificateNum') {
const obj = this.form.inventory.find(item => item.testNo === value) const obj = this.form.inventory.find(item => item.testNo === value)
this.$set(this.form, 'diluentLotNo', obj.lotNo) this.$set(this.form, 'diluentLotNo', obj.lotNo)
} else if (this.itemObj.attrKey === 'baseModelNo') {
this.$set(this.form, 'certificateNo', '')
} else { } else {
this.$set(this.form, this.itemObj.attrKey, value) this.$set(this.form, this.itemObj.attrKey, value)
this.changeRequest() this.changeRequest()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment