From 0abee12359e1a8de106cb162f9b26ddea5c98587 Mon Sep 17 00:00:00 2001 From: chenfang Date: Thu, 16 May 2024 20:13:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E5=AD=98=E4=BD=99=E9=A2=9D=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E6=A0=87=E7=AD=BE=E4=B8=8E=E7=BF=BB=E5=8C=85=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/printLabelCorrelation/index.ts | 50 +++++++++++++++ .../wms/inventoryManage/balance/index.vue | 23 +++++-- .../packageoverRecordMain/index.vue | 22 ++++--- .../packageoverRequestMain/index.vue | 63 +------------------ 4 files changed, 81 insertions(+), 77 deletions(-) create mode 100644 src/api/wms/printLabelCorrelation/index.ts diff --git a/src/api/wms/printLabelCorrelation/index.ts b/src/api/wms/printLabelCorrelation/index.ts new file mode 100644 index 000000000..a5370b81c --- /dev/null +++ b/src/api/wms/printLabelCorrelation/index.ts @@ -0,0 +1,50 @@ +import request from '@/config/axios' + +export interface PrintCorrelationVO { + id: number + number: string + labelId: string + labelType: string + available: string +} + +// 查询打印标签关联列表 +export const getPrintCorrelationPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/print-correlation/senior', data }) + } else { + return await request.get({ url: `/wms/print-correlation/page`, params }) + } +} + +// 查询打印标签关联详情 +export const getPrintCorrelation = async (id: number) => { + return await request.get({ url: `/wms/print-correlation/get?id=` + id }) +} + +// 新增打印标签关联 +export const createPrintCorrelation = async (data: PrintCorrelationVO) => { + return await request.post({ url: `/wms/print-correlation/create`, data }) +} + +// 修改打印标签关联 +export const updatePrintCorrelation = async (data: PrintCorrelationVO) => { + return await request.put({ url: `/wms/print-correlation/update`, data }) +} + +// 删除打印标签关联 +export const deletePrintCorrelation = async (id: number) => { + return await request.delete({ url: `/wms/print-correlation/delete?id=` + id }) +} + +// 导出打印标签关联 Excel +export const exportPrintCorrelation = async (params) => { + return await request.download({ url: `/wms/print-correlation/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/wms/print-correlation/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/wms/inventoryManage/balance/index.vue b/src/views/wms/inventoryManage/balance/index.vue index f566ba699..e4a619623 100644 --- a/src/views/wms/inventoryManage/balance/index.vue +++ b/src/views/wms/inventoryManage/balance/index.vue @@ -178,20 +178,31 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { } const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL - +const labelType = ref('') // 标签类别 采购还是制造等 // 标签打印 const handlePoint = async (row) => { console.log(row.packingNumber,445555555555555); PackageApi.getBalanceToPackage(row.packingNumber).then(res => { - console.log(res,66666666666); - // 判断是采购还是制造 - if (res.asnNumber !== null && res.asnNumber !== '') { + console.log(777,res); + if (res.productionLineCode != null) { + labelType.value = 'zz' + } else { + labelType.value = 'cg' + } + PackageApi.batchPrintingLable((res.number)).then((resLable) =>{ + console.log(159,resLable ) + // 判断是采购还是制造 + if (labelType.value == 'cg') { const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) - window.open(src.value+'&asn_number='+res.id) + console.log(159,resLable ) + window.open(src.value+'&asn_number='+resLable) } else { const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) - window.open(src.value+'&asn_number='+res.id) + window.open(src.value+'&asn_number='+resLable) } + }) + }).catch(err => { + console.log(err) }) } diff --git a/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/index.vue b/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/index.vue index 6729c03a1..ec1050a12 100644 --- a/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/index.vue +++ b/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/index.vue @@ -66,6 +66,7 @@ import download from '@/utils/download' import { PackageoverMain,PackageoverMainRules, PackageoverDetail, PackageoverDetailRules } from './packageoverRecordMain.data' import * as PackageoverRecordMainApi from '@/api/wms/packageoverRecordMain' import * as PackageoverRecordDetailApi from '@/api/wms/packageoverRecordDetail' +import * as printLabelCorrelationApi from '@/api/wms/printLabelCorrelation' import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as PackageApi from '@/api/wms/package' import { getAccessToken } from '@/utils/auth' @@ -149,19 +150,22 @@ const handlePoint = async (row) => { } else { labelType.value = 'cg' } - } - }).catch(err => { - console.log(err) - }) - // 判断是采购还是制造 - if (labelType.value == 'cg') { + PackageApi.batchPrintingLable(res.list.map(item1=>item1.number).join(',')).then((resLable) =>{ + console.log(159,resLable ) + + // 判断是采购还是制造 + if (labelType.value == 'cg') { const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) - console.log(159,row.number ) - window.open(src.value+'&asn_number='+row.number) + window.open(src.value+'&asn_number='+resLable) } else { const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) - window.open(src.value+'&asn_number='+row.number) + window.open(src.value+'&asn_number='+resLable) } + }) + } + }).catch(err => { + console.log(err) + }) } /** 详情操作 */ diff --git a/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRequestMain/index.vue b/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRequestMain/index.vue index b05a91479..24f86773b 100644 --- a/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRequestMain/index.vue @@ -74,9 +74,7 @@ - - - +