|
|
@ -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) { |
|
|
|