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) {
return request({
url: baseApi + "/wms/purchasereturn-request-main/submit",
method: "put",
url: baseApi + "/wms/customerreturn-record-main/create",
method: "post",
data: params,
});
}

3
mycomponents/scan/winComScan.vue

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

2
mycomponents/scan/winScanLocation.vue

@ -12,7 +12,7 @@
</view>
<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">
</win-com-scan>
</view>

6
mycomponents/scan/winScanPackAndLocation.vue

@ -40,7 +40,7 @@
<view class="">
<view class="">
<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>
@ -95,6 +95,10 @@
type: Boolean,
default: true
},
headerType: {
type: String,
default: "HPQ"
},
},
data() {
return {

190
pages/customerReturn/record/returnRecord.vue

@ -8,7 +8,7 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<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"
@removePack="removePack">
</record-com-detail-card>
@ -17,13 +17,12 @@
</scroll-view>
</view>
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation>
</view>
<view class=" uni-flex uni-row">
<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>
</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>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationTypeList="fromlocationTypeList"></win-scan-location>
@ -44,7 +43,6 @@
<script>
import {
getBasicCustomerList,
customerReturnRequestSubmit,
customerReturnRecordSubmit
} from '@/api/request2.js';
import {
@ -53,12 +51,12 @@
} from '@/common/directory.js';
import {
getManagementPrecisions
getPrecisionStrategyList
} from '@/common/balance.js';
import {
goHome,
updateTitle,
getPackingNumberAndBatch
getPackingNumberAndBatchByList
} from '@/common/basic.js';
import {
@ -98,35 +96,21 @@
received: false,
isShowPackingCode: true,
scanCount: 0,
jobContent: {}, //
dataContent: {}, //
subList: [], //subList
detailSource: [], //
locationTypeList: [],
toLocationInfo: {},
businessType: {},
fromLocationInfo: {},
fromLocationCode: "",
toLocationInfo: {},
toLocationCode: "",
isShowLocation: false,
fromlocationTypeList: [],
tolocationTypeList: [],
allowModifyLocation: false,
inInventoryStatus: "", //
outInventoryStatus: "", //
fromType :"",
showToLoaction:true
managementList: [],
toWarehouseCode:''
};
},
onLoad(option) {
this.fromType = option.fromType
if(this.fromType=="requestType"){
var typeCode = "CustomerreturnRequest" updateTitle("客户退货申请")
this.showToLoaction = false; }else {
var typeCode = "CustomerreturnRecord"
updateTitle("客户退货记录")
this.showToLoaction = true; }
var typeCode ="CustomerreturnRecord"
getBusinessType(typeCode, res => {
if (res.success) {
this.businessType = res.businessType;
@ -134,7 +118,7 @@
this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup();
} else {
this.$refs.comMessage.showBreakMessage(res.message );
this.showErrorMessage(res.message )
}
});
@ -266,94 +250,116 @@
},
commit() {
if (this.showToLoaction &&this.toLocationCode == "") {
if (this.toLocationCode == "") {
this.showMessage("请先选择目标库位")
return;
}
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
//
uni.showLoading({
title: "提交中....",
mask: true
});
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
if(this.fromType=="requestType"){
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 => {
getPrecisionStrategyList(precisionStrategParams, 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)
// })
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)
})
} else {
uni.hideLoading();
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 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;;
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.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 = ""
}
detail.fromLocationCode = detail.locationCode;
detail.toLocationCode = detail.toLocationCode;
subList.push(detail)
}
})
})
this.jobContent.subList = subList
this.jobContent.creator = creator;
return this.jobContent;
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;
},
@ -385,25 +391,21 @@
this.getFromLocationCode(location, code)
},
getFromLocationCode(location, code) {
this.fromLocationInfo = location;
this.fromLocationCode = code;
this.openScanPopup();
},
getToLocationCode(location, code) {
if (this.fromLocationCode == code) {
uni.showToast({
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致",
duration: 2000
})
return
}
this.toLocationCodeInfo = location;
this.toLocationCode = code;
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.fromLocationCode = '';
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {}
this.toWarehouseCode = ""
})
},

Loading…
Cancel
Save