|
|
@ -1,7 +1,7 @@ |
|
|
|
<template> |
|
|
|
<view class="page-wraper"> |
|
|
|
<view class=""> |
|
|
|
<com-blank-view @goScan='getBusinessType' v-if="detailSource.length==0"></com-blank-view> |
|
|
|
<com-blank-view @goScan="getBusinessType" v-if="detailSource.length == 0"></com-blank-view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="page-wraper" v-if="detailSource.length > 0"> |
|
|
@ -9,73 +9,51 @@ |
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
|
<view class=""> |
|
|
|
<record-com-detail-card :dataContent="item" @removeItem="removeItem(index,item)" |
|
|
|
@updateData="updateData" @removePack='updateData' :isShowToLocation="false"> |
|
|
|
</record-com-detail-card> |
|
|
|
<record-com-detail-card :dataContent="item" @removeItem="removeItem(index, item)" @updateData="updateData" @removePack="updateData" :isShowToLocation="false"> </record-com-detail-card> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="uni-flex uni-row" style="margin-left: 30rpx;margin-top: 10rpx; "> |
|
|
|
|
|
|
|
<text style="font-size: 35rpx; margin-right: 20rpx;">拆出数量 :</text> |
|
|
|
<uni-number-box @change="calcQty($event,splitCount)" :value="splitCount"> |
|
|
|
</uni-number-box> |
|
|
|
<view class="uni-flex uni-row" style="margin-left: 30rpx; margin-top: 10rpx"> |
|
|
|
<text style="font-size: 35rpx; margin-right: 20rpx">拆出数量 :</text> |
|
|
|
<uni-number-box @change="calcQty($event, splitCount)" :value="splitCount"> </uni-number-box> |
|
|
|
<uom :uom="detailSource[0].uom"></uom> |
|
|
|
</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=""> |
|
|
|
</view> |
|
|
|
<view class="uni-flex u-col-center space-between padding_10" style="background-color: ghostwhite; width: 100%"> |
|
|
|
<view class=""> </view> |
|
|
|
<view class="uni-flex uni-row"> |
|
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
|
<win-scan-button @goScan="openScanPopup"></win-scan-button> |
|
|
|
</view> |
|
|
|
|
|
|
|
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="typeCode"> |
|
|
|
</winComScanBalance> |
|
|
|
<winComScanBalance ref="scanPopup" @getBalance="getScanResult" :bussinessCode="typeCode"> </winComScanBalance> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
goHome, |
|
|
|
showConfirmMsg |
|
|
|
} from '@/common/basic.js'; |
|
|
|
import { |
|
|
|
splitPackageRecordSubmit |
|
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
calc |
|
|
|
} from '@/common/calc.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
getInventoryStatusDesc, |
|
|
|
getDirectoryItemArray |
|
|
|
} from '@/common/directory.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
getBusinessType, |
|
|
|
createItemInfo, |
|
|
|
createDetailInfo, |
|
|
|
calcHandleQty |
|
|
|
} from '@/common/record.js'; |
|
|
|
import { goHome, showConfirmMsg } from '@/common/basic.js' |
|
|
|
import { splitPackageRecordSubmit } from '@/api/request2.js' |
|
|
|
|
|
|
|
import { calc } from '@/common/calc.js' |
|
|
|
|
|
|
|
import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js' |
|
|
|
|
|
|
|
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js' |
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
|
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' |
|
|
|
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' |
|
|
|
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
|
|
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|
|
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
|
|
|
import winScanLocation from '@/mycomponents/scan/winScanLocation.vue' |
|
|
|
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue' |
|
|
|
import recommendBalance from '@/mycomponents/balance/recommendBalance.vue' |
|
|
|
import comPackageRecord from '@/pages/package/coms/comPackageRecord.vue' |
|
|
|
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' |
|
|
@ -99,43 +77,30 @@ |
|
|
|
return { |
|
|
|
id: '', |
|
|
|
detailSource: [], // 绑定在页面上的数据源 |
|
|
|
fromLocationCode: "", |
|
|
|
toLocationCode: "", |
|
|
|
fromLocationCode: '', |
|
|
|
toLocationCode: '', |
|
|
|
fromLocationAreaTypeList: [], |
|
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
|
inInventoryStatus: '', // 目标入库库存状态 |
|
|
|
outInventoryStatus: '', // 来源出库库存状态 |
|
|
|
businessType: {}, |
|
|
|
dataContent: {}, |
|
|
|
currentItemCode: "", |
|
|
|
toPackingNumber: "", |
|
|
|
itemCode:"", |
|
|
|
currentItemCode: '', |
|
|
|
toPackingNumber: '', |
|
|
|
itemCode: '', |
|
|
|
splitCount: 1, |
|
|
|
typeCode:"SplitPackage" |
|
|
|
}; |
|
|
|
typeCode: 'SplitPackage' |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
<<<<<<< Updated upstream |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: option.title |
|
|
|
}) |
|
|
|
var typeCode = "SplitPackage" |
|
|
|
getBusinessType(typeCode, res => { |
|
|
|
if (res.success) { |
|
|
|
this.businessType = res.businessType; |
|
|
|
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList; |
|
|
|
this.showFromLocationPopup(); |
|
|
|
} else { |
|
|
|
this.showErrorMessage(res.message) |
|
|
|
} |
|
|
|
}); |
|
|
|
======= |
|
|
|
this.getBusinessType(); |
|
|
|
>>>>>>> Stashed changes |
|
|
|
this.getBusinessType() |
|
|
|
}, |
|
|
|
// 返回首页 |
|
|
|
onNavigationBarButtonTap(e) { |
|
|
|
if (e.index === 0) { |
|
|
|
goHome(); |
|
|
|
goHome() |
|
|
|
} |
|
|
|
}, |
|
|
|
// 拦截返回按钮事件 |
|
|
@ -146,28 +111,28 @@ |
|
|
|
mounted() {}, |
|
|
|
methods: { |
|
|
|
getBusinessType() { |
|
|
|
getBusinessType(this.typeCode, res => { |
|
|
|
getBusinessType(this.typeCode, (res) => { |
|
|
|
if (res.success) { |
|
|
|
this.businessType = res.businessType; |
|
|
|
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses); |
|
|
|
this.businessType = res.businessType |
|
|
|
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses) |
|
|
|
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList |
|
|
|
this.openScanPopup(); |
|
|
|
this.openScanPopup() |
|
|
|
} else { |
|
|
|
this.showErrorMessage(res.message) |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
}, |
|
|
|
openScanPopup() { |
|
|
|
if (this.businessType) { |
|
|
|
if (this.detailSource.length > 0) { |
|
|
|
showConfirmMsg("拆包信息还没提交,是否要重新扫描?",res=>{ |
|
|
|
showConfirmMsg('拆包信息还没提交,是否要重新扫描?', (res) => { |
|
|
|
if (res) { |
|
|
|
this.clearData(); |
|
|
|
this.$refs.scanPopup.openScanPopup(this.businessType); |
|
|
|
this.clearData() |
|
|
|
this.$refs.scanPopup.openScanPopup(this.businessType) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$refs.scanPopup.openScanPopup(this.businessType); |
|
|
|
this.$refs.scanPopup.openScanPopup(this.businessType) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.getBusinessType() |
|
|
@ -175,82 +140,74 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
|
this.setData(result); |
|
|
|
this.setData(result) |
|
|
|
}, |
|
|
|
|
|
|
|
setData(result) { |
|
|
|
let balance = result.balance; |
|
|
|
let label = result.label; |
|
|
|
let pack = result.package; |
|
|
|
this.fromPackUnit = pack.packUnit; |
|
|
|
this.fromPack = pack; |
|
|
|
const { balance } = result |
|
|
|
const { label } = result |
|
|
|
const pack = result.package |
|
|
|
this.fromPackUnit = pack.packUnit |
|
|
|
this.fromPack = pack |
|
|
|
if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) { |
|
|
|
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位[" + this |
|
|
|
.fromLocationCode + "]没有库存余额") |
|
|
|
return; |
|
|
|
this.showErrorMessage(`箱码[${balance.packingNumber}批次[${balance.batch}]在库位[${this.fromLocationCode}]没有库存余额`) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
var item = this.detailSource.find(res => { |
|
|
|
const item = this.detailSource.find((res) => { |
|
|
|
if (res.itemCode == balance.itemCode) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
|
if (item == undefined) { |
|
|
|
if (this.itemCode != "" && this.itemCode != balance.itemCode) { |
|
|
|
this.showErrorMessage("请扫描物料为【" + this.itemCode + "】的箱码") |
|
|
|
return; |
|
|
|
if (this.itemCode != '' && this.itemCode != balance.itemCode) { |
|
|
|
this.showErrorMessage(`请扫描物料为【${this.itemCode}】的箱码`) |
|
|
|
return |
|
|
|
} |
|
|
|
var itemp = createItemInfo(balance, pack); |
|
|
|
const itemp = createItemInfo(balance, pack) |
|
|
|
itemp.handleQty = 0 |
|
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
|
const newDetail = createDetailInfo(balance, pack) // |
|
|
|
newDetail.handleQty = 0 |
|
|
|
newDetail.scaned = false |
|
|
|
itemp.subList.push(newDetail); |
|
|
|
itemp.subList.push(newDetail) |
|
|
|
this.detailSource.push(itemp) |
|
|
|
this.itemCode = balance.itemCode; |
|
|
|
this.itemCode = balance.itemCode |
|
|
|
this.fromLocationCode = balance.locationCode |
|
|
|
this.closeScanPopup() |
|
|
|
} else { |
|
|
|
var detail = item.subList.find(r => { |
|
|
|
if (r.packingNumber == balance.packingNumber && |
|
|
|
r.batch == balance.batch && |
|
|
|
r.locationCode == balance.locationCode && |
|
|
|
r.inventoryStatus == balance.inventoryStatus) { |
|
|
|
return r; |
|
|
|
const detail = item.subList.find((r) => { |
|
|
|
if (r.packingNumber == balance.packingNumber && r.batch == balance.batch && r.locationCode == balance.locationCode && r.inventoryStatus == balance.inventoryStatus) { |
|
|
|
return r |
|
|
|
} |
|
|
|
}) |
|
|
|
if (detail == undefined) { |
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
const newDetail = createDetailInfo(balance, pack) |
|
|
|
newDetail.handleQty = 0 |
|
|
|
item.subList.push(newDetail); |
|
|
|
item.subList.push(newDetail) |
|
|
|
this.closeScanPopup() |
|
|
|
} else { |
|
|
|
if (detail.scaned == true) { |
|
|
|
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中") |
|
|
|
} |
|
|
|
} else if (detail.scaned == true) { |
|
|
|
this.showErrorMessage(`箱码[${balance.packingNumber}批次[${balance.batch}]已经在列表中`) |
|
|
|
} |
|
|
|
} |
|
|
|
this.calcHandleQty(); |
|
|
|
this.calcHandleQty() |
|
|
|
}, |
|
|
|
|
|
|
|
calcHandleQty() { |
|
|
|
calcHandleQty(this.detailSource) |
|
|
|
this.$forceUpdate(); |
|
|
|
this.$forceUpdate() |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showErrorMessage(message) { |
|
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
|
this.$refs.comMessage.showErrorMessage(message, (res) => { |
|
|
|
if (res) { |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
updateData() { |
|
|
|
this.calcHandleQty(); |
|
|
|
for (var i = 0; i < this.detailSource.length; i++) { |
|
|
|
let item = this.detailSource[i]; |
|
|
|
this.calcHandleQty() |
|
|
|
for (let i = 0; i < this.detailSource.length; i++) { |
|
|
|
const item = this.detailSource[i] |
|
|
|
if (item.qty == 0) { |
|
|
|
this.detailSource.splice(i, 1) |
|
|
|
} |
|
|
@ -262,34 +219,33 @@ |
|
|
|
|
|
|
|
closeScanPopup() { |
|
|
|
if (this.$refs.scanPopup != undefined) { |
|
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
|
this.$refs.scanPopup.closeScanPopup() |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
scanPopupGetFocus() { |
|
|
|
if (this.$refs.scanPopup != undefined) { |
|
|
|
this.$refs.scanPopup.getfocus(); |
|
|
|
this.$refs.scanPopup.getfocus() |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
commit() { |
|
|
|
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
|
|
|
|
|
|
|
if (this.splitCount == 0) { |
|
|
|
this.showErrorMessage("拆出数量不能等于0") |
|
|
|
return; |
|
|
|
this.showErrorMessage('拆出数量不能等于0') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.splitCount > this.detailSource[0].qty) { |
|
|
|
this.showErrorMessage("拆出数量不能大于库存数量") |
|
|
|
return; |
|
|
|
this.showErrorMessage('拆出数量不能大于库存数量') |
|
|
|
return |
|
|
|
} |
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中....", |
|
|
|
title: '提交中....', |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
}) |
|
|
|
|
|
|
|
var params = this.setParams(); |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
const params = this.setParams() |
|
|
|
console.log(`提交${JSON.stringify(params)}`) |
|
|
|
// splitPackageRecordSubmit(params).then(res => { |
|
|
|
// uni.hideLoading() |
|
|
|
// if (res.data) { |
|
|
@ -323,96 +279,92 @@ |
|
|
|
// this.showErrorMessage(error) |
|
|
|
// }) |
|
|
|
} else { |
|
|
|
this.showErrorMessage("没有要提交的数据") |
|
|
|
this.showErrorMessage('没有要提交的数据') |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
setParams() { |
|
|
|
var subList = [] |
|
|
|
var creator = this.$store.state.user.id |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
var subItem = {}; |
|
|
|
const subList = [] |
|
|
|
const creator = this.$store.state.user.id |
|
|
|
this.detailSource.forEach((item) => { |
|
|
|
item.subList.forEach((detail) => { |
|
|
|
const subItem = {} |
|
|
|
Object.assign(subItem, detail) |
|
|
|
subItem.itemCode = subItem.itemCode; |
|
|
|
subItem.itemName = detail.package.itemName; |
|
|
|
subItem.itemDesc1 = detail.package.itemDesc1; |
|
|
|
subItem.itemDesc2 = detail.package.itemDesc2; |
|
|
|
subItem.itemCode = subItem.itemCode |
|
|
|
subItem.itemName = detail.package.itemName |
|
|
|
subItem.itemDesc1 = detail.package.itemDesc1 |
|
|
|
subItem.itemDesc2 = detail.package.itemDesc2 |
|
|
|
|
|
|
|
subItem.fromInventoryStatus = subItem.inventoryStatus; |
|
|
|
subItem.toInventoryStatus = subItem.inventoryStatus; |
|
|
|
subItem.fromInventoryStatus = subItem.inventoryStatus |
|
|
|
subItem.toInventoryStatus = subItem.inventoryStatus |
|
|
|
|
|
|
|
subItem.fromQty = subItem.qty |
|
|
|
subItem.toQty = subItem.qty |
|
|
|
|
|
|
|
subItem.fromPackingNumber = subItem.packingNumber; |
|
|
|
subItem.toPackingNumber = subItem.packingNumber; |
|
|
|
subItem.fromPackingNumber = subItem.packingNumber |
|
|
|
subItem.toPackingNumber = subItem.packingNumber |
|
|
|
|
|
|
|
subItem.fromBatch = subItem.batch; |
|
|
|
subItem.toBatch = subItem.batch; |
|
|
|
subItem.fromLocationCode = subItem.fromLocationCode; |
|
|
|
subItem.package = "" |
|
|
|
subItem.Records = "" |
|
|
|
subItem.fromBatch = subItem.batch |
|
|
|
subItem.toBatch = subItem.batch |
|
|
|
subItem.fromLocationCode = subItem.fromLocationCode |
|
|
|
subItem.package = '' |
|
|
|
subItem.Records = '' |
|
|
|
subList.push(subItem) |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
this.dataContent.subList = subList; |
|
|
|
this.dataContent.creator = creator; |
|
|
|
return this.dataContent; |
|
|
|
this.dataContent.subList = subList |
|
|
|
this.dataContent.creator = creator |
|
|
|
return this.dataContent |
|
|
|
}, |
|
|
|
|
|
|
|
showMessage(message) { |
|
|
|
this.$refs.comMessage.showMessage(message, res => { |
|
|
|
if (res) {} |
|
|
|
}); |
|
|
|
this.$refs.comMessage.showMessage(message, (res) => { |
|
|
|
if (res) { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
showScanMessage(message) { |
|
|
|
this.$refs.comMessage.showScanMessage(message); |
|
|
|
this.$refs.comMessage.showScanMessage(message) |
|
|
|
}, |
|
|
|
|
|
|
|
afterCloseMessage() { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
this.scanPopupGetFocus() |
|
|
|
}, |
|
|
|
|
|
|
|
closeScanMessage() { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
this.scanPopupGetFocus() |
|
|
|
}, |
|
|
|
|
|
|
|
showCommitSuccessMessage(hint, pointData) { |
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
this.clearData(); |
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, (res) => { |
|
|
|
this.clearData() |
|
|
|
if (pointData.length > 0) { |
|
|
|
uni.navigateTo({ |
|
|
|
url: `/pages/point/index?points=${JSON.stringify(pointData)}` |
|
|
|
}); |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
clearData() { |
|
|
|
this.detailSource = [] |
|
|
|
this.fromLocationCode = ''; |
|
|
|
this.currentItemCode = "" |
|
|
|
this.fromLocationCode = '' |
|
|
|
this.currentItemCode = '' |
|
|
|
this.dataContent = {} |
|
|
|
this.itemCode="" |
|
|
|
this.itemCode = '' |
|
|
|
this.splitCount = 1 |
|
|
|
}, |
|
|
|
|
|
|
|
calcQty(val) { |
|
|
|
this.splitCount =val; |
|
|
|
this.splitCount = val |
|
|
|
// if(val<=0){ |
|
|
|
// this.showErrorMessage("数量必须大于0") |
|
|
|
// } |
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|
|
|
|
</style> |
|
|
|
<style scoped lang="scss"></style> |
|
|
|