Browse Source

page/purchaseReceipt 文件迁移 8/8-10/25

hella_vue3
王志国 4 weeks ago
parent
commit
5ef62fb37b
  1. 2
      src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue
  2. 193
      src/pages/purchaseReceipt/coms/comReceiptDetailCardBacth.vue
  3. 199
      src/pages/purchaseReceipt/job/receiptDetail.vue
  4. 12
      src/pages/purchaseReceipt/job/receiptJob.vue

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

@ -11,7 +11,7 @@
</u-collapse-item>
</u-collapse>
<recommend-qty-edit ref=" receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm"> </recommend-qty-edit>
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm"> </recommend-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation="getLocation" :locationAreaTypeList="locationAreaTypeList"></win-scan-location>
<receipt-detail-info-popup ref="jobDetailPopup" :dataContent="showItem"></receipt-detail-info-popup>
<com-message ref="comMessageRef" />

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

@ -0,0 +1,193 @@
<template>
<view class="" style="background-color: #fff;">
<u-collapse ref="collapse">
<u-collapse-item :open="true">
<template v-slot:title>
<u-swipe-action @click="(...event)=>swipeClick(event,dataContent)"
options="dataContent.handleQty>0? removeOptions:options"
:class="dataContent.scaned?'scan_view':''">
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowPackUnit="false"></itemCompareQty>
<batch v-if="dataContent.subList[0].batch" :batch="dataContent.subList[0].batch"></batch>
<location title="来源库位" v-if="dataContent.subList[0].fromLocationCode"
:locationCode="dataContent.subList[0].fromLocationCode">
</location>
</u-swipe-action>
</template>
</u-collapse-item>
</u-collapse>
<recommend-qty-edit ref=" receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm">
</recommend-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationAreaTypeList="locationAreaTypeList"></win-scan-location>
<receipt-detail-info-popup ref="jobDetailPopup" :dataContent="showItem"></receipt-detail-info-popup>
<comMessage ref="message"></comMessage>
</view>
</template>
<script setup lang="ts">
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue'
import receiptDetailInfoPopup from '@/pages/purchaseReceipt/coms/receiptDetailInfoPopup.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import detailList from '@/mycomponents/detail/detailList.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 {
getDetailOption,
getPurchaseReceiptOption,
getRemoveOption
} from '@/common/array.js';
import {ref, onMounted, watch, nextTick} from 'vue';
const props = defineProps({
dataContent: {
type: Object,
default: null
},
settingParam: {
type: Object,
default: null
},
locationAreaTypeList: {
type: Object,
default: null
}
});
const showItem = ref({});
const editItem = ref({record: {}});
const locatonItem = ref({});
const detailOptions = ref([]);
const scanOptions = ref([]);
const options = ref([]);
const removeOptions = ref([]);
const collapse = ref(null);
const receiptEdit = ref(null);
const scanLocationCode = ref(null);
const jobDetailPopup = ref(null);
const message = ref(null);
onMounted(() => {
if (detailOptions.value.length === 0) {
detailOptions.value = getDetailOption();
}
if (scanOptions.value.length === 0) {
scanOptions.value = getPurchaseReceiptOption(props.settingParam.allowModifyQty, props.settingParam.allowModifyLocation);
}
if (removeOptions.value.length === 0) {
removeOptions.value = getRemoveOption();
}
});
const collapseChange = () => {
setTimeout(() => {
resizeCollapse();
}, 500);
};
const resizeCollapse = () => {
nextTick(() => {
if (collapse.value) {
collapse.value.init();
}
});
};
const refreshCollapse = () => {
nextTick(() => {
if (collapse.value) {
collapse.value.forEach(r => {
r.childrens.forEach(i => {
i.init();
});
r.resize();
});
}
});
};
const swipeClick = (e, item) => {
if (e.content.text === "详情") {
detail(item);
} else if (e.content.text === "编辑") {
edit(item);
} else if (e.content.text === "库位") {
showLocation(item);
} else if (e.content.text === "移除") {
removeScan(item);
}
};
const edit = (item) => {
editItem.value = item;
if (receiptEdit.value) {
receiptEdit.value.openTaskEditPopup(item.qty, item.handleQty, item.labelQty);
}
};
const showLocation = (item) => {
locatonItem.value = item;
if (scanLocationCode.value) {
scanLocationCode.value.openScanPopup();
}
};
const getLocation = (location, code) => {
locatonItem.value.toLocationCode = code;
emit('updateData');
};
const detail = (item) => {
showItem.value = item;
if (jobDetailPopup.value) {
jobDetailPopup.value.openPopup(item);
}
};
const removeScan = (item) => {
if (message.value) {
message.value.showQuestionMessage("确定移除物料的所有扫描信息?", res => {
if (res) {
item.handleQty = null;
item.subList.forEach(lst => {
lst.scaned = false;
lst.handleQty = null;
lst.packList.forEach(pack => {
pack.scaned = false;
pack.handleQty = null;
});
});
emit('updateData');
}
});
}
};
const confirm = (qty) => {
editItem.value.handleQty = qty;
emit('updateData');
};
const updateData = () => {
emit('updateData');
};
const emit = defineEmits(['updateData']);
</script>
<style>
</style>

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

@ -26,7 +26,14 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<com-receipt-detail-card ref="comReceiptDetailCardRef" :dataContent="item" :index="index" :settingParam="jobContent" @remove="updateData" @updateData="updateData" :locationAreaTypeList="toLocationAreaTypeList" :key="count"> </com-receipt-detail-card>
<!-- 管理精度是批次 -->
<comReceiptDetailCardBacth :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList'
v-if="managementType == 'BY_BATCH'">
</comReceiptDetailCardBacth>
<com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent" @remove="updateData"
@updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList' v-else>
</com-receipt-detail-card>
</view>
</view>
</scroll-view>
@ -74,7 +81,7 @@ import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue'
import comReceiptDetailCard from '@/pages/purchaseReceipt/coms/comReceiptDetailCard.vue'
import jobTopAsn from '@/mycomponents/job/jobTopAsn.vue'
import comReceiptDetailCardBacth from '@/pages/purchaseReceipt/coms/comReceiptDetailCardBacth.vue'
import { useCountStore } from '@/store'
// store
const store = useCountStore()
@ -104,6 +111,8 @@ const locationCompareRef = ref()
const scanPopup = ref()
const comReceiptDetailCardRef = ref()
const count = ref(0)
const managementType = ref('')
const switchCode1 = ref('')
onLoad((option) => {
id.value = option.id
scanMessage.value = option.scanMessage
@ -111,6 +120,7 @@ onLoad((option) => {
status.value = option.status || ''
operation.value = option.operation
switchCode.value = 'purchasereceiptPrintPDA' // pda
switchCode1.value = "EnableQms" //QMSTRUEFALSE
})
onShow(() => {
@ -190,6 +200,18 @@ const getDetail = () => {
toLocationCode.value = jobToLocationCode.value
}
isAllReceived.value = false
//
let itemCodes = []
detailSource.value.forEach(item => {
itemCodes.push(item.itemCode)
})
getManagementPrecisions(itemCodes, that.jobToLocationCode, res => {
if (res.success) {
managementList.value = res.list;
managementType.value = managementList.value.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
}
})
if (scanMessage.value) {
scanPopup.value.simulateScan(scanMessage.value)
}
@ -203,9 +225,18 @@ const getDetail = () => {
})
}
const getScanResult = (result) => {
if(managementType.value == 'BY_BATCH'){
getScanResultAfterBatch(result)
}else{
getScanResultAfter(result)
}
}
const getScanResultAfter = (result) => {
try {
const { itemCode } = result.label
var detail = detailSource.value.find((r) => r.itemCode == itemCode)
let detail = detailSource.value.find((r) => r.itemCode == itemCode)
detail.scaned = true;
if (detail == undefined) {
showErrorMessage(`物料号【${itemCode}】不在列表中`)
return
@ -273,20 +304,20 @@ const getScanResult = (result) => {
showMessage(`箱码【${packingNumber}】已经扫描`)
} else {
itemDetail.scaned = true
itemDetail.scanDate = new Date();
itemDetail.scanDate = new Date();
detailSource.value[0].subList.sort(compareAsc('scaned')) //
itemDetail.handleQty = Number(result.label.qty)
itemDetail.toLocationCode = toLocationCode.value
itemDetail.labelQty = Number(result.label.qty)
itemDetail.packList.forEach((pac) => {
pac.scaned = true
pac.scanDate = new Date();
pac.scanDate = new Date();
pac.handleQty = Number(pac.qty)
pac.toLocationCode = toLocationCode.value
})
calcTreeHandleQty(detailSource.value)
detailSource[0].subList.sort(compareDesc('scanDate'))
detailSource[0].subList.sort(compareDesc('scanDate'))
const test = detailSource.value
continueScan()
}
@ -297,6 +328,113 @@ const getScanResult = (result) => {
showErrorMessage(e.message)
}
}
//
const getScanResultAfterBatch = (result)=>{
try {
let itemCode = result.label.itemCode;
let detail = detailSource.value.find(r => r.itemCode == itemCode);
detail.scaned = true;
if (detail == undefined) {
showErrorMessage("物料号【" + itemCode + "】不在列表中")
return;
}
if (result.label.labelType == "ContainerLabel") {
let containerNumber = result.label.container;
let 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 = item.qty;
item.toLocationCode = toLocationCode.value;
})
calcHandleQty(detailSource.value);
detailSource.value[0].subList.sort(compareDesc('scanDate')); //
continueScan()
}
}
} else if (result.label.labelType == "PurchaseLabel") {
let packingNumber = result.package.number;
let parentpackingNumber = result.package.parentNumber;
let batch = result.label.batch;
let qty = result.label.qty;
let detail = detailSource.value.find(r => r.itemCode == itemCode);
if (detail == undefined) {
showMessage("物料号【" + itemCode + "】不在列表中")
} else {
//
let itemDetail = detail.subList.find(r => r.batch ==
batch);
if (itemDetail == undefined) {
itemDetail = detail.subList.find(r => r.batch ==
batch);
if (itemDetail == undefined) {
showMessage("批次【" + batch + "】不在列表中")
} else {
let pack = itemDetail.packList.find(p =>
p.batch == batch)
if (pack == undefined) {
showMessage("批次【" + batch + "】不在列表中")
} else {
if (pack.scaned) {
pack.scanDate = new Date();
showMessage("批次【" + batch + "】已经扫描");
} else {
pack.scaned = true
pack.scanDate = new Date();
pack.handleQty = Number(result.label.qty);
pack.toLocationCode = toLocationCode.value;
pack.labelQty = Number(result.label.qty);
}
}
calcTreeHandleQty(detailSource.value);
itemDetail.packList.sort(compareDesc('scanDate')); //
}
} else {
//,
let scanedLength = 0;
itemDetail.packList.forEach(res => {
if (res.scaned) {
scanedLength++;
}
})
if (itemDetail.scaned && scanedLength == itemDetail
.packList.length) {
itemDetail.scanDate = new Date();
showMessage("批次【" + batch + "】已经扫描")
} else {
itemDetail.scaned = true;
itemDetail.scanDate = new Date();
itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = toLocationCode.value;
itemDetail.labelQty = Number(result.label.qty);
itemDetail.packList.forEach(pac => {
pac.scaned = true
pac.scanDate = new Date();
pac.handleQty = Number(pac.qty);
pac.toLocationCode = toLocationCode.value;
})
calcTreeHandleQty(detailSource.value);
this.detailSource[0].subList.sort(compareDesc('scanDate')); //
this.continueScan()
this.$forceUpdate()
}
}
}
}
} catch (e) {
this.showErrorMessage(e.message)
}
}
//
const continueScan = () => {
scanCount.value = getScanCount(subList.value)
@ -315,6 +453,7 @@ const updateData = () => {
const scanLocationCode = (location, code) => {
if (jobContent.value.allowModifyLocation == 'TRUE') {
toLocationCode.value = code
jobToLocationCode.value= code
} else if (code == jobToLocationCode.value) {
toLocationCode.value = code
} else {
@ -342,12 +481,16 @@ const commit = () => {
//
comMessageRef.value.showQuestionMessage('还有未扫描的物料,是否继续提交?', (res) => {
if (res) {
submitJob()
comMessageRef.value.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
submitJob()
}
});
}
})
} else {
//
comMessageRef.value.showErrorMessage('请完成扫描后,再进行提交<br>' + `已经扫描[${scanCount.value}]箱总共[${subList.value.length}]箱`, (res) => {
comMessageRef.value.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
openScanPopup()
}
@ -361,7 +504,7 @@ const reject = () => {
showMessage('请输入拒收原因')
return
}
comMessageRef.value.showErrorMessage(`是否要拒收任务<br>[${jobContent.value.asnNumber}]?`, (res) => {
comMessageRef.value.showErrorMessage(`是否要拒收任务\n[${jobContent.value.asnNumber}]?`, (res) => {
console.log(res)
if (res) {
proxy.$modal.loading('提交中....')
@ -404,13 +547,16 @@ const submitJob = () => {
if (res.data) {
// showCommitSuccessMessage(`<br><br>${res.data}`)
const isCheckPrint = getSwitchInfoByCode(switchCode.value)
let isCheckPrint1 = getSwitchInfoByCode(switchCode1.value)//
if (!isCheckPrint) {
uni.hideLoading()
// showCommitSuccessMessage(`<br><br>${res.data.number}`)
uni.redirectTo({
url: '/pages/pointPutawayJob/index?number='+that.jobContent.number
url: '/pages/pointPutawayJob/index?number='+jobContent.value.number
})
} else {
} else if(!isCheckPrint1 && !isCheckPrint){
showCommitSuccessMessage("提交成功\n生成采购收货记录\n" + res.data.number)
}else {
uni.showLoading({
title: '提交成功,将跳转到打印页面',
mask: true
@ -438,6 +584,7 @@ const submitJob = () => {
if (res1.data && res1.data.list && res1.data.list.length && res1.data.total >= res.data.detailCount) {
uni.hideLoading()
clearInterval(timer1)
uni.hideLoading()
const dataParams = {
toLocationCode: res1.data.list[0].toLocationCode,
number: res1.data.list[0].number,
@ -447,10 +594,18 @@ const submitJob = () => {
}
console.log(dataParams)
uni.hideLoading()
uni.redirectTo({
uurl: '/pages/pointPutawayJob/index?number='+jobContent.value.number+'&data=' +
encodeURIComponent(JSON.stringify(dataParams))
})
if(!isCheckPrint1 && isCheckPrint){
uni.redirectTo({
url: '/pages/pointPutawayJob/index?data=' +
encodeURIComponent(JSON.stringify(dataParams))
})
}else if(isCheckPrint1 && isCheckPrint){
uni.redirectTo({
url: '/pages/pointPutawayJob/index?number=' + that.jobContent.number +
'&data=' +
encodeURIComponent(JSON.stringify(dataParams))
})
}
}
})
}, 2000)
@ -461,7 +616,11 @@ const submitJob = () => {
})
.catch((error) => {
uni.hideLoading()
showErrorMessage(error)
comMessageRef.value.showErrorMessage(error, res => {
if (res) {
navigateBack(1)
}
});
})
} else {
uni.hideLoading()
@ -487,6 +646,8 @@ const setParams = () => {
})
const info = getPackingNumberAndBatch(managementList.value, detail.itemCode, detail.packingNumber, detail.batch)
detail.toPackingNumber = info.packingNumber
detail.packingNumber = info.packingNumber;
detail.formPackingNumber = info.packingNumber;
detail.toBatch = info.batch
subList.push(detail)
})
@ -546,6 +707,9 @@ const switchChange = (isOn) => {
}
const showMessage = (message) => {
if (scanPopup.value) {
scanPopup.value.losefocus();
}
setTimeout((r) => {
scanPopupLoseFocus()
comMessageRef.value.showMessage(message, (res) => {
@ -555,6 +719,9 @@ const showMessage = (message) => {
}
const showErrorMessage = (message) => {
if (scanPopup.value) {
scanPopup.value.losefocus();
}
setTimeout((r) => {
scanPopupLoseFocus()
comMessageRef.value.showErrorMessage(message, (res) => {

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

@ -273,6 +273,9 @@ const switchChangeWait = (state, jobStatus) => {
getList('refresh')
}
const showMessage = (message) => {
if(scanPopup.value){
scanPopup.value.packLoseFocus()
}
comMessageRef.value.showErrorMessage(message, (res) => {
if (res) {
if (scanPopup.value) {
@ -315,6 +318,11 @@ const getScanResult = (result) => {
column: 'status',
action: 'in',
value: '1,2'
},
{
column: "accept_user_id",
action: "==",
value: store.id
}
]
} else {
@ -382,14 +390,14 @@ const getScanResult = (result) => {
selectItem(list[0], result.scanMessage.indexOf('ASN') > -1)
}
} else {
showMessage('未查找到任务<br>' + `扫描[${result.scanMessage}]`)
showMessage('未查找到任务\n' + `扫描[${result.scanMessage}]`)
}
})
.catch((error) => {
showMessage(error)
})
} catch (e) {
showMessage(`${error}<br>扫描[${result.scanMessage}]`)
showMessage(`${error}\n扫描[${result.scanMessage}]`)
}
}
defineExpose({

Loading…
Cancel
Save