feat(wms): 新增钢卷合同号自动填充功能
1. 在钢卷合并、分卷、打钢印、计划拆分、退火计划页面添加合同号自动拉取逻辑 2. 优化合同选择组件,补全不存在于列表的已选合同 3. 移除split.vue中冗余的注释代码
This commit is contained in:
@@ -157,6 +157,17 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value(val) {
|
||||
if (val && !this.contractList.some(item => String(item.orderId) === String(val))) {
|
||||
getOrder(val).then(res => {
|
||||
if (res.data) {
|
||||
this.contractList.unshift(res.data)
|
||||
}
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.mode == "today") {
|
||||
this.loadFromLocalStorage();
|
||||
@@ -211,6 +222,17 @@ export default {
|
||||
this.sortLastSelectedToFirst();
|
||||
// 保存到localStorage
|
||||
this.saveToLocalStorage();
|
||||
// 确保已选中的合同在列表中
|
||||
if (this.value && !this.contractList.some(item => String(item.orderId) === String(this.value))) {
|
||||
try {
|
||||
const contract = await getOrder(this.value);
|
||||
if (contract.data) {
|
||||
this.contractList.unshift(contract.data);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Failed to fetch selected contract:', e);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 将上一次选择的合同排到列表第一位
|
||||
|
||||
Reference in New Issue
Block a user