白坯订单管理

yangwl
wws 1 year ago
parent fdbf1021a0
commit 864bffd6d2

@ -928,6 +928,18 @@ export default {
this.splitData = response.data.proOrderWorkorderList;
this.productData.push(response.data.proOrderList[0]);
//
function setAtrr1(row) {
row.atrr1 = 0
if (row.children !== undefined) {
for (let i = 0; i < row.children.length; i++) {
setAtrr1(row.children[i])
}
}
}
setAtrr1(this.productData[0])
})
// 5.
this.splitForm.productDate = moment(new Date()).format('YYYY-MM-DD')
@ -991,7 +1003,7 @@ export default {
this.materielQueryParams.pageNum = 1;
this.getMaterielList();
},
// -
// -
changeCarNum(num) {
console.log("车数数量改变")
//

@ -356,6 +356,13 @@
clearable></el-cascader>
</el-form-item>
</el-col>
<el-col :offset="1" :span="7">
<!-- 工单日期 -->
<el-form-item size="small" label="工单日期: ">
<el-date-picker @change="checkDate" v-model="splitForm.productDate" type="date" placeholder="选择日期"
></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<!-- 第二行 -->
<el-row>
@ -378,11 +385,10 @@
<el-input required type="number" @input="splitNumChange" v-model="splitForm.splitNum"></el-input>
</el-form-item>
</el-col>
<el-col :offset="1" :span="5">
<!-- 工单日期 -->
<el-form-item size="small" label="工单日期: ">
<el-date-picker @change="checkDate" v-model="splitForm.productDate" type="date" placeholder="选择日期"
></el-date-picker>
<el-col :offset="1" :span="7">
<!-- 车数 -->
<el-form-item v-if="this.splitForm.carNum != null" size="small" label="分配车数:">
<el-input required type="number" @input="changeCarNum" v-model="splitForm.carNum"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -454,6 +460,7 @@ import {
} from '@/api/plan/workorder'
import moment from 'moment';
import { getProEquipment, getProRoutes, getProShifts} from '@/api/plan/order'
import {prototype} from "clipboard";
export default {
name: "Workorder",
@ -514,6 +521,7 @@ export default {
productDate: null,
shiftId: null,
routeCode: null,
carNum: null,
},
//
loading: true,
@ -600,6 +608,38 @@ export default {
this.getList();
},
methods: {
// -
changeCarNum(num) {
console.log("车数数量改变")
console.log(num)
//
if (this.splitForm.splitNum == null) {
this.$message({
message: '请先输入拆分数量!',
type: 'warning'
})
this.splitForm.carNum = null;
return
}
//
if (Number(this.splitForm.splitNum) - Number(num) < 0) {
this.$message({
message: '车数不能超过拆分数量!',
type: 'warning'
})
this.splitForm.carNum = this.splitForm.splitNum;
}
//
if (num <= 0) {
this.$message({
message: '车数数量不能小于0',
type: 'warning'
})
this.splitForm.carNum = 1;
}
this.splitForm.carNum = num;
},
// -
handleUpdateDown(row) {
var statusesArray = this.statuses;
@ -695,7 +735,25 @@ export default {
this.splitForm.shiftId = this.splitData[0].shiftDesc
//
this.splitForm.routeCode = this.splitData[0].routeCode
//
this.splitForm.carNum = this.splitData[0].carNum
//
if (this.productData[0].prodType == 'white'){
//
function setAtrr1(order, work) {
order.quantitySplit = Number(order.quantitySplit) - Number(work.quantitySplit);
order.atrr1 = work.quantitySplit;
if (order.children !== undefined && work.children !== undefined) {
setAtrr1(order.children[0], work);
}
}
setAtrr1(this.productData[0], this.splitData[0]);
}
//
if (this.productData[0],prototype != 'white'){
//
function setAtrr1(order, work) {
order.quantitySplit = Number(order.quantitySplit) - Number(work.quantitySplit);
@ -707,6 +765,7 @@ export default {
}
setAtrr1(this.productData[0], this.splitData[0]);
}
})
@ -739,11 +798,15 @@ export default {
},
// -
splitNumChange(e) {
//
console.log(this.productData)
//
if (e <= 0) {
e = 1
this.splitForm.splitNum = 1
} else {
}
//
if (this.productData[0].prodType != 'white') {
console.log("成品逻辑")
//
let max = Number(this.productData[0].quantity) - Number(this.productData[0].quantitySplit)
//
@ -782,6 +845,45 @@ export default {
this.workForm.splitNum = this.splitForm.splitNum
}
//
if (this.productData[0].prodType == 'white') {
console.log("白坯逻辑")
//
let max = Number(this.productData[0].quantity) - Number(this.productData[0].quantitySplit)
//
if (e > max) {
this.$message({
message: '最大值不能超过' + max + '!',
type: 'warning'
})
this.splitForm.splitNum = max
}
//
//
this.proLoading = true // true
//
function setAtrr1(data, splitNum) {
if (data.children !== undefined) {
for (let i = 0; i < data.children.length; i++) {
data.children[i].atrr1 = splitNum
setAtrr1(data.children[i], splitNum)
}
}
}
this.productData[0].atrr1 = this.splitForm.splitNum
setAtrr1(this.productData[0], this.splitForm.splitNum)
this.refreshProTable = false // refreshProTablefalse
this.$nextTick(() => {
// 使$nextTickDOM
this.refreshProTable = true // refreshProTabletrue
this.proLoading = false // false
})
this.workForm.splitNum = this.splitForm.splitNum
}
this.product = this.productData[0]
},
// -

Loading…
Cancel
Save