|
|
@ -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; // 立即将refreshProTable设置为true,显示表格
|
|
|
|
this.refreshWorkTable = true; // 立即将refreshProTable设置为true,显示表格
|
|
|
|
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
|
|
|
|