Browse Source

fix: customerReturn\job deliver\job inventoryMove issue 文件修改 Vue2升级Vue3 11-11/11-13

syhx_app_vue3
王志国 1 week ago
parent
commit
f53b107126
  1. 10
      src/pages/customerReturn/job/returnDetail.vue
  2. 33
      src/pages/deliver/job/deliverDetailBatch.vue
  3. 63
      src/pages/inventoryMove/coms/comMoveRecord.vue
  4. 20
      src/pages/inventoryMove/coms/okToHoldRecordPack.vue
  5. 4
      src/pages/inventoryMove/job/inventoryMoveDetail.vue
  6. 2
      src/pages/issue/coms/comIssueDetailCardBatch.vue
  7. 80
      src/pages/issue/job/issueDetailBatch.vue
  8. 2
      src/pages/issue/record/directIssueByBatch.vue

10
src/pages/customerReturn/job/returnDetail.vue

@ -14,15 +14,15 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<comDetailCardBatch :dataContent="item" :settingParam="jobContent" :isShowLocation="false"
@remove="updateData" @updateData="updateData" @openDetail="openDetail"
:locationAreaTypeList="toLocationAreaTypeList" v-if="managementType=='BY_BATCH'">
</comDetailCardBatch>
<!-- <comDetailCardBatch :dataContent="item" :settingParam="jobContent" :isShowLocation="false"-->
<!-- @remove="updateData" @updateData="updateData" @openDetail="openDetail"-->
<!-- :locationAreaTypeList="toLocationAreaTypeList" v-if="managementType=='BY_BATCH'">-->
<!-- </comDetailCardBatch>-->
<comLableDetailCard :dataContent="item" :settingParam="jobContent"
:isShowStatus="false"
:isShowLocation="false"
@remove="updateData" @updateData="updateData" @openDetail="openDetail"
:locationAreaTypeList="toLocationAreaTypeList" v-else>
:locationAreaTypeList="toLocationAreaTypeList">
</comLableDetailCard >
</view>
<view class="split_line"></view>

33
src/pages/deliver/job/deliverDetailBatch.vue

@ -120,6 +120,7 @@ const managementType = ref('')
const scanCount = ref('')
const balanceinfo = ref('')
const fromLocationCode = ref('')
const recommendQty = ref('')
const managementList = ref([]);
const comMessageRef = ref(null);
@ -217,6 +218,34 @@ const resizeCollapse = () => {
};
const getScanResult = (result, managementTypeParams)=> {
managementType.value = managementTypeParams
let array1 = []//
let array2 = []//
detailSource.value.forEach(item=>{
item.subList.forEach(cur=>{
array1.push(cur.fromLocationCode)
array2.push(cur.batch)
})
})
//
const obj1 = array1.find(item=>item == result.fromLocationCode)
const obj2 = array2.find(item=>item == result.label.batch)
if(jobContent.value.allowModifyLocation == 'FALSE'){
if(!obj1){
showErrorMessage(`不可以扫描推荐库位【${array1.join(',')}】以外的库位`)
return
}
}
if(jobContent.value.allowModifyBatch == 'FALSE'){
if(!obj2){
showErrorMessage(`不可以扫描推荐批次【${array2.join(',')}】以外的批次`)
return
}
}
if(!obj1){
recommendQty.value = 0
}else{
recommendQty.value = result.balance.qty
}
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){
setDataBatch(result)
}else{
@ -274,7 +303,7 @@ const setDataBatch = (result)=> {
toLocationCode:toLocationCode.value,
batch:result.label.batch,
handleQty:result.label.qty,
qty:result.balance.qty,
qty:recommendQty.value,
inventoryStatus:result.balance.inventoryStatus,
toLocation:result.balance.toLocation,
balance:result.balance,
@ -468,7 +497,7 @@ const checkCountBatch = ()=> {
item.totalQty = 0
item.taskQty = calc.add(item.taskQty, item.qty)
item.totalQty = calc.add(item.totalQty, item.handleQty)
if (jobContent.value.allowPartialComplete == "FALSE") {
if (jobContent.value.allowSmallerQty == "FALSE") {
if (item.handleQty != item.taskQty) {
str += `批次【${item.batch}】提交数量【${item.handleQty}】与任务物料数量【${item.taskQty}】不一致\n`
}

63
src/pages/inventoryMove/coms/comMoveRecord.vue

@ -1,7 +1,7 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan="showFromLocationPopup" v-if="detailSource.length == 0"></com-blank-view>
<com-blank-view @goScan="showPopup" v-if="detailSource.length == 0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length > 0">
<view class="split_line"></view>
@ -30,7 +30,7 @@
</view>
</view>
</view>
<win-scan-button @goScan="showFromLocationPopup"></win-scan-button>
<win-scan-button @goScan="showPopup"></win-scan-button>
</view>
<okToHoldRecordPack ref="okToHoldRecordPackRef" :showOnePop='showOnePop'
@showFromLocationPopup='showFromLocationPopup'
@ -39,10 +39,12 @@
@clickBtnClearFromLocation='clearFromLocation'
@clickBtnClearItemCode='clearItemCode'>
</okToHoldRecordPack>
<win-scan-pack-and-location ref="scanPopup" @getResult="getScanResult" @clearItemCode='clearItemCode' :title="'箱码'"></win-scan-pack-and-location>
<win-scan-pack-and-location ref="scanPopup" @getResult="getScanResult"
:title="'箱码'">
</win-scan-pack-and-location>
<win-scan-location ref="scanFromLocationCode" title="来源库位"
@getLocation="getFromLocation" :locationAreaTypeList="fromLocationAreaTypeList"
@clearFromLocation='clearFromLocation'>
>
</win-scan-location>
<com-message ref="comMessageRef" />
</view>
@ -69,7 +71,7 @@ import {
} from '@/common/calc.js';
import { getPackingNumberAndBatchByList, deepCopyData } from '@/common/basic.js'
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js'
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty,createItemInfoForLabel,createDetailInfoForLabel } from '@/common/record.js'
import { useCountStore } from '@/store'
// store
const store = useCountStore()
@ -113,6 +115,7 @@ const isShowEditLocation = ref(false)
const scanFromLocationCode = ref()
const getResult = ref({})
const managementType = ref('')
const isJustReplay = ref(true)
const scanPopup = ref()
const businessTypeCode = ref(props.businessTypeCode)
@ -125,7 +128,9 @@ onMounted(() => {
getBusinessType(props.businessTypeCode, (res) => {
if (res.success) {
businessType.value = res.businessType
openScanPopup(true)
fromLocationAreaTypeList.value = res.fromLocationAreaTypeList;
toLocationAreaTypeList.value = res.toLocationAreaTypeList;
showPopup(true)
} else {
showErrorMessage(res.message)
}
@ -200,13 +205,17 @@ const getLocationInfo = () => {
}
const openScanPopup = () => {
isJustReplay.value = true
if (fromLocationCode.value == '') {
showFromLocationPopup()
return
}
scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value)
}
const showFromLocationPopup = () => {
const showFromLocationPopup = ()=> {
scanFromLocationCode.value.openScanPopup();
}
const showPopup = () => {
setTimeout(()=>{
if(props.showOnePop){
okToHoldRecordPackRef.value.fromLocationCode = ''
@ -222,6 +231,7 @@ const showFromLocationPopup = () => {
}
const getFromLocation = (location) => {
fromLocationCode.value = location.code
okToHoldRecordPackRef.value.fromLocationCode = location.code
fromLocationInfo.value = location
if(!props.showOnePop){
openScanPopup()
@ -238,11 +248,14 @@ const getToLocation = (location, code) => {
const getScanResult = (result,managementTypeParams)=> {
managementType.value = managementTypeParams
if(props.showOnePop){
if(this.isJustReplay){
okToHoldRecordPackRef.value.itemCode= result.balance.itemCode
okToHoldRecordPackRef.value.batch = result.balance.batch
getResult.value = result//
scanPopup.value.closeScanPopup()
}else{
getScanResultAfterBatch(result,managementTypeParams)
}
}else{
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){
getScanResultAfterBatch(result,managementTypeParams)
@ -254,21 +267,27 @@ const getScanResult = (result,managementTypeParams)=> {
const okToHoldRecordPackConfirm = (obj)=>{
// this.getResult. = result//
if(!obj.fromLocationCode){
comMessageRef.value.showErrorMessage('请选择来源库位');
comMessageRef.value.showErrorMessage('请输入来源库位');
return;
}
if(!obj.itemCode){
comMessageRef.value.showErrorMessage('请选择零件');
comMessageRef.value.showErrorMessage('请输入零件');
return;
}
if(!obj.handleQty){
comMessageRef.value.showErrorMessage('请输入数量');
return;
}
// this.getResult.fromLocationCode = obj.fromLocationCode
getResult.value.label.batch = obj.handleQty
getResult.value = getResult.value ? getResult.value : {
label:{},
fromLocationCode:''
}
getResult.value.fromLocationCode = obj.fromLocationCode
getResult.value.label.itemCode = obj.itemCode
getResult.value.label.batch = obj.batch
getResult.value.label.qty = obj.handleQty
getScanResultAfterBatch(getResult.value,managementType.value)
isJustReplay.value = false
scanPopup.value.getScanResult(getResult.value,businessType.value)
}
const getScanResultAfter = (result) => {
const { balance } = result
@ -335,8 +354,8 @@ const getScanResultAfterBatch = (result,managementTypeParams)=> {
}
})
if (item == undefined) {
let itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack);
let itemp = createItemInfoForLabel(balance, result.label);
let newDetail = createDetailInfoForLabel(balance, pack, result.label);
if (newDetail.packingNumber == '') {
newDetail.packingNumber = pack.number;
@ -369,7 +388,7 @@ const getScanResultAfterBatch = (result,managementTypeParams)=> {
})
}else if(managementTypeParams == 'BY_BATCH'){
detail = item.subList.find(r => {
if (r.batch == pack.batch &&
if (r.batch == result.label.batch &&
r.fromLocationCode == balance.locationCode &&
r.scaned == true) {
return r;
@ -424,14 +443,14 @@ const getInputMsgResult = (result,fromWitch)=> {
//
const clearFromLocation = (fromLocationCodeParams)=>{
okToHoldRecordPackRef.value.fromLocationCode = ''
okToHoldRecordPackRef.value.itemCode =''
okToHoldRecordPackRef.value.batch =''
// okToHoldRecordPackRef.value.itemCode =''
// okToHoldRecordPackRef.value.batch =''
// this.isClearFromLocationCode = true
}
//
const clearItemCode = (label)=>{
okToHoldRecordPackRef.value.itemCode =''
okToHoldRecordPackRef.value.batch =''
// okToHoldRecordPackRef.value.batch =''
}
const showErrorMessage = (message) => {
if(scanPopup.value){
@ -585,9 +604,9 @@ const setParams = () => {
const info = getPackingNumberAndBatchByList(managementList.value, detail.itemCode, detail.packingNumber, detail.toLocationCode, detail.batch)
const submitItem = deepCopyData(detail)
submitItem.itemCode = detail.itemCode
submitItem.itemName = detail.package.itemName
submitItem.itemDesc1 = detail.package.itemDesc1
submitItem.itemDesc2 = detail.package.itemDesc2
submitItem.itemName = detail.itemName
submitItem.itemDesc1 = detail.itemDesc1
submitItem.itemDesc2 = detail.itemDesc2
submitItem.fromInventoryStatus = detail.inventoryStatus
submitItem.toInventoryStatus = detail.toInventoryStatus

20
src/pages/inventoryMove/coms/okToHoldRecordPack.vue

@ -10,7 +10,7 @@
<view class="item">
<view class="label">来源库位</view>
<view class="value">
<u-input v-model="fromLocationCode" @blur="fromLocationScanMsg"></u-input>
<u-input v-model="fromLocationCode" @blur="fromLocationScanMsg" clearable></u-input>
<u-icon name="close-circle-fill" color="#acacac" size="36" @click="clickBtnClearFromLocation"></u-icon>
</view>
<view class="searchIcon">
@ -20,8 +20,7 @@
<view class="item">
<view class="label">零件</view>
<view class="value">
<u-input v-model="itemCode" @blur="itemCodeScanMsg"></u-input>
<u-icon name="close-circle-fill" color="#acacac" size="36" @click="clickBtnClearItemCode"></u-icon>
<u-input v-model="itemCode" clearable></u-input>
</view>
<view class="searchIcon">
<image src="/static/search.svg" mode="" @click="itemCodeClick"/>
@ -30,8 +29,7 @@
<view class="item">
<view class="label">批次</view>
<view class="value">
<u-input v-model='batch'></u-input>
<u-icon name="close-circle-fill" color="#acacac" size="36" @click="batch = ''"></u-icon>
<u-input v-model='batch' clearable></u-input>
</view>
<view class="searchIcon"></view>
</view>
@ -115,6 +113,18 @@ const confirm = () => {
handleQty: handleQty.value,
};
emit('confirm', obj);
// if(!obj.fromLocationCode){
// this.$refs.comMessage.showErrorMessage('');
// return;
// }
// if(!obj.itemCode){
// this.$refs.comMessage.showErrorMessage('');
// return;
// }
// if(!obj.handleQty){
// this.$refs.comMessage.showErrorMessage('');
// return;
// }
};
const fromLocationScanMsg = () => {

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

@ -490,12 +490,12 @@ const checkCountBatch = ()=> {
tempHandleQty = 0
}
str +=
`批次【${cur.batch}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致\n`
`物料号【${item.itemCode}批次【${cur.batch}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致\n`
if( cur.handleQty > cur.balance.balanceQty){
console.log(2333,cur.handleQty)
console.log(2333,cur.balance.balanceQty)
str1 +=
`批次【${cur.batch}】提交数量【${ cur.handleQty}】不可以大于库存数量【${cur.balance.balanceQty}`
`物料号【${item.itemCode}批次【${cur.batch}】提交数量【${ cur.handleQty}】不可以大于库存数量【${cur.balance.balanceQty}`
}
}
})

2
src/pages/issue/coms/comIssueDetailCardBatch.vue

@ -11,7 +11,7 @@
<!-- <com-issue-request-info :workShopCode="dataContent.workShopCode" :dataContent="dataContent">
</com-issue-request-info> -->
</template>
<u-swipe-action ref="swipeAction" :options="removeOptions"
<u-swipe-action ref="swipeAction" :options="(item.scaned&&settingParam.allowModifyQty == 'TRUE')?editAndRemoveOptions : item.scaned? removeOptions:options"
v-for="(item,index) in dataContent.subList"
@click="(...event)=>itemCoceClick(event,item,index)">
<view class="" :class="item.scaned?'scan_view':''">

80
src/pages/issue/job/issueDetailBatch.vue

@ -84,6 +84,8 @@ import {
import WinScanButton from '@/mycomponents/scan/winScanButton.vue'
import JobTop from '@/mycomponents/job/jobTop.vue'
import WinScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import WorkStation from '@/mycomponents/workStation/workStation.vue'
import BalanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import {ref, nextTick, getCurrentInstance} from 'vue';
import {onLoad, onNavigationBarButtonTap, onBackPress} from '@dcloudio/uni-app';
@ -104,6 +106,7 @@ const scanCount = ref('')
const balanceinfo = ref('')
const fromLocationCode = ref('')
const scanMessage = ref('')
const recommendQty = ref('')
const managementList = ref([]);
const comMessageRef = ref(null);
@ -172,6 +175,7 @@ const getDetail = () => {
getIssueJobDetail(id.value).then((res) => {
uni.hideLoading();
if (res.data && res.data.subList.length > 0) {
// res.data.allowModifyLocation = 'FALSE'
jobContent.value = res.data;
jobStatus.value = res.data.status;
subList.value = res.data.subList;
@ -209,6 +213,34 @@ const resizeCollapse = () => {
};
const getScanResult = (result, managementTypeParams)=> {
managementType.value = managementTypeParams
let array1 = []//
let array2 = []//
this.detailSource.forEach(item=>{
item.subList.forEach(cur=>{
array1.push(cur.fromLocationCode)
array2.push(cur.batch)
})
})
//
const obj1 = array1.find(item=>item == result.fromLocationCode)
const obj2 = array2.find(item=>item == result.label.batch)
if(jobContent.value.allowModifyLocation == 'FALSE'){
if(!obj1){
this.showErrorMessage(`不可以扫描推荐库位【${array1.join(',')}】以外的库位`)
return
}
}
if(jobContent.value.allowModifyBatch == 'FALSE'){
if(!obj2){
showErrorMessage(`不可以扫描推荐批次【${array2.join(',')}】以外的批次`)
return
}
}
if(!obj1){
recommendQty.value = 0
}else{
recommendQty.value = result.balance.qty
}
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){
setDataBatch(result)
}
@ -262,7 +294,7 @@ const setDataBatch = (result)=> {
toLocationCode:toLocationCode.value,
batch:result.label.batch,
handleQty:result.label.qty,
qty:result.balance.qty,
qty:recommendQty.value,
inventoryStatus:result.balance.inventoryStatus,
toLocation:result.balance.toLocation,
balance:result.balance,
@ -604,8 +636,10 @@ const updateData = (record) => {
};
const autoCommit = ()=> {
// this.$throttle(this.submit, 2000, this)()
jobContent.value.allowBiggerQty = 'FALSE'
let str = ""
let str1 = ""
let str2 = ""
let totalQty = 0;
let taskQty = 0;
detailSource.value.forEach(detail => {
@ -613,22 +647,35 @@ const autoCommit = ()=> {
if (item.scaned) {
taskQty = calc.add(taskQty, item.qty)
totalQty = calc.add(totalQty, item.handleQty)
if (item.handleQty < item.qty) {
str += `批次【${item.batch}】提交数量【${item.handleQty}】与任务物料数量【${item.qty}】不一致\n`
if (jobContent.value.allowSmallerQty == "FALSE") {
if(parseFloat(item.handleQty)<parseFloat(item.qty)){
str += `批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不允许小于任务数量【${item.qty}`
}
if (item.handleQty > item.balance.qty) {
str1 += `批次【${item.batch}】提交数量【${item.handleQty}】不可以大于库存数量【${item.balance.qty}`
}
if (jobContent.value.allowBiggerQty == 'FALSE') {
if (parseFloat( item.handleQty )> parseFloat(item.qty)){
str1 += `批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不允许大于任务数量【${item.qty}`
}
}
if(parseFloat(item.handleQty)>parseFloat( item.balance.qty)){
str2 += `批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不可以大于库存数量【${item.balance.qty}`
}
}
})
})
if(str1){
comMessageRef.value.showMessage(str1, res => {
if (res) {
afterCloseMessage()
if (str) {
str1 = '不允许提交\n' + str
showErrorMessage(str)
return
}
});
if (str1) {
str1 = '不允许提交\n' + str1
showErrorMessage(str1)
return
}
if (str2) {
str2 = '不允许提交\n' + str2
showErrorMessage(str2)
return
}
if(str){
@ -641,17 +688,6 @@ const autoCommit = ()=> {
//
proxy.$throttle(submit, 2000, proxy)()
} else {
// this.detailSource.forEach(detail => {
// detail.Items.forEach(item => {
// taskQty =calc.add(taskQty,item.qty)
// item.Locations.forEach(lco => {
// lco.Batchs.forEach(batch => {
// batch.Records = []
// })
// })
// })
// })
// this.$refs.comScanIssuePack.clearList()
scanPopupGetFocus()
}
});

2
src/pages/issue/record/directIssueByBatch.vue

@ -345,7 +345,7 @@ const closeScanPopup = () => {
const scanPopupGetFocus = () => {
if (scanPopup.value) {
scanPopup.value.getfocus();
scanPopup.value.packGetFocus();
}
};

Loading…
Cancel
Save