guoyujia 1 жил өмнө
parent
commit
ce35749617

+ 6 - 0
api/login/index.js

@@ -11,6 +11,12 @@ export function getUserInfo() {
 	})
 }
 
+export function getTenantList() {
+	return req.request({
+		url:'/business/tenant/list',
+		method: 'GET',
+	})
+}
 export function getNickNameByUserName(userName) {
 	return req.request({
 		url:'/system/user/getNickNameByUserName?userName=' + userName,

+ 41 - 2
pages/dashboard/index.vue

@@ -14,6 +14,17 @@
 				<view class="process uni-row"><text class="label">当前工段:</text><text class="label">{{ deptName }}</text>
 				</view>
 			</view>
+			<view class="user-info uni-column" style="margin-left: 40rpx; width: 35%;">
+				<view class="nickname">
+				<text class="label">当前厂别</text></view>
+			<view class="uni-row info">
+				<select id="incomingInfo" class="uni-input data-select" v-model="userInfo.tenantId" @change="handleTenantChange" >
+					<option class="data-select-options" v-for="(item,index) in tenantList" :value="item.id" >{{item.orgName}} </option>
+				</select>
+				<!-- <input id="HeatNo" class="uni-input" v-model="basicInfo.heatNo" placeholder="请填写" /> -->
+				<!-- <text id="HeatNo" class="uni-input">{{basicInfo.heatNo}}</text> -->
+			</view>
+			</view>
 		</view>
 		<view class="business-btn uni-row" @click="handleToRecerptSfprod"><text class="label">半成品接收</text></view>
 		<view class="business-btn uni-row" @click="handleToProductionPlan"><text class="label">报工</text></view>
@@ -38,6 +49,7 @@
 		getSubPlanDetailsList
 	} from '../../api/business/subPlanDetails'
 	import {
+		getTenantList,
 		getDeptName
 	} from '@/api/login/index.js'
 	import { store } from '@/store/index.js'
@@ -48,13 +60,15 @@
 	const userName = ref('')
 	const userId = ref(null)
 	const userInfo = ref({})
+	const tenantList = ref([])
 	
-	onLoad((options) => {
+	onLoad(() => {
 		userInfo.value = store.userInfo || {
 			nickName: ""
 		};
-		console.log(userInfo.value)
+		store.tenantId = userInfo.value.tenantId
 		getDepartmentName()
+		getTenant()
 	})
 	
 	const handleToRecerptSfprod = () => {
@@ -91,6 +105,20 @@
 			}
 		})
 	}
+	 
+	function getTenant() {
+		getTenantList().then((res) => {
+			if(res.code == 200) {
+			tenantList.value = res.rows
+			
+			}
+		})
+	}
+	
+	function handleTenantChange() {
+		store.tenantId = userInfo.value.tenantId
+		console.log(store.tenantId)
+	}
 </script>
 
 <style lang="scss">
@@ -148,6 +176,17 @@
 				}
 			}
 		}
+		.data-select {
+			flex: 3;
+			width: 100%;
+			height: 50rpx;
+			border-radius: 18rpx;
+			background-color: #FFF;
+		
+			.data-select-options {
+				width: 200rpx;
+			}
+		}
 	}
 
 	.business-btn {

+ 23 - 8
pages/productionPlan/index.vue

@@ -65,13 +65,27 @@
 	import {
 		getToken
 	} from '@/utils/auth'
-	import { store } from '@/store/index.js'
-	
+	import {
+		store
+	} from '@/store/index.js'
+
+
 	const listData = ref([])
 	const keywords = ref('')
 
 	onLoad(() => {
-		init()
+		let requestParam = {}
+		if (!store.tenantId) {
+			requestParam = {
+				tenantId: store.userInfo.tenantId
+			}
+		}else {
+			requestParam = {
+				tenantId: store.tenantId
+			}
+		}
+
+		init(requestParam)
 	})
 
 	/**
@@ -84,7 +98,7 @@
 		}, 3000);
 	})
 
-	function init(data={}) {
+	function init(data = {}) {
 		uni.showLoading({
 			title: '加载中'
 		});
@@ -111,18 +125,18 @@
 					title: res.msg,
 					duration: 1500
 				})
-			} 
+			}
 		})
 	}
 
 	function handleToBatchReporting(item) {
 		store.planSubDetails = item
 		uni.navigateTo({
-			url: '/pages/batchReporting/index' 
+			url: '/pages/batchReporting/index'
 		})
 	}
-	
-	function handleSearch(){
+
+	function handleSearch() {
 		let reqParam = {
 			keywords: keywords.value
 		}
@@ -171,6 +185,7 @@
 			color: #808080;
 		}
 	}
+
 	.uni-column {
 		background-color: rgba(245, 245, 245, 1);
 		height: 100%;

+ 2 - 1
store/index.js

@@ -4,5 +4,6 @@ export const store = reactive({
   userInfo: null,
   planSubDetails: null,
   dayworkInfo: null,
-  userProcessInfo: null
+  userProcessInfo: null,
+  tenantId: null
 })