|
|
@ -7,11 +7,17 @@ |
|
|
|
<view class="page-main"> |
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
|
<uni-data-picker style="padding: 20rpx; background-color:#fff;" class='uni-data-picker' |
|
|
|
placeholder="请选择出库原因" popup-title="出库原因" :localdata="reasonList" @change="reasonChange"> |
|
|
|
placeholder="请选择出库原因" popup-title="出库原因" :localdata="reasonList" @change="reasonChange"> |
|
|
|
</uni-data-picker> |
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
|
<view class=""> |
|
|
|
<record-com-detail-card :dataContent="item" :index="index" |
|
|
|
<record-com-detail-card-batch :dataContent="item" :index="index" :isShowFromLocation="false" |
|
|
|
:isShowParentToLocation="false" |
|
|
|
@removeItem="removeItem(index,item)" :isShowToLocation="false" @updateData="updateData" |
|
|
|
@removePack="removePack" |
|
|
|
v-if="managementType == 'BY_BATCH'||managementType =='BY_QUANTITY' "> |
|
|
|
</record-com-detail-card-batch> |
|
|
|
<record-com-detail-card v-else :dataContent="item" :index="index" |
|
|
|
@removeItem="removeItem(index,item)" @updateData="updateData" :isShowLocation="true" |
|
|
|
@removePack="removePack" :isShowToLocation="false"> |
|
|
|
</record-com-detail-card> |
|
|
@ -48,6 +54,7 @@ |
|
|
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|
|
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
|
|
|
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' |
|
|
|
import recordComDetailCardBatch from '@/mycomponents/record/recordComDetailCardBatch.vue' |
|
|
|
import { |
|
|
|
unPlannedIssueRecordSubmit |
|
|
|
} from '@/api/request2.js'; |
|
|
@ -64,9 +71,13 @@ |
|
|
|
import { |
|
|
|
createItemInfo, |
|
|
|
createDetailInfo, |
|
|
|
calcHandleQty |
|
|
|
calcHandleQty, |
|
|
|
} from '@/common/record.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
calc |
|
|
|
} from '@/common/calc.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
goHome, |
|
|
|
deepCopyData |
|
|
@ -79,7 +90,8 @@ |
|
|
|
comBlankView, |
|
|
|
winScanLocation, |
|
|
|
winScanPackAndLocation, |
|
|
|
recordComDetailCard |
|
|
|
recordComDetailCard, |
|
|
|
recordComDetailCardBatch |
|
|
|
}, |
|
|
|
props: {}, |
|
|
|
data() { |
|
|
@ -91,9 +103,11 @@ |
|
|
|
businessType: {}, //业务类型 |
|
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
|
reasonText: "", |
|
|
|
reasonCode:"", |
|
|
|
reasonCode: "", |
|
|
|
reasonList: [], |
|
|
|
dataContent:{} |
|
|
|
dataContent: {}, |
|
|
|
managementType:"" |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@ -111,8 +125,7 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
onLoad(option) { |
|
|
|
}, |
|
|
|
onLoad(option) {}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
openScanPopup() { |
|
|
@ -135,11 +148,55 @@ |
|
|
|
this.fromLocationCode = location.code; |
|
|
|
this.openScanPopup(); |
|
|
|
}, |
|
|
|
getScanResult(result) { |
|
|
|
this.getDataSource(result) |
|
|
|
getScanResult(result,managementTypeParams) { |
|
|
|
this.managementType = managementTypeParams |
|
|
|
console.log(managementTypeParams) |
|
|
|
if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { |
|
|
|
this.setDataBatch(result) |
|
|
|
} else { |
|
|
|
this.setData(result) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
setDataBatch(result) { |
|
|
|
let balance = result.balance; |
|
|
|
let label = result.label; |
|
|
|
let pack = result.package; |
|
|
|
var item = this.detailSource.find(res => { |
|
|
|
if (res.itemCode == label.itemCode) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
|
if (item == undefined) { |
|
|
|
var itemp = createItemInfo(balance, pack); |
|
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
|
// newDetail.inventoryStatus ="OK"; |
|
|
|
itemp.subList.push(newDetail); |
|
|
|
this.detailSource.push(itemp) |
|
|
|
this.packGetFocus() |
|
|
|
} else { |
|
|
|
var detail = item.subList.find(r => { |
|
|
|
if (r.batch == balance.batch && |
|
|
|
r.locationCode == balance.locationCode && |
|
|
|
r.inventoryStatus == balance.inventoryStatus && |
|
|
|
r.scaned == true) { |
|
|
|
return r; |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
if (detail == undefined) { |
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
item.subList.push(newDetail); |
|
|
|
this.packGetFocus() |
|
|
|
}else { |
|
|
|
detail.handleQty =calc.add(detail.handleQty, result.label.qty) |
|
|
|
} |
|
|
|
} |
|
|
|
this.calcHandleQty(this.detailSource) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getDataSource(result) { |
|
|
|
setData(result) { |
|
|
|
let balance = result.balance; |
|
|
|
let label = result.label; |
|
|
|
let pack = result.package; |
|
|
@ -178,8 +235,8 @@ |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
packGetFocus(){ |
|
|
|
if(this.$refs.scanPopup){ |
|
|
|
packGetFocus() { |
|
|
|
if (this.$refs.scanPopup) { |
|
|
|
this.$refs.scanPopup.packGetFocus() |
|
|
|
} |
|
|
|
}, |
|
|
@ -216,19 +273,19 @@ |
|
|
|
this.showErrorMessage("请选择出库原因") |
|
|
|
return; |
|
|
|
} |
|
|
|
var params =this.setParams() |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
unPlannedIssueRecordSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
this.showCommitSuccessMessage("提交成功\n生成采购收货记录\n" + res.data ) |
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
var params = this.setParams() |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
unPlannedIssueRecordSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
this.showCommitSuccessMessage("提交成功\n生成计划外出库记录\n" + res.data) |
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
setParams() { |
|
|
@ -259,7 +316,7 @@ |
|
|
|
|
|
|
|
submitItem.reason = this.reasonCode; |
|
|
|
submitItem.qty = detail.handleQty; |
|
|
|
submitItem.package =""; |
|
|
|
submitItem.package = ""; |
|
|
|
submitItem.detailDataType = 1; |
|
|
|
subList.push(submitItem) |
|
|
|
} |
|
|
@ -282,15 +339,15 @@ |
|
|
|
}, |
|
|
|
showCommitSuccessMessage(hint) { |
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
this.clearData(); |
|
|
|
this.clearData(); |
|
|
|
}) |
|
|
|
}, |
|
|
|
clearData(){ |
|
|
|
clearData() { |
|
|
|
this.reasonCode = "" |
|
|
|
this.reasonText = ""; |
|
|
|
this.detailSource = []; |
|
|
|
this.managementList =[]; |
|
|
|
this.dataContent ={} |
|
|
|
this.managementList = []; |
|
|
|
this.dataContent = {} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|