|
|
|
@ -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 // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
// 使用$nextTick来等待DOM更新完成
|
|
|
|
|
this.refreshWorkerTable = true // 立即将refreshProTable设置为true,显示表格
|
|
|
|
|
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 = ''
|
|
|
|
|
}
|
|
|
|
|
this.getList()
|
|
|
|
|
this.splitOpen = false
|
|
|
|
|
},
|
|
|
|
|
// 拆分-新增-取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|