Browse Source

打印还原 2024/08/02

hella_vue3
王志国 1 month 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>
<view class="card_itemName" style="padding: 3px 5px; font-size: 28rpx"> 打印设置 </view>
</template>
<print ref="printService" @printCode="printCode" @templateCode="templateCode"></print>
<!-- <print ref="printService" @printCode="printCode" @templateCode="templateCode"></print>-->
</uni-collapse-item>
</uni-collapse>
</view>
@ -80,7 +80,7 @@ import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comScanPackagePack from '@/pages/package/coms/comScanPackagePack.vue'
import jobTop from '@/mycomponents/job/jobTop.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'
// store
const store = useCountStore()
@ -92,8 +92,8 @@ const detailSource = ref([]) // 绑定在页面上的数据源
const detailOptions = ref([])
const scanOptions = ref([])
const jobStatus = ref('')
const printDeafult = ref({}) //
const templateDeafult = ref({}) //
// const printDeafult = ref({}) //
// const templateDeafult = ref({}) //
const scanPopup = ref()
const comScanPackagePackRef = ref()
const comMessageRef = ref()
@ -174,12 +174,12 @@ const getDetail = () => {
subList.value = res.data.subList
detailSource.value = getDataSource(detailSource.value, subList.value)
nextTick(() => {
if (uni.getStorageSync('overPackageJobDetailPointParams')) {
const overPackageJobDetailPointParams = uni.getStorageSync('overPackageJobDetailPointParams')
jobContent.value.printerUuid = overPackageJobDetailPointParams.printDeafult.value
jobContent.value.modelCode = overPackageJobDetailPointParams.templateDeafult.value
printService.value.setDefaultData(overPackageJobDetailPointParams.printDeafult, overPackageJobDetailPointParams.templateDeafult)
}
// if (uni.getStorageSync('overPackageJobDetailPointParams')) {
// const overPackageJobDetailPointParams = uni.getStorageSync('overPackageJobDetailPointParams')
// jobContent.value.printerUuid = overPackageJobDetailPointParams.printDeafult.value
// jobContent.value.modelCode = overPackageJobDetailPointParams.templateDeafult.value
// printService.value.setDefaultData(overPackageJobDetailPointParams.printDeafult, overPackageJobDetailPointParams.templateDeafult)
// }
})
setTimeout((r) => {
resizeCollapse()
@ -199,14 +199,14 @@ const closeScan = () => {
resizeCollapse()
}
const submit = () => {
if (!jobContent.value.printerUuid) {
showErrorMessage('请选择打印机')
return
}
if (!jobContent.value.modelCode) {
showErrorMessage('请选择打印模板')
return
}
// if (!jobContent.value.printerUuid) {
// showErrorMessage('')
// return
// }
// if (!jobContent.value.modelCode) {
// showErrorMessage('')
// return
// }
//
const itemCodes = []
const locationCode = detailSource.value[0].toLocationCode
@ -264,16 +264,41 @@ const submitJob = () => {
overPageSubmit(params)
.then((res) => {
uni.hideLoading()
if (res.data == '打印任务已发送,等待打印机处理!') {
const list = []
showCommitSuccessMessage(res.data)
const overPackageJobDetailPointParams = {
printDeafult: printDeafult.value,
templateDeafult: templateDeafult.value
}
uni.setStorageSync('overPackageJobDetailPointParams', overPackageJobDetailPointParams)
// if (res.data == '') {
// const list = []
// showCommitSuccessMessage(res.data)
// const overPackageJobDetailPointParams = {
// printDeafult: printDeafult.value,
// templateDeafult: templateDeafult.value
// }
// 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 {
showErrorMessage(res.data)
showErrorMessage("提交失败[" + res.msg + "]")
}
})
.catch((error) => {
@ -336,14 +361,14 @@ const setParams = () => {
jobContent.value.creator = creator
return jobContent.value
}
const printCode = (e) => {
jobContent.value.printerUuid = e.value
printDeafult.value = e
}
const templateCode = (e) => {
jobContent.value.modelCode = e.value
templateDeafult.value = e
}
// const printCode = (e) => {
// jobContent.value.printerUuid = e.value
// printDeafult.value = e
// }
// const templateCode = (e) => {
// jobContent.value.modelCode = e.value
// templateDeafult.value = e
// }
const cancel = () => {
comMessageRef.value.showQuestionMessage('是否要清空已扫描的物料和目标库位信息?', (res) => {
if (res) {

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

@ -3,7 +3,7 @@
<view class="">
<com-blank-view @goScan="getBusinessType" v-if="detailSource.length == 0"></com-blank-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="cen_card" style="background-color: #fff; margin: 10px">
<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 packUnit from '@/mycomponents/qty/packUnit.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'
// store
@ -105,8 +105,8 @@ const toPackUnitShow = ref('请选择')
const toPackQty = ref('')
const itemCode = ref('')
const resultData = ref({})
const printDeafult = ref({}) //
const templateDeafult = ref({}) //
// const printDeafult = ref({}) //
// const templateDeafult = ref({}) //
const scanPopup = ref()
const scanLocationCode = ref()
const toPackUnit = ref()
@ -114,14 +114,14 @@ const comMessageRef = ref()
const printService = ref()
onLoad(() => {
getBusinessType()
nextTick(() => {
if (uni.getStorageSync('overPackageRecordPointParams')) {
const overPackageRecordPointParams = uni.getStorageSync('overPackageRecordPointParams')
dataContent.value.printerUuid = overPackageRecordPointParams.printDeafult.value
dataContent.value.modelCode = overPackageRecordPointParams.templateDeafult.value
printService.value.setDefaultData(overPackageRecordPointParams.printDeafult, overPackageRecordPointParams.templateDeafult)
}
})
// nextTick(() => {
// if (uni.getStorageSync('overPackageRecordPointParams')) {
// const overPackageRecordPointParams = uni.getStorageSync('overPackageRecordPointParams')
// dataContent.value.printerUuid = overPackageRecordPointParams.printDeafult.value
// dataContent.value.modelCode = overPackageRecordPointParams.templateDeafult.value
// printService.value.setDefaultData(overPackageRecordPointParams.printDeafult, overPackageRecordPointParams.templateDeafult)
// }
// })
})
onLoad((option) => {
uni.setNavigationBarTitle({
@ -295,14 +295,14 @@ const scanPopupGetFocus = () => {
}
}
const commit = () => {
if (!dataContent.value.printerUuid) {
showErrorMessage('请选择打印机')
return
}
if (!dataContent.value.modelCode) {
showErrorMessage('请选择打印模板')
return
}
// if (!dataContent.value.printerUuid) {
// showErrorMessage('')
// return
// }
// if (!dataContent.value.modelCode) {
// showErrorMessage('')
// return
// }
if (detailSource.value.length > 0 && detailSource.value[0].subList.length > 0) {
if (toPackUnit.value || toPackUnit.value == '包装规格') {
showErrorMessage('请选择目标包装规格')
@ -340,22 +340,46 @@ const submitJob = () => {
overPackageRecordSubmit(params)
.then((res) => {
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) {
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}`)
let list = []
res.data.forEach(item => {
list.push({
itemCode: item.itemCode, //
itemName: item.itemName, //
packName: item.packName, //
packageCode: item.toPackingNumber, //
batch: item.toBatch, //
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(res.msg)
} else {
showErrorMessage(`提交失败[${res.msg}]`)
showErrorMessage("提交失败[" + res.msg + "]")
}
})
.catch((error) => {
@ -396,14 +420,14 @@ const setParams = () => {
dataContent.value.creator = creator
return dataContent.value
}
const printCode = (e) => {
dataContent.value.printerUuid = e.value
printDeafult.value = e
}
const templateCode = (e) => {
dataContent.value.modelCode = e.value
templateDeafult.value = e
}
// const printCode = (e) => {
// dataContent.value.printerUuid = e.value
// printDeafult.value = e
// }
// const templateCode = (e) => {
// dataContent.value.modelCode = e.value
// templateDeafult.value = e
// }
const showMessage = (message) => {
comMessageRef.value.showMessage(message, (res) => {
if (res) {

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

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

Loading…
Cancel
Save