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

yangwl
wws 1 year ago
parent c15e1162d7
commit 6bdf3c0937

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

Loading…
Cancel
Save