Browse Source

2024/09/10

master
qiezi 1 year ago
parent
commit
e3bfdaa3af
  1. 3
      src/api/shipment/roll.js
  2. 55
      src/views/modules/finshProduct/outWarehouse/shipmentBox.vue

3
src/api/shipment/roll.js

@ -7,3 +7,6 @@ export const printShipmentRoll = (data) => createAPI(`/shipment/roll/print`,'pos
export const getShipmentRollAllData = (data) => createAPI(`/shipment/roll/all`,'post',data)
export const getShipmentRollDataByShipmentId = (data) => createAPI(`/shipment/roll/box/list`,'post',data)
export const queryShipmentDetailByBox = (data) => createAPI(`/shipment/detail/box`,'post',data)

55
src/views/modules/finshProduct/outWarehouse/shipmentBox.vue

@ -7,7 +7,7 @@ import {
} from '../../../../api/shipment/box'
import {
getShipmentRollAllData,
getShipmentRollDataList, printShipmentRoll,
getShipmentRollDataList, printShipmentRoll, queryShipmentDetailByBox,
removeShipmentRollData,
saveShipmentRollData
} from '../../../../api/shipment/roll'
@ -37,6 +37,12 @@ export default {
},
data(){
return {
labelLoading:false,
labelVisible:false,
shipmentDetailList:[],
box:{
refOrderNo:'',
},
open:false,
endOpen:false,
form:{},
@ -90,7 +96,7 @@ export default {
if (data && data.code === 0){
this.$message.success(data.msg)
if (status === 0){
this.handlePrint(row)
this.handleClickPrint(row)
}
this.$emit('refresh')
}else {
@ -273,9 +279,14 @@ export default {
})
},
handlePrint(row){
if (row.refOrderNo === '' || row.refOrderNo === undefined || row.refOrderNo === null){
this.$message.warning('未选择信息')
return
}
this.printBoxLabel(row);
},
printBoxLabel(row){
this.labelLoading = true;
printShipmentBox(row).then(({data})=>{
if (data && data.code === 0){
let arr = data.rows.map((item)=>{
@ -285,13 +296,16 @@ export default {
item.boxNo = `${dayjs(row.createDate).format("YYMMDDHHmmss")}${(row.boxNo+'').padStart(3,'0')}`
return item
})
this.labelVisible = false;
// printShipmentBoxLabel(arr);
this.printRollLabel(row,arr);
}else {
this.$message.warning(data.msg)
}
this.labelLoading = false;
}).catch((error)=>{
this.$message.error(error)
this.labelLoading = false;
})
},
printRollLabel(row,packList){
@ -314,6 +328,32 @@ export default {
}).catch((error)=>{
this.$message.error(error)
})
},
handleClickPrint(row){
this.box = {
...row,
refOrderNo:'',
}
this.handleQueryShipmenDetail(row);
this.labelVisible = true;
},
handleQueryShipmenDetail(row){
let params = {
...row
}
this.shipmentDetailList = []
queryShipmentDetailByBox(params).then(({data})=>{
if (data && data.code === 0){
this.shipmentDetailList = data.rows
if (this.shipmentDetailList.length > 0){
this.box.refOrderNo = `${this.shipmentDetailList[0].orderNumber}-${this.shipmentDetailList[0].lineNo}-${this.shipmentDetailList[0].relNo}`
}
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
}
},
watch:{
@ -347,11 +387,20 @@ export default {
<el-link v-if="scope.row.status==='已封箱'" @click="handleUpdateBoxStatus(scope.row,1)">解封箱</el-link>
<el-link v-if="scope.row.status==='未封箱'" @click="handleRemoveBox(scope.row)">删除</el-link>
<el-link @click="handleGetRollDataList(scope.row)">查看</el-link>
<el-link v-if="scope.row.status==='已封箱'" @click="handlePrint(scope.row)">补打</el-link>
<el-link v-if="scope.row.status==='已封箱'" @click="handleClickPrint(scope.row)">补打</el-link>
</template>
</el-table-column>
</el-table>
<el-dialog title="标签" :visible.sync="labelVisible" top="20vh" v-drag :close-on-click-modal="false" append-to-body width="280px">
<el-select v-model="box.refOrderNo" style="width: 100%;">
<el-option :label="`${item.orderNumber}-${item.lineNo}-${item.relNo}`" :value="`${item.orderNumber}-${item.lineNo}-${item.relNo}`" v-for="(item,i) in shipmentDetailList" :key="i"></el-option>
</el-select>
<el-footer style="height: 30px;text-align: center;line-height: 30px">
<el-button type="primary" :loading="labelLoading" @click="handlePrint(box)">确定</el-button>
</el-footer>
</el-dialog>
<el-dialog title="扫描" :visible.sync="open" v-drag :close-on-click-modal="false" append-to-body width="1000px">
<el-form :model="form" label-width="100px" label-position="top" >
<el-row :gutter="10">

Loading…
Cancel
Save