Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-uniapp into master_hella

hella_online_20240829
niexiting 4 months ago
parent
commit
000872176b
  1. 3
      .env.development
  2. 5
      .env.hella13
  3. 5
      .env.hella14
  4. 9
      .env.hella15
  5. 9
      .env.hella16
  6. 6
      .env.hella8
  7. 5
      .env.hella9
  8. 5
      .env.production
  9. 5
      .env.test
  10. 27
      src/api/request2.js
  11. 12
      src/pages.json
  12. 287
      src/pages/pointProductReceipt/index.vue
  13. 30
      src/pages/pointProductReceipt/webview.vue
  14. 98
      src/pages/productReceipt/job/fgProductReceiptDetail.vue

3
.env.development

@ -4,3 +4,6 @@ VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/api/admin-api
# 是否是测试环境 # 是否是测试环境
VITE_isDevelopment=true VITE_isDevelopment=true
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25310'

5
.env.hella13

@ -5,4 +5,7 @@ VITE_BASE_URL_IMAGE=http://172.21.32.13:81/admin-api
VITE_TENANT='[{"text":"长春","value":1}]' VITE_TENANT='[{"text":"长春","value":1}]'
# 是否是测试环境 # 是否是测试环境
VITE_isDevelopment=false VITE_isDevelopment=false
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.21.32.13:90'

5
.env.hella14

@ -5,4 +5,7 @@ VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api
VITE_TENANT='[{"text":"长春","value":1}]' VITE_TENANT='[{"text":"长春","value":1}]'
# 是否是测试环境 # 是否是测试环境
VITE_isDevelopment=false VITE_isDevelopment=false
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.21.32.14:90'

9
.env.hella15

@ -1,8 +1,11 @@
VITE_BASE_URL=http://172.21.32.15:81/api/admin-api VITE_BASE_URL=https://scp.faway-hella.com:81/api/admin-api
VITE_BASE_URL_IMAGE=http://172.21.32.15:81/admin-api VITE_BASE_URL_IMAGE=https://scp.faway-hella.com:81/admin-api
# 租户配置 # 租户配置
VITE_TENANT='[{"text":"长春","value":1}]' VITE_TENANT='[{"text":"长春","value":1}]'
# 是否是测试环境 # 是否是测试环境
VITE_isDevelopment=false VITE_isDevelopment=false
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='https://scp.faway-hella.com'

9
.env.hella16

@ -1,8 +1,11 @@
VITE_BASE_URL=http://172.21.32.16:81/api/admin-api VITE_BASE_URL=https://scptest.faway-hella.com:81/api/admin-api
VITE_BASE_URL_IMAGE=http://172.21.32.16:81/admin-api VITE_BASE_URL_IMAGE=https://scptest.faway-hella.com:81/admin-api
# 租户配置 # 租户配置
VITE_TENANT='[{"text":"长春","value":1},{"text":"成都","value":2}]' VITE_TENANT='[{"text":"长春","value":1},{"text":"成都","value":2}]'
# 是否是测试环境 # 是否是测试环境
VITE_isDevelopment=false VITE_isDevelopment=false
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='https://scptest.faway-hella.com'

6
.env.hella8

@ -5,4 +5,8 @@ VITE_BASE_URL_IMAGE=http://172.22.32.8:81/admin-api
VITE_TENANT='[{"text":"成都","value":2}]' VITE_TENANT='[{"text":"成都","value":2}]'
# 是否是测试环境 # 是否是测试环境
VITE_isDevelopment=false VITE_isDevelopment=false
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.22.32.8:90'

5
.env.hella9

@ -5,4 +5,7 @@ VITE_BASE_URL_IMAGE=http://172.22.32.9:81/admin-api
VITE_TENANT='[{"text":"成都","value":2}]' VITE_TENANT='[{"text":"成都","value":2}]'
# 是否是测试环境 # 是否是测试环境
VITE_isDevelopment=false VITE_isDevelopment=false
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.22.32.9:90'

5
.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_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 VITE_isDevelopment=false
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.21.32.14:90'

5
.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_TENANT='[{"text":"长春","value":1},{"text":"成都","value":2}]'
# 是否是测试环境 # 是否是测试环境
VITE_isDevelopment=false VITE_isDevelopment=false
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25310'

27
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,
});
}
/** /**
* 查询库存通过多种条件 高级筛选 * 查询库存通过多种条件 高级筛选

12
src/pages.json

@ -2037,6 +2037,18 @@
"navigationBarTitleText": "打印", "navigationBarTitleText": "打印",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},{
"path": "pages/pointProductReceipt/index",
"style": {
"navigationBarTitleText": "打印",
"enablePullDownRefresh": false
}
},{
"path": "pages/pointProductReceipt/webview",
"style": {
"navigationBarTitleText": "打印",
"enablePullDownRefresh": false
}
}, },
{ {
"path": "pages/print/index", "path": "pages/print/index",

287
src/pages/pointProductReceipt/index.vue

@ -0,0 +1,287 @@
<template>
<view class="content" style="padding:30rpx 20rpx 100rpx;min-height: calc(100vh - 120rpx);">
<!-- 只用于展示页面 -->
<view class="box" v-for="(item,index) in data" :key='index' style="margin-bottom: 20rpx;">
<view class="left">
<view class="left-item">
<view class="label">物品代码</view>
<view class="value" id="name1">{{item.itemCode}}</view>
</view>
<view class="left-item">
<view class="label">物品名称</view>
<view class="value" id="name2">{{item.itemName}}</view>
</view>
<view class="left-item">
<view class="label">物料描述</view>
<view class="value">{{item.itemDesc1}}</view>
</view>
<view class="left-item">
<view class="label">包装号</view>
<view class="value">{{item.relateNumber}}</view>
</view>
<view class="left-item">
<view class="label">生产线</view>
<view class="value">{{item.productionLineCode}}</view>
</view>
<view class="left-item">
<view class="label">数量</view>
<view class="value">{{item.qty}}</view>
</view>
</view>
<view class="right">
<view class="image">
<l-qrcode ref="qrcodeRef" :value="item.barcodeString" size="300rpx"></l-qrcode>
</view>
<view class="left-item">
<view class="label">批次</view>
<view class="value">{{item.batch}}</view>
</view>
<view class="left-item">
<view class="label">班次</view>
<view class="value">{{item.shiftCode}}</view>
</view>
<view class="left-item" >
<view class="label">打印时间</view>
<view class="value">{{item.printTimes}}</view>
</view>
</view>
</view>
<view class="" style="position: fixed;width: 100%;bottom: 0rpx;left: 0px;">
<button @click="printImage"
style='background:rgb(60, 156, 255) !important ;color: white;margin-top: 80rpx;'> 打印</button>
</view>
</view>
</template>
<script>
//
const htmlFileUrl = '/hybrid/html/point.html';
import {
pathToBase64
} from "../../api/img-to-base64.js" //js
// #ifdef APP
var testModule = uni.requireNativePlugin("TestModule")
// #endif
export default {
name: 'pointProductReceipt',
data() {
return {
data: {},
newHtmlContent: '', //html
isLoadFinish: false,
}
},
methods: {
// #ifdef APP
//
printImage() {
testModule.doHTMLPrint(this.newHtmlContent)
},
// html
readFile(path, callback) {
plus.io.resolveLocalFileSystemURL(path, function(entry) {
entry.file(function(file) {
var reader = new plus.io.FileReader();
reader.onloadend = function(e) {
callback(e.target.result);
};
reader.readAsText(file);
}, function(e) {
console.log("读取文件失败:" + e.message);
});
}, function(e) {
console.log("获取图片资源失败:" + e.message);
});
}
// #endif
},
watch: {
isLoadFinish(newVal, oldVal) {
if (newVal == true) {
// html
let str = ''
this.readFile(htmlFileUrl, (htmlContent) => {
this.newHtmlContent = htmlContent
this.data.forEach(item => {
str += `<div class="box" style="page-break-before:always;"><br />
<div class="left">
<div class="left-item">
<div class="label">物品代码</div>
<div class="value" id="name1">${item.itemCode}</div>
</div>
<div class="left-item">
<div class="label">物品名称</div>
<div class="value" id="name2">${item.itemName}</div>
</div>
<view class="left-item">
<view class="label">物料描述</view>
<view class="value">{{item.itemDesc1}}</view>
</view>
<view class="left-item">
<view class="label">包装号</view>
<view class="value">{{item.relateNumber}}</view>
</view>
<view class="left-item">
<view class="label">生产线</view>
<view class="value">{{item.productionLineCode}}</view>
</view>
<view class="left-item">
<view class="label">数量</view>
<view class="value">{{item.qty}}</view>
</view>
</div>
<div class="right">
<div class="image">
<img id='image1' src="${item.barcodeBase64}" alt="" />
</div>
<view class="left-item">
<view class="label">批次</view>
<view class="value">{{item.batch}}</view>
</view>
<view class="left-item">
<view class="label">班次</view>
<view class="value">{{item.shiftCode}}</view>
</view>
<view class="left-item">
<view class="label">打印时间</view>
<view class="value">{{item.printTimes}}</view>
</view>
</div>
</div>`
})
this.newHtmlContent = this.newHtmlContent.replace(
"mainBody", str); //
console.log(this.newHtmlContent)
});
}
}
},
onLoad(option) {
if (option.points) {
this.data = JSON.parse(option.points);
}
},
async onShow() {
//
// this.data = [{
// itemNumber: '555555',
// itemName: 'hahah',
// referenceOrderRow: '55',
// referenceOrderCode: '55',
// supplierCode: '555',
// packageCode: '9999-8888',
// amount: '55',
// barcodeString: 'HMQ;V1.0;Dwork1-line1;F;R2024-04-03T08:28:41;B20240403;PPN0403-000005;I399.960-12;Q5.000000;UEA;',
// barcodeBase64: ''
// }, {
// itemNumber: '66',
// itemName: 'hahah',
// referenceOrderRow: '66',
// referenceOrderCode: '666',
// supplierCode: '66',
// packageCode: '66666',
// amount: '666666',
// barcodeString: 'HMQ;V1.0;Dwork1-line1;F;R2024-04-03T08:28:41;B20240403;PPN0403-000005;I399.960-12;Q5.000000;UEA;',
// barcodeBase64: ''
// }, {
// itemNumber: '66',
// itemName: 'hahah',
// referenceOrderRow: '66',
// referenceOrderCode: '666',
// supplierCode: '66',
// packageCode: '66666',
// amount: '666666',
// barcodeString: 'HMQ;V1.0;Dwork1-line1;F;R2024-04-03T08:28:41;',
// barcodeBase64: ''
// }]
this.$nextTick(async () => {
//
const el = this.$refs['qrcodeRef']
let str = ''
el.forEach(async (item, index) => {
await item.canvasToTempFilePath({
success: async (res) => {
// base64
await pathToBase64(res.tempFilePath).then(base64 => {
this.data[index].barcodeBase64 = base64
if (index == el.length - 1) {
this.isLoadFinish = true
}
}).catch(err => {
console.log(err);
})
},
fail(err) {
console.log('err:::', err)
}
})
})
})
},
}
</script>
<style>
.box {
font-size: 24rpx;
display: flex;
}
.left {
border-top: 1px solid #b1b1b1;
border-left: 1px solid #b1b1b1;
flex: 1;
}
.left-item {
display: flex;
}
.label {
border-bottom: 1px solid #b1b1b1;
border-right: 1px solid #b1b1b1;
width: 140rpx;
padding: 0px 10rpx;
height: 100rpx;
line-height: 100rpx;
}
.value {
border-bottom: 1px solid #b1b1b1;
border-right: 1px solid #b1b1b1;
padding: 0px 5px;
height: 100rpx;
flex: 1;
width: 0px;
display: flex;
align-items: center;
word-wrap: break-word;
}
.right {
width: 300rpx;
}
.image {
width: 100%;
height: 301rpx;
border-bottom: 1px solid #b1b1b1;
border-top: 1px solid #b1b1b1;
border-right: 1px solid #b1b1b1;
}
.image img {
width: calc(100% - 4px);
height: calc(100% - 4px);
margin: 4rpx;
}
</style>

30
src/pages/pointProductReceipt/webview.vue

@ -0,0 +1,30 @@
<template>
<view v-if="webUrl">
<web-view :webview-styles="webviewStyles" :src="`${webUrl}`"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
webUrl: '',
webviewStyles: {
progress: {
color: "#FF3333"
}
}
}
},
props: {
src: {
type: [String],
default: null
}
},
onLoad(event) {
let webData = JSON.parse(event.webData)
this.webUrl = event.url+'?token='+webData.token+'&asn_number='+webData.asn_number
}
}
</script>

98
src/pages/productReceipt/job/fgProductReceiptDetail.vue

@ -49,10 +49,10 @@
<view class="page-footer"> <view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<locationCompare title="收货库位" :isShowEdit="jobContent.allowModifyLocation=='TRUE'" :recommendLocationCode="jobToLocationCode" <locationCompare title="收货库位" :isShowEdit="jobContent.allowModifyLocation=='TRUE'"
:locationCode="toLocationCode" @getLocation='scanLocationCode' :recommendLocationCode="jobToLocationCode" :locationCode="toLocationCode"
:locationTypeList="toLocationTypeList"></locationCompare> @getLocation='scanLocationCode' :locationTypeList="toLocationTypeList"></locationCompare>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -75,7 +75,10 @@
getProductReceiptJobDetail, getProductReceiptJobDetail,
takeProductReceiptJob, takeProductReceiptJob,
cancleTakeProductReceiptJob, cancleTakeProductReceiptJob,
productReceiptJobsubmit productReceiptJobsubmit,
getPrintProductReceiptList,
getBalanceToPackage,
batchPrintingLable
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
@ -109,6 +112,7 @@
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue" import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue"
import storage from '@/common/utils/storage.js'
export default { export default {
name: 'receipt_detail', name: 'receipt_detail',
@ -286,10 +290,10 @@
pack.handleQty = calc.add(pack.handleQty, fg.qty); pack.handleQty = calc.add(pack.handleQty, fg.qty);
// item.qty = calc.add(item.qty, detail.qty); // item.qty = calc.add(item.qty, detail.qty);
} }
}) })
// //
if(pack.scaned&&pack.qty==pack.fgList.length){ if (pack.scaned && pack.qty == pack.fgList.length) {
this.commit() 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() { commit() {
// this.scanCount = getScanCount(this.subList); // this.scanCount = getScanCount(this.subList);
// if (this.scanCount == 0) { // if (this.scanCount == 0) {
@ -466,7 +543,8 @@
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1) // navigateBack(1)
this.print()
}) })
}, },

Loading…
Cancel
Save