计划管理优化

yangwl
wws 1 year ago
parent 8c0e62b1f9
commit 534ebef16c

@ -54,16 +54,16 @@
>
</el-date-picker>
</el-form-item>
<el-form-item label="订单类型" prop="status">
<el-select v-model="queryParams.orderType" placeholder="请选择订单类型" clearable>
<el-option
v-for="dict in dict.type.product_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="订单类型" prop="status">-->
<!-- <el-select v-model="queryParams.orderType" placeholder="请选择订单类型" clearable>-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.product_type"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
@ -797,37 +797,6 @@ export default {
...this.queryParams
}, `order_${new Date().getTime()}.xlsx`)
},
// -
changeRoute(routeCode) {
console.log("点击了拆分-选择工艺")
getProEquipment(routeCode).then(response => {
this.eRouteOptions = response.data
//
let selectAll = [];
this.eRouteOptions.forEach(it => {
var children = it.children;
if (children != null) {
children.forEach(it2 => {
let arr = []
arr.push(it.value)
arr.push(it2.value)
selectAll.push(arr)
})
}
})
this.splitForm.prodLineCodeArray = selectAll
})
},
// -线
changeEquipment() {
if (this.splitForm.routeCode == null) {
this.$message({
message: '请先选择工艺!',
type: 'warning'
})
return
}
},
// -
splitBtn(e) {
//
@ -894,6 +863,38 @@ export default {
})
},
// -
changeRoute(routeCode) {
console.log("点击了拆分-选择工艺")
//
getProEquipment(routeCode).then(response => {
this.eRouteOptions = response.data
//
let selectAll = [];
this.eRouteOptions.forEach(it => {
var children = it.children;
if (children != null) {
children.forEach(it2 => {
let arr = []
arr.push(it.value)
arr.push(it2.value)
selectAll.push(arr)
})
}
})
this.splitForm.prodLineCodeArray = selectAll
})
},
// -线
changeEquipment() {
if (this.splitForm.routeCode == null) {
this.$message({
message: '请先选择工艺!',
type: 'warning'
})
return
}
},
// -
splitNumChange(e) {
@ -944,6 +945,18 @@ export default {
}
this.product = this.productData[0]
},
// -
checkDate(e) {
var now = new Date()
if (e < now) {
e = now
this.splitForm.productDate = now
this.$message({
message: "工单日期不能早于今天",
type: "warning"
})
}
},
// -
batchCodeChange(e) {
if (this.formFields.length > 1) {
@ -962,16 +975,81 @@ export default {
}
}
},
// -
checkDate(e) {
var now = new Date()
if (e < now) {
e = now
this.splitForm.productDate = now
// -
addField() {
//
let sum = 0
for (let i = 0; i < this.formFields.length; i++) {
sum += Number(this.formFields[i].batchQuantity)
}
if (sum >= this.productData[0].atrr1) {
this.$message({
message: "工单日期不能早于今天",
type: "warning"
message: '无法添加!您的批次数量已满!',
type: 'warning'
})
return
}
this.formFields.push({batchCode: '', batchQuantity: ''})
//
this.formFields[this.formFields.length - 1].batchQuantity = Number(this.productData[0].atrr1) - Number(sum)
},
// -
removeField(index) {
this.formFields.splice(index, 1)
},
// -
resetBatch() {
this.eRouteOptions = [],
this.splitForm = {
prodLineCodeArray: [],
id: null,
prodLineCode: [],
splitNum: null,
productDate: null,
shiftId: null,
formFields: []
}
this.splitData = []
this.productData = []
this.proline = []
this.splitnum = null
this.workShift = []
this.formFields = [{
batchCode: '',
batchQuantity: ''
}]
},
// -
inBatch(e) {
//
if (e <= 0) {
this.$message({
message: '拆分数量不能为负数!',
type: 'warning'
})
this.formFields[this.formFields.length - 1].batchQuantity = 1
}
//
let sum = 0
for (let i = 0; i < this.formFields.length; i++) {
sum += Number(this.formFields[i].batchQuantity)
}
//
if (sum > this.productData[0].atrr1) {
this.$message({
message: '你的批次数量总和不能超过拆分数量!',
type: 'warning'
})
this.formFields[this.formFields.length - 1].batchQuantity = Number(this.productData[0].atrr1) - Number(Number(sum) - Number(e))
if (this.formFields[this.formFields.length - 1].batchQuantity <= 0) {
this.formFields[this.formFields.length - 1].batchQuantity = 1
}
}
//
if (this.productData[0].atrr1 == '' || this.productData[0].atrr1 == null) {
this.formFields[this.formFields.length - 1].batchQuantity = ''
}
},
// -
@ -1046,10 +1124,8 @@ export default {
routeCode: this.splitForm.routeCode
}
let check = 1
subSplitOrder(data).then(response => {
if (response.code == 500) {
check = 0
this.$modal.msgError(response.msg)
return
}
@ -1071,104 +1147,8 @@ export default {
batchQuantity: ''
}]
//
getWorkOrderList(id).then(response => {
if (response.code == 500) {
this.$modal.msgError(response.msg)
}
//
this.splitData = response.data
//
this.workerLoading = true // true
this.refreshWorkerTable = false // refreshProTablefalse
this.$nextTick(() => {
// 使$nextTickDOM
this.refreshWorkerTable = true // refreshProTabletrue
this.workerLoading = false // false
})
})
if (check) {
setTimeout(() => {
this.getList()
// 1
this.splitOpen = false
}, 500)
}
},
// -
addField() {
//
let sum = 0
for (let i = 0; i < this.formFields.length; i++) {
sum += Number(this.formFields[i].batchQuantity)
}
if (sum >= this.productData[0].atrr1) {
this.$message({
message: '无法添加!您的批次数量已满!',
type: 'warning'
})
return
}
this.formFields.push({batchCode: '', batchQuantity: ''})
//
this.formFields[this.formFields.length - 1].batchQuantity = Number(this.productData[0].atrr1) - Number(sum)
},
// -
removeField(index) {
this.formFields.splice(index, 1)
},
// -
resetBatch() {
this.eRouteOptions = [],
this.splitForm = {
prodLineCodeArray: [],
id: null,
prodLineCode: [],
splitNum: null,
productDate: null,
shiftId: null,
formFields: []
}
this.splitData = []
this.productData = []
this.proline = []
this.splitnum = null
this.workShift = []
this.formFields = [{
batchCode: '',
batchQuantity: ''
}]
},
// -
inBatch(e) {
//
if (e <= 0) {
this.formFields[this.formFields.length - 1].batchQuantity = 1
}
//
let sum = 0
for (let i = 0; i < this.formFields.length; i++) {
sum += Number(this.formFields[i].batchQuantity)
}
//
if (sum > this.productData[0].atrr1) {
this.$message({
message: '你的批次数量总和不能超过拆分数量!',
type: 'warning'
})
this.formFields[this.formFields.length - 1].batchQuantity = Number(this.productData[0].atrr1) - Number(Number(sum) - Number(e))
if (this.formFields[this.formFields.length - 1].batchQuantity <= 0) {
this.formFields[this.formFields.length - 1].batchQuantity = 1
}
}
//
if (this.productData[0].atrr1 == '' || this.productData[0].atrr1 == null) {
this.formFields[this.formFields.length - 1].batchQuantity = ''
}
},
// --
cancel() {

Loading…
Cancel
Save