fix(品质复判):执行时修改双单位判断为是否成品,批次调整问题
This commit is contained in:
parent
b68f384620
commit
c104ade50c
@ -236,6 +236,11 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="kzwsm" width="80" label="双单位">
|
||||
</el-table-column>
|
||||
<el-table-column prop="finishedProduct" label="是否成品">
|
||||
<template v-slot:default="scope">
|
||||
{{scope.row.finishedProduct === 'Y' ? '是' : '否'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="false" prop="newItem" width="150" label="新物料">
|
||||
</el-table-column>
|
||||
<el-table-column prop="newItemDesc" width="150" label="复判后物料描述">
|
||||
@ -684,10 +689,10 @@ export default {
|
||||
}
|
||||
let emptyCount = 0;
|
||||
let nonEmptyCount = 0;
|
||||
// 双单位
|
||||
let kzwsmCount = 0;
|
||||
// 非双单位
|
||||
let noKzwsmCount = 0;
|
||||
// 成品
|
||||
let finishedProductCount = 0;
|
||||
// 非成品
|
||||
let noFinishedProductCount = 0;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
let row = list[i]
|
||||
if (isBlank(row.newItemBo) && me.form.changeItem === 'Y' && row.rejudgLevel === 'G') {
|
||||
@ -699,10 +704,10 @@ export default {
|
||||
if (row.inspecLevel === row.rejudgLevel) {
|
||||
return me.$message.error('第['+row.seq+']行,复判后等级不能与复判前等级相同')
|
||||
}
|
||||
if (row.kzwsm === "B") {
|
||||
kzwsmCount++;
|
||||
if (row.finishedProduct === "Y") {
|
||||
finishedProductCount++;
|
||||
} else {
|
||||
noKzwsmCount++;
|
||||
noFinishedProductCount++;
|
||||
}
|
||||
|
||||
// 判断如果每一行的row.newItemBo都为空或者都不为空时,继续执行下一步,否则,报错:品质复判:多笔数据复判进行保存时,要求复判后物料描述要么全为空,要么都不为空,不能存在有的为空,有的不为空的情况;
|
||||
@ -714,9 +719,9 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
// 判断如果每一行的 双单位 都为B或者都不为B时,继续执行下一步,否则,报错
|
||||
if (kzwsmCount > 0 && noKzwsmCount > 0) {
|
||||
return me.$message.error('品质复判:多笔数据复判进行保存时,要求双单位字段要么全为B,要么都不为B,不能存在有的为B,有的不为B的情况');
|
||||
// 判断如果每一行的 是否成品 都为是或者都为否时,继续执行下一步,否则,报错
|
||||
if (finishedProductCount > 0 && noFinishedProductCount > 0) {
|
||||
return me.$message.error('品质复判:多笔数据复判进行保存时,要求是否成品字段要么全为是,要么全为否,不能存在有的为成品,有的不为成品的情况');
|
||||
}
|
||||
|
||||
// 判断如果每一行的 row.newItemBo 都为空或者都不为空时,继续执行下一步,否则,报错
|
||||
@ -725,7 +730,7 @@ export default {
|
||||
}
|
||||
|
||||
let enableDualUnits = "N";
|
||||
if(kzwsmCount > 0 && noKzwsmCount === 0) {
|
||||
if(finishedProductCount > 0 && noFinishedProductCount === 0) {
|
||||
enableDualUnits = "Y"
|
||||
}
|
||||
|
||||
@ -782,10 +787,10 @@ export default {
|
||||
return me.$message.error('备注不能为空值')
|
||||
}
|
||||
|
||||
// 双单位
|
||||
let kzwsmCount = 0;
|
||||
// 非双单位
|
||||
let noKzwsmCount = 0;
|
||||
// 成品
|
||||
let finishedProductCount = 0;
|
||||
// 非成品
|
||||
let noFinishedProductCount = 0;
|
||||
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
let row = list[i]
|
||||
@ -800,19 +805,19 @@ export default {
|
||||
list[i].remark = me.dialogFrom.remark
|
||||
}
|
||||
|
||||
if (row.kzwsm === "B") {
|
||||
kzwsmCount++;
|
||||
if (row.finishedProduct === "Y") {
|
||||
finishedProductCount++;
|
||||
} else {
|
||||
noKzwsmCount++;
|
||||
noFinishedProductCount++;
|
||||
}
|
||||
}
|
||||
|
||||
// 判断如果每一行的 双单位 都为B或者都不为B时,继续执行下一步,否则,报错
|
||||
if (kzwsmCount > 0 && noKzwsmCount > 0) {
|
||||
return me.$message.error('品质复判:多笔数据复判进行保存时,要求双单位字段要么全为B,要么都不为B,不能存在有的为B,有的不为B的情况');
|
||||
// 判断如果每一行的 是否成品 为是或者都为否时,继续执行下一步,否则,报错
|
||||
if (finishedProductCount > 0 && noFinishedProductCount > 0) {
|
||||
return me.$message.error('品质复判:多笔数据复判进行保存时,要求是否成品字段要么全为是,要么全为否,不能存在有的为成品,有的不为成品的情况');
|
||||
}
|
||||
let enableDualUnits = "N";
|
||||
if(kzwsmCount > 0 && noKzwsmCount === 0) {
|
||||
if(finishedProductCount > 0 && noFinishedProductCount === 0) {
|
||||
enableDualUnits = "Y"
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user