Selaa lähdekoodia

修改出入库缺少inOutTypeKey

wangchao 3 vuotta sitten
vanhempi
commit
85fa817e61

+ 11 - 0
pages/erp/exWarehousing/exWarehousing.vue

@@ -426,6 +426,17 @@
 					this.detailData.goodsName = this.inOutNoList[0].goodsName
 					this.detailData.grade = this.inOutNoList[0].grade
 					this.detailData.inOutType = this.inOutNoList[0].inOutType
+					if (this.detailData.inOutType == '销售出库') {
+						this.detailData.inOutTypeKey = 1
+					} else if (this.detailData.inOutType == '移库出库') {
+						this.detailData.inOutTypeKey = 3
+					} else if (this.detailData.inOutType == '暂存出库') {
+						this.detailData.inOutTypeKey = 4
+					} else if (this.detailData.inOutType == '贸易服务出库') {
+						this.detailData.inOutTypeKey = 5
+					} else if (this.detailData.inOutType == '采购出库') {
+						this.detailData.inOutTypeKey = 6
+					}
 					//查询所有的合同  进行获取车牌号
 					this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
 						flag: 5,

+ 12 - 12
pages/erp/warehousing/warehousing.vue

@@ -345,17 +345,6 @@
 			this.detailData.contractNo = _data.contractNo;
 			this.detailData.goodsNameKey = _data.goodsNameKey;
 			this.detailData.inOutType = _data.inOutType;
-			if (this.detailData.inOutType == '采购入库') {
-				this.detailData.inOutTypeKey = 1
-			} else if (this.detailData.inOutType == '移库入库') {
-				this.detailData.inOutTypeKey = 3
-			} else if (this.detailData.inOutType == '暂存入库') {
-				this.detailData.inOutTypeKey = 4
-			} else if (this.detailData.inOutType == '贸易服务入库') {
-				this.detailData.inOutTypeKey = 5
-			} else if (this.detailData.inOutType == '退库') {
-				this.detailData.inOutTypeKey = 6
-			}
 			if (_data.unitContractPrice) {
 				this.detailData.cost = _data.unitContractPrice
 			}
@@ -432,7 +421,7 @@
 					flag: 2,
 					warehouseName:this.warehouseName,
 					agentKey : this.userInfo.id
-				}).then(res => {
+				}).then(res => {debugger
 					this.inOutNoList = res.data.data
 					if(this.inOutNoList.length > 0){
 						this.detailData.inOutTaskNo = this.inOutNoList[0].inOutTaskNo
@@ -445,6 +434,17 @@
 					this.detailData.goodsName = this.inOutNoList[0].goodsName
 					this.detailData.grade = this.inOutNoList[0].grade
 					this.detailData.inOutType = this.inOutNoList[0].inOutType
+					if (this.detailData.inOutType == '采购入库') {
+						this.detailData.inOutTypeKey = 1
+					} else if (this.detailData.inOutType == '移库入库') {
+						this.detailData.inOutTypeKey = 3
+					} else if (this.detailData.inOutType == '暂存入库') {
+						this.detailData.inOutTypeKey = 4
+					} else if (this.detailData.inOutType == '贸易服务入库') {
+						this.detailData.inOutTypeKey = 5
+					} else if (this.detailData.inOutType == '退库') {
+						this.detailData.inOutTypeKey = 6
+					}
 					//查询所有的合同  进行获取车牌号
 					this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
 						flag: 7,

+ 9 - 20
pages/erpbusiness/bleConnect.vue

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

+ 13 - 2
store/bluetooth/index.js

@@ -2,10 +2,21 @@ let sysinfo = uni.getSystemInfoSync();
 const Bluetooth = {
 	state: {
 		//蓝牙信息
-		
+		BLEInformation: {
+			platform: sysinfo.platform || "",
+			deviceId: "",
+			writeCharaterId: "",
+			writeServiceId: "",
+			notifyCharaterId: "",
+			notifyServiceId: "",
+			readCharaterId: "",
+			readServiceId: "",
+		}
 	},
 	mutations:{
-		
+		BLEInformationSet(state, info){
+			state.BLEInformation = info;
+		}
 	}
 }
 

+ 9 - 21
store/index.js

@@ -1,6 +1,8 @@
 import Vue from 'vue'
 import Vuex from 'vuex'
 Vue.use(Vuex)
+//蓝牙设置
+import Bluetooth from '@/store/bluetooth/index.js'
 let lifeData = {};
 
 try {
@@ -39,15 +41,16 @@ const saveLifeData = function(key, value) {
 		uni.setStorageSync('lifeData', tmp);
 	}
 }
-let sysinfo = uni.getSystemInfoSync();
 
 
 const store = new Vuex.Store({
+	modules: {
+		Bluetooth
+	},
 	state: {
 		sysinfo: uni.getSystemInfoSync(),//系统信息
 		enter:{},
 		hasLogin: false,
-		BLEInformation: {},
 		// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
 		pushRes:lifeData.pushRes?lifeData.pushRes: {},
 		//期货数据获取
@@ -90,18 +93,7 @@ const store = new Vuex.Store({
 		clientId: lifeData.clientId?lifeData.clientId: "",
 		// 确定收货
 		isConfigfreightTransport:true,
-		choice:"",
-		//蓝牙信息
-		BLEInformation: {
-			platform: sysinfo.platform || "",
-			deviceId: "",
-			writeCharaterId: "",
-			writeServiceId: "",
-			notifyCharaterId: "",
-			notifyServiceId: "",
-			readCharaterId: "",
-			readServiceId: "",
-		}
+		choice:""
 	},
 	mutations: {
 		$uStore(state, payload) {
@@ -129,10 +121,7 @@ const store = new Vuex.Store({
 			state.userInfo = provider;
 			uni.setStorageSync('userInfo', provider)
 		},
-		BLEInformationSet(state, info){
-			console.log(info)
-			state.BLEInformation = info;
-		},
+		
 		logout(state) {
 			state.hasLogin = false;
 			state.userInfo = {};
@@ -151,9 +140,8 @@ const store = new Vuex.Store({
 		state.enter = provider
 		console.log(state)
 		},
-		BLEInformationSet(state, info){
-			state.BLEInformation = info;
-		}
+		
+		
 	},
 	actions: {