Browse Source

发货记录

wms3.0_pda
lijuncheng 11 months ago
parent
commit
4d6a96de15
  1. 4
      api/request2.js
  2. 4
      mycomponents/record/recordComDetailCard.vue
  3. 26
      pages/customerReturn/record/returnRecord.vue
  4. 218
      pages/deliver/record/deliverRecord.vue
  5. 1
      pages/unPlanned/record/issueRecord.vue
  6. 3
      store/modules/user.js

4
api/request2.js

@ -1886,8 +1886,8 @@ export function deliverRequestSubmit(params) {
*/
export function deliverRecordSubmit(params) {
return request({
url: baseApi + "/wms/purchasereturn-request-main/submit",
method: "put",
url: baseApi + "/wms/deliver-record-main/create",
method: "post",
data: params,
});
}

4
mycomponents/record/recordComDetailCard.vue

@ -43,7 +43,7 @@
import {
getDetailOption,
getDetailRemoveOption,
getDetailEditRemoveOption,
getClearOption
} from '@/common/array.js';
export default {
@ -113,7 +113,7 @@
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getDetailRemoveOption();
this.scanOptions = getDetailEditRemoveOption();
this.removeOptions = getClearOption();
},

26
pages/customerReturn/record/returnRecord.vue

@ -8,9 +8,8 @@
<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"
:isShowLocation="true" @removeItem="removeItem(index,item)" @updateData="updateData"
@removePack="removePack">
<record-com-detail-card :dataContent="item" :index="index" :isShowLocation="true"
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack">
</record-com-detail-card>
</view>
</view>
@ -32,7 +31,8 @@
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</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' 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>
@ -106,11 +106,11 @@
fromlocationTypeList: [],
tolocationTypeList: [],
managementList: [],
toWarehouseCode:''
toWarehouseCode: '',
};
},
onLoad(option) {
var typeCode ="CustomerreturnRecord"
var typeCode = "CustomerreturnRecord"
getBusinessType(typeCode, res => {
if (res.success) {
this.businessType = res.businessType;
@ -118,22 +118,10 @@
this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup();
} else {
this.showErrorMessage(res.message )
this.showErrorMessage(res.message)
}
});
getBasicCustomerList().then(res => {
if (res.data.length > 0) {
var list = res.data;
list.forEach(item => {
item.text = item.Name
item.value = item.Code
})
this.customerList = list;
}
}).catch(error => {
this.showErrorMessage(error)
})
},
//
onNavigationBarButtonTap(e) {

218
pages/deliver/record/deliverRecord.vue

@ -1,7 +1,7 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='getLocation' v-if="detailSource.length==0"></com-blank-view>
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class="page-main">
@ -24,7 +24,8 @@
</view>
<uni-data-picker v-if="detailSource.length>0" style="padding: 20rpx; background-color:#fff;"
class='uni-data-picker' placeholder="请选择客户" popup-title="选择客户" :localdata="customerList"
v-model="customer">
@change="reasonChange">
</uni-data-picker>
</view>
@ -32,7 +33,7 @@
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<requiredLocation v-if="showToLoaction" ref='comScanLocation' title="目标库位" :locationCode="toLocationCode"
<requiredLocation ref='comScanLocation' title="目标库位" :locationCode="toLocationCode"
@getLocation='scanLocationCode' :isShowEdit="true"
:locationTypeList="tolocationTypeList"></requiredLocation>
</view>
@ -44,7 +45,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="HMQ"></win-scan-pack-and-location>
<comMessage ref="comMessage"></comMessage>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationTypeList="fromlocationTypeList"></win-scan-location>
@ -55,12 +56,11 @@
<script>
import {
getBasicCustomerList,
deliverRequestSubmit,
deliverRecordSubmit
} from '@/api/request2.js';
import {
goHome,
updateTitle
getPackingNumberAndBatchByList
} from '@/common/basic.js';
import {
@ -68,6 +68,10 @@
getDirectoryItemArray
} from '@/common/directory.js';
import {
getPrecisionStrategyList
} from '@/common/balance.js';
import {
getBusinessType,
createItemInfo,
@ -100,34 +104,24 @@
data() {
return {
id: '',
receiptJob: {},
received: false,
isShowPackingCode: true,
scanCount: 0,
subList: [], //subList
detailSource: [], //
locationTypeList: [],
businessTypeInfo: {},
fromLocationInfo: {},
fromLocationCode: "",
toLocationCode: "",
isShowLocation: false,
fromlocationTypeList: [],
tolocationTypeList: [],
allowModifyLocation: false,
businessType: {},
customerList: [],
customer: "",
fromType: "",
showToLoaction: true,
dataContent:{}
customerText: "",
customerCode : "",
dataContent:{},
managementList:[]
};
},
onLoad(option) {
this.fromType = option.fromType
this.updateTitle();
var typeCode = "DeliverRequest"
var typeCode = "DeliverRecord"
getBusinessType(typeCode, res => {
if (res.success) {
this.businessType = res.businessType;
@ -135,7 +129,7 @@
this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup();
} else {
this.$refs.comMessage.showBreakMessage(res.message);
this.showErrorMessage(res.message)
}
});
@ -165,17 +159,6 @@
mounted() {},
methods: {
updateTitle() {
if (this.fromType == "requestType") {
this.showToLoaction = false
updateTitle("制品发货申请")
} else {
this.showToLoaction = true
updateTitle("制品发货记录")
}
},
getScanResult(result) {
let balance = result.balance;
let label = result.label;
@ -187,9 +170,8 @@
return res
}
})
var qty =labelQty>balanceQty?balanceQty:labelQty
if (item == undefined) {
var itemp = createItemInfo(qty, pack);
var itemp = createItemInfo(balance.qty, pack);
let newDetail = createDetailInfo(balance, pack); //
if(labelQty)
itemp.subList.push(newDetail);
@ -289,108 +271,118 @@
},
commit() {
if (this.customer == "") {
if (this.customerText == "") {
this.showMessage("请先选择客户")
return;
}
console.log("客户", this.customer)
if (this.toLocationCode == ""&&this.showToLoaction) {
console.log("客户", this.customerText)
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.setRequestParams();
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
// deliverRequestSubmit(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)
// })
deliverRecordSubmit(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 {
// deliverRecordSubmit(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)
// })
uni.hideLoading();
this.showErrorMessage(res.message);
}
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
setPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toPackingNumber = detail.packingNumber;
detail.toContainerNumber = detail.containerNumber
detail.toBatch = detail.toBatch;
detail.toInventoryStatus = detail.inventoryStatus
detail.toLocationCode = ""
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)
}
subList.push(detail)
}
})
})
this.dataContent.subList = subList
this.dataContent.creator = creator;
return this.dataContent;
return itemList;
},
setRequestParams(){
setParams() {
var subList = []
var supplierCode=""
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.soNumber =detail.package.soNumber;
detail.soLine = detail.soLine.soNumber;
// soNumber: 926926926,
// soLine: 926,
// itemCode: THILDD0A691AG,
// remark: ,
// qty: 2,
// uom: EA
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.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.deliverPlanNumber = "DP20231130-0001"
this.dataContent.customerCode = "CF"
this.dataContent.customerDockCode = ""
this.dataContent.carrierCode = ""
this.dataContent.transferMode = ""
this.dataContent.vehiclePlateNumber = ""
this.dataContent.remark = ""
this.dataContent.dueTime = ""
this.dataContent.departmentCode = "研发部门"
this.dataContent.status = 1
this.dataContent.autoCommit = "FALSE"
this.dataContent.autoAgree = "FALSE"
this.dataContent.autoExecute = "FALSE"
this.dataContent.directCreateRecord = "FALSE"
this.dataContent.subList = subList;
this.dataContent.creator = creator;
this.dataContent.customerCode =this.customerCode;
this.dataContent.fromWarehouseCode = this.detailSource[0].subList[0].warehouseCode;
this.dataContent.toWarehouseCode = this.toWarehouseCode;
return this.dataContent;
},
@ -422,24 +414,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.toLocationCode = code;
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.fromLocationCode = '';
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {}
this.toWarehouseCode = ""
})
},
@ -452,7 +441,16 @@
this.detailSource.splice(i, 1)
}
}
},
reasonChange(e) {
if (e.detail.value.length == 0) {
this.customerCode = ""
this.customerText = ""
} else {
this.customerCode = e.detail.value[0].value
this.customerText = e.detail.value[0].text
}
},
}
}
</script>

1
pages/unPlanned/record/issueRecord.vue

@ -159,6 +159,7 @@
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
newDetail.inventoryStatus ="OK";
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {

3
store/modules/user.js

@ -10,7 +10,7 @@ import {
const user = {
state: {
id: 0, // 用户编号
id: storage.getStorage(storage.constant.id), // 用户编号
name: storage.getStorage(storage.constant.name),
avatar: storage.getStorage(storage.constant.avatar),
roles: storage.getStorage(storage.constant.roles),
@ -20,6 +20,7 @@ const user = {
mutations: {
SET_ID: (state, id) => {
state.id = id
storage.setStorage(storage.constant.id, id)
},
SET_NAME: (state, name) => {
state.name = name

Loading…
Cancel
Save