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

master
wws 1 year ago
parent f8dbdb1958
commit b9fefacceb

@ -12,12 +12,12 @@
>
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="同步状态">-->
<!-- <el-select v-model="queryParams.syncFlag" placeholder="请选择同步状态">-->
<!-- <el-option label="已同步" value="Y"></el-option>-->
<!-- <el-option label="未同步" value="N"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="同步状态">-->
<!-- <el-select v-model="queryParams.syncFlag" placeholder="请选择同步状态">-->
<!-- <el-option label="已同步" value="Y"></el-option>-->
<!-- <el-option label="未同步" value="N"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="同步状态">
<el-select v-model="queryParams.syncFlag" placeholder="请选择同步状态" clearable>
<el-option
@ -175,8 +175,8 @@
<el-table-column width="150" align="center" prop="productDate" label="工单日期" show-overflow-tooltip
></el-table-column>
<el-table-column prop="shiftDesc" label="班次"></el-table-column>
<el-table-column prop="" 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="materialName1" label="物料"></el-table-column>
</el-table>
</el-row>
<!-- 料罐-物料-计划日期的选择 -->
@ -194,12 +194,12 @@
<!--选择物料 -->
<el-col :span="7">
<el-form-item size="small" label="选择物料:">
<el-input @focus="selectMateriel" readonly 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"-->
<!-- :value="item.productId"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<el-input @focus="selectMateriel" readonly v-model="form.productName" placeholder="点击选择物料"/>
<!-- <el-select v-if="false" v-model="form.productId" placeholder="请选择物料">-->
<!-- <el-option v-for="item in selectProductList" :key="item.productId" :label="item.productDesc"-->
<!-- :value="item.productId"-->
<!-- ></el-option>-->
<!-- </el-select>-->
</el-form-item>
</el-col>
<!-- 选择日期 -->
@ -237,6 +237,17 @@
<el-table-column prop="shiftDesc" 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 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-row>
</el-form>
@ -429,6 +440,7 @@ export default {
dicts: ['sys_yes_no'],
data() {
return {
//
// -list
materiel: [],
materielList: [],
@ -499,19 +511,64 @@ export default {
form: {
bucketId: null,
productId: null,
planTime: null
planTime: null,
productName: null
},
//
rules: {}
}
},
created() {
this.timeList = [new Date(),new Date()]
this.timeList = [new Date(), new Date()]
this.queryParams.startTime = moment(this.timeList[0]).format('YYYY-MM-DD')
this.queryParams.endTime = moment(this.timeList[1]).format('YYYY-MM-DD')
this.getList()
},
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() {
this.materielQueryParams.pageNum = 1;
@ -540,6 +597,9 @@ export default {
this.form.productId = this.materiel[0].productId;
this.form.prodCode = this.materiel[0].productCode;
this.form.prodDesc = this.materiel[0].productDescZh;
this.form.productName = this.materiel[0].productDescZh;
this.innerVisible = false;
},
// -
@ -650,14 +710,14 @@ export default {
})
return
}
if (this.form.bucketId == null){
if (this.form.bucketId == null) {
this.$message({
message: '请选择料管!',
type: 'warning'
})
return
}
if (this.form.productId == null){
if (this.form.productId == null) {
this.$message({
message: '请选择物料!',
type: 'warning'
@ -690,7 +750,7 @@ export default {
}
}
}
this.bmsList.push(bms)
//
//
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
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].bucketId = bucket.bucketId
this.selectList[i].bucketCode = bucket.bucketCode
@ -716,20 +844,35 @@ export default {
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])
this.newWorkOrderList.push(workOrder)
}
//
const selectedCodes = this.selectList.map(item => item.workorderCode)
this.workOrderList = this.workOrderList.filter(item => !selectedCodes.includes(item.workorderCode))
// const selectedCodes = this.selectList.map(item => 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.productId = null
this.form.productName = null
},
/** 校验计划日期 */
checkDate: function(e) {
checkDate: function (e) {
if (this.newWorkOrderList.length > 0) {
this.$message({
message: '您已生成数据不能更改日期!',
@ -905,9 +1048,9 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
checkChangePlan(row.id).then(response => {
if (response.code == 500){
if (response.code == 500) {
}else {
} else {
//
this.reset()
this.selectBucketList = null
@ -951,7 +1094,7 @@ export default {
/** 修改-提交按钮 */
updateForm() {
//
if (this.wetMaterialPlanList.length>0){
if (this.wetMaterialPlanList.length > 0) {
this.$message({
message: '计划要全部重新分配完!',
type: 'warning'
@ -1005,7 +1148,7 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$modal.confirm('是否确认删除湿料计划管理编号为"' + ids + '"的数据项?').then(function() {
this.$modal.confirm('是否确认删除湿料计划管理编号为"' + ids + '"的数据项?').then(function () {
return delPlan(ids)
}).then(() => {
this.getList()

Loading…
Cancel
Save