|
|
|
@ -1,44 +1,71 @@
|
|
|
|
|
<template>
|
|
|
|
|
<Dialog title="打印预览" v-model="dialogVisible" width="1000">
|
|
|
|
|
<!-- 打印预览 -->
|
|
|
|
|
<div class="print-wrap page" ref="print">
|
|
|
|
|
<div class="print-wraps" ref="print">
|
|
|
|
|
<div class="print-wrap page" v-for="item in List" :key="item.id">
|
|
|
|
|
<!-- <div style="display: flex">
|
|
|
|
|
<div style="width: 33%">基础信息:</div>
|
|
|
|
|
</div> -->
|
|
|
|
|
<div style="display: flex; margin-top: 20px">
|
|
|
|
|
<div style="width: 33%">出库单号</div>
|
|
|
|
|
<div style="width: 33%">单据日期</div>
|
|
|
|
|
<div style="width: 33%">单据状态</div>
|
|
|
|
|
<div style="width: 33%">出库单号: {{ item.data.stockNo }}</div>
|
|
|
|
|
<div style="width: 33%"
|
|
|
|
|
>单据日期: {{ formatDate(item.data.createTime, 'YYYY-MM-DD HH:mm') }}</div
|
|
|
|
|
>
|
|
|
|
|
<div style="width: 33%"
|
|
|
|
|
>单据状态: {{ getDictLabel(DICT_TYPE.BIZ_STORAGE_STATUS, item.data.status) }}</div
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="display: flex">
|
|
|
|
|
<div style="width: 33%">出库类型</div>
|
|
|
|
|
<div style="width: 33%">生产订单号</div>
|
|
|
|
|
<div style="width: 33%">出库仓库</div>
|
|
|
|
|
<div style="width: 33%"
|
|
|
|
|
>出库类型:
|
|
|
|
|
{{ getDictLabel(DICT_TYPE.BIZ_STORAGE_OUT_TYPE, item.data.stockInType) }}</div
|
|
|
|
|
>
|
|
|
|
|
<div style="width: 33%">生产订单号: {{ item.data.projectOrderCode }}</div>
|
|
|
|
|
<div style="width: 33%"
|
|
|
|
|
>出库仓库: {{ warehouseList.find((tag) => tag.id === item.data.whId)?.whName }}</div
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="display: flex">
|
|
|
|
|
<div style="width: 33%">领料模式</div>
|
|
|
|
|
<div style="width: 33%">领料车间</div>
|
|
|
|
|
<div style="width: 33%"
|
|
|
|
|
>领料模式:
|
|
|
|
|
{{ getDictLabel(DICT_TYPE.BIZ_STORAGE_OUT_MODE, item.data.materialMode) }}</div
|
|
|
|
|
>
|
|
|
|
|
<div style="width: 33%">领料车间:</div>
|
|
|
|
|
<div style="width: 33%"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="display: flex; margin-top: 50px">
|
|
|
|
|
<div style="width: 33%">创建人</div>
|
|
|
|
|
<div style="width: 33%">创建时间</div>
|
|
|
|
|
<div style="width: 33%"
|
|
|
|
|
>创建人: {{ userList.find((user) => user.id == item.data.creator)?.nickname }}</div
|
|
|
|
|
>
|
|
|
|
|
<div style="width: 33%"
|
|
|
|
|
>创建时间: {{ formatDate(item.data.createTime, 'YYYY-MM-DD HH:mm') }}</div
|
|
|
|
|
>
|
|
|
|
|
<div style="width: 33%"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="display: flex">
|
|
|
|
|
<div style="width: 33%">送审人</div>
|
|
|
|
|
<div style="width: 33%">送审时间</div>
|
|
|
|
|
<div style="width: 33%"
|
|
|
|
|
>送审人:{{ userList.find((user) => user.id == item.data.outbound)?.nickname }}</div
|
|
|
|
|
>
|
|
|
|
|
<div style="width: 33%"
|
|
|
|
|
>送审时间:{{ formatDate(item.data.outboundTime, 'YYYY-MM-DD HH:mm') }}</div
|
|
|
|
|
>
|
|
|
|
|
<div style="width: 33%"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="display: flex">
|
|
|
|
|
<div style="width: 33%">审核人</div>
|
|
|
|
|
<div style="width: 33%">审核时间</div>
|
|
|
|
|
<div style="width: 33%"
|
|
|
|
|
>审核人: {{ userList.find((user) => user.id == item.data.cancel)?.nickname }}</div
|
|
|
|
|
>
|
|
|
|
|
<div style="width: 33%"
|
|
|
|
|
>审核时间: {{ formatDate(item.data.cancelTime, 'YYYY-MM-DD HH:mm') }}</div
|
|
|
|
|
>
|
|
|
|
|
<div style="width: 33%"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<table border="2" cellspacing="0" id="table">
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr
|
|
|
|
|
><td colspan="10"> <div style="text-align: center; width: 100%">物料信息</div></td></tr
|
|
|
|
|
><td colspan="10">
|
|
|
|
|
<div style="text-align: center; width: 100%">物料信息</div></td
|
|
|
|
|
></tr
|
|
|
|
|
>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="xh"> 序号</td>
|
|
|
|
@ -51,20 +78,21 @@
|
|
|
|
|
<td> 本次出库数量 </td>
|
|
|
|
|
<td colspan="3"> 备注 </td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr v-for="item in 8" :key="item.index">
|
|
|
|
|
<td>{{ item }}</td>
|
|
|
|
|
<td colspan="2"></td>
|
|
|
|
|
<td> </td>
|
|
|
|
|
<td> </td>
|
|
|
|
|
<td> </td>
|
|
|
|
|
<td> </td>
|
|
|
|
|
<td> </td>
|
|
|
|
|
<td> </td>
|
|
|
|
|
<td colspan="3"> </td>
|
|
|
|
|
<tr v-for="(tabite, index) in item.matItemDOList" :key="tabite.index">
|
|
|
|
|
<td>{{ index + 1 }}</td>
|
|
|
|
|
<td colspan="2">{{ tabite.projectSubCode }}</td>
|
|
|
|
|
<td>{{ tabite.projectSubName }}</td>
|
|
|
|
|
<td>{{ getDictLabel(DICT_TYPE.BIZ_MATERIAL_TYPE, tabite.materialType) }}</td>
|
|
|
|
|
<td>{{ tabite.spec }}</td>
|
|
|
|
|
<td>{{ getDictLabel(DICT_TYPE.BIZ_MATERIAL_UNIT, tabite.unit) }} </td>
|
|
|
|
|
<td>{{ tabite.stockQuantity }}</td>
|
|
|
|
|
<td>{{ tabite.storageOkQty }}</td>
|
|
|
|
|
<td colspan="3"> {{ tabite.description }}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<!-- 【打印】 -->
|
|
|
|
|
<el-button @click="onPrint" type="primary">打印</el-button>
|
|
|
|
@ -73,13 +101,20 @@
|
|
|
|
|
</Dialog>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import * as StorageApi from '@/api/biz/storage'
|
|
|
|
|
import * as StorageMatApi from '@/api/biz/storagemat'
|
|
|
|
|
import * as WarehouseApi from '@/api/biz/warehouse'
|
|
|
|
|
import { formatDate } from '@/utils/formatTime'
|
|
|
|
|
import * as UserApi from '@/api/system/user'
|
|
|
|
|
|
|
|
|
|
import { DICT_TYPE, getDictLabel } from '@/utils/dict'
|
|
|
|
|
// import { ref, reactive } from 'vue'
|
|
|
|
|
import { Check } from '@element-plus/icons-vue'
|
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
|
|
|
|
|
|
const onPrint = () => {
|
|
|
|
|
// 拿到打印页面dom节点
|
|
|
|
|
const printNode = document.querySelector('.print-wrap')
|
|
|
|
|
const printNode = document.querySelector('.print-wraps')
|
|
|
|
|
if (!printNode) return
|
|
|
|
|
// 页面文档创建一个空的内框架,用于挂载打印节点,并设置一定的样式
|
|
|
|
|
const newIframe: any = document.createElement('iframe')
|
|
|
|
@ -110,7 +145,7 @@ const onPrint = () => {
|
|
|
|
|
|
|
|
|
|
@page {
|
|
|
|
|
size: A4;
|
|
|
|
|
margin:1cm;
|
|
|
|
|
margin:0;
|
|
|
|
|
}
|
|
|
|
|
@media print {
|
|
|
|
|
.page {
|
|
|
|
@ -164,13 +199,34 @@ table {
|
|
|
|
|
const outopen = () => {
|
|
|
|
|
dialogVisible.value = false
|
|
|
|
|
}
|
|
|
|
|
const queryParams: any = ref({
|
|
|
|
|
code: undefined
|
|
|
|
|
})
|
|
|
|
|
const isSelected = ref([1, 3])
|
|
|
|
|
|
|
|
|
|
const List = ref([])
|
|
|
|
|
const warehouseList = ref([])
|
|
|
|
|
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
|
|
|
|
|
/** 打开弹窗 */
|
|
|
|
|
const open = async (type: string, id?: number) => {
|
|
|
|
|
const open = async (fid) => {
|
|
|
|
|
List.value = []
|
|
|
|
|
// console.log(fid)
|
|
|
|
|
fid.forEach(async (id) => {
|
|
|
|
|
const row = {
|
|
|
|
|
data: undefined,
|
|
|
|
|
matItemDOList: []
|
|
|
|
|
}
|
|
|
|
|
row.data = await StorageApi.getStorage(id)
|
|
|
|
|
// 获取库存物料列表信息
|
|
|
|
|
const queryParamsMat = reactive({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 99,
|
|
|
|
|
stockId: id,
|
|
|
|
|
whId: row.data.whId
|
|
|
|
|
})
|
|
|
|
|
row.matItemDOList = await StorageMatApi.getStorageMatPage(queryParamsMat)
|
|
|
|
|
List.value.push(row)
|
|
|
|
|
})
|
|
|
|
|
//仓库信息
|
|
|
|
|
warehouseList.value = await WarehouseApi.getWarehouseSimpList()
|
|
|
|
|
//用户信息,用于底部数据展示
|
|
|
|
|
userList.value = await UserApi.getSimpleUserList()
|
|
|
|
|
dialogVisible.value = true
|
|
|
|
|
}
|
|
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
|
|
|