|
@ -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;">  HOLD</text> |
|
|
<text style="font-size: 35rpx;color:#3FBAFF;">  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 = ""; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|