仓库-出库单:出库计划,样式功能调整,打印功能添加

This commit is contained in:
赵正易
2024-03-22 08:36:13 +08:00
parent 1ecac2d4f2
commit cf904b1ffa
4 changed files with 184 additions and 65 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div>
<el-dialog v-bind="$attrs" v-on="$listeners" @open="onOpen" @close="onClose" title="出库单打印" width="860px">
<el-dialog v-loading="loading" v-bind="$attrs" v-on="$listeners" @open="onOpen" @close="onClose" title="出库单打印" width="860px">
<div class="print" id="printDom" ref="printRef">
<div class="print-body-box">
<div class="title">出库单 {{ printData.shipmentNum }}</div>
@@ -42,10 +42,10 @@
<tbody>
<tr v-for="item in printData.materialList">
<td>{{ item.partnumber }}</td>
<td>{{ item.description }}</td>
<td>{{ item.productName }}</td>
<td>{{ item.requireOutNum }}</td>
<td>20</td>
<td>200</td>
<td>{{ item.packageNum }}</td>
<td>{{ item.itemNum }}</td>
<!-- <td>{{ item.stockQuantity }}</td>
<td>{{ item.stockQuantity2 }}</td> -->
</tr>
@@ -70,15 +70,15 @@
</tr>
</thead>
<tbody>
<tr v-if="item.package_code_client !==null" v-for="item in printData.planlList">
<td>{{ item.package_code_client }}</td>
<td>{{ item.partnumber }}</td>
<td>{{ item.location_code }}</td>
<td>{{ item.count }}</td>
<td>{{ item.goods_num_action_count }}</td>
<td>{{ item.outhouse_num }}</td>
<td>{{ item.time }}</td>
<td>{{ item.sort }}</td>
<tr v-if="item.package_code_client !== null" v-for="item in printData.planlList">
<td>{{ item.patchcode }}</td>
<td>{{ item.materialCode }}</td>
<td>{{ item.warehouseCode }}</td>
<td>{{ item.packageNum }}</td>
<td>{{ item.partnumberNum }}</td>
<td>{{ item.requireNum }}</td>
<td>{{ item.patchtime }}</td>
<td>{{ item.outorder }}</td>
</tr>
<tr v-else>
<td :colspan="8"><div class="line"></div></td>
@@ -96,7 +96,7 @@
</div>
</template>
<script>
import { getWmOutOrder } from '@/api/wmsManagement/wmOutOrder.js'
import * as WmOutOrderApi from '@/api/wmsManagement/wmOutOrder.js'
import print from 'print-js'
export default {
inheritAttrs: false,
@@ -108,6 +108,7 @@ export default {
},
data() {
return {
loading: false,
clearData: {},
// 待打印的数据
printData: {
@@ -143,60 +144,40 @@ export default {
this.$emit('update:visible', false)
},
getPrintData() {
this.loading = true
setTimeout(() => {
this.loading = false
}, 30000)
// 出库单主键
const getKey = this.printKey
if (getKey === null) {
this.$message('打印参数异常!', getKey)
return
}
getWmOutOrder(getKey).then((res) => {
WmOutOrderApi.getWmOutOrder(getKey).then((res) => {
const { code, data } = res
if (code == 200) {
// 基本数据
this.printData = data
this.printData.planlList = [
{
package_code_client: 'BNW240318005',
partnumber: '26255122',
location_code: 'A1-01',
count: 15,
goods_num_action_count: 100,
outhouse_num: 100,
time: '240317',
sort: 1,
},
{
package_code_client: null,
partnumber: null,
location_code: null,
count: null,
goods_num_action_count: null,
outhouse_num: null,
time: null,
sort: null,
},
{
package_code_client: 'BNW240318006',
partnumber: '26372445',
location_code: 'A1-01',
count: 5,
goods_num_action_count: 50,
outhouse_num: 100,
time: '240318',
sort: 2,
},
{
package_code_client: 'BNW240318007',
partnumber: '26372445',
location_code: 'A1-01',
count: 5,
goods_num_action_count: 50,
outhouse_num: 100,
time: '240318',
sort: 3,
},
]
// 需求物料清单数据
WmOutOrderApi.getOutoderMatrials({ shipment_num: getKey }).then((res) => {
if (res.code === 200) {
this.printData.materialList = res.data
}
})
WmOutOrderApi.generateOutorderplan({ shipment_num: getKey }).then((res) => {
if (res.code === 200) {
this.printData.planlList = res.data
console.log('generateOutorderplan', res.data)
// 计划出库批次清单
this.loading = false
} else {
this.$message.error('打印参数异常!' + res.msg + getKey)
this.loading = false
}
})
} else {
this.$message('打印参数异常!', getKey)
this.$message.error('打印参数异常!' + getKey)
}
})
},