mao 1 năm trước cách đây
mục cha
commit
8eb4b7cb90

+ 61 - 52
components/dialog-login/dialog-login.vue

@@ -31,7 +31,7 @@
 	import {
 		getUserProcess
 	} from '@/api/process/process.js'
-	// import baseURL from '@/api/base/path.js'
+	import baseURL from '@/api/base/path.js'
 	import {
 		store
 	} from '@/store/index.js'
@@ -42,11 +42,13 @@
 	const successMsg = ref('登录成功')
 	const userInfo = ref({})
 	const user = ref([])
-	const baseURL = ref('')
+	const URL = ref('')
 	// const { proxy } = getCurrentInstance()
-
-
-
+	
+	onLoad(() => {
+		URL.value = baseURL;
+	})
+	
 	function init() {
 
 	}
@@ -61,7 +63,7 @@
 		uni.getStorage({
 			key: 'baseUrl',
 			success: function(res) {
-				baseURL.value = res.data;
+				URL.value = res.data;
 				// 加载
 				uni.showLoading({
 					title: '加载中'
@@ -69,55 +71,62 @@
 				setTimeout(function() {
 					uni.hideLoading();
 				}, 3000)
-				// 请求 
-				uni.request({
-					method: 'POST',
-					url: baseURL.value + '/login',
-					data: {
-						username: currentUser.value.userName,
-						password: currentUser.value.password
-					},
-					success: (res) => {
-						if (res.data.code === 200) {
-							uni.showToast({
-								title: successMsg.value,
-								icon: 'success',
-								duration: 2000
-							});
-							// 保存token
-							uni.setStorageSync('token', res.data.token);
-							uni.setStorage({
-								key: currentUser.value.userName,
-								data: currentUser.value.password,
+				loginRequest(URL.value);	
+			},
+			fail: function() {
+				loginRequest(URL.value)
+			}
+		});
+	}
+
+	function loginRequest(url){
+		// 请求
+		uni.request({
+			method: 'POST',
+			url: url + '/login',
+			data: {
+				username: currentUser.value.userName,
+				password: currentUser.value.password
+			},
+			success: (res) => {
+				if (res.data.code === 200) {
+					uni.showToast({
+						title: successMsg.value,
+						icon: 'success',
+						duration: 2000
+					});
+					// 保存token
+					uni.setStorageSync('token', res.data.token);
+					uni.setStorage({
+						key: currentUser.value.userName,
+						// data: currentUser.value.password,
+					});
+					// 获取员工工序信息
+					getUserProcess().then(res => {
+						store.userProcessInfo = res.data;
+					})
+					// 获取员工信息存入store,并跳转到控制面板
+					getUserInfo(currentUser.value).then((res) => {
+						if (res.code == 200) {
+							userInfo.value = res.data;
+							user.value.push(userInfo.value);
+							store.userInfo = res.data
+							console.log(store.userInfo)
+							uni.redirectTo({
+								url: '/pages/dashboard/index'
 							});
-							// 获取员工工序信息
-							getUserProcess().then(res => {
-								store.userProcessInfo = res.data;
-							})
-							// 获取员工信息存入store,并跳转到控制面板
-							getUserInfo(currentUser.value).then((res) => {
-								if (res.code == 200) {
-									userInfo.value = res.data;
-									user.value.push(userInfo.value);
-									store.userInfo = res.data
-									console.log(store.userInfo)
-									uni.redirectTo({
-										url: '/pages/dashboard/index'
-									});
-								}
-							})
-						} else {
-							uni.showToast({
-								title: errorMsg.value,
-								icon: 'error',
-								//显示持续时间为 2秒
-								duration: 2000
-							})
 						}
-					}
-				})
+					})
+				} else {
+					uni.showToast({
+						title: errorMsg.value,
+						icon: 'error',
+						//显示持续时间为 2秒
+						duration: 2000
+					})
+				}
 			}
-		});
+		})
 	}
 
 	/** 暴露给父组件的方法 */

+ 16 - 4
manifest.json

@@ -1,6 +1,6 @@
 {
-    "name" : "ezhizao_dms_app",
-    "appid" : "__UNI__D96EF63",
+    "name" : "德迈仕数字生产管理平台",
+    "appid" : "__UNI__B065984",
     "description" : "",
     "versionName" : "1.0.0",
     "versionCode" : "100",
@@ -41,9 +41,21 @@
                 ]
             },
             /* ios打包配置 */
-            "ios" : {},
+            "ios" : {
+                "dSYMs" : false
+            },
             /* SDK配置 */
-            "sdkConfigs" : {}
+            "sdkConfigs" : {
+                "ad" : {}
+            },
+            "icons" : {
+                "android" : {
+                    "hdpi" : "static/images/logo.png",
+                    "xhdpi" : "static/images/logo.png",
+                    "xxhdpi" : "static/images/logo.png",
+                    "xxxhdpi" : "static/images/logo.png"
+                }
+            }
         }
     },
     /* 快应用特有相关 */

+ 7 - 2
pages/addNewBatch/index.vue

@@ -36,7 +36,7 @@
 				<uni-icons type="paperclip" size="30" style="margin: 10rpx;"></uni-icons>
 				<view class='segment'></view>
 			</view>
-			<view>
+			<view class="incomingInfo">
 				<text class='title' style="margin-bottom: 50rpx;">基础信息</text>
 				<view class="uni-row info">
 					<label for="HeatNo">炉号:</label>
@@ -216,7 +216,12 @@
 		height: 100%;
 		background-color: #f5f5f5;
 	}
-
+	
+	.incomingInfo {
+		overflow: auto;
+		height: 30%;
+	}
+	
 	.bottom {
 		background-color: white;
 		width: 100%;

+ 2 - 2
pages/batchReporting/index.vue

@@ -50,7 +50,7 @@
 							@click.stop="handleShowTurnoverApplication(item)">周转申请</button>
 						<!-- <button class="reporting-tag" size="mini" @click="handleToreportingForWork">去报工</button> -->
 					</view>
-					<view v-else-if="item['status'] == 2" class=" uni-row">
+					<view v-else-if="item['currentStatus'] == 1" class=" uni-row">
 						<button class="turnover-tag" size="mini">取消周转</button>
 					</view>
 				</view>
@@ -360,7 +360,7 @@
 		.start-batch-btn {
 			flex: 1;
 			height: 80rpx;
-			// padding-top: 20 rpx;
+			line-height: 80rpx;
 			border-radius: 8rpx;
 			color: #FFFFFF;
 			font-size: 28rpx;

+ 4 - 0
pages/dashboard/index.vue

@@ -128,6 +128,10 @@
 </script>
 
 <style lang="scss">
+	.page-container {
+		height: 1000rpx;
+		overflow: auto;
+	}
 	.logo-container {
 		justify-content: center;
 

+ 17 - 3
pages/index/index.vue

@@ -1,8 +1,11 @@
 <template>
 	<view class="page-container uni-column">
+		<view class="uni-row" style="align-items: center;margin:8rpx 0 16rpx 0">
+			<image class="logo" src="../../static/images/logo.png" />
+			<uni-icons class="icon-gear" type="gear-filled" size="60" @click="handleGear"></uni-icons>
+		</view>
 		<view class="title uni-row" v-if="loggedUsers.length > 0">
 			<text>点击头像切换用户</text>
-			<uni-icons class="icon-gear" type="gear-filled" size="60" color="#1684fc" @click="handleGear"></uni-icons>
 		</view>
 		<view class="baseUrl uni-row" v-if="showInput">
 			<input v-model="baseUrl" placeholder="服务器地址" />
@@ -74,7 +77,7 @@
 									if (response.code == 200) {
 										loggedUsers.value.push({
 											userName: storagekey,
-											password: res.data,
+											// password: res.data,
 											nickName: response.msg
 										})
 									}
@@ -172,10 +175,21 @@
 </script>
 
 <style lang="scss">
+	.page-container {
+		overflow: auto;
+	}
+	
+	.logo {
+		width: 120rpx;
+		height: 120rpx;
+		margin: 0 auto;
+	}
+	
 	.title {
-		height: 128rpx;
+		height: 80rpx;
 		justify-content: center;
 		align-items: center;
+		color: #999999;
 	}
 
 	.icon-gear {

+ 13 - 2
pages/reportingForWork/index.vue

@@ -46,7 +46,7 @@
 				</view>
 				<view v-if="item['userId'] == userInfo['userId'] ? item['status'] == 0 : false" class="status-btn uni-row ">
 					<button class="finished-turnover-tag" size="mini"
-						@click.stop="handleShowEndWorkDialog(item)">开始报工</button>
+						@click.stop="handleStartFirstItem(item)">开始报工</button>
 				</view>
 			</view>
 		</scroll-view>
@@ -71,7 +71,8 @@
 	} from '@dcloudio/uni-app'
 	import {
 		getDayWorkItemList,
-		saveDayWorkItemBatch
+		saveDayWorkItemBatch,
+		updateDayWorkItem
 	} from "@/api/business/dayWorkItem.js"
 	import {
 		store
@@ -140,6 +141,15 @@
 	function handleStartProcessing() {
 		selectEquipment.value.open();
 	}
+	
+	function handleStartFirstItem(item){
+		item.status = 1;
+		updateDayWorkItem(item).then(res => {
+			if (res.code === 200) {
+				init();
+			}
+		})
+	}
 
 	function handleAddDayWorkItem(data) {
 		equipmentList.value = data;
@@ -151,6 +161,7 @@
 			productionPlanDetailSubDetailId: curSubDetails.value.id,
 			processId: store.dayworkInfo.currentProcess.id,
 			technologicalProcessId: dayworkInfo.technologicalProcessId,
+			status: 1,
 			startTime: timestampToTime(new Date())
 		}