|
|
@ -5,7 +5,7 @@ |
|
|
|
<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 0px 0px 10px;"> |
|
|
|
<view class="cell_box uni-flex uni-row"> |
|
|
@ -112,7 +112,7 @@ |
|
|
|
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 { |
|
|
|
getCurrDateTime |
|
|
@ -131,7 +131,7 @@ |
|
|
|
recordComDetailCard, |
|
|
|
packUnit, |
|
|
|
winComScanBalance, |
|
|
|
print |
|
|
|
// print |
|
|
|
}, |
|
|
|
onLoad(option){ |
|
|
|
uni.setNavigationBarTitle({ |
|
|
@ -160,22 +160,21 @@ |
|
|
|
itemCode: "", |
|
|
|
resultData: {}, |
|
|
|
|
|
|
|
printDeafult:{},//默认打印机 |
|
|
|
templateDeafult:{}//默认的模板 |
|
|
|
// printDeafult:{},//默认打印机 |
|
|
|
// templateDeafult:{}//默认的模板 |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
this.getBusinessType(); |
|
|
|
|
|
|
|
this.$nextTick(()=>{ |
|
|
|
if(uni.getStorageSync('overPackageRecordPointParams')){ |
|
|
|
const overPackageRecordPointParams = uni.getStorageSync('overPackageRecordPointParams') |
|
|
|
this.dataContent.printerUuid = overPackageRecordPointParams.printDeafult.value; |
|
|
|
this.dataContent.modelCode = overPackageRecordPointParams.templateDeafult.value; |
|
|
|
this.$refs.printService.setDefaultData(overPackageRecordPointParams.printDeafult,overPackageRecordPointParams.templateDeafult) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
// this.$nextTick(()=>{ |
|
|
|
// if(uni.getStorageSync('overPackageRecordPointParams')){ |
|
|
|
// const overPackageRecordPointParams = uni.getStorageSync('overPackageRecordPointParams') |
|
|
|
// this.dataContent.printerUuid = overPackageRecordPointParams.printDeafult.value; |
|
|
|
// this.dataContent.modelCode = overPackageRecordPointParams.templateDeafult.value; |
|
|
|
// this.$refs.printService.setDefaultData(overPackageRecordPointParams.printDeafult,overPackageRecordPointParams.templateDeafult) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
}, |
|
|
|
//返回首页 |
|
|
|
onNavigationBarButtonTap(e) { |
|
|
@ -359,14 +358,14 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
commit() { |
|
|
|
if(!this.dataContent.printerUuid){ |
|
|
|
this.showErrorMessage("请选择打印机") |
|
|
|
return; |
|
|
|
} |
|
|
|
if(!this.dataContent.modelCode){ |
|
|
|
this.showErrorMessage("请选择打印模板") |
|
|
|
return; |
|
|
|
} |
|
|
|
// if(!this.dataContent.printerUuid){ |
|
|
|
// this.showErrorMessage("请选择打印机") |
|
|
|
// return; |
|
|
|
// } |
|
|
|
// if(!this.dataContent.modelCode){ |
|
|
|
// this.showErrorMessage("请选择打印模板") |
|
|
|
// return; |
|
|
|
// } |
|
|
|
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
|
|
|
if (!this.toPackUnit || this.toPackUnit == "包装规格") { |
|
|
|
this.showErrorMessage("请选择目标包装规格") |
|
|
@ -412,41 +411,41 @@ |
|
|
|
overPackageRecordSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
|
|
|
|
if (res.data == '打印任务已发送,等待打印机处理!') { |
|
|
|
this.showCommitSuccessMessage(res.data) |
|
|
|
const overPackageRecordPointParams = { |
|
|
|
printDeafult:this.printDeafult, |
|
|
|
templateDeafult:this.templateDeafult, |
|
|
|
} |
|
|
|
uni.setStorageSync('overPackageRecordPointParams',overPackageRecordPointParams) |
|
|
|
this.detailSource = [] |
|
|
|
}else { |
|
|
|
this.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.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: '', |
|
|
|
// // }) |
|
|
|
// // }) |
|
|
|
// this.showCommitSuccessMessage(res.msg) |
|
|
|
// if (res.data == '打印任务已发送,等待打印机处理!') { |
|
|
|
// this.showCommitSuccessMessage(res.data) |
|
|
|
// const overPackageRecordPointParams = { |
|
|
|
// printDeafult:this.printDeafult, |
|
|
|
// templateDeafult:this.templateDeafult, |
|
|
|
// } |
|
|
|
// uni.setStorageSync('overPackageRecordPointParams',overPackageRecordPointParams) |
|
|
|
// this.detailSource = [] |
|
|
|
// }else { |
|
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
// this.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.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: '', |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.showCommitSuccessMessage(res.msg) |
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
@ -487,14 +486,14 @@ |
|
|
|
this.dataContent.creator = creator; |
|
|
|
return this.dataContent; |
|
|
|
}, |
|
|
|
printCode(e){ |
|
|
|
this.dataContent.printerUuid = e.value; |
|
|
|
this.printDeafult = e |
|
|
|
}, |
|
|
|
templateCode(e){ |
|
|
|
this.dataContent.modelCode = e.value; |
|
|
|
this.templateDeafult = e |
|
|
|
}, |
|
|
|
// printCode(e){ |
|
|
|
// this.dataContent.printerUuid = e.value; |
|
|
|
// this.printDeafult = e |
|
|
|
// }, |
|
|
|
// templateCode(e){ |
|
|
|
// this.dataContent.modelCode = e.value; |
|
|
|
// this.templateDeafult = e |
|
|
|
// }, |
|
|
|
showMessage(message) { |
|
|
|
this.$refs.comMessage.showMessage(message, res => { |
|
|
|
if (res) {} |
|
|
|