湿料计划(新增湿料计划)

yangwl
wws 1 year ago
parent f8dbdb1958
commit b9fefacceb

@ -175,8 +175,8 @@
<el-table-column width="150" align="center" prop="productDate" label="工单日期" show-overflow-tooltip <el-table-column width="150" align="center" prop="productDate" label="工单日期" show-overflow-tooltip
></el-table-column> ></el-table-column>
<el-table-column prop="shiftDesc" label="班次"></el-table-column> <el-table-column prop="shiftDesc" label="班次"></el-table-column>
<el-table-column prop="" label="料罐"></el-table-column> <el-table-column prop="bucketName1" label="料罐"></el-table-column>
<el-table-column prop="" label="物料"></el-table-column> <el-table-column prop="materialName1" label="物料"></el-table-column>
</el-table> </el-table>
</el-row> </el-row>
<!-- 料罐-物料-计划日期的选择 --> <!-- 料罐-物料-计划日期的选择 -->
@ -194,7 +194,7 @@
<!--选择物料 --> <!--选择物料 -->
<el-col :span="7"> <el-col :span="7">
<el-form-item size="small" label="选择物料:"> <el-form-item size="small" label="选择物料:">
<el-input @focus="selectMateriel" readonly v-model="form.productId" placeholder="点击选择物料"/> <el-input @focus="selectMateriel" readonly v-model="form.productName" placeholder="点击选择物料"/>
<!-- <el-select v-if="false" v-model="form.productId" placeholder="请选择物料">--> <!-- <el-select v-if="false" v-model="form.productId" placeholder="请选择物料">-->
<!-- <el-option v-for="item in selectProductList" :key="item.productId" :label="item.productDesc"--> <!-- <el-option v-for="item in selectProductList" :key="item.productId" :label="item.productDesc"-->
<!-- :value="item.productId"--> <!-- :value="item.productId"-->
@ -237,6 +237,17 @@
<el-table-column prop="shiftDesc" label="班次"></el-table-column> <el-table-column prop="shiftDesc" label="班次"></el-table-column>
<el-table-column prop="bucketName" label="料罐"></el-table-column> <el-table-column prop="bucketName" label="料罐"></el-table-column>
<el-table-column prop="materialName" label="物料"></el-table-column> <el-table-column prop="materialName" label="物料"></el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="deleteSelectWork(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table> </el-table>
</el-row> </el-row>
</el-form> </el-form>
@ -429,6 +440,7 @@ export default {
dicts: ['sys_yes_no'], dicts: ['sys_yes_no'],
data() { data() {
return { return {
//
// -list // -list
materiel: [], materiel: [],
materielList: [], materielList: [],
@ -499,7 +511,8 @@ export default {
form: { form: {
bucketId: null, bucketId: null,
productId: null, productId: null,
planTime: null planTime: null,
productName: null
}, },
// //
rules: {} rules: {}
@ -512,6 +525,50 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
//
deleteSelectWork(e) {
//
for (let i =0; i < this.newWorkOrderList.length; i++) {
if (e.workorderCode == this.newWorkOrderList[i].workorderCode) {
this.newWorkOrderList.splice(i,1);
}
}
//
let newMaterialName1 = "";
let newBucketName1 = "";
for (let i =0; i < this.workOrderList.length; i++) {
if (e.workorderCode == this.workOrderList[i].workorderCode) {
//
let materialNameArray = this.workOrderList[i].materialName1.split(',');
let materialFlag = true;
for (let j = materialNameArray.length - 2; j >= 0; j--) {
if (e.materialName == materialNameArray[j] && materialFlag) {
materialNameArray.splice(j,1);
materialFlag = false;
}else {
newMaterialName1 += materialNameArray[j]+",";
}
}
//
let bucketArray = this.workOrderList[i].bucketName1.split(',');
let bucketFlag = true;
for (let j = bucketArray.length - 2; j >= 0; j--) {
if (e.bucketName == bucketArray[j] && bucketFlag) {
bucketArray.splice(j,1);
bucketFlag = false;
}else {
newBucketName1 += bucketArray[j]+",";
}
}
this.workOrderList[i].materialName1 = newMaterialName1;
this.workOrderList[i].bucketName1 = newBucketName1;
}
}
},
// - // -
handleMaterielQuery() { handleMaterielQuery() {
this.materielQueryParams.pageNum = 1; this.materielQueryParams.pageNum = 1;
@ -540,6 +597,9 @@ export default {
this.form.productId = this.materiel[0].productId; this.form.productId = this.materiel[0].productId;
this.form.prodCode = this.materiel[0].productCode; this.form.prodCode = this.materiel[0].productCode;
this.form.prodDesc = this.materiel[0].productDescZh; this.form.prodDesc = this.materiel[0].productDescZh;
this.form.productName = this.materiel[0].productDescZh;
this.innerVisible = false; this.innerVisible = false;
}, },
// - // -
@ -690,7 +750,7 @@ export default {
} }
} }
} }
this.bmsList.push(bms)
// //
// //
var bucket var bucket
@ -707,8 +767,76 @@ export default {
} }
} }
// --
for (let i = 0; i < this.selectList.length; i++) {
for (let j = 0; j < this.workOrderList.length; j++) {
if (this.selectList[i].workorderCode == this.workOrderList[j].workorderCode) {
//
if (this.workOrderList[j].materialName1 != null) {
let materialNameArray = this.workOrderList[j].materialName1.split(',');
for (let i = materialNameArray.length - 2; i >= 0; i--) {
if (material.productDesc != materialNameArray[i]) {
this.$message({
message: '同一工单只能选一个物料!',
type: 'warning'
})
return
}
}
}
//
if (this.workOrderList[j].bucketName1 != null) {
let bucketArray = this.workOrderList[j].bucketName1.split(',');
for (let i = bucketArray.length - 1; i >= 0; i--) {
if (bucket.bucketName == bucketArray[i]) {
this.$message({
message: '料罐重复!',
type: 'warning'
})
return
}
}
}
}
}
}
this.bmsList.push(bms)
//
var workOrder = {
productName: null,
factoryCode: null,
workorderId: null,
workorderCode: null,
bucketId: null,
bucketCode: null,
bucketName: null,
materialId: null,
materialCode: null,
materialName: null,
shiftId: null,
shiftDesc: null,
planTime: null,
productDate: null,
};
// newList // newList
for (let i = 0; i < this.selectList.length; i++) { for (let i = 0; i < this.selectList.length; i++) {
workOrder.bucketCode = bucket.bucketCode;
workOrder.bucketId = bucket.bucketId;
workOrder.bucketName = bucket.bucketName;
workOrder.materialId = material.productId;
workOrder.materialCode = material.productCode;
workOrder.materialName = material.productDesc;
workOrder.shiftId = this.selectList[i].shiftId;
workOrder.shiftDesc = this.selectList[i].shiftDesc;
workOrder.planTime = this.form.planTime;
workOrder.productDate = this.selectList[i].productDate;
workOrder.productName = this.selectList[i].productName;
workOrder.workorderId = this.selectList[i].workorderId;
workOrder.workorderCode = this.selectList[i].workorderCode;
this.selectList[i].bucketName = bucket.bucketName this.selectList[i].bucketName = bucket.bucketName
this.selectList[i].bucketId = bucket.bucketId this.selectList[i].bucketId = bucket.bucketId
this.selectList[i].bucketCode = bucket.bucketCode this.selectList[i].bucketCode = bucket.bucketCode
@ -716,17 +844,32 @@ export default {
this.selectList[i].materialCode = material.productCode this.selectList[i].materialCode = material.productCode
this.selectList[i].materialName = material.productDesc this.selectList[i].materialName = material.productDesc
this.selectList[i].planTime = this.form.planTime this.selectList[i].planTime = this.form.planTime
this.newWorkOrderList.push(this.selectList[i])
this.newWorkOrderList.push(workOrder)
} }
// //
const selectedCodes = this.selectList.map(item => item.workorderCode) // const selectedCodes = this.selectList.map(item => item.workorderCode)
this.workOrderList = this.workOrderList.filter(item => !selectedCodes.includes(item.workorderCode)) for (let i = 0; i < this.selectList.length; i++) {
for (let j = 0; j < this.workOrderList.length; j++) {
if (this.selectList[i].workorderCode == this.workOrderList[j].workorderCode) {
if (this.workOrderList[j].bucketName1 == null) {
this.workOrderList[j].bucketName1 = "";
}
this.workOrderList[j].bucketName1 += this.selectList[i].bucketName + ",";
if (this.workOrderList[j].materialName1 == null) {
this.workOrderList[j].materialName1 = "";
}
this.workOrderList[j].materialName1 += this.selectList[i].materialName + ",";
}
}
}
// this.workOrderList = this.workOrderList.filter(item => !selectedCodes.includes(item.workorderCode))
// //
this.form.bucketId = null this.form.bucketId = null
this.form.productId = null this.form.productId = null
this.form.productName = null
}, },
/** 校验计划日期 */ /** 校验计划日期 */
checkDate: function (e) { checkDate: function (e) {

Loading…
Cancel
Save