From f711f88abc5217661d4c59a0bdea1dd0d0453cd1 Mon Sep 17 00:00:00 2001 From: zxy Date: Thu, 26 Mar 2026 16:21:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(storage):=20=E6=B7=BB=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E5=8D=95=E6=89=93=E5=8D=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/heli/storage/index.vue | 96 +++++- .../src/views/heli/storage/print.vue | 318 ++++++++++++++++++ 2 files changed, 410 insertions(+), 4 deletions(-) create mode 100644 mes-ui/mes-ui-admin-vue3/src/views/heli/storage/print.vue diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/index.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/index.vue index acedc40d..6dba4fc4 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/index.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/index.vue @@ -104,10 +104,27 @@ + + - - - + + + @@ -126,7 +143,7 @@ {{ warehouseList.find((tag) => tag.id === scope.row.whId)?.whName }} - + @@ -214,6 +233,9 @@ import * as UserApi from '@/api/system/user' import routeParamsCache from '@/utils/routeParamsCache' import axios from "axios"; import {getAccessToken, getTenantId} from "@/utils/auth"; +import {ElButton, ElTable} from "element-plus"; +import PrintRef from "./print.vue" +import * as PurchaseOrderApi from "@/api/heli/purchaseorder"; defineOptions({ name: 'Storage' }) const message = useMessage() // 消息弹窗 @@ -275,6 +297,29 @@ const resetQuery = () => { queryFormRef.value.resetFields() handleQuery() } +const multipleTableRef: any = ref>() +const multipleSelection: any = ref([]) + +const handleSelectionChange = (val: PurchaseOrderApi.PurchaseOrderVO[]) => { + // 第一步:重置所有行的 isSelected 为 false + list.value.forEach(row => { + row.isSelected = false; + }); + + // 第二步:将当前选中行的 isSelected 设为 true + val.forEach(selectedRow => { + // 找到对应行并更新状态(通过唯一标识符匹配更准确) + const targetRow = list.value.find(row => row.id === selectedRow.id); + if (targetRow) { + targetRow.isSelected = true; + } + }); + multipleSelection.value = val + +} +const tableRowClassName = ({ row }) => { + return row.isSelected ? 'selected-row' : ''; +} /** 导出按钮操作 */ const handleExport = async () => { if (!queryParams.stockNo){ @@ -337,6 +382,43 @@ const openDetail = (active: string, id?: number) => { router.push({ path: '/inventory/storagedetail', query: { type: active, id: id } }) } + +const printRef = ref>() +const isPrint = async () => { + function formatDate(val) { + if (!val) return '' + const date = new Date(val) + return date.toLocaleDateString() + } + + try { + const list = multipleSelection.value|| []; // 安全获取数据 + if(list.length==0){ + message.warning("请选择入库单信息"); + return; + } + //日期 客户名 模具名 件号 零件名称 材料 规格 数量 单价 总价格 要求日期 + //createTime brief projectSubCode blueprintNo boomName compositionName matSpec purchaseAmount unitPrice estimatedPrice requireTime + const data = list?.map((item,idx) => ({ + 编号: idx + 1, + 入库单号: item.stockNo, + 入库类型: getIntDictOptions(DICT_TYPE.HELI_STORAGE_IN_TYPE).find(d => d.value === item.stockInType)?.label || item.stockInType, + 上游单号: item.headerNo, + 入库仓库: warehouseList.value.find(w => w.id === item.whId)?.whName || item.whId, + 即入即出: item.inOutFlag ? '是' : '否', + 单据状态: getIntDictOptions(DICT_TYPE.HELI_STORAGE_IN_STATUS).find(d => d.value === item.status)?.label || item.status, + 创建时间: formatDate(item.createTime), + 提交时间: formatDate(item.keeperTime), + })) || []; + console.log(data) + + // openPrintDialog(newVar) + printRef.value?.open(data,"") + } finally { + } + +} + /** 初始化 **/ const route = useRoute() const routeValue = ref('') @@ -376,3 +458,9 @@ onActivated(() => { getList() }) + diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/print.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/print.vue new file mode 100644 index 00000000..c9bb3bd7 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/print.vue @@ -0,0 +1,318 @@ + + + + +