renmy 1 rok temu
rodzic
commit
89b43f9c07

+ 4 - 0
common/http.js

@@ -72,4 +72,8 @@ export function orderDeal(params){
 //获取工单处理过程列表
 export function getOrderDealList(params){
 	return request.post("/mini/workOrderLog/getList", params)
+}
+//我的-我的记录
+export function getMyRecord(stationCode){
+	return request.get("/mini/workOrderLog/mine/myRecord?stationCode=" + stationCode)
 }

+ 4 - 1
pages.json

@@ -15,7 +15,10 @@
 		    "style" :                                                                                    
 		    {
 		        "navigationBarTitleText": "工单上报",
-		        "enablePullDownRefresh": false
+		        "enablePullDownRefresh": false,
+				"app-plus": {
+					"softinputMode": "adjustResize"
+				}
 		    }
 		},
 		{

+ 32 - 11
pages/index/index.vue

@@ -35,7 +35,7 @@
 						</view>
 					</view>
 					<view class="page-home-order-item" @click="gotoOrder(0)">
-						<image class="page-home-order-img" src="@/static/home-order-four.png" mode=""></image>
+						<image class="page-home-order-img" src="@/static/home-order-first.png" mode=""></image>
 						<view class="page-home-order-name">
 							{{'未处理(' + notProcessed + ')'}}
 						</view>
@@ -114,21 +114,42 @@
 		methods: {
 			//跳转工单上报
 			gotoOrderUp() {
-				uni.navigateTo({
-					url: '/pages/index/orderUp',
-				})
+				let token = uni.getStorageSync('token')
+				if(!token) {
+					uni.navigateTo({
+						url: '/pages/public/login'
+					})
+				} else {
+					uni.navigateTo({
+						url: '/pages/index/orderUp',
+					})
+				}
 			},
 			//跳转工单页面
 			gotoOrder(type) {
-				uni.navigateTo({
-					url: '/pages/index/order?type=' + type,
-				})
+				let token = uni.getStorageSync('token')
+				if(!token) {
+					uni.navigateTo({
+						url: '/pages/public/login'
+					})
+				} else {
+					uni.navigateTo({
+						url: '/pages/index/order?type=' + type,
+					})
+				}
 			},
 			//跳转供应商页面
 			gotoSupplier(item) {
-				uni.navigateTo({
-					url: "/pages/index/supplier?stationCode=" + item.stationCode
-				})
+				let token = uni.getStorageSync('token')
+				if(!token) {
+					uni.navigateTo({
+						url: '/pages/public/login'
+					})
+				} else {
+					uni.navigateTo({
+						url: "/pages/index/supplier?stationCode=" + item.stationCode
+					})
+				}
 			},
 			//获取首页工单信息数据
 			getIndexOptionData() {
@@ -211,7 +232,7 @@
 						height: 128rpx;
 						position: relative;
 						margin: 0 12rpx 26rpx 12rpx;
-						padding: 24rpx;
+						// padding: 24rpx;
 						.page-home-order-img {
 							height: 100%;
 							width: 100%;

+ 31 - 4
pages/index/order.vue

@@ -4,13 +4,13 @@
 			<u-input type="select" class="page-search-text" :select-open="show" placeholder="请选择换电站" v-model="formData.name" @click="show = true"/>
 			<view class="searchType-top-container">
 				<view :class="current == 1 ? 'searchType-top-left-active' : 'searchType-top-left'" @click="tabsChange(1)">
-					待处理
+					{{"待处理(" + pending + ")"}}
 				</view>
 				<view :class="current == 0 ? 'searchType-top-left-active' : 'searchType-top-left'" @click="tabsChange(0)">
-					未处理
+					{{"未处理(" + notProcessed + ")"}}
 				</view>
 				<view :class="current == 2 ? 'searchType-top-left-active' : 'searchType-top-left'" @click="tabsChange(2)">
-					已完结
+					{{"已完结(" + closed + ")"}}
 				</view>
 			</view>
 			<!-- <u-tabs-swiper ref="tabs" :list="tabsList" :current="current" :is-scroll="false" bar-height="6" bar-width="40" active-color="#2979ff" @change="tabsChange" ></u-tabs-swiper> -->
@@ -62,7 +62,7 @@
 			//查询条件
 			formData: {
 				name: '全部站点',
-				stationCode: null,
+				stationCode: '',
 				pageIndex: 1,
 				pageSize: 10,
 				orderStatus: null,
@@ -79,6 +79,12 @@
 			pageTotal: 0,
 			//提示
 			textInfo: '',
+			//待处理
+			pending: 0,
+			//已完结
+			closed: 0,
+			//未处理
+			notProcessed: 0,
 	    }
 	  },
 		//第一次加载
@@ -104,6 +110,7 @@
 		mounted() {
 			this.getSites();
 			this.getDataList();
+			this.getIndexOptionData();
 		},
 		methods: {
 			// tabs通知swiper切换
@@ -129,12 +136,32 @@
 					}, 1000);
 				}
 			},
+			//获取工单信息数据
+			getIndexOptionData() {
+				const _that = this;
+				_that.dataInfo = {};
+				uni.showLoading({
+					title: '搜索中...',
+				})
+				_that.$http.getOpsOrderOverview(_that.formData.stationCode).then(res => {
+					uni.hideLoading();
+					if(res.code == 200) {
+						let {pending, closed, notProcessed} = res.data
+						_that.pending = pending;
+						_that.closed = closed;
+						_that.notProcessed = notProcessed;
+					} else {
+						_that.$utils.msg(res.msg);
+					}
+				})
+			},
 			//站点选择
 			siteSelectCallback(data) {
 				uni.hideKeyboard();
 				this.formData.name = data[0].label;
 				this.formData.stationCode = data[0].value;
 				this.getDataList();
+				this.getIndexOptionData();
 			},
 			//跳转详情页面
 			gotoDetail(item) {

+ 55 - 18
pages/index/orderDetail.vue

@@ -24,7 +24,7 @@
 					</view>
 					<view class="order-detail-site">
 						<view class="order-detail-status">
-							{{detailInfo.status == 0 ? '待处理...' : (detailInfo.status == 1 ? '分析中...' : '已完结')}}
+							{{detailInfo.status == 0 ? '待处理...' : (detailInfo.status == 1 ? '处理中...' : '已完结')}}
 						</view>
 						<view class="order-detail-site-text">
 							{{detailInfo.stationName || '-'}}
@@ -107,18 +107,18 @@
 						</view>
 					</view>
 				</view>
-				<view class="order-detail-deal" v-if="detailInfo.status == 0 || (detailInfo.status == 1 && detailInfo.currentPerson == userinfo.userId)">
-					<view class="order-detail-deal-title">
-						处理信息
-					</view>
-					<u-form :model="form" ref="uform" :rules="rules" label-align='left' label-width="150">
-						<u-form-item label="处理方式" prop="statusText">
+				<u-form :model="form" ref="uform" :rules="rules" label-align='left' label-width="150">
+					<view class="order-detail-deal" v-if="detailInfo.status == 0 || (detailInfo.status == 1 && detailInfo.currentPerson == userinfo.userId)">
+						<view class="order-detail-deal-title">
+							处理信息
+						</view>
+						<u-form-item label="*处理方式" prop="statusText">
 							<u-input type="select" :select-open="dealSelectShow" placeholder="请选择换电站" v-model="form.statusText" @click="dealSelectShow = true"/>
 						</u-form-item>
-						<u-form-item label="处理人员" prop="nextPerson" v-if="form.status == 3">
+						<u-form-item label="*处理人员" prop="nextPerson" v-if="form.status == 3">
 							<u-input type="select" :select-open="showPerson" placeholder="请选择处理人员" v-model="form.nextPerson" @click="showPerson = true"/>
 						</u-form-item>
-						<u-form-item label="处理记录" prop="info" :label-position="'top'">
+						<u-form-item label="*处理记录" prop="info" :label-position="'top'">
 							<u-input type="textarea" placeholder="请输入问题记录 不超过200个字" :maxlength="200" v-model="form.info" />
 						</u-form-item>
 						<u-form-item label="问题图片(不超过5张,20M以内)" prop="intro" :label-position="'top'">
@@ -131,10 +131,11 @@
 							</view>
 							<view class="uploadv" v-if="form.video">
 								<video class="u-add-btn" :src="form.video"></video>
+								<image class="u-add-img" src="@/static/index-delete.png" alt="" @click="delHandle"/>
 							</view>
 						</u-form-item>
-					</u-form>
-				</view>
+					</view>
+				</u-form>	
 				<view class="order-footer-button" :disabled="isClick" v-if="detailInfo.status == 0 || (detailInfo.status == 1 && detailInfo.currentPerson == userinfo.userId)" @click="submitHandle">
 					处理
 				</view>
@@ -148,7 +149,7 @@
 							</view>
 						</template>
 						<template v-slot:content>
-							<view>
+							<view style="margin-left: 20rpx;">
 								<view class="u-order-title">
 									<span class="u-order-time">{{item.handleTime || '-'}}</span>
 									<span class="u-order-name" v-if="item.processorName && item.nextPerson">{{item.processorName + '>' + item.nextPerson}}</span>
@@ -162,7 +163,6 @@
 								<view class="u-order-images"  v-if="item.video">
 									<video :src="item.video" class="u-order-img"></video>
 								</view>
-								
 							</view>
 						</template>
 					</u-time-line-item>
@@ -228,7 +228,13 @@
 							required: true, 
 						}
 					],
-					
+					nextPerson: [
+						{
+							trigger: ['change','blur'],
+							message: '请选择流转人员',
+							required: true, 
+						}
+					],
 				},
 				timeDatas: [],
 				//是否点击按钮
@@ -242,7 +248,7 @@
 			  this.userinfo = JSON.parse(userinfo)
 		},
 		onReady() {
-		  // this.$refs.uform.setRules(this.rules);
+		  this.$refs.uform.setRules(this.rules);
 		},
 		mounted() {
 			this.getDetailData();
@@ -360,6 +366,21 @@
 					},
 				})
 			},
+			//删除视频
+			delHandle() {
+				let _that = this;
+				uni.showModal({
+					title: '提示',
+					content:'确定删除该视频文件吗?',
+					success: (res) => {
+						if(res.confirm) {
+							_that.form.video = null
+						} else {
+							return
+						}
+					}
+				})
+			},
 			//视频上传
 			onVideoChooseComplete() {
 				const _that = this;
@@ -422,6 +443,16 @@
 							})
 							setTimeout(() => {
 								_that.getDetailData();
+								_that.form = {
+									status: null,
+									statusText: null,
+									info: null,
+									nextPerson: null,
+									nextId: null,
+									attachment: null,
+									img: [],
+									video: null,
+								}
 							}, 1000);
 						} else {
 							_that.$utils.msg(res.msg);
@@ -678,16 +709,15 @@
 				border-radius: 0rpx 0rpx 16rpx 16rpx;
 				min-height: 220rpx;
 				.time-line-node {
-					height: 80rpx;
 					background: #3F8CFF;
 					line-height: 80rpx;
-					width: auto;
-					padding: 0 10rpx;
+					width: 80rpx;
 					border-radius: 50%;
 					font-size: 28rpx;
 					font-family: PingFang SC-Regular, PingFang SC;
 					font-weight: 500;
 					color: #FFFFFF;
+					text-align: center;
 				}
 				.u-order-title {
 					display: flex;
@@ -774,6 +804,13 @@
 				margin-top: 20rpx;
 				line-height: 20rpx;
 			}
+			.u-add-img {
+				width: 50rpx;
+				height: 50rpx;
+				position: absolute;
+				top: 10rpx;
+				right: 15rpx;
+			}
 			.img {
 				width: 60%;
 				height: 60%;

+ 29 - 6
pages/index/orderUp.vue

@@ -4,11 +4,11 @@
 			<span class="order-imp">*</span>
 			工单信息填写
 		</view>
-		<u-form :model="form" ref="uform" :rules="rules" label-align='left' label-width="150">
-			<u-form-item label="换电站名" prop="stationName">
+		<u-form :model="form" ref="uform" :rules="rules" label-align='left' label-width="170">
+			<u-form-item label="*电站名称" prop="stationName">
 				<u-input type="select" :select-open="siteSelectShow" placeholder="请选择换电站" v-model="form.stationName" @click="siteSelectShow = true"/>
 			</u-form-item>
-			<u-form-item label="设备名称" prop="deviceName">
+			<u-form-item label="*设备名称" prop="deviceName">
 				<u-input type="select" :select-open="nameSelectShow" placeholder="请选择设备名称" v-model="form.deviceName" @click="nameSelectShow = true"/>
 			</u-form-item>
 			<u-form-item label="设备编号">
@@ -17,16 +17,16 @@
 			<u-form-item label="故障等级">
 				<u-input type="select" :select-open="levelSelectShow" placeholder="请选择故障等级" v-model="form.levelText" @click="levelSelectShow = true"/>
 			</u-form-item>
-			<u-form-item label="发生时间" prop="occurrenceTime">
+			<u-form-item label="*发生时间" prop="occurrenceTime">
 				<u-input type="select" :select-open="show" placeholder="请选择发生时间" v-model="form.occurrenceTime" @click="show = true"/>
 			</u-form-item>
 			<u-form-item label="处理人员">
 				<u-input type="select" :select-open="showPerson" placeholder="请选择处理人员" v-model="form.nextPerson" @click="personHandle"/>
 			</u-form-item>
-			<u-form-item label="问题描述" prop="problemTitle" :label-position="'top'">
+			<u-form-item label="*问题描述" prop="problemTitle" :label-position="'top'">
 				<u-input placeholder="请输入问题描述 不超过15个字" :maxlength="15" v-model="form.problemTitle" />
 			</u-form-item>
-			<u-form-item label="问题记录" prop="deviceProblem" :label-position="'top'">
+			<u-form-item label="*问题记录" prop="deviceProblem" :label-position="'top'">
 				<u-input type="textarea" placeholder="请输入问题记录 不超过200个字" :maxlength="200" v-model="form.deviceProblem" />
 			</u-form-item>
 			<u-form-item label="问题图片(不超过5张,20M以内)" prop="intro" :label-position="'top'">
@@ -39,6 +39,7 @@
 				</view>
 				<view class="uploadv" v-if="form.video">
 					<video class="u-add-btn" :src="form.video"></video>
+					<image class="u-add-img" src="@/static/index-delete.png" alt="" @click="delHandle"/>
 				</view>
 			</u-form-item>
 		</u-form>
@@ -361,6 +362,21 @@
 				    }
 				});
 			},
+			//删除视频
+			delHandle() {
+				let _that = this;
+				uni.showModal({
+					title: '提示',
+					content:'确定删除该视频文件吗?',
+					success: (res) => {
+						if(res.confirm) {
+							_that.form.video = null
+						} else {
+							return
+						}
+					}
+				})
+			}
 		}
 	}
 </script>
@@ -413,6 +429,13 @@
 				margin-top: 20rpx;
 				line-height: 20rpx;
 			}
+			.u-add-img {
+				width: 50rpx;
+				height: 50rpx;
+				position: absolute;
+				top: 10rpx;
+				right: 15rpx;
+			}
 			.img {
 				width: 60%;
 				height: 60%;

+ 4 - 2
pages/public/login.vue

@@ -59,6 +59,7 @@
 					that.params.encryptedData=e.detail.encryptedData
 					that.params.iv=e.detail.iv
 					that.$http.wxLogin(that.params).then(res=>{
+						uni.hideLoading()
 						if(res.code == 200){
 							that.$storage.setJson("token",res.token)
 							that.$http.getInfoData().then(response => {
@@ -70,11 +71,12 @@
 							uni.navigateBack()
 							that.isSubmit = false;
 						}else{
-							that.$utils.msg(res.msg);
 							uni.hideLoading()
+							return that.$utils.msg(res.msg);
 						}
 					}).catch(error=>{
-						that.$utils.msg(error);
+						uni.hideLoading()
+						return that.$utils.msg(error);
 					});
 				}
 			},

+ 99 - 13
pages/ucenter/index.vue

@@ -1,12 +1,18 @@
 <template>
 	<view class="personal-page">
 		<!-- <u-navbar :is-back="false" title="个人中心" :title-color="'#FFFFFF'" :background="{ background: background }"></u-navbar> -->
+		<view class="navBarBox">
+			<view class="statusBar" :style="{ paddingTop: statusBarHeight + 'px' }"></view>
+			<view class="navBar">
+				<view class="navBar-title">个人中心</view>
+			</view>
+		</view>
 		<view class="personal-place"></view>
 		<view class="personal-info">
 			<view class="personal-info-left">
 				<view class="personal-name">
 					<span>{{userinfo.nickName || '微信用户'}}</span>
-					<span class="personal-phone">{{' / ' + userinfo.phonenumber || '-'}}</span>
+					<span class="personal-phone">/{{userinfo.phonenumber || '-'}}</span>
 				</view>
 				<view class="personal-role">
 					{{userinfo.roles[0].roleName || '-'}}
@@ -18,13 +24,22 @@
 		</view>
 
 		<view class="toPage">
-			<view class="toPage-items" v-for="(item, index) in dataList" :key="index"  @click="toPage(item)">
+			<view class="toPage-items" @click="toPage(0)">
+				<u-icon size="40" name="order"></u-icon>
+				<view class="toPage-title">
+					工单上报
+				</view>
+				<view class="toPage-next">
+					{{esOrder + ' >'}}
+				</view>
+			</view>
+			<view class="toPage-items" @click="toPage(1)">
 				<u-icon size="40" name="order"></u-icon>
 				<view class="toPage-title">
-					{{item.title}}
+					参与工单
 				</view>
 				<view class="toPage-next">
-					>
+					{{processRecords + ' >'}}
 				</view>
 			</view>
 		</view>
@@ -51,12 +66,16 @@
 				dataInfo: {},
 				background: null,
 				userinfo: {},
+				//上报工单
+				esOrder: 0,
+				//参与工单
+				processRecords: 0,
+				// 状态栏高度
+				statusBarHeight: 0,
+				// 导航栏高度
+				navBarHeight: 82+11,
 			}
 		},
-		created() {
-			let userinfo = uni.getStorageSync('user')
-			this.userinfo = JSON.parse(userinfo)
-		},
 		computed: {
 			usernameFirst: {
 				get() {
@@ -72,13 +91,49 @@
 		},
 		onLoad() {
 			this.background = myPrimary;
+			this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight'];
+			let systemInfoSync = uni.getSystemInfoSync();
+			this.screenHeight = systemInfoSync.screenHeight - 500;
+		},
+		onShow() {
+			let userinfo = uni.getStorageSync('user')
+			if(userinfo) {
+				this.userinfo = JSON.parse(userinfo)
+			}
+			this.getMyRecordData();
 		},
 		methods: {
-			toPage(item) {
-				uni.navigateTo({
-					url: item.path + '?type=' + item.type
-				})
+			//跳转详情
+			toPage(type) {
+				let token = uni.getStorageSync('token')
+				if(!token) {
+					uni.navigateTo({
+						url: '/pages/public/login'
+					})
+				} else {
+					uni.navigateTo({
+						url: '/pages/ucenter/mineNotes?type=' + type
+					})
+				}
 			},
+			//获取我的记录数据
+			getMyRecordData() {
+				const _that = this;
+				_that.dataInfo = {};
+				uni.showLoading({
+					title: '搜索中...',
+				})
+				_that.$http.getMyRecord('').then(res => {
+					uni.hideLoading();
+					if(res.code == 200) {
+						let {esOrder, processRecords} = res.data
+						_that.esOrder = esOrder;
+						_that.processRecords = processRecords;
+					} else {
+						// _that.$utils.msg(res.msg);
+					}
+				})
+			}
 		}
 	}
 </script>
@@ -108,7 +163,7 @@
 			display: flex;
 			padding: 0 30rpx;
 			.personal-info-left {
-				width: 70%;
+				width: 80%;
 				.personal-name {
 					font-size: 40rpx;
 					font-family: PingFang SC-Semibold, PingFang SC;
@@ -175,5 +230,36 @@
 				}
 			}
 		}
+		.navBarBox{position: fixed;}
+		.navBarBox .statusBar {}
+		.navBarBox .navBar {
+			padding: 3rpx 50rpx;
+			padding-bottom: 8rpx;
+			display: flex;
+			flex-direction: row;
+			justify-content: center;
+			align-items: center;
+			position: fixed;
+			.navBar-title {
+				height: 24px;
+				font-size: 17px;
+				font-family: PingFang SC-Medium, PingFang SC;
+				font-weight: 500;
+				color: #000000;
+				line-height: 24px;
+			}
+		}
+		.navBarBox .navBar .logo {
+			width: 82rpx;
+			height: 82rpx;
+			margin-right: 10rpx;
+		}
+		.grace-loading {
+			position: relative;
+			text-align: center;
+			padding-top: 100rpx;
+			height: 300rpx;
+			color: #979797;
+		}
 	}
 </style>

+ 28 - 4
pages/ucenter/mineNotes.vue

@@ -4,10 +4,10 @@
 			<u-input type="select" class="page-search-text" :select-open="show" placeholder="请选择换电站" v-model="formData.name" @click="show = true"/>
 			<view class="searchType-top-container">
 				<view :class="current == 0 ? 'searchType-top-left-active' : 'searchType-top-left'" @click="tabsChange(0)">
-					工单上报
+					{{"工单上报(" + esOrder + ")"}}
 				</view>
 				<view :class="current == 1 ? 'searchType-top-right-active' : 'searchType-top-right'" @click="tabsChange(1)">
-					参与工单
+					{{"参与工单(" + processRecords + ")"}}
 				</view>
 			</view>
 		</view>
@@ -19,7 +19,7 @@
 							{{order.problemTitle || '-'}}
 						</view>
 						<view class="order-status">
-							{{order.status == 0 ? '未处理' : (order.status == 1 ? '处理' : '已完结')}}
+							{{order.status == 0 ? '未处理' : (order.status == 1 ? '处理' : '已完结')}}
 						</view>
 					</view>
 					<view class="order-time">
@@ -57,7 +57,7 @@
 			//查询条件
 			formData: {
 				name: '全部站点',
-				stationCode: null,
+				stationCode: '',
 				recordType: 0,
 				pageIndex: 1,
 				pageSize: 10,
@@ -74,6 +74,10 @@
 			pageTotal: 0,
 			//提示
 			textInfo: '',
+			//上报工单
+			esOrder: 0,
+			//参与工单
+			processRecords: 0,
 	    }
 	  },
 		//第一次加载
@@ -98,6 +102,7 @@
 		mounted() {
 			this.getSites();
 			this.getDataList();
+			this.getMyRecordData();
 		},
 		methods: {
 			// tabs通知swiper切换
@@ -132,6 +137,7 @@
 				this.formData.name = data[0].label;
 				this.formData.stationCode = data[0].value;
 				this.getDataList();
+				this.getMyRecordData();
 			},
 			//跳转详情页面
 			gotoDetail(item) {
@@ -161,6 +167,7 @@
 					title: '搜索中...',
 				})
 				_that.$http.getOrderLogList(_that.formData).then(res => {
+					uni.hideLoading();
 					if(res.code == 200) {
 						if (_that.formData.pageIndex == 1) _that.orderlist = [];
 						 _that.pageTotal = res.data.total;
@@ -169,7 +176,24 @@
 					} else {
 						_that.$utils.msg(res.msg);
 					}
+				})
+			},
+			//获取我的记录数据
+			getMyRecordData() {
+				const _that = this;
+				_that.dataInfo = {};
+				uni.showLoading({
+					title: '搜索中...',
+				})
+				_that.$http.getMyRecord(_that.formData.stationCode).then(res => {
 					uni.hideLoading();
+					if(res.code == 200) {
+						let {esOrder, processRecords} = res.data
+						_that.esOrder = esOrder;
+						_that.processRecords = processRecords;
+					} else {
+						_that.$utils.msg(res.msg);
+					}
 				})
 			}
 		}	

BIN
static/index-delete.png