Browse Source

生产退料提交记录

wms3.0_pda
lijuncheng 11 months ago
parent
commit
3eb2c927f2
  1. 2
      pages/productionReturn/coms/comReturnRecord.vue
  2. 92
      pages/productionReturn/record/returnToHold.vue
  3. 93
      pages/productionReturn/record/returnToStore.vue

2
pages/productionReturn/coms/comReturnRecord.vue

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

92
pages/productionReturn/record/returnToHold.vue

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

93
pages/productionReturn/record/returnToStore.vue

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

Loading…
Cancel
Save