Browse Source

打印还原 2024/08/02

hella_vue3
王志国 4 weeks ago
parent
commit
0ca8be2cc4
  1. 95
      src/pages/package/job/overPackageJobDetail.vue
  2. 108
      src/pages/package/record/overPackageRecord.vue
  3. 5
      src/pages/purchaseReceipt/job/receiptDetail.vue

95
src/pages/package/job/overPackageJobDetail.vue

@ -32,7 +32,7 @@
<template v-slot:title> <template v-slot:title>
<view class="card_itemName" style="padding: 3px 5px; font-size: 28rpx"> 打印设置 </view> <view class="card_itemName" style="padding: 3px 5px; font-size: 28rpx"> 打印设置 </view>
</template> </template>
<print ref="printService" @printCode="printCode" @templateCode="templateCode"></print> <!-- <print ref="printService" @printCode="printCode" @templateCode="templateCode"></print>-->
</uni-collapse-item> </uni-collapse-item>
</uni-collapse> </uni-collapse>
</view> </view>
@ -80,7 +80,7 @@ import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comScanPackagePack from '@/pages/package/coms/comScanPackagePack.vue' import comScanPackagePack from '@/pages/package/coms/comScanPackagePack.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import workStation from '@/mycomponents/workStation/workStation.vue' import workStation from '@/mycomponents/workStation/workStation.vue'
import print from '@/mycomponents/print/print.vue' // import print from '@/mycomponents/print/print.vue'
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store // store
const store = useCountStore() const store = useCountStore()
@ -92,8 +92,8 @@ const detailSource = ref([]) // 绑定在页面上的数据源
const detailOptions = ref([]) const detailOptions = ref([])
const scanOptions = ref([]) const scanOptions = ref([])
const jobStatus = ref('') const jobStatus = ref('')
const printDeafult = ref({}) // // const printDeafult = ref({}) //
const templateDeafult = ref({}) // // const templateDeafult = ref({}) //
const scanPopup = ref() const scanPopup = ref()
const comScanPackagePackRef = ref() const comScanPackagePackRef = ref()
const comMessageRef = ref() const comMessageRef = ref()
@ -174,12 +174,12 @@ const getDetail = () => {
subList.value = res.data.subList subList.value = res.data.subList
detailSource.value = getDataSource(detailSource.value, subList.value) detailSource.value = getDataSource(detailSource.value, subList.value)
nextTick(() => { nextTick(() => {
if (uni.getStorageSync('overPackageJobDetailPointParams')) { // if (uni.getStorageSync('overPackageJobDetailPointParams')) {
const overPackageJobDetailPointParams = uni.getStorageSync('overPackageJobDetailPointParams') // const overPackageJobDetailPointParams = uni.getStorageSync('overPackageJobDetailPointParams')
jobContent.value.printerUuid = overPackageJobDetailPointParams.printDeafult.value // jobContent.value.printerUuid = overPackageJobDetailPointParams.printDeafult.value
jobContent.value.modelCode = overPackageJobDetailPointParams.templateDeafult.value // jobContent.value.modelCode = overPackageJobDetailPointParams.templateDeafult.value
printService.value.setDefaultData(overPackageJobDetailPointParams.printDeafult, overPackageJobDetailPointParams.templateDeafult) // printService.value.setDefaultData(overPackageJobDetailPointParams.printDeafult, overPackageJobDetailPointParams.templateDeafult)
} // }
}) })
setTimeout((r) => { setTimeout((r) => {
resizeCollapse() resizeCollapse()
@ -199,14 +199,14 @@ const closeScan = () => {
resizeCollapse() resizeCollapse()
} }
const submit = () => { const submit = () => {
if (!jobContent.value.printerUuid) { // if (!jobContent.value.printerUuid) {
showErrorMessage('请选择打印机') // showErrorMessage('')
return // return
} // }
if (!jobContent.value.modelCode) { // if (!jobContent.value.modelCode) {
showErrorMessage('请选择打印模板') // showErrorMessage('')
return // return
} // }
// //
const itemCodes = [] const itemCodes = []
const locationCode = detailSource.value[0].toLocationCode const locationCode = detailSource.value[0].toLocationCode
@ -264,16 +264,41 @@ const submitJob = () => {
overPageSubmit(params) overPageSubmit(params)
.then((res) => { .then((res) => {
uni.hideLoading() uni.hideLoading()
if (res.data == '打印任务已发送,等待打印机处理!') { // if (res.data == '') {
const list = [] // const list = []
showCommitSuccessMessage(res.data) // showCommitSuccessMessage(res.data)
const overPackageJobDetailPointParams = { // const overPackageJobDetailPointParams = {
printDeafult: printDeafult.value, // printDeafult: printDeafult.value,
templateDeafult: templateDeafult.value // templateDeafult: templateDeafult.value
} // }
uni.setStorageSync('overPackageJobDetailPointParams', overPackageJobDetailPointParams) // uni.setStorageSync('overPackageJobDetailPointParams', overPackageJobDetailPointParams)
// } else {
// showErrorMessage(res.data)
// }
if (res.data) {
let list = [];
res.data.forEach(item => {
list.push({
itemCode: item.itemCode, //
itemName: item.itemName, //
packName: item.packName, //
packageCode: item.number, //
batch: item.batch, //
parentNumber: item.parentNumber, //
itemType: item.itemType, //
asnNumber: item.asnNumber, //ASN
supplierCode: item.supplierCode, //
qty: item.qty, //
printTimes: getCurrDateTime(), //
productionLineCode: item.productionLineCode, //线
barcodeString: item.barcodeString, //
barcodeBase64: '',
})
})
showCommitSuccessMessage("提交成功<br>生成翻包记录<br>", list)
} else { } else {
showErrorMessage(res.data) showErrorMessage("提交失败[" + res.msg + "]")
} }
}) })
.catch((error) => { .catch((error) => {
@ -336,14 +361,14 @@ const setParams = () => {
jobContent.value.creator = creator jobContent.value.creator = creator
return jobContent.value return jobContent.value
} }
const printCode = (e) => { // const printCode = (e) => {
jobContent.value.printerUuid = e.value // jobContent.value.printerUuid = e.value
printDeafult.value = e // printDeafult.value = e
} // }
const templateCode = (e) => { // const templateCode = (e) => {
jobContent.value.modelCode = e.value // jobContent.value.modelCode = e.value
templateDeafult.value = e // templateDeafult.value = e
} // }
const cancel = () => { const cancel = () => {
comMessageRef.value.showQuestionMessage('是否要清空已扫描的物料和目标库位信息?', (res) => { comMessageRef.value.showQuestionMessage('是否要清空已扫描的物料和目标库位信息?', (res) => {
if (res) { if (res) {

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

@ -3,7 +3,7 @@
<view class=""> <view class="">
<com-blank-view @goScan="getBusinessType" v-if="detailSource.length == 0"></com-blank-view> <com-blank-view @goScan="getBusinessType" v-if="detailSource.length == 0"></com-blank-view>
</view> </view>
<print ref="printService" @printCode="printCode" @templateCode="templateCode"></print> <!-- <print ref="printService" @printCode="printCode" @templateCode="templateCode"></print>-->
<view class="page-wraper" v-if="detailSource.length > 0"> <view class="page-wraper" v-if="detailSource.length > 0">
<view class="cen_card" style="background-color: #fff; margin: 10px"> <view class="cen_card" style="background-color: #fff; margin: 10px">
<view class="cell_box uni-flex uni-row"> <view class="cell_box uni-flex uni-row">
@ -79,7 +79,7 @@ import packageTarget from '@/mycomponents/package/packageTarget.vue'
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import packUnit from '@/mycomponents/qty/packUnit.vue' import packUnit from '@/mycomponents/qty/packUnit.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import print from '@/mycomponents/print/print.vue' // import print from '@/mycomponents/print/print.vue'
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store // store
@ -105,8 +105,8 @@ const toPackUnitShow = ref('请选择')
const toPackQty = ref('') const toPackQty = ref('')
const itemCode = ref('') const itemCode = ref('')
const resultData = ref({}) const resultData = ref({})
const printDeafult = ref({}) // // const printDeafult = ref({}) //
const templateDeafult = ref({}) // // const templateDeafult = ref({}) //
const scanPopup = ref() const scanPopup = ref()
const scanLocationCode = ref() const scanLocationCode = ref()
const toPackUnit = ref() const toPackUnit = ref()
@ -114,14 +114,14 @@ const comMessageRef = ref()
const printService = ref() const printService = ref()
onLoad(() => { onLoad(() => {
getBusinessType() getBusinessType()
nextTick(() => { // nextTick(() => {
if (uni.getStorageSync('overPackageRecordPointParams')) { // if (uni.getStorageSync('overPackageRecordPointParams')) {
const overPackageRecordPointParams = uni.getStorageSync('overPackageRecordPointParams') // const overPackageRecordPointParams = uni.getStorageSync('overPackageRecordPointParams')
dataContent.value.printerUuid = overPackageRecordPointParams.printDeafult.value // dataContent.value.printerUuid = overPackageRecordPointParams.printDeafult.value
dataContent.value.modelCode = overPackageRecordPointParams.templateDeafult.value // dataContent.value.modelCode = overPackageRecordPointParams.templateDeafult.value
printService.value.setDefaultData(overPackageRecordPointParams.printDeafult, overPackageRecordPointParams.templateDeafult) // printService.value.setDefaultData(overPackageRecordPointParams.printDeafult, overPackageRecordPointParams.templateDeafult)
} // }
}) // })
}) })
onLoad((option) => { onLoad((option) => {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
@ -295,14 +295,14 @@ const scanPopupGetFocus = () => {
} }
} }
const commit = () => { const commit = () => {
if (!dataContent.value.printerUuid) { // if (!dataContent.value.printerUuid) {
showErrorMessage('请选择打印机') // showErrorMessage('')
return // return
} // }
if (!dataContent.value.modelCode) { // if (!dataContent.value.modelCode) {
showErrorMessage('请选择打印模板') // showErrorMessage('')
return // return
} // }
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 || toPackUnit.value == '包装规格') { if (toPackUnit.value || toPackUnit.value == '包装规格') {
showErrorMessage('请选择目标包装规格') showErrorMessage('请选择目标包装规格')
@ -340,22 +340,46 @@ const submitJob = () => {
overPackageRecordSubmit(params) overPackageRecordSubmit(params)
.then((res) => { .then((res) => {
uni.hideLoading() uni.hideLoading()
// if (res.data) {
// const list = []
// if (res.data == '') {
// showCommitSuccessMessage(res.data)
// const overPackageRecordPointParams = {
// printDeafult: printDeafult.value,
// templateDeafult: templateDeafult.value
// }
// uni.setStorageSync('overPackageRecordPointParams', overPackageRecordPointParams)
// detailSource.value = []
// } else {
// showErrorMessage(res.data)
// }
// showCommitSuccessMessage(`<br><br>${list}`)
// } else {
// showErrorMessage(`[${res.msg}]`)
// }
if (res.data) { if (res.data) {
const list = [] let list = []
if (res.data == '打印任务已发送,等待打印机处理!') { res.data.forEach(item => {
showCommitSuccessMessage(res.data) list.push({
const overPackageRecordPointParams = { itemCode: item.itemCode, //
printDeafult: printDeafult.value, itemName: item.itemName, //
templateDeafult: templateDeafult.value packName: item.packName, //
} packageCode: item.toPackingNumber, //
uni.setStorageSync('overPackageRecordPointParams', overPackageRecordPointParams) batch: item.toBatch, //
detailSource.value = [] parentNumber: item.parentNumber, //
} else { itemType: item.itemType, //
showErrorMessage(res.data) asnNumber: item.asnNumber, //ASN
} supplierCode: item.supplierCode, //
showCommitSuccessMessage(`提交成功<br>生成翻包记录<br>${list}`) qty: item.qty, //
printTimes: getCurrDateTime(), //
productionLineCode: item.productionLineCode, //线
barcodeString: item.barcodeString, //
barcodeBase64: '',
})
})
showCommitSuccessMessage(res.msg)
} else { } else {
showErrorMessage(`提交失败[${res.msg}]`) showErrorMessage("提交失败[" + res.msg + "]")
} }
}) })
.catch((error) => { .catch((error) => {
@ -396,14 +420,14 @@ const setParams = () => {
dataContent.value.creator = creator dataContent.value.creator = creator
return dataContent.value return dataContent.value
} }
const printCode = (e) => { // const printCode = (e) => {
dataContent.value.printerUuid = e.value // dataContent.value.printerUuid = e.value
printDeafult.value = e // printDeafult.value = e
} // }
const templateCode = (e) => { // const templateCode = (e) => {
dataContent.value.modelCode = e.value // dataContent.value.modelCode = e.value
templateDeafult.value = e // templateDeafult.value = e
} // }
const showMessage = (message) => { const showMessage = (message) => {
comMessageRef.value.showMessage(message, (res) => { comMessageRef.value.showMessage(message, (res) => {
if (res) { if (res) {

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

@ -268,9 +268,8 @@ const getScanResult = (result) => {
scanedLength++ scanedLength++
} }
}) })
if (itemDetail.scaned && scanedLength == itemDetail.packList.length) {gth == itemDetail if (itemDetail.scaned && scanedLength == itemDetail.packList.length) {
.packList.length) { itemDetail.scanDate = new Date();
isExit.scanDate = new Date();
showMessage(`箱码【${packingNumber}】已经扫描`) showMessage(`箱码【${packingNumber}】已经扫描`)
} else { } else {
itemDetail.scaned = true itemDetail.scaned = true

Loading…
Cancel
Save