diff --git a/hw-ui/src/views/mes/materialinfo/index.vue b/hw-ui/src/views/mes/materialinfo/index.vue
index 730ebcc6..38c8b1d6 100644
--- a/hw-ui/src/views/mes/materialinfo/index.vue
+++ b/hw-ui/src/views/mes/materialinfo/index.vue
@@ -188,7 +188,8 @@
plain
icon="el-icon-check"
size="mini"
- @click="handleBatchSave"
+ :disabled="multiple"
+ @click="handleBatchAdd"
v-hasPermi="['mes:materialinfo:batchEdit']"
>批量保存
@@ -240,7 +241,7 @@
-
+
+
@@ -300,7 +301,6 @@
-
@@ -455,7 +455,21 @@
+
+
+
+
+
+
+
+
+
+
@@ -506,6 +520,8 @@ export default {
title: "",
// 是否显示弹出层
open: false,
+ // 是否显示批量修改安全库存数量弹出层
+ batchOpen: false,
// 查询参数
queryParams: {
pageNum: 1,
@@ -580,6 +596,7 @@ export default {
// 取消按钮
cancel() {
this.open = false;
+ this.batchOpen = false;
this.reset();
},
// 表单重置
@@ -745,41 +762,51 @@ export default {
return '';
},
- handleSafeStockChange(row) {
- // 记录修改的安全库存数据
- const existingIndex = this.modifiedSafeStockData.findIndex(item => item.materialId === row.materialId);
- if (existingIndex > -1) {
- this.modifiedSafeStockData[existingIndex] = {
- materialId: row.materialId,
- safeStockAmount: row.safeStockAmount
- };
- } else {
- this.modifiedSafeStockData.push({
- materialId: row.materialId,
- safeStockAmount: row.safeStockAmount
- });
- }
- },
+ // handleSafeStockChange(row) {
+ // // 记录修改的安全库存数据
+ // const existingIndex = this.modifiedSafeStockData.findIndex(item => item.materialId === row.materialId);
+ // if (existingIndex > -1) {
+ // this.modifiedSafeStockData[existingIndex] = {
+ // materialId: row.materialId,
+ // safeStockAmount: row.safeStockAmount
+ // };
+ // } else {
+ // this.modifiedSafeStockData.push({
+ // materialId: row.materialId,
+ // safeStockAmount: row.safeStockAmount
+ // });
+ // }
+ // },
+ handleBatchAdd() {
+ this.reset();
+ this.batchOpen = true;
+ this.title = "批量修改安全库存数量";
+ },
/** 批量保存安全库存 */
handleBatchSave() {
+ const materialIds = this.ids;
+ materialIds.forEach((materialId) => {
+ const materialVO = {materialId: materialId, safeStockAmount: this.form.safeStockAmount};
+ this.modifiedSafeStockData.push(materialVO);
+ })
if (this.modifiedSafeStockData.length === 0) {
this.$modal.msgWarning("没有需要保存的修改");
return;
}
-
this.$modal.confirm('确认要保存修改的安全库存数量吗?').then(() => {
this.loading = true;
batchUpdateSafeStock(this.modifiedSafeStockData).then(response => {
this.$modal.msgSuccess("批量保存成功");
this.modifiedSafeStockData = []; // 清空修改记录
+ this.batchOpen = false;
this.getList(); // 刷新列表
}).catch(() => {
this.loading = false;
});
}).catch(() => {});
},
- checkPermi,
+
}
};