Browse Source

page/productReceipt/job 文件迁移 8/8-10/25

pull/1/head
test 4 months ago
parent
commit
04890c1922
  1. 75
      src/pages/productReceipt/job/ccProductReceiptDetail.vue
  2. 14
      src/pages/productReceipt/job/ccProductReceiptJob.vue
  3. 633
      src/pages/productReceipt/job/completeReceiveJobDetail.vue
  4. 40
      src/pages/productReceipt/job/fgProductReceiptDetail.vue
  5. 27
      src/pages/productReceipt/job/fgProductReceiptJob.vue
  6. 60
      src/pages/productReceipt/job/productReceiptDetail.vue
  7. 113
      src/pages/productReceipt/job/productReceiptJob.vue
  8. 84
      src/pages/productReceipt/job/scrapReceiptDetail.vue
  9. 27
      src/pages/productReceipt/job/scrapReceiptJob.vue
  10. 789
      src/pages/productReceipt/job/semiProductReceiptDetail.vue
  11. 27
      src/pages/productReceipt/job/semiProductReceiptJob.vue

75
src/pages/productReceipt/job/ccProductReceiptDetail.vue

@ -35,8 +35,12 @@
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<comProductDetailCardBatch :dataContent="item" :settingParam="jobContent" :isShowLocation="false"
@remove="updateData" @updateData="updateData"
:locationAreaTypeList='toLocationAreaTypeList' v-if="managementType=='BY_BATCH'">
</comProductDetailCardBatch>
<comProductDetailCard :dataContent="item" :settingParam="jobContent" :isShowLocation="false" <comProductDetailCard :dataContent="item" :settingParam="jobContent" :isShowLocation="false"
@remove="updateData" @updateData="updateData" :locationAreaTypeList="toLocationAreaTypeList"> @remove="updateData" @updateData="updateData" :locationAreaTypeList="toLocationAreaTypeList" v-else>
</comProductDetailCard> </comProductDetailCard>
</view> </view>
</view> </view>
@ -46,7 +50,7 @@
<view class="page-footer"> <view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10" style="background-color: ghostwhite; width: 100%"> <view class="uni-flex u-col-center space-between padding_10" style="background-color: ghostwhite; width: 100%">
<view class=""> <view class="">
<<locationCompare ref="comScanLocation" title="收货库位" :isShowEdit="jobContent.allowModifyLocation=='TRUE'" <locationCompare ref="comScanLocation" title="收货库位"
:recommendLocationCode="jobToLocationCode" :locationCode="toLocationCode" @getLocation='scanLocationCode' :recommendLocationCode="jobToLocationCode" :locationCode="toLocationCode" @getLocation='scanLocationCode'
:locationAreaTypeList="toLocationAreaTypeList"> :locationAreaTypeList="toLocationAreaTypeList">
</locationCompare> </locationCompare>
@ -80,10 +84,9 @@
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue' import locationCompare from '@/mycomponents/location/locationCompare.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comDetailCard from '@/mycomponents/detail/comDetailCard.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import comProductDetailCard from '@/pages/productReceipt/coms/comProductDetailCard.vue' import comProductDetailCard from '@/pages/productReceipt/coms/comProductDetailCard.vue'
import comProductDetailCardBatch from "@/pages/productReceipt/coms/comProductDetailCardBatch.vue"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store // store
const store = useCountStore() const store = useCountStore()
@ -97,6 +100,7 @@
const detailSource = ref([])// const detailSource = ref([])//
const toLocationAreaTypeList = ref([]) const toLocationAreaTypeList = ref([])
const managementList = ref([]) const managementList = ref([])
const managementType = ref('')
const jobStatus = ref('') const jobStatus = ref('')
const jobToLocationCode = ref('') const jobToLocationCode = ref('')
const scanedPackingNumber = ref('') const scanedPackingNumber = ref('')
@ -189,14 +193,24 @@
subList.value = res.data.subList subList.value = res.data.subList
jobStatus.value = res.data.status jobStatus.value = res.data.status
jobToLocationCode.value = subList.value[0].toLocationCode jobToLocationCode.value = subList.value[0].toLocationCode
if (jobContent.value.allowModifyLocation == 'FALSE') {
toLocationCode.value = subList.value[0].toLocationCode
}
toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes) toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes)
detailSource.value = getDataSource(subList.value) detailSource.value = getDataSource(subList.value)
if (scanMessage.value) { if (scanMessage.value) {
scanPopup.value.simulateScan(scanMessage.value); scanPopup.value.simulateScan(scanMessage.value);
} }
//
let itemCodes = []
detailSource.value.forEach(item => {
itemCodes.push(item.itemCode)
item.scaned = false
})
getManagementPrecisions(itemCodes, jobToLocationCode.value, res => {
if (res.success) {
managementList.value = res.list;
managementType.value = managementList.value.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
}
})
} else { } else {
showMessage('列表数据为0') showMessage('列表数据为0')
} }
@ -218,6 +232,7 @@
if (detail == undefined) { if (detail == undefined) {
showErrorMessage(`物料号【${itemCode}】不在列表中`) showErrorMessage(`物料号【${itemCode}】不在列表中`)
} else { } else {
detail.scaned = true
const itemDetail = detail.subList.find((r) => r.packingNumber == packingNumber && r.batch == batch) const itemDetail = detail.subList.find((r) => r.packingNumber == packingNumber && r.batch == batch)
if (itemDetail == undefined) { if (itemDetail == undefined) {
showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]不在任务列表中`) showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]不在任务列表中`)
@ -226,11 +241,10 @@
} else { } else {
itemDetail.scaned = true itemDetail.scaned = true
itemDetail.handleQty = Number(result.label.qty) itemDetail.handleQty = Number(result.label.qty)
itemDetail.toLocationCode = toLocationCode.value itemDetail.toLocationCode = toLocationCode.value?toLocationCode.value:jobToLocationCode.value
itemDetail.labelQty = Number(result.label.qty) itemDetail.labelQty = Number(result.label.qty)
calcHandleQty(detailSource.value) calcHandleQty(detailSource.value)
continueScan() continueScan()
$forceUpdate()
} }
} }
} }
@ -246,7 +260,7 @@
} }
const updateData = () => { const updateData = () => {
calcHandleQty(detailSource.value) // calcHandleQty(detailSource.value)
} }
const openScanPopup = () => { const openScanPopup = () => {
@ -258,12 +272,27 @@
} }
const scanLocationCode = (location, code) => { const scanLocationCode = (location, code) => {
toLocationCode.value = code if(jobContent.value.allowModifyLocation=="TRUE"){
detailSource.value.forEach((item) => { toLocationCode.value = code
item.subList.forEach((detail) => { detailSource.value.forEach((item) => {
detail.toLocationCode = code item.subList.forEach((detail) => {
}) detail.toLocationCode = code
}) })
})
}else {
//
if(code!=jobToLocationCode.value){
showMessageHint("任务中不允许修改库位\n扫描库位["+code+"]推荐库位是["+jobToLocationCode.value+"]",callBack=>{
})
}else {
toLocationCode.value = code
detailSource.value.forEach((item) => {
item.subList.forEach((detail) => {
detail.toLocationCode = code
})
})
}
}
} }
const checkLocation = () => { const checkLocation = () => {
@ -278,7 +307,7 @@
return isPass return isPass
} }
const showMessageHint(hint, callback) { const showMessageHint = (hint, callback)=> {
comMessageRef.value.showErrorMessage(hint, (res) => { comMessageRef.value.showErrorMessage(hint, (res) => {
if (res) { if (res) {
callback() callback()
@ -298,9 +327,11 @@
return return
} }
}else{ }else{
this.toLocationCode = this.jobToLocationCode this.toLocationCode = toLocationCode.value?toLocationCode.value:jobToLocationCode.value
}
if(!toLocationCode.value){
return;
} }
// //
if (scanCount.value == subList.value.length) { if (scanCount.value == subList.value.length) {
if (checkCount()) { if (checkCount()) {
@ -315,7 +346,7 @@
} }
} else { } else {
// //
showMessage('请完成扫描后,再进行提交<br>' + `已经扫描[${scanCount.value}]总共[${subList.value.length}]`) showMessage('请完成扫描后,再进行提交\n' + `已经扫描[${scanCount.value}]总共[${subList.value.length}]`)
} }
} }
} }
@ -362,7 +393,7 @@
.then((res) => { .then((res) => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
showCommitSuccessMessage("提交成功<br>生成装配收货记录<br>" + res.data) showCommitSuccessMessage("提交成功\n生成装配收货记录<br>" + res.data)
} else { } else {
showErrorMessage(`提交失败[${res.msg}]`) showErrorMessage(`提交失败[${res.msg}]`)
} }
@ -387,6 +418,8 @@
if (detail.scaned) { if (detail.scaned) {
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.fromPackingNumber = info.packingNumber;
detail.toBatch = info.batch detail.toBatch = info.batch
detail.toContainerNumber = '' detail.toContainerNumber = ''
detail.toInventoryStatus = detail.inventoryStatus detail.toInventoryStatus = detail.inventoryStatus

14
src/pages/productReceipt/job/ccProductReceiptJob.vue

@ -96,13 +96,13 @@
} }
}) })
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap((e) =>{
if (e.index === 0) { if (e.index === 0) {
goHome() goHome()
} else if (e.index == 1) { } else if (e.index == 1) {
filter.value.openFilter() filter.value.openFilter()
} }
} })
onReachBottom(() => { onReachBottom(() => {
// //
@ -283,8 +283,14 @@
} }
const showMessage = (message) => { const showMessage = (message) => {
if(scanPopup.value){
scanPopup.value.packLoseFocus()
}
comMessageRef.value.showErrorMessage(message, (res) => { comMessageRef.value.showErrorMessage(message, (res) => {
if (res) { if (res) {
if(scanPopup.value){
scanPopup.value.packGetFocus()
}
} }
}) })
} }
@ -382,11 +388,11 @@
selectItem(list[0]) selectItem(list[0])
} }
} else { } else {
showMessage('未查找到任务<br>' + `扫描[${result.scanMessage}]`) showMessage('未查找到任务\n' + `扫描[${result.scanMessage}]`)
} }
}) })
.catch((error) => { .catch((error) => {
showMessage(`${error}<br>扫描[${result.scanMessage}]`) showMessage(`${error}\n扫描[${result.scanMessage}]`)
}) })
} catch (e) { } catch (e) {
showMessage(e.message) showMessage(e.message)

633
src/pages/productReceipt/job/completeReceiveJobDetail.vue

@ -43,7 +43,7 @@
</view> </view>
</template> </template>
<script> <script setup lang="ts">
import { import {
getManagementPrecisions getManagementPrecisions
} from '@/common/balance.js'; } from '@/common/balance.js';
@ -81,335 +81,308 @@
import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue" import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue"
export default { import { ref, onMounted, onBeforeUnmount } from 'vue';
name: 'receipt_detail', import { onLoad, onPullDownRefresh, onBackPress, onNavigationBarButtonTap } from '@dcloudio/uni-app';
components: {
winScanButton, //
comDetailCard, const id = ref('');
locationCompare, const receiptJob = ref({});
winScanPack, const toLocationCode = ref('');
jobTop, const isShowPackingCode = ref(true);
comProductDetailCard const scanCount = ref(0);
}, const jobContent = ref({}); //
data() { const subList = ref([]); // subList
return { const detailSource = ref([]); //
id: '', const toLocationAreaTypeList = ref([]);
receiptJob: {}, const managementList = ref([]);
toLocationCode: '', const jobStatus = ref("");
isShowPackingCode: true, const jobToLocationCode = ref("");
scanCount: 0,
jobContent: {}, // //
subList: [], //subList const scanPopupRef = ref(null);
detailSource: [], // const comMessageRef = ref(null);
toLocationAreaTypeList: [], const comScanLocationRef = ref(null);
managementList: [],
jobStatus:"", //
jobToLocationCode:"" onLoad((option) => {
id.value = option.id;
}; if (id.value !== undefined) {
}, //
onLoad(option) { if (option.status === "1") {
this.id = option.id; receive(() => {
if (this.id != undefined) { getDetail();
// });
if (option.status == "1") { } else {
this.receive((callback => { getDetail();
this.getDetail(); }
})); }
} else { });
this.getDetail();
} onNavigationBarButtonTap((e) => {
if (e.index === 0) {
} goHome();
}, }
// });
onNavigationBarButtonTap(e) {
if (e.index === 0) { onBackPress((e) => {
goHome(); //
} if (e.from === 'backbutton') {
}, if (jobStatus.value === "2") {
// //
onBackPress(e) { cancleTakeProductReceiptJob(id.value).then(() => {
// uni.navigateBack();
if (e.from == 'backbutton') { }).catch(() => {
if (this.jobStatus=="2") { uni.navigateBack();
// });
cancleTakeProductReceiptJob(this.id).then(res => { } else {
uni.navigateBack(); uni.navigateBack();
}).catch(error => { }
uni.navigateBack(); return true;
}) }
} else { });
uni.navigateBack();
} onPullDownRefresh(() => {
getDetail();
return true; uni.stopPullDownRefresh();
} });
}, //
const receive = (callback) => {
onPullDownRefresh() { if (id.value !== null) {
this.getDetail(); takeProductReceiptJob(id.value).then(() => {
uni.stopPullDownRefresh(); callback();
}, }).catch((error) => {
showErrorMessage(error);
mounted() { });
}
}, };
methods: {
// const getDetail = () => {
receive(callback) { uni.showLoading({
if (this.id != null) { title: "加载中....",
takeProductReceiptJob(this.id).then(res => { mask: true
callback(); });
}).catch(error => { getProductReceiptJobDetail(id.value).then((res) => {
this.showErrorMessage(error) uni.hideLoading();
}) if (res.data === null) {
} showMessage('未获取到详情');
}, } else {
if (res.data.subList.length > 0) {
getDetail() { jobContent.value = res.data;
var that = this; subList.value = res.data.subList;
uni.showLoading({ jobStatus.value = res.data.status;
title: "加载中....", jobToLocationCode.value = subList.value[0].toLocationCode;
mask: true toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes);
}); detailSource.value = getDataSource(subList.value);
getProductReceiptJobDetail(that.id).then(res => { } else {
uni.hideLoading(); showMessage('列表数据为0');
if (res.data == null) { }
that.showMessage('未获取到详情'); }
} else { }).catch((error) => {
if (res.data.subList.length > 0) { uni.hideLoading();
that.jobContent = res.data; showErrorMessage(error);
that.subList = res.data.subList; });
that.jobStatus = res.data.status };
that.jobToLocationCode = that.subList[0].toLocationCode
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes) const getScanResult = (result) => {
that.detailSource = getDataSource(that.subList) const label = result.label;
} else { const packingNumber = label.packingNumber;
that.showMessage('列表数据为0'); const batch = label.batch;
} const qty = label.qty;
} const itemCode = label.itemCode;
}).catch(error => {
uni.hideLoading() const detail = detailSource.value.find((r) => r.itemCode === itemCode);
this.showErrorMessage(error) if (detail === undefined) {
}) showErrorMessage(`物料号【${itemCode}】不在列表中`);
}, } else {
const itemDetail = detail.subList.find((r) =>
getScanResult(result) { r.packingNumber === packingNumber && r.batch === batch
let label = result.label; );
var packingNumber = label.packingNumber; if (itemDetail === undefined) {
var batch = label.batch; showErrorMessage(`箱码[${packingNumber}]批次[${batch}]不在任务列表中`);
var qty = label.qty; } else {
var itemCode = label.itemCode; if (itemDetail.scaned) {
showErrorMessage(`箱码[${packingNumber}]批次[${batch}]已经扫描`);
var detail = this.detailSource.find(r => r.itemCode == itemCode); } else {
if (detail == undefined) { itemDetail.scaned = true;
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") itemDetail.handleQty = Number(result.label.qty);
} else { itemDetail.toLocationCode = toLocationCode.value;
var itemDetail = detail.subList.find(r => itemDetail.labelQty = Number(result.label.qty);
r.packingNumber == packingNumber && calcHandleQty(detailSource.value);
r.batch == batch); continueScan();
if (itemDetail == undefined) { }
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在任务列表中") }
} else { }
if (itemDetail.scaned) { };
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]已经扫描")
} else { const continueScan = () => {
itemDetail.scaned = true; scanCount.value = getScanCount(subList.value);
itemDetail.handleQty = Number(result.label.qty); if (scanCount.value === subList.value.length) {
itemDetail.toLocationCode = this.toLocationCode; closeScanPopup();
itemDetail.labelQty = Number(result.label.qty); } else {
calcHandleQty(this.detailSource); scanPopupGetFocus();
this.continueScan() }
this.$forceUpdate() };
}
const updateData = () => {
} calcHandleQty(detailSource.value);
} };
},
const openScanPopup = () => {
// scanPopupRef.value.openScanPopup();
continueScan() { };
this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) { const closeScanPopup = () => {
this.closeScanPopup(); scanPopupRef.value.closeScanPopup();
} else { };
this.scanPopupGetFocus();
} const scanLocationCode = (location, code) => {
}, toLocationCode.value = code;
detailSource.value.forEach((item) => {
item.subList.forEach((detail) => {
updateData() { detail.toLocationCode = code;
calcHandleQty(this.detailSource); });
}, });
};
openScanPopup() { const checkLocation = () => {
this.$refs.scanPopup.openScanPopup(); let isPass = true;
}, if (toLocationCode.value === "" || toLocationCode.value === null) {
showMessageHint('请扫描收货库位', () => {
closeScanPopup() { comScanLocationRef.value.showLocation();
this.$refs.scanPopup.closeScanPopup(); });
}, isPass = false;
}
return isPass;
scanLocationCode(location, code) { };
this.toLocationCode = code
this.detailSource.forEach(item => { const showMessageHint = (hint, callback) => {
item.subList.forEach(detail => { comMessageRef.value.showErrorMessage(hint, (res) => {
detail.toLocationCode = code if (res) {
}) callback();
}) }
}, });
};
checkLocation() {
var isPass = true; const commit = () => {
if (this.toLocationCode == "" || this.toLocationCode == null) { scanCount.value = getScanCount(subList.value);
this.showMessageHint('请扫描收货库位', callback => { if (scanCount.value === 0) {
this.$refs.comScanLocation.showLocation(); showErrorMessage("扫描数为0,请先扫描");
}) return;
}
return isPass = false; if (!checkLocation()) {
} return;
return isPass; }
},
if (scanCount.value === subList.value.length) {
showMessageHint(hint, callback) { submitJob();
this.$refs.comMessage.showErrorMessage(hint, res => { } else if (scanCount.value < subList.value.length) {
if (res) { if (jobContent.value.allowPartialComplete === "TRUE") {
callback() comMessageRef.value.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', (res) => {
} if (res) {
}); submitJob();
}, }
});
commit() { } else {
this.scanCount = getScanCount(this.subList); showMessage("任务明细未全部完成,不允许部分提交!");
if (this.scanCount == 0) { }
this.showErrorMessage("扫描数为0,请先扫描") }
return; };
}
// const submitJob = () => {
if (!this.checkLocation()) { uni.showLoading({
return title: "提交中....",
} mask: true
});
const itemCodes = [];
// detailSource.value.forEach((item) => {
if (this.scanCount == this.subList.length) { itemCodes.push(item.itemCode);
this.submitJob(); });
} else if (this.scanCount < this.subList.length) { getManagementPrecisions(itemCodes, toLocationCode.value, (res) => {
// if (res.success) {
if (this.jobContent.allowPartialComplete == "TRUE") { managementList.value = res.list;
// const params = setParams();
this.submitJob(); console.log("提交参数", JSON.stringify(params));
} else { productReceiptJobsubmit(params).then((res) => {
// uni.hideLoading();
this.showMessage('请完成扫描后,再进行提交<br>' + "已经扫描[" + this.scanCount + "]总共[" + this.subList if (res.data) {
.length + showCommitSuccessMessage(`提交成功\n生成制品收货记录\n${res.data}`);
"]"); } else {
} showErrorMessage(`提交失败[${res.msg}]`);
} }
}).catch((error) => {
}, uni.hideLoading();
showErrorMessage(error);
submitJob() { });
uni.showLoading({ } else {
title: "提交中....", uni.hideLoading();
mask: true showErrorMessage(res.message);
}); }
var itemCodes = [] });
this.detailSource.forEach(item => { };
itemCodes.push(item.itemCode)
}) const setParams = () => {
getManagementPrecisions(itemCodes, this.toLocationCode, res => { const subList = [];
if (res.success) { const creator = store.state.user.id;
this.managementList = res.list;
var params = this.setParams(); detailSource.value.forEach((item) => {
console.log("提交参数", JSON.stringify(params)); item.subList.forEach((detail) => {
productReceiptJobsubmit(params).then(res => { if (detail.scaned) {
uni.hideLoading() const info = getPackingNumberAndBatch(managementList.value, detail.itemCode, detail.packingNumber, detail.batch);
if (res.data) { detail.toPackingNumber = info.packingNumber;
this.showCommitSuccessMessage("提交成功<br>生成制品收货记录<br>" + res.data, ) detail.toBatch = info.batch;
} else { detail.toContainerNumber = '';
this.showErrorMessage("提交失败[" + res.msg + "]") detail.toInventoryStatus = detail.inventoryStatus;
} detail.toLocationCode = toLocationCode.value;
}).catch(error => { subList.push(detail);
uni.hideLoading() }
this.showErrorMessage(error) });
}) });
} else { jobContent.value.subList = subList;
uni.hideLoading(); jobContent.value.creator = creator;
this.showErrorMessage(res.message); return jobContent.value;
} };
});
}, const scanPopupGetFocus = () => {
if (scanPopupRef.value) {
setParams() { scanPopupRef.value.getfocus();
var subList = [] }
var creator = this.$store.state.user.id };
this.detailSource.forEach(item => { const scanPopupLoseFocus = () => {
item.subList.forEach(detail => { if (scanPopupRef.value) {
if (detail.scaned) { scanPopupRef.value.losefocus();
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, }
detail.packingNumber, detail.batch); };
detail.toPackingNumber = info.packingNumber;
detail.toBatch = info.batch; const showMessage = (message) => {
detail.toContainerNumber = ''; setTimeout(() => {
detail.toInventoryStatus = detail.inventoryStatus scanPopupLoseFocus();
detail.toLocationCode = this.toLocationCode comMessageRef.value.showMessage(message, (res) => {
subList.push(detail) if (res) {
} scanPopupGetFocus();
}) }
}) });
this.jobContent.subList = subList });
this.jobContent.creator = creator; };
return this.jobContent;
}, const showErrorMessage = (message) => {
setTimeout(() => {
scanPopupLoseFocus();
scanPopupGetFocus() { comMessageRef.value.showErrorMessage(message, (res) => {
if (this.$refs.scanPopup != undefined) { if (res) {
this.$refs.scanPopup.getfocus(); scanPopupGetFocus();
} }
}, });
});
scanPopupLoseFocus() { };
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.losefocus(); const showCommitSuccessMessage = (hint) => {
} comMessageRef.value.showSuccessMessage(hint, () => {
}, navigateBack(1);
});
showMessage(message) { };
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.scanPopupGetFocus();
}
});
})
},
showErrorMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.scanPopupGetFocus();
}
});
})
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1)
})
},
}
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

40
src/pages/productReceipt/job/fgProductReceiptDetail.vue

@ -29,7 +29,7 @@
<view class="cell_info"> <view class="cell_info">
<view class="text_lightblue">班次</view> <view class="text_lightblue">班次</view>
<view> <view>
{{jobContent.shift}} {{jobContent.shiftName}}
</view> </view>
</view> </view>
</view> </view>
@ -52,7 +52,7 @@
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<locationCompare title="收货库位" :isShowEdit="jobContent.allowModifyLocation=='TRUE'" <locationCompare title="收货库位" ref="comScanLocation" :isShowEdit="jobContent.allowModifyLocation=='TRUE'"
:recommendLocationCode="jobToLocationCode" :locationCode="toLocationCode" :recommendLocationCode="jobToLocationCode" :locationCode="toLocationCode"
@getLocation='scanLocationCode' :locationTypeList="toLocationTypeList"></locationCompare> @getLocation='scanLocationCode' :locationTypeList="toLocationTypeList"></locationCompare>
</view> </view>
@ -259,6 +259,7 @@ const calcFgQty = () => {
}) })
// //
if (pack.scaned && pack.qty == pack.fgList.length) { if (pack.scaned && pack.qty == pack.fgList.length) {
closeScanPopup()
commit() commit()
} }
}) })
@ -282,20 +283,34 @@ const closeScanPopup = () => {
} }
const scanLocationCode = (location, code) => { const scanLocationCode = (location, code) => {
toLocationCode.value = code //
detailSource.value.forEach((item) => { if (this.jobContent.allowModifyLocation == "TRUE") {
item.subList.forEach((detail) => { toLocationCode.value = code
detail.toLocationCode = code detailSource.value.forEach((item) => {
item.subList.forEach((detail) => {
detail.toLocationCode = code
})
}) })
}) } else {
//
if (code != this.jobToLocationCode) {
this.showMessageHint("任务中不允许修改库位\n扫描库位[" + code + "]推荐库位是[" + this.jobToLocationCode + "]",
callBack => {})
} else {
toLocationCode.value = code
detailSource.value.forEach((item) => {
item.subList.forEach((detail) => {
detail.toLocationCode = code
})
})
}
}
} }
const checkLocation = () => { const checkLocation = () => {
let isPass = true let isPass = true
if (toLocationCode.value == '' || toLocationCode.value == null) { if (toLocationCode.value == '' || toLocationCode.value == null) {
showMessageHint('请扫描收货库位', (callback) => { comScanLocation.value.showLocation()
comScanLocation.value.showLocation()
})
return (isPass = false) return (isPass = false)
} }
return isPass return isPass
@ -390,6 +405,9 @@ const commit = () => {
}else{ }else{
this.toLocationCode = this.jobToLocationCode this.toLocationCode = this.jobToLocationCode
} }
if(!toLocationCode.value){
return;
}
detailSource.value.forEach((item) => { detailSource.value.forEach((item) => {
item.subList.forEach((subitem) => { item.subList.forEach((subitem) => {
if (valiDate) { if (valiDate) {
@ -429,7 +447,7 @@ const submitJob = () => {
.then((res) => { .then((res) => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
showCommitSuccessMessage(`提交成功<br>生成装配收货记录<br>${res.data}`) showCommitSuccessMessage(`提交成功\n生成装配收货记录\n${res.data}`)
} else { } else {
showErrorMessage(`提交失败[${res.msg}]`) showErrorMessage(`提交失败[${res.msg}]`)
} }

27
src/pages/productReceipt/job/fgProductReceiptJob.vue

@ -6,23 +6,42 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue' import { ref, getCurrentInstance, nextTick } from 'vue'
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app' import {
onLoad,
onShow,
onNavigationBarButtonTap,
onReady,
onBackPress,
onReachBottom,
onPullDownRefresh,
onHide, onUnload
} from '@dcloudio/uni-app'
import productReceiptJob from '@/pages/productReceipt/job/productReceiptJob.vue' import productReceiptJob from '@/pages/productReceipt/job/productReceiptJob.vue'
const productreceiptjobRef = ref() const productreceiptjobRef = ref()
const title = ref('') const title = ref('')
onShow(() => { onShow(() => {
nextTick(() => { nextTick(() => {
if (productreceiptjobRef.value != undefined) { if (productreceiptjobRef.value) {
productreceiptjobRef.value.refresh() productreceiptjobRef.value.timerRefresh()
} }
}) })
}) })
onHide(()=>{
if (productreceiptjobRef.value) {
productreceiptjobRef.value.stopRefresh()
}
})
onUnload(()=>{
if (productreceiptjobRef.value) {
productreceiptjobRef.value.stopRefresh()
}
})
onLoad((option) => { onLoad((option) => {
title.value = option.title title.value = option.title
}) })
onPullDownRefresh(() => { onPullDownRefresh(() => {
productreceiptjobRef.value.refresh() productreceiptjobRef.value.timerRefresh()
}) })
onReachBottom(() => { onReachBottom(() => {
productreceiptjobRef.value.onReach() productreceiptjobRef.value.onReach()

60
src/pages/productReceipt/job/productReceiptDetail.vue

@ -31,7 +31,7 @@
<view class="cell_info"> <view class="cell_info">
<view class="text_lightblue">班次</view> <view class="text_lightblue">班次</view>
<view> <view>
{{ jobContent.shift }} {{ jobContent.shiftName }}
</view> </view>
</view> </view>
</view> </view>
@ -40,7 +40,15 @@
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<comProductDetailCard :dataContent="item" :settingParam="jobContent" :isShowLocation="false" @remove="updateData" @updateData="updateData" :locationAreaTypeList="toLocationAreaTypeList"> </comProductDetailCard> <comProductDetailCardBatch :dataContent="item" :settingParam="jobContent" :isShowLocation="false"
@remove="updateData" @updateData="updateData"
:locationAreaTypeList='toLocationAreaTypeList' v-if="managementType=='BY_BATCH'">
</comProductDetailCardBatch>
<comProductDetailCard v-else :dataContent="item" :settingParam="jobContent"
:isShowLocation="false" @remove="updateData"
@updateData="updateData"
:locationAreaTypeList="toLocationAreaTypeList">
</comProductDetailCard>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@ -69,7 +77,7 @@ import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReach
import { getManagementPrecisions } from '@/common/balance.js' import { getManagementPrecisions } from '@/common/balance.js'
import { getProductReceiptJobDetail, takeProductReceiptJob, cancleTakeProductReceiptJob, productReceiptJobsubmit } from '@/api/request2.js' import { getProductReceiptJobDetail, takeProductReceiptJob, cancleTakeProductReceiptJob, productReceiptJobsubmit } from '@/api/request2.js'
import { goHome, navigateBack, getPackingNumberAndBatch } from '@/common/basic.js' import { goHome, navigateBack, getPackingNumberAndBatch ,getSwitchInfoByCode} from '@/common/basic.js'
import { getDirectoryItemArray, getInventoryStatusName } from '@/common/directory.js' import { getDirectoryItemArray, getInventoryStatusName } from '@/common/directory.js'
@ -82,6 +90,7 @@ import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comDetailCard from '@/mycomponents/detail/comDetailCard.vue' import comDetailCard from '@/mycomponents/detail/comDetailCard.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import comProductDetailCard from '@/pages/productReceipt/coms/comProductDetailCard.vue' import comProductDetailCard from '@/pages/productReceipt/coms/comProductDetailCard.vue'
import comProductDetailCardBatch from "@/pages/productReceipt/coms/comProductDetailCardBatch.vue"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store // store
const store = useCountStore() const store = useCountStore()
@ -96,6 +105,7 @@ const subList = ref([]) // 接口返回的任务subList
const detailSource = ref([]) // const detailSource = ref([]) //
const toLocationAreaTypeList = ref([]) const toLocationAreaTypeList = ref([])
const managementList = ref([]) const managementList = ref([])
const managementType = ref('')
const jobStatus = ref('') const jobStatus = ref('')
const jobToLocationCode = ref('') const jobToLocationCode = ref('')
const status = ref('') const status = ref('')
@ -179,14 +189,30 @@ const getDetail = () => {
jobToLocationCode.value = subList.value[0].toLocationCode jobToLocationCode.value = subList.value[0].toLocationCode
productionLineCode.value = jobContent.value.subList[0].productionLineCode productionLineCode.value = jobContent.value.subList[0].productionLineCode
if (jobContent.value.allowModifyLocation == 'FALSE') { let valiDate = getSwitchInfoByCode("semiProductReceipCommitValidate")
toLocationCode.value = subList.value[0].toLocationCode if(valiDate){
jobContent.value.allowModifyLocation = 'TRUE'
}else{
jobContent.value.allowModifyLocation = 'FALSE'
} }
toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes) toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes)
detailSource.value = getDataSource(subList.value) detailSource.value = getDataSource(subList.value)
if (scanMessage.value) { if (scanMessage.value) {
scanPopup.value.simulateScan(scanMessage.value) scanPopup.value.simulateScan(scanMessage.value)
} }
//
let itemCodes = []
detailSource.value.forEach(item => {
itemCodes.push(item.itemCode)
item.scaned = false
})
getManagementPrecisions(itemCodes, jobToLocationCode.value, res => {
if (res.success) {
managementList.value = res.list;
managementType.value = managementList.value.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
}
})
} else { } else {
showMessage('列表数据为0') showMessage('列表数据为0')
} }
@ -207,11 +233,12 @@ const getScanResult = (result) => {
if (detail == undefined) { if (detail == undefined) {
showErrorMessage(`物料号【${itemCode}】不在列表中`) showErrorMessage(`物料号【${itemCode}】不在列表中`)
} else { } else {
detail.scaned = true
const itemDetail = detail.subList.find((r) => r.packingNumber == packingNumber && r.batch == batch) const itemDetail = detail.subList.find((r) => r.packingNumber == packingNumber && r.batch == batch)
if (itemDetail == undefined) { if (itemDetail == undefined) {
showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]不在任务列表中`) showErrorMessage(`批次[${batch}]不在任务列表中`)
} else if (itemDetail.scaned) { } else if (itemDetail.scaned) {
showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]已经扫描`) showErrorMessage(`批次[${batch}]已经扫描`)
} else { } else {
itemDetail.scaned = true itemDetail.scaned = true
itemDetail.handleQty = Number(result.label.qty) itemDetail.handleQty = Number(result.label.qty)
@ -235,7 +262,7 @@ const continueScan = () => {
} }
const updateData = () => { const updateData = () => {
calcHandleQty(detailSource.value) // calcHandleQty(detailSource.value)
} }
const openScanPopup = () => { const openScanPopup = () => {
@ -281,9 +308,14 @@ const commit = () => {
showErrorMessage('扫描数为0,请先扫描') showErrorMessage('扫描数为0,请先扫描')
return return
} }
// let valiDate = getSwitchInfoByCode("semiProductReceipCommitValidate")
if (!checkLocation()) { //
return if(valiDate){
if (!checkLocation()) {
return
}
}else{
toLocationCode.value = jobToLocationCode.value
} }
// //
@ -300,7 +332,7 @@ const commit = () => {
} }
} else { } else {
// //
showMessage('请完成扫描后,再进行提交<br>' + `已经扫描[${scanCount.value}]总共[${subList.value.length}]`) showMessage('请完成扫描后,再进行提交\n' + `已经扫描[${scanCount.value}]总共[${subList.value.length}]`)
} }
} }
} }
@ -344,7 +376,7 @@ const submitJob = () => {
.then((res) => { .then((res) => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
showCommitSuccessMessage(`提交成功<br>生成预生产收货记录<br>${res.data}`) showCommitSuccessMessage(`提交成功\n生成预生产收货记录\n${res.data}`)
} else { } else {
showErrorMessage(`提交失败[${res.msg}]`) showErrorMessage(`提交失败[${res.msg}]`)
} }
@ -369,6 +401,8 @@ const setParams = () => {
if (detail.scaned) { if (detail.scaned) {
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.fromPackingNumber = info.packingNumber;
detail.toBatch = info.batch detail.toBatch = info.batch
detail.toContainerNumber = '' detail.toContainerNumber = ''
detail.toInventoryStatus = detail.inventoryStatus detail.toInventoryStatus = detail.inventoryStatus

113
src/pages/productReceipt/job/productReceiptJob.vue

@ -27,7 +27,7 @@ import { getProductReceiptJobList, cancleTakeProductReceiptJob } from '@/api/req
import { goHome, updateTitle } from '@/common/basic.js' import { goHome, updateTitle } from '@/common/basic.js'
import { getDetailOption, getDetailGiveupOption } from '@/common/array.js' import { getDetailOption, getDetailGiveupOption } from '@/common/array.js'
import {planRefreshTime} from '@/common/config.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue' import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue' import jobFilter from '@/mycomponents/job/jobFilter.vue'
@ -72,15 +72,26 @@ const jobInfoPopupRef = ref()
const jobListPopupRef = ref() const jobListPopupRef = ref()
const scanPopup = ref() const scanPopup = ref()
const jobListRef = ref() const jobListRef = ref()
const timer = ref(null)
onMounted(() => { onMounted(() => {
detailOptions.value = getDetailOption() detailOptions.value = getDetailOption()
detailGiveupOptions.value = getDetailGiveupOption() detailGiveupOptions.value = getDetailGiveupOption()
timerRefresh()
// getList('refresh') // getList('refresh')
}) })
const refresh = () => { const timerRefresh = () => {
getList('refresh') getList('refresh')
stopRefresh();
timer.value = setInterval(function() {
getList('refresh');
}, planRefreshTime)
}
const stopRefresh = ()=> {
if (timer.value) {
clearInterval(timer.value);
timer.value = null;
}
} }
const getList = (type) => { const getList = (type) => {
proxy.$modal.loading('加载中­....') proxy.$modal.loading('加载中­....')
loadingType.value = 'loading' loadingType.value = 'loading'
@ -102,11 +113,6 @@ const getList = (type) => {
action: 'in', action: 'in',
value: status.value value: status.value
}) })
filters.push({
column: 'accept_user_id',
action: '==',
value: store.id
})
filters.push({ filters.push({
column: 'type', column: 'type',
action: '==', action: '==',
@ -151,20 +157,7 @@ const getList = (type) => {
} }
const openJobDetail = (item, scanMessage = '') => { const openJobDetail = (item, scanMessage = '') => {
if (props.type == 'predict') { getJobInfoByNumber(item.number,scanMessage)
uni.navigateTo({
url: `./productReceiptDetail?id=${item.masterId}&status=${item.status}&scanMessage=${scanMessage}&title=${props.title}`
})
} else if (props.type == 'assemble') {
uni.navigateTo({
url: `./fgProductReceiptDetail?id=${item.masterId}&status=${item.status}&scanMessage=${scanMessage}&title=${props.title}}`
})
} else {
uni.navigateTo({
url: `./scrapReceiptDetail?id=${item.masterId}&status=${item.status}&scanMessage=${scanMessage}&title=${props.title}}`
})
}
scanMessage.value = ''
} }
const showItemList = (itemList) => { const showItemList = (itemList) => {
@ -239,11 +232,6 @@ const getDataListByType = (code) => {
action: '==', action: '==',
value: code value: code
}) })
filters.push({
column: 'accept_user_id',
action: '==',
value: store.id
})
const params = { const params = {
filters, filters,
pageNo: 1, pageNo: 1,
@ -264,8 +252,14 @@ const getDataListByType = (code) => {
}) })
} }
const showMessage = (message) => { const showMessage = (message) => {
if(scanPopup.value){
scanPopup.value.packLoseFocus()
}
comMessageRef.value.showErrorMessage(message, (res) => { comMessageRef.value.showErrorMessage(message, (res) => {
if (res) { if (res) {
if(scanPopup.value){
scanPopup.value.packGetFocus()
}
} }
}) })
} }
@ -322,11 +316,6 @@ const getScanResult = (result) => {
action: 'in', action: 'in',
value: '1,2' value: '1,2'
}, },
{
column: 'accept_user_id',
action: '==',
value: store.id
}
// { // {
// column: 'fromLocationCode', // column: 'fromLocationCode',
// action: '==', // action: '==',
@ -358,16 +347,72 @@ const getScanResult = (result) => {
selectItem(list[0]) selectItem(list[0])
} }
} else { } else {
showMessage('未查找到任务<br>' + `扫描[${result.scanMessage}]`) showMessage('未查找到任务\n' + `扫描[${result.scanMessage}]`)
} }
}) })
.catch((error) => { .catch((error) => {
showMessage(error) showMessage(error)
}) })
} catch (e) { } catch (e) {
showMessage(`${error}<br>扫描[${result.scanMessage}]`) showMessage(`${error}\n扫描[${result.scanMessage}]`)
} }
} }
const getJobInfoByNumber = (number,scanMessage)=>{
uni.showLoading({
title: "加载中....",
mask: true
});
let filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: number
})
const params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getProductReceiptJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
showMessage('未查找到' + '【' + number + '】的发料任务');
} else {
let result = res.data.list[0];
if(result.acceptUserId&&result.acceptUserId!=this.$store.state.user.id){
comMessageRef.value.showErrorMessage("任务号["+result.number+"]已经被["+result.acceptUserName+"]承接,无法执行", res => {
if (res) {
getList('refresh')
}
});
return;
}
if (props.type == 'predict') {
uni.navigateTo({
url: `./productReceiptDetail?id=${item.masterId}&status=${item.status}&scanMessage=${scanMessage}&title=${props.title}`
})
} else if (props.type == 'assemble') {
uni.navigateTo({
url: `./fgProductReceiptDetail?id=${item.masterId}&status=${item.status}&scanMessage=${scanMessage}&title=${props.title}}`
})
} else {
uni.navigateTo({
url: `./scrapReceiptDetail?id=${item.masterId}&status=${item.status}&scanMessage=${scanMessage}&title=${props.title}}`
})
}
scanMessage.value = ''
}
}).catch(error => {
uni.hideLoading();
showMessage(error);
})
}
defineExpose({ defineExpose({
refresh, refresh,
toHome, toHome,

84
src/pages/productReceipt/job/scrapReceiptDetail.vue

@ -13,7 +13,12 @@
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<comProductDetailCard :dataContent="item" :settingParam="jobContent" :isShowLocation="false" @remove="updateData" @updateData="updateData" :locationTypeList="toLocationTypeList"> </comProductDetailCard> <comProductDetailCardBatch :dataContent="item" :settingParam="jobContent" :isShowLocation="false"
@remove="updateData" @updateData="updateData" :locationTypeList='toLocationTypeList' v-if="managementType=='BY_BATCH'">
</comProductDetailCardBatch>
<comProductDetailCard :dataContent="item" :settingParam="jobContent" :isShowLocation="false"
@remove="updateData" @updateData="updateData" :locationTypeList='toLocationTypeList' v-else>
</comProductDetailCard>
</view> </view>
<u-line /> <u-line />
</view> </view>
@ -55,6 +60,7 @@ import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comDetailCard from '@/mycomponents/detail/comDetailCard.vue' import comDetailCard from '@/mycomponents/detail/comDetailCard.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import comProductDetailCard from '@/pages/productReceipt/coms/comProductDetailCard.vue' import comProductDetailCard from '@/pages/productReceipt/coms/comProductDetailCard.vue'
import comProductDetailCardBatch from "@/pages/productReceipt/coms/comProductDetailCardBatch.vue"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store // store
const store = useCountStore() const store = useCountStore()
@ -66,6 +72,7 @@ const toLocationCode = ref('')
const subList = ref([]) // subList const subList = ref([]) // subList
const detailSource = ref([]) // const detailSource = ref([]) //
const managementList = ref([]) const managementList = ref([])
const managementType = ref('')
const jobStatus = ref('') const jobStatus = ref('')
const toLocationTypeList = ref([]) const toLocationTypeList = ref([])
const receiptJob = ref({}) const receiptJob = ref({})
@ -75,6 +82,7 @@ const scanPopup = ref()
const comScanLocation = ref() const comScanLocation = ref()
const detailInfoPopupRef = ref() const detailInfoPopupRef = ref()
const comMessageRef = ref() const comMessageRef = ref()
const managementPrecision = ref()
onLoad((option) => { onLoad((option) => {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: `${option.title}详情` title: `${option.title}详情`
@ -135,7 +143,7 @@ const receive = (callback) => {
const getDetail = () => { const getDetail = () => {
proxy.$modal.loading('加载中....') proxy.$modal.loading('加载中....')
getProductReceiptJobDetail(id.value) getProductReceiptJobDetail(id.value)
.then((res) => { .then(async (res) => {
uni.hideLoading() uni.hideLoading()
if (res.data == null) { if (res.data == null) {
showMessage('未获取到详情') showMessage('未获取到详情')
@ -145,7 +153,20 @@ const getDetail = () => {
subList.value = res.data.subList subList.value = res.data.subList
jobToLocationCode.value = subList.value[0].toLocationCode jobToLocationCode.value = subList.value[0].toLocationCode
toLocationTypeList.value = getDirectoryItemArray(jobContent.value.toLocationTypes) toLocationTypeList.value = getDirectoryItemArray(jobContent.value.toLocationTypes)
detailSource.value = getDataSource(subList.value) detailSource.value = await getDataSource(subList.value)
//
let itemCodes = []
detailSource.value.forEach(item => {
itemCodes.push(item.itemCode)
item.scaned = false
})
await getManagementPrecisions(itemCodes, jobToLocationCode.value, res => {
if (res.success) {
managementList.value = res.list;
managementType.value = managementList.value.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
}
})
uni.hideLoading() uni.hideLoading()
} else { } else {
showMessage('列表数据为0') showMessage('列表数据为0')
@ -167,18 +188,25 @@ const getScanResult = (result) => {
if (detail == undefined) { if (detail == undefined) {
showErrorMessage(`物料号【${itemCode}】不在列表中`) showErrorMessage(`物料号【${itemCode}】不在列表中`)
} else { } else {
const itemDetail = detail.subList.find((r) => r.packingNumber == packingNumber && r.batch == batch) let itemDetail
if(managementPrecision.value == 'BY_QUANTITY'){
itemDetail = detail.subList.find(r => r.itemCode == result.label.itemCode);
}else{
itemDetail = detail.subList.find(r => r.batch == batch);
}
if (itemDetail == undefined) { if (itemDetail == undefined) {
showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]不在任务列表中`) showErrorMessage(`批次[${batch}]不在任务列表中`)
} else if (itemDetail.scaned) {
showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]已经扫描`)
} else { } else {
itemDetail.scaned = true if(itemDetail.scaned){
itemDetail.handleQty = Number(result.label.qty) showErrorMessage(`批次[${batch}]已经扫描`)
itemDetail.toLocationCode = toLocationCode.value }else {
itemDetail.labelQty = Number(result.label.qty) itemDetail.scaned = true
calcHandleQty(detailSource.value) itemDetail.handleQty = Number(result.label.qty)
continueScan() itemDetail.toLocationCode = toLocationCode.value
itemDetail.labelQty = Number(result.label.qty)
calcHandleQty(detailSource.value)
continueScan()
}
} }
} }
} }
@ -235,17 +263,38 @@ const commit = () => {
if (!checkLocation()) { if (!checkLocation()) {
return return
} }
// //
if (scanCount.value == subList.value.length) {
checkCount();
} else if (scanCount.value < subList.value.length) {
//
if (jobContent.value.allowPartialComplete == "TRUE") {
//
checkCount();
} else {
//
showMessage("任务明细未全部完成,是否提交");
}
}
}
const checkCount = ()=>{
// //
let str = '' let str = ''
detailSource.value.forEach((item) => { detailSource.value.forEach((item) => {
item.subList.forEach(cur => { item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) { if (cur.qty != cur.handleQty) {
str += `包装号【${cur.packingNumber}】提交数量【${cur.handleQty}】与任务物料数量【${cur.qty}】不一致` let tempHandleQty = 0
if(cur.handleQty){
tempHandleQty = cur.handleQty
}else {
tempHandleQty = 0
}
str += `包装号【${cur.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致`
} }
}) })
}) })
if (str) { if (str) {
str += ',是否确认提交?' str = '任务明细未全部完成,是否提交?\n'+str
comMessageRef.value.showQuestionMessage1(str, 'red', res => { comMessageRef.value.showQuestionMessage1(str, 'red', res => {
if (res) { if (res) {
submitJob() submitJob()
@ -269,12 +318,13 @@ const submitJob = () => {
getManagementPrecisions(itemCodes, toLocationCode.value, (res) => { getManagementPrecisions(itemCodes, toLocationCode.value, (res) => {
if (res.success) { if (res.success) {
managementList.value = res.list managementList.value = res.list
managementPrecision.value = managementList.value[0].ManagementPrecision
const params = setParams() const params = setParams()
productReceiptJobsubmit(params) productReceiptJobsubmit(params)
.then((res) => { .then((res) => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
showCommitSuccessMessage(`提交成功<br>生成制品上架记录:${res.data}`) showCommitSuccessMessage(`提交成功\n生成制品上架记录:${res.data}`)
} else { } else {
showErrorMessage(`提交失败[${res.msg}]`) showErrorMessage(`提交失败[${res.msg}]`)
} }
@ -298,6 +348,8 @@ const setParams = () => {
if (detail.scaned) { if (detail.scaned) {
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.fromPackingNumber = info.packingNumber;
detail.toBatch = info.batch detail.toBatch = info.batch
detail.toContainerNumber = '' detail.toContainerNumber = ''
detail.toInventoryStatus = detail.inventoryStatus detail.toInventoryStatus = detail.inventoryStatus

27
src/pages/productReceipt/job/scrapReceiptJob.vue

@ -6,23 +6,42 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue' import { ref, getCurrentInstance, nextTick } from 'vue'
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app' import {
onLoad,
onShow,
onNavigationBarButtonTap,
onReady,
onBackPress,
onReachBottom,
onPullDownRefresh,
onHide, onUnload
} from '@dcloudio/uni-app'
import productReceiptJob from '@/pages/productReceipt/job/productReceiptJob.vue' import productReceiptJob from '@/pages/productReceipt/job/productReceiptJob.vue'
const productreceiptjobRef = ref() const productreceiptjobRef = ref()
const title = ref('') const title = ref('')
onShow(() => { onShow(() => {
nextTick(() => { nextTick(() => {
if (productreceiptjobRef.value != undefined) { if (productreceiptjobRef.value) {
productreceiptjobRef.value.refresh() productreceiptjobRef.value.timerRefresh()
} }
}) })
}) })
onHide(()=>{
if (productreceiptjobRef.value) {
productreceiptjobRef.value.stopRefresh()
}
})
onUnload(()=>{
if (productreceiptjobRef.value) {
productreceiptjobRef.value.stopRefresh()
}
})
onLoad((option) => { onLoad((option) => {
title.value = option.title title.value = option.title
}) })
onPullDownRefresh(() => { onPullDownRefresh(() => {
productreceiptjobRef.value.refresh() productreceiptjobRef.value.timerRefresh()
}) })
onReachBottom(() => { onReachBottom(() => {
productreceiptjobRef.value.onReach() productreceiptjobRef.value.onReach()

789
src/pages/productReceipt/job/semiProductReceiptDetail.vue

@ -1,415 +1,386 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<view class="page-header"> <view class="page-header">
<view class="header_job_top"> <view class="header_job_top">
<job-top :dataContent="jobContent"></job-top> <job-top :dataContent="jobContent"></job-top>
</view> </view>
<view class="header_item"> <view class="header_item">
申请单号 : {{jobContent.requestNumber}} 申请单号 : {{ jobContent.requestNumber }}
</view> </view>
<view class='split_line'></view> <view class='split_line'></view>
</view> </view>
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<comProductDetailCard :dataContent="item" :settingParam="jobContent" :isShowLocation="false" <comProductDetailCard :dataContent="item" :settingParam="jobContent" :isShowLocation="false"
@remove="updateData" @updateData="updateData" :locationTypeList='toLocationTypeList'> @remove="updateData" @updateData="updateData" :locationTypeList='toLocationTypeList'>
</comProductDetailCard> </comProductDetailCard>
</view> </view>
<view class='split_line'></view> <view class='split_line'></view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="page-footer"> <view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<locationCompare title="收货库位" :recommendLocationCode="jobToLocationCode" :locationCode="toLocationCode" <locationCompare title="收货库位" :recommendLocationCode="jobToLocationCode" :locationCode="toLocationCode"
@getLocation='scanLocationCode' @getLocation='scanLocationCode'
:locationTypeList="toLocationTypeList"></locationCompare> :locationTypeList="toLocationTypeList"></locationCompare>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view> </view>
</view> </view>
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' :title="'制品标签'" headerType="HMQ"></win-scan-pack> <win-scan-pack ref="scanPopup" @getResult='getScanResult' :title="'制品标签'" headerType="HMQ"></win-scan-pack>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
<script> <script setup lang="ts">
import { import {
getManagementPrecisions getManagementPrecisions
} from '@/common/balance.js'; } from '@/common/balance.js';
import { import {
getProductReceiptJobDetail, getProductReceiptJobDetail,
takeProductReceiptJob, takeProductReceiptJob,
cancleTakeProductReceiptJob, cancleTakeProductReceiptJob,
productReceiptJobsubmit productReceiptJobsubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
navigateBack, navigateBack,
getPackingNumberAndBatch, getPackingNumberAndBatch,
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
getDirectoryItemArray, getDirectoryItemArray,
getInventoryStatusName getInventoryStatusName
} from '@/common/directory.js'; } from '@/common/directory.js';
import { import {
getDataSource, getDataSource,
createRecordInfo, createRecordInfo,
calcHandleQty, calcHandleQty,
getScanCount getScanCount
} from '@/common/detail.js'; } from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue' import locationCompare from '@/mycomponents/location/locationCompare.vue'
import winScanPack from "@/mycomponents/scan/winScanPack.vue" import winScanPack from "@/mycomponents/scan/winScanPack.vue"
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue" import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue"
export default { import {ref, onMounted, onBeforeUnmount} from 'vue';
name: 'receipt_detail', import {onLoad, onPullDownRefresh, onBackPress, onNavigationBarButtonTap} from '@dcloudio/uni-app';
components: { import {useCountStore} from '@/store'
winScanButton,
comDetailCard, const store = useCountStore()
locationCompare, const id = ref('');
winScanPack, const receiptJob = ref({});
jobTop, const toLocationCode = ref('');
comProductDetailCard const isShowPackingCode = ref(true);
}, const scanCount = ref(0);
data() { const jobContent = ref({}); //
return { const subList = ref([]); // subList
id: '', const detailSource = ref([]); //
receiptJob: {}, const toLocationTypeList = ref([]);
toLocationCode: '', const managementList = ref([]);
isShowPackingCode: true, const jobStatus = ref("");
scanCount: 0, const jobToLocationCode = ref("");
jobContent: {}, //
subList: [], //subList const scanPopupRef = ref(null);
detailSource: [], // const comMessageRef = ref(null);
toLocationTypeList: [], const comScanLocationRef = ref(null);
managementList: [],
jobStatus:"", onLoad((option) => {
jobToLocationCode:"" id.value = option.id;
if (id.value !== undefined) {
}; //
}, if (option.status === "1") {
onLoad(option) { receive(() => {
this.id = option.id; getDetail();
if (this.id != undefined) { });
// } else {
if (option.status == "1") { getDetail();
this.receive((callback => { }
this.getDetail(); }
})); });
} else {
this.getDetail(); onNavigationBarButtonTap((e) => {
} if (e.index === 0) {
goHome();
} }
}, });
//
onNavigationBarButtonTap(e) { onBackPress((e) => {
if (e.index === 0) { //
goHome(); if (e.from === 'backbutton') {
} if (jobStatus.value === "2") {
}, //
// cancleTakeProductReceiptJob(id.value).then(() => {
onBackPress(e) { uni.navigateBack();
// }).catch(() => {
if (e.from == 'backbutton') { uni.navigateBack();
if (this.jobStatus=="2") { });
// } else {
cancleTakeProductReceiptJob(this.id).then(res => { uni.navigateBack();
uni.navigateBack(); }
}).catch(error => { return true;
uni.navigateBack(); }
}) });
} else {
uni.navigateBack(); onPullDownRefresh(() => {
} getDetail();
uni.stopPullDownRefresh();
return true; });
}
//
}, const receive = (callback) => {
if (id.value !== null) {
onPullDownRefresh() { takeProductReceiptJob(id.value).then(() => {
this.getDetail(); callback();
uni.stopPullDownRefresh(); }).catch((error) => {
}, showErrorMessage(error);
});
mounted() { }
};
},
methods: { const getDetail = () => {
// uni.showLoading({
receive(callback) { title: "加载中....",
if (this.id != null) { mask: true
takeProductReceiptJob(this.id).then(res => { });
callback(); getProductReceiptJobDetail(id.value).then((res) => {
}).catch(error => { uni.hideLoading();
this.showErrorMessage(error) if (res.data === null) {
}) showMessage('未获取到详情');
} } else {
}, if (res.data.subList.length > 0) {
jobContent.value = res.data;
getDetail() { subList.value = res.data.subList;
var that = this; jobStatus.value = res.data.status;
uni.showLoading({ jobToLocationCode.value = subList.value[0].toLocationCode;
title: "加载中....", toLocationTypeList.value = getDirectoryItemArray(jobContent.value.toLocationTypes);
mask: true detailSource.value = getDataSource(subList.value);
}); } else {
getProductReceiptJobDetail(that.id).then(res => { showMessage('列表数据为0');
uni.hideLoading(); }
if (res.data == null) { }
that.showMessage('未获取到详情'); }).catch((error) => {
} else { uni.hideLoading();
if (res.data.subList.length > 0) { showErrorMessage(error);
that.jobContent = res.data; });
that.subList = res.data.subList; };
that.jobStatus = res.data.status
that.jobToLocationCode = that.subList[0].toLocationCode const getScanResult = (result) => {
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes) const label = result.label;
that.detailSource = getDataSource(that.subList) const packingNumber = label.packingNumber;
} else { const batch = label.batch;
that.showMessage('列表数据为0'); const qty = label.qty;
} const itemCode = label.itemCode;
}
}).catch(error => { const detail = detailSource.value.find((r) => r.itemCode === itemCode);
uni.hideLoading() if (detail === undefined) {
this.showErrorMessage(error) showErrorMessage(`物料号【${itemCode}】不在列表中`);
}) } else {
}, const itemDetail = detail.subList.find((r) =>
r.packingNumber === packingNumber && r.batch === batch
getScanResult(result) { );
let label = result.label; if (itemDetail === undefined) {
var packingNumber = label.packingNumber; showErrorMessage(`箱码[${packingNumber}]批次[${batch}]不在任务列表中`);
var batch = label.batch; } else {
var qty = label.qty; if (itemDetail.scaned) {
var itemCode = label.itemCode; showErrorMessage(`箱码[${packingNumber}]批次[${batch}]已经扫描`);
} else {
var detail = this.detailSource.find(r => r.itemCode == itemCode); itemDetail.scaned = true;
if (detail == undefined) { itemDetail.handleQty = Number(result.label.qty);
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") itemDetail.toLocationCode = toLocationCode.value;
} else { itemDetail.labelQty = Number(result.label.qty);
var itemDetail = detail.subList.find(r => calcHandleQty(detailSource.value);
r.packingNumber == packingNumber && continueScan();
r.batch == batch); }
if (itemDetail == undefined) { }
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在任务列表中") }
} else { };
if (itemDetail.scaned) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]已经扫描") const continueScan = () => {
} else { scanCount.value = getScanCount(subList.value);
itemDetail.scaned = true; if (scanCount.value === subList.value.length) {
itemDetail.handleQty = Number(result.label.qty); closeScanPopup();
itemDetail.toLocationCode = this.toLocationCode; } else {
itemDetail.labelQty = Number(result.label.qty); scanPopupGetFocus();
calcHandleQty(this.detailSource); }
this.continueScan() };
this.$forceUpdate()
} const updateData = () => {
calcHandleQty(detailSource.value);
} };
}
}, const openScanPopup = () => {
scanPopupRef.value.openScanPopup();
// };
continueScan() {
this.scanCount = getScanCount(this.subList); const closeScanPopup = () => {
if (this.scanCount == this.subList.length) { scanPopupRef.value.closeScanPopup();
this.closeScanPopup(); };
} else {
this.scanPopupGetFocus(); const scanLocationCode = (location, code) => {
} toLocationCode.value = code;
}, detailSource.value.forEach((item) => {
item.subList.forEach((detail) => {
detail.toLocationCode = code;
updateData() { });
calcHandleQty(this.detailSource); });
}, };
const checkLocation = () => {
openScanPopup() { let isPass = true;
this.$refs.scanPopup.openScanPopup(); if (toLocationCode.value === "" || toLocationCode.value === null) {
}, showMessageHint('请扫描收货库位', () => {
comScanLocationRef.value.showLocation();
closeScanPopup() { });
this.$refs.scanPopup.closeScanPopup(); isPass = false;
}, }
return isPass;
};
scanLocationCode(location, code) {
this.toLocationCode = code const showMessageHint = (hint, callback) => {
this.detailSource.forEach(item => { comMessageRef.value.showErrorMessage(hint, (res) => {
item.subList.forEach(detail => { if (res) {
detail.toLocationCode = code callback();
}) }
}) });
}, };
checkLocation() { const commit = () => {
var isPass = true; scanCount.value = getScanCount(subList.value);
if (this.toLocationCode == "" || this.toLocationCode == null) { if (scanCount.value === 0) {
this.showMessageHint('请扫描收货库位', callback => { showErrorMessage("扫描数为0,请先扫描");
this.$refs.comScanLocation.showLocation(); return;
}) }
if (!checkLocation()) {
return isPass = false; return;
} }
return isPass;
}, if (scanCount.value === subList.value.length) {
submitJob();
showMessageHint(hint, callback) { } else if (scanCount.value < subList.value.length) {
this.$refs.comMessage.showErrorMessage(hint, res => { if (jobContent.value.allowPartialComplete === "TRUE") {
if (res) { comMessageRef.value.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', (res) => {
callback() if (res) {
} submitJob();
}); }
}, });
} else {
commit() { showMessage("任务明细未全部完成,不允许部分提交!");
this.scanCount = getScanCount(this.subList); }
if (this.scanCount == 0) { }
this.showErrorMessage("扫描数为0,请先扫描") };
return;
} const submitJob = () => {
// uni.showLoading({
if (!this.checkLocation()) { title: "提交中....",
return mask: true
} });
const itemCodes = [];
detailSource.value.forEach((item) => {
// itemCodes.push(item.itemCode);
if (this.scanCount == this.subList.length) { });
this.submitJob(); getManagementPrecisions(itemCodes, toLocationCode.value, (res) => {
} else if (this.scanCount < this.subList.length) { if (res.success) {
// managementList.value = res.list;
if (this.jobContent.allowPartialComplete == "TRUE") { const params = setParams();
// console.log("提交参数", JSON.stringify(params));
this.submitJob(); productReceiptJobsubmit(params).then((res) => {
} else { uni.hideLoading();
// if (res.data) {
this.showMessage('请完成扫描后,再进行提交<br>' + "已经扫描[" + this.scanCount + "]总共[" + this.subList showCommitSuccessMessage(`提交成功\n生成制品收货记录\n${res.data}`);
.length + } else {
"]"); showErrorMessage(`提交失败[${res.msg}]`);
} }
} }).catch((error) => {
uni.hideLoading();
}, showErrorMessage(error);
});
submitJob() { } else {
uni.showLoading({ uni.hideLoading();
title: "提交中....", showErrorMessage(res.message);
mask: true }
}); });
var itemCodes = [] };
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode) const setParams = () => {
}) const subList = [];
getManagementPrecisions(itemCodes, this.toLocationCode, res => { const creator = store.id;
if (res.success) {
this.managementList = res.list; detailSource.value.forEach((item) => {
var params = this.setParams(); item.subList.forEach((detail) => {
console.log("提交参数", JSON.stringify(params)); if (detail.scaned) {
productReceiptJobsubmit(params).then(res => { const info = getPackingNumberAndBatch(managementList.value, detail.itemCode, detail.packingNumber, detail.batch);
uni.hideLoading() detail.toPackingNumber = info.packingNumber;
if (res.data) { detail.toBatch = info.batch;
this.showCommitSuccessMessage("提交成功<br>生成制品收货记录<br>" + res.data, ) detail.toContainerNumber = '';
} else { detail.toInventoryStatus = detail.inventoryStatus;
this.showErrorMessage("提交失败[" + res.msg + "]") detail.toLocationCode = toLocationCode.value;
} subList.push(detail);
}).catch(error => { }
uni.hideLoading() });
this.showErrorMessage(error) });
}) jobContent.value.subList = subList;
} else { jobContent.value.creator = creator;
uni.hideLoading(); return jobContent.value;
this.showErrorMessage(res.message); };
}
}); const scanPopupGetFocus = () => {
}, if (scanPopupRef.value) {
scanPopupRef.value.getfocus();
setParams() { }
var subList = [] };
var creator = this.$store.state.user.id
const scanPopupLoseFocus = () => {
this.detailSource.forEach(item => { if (scanPopupRef.value) {
item.subList.forEach(detail => { scanPopupRef.value.losefocus();
if (detail.scaned) { }
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, };
detail.packingNumber, detail.batch);
detail.toPackingNumber = info.packingNumber; const showMessage = (message) => {
detail.toBatch = info.batch; setTimeout(() => {
detail.toContainerNumber = ''; scanPopupLoseFocus();
detail.toInventoryStatus = detail.inventoryStatus comMessageRef.value.showMessage(message, (res) => {
detail.toLocationCode = this.toLocationCode if (res) {
subList.push(detail) scanPopupGetFocus();
} }
}) });
}) });
this.jobContent.subList = subList };
this.jobContent.creator = creator;
return this.jobContent; const showErrorMessage = (message) => {
}, setTimeout(() => {
scanPopupLoseFocus();
comMessageRef.value.showErrorMessage(message, (res) => {
scanPopupGetFocus() { if (res) {
if (this.$refs.scanPopup != undefined) { scanPopupGetFocus();
this.$refs.scanPopup.getfocus(); }
} });
}, });
};
scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) { const showCommitSuccessMessage = (hint) => {
this.$refs.scanPopup.losefocus(); comMessageRef.value.showSuccessMessage(hint, () => {
} navigateBack(1);
}, });
};
showMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.scanPopupGetFocus();
}
});
})
},
showErrorMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.scanPopupGetFocus();
}
});
})
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1)
})
},
}
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

27
src/pages/productReceipt/job/semiProductReceiptJob.vue

@ -6,23 +6,42 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue' import { ref, getCurrentInstance, nextTick } from 'vue'
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app' import {
onLoad,
onShow,
onNavigationBarButtonTap,
onReady,
onBackPress,
onReachBottom,
onPullDownRefresh,
onHide, onUnload
} from '@dcloudio/uni-app'
import productReceiptJob from '@/pages/productReceipt/job/productReceiptJob.vue' import productReceiptJob from '@/pages/productReceipt/job/productReceiptJob.vue'
const productreceiptjobRef = ref() const productreceiptjobRef = ref()
const title = ref('') const title = ref('')
onShow(() => { onShow(() => {
nextTick(() => { nextTick(() => {
if (productreceiptjobRef.value != undefined) { if (productreceiptjobRef.value) {
productreceiptjobRef.value.refresh() productreceiptjobRef.value.timerRefresh()
} }
}) })
}) })
onHide(()=>{
if (productreceiptjobRef.value) {
productreceiptjobRef.value.stopRefresh()
}
})
onUnload(()=>{
if (productreceiptjobRef.value) {
productreceiptjobRef.value.stopRefresh()
}
})
onLoad((option) => { onLoad((option) => {
title.value = option.title title.value = option.title
}) })
onPullDownRefresh(() => { onPullDownRefresh(() => {
productreceiptjobRef.value.refresh() productreceiptjobRef.value.timerRefresh()
}) })
onReachBottom(() => { onReachBottom(() => {
productreceiptjobRef.value.onReach() productreceiptjobRef.value.onReach()

Loading…
Cancel
Save