Browse Source

修改计划外出库扫描的不是推荐的包装号

hella_online_20240803
lijuncheng 4 weeks ago
parent
commit
96d0346a54
  1. 11
      src/mycomponents/detail/comDetailCard.vue
  2. 194
      src/mycomponents/detail/comRecommendDetailCard.vue
  3. 103
      src/pages/unPlanned/job/issueJobDetail.vue

11
src/mycomponents/detail/comDetailCard.vue

@ -15,6 +15,7 @@
style='padding:0px 0px 5px 0px;align-items: center;'> style='padding:0px 0px 5px 0px;align-items: center;'>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false"> <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
</recommend> </recommend>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
</view> </view>
@ -83,13 +84,17 @@
dataContent: { dataContent: {
handler(newName, oldName) { handler(newName, oldName) {
if (this.dataContent.subList.length > 0) { if (this.dataContent.subList.length > 0) {
if (this.$refs.collapse1 != undefined && this.$refs.collapse1 != null) {
this.$nextTick(res => { this.$nextTick(res => {
this.$refs.collapse1.resize() setTimeout(() => {
}) if (this.$refs.collapse1) {
this.$refs.collapse1.resize();
} }
}, 500)
})
} }
}, },
immediate: true, immediate: true,
deep: true deep: true
} }

194
src/mycomponents/detail/comRecommendDetailCard.vue

@ -0,0 +1,194 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" >
<uni-collapse-item :open="true">
<template v-slot:title>
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowStdPack="false">
</item-compare-qty>
</template>
<view class="" v-for="(item,index) in dataContent.subList" :key="index">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"
style='padding:0px 0px 5px 0px;align-items: center;'>
<view v-if="item.isRecommend" class="uni-flex" style="flex-direction: row; align-items: center;background-color: antiquewhite;">
<view class="" style="font-size: 32rpx; color: black; font-weight: bold; text-align: center;">
</view>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
</recommend>
</view>
<view v-else class="uni-flex" style="flex-direction: row; align-items: center;background-color: antiquewhite; margin-top: 5rpx;">
<view class="" style="font-size: 32rpx; color: red; font-weight: bold; text-align: center;">
</view>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
</recommend>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" @confirm="confirm"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationAreaTypeList="locationAreaTypeList"></win-scan-location>
<comMessage ref="message"></comMessage>
</view>
</template>
<script>
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import {
getDetailOption,
getPurchaseReceiptOption
} from '@/common/array.js';
export default {
emits: ['openDetail', "updateData"],
components: {
itemCompareQty,
recommend,
balanceQtyEdit,
winScanLocation
},
props: {
dataContent: {
type: Object,
default: null
},
settingParam: {
type: Object,
default: null
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
locationAreaTypeList: {
type: Array,
default: null
},
queryBalance: {
type: Boolean,
default: true
},
isShowStatus: {
type: Boolean,
default: true
},
},
watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
this.$nextTick(res => {
setTimeout(() => {
if (this.$refs.collapse1) {
this.$refs.collapse1.resize();
}
}, 500)
})
}
},
immediate: true,
deep: true
}
},
data() {
return {
option: [],
showItem: {},
locatonItem: {},
editItem: {},
detailOptions: [],
scanOptions: []
}
},
mounted() {
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false)
}
// this.showLocation();
},
methods: {
swipeClick(e, item) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "库位") {
this.showLocation(item)
} else if (e.content.text == "移除") {
this.remove(item)
}
},
edit(item) {
this.editItem = item;
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty);
},
detail(item) {
this.$emit('openDetail', item);
// this.showItem = item;
// this.$refs.jobDetailPopup.openPopup(item)
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.balance = {}
item.handleQty = null;
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.editItem.handleQty = qty;
this.$emit('updateData')
},
showLocation(item) {
this.locatonItem = item;
this.$refs.scanLocationCode.openScanPopup();
},
//
getLocation(location, code) {
this.locatonItem.toLocationCode = code;
this.$emit('updateData')
},
}
}
</script>
<style>
</style>

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

@ -12,9 +12,9 @@
<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-detail-card :dataContent="item" :index="index" :settingParam="jobContent" <comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail"> @remove="updateData" @updateData="updateData" @openDetail="openDetail">
</com-detail-card> </comRecommendDetailCard>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@ -66,7 +66,7 @@
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" import comRecommendDetailCard from "@/mycomponents/detail/comRecommendDetailCard.vue"
import detailInfoPopup from '@/pages/unPlanned/coms/detailInfoPopup.vue' import detailInfoPopup from '@/pages/unPlanned/coms/detailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
@ -75,7 +75,7 @@
components: { components: {
winScanButton, winScanButton,
winScanPackAndLocation, winScanPackAndLocation,
comDetailCard, comRecommendDetailCard,
detailInfoPopup, detailInfoPopup,
jobTop jobTop
}, },
@ -166,6 +166,9 @@
that.jobContent = res.data; that.jobContent = res.data;
that.jobStatus = res.data.status that.jobStatus = res.data.status
that.subList = res.data.subList; that.subList = res.data.subList;
that.subList.forEach(item=>{
item.isRecommend = true
})
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)
} else { } else {
that.showErrorMessage('列表数据为0'); that.showErrorMessage('列表数据为0');
@ -190,11 +193,21 @@
calcHandleQty() { calcHandleQty() {
calcHandleQty(this.detailSource) calcHandleQty(this.detailSource)
this.continueScan() // this.continueScan()
this.$forceUpdate(); this.$forceUpdate();
}, },
updateData() { updateData() {
//
for (var i = 0; i < this.detailSource.length; i++) {
var item =this.detailSource[i]
for (var j = 0; j < item.subList.length; j++) {
var sub =item.subList[j]
if(sub.isRecommend&&!sub.scaned){
item.subList.splice(j,1)
}
}
}
this.calcHandleQty(); this.calcHandleQty();
}, },
@ -218,11 +231,28 @@
var itemDetail = detail.subList.find(r => { var itemDetail = detail.subList.find(r => {
return r.packingNumber == packingNumber && return r.packingNumber == packingNumber &&
r.batch == batch && r.batch == batch &&
r.fromLocationCode == result.fromLocationCode r.fromLocationCode == result.fromLocationCode&&
r.isRecommend==false
}) })
if (itemDetail == undefined) { if (itemDetail == undefined) {
this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result var newAdd = {
.fromLocationCode + "】不在列表中") itemCode:itemCode,
packingNumber:packingNumber,
batch:batch,
handleQty:Number(result.balance.qty),
qty:qty,
fromLocationCode: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 + "】库位【" + result this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result
@ -275,29 +305,43 @@
}, },
commit() { commit() {
this.scanCount = getScanCount(this.subList); var scanCount=0;
if (this.scanCount == 0) { this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if(cur.scaned){
scanCount++;
}
})
})
if(scanCount==0){
this.showErrorMessage("扫描数为0,请先扫描") this.showErrorMessage("扫描数为0,请先扫描")
return; return;
} }
// //
if (this.scanCount == this.subList.length) {
this.checkCount(); this.checkCount();
} else if (this.scanCount < this.subList.length) { // this.scanCount = getScanCount(this.jobContent.subList);
// // if (this.scanCount == 0) {
if (this.jobContent.allowPartialComplete == "TRUE") { // this.showErrorMessage("0,")
// // return;
this.checkCount(); // }
} else {
// // // //
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => { // if (this.scanCount == this.subList.length) {
if (res) { // this.checkCount();
this.openScanPopup(); // } else if (this.scanCount < this.subList.length) {
} // //
}); // if (this.jobContent.allowPartialComplete == "TRUE") {
} // //
} // this.checkCount();
// } else {
// //
// this.$refs.comMessage.showErrorMessage(",!", res => {
// if (res) {
// this.openScanPopup();
// }
// });
// }
// }
}, },
checkCount(){ checkCount(){
@ -305,6 +349,7 @@
let str = '' let str = ''
this.detailSource.forEach((item) => { this.detailSource.forEach((item) => {
item.subList.forEach(cur => { item.subList.forEach(cur => {
if(cur.scaned){
if (cur.qty != cur.handleQty) { if (cur.qty != cur.handleQty) {
var tempHandleQty =0 var tempHandleQty =0
if(cur.handleQty){ if(cur.handleQty){
@ -314,6 +359,8 @@
} }
str += `包装号【${cur.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致` str += `包装号【${cur.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致`
} }
}
}) })
}) })
if (str) { if (str) {
@ -357,7 +404,7 @@
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned&&!detail.isRecommend) {
detail.toPackingNumber = detail.packingNumber; detail.toPackingNumber = detail.packingNumber;
detail.toContainerNumber = ''; detail.toContainerNumber = '';
detail.toBatch = detail.batch; detail.toBatch = detail.batch;

Loading…
Cancel
Save