Browse Source

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

hella_vue3
王志国 3 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">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<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>
</scroll-view>
@ -42,14 +51,16 @@ import { getManagementPrecisions, getPrecisionStrategyList } from '@/common/bala
import { getDataSource, getScanCount, calcHandleQty } from '@/common/detail.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 winScanPack from '@/mycomponents/scan/winScanPack.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 detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import { useCountStore } from '@/store'
import {a} from "unocss-preset-weapp/dist/utilities-322cd311";
// store
const store = useCountStore()
const { proxy } = getCurrentInstance()
@ -70,6 +81,8 @@ const scanPopup = ref()
const detailInfoPopupRef = ref()
const comMessageRef = ref()
const comScanLocation = ref()
const managementType = ref()
const toLocationAreaTypeList = ref([])
onLoad((option) => {
title.value = option.title
id.value = option.id
@ -122,7 +135,11 @@ const initData = () => {
name = '隔离转合格'
toLocationCode.value = ''
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 = '隔离转报废'
toLocationCode.value = 'SCRAP'
toInventoryStatus.value = 'SCRAP'
@ -166,15 +183,30 @@ const receive = (callback) => {
const getDetail = () => {
proxy.$modal.loading('加载中...')
getInventoryMoveJobDetail(id.value)
.then((res) => {
.then(async (res) => {
uni.hideLoading()
if (res.data == null) {
showMessage('未获取到详情')
} else if (res.data.subList.length > 0) {
jobContent.value = res.data
toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes);
jobStatus.value = res.data.status
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 {
showMessage('列表数据为0')
}
@ -226,7 +258,7 @@ const openScanPopup = () => {
scanPopup.value.openScanPopupForJob(fromlocationCode, fromlocationList, jobContent.value)
}
const getScanResult = (result) => {
const getScanResult = (result,managementPrecision) => {
try {
const { packingNumber } = result.label
const { batch } = result.label
@ -236,13 +268,20 @@ const getScanResult = (result) => {
if (detail == undefined) {
showMessage(`物料号【${itemCode}】不在列表中`)
} else {
const itemDetail = detail.subList.find((r) => {
return r.packingNumber == packingNumber && r.batch == batch
})
if (itemDetail == undefined) {
showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]不在列表中`)
let itemDetail = ''
if(managementPrecision == 'BY_QUANTITY'){
itemDetail = detail.subList.find(r => {
return r.itemCode == result.label.itemCode
})
}else{
itemDetail = detail.subList.find(r => {
return r.batch == batch
})
}
if (itemDetail == undefined && managementPrecision != 'BY_QUANTITY') {
showErrorMessage(`批次[${batch}]不在列表中`)
} else if (itemDetail.scaned) {
showMessage(`箱码【${packingNumber}】已经扫描`)
showMessage(`批次【${batch}】已经扫描`)
} else {
const balanceStatus = getInventoryStatusName(result.balance.inventoryStatus)
const itemStatus = getInventoryStatusName(itemDetail.inventoryStatus)
@ -292,18 +331,43 @@ const commit = () => {
showErrorMessage('扫描数为0,请先扫描')
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 = ''
detailSource.value.forEach((item) => {
item.subList.forEach(cur => {
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) {
str += ',是否确认提交?'
str = '任务明细未全部完成,是否提交?\n' + str
comMessageRef.value.showQuestionMessage1(str, 'red', res => {
if (res) {
submitJob()
@ -313,7 +377,6 @@ const commit = () => {
submitJob()
}
}
const submitJob = () => {
proxy.$modal.loading('提交中...')
@ -329,7 +392,11 @@ const submitJob = () => {
.then((res) => {
uni.hideLoading()
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 {
showErrorMessage(`提交失败[${res.msg}]`)
}
@ -378,6 +445,8 @@ const setParams = () => {
if (detail.scaned) {
const info = getPackingNumberAndBatchByList(managementList.value, detail.itemCode, detail.packingNumber, detail.toLocationCode, detail.batch)
detail.toPackingNumber = info.packingNumber
detail.packingNumber = info.packingNumber;
detail.fromPackingNumber = info.packingNumber;
detail.toBatch = info.batch
detail.toContainerNumber = ''
// detail.toLocationCode = this.toLocationCode;

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

@ -1,6 +1,6 @@
<template>
<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>
</template>

Loading…
Cancel
Save