Browse Source

生产退料提交记录

wms3.0_pda
lijuncheng 9 months ago
parent
commit
3eb2c927f2
  1. 2
      pages/productionReturn/coms/comReturnRecord.vue
  2. 130
      pages/productionReturn/record/returnToHold.vue
  3. 113
      pages/productionReturn/record/returnToStore.vue

2
pages/productionReturn/coms/comReturnRecord.vue

@ -17,7 +17,7 @@
<uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions">
<balance :dataContent="item" :isShowStdPack="false" :isShowStatus="true" :isShowPack="true"
:isShowLocation="false" :isShowToLocation="isShowToLocation"></balance>
:isShowLocation="true" :isShowToLocation="isShowToLocation"></balance>
<!-- <production-label :dataContent="item" :packageContent="item.package"
:isShowLocation="false">
</production-label> -->

130
pages/productionReturn/record/returnToHold.vue

@ -28,12 +28,12 @@
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<view class="">
<view class="uni-flex uni-row u-col-center" @click="showLocation">
<view class="uni-flex uni-row u-col-center" @click="">
<view>
目标库位
<text style="font-size: 35rpx;color:#3FBAFF;">&nbsp HOLD</text>
</view>
<image v-if="isShowEdit" style="width:45rpx;height: 45rpx;"
<image v-if="false" style="width:45rpx;height: 45rpx;"
src="/static/icons/icons_edit.svg"></image>
</view>
</view>
@ -53,6 +53,7 @@
<script>
import {
productionReturnRecordSubmit,
getPrecisionStrategy
} from '@/api/request2.js';
import {
@ -68,7 +69,6 @@
getBusinessType,
} from '@/common/record.js';
import {
getPrecisionStrategyList,
getPrecisionStrategyParams
} from '@/common/balance.js';
@ -182,6 +182,8 @@
var itemp = this.createItemInfo(label, pack);
let newDetail = this.createDetailInfo(label, pack);
newDetail.toLocationCode = "HOLD";
newDetail.locationCode = this.rawLocationCode;
newDetail.fromLocationCode = this.rawLocationCode;
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
@ -196,6 +198,8 @@
if (detail == undefined) {
let newDetail = this.createDetailInfo(label, pack);
newDetail.toLocationCode = "HOLD";
newDetail.locationCode = this.rawLocationCode;
newDetail.fromLocationCode = this.rawLocationCode;
item.subList.push(newDetail);
} else {
@ -225,7 +229,7 @@
Object.assign(detail, label)
detail.scaned = true;
detail.qty = Number(label.qty);
detail.inventoryStatus = "HOLD"
detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit;
detail.batch = pack.batch;
@ -277,7 +281,7 @@
}
},
commit() {
async commit() {
if (this.positionInfo == "请选择位置") {
this.showMessage("请先选择位置")
return;
@ -289,46 +293,77 @@
title: "提交中....",
mask: true
});
this.managementList = [];
var precisionStrategParams = getPrecisionStrategyParams(this.detailSource)
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
productionReturnRecordSubmit(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)
})
this.fromManagementList = [];
this.toManagementList = [];
var fromPrecisionStrategParams = this.setFromPrecisionStrategParams(this.detailSource)
var toPrecisionStrategParams = this.setToPrecisionStrategParams(this.detailSource);
var fromManagement = await getPrecisionStrategy(fromPrecisionStrategParams);
this.fromManagementList = fromManagement.data;
if (this.fromManagementList.length == 0) {
this.showErrorMessage("查询来源库位管理模式异常")
return;
}
var toManagement = await getPrecisionStrategy(toPrecisionStrategParams);
this.toManagementList = toManagement.data;
if (this.toManagementList.length == 0) {
this.showErrorMessage("查询目标库位管理模式异常")
return;
}
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
productionReturnRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成退料记录<br>" + res.data)
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
},
setPrecisionStrategParams() {
setFromPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
detail.fromLocationCode == res.fromLocationCode) {
return res
}
})
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.fromLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
},
setToPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
detail.toLocationCode == res.locationCode) {
detail.toLocationCode == res.toLocationCode) {
return res
}
})
@ -340,7 +375,7 @@
}
itemList.push(result)
}
}
})
})
@ -353,27 +388,30 @@
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
var fromInfo = getPackingNumberAndBatchByList(this.fromManagementList, detail.itemCode,
detail.packingNumber, detail.fromLocationCode, detail.batch);
var toInfo = getPackingNumberAndBatchByList(this.fromManagementList, 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.fromPackingNumber = fromInfo.packingNumber;
detail.toPackingNumber = toInfo.packingNumber;
detail.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber
detail.fromBatch = info.batch;
detail.toBatch = info.batch;
detail.fromLocationCode = detail.locationCode;
detail.fromBatch = fromInfo.batch;
detail.toBatch = toInfo.batch;
detail.fromLocationCode = detail.fromLocationCode;
detail.toLocationCode = detail.toLocationCode;
detail.productionlineCode = this.productionLineCode;
detail.workStationCode = this.workStationCode;
@ -438,6 +476,10 @@
this.toLocationCode = '';
this.dataContent = {};
this.positionInfo = "请选择位置";
this.workshopCode = "";
this.productionLineCode = "";
this.workStationCode = "";
this.rawLocationCode = "";
}
}
}

113
pages/productionReturn/record/returnToStore.vue

@ -43,7 +43,8 @@
<script>
import {
productionReturnRecordSubmit,
getPutawayRecommendLocation
getPutawayRecommendLocation,
getPrecisionStrategy
} from '@/api/request2.js';
import {
@ -115,7 +116,9 @@
businessTypeCode: "ReturnToStore",
positionInfo: "",
recommendLocationList: [], //
fromWarehouseCode: '' //
fromWarehouseCode: '', //
fromManagementList: [],
toManagementList: []
};
},
@ -160,7 +163,6 @@
this.productionLineCode = param.productionLineCode;
this.workStationCode = param.workStationCode;
this.rawLocationCode = param.rawLocationCode;
debugger;
let label = result.label;
let pack = result.package;
@ -178,6 +180,7 @@
var itemp = this.createItemInfo(label, pack);
let newDetail = this.createDetailInfo(label, pack);
newDetail.toLocationCode = toLocation.code;
newDetail.fromLocationCode = this.rawLocationCode;
newDetail.toWarehouseCode = toLocation.warehouseCode;
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
@ -195,6 +198,7 @@
this.getRecommendLocation(label, pack, toLocation => {
let newDetail = this.createDetailInfo(label, pack);
newDetail.toLocationCode = toLocation.code;
newDetail.fromLocationCode = this.rawLocationCode;
newDetail.toWarehouseCode = toLocation.warehouseCode;
item.subList.push(newDetail);
});
@ -304,7 +308,7 @@
}
},
commit() {
async commit() {
if (this.positionInfo == "请选择位置") {
this.showMessage("请先选择位置")
return;
@ -316,31 +320,37 @@
title: "提交中....",
mask: true
});
this.managementList = [];
var precisionStrategParams = getPrecisionStrategyParams(this.detailSource)
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
productionReturnRecordSubmit(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)
})
this.fromManagementList = [];
this.toManagementList = [];
var fromPrecisionStrategParams = this.setFromPrecisionStrategParams(this.detailSource)
var toPrecisionStrategParams = this.setToPrecisionStrategParams(this.detailSource);
var fromManagement =await getPrecisionStrategy(fromPrecisionStrategParams);
this.fromManagementList =fromManagement.data ;
if (this.fromManagementList.length == 0) {
this.showErrorMessage("查询来源库位管理模式异常")
return;
}
var toManagement =await getPrecisionStrategy(toPrecisionStrategParams);
this.toManagementList =toManagement.data ;
if (this.toManagementList.length == 0) {
this.showErrorMessage("查询目标库位管理模式异常")
return;
}
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
productionReturnRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成退料记录<br>" + res.data)
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
@ -348,14 +358,40 @@
},
setPrecisionStrategParams() {
setFromPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
detail.fromLocationCode == res.fromLocationCode) {
return res
}
})
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.fromLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
},
setToPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
detail.toLocationCode == res.locationCode) {
detail.toLocationCode == res.toLocationCode) {
return res
}
})
@ -381,7 +417,10 @@
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
var fromInfo = getPackingNumberAndBatchByList(this.fromManagementList, detail.itemCode,
detail.packingNumber, detail.fromLocationCode, detail.batch);
var toInfo = getPackingNumberAndBatchByList(this.fromManagementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch);
detail.itemCode = detail.itemCode;
detail.itemName = detail.package.itemName;
@ -390,22 +429,21 @@
detail.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = info.packingNumber;
detail.toPackingNumber = info.packingNumber;
detail.fromPackingNumber = fromInfo.packingNumber;
detail.toPackingNumber = toInfo.packingNumber;
detail.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber
detail.fromBatch = info.batch;
detail.toBatch = info.batch;
detail.fromBatch = fromInfo.batch;
detail.toBatch = toInfo.batch;
detail.fromLocationCode = detail.locationCode;
detail.fromLocationCode = detail.fromLocationCode;
detail.toLocationCode = detail.toLocationCode;
detail.productionlineCode = this.productionLineCode;
detail.workStationCode = this.workStationCode;
subList.push(detail)
}
})
@ -465,6 +503,11 @@
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {};
this.positionInfo = "请选择位置";
this.workshopCode = "";
this.productionLineCode = "";
this.workStationCode = "";
this.rawLocationCode = "";
}
}
}

Loading…
Cancel
Save