From 176182390456f8b7fe2da74cebb210976c6114a2 Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Fri, 19 Apr 2024 13:28:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=A0=87=E7=AD=BE=EF=BC=8C?= =?UTF-8?q?=E5=8C=85=E8=A3=85=E4=BF=A1=E6=81=AF=E5=88=97=E8=A1=A8=EF=BC=8C?= =?UTF-8?q?=E6=B2=A1=E6=9C=89id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/package/index.ts | 5 ++ .../supplierdeliverRequestMain/index.vue | 66 +++++++++++++++++-- .../supplierdeliverRequestMain.data.ts | 51 ++++++++++++++ 3 files changed, 118 insertions(+), 4 deletions(-) diff --git a/src/api/wms/package/index.ts b/src/api/wms/package/index.ts index 316ad8611..57f4e2429 100644 --- a/src/api/wms/package/index.ts +++ b/src/api/wms/package/index.ts @@ -100,3 +100,8 @@ export const createPackageLabel = async (data: PackageVO) => { export const batchPrintingLable = async (data: any) => { return await request.post({ url: `/wms/package/batchPrintingLable`, data }) } + +// 打印标签获取包装列表 +export const getLabel = async (id: number) => { + return await request.get({ url: `/wms/package/getLabel?id=` + id }) +} diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue index 56a4424a1..b720e813e 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue @@ -20,8 +20,8 @@ /> - - +
1111 + + + + @@ -159,7 +163,8 @@ import { SupplierdeliverRequestMainRules, SupplierdeliverRequestDetail, SupplierdeliverRequestDetailRules, - SupplierdeliverRequestDetailLabel + SupplierdeliverRequestDetailLabel, + SupplierdeliverRequestPackage } from './supplierdeliverRequestMain.data' import {   SupplierdeliverInspectionDetail} from '../supplierdeliverInspectionDetail/supplierdeliverInspectionDetail.data' import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' @@ -168,6 +173,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as PurchasePlanDetailApi from '@/api/wms/purchasePlanDetail' import * as ItembasicApi from '@/api/wms/itembasic' import * as SupplierdeliverInspectionDetailApi from '@/api/wms/supplierdeliverInspectionDetail' +import * as PackageApi from '@/api/wms/package' import { PurchasePlanDetail } from '../purchasePlanMain/purchasePlanMain.data' import { addDay } from '@/utils/formatTime' @@ -752,8 +758,60 @@ const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) // 标签打印 +const searchTableRef = ref() const labelPrint = async (row) => { - window.open(src.value + '&asn_number=' + row.asnNumber) + tableObject.loading = true + const subTableDFata = await PackageApi.getLabel(row.masterId) + tableObject.loading = false + const tableObject1 = { + // 当前页 + currentPage: 1, + // 导出加载中 + exportLoading: false, + // 加载中 + loading: false, + // 页数 + pageSize: subTableDFata.length, + params:null, + // 排序 + sort: { + order: '', // 排序规则 + prop: '' // 排序字段 + }, + // 总条数 + total: subTableDFata.length, + // 表格数据 + tableList: subTableDFata, + currentRow:null + } + console.log("标签打印",subTableDFata,tableObject1,SupplierdeliverRequestPackage.allSchemas) + + const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns + + tableColumns.forEach((item) => { + item.width = item.table?.width || 150 + }) + searchTableRef.value.openData("采购收货记录单号",tableObject1,{tableColumns},true) + + // window.open(src.value + '&asn_number=' + row.asnNumber) +} +// 批量打印 +const searchTableSuccess1 = async (formField, searchField, val, formRef, type, row) => { + let rows:any = [] + val.forEach(item=>{ + rows = [...rows,...item.selectionRows.map(item1=>item1.id)] + }) + if(rows.length == 0){ + message.warning("请先选择要打印的数据!") + return + } + await PackageApi.batchPrintingLable(rows.join(',')).then(res => { + console.log(res) + window.open(src.value + '&asn_number=' + res) + }).catch(err => { + console.log(err) + message.error('创建标签失败') + }) } const print = async () => { diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts index 69fe8457c..e7cab7a50 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts @@ -1662,4 +1662,55 @@ export const UploadQualityReport = useCrudSchemas(reactive([ width: 150 }, }, +])) +export const SupplierdeliverRequestPackage = useCrudSchemas(reactive([ + { + label: '包装号', + field: 'number', + sort: 'custom', + isSearch: true, + table: { + width: 180, + fixed: 'left' + }, + }, +{ + label: '物料代码', + field: 'itemCode', + sort: 'custom', + isSearch: true, + table: { + width: 150, + }, + }, +{ + label: '批次', + field: 'batch', + sort: 'custom', + isSearch: true, + table: { + width: 150, + }, + }, +{ + label: '计量单位', + field: 'uom', + sort: 'custom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'SelectV2' + }, + table: { + width: 150, + }, + }, +{ + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150, + }, + }, ])) \ No newline at end of file