|
|
|
@ -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: '同班次下-同料罐下:不能混料!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
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; // 立即将refreshProTable设置为true,显示表格
|
|
|
|
|
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
|
|
|
|
|