Browse Source

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

hella_vue3
王志国 4 weeks ago
parent
commit
6ceb4108a8
  1. 42
      src/pages/inventoryMove/job/holdToWipMoveJob.vue
  2. 103
      src/pages/inventoryMove/job/inventoryMoveDetail.vue
  3. 2
      src/pages/inventoryMove/job/okToHoldMoveJob.vue

42
src/pages/inventoryMove/job/holdToWipMoveJob.vue

@ -0,0 +1,42 @@
<template>
<view class="page-wraper">
<comMoveJob :title="title" ref="comMoveJob" businessTypeCode='HoldToWip'></comMoveJob>
</view>
</template>
<script lang="ts" setup>
import {ref} from 'vue'
import {onLoad, onShow, onPullDownRefresh, onReachBottom, onNavigationBarButtonTap} from '@dcloudio/uni-app'
import comMoveJob from '@/pages/inventoryMove/coms/comMoveJob.vue'
const title = ref('')
const comMoveJob = ref('')
onLoad((option) => {
title.value = option.title
})
onShow(()=> {
if (comMoveJob.value) {
comMoveJob.value.refresh();
}
})
onPullDownRefresh(()=> {
if (comMoveJob.value) {
comMoveJob.value.refresh();
}
})
onReachBottom(()=> {
if (comMoveJob.value) {
comMoveJob.value.onReach();
}
})
onNavigationBarButtonTap((e)=> {
if (e.index === 0) {
comMoveJob.value.toHome();
} else if (e.index == 1) {
comMoveJob.value.openFilter();
}
})
</script>
<style>
</style>

103
src/pages/inventoryMove/job/inventoryMoveDetail.vue

@ -12,7 +12,16 @@
<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="">
<comInventoryDetailCard :dataContent="item" :settingParam="jobContent" @remove="updateData" @updateData="updateData" @openDetail="openDetail"> </comInventoryDetailCard> <comInventoryDetailCardBatch :dataContent="item" :settingParam="jobContent" @remove="updateData"
@updateData='updateData'
:locationAreaTypeList="toLocationAreaTypeList"
@openDetail="openDetail" v-if="managementType=='BY_BATCH'">
</comInventoryDetailCardBatch>
<comInventoryDetailCard :dataContent="item" :settingParam="jobContent" @remove="updateData"
@updateData='updateData' :locationAreaTypeList="toLocationAreaTypeList"
:allowEditQty ="jobContent.allowModifyQty=='TRUE'?true:false"
@openDetail="openDetail" v-else>
</comInventoryDetailCard>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@ -42,14 +51,16 @@ import { getManagementPrecisions, getPrecisionStrategyList } from '@/common/bala
import { getDataSource, getScanCount, calcHandleQty } from '@/common/detail.js' import { getDataSource, getScanCount, calcHandleQty } from '@/common/detail.js'
import { goHome, navigateBack, getCurrDateTime, getPackingNumberAndBatchByList, getInventoryStatusName } from '@/common/basic.js' import { goHome, navigateBack, getCurrDateTime, getPackingNumberAndBatchByList, getInventoryStatusName } from '@/common/basic.js'
import {getDirectoryItemArray} from '@/common/directory.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comInventoryDetailCard from '@/pages/inventoryMove/coms/comInventoryDetailCard.vue' import comInventoryDetailCard from '@/pages/inventoryMove/coms/comInventoryDetailCard.vue'
import comInventoryDetailCardBatch from '@/pages/inventoryMove/coms/comInventoryDetailCardBatch.vue'
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue' import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue'
import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.vue' import detailInfoPopup from '@/pages/inventoryMove/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'
import {a} from "unocss-preset-weapp/dist/utilities-322cd311";
// store // store
const store = useCountStore() const store = useCountStore()
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -70,6 +81,8 @@ const scanPopup = ref()
const detailInfoPopupRef = ref() const detailInfoPopupRef = ref()
const comMessageRef = ref() const comMessageRef = ref()
const comScanLocation = ref() const comScanLocation = ref()
const managementType = ref()
const toLocationAreaTypeList = ref([])
onLoad((option) => { onLoad((option) => {
title.value = option.title title.value = option.title
id.value = option.id id.value = option.id
@ -122,7 +135,11 @@ const initData = () => {
name = '隔离转合格' name = '隔离转合格'
toLocationCode.value = '' toLocationCode.value = ''
toInventoryStatus.value = 'OK' toInventoryStatus.value = 'OK'
} else if (businessTypeCode.value == 'HoldToScrap') { } else if(this.businessTypeCode == "HoldToWip"){
name = '隔离转线边'
toLocationCode.value = ''
toInventoryStatus.value = 'OK'
}else if (businessTypeCode.value == 'HoldToScrap') {
name = '隔离转报废' name = '隔离转报废'
toLocationCode.value = 'SCRAP' toLocationCode.value = 'SCRAP'
toInventoryStatus.value = 'SCRAP' toInventoryStatus.value = 'SCRAP'
@ -166,15 +183,30 @@ const receive = (callback) => {
const getDetail = () => { const getDetail = () => {
proxy.$modal.loading('加载中...') proxy.$modal.loading('加载中...')
getInventoryMoveJobDetail(id.value) getInventoryMoveJobDetail(id.value)
.then((res) => { .then(async (res) => {
uni.hideLoading() uni.hideLoading()
if (res.data == null) { if (res.data == null) {
showMessage('未获取到详情') showMessage('未获取到详情')
} else if (res.data.subList.length > 0) { } else if (res.data.subList.length > 0) {
jobContent.value = res.data jobContent.value = res.data
toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes);
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) detailSource.value = await getDataSource(subList.value)
//
let itemCodes = []
detailSource.value.forEach(item => {
itemCodes.push(item.itemCode)
item.scaned = false
})
toLocationCode.value = subList.value[0].toLocationCode
getManagementPrecisions(itemCodes, toLocationCode.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')
} }
@ -226,7 +258,7 @@ const openScanPopup = () => {
scanPopup.value.openScanPopupForJob(fromlocationCode, fromlocationList, jobContent.value) scanPopup.value.openScanPopupForJob(fromlocationCode, fromlocationList, jobContent.value)
} }
const getScanResult = (result) => { const getScanResult = (result,managementPrecision) => {
try { try {
const { packingNumber } = result.label const { packingNumber } = result.label
const { batch } = result.label const { batch } = result.label
@ -236,13 +268,20 @@ const getScanResult = (result) => {
if (detail == undefined) { if (detail == undefined) {
showMessage(`物料号【${itemCode}】不在列表中`) showMessage(`物料号【${itemCode}】不在列表中`)
} else { } else {
const itemDetail = detail.subList.find((r) => { let itemDetail = ''
return r.packingNumber == packingNumber && r.batch == batch if(managementPrecision == 'BY_QUANTITY'){
}) itemDetail = detail.subList.find(r => {
if (itemDetail == undefined) { return r.itemCode == result.label.itemCode
showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]不在列表中`) })
}else{
itemDetail = detail.subList.find(r => {
return r.batch == batch
})
}
if (itemDetail == undefined && managementPrecision != 'BY_QUANTITY') {
showErrorMessage(`批次[${batch}]不在列表中`)
} else if (itemDetail.scaned) { } else if (itemDetail.scaned) {
showMessage(`箱码【${packingNumber}】已经扫描`) showMessage(`批次【${batch}】已经扫描`)
} else { } else {
const balanceStatus = getInventoryStatusName(result.balance.inventoryStatus) const balanceStatus = getInventoryStatusName(result.balance.inventoryStatus)
const itemStatus = getInventoryStatusName(itemDetail.inventoryStatus) const itemStatus = getInventoryStatusName(itemDetail.inventoryStatus)
@ -292,18 +331,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) {
this.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
if (cur.handleQty) {
tempHandleQty = cur.handleQty
} else {
tempHandleQty = 0
}
str += `包装号【${cur.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致\n`
} }
}) })
}) })
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()
@ -313,7 +377,6 @@ const commit = () => {
submitJob() submitJob()
} }
} }
const submitJob = () => { const submitJob = () => {
proxy.$modal.loading('提交中...') proxy.$modal.loading('提交中...')
@ -329,7 +392,11 @@ const submitJob = () => {
.then((res) => { .then((res) => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
showCommitSuccessMessage(`提交成功<br>生成库存转移记录<br>${res.data}`) let showTitle = this.title
if (title.value.indexOf('任务') == title.value.length - 2) {
showTitle = this.title.replace('任务', '')
}
showCommitSuccessMessage(`提交成功\n生成${showTitle}库存转移记录\n${res.data}`)
} else { } else {
showErrorMessage(`提交失败[${res.msg}]`) showErrorMessage(`提交失败[${res.msg}]`)
} }
@ -378,6 +445,8 @@ const setParams = () => {
if (detail.scaned) { if (detail.scaned) {
const info = getPackingNumberAndBatchByList(managementList.value, detail.itemCode, detail.packingNumber, detail.toLocationCode, detail.batch) const info = getPackingNumberAndBatchByList(managementList.value, detail.itemCode, detail.packingNumber, detail.toLocationCode, 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.toLocationCode = this.toLocationCode; // detail.toLocationCode = this.toLocationCode;

2
src/pages/inventoryMove/job/okToHoldMoveJob.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="page-wraper" style="min-height: 101vh"> <view class="page-wraper" style="min-height: 101vh">
<comMoveJob :title="title" ref="receiptjob" businessTypeCode="OkToHold"> </comMoveJob> <comMoveJob :isShowItemCode="true" :isShowQurery="true" :title="title" ref="comMoveJob" businessTypeCode='OkToHold' > </comMoveJob>
</view> </view>
</template> </template>

Loading…
Cancel
Save