|
@ -5,7 +5,7 @@ |
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<comInventoryDetailCard :dataContent="item" :settingParam="jobContent" @remove="updateData" |
|
|
<comInventoryDetailCard :dataContent="item" :settingParam="jobContent" @remove="updateData" |
|
|
@updateData='updateData'> |
|
|
@updateData='updateData' @openDetail="openDetail"> |
|
|
</comInventoryDetailCard> |
|
|
</comInventoryDetailCard> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
@ -25,6 +25,7 @@ |
|
|
|
|
|
|
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> |
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> |
|
|
|
|
|
<detailInfoPopup ref="jobDetailPopup"></detailInfoPopup> |
|
|
<com-message ref="comMessage"></com-message> |
|
|
<com-message ref="comMessage"></com-message> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
@ -40,6 +41,12 @@ |
|
|
import { |
|
|
import { |
|
|
getManagementPrecisions |
|
|
getManagementPrecisions |
|
|
} from '@/common/balance.js'; |
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
getDataSource, |
|
|
|
|
|
getScanCount, |
|
|
|
|
|
calcHandleQty |
|
|
|
|
|
} from '@/common/detail.js'; |
|
|
import { |
|
|
import { |
|
|
goHome, |
|
|
goHome, |
|
|
updateTitle, |
|
|
updateTitle, |
|
@ -54,6 +61,9 @@ |
|
|
import comInventoryDetailCard from '@/pages/inventoryMove/coms/comInventoryDetailCard.vue' |
|
|
import comInventoryDetailCard from '@/pages/inventoryMove/coms/comInventoryDetailCard.vue' |
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
|
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
|
|
|
|
|
import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.vue' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: 'returnDetail', |
|
|
name: 'returnDetail', |
|
@ -63,7 +73,8 @@ |
|
|
comInventoryDetailCard, |
|
|
comInventoryDetailCard, |
|
|
requiredLocation, |
|
|
requiredLocation, |
|
|
comMessage, |
|
|
comMessage, |
|
|
winScanPackAndLocation |
|
|
winScanPackAndLocation, |
|
|
|
|
|
detailInfoPopup |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
@ -161,7 +172,7 @@ |
|
|
if (res.data.subList.length > 0) { |
|
|
if (res.data.subList.length > 0) { |
|
|
that.jobContent = res.data; |
|
|
that.jobContent = res.data; |
|
|
that.subList = res.data.subList; |
|
|
that.subList = res.data.subList; |
|
|
that.detailSource = that.getDataSource(that.subList) |
|
|
that.detailSource = getDataSource(that.subList) |
|
|
} else { |
|
|
} else { |
|
|
that.showMessage('列表数据为0'); |
|
|
that.showMessage('列表数据为0'); |
|
|
} |
|
|
} |
|
@ -173,75 +184,9 @@ |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getDataSource(subList) { |
|
|
|
|
|
let items = []; |
|
|
|
|
|
subList.forEach(detail => { |
|
|
|
|
|
var item = items.find(r => |
|
|
|
|
|
r.itemCode == detail.itemCode) |
|
|
|
|
|
if (item == undefined) { |
|
|
|
|
|
item = this.createItemInfo(detail); |
|
|
|
|
|
let newDetail = this.createDetailInfo(detail); // |
|
|
|
|
|
item.subList.push(newDetail); |
|
|
|
|
|
items.push(item) |
|
|
|
|
|
} else { |
|
|
|
|
|
item.qty += detail.qty |
|
|
|
|
|
let newDetail = this.createDetailInfo(detail); // |
|
|
|
|
|
item.subList.push(newDetail); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
return items; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
createItemInfo(res) { |
|
|
|
|
|
let item = { |
|
|
|
|
|
itemCode: res.itemCode, |
|
|
|
|
|
itemName: res.itemName, |
|
|
|
|
|
stdPackQty: res.stdPackQty, |
|
|
|
|
|
stdPackUnit: res.stdPackUnit, |
|
|
|
|
|
qty: res.qty, |
|
|
|
|
|
handleQty: 0, |
|
|
|
|
|
uom: res.uom, |
|
|
|
|
|
subList: [] |
|
|
|
|
|
} |
|
|
|
|
|
return item; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
createDetailInfo(data) { |
|
|
|
|
|
data.scaned = false; |
|
|
|
|
|
// data.record = {}; |
|
|
|
|
|
let detail = data; |
|
|
|
|
|
return detail; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
calcScanCount(closeScan) { |
|
|
|
|
|
let items = this.subList.filter(r => { |
|
|
|
|
|
if (r.scaned) { |
|
|
|
|
|
return r; |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
this.scanCount = items != null ? items.length : 0; |
|
|
|
|
|
if (this.scanCount == this.subList.length) { |
|
|
|
|
|
this.closeScanPopup(); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
calcHandleQty() { |
|
|
|
|
|
for (let item of this.detailSource) { |
|
|
|
|
|
item.handleQty = 0; |
|
|
|
|
|
for (let detail of item.subList) { |
|
|
|
|
|
if (detail.record != undefined) { |
|
|
|
|
|
item.handleQty += Number(detail.record.qty) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
this.continueScan() |
|
|
|
|
|
this.$forceUpdate(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//继续扫描 |
|
|
//继续扫描 |
|
|
continueScan() { |
|
|
continueScan() { |
|
|
this.scanCount = this.getScanCount(); |
|
|
this.scanCount = getScanCount(this.subList); |
|
|
if (this.scanCount == this.subList.length) { |
|
|
if (this.scanCount == this.subList.length) { |
|
|
this.closeScanPopup(); |
|
|
this.closeScanPopup(); |
|
|
} else { |
|
|
} else { |
|
@ -249,20 +194,21 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getScanCount(closeScan) { |
|
|
openDetail(item) { |
|
|
let items = this.subList.filter(r => { |
|
|
this.$refs.jobDetailPopup.openPopup(item) |
|
|
if (r.scaned) { |
|
|
|
|
|
return r; |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
let scanCount = items != null ? items.length : 0; |
|
|
|
|
|
return scanCount; |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateData() { |
|
|
updateData() { |
|
|
this.calcHandleQty(); |
|
|
this.calcHandleQty(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
calcHandleQty() { |
|
|
|
|
|
calcHandleQty(this.detailSource) |
|
|
|
|
|
this.continueScan() |
|
|
|
|
|
this.$forceUpdate(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
openScanPopup() { |
|
|
openScanPopup() { |
|
|
let fromlocationCode = ''; |
|
|
let fromlocationCode = ''; |
|
|
let fromlocationList = []; |
|
|
let fromlocationList = []; |
|
@ -313,7 +259,12 @@ |
|
|
']不一致,是否继续上架?', res => { |
|
|
']不一致,是否继续上架?', res => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
itemDetail.scaned = true; |
|
|
itemDetail.scaned = true; |
|
|
itemDetail.record = this.createRecordInfo(itemDetail, result.balance); |
|
|
itemDetail.handleQty = Number(result.label.qty) > Number(result.balance |
|
|
|
|
|
.qty) ? Number(result.balance.qty) : Number(result.label.qty); |
|
|
|
|
|
itemDetail.balance = result.balance; |
|
|
|
|
|
itemDetail.balance.balanceQty = result.balance.qty; |
|
|
|
|
|
itemDetail.balance.stdPackQty = result.package.stdPackQty |
|
|
|
|
|
itemDetail.balance.stdPackUnit = result.package.stdPackUnit |
|
|
this.calcHandleQty(); |
|
|
this.calcHandleQty(); |
|
|
} else { |
|
|
} else { |
|
|
this.scanPopupGetFocus(); |
|
|
this.scanPopupGetFocus(); |
|
@ -321,7 +272,12 @@ |
|
|
}); |
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
itemDetail.scaned = true; |
|
|
itemDetail.scaned = true; |
|
|
itemDetail.record = this.createRecordInfo(itemDetail, result.balance); |
|
|
itemDetail.handleQty = Number(result.label.qty) > Number(result.balance |
|
|
|
|
|
.qty) ? Number(result.balance.qty) : Number(result.label.qty); |
|
|
|
|
|
itemDetail.balance = result.balance; |
|
|
|
|
|
itemDetail.balance.balanceQty = result.balance.qty; |
|
|
|
|
|
itemDetail.balance.stdPackQty = result.package.stdPackQty |
|
|
|
|
|
itemDetail.balance.stdPackUnit = result.package.stdPackUnit |
|
|
this.calcHandleQty(); |
|
|
this.calcHandleQty(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -333,20 +289,14 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
createRecordInfo(detail, balance) { |
|
|
|
|
|
var record = {} |
|
|
|
|
|
detail.scaned = true; |
|
|
|
|
|
detail.balance = balance; |
|
|
|
|
|
detail.recommendInventoryStatus = detail.inventoryStatus; |
|
|
|
|
|
detail.inventoryStatus = balance.inventoryStatus; |
|
|
|
|
|
// let record = JSON.parse(JSON.stringify(detail)); |
|
|
|
|
|
//克隆对象,深度克隆,防止双向绑定同一个变量 |
|
|
|
|
|
Object.assign(record, detail) |
|
|
|
|
|
record.qty = Number(balance.qty); |
|
|
|
|
|
return record; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async commit() { |
|
|
commit() { |
|
|
|
|
|
this.scanCount = getScanCount(this.subList); |
|
|
|
|
|
if (this.scanCount == 0) { |
|
|
|
|
|
this.showErrorMessage("扫描数为0,请先扫描") |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//允许部分提交 |
|
|
//允许部分提交 |
|
|
//扫描数量和任务数量相等,直接提交 |
|
|
//扫描数量和任务数量相等,直接提交 |
|
|
if (this.scanCount == this.subList.length) { |
|
|
if (this.scanCount == this.subList.length) { |
|
@ -369,109 +319,46 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async submitJob() { |
|
|
submitJob() { |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: "提交中....", |
|
|
title: "提交中....", |
|
|
mask: true |
|
|
mask: true |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
var itemCodes = [] |
|
|
|
|
|
this.detailSource.forEach(item => { |
|
|
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
var param = { |
|
|
|
|
|
itemCode: itemCodes, |
|
|
|
|
|
locationCode: this.toLocationCode |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var params = this.setParams(); |
|
|
var params = this.setParams(); |
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
inventoryMoveSubmit(this.id, params).then(res => { |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
if (res.data) { |
|
|
|
|
|
var hint = res.data.Number; |
|
|
|
|
|
this.showCommitSuccessMessage("提交成功" + hint, ) |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
// inventoryMoveSubmit(params).then(res => { |
|
|
this.showErrorMessage("提交失败") |
|
|
// uni.hideLoading() |
|
|
} |
|
|
// if (res.data) { |
|
|
}).catch(error => { |
|
|
// this.showCommitSuccessMessage("提交成功<br>生成库存转移记录" + res.data) |
|
|
uni.hideLoading() |
|
|
// } else { |
|
|
this.showErrorMessage(error) |
|
|
// this.showErrorMessage("提交失败"+res.msg) |
|
|
}) |
|
|
// } |
|
|
|
|
|
// }).catch(error => { |
|
|
|
|
|
// uni.hideLoading() |
|
|
|
|
|
// this.showErrorMessage(error) |
|
|
|
|
|
// }) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setParams() { |
|
|
setParams() { |
|
|
var params = { |
|
|
var subList = [] |
|
|
requestNumber: this.jobContent.requestNumber, |
|
|
var creator = this.$store.state.user.id |
|
|
jobNumber: '', |
|
|
|
|
|
asnNumber: this.jobContent.asnNumber, |
|
|
|
|
|
ppNumber: this.jobContent.ppNumber, |
|
|
|
|
|
supplierCode: this.jobContent.supplierCode, |
|
|
|
|
|
carrierCode: this.jobContent.carrierCode, |
|
|
|
|
|
transferMode: this.jobContent.transferMode, |
|
|
|
|
|
vehiclePlateNumber: this.jobContent.vehiclePlateNumber, |
|
|
|
|
|
fromWarehouseCode: this.jobContent.fromWarehouseCode, |
|
|
|
|
|
fromLocationTypes: this.jobContent.fromLocationTypes, |
|
|
|
|
|
fromAreaCodes: this.jobContent.fromAreaCodes, |
|
|
|
|
|
toWarehouseCode: this.jobContent.toWarehouseCode, |
|
|
|
|
|
toLocationTypes: this.jobContent.toLocationTypes, |
|
|
|
|
|
status: this.jobContent.status, |
|
|
|
|
|
toAreaCodes: this.jobContent.toAreaCodes, |
|
|
|
|
|
executeTime: getCurrDateTime(), |
|
|
|
|
|
activeDate: getCurrDateTime(), |
|
|
|
|
|
available: 1, //是否可用 0不可用,1可用 |
|
|
|
|
|
requestTime: this.jobContent.requestTime, |
|
|
|
|
|
dueTime: getCurrDateTime(), |
|
|
|
|
|
expiredTime: this.jobContent.expiredTime, |
|
|
|
|
|
departmentCode: this.jobContent.departmentCode, |
|
|
|
|
|
interfaceType: "jklxPURCHASE_RETURN", //接口类型 |
|
|
|
|
|
Number: this.jobContent.Number, |
|
|
|
|
|
businessType: this.jobContent.businessType, |
|
|
|
|
|
remark: this.jobContent.remark, |
|
|
|
|
|
creationTime: this.jobContent.creationTime, |
|
|
|
|
|
creatorId: this.jobContent.creatorId, |
|
|
|
|
|
creatorName: this.jobContent.creatorName, |
|
|
|
|
|
extraProperties: this.jobContent.extraProperties, |
|
|
|
|
|
siteId: this.jobContent.siteId, |
|
|
|
|
|
Code: "", |
|
|
|
|
|
subList: [], |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.detailSource.forEach(item => { |
|
|
this.detailSource.forEach(item => { |
|
|
item.subList.forEach(detail => { |
|
|
item.subList.forEach(detail => { |
|
|
if (detail.scaned) { |
|
|
if (detail.scaned) { |
|
|
detail.record.fromPackingNumber = detail.record.packingNumber |
|
|
subList.push(detail) |
|
|
detail.record.toPackingNumber = detail.record.packingNumber |
|
|
|
|
|
detail.record.fromBatch = detail.record.batch |
|
|
|
|
|
detail.record.ToBatch = detail.record.batch; |
|
|
|
|
|
detail.record.FromContainerNumber = detail.record.ContainerNumber |
|
|
|
|
|
detail.record.ToContainerNumber = "" |
|
|
|
|
|
detail.record.FromLocationGroupCode = "" |
|
|
|
|
|
detail.record.FromAreaCode = "" |
|
|
|
|
|
detail.record.ToLocationGroupCode = ""; |
|
|
|
|
|
detail.record.ToAreaCode = ""; |
|
|
|
|
|
detail.record.VisualInspectResult = "", |
|
|
|
|
|
detail.record.VisualInspectPhotos = "", |
|
|
|
|
|
detail.record.FailedReason = "" |
|
|
|
|
|
detail.record.SinglePrice = "", |
|
|
|
|
|
detail.record.Amount = "", |
|
|
|
|
|
detail.record.JobDetailID = detail.record.id, |
|
|
|
|
|
detail.record.masterID = this.jobContent.id, |
|
|
|
|
|
detail.record.projectCode = "", |
|
|
|
|
|
detail.record.Code = "" |
|
|
|
|
|
detail.record.interfaceType = "jklxPURCHASE_RETURN" |
|
|
|
|
|
params.subList.push(detail.record) |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
this.jobContent.subList = subList |
|
|
return params; |
|
|
this.jobContent.creator = creator; |
|
|
|
|
|
return this.jobContent; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getLocationInfo(locationCode) { |
|
|
getLocationInfo(locationCode) { |
|
|
getBasicLocationByCode(locationCode).then(res => { |
|
|
getBasicLocationByCode(locationCode).then(res => { |
|
|
if (res.data.list.length > 0) { |
|
|
if (res.data.list.length > 0) { |
|
@ -530,7 +417,7 @@ |
|
|
closeCommitMessage() { |
|
|
closeCommitMessage() { |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url: './receipt' |
|
|
url: './inventoryMoveJob' |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
//点关闭直接返回列表 |
|
|
//点关闭直接返回列表 |
|
@ -540,13 +427,10 @@ |
|
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
showCommitSuccessMessage(hint) { |
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url: './receiptJob' |
|
|
url: './inventoryMoveJob' |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}, 3000) |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|