From 983619ef25f84e095bcbf6f4996b0cb58210c73b Mon Sep 17 00:00:00 2001
From: 819527061@qq.com <123456>
Date: 星期四, 08 八月 2024 18:25:24 +0800
Subject: [PATCH] 质检页面

---
 store/index.js |  244 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 239 insertions(+), 5 deletions(-)

diff --git a/store/index.js b/store/index.js
index f9aa732..8932393 100644
--- a/store/index.js
+++ b/store/index.js
@@ -1,61 +1,211 @@
 import Vue from 'vue'
 import Vuex from 'vuex'
-import { webSocketUrl } from '@/api/request.js'
+import { webSocketUrl,BaseUrl } from '@/api/request.js'
+// 璇锋眰鐩稿叧
+import {
+	reqGet
+} from '@/api/index.js'
 Vue.use(Vuex)
 
 // 鍔ㄦ�佸簳閮╰abbar
 const userRoleTabbar = {
 	first: [{
 			pagePath: 'pages/tabbar-page/index-tabbar/index-tabbar',
+			//#ifdef MP-WEIXIN
 			iconPath: '../../static/tabBar-icon/home.png',
 			selectedIconPath: '../../static/tabBar-icon/homeblue.png',
+			// #endif
+			// #ifdef H5
+			iconPath: '/static/tabBar-icon/home.png',
+			selectedIconPath: '/static/tabBar-icon/homeblue.png',
+			// #endif
 			text: '棣栭〉'
 		},
 		{
 			pagePath: 'pages/customer-page/customer-my/faYunstatistics/faYunstatistics',
+			//#ifdef MP-WEIXIN
 			iconPath: '../../static/tabBar-icon/statistics.png',
 			selectedIconPath: '../../static/tabBar-icon/statisticsactive.png',
+			// #endif
+			// #ifdef H5
+			iconPath: '/static/tabBar-icon/statistics.png',
+			selectedIconPath: '/static/tabBar-icon/statisticsactive.png',
+			// #endif
 			text: '缁熻'
 		},
 		{
 			pagePath: 'pages/tabbar-page/myPage-tabbar/myPage-tabbar',
+			//#ifdef MP-WEIXIN
 			iconPath: '../../static/tabBar-icon/Gmine10.png',
 			selectedIconPath: '../../static/tabBar-icon/Bmine57.png',
+		    // #endif
+			// #ifdef H5
+			iconPath: '/static/tabBar-icon/Gmine10.png',
+			selectedIconPath: '/static/tabBar-icon/Bmine57.png',
+			// #endif
 			text: '鎴戠殑'
 		}
 	],
 	second: [{
 			pagePath: 'pages/tabbar-page/index-tabbar/index-tabbar',
+			//#ifdef MP-WEIXIN
 			iconPath: '../../static/tabBar-icon/home.png',
 			selectedIconPath: '../../static/tabBar-icon/homeblue.png',
+			// #endif
+			// #ifdef H5
+			iconPath: '/static/tabBar-icon/home.png',
+			selectedIconPath: '/static/tabBar-icon/homeblue.png',
+			// #endif
 			text: '棣栭〉'
 		},
 		{
 			pagePath: 'pages/customer-page/customer-my/faYunstatistics/faYunstatistics',
+			//#ifdef MP-WEIXIN
 			iconPath: '../../static/tabBar-icon/statistics.png',
 			selectedIconPath: '../../static/tabBar-icon/statisticsactive.png',
+			// #endif
+			//#ifdef H5
+			iconPath: '/static/tabBar-icon/statistics.png',
+			selectedIconPath: '/static/tabBar-icon/statisticsactive.png',
+			// #endif
 			text: '缁熻'
 		},
 		{
 			pagePath: 'pages/tabbar-page/myPage-tabbar/myPage-tabbar',
+			//#ifdef MP-WEIXIN
 			iconPath: '../../static/tabBar-icon/Gmine10.png',
 			selectedIconPath: '../../static/tabBar-icon/Bmine57.png',
+			// #endif
+			//#ifdef H5
+			iconPath: '/static/tabBar-icon/Gmine10.png',
+			selectedIconPath: '/static/tabBar-icon/Bmine57.png',
+			// #endif
 			text: '鎴戠殑'
 		}
 	],
 	three: [{
 			pagePath: 'pages/tabbar-page/index-tabbar/index-tabbar',
+			//#ifdef MP-WEIXIN
 			iconPath: '../../static/tabBar-icon/home.png',
 			selectedIconPath: '../../static/tabBar-icon/homeblue.png',
+			// #endif
+			//#ifdef H5
+			iconPath: '/static/tabBar-icon/home.png',
+			selectedIconPath: '/static/tabBar-icon/homeblue.png',
+			// #endif
 			text: '棣栭〉'
 		},
 		{
 			pagePath: 'pages/tabbar-page/myPage-tabbar/myPage-tabbar',
+			//#ifdef MP-WEIXIN
 			iconPath: '../../static/tabBar-icon/Gmine10.png',
 			selectedIconPath: '../../static/tabBar-icon/Bmine57.png',
+		    // #endif
+			//#ifdef H5
+			iconPath: '/static/tabBar-icon/Gmine10.png',
+			selectedIconPath: '/static/tabBar-icon/Bmine57.png',
+			// #endif
 			text: '鎴戠殑'
 		}
-	]
+	],
+	fourth: [{
+			pagePath: 'pages/tabbar-page/index-tabbar/index-tabbar',
+			//#ifdef MP-WEIXIN
+			iconPath: '../../static/tabBar-icon/home.png',
+			selectedIconPath: '../../static/tabBar-icon/homeblue.png',
+			// #endif
+			//#ifdef H5
+			iconPath: '/static/tabBar-icon/home.png',
+			selectedIconPath: '/static/tabBar-icon/homeblue.png',
+			// #endif
+			text: '杩涘満'
+		},{
+			pagePath: 'pages/doorkeeper-page/doorkeeper-index/exit-index',
+			//#ifdef MP-WEIXIN
+			iconPath: '../../static/tabBar-icon/home.png',
+			selectedIconPath: '../../static/tabBar-icon/homeblue.png',
+			// #endif
+			//#ifdef H5
+			iconPath: '/static/tabBar-icon/home.png',
+			selectedIconPath: '/static/tabBar-icon/homeblue.png',
+			// #endif
+			text: '鍑哄満'
+		},
+		{
+			pagePath: 'pages/tabbar-page/myPage-tabbar/myPage-tabbar',
+			//#ifdef MP-WEIXIN
+			iconPath: '../../static/tabBar-icon/Gmine10.png',
+			selectedIconPath: '../../static/tabBar-icon/Bmine57.png',
+			// #endif
+			//#ifdef H5
+			iconPath: '/static/tabBar-icon/Gmine10.png',
+			selectedIconPath: '/static/tabBar-icon/Bmine57.png',
+			// #endif
+			text: '鎴戠殑'
+		},
+
+	],
+	five:[{
+		pagePath: 'pages/tabbar-page/index-tabbar/index-tabbar',
+		//#ifdef MP-WEIXIN
+		iconPath: '../../static/tabBar-icon/home.png',
+		selectedIconPath: '../../static/tabBar-icon/homeblue.png',
+		// #endif
+		//#ifdef H5
+		iconPath: '/static/tabBar-icon/home.png',
+		selectedIconPath: '/static/tabBar-icon/homeblue.png',
+		// #endif
+		text: '棣栭〉'
+	},
+	{
+		pagePath: 'pages/loadUnload-page/orderPlanList/index',
+		//#ifdef MP-WEIXIN
+		iconPath:  '../../static/tabBar-icon/statistics.png',
+		selectedIconPath: '../../static/tabBar-icon/statisticsactive.png',
+		// #endif
+		//#ifdef  H5
+		iconPath:  '/static/tabBar-icon/statistics.png',
+		selectedIconPath: '/static/tabBar-icon/statisticsactive.png',
+		// #endif
+		text: '鏃ヨ鍒�'
+	},
+	{
+		pagePath: 'pages/tabbar-page/myPage-tabbar/myPage-tabbar',
+		//#ifdef MP-WEIXIN
+		iconPath: '../../static/tabBar-icon/Gmine10.png',
+		selectedIconPath: '../../static/tabBar-icon/Bmine57.png',
+		// #endif
+		//#ifdef H5
+		iconPath: '/static/tabBar-icon/Gmine10.png',
+		selectedIconPath: '/static/tabBar-icon/Bmine57.png',
+		// #endif
+		text: '鎴戠殑'
+	}
+	],
+	six:[{
+		pagePath: 'pages/tabbar-page/index-tabbar/index-tabbar',
+		//#ifdef MP-WEIXIN
+		iconPath: '../../static/tabBar-icon/home.png',
+		selectedIconPath: '../../static/tabBar-icon/homeblue.png',
+		// #endif
+		//#ifdef  H5
+		iconPath: '/static/tabBar-icon/home.png',
+		selectedIconPath: '/static/tabBar-icon/homeblue.png',
+		// #endif
+		text: '棣栭〉'
+	},
+	{
+		pagePath: 'pages/tabbar-page/myPage-tabbar/myPage-tabbar',
+		//#ifdef MP-WEIXIN
+		iconPath: '../../static/tabBar-icon/Gmine10.png',
+		selectedIconPath: '../../static/tabBar-icon/Bmine57.png',
+		// #endif
+		//#ifdef  H5
+		iconPath: '/static/tabBar-icon/Gmine10.png',
+		selectedIconPath: '/static/tabBar-icon/Bmine57.png',
+		// #endif
+		text: '鎴戠殑'
+	}]
 }
 const store = new Vuex.Store({
 	state: {
@@ -150,6 +300,9 @@
 		confirmWeighContent: '',
 		// 绉伴噸绋冲畾鎬�  0/绋冲畾 1/闈炵ǔ瀹�  闈炵ǔ瀹氭�佷笉鑳界偣绉伴噸
 		globalWarning: false,
+		filedId:'', //鍦哄湴id
+		bunkerList:'', //浠撳簱list
+		samplingPersonList:'', //閲囨牱鍛榣ist
 	},
 	mutations: {
 		setUserInfo(state, identity) {
@@ -165,7 +318,13 @@
 				state.userTabbar = userRoleTabbar.second
 				uni.setStorageSync('userTabbar', state.userTabbar)
 			} else if (roleType == 5) {
-				state.userTabbar = userRoleTabbar.three
+				state.userTabbar = userRoleTabbar.five
+				uni.setStorageSync('userTabbar', state.userTabbar)
+			}else if (roleType == 6) {
+				state.userTabbar = userRoleTabbar.fourth
+				uni.setStorageSync('userTabbar', state.userTabbar)
+			}else if (roleType == 7) {
+				state.userTabbar = userRoleTabbar.six
 				uni.setStorageSync('userTabbar', state.userTabbar)
 			}
 		},
@@ -205,6 +364,7 @@
 			console.log(state.globalisLogin, '鍏ㄥ眬鐧诲綍鐘舵�佹敼鍙樹簡')
 		},
 		setWebsocketData(state, data) {
+			console.log(data,'data-----')
 			state.websocketData = data
 		},
 		// 鏀瑰彉閲嶈繛鐘舵��
@@ -248,13 +408,33 @@
 		changeWarning(state, payload) {
 			state.globalWarning = payload
 		},
+		// 鍦哄湴filedId鐨勮幏鍙�
+		getFiledId(state, payload) {
+			console.log(payload,'filedId=====')
+			state.filedId = payload
+			uni.setStorageSync('filedId', state.filedId)
+		},
+		getBunkerList(state, payload) {
+			state.bunkerList = payload
+			uni.setStorageSync('bunkerList', state.bunkerList)
+		},
+		getSamplingPersonList(state, payload) {
+			console.log('鎴戞墽琛屼簡samplingPersonList====',payload)
+			state.samplingPersonList = payload
+			uni.setStorageSync('samplingPersonList', state.samplingPersonList)
+		},
 	},
 	actions: {
 		websocketInit({ state, dispatch, commit }) {
+			// #ifdef H5
+			let wsUrl = `${webSocketUrl}?UUID=${uni.getStorageSync('token')}`
+			// #endif
+			// #ifndef H5
 			let wsUrl = `${webSocketUrl}?access_token=${uni.getStorageSync('token')}`
+			// #endif
 			state.socketTask = uni.connectSocket({
 				url: wsUrl,
-				header: { 
+				header: {
 				clientToc: 'Y' ,
 				'CLIENT_TOC': 'Y',
 			},
@@ -355,7 +535,61 @@
 					dispatch('websocketInit')
 				}, 5000)
 			}
-		}
+		},
+
+		//filedId
+		async getBunkerList({ state,dispatch, commit }) { //鑾峰彇filedId
+			// this.$reqGet(`getList/${this.deptId}`).then(res => {
+			//   console.log(res,'鎯冲緱鍒癴iledId')
+			// })
+			let deptId = uni.getStorageSync('userInfo').deptIds
+			console.log(deptId,'deptId====')
+			await uni.request({  //鑾峰彇deptId
+				url: `/wrzs/jccoalfiled/list/${deptId}`,
+				method: 'GET',
+				header: {
+					Authorization: 'Bearer' + ' ' + uni.getStorageSync('token'),
+					clientToc: 'Y',
+					'CLIENT_TOC': 'Y',
+				},
+				success: res => {
+					console.log(res,'filedId鎺ュ彛000000000000')
+					commit('getFiledId',res.data.data[0].id || '')
+					dispatch('getFiledIdCoalBunker')
+					// console.log(res,'shuj------')
+					// this.filedId = res.data?.data.length > 0 ? res.data.data[0].id : '';
+					// this.getFiledIdCoalBunker()
+				}
+			})
+
+		},
+		getSamplingPerson({ state, commit }) {  //閲囨牱浜�
+			let params = {
+				current: 1,
+				size: 999,
+				type: 7
+			}
+			reqGet('pageCarAndHuoDai',params).then(res => {
+			  console.log(res,'pageCarAndHuoDai======')
+				if(res.code == 0) {
+					let temp = res.data.records
+					commit('getSamplingPersonList',temp)
+				}
+			})
+		},
+		getFiledIdCoalBunker({ state, commit }) {  //浠撳簱鍒楄〃锛堥噰鏍峰湴鐐癸級
+			let filedId = uni.getStorageSync('filedId')
+			console.log(filedId,'鏈�缁堢殑filedId=============')
+			reqGet('getFiledIdCoalBunker', {filedId: filedId}).then(res => {
+				console.log(res,'res----浠撳簱')
+				commit('getBunkerList',res.data)
+			})
+		},
+	},
+	getters:{
+		websocketData:(state) => state.websocketData,
+		samplingPersonList: (state) => state.samplingPersonList
+
 	}
 })
 

--
Gitblit v1.9.1