Pārlūkot izejas kodu

合并了一些冲突
登录代码做了调整

zhuangdezheng 1 gadu atpakaļ
vecāks
revīzija
50f8f57c42

+ 2 - 2
api/base/path.js

@@ -1,3 +1,3 @@
-const baseURL = 'http://192.168.31.147:8099';
+const baseURL = 'http://192.168.31.147:8099'
 
-export default baseURL;
+export default baseURL

+ 1 - 1
api/business/subPlanDetails.js

@@ -18,4 +18,4 @@ export function getSubPlanDetailsList(data) {
 		method: 'GET',
 		data: data
 	})
-}
+}

+ 7 - 0
api/login/index.js

@@ -10,4 +10,11 @@ export function getUserInfo() {
 		// header: reqHeader,
 		method: 'GET',
 	})
+}
+export function getDeptName(userId) {
+	return req.request({
+		url:'/system/dept/getDeptName/'+userId,
+		// header: reqHeader,
+		method: 'GET',
+	})
 }

+ 10 - 7
components/dialog-login/dialog-login.vue

@@ -29,7 +29,8 @@
 	const currentUser = ref({})
 	const errorMsg = ref('用户名或密码错误')
 	const successMsg = ref('登录成功')
-	const userInfo = ref ([])
+	const userInfo = ref ({})
+	const user = ref([])
 	// const { proxy } = getCurrentInstance()
 
 	const open = (data) => {
@@ -37,7 +38,7 @@
 		// console.log(dialog.value)
 		baseDialog.value.open()
 	}
-	const handleLogin = () => {
+	 const handleLogin = () => {
 		uni.request({
 			method: 'POST',
 			url: baseURL +'/login',
@@ -63,13 +64,15 @@
 					});
 					getUserInfo(currentUser.value).then((res)=>{
 						if(res.code ==200) {
-							userInfo.value.push(res.data)
-							console.log(userInfo.value)
+							userInfo.value = res.data;
+							user.value.push(userInfo.value);
+							console.log(userInfo.value,999);
+							uni.redirectTo({
+					  url: '/pages/dashboard/index?userName='+userInfo.value.userName + '&userId=' + userInfo.value.userId
+					});
 						}
 					})
-					uni.redirectTo({
-						url: '/pages/dashboard/index'
-					})
+					
 				} else {
 					uni.showToast({
 						title: errorMsg.value,

+ 1 - 0
pages.json

@@ -36,6 +36,7 @@
 			"path": "pages/productionPlan/index",
 			"style": {
 				"navigationBarTitleText": "生产计划单"
+				// "enablePullDownRefresh":true
 			}
 		},
 		{

+ 4 - 35
pages/batchReporting/index.vue

@@ -67,41 +67,7 @@
 	})
 	const turnoverApplicationDialog = ref(null)
 	const lotDialog = ref(null)
-	const listData = ref([
-		{
-			batchNumber: "DC23727410070",
-			caseNumber: "X12522、X522、X15522、J5211、J5112",
-			totalWorkingHours: 135.5,
-			qualifiedQuantity: 600,
-			invest: 1000,
-			previousProcess: "NC车1",
-			currentProcess: "热处理",
-			NextProcess: "清洗",
-			status: 0
-		},
-		{
-			batchNumber: "DC23727410070",
-			caseNumber: "X12522、X522、X15522、J5211、J5112",
-			totalWorkingHours: 135.5,
-			qualifiedQuantity: 600,
-			invest: 1000,
-			previousProcess: "NC车1",
-			currentProcess: "热处理",
-			NextProcess: "清洗",
-			status: 1
-		},
-		{
-			batchNumber: "DC23727410070",
-			caseNumber: "X12522、X522、X15522、J5211、J5112",
-			totalWorkingHours: 135.5,
-			qualifiedQuantity: 600,
-			invest: 1000,
-			previousProcess: "NC车1",
-			currentProcess: "热处理",
-			NextProcess: "清洗",
-			status: 2
-		}
-	])
+	const listData = ref([])
 	const handleShowTurnoverApplication = (data) => {
 		let _data = data ?? {}
 		// 调用子组件中的方法
@@ -112,6 +78,9 @@
 		// 调用子组件中的方法
 		lotDialog.value.open(_data)
 	}
+	const init = () = > {
+		
+	}
 
 </script>
 

+ 163 - 145
pages/dashboard/index.vue

@@ -1,152 +1,170 @@
 <template>
-	<view class="page-container uni-column">
-		<view class="logo-container uni-row">
-			<image class="logo" src="../../static/images/logo.png" />
-		</view>
-		<view class="title"><text class="label">德迈仕数字生产线管理平台</text></view>
-		<view class="user-info-container uni-row">
-			<view class="icon"><text class="label">张</text></view>
-			<view class="user-info uni-column">
-				<view class="nickname"><text class="label">张三 ID 15521</text> </view>
-				<view class="process"><text class="label">当前工段:热处理</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>
-		<view class="business-btn uni-row" @click="handleToHandlingList"><text class="label">周转</text></view>
-		<view class="bottom-btn-container">
-			<view class="start-batch-btn uni-row"><text class="label">绑定设备</text></view>
-			<view class="start-batch-btn uni-row" @click="handleSwitchOrQuit"><text class="label">切换 / 退出账号</text></view>
-		</view>
-	</view>
+  <view class="page-container uni-column">
+    <view class="logo-container uni-row">
+      <image class="logo" src="../../static/images/logo.png" />
+    </view>
+    <view class="title"><text class="label">德迈仕数字生产线管理平台</text></view>
+    <view class="user-info-container uni-row">
+      <view class="icon"
+        ><text class="label">{{ userName.charAt(0) }}</text></view
+      >
+      <view class="user-info uni-column">
+        <view class="nickname uni-row"
+          ><text class="label">{{ userName }}</text
+          ><text class="label" style="margin-left: 12rpx">ID</text><text class="label" style="margin-left: 8rpx">{{ userId }}</text>
+        </view>
+        <view class="process uni-row"
+          ><text class="label">当前工段:</text><text class="label">{{ deptName }}</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>
+    <view class="business-btn uni-row" @click="handleToHandlingList"><text class="label">周转</text></view>
+    <view class="bottom-btn-container">
+      <view class="start-batch-btn uni-row"><text class="label">绑定设备</text></view>
+      <view class="start-batch-btn uni-row" @click="handleSwitchOrQuit"><text class="label">切换 / 退出账号</text></view>
+    </view>
+  </view>
 </template>
 
 <script setup>
-	import { ref } from 'vue'
-	import { onLoad, onReady } from '@dcloudio/uni-app'
-	import { getSubPlanDetailsList } from '../../api/business/subPlanDetails'
-	
-	const name = ref('')
-	
-	const handleToRecerptSfprod = () => {
-		uni.navigateTo({
-			url: "/pages/recerptSfprod/index",
-		})
-	}
-	const handleToProductionPlan = () => {
-		uni.navigateTo({
-			url: "/pages/productionPlan/index",
-		});
-		getSubPlanDetailsList().then(res => {
-			console.log(res);
-		})
-	}
-	const handleToHandlingList = () => {
-		uni.navigateTo({
-			url: "/pages/handlingList/index",
-		});
-	}
-	const handleSwitchOrQuit = () =>{
-		uni.navigateTo({
-		    url:"/pages/index/index",
-		})
-	}
-	
-	onReady(() => {
-		//console.log('token:' + uni.getStorageSync('token'))
-	})
+import { ref } from 'vue'
+import { onLoad, onReady } from '@dcloudio/uni-app'
+import { getSubPlanDetailsList } from '../../api/business/subPlanDetails'
+import { getDeptName } from '@/api/login/index.js'
+import { onLoad, onReady } from '@dcloudio/uni-app'
+
+onLoad((options) => {
+  userName.value = options.userName
+  userId.value = options.userId
+  getDepartmentName()
+})
+const deptName = ref('')
+const name = ref('')
+const userName = ref('')
+const userId = ref(null)
+const handleToRecerptSfprod = () => {
+  uni.navigateTo({
+    url: '/pages/recerptSfprod/index'
+  })
+}
+const handleToProductionPlan = () => {
+  uni.navigateTo({
+    url: '/pages/productionPlan/index'
+  })
+  getSubPlanDetailsList().then((res) => {
+    console.log(res)
+  })
+}
+const handleToHandlingList = () => {
+  uni.navigateTo({
+    url: '/pages/handlingList/index'
+  })
+}
+const handleSwitchOrQuit = () => {
+  uni.navigateTo({
+    url: '/pages/index/index'
+  })
+}
+function getDepartmentName() {
+  getDeptName(userId.value).then((res) => {
+    if (res.code == 200) {
+      deptName.value = res.msg
+    }
+  })
+}
 </script>
 
 <style lang="scss">
-	.logo-container {
-		justify-content: center;
-		
-		.logo {
-			width: 120rpx;
-			height: 120rpx;
-		}
-	}
-
-	.title {
-		align-items: center;
-
-		.label {
-			font-size: 40rpx;
-			font-weight: bold;
-		}
-	}
-
-	.user-info-container {
-		margin: 64rpx 0 40rpx 8rpx;
-		
-		.icon {
-			width: 120rpx;
-			height: 120rpx;
-			justify-content: center;
-			align-items: center;
-			border-radius: 60rpx;
-			border: 1px solid #e1e1e1;
-			
-			.label {
-				font-size: 64rpx;
-			}
-		}
-
-		.user-info {
-			margin-left: 8rpx;
-			justify-content: center;
-
-			// font-size: 20rpx;
-			.nickname {
-				margin-bottom: 16rpx;
-				.label {
-					font-weight: bold;
-					font-size: 32rpx;
-				}
-			}
-
-			.process {
-				.label {
-					font-size: 32rpx;
-				}
-			}
-		}
-	}
-
-	.business-btn {
-		margin: 0 20rpx 20rpx 20rpx;
-		background-color: #fff;
-		height: 200rpx;
-		border-radius: 4;
-		align-items: center;
-		justify-content: center;
-		border: 1px solid #e1e1e1;
-		border-radius: 8rpx;
-
-		.label {
-			font-size: 40rpx;
-		}
-	}
-
-	.bottom-btn-container {
-		position: fixed;
-		right: 20rpx;
-		bottom: 0;
-		left: 20rpx;
-		
-		.start-batch-btn {
-			background-color: grey;
-			margin-bottom: 24rpx;
-			border-radius: 8rpx;
-			justify-content: center;
-			align-items: center;
-			height: 80rpx;
-		
-			.label {
-				font-size: 32rpx;
-				color: #FFFFFF;
-			}
-		}
-	}
-
-</style>
+.logo-container {
+  justify-content: center;
+
+  .logo {
+    width: 120rpx;
+    height: 120rpx;
+  }
+}
+
+.title {
+  align-items: center;
+
+  .label {
+    font-size: 40rpx;
+    font-weight: bold;
+  }
+}
+
+.user-info-container {
+  margin: 64rpx 0 40rpx 8rpx;
+
+  .icon {
+    width: 120rpx;
+    height: 120rpx;
+    justify-content: center;
+    align-items: center;
+    border-radius: 60rpx;
+    border: 1px solid #e1e1e1;
+
+    .label {
+      font-size: 64rpx;
+    }
+  }
+
+  .user-info {
+    margin-left: 8rpx;
+    justify-content: center;
+
+    // font-size: 20rpx;
+    .nickname {
+      margin-bottom: 16rpx;
+      .label {
+        font-weight: bold;
+        font-size: 32rpx;
+      }
+    }
+
+    .process {
+      .label {
+        font-size: 32rpx;
+      }
+    }
+  }
+}
+
+.business-btn {
+  margin: 0 20rpx 20rpx 20rpx;
+  background-color: #fff;
+  height: 200rpx;
+  border-radius: 4;
+  align-items: center;
+  justify-content: center;
+  border: 1px solid #e1e1e1;
+  border-radius: 8rpx;
+
+  .label {
+    font-size: 40rpx;
+  }
+}
+
+.bottom-btn-container {
+  position: fixed;
+  right: 20rpx;
+  bottom: 0;
+  left: 20rpx;
+
+  .start-batch-btn {
+    background-color: grey;
+    margin-bottom: 24rpx;
+    border-radius: 8rpx;
+    justify-content: center;
+    align-items: center;
+    height: 80rpx;
+
+    .label {
+      font-size: 32rpx;
+      color: #ffffff;
+    }
+  }
+}
+</style>

+ 160 - 162
pages/productionPlan/index.vue

@@ -1,175 +1,173 @@
 <template>
-	<view class="uni-column" style="padding: 24rpx;">
-		<view v-for="(item, index) in listData" :key="index" class="list-item">
-			<view class="title-container uni-row">
-				<view class="title uni-row">
-					<text class="label">生产计划单号</text>
-					<text class="label code">{{ item['productionPlanNo'] }}</text>
-				</view>
-				<view v-if="item['status']" class="tag"><text class="label">进行中</text></view>
-				<view v-else type="default" class="tag not-start"><text class="label">未开始</text></view>
-			</view>
-			<!-- 			<view class="item-info uni-row">
+  <view class="uni-column" style="padding: 24rpx">
+    <view v-for="(item, index) in listData" :key="index" @click="handleToBatchReporting" class="list-item">
+      <view class="title-container uni-row">
+        <view class="title uni-row">
+          <text class="label">生产计划单号</text>
+          <text class="label code">{{ item['productionPlanNo'] }}</text>
+        </view>
+        <view v-if="item['dayWorkList'].length > 0" class="tag"><text class="label">进行中</text></view>
+        <view v-else type="default" class="tag not-start"><text class="label">未开始</text></view>
+      </view>
+      <!-- 			<view class="item-info uni-row">
 				<text class="label">当前工序</text>
 				<text class="label right">{{ item['process'] }}</text>
 			</view> -->
-			<view class="item-info uni-row">
-				<text class="label">产品描述</text>
-				<text class="label right">{{ item['productDescription']}}</text>
-			</view>
-			<view class="item-info uni-row">
-				<text class="label">总批数</text>
-				<text class="label right">{{ item['batchNumber'] }}</text>
-			</view>
-			<view class="item-info uni-row">
-				<text class="label">完成批数</text>
-				<text class="label right">{{ item['equiment']}}</text>
-			</view>
-			<view class="item-info uni-row">
-				<text class="label">投产数/合格数</text>
-				<text class="label right">{{ item['qualifiedQuantity'] }}/{{item['invest']}}</text>
-			</view>
-			<view class="item-info uni-row">
-				<text class="label">设备</text>
-				<text class="label right">{{ item['equiment']}}</text>
-			</view>
-			<!-- 			<view class="item-info uni-row">
+      <view class="item-info uni-row">
+        <text class="label">产品描述</text>
+        <text class="label right">{{ item['productDescription'] }}</text>
+      </view>
+      <view class="item-info uni-row">
+        <text class="label">总批数</text>
+        <text class="label right">{{ item['lotNumber'] }}</text>
+      </view>
+      <view class="item-info uni-row">
+        <text class="label">完成批数</text>
+        <text class="label right">{{ item['equiment'] }}</text>
+      </view>
+      <view class="item-info uni-row">
+        <text class="label">投产数/合格数</text>
+        <text class="label right">{{ item['productionQuantity'] }}/{{ item['invest'] }}</text>
+      </view>
+      <view class="item-info uni-row">
+        <text class="label">设备</text>
+        <text class="label right">{{ item['equipmentName'] }}</text>
+      </view>
+      <!-- 			<view class="item-info uni-row">
 				<text class="label">操作人</text>
 				<text class="label right">{{ item['operator'] }}</text>
 			</view> -->
-		</view>
-	</view>
+    </view>
+  </view>
 </template>
 
 <script setup>
-	import {
-		getSubPlanDetailsList
-	} from '../../api/business/subPlanDetails'
-	import {
-		ref
-	} from 'vue'
-	import {
-		onReady,
-		onLoad
-	} from '@dcloudio/uni-app'
-	import { getToken } from '@/utils/auth'
-	
-
-	const listData = ref([])
-	onLoad(() => {
-		init();
-	})  
-
-	function init(){
-		getSubPlanDetailsList({}).then(res => {
-			console.log(res)
-			if (res.code === 200) {
-				listData.value = res.rows;
-			} else if (res.code === 401) {
-				uni.showToast({
-					icon: 'none',
-					title: "未登录或登录状态已超时",
-					duration: 1500
-				});
-			} else if (res.code === 500) {
-				uni.showToast({
-					icon: 'none',
-					title: "系统错误,请联系管理员",
-					duration: 1500
-				});
-			} else {
-				uni.showToast({
-					icon: 'none',
-					title: res.msg,
-					duration: 1500
-				});
-			}
-		})
-
-		// let token = 'Bearer ' + getToken();
-		// let reqHeader = {
-		//   'Authorization': token
-		// }
-		// console.log(reqHeader)	
-		// console.log(getToken())
-		// uni.request({
-		// 	url: 'http://localhost:8081/business/planDetailSubDetail/list',
-		// 	header: reqHeader,
-		// 	method: 'get',
-		// }).then( res => {
-		// 	console.log(res)
-		// 	listData.value = res.data.rows;
-		// }) 
-	} 
-	
+import { getSubPlanDetailsList } from '../../api/business/subPlanDetails'
+import { ref } from 'vue'
+import { onReady, onLoad } from '@dcloudio/uni-app'
+import { getToken } from '@/utils/auth'
+
+const listData = ref([])
+
+onLoad(() => {
+  init()
+})
+
+function init() {
+  getSubPlanDetailsList({}).then((res) => {
+    console.log(res)
+    if (res.code === 200) {
+      listData.value = res.rows
+    } else if (res.code === 401) {
+      uni.showToast({
+        icon: 'none',
+        title: '未登录或登录状态已超时',
+        duration: 1500
+      })
+    } else if (res.code === 500) {
+      uni.showToast({
+        icon: 'none',
+        title: '系统错误,请联系管理员',
+        duration: 1500
+      })
+    } else {
+      uni.showToast({
+        icon: 'none',
+        title: res.msg,
+        duration: 1500
+      })
+    }
+  })
+
+  // let token = 'Bearer ' + getToken();
+  // let reqHeader = {
+  //   'Authorization': token
+  // }
+  // console.log(reqHeader)
+  // console.log(getToken())
+  // uni.request({
+  // 	url: 'http://localhost:8081/business/planDetailSubDetail/list',
+  // 	header: reqHeader,
+  // 	method: 'get',
+  // }).then( res => {
+  // 	console.log(res)
+  // 	listData.value = res.data.rows;
+  // })
+}
+
+function handleToBatchReporting() {
+  uni.navigateTo({
+    url: '/pages/batchReporting/index'
+  })
+}
 </script>
 
 <style lang="scss">
-	.uni-column {
-		background-color: rgba(245, 245, 245, 1);
-	}
-
-	.list-item {
-		background-color: #fff;
-		position: relative;
-		padding: 16rpx;
-		padding-bottom: 24rpx;
-		margin-bottom: 24rpx;
-
-		.title-container {
-			justify-content: space-between;
-			margin-top: 8rpx;
-			margin-bottom: 16rpx;
-
-			.title {
-				height: 48rpx;
-				align-items: center;
-
-				.label {
-					font-size: 32rpx;
-					font-weight: bold;
-
-					&.code {
-						margin-left: 8rpx;
-					}
-				}
-			}
-
-			.tag {
-				border: 1px solid #1CE5B0;
-				background-color: #F6FFFD;
-				padding: 8rpx;
-				border-radius: 8rpx;
-
-				.label {
-					color: #1CE5B0;
-					font-size: 24rpx;
-				}
-
-				&.not-start {
-					border: 1px solid #BBBBBB;
-					background-color: #F5F5F5;
-
-					.label {
-						color: #BBBBBB;
-					}
-				}
-			}
-		}
-
-		.item-info {
-			margin-bottom: 8rpx;
-
-			.label {
-				font-size: 28rpx;
-				width: 220rpx;
-				color: #808080;
-
-				&.right {
-					flex: 1;
-					color: #000000;
-				}
-			}
-		}
-	}
-</style>
+.uni-column {
+  background-color: rgba(245, 245, 245, 1);
+}
+
+.list-item {
+  background-color: #fff;
+  position: relative;
+  padding: 16rpx;
+  padding-bottom: 24rpx;
+  margin-bottom: 24rpx;
+
+  .title-container {
+    justify-content: space-between;
+    margin-top: 8rpx;
+    margin-bottom: 16rpx;
+
+    .title {
+      height: 48rpx;
+      align-items: center;
+
+      .label {
+        font-size: 32rpx;
+        font-weight: bold;
+
+        &.code {
+          margin-left: 8rpx;
+        }
+      }
+    }
+
+    .tag {
+      border: 1px solid #1ce5b0;
+      background-color: #f6fffd;
+      padding: 8rpx;
+      border-radius: 8rpx;
+
+      .label {
+        color: #1ce5b0;
+        font-size: 24rpx;
+      }
+
+      &.not-start {
+        border: 1px solid #bbbbbb;
+        background-color: #f5f5f5;
+
+        .label {
+          color: #bbbbbb;
+        }
+      }
+    }
+  }
+
+  .item-info {
+    margin-bottom: 8rpx;
+
+    .label {
+      font-size: 28rpx;
+      width: 220rpx;
+      color: #808080;
+
+      &.right {
+        flex: 1;
+        color: #000000;
+      }
+    }
+  }
+}
+</style>