Commit 1184bd1a authored by wangwenjie's avatar wangwenjie

高亮

parent 909d8df0
......@@ -70,7 +70,7 @@
v-for="(item, index) in currentPageList"
:key="item.BrandId || index"
:class="{
'selected-item': fieldValue && item.boxBarProductLineDeviceCode === fieldValue,
'selected-item': isSelectedItem(item),
'scanned-item': isScannedItem(item)
}"
>
......@@ -173,16 +173,16 @@ export default {
if (!this.data.childrenList || this.data.childrenList.length === 0) {
return [{ text: "暂无机台号" }]; // 兜底提示,避免选择器为空
}
// 过滤掉 boxBarProductLineDeviceCode 为空/undefined 的项,再去重
// 过滤掉 boxBarProductLineDeviceName 为空/undefined 的项,再去重
const numList = this.data.childrenList
.map(item => item.boxBarProductLineDeviceName)
.filter(code => code && code.trim() !== ""); // 过滤空值
.filter(name => name && name.trim() !== ""); // 过滤空值
const uniqueNums = Array.from(new Set(numList));
// 去重后仍为空,返回兜底提示
if (uniqueNums.length === 0) {
return [{ text: "暂无机台号" }];
}
return uniqueNums.map(code => ({ text: code }));
return uniqueNums.map(name => ({ text: name }));
},
// 总页数
totalPages() {
......@@ -260,7 +260,7 @@ export default {
// 格式化条码:截取后10位,前面拼接...
formatQrCode(qrCode) {
if (!qrCode) return "";
// 截取后10位,前面拼接...
// 截取后4位,前面拼接...
return `...${qrCode.slice(-4)}`;
},
// 扫码确认:校验并标记状态
......@@ -300,6 +300,10 @@ export default {
Notify({type: 'warning', message: '条码已扫描'});
}
},
// 新增:判断是否属于选中机台号的条码
isSelectedItem(item) {
return this.fieldValue && item.boxBarProductLineDeviceName === this.fieldValue;
},
// 判断是否高亮:条码是否在已扫描列表中
isScannedItem(item) {
return this.scannedCodes.includes(item.qrCode);
......
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