|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<view class="sendOutGoods-wrap">
|
|
<view class="sendOutGoods-wrap">
|
|
<view class="sendOutGoods-con">
|
|
<view class="sendOutGoods-con">
|
|
- <view class="barCode" id="barcode"></view>
|
|
|
|
|
|
+ <!-- <view class="barCode" id="barcode"></view> -->
|
|
<view class="info-body">
|
|
<view class="info-body">
|
|
<view class="info partList">
|
|
<view class="info partList">
|
|
<!-- 补货产品 -->
|
|
<!-- 补货产品 -->
|
|
@@ -10,10 +10,14 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="sendOutGoods-footer">
|
|
<view class="sendOutGoods-footer">
|
|
- <u-button @click="handleOutGoods" type="success" :custom-style="customStyle" hover-class="none" shape="circle">立即出库</u-button>
|
|
|
|
|
|
+ <u-button v-if="!isAll" @click="scanCode" type="success" :custom-style="customStyle" hover-class="none" shape="circle">
|
|
|
|
+ <u-icon name="scan" size="34"></u-icon>
|
|
|
|
+ 点击扫码
|
|
|
|
+ </u-button>
|
|
|
|
+ <u-button v-else @click="handleOutGoods" type="success" :custom-style="customStyle" hover-class="none" shape="circle">立即出库</u-button>
|
|
</view>
|
|
</view>
|
|
<!-- 确认弹框 -->
|
|
<!-- 确认弹框 -->
|
|
- <common-modal v-if="confirmModal" :openModal="confirmModal" title="扫码失败" :content="contModal" confirmText="好的" :isCancel="false" @confirm="modalConfirm" @close="confirmModal=false" />
|
|
|
|
|
|
+ <common-modal v-if="confirmModal" :openModal="confirmModal" :title="contTitle?'扫码成功':'扫码失败'" :content="contModal" confirmText="继续扫码" @confirm="modalConfirm" @close="confirmModal=false" />
|
|
<!-- 出库确认弹框 -->
|
|
<!-- 出库确认弹框 -->
|
|
<common-modal v-if="confirmOutModal" :openModal="confirmOutModal" title="出库" content="此补货单产品已经全部扫描完成,确认出库吗?" confirmText="确认出库" @confirm="modalOutConfirm" @close="confirmOutModal=false" />
|
|
<common-modal v-if="confirmOutModal" :openModal="confirmOutModal" title="出库" content="此补货单产品已经全部扫描完成,确认出库吗?" confirmText="确认出库" @confirm="modalOutConfirm" @close="confirmOutModal=false" />
|
|
<!-- 选择配送方式弹框 -->
|
|
<!-- 选择配送方式弹框 -->
|
|
@@ -42,14 +46,16 @@
|
|
background: this.$config('primaryColor')
|
|
background: this.$config('primaryColor')
|
|
},
|
|
},
|
|
isAll: false,
|
|
isAll: false,
|
|
|
|
+ contTitle: '',
|
|
contModal: '',
|
|
contModal: '',
|
|
confirmOutModal: false,
|
|
confirmOutModal: false,
|
|
- chooseModal: false
|
|
|
|
|
|
+ chooseModal: false,
|
|
|
|
+ mpaasScanModule: null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onReady() {
|
|
onReady() {
|
|
// 初始化摄像头
|
|
// 初始化摄像头
|
|
- this.init()
|
|
|
|
|
|
+ // this.init()
|
|
},
|
|
},
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
this.replenishBillSn = options.sn
|
|
this.replenishBillSn = options.sn
|
|
@@ -58,6 +64,24 @@
|
|
this.getDetail()
|
|
this.getDetail()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 扫码
|
|
|
|
+ scanCode(){
|
|
|
|
+ this.mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
|
|
|
|
+ this.mpaasScanModule.mpaasScan({
|
|
|
|
+ // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
|
|
|
|
+ 'scanType': ['qrCode','barCode'],
|
|
|
|
+ // 是否隐藏相册,默认false不隐藏
|
|
|
|
+ 'hideAlbum': false
|
|
|
|
+ },
|
|
|
|
+ (ret) => {
|
|
|
|
+ // 返回值中,resp_code 表示返回结果值,10:用户取消,11:其他错误,1000:成功
|
|
|
|
+ // 返回值中,resp_message 表示返回结果信息
|
|
|
|
+ // 返回值中,resp_result 表示扫码结果,只有成功才会有返回
|
|
|
|
+ if(ret.resp_code == '1000'){
|
|
|
|
+ this.scanResult(ret.resp_result)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 详情
|
|
// 详情
|
|
getDetail(){
|
|
getDetail(){
|
|
shelfReplenishDetail({ sn: this.replenishBillSn }).then(res => {
|
|
shelfReplenishDetail({ sn: this.replenishBillSn }).then(res => {
|
|
@@ -118,6 +142,7 @@
|
|
},
|
|
},
|
|
// 确认出库
|
|
// 确认出库
|
|
modalOutConfirm(){
|
|
modalOutConfirm(){
|
|
|
|
+ this.confirmOutModal = false
|
|
this.chooseModal = true
|
|
this.chooseModal = true
|
|
},
|
|
},
|
|
closeChooseType(){
|
|
closeChooseType(){
|
|
@@ -154,17 +179,18 @@
|
|
}).then(res => {
|
|
}).then(res => {
|
|
console.log(res)
|
|
console.log(res)
|
|
if(res.status == 200){
|
|
if(res.status == 200){
|
|
- _this.toashMsg("扫码成功!")
|
|
|
|
- setTimeout(()=>{
|
|
|
|
- _this.barcode.start()
|
|
|
|
- // 刷新列表
|
|
|
|
- _this.getPartList()
|
|
|
|
- },2000)
|
|
|
|
|
|
+ // 刷新列表
|
|
|
|
+ _this.getPartList()
|
|
if(res.data && res.data.totalConfirmQty && res.data.totalScanQty && res.data.totalConfirmQty == res.data.totalScanQty){
|
|
if(res.data && res.data.totalConfirmQty && res.data.totalScanQty && res.data.totalConfirmQty == res.data.totalScanQty){
|
|
_this.isAll = true
|
|
_this.isAll = true
|
|
_this.handleOutGoods()
|
|
_this.handleOutGoods()
|
|
|
|
+ }else{
|
|
|
|
+ this.contTitle = 1
|
|
|
|
+ this.contModal = '是否继续扫码'
|
|
|
|
+ this.confirmModal = true
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
|
|
+ this.contTitle = 0
|
|
this.contModal = res.message
|
|
this.contModal = res.message
|
|
this.confirmModal = true
|
|
this.confirmModal = true
|
|
}
|
|
}
|
|
@@ -172,43 +198,43 @@
|
|
},
|
|
},
|
|
modalConfirm(){
|
|
modalConfirm(){
|
|
this.confirmModal = false
|
|
this.confirmModal = false
|
|
- this.barcode.start()
|
|
|
|
|
|
+ this.scanCode()
|
|
},
|
|
},
|
|
init(){
|
|
init(){
|
|
- const _this = this
|
|
|
|
- // 初始化
|
|
|
|
- this.barcode = plus.barcode.create('barcode', [], {
|
|
|
|
- top:'0px',
|
|
|
|
- left:'0px',
|
|
|
|
- width: '100%',
|
|
|
|
- height: '28%',
|
|
|
|
- position: 'static',
|
|
|
|
- frameColor: '#00aaff',
|
|
|
|
- scanbarColor: '#00aaff'
|
|
|
|
- })
|
|
|
|
- // 设置高度
|
|
|
|
- const query = uni.createSelectorQuery().in(this);
|
|
|
|
- query.select('#barcode').boundingClientRect(data => {
|
|
|
|
- this.barcode.setStyle({
|
|
|
|
- height: data.height + 'px' // 调整扫码控件的位置
|
|
|
|
- })
|
|
|
|
- }).exec()
|
|
|
|
|
|
+ // const _this = this
|
|
|
|
+ // // 初始化
|
|
|
|
+ // this.barcode = plus.barcode.create('barcode', [], {
|
|
|
|
+ // top:'0px',
|
|
|
|
+ // left:'0px',
|
|
|
|
+ // width: '100%',
|
|
|
|
+ // height: '28%',
|
|
|
|
+ // position: 'static',
|
|
|
|
+ // frameColor: '#00aaff',
|
|
|
|
+ // scanbarColor: '#00aaff'
|
|
|
|
+ // })
|
|
|
|
+ // // 设置高度
|
|
|
|
+ // const query = uni.createSelectorQuery().in(this);
|
|
|
|
+ // query.select('#barcode').boundingClientRect(data => {
|
|
|
|
+ // this.barcode.setStyle({
|
|
|
|
+ // height: data.height + 'px' // 调整扫码控件的位置
|
|
|
|
+ // })
|
|
|
|
+ // }).exec()
|
|
|
|
|
|
- // 扫码成功后
|
|
|
|
- this.barcode.onmarked = function(type, result) {
|
|
|
|
- console.log(type,result)
|
|
|
|
- _this.scanResult(result)
|
|
|
|
- }
|
|
|
|
- // 扫码识别出错
|
|
|
|
- this.barcode.onerror = function(error){
|
|
|
|
- console.log(error)
|
|
|
|
- _this.toashMsg("条形码错误!")
|
|
|
|
- _this.barcode.start()
|
|
|
|
- }
|
|
|
|
|
|
+ // // 扫码成功后
|
|
|
|
+ // this.barcode.onmarked = function(type, result) {
|
|
|
|
+ // console.log(type,result)
|
|
|
|
+ // _this.scanResult(result)
|
|
|
|
+ // }
|
|
|
|
+ // // 扫码识别出错
|
|
|
|
+ // this.barcode.onerror = function(error){
|
|
|
|
+ // console.log(error)
|
|
|
|
+ // _this.toashMsg("条形码错误!")
|
|
|
|
+ // _this.barcode.start()
|
|
|
|
+ // }
|
|
|
|
|
|
- const currentWebview = this.$mp.page.$getAppWebview()
|
|
|
|
- currentWebview.append(this.barcode)
|
|
|
|
- this.barcode.start()
|
|
|
|
|
|
+ // const currentWebview = this.$mp.page.$getAppWebview()
|
|
|
|
+ // currentWebview.append(this.barcode)
|
|
|
|
+ // this.barcode.start()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -237,7 +263,7 @@
|
|
.info-body{
|
|
.info-body{
|
|
flex-flow: 1;
|
|
flex-flow: 1;
|
|
overflow: auto;
|
|
overflow: auto;
|
|
- height: 57%;
|
|
|
|
|
|
+ height: 100%;
|
|
}
|
|
}
|
|
.info{
|
|
.info{
|
|
background-color: #FFFFFF;
|
|
background-color: #FFFFFF;
|