From 0d2024eabd0f07bc4ab3341dddc10464d31938f8 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期六, 21 十二月 2024 18:47:12 +0800 Subject: [PATCH] #新增订单筛选物料界面 --- pages/print/printUNI.vue | 277 +++++++++++++++++++++++++++++-------------------------- 1 files changed, 146 insertions(+), 131 deletions(-) diff --git a/pages/print/printUNI.vue b/pages/print/printUNI.vue index 75b8835..d343491 100644 --- a/pages/print/printUNI.vue +++ b/pages/print/printUNI.vue @@ -1,131 +1,146 @@ -<template> - <view class="content"> - <view> - <view class="bluetoothConnected"> - <view class="bluetoothList" v-for="(item,index) in GET_CONNECTBLEDATA" :key="index" @tap="confirm_bluetooth(item)"> - <view class="bluetoothList-name">鍚嶇О:{{item.name}}</view> - <view class="bluetoothList-mac">鍦板潃:{{item.mac}}</view> - </view> - </view> - <button type="default" @click="search_bluetooth">鎼滅储钃濈墮</button> - <button @click="senBleLabel">鎵撳嵃</button> - <view class="bluetoothItem" v-if="GET_INFODATA"> - <view class="bluetoothList" v-for="(item,index) in GET_INFODATA" :key="index" @tap="confirm_bluetooth(item)"> - <view class="bluetoothList-name">鍚嶇О:{{item.name}}</view> - <view class="bluetoothList-mac">鍦板潃:{{item.mac}}</view> - </view> - </view> - </view> - </view> -</template> - -<script> - import printConnect from "@/common/print.js"; //寮曞叆鎵撳嵃鏈烘ā鏉挎枃浠� - let _this = null; - import { - mapGetters, - mapActions - } from 'vuex'; - import { - GET_INFODATA, - GET_CONNECTBLEDATA - } from "@/store/gettersType.js"; - import { - SET_CONNECTBLEDATA - } from '@/store/actionsType.js'; - // #ifdef APP-PLUS - const HanyinPlugin = uni.requireNativePlugin('Hanyin-Plugin'); //姹夊嵃 - // #endif - let print; - export default { - data() { - return { - bArray: [], //鐢ㄤ簬鎼滅储钃濈墮鍘婚噸鐢ㄧ殑 - no_match_list: [], //娌℃湁閰嶅鐨勮摑鐗欏垪琛� - match_list: "", //宸茶繛鎺ヨ摑鐗欐墦鍗版満 - val: "", - dateTimer: "", - valArr: [], - // 宸存灙鍙傛暟 - // broadcase_actions: "com.android.receive_scan_action", - // broadcast_flag: "data" - }; - }, - computed: { - ...mapGetters([GET_INFODATA, GET_CONNECTBLEDATA]) - }, - onShow() { - uni.hideLoading(); - //妫�鏌ユ槸鍚﹀凡杩炴帴钃濈墮 - // this.$check_bluetooth_connect(); - console.log('onShow'); - }, - onHide() { - console.log('onHide'); - }, - onUnload() { - console.log('onUnload'); - }, - onLoad(options) { - _this = this; - this.$init_bluetooth(); - }, - methods: { - ...mapActions([SET_CONNECTBLEDATA]), - senBleLabel() { - // console.log(this.$Mock.order_data); - if(!print) return; - print.startPrint(this.$Mock.order_data); - }, - // 杩炴帴鎵撳嵃鏈� - confirm_bluetooth(item) { - let { - name, - mac - } = item; - //鍒ゆ柇钃濈墮鏄惁鎵撳紑 - this.$check_bluetooth_open().then(res => { - console.log(res); - //杩涜鎵撳嵃鏈鸿繛鎺� - if (res) { - print =new printConnect(item); //鎵撳嵃鏈鸿繛鎺� - } - }) - }, - //鎼滅储娌″尮閰嶇殑钃濈墮璁惧 - search_bluetooth(address) { - let _this = this; - //妫�鏌ヨ摑鐗欐槸鍚﹀紑鍚� - this.$check_bluetooth_open().then(ores => { - if (ores) { - console.log(ores); - //鎼滅储钃濈墮 - _this.$search_bluetooth().then(bres => { - console.log(bres); - if (bres.code) { - _this.$search_pipei().then(pres => { - console.log(pres); - }) - } - }) - } - }) - } - } - } -</script> - -<style lang="scss"> - .bluetoothItem { - width: 100%; - height: 100%; - - .bluetoothList { - display: flex; - flex-direction: column; - padding: 20rpx; - border-bottom: 1rpx solid #BEBEBE; - font-size: 18rpx; - } - } -</style> +<template> + <view class="content"> + <view> + <view class="bluetoothConnected"> + <view class="bluetoothList" v-for="(item,index) in GET_CONNECTBLEDATA" :key="index" @tap="confirm_bluetooth(item)"> + <view class="bluetoothList-name">鍚嶇О:{{item.name}}</view> + <view class="bluetoothList-mac">鍦板潃:{{item.mac}}</view> + </view> + </view> + <button type="default" @click="search_bluetooth">鎼滅储钃濈墮</button> + <button @click="senBleLabel">鎵撳嵃</button> + <view class="bluetoothItem" v-if="GET_INFODATA"> + <view class="bluetoothList" v-for="(item,index) in GET_INFODATA" :key="index" @tap="confirm_bluetooth(item)"> + <view class="bluetoothList-name">鍚嶇О:{{item.name}}</view> + <view class="bluetoothList-mac">鍦板潃:{{item.mac}}</view> + </view> + </view> + </view> + </view> +</template> + +<script> + import printConnect from "@/common/print.js"; //寮曞叆鎵撳嵃鏈烘ā鏉挎枃浠� + let _this = null; + import { + mapGetters, + mapActions + } from 'vuex'; + import { + GET_INFODATA, + GET_CONNECTBLEDATA + } from "@/store/gettersType.js"; + import { + SET_CONNECTBLEDATA + } from '@/store/actionsType.js'; + // #ifdef APP-PLUS + const HanyinPlugin = uni.requireNativePlugin('Hanyin-Plugin'); //姹夊嵃 + // #endif + let print; + export default { + data() { + return { + bArray: [], //鐢ㄤ簬鎼滅储钃濈墮鍘婚噸鐢ㄧ殑 + no_match_list: [], //娌℃湁閰嶅鐨勮摑鐗欏垪琛� + match_list: "", //宸茶繛鎺ヨ摑鐗欐墦鍗版満 + val: "", + dateTimer: "", + valArr: [], + print_data: '', + mat: '', + time: '', + // 宸存灙鍙傛暟 + // broadcase_actions: "com.android.receive_scan_action", + // broadcast_flag: "data" + }; + }, + computed: { + ...mapGetters([GET_INFODATA, GET_CONNECTBLEDATA]) + }, + onShow() { + uni.hideLoading(); + //妫�鏌ユ槸鍚﹀凡杩炴帴钃濈墮 + // this.$check_bluetooth_connect(); + console.log('onShow'); + }, + onHide() { + console.log('onHide'); + }, + onUnload() { + console.log('onUnload'); + }, + onLoad(options) { + _this = this; + this.$init_bluetooth(); + let that = this + const eventChannel = this.getOpenerEventChannel(); + eventChannel.on('data1', function(data1) { + that.mat = data1.data + that.time = data1.time + console.log(data1); + }) + }, + methods: { + ...mapActions([SET_CONNECTBLEDATA]), + senBleLabel() { + // console.log(this.$Mock.order_data); + if(!print) return; + console.log(this.mat); + this.print_data = this.$Mock.order_data + this.print_data.MATNR = this.mat.matnr + this.print_data.MAKTX = this.mat.maktx + this.print_data.MODI_TIME = this.time + print.startPrint(this.print_data); + }, + // 杩炴帴鎵撳嵃鏈� + confirm_bluetooth(item) { + let { + name, + mac + } = item; + //鍒ゆ柇钃濈墮鏄惁鎵撳紑 + this.$check_bluetooth_open().then(res => { + console.log(res); + //杩涜鎵撳嵃鏈鸿繛鎺� + if (res) { + print =new printConnect(item); //鎵撳嵃鏈鸿繛鎺� + } + }) + }, + //鎼滅储娌″尮閰嶇殑钃濈墮璁惧 + search_bluetooth(address) { + let _this = this; + //妫�鏌ヨ摑鐗欐槸鍚﹀紑鍚� + this.$check_bluetooth_open().then(ores => { + if (ores) { + console.log(ores); + //鎼滅储钃濈墮 + _this.$search_bluetooth().then(bres => { + console.log(bres); + if (bres.code) { + _this.$search_pipei().then(pres => { + console.log(pres); + }) + } + }) + } + }) + } + } + } +</script> + +<style lang="scss"> + .bluetoothItem { + width: 100%; + height: 100%; + + .bluetoothList { + display: flex; + flex-direction: column; + padding: 20rpx; + border-bottom: 1rpx solid #BEBEBE; + font-size: 18rpx; + } + } +</style> -- Gitblit v1.9.1