|
|
@ -146,12 +146,12 @@
|
|
|
|
@selection-change="handleSelectionChange">
|
|
|
|
@selection-change="handleSelectionChange">
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
|
<el-table-column width="60" align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
|
|
|
|
<el-table-column width="60" align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
|
|
|
|
<el-table-column prop="workorderCode" label="工单编码" width="120"></el-table-column>
|
|
|
|
<el-table-column width="140" align="center" prop="workorderCode" label="工单编码"></el-table-column>
|
|
|
|
<el-table-column prop="productName" label="产品名称" width="120"></el-table-column>
|
|
|
|
<el-table-column width="230" align="center" prop="productName" label="产品名称"></el-table-column>
|
|
|
|
<el-table-column prop="productDate" label="工单日期" show-overflow-tooltip></el-table-column>
|
|
|
|
<el-table-column width="150" align="center" prop="productDate" label="工单日期" show-overflow-tooltip></el-table-column>
|
|
|
|
<el-table-column prop="shiftDesc" label="班次" show-overflow-tooltip></el-table-column>
|
|
|
|
<el-table-column prop="shiftDesc" label="班次"></el-table-column>
|
|
|
|
<el-table-column prop="" label="料罐" show-overflow-tooltip></el-table-column>
|
|
|
|
<el-table-column prop="" label="料罐"></el-table-column>
|
|
|
|
<el-table-column prop="" label="物料" show-overflow-tooltip></el-table-column>
|
|
|
|
<el-table-column prop="" label="物料"></el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-table>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<!-- 料罐-物料-计划日期的选择 -->
|
|
|
|
<!-- 料罐-物料-计划日期的选择 -->
|
|
|
@ -199,17 +199,17 @@
|
|
|
|
@selection-change="handleSelectionChange">
|
|
|
|
@selection-change="handleSelectionChange">
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
|
<el-table-column width="60" align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
|
|
|
|
<el-table-column width="60" align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
|
|
|
|
<el-table-column prop="workorderCode" label="工单编码" width="120"></el-table-column>
|
|
|
|
<el-table-column width="140" align="center" prop="workorderCode" label="工单编码"></el-table-column>
|
|
|
|
<el-table-column prop="productName" label="产品名称" width="120"></el-table-column>
|
|
|
|
<el-table-column width="230" align="center" prop="productName" label="产品名称"></el-table-column>
|
|
|
|
<el-table-column prop="productDate" label="工单日期" show-overflow-tooltip></el-table-column>
|
|
|
|
<el-table-column width="150" align="center" prop="productDate" label="工单日期" show-overflow-tooltip></el-table-column>
|
|
|
|
<el-table-column prop="shiftDesc" label="班次" show-overflow-tooltip></el-table-column>
|
|
|
|
<el-table-column prop="shiftDesc" label="班次"></el-table-column>
|
|
|
|
<el-table-column prop="bucketName" label="料罐" show-overflow-tooltip></el-table-column>
|
|
|
|
<el-table-column prop="bucketName" label="料罐"></el-table-column>
|
|
|
|
<el-table-column prop="materialName" label="物料" show-overflow-tooltip></el-table-column>
|
|
|
|
<el-table-column prop="materialName" label="物料"></el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-table>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<el-button type="primary" @click="submitForm">提 交</el-button>
|
|
|
|
<el-button type="primary" @click="addSubmitForm">提 交</el-button>
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
@ -230,7 +230,7 @@ export default {
|
|
|
|
// 当前计划日期下的BMS
|
|
|
|
// 当前计划日期下的BMS
|
|
|
|
bmsList: null,
|
|
|
|
bmsList: null,
|
|
|
|
// 新增下方的工单表
|
|
|
|
// 新增下方的工单表
|
|
|
|
newWorkOrderList: null,
|
|
|
|
newWorkOrderList: [],
|
|
|
|
// 物料的选择list
|
|
|
|
// 物料的选择list
|
|
|
|
selectProductList: null,
|
|
|
|
selectProductList: null,
|
|
|
|
// 料罐的选择list
|
|
|
|
// 料罐的选择list
|
|
|
@ -289,7 +289,6 @@ export default {
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
/** 新增-提交按钮 */
|
|
|
|
/** 新增-提交按钮 */
|
|
|
|
batchBtn() {
|
|
|
|
batchBtn() {
|
|
|
|
console.log(this.selectProductList)
|
|
|
|
|
|
|
|
// 数据判空
|
|
|
|
// 数据判空
|
|
|
|
if (this.selectList == null || this.selectList === undefined){
|
|
|
|
if (this.selectList == null || this.selectList === undefined){
|
|
|
|
this.$message({
|
|
|
|
this.$message({
|
|
|
@ -320,75 +319,68 @@ export default {
|
|
|
|
materialId: this.form.productId,
|
|
|
|
materialId: this.form.productId,
|
|
|
|
shiftId: this.selectList[0].shiftId,
|
|
|
|
shiftId: this.selectList[0].shiftId,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
for (let i = 0;i<bmsList.length-1;i++){
|
|
|
|
if (this.bmsList != 0){
|
|
|
|
for (let j = i;j < bmsList.length-1;j++){
|
|
|
|
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 (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'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
this.bmsList.pop();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 数据保存(仅前端)
|
|
|
|
// 数据保存(仅前端)
|
|
|
|
console.log("这里是你先要的数据")
|
|
|
|
|
|
|
|
console.log(this.selectList)
|
|
|
|
|
|
|
|
console.log(this.selectBucketList)
|
|
|
|
|
|
|
|
console.log(this.selectProductList)
|
|
|
|
|
|
|
|
// 创建料罐对象
|
|
|
|
// 创建料罐对象
|
|
|
|
var bucket;
|
|
|
|
var bucket;
|
|
|
|
for (let i = 0;i < this.selectBucketList.length-1;i++){
|
|
|
|
for (let i = 0;i < this.selectBucketList.length;i++){
|
|
|
|
if (this.form.bucketId == this.selectBucketList[i].bucketId){
|
|
|
|
if (this.form.bucketId == this.selectBucketList[i].bucketId){
|
|
|
|
bucket = this.selectBucketList[i];
|
|
|
|
bucket = this.selectBucketList[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 创建物料对象
|
|
|
|
// 创建物料对象
|
|
|
|
var material;
|
|
|
|
var material;
|
|
|
|
for (let i = 0;i < this.selectProductList.length-1;i++){
|
|
|
|
for (let i = 0;i < this.selectProductList.length;i++){
|
|
|
|
if (this.form.productId == this.selectProductList[i].productId){
|
|
|
|
if (this.form.productId == this.selectProductList[i].productId){
|
|
|
|
material = this.selectProductList[i];
|
|
|
|
material = this.selectProductList[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.newWorkOrderList = this.selectList;
|
|
|
|
// 将选择的信息放入newList
|
|
|
|
for (let i = 0; i < this.newWorkOrderList.length-1;i++){
|
|
|
|
for (let i = 0;i < this.selectList.length;i++){
|
|
|
|
// this.newWorkOrderList[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]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 创建湿料计划详情对象
|
|
|
|
// 将选择的数据在上方的列表中删除
|
|
|
|
// var wetMaterialDetail = {
|
|
|
|
var list = [];
|
|
|
|
// workorderId: null,
|
|
|
|
for (let i = 0; i < this.workOrderList.length; i++){
|
|
|
|
// workorderCode: null,
|
|
|
|
for (let j = 0;j < this.selectList.length; j++){
|
|
|
|
// productName: null,
|
|
|
|
if (this.workOrderList[i].workorderCode != this.selectList[j].workorderCode){
|
|
|
|
// workorderTime: null,
|
|
|
|
list.push(this.workOrderList[i]);
|
|
|
|
// shiftId: null,
|
|
|
|
}
|
|
|
|
// shiftCode: null,
|
|
|
|
}
|
|
|
|
// shiftDesc: null,
|
|
|
|
}
|
|
|
|
// bucketId: bucket.bucketId,
|
|
|
|
// 重新赋值worklist
|
|
|
|
// bucketCode: bucket.bucketCode,
|
|
|
|
this.workOrderList = list;
|
|
|
|
// bucketName: bucket.bucketName,
|
|
|
|
|
|
|
|
// materialId: material.productId,
|
|
|
|
|
|
|
|
// materialName: material.productDesc,
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
// for (let i = 0; i < this.selectList.length-1;i++){
|
|
|
|
|
|
|
|
// var workOrder = this.selectList[i];
|
|
|
|
|
|
|
|
// wetMaterialDetail.workorderId = workOrder.workorderId;
|
|
|
|
|
|
|
|
// wetMaterialDetail.workorderCode = workOrder.workorderCode;
|
|
|
|
|
|
|
|
// wetMaterialDetail.productName = workOrder.productName;
|
|
|
|
|
|
|
|
// wetMaterialDetail.workorderTime = workOrder.productDate;
|
|
|
|
|
|
|
|
// wetMaterialDetail.shiftId = workOrder.shiftId;
|
|
|
|
|
|
|
|
// wetMaterialDetail.shiftDesc = workOrder.shiftDesc;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// this.wetMaterialDetailList.push(workOrder);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log("看这里!!!!")
|
|
|
|
this.$message('点击了提交按钮!');
|
|
|
|
console.log(this.wetMaterialDetailList)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 重置数据
|
|
|
|
this.bmsList = bmsList;
|
|
|
|
this.bmsList = bmsList;
|
|
|
|
this.$message('点击了提交按钮!');
|
|
|
|
this.form.bucketId = null;
|
|
|
|
|
|
|
|
this.form.productId = null;
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 校验计划日期 */
|
|
|
|
/** 校验计划日期 */
|
|
|
|
checkDate(e){
|
|
|
|
checkDate(e){
|
|
|
@ -418,8 +410,6 @@ export default {
|
|
|
|
const productDate = `${year}-${month}-${day}`;
|
|
|
|
const productDate = `${year}-${month}-${day}`;
|
|
|
|
|
|
|
|
|
|
|
|
getWorkOrderList(productDate).then(response => {
|
|
|
|
getWorkOrderList(productDate).then(response => {
|
|
|
|
console.log("这里是你要的数据")
|
|
|
|
|
|
|
|
console.log(response.data)
|
|
|
|
|
|
|
|
this.workOrderList = response.data;
|
|
|
|
this.workOrderList = response.data;
|
|
|
|
// 刷新表格
|
|
|
|
// 刷新表格
|
|
|
|
// 在获取到新的数据后执行以下代码
|
|
|
|
// 在获取到新的数据后执行以下代码
|
|
|
@ -474,8 +464,6 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 首-搜索按钮操作 */
|
|
|
|
/** 首-搜索按钮操作 */
|
|
|
|
handleQuery() {
|
|
|
|
handleQuery() {
|
|
|
|
console.log("这里是你要的数据");
|
|
|
|
|
|
|
|
console.log(this.timeList);
|
|
|
|
|
|
|
|
if (this.timeList.length-1>1){
|
|
|
|
if (this.timeList.length-1>1){
|
|
|
|
// 赋值
|
|
|
|
// 赋值
|
|
|
|
const year = this.timeList[0].getFullYear(); // 获取年份
|
|
|
|
const year = this.timeList[0].getFullYear(); // 获取年份
|
|
|
@ -510,7 +498,7 @@ export default {
|
|
|
|
// 初始化
|
|
|
|
// 初始化
|
|
|
|
this.checkSelect = true;
|
|
|
|
this.checkSelect = true;
|
|
|
|
// 如果选择中班次冲突
|
|
|
|
// 如果选择中班次冲突
|
|
|
|
for (let i = 0; i < selection.length-1; i++){
|
|
|
|
for (let i = 0; i < selection.length; i++){
|
|
|
|
if (selection[0].shiftId != selection[i].shiftId){
|
|
|
|
if (selection[0].shiftId != selection[i].shiftId){
|
|
|
|
this.$message({
|
|
|
|
this.$message({
|
|
|
|
message: '班次冲突!',
|
|
|
|
message: '班次冲突!',
|
|
|
@ -533,7 +521,7 @@ export default {
|
|
|
|
this.workOrderTime = null;
|
|
|
|
this.workOrderTime = null;
|
|
|
|
this.workOrderList = [];
|
|
|
|
this.workOrderList = [];
|
|
|
|
this.selectProductList = null;
|
|
|
|
this.selectProductList = null;
|
|
|
|
this.newWorkOrderList = null;
|
|
|
|
this.newWorkOrderList = [];
|
|
|
|
this.bmapId = null;
|
|
|
|
this.bmapId = null;
|
|
|
|
// 数据初始化
|
|
|
|
// 数据初始化
|
|
|
|
this.workOrderTime = new Date();
|
|
|
|
this.workOrderTime = new Date();
|
|
|
@ -581,25 +569,21 @@ export default {
|
|
|
|
this.title = "修改湿料计划管理";
|
|
|
|
this.title = "修改湿料计划管理";
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 提交按钮 */
|
|
|
|
/** 新增-提交按钮 */
|
|
|
|
submitForm() {
|
|
|
|
addSubmitForm() {
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
// 校验数据判断newList是否为空
|
|
|
|
if (valid) {
|
|
|
|
if (this.newWorkOrderList == [] || this.newWorkOrderList.length == 0 || this.newWorkOrderList == null){
|
|
|
|
if (this.form.id != null) {
|
|
|
|
this.$message({
|
|
|
|
updatePlan(this.form).then(response => {
|
|
|
|
message:'提交数据不能为空!',
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
type:'warning'
|
|
|
|
this.open = false;
|
|
|
|
})
|
|
|
|
this.getList();
|
|
|
|
return;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
|
|
|
|
addPlan(this.form).then(response => {
|
|
|
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
this.open = false;
|
|
|
|
this.open = false;
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
handleDelete(row) {
|
|
|
|
handleDelete(row) {
|
|
|
|