湿料计划管理(新增模块完成)

yangwl
wws 1 year ago
parent c15e1162d7
commit 6bdf3c0937

@ -228,7 +228,7 @@ export default {
// selectList
selectList: null,
// BMS
bmsList: null,
bmsList: [],
//
newWorkOrderList: [],
// list
@ -290,9 +290,13 @@ export default {
/** 新增-料罐选择校验 */
bucketSelectChange(e) {
//
console.log("这里是改变日期")
console.log(e)
},
/** 新增-提交按钮 */
/** 新增-确定按钮 */
batchBtn() {
console.log("这里是bms")
console.log(this.bmsList)
//
if (this.selectList == null || this.selectList === undefined){
this.$message({
@ -316,28 +320,25 @@ export default {
})
return;
}
//
var bmsList = this.bmsList;
bmsList.push({
var bms = {
bucketId: this.form.bucketId,
materialId: this.form.productId,
shiftId: this.selectList[0].shiftId,
});
if (this.bmsList != 0){
for (let i = 0;i<bmsList.length;i++){
for (let j = i;j < bmsList.length;j++){
if (bmsList[i].shiftId == bmsList[j].shiftId && bmsList[i].bucketId == bmsList[j].bucketId && bmsList[i].materialId != bmsList[j].materialId){
};
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: '同班次下-同料罐下:不能混料!',
message:'同班次同料罐下不能混料!',
type:'warning'
})
this.bmsList.pop();
return;
}
}
}
}
this.bmsList.push(bms);
//
//
var bucket;
@ -367,27 +368,25 @@ export default {
}
//
var list = [];
for (let i = 0; i < this.workOrderList.length; i++){
for (let j = 0;j < this.selectList.length; j++){
if (this.workOrderList[i].workorderCode != this.selectList[j].workorderCode){
list.push(this.workOrderList[i]);
}
}
}
// worklist
this.workOrderList = list;
const selectedCodes = this.selectList.map(item => item.workorderCode);
this.workOrderList = this.workOrderList.filter(item => !selectedCodes.includes(item.workorderCode));
this.$message('点击了提交按钮!');
//
this.bmsList = bmsList;
this.form.bucketId = null;
this.form.productId = null;
},
/** 校验计划日期 */
checkDate(e){
if (this.newWorkOrderList.length>0){
this.$message({
message:'您已生成数据不能更改日期!',
type:'warning'
})
return;
}
var now = new Date();
if (e < now){
this.$message({
@ -397,6 +396,18 @@ export default {
e = now;
this.form.planTime = now;
}
// list
const year = this.form.planTime.getFullYear(); //
const month = String(this.form.planTime.getMonth() + 1).padStart(2, '0'); //
const day = String(this.form.planTime.getDate()).padStart(2, '0'); //
const planTime = `${year}-${month}-${day}`;
getBMSList(planTime).then(response => {
console.log("w这里是改变日期")
console.log(response.data)
if (response.data !== undefined){
this.bmsList = response.data;
}
})
},
/** 新增-选择工单日期 */
workOrderTimeChange(e) {
@ -547,12 +558,14 @@ export default {
this.refreshWorkTable = true; // refreshProTabletrue
this.workLoading = false; // false
});
console.log("这里是order")
console.log(this.workOrderList)
})
// list
getBMSList(productDate).then(response => {
if (response.data !== undefined){
this.bmsList = response.data;
console.log("这里是bms开始")
console.log(this.bmsList)
}
})
//
// list

Loading…
Cancel
Save