Browse Source

fix: purchaseReceipt 文件修改 Vue2升级Vue3 10/25-11-11

syhx_app_vue3
王志国 2 weeks ago
parent
commit
65aae6dea0
  1. 6
      src/pages/productRecycle/job/productRecycleJobDetail.vue
  2. 5
      src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue
  3. 18
      src/pages/purchaseReceipt/coms/comReceiptDetailCardBacth.vue
  4. 2
      src/pages/purchaseReceipt/job/purchaseReceipt.vue
  5. 283
      src/pages/purchaseReceipt/job/receiptDetail.vue
  6. 28
      src/pages/purchaseReceipt/job/receiptJob.vue

6
src/pages/productRecycle/job/productRecycleJobDetail.vue

@ -324,7 +324,7 @@ const getScanResultAfterBatch = (result)=> {
itemDetail.balance.packQty = Number(result.package.packQty) itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit itemDetail.balance.packUnit = result.package.packUnit
} }
calcHandleQty(); calcHandleQty1();
} else { } else {
// //
itemDetail = detail.subList.find(r => { itemDetail = detail.subList.find(r => {
@ -348,7 +348,7 @@ const getScanResultAfterBatch = (result)=> {
itemDetail.balance.balanceQty = result.balance.qty; itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.packQty = result.package.packQty itemDetail.balance.packQty = result.package.packQty
itemDetail.balance.packUnit = result.package.packUnit itemDetail.balance.packUnit = result.package.packUnit
calcHandleQty(); calcHandleQty1();
} else { } else {
scanPopupGetFocus(); scanPopupGetFocus();
} }
@ -370,7 +370,7 @@ const getScanResultAfterBatch = (result)=> {
itemDetail.balance.balanceQty = result.balance.qty; itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.packQty = result.package.packQty itemDetail.balance.packQty = result.package.packQty
itemDetail.balance.packUnit = result.package.packUnit itemDetail.balance.packUnit = result.package.packUnit
calcHandleQty(); calcHandleQty1();
} }
} else { } else {

5
src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue

@ -7,7 +7,10 @@
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowPackUnit="false" style="width: 100%"></itemCompareQty> <itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowPackUnit="false" style="width: 100%"></itemCompareQty>
</u-swipe-action> </u-swipe-action>
</template> </template>
<package-list :dataContent="dataContent.subList" :isEdit="settingParam.allowModifyQty == 'TRUE'" :settingParam="settingParam" @collapseChange="collapseChange" @updateData="updateData" :isShowFromLocation="false"></package-list> <package-list :dataContent="dataContent.subList"
:isEdit="settingParam.allowModifyQty == 'TRUE'"
:settingParam="settingParam" @collapseChaWnge="collapseChange"
@updateData="updateData" :isShowFromLocation="false"></package-list>
</u-collapse-item> </u-collapse-item>
</u-collapse> </u-collapse>

18
src/pages/purchaseReceipt/coms/comReceiptDetailCardBacth.vue

@ -6,13 +6,12 @@
<view style="flex: 1"> <view style="flex: 1">
<u-swipe-action @click="(...event)=>swipeClick(event,dataContent)" <u-swipe-action @click="(...event)=>swipeClick(event,dataContent)"
:options="dataContent.handleQty>0? removeOptions:options" :options="dataContent.handleQty>0? removeOptions:options"
:class="dataContent.scaned?'scan_view':''"> >
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" <itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowPackUnit="false"></itemCompareQty> :isShowPackUnit="false"></itemCompareQty>
<batch v-if="dataContent.subList[0].batch" :batch="dataContent.subList[0].batch"></batch> <package-list :dataContent="dataContent.subList" :isEdit="settingParam.allowModifyQty=='TRUE'"
<location title="来源库位" v-if="dataContent.subList[0].fromLocationCode" :settingParam="settingParam" @collapseChange="collapseChange" @updateData="updateData"
:locationCode="dataContent.subList[0].fromLocationCode"> :isShowFromLocation="false"></package-list>
</location>
</u-swipe-action> </u-swipe-action>
</view> </view>
</template> </template>
@ -30,18 +29,13 @@
<script setup lang="ts"> <script setup lang="ts">
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue' import Recommend from '@/mycomponents/recommend/recommend.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue' import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import JobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue' import JobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue'
import receiptDetailInfoPopup from '@/pages/purchaseReceipt/coms/receiptDetailInfoPopup.vue' import receiptDetailInfoPopup from '@/pages/purchaseReceipt/coms/receiptDetailInfoPopup.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import detailList from '@/mycomponents/detail/detailList.vue' import PackageList from '@/mycomponents/package/packageList.vue'
import packageList from '@/mycomponents/package/packageList.vue'
import pack from '@/mycomponents/balance/pack.vue'
import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue'
import batch from '@/mycomponents/balance/batch.vue'
import { import {
getDetailOption, getDetailOption,

2
src/pages/purchaseReceipt/job/purchaseReceipt.vue

@ -1,6 +1,6 @@
<template> <template>
<view class=""> <view class="">
<receipt-job :title="title" scanTitle="箱标签/ASN单号" :isShowAsn="false" :isShowJob="false" ref="receiptjob" operation="receipt"></receipt-job> <receipt-job source_type="ASN" :title="title" scanTitle="箱标签/ASN单号" :isShowAsn="false" :isShowJob="false" ref="receiptjob" operation="receipt"></receipt-job>
</view> </view>
</template> </template>

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

@ -29,7 +29,7 @@
<!-- 管理精度是批次 --> <!-- 管理精度是批次 -->
<comReceiptDetailCardBacth :dataContent="item" :index="index" :settingParam="jobContent" <comReceiptDetailCardBacth :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList' @remove="updateData" @updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList'
v-if="managementType == 'BY_BATCH'"> v-if="managementType == 'BY_BATCH' || managementType =='BY_QUANTITY'">
</comReceiptDetailCardBacth> </comReceiptDetailCardBacth>
<com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent" @remove="updateData" <com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent" @remove="updateData"
@updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList' v-else> @updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList' v-else>
@ -55,7 +55,7 @@
</view> </view>
</view> </view>
<win-scan-pack ref="scanPopup" @getResult="getScanResult"></win-scan-pack> <win-scan-pack ref="scanPopup" @getResult="getScanResult" :locationCode='jobToLocationCode'></win-scan-pack>
<win-scan-button @goScan="openScanPopup" v-if="operation == 'receipt'"></win-scan-button> <win-scan-button @goScan="openScanPopup" v-if="operation == 'receipt'"></win-scan-button>
<!-- <winScanPackAndCont ref="scanPopup" @getResult='getScanResult'></winScanPackAndCont> --> <!-- <winScanPackAndCont ref="scanPopup" @getResult='getScanResult'></winScanPackAndCont> -->
<com-message ref="comMessageRef" /> <com-message ref="comMessageRef" />
@ -70,7 +70,9 @@ import { purchaseReceiptJobSubmit, getPurchaseReceiptJobDetail, takePurchaseRece
import { goHome, getCurrDateTime, getPackingNumberAndBatch, compareDesc, navigateBack, getSwitchInfoByCode } from '@/common/basic.js' import { goHome, getCurrDateTime, getPackingNumberAndBatch, compareDesc, navigateBack, getSwitchInfoByCode } from '@/common/basic.js'
import { getDirectoryItemArray } from '@/common/directory.js' import { getDirectoryItemArray } from '@/common/directory.js'
import { Decimal } from 'decimal.js';
import { calc } from '@/common/calc'
import { getManagementPrecisions } from '@/common/balance.js' import { getManagementPrecisions } from '@/common/balance.js'
import { getTreeDataSource, createRecordInfo, calcHandleQty, getScanCount, calcTreeHandleQty } from '@/common/detail.js' import { getTreeDataSource, createRecordInfo, calcHandleQty, getScanCount, calcTreeHandleQty } from '@/common/detail.js'
@ -114,11 +116,17 @@ const count = ref(0)
const managementType = ref('') const managementType = ref('')
const switchCode1 = ref('') const switchCode1 = ref('')
const scanedPackingNumber = ref('') const scanedPackingNumber = ref('')
const packingNumberList = ref([])
const source_type = ref('')
const balanceInfo = ref('')
const packList = ref([])
onLoad((option) => { onLoad((option) => {
id.value = option.id id.value = option.id
scanMessage.value = option.scanMessage scanMessage.value = option.scanMessage
scanedPackingNumber.value = option.scaned || '' scanedPackingNumber.value = option.scaned || ''
status.value = option.status || '' status.value = option.status || ''
source_type.value = option.source_type;
operation.value = option.operation operation.value = option.operation
switchCode.value = 'purchasereceiptPrintPDA' // pda switchCode.value = 'purchasereceiptPrintPDA' // pda
switchCode1.value = "EnableQms" //QMSTRUEFALSE switchCode1.value = "EnableQms" //QMSTRUEFALSE
@ -209,8 +217,9 @@ const getDetail = () => {
getManagementPrecisions(itemCodes, jobToLocationCode.value, res => { getManagementPrecisions(itemCodes, jobToLocationCode.value, res => {
if (res.success) { if (res.success) {
managementList.value = res.list; managementList.value = res.list;
managementType.value = managementList.value.some(item => item.ManagementPrecision == managementType.value = managementList.value &&
'BY_BATCH') ? 'BY_BATCH' : '' managementList.value[0] &&
managementList.value[0].ManagementPrecision ? managementList.value[0].ManagementPrecision : 'BY_PACKAGING'
} }
}) })
if (scanMessage.value) { if (scanMessage.value) {
@ -226,8 +235,11 @@ const getDetail = () => {
}) })
} }
const getScanResult = (result) => { const getScanResult = (result) => {
balanceInfo.value = result.balance
if(managementType.value == 'BY_BATCH'){ if(managementType.value == 'BY_BATCH'){
getScanResultAfterBatch(result) getScanResultAfterBatch(result)
}else if(managementType.value == 'BY_QUANTITY' ){
getScanResultAfterQuantity(result)
}else{ }else{
getScanResultAfter(result) getScanResultAfter(result)
} }
@ -237,11 +249,11 @@ const getScanResultAfter = (result) => {
try { try {
const { itemCode } = result.label const { itemCode } = result.label
let detail = detailSource.value.find((r) => r.itemCode == itemCode) let detail = detailSource.value.find((r) => r.itemCode == itemCode)
detail.scaned = true;
if (detail == undefined) { if (detail == undefined) {
showErrorMessage(`物料号【${itemCode}】不在列表中`) showErrorMessage(`物料号【${itemCode}】不在列表中`)
return return
} }
detail.scaned = true;
if (result.label.labelType == 'ContainerLabel') { if (result.label.labelType == 'ContainerLabel') {
const containerNumber = result.label.container const containerNumber = result.label.container
var itemDetail = detail.subList.filter((r) => r.containerNumber == containerNumber) var itemDetail = detail.subList.filter((r) => r.containerNumber == containerNumber)
@ -289,7 +301,7 @@ const getScanResultAfter = (result) => {
pack.toLocationCode = toLocationCode.value pack.toLocationCode = toLocationCode.value
pack.labelQty = Number(result.label.qty) pack.labelQty = Number(result.label.qty)
} }
calcTreeHandleQty(detailSource.value) calcHandleQty(detailSource.value)
itemDetail.packList.sort(compareDesc('scanDate')) // itemDetail.packList.sort(compareDesc('scanDate')) //
} }
} else { } else {
@ -333,11 +345,11 @@ const getScanResultAfterBatch = (result)=>{
try { try {
let itemCode = result.label.itemCode; let itemCode = result.label.itemCode;
let detail = detailSource.value.find(r => r.itemCode == itemCode); let detail = detailSource.value.find(r => r.itemCode == itemCode);
detail.scaned = true;
if (detail == undefined) { if (detail == undefined) {
showErrorMessage("物料号【" + itemCode + "】不在列表中") showErrorMessage("物料号【" + itemCode + "】不在列表中")
return; return;
} }
detail.scaned = true;
if (result.label.labelType == "ContainerLabel") { if (result.label.labelType == "ContainerLabel") {
let containerNumber = result.label.container; let containerNumber = result.label.container;
let itemDetail = detail.subList.filter(r => r.containerNumber == containerNumber); let itemDetail = detail.subList.filter(r => r.containerNumber == containerNumber);
@ -350,10 +362,10 @@ const getScanResultAfterBatch = (result)=>{
itemDetail.forEach(item => { itemDetail.forEach(item => {
item.scaned = true; item.scaned = true;
itemDetail.scanDate = new Date(); itemDetail.scanDate = new Date();
item.handleQty = item.qty; item.handleQty = calc.add(item.handleQty,result.label.qty)
item.toLocationCode = toLocationCode.value; item.toLocationCode = toLocationCode.value;
}) })
calcHandleQty(detailSource.value); // calcHandleQty(detailSource.value);
detailSource.value[0].subList.sort(compareDesc('scanDate')); // detailSource.value[0].subList.sort(compareDesc('scanDate')); //
continueScan() continueScan()
} }
@ -382,10 +394,19 @@ const getScanResultAfterBatch = (result)=>{
if (pack == undefined) { if (pack == undefined) {
showMessage("批次【" + batch + "】不在列表中") showMessage("批次【" + batch + "】不在列表中")
} else { } else {
if (pack.scaned) { let isScan = false
if(packingNumber){
isScan = packList.value.some(item=>item == packingNumber)
}else{
isScan = false
}
if (isScan) {
pack.scanDate = new Date(); pack.scanDate = new Date();
showMessage("批次【" + batch + "】已经扫描"); pack.handleQty = calc.add(pack.handleQty,result.label.qty)
// showMessage("" + batch + "");
} else { } else {
packList.value.push(packingNumber)
pack.packList.push(packingNumber)
pack.scaned = true pack.scaned = true
pack.scanDate = new Date(); pack.scanDate = new Date();
pack.handleQty = Number(result.label.qty); pack.handleQty = Number(result.label.qty);
@ -393,10 +414,9 @@ const getScanResultAfterBatch = (result)=>{
pack.labelQty = Number(result.label.qty); pack.labelQty = Number(result.label.qty);
} }
} }
calcTreeHandleQty(detailSource.value); calcHandleQty(detailSource.value);
itemDetail.packList.sort(compareDesc('scanDate')); // itemDetail.packList.sort(compareDesc('scanDate')); //
} }
} else { } else {
//, //,
let scanedLength = 0; let scanedLength = 0;
@ -405,36 +425,171 @@ const getScanResultAfterBatch = (result)=>{
scanedLength++; scanedLength++;
} }
}) })
if (itemDetail.scaned && scanedLength == itemDetail let isScan = false
.packList.length) { if(packingNumber){
isScan = packingNumberList.value.some(item=>item == packingNumber)
}else{
isScan = false
}
if (isScan) {
itemDetail.scanDate = new Date(); itemDetail.scanDate = new Date();
showMessage("批次【" + batch + "】已经扫描") itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty)
// showMessage("" + batch + "")
} else { } else {
packingNumberList.value.push(packingNumber)
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.scanDate = new Date(); itemDetail.scanDate = new Date();
itemDetail.handleQty = Number(result.label.qty); itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty)
itemDetail.toLocationCode = toLocationCode.value; itemDetail.toLocationCode = toLocationCode.value;
itemDetail.labelQty = Number(result.label.qty); itemDetail.labelQty = Number(result.label.qty);
itemDetail.packList.forEach(pac => { itemDetail.packList.forEach(pac => {
pac.scaned = true pac.scaned = true
pac.scanDate = new Date(); pac.scanDate = new Date();
pac.handleQty = Number(pac.qty); pac.handleQty = calc.add(pac.handleQty,result.label.qty);
pac.toLocationCode = toLocationCode.value; pac.toLocationCode = toLocationCode.value;
}) })
calcTreeHandleQty(detailSource.value); detail.handleQty = itemDetail.handleQty
this.detailSource[0].subList.sort(compareDesc('scanDate')); // detailSource.value[0].subList.sort(compareDesc('scanDate')); //
this.continueScan() continueScan()
this.$forceUpdate()
} }
calcHandleQty(detailSource.value);
} }
} }
} }
} catch (e) { } catch (e) {
this.showErrorMessage(e.message) this.showErrorMessage(e.message)
} }
} }
//
const getScanResultAfterQuantity = (result)=> {
try {
let itemCode = result.label.itemCode;
let detail = detailSource.value.find(r => r.itemCode == itemCode);
if (detail == undefined) {
showErrorMessage("物料号【" + itemCode + "】不在列表中")
return;
}
detail.scaned = true;
if (result.label.labelType == "ContainerLabel") {
const containerNumber = result.label.container;
const itemDetail = detail.subList.filter(r => r.containerNumber == containerNumber);
if (itemDetail.length == 0) {
showErrorMessage("物料【" + itemCode + "】、托码【" + containerNumber + "】不在列表中")
} else {
if (itemDetail[0].scaned) {
showErrorMessage("物料【" + itemCode + "】、托码【" + containerNumber + "】已经扫描")
} else {
itemDetail.forEach(item => {
item.scaned = true;
itemDetail.scanDate = new Date();
item.handleQty = calc.add(item.handleQty,result.label.qty)
item.toLocationCode = toLocationCode.value;
})
// calcHandleQty(this.detailSource);
detailSource.value[0].subList.sort(compareDesc('scanDate')); //
continueScan()
}
}
} else if (result.label.labelType == "PurchaseLabel") {
const packingNumber = result.package.number;
const parentpackingNumber = result.package.parentNumber;
const batch = result.label.batch;
const qty = result.label.qty;
const detail = detailSource.value.find(r => r.itemCode == itemCode);
console.log(8989,this.detailSource)
if (detail == undefined) {
showMessage("物料号【" + itemCode + "】不在列表中")
} else {
//
// var itemDetail = detail.subList.find(r => r.batch ==
// batch);
// if (itemDetail == undefined) {
// itemDetail = detail.subList.find(r => r.batch ==
// batch);
// if (itemDetail == undefined) {
// this.showMessage("" + batch + "")
// } else {
// var pack = itemDetail.packList.find(p =>
// p.batch == batch)
// if (pack == undefined) {
// this.showMessage("" + batch + "")
// } else {
let isScan = false
const itemDetail = detail.subList[0]
let pack = detail.subList[0] && detail.subList[0].length>0 ?detail.subList[0] : {}
if(packingNumber){
isScan = packingNumberList.value.some(item=>item == packingNumber)
}else{
isScan = false
}
if (isScan) {
detail.subList[0].scanDate = new Date();
// this.showMessage("" + packingNumber + "");
detail.subList[0].handleQty = calc.add(detail.subList[0].handleQty,result.label.qty)
} else {
packingNumberList.value.push(packingNumber)
detail.subList[0].scaned = true
detail.subList[0].scanDate = new Date();
detail.subList[0].handleQty = Number(result.label.qty);
detail.subList[0].toLocationCode = toLocationCode.value;
detail.subList[0].labelQty = Number(result.label.qty);
}
// }
calcHandleQty(detailSource.value);
continueScan()
// itemDetail.packList[0] = detail.subList[0]; //
// }
// } else {
// //,
// var scanedLength = 0;
// itemDetail.packList.forEach(res => {
// if (res.scaned) {
// scanedLength++;
// }
// })
// debugger
// let isScan = false
// if(packingNumber){
// isScan = this.packingNumberList.some(item=>item == packingNumber)
// }else{
// isScan = false
// }
// if (isScan) {
// itemDetail.scanDate = new Date();
// // this.showMessage("" + packingNumber + "")
// itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty)
// } else {
// this.packingNumberList.push(packingNumber)
// itemDetail.scaned = true;
// itemDetail.scanDate = new Date();
// itemDetail.handleQty =itemDetail.handleQty ?itemDetail.handleQty:0
// itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty)
// console.log(itemDetail.handleQty)
// itemDetail.toLocationCode = this.toLocationCode;
// itemDetail.labelQty = Number(result.label.qty);
// itemDetail.packList.forEach(pac => {
// pac.scaned = true
// pac.scanDate = new Date();
// pac.handleQty = calc.add(pac.handleQty,result.label.qty);
// pac.toLocationCode = this.toLocationCode;
// })
// detail.handleQty = itemDetail.handleQty
// this.detailSource[0].subList.sort(compareDesc('scanDate')); //
// this.continueScan()
// this.$forceUpdate()
// }
// calcHandleQty(this.detailSource);
// }
}
}
} catch (e) {
showErrorMessage(e.message)
}
}
// //
const continueScan = () => { const continueScan = () => {
scanCount.value = getScanCount(subList.value) scanCount.value = getScanCount(subList.value)
@ -446,7 +601,7 @@ const continueScan = () => {
} }
const updateData = () => { const updateData = () => {
calcTreeHandleQty(detailSource.value) calcHandleQty(detailSource.value)
// calcHandleQty(this.detailSource); // calcHandleQty(this.detailSource);
} }
@ -471,11 +626,36 @@ const commit = () => {
if (!checkLocation()) { if (!checkLocation()) {
return return
} }
let itemCodes = []
detailSource.value.forEach(item => {
itemCodes.push(item.itemCode)
})
//
getManagementPrecisions(itemCodes, toLocationCode.value, res => {
if (res.success) {
managementList.value = res.list;
managementType.value = managementList.value &&
managementList.value[0] &&
managementList.value[0].ManagementPrecision ? managementList.value[0].ManagementPrecision : 'BY_PACKAGING'
if(managementType.value == 'BY_BATCH' || managementType.value == 'BY_QUANTITY'){
checkBatch()
}else{
check()
}
} else {
uni.hideLoading();
showErrorMessage(res.message);
}
})
}
//
const check = ()=>{
// //
if (scanCount.value == subList.value.length) { if (scanCount.value == subList.value.length) {
submitJob() submitJob()
} else if (scanCount.value < subList.value.length) { }
else if (scanCount.value < subList.value.length) {
// //
if (jobContent.value.allowPartialComplete == 'TRUE') { if (jobContent.value.allowPartialComplete == 'TRUE') {
// //
@ -492,13 +672,38 @@ const commit = () => {
// //
comMessageRef.value.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => { comMessageRef.value.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) { if (res) {
openScanPopup() openScanPopup(jobToLocationCode.value)
} }
}) })
} }
} }
} }
//
const checkBatch = ()=> {
//
const scanCount1 = detailSource.value
const current = detailSource.value.find(item=> item.handleQty<item.qty)
if(current){
//
if (jobContent.value.allowPartialComplete == "TRUE") {
//
comMessageRef.value.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
submitJob()
}
});
} else {
//
comMessageRef.value.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
openScanPopup(jobToLocationCode.value);
}
});
}
}else{
submitJob();
}
}
const reject = () => { const reject = () => {
if (!reasonText.value) { if (!reasonText.value) {
showMessage('请输入拒收原因') showMessage('请输入拒收原因')
@ -530,17 +735,7 @@ const reject = () => {
const submitJob = () => { const submitJob = () => {
proxy.$modal.loading('提交中....') proxy.$modal.loading('提交中....')
const itemCodes = []
detailSource.value.forEach((item) => {
itemCodes.push(item.itemCode)
})
//
getManagementPrecisions(itemCodes, toLocationCode.value, (res) => {
if (res.success) {
managementList.value = res.list
const params = setParams() const params = setParams()
purchaseReceiptJobSubmit(params) purchaseReceiptJobSubmit(params)
.then((res) => { .then((res) => {
uni.hideLoading() uni.hideLoading()
@ -556,7 +751,7 @@ const submitJob = () => {
}) })
} else if(!isCheckPrint1 && !isCheckPrint){ } else if(!isCheckPrint1 && !isCheckPrint){
showCommitSuccessMessage("提交成功\n生成采购收货记录\n" + res.data.number) showCommitSuccessMessage("提交成功\n生成采购收货记录\n" + res.data.number)
}else { }else if(source_type.value !='TOOL' && source_type.value != 'Develop') {
uni.showLoading({ uni.showLoading({
title: '提交成功,将跳转到打印页面', title: '提交成功,将跳转到打印页面',
mask: true mask: true
@ -610,6 +805,9 @@ const submitJob = () => {
}) })
}, 2000) }, 2000)
} }
} else if(source_type.value == 'TOOL' || source_type.value == 'Develop'){
uni.hideLoading()
this.showCommitSuccessMessage("提交成功\n生成采购收货记录\n" + res.data.number)
}else { }else {
showErrorMessage(`提交失败[${res.msg}]`) showErrorMessage(`提交失败[${res.msg}]`)
} }
@ -622,11 +820,6 @@ const submitJob = () => {
} }
}); });
}) })
} else {
uni.hideLoading()
showErrorMessage(res.message)
}
})
} }
const setParams = () => { const setParams = () => {
@ -644,6 +837,7 @@ const setParams = () => {
pack.handleQty = 0 pack.handleQty = 0
} }
}) })
detail.toLocationCode = toLocationCode.value ? toLocationCode.value : jobToLocationCode.value
const info = getPackingNumberAndBatch(managementList.value, detail.itemCode, detail.packingNumber, detail.batch) const info = getPackingNumberAndBatch(managementList.value, detail.itemCode, detail.packingNumber, detail.batch)
detail.toPackingNumber = info.packingNumber detail.toPackingNumber = info.packingNumber
detail.packingNumber = info.packingNumber; detail.packingNumber = info.packingNumber;
@ -694,6 +888,7 @@ const switchChange = (isOn) => {
r.resizeCollapse() r.resizeCollapse()
}) })
}) })
scanCount.value = getScanCount(detailSource.value);
calcHandleQty(detailSource.value) calcHandleQty(detailSource.value)
} else { } else {
comMessageRef.value.showQuestionMessage('是否要关闭整单收货?', (res) => { comMessageRef.value.showQuestionMessage('是否要关闭整单收货?', (res) => {
@ -731,7 +926,7 @@ const showErrorMessage = (message) => {
} }
const openScanPopup = () => { const openScanPopup = () => {
scanPopup.value.openScanPopup() scanPopup.value.openScanPopup(jobToLocationCode.value)
} }
const closeScanPopup = () => { const closeScanPopup = () => {

28
src/pages/purchaseReceipt/job/receiptJob.vue

@ -11,7 +11,7 @@
<receipt-job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></receipt-job-list-popup> <receipt-job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></receipt-job-list-popup>
</view> </view>
<win-scan-button @goScan="openScanPopup" v-if="jobList.length > 0"></win-scan-button> <win-scan-button @goScan="openScanPopup" v-if="jobList.length > 0"></win-scan-button>
<winScanPackJob title="箱标签/ASN单号" ref="scanPopup" @getResult="getScanResult"> </winScanPackJob> <winScanPackJob :title="scanHintTitle" ref="scanPopup" @getResult="getScanResult"> </winScanPackJob>
<jobListCom ref="jobListRef" @selectItem="selectItem"></jobListCom> <jobListCom ref="jobListRef" @selectItem="selectItem"></jobListCom>
<com-message ref="comMessageRef" /> <com-message ref="comMessageRef" />
</view> </view>
@ -58,6 +58,8 @@ const jobInfoPopup = ref()
const jobListPopup = ref() const jobListPopup = ref()
const scanPopup = ref() const scanPopup = ref()
const jobListRef = ref() const jobListRef = ref()
const manageModel = import.meta.env.VITE_MANAGE_MODEL
const scanHintTitle = ref('')
const props = defineProps({ const props = defineProps({
operation: { operation: {
type: String, type: String,
@ -78,7 +80,11 @@ const props = defineProps({
title: { title: {
type: String, type: String,
default: '' default: ''
} },
source_type: {
type: String,
default: ''
},
}) })
onMounted(() => { onMounted(() => {
nextTick(() => { nextTick(() => {
@ -88,6 +94,11 @@ onMounted(() => {
}) })
}) })
const refresh = () => { const refresh = () => {
if(manageModel == 'BY_BATCH'){
scanHintTitle.value = "ASN单号"
}else {
scanHintTitle.value = "箱标签/ASN单号"
}
getList('refresh') getList('refresh')
} }
const openFilter = () => { const openFilter = () => {
@ -123,6 +134,13 @@ const getList = (type) => {
action: '==', action: '==',
value: store.id value: store.id
}) })
if(props.source_type){
filters.push({
column: "source_type",
action: "==",
value: props.source_type
})
}
const params = { const params = {
filters, filters,
pageNo: pageNo.value, pageNo: pageNo.value,
@ -211,7 +229,7 @@ const getDataListByType = (code, type) => {
}) })
} }
const openJobDetail = (item, scanMessageMes = '') => { const openJobDetail = (item, scanMessageMes = '') => {
proxy.$tab.navigateTo(`./receiptDetail?id=${item.masterId}&status=${item.status}&operation=${props.operation}&scanMessage=${scanMessageMes}`) proxy.$tab.navigateTo(`./receiptDetail?id=${item.masterId}&status=${item.status}&operation=${props.operation}&scanMessage=${scanMessageMes}&source_type=${props.source_type}`)
scanMessage.value = '' scanMessage.value = ''
} }
const showItemList = (itemList) => { const showItemList = (itemList) => {
@ -322,6 +340,10 @@ const getScanResult = (result) => {
} }
] ]
} else { } else {
if(manageModel == "BY_BATCH"){
showMessage("请扫描ASN单号")
return;
}
filters = [ filters = [
{ {
column: "packingNumber", column: "packingNumber",

Loading…
Cancel
Save