Browse Source

fix: cproductionReturn\job productReceipt unPlanned\job 文件修改 Vue2升级Vue3 11-11/11-13

syhx_app_vue3
王志国 1 week ago
parent
commit
7967df06e2
  1. 8
      src/pages/productReceipt/coms/comProductDetailCardBatch.vue
  2. 2
      src/pages/productReceipt/job/productReceiptDetail.vue
  3. 18
      src/pages/productionReturn/job/okToReturnDetail.vue
  4. 1
      src/pages/unPlanned/job/issueJobDetail.vue
  5. 116
      src/pages/unPlanned/job/receiptJobDetail.vue

8
src/pages/productReceipt/coms/comProductDetailCardBatch.vue

@ -20,7 +20,9 @@
</view> </view>
</u-collapse-item> </u-collapse-item>
</u-collapse> </u-collapse>
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm"> <recommend-qty-edit ref="receiptEdit" :dataContent="editItem"
:isNumTips='isNumTips'
:settingParam="settingParam" @confirm="confirm">
</recommend-qty-edit> </recommend-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation' <win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationAreaTypeList="locationAreaTypeList"></win-scan-location> :locationAreaTypeList="locationAreaTypeList"></win-scan-location>
@ -60,6 +62,10 @@ const props = defineProps({
type: Array, type: Array,
default: null default: null
}, },
isNumTips: {
type: Boolean,
default: true
},
}); });
const emit = defineEmits(['updateData', 'remove']); const emit = defineEmits(['updateData', 'remove']);

2
src/pages/productReceipt/job/productReceiptDetail.vue

@ -40,7 +40,7 @@
<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="">
<comProductDetailCardBatch :dataContent="item" :settingParam="jobContent" :isShowLocation="false" <comProductDetailCardBatch :dataContent="item" :settingParam="jobContent" :isShowLocation="false"
@remove="updateData" @updateData="updateData" @remove="updateData" @updateData="updateData" :isNumTips='false'
:locationAreaTypeList='toLocationAreaTypeList' v-if="managementType=='BY_BATCH'"> :locationAreaTypeList='toLocationAreaTypeList' v-if="managementType=='BY_BATCH'">
</comProductDetailCardBatch> </comProductDetailCardBatch>
<comProductDetailCard v-else :dataContent="item" :settingParam="jobContent" <comProductDetailCard v-else :dataContent="item" :settingParam="jobContent"

18
src/pages/productionReturn/job/okToReturnDetail.vue

@ -194,13 +194,24 @@ const getDetail = async () => {
await getManagementPrecisions(itemCodes, fromLocationCode.value, (res) => { await getManagementPrecisions(itemCodes, fromLocationCode.value, (res) => {
if (res.success) { if (res.success) {
managementList.value = res.list; managementList.value = res.list;
managementType.value = managementList.value.some(item => item.ManagementPrecision === 'BY_BATCH') ? 'BY_BATCH' : ''; this.managementType = managementList.value &&
if (managementType.value === 'BY_BATCH') { managementList.value[0] &&
managementList.value[0].ManagementPrecision
if(managementType.value == 'BY_BATCH'){
detailSource.value.forEach(item=>{
item.subList.forEach(cur=>{
cur.packingNumber=''
cur.toPackingNumber=''
cur.fromPackingNumber=''
})
})
}else if (managementType.value === 'BY_BATCH') {
detailSource.value.forEach(item => { detailSource.value.forEach(item => {
item.subList.forEach(cur => { item.subList.forEach(cur => {
cur.packingNumber = ''; cur.packingNumber = '';
cur.toPackingNumber = ''; cur.toPackingNumber = '';
cur.fromPackingNumber = ''; cur.fromPackingNumber = '';
cur.batch = ''
}); });
}); });
} }
@ -257,8 +268,9 @@ const setDataBatch = (result)=>{
const qty = result.label.qty; const qty = result.label.qty;
const itemCode = result.label.itemCode; const itemCode = result.label.itemCode;
const detail = detailSource.value.find(r => r.itemCode == itemCode); const detail = detailSource.value.find(r => r.itemCode == itemCode);
let itemcodes = detailSource.value.map(item=>item.itemCode).join(',')
if (detail == undefined) { if (detail == undefined) {
showErrorMessage("物料号【" + itemCode + "】不在列表中") showErrorMessage(`扫描的物料【 ${ result.label.itemCode} 】与任务明细中的物料【 ${itemcodes} 】不一致`)
} else { } else {
let itemDetail = detail.subList.find(r => { let itemDetail = detail.subList.find(r => {
return r.batch == batch return r.batch == batch

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

@ -23,6 +23,7 @@
<comRecommendDetailCard :dataContent="item" :index="index" <comRecommendDetailCard :dataContent="item" :index="index"
:settingParam="jobContent" @remove="updateData" :settingParam="jobContent" @remove="updateData"
:isShowToLocation='false'
@updateData="updateData" @openDetail="openDetail"> @updateData="updateData" @openDetail="openDetail">
</comRecommendDetailCard> </comRecommendDetailCard>
</view> </view>

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

@ -13,11 +13,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-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent"-->
<com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent" <!-- @remove="updateData" @updateData="updateData"-->
@remove="updateData" @updateData="updateData" <!-- :locationAreaTypeList='toLocationAreaTypeList'>-->
:locationAreaTypeList='toLocationAreaTypeList'> <!-- </com-receipt-detail-card>-->
</com-receipt-detail-card> <comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail" :isShowFromLocation='false'>
</comRecommendDetailCard>
</view> </view>
<view class="split_line"></view> <view class="split_line"></view>
</view> </view>
@ -53,9 +55,10 @@ import { getDataSource, createRecordInfo, calcHandleQty, getScanCount } from '@/
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 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 ComRecommendDetailCard from "@/mycomponents/detail/comRecommendDetailCard.vue"
import JobTop from '@/mycomponents/job/jobTop.vue'
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store // store
const store = useCountStore() const store = useCountStore()
@ -149,6 +152,9 @@ 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
subList.value.forEach(item=>{
item.isRecommend = true
})
detailSource.value = getDataSource(subList.value) detailSource.value = getDataSource(subList.value)
jobToLocationCode.value = subList.value[0].toLocationCode jobToLocationCode.value = subList.value[0].toLocationCode
toLocationAreaTypeList.value = await getDirectoryItemArray(jobContent.value.toAreaTypes) toLocationAreaTypeList.value = await getDirectoryItemArray(jobContent.value.toAreaTypes)
@ -161,7 +167,9 @@ const getDetail = () => {
getManagementPrecisions(itemCodes, jobToLocationCode.value, res => { getManagementPrecisions(itemCodes, jobToLocationCode.value, res => {
if (res.success) { if (res.success) {
managementList.value = res.list; managementList.value = res.list;
managementType.value = managementList.value.some(item => item.ManagementPrecision == 'BY_BATCH') ? 'BY_BATCH' : '' managementType.value = managementList.value &&
managementList.value[0] &&
managementList.value[0].ManagementPrecision
} }
}) })
} else { } else {
@ -209,14 +217,41 @@ const setDataBatch = (result)=>{
const batch = result.label.batch; const batch = result.label.batch;
const qty = result.label.qty; const qty = result.label.qty;
const itemCode = result.label.itemCode; const itemCode = result.label.itemCode;
const locationCode = result.package.toLocationCode;
const detail = detailSource.value.find(r => r.itemCode == itemCode); const detail = detailSource.value.find(r => r.itemCode == itemCode);
if (detail == undefined) { if (detail == undefined) {
showErrorMessage("物料号【" + itemCode + "】不在列表中") showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else { } else {
const itemDetail = detail.subList.find(r => {
var itemDetail = detail.subList.find(r => r.batch == batch); return r.batch == batch &&
r.fromLocationCode == result.fromLocationCode&&
r.isRecommend==false
})
const itemDetail1 = detail.subList.find(r => {
return r.batch == batch &&
r.fromLocationCode == result.fromLocationCode&&
r.isRecommend==true
})
if (itemDetail == undefined) { if (itemDetail == undefined) {
showErrorMessage("批次【" + batch + "】" + "不在列表中") let newAdd = {
...itemDetail1,
itemCode:itemCode,
packingNumber:packingNumber,
batch:batch,
handleQty:Number(result.label.qty),
qty:detail.qty,
toLocationCode:locationCode,
// inventoryStatus:inventoryStatus,
// toInventoryStatus:inventoryStatus,
// balance:result.balance,
isRecommend:false,
isNewAdd:"newAdd"
}
// newAdd.balance.balanceQty = Number(result.balance.qty);
// newAdd.balance.packQty = Number(result.package.packQty)
// newAdd.balance.packUnit = result.package.packUnit
newAdd.scaned = true;
detail.subList.push(newAdd)
} else { } else {
if (itemDetail.scaned) { if (itemDetail.scaned) {
// this.showErrorMessage("" + packingNumber + "," + batch + "" + "") // this.showErrorMessage("" + packingNumber + "," + batch + "" + "")
@ -269,6 +304,64 @@ const setData = (result) => {
} }
const commit = () => { const commit = () => {
if(managementType.value == 'BY_BATCH' || managementType.value == 'BY_QUANTITY' ){
let scanCount = 0;
detailSource.value.forEach((item) => {
item.subList.forEach(cur => {
if(cur.scaned){
scanCount++;
}
})
})
if(scanCount==0){
showErrorMessage("扫描数为0,请先扫描")
return;
}
let str = ''
let str1 = ''
detailSource.value.forEach((item) => {
item.subList.forEach(cur=>{
if(cur.scaned){
if(parseFloat(cur.qty)>parseFloat(cur.handleQty)){
str += `物料号【${item.itemCode}】实际提交数量【${cur.handleQty}】不可以小于任务数量【${cur.qty}`
}
if(parseFloat(cur.qty)<parseFloat(cur.handleQty)){
str1 += `物料号【${item.itemCode}】实际提交数量【${cur.handleQty}】不可以大于任务数量【${cur.qty}`
}
}
})
})
if(jobContent.value.allowBiggerQty == "FALSE"){
if(str1){
comMessageRef.value.showErrorMessage(str1);
return;
}
}
if(jobContent.value.allowSmallerQty == "FALSE"){
if(str){
comMessageRef.value.showErrorMessage(str);
return;
}
}
if (scanCount < subList.value.length){
if(jobContent.value.allowPartialComplete == "TRUE"){
comMessageRef.value.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
submitJob()
}
});
} else {
//
comMessageRef.value.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
openScanPopup();
}
});
}
}else{
submitJob()
}
}else {
scanCount.value = getScanCount(subList.value) scanCount.value = getScanCount(subList.value)
if (scanCount.value == 0) { if (scanCount.value == 0) {
showErrorMessage('扫描数为0,请先扫描') showErrorMessage('扫描数为0,请先扫描')
@ -301,6 +394,7 @@ const commit = () => {
} }
} }
} }
}
const checkLocation = () => { const checkLocation = () => {
let isPass = true let isPass = true

Loading…
Cancel
Save