lijuncheng
8 months ago
18 changed files with 1348 additions and 119 deletions
@ -0,0 +1,175 @@ |
|||
<template> |
|||
<view class="" style="background-color: #fff;"> |
|||
<uni-collapse ref="collapse" style="height: 500px;"> |
|||
<uni-collapse-item :open="true"> |
|||
<template v-slot:title> |
|||
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" |
|||
:isShowPackUnit="false"></itemCompareQty> |
|||
</template> |
|||
<package-list :dataContent="dataContent.subList" :isEdit="settingParam.allowModifyQty=='TRUE'" :settingParam="settingParam" @collapseChange="collapseChange"></package-list> |
|||
</uni-collapse-item> |
|||
</uni-collapse> |
|||
|
|||
<recommend-qty-edit ref=" receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm"> |
|||
</recommend-qty-edit> |
|||
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation' |
|||
:locationTypeList="locationTypeList"></win-scan-location> |
|||
<receipt-detail-info-popup ref="jobDetailPopup" :dataContent="showItem"></receipt-detail-info-popup> |
|||
<comMessage ref="message"></comMessage> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' |
|||
import recommend from '@/mycomponents/recommend/recommend.vue' |
|||
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue' |
|||
import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue' |
|||
import receiptDetailInfoPopup from '@/pages/purchaseReceipt/coms/receiptDetailInfoPopup.vue' |
|||
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|||
import pack from '@/mycomponents/balance/pack.vue' |
|||
import detailList from '@/mycomponents/detail/detailList.vue' |
|||
import packageList from '@/mycomponents/package/packageList.vue' |
|||
|
|||
import { |
|||
getDetailOption, |
|||
getPurchaseReceiptOption |
|||
} from '@/common/array.js'; |
|||
|
|||
export default { |
|||
components: { |
|||
itemCompareQty, |
|||
recommend, |
|||
recommendQtyEdit, |
|||
jobDetailPopup, |
|||
receiptDetailInfoPopup, |
|||
winScanLocation, |
|||
detailList, |
|||
packageList |
|||
}, |
|||
props: { |
|||
dataContent: { |
|||
type: Object, |
|||
default: null |
|||
}, |
|||
settingParam: { |
|||
type: Object, |
|||
default: null |
|||
}, |
|||
locationTypeList: { |
|||
type: Object, |
|||
default: null |
|||
}, |
|||
|
|||
|
|||
}, |
|||
watch: { |
|||
|
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
showItem: {}, |
|||
editItem: { |
|||
record: { |
|||
|
|||
} |
|||
}, |
|||
locatonItem: {}, |
|||
detailOptions: [], |
|||
scanOptions: [] |
|||
} |
|||
}, |
|||
|
|||
mounted() { |
|||
if (this.detailOptions.length == 0) { |
|||
this.detailOptions = getDetailOption(); |
|||
} |
|||
if (this.scanOptions.length == 0) { |
|||
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam |
|||
.allowModifyLocation) |
|||
} |
|||
|
|||
|
|||
}, |
|||
|
|||
updated() { |
|||
console.log('updated') |
|||
}, |
|||
|
|||
methods: { |
|||
collapseChange(){ |
|||
setTimeout(() => { |
|||
this.resizeCollapse(); |
|||
}, 500) |
|||
}, |
|||
|
|||
resizeCollapse() { |
|||
this.$nextTick(r => { |
|||
this.$refs.collapse.resize() |
|||
}); |
|||
this.$forceUpdate(); |
|||
}, |
|||
|
|||
|
|||
refreshCollapse() { |
|||
this.$nextTick(r => { |
|||
this.$refs.collapse.forEach(r => { |
|||
r.childrens.forEach(i => { |
|||
i.init(); |
|||
}) |
|||
r.resize(); |
|||
}) |
|||
}); |
|||
this.$forceUpdate(); |
|||
}, |
|||
|
|||
swipeClick(e, item) { |
|||
if (e.content.text == "详情") { |
|||
this.detail(item) |
|||
} else if (e.content.text == "编辑") { |
|||
this.edit(item) |
|||
} else if (e.content.text == "库位") { |
|||
this.showLocation(item) |
|||
} else if (e.content.text == "移除") { |
|||
this.remove(item) |
|||
} |
|||
}, |
|||
edit(item) { |
|||
this.editItem = item; |
|||
this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty, item.labelQty); |
|||
}, |
|||
showLocation(item) { |
|||
this.locatonItem = item; |
|||
this.$refs.scanLocationCode.openScanPopup(); |
|||
}, |
|||
//扫描源库位 |
|||
getLocation(location, code) { |
|||
this.locatonItem.toLocationCode = code; |
|||
this.$emit('updateData') |
|||
}, |
|||
|
|||
detail(item) { |
|||
this.showItem = item; |
|||
this.$refs.jobDetailPopup.openPopup(item) |
|||
}, |
|||
remove(item) { |
|||
this.$refs.message.showQuestionMessage("确定移除扫描信息?", |
|||
res => { |
|||
if (res) { |
|||
item.scaned = false |
|||
item.handleQty = null |
|||
this.$forceUpdate() |
|||
this.$emit('remove', item) |
|||
} |
|||
}); |
|||
}, |
|||
confirm(qty) { |
|||
this.editItem.handleQty = qty; |
|||
this.$emit('updateData') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
@ -0,0 +1,168 @@ |
|||
<template> |
|||
<view :class="dataContent.scaned?'scan_view':''" style="background-color: #fff; "> |
|||
<!-- border-bottom: 1upx solid #EEEEEE; --> |
|||
<view class="uni-flex uni-row space-between" style="align-items: center"> |
|||
<!-- uni-inline-item 暂时拿掉--> |
|||
<view style="word-break: break-all;"> |
|||
<!-- <container v-if="isShowContainer&&dataContent.containerNumber!=null" :container="dataContent.containerNumber"> |
|||
</container> --> |
|||
<pack v-if="isShowPack && dataContent.packingNumber!=null" :packingCode="dataContent.packingNumber"></pack> |
|||
<batch v-if="isShowBatch && dataContent.batch!=null" :batch="dataContent.batch"></batch> |
|||
<location v-if="isShowFromLocation" title="来源库位" :locationCode="dataContent.fromLocationCode"> |
|||
</location> |
|||
<!-- <to-location></to-location> --> |
|||
<to-location v-if="isShowToLocation" title="目标库位" :locationCode="dataContent.toLocationCode"> |
|||
</to-location> |
|||
</view> |
|||
<view class="uni-flex uni-row" style="word-break: break-all;"> |
|||
<qty v-if="true" :dataContent="dataContent" |
|||
:isShowStdPack="isShowStdPack" :isShowStatus="isShowStatus"></qty> |
|||
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)" |
|||
:handleQty="dataContent.handleQty" :isShowStatus="false" :isShowPack="isShowPack"> |
|||
</compare-qty> |
|||
|
|||
<view class="uni-flex uni-row center" style="vertical-align:center ;" v-if="isDevlement()"> |
|||
<text style="font-size: 25rpx;color: #2979ff; width: 45rpx; " @click="copy">复制</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import qty from '@/mycomponents/qty/qty.vue' |
|||
import container from '@/mycomponents/container/container.vue' |
|||
import pack from '@/mycomponents/balance/pack.vue' |
|||
import location from '@/mycomponents/balance/location.vue' |
|||
import toLocation from '@/mycomponents/balance/toLocation.vue' |
|||
import batch from '@/mycomponents/balance/batch.vue' |
|||
import recommendQty from '@/mycomponents/qty/recommendQty.vue' |
|||
import compareQty from '@/mycomponents/qty/compareQty.vue' |
|||
import config from '@/static/config.js' |
|||
import balanceQty from '@/mycomponents/qty/balanceQty.vue' |
|||
|
|||
export default { |
|||
components: { |
|||
container, |
|||
pack, |
|||
location, |
|||
toLocation, |
|||
batch, |
|||
recommendQty, |
|||
compareQty, |
|||
balanceQty, |
|||
qty |
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
}, |
|||
props: { |
|||
dataContent: { |
|||
type: Object, |
|||
default: {} |
|||
}, |
|||
isShowContainer: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
isShowPack: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
isShowBatch: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
isShowFromLocation: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
isShowToLocation: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
isShowStatus: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
|
|||
locationTitle: { |
|||
type: String, |
|||
default: '库位' |
|||
}, |
|||
isShowBalanceQty: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
showPack: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
|
|||
}, |
|||
watch: { |
|||
|
|||
}, |
|||
methods: { |
|||
copy() { |
|||
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 |
|||
var content = "HPQ;V1.0;I" + this.dataContent.itemCode + ";P" + this.dataContent.packingNumber + ";B" + this.dataContent |
|||
.batch + ";Q" + this.dataContent.qty |
|||
// #ifdef H5 |
|||
this.$copyText(content).then( |
|||
res => { |
|||
uni.showToast({ |
|||
title: '复制采购标签成功', |
|||
icon: 'none' |
|||
}) |
|||
} |
|||
) |
|||
// #endif |
|||
// #ifndef H5 |
|||
uni.setClipboardData({ |
|||
data: content, |
|||
success: () => { |
|||
uni.showToast({ |
|||
title: '复制采购标签成功' |
|||
}) |
|||
} |
|||
}) |
|||
// #endif |
|||
}, |
|||
copyPro() { |
|||
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 |
|||
var content = "HMQ;V1.0;I" + this.dataContent.itemCode + ";P" + this.dataContent.packingNumber + ";B" + this.dataContent |
|||
.batch + ";Q" + this.dataContent.qty |
|||
// #ifdef H5 |
|||
this.$copyText(content).then( |
|||
res => { |
|||
uni.showToast({ |
|||
title: '复制制品标签成功', |
|||
icon: 'none' |
|||
}) |
|||
} |
|||
) |
|||
// #endif |
|||
// #ifndef H5 |
|||
uni.setClipboardData({ |
|||
data: content, |
|||
success: () => { |
|||
uni.showToast({ |
|||
title: '复制制品标签成功' |
|||
}) |
|||
} |
|||
}) |
|||
// #endif |
|||
}, |
|||
isDevlement() { |
|||
return config.isDevelopment; |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
@ -0,0 +1,195 @@ |
|||
<template> |
|||
<view class=""> |
|||
<view class="" v-for="(item,index) in dataContent" :key="item.id"> |
|||
<uni-collapse ref="collapse2" @change="collapseChange"> |
|||
<uni-collapse-item :disabled="false"> |
|||
<template v-slot:title> |
|||
<packageRecordCard :dataContent="item" :isShowLocation="false" |
|||
:isShowFromLocation="false"></packageRecordCard> |
|||
</template> |
|||
<view v-for="(pack,index) in item.packList" :key="pack.id" style=" width: 100%; background-color: antiquewhite;"> |
|||
<uni-swipe-action-item :right-options="editAndRemoveOptions" |
|||
@click="swipeClick($event,pack)"> |
|||
<packageRecordCard :dataContent="pack" :isShowLocation="false" :isShowFromLocation="false" |
|||
:isShowToLocation="false" :isShowBatch="false"></packageRecordCard> |
|||
</uni-swipe-action-item> |
|||
|
|||
</view> |
|||
</uni-collapse-item> |
|||
</uni-collapse> |
|||
</view> |
|||
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm"></balance-qty-edit> |
|||
</view> |
|||
</template> |
|||
|
|||
|
|||
<script> |
|||
import config from '@/static/config.js' |
|||
import packageRecordCard from '@/mycomponents/package/packageRecordCard.vue' |
|||
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' |
|||
|
|||
import { |
|||
getRemoveOption, |
|||
getEditRemoveOption |
|||
} from '@/common/array.js'; |
|||
export default { |
|||
emits: ["collapseChange"], |
|||
components: { |
|||
packageRecordCard, |
|||
balanceQtyEdit |
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
editItem: {}, |
|||
options: [], |
|||
removeOptions: [], |
|||
editAndRemoveOptions:[] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.removeOptions = getRemoveOption(); |
|||
this.editAndRemoveOptions =getEditRemoveOption() |
|||
}, |
|||
props: { |
|||
dataContent: { |
|||
type: Object, |
|||
default: null |
|||
}, |
|||
isShowContainer: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
isShowPack: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
isShowBatch: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
isShowFromLocation: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
isShowToLocation: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
isShowStatus: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
|
|||
locationTitle: { |
|||
type: String, |
|||
default: '库位' |
|||
}, |
|||
settingParam: { |
|||
type: Object, |
|||
default: null |
|||
}, |
|||
isEdit:{ |
|||
type: Boolean, |
|||
default: false |
|||
} |
|||
|
|||
}, |
|||
watch: { |
|||
|
|||
}, |
|||
methods: { |
|||
swipeClick(e, item) { |
|||
if (e.content.text == "编辑") { |
|||
// this.edit(item) |
|||
} |
|||
}, |
|||
// edit(item) { |
|||
// this.editItem = item; |
|||
// this.$refs.balanceQtyEdit.openEditPopup(this.editItem, this.editItem.qty); |
|||
// }, |
|||
collapseChange() { |
|||
this.$emit("collapseChange"); |
|||
this.resizeCollapse(); |
|||
}, |
|||
resizeCollapse() { |
|||
this.$nextTick(r => { |
|||
this.$refs.collapse2.forEach(r => { |
|||
r.childrens.forEach(i => { |
|||
i.init(); |
|||
}) |
|||
r.resize(); |
|||
}) |
|||
|
|||
}); |
|||
this.$forceUpdate(); |
|||
}, |
|||
|
|||
copy() { |
|||
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 |
|||
var content = "HPQ;V1.0;I" + this.detail.itemCode + ";P" + this.detail.packingNumber + ";B" + this.detail |
|||
.batch + ";Q" + this.detail.qty |
|||
// #ifdef H5 |
|||
this.$copyText(content).then( |
|||
res => { |
|||
uni.showToast({ |
|||
title: '复制采购标签成功', |
|||
icon: 'none' |
|||
}) |
|||
} |
|||
) |
|||
// #endif |
|||
// #ifndef H5 |
|||
uni.setClipboardData({ |
|||
data: content, |
|||
success: () => { |
|||
uni.showToast({ |
|||
title: '复制采购标签成功' |
|||
}) |
|||
} |
|||
}) |
|||
// #endif |
|||
}, |
|||
copyPro() { |
|||
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 |
|||
var content = "HMQ;V1.0;I" + this.detail.itemCode + ";P" + this.detail.packingNumber + ";B" + this.detail |
|||
.batch + ";Q" + this.detail.qty |
|||
// #ifdef H5 |
|||
this.$copyText(content).then( |
|||
res => { |
|||
uni.showToast({ |
|||
title: '复制制品标签成功', |
|||
icon: 'none' |
|||
}) |
|||
} |
|||
) |
|||
// #endif |
|||
// #ifndef H5 |
|||
uni.setClipboardData({ |
|||
data: content, |
|||
success: () => { |
|||
uni.showToast({ |
|||
title: '复制制品标签成功' |
|||
}) |
|||
} |
|||
}) |
|||
// #endif |
|||
}, |
|||
isDevlement() { |
|||
return config.isDevelopment; |
|||
}, |
|||
confirm(qty){ |
|||
this.editItem.qty =qty; |
|||
this.$emit('updateData') |
|||
} |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
.open { |
|||
/* background-color: green !important; */ |
|||
padding-top: 0px !important; |
|||
} |
|||
</style> |
@ -0,0 +1,173 @@ |
|||
<template> |
|||
<view class="" style="background-color: #fff;"> |
|||
<uni-collapse ref="collapse" style="height: 500px;"> |
|||
<uni-collapse-item :open="true"> |
|||
<template v-slot:title> |
|||
<itemQty :dataContent="dataContent" :handleQty="dataContent.handleQty" |
|||
:isShowPackUnit="false"></itemQty> |
|||
</template> |
|||
<packageRecordList :dataContent="dataContent.subList" :isEdit="settingParam.allowModifyQty=='TRUE'" :settingParam="settingParam" @collapseChange="collapseChange"></packageRecordList> |
|||
</uni-collapse-item> |
|||
</uni-collapse> |
|||
|
|||
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm"> |
|||
</recommend-qty-edit> |
|||
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation' |
|||
:locationTypeList="locationTypeList"></win-scan-location> |
|||
<receipt-detail-info-popup ref="jobDetailPopup" :dataContent="showItem"></receipt-detail-info-popup> |
|||
<comMessage ref="message"></comMessage> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import itemQty from '@/mycomponents/item/itemQty.vue' |
|||
import recommend from '@/mycomponents/recommend/recommend.vue' |
|||
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue' |
|||
import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue' |
|||
import receiptDetailInfoPopup from '@/pages/purchaseReceipt/coms/receiptDetailInfoPopup.vue' |
|||
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|||
import pack from '@/mycomponents/balance/pack.vue' |
|||
import packageRecordList from '@/mycomponents/package/packageRecordList.vue' |
|||
|
|||
import { |
|||
getDetailOption, |
|||
getPurchaseReceiptOption |
|||
} from '@/common/array.js'; |
|||
|
|||
export default { |
|||
components: { |
|||
itemQty, |
|||
recommend, |
|||
recommendQtyEdit, |
|||
jobDetailPopup, |
|||
receiptDetailInfoPopup, |
|||
winScanLocation, |
|||
packageRecordList |
|||
}, |
|||
props: { |
|||
dataContent: { |
|||
type: Object, |
|||
default: null |
|||
}, |
|||
settingParam: { |
|||
type: Object, |
|||
default: null |
|||
}, |
|||
locationTypeList: { |
|||
type: Object, |
|||
default: null |
|||
}, |
|||
|
|||
|
|||
}, |
|||
watch: { |
|||
|
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
showItem: {}, |
|||
editItem: { |
|||
record: { |
|||
|
|||
} |
|||
}, |
|||
locatonItem: {}, |
|||
detailOptions: [], |
|||
scanOptions: [] |
|||
} |
|||
}, |
|||
|
|||
mounted() { |
|||
if (this.detailOptions.length == 0) { |
|||
this.detailOptions = getDetailOption(); |
|||
} |
|||
if (this.scanOptions.length == 0) { |
|||
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam |
|||
.allowModifyLocation) |
|||
} |
|||
|
|||
|
|||
}, |
|||
|
|||
updated() { |
|||
console.log('updated') |
|||
}, |
|||
|
|||
methods: { |
|||
collapseChange(){ |
|||
setTimeout(() => { |
|||
this.resizeCollapse(); |
|||
}, 500) |
|||
}, |
|||
|
|||
resizeCollapse() { |
|||
this.$nextTick(r => { |
|||
this.$refs.collapse.resize() |
|||
}); |
|||
this.$forceUpdate(); |
|||
}, |
|||
|
|||
|
|||
refreshCollapse() { |
|||
this.$nextTick(r => { |
|||
this.$refs.collapse.forEach(r => { |
|||
r.childrens.forEach(i => { |
|||
i.init(); |
|||
}) |
|||
r.resize(); |
|||
}) |
|||
}); |
|||
this.$forceUpdate(); |
|||
}, |
|||
|
|||
swipeClick(e, item) { |
|||
if (e.content.text == "详情") { |
|||
this.detail(item) |
|||
} else if (e.content.text == "编辑") { |
|||
this.edit(item) |
|||
} else if (e.content.text == "库位") { |
|||
this.showLocation(item) |
|||
} else if (e.content.text == "移除") { |
|||
this.remove(item) |
|||
} |
|||
}, |
|||
edit(item) { |
|||
this.editItem = item; |
|||
this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty, item.labelQty); |
|||
}, |
|||
showLocation(item) { |
|||
this.locatonItem = item; |
|||
this.$refs.scanLocationCode.openScanPopup(); |
|||
}, |
|||
//扫描源库位 |
|||
getLocation(location, code) { |
|||
this.locatonItem.toLocationCode = code; |
|||
this.$emit('updateData') |
|||
}, |
|||
|
|||
detail(item) { |
|||
this.showItem = item; |
|||
this.$refs.jobDetailPopup.openPopup(item) |
|||
}, |
|||
remove(item) { |
|||
this.$refs.message.showQuestionMessage("确定移除扫描信息?", |
|||
res => { |
|||
if (res) { |
|||
item.scaned = false |
|||
item.handleQty = null |
|||
this.$forceUpdate() |
|||
this.$emit('remove', item) |
|||
} |
|||
}); |
|||
}, |
|||
confirm(qty) { |
|||
this.editItem.handleQty = qty; |
|||
this.$emit('updateData') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
@ -0,0 +1,454 @@ |
|||
<template> |
|||
<view> |
|||
<uni-popup ref="popup" @change="change" @maskClick="closeScanPopup()"> |
|||
<view class="popup_box"> |
|||
<view class="pop_title uni-flex space-between"> |
|||
<view class="" style="font-size: 35rpx;"> |
|||
扫描{{title}} |
|||
</view> |
|||
|
|||
<view class=""> |
|||
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg" |
|||
@click="closeScanPopup()"></image> |
|||
</view> |
|||
</view> |
|||
<view class="uni-flex uni-row" style="align-items: center; |
|||
background-color: #fff; |
|||
margin-left: 20rpx; |
|||
margin-right: 20rpx; |
|||
border-radius: 8rpx; |
|||
height: 30px;"> |
|||
<view class="uni-center" style="width: 25%; "> |
|||
来源库位 |
|||
</view> |
|||
<!-- style="width: 75%;padding: 8rpx" --> |
|||
<view class=""> |
|||
<!-- <input v-model="fromLocationCode" placeholder="请扫描来源库位" :focus="locationOnFocus" |
|||
placeholder-style="font-size:12px" style="padding: 5px;" @confirm="scanLocation" /> --> |
|||
|
|||
<view v-if='allowModifyLocation'> |
|||
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请扫描来源库位" |
|||
@confirm="" style='height: 30rpx;border:1px solid #fff ;'></uni-combox> |
|||
</view> |
|||
<view v-else> |
|||
<text style="padding: 5px"> |
|||
{{fromLocationCode}} |
|||
</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class=""> |
|||
<view class=""> |
|||
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" |
|||
:isShowHistory="isShowHistory" :clearResult="true" :headerType="headerType"></win-com-scan> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</uni-popup> |
|||
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select> |
|||
</view> |
|||
<comMessage ref="comMessage"></comMessage> |
|||
</template> |
|||
|
|||
<script> |
|||
import winComScan from '@/mycomponents/scan/winComScan.vue' |
|||
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' |
|||
import { |
|||
getBalanceByManagementPrecision, |
|||
} from '@/common/balance.js'; |
|||
|
|||
import { |
|||
getBasicLocationByCode, |
|||
} from '@/api/request2.js'; |
|||
|
|||
import { |
|||
getListLocationTypeDesc, |
|||
checkDirectoryItemExist, |
|||
getDirectoryItemArray, |
|||
getLocationTypeName, |
|||
getInventoryStatusDesc |
|||
} from '@/common/directory.js'; |
|||
export default { |
|||
name: 'winScanPack', |
|||
emits: ["getResult", "close", "getCountScanResult"], |
|||
components: { |
|||
winComScan, |
|||
balanceSelect |
|||
}, |
|||
props: { |
|||
title: { |
|||
type: String, |
|||
default: '箱标签' |
|||
}, |
|||
isShowHistory: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
allowNullBalance: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
//不提示库存 |
|||
noShowBalanceMessage: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
//是否允许修改库位 |
|||
allowModifyLocation: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
headerType: { |
|||
type: String, |
|||
default: "HPQ,HMQ" |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
scanResult: {}, |
|||
show: false, |
|||
scanList: [], |
|||
expand: false, |
|||
showScanResult: {}, |
|||
expendIcon: 'arrow-down', |
|||
fromLocationCode: '', |
|||
fromLocation: '', |
|||
fromLocationList: [], |
|||
fromLocationTypeArray: [], |
|||
locationOnFocus: false, |
|||
businessType: {}, |
|||
inventoryStatus: [], |
|||
managementPrecision: '', |
|||
fromInventoryStatuses: "", |
|||
isCheck:false |
|||
} |
|||
}, |
|||
created() { |
|||
|
|||
}, |
|||
methods: { |
|||
//直接扫描 |
|||
openScanPopupForType(fromLocationCode, businessType) { |
|||
this.businessType = businessType; |
|||
this.fromLocationCode = fromLocationCode; |
|||
if (fromLocationCode != '') { |
|||
this.packGetFocus(); |
|||
} else { |
|||
this.locationGetFocus(); |
|||
} |
|||
this.fromInventoryStatuses = this.businessType.outInventoryStatuses |
|||
this.inventoryStatus = getDirectoryItemArray(this.businessType.outInventoryStatuses); //出库库存状态 |
|||
this.fromLocationTypeArray = getDirectoryItemArray(this.businessType.outLocationTypes); //出库库存状态 |
|||
setTimeout(res => { |
|||
this.$refs.popup.open('bottom') |
|||
}, 500) |
|||
}, |
|||
|
|||
//在任务中扫描 |
|||
openScanPopupForJob(fromLocationCode, fromLocationList, jobContent) { |
|||
this.fromLocationCode = fromLocationCode; |
|||
this.fromLocationList = fromLocationList; |
|||
if (fromLocationCode != '') { |
|||
this.packGetFocus(); |
|||
} else { |
|||
if (this.fromLocationList.length == 0) { |
|||
this.locationGetFocus(); |
|||
} else { |
|||
this.fromLocationCode = this.fromLocationList[0]; |
|||
} |
|||
} |
|||
setTimeout(res => { |
|||
this.$refs.popup.open('bottom') |
|||
}, 500) |
|||
this.fromInventoryStatuses = jobContent.outInventoryStatuses |
|||
this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //出库库存状态; //出库库存状态 |
|||
this.fromLocationTypeArray = getDirectoryItemArray(jobContent.fromLocationTypes); //出库库存状态 |
|||
}, |
|||
|
|||
closeScanPopup(content) { |
|||
this.$refs.popup.close(); |
|||
this.$emit("close", ''); |
|||
}, |
|||
|
|||
|
|||
scanLocation(scanResult) { |
|||
var isCheck = false; |
|||
if (this.fromLocationCode == '') { |
|||
this.showErrorMessage('来源库位不能为空', callback => { |
|||
this.locationGetFocus(); |
|||
}) |
|||
return; |
|||
} |
|||
|
|||
if(this.fromLocationList.length>0){ |
|||
if(!this.isInLocationList(this.fromLocationCode)){ |
|||
this.showErrorMessage("扫描库位【"+this.fromLocationCode+'】不在任务来源库位中', callback => { |
|||
this.locationGetFocus(); |
|||
}) |
|||
return; |
|||
} |
|||
} |
|||
|
|||
uni.showLoading({ |
|||
title: '扫描中...', |
|||
mask: true |
|||
}); |
|||
getBasicLocationByCode(this.fromLocationCode).then(res => { |
|||
if (res.data.total > 0) { |
|||
let result = res.data.list[0]; |
|||
var type = result.type; |
|||
var available = result.available; |
|||
if (available == "TRUE") { |
|||
if (checkDirectoryItemExist(this.fromLocationTypeArray, type)) { |
|||
this.location = result; |
|||
// this.packGetFocus(); |
|||
this.checkPackage(scanResult); |
|||
} else { |
|||
uni.hideLoading(); |
|||
var hint = getListLocationTypeDesc(this.fromLocationTypeArray); |
|||
this.showErrorMessage("库位[" + this.fromLocationCode + "]是" + |
|||
getLocationTypeName(type) + ",<br>需要的库位类型是[" + hint + "]", callback => { |
|||
this.locationGetFocus(); |
|||
}) |
|||
} |
|||
} else { |
|||
uni.hideLoading(); |
|||
this.showErrorMessage("扫描库位[" + this.fromLocationCode + "]不可用", res => { |
|||
this.locationGetFocus(); |
|||
}) |
|||
} |
|||
} else { |
|||
uni.hideLoading(); |
|||
this.showErrorMessage('未查询到库位[' + this.fromLocationCode + ']', res => { |
|||
this.locationGetFocus(); |
|||
}) |
|||
} |
|||
}).catch(error => { |
|||
uni.hideLoading(); |
|||
this.showErrorMessage(error, res => { |
|||
this.locationGetFocus(); |
|||
}) |
|||
}) |
|||
}, |
|||
|
|||
getScanResult(result) { |
|||
// console.log("扫描", result) |
|||
// if (this.fromLocationCode == '' || this.fromLocationCode == null) { |
|||
// this.showMessage('请先扫描来源库位', callback => { |
|||
// this.locationGetFocus(); |
|||
// }) |
|||
// return; |
|||
// } else |
|||
this.scanLocation(result); |
|||
// debugger |
|||
// if(this.isCheck){ |
|||
// this.checkPackage(result); |
|||
// } |
|||
}, |
|||
|
|||
checkPackage(result){ |
|||
if (result.label != null) { |
|||
this.scanResult = result; |
|||
// uni.showLoading({ |
|||
// title: '查询中...', |
|||
// mask: true |
|||
// }) |
|||
getBalanceByManagementPrecision(result.label, this.fromLocationCode, this.fromInventoryStatuses, |
|||
res => { |
|||
uni.hideLoading(); |
|||
if (res.success) { |
|||
this.managementPrecision = res.managementPrecision |
|||
this.afterQueryBalance(res.data.list); |
|||
} else { |
|||
this.showErrorMessage(res.message, res => { |
|||
this.packGetFocus(); |
|||
}) |
|||
} |
|||
// uni.hideLoading(); |
|||
}); |
|||
} |
|||
}, |
|||
|
|||
|
|||
afterQueryBalance(datas) { |
|||
if (this.allowNullBalance) { |
|||
this.allowNoneBalance(datas); |
|||
} else if (this.noShowBalanceMessage) { |
|||
this.countCallBack(datas); |
|||
} else { |
|||
this.mustHavaBalance(datas); |
|||
} |
|||
uni.hideLoading(); |
|||
}, |
|||
|
|||
//允许无库存 |
|||
allowNoneBalance(datas) { |
|||
this.packCallBack(null); |
|||
// if (datas.length == 0) { |
|||
// this.packCallBack(null); |
|||
// } else { |
|||
// this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],已经查找到该包装的库存记录,请重新扫描', res => { |
|||
// this.packGetFocus(); |
|||
// }) |
|||
// } |
|||
}, |
|||
|
|||
//必须有库存 |
|||
mustHavaBalance(datas) { |
|||
if (datas.length == 0) { |
|||
this.showErrorMessage(this.getQueryCondition() + '<br>未查找到库存记录', res => { |
|||
this.packGetFocus(); |
|||
}) |
|||
} else if (datas.length == 1) { |
|||
let balance = datas[0]; |
|||
this.packCallBack(balance); |
|||
|
|||
//因为盘点时有负库存,暂时去掉判断 2023年12月28日 |
|||
|
|||
// if (balance.qty > 0) { |
|||
// this.packCallBack(balance); |
|||
// } else { |
|||
// this.showErrorMessage(this.getQueryCondition() + '<br>查找到库存记录数量为[' + balance.qty + "],<br>不可以进行操作", |
|||
// res => { |
|||
// this.packGetFocus(); |
|||
// }) |
|||
// } |
|||
} else { |
|||
this.showBalanceSelect(datas); |
|||
} |
|||
}, |
|||
|
|||
showBalanceSelect(items) { |
|||
this.$refs.balanceSelect.openPopup(items); |
|||
}, |
|||
|
|||
selectBalanceItem(balance) { |
|||
this.packCallBack(balance); |
|||
//因为盘点时有负库存,暂时去掉判断 2023年12月28日 |
|||
// if (balance.qty > 0) { |
|||
// this.packCallBack(balance); |
|||
// } else { |
|||
// this.showErrorMessage(this.getQueryCondition() + '<br>查找到库存记录数量为[' + balance.qty + "],不可以进行操作", |
|||
// res => { |
|||
// this.packGetFocus(); |
|||
// }) |
|||
// } |
|||
}, |
|||
|
|||
//盘点回调 |
|||
countCallBack(datas) { |
|||
this.$refs.comscan.clear(); |
|||
//返回标签信息、库存信息和管理模式 |
|||
let data = { |
|||
label: this.scanResult.label, |
|||
package: this.scanResult.package, |
|||
balance: datas, |
|||
fromLocationCode: this.fromLocationCode, |
|||
} |
|||
this.packGetFocus(); |
|||
this.$emit("getCountScanResult", data); |
|||
}, |
|||
|
|||
packCallBack(item) { |
|||
this.$refs.comscan.clear(); |
|||
//返回标签信息、库存信息和管理模式 |
|||
let data = { |
|||
label: this.scanResult.label, |
|||
package: this.scanResult.package, |
|||
balance: item, |
|||
fromLocationCode: this.fromLocationCode, |
|||
} |
|||
this.packGetFocus(); |
|||
this.$emit("getResult", data); |
|||
}, |
|||
|
|||
packGetFocus() { |
|||
if (this.$refs.comscan != undefined) { |
|||
this.$refs.comscan.getfocus(); |
|||
} |
|||
}, |
|||
|
|||
packLoseFocus() { |
|||
if (this.$refs.comscan != undefined) { |
|||
this.$refs.comscan.losefocus(); |
|||
} |
|||
}, |
|||
|
|||
locationGetFocus() { |
|||
this.fromLocationCode = ''; |
|||
this.locationOnFocus = true; |
|||
}, |
|||
|
|||
getQueryCondition() { |
|||
let condition = '按照以下条件:<br>'; |
|||
let label = this.scanResult.label; |
|||
let status = getInventoryStatusDesc(this.inventoryStatus); |
|||
switch (this.managementPrecision) { |
|||
case 'BY_PACKAGING': |
|||
condition = condition + '物料号=[' + label.itemCode + ']<br>箱码=[' + label.packingNumber + |
|||
']<br>批次=[' + |
|||
label.batch + |
|||
']<br>库位=[' + this.fromLocationCode + ']' |
|||
|
|||
break; |
|||
case 'BY_BATCH': |
|||
condition = condition + '物料号=[' + label.itemCode + ']<br>批次=[' + |
|||
label.batch + |
|||
']<br>库位=[' + this.fromLocationCode + ']' |
|||
break; |
|||
case 'BY_QUANTITY': |
|||
condition = condition + '物料号=[' + label.itemCode + ']<br>库位=[' + this.fromLocationCode + ']' |
|||
break; |
|||
case 'BY_UNIQUEID': |
|||
condition = condition + '物料号=[' + label.itemCode + ']' |
|||
break; |
|||
} |
|||
if (this.inventoryStatus.length > 0) { |
|||
condition = condition + '<br>库存状态=[' + status + ']' |
|||
} |
|||
return condition; |
|||
}, |
|||
|
|||
|
|||
showMessage(message, callback) { |
|||
setTimeout(r => { |
|||
this.packLoseFocus(); |
|||
this.$refs.comMessage.showMessage(message, callback); |
|||
}) |
|||
}, |
|||
|
|||
showErrorMessage(message, callback) { |
|||
setTimeout(r => { |
|||
this.packLoseFocus(); |
|||
this.$refs.comMessage.showErrorMessage(message, callback) |
|||
}) |
|||
}, |
|||
|
|||
change(e) { |
|||
this.show = e.show |
|||
}, |
|||
isInLocationList(location) { |
|||
|
|||
var item = this.fromLocationList.find(res => res == location) |
|||
|
|||
if (item = undefined) { |
|||
return false |
|||
} |
|||
return true |
|||
}, |
|||
addLocationCode(code) { |
|||
if (!this.isInLocationList(code)) { |
|||
this.fromLocationList.push(code) |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.scroll-view { |
|||
overflow-y: scroll; |
|||
height: auto; |
|||
max-height: 300rpx; |
|||
} |
|||
</style> |
Loading…
Reference in new issue