Browse Source

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

pull/1/head
test 6 months ago
parent
commit
cb439eddf6
  1. 84
      src/pages/productRecycle/job/productRecycleJobDetail.vue
  2. 4
      src/pages/productRecycle/record/productRecycleRecord.vue

84
src/pages/productRecycle/job/productRecycleJobDetail.vue

@ -14,7 +14,13 @@
<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" :settingParam="jobContent" @remove="updateData" @updateData="updateData" @openDetail="openDetail"> </com-detail-card> <comDetailCardBatch :dataContent="item" :index="index" :settingParam="jobContent" :isShowStatus="false"
@remove="updateData" @updateData="updateData" @openDetail="openDetail"
:locationAreaTypeList='toLocationAreaTypeList' v-if="managementType == 'BY_BATCH'">
</comDetailCardBatch>
<com-detail-card :dataContent="item" :settingParam="jobContent" @remove="updateData"
@updateData='updateData' @openDetail="openDetail" v-else>
</com-detail-card>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@ -50,6 +56,7 @@ import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.v
import comDetailCard from '@/mycomponents/detail/comDetailCard.vue' import comDetailCard from '@/mycomponents/detail/comDetailCard.vue'
import recycleDetailInfoPopup from '@/pages/productRecycle/coms/recycleDetailInfoPopup.vue' import recycleDetailInfoPopup from '@/pages/productRecycle/coms/recycleDetailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import comDetailCardBatch from "@/mycomponents/detail/comDetailCardBatch.vue"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store // store
const store = useCountStore() const store = useCountStore()
@ -61,11 +68,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 toLocationCode = ref() const toLocationCode = ref()
const jobStatus = ref('') const jobStatus = ref('')
const scanPopup = ref() const scanPopup = ref()
const comMessageRef = ref() const comMessageRef = ref()
const jobDetailPopup = ref() const jobDetailPopup = ref()
const fromLocationCode = ref()
onLoad((option) => { onLoad((option) => {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: `${option.title}详情` title: `${option.title}详情`
@ -129,7 +138,7 @@ const receive = (callback) => {
const getDetail = () => { const getDetail = () => {
proxy.$modal.loading('加载中...') proxy.$modal.loading('加载中...')
getProductRecycleDetail(id.value) getProductRecycleDetail(id.value)
.then((res) => { .then(async (res) => {
uni.hideLoading() uni.hideLoading()
if (res.data == null) { if (res.data == null) {
showMessage('未获取到详情') showMessage('未获取到详情')
@ -141,7 +150,21 @@ const getDetail = () => {
res.fromLocationCode = res.toLocationCode res.fromLocationCode = res.toLocationCode
}) })
toLocationCode.value = res.data.toLocationCode toLocationCode.value = res.data.toLocationCode
detailSource.value = getDataSource(subList.value) detailSource.value = await getDataSource(subList.value);
//
let itemCodes = []
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
item.scaned = false
})
fromLocationCode.value = subList.value[0].fromLocationCode
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')
} }
@ -190,6 +213,7 @@ const getScanResult = (result) => {
if (detail == undefined) { if (detail == undefined) {
showMessage(`物料号【${itemCode}】不在列表中`) showMessage(`物料号【${itemCode}】不在列表中`)
} else { } else {
detail.scaned = true
const balanceStatus = getInventoryStatusName(result.balance.inventoryStatus) const balanceStatus = getInventoryStatusName(result.balance.inventoryStatus)
// //
itemDetail = detail.subList.find((r) => { itemDetail = detail.subList.find((r) => {
@ -199,7 +223,7 @@ const getScanResult = (result) => {
const itemStatus = getInventoryStatusName(itemDetail.inventoryStatus) const itemStatus = getInventoryStatusName(itemDetail.inventoryStatus)
// //
if (itemDetail.scaned) { if (itemDetail.scaned) {
showErrorMessage(`箱码【${packingNumber}<br>批次【${batch}<br>库位【${result.fromLocationCode}<br>状态【${balanceStatus}<br>已经扫描`) showErrorMessage(`箱码【${packingNumber}\n批次【${batch}\n库位【${result.fromLocationCode}\n状态【${balanceStatus}\n已经扫描`)
return return
} }
itemDetail.scaned = true itemDetail.scaned = true
@ -241,7 +265,7 @@ const getScanResult = (result) => {
}) })
} }
} else { } else {
showErrorMessage(`箱码【${packingNumber}<br>批次【${batch}<br>库位【${result.fromLocationCode}<br>状态【${balanceStatus}<br>不在任务列表中`) showErrorMessage(`箱码【${packingNumber}\n批次【${batch}\n库位【${result.fromLocationCode}\n状态【${balanceStatus}\n不在任务列表中`)
} }
} }
} }
@ -256,17 +280,43 @@ const commit = () => {
showErrorMessage('扫描数为0,请先扫描') showErrorMessage('扫描数为0,请先扫描')
return return
} }
// //
// //
if (scanCount.value == subList.value.length) {
checkCount();
} else if (scanCount.value < subList.value.length) {
//
if (jobContent.value.allowPartialComplete == "TRUE") {
//
checkCount();
} else {
//
comMessageRef.value.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
openScanPopup();
}
});
}
}
}
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()
@ -276,9 +326,15 @@ const commit = () => {
submitJob() submitJob()
} }
} }
const submitJob = () => { const submitJob = () => {
proxy.$modal.loading('提交中...') proxy.$modal.loading('提交中...')
let itemCodes = []
detailSource.value.forEach(item => {
itemCodes.push(item.itemCode)
})
getManagementPrecisions(itemCodes, fromLocationCode.value, res => {
if (res.success) {
managementList.value = res.list;
const params = setParams() const params = setParams()
productRecycleJobsubmit(params) productRecycleJobsubmit(params)
.then((res) => { .then((res) => {
@ -294,6 +350,8 @@ const submitJob = () => {
showErrorMessage(error) showErrorMessage(error)
}) })
} }
})
}
const setParams = () => { const setParams = () => {
const subList = [] const subList = []
const creator = store.id const creator = store.id
@ -306,6 +364,10 @@ const setParams = () => {
detail.toBatch = detail.batch detail.toBatch = detail.batch
detail.toLocationCode = detail.toLocationCode detail.toLocationCode = detail.toLocationCode
let info = getPackingNumberAndBatch(this.managementList, detail.itemCode, detail.packingNumber, detail.batch);
detail.toPackingNumber = info.packingNumber;
detail.packingNumber = info.packingNumber;
detail.fromPackingNumber = info.packingNumber;
subList.push(detail) subList.push(detail)
} }
}) })
@ -354,6 +416,7 @@ const openDetail = (item) => {
} }
const showMessage = (message) => { const showMessage = (message) => {
scanPopupLoseFocus()
comMessageRef.value.showMessage(message, (res) => { comMessageRef.value.showMessage(message, (res) => {
if (res) { if (res) {
scanPopupGetFocus() scanPopupGetFocus()
@ -362,6 +425,7 @@ const showMessage = (message) => {
} }
const showErrorMessage = (message) => { const showErrorMessage = (message) => {
scanPopupLoseFocus()
comMessageRef.value.showErrorMessage(message, (res) => { comMessageRef.value.showErrorMessage(message, (res) => {
if (res) { if (res) {
scanPopupGetFocus() scanPopupGetFocus()
@ -374,12 +438,14 @@ const showQuestionMessage = (message, callback) => {
comMessageRef.value.showQuestionMessage(message, (res) => { comMessageRef.value.showQuestionMessage(message, (res) => {
if (res) { if (res) {
callback(res) callback(res)
}else {
scanPopupGetFocus()
} }
}) })
}) })
} }
const showCommitSuccessMessage = (hint) => { const showCommitSuccessMessage = (hint) => {
comMessageRef.value.showSuccessMessage(`提交成功<br>生成制品回收记录<br>:${number}`, (res) => { comMessageRef.value.showSuccessMessage(`提交成功\n生成制品回收记录\n:${number}`, (res) => {
navigateBack(1) navigateBack(1)
}) })
} }

4
src/pages/productRecycle/record/productRecycleRecord.vue

@ -154,7 +154,7 @@ const getDataSource = (result) => {
const newDetail = createDetailInfo(balance, pack) const newDetail = createDetailInfo(balance, pack)
item.subList.push(newDetail) item.subList.push(newDetail)
} else { } else {
showErrorMessage(`箱码[${balance.packingNumber}]已经在列表中`) showErrorMessage(`箱码[${balance.packingNumber}]重复扫描`)
} }
} }
calcHandleQty(detailSource.value) calcHandleQty(detailSource.value)
@ -194,7 +194,7 @@ const commit = () => {
.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}]`)
} }

Loading…
Cancel
Save