Commit 19703862 authored by jingnan's avatar jingnan 👀

漆料批次号带出,胶漆记录卡合格证查询增加参数并去重

parent 8975e016
......@@ -354,6 +354,12 @@ export default {
if (this.itemObj.attrKey === 'certificateNo') {
const obj = this.form.inventory.find(item => item.testNo === value)
this.$set(this.form, 'lotNo', obj.lotNo)
if (this.subTypeName === 'AssignCardPaint') {
const lotNoArr = obj.lotNo && obj.lotNo.split('/')
this.$set(this.form, 'baseLotNo', lotNoArr[0] || '')
this.$set(this.form, 'curingLotNo', lotNoArr[1] || '')
this.$set(this.form, 'diluentLotNo', lotNoArr[2] || '')
}
} else if (this.itemObj.attrKey === 'certificateNum') {
const obj = this.form.inventory.find(item => item.testNo === value)
this.$set(this.form, 'diluentLotNo', obj.lotNo)
......@@ -596,6 +602,33 @@ export default {
})
},
getCertificateNo(query, attrKey) {
let paramsItems = []
if (this.subTypeName === 'AssignCardPaint' || this.subTypeName === 'AssignCardLacquer') {
paramsItems = [{
'fieldName': 'remark',
'operator': 'LIKE',
'value': this.form.realityMark || ''
},
{
'fieldName': 'modelNo',
'operator': 'EQ',
'value': this.form.modelNo || ''
}]
} else {
if (this.itemObj.attrKey === 'certificateNum') {
paramsItems = [{
'fieldName': 'modelNo',
'operator': 'EQ',
'value': this.form.diluentModelNo || ''
}]
} else {
paramsItems = [{
'fieldName': 'modelNo',
'operator': 'EQ',
'value': this.form.baseModelNo || ''
}]
}
}
const params = {
'pageFrom': 1,
'pageSize': 20,
......@@ -609,15 +642,24 @@ export default {
{
'fieldName': 'lotNo',
'operator': 'NOTNULL'
}
},
...paramsItems
]
}
}
post(`/Inventory/search`, params).then(res => {
this.loading = false
if (res.code === 0) {
this.form.inventory = res.items.content
this.requestOp = res.items.content.map(item => {
const resDeduplicate = []
// 去重
res.items.content.forEach(m => {
if (!resDeduplicate.find(d => d.testNo === m.testNo)) {
resDeduplicate.push(m)
}
})
this.form.inventory = resDeduplicate
this.requestOp = resDeduplicate.map(item => {
let disabled = false
if (item.qualityPeriod) {
disabled = new Date().getTime() > Date.parse(item.qualityPeriod)
......
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