|
|
|
|
@ -10,17 +10,22 @@ |
|
|
|
|
@opened="opened" |
|
|
|
|
> |
|
|
|
|
<el-card class="box-card"> |
|
|
|
|
<sForm ref="simpleForm" :formdata="formdata"> </sForm> |
|
|
|
|
<sForm |
|
|
|
|
ref="simpleForm" |
|
|
|
|
:formdata="formdata" |
|
|
|
|
> </sForm> |
|
|
|
|
</el-card> |
|
|
|
|
<div class="opt-box"> |
|
|
|
|
<div class="opt-box-right"> |
|
|
|
|
<el-button type="primary" @click="redFlushTotal">整单冲红</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
@click="redFlushTotal" |
|
|
|
|
>整单冲红</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
@click="redFlushDetial" |
|
|
|
|
:disabled="handleSelect.length === 0" |
|
|
|
|
>所选明细冲红</el-button |
|
|
|
|
> |
|
|
|
|
>所选明细冲红</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="layout-full"> |
|
|
|
|
@ -56,7 +61,10 @@ |
|
|
|
|
:prop="`data.${scope.row.index}.reason`" |
|
|
|
|
:rules="tableForm.rules.reason" |
|
|
|
|
> |
|
|
|
|
<el-select v-model="scope.row.reason" placeholder="请选择"> |
|
|
|
|
<el-select |
|
|
|
|
v-model="scope.row.reason" |
|
|
|
|
placeholder="请选择" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in dict.type.red_reason" |
|
|
|
|
:key="item.value" |
|
|
|
|
@ -73,26 +81,22 @@ |
|
|
|
|
</el-dialog> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
|
import { |
|
|
|
|
getListByOrderNo, |
|
|
|
|
wholeOrderRed, |
|
|
|
|
orderDetailRed, |
|
|
|
|
} from "@/api/exWarehouse/dispatchDistribute"; |
|
|
|
|
import { validateField } from "@/utils/custom.js"; |
|
|
|
|
import { getListByOrderNo, wholeOrderRed, orderDetailRed } from '@/api/exWarehouse/dispatchDistribute' |
|
|
|
|
import { validateField } from '@/utils/custom.js' |
|
|
|
|
export default { |
|
|
|
|
props: ["orderInfo"], |
|
|
|
|
dicts: ["red_reason", "goods_unit"], |
|
|
|
|
props: ['orderInfo'], |
|
|
|
|
dicts: ['red_reason', 'goods_unit'], |
|
|
|
|
data() { |
|
|
|
|
const _that = this; |
|
|
|
|
const _that = this |
|
|
|
|
return { |
|
|
|
|
dialogVisible: false, |
|
|
|
|
formdata: { |
|
|
|
|
type: "view", |
|
|
|
|
width: "100px", |
|
|
|
|
type: 'view', |
|
|
|
|
width: '100px', |
|
|
|
|
data: { |
|
|
|
|
orderNo: "", |
|
|
|
|
companyName: "", |
|
|
|
|
consignorName: "", |
|
|
|
|
orderNo: '', |
|
|
|
|
companyName: '', |
|
|
|
|
consignorName: '' |
|
|
|
|
}, |
|
|
|
|
config: [ |
|
|
|
|
{ |
|
|
|
|
@ -101,25 +105,25 @@ export default { |
|
|
|
|
[ |
|
|
|
|
[ |
|
|
|
|
{ |
|
|
|
|
label: "单据编号:", |
|
|
|
|
prop: "orderNo", |
|
|
|
|
type: "label", |
|
|
|
|
label: '单据编号:', |
|
|
|
|
prop: 'orderNo', |
|
|
|
|
type: 'label' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "单位名称:", |
|
|
|
|
prop: "companyName", |
|
|
|
|
type: "label", |
|
|
|
|
label: '单位名称:', |
|
|
|
|
prop: 'companyName', |
|
|
|
|
type: 'label' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "业主名称:", |
|
|
|
|
prop: "consignorName", |
|
|
|
|
type: "label", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
label: '业主名称:', |
|
|
|
|
prop: 'consignorName', |
|
|
|
|
type: 'label' |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
tableForm: { |
|
|
|
|
data: [], |
|
|
|
|
@ -127,230 +131,222 @@ export default { |
|
|
|
|
redNum: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入冲红数量", |
|
|
|
|
trigger: "change,blur", |
|
|
|
|
}, |
|
|
|
|
message: '请输入冲红数量', |
|
|
|
|
trigger: 'change,blur' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
reason: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请选择冲红原因", |
|
|
|
|
trigger: "change,blur", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
message: '请选择冲红原因', |
|
|
|
|
trigger: 'change,blur' |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
tableProps: { |
|
|
|
|
"max-height": 500, |
|
|
|
|
'max-height': 500 |
|
|
|
|
}, |
|
|
|
|
config: [ |
|
|
|
|
// 表头数据 |
|
|
|
|
{ label: "复选框", type: "selection", prop: "selection", istrue: true }, |
|
|
|
|
{ label: '复选框', type: 'selection', prop: 'selection', istrue: true }, |
|
|
|
|
{ |
|
|
|
|
label: "序号", |
|
|
|
|
prop: "index", |
|
|
|
|
type: "index", |
|
|
|
|
istrue: true, |
|
|
|
|
label: '序号', |
|
|
|
|
prop: 'index', |
|
|
|
|
type: 'index', |
|
|
|
|
istrue: true |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "商品编号", |
|
|
|
|
prop: "goodNo", |
|
|
|
|
istrue: true, |
|
|
|
|
label: '商品编号', |
|
|
|
|
prop: 'goodNo', |
|
|
|
|
istrue: true |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "商品名称", |
|
|
|
|
prop: "goodName", |
|
|
|
|
istrue: true, |
|
|
|
|
label: '商品名称', |
|
|
|
|
prop: 'goodName', |
|
|
|
|
istrue: true |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "商品规格", |
|
|
|
|
prop: "specifications", |
|
|
|
|
istrue: true, |
|
|
|
|
label: '商品规格', |
|
|
|
|
prop: 'specifications', |
|
|
|
|
istrue: true |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// { |
|
|
|
|
// label: '生产厂家', |
|
|
|
|
// prop: 'factory', |
|
|
|
|
// istrue: true |
|
|
|
|
// }, |
|
|
|
|
{ |
|
|
|
|
label: "生产厂家", |
|
|
|
|
prop: "factory", |
|
|
|
|
istrue: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "件装量", |
|
|
|
|
prop: "packageQty", |
|
|
|
|
istrue: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "单位", |
|
|
|
|
prop: "unit", |
|
|
|
|
istrue: true, |
|
|
|
|
filter(row, value) { |
|
|
|
|
return _that.getDictLabel(value, _that.dict.type.goods_unit); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "批号", |
|
|
|
|
prop: "batchNo", |
|
|
|
|
istrue: true, |
|
|
|
|
label: '件装量', |
|
|
|
|
prop: 'packageQty', |
|
|
|
|
istrue: true |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "生产日期", |
|
|
|
|
prop: "productionDate", |
|
|
|
|
istrue: true, |
|
|
|
|
label: '单位', |
|
|
|
|
prop: 'unit', |
|
|
|
|
istrue: true |
|
|
|
|
// filter(row, value) { |
|
|
|
|
// return _that.getDictLabel(value, _that.dict.type.goods_unit); |
|
|
|
|
// }, |
|
|
|
|
}, |
|
|
|
|
// { |
|
|
|
|
// label: '批号', |
|
|
|
|
// prop: 'batchNo', |
|
|
|
|
// istrue: true |
|
|
|
|
// }, |
|
|
|
|
// { |
|
|
|
|
// label: '生产日期', |
|
|
|
|
// prop: 'productionDate', |
|
|
|
|
// istrue: true |
|
|
|
|
// }, |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
label: "有效期", |
|
|
|
|
prop: "expiredDate", |
|
|
|
|
istrue: true, |
|
|
|
|
}, |
|
|
|
|
// { |
|
|
|
|
// label: '有效期', |
|
|
|
|
// prop: 'expiredDate', |
|
|
|
|
// istrue: true |
|
|
|
|
// }, |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
label: "订单总数量", |
|
|
|
|
prop: "qty", |
|
|
|
|
istrue: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "冲红数量", |
|
|
|
|
prop: "redNum", |
|
|
|
|
"min-width": 100, |
|
|
|
|
istrue: true, |
|
|
|
|
type: "slot", |
|
|
|
|
slotName: "redNum", |
|
|
|
|
tooltip: false, |
|
|
|
|
label: '订单总数量', |
|
|
|
|
prop: 'qty', |
|
|
|
|
istrue: true |
|
|
|
|
}, |
|
|
|
|
// { |
|
|
|
|
// label: '冲红数量', |
|
|
|
|
// prop: 'redNum', |
|
|
|
|
// 'min-width': 100, |
|
|
|
|
// istrue: true, |
|
|
|
|
// type: 'slot', |
|
|
|
|
// slotName: 'redNum', |
|
|
|
|
// tooltip: false |
|
|
|
|
// }, |
|
|
|
|
// { |
|
|
|
|
// label: '冲红原因', |
|
|
|
|
// 'min-width': 100, |
|
|
|
|
// prop: 'reason', |
|
|
|
|
// istrue: true, |
|
|
|
|
// type: 'slot', |
|
|
|
|
// slotName: 'reason', |
|
|
|
|
// tooltip: false |
|
|
|
|
// }, |
|
|
|
|
{ |
|
|
|
|
label: "冲红原因", |
|
|
|
|
"min-width": 100, |
|
|
|
|
prop: "reason", |
|
|
|
|
istrue: true, |
|
|
|
|
type: "slot", |
|
|
|
|
slotName: "reason", |
|
|
|
|
tooltip: false, |
|
|
|
|
label: '累计已冲红数量', |
|
|
|
|
prop: 'redQty', |
|
|
|
|
istrue: true |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "累计已冲红数量", |
|
|
|
|
prop: "redQty", |
|
|
|
|
istrue: true, |
|
|
|
|
label: '整件未处理量', |
|
|
|
|
prop: 'noHandleCaseQty', |
|
|
|
|
istrue: true |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "整件未处理量", |
|
|
|
|
prop: "noHandleCaseQty", |
|
|
|
|
istrue: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "零货未处理量", |
|
|
|
|
prop: "noHandlePieceQty", |
|
|
|
|
istrue: true, |
|
|
|
|
}, |
|
|
|
|
label: '零货未处理量', |
|
|
|
|
prop: 'noHandlePieceQty', |
|
|
|
|
istrue: true |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
handleSelect: [], // 选择项 |
|
|
|
|
handleSelectId: [], // 选择项的id |
|
|
|
|
handleSelectMap: [], // 选择项的某些数值对象 |
|
|
|
|
}; |
|
|
|
|
handleSelectMap: [] // 选择项的某些数值对象 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
async open() { |
|
|
|
|
await this.getTableHeaderCom("busin_out_order_d", { |
|
|
|
|
config: this.config, |
|
|
|
|
}); |
|
|
|
|
this.queryTable(); |
|
|
|
|
await this.getTableHeaderCom('busin_out_order_d', { |
|
|
|
|
config: this.config |
|
|
|
|
}) |
|
|
|
|
this.queryTable() |
|
|
|
|
}, |
|
|
|
|
opened() { |
|
|
|
|
this.$refs.simpleForm.resetFormValue(); |
|
|
|
|
this.$refs.simpleForm.setFormValue(this.orderInfo); |
|
|
|
|
this.$refs.simpleForm.resetFormValue() |
|
|
|
|
this.$refs.simpleForm.setFormValue(this.orderInfo) |
|
|
|
|
}, |
|
|
|
|
hasValid(row) { |
|
|
|
|
if (row.redNum > row.qty - row.redQty) { |
|
|
|
|
this.$message.warning("冲红数量不能超过(订单总数量-累计已冲红数量)"); |
|
|
|
|
row.redNum = ""; |
|
|
|
|
} else if (row.redNum === 0 || row.redNum === "0") { |
|
|
|
|
this.$message.warning("冲红数量不能为0"); |
|
|
|
|
row.redNum = ""; |
|
|
|
|
this.$message.warning('冲红数量不能超过(订单总数量-累计已冲红数量)') |
|
|
|
|
row.redNum = '' |
|
|
|
|
} else if (row.redNum === 0 || row.redNum === '0') { |
|
|
|
|
this.$message.warning('冲红数量不能为0') |
|
|
|
|
row.redNum = '' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 整单冲红 |
|
|
|
|
redFlushTotal() { |
|
|
|
|
this.$refs["tableForm"].clearValidate(); |
|
|
|
|
this.$refs["tableForm"].validate((valid) => { |
|
|
|
|
this.$refs['tableForm'].clearValidate() |
|
|
|
|
this.$refs['tableForm'].validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
this.$confirm( |
|
|
|
|
"确认要对整个订单进行冲红吗?冲红后将无法再进行波次安排!", |
|
|
|
|
"冲红确认", |
|
|
|
|
{ |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
} |
|
|
|
|
).then(() => { |
|
|
|
|
this.$confirm('确认要对整个订单进行冲红吗?冲红后将无法再进行波次安排!', '冲红确认', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning' |
|
|
|
|
}).then(() => { |
|
|
|
|
wholeOrderRed({ orderNo: this.orderInfo.orderNo }).then((res) => { |
|
|
|
|
if (res.code === 200) { |
|
|
|
|
this.$message.success("冲红成功"); |
|
|
|
|
this.closeDialog(); |
|
|
|
|
this.$message.success('冲红成功') |
|
|
|
|
this.closeDialog() |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning("校验不通过"); |
|
|
|
|
this.$message.warning('校验不通过') |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
validateField, |
|
|
|
|
// 明细冲红 |
|
|
|
|
redFlushDetial() { |
|
|
|
|
this.$refs["tableForm"].clearValidate(); |
|
|
|
|
let arr = []; |
|
|
|
|
this.$refs['tableForm'].clearValidate() |
|
|
|
|
let arr = [] |
|
|
|
|
this.tableForm.data.forEach((ele, index) => { |
|
|
|
|
if (this.handleSelectId.includes(ele.id)) { |
|
|
|
|
arr.push(this.validateField("tableForm", index)); |
|
|
|
|
arr.push(this.validateField('tableForm', index)) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
if (arr.some((k) => !k)) { |
|
|
|
|
// 校验的某一行有不通过的就都不通过 |
|
|
|
|
this.$message.warning("校验不通过"); |
|
|
|
|
this.$message.warning('校验不通过') |
|
|
|
|
} else { |
|
|
|
|
this.$confirm( |
|
|
|
|
"确认要对所选明细进行数量冲红吗?冲红后的数量将无法进行拣选!", |
|
|
|
|
"冲红确认", |
|
|
|
|
{ |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
} |
|
|
|
|
).then(() => { |
|
|
|
|
this.$confirm('确认要对所选明细进行数量冲红吗?冲红后的数量将无法进行拣选!', '冲红确认', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning' |
|
|
|
|
}).then(() => { |
|
|
|
|
this.handleSelectMap = this.handleSelect.map((ele) => { |
|
|
|
|
return { |
|
|
|
|
id: ele.id, |
|
|
|
|
redQty: ele.redNum, |
|
|
|
|
reason: ele.reason, |
|
|
|
|
}; |
|
|
|
|
}); |
|
|
|
|
reason: ele.reason |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
orderDetailRed(this.handleSelectMap).then((res) => { |
|
|
|
|
if (res.code === 200) { |
|
|
|
|
this.$message.success("冲红成功"); |
|
|
|
|
this.closeDialog(); |
|
|
|
|
this.$message.success('冲红成功') |
|
|
|
|
this.closeDialog() |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 关闭弹框 |
|
|
|
|
closeDialog() { |
|
|
|
|
this.dialogVisible = false; |
|
|
|
|
this.$emit("toReset"); |
|
|
|
|
this.dialogVisible = false |
|
|
|
|
this.$emit('toReset') |
|
|
|
|
}, |
|
|
|
|
// 初始化列表 |
|
|
|
|
queryTable() { |
|
|
|
|
getListByOrderNo(this.orderInfo.orderNo).then((res) => { |
|
|
|
|
if (res.code === 200) { |
|
|
|
|
this.tableForm.data = res.data; |
|
|
|
|
this.tableForm.data = res.data |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleselection(data) { |
|
|
|
|
this.handleSelect = data; |
|
|
|
|
this.handleSelectId = data.map((ele) => ele.id); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
this.handleSelect = data |
|
|
|
|
this.handleSelectId = data.map((ele) => ele.id) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
<style rel="stylesheet/scss" lang="scss" scoped> |
|
|
|
|
.box-card { |
|
|
|
|
|