湿料计划管理(修改init)

master
wws 1 year ago
parent 738ed999d6
commit 7ae568286f

@ -1,9 +1,18 @@
import request from '@/utils/request'
// 修改-提交按钮-修改湿料计划
export function updatePlanDetail(data) {
return request({
url:'/mes/plan/updatePlanDetail',
method: 'put',
data: data
})
}
// 修改-通过主计划id获取湿料计划详情list
export function getPlanDetailList(id) {
return request({
url: 'mes/plan/getPlanDetail'+'?id='+id,
url: '/mes/plan/getPlanDetail'+'?id='+id,
method: 'get',
})
}
@ -20,7 +29,7 @@ export function addWetPlan(data) {
// 通过计划日期获取已分配的料罐、物料、班次信息list
export function getBMSList(planTime) {
return request({
url:'mes/plan/getBMSList/'+'?planTime='+planTime,
url:'/mes/plan/getBMSList/'+'?planTime='+planTime,
method:'get'
})
}

@ -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

Loading…
Cancel
Save