|
@@ -16,8 +16,8 @@
|
|
|
<view>{{fromPage == 'smdy'?'实发':'库存'}}数量:{{fromPage == 'smdy'?infoData.confirmQty : infoData.qty}}</view>
|
|
|
</view>
|
|
|
<view class="buttons flex align_center justify_center">
|
|
|
- <view v-if="fromPage == 'bdtq'"><u-button @click="cansel" shape="circle" plain>返回列表</u-button></view>
|
|
|
- <view v-if="fromPage == 'smdy'"><u-button @click="cansel" shape="circle" plain>重新扫描</u-button></view>
|
|
|
+ <view v-if="fromPage == 'bdtq'"><u-button @click="cancel" shape="circle" plain>返回列表</u-button></view>
|
|
|
+ <view v-if="fromPage == 'smdy'"><u-button @click="cancel" shape="circle" plain>重新扫描</u-button></view>
|
|
|
<view>
|
|
|
<kk-printer ref="kkprinter" @startPrint="startPrint"></kk-printer>
|
|
|
</view>
|
|
@@ -60,12 +60,19 @@
|
|
|
},
|
|
|
// 监听页面返回,返回 event = {from:backbutton、 navigateBack} ,backbutton 表示来源是左上角返回按钮或 android 返回键;navigateBack表示来源是 uni.navigateBack
|
|
|
onBackPress(event){
|
|
|
- this.cansel()
|
|
|
+ if(event.from == 'backbutton'){
|
|
|
+ this.cancel()
|
|
|
+ return true // 阻止默认返回行为(会导致无限循环)
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
- cansel(){
|
|
|
- uni.$emit('refreshBL')
|
|
|
- uni.navigateBack()
|
|
|
+ cancel(){
|
|
|
+ if(this.fromPage == 'bdtq'){ // 补打贴签
|
|
|
+ uni.navigateBack({delta: 1})
|
|
|
+ }else if(this.fromPage == 'smdy'){ // 扫码打印
|
|
|
+ uni.$emit('refreshBL')
|
|
|
+ uni.navigateBack({delta: 1})
|
|
|
+ }
|
|
|
},
|
|
|
// 获取打印内容
|
|
|
getPrintContent(){
|