Browse Source

打印数据bug 2024/6/18 13:48:02

hella_vue3
zhang_li 3 months ago
parent
commit
3aa0d74ab5
  1. 4
      src/api/request2.js
  2. 15
      src/mycomponents/recommend/recommend.vue
  3. 5
      src/mycomponents/scan/winComScanFg.vue
  4. 12
      src/mycomponents/scan/winScanFgLabel.vue
  5. 4
      src/pages/deliver/job/deliverDetail.vue
  6. 2
      src/pages/package/record/overPackageRecord.vue
  7. 84
      src/pages/pointPutawayJob/index.vue
  8. 6
      src/pages/productReceipt/job/fgProductReceiptDetail.vue
  9. 24
      src/pages/purchaseReceipt/job/receiptDetail.vue

4
src/api/request2.js

@ -2584,6 +2584,6 @@ export function isCheckMesCode(code) {
* 获取上架任务打印明细 * 获取上架任务打印明细
* @param {*} * @param {*}
*/ */
export function getJimuPutawayJobDetail(ids) { export function getJimuPutawayJobDetail(data) {
return http.get("/wms/jimu-report/getPutawayJobDetailForPDA?masterIds="+ids) return http.post("/wms/jimu-report/getPutawayJobDetailForPDA",data)
} }

15
src/mycomponents/recommend/recommend.vue

@ -69,6 +69,21 @@ const props = defineProps({
default: '库位' default: '库位'
} }
}) })
watch(
() => props.detail,
(newVal, oldVal) => {
if (newVal.scaned) {
newVal.copyContent = `HPQ;V1.0;I${newVal.itemCode};P${newVal.packingNumber};B${newVal.batch};Q${newVal.qty}`
} else {
newVal.copyContent = ''
}
console.log('newVal.copyContent', newVal.copyContent)
},
{
immediate: true,
deep: true
}
)
const copy = () => { const copy = () => {
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 // HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100
const content = `HPQ;V1.0;I${props.detail.itemCode};P${props.detail.packingNumber};B${props.detail.batch};Q${props.detail.qty}` const content = `HPQ;V1.0;I${props.detail.itemCode};P${props.detail.packingNumber};B${props.detail.batch};Q${props.detail.qty}`

5
src/mycomponents/scan/winComScanFg.vue

@ -119,6 +119,11 @@ const hide = () => {
// #endif // #endif
} }
const setItemCodeSimulate = (itemCode, scanMsg) => {
itemCode.value = itemCode
scanMsg.value = scanMsg
}
const setItemCode = (itemCodeParams) => { const setItemCode = (itemCodeParams) => {
itemCode.value = itemCodeParams itemCode.value = itemCodeParams
} }

12
src/mycomponents/scan/winScanFgLabel.vue

@ -16,6 +16,9 @@
</view> </view>
</view> </view>
</u-popup> </u-popup>
<!-- 模拟扫描功能 -->
<win-com-scan-fg v-show="false" ref="comscansimulate" @getResult="getScanResult" :isShowHistory="false" :clearResult="true"></win-com-scan-fg>
<com-message ref="comMessageRef" @afterClose="getfocus" /> <com-message ref="comMessageRef" @afterClose="getfocus" />
</view> </view>
</template> </template>
@ -36,6 +39,12 @@ const props = defineProps({
}) })
const show = ref(false) const show = ref(false)
const comscan = ref() const comscan = ref()
const comscansimulate = ref()
//
const simulateScan = (item) => {
comscansimulate.value.setItemCodeSimulate(item.itemCode, item.copyContent)
comscansimulate.value.clickScanMsg()
}
const openScanPopup = (itemCode) => { const openScanPopup = (itemCode) => {
setTimeout((res) => { setTimeout((res) => {
show.value = true show.value = true
@ -84,7 +93,8 @@ defineExpose({
openScanPopup, openScanPopup,
closeScanPopup, closeScanPopup,
losefocus, losefocus,
getfocus getfocus,
simulateScan
}) })
</script> </script>

4
src/pages/deliver/job/deliverDetail.vue

@ -202,7 +202,9 @@ const submit = () => {
const submitJob = () => { const submitJob = () => {
const params = setParams() const params = setParams()
if (params.subList.length == 0) { if (params.subList.length == 0) {
comMessageRef.value.showSuccessMessage('请扫描箱码') uni.hideLoading()
comMessageRef.value.showConfirmMessageModal('请扫描箱码')
return
} }
deliverJobSubmit(params) deliverJobSubmit(params)
.then((res) => { .then((res) => {

2
src/pages/package/record/overPackageRecord.vue

@ -253,7 +253,7 @@ const scanPopupGetFocus = () => {
} }
const commit = () => { const commit = () => {
if (detailSource.value.length > 0 && detailSource.value[0].subList.length > 0) { if (detailSource.value.length > 0 && detailSource.value[0].subList.length > 0) {
if (toPackUnit.value == '包装规格') { if (toPackUnit.value || toPackUnit.value == '包装规格') {
showErrorMessage('请选择目标包装规格') showErrorMessage('请选择目标包装规格')
return return
} }

84
src/pages/pointPutawayJob/index.vue

@ -1,8 +1,8 @@
<template> <template>
<view class="content" style="padding:30rpx 20rpx 100rpx;min-height: calc(100vh - 120rpx);"> <view class="content" style="padding: 30rpx 20rpx 100rpx; min-height: calc(100vh - 120rpx)">
<com-empty-view v-if="data.length == 0"></com-empty-view> <com-empty-view v-if="data.length == 0"></com-empty-view>
<!-- 只用于展示页面 --> <!-- 只用于展示页面 -->
<view class="box" style="margin-bottom: 20rpx;"> <view class="box" style="margin-bottom: 20rpx">
<view class="top"> <view class="top">
<view class="mb-kw"> <view class="mb-kw">
目标库位<text>{{ data.toLocationCode }}</text> 目标库位<text>{{ data.toLocationCode }}</text>
@ -14,10 +14,10 @@
创建人<text>{{ data.creator || '' }}</text> 创建人<text>{{ data.creator || '' }}</text>
</view> </view>
<view class="mb-text"> <view class="mb-text">
创建时间<text>{{data.createTime}}</text> 创建时间<text>{{ formatDate(data.createTime) }}</text>
</view> </view>
</view> </view>
<u-table style="margin-top: 20rpx;"> <u-table style="margin-top: 20rpx">
<u-tr> <u-tr>
<u-th>物品代码</u-th> <u-th>物品代码</u-th>
<u-th>物品描述</u-th> <u-th>物品描述</u-th>
@ -27,7 +27,7 @@
<u-th>数量</u-th> <u-th>数量</u-th>
<u-th>计量单位</u-th> <u-th>计量单位</u-th>
</u-tr> </u-tr>
<u-tr v-for="(cur,key) in data.sublist" :key='key'> <u-tr v-for="(cur, key) in data.sublist" :key="key">
<u-td>{{ cur.itemCode }}</u-td> <u-td>{{ cur.itemCode }}</u-td>
<u-td>{{ cur.itemDesc1 }}</u-td> <u-td>{{ cur.itemDesc1 }}</u-td>
<u-td>{{ cur.batch }}</u-td> <u-td>{{ cur.batch }}</u-td>
@ -38,22 +38,19 @@
</u-tr> </u-tr>
</u-table> </u-table>
</view> </view>
<view class="" style="position: fixed;width: 100%;bottom: 0rpx;left: 0px;"> <view class="" style="position: fixed; width: 100%; bottom: 0rpx; left: 0px">
<button @click="printImage" <button @click="printImage" style="background: rgb(60, 156, 255) !important ; color: white; margin-top: 80rpx">打印</button>
style='background:rgb(60, 156, 255) !important ;color: white;margin-top: 80rpx;'> 打印</button>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { import { getJimuPutawayJobDetail } from '@/api/request2.js'
getJimuPutawayJobDetail import { dateFormat } from '@/common/basic.js'
} from '@/api/request2.js';
// //
const htmlFileUrl = '/hybrid/html/pointPutawayJob.html'; const htmlFileUrl = '/hybrid/html/pointPutawayJob.html'
// #ifdef APP // #ifdef APP
var testModule = uni.requireNativePlugin("TestModule") const testModule = uni.requireNativePlugin('TestModule')
// #endif // #endif
export default { export default {
@ -77,42 +74,52 @@
}, },
// html // html
readFile(path, callback) { readFile(path, callback) {
plus.io.resolveLocalFileSystemURL(path, function(entry) { plus.io.resolveLocalFileSystemURL(
entry.file(function(file) { path,
var reader = new plus.io.FileReader(); function (entry) {
entry.file(
function (file) {
const reader = new plus.io.FileReader()
reader.onloadend = function (e) { reader.onloadend = function (e) {
callback(e.target.result); callback(e.target.result)
}; }
reader.readAsText(file); reader.readAsText(file)
}, function(e) { },
console.log("读取文件失败:" + e.message); function (e) {
}); console.log(`读取文件失败:${e.message}`)
}, function(e) { }
console.log("获取图片资源失败:" + e.message); )
}); },
function (e) {
console.log(`获取图片资源失败:${e.message}`)
} }
)
},
// #endif // #endif
formatDate(val) {
return dateFormat(val)
}
}, },
watch: { watch: {
isLoadFinish: { isLoadFinish: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
if (newVal == true) { if (newVal == true) {
// html // html
} }
}, },
immediate: true immediate: true
} }
}, },
onLoad(option) { onLoad(option) {
if (option.data) { if (option.data) {
this.data = JSON.parse(decodeURIComponent(option.data)); this.data = JSON.parse(decodeURIComponent(option.data))
} }
}, },
async onShow() { async onShow() {
await getJimuPutawayJobDetail(this.data.ids).then(res=>{ await getJimuPutawayJobDetail({
masterIds: this.data.ids
}).then((res) => {
this.data.sublist = res.data this.data.sublist = res.data
}) })
// //
@ -184,7 +191,7 @@
创建人<span>${this.data.creator}</span> 创建人<span>${this.data.creator}</span>
</div> </div>
<div class="mb-text"> <div class="mb-text">
创建时间<span>${this.data.createTime}</span> 创建时间<span>${this.formatDate(this.data.createTime)}</span>
</div> </div>
</div> </div>
<table style="margin-top: 20rpx;" style='border-collapse: collapse;'> <table style="margin-top: 20rpx;" style='border-collapse: collapse;'>
@ -215,16 +222,12 @@
</tr> </tr>
` `
}) })
str = str.replace( str = str.replace('tableTrTd', str1)
"tableTrTd", str1)
// }) // })
this.newHtmlContent = this.newHtmlContent.replace( this.newHtmlContent = this.newHtmlContent.replace('mainBody', str) //
"mainBody", str); // })
});
}) })
}
},
} }
</script> </script>
@ -234,7 +237,6 @@
/* display: flex; */ /* display: flex; */
padding: 20rpx; padding: 20rpx;
border: 1px solid #dedede; border: 1px solid #dedede;
} }
.left { .left {
@ -291,7 +293,6 @@
.mb-kw { .mb-kw {
border-bottom: 1px solid #dedede; border-bottom: 1px solid #dedede;
padding-bottom: 20rpx; padding-bottom: 20rpx;
} }
.mb-kw text { .mb-kw text {
@ -311,6 +312,5 @@
height: auto !important; height: auto !important;
font-size: 24rpx !important; font-size: 24rpx !important;
word-break: break-all; word-break: break-all;
} }
</style> </style>

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

@ -183,7 +183,11 @@ const getDetail = () => {
detailSource.value = getDataSource(subList.value) detailSource.value = getDataSource(subList.value)
detailSource.value.forEach((r) => { detailSource.value.forEach((r) => {
r.subList.forEach((s) => { r.subList.forEach((s) => {
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) s.scaned = true if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) {
s.scaned = true
//
scanPopup.value.simulateScan(s)
}
}) })
}) })
} else { } else {

24
src/pages/purchaseReceipt/job/receiptDetail.vue

@ -386,11 +386,11 @@ const submitJob = () => {
// //
let timerCount = 0 let timerCount = 0
const timer1 = setInterval(async () => { const timer1 = setInterval(async () => {
if (timerCount == 10) { if (timerCount == 15) {
clearInterval(timer1) clearInterval(timer1)
uni.showLoading({ uni.showToast({
title: '跳转打印页面失败', title: '跳转打印页面失败',
mask: true icon: 'none'
}) })
return return
} }
@ -399,23 +399,23 @@ const submitJob = () => {
{ {
column: 'purchaseReceiptRecordNumber', column: 'purchaseReceiptRecordNumber',
action: 'in', action: 'in',
value: res.data value: res.data.number
} }
], ],
pageNo: 1, pageNo: 1,
pageSize: 1000 pageSize: 1000
}).then((res) => { }).then((res1) => {
timerCount += 1 timerCount += 1
console.log(11111) console.log(11111)
if (res.data && res.data.list && res.data.list.length) { if (res1.data && res1.data.list && res1.data.list.length && res1.data.total >= res.data.detailCount) {
uni.hideLoading() uni.hideLoading()
clearInterval(timer1) clearInterval(timer1)
const dataParams = { const dataParams = {
toLocationCode: res.data.list[0].toLocationCode, toLocationCode: res1.data.list[0].toLocationCode,
number: res.data.list[0].number, number: res1.data.list[0].number,
creator: res.data.list[0].creator, creator: res1.data.list[0].creator,
createTime: res.data.list[0].createTime, createTime: res1.data.list[0].createTime,
ids: res.data.list.map((item) => item.masterId).join(',') ids: res1.data.list.map((item) => item.masterId).join(',')
} }
console.log(dataParams) console.log(dataParams)
uni.navigateTo({ uni.navigateTo({
@ -423,7 +423,7 @@ const submitJob = () => {
}) })
} }
}) })
}, 1000) }, 2000)
} else { } else {
showErrorMessage(`提交失败[${res.msg}]`) showErrorMessage(`提交失败[${res.msg}]`)
} }

Loading…
Cancel
Save