Commit 5696c505 authored by jingnan's avatar jingnan 👀

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

parent 64650aed
...@@ -79,7 +79,8 @@ export default { ...@@ -79,7 +79,8 @@ export default {
AssignCardItem: 'ShellacCardLacquer', AssignCardItem: 'ShellacCardLacquer',
AssignCardAlodine: 'ShellacCardAlodine' AssignCardAlodine: 'ShellacCardAlodine'
}, },
subTypeName: '' subTypeName: '',
shellacDeployLists: []
} }
}, },
computed: { computed: {
...@@ -394,8 +395,21 @@ export default { ...@@ -394,8 +395,21 @@ 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 => { .then(res => {
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) { if (res.code === 0) {
this.requestOp = res.items.map(item => { this.requestOp = res.items.map(item => {
return { return {
...@@ -404,6 +418,7 @@ export default { ...@@ -404,6 +418,7 @@ export default {
} }
}) })
} }
}
}) })
}, },
changeEvent(value) { changeEvent(value) {
...@@ -422,6 +437,10 @@ export default { ...@@ -422,6 +437,10 @@ export default {
} else if (this.itemObj.attrKey === 'baseModelNo') { } else if (this.itemObj.attrKey === 'baseModelNo') {
this.$set(this.form, 'certificateNo', '') this.$set(this.form, 'certificateNo', '')
this.$set(this.form, 'lotNo', '') this.$set(this.form, 'lotNo', '')
this.setDiluentModelNoOption(value)
this.$set(this.form, 'diluentModelNo', '')
this.$set(this.form, 'certificateNum', '')
this.$set(this.form, 'diluentLotNo', '')
} else { } else {
this.$set(this.form, this.itemObj.attrKey, value) this.$set(this.form, this.itemObj.attrKey, value)
this.changeRequest() this.changeRequest()
...@@ -756,6 +775,21 @@ export default { ...@@ -756,6 +775,21 @@ export default {
this.setFormDataAttr(attrKey, 'options', this.requestOp) 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