lijuncheng
10 months ago
11 changed files with 283 additions and 50 deletions
@ -0,0 +1,24 @@ |
|||
<template> |
|||
<view class="card_view "> |
|||
<text class="card_container card_content ">托码</text> |
|||
<text class="card_content ">{{container}}</text> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return {} |
|||
}, |
|||
props: { |
|||
container: { |
|||
type: String, |
|||
default: "" |
|||
} |
|||
}, |
|||
|
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
@ -0,0 +1,134 @@ |
|||
<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=""> |
|||
<view class=""> |
|||
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" :headerType="headerType" |
|||
:isShowHistory="isShowHistory" :clearResult="true"></win-com-scan> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</uni-popup> |
|||
<com-message ref="comMessage" @afterClose="getfocus"></com-message> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import winComScan from '@/mycomponents/scan/winComScan.vue' |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
import { |
|||
getInventoryLabel, |
|||
getContainerByNumber |
|||
} from '@/api/request2.js'; |
|||
|
|||
export default { |
|||
name: 'winScanPack', |
|||
components: { |
|||
winComScan, |
|||
comMessage |
|||
}, |
|||
props: { |
|||
title: { |
|||
type: String, |
|||
default: '箱标签或托标签' |
|||
}, |
|||
isShowHistory: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
headerType:{ |
|||
type: String, |
|||
default: 'HPQ,HMQ,HCQ' |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
show: false, |
|||
} |
|||
}, |
|||
created() { |
|||
|
|||
}, |
|||
methods: { |
|||
openScanPopup() { |
|||
this.$refs.popup.open('bottom'); |
|||
}, |
|||
|
|||
closeScanPopup() { |
|||
this.$refs.popup.close(); |
|||
this.$emit("close", ''); |
|||
}, |
|||
|
|||
scanClick() { |
|||
this.$refs.comscan.clickScanMsg(); |
|||
}, |
|||
|
|||
cancelClick() { |
|||
this.$refs.comscan.clearScanValue(); |
|||
}, |
|||
|
|||
getScanResult(result) { |
|||
if (result.success) { |
|||
if(result.label.labelType=="ContainerLabel"){ |
|||
this.getContainerByNumber(result); |
|||
}else { |
|||
this.$emit("getResult", result); |
|||
} |
|||
} else { |
|||
this.showMessage(result.message) |
|||
} |
|||
}, |
|||
|
|||
getContainerByNumber(result){ |
|||
getContainerByNumber(result.label.container).then(res => { |
|||
if (res.data.list.length > 0) { |
|||
this.$emit("getResult", result); |
|||
} else { |
|||
this.showMessage('未查找到托码【' + result.label.container + '】'); |
|||
} |
|||
|
|||
}).catch(error => { |
|||
this.showMessage(error); |
|||
}) |
|||
}, |
|||
|
|||
getfocus() { |
|||
if (this.$refs.comscan != undefined) { |
|||
this.$refs.comscan.getfocus(); |
|||
} |
|||
}, |
|||
|
|||
losefocus() { |
|||
if (this.$refs.comscan != undefined) { |
|||
this.$refs.comscan.losefocus(); |
|||
} |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
change(e) { |
|||
this.show = e.show |
|||
}, |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.scroll-view { |
|||
overflow-y: scroll; |
|||
height: auto; |
|||
max-height: 300rpx; |
|||
} |
|||
</style> |
Loading…
Reference in new issue