|
|
@ -188,7 +188,8 @@
|
|
|
|
plain
|
|
|
|
plain
|
|
|
|
icon="el-icon-check"
|
|
|
|
icon="el-icon-check"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
@click="handleBatchSave"
|
|
|
|
:disabled="multiple"
|
|
|
|
|
|
|
|
@click="handleBatchAdd"
|
|
|
|
v-hasPermi="['mes:materialinfo:batchEdit']"
|
|
|
|
v-hasPermi="['mes:materialinfo:batchEdit']"
|
|
|
|
>批量保存
|
|
|
|
>批量保存
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
@ -240,7 +241,7 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="批次数量" align="center" prop="batchAmount"/>
|
|
|
|
<el-table-column label="批次数量" align="center" prop="batchAmount"/>
|
|
|
|
<el-table-column label="安全库存数量" align="center" prop="safeStockAmount" width="120" v-if="checkPermi(['mes:materialinfo:batchEdit'])">
|
|
|
|
<!-- <el-table-column label="安全库存数量" align="center" prop="safeStockAmount" width="120" v-if="checkPermi(['mes:materialinfo:batchEdit'])">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<el-input-number
|
|
|
|
<el-input-number
|
|
|
|
v-model="scope.row.safeStockAmount"
|
|
|
|
v-model="scope.row.safeStockAmount"
|
|
|
@ -251,8 +252,8 @@
|
|
|
|
@change="handleSafeStockChange(scope.row)"
|
|
|
|
@change="handleSafeStockChange(scope.row)"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>-->
|
|
|
|
<el-table-column label="安全库存数量" align="center" prop="safeStockAmount" width="120" v-if="!checkPermi(['mes:materialinfo:batchEdit'])"/>
|
|
|
|
<el-table-column label="安全库存数量" align="center" prop="safeStockAmount" width="120" />
|
|
|
|
<el-table-column label="库存数量" align="center" prop="availableAmount" >
|
|
|
|
<el-table-column label="库存数量" align="center" prop="availableAmount" >
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<span :style="setCellClassName(scope.row)">
|
|
|
|
<span :style="setCellClassName(scope.row)">
|
|
|
@ -300,7 +301,6 @@
|
|
|
|
<!-- 添加或修改物料信息对话框 -->
|
|
|
|
<!-- 添加或修改物料信息对话框 -->
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="物料编码" prop="materialCode">
|
|
|
|
<el-form-item label="物料编码" prop="materialCode">
|
|
|
|
<el-input v-model="form.materialCode" placeholder="请输入物料编码" :disabled="true"/>
|
|
|
|
<el-input v-model="form.materialCode" placeholder="请输入物料编码" :disabled="true"/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
@ -455,7 +455,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
<el-button type="primary" @click="handleBatchSave">确 定</el-button>
|
|
|
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改物料信息对话框 -->
|
|
|
|
|
|
|
|
<el-dialog :title="title" :visible.sync="batchOpen" width="700px" append-to-body>
|
|
|
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
|
|
|
|
|
<el-form-item label="安全库存数量" prop="safeStockAmount">
|
|
|
|
|
|
|
|
<el-input-number v-model="form.safeStockAmount" placeholder="请输入安全库存数量" :min="1" :max="10000000000"
|
|
|
|
|
|
|
|
style="width:180px"/>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
|
|
|
<el-button type="primary" @click="handleBatchSave">确 定</el-button>
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
@ -506,6 +520,8 @@ export default {
|
|
|
|
title: "",
|
|
|
|
title: "",
|
|
|
|
// 是否显示弹出层
|
|
|
|
// 是否显示弹出层
|
|
|
|
open: false,
|
|
|
|
open: false,
|
|
|
|
|
|
|
|
// 是否显示批量修改安全库存数量弹出层
|
|
|
|
|
|
|
|
batchOpen: false,
|
|
|
|
// 查询参数
|
|
|
|
// 查询参数
|
|
|
|
queryParams: {
|
|
|
|
queryParams: {
|
|
|
|
pageNum: 1,
|
|
|
|
pageNum: 1,
|
|
|
@ -580,6 +596,7 @@ export default {
|
|
|
|
// 取消按钮
|
|
|
|
// 取消按钮
|
|
|
|
cancel() {
|
|
|
|
cancel() {
|
|
|
|
this.open = false;
|
|
|
|
this.open = false;
|
|
|
|
|
|
|
|
this.batchOpen = false;
|
|
|
|
this.reset();
|
|
|
|
this.reset();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 表单重置
|
|
|
|
// 表单重置
|
|
|
@ -745,41 +762,51 @@ export default {
|
|
|
|
return '';
|
|
|
|
return '';
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
handleSafeStockChange(row) {
|
|
|
|
// handleSafeStockChange(row) {
|
|
|
|
// 记录修改的安全库存数据
|
|
|
|
// // 记录修改的安全库存数据
|
|
|
|
const existingIndex = this.modifiedSafeStockData.findIndex(item => item.materialId === row.materialId);
|
|
|
|
// const existingIndex = this.modifiedSafeStockData.findIndex(item => item.materialId === row.materialId);
|
|
|
|
if (existingIndex > -1) {
|
|
|
|
// if (existingIndex > -1) {
|
|
|
|
this.modifiedSafeStockData[existingIndex] = {
|
|
|
|
// this.modifiedSafeStockData[existingIndex] = {
|
|
|
|
materialId: row.materialId,
|
|
|
|
// materialId: row.materialId,
|
|
|
|
safeStockAmount: row.safeStockAmount
|
|
|
|
// safeStockAmount: row.safeStockAmount
|
|
|
|
};
|
|
|
|
// };
|
|
|
|
} else {
|
|
|
|
// } else {
|
|
|
|
this.modifiedSafeStockData.push({
|
|
|
|
// this.modifiedSafeStockData.push({
|
|
|
|
materialId: row.materialId,
|
|
|
|
// materialId: row.materialId,
|
|
|
|
safeStockAmount: row.safeStockAmount
|
|
|
|
// safeStockAmount: row.safeStockAmount
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleBatchAdd() {
|
|
|
|
|
|
|
|
this.reset();
|
|
|
|
|
|
|
|
this.batchOpen = true;
|
|
|
|
|
|
|
|
this.title = "批量修改安全库存数量";
|
|
|
|
|
|
|
|
},
|
|
|
|
/** 批量保存安全库存 */
|
|
|
|
/** 批量保存安全库存 */
|
|
|
|
handleBatchSave() {
|
|
|
|
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) {
|
|
|
|
if (this.modifiedSafeStockData.length === 0) {
|
|
|
|
this.$modal.msgWarning("没有需要保存的修改");
|
|
|
|
this.$modal.msgWarning("没有需要保存的修改");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.$modal.confirm('确认要保存修改的安全库存数量吗?').then(() => {
|
|
|
|
this.$modal.confirm('确认要保存修改的安全库存数量吗?').then(() => {
|
|
|
|
this.loading = true;
|
|
|
|
this.loading = true;
|
|
|
|
batchUpdateSafeStock(this.modifiedSafeStockData).then(response => {
|
|
|
|
batchUpdateSafeStock(this.modifiedSafeStockData).then(response => {
|
|
|
|
this.$modal.msgSuccess("批量保存成功");
|
|
|
|
this.$modal.msgSuccess("批量保存成功");
|
|
|
|
this.modifiedSafeStockData = []; // 清空修改记录
|
|
|
|
this.modifiedSafeStockData = []; // 清空修改记录
|
|
|
|
|
|
|
|
this.batchOpen = false;
|
|
|
|
this.getList(); // 刷新列表
|
|
|
|
this.getList(); // 刷新列表
|
|
|
|
}).catch(() => {
|
|
|
|
}).catch(() => {
|
|
|
|
this.loading = false;
|
|
|
|
this.loading = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}).catch(() => {});
|
|
|
|
}).catch(() => {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
checkPermi,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|