Browse Source

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

hella_vue3
王志国 3 weeks ago
parent
commit
38e1fc2f36
  1. 200
      src/pages/unPlanned/job/issueJobDetail.vue
  2. 38
      src/pages/unPlanned/job/receiptJobDetail.vue

200
src/pages/unPlanned/job/issueJobDetail.vue

@ -5,6 +5,12 @@
<view class="header_job_top">
<job-top :dataContent="jobContent"></job-top>
</view>
<view class="task_text">
<view class="card_view">
<text class="card_packing_code ">目的地</text>
<text class="card_content " style="word-wrap: break-word; word-break: break-all;" >{{jobContent.destination}}</text>
</view>
</view>
<!-- <view class="header_item"> 申请单号 : {{ jobContent.requestNumber }} </view> -->
<!-- <view class='split_line'></view> -->
</view>
@ -14,7 +20,12 @@
<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-detail-card :dataContent="item" :index="index" :settingParam="jobContent" @remove="updateData" @updateData="updateData" @openDetail="openDetail"> </com-detail-card>
<comRecommendDetailCardBatch :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail" v-if="managementType=='BY_BATCH'">
</comRecommendDetailCardBatch>
<comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail" v-else>
</comRecommendDetailCard>
</view>
</view>
</scroll-view>
@ -43,11 +54,18 @@ import { getManagementPrecisions } from '@/common/balance.js'
import { getUnPlannedIssueJobDetail, takeUnPlannedIssueJob, cancleTakeUnPlannedIssueJob, unPlannedIssueJobSubmit } from '@/api/request2.js'
import { goHome, navigateBack, getPackingNumberAndBatch, getDirectoryItemArray, getInventoryStatusName } from '@/common/basic.js'
import { getDataSource, createRecordInfo, calcHandleQty, getScanCount } from '@/common/detail.js'
import { getDataSource, createRecordInfo, calcHandleQty, getScanCount,calcHandleNewQty } from '@/common/detail.js'
import {
calc
} from '@/common/calc'
import {
Decimal
} from 'decimal.js'; //
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue'
import comDetailCard from '@/mycomponents/detail/comDetailCard.vue'
import comRecommendDetailCard from "@/mycomponents/detail/comRecommendDetailCard.vue"
import comRecommendDetailCardBatch from "@/mycomponents/detail/comRecommendDetailCardBatch.vue"
import detailInfoPopup from '@/pages/unPlanned/coms/detailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import { useCountStore } from '@/store'
@ -61,11 +79,13 @@ const subList = ref([]) // 接口返回的任务subList
const detailSource = ref([]) //
const businessTypeInfo = ref({})
const managementList = ref([])
const managementType = ref('')
const jobStatus = ref('')
const scanPopup = ref()
const comScanLocation = ref()
const detailInfoPopupRef = ref()
const comMessageRef = ref()
const fromLocationCode = ref('')
onLoad((option) => {
uni.setNavigationBarTitle({
title: `${option.title}详情`
@ -129,7 +149,7 @@ const receive = (callback) => {
const getDetail = () => {
proxy.$modal.loading('加载中...')
getUnPlannedIssueJobDetail(id.value)
.then((res) => {
.then(async (res) => {
uni.hideLoading()
if (res.data == null) {
showMessage('未获取到详情')
@ -137,7 +157,24 @@ const getDetail = () => {
jobContent.value = res.data
jobStatus.value = res.data.status
subList.value = res.data.subList
detailSource.value = getDataSource(subList.value)
subList.value.forEach(item=>{
item.isRecommend = true
})
detailSource.value = await getDataSource(subList.value)
//
let itemCodes = []
detailSource.value.forEach(item => {
itemCodes.push(item.itemCode)
item.scaned = false
})
fromLocationCode.value = subList.value[0].fromLocationCode
await getManagementPrecisions(itemCodes, fromLocationCode.value, res => {
if (res.success) {
managementList.value = res.list;
managementType.value = managementList.value.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
}
})
} else {
showMessage('列表数据为0')
}
@ -157,10 +194,20 @@ const continueScan = () => {
}
}
const calcHandleQty1 = () => {
calcHandleQty(detailSource.value)
calcHandleNewQty(detailSource.value)
continueScan()
}
const updateData = () => {
//
for (let i = 0; i < detailSource.value.length; i++) {
let item = detailSource.value[i]
for (let j = 0; j < item.subList.length; j++) {
var sub = item.subList[j]
if(!sub.isRecommend&&!sub.scaned){
item.subList.splice(j,1)
}
}
}
calcHandleQty1()
}
const openDetail = (item) => {
@ -181,45 +228,32 @@ const getScanResult = (result) => {
showErrorMessage(`物料号【${itemCode}】不在列表中`)
} else {
const itemDetail = detail.subList.find((r) => {
return r.packingNumber == packingNumber && r.batch == batch && r.fromLocationCode == result.fromLocationCode
return r.packingNumber == packingNumber && r.batch == batch && r.fromLocationCode == result.fromLocationCode && r.isRecommend==false
})
if (itemDetail == undefined) {
showErrorMessage(`箱码【${packingNumber}】,批次【${batch}】库位【${result.fromLocationCode}】不在列表中`)
} else if (itemDetail.scaned) {
showErrorMessage(`箱码【${packingNumber}】,批次【${batch}】库位【${result.fromLocationCode}】已经扫描`)
let newAdd = {
itemCode:itemCode,
packingNumber:packingNumber,
batch:batch,
handleQty:detail.qty<Number(result.balance.qty)?detail.qty:Number(result.balance.qty),
qty:detail.qty,
fromLocationCode:locationCode,
inventoryStatus:inventoryStatus,
toInventoryStatus:inventoryStatus,
balance:result.balance,
isRecommend:false,
isNewAdd:"newAdd"
}
newAdd.balance.balanceQty = Number(result.balance.qty);
newAdd.balance.packQty = Number(result.package.packQty)
newAdd.balance.packUnit = result.package.packUnit
newAdd.scaned = true;
detail.subList.push(newAdd)
calcHandleQty();
} else {
const balanceStatus = getInventoryStatusName(result.balance.inventoryStatus)
const itemStatus = getInventoryStatusName(itemDetail.inventoryStatus)
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
if (jobContent.value.allowModifyInventoryStatus == 'TRUE') {
showQuestionMessage(`任务中允许修改库存状态,实际库存状态[${balanceStatus}]与推荐库存状态[${itemStatus}]不一致,是否继续出库?`, (res) => {
if (res) {
itemDetail.scaned = true
itemDetail.handleQty = Number(result.balance.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
calcHandleQty1()
} else {
scanPopupGetFocus()
}
})
} else {
showQuestionMessage(`任务中不允许修改库存状态,实际库存状态[${balanceStatus}]与推荐库存状态[${itemStatus}]不一致,不允许转移!`, (res) => {
scanPopupGetFocus()
})
}
} else {
itemDetail.scaned = true
itemDetail.handleQty = Number(result.balance.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
calcHandleQty1()
if (itemDetail.scaned) {
showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result
.fromLocationCode + "】已经扫描")
}
}
}
@ -228,11 +262,21 @@ const getScanResult = (result) => {
}
}
const commit = () => {
scanCount.value = getScanCount(subList.value)
if (scanCount.value == 0) {
let scanCount = 0;
detailSource.value.forEach((item) => {
item.subList.forEach(cur => {
if (cur.scaned) {
scanCount++;
}
})
})
if (scanCount == 0) {
showErrorMessage('扫描数为0,请先扫描')
return
}
checkCount()
}
const checkCount = ()=>{
//
let str = ''
detailSource.value.forEach((item) => {
@ -243,7 +287,7 @@ const commit = () => {
})
})
if (str) {
str += ',是否确认提交?'
str = str+'\n是否提交?'
comMessageRef.value.showQuestionMessage1(str, 'red', res => {
if (res) {
submitJob()
@ -252,41 +296,37 @@ const commit = () => {
} else {
submitJob()
}
// //
// //
// if (scanCount.value == subList.value.length) {
// submitJob()
// } else if (scanCount.value < subList.value.length) {
// //
// if (jobContent.value.allowPartialComplete == 'TRUE') {
// //
// submitJob()
// } else {
// //
// comMessageRef.value.showErrorMessage(',<br>' + `[${scanCount.value}][${subList.value.length}]`, (res) => {
// if (res) {
// openScanPopup()
// }
// })
// }
// }
}
const submitJob = () => {
proxy.$modal.loading('提交中...')
const params = setParams()
unPlannedIssueJobSubmit(params)
.then((res) => {
uni.hideLoading()
if (res.data) {
showCommitSuccessMessage(`提交成功<br>生成计划外出库记录<br>${res.data}`)
} else {
showErrorMessage(`提交失败[${res.msg}]`)
}
})
.catch((error) => {
uni.hideLoading()
showErrorMessage(error)
})
let itemCodes = []
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
item.scaned = false
})
getManagementPrecisions(itemCodes, fromLocationCode.value, res => {
if (res.success) {
managementList.value = res.list;
//
const params = setParams()
unPlannedIssueJobSubmit(params)
.then((res) => {
uni.hideLoading()
if (res.data) {
showCommitSuccessMessage(`提交成功\n生成计划外出库记录\n${res.data}`)
} else {
showErrorMessage(`提交失败[${res.msg}]`)
}
})
.catch((error) => {
uni.hideLoading()
showErrorMessage(error)
})
} else {
uni.hideLoading();
showErrorMessage(res.message);
}
});
}
const setParams = () => {
const subList = []
@ -294,10 +334,14 @@ const setParams = () => {
detailSource.value.forEach((item) => {
item.subList.forEach((detail) => {
if (detail.scaned) {
if (detail.scaned && !detail.isRecommend) {
detail.toPackingNumber = detail.packingNumber
detail.toContainerNumber = ''
detail.toBatch = detail.batch
let info = getPackingNumberAndBatch(managementList.value, detail.itemCode,detail.packingNumber, detail.batch);
detail.toPackingNumber = info.packingNumber;
detail.packingNumber = info.packingNumber;
detail.fromPackingNumber = info.packingNumber;
subList.push(detail)
}
})

38
src/pages/unPlanned/job/receiptJobDetail.vue

@ -14,7 +14,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 :dataContent="item" :index="index" :settingParam="jobContent" @remove="updateData" @updateData="updateData" :locationAreaTypeList="toLocationAreaTypeList"> </com-receipt-detail-card>
<comReceiptDetailCardBatch :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData"
:locationAreaTypeList='toLocationAreaTypeList' v-if="managementType=='BY_BATCH'">
</comReceiptDetailCardBatch>
<com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData"
:locationAreaTypeList='toLocationAreaTypeList' v-else>
</com-receipt-detail-card>
</view>
<view class="split_line"></view>
</view>
@ -53,6 +60,7 @@ import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue'
import comReceiptDetailCard from '@/pages/unPlanned/coms/comReceiptDetailCard.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import comReceiptDetailCardBatch from '@/pages/unPlanned/coms/comReceiptDetailCardBatch.vue'
import { useCountStore } from '@/store'
// store
const store = useCountStore()
@ -67,6 +75,7 @@ const toLocationCode = ref('')
const toLocationInfo = ref({})
const businessTypeInfo = ref({})
const managementList = ref([])
const managementType = ref('')
const jobStatus = ref('')
const jobToLocationCode = ref('')
const scanPopup = ref()
@ -137,7 +146,7 @@ const receive = (callback) => {
const getDetail = () => {
proxy.$modal.loading('加载中....')
getUnPlannedReceiptJobDetail(id.value)
.then((res) => {
.then(async (res) => {
uni.hideLoading()
if (res.data == null) {
showMessage('未获取到详情')
@ -147,7 +156,19 @@ const getDetail = () => {
subList.value = res.data.subList
detailSource.value = getDataSource(subList.value)
jobToLocationCode.value = subList.value[0].toLocationCode
toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes)
toLocationAreaTypeList.value = await getDirectoryItemArray(jobContent.value.toAreaTypes)
//
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 {
showErrorMessage('列表数据为0')
}
@ -228,10 +249,15 @@ const commit = () => {
//
if (jobContent.value.allowPartialComplete == 'TRUE') {
//
comMessageRef.value.showErrorMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
submitJob()
}
})
submitJob()
} else {
//
comMessageRef.value.showErrorMessage('请完成扫描后,再进行提交<br>' + `已经扫描[${scanCount.value}]箱总共[${subList.value.length}]箱`, (res) => {
comMessageRef.value.showErrorMessage(`任务明细未全部完成,不允许部分提交!`, (res) => {
if (res) {
openScanPopup()
}
@ -275,7 +301,7 @@ const submitJob = () => {
.then((res) => {
uni.hideLoading()
if (res.data) {
showCommitSuccessMessage(`提交成功<br>生成计划外入库记录<br>${res.data}`)
showCommitSuccessMessage(`提交成功\n生成计划外入库记录\n${res.data}`)
} else {
showErrorMessage(`提交失败[${res.msg}]`)
}
@ -300,6 +326,8 @@ const setParams = () => {
if (detail.scaned) {
const info = getPackingNumberAndBatch(managementList.value, detail.itemCode, detail.packingNumber, detail.batch)
detail.toPackingNumber = info.packingNumber
detail.packingNumber = info.packingNumber;
detail.fromPackingNumber = info.packingNumber;
detail.toBatch = info.batch
detail.toLocationCode = toLocationCode.value
detail.toContainerNumber = ''

Loading…
Cancel
Save