Browse Source

客户退货记录

wms3.0_pda
lijuncheng 11 months ago
parent
commit
6a5725c1dc
  1. 4
      api/request2.js
  2. 3
      mycomponents/scan/winComScan.vue
  3. 2
      mycomponents/scan/winScanLocation.vue
  4. 6
      mycomponents/scan/winScanPackAndLocation.vue
  5. 920
      pages/customerReturn/record/returnRecord.vue

4
api/request2.js

@ -2011,8 +2011,8 @@ export function customerReturnRequestSubmit(params) {
*/ */
export function customerReturnRecordSubmit(params) { export function customerReturnRecordSubmit(params) {
return request({ return request({
url: baseApi + "/wms/purchasereturn-request-main/submit", url: baseApi + "/wms/customerreturn-record-main/create",
method: "put", method: "post",
data: params, data: params,
}); });
} }

3
mycomponents/scan/winComScan.vue

@ -103,6 +103,9 @@
} }
}, },
mounted() { mounted() {
if(document.querySelector('textarea')!=null){
document.querySelector('textarea').setAttribute('inputmode', 'none')
}
// if (this.$el.querySelector('textarea') != null) { // if (this.$el.querySelector('textarea') != null) {
// this.$el.querySelector('textarea').setAttribute('inputmode', 'none') // this.$el.querySelector('textarea').setAttribute('inputmode', 'none')
// } // }

2
mycomponents/scan/winScanLocation.vue

@ -12,7 +12,7 @@
</view> </view>
<view class=""> <view class="">
<view class=""> <view class="">
<win-com-scan ref="scan" labelType="LocationLabel" @getResult="getScanResult" :placeholder='title' :clearResult="false" <win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="false"
:boxFocus="true" :isShowHistory="isShowHistory" headerType="HLB"> :boxFocus="true" :isShowHistory="isShowHistory" headerType="HLB">
</win-com-scan> </win-com-scan>
</view> </view>

6
mycomponents/scan/winScanPackAndLocation.vue

@ -40,7 +40,7 @@
<view class=""> <view class="">
<view class=""> <view class="">
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" <win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult"
:isShowHistory="isShowHistory" :clearResult="true"></win-com-scan> :isShowHistory="isShowHistory" :clearResult="true" :headerType ="headerType"></win-com-scan>
</view> </view>
</view> </view>
</view> </view>
@ -95,6 +95,10 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
headerType: {
type: String,
default: "HPQ"
},
}, },
data() { data() {
return { return {

920
pages/customerReturn/record/returnRecord.vue

@ -1,459 +1,461 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<view class=""> <view class="">
<com-blank-view @goScan='getLocation' v-if="detailSource.length==0"></com-blank-view> <com-blank-view @goScan='getLocation' v-if="detailSource.length==0"></com-blank-view>
</view> </view>
<view class="page-wraper" v-if="detailSource.length>0"> <view class="page-wraper" v-if="detailSource.length>0">
<view class="page-main"> <view class="page-main">
<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="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="jobContent" <record-com-detail-card :dataContent="item" :index="index"
:isShowLocation="true" @removeItem="removeItem(index,item)" @updateData="updateData" :isShowLocation="true" @removeItem="removeItem(index,item)" @updateData="updateData"
@removePack="removePack"> @removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode' <view class="page-footer">
:locationTypeList="tolocationTypeList"></requiredLocation> <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="page-footer"> <view class="">
<view class="uni-flex u-col-center space-between padding_10" <requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
style="background-color:ghostwhite; width: 100%; "> :locationTypeList="tolocationTypeList"></requiredLocation>
<view class=""> </view>
</view> <view class=" uni-flex uni-row">
<view class=" uni-flex uni-row"> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> </view>
</view> </view>
</view> </view>
</view> <win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-button @goScan='openScanPopup'></win-scan-button> </view>
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' headerType="HPQ,HMQ"></win-scan-pack-and-location>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> <comMessage ref="comMessage"></comMessage>
<comMessage ref="comMessage"></comMessage> <win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' :locationTypeList="fromlocationTypeList"></win-scan-location>
:locationTypeList="fromlocationTypeList"></win-scan-location> </view>
</view>
</template>
</template>
<script>
<script> import {
import { getBasicCustomerList,
getBasicCustomerList, customerReturnRecordSubmit
customerReturnRequestSubmit, } from '@/api/request2.js';
customerReturnRecordSubmit import {
} from '@/api/request2.js'; getInventoryStatusDesc,
import { getDirectoryItemArray
getInventoryStatusDesc, } from '@/common/directory.js';
getDirectoryItemArray
} from '@/common/directory.js'; import {
getPrecisionStrategyList
import { } from '@/common/balance.js';
getManagementPrecisions import {
} from '@/common/balance.js'; goHome,
import { updateTitle,
goHome, getPackingNumberAndBatchByList
updateTitle, } from '@/common/basic.js';
getPackingNumberAndBatch
} from '@/common/basic.js'; import {
getBusinessType,
import { createItemInfo,
getBusinessType, createDetailInfo,
createItemInfo, calcHandleQty
createDetailInfo, } from '@/common/record.js';
calcHandleQty
} from '@/common/record.js'; import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue' import comReturnRecord from '@/pages/customerReturn/coms/comReturnRecord.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' import comBlankView from '@/mycomponents/common/comBlankView.vue'
import comReturnRecord from '@/pages/customerReturn/coms/comReturnRecord.vue' import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import comBlankView from '@/mycomponents/common/comBlankView.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comMessage from '@/mycomponents/common/comMessage.vue' import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
export default {
components: {
export default { winScanButton,
components: { winScanPack,
winScanButton, comReturnRecord,
winScanPack, requiredLocation,
comReturnRecord, comBlankView,
requiredLocation, winScanLocation,
comBlankView, comMessage,
winScanLocation, winScanPackAndLocation,
comMessage, recordComDetailCard
winScanPackAndLocation, },
recordComDetailCard data() {
}, return {
data() { id: '',
return { receiptJob: {},
id: '', received: false,
receiptJob: {}, isShowPackingCode: true,
received: false, scanCount: 0,
isShowPackingCode: true, dataContent: {}, //
scanCount: 0, subList: [], //subList
jobContent: {}, // detailSource: [], //
subList: [], //subList locationTypeList: [],
detailSource: [], // businessType: {},
locationTypeList: [], fromLocationCode: "",
toLocationInfo: {}, toLocationCode: "",
businessType: {}, fromlocationTypeList: [],
fromLocationInfo: {}, tolocationTypeList: [],
fromLocationCode: "", managementList: [],
toLocationInfo: {}, toWarehouseCode:''
toLocationCode: "", };
isShowLocation: false, },
fromlocationTypeList: [], onLoad(option) {
tolocationTypeList: [], var typeCode ="CustomerreturnRecord"
allowModifyLocation: false, getBusinessType(typeCode, res => {
inInventoryStatus: "", // if (res.success) {
outInventoryStatus: "", // this.businessType = res.businessType;
fromType :"", this.fromlocationTypeList = res.fromlocationTypeList;
showToLoaction:true this.tolocationTypeList = res.tolocationTypeList;
}; this.showFromLocationPopup();
}, } else {
onLoad(option) { this.showErrorMessage(res.message )
this.fromType = option.fromType }
if(this.fromType=="requestType"){ });
var typeCode = "CustomerreturnRequest" updateTitle("客户退货申请")
this.showToLoaction = false; }else { getBasicCustomerList().then(res => {
var typeCode = "CustomerreturnRecord" if (res.data.length > 0) {
updateTitle("客户退货记录") var list = res.data;
this.showToLoaction = true; } list.forEach(item => {
item.text = item.Name
getBusinessType(typeCode, res => { item.value = item.Code
if (res.success) { })
this.businessType = res.businessType; this.customerList = list;
this.fromlocationTypeList = res.fromlocationTypeList; }
this.tolocationTypeList = res.tolocationTypeList; }).catch(error => {
this.showFromLocationPopup(); this.showErrorMessage(error)
} else { })
this.$refs.comMessage.showBreakMessage(res.message ); },
} //
}); onNavigationBarButtonTap(e) {
if (e.index === 0) {
getBasicCustomerList().then(res => { goHome();
if (res.data.length > 0) { }
var list = res.data; },
list.forEach(item => { //
item.text = item.Name onBackPress(e) {},
item.value = item.Code
}) onPullDownRefresh() {},
this.customerList = list;
} mounted() {
}).catch(error => {
this.showErrorMessage(error) },
}) methods: {
}, getScanResult(result) {
// let balance = result.balance;
onNavigationBarButtonTap(e) { let label = result.label;
if (e.index === 0) { let pack = result.package;
goHome(); var item = this.detailSource.find(res => {
} if (res.itemCode == balance.itemCode) {
}, return res
// }
onBackPress(e) {}, })
if (item == undefined) {
onPullDownRefresh() {}, var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
mounted() { itemp.subList.push(newDetail);
this.detailSource.push(itemp)
}, } else {
methods: { var detail = item.subList.find(r => {
getScanResult(result) { if (r.packingNumber == balance.packingNumber &&
let balance = result.balance; r.batch == balance.batch &&
let label = result.label; r.locationCode == balance.locationCode &&
let pack = result.package; r.inventoryStatus == balance.inventoryStatus) {
var item = this.detailSource.find(res => { return r;
if (res.itemCode == balance.itemCode) { }
return res })
} if (detail == undefined) {
}) let newDetail = createDetailInfo(balance, pack);
if (item == undefined) { item.subList.push(newDetail);
var itemp = createItemInfo(balance, pack); } else {
let newDetail = createDetailInfo(balance, pack); // if (detail.scaned == true) {
itemp.subList.push(newDetail); this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中")
this.detailSource.push(itemp) }
} else { }
var detail = item.subList.find(r => { }
if (r.packingNumber == balance.packingNumber && this.calcHandleQty();
r.batch == balance.batch &&
r.locationCode == balance.locationCode && },
r.inventoryStatus == balance.inventoryStatus) {
return r; showErrorMessage(message) {
} this.$refs.comMessage.showErrorMessage(message, res => {
}) if (res) {
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack); }
item.subList.push(newDetail); });
} else { },
if (detail.scaned == true) { calcHandleQty() {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中") calcHandleQty(this.detailSource)
} this.$forceUpdate();
} },
}
this.calcHandleQty();
updateData() {
}, this.calcHandleQty();
},
showErrorMessage(message) { removeItem(index, item) {
this.$refs.comMessage.showErrorMessage(message, res => { this.detailSource.splice(index, 1)
if (res) { },
removePack() {
} for (var i = 0; i < this.detailSource.length; i++) {
}); var item = this.detailSource[i];
}, if (item.subList.length == 0) {
calcHandleQty() { this.detailSource.splice(i, 1)
calcHandleQty(this.detailSource) }
this.$forceUpdate(); }
}, this.updateData();
},
updateData() { openScanPopup() {
this.calcHandleQty();
}, if (this.fromLocationCode == "") {
removeItem(index, item) { this.showFromLocationPopup();
this.detailSource.splice(index, 1) return
}, }
removePack() { this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
for (var i = 0; i < this.detailSource.length; i++) { },
var item = this.detailSource[i]; showFromLocationPopup() {
if (item.subList.length == 0) { this.$nextTick(() => {
this.detailSource.splice(i, 1) this.$refs.scanLocationCode.openScanPopup();
} })
} },
this.updateData();
}, closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
openScanPopup() { },
if (this.fromLocationCode == "") { scanPopupGetFocus() {
this.showFromLocationPopup(); this.$refs.scanPopup.getfocus();
return },
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); scanLocationCode(location, code) {
}, this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
showFromLocationPopup() { this.toLocationCode = code
this.$nextTick(() => { this.detailSource.forEach(item => {
this.$refs.scanLocationCode.openScanPopup(); item.subList.forEach(detail => {
}) detail.toLocationCode = code
}, })
})
closeScanPopup() { })
this.$refs.scanPopup.closeScanPopup();
}, },
scanPopupGetFocus() { commit() {
this.$refs.scanPopup.getfocus();
}, if (this.toLocationCode == "") {
this.showMessage("请先选择目标库位")
scanLocationCode(location, code) { return;
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => { }
this.toLocationCode = code if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
this.detailSource.forEach(item => { //
item.subList.forEach(detail => { uni.showLoading({
detail.toLocationCode = code title: "提交中....",
}) mask: true
}) });
}) this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
},
getPrecisionStrategyList(precisionStrategParams, res => {
commit() { if (res.success) {
if (this.showToLoaction &&this.toLocationCode == "") { this.managementList = res.list;
this.showMessage("请先选择目标库位") var params = this.setParams()
return; console.log("提交" + JSON.stringify(params))
} customerReturnRecordSubmit(params).then(res => {
uni.hideLoading()
uni.showLoading({ if (res.data) {
title: "提交中....", this.showCommitSuccessMessage("提交成功<br>生成客户退货记录<br>" + res.data)
mask: true } else {
}); this.showErrorMessage("提交失败[" + res.msg + "]")
}
if(this.fromType=="requestType"){ }).catch(error => {
var params = this.setParams(false) uni.hideLoading()
console.log("提交" + JSON.stringify(params)) this.showErrorMessage(error)
// putawayRequestSubmit(params).then(res => { })
// uni.hideLoading()
// if (res.data) { } else {
// this.showCommitSuccessMessage("<br>" + res.data, ) uni.hideLoading();
// } else { this.showErrorMessage(res.message);
// this.showErrorMessage("[" + res.msg + "]") }
// }
// }).catch(error => { })
// uni.hideLoading()
// this.showErrorMessage(error) } else {
// }) this.showErrorMessage("没有要提交的数据,请先扫描")
}else { }
//
var itemCodes = []
this.detailSource.forEach(item => { },
itemCodes.push(item.itemCode)
}) setPrecisionStrategParams() {
// var itemList = []
getManagementPrecisions(itemCodes, this.toLocationCode, res => { this.detailSource.forEach(item => {
if (res.success) { item.subList.forEach(detail => {
this.managementList = res.list; if (detail.scaned) {
var params = this.setParams(true) detail.toLocationCode = this.toLocationCode;
console.log("提交参数", JSON.stringify(params)); var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
// putawayRecordSubmit(params).then(res => { detail.toLocationCode == res.locationCode) {
// uni.hideLoading() return res
// if (res.data) { }
// this.showCommitSuccessMessage("<br>" + res.data, ) })
// } else { //
// this.showErrorMessage("[" + res.msg + "]") if (filterResult.length == 0) {
// } var result = {
// }).catch(error => { itemCode: item.itemCode,
// uni.hideLoading() locationCode: detail.toLocationCode
// this.showErrorMessage(error) }
// }) itemList.push(result)
} else { }
uni.hideLoading();
this.showErrorMessage(res.message); }
} })
}); })
} return itemList;
},
},
setParams() {
setParams(queryModel) {
var subList = [] var subList = []
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
// var subItem = {}; var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
// Object.assign(subItem, detail) detail.packingNumber, detail.toLocationCode, detail.batch);
if (queryModel) { detail.itemCode = detail.itemCode;
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, detail.itemName = detail.package.itemName;
detail.packingNumber, detail.batch); detail.itemDesc1 = detail.package.itemDesc1;
detail.toPackingNumber = info.packingNumber;; detail.itemDesc2 = detail.package.itemDesc2;
detail.toContainerNumber = detail.containerNumber
detail.toBatch = info.batch; detail.inventoryStatus = detail.inventoryStatus;
detail.toInventoryStatus = detail.inventoryStatus detail.toInventoryStatus = detail.inventoryStatus;
detail.toLocationCode = this.toLocationCode
} else { detail.fromPackingNumber = info.packingNumber;
detail.toPackingNumber = detail.packingNumber; detail.toPackingNumber = info.packingNumber;
detail.toContainerNumber = detail.containerNumber
detail.toBatch = detail.toBatch; detail.fromContainerNumber = detail.containerNumber;
detail.toInventoryStatus = detail.inventoryStatus detail.toContainerNumber = detail.containerNumber
detail.toLocationCode = ""
} detail.fromBatch = info.batch;
detail.toBatch = info.batch;
subList.push(detail)
} detail.fromLocationCode = detail.locationCode;
}) detail.toLocationCode = detail.toLocationCode;
})
this.jobContent.subList = subList subList.push(detail)
this.jobContent.creator = creator; }
return this.jobContent; })
}, })
this.dataContent.subList = subList;
this.dataContent.creator = creator;
showMessage(message) { this.dataContent.fromWarehouseCode = this.detailSource[0].subList[0].warehouseCode;
this.$refs.comMessage.showMessage(message, res => { this.dataContent.toWarehouseCode = this.toWarehouseCode;
if (res) {} return this.dataContent;
}); },
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { showMessage(message) {
if (res) { this.$refs.comMessage.showMessage(message, res => {
if (res) {}
} });
}); },
}, showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
showScanMessage(message) { if (res) {
this.$refs.comMessage.showScanMessage(message);
}, }
});
afterCloseMessage() { },
this.scanPopupGetFocus();
}, showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
closeScanMessage() { },
this.scanPopupGetFocus();
}, afterCloseMessage() {
getLocation(location, code) { this.scanPopupGetFocus();
this.getFromLocationCode(location, code) },
},
getFromLocationCode(location, code) { closeScanMessage() {
this.fromLocationInfo = location; this.scanPopupGetFocus();
this.fromLocationCode = code; },
this.openScanPopup(); getLocation(location, code) {
}, this.getFromLocationCode(location, code)
getToLocationCode(location, code) { },
if (this.fromLocationCode == code) { getFromLocationCode(location, code) {
uni.showToast({ this.fromLocationCode = code;
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", this.openScanPopup();
duration: 2000 },
}) getToLocationCode(location, code) {
return this.toLocationCode = code;
} },
this.toLocationCodeInfo = location;
this.toLocationCode = code; showCommitSuccessMessage(hint) {
}, this.$refs.comMessage.showSuccessMessage(hint, res => {
this.fromLocationCode = '';
showCommitSuccessMessage(hint) { this.subList = [];
this.$refs.comMessage.showSuccessMessage(hint, res => { this.detailSource = [];
this.fromLocationCode = ''; this.toLocationCode = '';
this.dataContent = {}
}) this.toWarehouseCode = ""
},
})
updateData() { },
this.calcHandleQty();
for (var i = 0; i < this.detailSource.length; i++) { updateData() {
let item = this.detailSource[i]; this.calcHandleQty();
if (item.qty == 0) { for (var i = 0; i < this.detailSource.length; i++) {
this.detailSource.splice(i, 1) let item = this.detailSource[i];
} if (item.qty == 0) {
} this.detailSource.splice(i, 1)
} }
} }
} }
</script> }
}
<style scoped lang="scss"> </script>
page {
width: 100%; <style scoped lang="scss">
height: 100%; page {
background-color: #fff; width: 100%;
} height: 100%;
background-color: #fff;
.page-wraper { }
display: flex;
flex-direction: column; .page-wraper {
width: 100%; display: flex;
height: 100%; flex-direction: column;
} width: 100%;
height: 100%;
}
.page-main {
flex: 1;
position: relative; .page-main {
} flex: 1;
position: relative;
.page-main-scroll { }
position: absolute;
left: 0; .page-main-scroll {
right: 0; position: absolute;
top: 0; left: 0;
bottom: 0; right: 0;
} top: 0;
bottom: 0;
.page-main-list { }
/* height: 80rpx;
line-height: 80rpx; */ .page-main-list {
text-align: center; /* height: 80rpx;
background: #e0e0e0; line-height: 80rpx; */
text-align: center;
} background: #e0e0e0;
</style>
}
</style>

Loading…
Cancel
Save