Browse Source

报修系统完善

xiaoxin 2 years ago
parent
commit
d33f4cbd59

+ 0 - 1
pages.json

@@ -161,7 +161,6 @@
 				"path": "message/message",
 				"style": {
 					"navigationBarTitleText": "消息中心",
-					"disableScroll": true,
 					"navigationBarBackgroundColor": "#6FB6B8",
 					"navigationBarTextStyle": "white",
 					"backgroundColorTop": "#6FB6B8",

+ 9 - 0
pagesRepairs/box/box.vue

@@ -109,6 +109,7 @@ export default {
 	},
 	onLoad() {
 		uni.$on('goToRepairs', this.goToRepairs)
+		uni.$on('goToMyRepairs', this.goToMyRepairs)
 		console.log('box页面加载')
 	},
 	onUnload() {
@@ -124,6 +125,14 @@ export default {
 				title: e.title
 			})
 		},
+		goToMyRepairs(e) {
+			// console.log(e)
+			this.show = e.show
+			this.currentRouter = 1
+			uni.setNavigationBarTitle({
+				title: e.title
+			})
+		},
 		// 底部导航栏切换回调
 		handleChangeRouter(show, text, e) {
 			uni.setStorageSync('currentIndexRepairs', e)

+ 2 - 2
pagesRepairs/home/home.vue

@@ -234,7 +234,7 @@ export default {
 				url: '/repairSystemMessages/querySystemMessagePage',
 				data: {
 					currentPage: 1,
-					pageCount: 10,
+					pageCount: 8,
 					userId: this.userId
 				}
 			})
@@ -668,7 +668,7 @@ export default {
 		z-index: 2;
 		position: fixed;
 		right: 0;
-		bottom: 200rpx;
+		bottom: 160rpx;
 		display: flex;
 		justify-content: space-evenly;
 		align-items: center;

+ 34 - 29
pagesRepairs/index/index.vue

@@ -44,46 +44,30 @@ export default {
 	},
 	mounted() {
 		this.hasUserInfo()
-		// uni.setStorageSync('currentIndexRepairs', 0)
-		// uni.showActionSheet({
-		// 	itemList: ['用户', '维修师傅', '管理员', '后勤'],
-		// 	success: (res) => {
-		// 		if (res.tapIndex == 0) {
-		// 			uni.setStorageSync('repairsUserInfo', this.userListInfo)
-		// 		} else if (res.tapIndex == 1) {
-		// 			uni.setStorageSync('repairsUserInfo', this.workerListInfo)
-		// 		} else if (res.tapIndex == 2) {
-		// 			uni.setStorageSync('repairsUserInfo', this.adminListInfo)
-		// 		} else if (res.tapIndex == 3) {
-		// 			uni.setStorageSync('repairsUserInfo', this.logisticsListInfo)
-		// 		}
-		// 		uni.reLaunch({
-		// 			url: '/pagesRepairs/box/box'
-		// 		})
-		// 	}
-		// })
 	},
 	methods: {
-		// 检查是否存在用户信息
+		// 检查用户是否已经授权
 		hasUserInfo() {
 			const repairsUserInfo = uni.getStorageSync('repairsUserInfo')
-			console.log(repairsUserInfo)
-			if (repairsUserInfo) {
+			const openId = uni.getStorageSync('openId')
+			// console.log(repairsUserInfo)
+			// console.log(openId)
+			if (repairsUserInfo && openId) {
 				uni.setStorageSync('currentIndexRepairs', 0)
 				uni.reLaunch({
 					url: '/pagesRepairs/box/box'
 				})
 			} else {
-				console.log('重新授权')
+				// console.log('重新授权')
 				this.showLogin = true
 				this.visible = true
 			}
 		},
 		// 授权成功回调
 		loginSuccess(res) {
-			console.log('成功')
+			// console.log('成功')
 			let wxcode = res.detail.wxcode
-			console.log(wxcode)
+			// console.log(wxcode)
 			// 获取wxcode后请求登录
 			this.login(wxcode)
 		},
@@ -97,16 +81,37 @@ export default {
 					wxcode
 				}
 			})
-			console.log(res)
+			// console.log(res)
 			if (res.code === '200') {
 				uni.setStorageSync('repairsUserInfo', res.data)
 				uni.setStorageSync('currentIndexRepairs', 0)
-
-				uni.reLaunch({
-					url: '/pagesRepairs/box/box'
-				})
+				this.getOpenId()
 			}
 		},
+		// 获取用户openId
+		getOpenId() {
+			// 获取code
+			uni.login({
+				//使用微信登录
+				provider: 'weixin',
+				success: async (res) => {
+					const result = await this.$myRequest_repairs({
+						url: '/login/XOpenid',
+						data: {
+							code: res.code,
+							userId: uni.getStorageSync('repairsUserInfo').userId
+						}
+					})
+					// console.log(result)
+					if (result.code === '200') {
+						uni.setStorageSync('openId', result.data.openId)
+						uni.reLaunch({
+							url: '/pagesRepairs/box/box'
+						})
+					}
+				}
+			})
+		},
 		// 授权失败回调
 		loginFail() {
 			// console.log("授权失败");

+ 8 - 7
pagesRepairs/management/management.vue

@@ -96,6 +96,7 @@
 					<view class="box_key">报修姓名:</view>
 					<view class="box_value">{{ item.userName }}</view>
 					<view class="box_type" v-if="item.timeoutStr">超时未接</view>
+					<view class="box_type" v-if="item.maintenanceTimeout">维修超时</view>
 				</view>
 
 				<!-- 报修电话 -->
@@ -126,7 +127,7 @@
 				</view>
 
 				<!-- 故障描述 -->
-				<view class="item_box">
+				<view class="item_box" v-if="item.description">
 					<view class="box_key">故障描述:</view>
 					<view class="box_value">{{ item.description }}</view>
 				</view>
@@ -138,7 +139,7 @@
 				</view>
 
 				<!-- 维修师傅 -->
-				<view class="item_time" v-if="item.state !== '待接单' && item.state !== '待确认'">
+				<view class="item_time" v-if="item.state !== '待接单' && item.state !== '待确认' && item.maintenancerName">
 					<view class="time_msg">
 						维修师傅:
 						<text>{{ item.maintenancerName }}</text>
@@ -146,7 +147,7 @@
 				</view>
 
 				<!-- 师傅电话 -->
-				<view class="item_box" v-if="item.state !== '待接单' && item.state !== '待确认'">
+				<view class="item_box" v-if="item.state !== '待接单' && item.state !== '待确认' && item.maintenancerPhone">
 					<view class="box_key">师傅电话:</view>
 					<view class="box_value phone" @click="handleCallPhone(item.maintenancerPhone)">
 						{{ item.maintenancerPhone }}
@@ -155,7 +156,7 @@
 				</view>
 
 				<!-- 维修费用 -->
-				<view class="item_box" v-if="item.state === '待审核' || item.state === '已完成' || item.state === '待确认'">
+				<view class="item_box" v-if="(item.state === '待审核' || item.state === '已完成' || item.state === '待确认') && item.price">
 					<view class="box_key">维修费用:</view>
 					<view class="box_value2 phone" @click="checkFeeDetail(item)">
 						{{ item.price }}元
@@ -334,7 +335,6 @@ export default {
 	methods: {
 		// 滚动到底部触发回调
 		scrolltolower() {
-			console.log('页面触底了')
 			if ((this.btns.includes('工单管理分段器') || this.btns.includes('分段器按钮')) && this.current === 0) {
 				// 团队工单
 				if (this.total > this.dataList.length) {
@@ -805,6 +805,7 @@ export default {
 
 				.box_value {
 					display: flex;
+					margin-right: auto;
 
 					img {
 						margin-left: 10rpx;
@@ -814,14 +815,13 @@ export default {
 				}
 
 				.box_type {
-					margin-left: auto;
+					margin-left: 10rpx;
 					width: 137rpx;
 					height: 47rpx;
 					line-height: 47rpx;
 					text-align: center;
 					border-radius: 136rpx;
 					color: #ff5733;
-					// font-size: 24rpx;
 					font-size: 24rpx;
 					border: 1rpx solid #ff5733;
 				}
@@ -845,6 +845,7 @@ export default {
 			.item_img {
 				display: flex;
 				align-items: center;
+				margin-bottom: 10rpx;
 				padding: 0 30rpx;
 				height: 120rpx;
 				color: #808080;

+ 12 - 14
pagesRepairs/message/message.vue

@@ -28,7 +28,7 @@ export default {
 			// 当前页
 			currentPage: 1,
 			// 每页多少条
-			pageCount: 10,
+			pageCount: 8,
 			// 总条数
 			total: null
 		}
@@ -38,13 +38,13 @@ export default {
 		this.userId = repairsUserInfo.userId
 		if (options.list) {
 			this.msgList = JSON.parse(options.list)
+			this.total = options.total
 		} else {
 			this.getMsgList()
 		}
-		this.total = options.total
 	},
+	// 页面上拉触底回调
 	onReachBottom() {
-		console.log(666)
 		if (this.total > this.msgList.length) {
 			this.currentPage++
 			this.getMsgList()
@@ -58,7 +58,7 @@ export default {
 	methods: {
 		// 点击信息回调
 		async handleRead(item) {
-			// 如果是未读信息
+			// 未读信息
 			if (item.isRead === 0) {
 				const res = await this.$myRequest_repairs({
 					url: '/repairSystemMessages/readSystemMessage',
@@ -68,16 +68,14 @@ export default {
 				})
 				// console.log(res)
 				if (res.code === '200') {
-					uni.showToast({
-						title: '已读',
-						icon: 'none'
+					uni.navigateTo({
+						url: `/pagesRepairs/repairDetails/repairDetails?id=${item.recordId}`
 					})
-					setTimeout(() => {
-						this.currentPage = 1
-						this.msgList = []
-						this.getMsgList()
-					}, 1500)
 				}
+			} else {
+				uni.navigateTo({
+					url: `/pagesRepairs/repairDetails/repairDetails?id=${item.recordId}`
+				})
 			}
 		},
 		// 获取列表信息
@@ -86,7 +84,7 @@ export default {
 				url: '/repairSystemMessages/querySystemMessagePage',
 				data: {
 					currentPage: this.currentPage,
-					pageCount: 10,
+					pageCount: this.pageCount,
 					userId: this.userId
 				}
 			})
@@ -103,7 +101,7 @@ export default {
 <style lang="scss" scoped>
 .container {
 	width: 100vw;
-	height: 100vh;
+	min-height: 100vh;
 	background-color: #f2f2f2;
 	overflow-y: auto;
 

+ 188 - 157
pagesRepairs/myRepairs/myRepairs.vue

@@ -8,9 +8,9 @@
 		<!-- 主体内容区域 -->
 		<view class="body">
 			<!-- 每一个记录区域 -->
-			<view class="body_item" v-for="item in list" :key="item.id">
+			<view class="body_item" :class="{ body_events: isClick }" v-for="item in list" :key="item.id" @click="handleLookDetail(item)">
 				<!-- 工单编号 -->
-				<view class="item_title" @click="handleLookDetail(item)">
+				<view class="item_title">
 					<img src="../../static/images/repairsImg/order.png" />
 					<view class="title_info">工单编号:{{ item.recordNo }}</view>
 					<view class="title_type" v-if="item.timeoutStr">{{ item.timeoutStr }}</view>
@@ -24,9 +24,12 @@
 					</view>
 					<view class="time_type" v-if="item.state === '待接单'">待接单</view>
 					<view class="time_type color_type" v-if="item.state === '维修中'">维修中</view>
+					<view class="time_type color_type" v-if="item.state === '转单待审核'">转单待审核</view>
+					<view class="time_type color_type" v-if="item.state === '协作待审核'">协作待审核</view>
 					<view class="time_type" v-if="item.state === '待确认'">待确认</view>
 					<view class="time_type color_type2" v-if="item.state === '已完成'">已完成</view>
 					<view class="time_type" v-if="item.state === '已取消'">已取消</view>
+					<view class="time_type color_type3" v-if="item.state === '已关单'">已关单</view>
 				</view>
 
 				<!-- 报修姓名 -->
@@ -38,7 +41,7 @@
 				<!-- 报修电话 -->
 				<view class="item_box">
 					<view class="box_key">报修电话:</view>
-					<view class="box_value phone" @click="handleCallPhone(item.userPhone)">
+					<view class="box_value phone" @click.stop="handleCallPhone(item.userPhone)">
 						{{ item.userPhone }}
 						<img src="../../static/images/repairsImg/phone.png" />
 					</view>
@@ -63,7 +66,7 @@
 				</view>
 
 				<!-- 故障描述 -->
-				<view class="item_box">
+				<view class="item_box" v-if="item.descript">
 					<view class="box_key">故障描述:</view>
 					<view class="box_value">{{ item.descript }}</view>
 				</view>
@@ -71,7 +74,7 @@
 				<!-- 上传图片 -->
 				<view class="item_img">
 					<view class="img_key">上传图片:</view>
-					<img class="img_value" mode="aspectFill" :src="item.images[0]" @click="handleLookImgs(item.images)" />
+					<img class="img_value" mode="aspectFill" :src="item.images[0]" @click.stop="handleLookImgs(item.images)" />
 				</view>
 
 				<!-- 维修师傅 -->
@@ -85,83 +88,103 @@
 				<!-- 师傅电话 -->
 				<view class="item_box" v-if="item.maintenancerPhone">
 					<view class="box_key">师傅电话:</view>
-					<view class="box_value phone" @click="handleCallPhone(item.maintenancerPhone)">
+					<view class="box_value phone" @click.stop="handleCallPhone(item.maintenancerPhone)">
 						{{ item.maintenancerPhone }}
 						<img src="../../static/images/repairsImg/phone.png" />
 					</view>
 				</view>
 
 				<!-- 维修费用 -->
-				<view class="item_box" v-if="item.money">
+				<view class="item_box" v-if="item.price">
 					<view class="box_key">维修费用:</view>
-					<view class="box_value2 phone" @click="checkFeeDetail(item)">
+					<view class="box_value2 phone" @click.stop="checkFeeDetail(item)">
 						{{ item.price }}元
 						<img src="../../static/images/repairsImg/eye.png" />
 					</view>
 				</view>
 
-				<!-- 维修费用弹窗 -->
-				<uni-popup :is-mask-click="false" ref="popup_fee">
-					<view class="pop_fee">
-						<view class="fee_title">
-							维修费用
-							<text @click="$refs.popup_fee[0].close()">×</text>
-						</view>
-						<view class="fee_list">
-							<view class="fee_item" v-for="ele in consumables" :key="ele.id">
-								<view class="fee_box">
-									耗材:
-									<text>{{ ele.consumeName }}</text>
-								</view>
-								<view class="fee_box">
-									耗材单价:
-									<text>{{ ele.price }}元</text>
-								</view>
-								<view class="fee_box">
-									耗材数量:
-									<text>{{ ele.number }}</text>
-								</view>
-								<view class="fee_box">
-									耗材费用:
-									<text>{{ ele.totalPrice }}元</text>
-								</view>
-							</view>
-						</view>
-					</view>
-				</uni-popup>
-
 				<!-- 按钮 -->
-				<view class="item_btn" v-if="item.state !== '已取消'">
-					<view class="btn_box type" v-if="item.state === '待接单' || item.state === '维修中'" @click="handleExpedite(item.id)">催单</view>
-					<view class="btn_box type" v-if="item.state === '待确认'" @click="handleBackOffice(item)">转后勤</view>
-					<view class="btn_box type" v-if="item.state === '待确认'" @click="handlePay(item)">支付</view>
-					<view class="btn_box type2" v-if="item.state === '待接单' || item.state === '维修中' || item.state === '待确认'" @click="handleRepeal(item.id)">撤销</view>
-					<view class="btn_box type" v-if="item.state === '已完成'" @click="handleEvaluate(item)">去评价</view>
+				<view class="item_btn" v-if="item.state !== '已取消' && item.state !== '已关单'">
+					<view
+						class="btn_box type"
+						v-if="item.state === '待接单' || item.state === '维修中' || item.state === '转单待审核' || item.state === '协作待审核'"
+						@click.stop="handleExpedite(item.id)"
+					>
+						催单
+					</view>
+					<view class="btn_box type" v-if="item.state === '待确认'" @click.stop="handleBackOffice(item)">转后勤</view>
+					<view class="btn_box type" v-if="item.state === '待确认'" @click.stop="handlePay(item)">支付</view>
+					<view class="btn_box type2" v-if="item.state === '待接单' || item.state === '待确认'" @click.stop="handleRepeal(item.id)">撤销</view>
+					<view class="btn_box type" v-if="item.state === '已完成' && item.evaluate === 1" @click.stop="handleEvaluate(item)">去评价</view>
+					<view class="btn_box type3" v-if="item.state === '已完成' && item.evaluate === 0" @click.stop="">已评价</view>
 				</view>
 				<view class="item_btn2" v-else></view>
+			</view>
 
-				<!-- 转后勤弹窗 -->
-				<uni-popup ref="popup_logistics" :is-mask-click="false">
-					<view class="pop_logistics">
-						<view class="logistics_title">转后勤</view>
-						<view class="logistics_body">
-							<textarea placeholder-style="color:#CCCCCC" placeholder="请输入您宝贵的留言" v-model="logisticsValue"></textarea>
+			<!-- 维修费用弹窗 -->
+			<uni-popup :is-mask-click="false" ref="popup_fee">
+				<view class="pop_fee" @click.stop="">
+					<view class="fee_title">
+						维修费用
+						<text
+							@click="
+								$refs.popup_fee.close()
+								isClick = false
+							"
+						>
+							×
+						</text>
+					</view>
+					<view class="fee_list">
+						<view class="fee_item" v-for="ele in consumables" :key="ele.id">
+							<view class="fee_box">
+								耗材:
+								<text>{{ ele.consumeName }}</text>
+							</view>
+							<view class="fee_box">
+								耗材单价:
+								<text>{{ ele.price }}元</text>
+							</view>
+							<view class="fee_box">
+								耗材数量:
+								<text>{{ ele.number }}</text>
+							</view>
+							<view class="fee_box">
+								耗材费用:
+								<text>{{ ele.totalPrice }}元</text>
+							</view>
 						</view>
-						<view class="logistics_btn">
-							<view class="btn_box cancel" @click="$refs.popup_logistics[0].close()">取消</view>
-							<view class="btn_box confirm" @click="handleLogisticsConfirm">确定</view>
+					</view>
+				</view>
+			</uni-popup>
+
+			<!-- 转后勤弹窗 -->
+			<uni-popup ref="popup_logistics" :is-mask-click="false">
+				<view class="pop_logistics" @click.stop="">
+					<view class="logistics_title">转后勤</view>
+					<view class="logistics_body">
+						<textarea placeholder-style="color:#CCCCCC" placeholder="请输入您宝贵的留言" v-model="logisticsValue"></textarea>
+					</view>
+					<view class="logistics_btn">
+						<view
+							class="btn_box cancel"
+							@click="
+								$refs.popup_logistics.close()
+								isClick = false
+							"
+						>
+							取消
 						</view>
+						<view class="btn_box confirm" @click="handleLogisticsConfirm">确定</view>
 					</view>
-				</uni-popup>
-			</view>
+				</view>
+			</uni-popup>
 
 			<!-- 没有数据时展示的图片 -->
 			<view class="body_no_data" v-if="list.length === 0">
 				<img src="../../pagesClockIn/static/imgs/nodata.png" />
 				<view>暂无数据</view>
 			</view>
-
-			<view class="body_text" v-if="list.length && showBottomText">---我是有底线的---</view>
 		</view>
 	</scroll-view>
 </template>
@@ -170,6 +193,8 @@
 export default {
 	data() {
 		return {
+			// 每一个订单点击时是否触发事件 true 不触发  false 触发
+			isClick: false,
 			// 后勤弹窗输入框绑定数据
 			logisticsValue: '',
 			// 顶部分段器数组
@@ -180,8 +205,6 @@ export default {
 			list: [],
 			// 是否可以Y轴滚动
 			scrollY: true,
-			// 是否显示底部文字
-			showBottomText: false,
 			// 用户id,请求接口时的参数
 			userId: '',
 			// 当前页
@@ -246,13 +269,14 @@ export default {
 
 		// 滚动到底部触发回调
 		scrolltolower() {
-			console.log('页面触底了')
 			if (this.total > this.list.length) {
 				this.currentPage++
 				this.getRepairList()
 			} else {
-				console.log('没有更多数据了')
-				this.showBottomText = true
+				uni.showToast({
+					title: '没有更多数据了',
+					icon: 'none'
+				})
 			}
 		},
 
@@ -293,7 +317,8 @@ export default {
 					title: '转后勤成功',
 					icon: 'success'
 				})
-				this.$refs.popup_logistics[0].close()
+				this.$refs.popup_logistics.close()
+				this.isClick = false
 			} else {
 				uni.showToast({
 					title: res.message,
@@ -359,13 +384,15 @@ export default {
 
 		// 查看维修费用回调
 		checkFeeDetail(item) {
-			this.$refs.popup_fee[0].open('center')
+			this.$refs.popup_fee.open('center')
 			this.consumables = item.consumables
+			this.isClick = true
 		},
 		// 转后勤按钮回调
 		handleBackOffice(item) {
 			this.recordId = item.id
-			this.$refs.popup_logistics[0].open('center')
+			this.isClick = true
+			this.$refs.popup_logistics.open('center')
 		},
 		// 去评价按钮回调
 		handleEvaluate(item) {
@@ -376,10 +403,8 @@ export default {
 		},
 		// 点击工单编号区域回调
 		handleLookDetail(item) {
-			const detailInfo = encodeURIComponent(JSON.stringify(item))
-			// console.log(detailInfo)
 			uni.navigateTo({
-				url: `/pagesRepairs/repairDetails/repairDetails?detailInfo=${detailInfo}`
+				url: `/pagesRepairs/repairDetails/repairDetails?id=${item.id}`
 			})
 		},
 		// 点击电话号码回调
@@ -521,6 +546,9 @@ export default {
 				.color_type2 {
 					color: #6fb6b8;
 				}
+				.color_type3 {
+					color: #cccccc;
+				}
 			}
 
 			.item_box {
@@ -606,121 +634,130 @@ export default {
 					background-color: #fff;
 					border: 1rpx solid #6fb6b8;
 				}
+
+				.type3 {
+					color: #6fb6b8;
+					background-color: #eee;
+				}
 			}
 
 			.item_btn2 {
 				height: 50rpx;
 			}
+		}
 
-			.pop_fee {
-				padding-bottom: 50rpx;
-				border-radius: 19rpx;
-				background-color: #fff;
+		.pop_fee {
+			padding-bottom: 10rpx;
+			border-radius: 19rpx;
+			background-color: #fff;
 
-				.fee_title {
-					display: flex;
-					justify-content: space-between;
-					align-items: center;
-					box-sizing: border-box;
-					padding: 0 31rpx 0 42rpx;
-					width: 690rpx;
-					height: 110rpx;
-					font-size: 32rpx;
-					font-weight: bold;
-					border-radius: 19rpx 19rpx 0 0;
+			.fee_title {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				box-sizing: border-box;
+				padding: 0 31rpx 0 42rpx;
+				width: 690rpx;
+				height: 110rpx;
+				font-size: 32rpx;
+				font-weight: bold;
+				border-radius: 19rpx 19rpx 0 0;
+				border-bottom: 1rpx solid #e6e6e6;
+
+				text {
+					font-size: 45rpx;
+					font-weight: 400;
+					color: #808080;
+				}
+			}
+
+			.fee_list {
+				max-height: 50vh;
+				overflow-y: auto;
+
+				.fee_item {
 					border-bottom: 1rpx solid #e6e6e6;
 
-					text {
-						font-size: 45rpx;
-						font-weight: 400;
+					.fee_box {
+						display: flex;
+						align-items: center;
+						padding-left: 42rpx;
+						height: 80rpx;
+						font-size: 28rpx;
 						color: #808080;
+
+						text {
+							color: #000000;
+						}
 					}
 				}
+			}
+		}
 
-				.fee_list {
-					height: 40vh;
-					overflow-y: auto;
+		.pop_logistics {
+			border-radius: 19rpx;
+			background-color: #fff;
 
-					.fee_item {
-						border-bottom: 1rpx solid #e6e6e6;
+			.logistics_title {
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				width: 690rpx;
+				height: 110rpx;
+				font-size: 32rpx;
+				font-weight: bold;
+				border-radius: 19rpx 19rpx 0 0;
+				border-bottom: 1rpx solid #e6e6e6;
+			}
 
-						.fee_box {
-							display: flex;
-							align-items: center;
-							padding-left: 42rpx;
-							height: 80rpx;
-							font-size: 28rpx;
-							color: #808080;
+			.logistics_body {
+				height: 440rpx;
+				border-bottom: 1rpx solid #e6e6e6;
 
-							text {
-								color: #000000;
-							}
-						}
-					}
+				textarea {
+					box-sizing: border-box;
+					margin: 35rpx 40rpx;
+					padding: 20rpx;
+					width: 610rpx;
+					height: 370rpx;
+					font-size: 28rpx;
+					border-radius: 14rpx;
+					border: 1rpx solid #e6e6e6;
 				}
 			}
 
-			.pop_logistics {
-				border-radius: 19rpx;
-				background-color: #fff;
+			.logistics_btn {
+				display: flex;
+				align-items: center;
+				justify-content: space-evenly;
+				height: 121rpx;
 
-				.logistics_title {
+				.btn_box {
 					display: flex;
 					justify-content: center;
 					align-items: center;
-					width: 690rpx;
-					height: 110rpx;
+					width: 203rpx;
+					height: 72rpx;
+					border-radius: 9rpx;
 					font-size: 32rpx;
-					font-weight: bold;
-					border-radius: 19rpx 19rpx 0 0;
-					border-bottom: 1rpx solid #e6e6e6;
 				}
 
-				.logistics_body {
-					height: 440rpx;
-					border-bottom: 1rpx solid #e6e6e6;
-
-					textarea {
-						box-sizing: border-box;
-						margin: 35rpx 40rpx;
-						padding: 20rpx;
-						width: 610rpx;
-						height: 370rpx;
-						font-size: 28rpx;
-						border-radius: 14rpx;
-						border: 1rpx solid #e6e6e6;
-					}
+				.cancel {
+					background-color: #e5e5e5;
+					color: #6fb6b8;
 				}
 
-				.logistics_btn {
-					display: flex;
-					align-items: center;
-					justify-content: space-evenly;
-					height: 121rpx;
-
-					.btn_box {
-						display: flex;
-						justify-content: center;
-						align-items: center;
-						width: 203rpx;
-						height: 72rpx;
-						border-radius: 9rpx;
-						font-size: 32rpx;
-					}
-
-					.cancel {
-						background-color: #e5e5e5;
-						color: #6fb6b8;
-					}
-
-					.confirm {
-						background-color: #6fb6b8;
-						color: #fff;
-					}
+				.confirm {
+					background-color: #6fb6b8;
+					color: #fff;
 				}
 			}
 		}
 
+		.body_events {
+			pointer-events: none;
+		}
+
 		.body_no_data {
 			text-align: center;
 			color: #b3b3b3;
@@ -732,12 +769,6 @@ export default {
 				height: 508rpx;
 			}
 		}
-
-		.body_text {
-			text-align: center;
-			color: #b3b3b3;
-			font-size: 24rpx;
-		}
 	}
 }
 </style>

+ 7 - 3
pagesRepairs/offer/offer.vue

@@ -96,6 +96,9 @@ export default {
 
 		uni.$on('addConsumable', this.addConsumable)
 	},
+	onUnload() {
+		uni.$off()
+	},
 	methods: {
 		// 单价输入框输入回调
 		handleChangePrice(e, item) {
@@ -159,7 +162,7 @@ export default {
 		},
 		// 全局自定义事件
 		addConsumable(e) {
-			// console.log(e)
+			console.log(e)
 			// 判断是否存在相同的耗材
 			let flag = this.goodList.some((ele) => {
 				return ele.consumeName === e.data.name
@@ -170,10 +173,11 @@ export default {
 				this.$set(e.data, 'consumeName', e.data.name)
 				this.$set(e.data, 'consumeId', e.data.id)
 				this.$set(e.data, 'articleId', e.articleId)
-				this.$delete(e.data, 'name')
-				this.$delete(e.data, 'id')
+				// this.$delete(e.data, 'name')
+				// this.$delete(e.data, 'id')
 				this.goodList.push(e.data)
 			}
+			console.log(this.goodList)
 		},
 		// 耗材数量计数器改变回调
 		bindChange(e, index) {

+ 10 - 6
pagesRepairs/pending/pending.vue

@@ -52,7 +52,7 @@
 				</view>
 
 				<!-- 故障描述 -->
-				<view class="item_box">
+				<view class="item_box" v-if="item.description">
 					<view class="box_key">故障描述:</view>
 					<view class="box_value">{{ item.description }}</view>
 				</view>
@@ -68,7 +68,7 @@
 					<img src="../../static/images/repairsImg/close.png" @click="handleClose(item)" />
 					<view class="btn_box type" v-if="btns.includes('延时')" @click="handleDelay(item)">延时</view>
 					<view class="btn_box type" v-if="btns.includes('接单')" @click="handleOrderReceiving(item)">接单</view>
-					<view class="btn_box type2" v-if="btns.includes('派单')" @click="handleSendOrder">派单</view>
+					<view class="btn_box type2" v-if="btns.includes('派单')" @click="handleSendOrder(item)">派单</view>
 				</view>
 
 				<!-- 关闭按钮弹窗 -->
@@ -136,7 +136,6 @@ export default {
 	methods: {
 		// 滚动到底部触发回调
 		scrolltolower() {
-			console.log('滚动到底部')
 			if (this.total > this.dataList.length) {
 				this.currentPage++
 				this.getData()
@@ -192,6 +191,11 @@ export default {
 								title: '接单成功',
 								icon: 'success'
 							})
+							setTimeout(() => {
+								this.dataList = []
+								this.currentPage = 1
+								this.getData()
+							}, 1500)
 						}
 					}
 				}
@@ -246,14 +250,14 @@ export default {
 			})
 		},
 		// 派单按钮回调
-		handleSendOrder() {
+		handleSendOrder(item) {
 			uni.navigateTo({
-				url: '/pagesRepairs/helpPeople/helpPeople?type=2'
+				url: `/pagesRepairs/helpPeople/helpPeople?type=1&id=${item.id}`
 			})
 		},
 		// 点击电话号码回调
 		handleCallPhone(phone) {
-			console.log(phone)
+			// console.log(phone)
 			uni.makePhoneCall({
 				phoneNumber: phone
 			})

+ 82 - 43
pagesRepairs/repairDetails/repairDetails.vue

@@ -16,6 +16,9 @@
 			<view class="time_type" v-if="detailInfo.state === '待确认'">待确认</view>
 			<view class="time_type color_type2" v-if="detailInfo.state === '已完成'">已完成</view>
 			<view class="time_type" v-if="detailInfo.state === '已取消'">已取消</view>
+			<view class="time_type color_type3" v-if="detailInfo.state === '已关单'">已关单</view>
+			<view class="time_type color_type" v-if="detailInfo.state === '转单待审核'">转单待审核</view>
+			<view class="time_type color_type" v-if="detailInfo.state === '协作待审核'">协作待审核</view>
 		</view>
 
 		<view class="box">
@@ -41,9 +44,9 @@
 			<view class="box_key">报修物品:</view>
 			<view class="box_value">{{ detailInfo.articleName }}</view>
 		</view>
-		<view class="box">
+		<view class="box" v-if="detailInfo.description">
 			<view class="box_key">故障描述:</view>
-			<view class="box_value">{{ detailInfo.descript }}</view>
+			<view class="box_value">{{ detailInfo.description }}</view>
 		</view>
 
 		<view class="box_img">
@@ -51,38 +54,40 @@
 			<img class="img_value" mode="aspectFill" :src="detailInfo.images[0]" @click="handleLookImgs(detailInfo.images)" />
 		</view>
 
-		<view class="box top" v-if="detailInfo.workerName">
+		<view class="box top" v-if="detailInfo.maintenancerName">
 			<view class="box_key">维修师傅:</view>
-			<view class="box_value">{{ detailInfo.workerName }}</view>
+			<view class="box_value">{{ detailInfo.maintenancerName }}</view>
 		</view>
 
-		<view class="box" v-if="detailInfo.workerPhone">
+		<view class="box" v-if="detailInfo.maintenancerPhone">
 			<view class="box_key">师傅电话:</view>
-			<view class="box_value phone" @click="handleCallPhone(detailInfo.workerPhone)">
-				{{ detailInfo.workerPhone }}
+			<view class="box_value phone" @click="handleCallPhone(detailInfo.maintenancerPhone)">
+				{{ detailInfo.maintenancerPhone }}
 				<img src="../../static/images/repairsImg/phone.png" />
 			</view>
 		</view>
 
-		<view class="box" v-if="detailInfo.money">
+		<view class="box" v-if="detailInfo.price">
 			<view class="box_key">维修费用:</view>
-			<view class="box_value2 phone" @click="checkFeeDetail">
-				{{ detailInfo.money }}元
+			<view class="box_value2 phone" @click="checkFeeDetail(detailInfo)">
+				{{ detailInfo.price }}元
 				<img src="../../static/images/repairsImg/eye.png" />
 			</view>
 		</view>
 
-		<view class="title top">报修跟踪</view>
+		<view class="title top" v-if="detailInfo.tracks">报修跟踪</view>
 
 		<!-- 步骤条区域 -->
 		<!-- activeIcon="checkmark-circle-fill" -->
-		<uv-steps activeColor="#6FB6B8" direction="column" current="4">
-			<uv-steps-item :customStyle="customStyle" v-for="item in stepsList" :key="item.id">
+		<uv-steps activeColor="#6FB6B8" direction="column" v-if="detailInfo.tracks" :current="detailInfo.tracks.length">
+			<uv-steps-item :customStyle="customStyle" v-for="item in detailInfo.tracks" :key="item.id">
 				<template v-slot:title>
-					<view class="steps_title" :class="{ active: item.type }">{{ item.title }}</view>
+					<view class="steps_title" :class="{ active: true }">{{ item.state }}</view>
 				</template>
 				<template v-slot:desc>
-					<view class="steps_desc" v-for="(element, index) in item.desc" :key="index">{{ element }}</view>
+					<!-- <view class="steps_desc" v-for="(element, index) in item.desc" :key="index">{{ element }}</view> -->
+					<view class="steps_desc">{{ item.createTime }}</view>
+					<view class="steps_desc" v-if="item.content">{{ item.content }}</view>
 				</template>
 			</uv-steps-item>
 		</uv-steps>
@@ -96,21 +101,25 @@
 					维修费用
 					<text @click="$refs.popup_fee.close()">×</text>
 				</view>
-				<view class="fee_box">
-					耗材:
-					<text>螺丝刀</text>
-				</view>
-				<view class="fee_box">
-					耗材单价:
-					<text>1元</text>
-				</view>
-				<view class="fee_box">
-					耗材数量:
-					<text>2</text>
-				</view>
-				<view class="fee_box">
-					耗材费用:
-					<text>2元</text>
+				<view class="fee_list">
+					<view class="fee_item" v-for="ele in consumables" :key="ele.id">
+						<view class="fee_box">
+							耗材:
+							<text>{{ ele.consumeName }}</text>
+						</view>
+						<view class="fee_box">
+							耗材单价:
+							<text>{{ ele.price }}元</text>
+						</view>
+						<view class="fee_box">
+							耗材数量:
+							<text>{{ ele.number }}</text>
+						</view>
+						<view class="fee_box">
+							耗材费用:
+							<text>{{ ele.totalPrice }}元</text>
+						</view>
+					</view>
 				</view>
 			</view>
 		</uni-popup>
@@ -159,17 +168,35 @@ export default {
 					type: false,
 					desc: ['2023-07-05 08:25:25']
 				}
-			]
+			],
+			// 订单id
+			recordId: '',
+			// 维修费用耗材明细列表
+			consumables: []
 		}
 	},
 	onLoad(options) {
-		this.detailInfo = JSON.parse(decodeURIComponent(options.detailInfo))
-		console.log(this.detailInfo)
+		this.recordId = options.id
+		this.getData()
 	},
 	methods: {
+		// 获取报修详情信息
+		async getData() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairRecord/details',
+				data: {
+					recordId: this.recordId
+				}
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.detailInfo = res.data
+			}
+		},
 		// 查看维修费用回调
-		checkFeeDetail() {
+		checkFeeDetail(item) {
 			this.$refs.popup_fee.open('center')
+			this.consumables = item.consumables
 		},
 		// 点击电话号码回调
 		handleCallPhone(phone) {
@@ -266,6 +293,9 @@ export default {
 		.color_type2 {
 			color: #6fb6b8;
 		}
+		.color_type3 {
+			color: #cccccc;
+		}
 	}
 
 	.box_img {
@@ -328,16 +358,25 @@ export default {
 			}
 		}
 
-		.fee_box {
-			display: flex;
-			align-items: center;
-			padding-left: 42rpx;
-			height: 80rpx;
-			font-size: 28rpx;
-			color: #808080;
+		.fee_list {
+			max-height: 50vh;
+			overflow-y: auto;
 
-			text {
-				color: #000000;
+			.fee_item {
+				border-bottom: 1rpx solid #e6e6e6;
+
+				.fee_box {
+					display: flex;
+					align-items: center;
+					padding-left: 42rpx;
+					height: 80rpx;
+					font-size: 28rpx;
+					color: #808080;
+
+					text {
+						color: #000000;
+					}
+				}
 			}
 		}
 	}

+ 34 - 23
pagesRepairs/repairs/repairs.vue

@@ -218,39 +218,43 @@ export default {
 	},
 	mounted() {
 		console.log('报修页面加载')
+		// 页面之间通讯监听自定义事件
 		uni.$on('addRepairsArea', this.addRepairsArea)
 		uni.$on('addRepairsGoods', this.addRepairsGoods)
 		//在ios下静音时播放没有声音,默认为true,改为false静音时播放有声音
 		uni.setInnerAudioOption({
 			obeyMuteSwitch: false
 		})
+		// 获取用户默认姓名
+		this.repairsName = uni.getStorageSync('repairsUserInfo').userName
 		this.getRepairNotice()
 		this.getSetPhone()
 	},
 	methods: {
-		// 获取紧急电话和服务监督电话
-		async getSetPhone() {
+		// 获取首页公告展示数据
+		async getRepairNotice() {
 			const res = await this.$myRequest_repairs({
-				url: '/repairSystemSetting/queryRepairSystemSetting'
+				url: '/repairNoticeSetting/queryRepairNoticeSettingByTop'
 			})
 			// console.log(res)
 			if (res.code === '200') {
-				this.urgencyPhone = res.data.emergencyCall
-				this.searchPhone = res.data.servicePhone
+				this.repairsNotice = res.data.noticeStr
 			}
 		},
-		// 获取首页公告展示数据
-		async getRepairNotice() {
+		// 获取紧急电话和服务监督电话
+		async getSetPhone() {
 			const res = await this.$myRequest_repairs({
-				url: '/repairNoticeSetting/queryRepairNoticeSettingByTop'
+				url: '/repairSystemSetting/queryRepairSystemSetting'
 			})
 			// console.log(res)
 			if (res.code === '200') {
-				this.repairsNotice = res.data.noticeStr
+				this.urgencyPhone = res.data.emergencyCall
+				this.searchPhone = res.data.servicePhone
 			}
 		},
 		// 确认提交按钮回调
 		handleAffirmSub() {
+			// 验证提交数据是否符合标准
 			const flag = this.handleValidate()
 			if (flag) {
 				uni.showModal({
@@ -297,18 +301,18 @@ export default {
 								})
 
 								// 重置数据
-								this.repairsArea = ''
-								this.repairsAddress = ''
-								this.repairsGoods = ''
-								this.articleId = ''
-								this.repairsDescription = ''
-								this.recordingPath = ''
-								this.imgList = []
-								this.subImgList = []
-								this.repairsName = ''
-								this.repairsPhone = ''
-								this.schoolId = null
-								this.buildId = null
+								// this.repairsArea = ''
+								// this.repairsAddress = ''
+								// this.repairsGoods = ''
+								// this.articleId = ''
+								// this.repairsDescription = ''
+								// this.recordingPath = ''
+								// this.imgList = []
+								// this.subImgList = []
+								// this.repairsName = ''
+								// this.repairsPhone = ''
+								// this.schoolId = null
+								// this.buildId = null
 
 								// 不是用户报修的单,则跳转回首页
 								if (repairsUserInfo.routes.includes('首页')) {
@@ -317,6 +321,13 @@ export default {
 											url: '/pagesRepairs/box/box'
 										})
 									}, 1500)
+								} else {
+									setTimeout(() => {
+										uni.$emit('goToMyRepairs', {
+											show: 'myRepairs',
+											title: '我的报修'
+										})
+									}, 1500)
 								}
 							}
 						}
@@ -388,14 +399,14 @@ export default {
 		},
 		// 全局自定义事件
 		addRepairsArea(e) {
-			console.log(e)
+			// console.log(e)
 			this.repairsArea = e.data
 			this.schoolId = e.schoolId
 			this.buildId = e.buildId
 		},
 		// 全局自定义事件
 		addRepairsGoods(e) {
-			console.log(e)
+			// console.log(e)
 			this.repairsGoods = e.data
 			this.articleId = e.articleId
 		},

+ 1 - 5
pagesRepairs/selectArea/selectArea.vue

@@ -36,8 +36,6 @@ export default {
 			current: 0,
 			// 校区ID
 			schoolId: 0,
-			// 楼栋ID
-			buildId: null,
 			// 左边分类数组
 			leftList: [],
 			// 左边分类数组当前索引
@@ -82,7 +80,6 @@ export default {
 				this.areaTreeList = res.data
 				this.leftList = this.areaTreeList.map((ele) => ele.name)
 				this.rightList = this.areaTreeList[this.active_left].children || []
-				this.buildId = this.areaTreeList[this.active_left].id
 			}
 		},
 		// 顶部分段器切换选项回调
@@ -100,7 +97,6 @@ export default {
 			this.active_left = index
 			this.active_right = null
 			this.rightList = this.areaTreeList[this.active_left].children || []
-			this.buildId = this.areaTreeList[this.active_left].id
 		},
 		// 右边数组切换回调
 		handleChange2(index) {
@@ -109,7 +105,7 @@ export default {
 			uni.$emit('addRepairsArea', {
 				data: repairsArea,
 				schoolId: this.schoolId,
-				buildId: this.buildId
+				buildId: this.rightList[this.active_right].id
 			})
 			uni.navigateBack(1)
 		}

+ 1 - 0
pagesRepairs/util/api.js

@@ -1,4 +1,5 @@
 const BASE_URL = "https://chtech.ncjti.edu.cn/campusMaintenance/repair-api/repair/api"
+// const BASE_URL = "http://192.168.161.220:8080/repair/api"
 export const myRequest_repairs = (options) => {
 	uni.showLoading({
 		title: "加载中",