Commit 5696c505 authored by jingnan's avatar jingnan 👀

阿洛丁组分填写牌号接口修改,添加剂牌号为根据阿洛丁牌号带出的组分牌号分割值

parent 64650aed
......@@ -79,7 +79,8 @@ export default {
AssignCardItem: 'ShellacCardLacquer',
AssignCardAlodine: 'ShellacCardAlodine'
},
subTypeName: ''
subTypeName: '',
shellacDeployLists: []
}
},
computed: {
......@@ -394,15 +395,29 @@ export default {
}
]
}
await post(`/ShellacDeploy/queryModel?param=${key}`, params)
const requestUrl = key === 'baseModelNo' ? '/ShellacDeploy/search' : `/ShellacDeploy/queryModel?param=${key}`
await post(requestUrl, params)
.then(res => {
if (res.code === 0) {
this.requestOp = res.items.map(item => {
return {
label: item,
value: item
}
})
if (key === 'baseModelNo') {
if (res.items && res.items.content) {
this.shellacDeployLists = res.items.content
this.requestOp = res.items.content.map(item => {
return {
label: item.modelNo,
value: item.modelNo
}
})
this.form.baseModelNo && this.setDiluentModelNoOption(this.form.baseModelNo)
}
} else {
if (res.code === 0) {
this.requestOp = res.items.map(item => {
return {
label: item,
value: item
}
})
}
}
})
},
......@@ -422,6 +437,10 @@ export default {
} else if (this.itemObj.attrKey === 'baseModelNo') {
this.$set(this.form, 'certificateNo', '')
this.$set(this.form, 'lotNo', '')
this.setDiluentModelNoOption(value)
this.$set(this.form, 'diluentModelNo', '')
this.$set(this.form, 'certificateNum', '')
this.$set(this.form, 'diluentLotNo', '')
} else {
this.$set(this.form, this.itemObj.attrKey, value)
this.changeRequest()
......@@ -756,6 +775,21 @@ export default {
this.setFormDataAttr(attrKey, 'options', this.requestOp)
}
})
},
setDiluentModelNoOption(value) {
const targetObj = this.shellacDeployLists.find(item => item.modelNo === value)
if (targetObj && targetObj.component) {
const diluentModelNoOption = this.splitByVerticalBar(targetObj.component).map(el => { return { value: el, label: el } })
this.setFormDataAttr('diluentModelNo', 'options', diluentModelNoOption || [])
}
},
splitByVerticalBar(str) {
// 正则表达式匹配中文竖线或英文竖线
const regex = /[\u3000\u007C\|]+/g
return str.split(regex).filter(function(item) {
// 去除空字符串
return item !== ''
})
}
}
}
......
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