From dcb77279a0cc018ac9c38f8870dbc72e52849546 Mon Sep 17 00:00:00 2001 From: panchengyong Date: Sat, 14 Mar 2026 14:58:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=87=87=E8=B4=AD=E5=88=B0=E8=B4=A7?= =?UTF-8?q?=E5=8D=95=E3=80=81=E5=BA=93=E5=8C=BA=E6=A0=87=E7=AD=BE=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E3=80=81EBOM=E8=A1=A8=E6=A0=BC=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 采购到货单: 新建 arrivalnotice API,重构 Checkin 页面对齐到货通知功能 - 库区标签打印: 新增 LocationLabelPrint 组件,支持单个/批量打印(4列排版) - EBOM: 表格表头和内容不换行,过长截断显示 Made-with: Cursor --- erp-frontend-vue/src/api/arrivalnotice.ts | 141 ++++ .../src/views/Purchasing/Checkin/index.vue | 691 ++++++++++++++++-- erp-frontend-vue/src/views/RD/Ebom/form.vue | 39 +- erp-frontend-vue/src/views/RD/Ebom/index.vue | 24 +- .../components/print/LocationLabelPrint.vue | 171 +++++ .../src/views/mes/wm/location/index.vue | 42 +- 6 files changed, 1041 insertions(+), 67 deletions(-) create mode 100644 erp-frontend-vue/src/api/arrivalnotice.ts create mode 100644 mom-frontend-vue2/src/components/print/LocationLabelPrint.vue diff --git a/erp-frontend-vue/src/api/arrivalnotice.ts b/erp-frontend-vue/src/api/arrivalnotice.ts new file mode 100644 index 0000000..79bedaa --- /dev/null +++ b/erp-frontend-vue/src/api/arrivalnotice.ts @@ -0,0 +1,141 @@ +import request from './request' + +/** 到货通知单 */ +export interface ArrivalNotice { + noticeId?: number + noticeCode?: string + noticeName?: string + poCode?: string + vendorId?: number + vendorCode?: string + vendorName?: string + vendorNick?: string + arrivalDate?: string + contact?: string + tel?: string + status?: string + remark?: string + createTime?: string + updateTime?: string +} + +/** 到货通知单行 */ +export interface ArrivalNoticeLine { + lineId?: number + noticeId?: number + itemId?: number + itemCode?: string + itemName?: string + specification?: string + unitOfMeasure?: string + unitName?: string + quantityArrival?: number + quantityQuanlified?: number + iqcCheck?: string + iqcId?: number + iqcCode?: string + remark?: string + createTime?: string + updateTime?: string +} + +/** 到货通知单查询参数 */ +export interface ArrivalNoticeQuery { + noticeCode?: string + noticeName?: string + poCode?: string + vendorId?: number + vendorName?: string + arrivalDate?: string + status?: string + pageNum?: number + pageSize?: number +} + +export interface ArrivalNoticeListResponse { + rows: ArrivalNotice[] + total: number +} + +export interface ArrivalNoticeLineListResponse { + rows: ArrivalNoticeLine[] + total: number +} + +const NOTICE_BASE = '/mes/wm/arrivalnotice' +const LINE_BASE = '/mes/wm/arrivalnoticeline' + +// ============ 到货通知单 ============ + +/** 查询到货通知单列表 */ +export function listArrivalNotice(query?: ArrivalNoticeQuery): Promise { + return request.get(`${NOTICE_BASE}/list`, { params: query }).then((res: any) => ({ + rows: res.rows || [], + total: res.total || 0 + })) +} + +/** 查询到货通知单详情 */ +export function getArrivalNotice(noticeId: number): Promise { + return request.get(`${NOTICE_BASE}/${noticeId}`).then((res: any) => res.data) +} + +/** 新增到货通知单 */ +export function addArrivalNotice(data: Partial): Promise<{ data?: number }> { + return request.post(NOTICE_BASE, data) +} + +/** 修改到货通知单 */ +export function updateArrivalNotice(data: Partial): Promise { + return request.put(NOTICE_BASE, data) +} + +/** 删除到货通知单 */ +export function deleteArrivalNotice(noticeId: number | number[]): Promise { + const ids = Array.isArray(noticeId) ? noticeId.join(',') : String(noticeId) + return request.delete(`${NOTICE_BASE}/${ids}`) +} + +/** 生成到货通知单编码 */ +export function genArrivalNoticeCode(): Promise { + return request.get('/system/autocode/get/ARRIVALNOTICE_CODE').then((res: any) => res.data ?? res.msg ?? '') +} + +// ============ 到货通知单行 ============ + +/** 查询到货通知单行列表 */ +export function listArrivalNoticeLine(query?: { noticeId?: number; pageNum?: number; pageSize?: number }): Promise { + return request.get(`${LINE_BASE}/list`, { params: query }).then((res: any) => ({ + rows: res.rows || [], + total: res.total || 0 + })) +} + +/** 查询到货通知单行详情 */ +export function getArrivalNoticeLine(lineId: number): Promise { + return request.get(`${LINE_BASE}/${lineId}`).then((res: any) => res.data) +} + +/** 新增到货通知单行 */ +export function addArrivalNoticeLine(data: Partial): Promise { + return request.post(LINE_BASE, data) +} + +/** 修改到货通知单行 */ +export function updateArrivalNoticeLine(data: Partial): Promise { + return request.put(LINE_BASE, data) +} + +/** 删除到货通知单行 */ +export function deleteArrivalNoticeLine(lineId: number | number[]): Promise { + const ids = Array.isArray(lineId) ? lineId.join(',') : String(lineId) + return request.delete(`${LINE_BASE}/${ids}`) +} + +// ============ 状态映射 ============ + +export const ARRIVAL_NOTICE_STATUS_MAP: Record = { + PREPARE: { label: '开立', type: 'info' }, + APPROVING: { label: '提交中', type: 'warning' }, + APPROVED: { label: '待入库', type: 'success' } +} diff --git a/erp-frontend-vue/src/views/Purchasing/Checkin/index.vue b/erp-frontend-vue/src/views/Purchasing/Checkin/index.vue index 6e0388e..f68b7e7 100644 --- a/erp-frontend-vue/src/views/Purchasing/Checkin/index.vue +++ b/erp-frontend-vue/src/views/Purchasing/Checkin/index.vue @@ -2,61 +2,63 @@
- - + + - - + + - - + + - - + + + + + + + + + + + 搜索 + 重置
- 单据 - 查询所有 新增 - 导出 + 导出
- - - - + + + + + + + - - - - - - - - - - - + @@ -118,6 +695,20 @@ onMounted(() => loadData()) .search-card :deep(.el-card__body) { padding-bottom: 0; } .toolbar { margin-bottom: 16px; display: flex; gap: 8px; } .table-footer { margin-top: 16px; display: flex; justify-content: space-between; align-items: center; } -.summary { font-size: 14px; color: #606266; } -.summary .value { color: #409eff; font-weight: bold; margin-right: 20px; } +.dialog-search { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; } +.inline-select { display: flex; align-items: center; gap: 4px; } +.inline-select .mono { font-family: monospace; color: #606266; } +.line-section { margin-top: 12px; } +.line-toolbar { margin-bottom: 8px; } + +.item-dialog-body { display: flex; gap: 12px; min-height: 420px; } +.category-tree { + width: 180px; + min-width: 180px; + border-right: 1px solid #e4e7ed; + padding-right: 12px; +} +.item-table-area { flex: 1; overflow: hidden; } +.item-search-area { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; } +.item-toolbar { margin-bottom: 8px; } diff --git a/erp-frontend-vue/src/views/RD/Ebom/form.vue b/erp-frontend-vue/src/views/RD/Ebom/form.vue index 958c227..d65e77b 100644 --- a/erp-frontend-vue/src/views/RD/Ebom/form.vue +++ b/erp-frontend-vue/src/views/RD/Ebom/form.vue @@ -162,9 +162,9 @@
- + - + - + @@ -165,8 +167,8 @@ {{ getBizTypeLabel(row.businessType) }} - - + + @@ -658,4 +660,14 @@ onMounted(() => { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 13px; } + +/* 表格表头和内容不换行,过长截断显示 */ +.ebom-table-nowrap :deep(.el-table__header th), +.ebom-table-nowrap :deep(.el-table__body td) { + white-space: nowrap; +} +.ebom-table-nowrap :deep(.el-table__body td .cell) { + overflow: hidden; + text-overflow: ellipsis; +} diff --git a/mom-frontend-vue2/src/components/print/LocationLabelPrint.vue b/mom-frontend-vue2/src/components/print/LocationLabelPrint.vue new file mode 100644 index 0000000..21bd97e --- /dev/null +++ b/mom-frontend-vue2/src/components/print/LocationLabelPrint.vue @@ -0,0 +1,171 @@ + + + + + + + diff --git a/mom-frontend-vue2/src/views/mes/wm/location/index.vue b/mom-frontend-vue2/src/views/mes/wm/location/index.vue index 272f37a..2acf09b 100644 --- a/mom-frontend-vue2/src/views/mes/wm/location/index.vue +++ b/mom-frontend-vue2/src/views/mes/wm/location/index.vue @@ -48,6 +48,17 @@ v-hasPermi="['mes:wm:location:remove']" >删除 + + 批量打印 + @@ -107,6 +118,13 @@ @click="handleHiPrint(scope.row)" v-hasPermi="['mes:wm:location:print']" >标签打印 + 简易打印 @@ -240,6 +258,12 @@ 取 消 + + + @@ -247,6 +271,7 @@ import { listLocation, getLocation, delLocation, addLocation, updateLocation, changeFrozenState, setProductMixing, setBatchMixing } from "@/api/mes/wm/location"; import {genCode} from "@/api/system/autocode/rule" import BarcodeImg from "@/components/barcodeImg/index.vue" +import LocationLabelPrint from "@/components/print/LocationLabelPrint.vue" import { getBarcodeUrl } from '@/api/mes/wm/barcode'; import {print} from "../../../../utils/print" import {getByTemplateType} from "@/api/print/template"; @@ -255,7 +280,7 @@ export default { name: "Location", dicts: ['sys_yes_no'], mixins: [hiprintMixin], - components: { BarcodeImg } , + components: { BarcodeImg, LocationLabelPrint }, data() { return { //自动生成编码 @@ -266,6 +291,7 @@ export default { loading: true, // 选中数组 ids: [], + selectedRows: [], // 非单个禁用 single: true, // 非多个禁用 @@ -280,6 +306,9 @@ export default { title: "", // 是否显示弹出层 open: false, + // 简易打印弹窗 + printDialogVisible: false, + printLocations: [], // 查询参数 queryParams: { pageNum: 1, @@ -314,6 +343,16 @@ export default { this.getList(); }, methods: { + // 简易打印(不依赖MinIO,纯前端二维码+window.print) + handleSimplePrint(row) { + this.printLocations = [row] + this.printDialogVisible = true + }, + // 批量打印 + handleBatchPrint() { + this.printLocations = this.selectedRows || this.locationList.filter(l => this.ids.includes(l.locationId)) + this.printDialogVisible = true + }, // 使用HiPrint打印 async handleHiPrint(row) { let printData = row @@ -393,6 +432,7 @@ export default { // 多选框选中数据 handleSelectionChange(selection) { this.ids = selection.map(item => item.locationId) + this.selectedRows = selection this.single = selection.length!==1 this.multiple = !selection.length },