diff --git a/src/pages/package/job/overPackageJobDetail.vue b/src/pages/package/job/overPackageJobDetail.vue index eb9d7aad..43026db2 100644 --- a/src/pages/package/job/overPackageJobDetail.vue +++ b/src/pages/package/job/overPackageJobDetail.vue @@ -32,7 +32,7 @@ - + @@ -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("提交成功
生成翻包记录
", 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) { diff --git a/src/pages/package/record/overPackageRecord.vue b/src/pages/package/record/overPackageRecord.vue index 313a9435..ae796fd4 100644 --- a/src/pages/package/record/overPackageRecord.vue +++ b/src/pages/package/record/overPackageRecord.vue @@ -3,7 +3,7 @@ - + @@ -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(`提交成功
生成翻包记录
${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(`提交成功
生成翻包记录
${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) { diff --git a/src/pages/purchaseReceipt/job/receiptDetail.vue b/src/pages/purchaseReceipt/job/receiptDetail.vue index 86f7be06..d85be67f 100644 --- a/src/pages/purchaseReceipt/job/receiptDetail.vue +++ b/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