Browse Source

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

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

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

@ -5,6 +5,12 @@
<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="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="header_item"> 申请单号 : {{ jobContent.requestNumber }} </view> -->
<!-- <view class='split_line'></view> --> <!-- <view class='split_line'></view> -->
</view> </view>
@ -14,7 +20,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="">
<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>
</view> </view>
</scroll-view> </scroll-view>
@ -43,11 +54,18 @@ import { getManagementPrecisions } from '@/common/balance.js'
import { getUnPlannedIssueJobDetail, takeUnPlannedIssueJob, cancleTakeUnPlannedIssueJob, unPlannedIssueJobSubmit } from '@/api/request2.js' import { getUnPlannedIssueJobDetail, takeUnPlannedIssueJob, cancleTakeUnPlannedIssueJob, unPlannedIssueJobSubmit } 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 { 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 winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.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 detailInfoPopup from '@/pages/unPlanned/coms/detailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
@ -61,11 +79,13 @@ const subList = ref([]) // 接口返回的任务subList
const detailSource = ref([]) // const detailSource = ref([]) //
const businessTypeInfo = ref({}) const businessTypeInfo = ref({})
const managementList = ref([]) const managementList = ref([])
const managementType = ref('')
const jobStatus = ref('') const jobStatus = ref('')
const scanPopup = ref() const scanPopup = ref()
const comScanLocation = ref() const comScanLocation = ref()
const detailInfoPopupRef = ref() const detailInfoPopupRef = ref()
const comMessageRef = ref() const comMessageRef = ref()
const fromLocationCode = ref('')
onLoad((option) => { onLoad((option) => {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: `${option.title}详情` title: `${option.title}详情`
@ -129,7 +149,7 @@ const receive = (callback) => {
const getDetail = () => { const getDetail = () => {
proxy.$modal.loading('加载中...') proxy.$modal.loading('加载中...')
getUnPlannedIssueJobDetail(id.value) getUnPlannedIssueJobDetail(id.value)
.then((res) => { .then(async (res) => {
uni.hideLoading() uni.hideLoading()
if (res.data == null) { if (res.data == null) {
showMessage('未获取到详情') showMessage('未获取到详情')
@ -137,7 +157,24 @@ const getDetail = () => {
jobContent.value = res.data jobContent.value = res.data
jobStatus.value = res.data.status jobStatus.value = res.data.status
subList.value = res.data.subList 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 { } else {
showMessage('列表数据为0') showMessage('列表数据为0')
} }
@ -157,10 +194,20 @@ const continueScan = () => {
} }
} }
const calcHandleQty1 = () => { const calcHandleQty1 = () => {
calcHandleQty(detailSource.value) calcHandleNewQty(detailSource.value)
continueScan() continueScan()
} }
const updateData = () => { 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() calcHandleQty1()
} }
const openDetail = (item) => { const openDetail = (item) => {
@ -181,45 +228,32 @@ const getScanResult = (result) => {
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 && r.fromLocationCode == result.fromLocationCode return r.packingNumber == packingNumber && r.batch == batch && r.fromLocationCode == result.fromLocationCode && r.isRecommend==false
}) })
if (itemDetail == undefined) { if (itemDetail == undefined) {
showErrorMessage(`箱码【${packingNumber}】,批次【${batch}】库位【${result.fromLocationCode}】不在列表中`) let newAdd = {
} else if (itemDetail.scaned) { itemCode:itemCode,
showErrorMessage(`箱码【${packingNumber}】,批次【${batch}】库位【${result.fromLocationCode}】已经扫描`) packingNumber:packingNumber,
} else { batch:batch,
const balanceStatus = getInventoryStatusName(result.balance.inventoryStatus) handleQty:detail.qty<Number(result.balance.qty)?detail.qty:Number(result.balance.qty),
const itemStatus = getInventoryStatusName(itemDetail.inventoryStatus) qty:detail.qty,
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) { fromLocationCode:locationCode,
if (jobContent.value.allowModifyInventoryStatus == 'TRUE') { inventoryStatus:inventoryStatus,
showQuestionMessage(`任务中允许修改库存状态,实际库存状态[${balanceStatus}]与推荐库存状态[${itemStatus}]不一致,是否继续出库?`, (res) => { toInventoryStatus:inventoryStatus,
if (res) { balance:result.balance,
itemDetail.scaned = true isRecommend:false,
itemDetail.handleQty = Number(result.balance.qty) isNewAdd:"newAdd"
itemDetail.toInventoryStatus = result.balance.inventoryStatus }
itemDetail.balance = result.balance newAdd.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.balanceQty = Number(result.balance.qty) newAdd.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packQty = Number(result.package.packQty) newAdd.balance.packUnit = result.package.packUnit
itemDetail.balance.packUnit = result.package.packUnit newAdd.scaned = true;
calcHandleQty1() detail.subList.push(newAdd)
} else { calcHandleQty();
scanPopupGetFocus()
}
})
} else { } else {
showQuestionMessage(`任务中不允许修改库存状态,实际库存状态[${balanceStatus}]与推荐库存状态[${itemStatus}]不一致,不允许转移!`, (res) => { if (itemDetail.scaned) {
scanPopupGetFocus() showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result
}) .fromLocationCode + "】已经扫描")
}
} 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()
} }
} }
} }
@ -228,11 +262,21 @@ const getScanResult = (result) => {
} }
} }
const commit = () => { const commit = () => {
scanCount.value = getScanCount(subList.value) let scanCount = 0;
if (scanCount.value == 0) { detailSource.value.forEach((item) => {
item.subList.forEach(cur => {
if (cur.scaned) {
scanCount++;
}
})
})
if (scanCount == 0) {
showErrorMessage('扫描数为0,请先扫描') showErrorMessage('扫描数为0,请先扫描')
return return
} }
checkCount()
}
const checkCount = ()=>{
// //
let str = '' let str = ''
detailSource.value.forEach((item) => { detailSource.value.forEach((item) => {
@ -243,7 +287,7 @@ const commit = () => {
}) })
}) })
if (str) { if (str) {
str += ',是否确认提交?' str = str+'\n是否提交?'
comMessageRef.value.showQuestionMessage1(str, 'red', res => { comMessageRef.value.showQuestionMessage1(str, 'red', res => {
if (res) { if (res) {
submitJob() submitJob()
@ -252,33 +296,24 @@ const commit = () => {
} else { } else {
submitJob() 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 = () => { const submitJob = () => {
proxy.$modal.loading('提交中...') proxy.$modal.loading('提交中...')
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() const params = setParams()
unPlannedIssueJobSubmit(params) unPlannedIssueJobSubmit(params)
.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}]`)
} }
@ -287,6 +322,11 @@ const submitJob = () => {
uni.hideLoading() uni.hideLoading()
showErrorMessage(error) showErrorMessage(error)
}) })
} else {
uni.hideLoading();
showErrorMessage(res.message);
}
});
} }
const setParams = () => { const setParams = () => {
const subList = [] const subList = []
@ -294,10 +334,14 @@ const setParams = () => {
detailSource.value.forEach((item) => { detailSource.value.forEach((item) => {
item.subList.forEach((detail) => { item.subList.forEach((detail) => {
if (detail.scaned) { if (detail.scaned && !detail.isRecommend) {
detail.toPackingNumber = detail.packingNumber detail.toPackingNumber = detail.packingNumber
detail.toContainerNumber = '' detail.toContainerNumber = ''
detail.toBatch = detail.batch 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) subList.push(detail)
} }
}) })

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

@ -14,7 +14,14 @@
<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="">
<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>
<view class="split_line"></view> <view class="split_line"></view>
</view> </view>
@ -53,6 +60,7 @@ import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue' import locationCompare from '@/mycomponents/location/locationCompare.vue'
import comReceiptDetailCard from '@/pages/unPlanned/coms/comReceiptDetailCard.vue' import comReceiptDetailCard from '@/pages/unPlanned/coms/comReceiptDetailCard.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import comReceiptDetailCardBatch from '@/pages/unPlanned/coms/comReceiptDetailCardBatch.vue'
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store // store
const store = useCountStore() const store = useCountStore()
@ -67,6 +75,7 @@ const toLocationCode = ref('')
const toLocationInfo = ref({}) const toLocationInfo = ref({})
const businessTypeInfo = ref({}) const businessTypeInfo = ref({})
const managementList = ref([]) const managementList = ref([])
const managementType = ref('')
const jobStatus = ref('') const jobStatus = ref('')
const jobToLocationCode = ref('') const jobToLocationCode = ref('')
const scanPopup = ref() const scanPopup = ref()
@ -137,7 +146,7 @@ const receive = (callback) => {
const getDetail = () => { const getDetail = () => {
proxy.$modal.loading('加载中....') proxy.$modal.loading('加载中....')
getUnPlannedReceiptJobDetail(id.value) getUnPlannedReceiptJobDetail(id.value)
.then((res) => { .then(async (res) => {
uni.hideLoading() uni.hideLoading()
if (res.data == null) { if (res.data == null) {
showMessage('未获取到详情') showMessage('未获取到详情')
@ -147,7 +156,19 @@ const getDetail = () => {
subList.value = res.data.subList subList.value = res.data.subList
detailSource.value = getDataSource(subList.value) detailSource.value = getDataSource(subList.value)
jobToLocationCode.value = subList.value[0].toLocationCode 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 { } else {
showErrorMessage('列表数据为0') showErrorMessage('列表数据为0')
} }
@ -228,10 +249,15 @@ const commit = () => {
// //
if (jobContent.value.allowPartialComplete == 'TRUE') { if (jobContent.value.allowPartialComplete == 'TRUE') {
// //
comMessageRef.value.showErrorMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
submitJob()
}
})
submitJob() submitJob()
} else { } else {
// //
comMessageRef.value.showErrorMessage('请完成扫描后,再进行提交<br>' + `已经扫描[${scanCount.value}]箱总共[${subList.value.length}]箱`, (res) => { comMessageRef.value.showErrorMessage(`任务明细未全部完成,不允许部分提交!`, (res) => {
if (res) { if (res) {
openScanPopup() openScanPopup()
} }
@ -275,7 +301,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}]`)
} }
@ -300,6 +326,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.toLocationCode = toLocationCode.value detail.toLocationCode = toLocationCode.value
detail.toContainerNumber = '' detail.toContainerNumber = ''

Loading…
Cancel
Save