成品库显示图号,精简历史记录map
This commit is contained in:
1 parent
3cba19da98
commit
13d3a96f0c
3 files changed
+29
-9
No files matched your search
@@ -160,14 +160,17 @@
|
||||
{
|
||||
title: '容器编码',
|
||||
dataIndex: 'ContainerCode',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '物料编码',
|
||||
dataIndex: 'MaterialCode',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '物料名称',
|
||||
title: '图号',
|
||||
dataIndex: 'MaterialName',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '物料型号',
|
||||
@@ -240,7 +243,7 @@
|
||||
getFilteredTips(type, inputVal) {
|
||||
if (!inputVal) {
|
||||
// 没有输入时显示所有历史记录
|
||||
console.log(1)
|
||||
|
||||
return this.history[type].map(item => ({ value: item }));
|
||||
}
|
||||
// 输入时过滤匹配的记录(不区分大小写)
|
||||
@@ -262,7 +265,7 @@
|
||||
// 添加到最前面(最新的在最上面)
|
||||
history.unshift(value);
|
||||
// 限制最多保存10条
|
||||
if (history.length > 10) {
|
||||
if (history.length > 20) {
|
||||
history.pop();
|
||||
}
|
||||
// 保存到本地存储
|
||||
@@ -477,7 +480,12 @@
|
||||
},
|
||||
|
||||
handleDelete(record) {
|
||||
const index = this.bindList.findIndex(item => item.id === record.id);
|
||||
if (!record || !record.Id) {
|
||||
this.$message.error("无效的记录");
|
||||
return;
|
||||
}
|
||||
|
||||
const index = this.bindList.findIndex(item => item.Id === record.Id);
|
||||
|
||||
if (index > -1) {
|
||||
// 调用后端删除库存
|
||||
@@ -502,7 +510,13 @@
|
||||
},
|
||||
|
||||
handleEdit(record) {
|
||||
this.editForm.index = this.bindList.findIndex(item => item.id === record.id);
|
||||
if (!record || !record.Id) {
|
||||
this.$message.error("无效的记录");
|
||||
return;
|
||||
}
|
||||
|
||||
this.editForm.index = this.bindList.findIndex(item => item.Id === record.Id);
|
||||
|
||||
this.editForm.qty = Math.floor(record.Qty);
|
||||
this.editModalVisible = true;
|
||||
},
|
||||
@@ -548,7 +562,12 @@
|
||||
},
|
||||
|
||||
handleDeduct(record) {
|
||||
this.deductForm.index = this.bindList.findIndex(item => item.id === record.id);
|
||||
if (!record || !record.Id) {
|
||||
this.$message.error("无效的记录");
|
||||
return;
|
||||
}
|
||||
|
||||
this.deductForm.index = this.bindList.findIndex(item => item.Id === record.Id);
|
||||
this.deductForm.qty = null;
|
||||
this.deductForm.maxQty = Math.floor(record.Qty);
|
||||
this.deductModalVisible = true;
|
||||
@@ -573,7 +592,7 @@
|
||||
this.$notification.error("扣除数量不能大于当前数量");
|
||||
return;
|
||||
}
|
||||
console.log(1);
|
||||
|
||||
const newQty = record.Qty - this.deductForm.qty;
|
||||
|
||||
if (newQty === 0) {
|
||||
|
||||
Reference in new issue
Block a user