Browse Source

修改客户退货扫描

hella_online_20240927
lijuncheng 2 months ago
parent
commit
bedca83c78
  1. 190
      src/mycomponents/detail/comLableDetailCard.vue
  2. 90
      src/pages/customerReturn/job/returnDetail.vue
  3. 2
      src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue

190
src/mycomponents/detail/comLableDetailCard.vue

@ -0,0 +1,190 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<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;'>
<recommend :detail="item" :isShowFromLocation="isShowFromLocation"
:isShowStatus="isShowStatus" :isShowToLocation="isShowToLocation">
</recommend>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</uni-collapse-item>
</uni-collapse>
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm">
</recommend-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 recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import {
getDetailOption,
getPurchaseReceiptOption
} from '@/common/array.js';
export default {
emits: ['openDetail', "updateData","remove"],
components: {
itemCompareQty,
recommend,
recommendQtyEdit,
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
},
isShowFromLocation: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: false
},
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.receiptEdit.openTaskEditPopup(item.qty, item.handleQty, item.labelQty);
},
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>

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

@ -16,10 +16,12 @@
<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" :settingParam="jobContent" :isShowLocation="false" <comLableDetailCard :dataContent="item" :settingParam="jobContent"
:isShowStatus="false"
:isShowLocation="false"
@remove="updateData" @updateData="updateData" @openDetail="openDetail" @remove="updateData" @updateData="updateData" @openDetail="openDetail"
:locationAreaTypeList="toLocationAreaTypeList"> :locationAreaTypeList="toLocationAreaTypeList">
</com-detail-card> </comLableDetailCard >
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@ -41,7 +43,7 @@
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> <win-scan-pack ref="scanPopup" @getResult='getScanResult'></win-scan-pack>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup> <detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
@ -75,9 +77,9 @@
} from '@/common/detail.js'; } from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue' import locationCompare from '@/mycomponents/location/locationCompare.vue'
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" import comLableDetailCard from "@/mycomponents/detail/comLableDetailCard .vue"
import detailInfoPopup from '@/pages/customerReturn/coms/detailInfoPopup.vue' import detailInfoPopup from '@/pages/customerReturn/coms/detailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
@ -85,9 +87,9 @@
components: { components: {
jobTop, jobTop,
winScanButton, winScanButton,
winScanPackAndLocation, winScanPack,
locationCompare, locationCompare,
comDetailCard, comLableDetailCard ,
detailInfoPopup detailInfoPopup
}, },
data() { data() {
@ -181,7 +183,6 @@
that.jobContent = res.data; that.jobContent = res.data;
that.subList = res.data.subList; that.subList = res.data.subList;
that.jobStatus = res.data.status that.jobStatus = res.data.status
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)
that.fromLocationCode = that.subList[0].fromLocationCode that.fromLocationCode = that.subList[0].fromLocationCode
that.jobToLocationCode = that.subList[0].toLocationCode that.jobToLocationCode = that.subList[0].toLocationCode
@ -225,25 +226,7 @@
}, },
openScanPopup() { openScanPopup() {
let fromlocationCode = ''; this.$refs.scanPopup.openScanPopup();
let fromlocationList = [];
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
item.subList.forEach(l => {
//
var location = fromlocationList.find(res => res == l.fromLocationCode)
if (location == undefined) {
fromlocationList.push(l.fromLocationCode);
}
//
if (fromlocationCode == '') {
if (!l.scaned) {
fromlocationCode = l.fromLocationCode;
}
}
})
}
this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent);
}, },
closeScanPopup() { closeScanPopup() {
@ -253,11 +236,9 @@
getScanResult(result) { getScanResult(result) {
try { try {
var packingNumber = result.package.number; var packingNumber = result.package.number;
var batch = result.balance.batch; var batch = result.label.batch;
var qty = result.balance.qty; var qty = result.label.qty;
var itemCode = result.balance.itemCode; var itemCode = result.label.itemCode;
var locationCode = result.balance.locationCode;
var inventoryStatus = result.balance.inventoryStatus;
var detail = this.detailSource.find(r => r.itemCode == itemCode); var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) { if (detail == undefined) {
@ -273,45 +254,12 @@
if (itemDetail.scaned) { if (itemDetail.scaned) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]已经扫描") this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]已经扫描")
} else { } else {
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
']不一致,是否继续退货?', res => {
if (res) {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty) itemDetail.handleQty = Number(result.label.qty)
itemDetail.inventoryStatus = result.balance.inventoryStatus; itemDetail.packQty = Number(result.package.packQty)
itemDetail.balance = result.balance; itemDetail.packUnit = result.package.packUnit
itemDetail.balance.balanceQty = Number(result.balance.qty)
itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty(); this.calcHandleQty();
} else {
this.scanPopupGetFocus();
}
});
} else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许转移!', res => {
this.scanPopupGetFocus();
});
}
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty)
itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty)
itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
}
} }
} }
} }
@ -405,7 +353,7 @@
customerReturnJobSubmit(params).then(res => { customerReturnJobSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成客户退货记录:" + res.data) this.showCommitSuccessMessage("提交成功\n生成客户退货记录:\n" + res.data)
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
} }
@ -499,13 +447,13 @@
scanPopupGetFocus() { scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) { if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packGetFocus(); this.$refs.scanPopup.getfocus();
} }
}, },
scanPopupLoseFocus() { scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) { if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packLoseFocus(); this.$refs.scanPopup.losefocus();
} }
}, },

2
src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue

@ -17,7 +17,7 @@
</uni-collapse-item> </uni-collapse-item>
</uni-collapse> </uni-collapse>
<recommend-qty-edit ref=" receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm"> <recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :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>

Loading…
Cancel
Save