Browse Source

fix: putaway\job scrap\job 文件修改 Vue2升级Vue3 10/25-11-11

syhx_app_vue3
王志国 2 weeks ago
parent
commit
d7963ff62b
  1. 12
      src/pages/putaway/job/putawayDetail.vue
  2. 3
      src/pages/putaway/job/putawayJob.vue
  3. 185
      src/pages/scrap/job/scrapJobDetail.vue

12
src/pages/putaway/job/putawayDetail.vue

@ -52,7 +52,9 @@
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 } from '@dcloudio/uni-app'
import { getManagementPrecisions } from '@/common/balance.js' import { getManagementPrecisions } from '@/common/balance.js'
import {
calc
} from '@/common/calc'
import { getPutawayJobDetail, putawayJobSubmit, takePutawayJob, cancleTakePutawayJob, getSwitchByCode } from '@/api/request2.js' import { getPutawayJobDetail, putawayJobSubmit, takePutawayJob, cancleTakePutawayJob, getSwitchByCode } from '@/api/request2.js'
import { goHome, getCurrDateTime, getPackingNumberAndBatch, navigateBack, compareAsc, getSwitchInfoByCode } from '@/common/basic.js' import { goHome, getCurrDateTime, getPackingNumberAndBatch, navigateBack, compareAsc, getSwitchInfoByCode } from '@/common/basic.js'
@ -226,7 +228,7 @@ const continueScan = () => {
} }
} }
const updateData = () => { const updateData = () => {
// calcTreeHandleQty(detailSource.value) calcTreeHandleQty(detailSource.value)
} }
// //
const openScanPopupSimulate = (message) => { const openScanPopupSimulate = (message) => {
@ -329,7 +331,7 @@ const getScanResult = (result,managementPrecision) => {
if (isExit == undefined) { if (isExit == undefined) {
showErrorMessage(`箱码【${packingNumber}】,批次【${batch}】库位【${result.fromLocationCode}】不在列表中`) showErrorMessage(`箱码【${packingNumber}】,批次【${batch}】库位【${result.fromLocationCode}】不在列表中`)
} else if (!isExit.cancleScanedHiht && isExit.scaned) { } else if (!isExit.cancleScanedHiht && isExit.scaned) {
showMessage(`箱码【${packingNumber}】已经扫描`) isExit.handleQty = calc.add(Number(result.label.qty),isExit.handleQty)
} else { } else {
isExit.scaned = true isExit.scaned = true
let qty = 0 let qty = 0
@ -353,7 +355,7 @@ const getScanResult = (result,managementPrecision) => {
}) })
itemDetail.fromInventoryStatus = result.balance.inventoryStatus itemDetail.fromInventoryStatus = result.balance.inventoryStatus
if (!itemDetail.cancleScanedHiht && itemDetail.scaned && scanedLength == itemDetail.packList.length) { if (!itemDetail.cancleScanedHiht && itemDetail.scaned && scanedLength == itemDetail.packList.length) {
showMessage(`箱码【${packingNumber}】已经扫描`) itemDetail.handleQty = calc.add(Number(result.label.qty),itemDetail.handleQty)
} }
else { else {
itemDetail.scaned = true itemDetail.scaned = true
@ -365,9 +367,9 @@ const getScanResult = (result,managementPrecision) => {
pac.handleQty = Number(pac.qty) pac.handleQty = Number(pac.qty)
pac.toLocationCode = toLocationCode.value pac.toLocationCode = toLocationCode.value
}) })
calcTreeHandleQty(detailSource.value)
continueScan() continueScan()
} }
calcTreeHandleQty(detailSource.value)
} }
} }
} }

3
src/pages/putaway/job/putawayJob.vue

@ -139,11 +139,10 @@ const getList = (type) => {
uni.hideLoading() uni.hideLoading()
if (type === 'refresh') { if (type === 'refresh') {
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
if(manageModel.value!='BY_BATCH'){ if(manageModel != 'BY_BATCH'){
openScanPopup() openScanPopup()
} }
} }
const { list } = res.data const { list } = res.data
totalCount.value = res.data.total totalCount.value = res.data.total
updateTitle(`${title.value}(${totalCount.value})`) updateTitle(`${title.value}(${totalCount.value})`)

185
src/pages/scrap/job/scrapJobDetail.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<view class="page-header"> <view class="page-header">
<view class="page-header-box"> <view class="header-view">
<view class="header_job_top"> <view class="header_job_top">
<job-top :dataContent="jobContent"></job-top> <job-top :dataContent="jobContent"></job-top>
</view> </view>
@ -46,7 +46,9 @@ 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 } from '@dcloudio/uni-app'
import { getScrapJobDetail, takeScrapJob, cancleTakeScrapJob, scrapJobSubmit } from '@/api/request2.js' import { getScrapJobDetail, takeScrapJob, cancleTakeScrapJob, scrapJobSubmit } from '@/api/request2.js'
import { goHome, navigateBack, getPackingNumberAndBatch, getDirectoryItemArray, getInventoryStatusName } from '@/common/basic.js' import { goHome, navigateBack, getPackingNumberAndBatch, getDirectoryItemArray, getInventoryStatusName } from '@/common/basic.js'
import {
calc
} from '@/common/calc.js';
import { getManagementPrecisions } from '@/common/balance.js' import { getManagementPrecisions } from '@/common/balance.js'
import { getDataSource, calcHandleQty, getScanCount } from '@/common/detail.js' import { getDataSource, calcHandleQty, getScanCount } from '@/common/detail.js'
@ -75,6 +77,8 @@ const comMessageRef = ref()
const scanPopup = ref() const scanPopup = ref()
const managementType = ref('') const managementType = ref('')
const fromLocationCode = ref('') const fromLocationCode = ref('')
const managementPrecision = ref('')
onLoad((option) => { onLoad((option) => {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: `${option.title}详情` title: `${option.title}详情`
@ -173,8 +177,128 @@ const getDetail = () => {
showErrorMessage(error) showErrorMessage(error)
}) })
} }
const getScanResult = (result,managementPrecisionParams)=> {
managementPrecision.value = managementPrecisionParams
if(managementPrecisionParams == 'BY_QUANTITY' || managementPrecisionParams == 'BY_BATCH'){
setDataBatch(result,managementPrecisionParams)
}else{
setData(result,managementPrecisionParams)
}
}
const setDataBatch = (result,managementPrecisionParams)=> {
try {
const { packingNumber } = result.balance
const { batch } = result.balance
const { qty } = result.balance
const { itemCode } = result.balance
const { locationCode } = result.balance
const { inventoryStatus } = result.balance
const detail = detailSource.value.find((r) => r.itemCode == itemCode)
if (detail == undefined) {
showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
let itemDetail = {}
if(managementPrecisionParams == 'BY_QUANTITY'){
itemDetail = detail.subList.find(r => {
return r.fromlocationCode == result.fromlocationCode
})
}else if(managementPrecisionParams == 'BY_BATCH'){
itemDetail = detail.subList.find(r => {
return r.batch == batch&& r.fromlocationCode == result.fromlocationCode
})
}
const getScanResult = (result) => { if (itemDetail == undefined) {
showErrorMessage("批次[" + (batch ? batch: '') + "]不在列表中")
} else {
if (itemDetail.scaned) {
// this.showErrorMessage("[" + packingNumber + "]" + "[" + batch + "]")
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
if (jobContent.value.allowModifyInventoryStatus == "TRUE") {
scanPopupLoseFocus();
comMessageRef.value.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,是否继续出库?', res => {
if (res) {
itemDetail.scaned = true;
itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit
calcHandleQty();
} else {
scanPopupGetFocus();
}
});
} else {
scanPopupLoseFocus();
comMessageRef.value.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许转移!', res => {
this.scanPopupGetFocus();
});
}
} else {
itemDetail.scaned = true;
itemDetail.handleQty = calc.add(itemDetail.handleQty, Number(result.label.qty));
itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit
calcHandleQty();
}
} else {
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
if (jobContent.value.allowModifyInventoryStatus == "TRUE") {
scanPopupLoseFocus();
comMessageRef.value.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,是否继续出库?', res => {
if (res) {
itemDetail.scaned = true;
itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit
calcHandleQty();
} else {
scanPopupGetFocus();
}
});
} else {
scanPopupLoseFocus();
comMessageRef.value.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许转移!', res => {
scanPopupGetFocus();
});
}
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty);
itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit
calcHandleQty();
}
}
}
}
} catch (e) {
showMessage(e.message)
}
}
const setData = (result) => {
try { try {
const { packingNumber } = result.balance const { packingNumber } = result.balance
const { batch } = result.balance const { batch } = result.balance
@ -186,7 +310,8 @@ const getScanResult = (result) => {
if (detail == undefined) { if (detail == undefined) {
showErrorMessage(`物料号【${itemCode}】不在列表中`) showErrorMessage(`物料号【${itemCode}】不在列表中`)
} else { }
else {
const itemDetail = detail.subList.find((r) => { const itemDetail = detail.subList.find((r) => {
return r.packingNumber == packingNumber && r.batch == batch return r.packingNumber == packingNumber && r.batch == batch
}) })
@ -200,7 +325,7 @@ const getScanResult = (result) => {
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) { if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
if (jobContent.value.allowModifyInventoryStatus == 'TRUE') { if (jobContent.value.allowModifyInventoryStatus == 'TRUE') {
scanPopupLoseFocus() scanPopupLoseFocus()
showQuestionMessage(`任务中允许修改库存状态,实际库存状态[${balanceStatus}]与推荐库存状态[${itemStatus}]不一致,是否继续出库?`, (res) => { comMessageRef.value.showQuestionMessage(`任务中允许修改库存状态,实际库存状态[${balanceStatus}]与推荐库存状态[${itemStatus}]不一致,是否继续出库?`, (res) => {
if (res) { if (res) {
itemDetail.scaned = true itemDetail.scaned = true
itemDetail.handleQty = Number(result.balance.qty) itemDetail.handleQty = Number(result.balance.qty)
@ -216,7 +341,7 @@ const getScanResult = (result) => {
}) })
} else { } else {
scanPopupLoseFocus() scanPopupLoseFocus()
showQuestionMessage(`任务中不允许修改库存状态,实际库存状态[${balanceStatus}]与推荐库存状态[${itemStatus}]不一致,不允许转移!`, (res) => { comMessageRef.value.showQuestionMessage(`任务中不允许修改库存状态,实际库存状态[${balanceStatus}]与推荐库存状态[${itemStatus}]不一致,不允许转移!`, (res) => {
scanPopupGetFocus() scanPopupGetFocus()
}) })
} }
@ -264,12 +389,20 @@ const commit = () => {
} }
// // // //
if (scanCount.value == subList.value.length) { if (scanCount.value == subList.value.length) {
checkCount(); if(managementPrecision.value == 'BY_QUANTITY' || managementPrecision.value == 'BY_BATCH'){
checkCountBatch();
}else{
checkCount();
}
} else if (scanCount.value < subList.value.length) { } else if (scanCount.value < subList.value.length) {
// //
if (jobContent.value.allowPartialComplete == "TRUE") { if (jobContent.value.allowPartialComplete == "TRUE") {
// //
checkCount(); if(managementPrecision.value == 'BY_QUANTITY' || managementPrecision.value == 'BY_BATCH'){
checkCountBatch();
}else{
checkCount();
}
} else { } else {
// //
comMessageRef.value.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => { comMessageRef.value.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
@ -307,6 +440,42 @@ const checkCount = ()=>{
submitJob() submitJob()
} }
} }
const checkCountBatch = ()=> {
//
let str = ''
let str1 = ''
detailSource.value.forEach((item) => {
item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) {
let tempHandleQty = 0
if(cur.handleQty){
tempHandleQty=cur.handleQty
}else {
tempHandleQty =0
}
str += `批次【${cur.batch}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致`
}
if(cur.handleQty > cur.balance.balanceQty){
str1 += `批次【${cur.batch}】提交数量【${ cur.balance.balanceQty}】不允许大于库存数量【${ cur.balance.balanceQty}`
}
})
})
if(str1){
comMessageRef.value.showConfirmWarningModal(str1)
return
}
if (str) {
str = '任务明细未全部完成,是否提交?\n'+str
comMessageRef.value.showQuestionMessage1(str, 'red', res => {
if (res) {
submitJob()
}
});
} else {
submitJob()
}
}
const submitJob = async () => { const submitJob = async () => {
proxy.$modal.loading('提交中...') proxy.$modal.loading('提交中...')
// //

Loading…
Cancel
Save