Browse Source

客户退货记录

wms3.0_pda
lijuncheng 12 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. 232
      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 {

232
pages/customerReturn/record/returnRecord.vue

@ -8,7 +8,7 @@
<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>
@ -17,13 +17,12 @@
</scroll-view> </scroll-view>
</view> </view>
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation>
<view class="page-footer"> <view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation>
</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>
@ -33,7 +32,7 @@
<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'></win-scan-pack-and-location> <win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' headerType="HPQ,HMQ"></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>
@ -44,7 +43,6 @@
<script> <script>
import { import {
getBasicCustomerList, getBasicCustomerList,
customerReturnRequestSubmit,
customerReturnRecordSubmit customerReturnRecordSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -53,12 +51,12 @@
} from '@/common/directory.js'; } from '@/common/directory.js';
import { import {
getManagementPrecisions getPrecisionStrategyList
} from '@/common/balance.js'; } from '@/common/balance.js';
import { import {
goHome, goHome,
updateTitle, updateTitle,
getPackingNumberAndBatch getPackingNumberAndBatchByList
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -98,35 +96,21 @@
received: false, received: false,
isShowPackingCode: true, isShowPackingCode: true,
scanCount: 0, scanCount: 0,
jobContent: {}, // dataContent: {}, //
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
locationTypeList: [], locationTypeList: [],
toLocationInfo: {},
businessType: {}, businessType: {},
fromLocationInfo: {},
fromLocationCode: "", fromLocationCode: "",
toLocationInfo: {},
toLocationCode: "", toLocationCode: "",
isShowLocation: false,
fromlocationTypeList: [], fromlocationTypeList: [],
tolocationTypeList: [], tolocationTypeList: [],
allowModifyLocation: false, managementList: [],
inInventoryStatus: "", // toWarehouseCode:''
outInventoryStatus: "", //
fromType :"",
showToLoaction:true
}; };
}, },
onLoad(option) { onLoad(option) {
this.fromType = option.fromType var typeCode ="CustomerreturnRecord"
if(this.fromType=="requestType"){
var typeCode = "CustomerreturnRequest" updateTitle("客户退货申请")
this.showToLoaction = false; }else {
var typeCode = "CustomerreturnRecord"
updateTitle("客户退货记录")
this.showToLoaction = true; }
getBusinessType(typeCode, res => { getBusinessType(typeCode, res => {
if (res.success) { if (res.success) {
this.businessType = res.businessType; this.businessType = res.businessType;
@ -134,7 +118,7 @@
this.tolocationTypeList = res.tolocationTypeList; this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup(); this.showFromLocationPopup();
} else { } else {
this.$refs.comMessage.showBreakMessage(res.message ); this.showErrorMessage(res.message )
} }
}); });
@ -265,96 +249,118 @@
}, },
commit() { commit() {
if (this.showToLoaction &&this.toLocationCode == "") {
this.showMessage("请先选择目标库位")
return;
}
if (this.toLocationCode == "") {
this.showMessage("请先选择目标库位")
return;
}
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
//
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
customerReturnRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成客户退货记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
if(this.fromType=="requestType"){ } else {
var params = this.setParams(false) uni.hideLoading();
console.log("提交" + JSON.stringify(params)) this.showErrorMessage(res.message);
// putawayRequestSubmit(params).then(res => { }
// uni.hideLoading()
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, )
// } else {
// this.showErrorMessage("[" + res.msg + "]")
// }
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
}else {
//
var itemCodes = []
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
})
//
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams(true)
console.log("提交参数", JSON.stringify(params));
// putawayRecordSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, )
// } else {
// this.showErrorMessage("[" + res.msg + "]")
// }
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
}
}, })
setParams(queryModel) { } else {
var subList = [] this.showErrorMessage("没有要提交的数据,请先扫描")
var creator = this.$store.state.user.id }
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) { },
// var subItem = {};
// Object.assign(subItem, detail)
if (queryModel) {
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch);
detail.toPackingNumber = info.packingNumber;;
detail.toContainerNumber = detail.containerNumber
detail.toBatch = info.batch;
detail.toInventoryStatus = detail.inventoryStatus
detail.toLocationCode = this.toLocationCode
} else {
detail.toPackingNumber = detail.packingNumber;
detail.toContainerNumber = detail.containerNumber
detail.toBatch = detail.toBatch;
detail.toInventoryStatus = detail.inventoryStatus
detail.toLocationCode = ""
}
subList.push(detail) setPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = this.toLocationCode;
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
detail.toLocationCode == res.locationCode) {
return res
}
})
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
} }
})
}
}) })
this.jobContent.subList = subList })
this.jobContent.creator = creator; return itemList;
return this.jobContent; },
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch);
detail.itemCode = detail.itemCode;
detail.itemName = detail.package.itemName;
detail.itemDesc1 = detail.package.itemDesc1;
detail.itemDesc2 = detail.package.itemDesc2;
detail.inventoryStatus = detail.inventoryStatus;
detail.toInventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = info.packingNumber;
detail.toPackingNumber = info.packingNumber;
detail.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber
detail.fromBatch = info.batch;
detail.toBatch = info.batch;
detail.fromLocationCode = detail.locationCode;
detail.toLocationCode = detail.toLocationCode;
subList.push(detail)
}
})
})
this.dataContent.subList = subList;
this.dataContent.creator = creator;
this.dataContent.fromWarehouseCode = this.detailSource[0].subList[0].warehouseCode;
this.dataContent.toWarehouseCode = this.toWarehouseCode;
return this.dataContent;
},
showMessage(message) { showMessage(message) {
@ -385,25 +391,21 @@
this.getFromLocationCode(location, code) this.getFromLocationCode(location, code)
}, },
getFromLocationCode(location, code) { getFromLocationCode(location, code) {
this.fromLocationInfo = location;
this.fromLocationCode = code; this.fromLocationCode = code;
this.openScanPopup(); this.openScanPopup();
}, },
getToLocationCode(location, code) { getToLocationCode(location, code) {
if (this.fromLocationCode == code) {
uni.showToast({
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致",
duration: 2000
})
return
}
this.toLocationCodeInfo = location;
this.toLocationCode = code; this.toLocationCode = code;
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
this.fromLocationCode = ''; this.fromLocationCode = '';
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {}
this.toWarehouseCode = ""
}) })
}, },

Loading…
Cancel
Save