计划管理优化

yangwl
wws 1 year ago
parent 8c0e62b1f9
commit 534ebef16c

@ -54,16 +54,16 @@
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="订单类型" prop="status"> <!-- <el-form-item label="订单类型" prop="status">-->
<el-select v-model="queryParams.orderType" placeholder="请选择订单类型" clearable> <!-- <el-select v-model="queryParams.orderType" placeholder="请选择订单类型" clearable>-->
<el-option <!-- <el-option-->
v-for="dict in dict.type.product_type" <!-- v-for="dict in dict.type.product_type"-->
:key="dict.value" <!-- :key="dict.value"-->
:label="dict.label" <!-- :label="dict.label"-->
:value="dict.value" <!-- :value="dict.value"-->
/> <!-- />-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
@ -797,37 +797,6 @@ export default {
...this.queryParams ...this.queryParams
}, `order_${new Date().getTime()}.xlsx`) }, `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) { 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) { splitNumChange(e) {
@ -944,6 +945,18 @@ export default {
} }
this.product = this.productData[0] 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) { batchCodeChange(e) {
if (this.formFields.length > 1) { if (this.formFields.length > 1) {
@ -962,16 +975,81 @@ export default {
} }
} }
}, },
// - // -
checkDate(e) { addField() {
var now = new Date() //
if (e < now) { let sum = 0
e = now for (let i = 0; i < this.formFields.length; i++) {
this.splitForm.productDate = now sum += Number(this.formFields[i].batchQuantity)
}
if (sum >= this.productData[0].atrr1) {
this.$message({ this.$message({
message: "工单日期不能早于今天", message: '无法添加!您的批次数量已满!',
type: "warning" 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 routeCode: this.splitForm.routeCode
} }
let check = 1
subSplitOrder(data).then(response => { subSplitOrder(data).then(response => {
if (response.code == 500) { if (response.code == 500) {
check = 0
this.$modal.msgError(response.msg) this.$modal.msgError(response.msg)
return return
} }
@ -1071,104 +1147,8 @@ export default {
batchQuantity: '' batchQuantity: ''
}] }]
// this.getList()
getWorkOrderList(id).then(response => { this.splitOpen = false
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() { cancel() {

Loading…
Cancel
Save