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. 166
      src/pages/unPlanned/job/receiptJobDetail.vue

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

@ -20,7 +20,9 @@
</view>
</u-collapse-item>
</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>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationAreaTypeList="locationAreaTypeList"></win-scan-location>
@ -60,6 +62,10 @@ const props = defineProps({
type: Array,
default: null
},
isNumTips: {
type: Boolean,
default: true
},
});
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="">
<comProductDetailCardBatch :dataContent="item" :settingParam="jobContent" :isShowLocation="false"
@remove="updateData" @updateData="updateData"
@remove="updateData" @updateData="updateData" :isNumTips='false'
:locationAreaTypeList='toLocationAreaTypeList' v-if="managementType=='BY_BATCH'">
</comProductDetailCardBatch>
<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) => {
if (res.success) {
managementList.value = res.list;
managementType.value = managementList.value.some(item => item.ManagementPrecision === 'BY_BATCH') ? 'BY_BATCH' : '';
if (managementType.value === 'BY_BATCH') {
this.managementType = managementList.value &&
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 => {
item.subList.forEach(cur => {
cur.packingNumber = '';
cur.toPackingNumber = '';
cur.fromPackingNumber = '';
cur.batch = ''
});
});
}
@ -257,8 +268,9 @@ const setDataBatch = (result)=>{
const qty = result.label.qty;
const itemCode = result.label.itemCode;
const detail = detailSource.value.find(r => r.itemCode == itemCode);
let itemcodes = detailSource.value.map(item=>item.itemCode).join(',')
if (detail == undefined) {
showErrorMessage("物料号【" + itemCode + "】不在列表中")
showErrorMessage(`扫描的物料【 ${ result.label.itemCode} 】与任务明细中的物料【 ${itemcodes} 】不一致`)
} else {
let itemDetail = detail.subList.find(r => {
return r.batch == batch

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

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

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

@ -13,11 +13,13 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData"
:locationAreaTypeList='toLocationAreaTypeList'>
</com-receipt-detail-card>
<!-- <com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent"-->
<!-- @remove="updateData" @updateData="updateData"-->
<!-- :locationAreaTypeList='toLocationAreaTypeList'>-->
<!-- </com-receipt-detail-card>-->
<comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail" :isShowFromLocation='false'>
</comRecommendDetailCard>
</view>
<view class="split_line"></view>
</view>
@ -53,9 +55,10 @@ import { getDataSource, createRecordInfo, calcHandleQty, getScanCount } from '@/
import winScanButton from '@/mycomponents/scan/winScanButton.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 jobTop from '@/mycomponents/job/jobTop.vue'
import ComRecommendDetailCard from "@/mycomponents/detail/comRecommendDetailCard.vue"
import JobTop from '@/mycomponents/job/jobTop.vue'
import { useCountStore } from '@/store'
// store
const store = useCountStore()
@ -149,6 +152,9 @@ const getDetail = () => {
jobContent.value = res.data
jobStatus.value = res.data.status
subList.value = res.data.subList
subList.value.forEach(item=>{
item.isRecommend = true
})
detailSource.value = getDataSource(subList.value)
jobToLocationCode.value = subList.value[0].toLocationCode
toLocationAreaTypeList.value = await getDirectoryItemArray(jobContent.value.toAreaTypes)
@ -161,7 +167,9 @@ const getDetail = () => {
getManagementPrecisions(itemCodes, jobToLocationCode.value, res => {
if (res.success) {
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 {
@ -209,14 +217,41 @@ const setDataBatch = (result)=>{
const batch = result.label.batch;
const qty = result.label.qty;
const itemCode = result.label.itemCode;
const locationCode = result.package.toLocationCode;
const detail = detailSource.value.find(r => r.itemCode == itemCode);
if (detail == undefined) {
showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => r.batch == batch);
const itemDetail = detail.subList.find(r => {
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) {
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 {
if (itemDetail.scaned) {
// this.showErrorMessage("" + packingNumber + "," + batch + "" + "")
@ -269,35 +304,94 @@ const setData = (result) => {
}
const commit = () => {
scanCount.value = getScanCount(subList.value)
if (scanCount.value == 0) {
showErrorMessage('扫描数为0,请先扫描')
return
}
//
if (!checkLocation()) {
return
}
//
if (scanCount.value == subList.value.length) {
submitJob()
} else if (scanCount.value < subList.value.length) {
//
if (jobContent.value.allowPartialComplete == 'TRUE') {
//
comMessageRef.value.showErrorMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
submitJob()
if(managementType.value == 'BY_BATCH' || managementType.value == 'BY_QUANTITY' ){
let scanCount = 0;
detailSource.value.forEach((item) => {
item.subList.forEach(cur => {
if(cur.scaned){
scanCount++;
}
})
submitJob()
} else {
//
comMessageRef.value.showErrorMessage(`任务明细未全部完成,不允许部分提交!`, (res) => {
if (res) {
openScanPopup()
})
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)
if (scanCount.value == 0) {
showErrorMessage('扫描数为0,请先扫描')
return
}
//
if (!checkLocation()) {
return
}
//
if (scanCount.value == subList.value.length) {
submitJob()
} else if (scanCount.value < subList.value.length) {
//
if (jobContent.value.allowPartialComplete == 'TRUE') {
//
comMessageRef.value.showErrorMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
submitJob()
}
})
submitJob()
} else {
//
comMessageRef.value.showErrorMessage(`任务明细未全部完成,不允许部分提交!`, (res) => {
if (res) {
openScanPopup()
}
})
}
}
}
}

Loading…
Cancel
Save