diff --git a/.env.development b/.env.development index ec745b5e..ff5732c2 100644 --- a/.env.development +++ b/.env.development @@ -4,3 +4,6 @@ VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/api/admin-api # 是否是测试环境 VITE_isDevelopment=true + +# 积木报表请求路径 +VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25310' diff --git a/.env.hella13 b/.env.hella13 index 853c42c2..cb56a1e4 100644 --- a/.env.hella13 +++ b/.env.hella13 @@ -5,4 +5,7 @@ VITE_BASE_URL_IMAGE=http://172.21.32.13:81/admin-api VITE_TENANT='[{"text":"长春","value":1}]' # 是否是测试环境 -VITE_isDevelopment=false \ No newline at end of file +VITE_isDevelopment=false + +# 积木报表请求路径 +VITE_JMREPORT_BASE_URL='http://172.21.32.13:90' diff --git a/.env.hella14 b/.env.hella14 index b36727af..8551225b 100644 --- a/.env.hella14 +++ b/.env.hella14 @@ -5,4 +5,7 @@ VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api VITE_TENANT='[{"text":"长春","value":1}]' # 是否是测试环境 -VITE_isDevelopment=false \ No newline at end of file +VITE_isDevelopment=false + +# 积木报表请求路径 +VITE_JMREPORT_BASE_URL='http://172.21.32.14:90' diff --git a/.env.hella15 b/.env.hella15 index b2e736b3..ec80eb53 100644 --- a/.env.hella15 +++ b/.env.hella15 @@ -1,8 +1,11 @@ -VITE_BASE_URL=http://172.21.32.15:81/api/admin-api -VITE_BASE_URL_IMAGE=http://172.21.32.15:81/admin-api +VITE_BASE_URL=https://scp.faway-hella.com:81/api/admin-api +VITE_BASE_URL_IMAGE=https://scp.faway-hella.com:81/admin-api # 租户配置 VITE_TENANT='[{"text":"长春","value":1}]' # 是否是测试环境 -VITE_isDevelopment=false \ No newline at end of file +VITE_isDevelopment=false + +# 积木报表请求路径 +VITE_JMREPORT_BASE_URL='https://scp.faway-hella.com' diff --git a/.env.hella16 b/.env.hella16 index 2f7a69ed..3dc7cd1c 100644 --- a/.env.hella16 +++ b/.env.hella16 @@ -1,8 +1,11 @@ -VITE_BASE_URL=http://172.21.32.16:81/api/admin-api -VITE_BASE_URL_IMAGE=http://172.21.32.16:81/admin-api +VITE_BASE_URL=https://scptest.faway-hella.com:81/api/admin-api +VITE_BASE_URL_IMAGE=https://scptest.faway-hella.com:81/admin-api # 租户配置 VITE_TENANT='[{"text":"长春","value":1},{"text":"成都","value":2}]' # 是否是测试环境 -VITE_isDevelopment=false \ No newline at end of file +VITE_isDevelopment=false + +# 积木报表请求路径 +VITE_JMREPORT_BASE_URL='https://scptest.faway-hella.com' diff --git a/.env.hella8 b/.env.hella8 index d1fde796..0f69956a 100644 --- a/.env.hella8 +++ b/.env.hella8 @@ -5,4 +5,8 @@ VITE_BASE_URL_IMAGE=http://172.22.32.8:81/admin-api VITE_TENANT='[{"text":"成都","value":2}]' # 是否是测试环境 -VITE_isDevelopment=false \ No newline at end of file +VITE_isDevelopment=false + + +# 积木报表请求路径 +VITE_JMREPORT_BASE_URL='http://172.22.32.8:90' diff --git a/.env.hella9 b/.env.hella9 index cfa01c2a..44e8ef4e 100644 --- a/.env.hella9 +++ b/.env.hella9 @@ -5,4 +5,7 @@ VITE_BASE_URL_IMAGE=http://172.22.32.9:81/admin-api VITE_TENANT='[{"text":"成都","value":2}]' # 是否是测试环境 -VITE_isDevelopment=false \ No newline at end of file +VITE_isDevelopment=false + +# 积木报表请求路径 +VITE_JMREPORT_BASE_URL='http://172.22.32.9:90' diff --git a/.env.production b/.env.production index dbe149eb..9175d1cc 100644 --- a/.env.production +++ b/.env.production @@ -1,4 +1,7 @@ VITE_BASE_URL=http://172.21.32.14:81/api/admin-api VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api # 租户配置 VITE_TENANT='[{"text":"长春","value":1},{"text":"成都","value":2}]' # 是否是测试环境 -VITE_isDevelopment=false \ No newline at end of file +VITE_isDevelopment=false + +# 积木报表请求路径 +VITE_JMREPORT_BASE_URL='http://172.21.32.14:90' diff --git a/.env.test b/.env.test index 6c18a67f..81ff2460 100644 --- a/.env.test +++ b/.env.test @@ -6,4 +6,7 @@ VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api VITE_TENANT='[{"text":"长春","value":1},{"text":"成都","value":2}]' # 是否是测试环境 -VITE_isDevelopment=false \ No newline at end of file +VITE_isDevelopment=false + +# 积木报表请求路径 +VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25310' diff --git a/src/api/request2.js b/src/api/request2.js index f9b6f0ad..e86d383b 100644 --- a/src/api/request2.js +++ b/src/api/request2.js @@ -3888,6 +3888,33 @@ export function getManagementPrecision(params) { }); } +// 装配收货详情--打印功能 +export function getPrintProductReceiptList(params) { + return request({ + url: baseApi + "/wms/barbasic/getBarbasicByPackingNumber", + method: "get", + data: params, + }); +} + +// 根据库存余额获取包装信息进行打印标签 H5 +export function getBalanceToPackage(params) { + return request({ + url: baseApi + "/wms/package/getBalanceToPackage", + method: "get", + data: params, + }); +} + + +// 批量打印标签 H5 +export function batchPrintingLable(params) { + return request({ + url: baseApi + "/wms/package/batchPrintingLable", + method: "post", + data: params, + }); +} /** * 查询库存通过多种条件 高级筛选 diff --git a/src/pages.json b/src/pages.json index 245464b2..9900c2ab 100644 --- a/src/pages.json +++ b/src/pages.json @@ -2037,6 +2037,18 @@ "navigationBarTitleText": "打印", "enablePullDownRefresh": false } + },{ + "path": "pages/pointProductReceipt/index", + "style": { + "navigationBarTitleText": "打印", + "enablePullDownRefresh": false + } + },{ + "path": "pages/pointProductReceipt/webview", + "style": { + "navigationBarTitleText": "打印", + "enablePullDownRefresh": false + } }, { "path": "pages/print/index", diff --git a/src/pages/pointProductReceipt/index.vue b/src/pages/pointProductReceipt/index.vue new file mode 100644 index 00000000..28cb3a00 --- /dev/null +++ b/src/pages/pointProductReceipt/index.vue @@ -0,0 +1,287 @@ + + + + + \ No newline at end of file diff --git a/src/pages/pointProductReceipt/webview.vue b/src/pages/pointProductReceipt/webview.vue new file mode 100644 index 00000000..2b2bcde4 --- /dev/null +++ b/src/pages/pointProductReceipt/webview.vue @@ -0,0 +1,30 @@ + + + diff --git a/src/pages/productReceipt/job/fgProductReceiptDetail.vue b/src/pages/productReceipt/job/fgProductReceiptDetail.vue index 9d93c945..af9309f0 100644 --- a/src/pages/productReceipt/job/fgProductReceiptDetail.vue +++ b/src/pages/productReceipt/job/fgProductReceiptDetail.vue @@ -49,10 +49,10 @@ - - + + @@ -75,7 +75,10 @@ getProductReceiptJobDetail, takeProductReceiptJob, cancleTakeProductReceiptJob, - productReceiptJobsubmit + productReceiptJobsubmit, + getPrintProductReceiptList, + getBalanceToPackage, + batchPrintingLable } from '@/api/request2.js'; import { goHome, @@ -109,6 +112,7 @@ import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" import jobTop from '@/mycomponents/job/jobTop.vue' import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue" + import storage from '@/common/utils/storage.js' export default { name: 'receipt_detail', @@ -286,10 +290,10 @@ pack.handleQty = calc.add(pack.handleQty, fg.qty); // item.qty = calc.add(item.qty, detail.qty); } - }) - // 扫满箱后应该自动提交 - if(pack.scaned&&pack.qty==pack.fgList.length){ - this.commit() + }) + // 扫满箱后应该自动提交 + if (pack.scaned && pack.qty == pack.fgList.length) { + this.commit() } }) }) @@ -338,7 +342,80 @@ } }); }, + //打印功能 + print() { + let _this = this + let packingNumber = [] + this.detailSource.forEach(item => { + item.subList.forEach(detail => { + if (detail.scaned) { + // var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, + // detail.packingNumber, detail.batch); + // detail.toPackingNumber = info.packingNumber; + packingNumber.push(detail.packingNumber) + } + }) + }) + // #ifdef APP + getPrintProductReceiptList({ + packingNumber: packingNumber.join(','), + type: 'MakeLabel' + }).then(res => { + console.log('打印', res) + let pointData = [] + res.data.forEach(item => { + pointData.push({ + barcodeString: item.barcodeString, //标签 + itemCode: item.itemCode || '', //物品代码 + itemName: item.itemName || '', //物品名称 + itemDesc1: item.itemDesc1 || '', //物品描述 + relateNumber: item.relateNumber || '', //relateNumber包装号 + batch: item.batch || '', //批次 + productionLineCode: item.productionLineCode || '', //生产线 + shiftCode: item.shiftCode || '', //班次 + qty: item.qty || '', //数量 + printTimes: item.printTimes || '' //打印时间 + }) + }) + console.log('pointData', pointData) + + uni.navigateTo({ + url: `/pages/pointProductReceipt/index?points=${JSON.stringify(pointData)}` + }); + + }).catch(error => { + _this.showErrorMessage(error) + }) + // #endif + // #ifdef H5 + getBalanceToPackage({ + packingNumber: packingNumber.join(',') + }).then(res => { + console.log('PC打印', res) + _this.getH5BatchPrintingLable(res.data.number) + + }).catch(error => { + _this.showErrorMessage(error) + }) + + // #endif + + }, + getH5BatchPrintingLable( number) { + let _this = this + batchPrintingLable(number).then(resLable => { + console.log('batchPrintingLable', resLable) + const webUrl = `${import.meta.env.VITE_JMREPORT_BASE_URL}/jmreport/view/922734157577715712` + const webData = { + token: storage.getStorage(storage.constant.token), + asn_number: resLable.data + } + uni.navigateTo({ + url: `/pages/pointProductReceipt/webview?url=${webUrl}&webData=${JSON.stringify(webData)}` + }); + }) + }, commit() { // this.scanCount = getScanCount(this.subList); // if (this.scanCount == 0) { @@ -466,7 +543,8 @@ showCommitSuccessMessage(hint) { this.$refs.comMessage.showSuccessMessage(hint, res => { - navigateBack(1) + // navigateBack(1) + this.print() }) },