Browse Source

装配收货H5端打印功能

hella_online_20240829
yufei0306 4 months ago
parent
commit
3eb6e4ff0f
  1. 17
      src/api/request2.js
  2. 3
      src/pages/pointProductReceipt/webview.vue
  3. 50
      src/pages/productReceipt/job/fgProductReceiptDetail.vue

17
src/api/request2.js

@ -3897,7 +3897,24 @@ export function getPrintProductReceiptList(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,
});
}
/** /**
* 查询库存通过多种条件 高级筛选 * 查询库存通过多种条件 高级筛选

3
src/pages/pointProductReceipt/webview.vue

@ -23,7 +23,8 @@
} }
}, },
onLoad(event) { onLoad(event) {
this.webUrl = event.url let webData = JSON.parse(event.webData)
this.webUrl = event.url+'?token='+webData.token+'&asn_number='+webData.asn_number
} }
} }
</script> </script>

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

@ -50,9 +50,9 @@
<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>
@ -76,7 +76,9 @@
takeProductReceiptJob, takeProductReceiptJob,
cancleTakeProductReceiptJob, cancleTakeProductReceiptJob,
productReceiptJobsubmit, productReceiptJobsubmit,
getPrintProductReceiptList getPrintProductReceiptList,
getBalanceToPackage,
batchPrintingLable
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
@ -290,7 +292,7 @@
} }
}) })
// //
if(pack.scaned&&pack.qty==pack.fgList.length){ if (pack.scaned && pack.qty == pack.fgList.length) {
this.commit() this.commit()
} }
}) })
@ -342,13 +344,14 @@
}, },
// //
print() { print() {
let _this = this
let packingNumber = [] let packingNumber = []
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
// var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, // var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
// detail.packingNumber, detail.batch); // detail.packingNumber, detail.batch);
// detail.toPackingNumber = info.packingNumber; // detail.toPackingNumber = info.packingNumber;
packingNumber.push(detail.packingNumber) packingNumber.push(detail.packingNumber)
} }
}) })
@ -381,19 +384,38 @@
}); });
}).catch(error => { }).catch(error => {
this.showErrorMessage(error) _this.showErrorMessage(error)
}) })
// #endif // #endif
// #ifdef H5 // #ifdef H5
const webUrl = getBalanceToPackage({
`${import.meta.env.VITE_JMREPORT_BASE_URL}/jmreport/view/922734157577715712?token=${storage.getStorage(storage.constant.token)}&asn_number=${packingNumber.join(',')}` packingNumber: packingNumber.join(',')
uni.navigateTo({ }).then(res => {
url: `/pages/pointProductReceipt/webview?url=${webUrl}` console.log('PC打印', res)
}); _this.getH5BatchPrintingLable(res.data.number)
}).catch(error => {
_this.showErrorMessage(error)
})
// #endif // #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) {

Loading…
Cancel
Save