|
@ -1,7 +1,7 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="page-wraper"> |
|
|
<view class="page-wraper"> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<com-blank-view @goScan='getLocation' v-if="detailSource.length==0"></com-blank-view> |
|
|
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="page-wraper" v-if="detailSource.length>0"> |
|
|
<view class="page-wraper" v-if="detailSource.length>0"> |
|
|
<view class="page-main"> |
|
|
<view class="page-main"> |
|
@ -24,7 +24,8 @@ |
|
|
</view> |
|
|
</view> |
|
|
<uni-data-picker v-if="detailSource.length>0" style="padding: 20rpx; background-color:#fff;" |
|
|
<uni-data-picker v-if="detailSource.length>0" style="padding: 20rpx; background-color:#fff;" |
|
|
class='uni-data-picker' placeholder="请选择客户" popup-title="选择客户" :localdata="customerList" |
|
|
class='uni-data-picker' placeholder="请选择客户" popup-title="选择客户" :localdata="customerList" |
|
|
v-model="customer"> |
|
|
@change="reasonChange"> |
|
|
|
|
|
|
|
|
</uni-data-picker> |
|
|
</uni-data-picker> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
@ -32,7 +33,7 @@ |
|
|
<view class="uni-flex u-col-center space-between padding_10" |
|
|
<view class="uni-flex u-col-center space-between padding_10" |
|
|
style="background-color:ghostwhite; width: 100%; "> |
|
|
style="background-color:ghostwhite; width: 100%; "> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<requiredLocation v-if="showToLoaction" ref='comScanLocation' title="目标库位" :locationCode="toLocationCode" |
|
|
<requiredLocation ref='comScanLocation' title="目标库位" :locationCode="toLocationCode" |
|
|
@getLocation='scanLocationCode' :isShowEdit="true" |
|
|
@getLocation='scanLocationCode' :isShowEdit="true" |
|
|
:locationTypeList="tolocationTypeList"></requiredLocation> |
|
|
:locationTypeList="tolocationTypeList"></requiredLocation> |
|
|
</view> |
|
|
</view> |
|
@ -44,7 +45,7 @@ |
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> |
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' headerType="HMQ"></win-scan-pack-and-location> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' |
|
|
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' |
|
|
:locationTypeList="fromlocationTypeList"></win-scan-location> |
|
|
:locationTypeList="fromlocationTypeList"></win-scan-location> |
|
@ -55,12 +56,11 @@ |
|
|
<script> |
|
|
<script> |
|
|
import { |
|
|
import { |
|
|
getBasicCustomerList, |
|
|
getBasicCustomerList, |
|
|
deliverRequestSubmit, |
|
|
|
|
|
deliverRecordSubmit |
|
|
deliverRecordSubmit |
|
|
} from '@/api/request2.js'; |
|
|
} from '@/api/request2.js'; |
|
|
import { |
|
|
import { |
|
|
goHome, |
|
|
goHome, |
|
|
updateTitle |
|
|
getPackingNumberAndBatchByList |
|
|
} from '@/common/basic.js'; |
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
@ -68,6 +68,10 @@ |
|
|
getDirectoryItemArray |
|
|
getDirectoryItemArray |
|
|
} from '@/common/directory.js'; |
|
|
} from '@/common/directory.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
getPrecisionStrategyList |
|
|
|
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
getBusinessType, |
|
|
getBusinessType, |
|
|
createItemInfo, |
|
|
createItemInfo, |
|
@ -100,34 +104,24 @@ |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
id: '', |
|
|
id: '', |
|
|
receiptJob: {}, |
|
|
|
|
|
received: false, |
|
|
|
|
|
isShowPackingCode: true, |
|
|
|
|
|
scanCount: 0, |
|
|
|
|
|
subList: [], //接口返回的任务subList |
|
|
subList: [], //接口返回的任务subList |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
locationTypeList: [], |
|
|
locationTypeList: [], |
|
|
businessTypeInfo: {}, |
|
|
|
|
|
fromLocationInfo: {}, |
|
|
|
|
|
fromLocationCode: "", |
|
|
fromLocationCode: "", |
|
|
toLocationCode: "", |
|
|
toLocationCode: "", |
|
|
isShowLocation: false, |
|
|
|
|
|
fromlocationTypeList: [], |
|
|
fromlocationTypeList: [], |
|
|
tolocationTypeList: [], |
|
|
tolocationTypeList: [], |
|
|
allowModifyLocation: false, |
|
|
|
|
|
businessType: {}, |
|
|
businessType: {}, |
|
|
customerList: [], |
|
|
customerList: [], |
|
|
customer: "", |
|
|
customerText: "", |
|
|
fromType: "", |
|
|
customerCode : "", |
|
|
showToLoaction: true, |
|
|
dataContent:{}, |
|
|
dataContent:{} |
|
|
managementList:[] |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onLoad(option) { |
|
|
onLoad(option) { |
|
|
this.fromType = option.fromType |
|
|
|
|
|
this.updateTitle(); |
|
|
|
|
|
|
|
|
|
|
|
var typeCode = "DeliverRequest" |
|
|
var typeCode = "DeliverRecord" |
|
|
getBusinessType(typeCode, res => { |
|
|
getBusinessType(typeCode, res => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
this.businessType = res.businessType; |
|
|
this.businessType = res.businessType; |
|
@ -135,7 +129,7 @@ |
|
|
this.tolocationTypeList = res.tolocationTypeList; |
|
|
this.tolocationTypeList = res.tolocationTypeList; |
|
|
this.showFromLocationPopup(); |
|
|
this.showFromLocationPopup(); |
|
|
} else { |
|
|
} else { |
|
|
this.$refs.comMessage.showBreakMessage(res.message); |
|
|
this.showErrorMessage(res.message) |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
@ -165,17 +159,6 @@ |
|
|
|
|
|
|
|
|
mounted() {}, |
|
|
mounted() {}, |
|
|
methods: { |
|
|
methods: { |
|
|
updateTitle() { |
|
|
|
|
|
if (this.fromType == "requestType") { |
|
|
|
|
|
this.showToLoaction = false |
|
|
|
|
|
updateTitle("制品发货申请") |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showToLoaction = true |
|
|
|
|
|
updateTitle("制品发货记录") |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
getScanResult(result) { |
|
|
let balance = result.balance; |
|
|
let balance = result.balance; |
|
|
let label = result.label; |
|
|
let label = result.label; |
|
@ -187,9 +170,8 @@ |
|
|
return res |
|
|
return res |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
var qty =labelQty>balanceQty?balanceQty:labelQty |
|
|
|
|
|
if (item == undefined) { |
|
|
if (item == undefined) { |
|
|
var itemp = createItemInfo(qty, pack); |
|
|
var itemp = createItemInfo(balance.qty, pack); |
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
if(labelQty) |
|
|
if(labelQty) |
|
|
itemp.subList.push(newDetail); |
|
|
itemp.subList.push(newDetail); |
|
@ -289,108 +271,118 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
commit() { |
|
|
commit() { |
|
|
if (this.customer == "") { |
|
|
if (this.customerText == "") { |
|
|
this.showMessage("请先选择客户") |
|
|
this.showMessage("请先选择客户") |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
console.log("客户", this.customer) |
|
|
console.log("客户", this.customerText) |
|
|
if (this.toLocationCode == ""&&this.showToLoaction) { |
|
|
if (this.toLocationCode == "") { |
|
|
this.showMessage("请先选择目标库位") |
|
|
this.showMessage("请先选择目标库位") |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
|
|
|
|
|
//查询管理模式 |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: "提交中....", |
|
|
title: "提交中....", |
|
|
mask: true |
|
|
mask: true |
|
|
}); |
|
|
}); |
|
|
|
|
|
this.managementList = []; |
|
|
|
|
|
var precisionStrategParams = this.setPrecisionStrategParams() |
|
|
|
|
|
|
|
|
|
|
|
getPrecisionStrategyList(precisionStrategParams, res => { |
|
|
if (this.fromType == "requestType") { |
|
|
if (res.success) { |
|
|
var params = this.setRequestParams(); |
|
|
this.managementList = res.list; |
|
|
|
|
|
var params = this.setParams() |
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
// deliverRequestSubmit(params).then(res => { |
|
|
deliverRecordSubmit(params).then(res => { |
|
|
// uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
// if (res.data) { |
|
|
if (res.data) { |
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data, ) |
|
|
this.showCommitSuccessMessage("提交成功<br>生成制品发货记录<br>" + res.data) |
|
|
// } else { |
|
|
} else { |
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
// } |
|
|
} |
|
|
// }).catch(error => { |
|
|
}).catch(error => { |
|
|
// uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
// this.showErrorMessage(error) |
|
|
this.showErrorMessage(error) |
|
|
// }) |
|
|
}) |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
// deliverRecordSubmit(params).then(res => { |
|
|
uni.hideLoading(); |
|
|
// uni.hideLoading() |
|
|
this.showErrorMessage(res.message); |
|
|
// if (res.data) { |
|
|
} |
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data, ) |
|
|
|
|
|
// } else { |
|
|
}) |
|
|
// this.showErrorMessage("提交失败"+res.msg) |
|
|
|
|
|
// } |
|
|
} else { |
|
|
// }).catch(error => { |
|
|
this.showErrorMessage("没有要提交的数据,请先扫描") |
|
|
// uni.hideLoading() |
|
|
|
|
|
// this.showErrorMessage(error) |
|
|
|
|
|
// }) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
setParams() { |
|
|
setPrecisionStrategParams() { |
|
|
var subList = [] |
|
|
var itemList = [] |
|
|
var creator = this.$store.state.user.id |
|
|
|
|
|
this.detailSource.forEach(item => { |
|
|
this.detailSource.forEach(item => { |
|
|
item.subList.forEach(detail => { |
|
|
item.subList.forEach(detail => { |
|
|
if (detail.scaned) { |
|
|
if (detail.scaned) { |
|
|
detail.toPackingNumber = detail.packingNumber; |
|
|
detail.toLocationCode = this.toLocationCode; |
|
|
detail.toContainerNumber = detail.containerNumber |
|
|
var filterResult = itemList.filter(res => { |
|
|
detail.toBatch = detail.toBatch; |
|
|
if (res.itemCode == item.itemCode && |
|
|
detail.toInventoryStatus = detail.inventoryStatus |
|
|
detail.toLocationCode == res.locationCode) { |
|
|
detail.toLocationCode = "" |
|
|
return res |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
//去掉重复元素 |
|
|
|
|
|
if (filterResult.length == 0) { |
|
|
|
|
|
var result = { |
|
|
|
|
|
itemCode: item.itemCode, |
|
|
|
|
|
locationCode: detail.toLocationCode |
|
|
|
|
|
} |
|
|
|
|
|
itemList.push(result) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
subList.push(detail) |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
this.dataContent.subList = subList |
|
|
return itemList; |
|
|
this.dataContent.creator = creator; |
|
|
|
|
|
return this.dataContent; |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
setRequestParams(){ |
|
|
setParams() { |
|
|
var subList = [] |
|
|
var subList = [] |
|
|
var supplierCode="" |
|
|
var creator = this.$store.state.user.id |
|
|
this.detailSource.forEach(item => { |
|
|
this.detailSource.forEach(item => { |
|
|
item.subList.forEach(detail => { |
|
|
item.subList.forEach(detail => { |
|
|
if (detail.scaned) { |
|
|
if (detail.scaned) { |
|
|
detail.soNumber =detail.package.soNumber; |
|
|
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, |
|
|
detail.soLine = detail.soLine.soNumber; |
|
|
detail.packingNumber, detail.toLocationCode, detail.batch); |
|
|
// soNumber: 926926926, |
|
|
detail.itemCode = detail.itemCode; |
|
|
// soLine: 926, |
|
|
detail.itemName = detail.package.itemName; |
|
|
// itemCode: THILDD0A691AG, |
|
|
detail.itemDesc1 = detail.package.itemDesc1; |
|
|
// remark: , |
|
|
detail.itemDesc2 = detail.package.itemDesc2; |
|
|
// qty: 2, |
|
|
|
|
|
// uom: EA |
|
|
detail.inventoryStatus = detail.inventoryStatus; |
|
|
|
|
|
|
|
|
|
|
|
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) |
|
|
subList.push(detail) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
this.dataContent.subList = subList; |
|
|
this.dataContent.subList = subList |
|
|
this.dataContent.creator = creator; |
|
|
this.dataContent.deliverPlanNumber = "DP20231130-0001" |
|
|
this.dataContent.customerCode =this.customerCode; |
|
|
this.dataContent.customerCode = "CF" |
|
|
this.dataContent.fromWarehouseCode = this.detailSource[0].subList[0].warehouseCode; |
|
|
this.dataContent.customerDockCode = "" |
|
|
this.dataContent.toWarehouseCode = this.toWarehouseCode; |
|
|
this.dataContent.carrierCode = "" |
|
|
|
|
|
this.dataContent.transferMode = "" |
|
|
|
|
|
this.dataContent.vehiclePlateNumber = "" |
|
|
|
|
|
this.dataContent.remark = "" |
|
|
|
|
|
this.dataContent.dueTime = "" |
|
|
|
|
|
this.dataContent.departmentCode = "研发部门" |
|
|
|
|
|
this.dataContent.status = 1 |
|
|
|
|
|
this.dataContent.autoCommit = "FALSE" |
|
|
|
|
|
this.dataContent.autoAgree = "FALSE" |
|
|
|
|
|
this.dataContent.autoExecute = "FALSE" |
|
|
|
|
|
this.dataContent.directCreateRecord = "FALSE" |
|
|
|
|
|
|
|
|
|
|
|
return this.dataContent; |
|
|
return this.dataContent; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -422,24 +414,21 @@ |
|
|
this.getFromLocationCode(location, code) |
|
|
this.getFromLocationCode(location, code) |
|
|
}, |
|
|
}, |
|
|
getFromLocationCode(location, code) { |
|
|
getFromLocationCode(location, code) { |
|
|
this.fromLocationInfo = location; |
|
|
|
|
|
this.fromLocationCode = code; |
|
|
this.fromLocationCode = code; |
|
|
this.openScanPopup(); |
|
|
this.openScanPopup(); |
|
|
}, |
|
|
}, |
|
|
getToLocationCode(location, code) { |
|
|
getToLocationCode(location, code) { |
|
|
if (this.fromLocationCode == code) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", |
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.toLocationCode = code; |
|
|
this.toLocationCode = code; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
showCommitSuccessMessage(hint) { |
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
this.fromLocationCode = ''; |
|
|
this.fromLocationCode = ''; |
|
|
|
|
|
this.subList = []; |
|
|
|
|
|
this.detailSource = []; |
|
|
|
|
|
this.toLocationCode = ''; |
|
|
|
|
|
this.dataContent = {} |
|
|
|
|
|
this.toWarehouseCode = "" |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
@ -452,7 +441,16 @@ |
|
|
this.detailSource.splice(i, 1) |
|
|
this.detailSource.splice(i, 1) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
reasonChange(e) { |
|
|
|
|
|
if (e.detail.value.length == 0) { |
|
|
|
|
|
this.customerCode = "" |
|
|
|
|
|
this.customerText = "" |
|
|
|
|
|
} else { |
|
|
|
|
|
this.customerCode = e.detail.value[0].value |
|
|
|
|
|
this.customerText = e.detail.value[0].text |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|