|
|
|
@ -220,19 +220,19 @@
|
|
|
|
|
<el-dialog title="修改计划模块" :visible.sync="dialogVisible" width="1000px" append-to-body>
|
|
|
|
|
<el-form :model="form" ref="dynamicForm" label-width="80px">
|
|
|
|
|
<!-- 选择工单生产日期 -->
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item size="small" label="工单日期: ">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
@change="workOrderTimeChange"
|
|
|
|
|
v-model="workOrderTime"
|
|
|
|
|
type="date"
|
|
|
|
|
placeholder="工单日期">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<!-- 工单列表 -->
|
|
|
|
|
<!-- <el-row>-->
|
|
|
|
|
<!-- <el-col :span="8">-->
|
|
|
|
|
<!-- <el-form-item size="small" label="工单日期: ">-->
|
|
|
|
|
<!-- <el-date-picker-->
|
|
|
|
|
<!-- @change="workOrderTimeChange"-->
|
|
|
|
|
<!-- v-model="workOrderTime"-->
|
|
|
|
|
<!-- type="date"-->
|
|
|
|
|
<!-- placeholder="工单日期">-->
|
|
|
|
|
<!-- </el-date-picker>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
<!-- </el-row>-->
|
|
|
|
|
<!-- 湿料计划详情列表 -->
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-table
|
|
|
|
|
ref="multipleTable"
|
|
|
|
@ -276,17 +276,17 @@
|
|
|
|
|
<!-- 选择日期 -->
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item size="small" label="计划日期: ">
|
|
|
|
|
<el-date-picker @change="checkDate" v-model="form.planTime" type="date" placeholder="选择日期"></el-date-picker>
|
|
|
|
|
<el-date-picker readonly @change="checkDate" v-model="form.planTime" type="date" placeholder="选择日期"></el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<!-- 确定按钮 -->
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :offset="11" :span="8">
|
|
|
|
|
<el-button @click="batchBtn" type="primary">确定</el-button>
|
|
|
|
|
<el-button @click="changeBatchBtn" type="primary">确定</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<!-- 变化的工单表 -->
|
|
|
|
|
<!-- 变化的湿料计划详情表 -->
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-table
|
|
|
|
|
ref="multipleTable"
|
|
|
|
@ -309,7 +309,7 @@
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="addSubmitForm">提 交</el-button>
|
|
|
|
|
<el-button type="primary" @click="updateForm">提 交</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
@ -318,7 +318,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { getPlanDetailList,addWetPlan,getBMSList,getProductList,getBucketList,getWorkOrderList,listPlan, getPlan, delPlan, addPlan, updatePlan } from "@/api/mes/plan";
|
|
|
|
|
import { updatePlanDetail,getPlanDetailList,addWetPlan,getBMSList,getProductList,getBucketList,getWorkOrderList,listPlan, getPlan, delPlan, addPlan, updatePlan } from "@/api/mes/plan";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "Plan",
|
|
|
|
@ -392,6 +392,86 @@ export default {
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
/** 修改-确定按钮 */
|
|
|
|
|
changeBatchBtn() {
|
|
|
|
|
// 数据判空
|
|
|
|
|
if (this.selectList == null || this.selectList === undefined){
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '请选择工单!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.form.bucketId == null || this.form.productId == null){
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '数据不能为空!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 数据校验班次冲突问题
|
|
|
|
|
if (this.checkSelect === false){
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '班次冲突请重新选择!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 校验数据班次、物料、料罐
|
|
|
|
|
var bms = {
|
|
|
|
|
bucketId: this.form.bucketId,
|
|
|
|
|
materialId: this.form.productId,
|
|
|
|
|
shiftId: this.selectList[0].shiftId,
|
|
|
|
|
};
|
|
|
|
|
if (this.bmsList != null || this.bmsList === undefined){
|
|
|
|
|
for (let i = 0;i<this.bmsList.length;i++){
|
|
|
|
|
if (bms.shiftId == this.bmsList[i].shiftId && bms.bucketId == this.bmsList[i].bucketId && bms.materialId != this.bmsList[i].materialId){
|
|
|
|
|
this.$message({
|
|
|
|
|
message:'同班次同料罐下不能混料!',
|
|
|
|
|
type:'warning'
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.bmsList.push(bms);
|
|
|
|
|
// 数据保存(仅前端)
|
|
|
|
|
// 创建料罐对象
|
|
|
|
|
var bucket;
|
|
|
|
|
for (let i = 0;i < this.selectBucketList.length;i++){
|
|
|
|
|
if (this.form.bucketId == this.selectBucketList[i].bucketId){
|
|
|
|
|
bucket = this.selectBucketList[i];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 创建物料对象
|
|
|
|
|
var material;
|
|
|
|
|
for (let i = 0;i < this.selectProductList.length;i++){
|
|
|
|
|
if (this.form.productId == this.selectProductList[i].productId){
|
|
|
|
|
material = this.selectProductList[i];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 将选择的信息放入newList
|
|
|
|
|
for (let i = 0;i < this.selectList.length;i++){
|
|
|
|
|
this.selectList[i].bucketName = bucket.bucketName;
|
|
|
|
|
this.selectList[i].bucketId = bucket.bucketId;
|
|
|
|
|
this.selectList[i].bucketCode = bucket.bucketCode;
|
|
|
|
|
this.selectList[i].materialId = material.productId;
|
|
|
|
|
this.selectList[i].materialCode = material.productCode;
|
|
|
|
|
this.selectList[i].materialName = material.productDesc;
|
|
|
|
|
this.selectList[i].planTime = this.form.planTime;
|
|
|
|
|
this.newWorkOrderList.push(this.selectList[i]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 将选择的数据在上方的列表中删除
|
|
|
|
|
const selectedCodes = this.selectList.map(item => item.workorderCode);
|
|
|
|
|
this.wetMaterialPlanList = this.wetMaterialPlanList.filter(item => !selectedCodes.includes(item.workorderCode));
|
|
|
|
|
|
|
|
|
|
// 重置数据
|
|
|
|
|
this.form.bucketId = null;
|
|
|
|
|
this.form.productId = null;
|
|
|
|
|
},
|
|
|
|
|
/** 新增-确定按钮 */
|
|
|
|
|
batchBtn() {
|
|
|
|
|
// 数据判空
|
|
|
|
@ -679,14 +759,56 @@ export default {
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
console.log("这里是修改操作区域")
|
|
|
|
|
console.log(row)
|
|
|
|
|
// 清除缓存
|
|
|
|
|
this.reset();
|
|
|
|
|
this.selectBucketList = null;
|
|
|
|
|
this.workOrderTime = null;
|
|
|
|
|
this.workOrderList = [];
|
|
|
|
|
this.selectProductList = null;
|
|
|
|
|
this.newWorkOrderList = [];
|
|
|
|
|
this.bmapId = null;
|
|
|
|
|
// 初始化数据
|
|
|
|
|
this.form.planTime = new Date();
|
|
|
|
|
// 获取订单详情list
|
|
|
|
|
getPlanDetailList(row.id).then(response => {
|
|
|
|
|
if (response.data !== undefined){
|
|
|
|
|
this.wetMaterialPlanList = response.data;
|
|
|
|
|
}
|
|
|
|
|
console.log(response.data)
|
|
|
|
|
})
|
|
|
|
|
// 获取料罐list
|
|
|
|
|
getBucketList().then(response => {
|
|
|
|
|
this.selectBucketList = response.data;
|
|
|
|
|
})
|
|
|
|
|
// 获取物料信息list
|
|
|
|
|
getProductList().then(response => {
|
|
|
|
|
this.selectProductList = response.data;
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.dialogVisible = true;
|
|
|
|
|
},
|
|
|
|
|
/** 修改-提交按钮 */
|
|
|
|
|
updateForm() {
|
|
|
|
|
// 校验数据判断newList是否为空
|
|
|
|
|
if (this.newWorkOrderList == [] || this.newWorkOrderList.length == 0 || this.newWorkOrderList == null){
|
|
|
|
|
this.$message({
|
|
|
|
|
message:'提交数据不能为空!',
|
|
|
|
|
type:'warning'
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
updatePlanDetail(this.newWorkOrderList).then(response => {
|
|
|
|
|
if (response.code === 200){
|
|
|
|
|
this.$message({
|
|
|
|
|
message:'提交成功',
|
|
|
|
|
type:'success'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.dialogVisible = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
/** 新增-提交按钮 */
|
|
|
|
|
addSubmitForm() {
|
|
|
|
|
// 校验数据判断newList是否为空
|
|
|
|
|