|
|
@ -10,21 +10,21 @@ |
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
|
<view class=""> |
|
|
|
<com-move-record :dataContent="item" :index="index" @removeData="removeData" |
|
|
|
:isShowStatus="isShowStatus" @updateData="updateData" @removePack='removePack' |
|
|
|
:allowEditStatus ="allowEditStatus"> |
|
|
|
:isShowStatus="isShowStatus" @updateData="updateData" @removePack='removePack' |
|
|
|
:allowEditStatus="allowEditStatus"> |
|
|
|
</com-move-record> |
|
|
|
</view> |
|
|
|
<u-line /> |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="page-footer"> |
|
|
|
<view class="uni-flex u-col-center space-between padding_10" |
|
|
|
style="background-color:ghostwhite; width: 100%; "> |
|
|
|
<view class=""> |
|
|
|
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode' |
|
|
|
:locationTypeList="toLocationTypeArray"></requiredLocation> |
|
|
|
:locationTypeList="toLocationTypeArray" :isShowEdit="toLocationCode==''"></requiredLocation> |
|
|
|
</view> |
|
|
|
<view class=" uni-flex uni-row"> |
|
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
|
|
@ -33,7 +33,8 @@ |
|
|
|
</view> |
|
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
|
</view> |
|
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :title="'箱码'"></win-scan-pack-and-location> |
|
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :title="'箱码'"> |
|
|
|
</win-scan-pack-and-location> |
|
|
|
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getLocation' |
|
|
|
:locationTypeList="fromlocationTypeList"></win-scan-location> |
|
|
|
<com-message ref="comMessage"></com-message> |
|
|
@ -56,15 +57,15 @@ |
|
|
|
import { |
|
|
|
getDirectoryItemArray |
|
|
|
} from '@/common/directory.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
getPrecisionStrategyList |
|
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
getPackingNumberAndBatchByList |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
getBusinessType, |
|
|
|
createItemInfo, |
|
|
@ -100,24 +101,27 @@ |
|
|
|
type: Boolean, |
|
|
|
default: false |
|
|
|
}, |
|
|
|
|
|
|
|
businessTypeCode: { |
|
|
|
type: String, |
|
|
|
default: "Move" |
|
|
|
} //业务类型 |
|
|
|
}, //业务类型 |
|
|
|
toLocationCode: { |
|
|
|
type: String, |
|
|
|
default: "" |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
fromLocationCode: "", |
|
|
|
toLocationCode: "", |
|
|
|
// toLocationCode: "", |
|
|
|
toLocationInfo: {}, |
|
|
|
toLocationTypeArray: [], |
|
|
|
toInventoryStatus: "", |
|
|
|
businessType: {}, //业务类型 |
|
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
|
title:"", |
|
|
|
dataContent:{}, |
|
|
|
toWarehouseCode:"", |
|
|
|
title: "", |
|
|
|
dataContent: {}, |
|
|
|
toWarehouseCode: "", |
|
|
|
fromlocationTypeList: [], |
|
|
|
tolocationTypeList: [], |
|
|
|
} |
|
|
@ -143,27 +147,27 @@ |
|
|
|
|
|
|
|
methods: { |
|
|
|
updateTitle() { |
|
|
|
if(this.businessTypeCode=="InventoryMove"){ |
|
|
|
if (this.businessTypeCode == "InventoryMove") { |
|
|
|
this.title = "库存转移记录"; |
|
|
|
this.toInventoryStatus = "OK" |
|
|
|
}else if(this.businessTypeCode=="HoldToOk"){ |
|
|
|
this.title = "隔离转合格记录"; |
|
|
|
this.toInventoryStatus = "OK" |
|
|
|
}else if(this.businessTypeCode=="HoldToScrap"){ |
|
|
|
this.title = "隔离转报废记录"; |
|
|
|
this.toInventoryStatus = "SCRAP" |
|
|
|
}else if(this.businessTypeCode=="OkToHold"){ |
|
|
|
this.title = "合格转隔离记录"; |
|
|
|
this.toInventoryStatus ="HOLD" |
|
|
|
}else if(this.businessTypeCode=="OktoScrap"){ |
|
|
|
this.title = "合格转报废记录"; |
|
|
|
this.toInventoryStatus ="SCRAP" |
|
|
|
}else if(this.businessTypeCode=="ScrapToHold"){ |
|
|
|
this.title = "报废转隔离记录"; |
|
|
|
this.toInventoryStatus ="HOLD" |
|
|
|
this.toInventoryStatus = "OK" |
|
|
|
} else if (this.businessTypeCode == "HoldToOk") { |
|
|
|
this.title = "隔离转合格记录"; |
|
|
|
this.toInventoryStatus = "OK" |
|
|
|
} else if (this.businessTypeCode == "HoldToScrap") { |
|
|
|
this.title = "隔离转报废记录"; |
|
|
|
this.toInventoryStatus = "SCRAP" |
|
|
|
} else if (this.businessTypeCode == "OkToHold") { |
|
|
|
this.title = "合格转隔离记录"; |
|
|
|
this.toInventoryStatus = "HOLD" |
|
|
|
} else if (this.businessTypeCode == "OktoScrap") { |
|
|
|
this.title = "合格转报废记录"; |
|
|
|
this.toInventoryStatus = "SCRAP" |
|
|
|
} else if (this.businessTypeCode == "ScrapToHold") { |
|
|
|
this.title = "报废转隔离记录"; |
|
|
|
this.toInventoryStatus = "HOLD" |
|
|
|
} |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: this.title |
|
|
|
title: this.title |
|
|
|
}) |
|
|
|
}, |
|
|
|
openScanPopup() { |
|
|
@ -203,10 +207,10 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
if (item == undefined) { |
|
|
|
var itemp = createItemInfo(balance,pack); |
|
|
|
var itemp = createItemInfo(balance, pack); |
|
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
|
newDetail.inventoryStatus =balance.inventoryStatus; |
|
|
|
newDetail.toInventoryStatus =this.toInventoryStatus |
|
|
|
newDetail.inventoryStatus = balance.inventoryStatus; |
|
|
|
newDetail.toInventoryStatus = this.toInventoryStatus |
|
|
|
itemp.subList.push(newDetail); |
|
|
|
this.detailSource.push(itemp) |
|
|
|
} else { |
|
|
@ -223,7 +227,7 @@ |
|
|
|
if (detail == undefined) { |
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
newDetail.inventoryStatus = balance.inventoryStatus; |
|
|
|
newDetail.toInventoryStatus =this.toInventoryStatus |
|
|
|
newDetail.toInventoryStatus = this.toInventoryStatus |
|
|
|
item.subList.push(newDetail); |
|
|
|
} else { |
|
|
|
this.showErrorMessage(balance.packingNumber + "已经在列表中") |
|
|
@ -274,7 +278,7 @@ |
|
|
|
this.clearData() |
|
|
|
}) |
|
|
|
}, |
|
|
|
clearData(){ |
|
|
|
clearData() { |
|
|
|
this.fromLocationCode = ''; |
|
|
|
this.subList = []; |
|
|
|
this.detailSource = []; |
|
|
@ -283,7 +287,7 @@ |
|
|
|
this.toWarehouseCode = "" |
|
|
|
}, |
|
|
|
commit() { |
|
|
|
|
|
|
|
|
|
|
|
if (this.toLocationCode == "") { |
|
|
|
this.showMessage("请先选择目标库位") |
|
|
|
return; |
|
|
@ -296,37 +300,38 @@ |
|
|
|
}); |
|
|
|
this.managementList = []; |
|
|
|
var precisionStrategParams = this.setPrecisionStrategParams() |
|
|
|
|
|
|
|
|
|
|
|
getPrecisionStrategyList(precisionStrategParams, res => { |
|
|
|
if (res.success) { |
|
|
|
this.managementList = res.list; |
|
|
|
var params = this.setParams() |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
inventoryMoveRecordSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
this.showCommitSuccessMessage("提交成功<br>生成"+this.title+"记录<br>" + res.data) |
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
|
|
|
|
inventoryMoveRecordSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
this.showCommitSuccessMessage("提交成功<br>生成" + this.title + "记录<br>" + |
|
|
|
res.data) |
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
uni.hideLoading(); |
|
|
|
this.showErrorMessage(res.message); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
this.showErrorMessage("没有要提交的数据,请先扫描") |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setPrecisionStrategParams() { |
|
|
|
var itemList = [] |
|
|
|
this.detailSource.forEach(item => { |
|
|
@ -347,14 +352,14 @@ |
|
|
|
} |
|
|
|
itemList.push(result) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
return itemList; |
|
|
|
}, |
|
|
|
setParams() { |
|
|
|
|
|
|
|
|
|
|
|
var subList = [] |
|
|
|
var creator = this.$store.state.user.id |
|
|
|
this.detailSource.forEach(item => { |
|
|
@ -366,22 +371,22 @@ |
|
|
|
detail.itemName = detail.package.itemName; |
|
|
|
detail.itemDesc1 = detail.package.itemDesc1; |
|
|
|
detail.itemDesc2 = detail.package.itemDesc2; |
|
|
|
|
|
|
|
|
|
|
|
detail.fromInventoryStatus = detail.inventoryStatus; |
|
|
|
// detail.toInventoryStatus = this.toInventoryStatus; |
|
|
|
|
|
|
|
|
|
|
|
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) |
|
|
|
} |
|
|
|
}) |
|
|
@ -393,11 +398,11 @@ |
|
|
|
this.dataContent.businessType = this.businessTypeCode; |
|
|
|
return this.dataContent; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|