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. 190
      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 {

190
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 )
} }
}); });
@ -266,94 +250,116 @@
}, },
commit() { commit() {
if (this.showToLoaction &&this.toLocationCode == "") {
if (this.toLocationCode == "") {
this.showMessage("请先选择目标库位") this.showMessage("请先选择目标库位")
return; 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()
if(this.fromType=="requestType"){ getPrecisionStrategyList(precisionStrategParams, res => {
var params = this.setParams(false)
console.log("提交" + JSON.stringify(params))
// 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) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;
var params = this.setParams(true) var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交" + JSON.stringify(params))
customerReturnRecordSubmit(params).then(res => {
// putawayRecordSubmit(params).then(res => { uni.hideLoading()
// uni.hideLoading() if (res.data) {
// if (res.data) { this.showCommitSuccessMessage("提交成功<br>生成客户退货记录<br>" + res.data)
// this.showCommitSuccessMessage("<br>" + res.data, ) } else {
// } else { this.showErrorMessage("提交失败[" + res.msg + "]")
// this.showErrorMessage("[" + res.msg + "]") }
// } }).catch(error => {
// }).catch(error => { uni.hideLoading()
// uni.hideLoading() this.showErrorMessage(error)
// this.showErrorMessage(error) })
// })
} else { } else {
uni.hideLoading(); uni.hideLoading();
this.showErrorMessage(res.message); this.showErrorMessage(res.message);
} }
});
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
},
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)
} }
}
})
})
return itemList;
}, },
setParams(queryModel) { setParams() {
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.inventoryStatus = detail.inventoryStatus;
detail.toInventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = info.packingNumber;
detail.toPackingNumber = info.packingNumber;
detail.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber detail.toContainerNumber = detail.containerNumber
detail.fromBatch = info.batch;
detail.toBatch = info.batch; detail.toBatch = info.batch;
detail.toInventoryStatus = detail.inventoryStatus
detail.toLocationCode = this.toLocationCode detail.fromLocationCode = detail.locationCode;
} else { detail.toLocationCode = detail.toLocationCode;
detail.toPackingNumber = detail.packingNumber;
detail.toContainerNumber = detail.containerNumber
detail.toBatch = detail.toBatch;
detail.toInventoryStatus = detail.inventoryStatus
detail.toLocationCode = ""
}
subList.push(detail) subList.push(detail)
} }
}) })
}) })
this.jobContent.subList = subList this.dataContent.subList = subList;
this.jobContent.creator = creator; this.dataContent.creator = creator;
return this.jobContent; this.dataContent.fromWarehouseCode = this.detailSource[0].subList[0].warehouseCode;
this.dataContent.toWarehouseCode = this.toWarehouseCode;
return this.dataContent;
}, },
@ -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