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 {*}
*/
export function getJimuPutawayJobDetail(ids) {
return http.get("/wms/jimu-report/getPutawayJobDetailForPDA?masterIds="+ids)
export function getJimuPutawayJobDetail(data) {
return http.post("/wms/jimu-report/getPutawayJobDetailForPDA",data)
}

15
src/mycomponents/recommend/recommend.vue

@ -69,6 +69,21 @@ const props = defineProps({
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 = () => {
// 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}`

5
src/mycomponents/scan/winComScanFg.vue

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

12
src/mycomponents/scan/winScanFgLabel.vue

@ -16,6 +16,9 @@
</view>
</view>
</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" />
</view>
</template>
@ -36,6 +39,12 @@ const props = defineProps({
})
const show = ref(false)
const comscan = ref()
const comscansimulate = ref()
//
const simulateScan = (item) => {
comscansimulate.value.setItemCodeSimulate(item.itemCode, item.copyContent)
comscansimulate.value.clickScanMsg()
}
const openScanPopup = (itemCode) => {
setTimeout((res) => {
show.value = true
@ -84,7 +93,8 @@ defineExpose({
openScanPopup,
closeScanPopup,
losefocus,
getfocus
getfocus,
simulateScan
})
</script>

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

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

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

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

84
src/pages/pointPutawayJob/index.vue

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

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

@ -183,7 +183,11 @@ const getDetail = () => {
detailSource.value = getDataSource(subList.value)
detailSource.value.forEach((r) => {
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 {

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

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

Loading…
Cancel
Save