gjy hace 3 años
padre
commit
9fa30186ab

+ 13 - 1
pages/erpbusiness/add_quality_testing.vue

@@ -102,7 +102,10 @@
 		</view>
 		</view>
 		<view style='padding-bottom:300rpx;'>
 		<view style='padding-bottom:300rpx;'>
 			<view class='wrap'>
 			<view class='wrap'>
-				<view class='title_b'>化验信息</view>
+				<view style='margin-right:10px;' class='flex justify-between align-item-center'>
+					<view class='title_b'>化验信息</view>
+					<view class='flex justify-between align-item-center'>补录:<u-switch activeColor="#22C572" v-model="value" @change="change"></u-switch></view>
+				</view>
 
 
 				<view class="c-row ">
 				<view class="c-row ">
 					<view class="title">等级</view>
 					<view class="title">等级</view>
@@ -216,6 +219,7 @@
 				show2: false,
 				show2: false,
 				goodsList: [],
 				goodsList: [],
 				currentPage: 1,
 				currentPage: 1,
+				value:false,
 				gridBorder: false,
 				gridBorder: false,
 				headUrl: "../../static/img/myimg/YongHu@3x.png",
 				headUrl: "../../static/img/myimg/YongHu@3x.png",
 				userphone: "",
 				userphone: "",
@@ -362,6 +366,14 @@
 			})
 			})
 		},
 		},
 		methods: {
 		methods: {
+			change(e){
+				if(e){
+					this.gridList.supplementaryRecording=1
+				}else{
+					this.gridList.supplementaryRecording=0
+				}
+				
+			},
 			print(){
 			print(){
 				uni.navigateTo({
 				uni.navigateTo({
 					url: '/pages/erpbusiness/bleConnect'
 					url: '/pages/erpbusiness/bleConnect'

+ 20 - 9
pages/erpbusiness/bleConnect.vue

@@ -33,8 +33,17 @@
 		},
 		},
 		computed: mapState(['sysinfo', 'Bluetooth']),
 		computed: mapState(['sysinfo', 'Bluetooth']),
 		onLoad() {
 		onLoad() {
-			// console.log(this.Bluetooth)
+			
+			
 			
 			
+		},
+		onShow() {
+			// if(this.Bluetooth){
+			// 	uni.navigateTo({
+			// 		url: '/pages/erpbusiness/sendCommand'
+			// 	})
+			// }
+		console.log(this.Bluetooth)
 		},
 		},
 		onUnload() {
 		onUnload() {
 			//停止搜索蓝牙设备
 			//停止搜索蓝牙设备
@@ -153,9 +162,9 @@
 			//校验权限
 			//校验权限
 			checkPemission() {
 			checkPemission() {
 				let that = this
 				let that = this
-				let {
+				let 
 					BLEInformation
 					BLEInformation
-				} = that.Bluetooth;
+				 = that.Bluetooth;
 				let platform = BLEInformation.platform;
 				let platform = BLEInformation.platform;
 				that.getBluetoothDevices();
 				that.getBluetoothDevices();
 			},
 			},
@@ -215,9 +224,9 @@
 				let {
 				let {
 					title
 					title
 				} = e.currentTarget.dataset;
 				} = e.currentTarget.dataset;
-				let {
+				let 
 					BLEInformation
 					BLEInformation
-				} = that.Bluetooth;
+				 = that.Bluetooth;
 				this.stopSearch();
 				this.stopSearch();
 				
 				
 				that.serviceId = 0;
 				that.serviceId = 0;
@@ -235,6 +244,7 @@
 						console.log('createBLEConnection success:', res)
 						console.log('createBLEConnection success:', res)
 						BLEInformation.deviceId = title;
 						BLEInformation.deviceId = title;
 						that.$store.commit('BLEInformationSet', BLEInformation);
 						that.$store.commit('BLEInformationSet', BLEInformation);
+						// console.log(this.Bluetooth,)
 						uni.hideLoading()
 						uni.hideLoading()
 						that.getSeviceId()
 						that.getSeviceId()
 					},
 					},
@@ -247,9 +257,9 @@
 			//获取蓝牙设备所有服务(service)。
 			//获取蓝牙设备所有服务(service)。
 			getSeviceId() {
 			getSeviceId() {
 				let that = this;
 				let that = this;
-				let {
+				let 
 					BLEInformation
 					BLEInformation
-				} = that.Bluetooth;
+				 = that.Bluetooth;
 				console.log('BLEInformation.deviceId:',BLEInformation.deviceId)
 				console.log('BLEInformation.deviceId:',BLEInformation.deviceId)
 				// uni.getBLEDeviceServices
 				// uni.getBLEDeviceServices
 				let t=setTimeout(()=>{
 				let t=setTimeout(()=>{
@@ -277,9 +287,9 @@
 					readCharacter: read,
 					readCharacter: read,
 					notifyCharacter: notify
 					notifyCharacter: notify
 				} = that;
 				} = that;
-				let {
+				let 
 					BLEInformation
 					BLEInformation
-				} = that.Bluetooth;
+				 = that.Bluetooth;
 				// uni.getBLEDeviceCharacteristics
 				// uni.getBLEDeviceCharacteristics
 				plus.bluetooth.getBLEDeviceCharacteristics({
 				plus.bluetooth.getBLEDeviceCharacteristics({
 					deviceId: BLEInformation.deviceId,
 					deviceId: BLEInformation.deviceId,
@@ -329,6 +339,7 @@
 								that.getCharacteristics()
 								that.getCharacteristics()
 							}
 							}
 						} else {
 						} else {
+							that.$store.commit('BLEInformationSet', BLEInformation);
 							that.openControl()
 							that.openControl()
 						}
 						}
 					},
 					},

+ 1 - 1
pages/erpbusiness/edit_quality_testing.vue

@@ -117,7 +117,7 @@
 			<view class='wrap'>
 			<view class='wrap'>
 				<view style='margin-right:10px;' class='flex justify-between align-item-center'>
 				<view style='margin-right:10px;' class='flex justify-between align-item-center'>
 					<view class='title_b'>化验信息</view>
 					<view class='title_b'>化验信息</view>
-					<u-switch v-if='flag!=1' v-model="value" @change="change"></u-switch>
+					<view class='flex justify-between align-item-center'>补录:<u-switch activeColor="#22C572" v-if='flag==0' v-model="value" @change="change"></u-switch></view>
 				</view>
 				</view>
 				<view class="c-row ">
 				<view class="c-row ">
 					<view class="title">等级</view>
 					<view class="title">等级</view>

+ 1 - 0
store/bluetooth/index.js

@@ -15,6 +15,7 @@ const Bluetooth = {
 	},
 	},
 	mutations:{
 	mutations:{
 		BLEInformationSet(state, info){
 		BLEInformationSet(state, info){
+			console.log(info)
 			state.BLEInformation = info;
 			state.BLEInformation = info;
 		}
 		}
 	}
 	}

+ 5 - 4
store/index.js

@@ -44,13 +44,11 @@ const saveLifeData = function(key, value) {
 
 
 
 
 const store = new Vuex.Store({
 const store = new Vuex.Store({
-	modules: {
-		Bluetooth
-	},
 	state: {
 	state: {
 		sysinfo: uni.getSystemInfoSync(),//系统信息
 		sysinfo: uni.getSystemInfoSync(),//系统信息
 		enter:{},
 		enter:{},
 		hasLogin: false,
 		hasLogin: false,
+		BLEInformation: {},
 		// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
 		// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
 		pushRes:lifeData.pushRes?lifeData.pushRes: {},
 		pushRes:lifeData.pushRes?lifeData.pushRes: {},
 		//期货数据获取
 		//期货数据获取
@@ -121,7 +119,10 @@ const store = new Vuex.Store({
 			state.userInfo = provider;
 			state.userInfo = provider;
 			uni.setStorageSync('userInfo', provider)
 			uni.setStorageSync('userInfo', provider)
 		},
 		},
-		
+		BLEInformationSet(state, info){
+			console.log(info)
+			state.BLEInformation = info;
+		},
 		logout(state) {
 		logout(state) {
 			state.hasLogin = false;
 			state.hasLogin = false;
 			state.userInfo = {};
 			state.userInfo = {};