2025-01-09 MES - 自检/首检两个表优化

master
元气满满(jgy) 6 months ago
parent 026b0c9bca
commit dce5fd232b

@ -445,7 +445,7 @@ export default {
// lineCodecheckDate // lineCodecheckDate
headerParameters: { headerParameters: {
handler(newVal) { handler(newVal) {
if (newVal.lineCode && newVal.checkDate) { if (newVal.lineCode || newVal.checkDate) {
this.getProductList(); // this.getProductList(); //
} }
}, },
@ -464,7 +464,7 @@ export default {
} }
}, },
// //
handleSelectProductChange(value) { handleSelectProductChange(value) {
const selectedOption = this.productCodeOption.find( const selectedOption = this.productCodeOption.find(
(option) => option.id === value (option) => option.id === value
@ -559,6 +559,19 @@ export default {
getProductList() { getProductList() {
getProductList(this.headerParameters).then((response) => { getProductList(this.headerParameters).then((response) => {
this.productCodeOption = response; this.productCodeOption = response;
if (response.length === 0) {
this.headerParameters.id = null;
// this.productCodeOption = null;
} else {
const found = this.productCodeOption.some(
(item) => item.id === this.headerParameters.id
);
if (!found) {
this.headerParameters.id = null;
}
}
}); });
}, },

@ -445,7 +445,7 @@ export default {
// lineCodecheckDate // lineCodecheckDate
headerParameters: { headerParameters: {
handler(newVal) { handler(newVal) {
if (newVal.lineCode && newVal.checkDate) { if (newVal.lineCode || newVal.checkDate) {
this.getProductList(); // this.getProductList(); //
} }
}, },
@ -559,6 +559,19 @@ export default {
getProductList() { getProductList() {
getProductList(this.headerParameters).then((response) => { getProductList(this.headerParameters).then((response) => {
this.productCodeOption = response; this.productCodeOption = response;
if (response.length === 0) {
this.headerParameters.id = null;
// this.productCodeOption = null;
} else {
const found = this.productCodeOption.some(
(item) => item.id === this.headerParameters.id
);
if (!found) {
this.headerParameters.id = null;
}
}
}); });
}, },
@ -722,7 +735,9 @@ export default {
checkTimeS === null || checkTimeS === null ||
checkTimeS === "" checkTimeS === ""
) { ) {
this.$modal.msg("您填入的检查时间存在开始时间为空的情况,请再次进行填写!"); this.$modal.msg(
"您填入的检查时间存在开始时间为空的情况,请再次进行填写!"
);
return; return;
} }
} }

Loading…
Cancel
Save