lijuncheng 9 months ago
parent
commit
4de079a8ad
  1. 1
      .gitignore
  2. 18
      common/basic.js
  3. 5
      mycomponents/scan/winScanPackAndLocation.vue
  4. 71
      pages/putaway/record/putawayRecord.vue
  5. 2
      static/config.json

1
.gitignore

@ -2,3 +2,4 @@
/node_modules /node_modules
/unpackage /unpackage
/static/config.json

18
common/basic.js

@ -595,13 +595,12 @@ export function getInspectReasonList(value) {
// else return 'Other' // else return 'Other'
// } // }
export function getPackingNumberAndBatchByList(managementList, itemCode, packingNumber,locationCode, batch) { export function getPackingNumberAndBatchByList(managementList, itemCode, packingNumber, locationCode, batch) {
var itemInfo = { var itemInfo = {
packingNumber: "", packingNumber: "",
batch: "" batch: ""
} }
var manageType = queryManageModelByList(managementList, itemCode, locationCode)
var manageType = queryManageModelByList(managementList, itemCode,locationCode)
if (manageType == "BY_QUANTITY") { if (manageType == "BY_QUANTITY") {
itemInfo.packingNumber = "" itemInfo.packingNumber = ""
itemInfo.batch = "" itemInfo.batch = ""
@ -614,19 +613,22 @@ export function getPackingNumberAndBatchByList(managementList, itemCode, packing
} else if (manageType == "BY_UNIQUE_ID") { } else if (manageType == "BY_UNIQUE_ID") {
itemInfo.packingNumber = packingNumber itemInfo.packingNumber = packingNumber
itemInfo.batch = batch itemInfo.batch = batch
} else if (manageType == "") {
itemInfo.packingNumber = packingNumber
itemInfo.batch = batch
} }
return itemInfo; return itemInfo;
} }
export function queryManageModelByList(managementList, itemCode,locationCode) { export function queryManageModelByList(managementList, itemCode, locationCode) {
var result = managementList.filter(res => { var result = managementList.find(res => {
if (res.itemCode == itemCode&&res.locationCode==locationCode) { if (res.itemCode == itemCode && res.locationCode == locationCode) {
return res.ManagementPrecision return res.ManagementPrecision
} }
}) })
if (result != undefined) { if (result != undefined) {
return result[0].ManagementPrecision return result.ManagementPrecision
} else { } else {
return "" return ""
} }
@ -806,7 +808,7 @@ export function getBatch() {
var year = date.getFullYear(); //年 var year = date.getFullYear(); //年
var month = date.getMonth() + 1; //月 var month = date.getMonth() + 1; //月
var day = date.getDate(); //日 var day = date.getDate(); //日
var batch =year.toString()+month.toString()+day.toString() var batch = year.toString() + month.toString() + day.toString()
return batch; return batch;
} }

5
mycomponents/scan/winScanPackAndLocation.vue

@ -21,13 +21,14 @@
<view class="uni-center" style="width: 25%; "> <view class="uni-center" style="width: 25%; ">
来源库位 来源库位
</view> </view>
<view class="" style="width: 75%;padding: 8rpx"> <!-- style="width: 75%;padding: 8rpx" -->
<view class="">
<!-- <input v-model="fromLocationCode" placeholder="请扫描来源库位" :focus="locationOnFocus" <!-- <input v-model="fromLocationCode" placeholder="请扫描来源库位" :focus="locationOnFocus"
placeholder-style="font-size:12px" style="padding: 5px;" @confirm="scanLocation" /> --> placeholder-style="font-size:12px" style="padding: 5px;" @confirm="scanLocation" /> -->
<view v-if='allowModifyLocation'> <view v-if='allowModifyLocation'>
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请扫描来源库位" <uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请扫描来源库位"
@confirm="scanLocation" style='height: 30px;'></uni-combox> @confirm="scanLocation" style='height: 30px;border:1px solid #fff ;'></uni-combox>
</view> </view>
<view v-else> <view v-else>
<text style="padding: 5px"> <text style="padding: 5px">

71
pages/putaway/record/putawayRecord.vue

@ -97,14 +97,14 @@
detailSource: [], // detailSource: [], //
fromLocationInfo: {}, fromLocationInfo: {},
fromLocationCode: "", fromLocationCode: "",
toLocationCode: "",
fromlocationTypeList: [], fromlocationTypeList: [],
tolocationTypeList: [], tolocationTypeList: [],
inInventoryStatus: "", // inInventoryStatus: "", //
outInventoryStatus: "", // outInventoryStatus: "", //
businessType: {}, businessType: {},
showToLoaction: true, showToLoaction: true,
recommendLocationList: [] // recommendLocationList: [], //
fromWarehouseCode: '' //
}; };
}, },
onLoad(option) { onLoad(option) {
@ -143,12 +143,16 @@
return res return res
} }
}) })
if (this.fromWarehouseCode == '') {
this.fromWarehouseCode = balance.warehouseCode;
}
if (item == undefined) { if (item == undefined) {
// //
this.getRecommendLocation(balance, pack, toLocationCode => { this.getRecommendLocation(balance, pack, toLocation => {
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
newDetail.toLocationCode = toLocationCode; newDetail.toLocationCode = toLocation.code;
newDetail.toWarehouseCode = toLocation.warehouseCode;
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
}) })
@ -163,8 +167,12 @@
} }
}) })
if (detail == undefined) { if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack); this.getRecommendLocation(balance, pack, toLocation => {
item.subList.push(newDetail); let newDetail = createDetailInfo(balance, pack);
newDetail.toLocationCode = toLocation.code;
newDetail.toWarehouseCode = toLocation.warehouseCode;
item.subList.push(newDetail);
});
} else { } else {
if (detail.scaned == true) { if (detail.scaned == true) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中") this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中")
@ -190,14 +198,14 @@
itemCode: balance.itemCode, itemCode: balance.itemCode,
locationCode: res.data.code locationCode: res.data.code
}) })
callback(res.data.code); callback(res.data);
}).catch(error => { }).catch(error => {
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
} else { } else {
callback(recommend.locationCode); callback(recommend);
} }
}, },
@ -259,27 +267,25 @@
this.$refs.scanPopup.getfocus(); this.$refs.scanPopup.getfocus();
}, },
scanLocationCode(location, code) { // scanLocationCode(location, code) {
this.toLocationCode = code // this.toLocationCode = code
this.toLocationCode = location; // this.toLocationCode = location;
}, // },
commit() { commit() {
// uni.showLoading({
title: "提交中....",
// uni.showLoading({ mask: true
// title: "....", });
// mask: true
// });
// //
let precisionStrategyParams = getPrecisionStrategyParams(this.detailSource); let precisionStrategyParams = getPrecisionStrategyParams(this.detailSource);
//2: //2:
getPrecisionStrategyList(precisionStrategyParams, this.toLocationCode, res => { getPrecisionStrategyList(precisionStrategyParams, res => {
if (res.success) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;
var params = this.setRecordParams(true) var params = this.setRecordParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
putawayRecordSubmit(params).then(res => { putawayRecordSubmit(params).then(res => {
@ -298,7 +304,6 @@
this.showErrorMessage(res.message); this.showErrorMessage(res.message);
} }
}); });
}, },
@ -333,14 +338,16 @@
return itemList; return itemList;
}, },
setRecordParams(queryModel) { setRecordParams() {
var subList = [] this.dataContent.creator = creator;
this.dataContent.fromWarehouseCode = this.fromWarehouseCode;
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
var subList = []
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch); detail.packingNumber, detail.toLocationCode, detail.batch);
detail.toPackingNumber = info.packingNumber;; detail.toPackingNumber = info.packingNumber;;
detail.toContainerNumber = detail.containerNumber detail.toContainerNumber = detail.containerNumber
detail.toBatch = info.batch; detail.toBatch = info.batch;
@ -351,8 +358,11 @@
} }
}) })
}) })
if (subList.length > 0) {
this.dataContent.toWarehouseCode = subList[0].toWarehouseCode;
}
this.dataContent.subList = subList this.dataContent.subList = subList
this.dataContent.creator = creator; debugger;
return this.dataContent; return this.dataContent;
}, },
@ -401,8 +411,7 @@
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
this.fromLocationCode = ''; this.clear();
}) })
}, },
@ -414,6 +423,14 @@
this.detailSource.splice(i, 1) this.detailSource.splice(i, 1)
} }
} }
},
clear() {
this.fromLocationInfo = {};
this.fromLocationCode = '';
this.fromWarehouseCode = '';
this.toWarehouseCode = '';
this.detailSource = [];
} }
} }
} }

2
static/config.json

@ -18,7 +18,7 @@
"request_url": { "request_url": {
"name": "request_url", "name": "request_url",
"value": "http://dev.ccwin-in.com:25100/api/admin-api", "value": "http://192.168.0.230:12080/admin-api",
"dev2": "http://192.168.0.157:12080/admin-api", "dev2": "http://192.168.0.157:12080/admin-api",
"chefang": "http://192.168.0.180:12080/admin-api", "chefang": "http://192.168.0.180:12080/admin-api",
"chenxinming": "http://192.168.0.230:12080/admin-api", "chenxinming": "http://192.168.0.230:12080/admin-api",

Loading…
Cancel
Save