Browse Source

校园报修最新代码更新

xiaoxin 2 years ago
parent
commit
cada7656e7

+ 61 - 10
pagesRepairs/addGoods/addGoods.vue

@@ -2,7 +2,7 @@
 	<view class="container">
 		<!-- 输入框区域 -->
 		<view class="search">
-			<img src="../../static/images/repairsImg/search.png" />
+			<img src="../../static/images/repairsImg/search.png" @click="handleSearch" />
 
 			<input type="text" placeholder="请输入搜索内容" v-model="searchValue" />
 		</view>
@@ -13,7 +13,9 @@
 				<view class="left_item" :class="{ active: activeIndex === index }" v-for="(item, index) in list" :key="index" @click="handleChange(index)">{{ item }}</view>
 			</view>
 			<view class="body_right">
-				<view class="right_item" :class="{ active: activeIndex2 === index2 }" v-for="(ele, index2) in List2" :key="index2" @click="handleChange2(index2)">{{ ele }}</view>
+				<view class="right_item" :class="{ active: activeIndex2 === index2 }" v-for="(ele, index2) in List2" :key="index2" @click="handleChange2(index2)">
+					{{ ele.name }}
+				</view>
 			</view>
 		</view>
 
@@ -44,19 +46,66 @@ export default {
 			// 左边数组的索引
 			activeIndex: 0,
 			// 左边数组
-			list: ['水电', '木工类', '行政楼', '泥工类', '其他'],
+			list: [],
 			// 右边数组的索引
 			activeIndex2: 0,
 			// 右边数组
-			List2: ['下水道', '安全指示牌', '消费应急灯', '排水管道', '吊顶', '风扇', '没电']
+			List2: [],
+			// 校区id
+			schoolId: '',
+			// 所有数据
+			allList: []
 		}
 	},
+	onLoad() {
+		const userInfo = uni.getStorageSync('repairsUserInfo')
+		this.schoolId = userInfo.schoolId
+		this.getData()
+	},
 	methods: {
+		handleSearch() {
+			this.activeIndex = 0
+			this.activeIndex2 = null
+			this.getData()
+		},
+		async getData() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairArticleType/queryConsumeMaterial',
+				data: {
+					schoolId: this.schoolId,
+					keyWord: this.searchValue
+				}
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.allList = res.data
+				this.list = this.allList.map((ele) => ele.name)
+				this.List2 = this.allList[this.activeIndex].consumes || []
+			}
+		},
 		// 确认按钮回调
-		handleAffirm() {
+		async handleAffirm() {
 			if (this.textareaValue) {
-				this.List2.push(this.textareaValue)
-				this.textareaValue = ''
+				const res = await this.$myRequest_repairs({
+					url: '/repairConsume/insertRepairAssociation',
+					method: 'post',
+					data: {
+						name: this.textareaValue,
+						articleId: this.allList[this.activeIndex].id,
+						schoolId: this.schoolId
+					}
+				})
+				// console.log(res)
+				if (res.code === '200') {
+					this.textareaValue = ''
+					uni.showToast({
+						title: '添加成功',
+						icon: 'success'
+					})
+					setTimeout(() => {
+						this.getData()
+					}, 1500)
+				}
 			} else {
 				uni.showToast({
 					title: '请输入备注',
@@ -67,18 +116,20 @@ export default {
 		// 左边数组切换回调
 		handleChange(index) {
 			this.activeIndex = index
+			this.activeIndex2 = null
+			this.List2 = this.allList[this.activeIndex].consumes || []
 		},
 		// 右边数组切换回调
 		handleChange2(index) {
 			this.activeIndex2 = index
 			uni.$emit('addConsumable', {
-				data: this.List2[this.activeIndex2]
+				data: this.List2[this.activeIndex2],
+				articleId: this.allList[this.activeIndex].id
 			})
 			uni.navigateBack(1)
 		},
 		// 输入框输入值变化回调
 		handleInput(e) {
-			// console.log(e.detail.value.length)
 			this.textLength = e.detail.value.length
 		}
 	}
@@ -216,4 +267,4 @@ export default {
 		background-color: #6fb6b8;
 	}
 }
-</style>
+</style>

+ 80 - 99
pagesRepairs/addressBook/addressBook.vue

@@ -2,42 +2,46 @@
 	<view class="container">
 		<!-- 搜索框区域 -->
 		<view class="search">
-			<img src="../../static/images/repairsImg/search.png" />
+			<img src="../../static/images/repairsImg/search.png" @click="getData" />
 
-			<input type="text" placeholder="请输入搜索内容" />
+			<input type="text" v-model="keyWord" placeholder="请输入搜索内容" />
 		</view>
 
-		<view class="title">外部维修成员({{ list.length }})</view>
+		<view class="title" v-if="list.length">外部维修成员({{ list.length }})</view>
 
 		<!-- 每一个外部维修成员区域 -->
 		<view class="box" v-for="item in list" :key="item.id" @click="handleEdit(item)">
 			<img src="../../static/images/repairsImg/photo.png" />
 			<view class="item_info">
 				<view class="info_msg">
-					{{ item.name }}
-					<view class="msg_work">{{ item.work }}</view>
+					{{ item.userName }}
+					<view class="msg_work">{{ item.workTypeName }}</view>
 				</view>
-				<view class="info_phone">{{ item.phone }}</view>
+				<view class="info_phone">{{ item.userPhone }}</view>
 			</view>
-			<view class="item_type color_type" v-if="item.type === 1">接单中</view>
-			<view class="item_type color_type2" v-if="item.type === 2">订单饱和</view>
-			<view class="item_type color_type3" v-if="item.type === 3">停止接单</view>
+			<view class="item_type color_type2" v-if="item.state === 1">大量接单</view>
+			<view class="item_type color_type3" v-if="item.state === 2">停止接单</view>
 		</view>
 
-		<view class="title">内部维修成员({{ list2.length }})</view>
+		<view class="title" v-if="list2.length">内部维修成员({{ list2.length }})</view>
 		<!-- 每一个内部维修成员区域 -->
 		<view class="box" v-for="item in list2" :key="item.id" @click="handleEdit(item)">
 			<img src="../../static/images/repairsImg/photo.png" />
 			<view class="item_info">
 				<view class="info_msg">
-					{{ item.name }}
-					<view class="msg_work">{{ item.work }}</view>
+					{{ item.userName }}
+					<view class="msg_work">{{ item.workTypeName }}</view>
 				</view>
-				<view class="info_phone">{{ item.phone }}</view>
+				<view class="info_phone">{{ item.userPhone }}</view>
 			</view>
-			<view class="item_type color_type" v-if="item.type === 1">接单中</view>
-			<view class="item_type color_type2" v-if="item.type === 2">订单饱和</view>
-			<view class="item_type color_type3" v-if="item.type === 3">停止接单</view>
+			<view class="item_type color_type2" v-if="item.state === 1">大量接单</view>
+			<view class="item_type color_type3" v-if="item.state === 2">停止接单</view>
+		</view>
+
+		<!-- 没有数据时展示的图片 -->
+		<view class="no_data" v-if="list.length === 0 && list2.length === 0">
+			<img src="../../pagesClockIn/static/imgs/nodata.png" />
+			<view>暂无数据</view>
 		</view>
 	</view>
 </template>
@@ -46,105 +50,73 @@
 export default {
 	data() {
 		return {
-			list: [
-				{
-					id: 1,
-					name: '张三',
-					phone: '13659856958',
-					type: 1,
-					work: '电工'
-				},
-				{
-					id: 2,
-					name: '李四',
-					phone: '13659856958',
-					type: 2,
-					work: '电工'
-				},
-				{
-					id: 3,
-					name: '张三',
-					phone: '13659856958',
-					type: 3,
-					work: '电工'
-				},
-				{
-					id: 4,
-					name: '张三',
-					phone: '13659856958',
-					type: 1,
-					work: '电工'
-				},
-				{
-					id: 5,
-					name: '李四',
-					phone: '13659856958',
-					type: 1,
-					work: '电工'
-				},
-				{
-					id: 6,
-					name: '张三',
-					phone: '13659856958',
-					type: 1,
-					work: '电工'
-				}
-			],
-			list2: [
-				{
-					id: 1,
-					name: '张三',
-					phone: '13659856958',
-					type: 1,
-					work: '电工'
-				},
-				{
-					id: 2,
-					name: '李四',
-					phone: '13659856958',
-					type: 3,
-					work: '电工'
-				},
-				{
-					id: 3,
-					name: '张三',
-					phone: '13659856958',
-					type: 2,
-					work: '电工'
-				},
-				{
-					id: 4,
-					name: '张三',
-					phone: '13659856958',
-					type: 1,
-					work: '电工'
-				}
-			]
+			// 搜索框绑定数据
+			keyWord: '',
+			// 校区id
+			schoolId: '',
+			// 用户id
+			userId: '',
+			// 外部维修成员数组
+			list: [],
+			// 内部维修成员数组
+			list2: []
 		}
 	},
 	mounted() {
 		console.log('通讯录页面加载')
+		const userInfo = uni.getStorageSync('repairsUserInfo')
+		this.userId = userInfo.userId
+		this.schoolId = userInfo.schoolId
+		this.getData()
 	},
 	methods: {
+		async getData() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairUser/getAddressBook',
+				data: {
+					schoolId: this.schoolId,
+					userId: this.userId,
+					keyWord: this.keyWord
+				}
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.list = res.data[0].list
+				this.list2 = res.data[1].list
+			}
+		},
 		handleEdit(item) {
 			// console.log(item.id)
 			uni.showActionSheet({
 				itemList: ['编辑', '删除'],
 				success: (res) => {
 					if (res.tapIndex === 0) {
+						let info = JSON.stringify(item)
 						uni.navigateTo({
-							url: '/pagesRepairs/edit/edit'
+							url: `/pagesRepairs/edit/edit?info=${info}`
 						})
 					} else if (res.tapIndex === 1) {
 						uni.showModal({
 							title: '提示',
-							content: `确定删除${item.name}吗?`,
-							success: (res) => {
+							content: `确定删除${item.userName}吗?`,
+							success: async (res) => {
 								if (res.confirm) {
-									uni.showToast({
-										title: '删除成功',
-										icon: 'success'
+									const res = await this.$myRequest_repairs({
+										url: '/repairUser/deleteRepairUserSettingById',
+										data: {
+											id: item.id
+										}
 									})
+									// console.log(res)
+									if (res.code === '200') {
+										uni.showToast({
+											title: '删除成功',
+											icon: 'success'
+										})
+										setTimeout(() => {
+											this.getData()
+										}, 1500)
+									}
 								}
 							}
 						})
@@ -247,9 +219,6 @@ export default {
 			// font-size: 24rpx;
 		}
 
-		.color_type {
-			color: #6fb6b8;
-		}
 		.color_type2 {
 			color: #1e7dfb;
 		}
@@ -257,5 +226,17 @@ export default {
 			color: #ff5733;
 		}
 	}
+
+	.no_data {
+		text-align: center;
+		color: #b3b3b3;
+		font-size: 24rpx;
+
+		img {
+			margin: 215rpx auto 0;
+			width: 480rpx;
+			height: 508rpx;
+		}
+	}
 }
 </style>

+ 0 - 296
pagesRepairs/components/recording3.vue

@@ -1,296 +0,0 @@
-<template>
-	<view class="record-layer">
-		<view class="record-box">
-			<view class="record-btn-layer" v-if="tempFilePath == ''">
-				<button class="record-btn" :class="longPress == '1' ? 'record-btn-1' : 'record-btn-2'" @longpress="longpressBtn()" @touchend="touchendBtn()">
-					<image src="../../static/image/logo.png" />
-					<text>{{ longPress == '1' ? '按住说话' : '说话中...' }}</text>
-				</button>
-			</view>
-			<view class="record-btn-layer" v-else>
-				<button class="record-btn" @longpress="delShow = true" @click="playBtn()" :class="playStatus == '1' ? 'record-btn-2' : 'record-btn-1'">
-					<image src="../../static/image/logo.png" />
-					<text>{{ playStatus == '1' ? count + 's' : '点击播放' }}</text>
-				</button>
-			</view>
-			<!-- 语音音阶动画 -->
-			<view class="prompt-layer prompt-layer-1" v-if="longPress == '2'">
-				<view class="prompt-loader">
-					<view class="em" v-for="(item, index) in 15" :key="index"></view>
-				</view>
-				<text class="p">{{ '剩余:' + count + 's' }}</text>
-				<text class="span">松手结束录音</text>
-			</view>
-			<!-- 删除 -->
-			<view class="prompt-layer prompt-layer-2" v-if="delShow" @click.stop="delBtn()">
-				<text>删除</text>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-const recorderManager = uni.getRecorderManager()
-const innerAudioContext = uni.createInnerAudioContext()
-var init // 录制时长计时器
-var timer // 播放 录制倒计时
-export default {
-	data() {
-		return {
-			count: null, // 录制倒计时
-			longPress: '1', // 1显示 按住说话 2显示 说话中
-			delShow: false, // 删除提示框显示隐藏
-			time: 0, //录音时长
-			duration: 60000, //录音最大值ms 60000/1分钟
-			tempFilePath: '', //音频路径
-			playStatus: 0 //录音播放状态 0:未播放 1:正在播放
-		}
-	},
-	methods: {
-		// 倒计时
-		countdown(val) {
-			this.count = Number(val)
-			timer = setInterval(() => {
-				if (this.count > 0) {
-					this.count--
-				} else {
-					this.longPress = '1'
-					clearInterval(timer)
-				}
-			}, 1000)
-		},
-		// 长按录音事件
-		longpressBtn() {
-			this.longPress = '2'
-			this.countdown(60) // 倒计时
-			clearInterval(init) // 清除定时器
-			recorderManager.onStop((res) => {
-				this.tempFilePath = res.tempFilePath
-				this.recordingTimer(this.time)
-			})
-			const options = {
-				duration: this.duration, // 指定录音的时长,单位 ms
-				sampleRate: 16000, // 采样率
-				numberOfChannels: 1, // 录音通道数
-				encodeBitRate: 96000, // 编码码率
-				format: 'mp3', // 音频格式,有效值 aac/mp3
-				frameSize: 10 // 指定帧大小,单位 KB
-			}
-			this.recordingTimer()
-			recorderManager.start(options)
-			// 监听音频开始事件
-			recorderManager.onStart((res) => {
-				console.log(res)
-			})
-		},
-		// 长按松开录音事件
-		touchendBtn() {
-			this.longPress = '1'
-			recorderManager.onStop((res) => {
-				this.tempFilePath = res.tempFilePath
-			})
-			this.recordingTimer(this.time)
-			recorderManager.stop()
-		},
-		recordingTimer(time) {
-			if (time == undefined) {
-				// 将计时器赋值给init
-				init = setInterval(() => {
-					this.time++
-				}, 1000)
-			} else {
-				clearInterval(init)
-			}
-		},
-		// 删除录音
-		delBtn() {
-			this.delShow = false
-			this.time = 0
-			this.tempFilePath = ''
-			this.playStatus = 0
-			innerAudioContext.stop()
-		},
-		// 播放
-		playBtn() {
-			innerAudioContext.src = this.tempFilePath
-			//在ios下静音时播放没有声音,默认为true,改为false就好了。
-			// innerAudioContext.obeyMuteSwitch = false
-			//点击播放
-			if (this.playStatus == 0) {
-				this.playStatus = 1
-				innerAudioContext.play()
-				this.countdown(this.time) // 倒计时
-			} else {
-				this.playStatus = 0
-				innerAudioContext.pause()
-			}
-			// //播放结束
-			innerAudioContext.onEnded(() => {
-				this.playStatus = 0
-				innerAudioContext.stop()
-			})
-		}
-	}
-}
-</script>
-
-<style scoped>
-/* 语音录制开始--------------------------------------------------------------------- */
-.record-layer {
-	margin: auto;
-	width: 50%;
-	padding: 300px 0;
-	box-sizing: border-box;
-}
-.record-box {
-	width: 100%;
-	position: relative;
-}
-.record-btn-layer {
-	width: 100%;
-}
-.record-btn-layer button::after {
-	border: none;
-}
-.record-btn-layer button {
-	font-size: 14px;
-	line-height: 38px;
-	width: 100%;
-	height: 38px;
-	border-radius: 8px;
-	text-align: center;
-	background: #ffd300;
-}
-.record-btn-layer button image {
-	width: 16px;
-	height: 16px;
-	margin-right: 4px;
-	vertical-align: middle;
-}
-.record-btn-layer .record-btn-2 {
-	background: rgba(255, 211, 0, 0.2);
-}
-/* 提示小弹窗 */
-.prompt-layer {
-	border-radius: 8px;
-	background: #ffd300;
-	padding: 8px 16px;
-	box-sizing: border-box;
-	position: absolute;
-	left: 50%;
-	transform: translateX(-50%);
-}
-.prompt-layer::after {
-	content: '';
-	display: block;
-	border: 6px solid rgba(0, 0, 0, 0);
-	border-top-color: rgba(255, 211, 0, 1);
-	position: absolute;
-	bottom: -10px;
-	left: 50%;
-	transform: translateX(-50%);
-}
-.prompt-layer-1 {
-	font-size: 12px;
-	width: 128px;
-	text-align: center;
-	display: flex;
-	flex-direction: column;
-	align-items: center;
-	justify-content: center;
-	top: -80px;
-}
-.prompt-layer-1 .p {
-	color: #000000;
-}
-.prompt-layer-1 .span {
-	color: rgba(0, 0, 0, 0.6);
-}
-.prompt-loader .em {
-}
-/* 语音音阶------------- */
-.prompt-loader {
-	width: 96px;
-	height: 20px;
-	display: flex;
-	align-items: center;
-	justify-content: space-between;
-	margin-bottom: 6px;
-}
-.prompt-loader .em {
-	display: block;
-	background: #333333;
-	width: 1px;
-	height: 10%;
-	margin-right: 2.5px;
-	float: left;
-}
-.prompt-loader .em:last-child {
-	margin-right: 0px;
-}
-.prompt-loader .em:nth-child(1) {
-	animation: load 2.5s 1.4s infinite linear;
-}
-.prompt-loader .em:nth-child(2) {
-	animation: load 2.5s 1.2s infinite linear;
-}
-.prompt-loader .em:nth-child(3) {
-	animation: load 2.5s 1s infinite linear;
-}
-.prompt-loader .em:nth-child(4) {
-	animation: load 2.5s 0.8s infinite linear;
-}
-.prompt-loader .em:nth-child(5) {
-	animation: load 2.5s 0.6s infinite linear;
-}
-.prompt-loader .em:nth-child(6) {
-	animation: load 2.5s 0.4s infinite linear;
-}
-.prompt-loader .em:nth-child(7) {
-	animation: load 2.5s 0.2s infinite linear;
-}
-.prompt-loader .em:nth-child(8) {
-	animation: load 2.5s 0s infinite linear;
-}
-.prompt-loader .em:nth-child(9) {
-	animation: load 2.5s 0.2s infinite linear;
-}
-.prompt-loader .em:nth-child(10) {
-	animation: load 2.5s 0.4s infinite linear;
-}
-.prompt-loader .em:nth-child(11) {
-	animation: load 2.5s 0.6s infinite linear;
-}
-.prompt-loader .em:nth-child(12) {
-	animation: load 2.5s 0.8s infinite linear;
-}
-.prompt-loader .em:nth-child(13) {
-	animation: load 2.5s 1s infinite linear;
-}
-.prompt-loader .em:nth-child(14) {
-	animation: load 2.5s 1.2s infinite linear;
-}
-.prompt-loader .em:nth-child(15) {
-	animation: load 2.5s 1.4s infinite linear;
-}
-@keyframes load {
-	0% {
-		height: 10%;
-	}
-	50% {
-		height: 100%;
-	}
-	100% {
-		height: 10%;
-	}
-}
-/* 语音音阶-------------------- */
-.prompt-layer-2 {
-	top: -40px;
-}
-.prompt-layer-2 .text {
-	color: rgba(0, 0, 0, 1);
-	font-size: 12px;
-}
-/* 语音录制结束---------------------------------------------------------------- */
-</style>

+ 62 - 31
pagesRepairs/delay/delay.vue

@@ -4,7 +4,7 @@
 		<view class="box">
 			接单考核时间
 			<view class="box_time">
-				<input type="number" v-model="receivingTime" @blur="handleChange($event, 1)" />
+				<input type="number" v-model="receivingTime" />
 				<img src="../../static/images/repairsImg/clock.png" />
 			</view>
 			分钟
@@ -14,7 +14,7 @@
 		<view class="box">
 			维修考核时间
 			<view class="box_time">
-				<input type="number" v-model="repairsTime" @blur="handleChange($event, 2)" />
+				<input type="number" v-model="repairsTime" />
 				<img src="../../static/images/repairsImg/clock.png" />
 			</view>
 			分钟
@@ -29,48 +29,79 @@
 export default {
 	data() {
 		return {
-			receivingTime: 0,
-			repairsTime: 0
+			// 接单考核时间
+			receivingTime: null,
+			// 维修考核时间
+			repairsTime: null,
+			// 订单id
+			id: ''
 		}
 	},
+	onLoad(options) {
+		this.id = options.id
+	},
 	methods: {
 		// 提交按钮回调
 		handleSub() {
+			// 验证输入为整数
+			const reg = /^\+?[1-9][0-9]*$/
+			if (!this.receivingTime) {
+				uni.showToast({
+					title: '请输入接单考核时间',
+					icon: 'none'
+				})
+				return
+			}
+			if (!reg.test(this.receivingTime)) {
+				uni.showToast({
+					title: '接单考核时间格式错误,请重新输入',
+					icon: 'none'
+				})
+				return
+			}
+			if (!this.repairsTime) {
+				uni.showToast({
+					title: '请输入维修考核时间',
+					icon: 'none'
+				})
+				return
+			}
+			if (!reg.test(this.repairsTime)) {
+				uni.showToast({
+					title: '维修考核时间格式错误,请重新输入',
+					icon: 'none'
+				})
+				return
+			}
 			uni.showModal({
 				title: '提示',
 				content: '确定延时吗?',
-				success: (res) => {
+				success: async (res) => {
 					if (res.confirm) {
-						console.log(this.receivingTime)
-						console.log(this.repairsTime)
-						uni.showToast({
-							title: '延时成功',
-							icon: 'success'
+						const res = await this.$myRequest_repairs({
+							url: '/repairRecord/delayed',
+							method: 'post',
+							data: {
+								recordId: this.id,
+								receiving: this.receivingTime,
+								maintain: this.repairsTime
+							}
 						})
-						setTimeout(() => {
-							uni.navigateBack(1)
-						}, 1500)
+						// console.log(res)
+						if (res.code === '200') {
+							uni.showToast({
+								title: '延时成功',
+								icon: 'success'
+							})
+							setTimeout(() => {
+								uni.redirectTo({
+									url: '/pagesRepairs/box/box'
+								})
+							}, 1500)
+						}
 					}
 				}
 			})
-		},
-		// 输入框输入事件回调
-		handleChange(e, type) {
-			// console.log(e.detail.value)
-			// 验证输入为整数
-			const reg = /^\+?[1-9][0-9]*$/
-
-			if (!reg.test(e.detail.value)) {
-				uni.showToast({
-					title: '输入格式错误,请重新输入',
-					icon: 'none'
-				})
-				if (type === 1) {
-					this.receivingTime = 0
-				} else {
-					this.repairsTime = 0
-				}
-			}
 		}
 	}
 }

+ 80 - 35
pagesRepairs/edit/edit.vue

@@ -1,19 +1,19 @@
 <template>
-	<view class="container">
+	<view class="container" v-if="info">
 		<view class="title">成员基本信息</view>
 
 		<view class="box">
 			手机
 			<view class="box_input">
-				<input type="number" maxlength="11" placeholder="请输入手机号码" v-model="phone" />
+				<input type="number" maxlength="11" placeholder="请输入手机号码" v-model="info.userPhone" />
 			</view>
 		</view>
 
 		<view class="box">
 			状态
-			<picker @change="bindPickerChange" :value="index" :range="array">
+			<picker @change="bindPickerChange" :value="index" range-key="name" :range="array">
 				<view class="box_input">
-					{{ array[index] }}
+					{{ array[index].name }}
 					<img src="../../static/images/repairsImg/bottom.png" />
 				</view>
 			</picker>
@@ -21,9 +21,9 @@
 
 		<view class="box">
 			工种
-			<picker @change="bindPickerChange2" :value="index2" :range="array2">
+			<picker @change="bindPickerChange2" :value="index2" range-key="name" :range="array2">
 				<view class="box_input">
-					{{ array2[index2] }}
+					{{ array2[index2].name }}
 					<img src="../../static/images/repairsImg/bottom.png" />
 				</view>
 			</picker>
@@ -33,7 +33,7 @@
 
 		<view class="box_time">
 			<view class="time">
-				<input type="text" v-model="receivingTime" />
+				<input type="text" v-model="info.acceptanceTime" />
 				<img src="../../static/images/repairsImg/clock.png" />
 			</view>
 			分钟
@@ -43,7 +43,7 @@
 
 		<view class="box_time">
 			<view class="time">
-				<input type="text" v-model="repairsTime" />
+				<input type="text" v-model="info.maintenanceTime" />
 				<img src="../../static/images/repairsImg/clock.png" />
 			</view>
 			分钟
@@ -58,26 +58,46 @@
 export default {
 	data() {
 		return {
-			// 手机号码
-			phone: '13659864589',
-			// 接单考核时间
-			receivingTime: 0,
-			// 维修考核时间
-			repairsTime: 0,
 			// 状态数组
-			array: ['接单中', '停止接单', '订单饱和'],
+			array: [],
 			// 状态数组当前索引
 			index: 0,
 			// 工种数组
-			array2: ['电工', '水工', '泥工', '空调'],
+			array2: [],
 			// 工种数组当前索引
-			index2: 0
+			index2: 0,
+			info: null
 		}
 	},
+	onLoad(options) {
+		this.getStateList()
+		this.getTypeList()
+		this.info = JSON.parse(options.info)
+		this.index = this.info.state - 1
+		this.index2 = this.info.workType - 1
+	},
 	methods: {
+		async getStateList() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairWorkType/getReceivingState'
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.array = res.data
+			}
+		},
+		async getTypeList() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairWorkType/getRepairWorkTypes'
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.array2 = res.data
+			}
+		},
 		// 确认提交按钮回调
 		handleSub() {
-			if (!this.phone) {
+			if (!this.info.userPhone) {
 				uni.showToast({
 					title: '请输入手机号码',
 					icon: 'none'
@@ -85,38 +105,63 @@ export default {
 				return
 			}
 			const rePhone = /^[1][3,4,5,7,8,9][0-9]{9}$/
-			if (!rePhone.test(this.phone)) {
+			if (!rePhone.test(this.info.userPhone)) {
 				uni.showToast({
 					title: '手机号码格式有误',
 					icon: 'none'
 				})
 				return
 			}
+			if (!this.info.acceptanceTime) {
+				uni.showToast({
+					title: '请输入接单考核时间',
+					icon: 'none'
+				})
+				return
+			}
+			if (!this.info.maintenanceTime) {
+				uni.showToast({
+					title: '请输入维修考核时间',
+					icon: 'none'
+				})
+				return
+			}
 			uni.showModal({
 				title: '提示',
 				content: '确认提交吗?',
 				success: (res) => {
 					if (res.confirm) {
-						console.log(this.phone)
-						console.log(this.array[this.index])
-						console.log(this.array2[this.index2])
-						console.log(this.receivingTime)
-						console.log(this.repairsTime)
-
-						uni.showToast({
-							title: '编辑成功',
-							icon: 'success'
-						})
-
-						setTimeout(() => {
-							uni.navigateTo({
-								url: '/pagesRepairs/box/box'
-							})
-						}, 1500)
+						this.handleEdit()
 					}
 				}
 			})
 		},
+		async handleEdit() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairUser/updateAddressBook',
+				method: 'post',
+				data: {
+					id: this.info.id,
+					state: this.array[this.index].id,
+					workType: this.array2[this.index2].id,
+					acceptanceTime: this.info.acceptanceTime,
+					maintenanceTime: this.info.maintenanceTime,
+					phone: this.info.userPhone
+				}
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				uni.showToast({
+					title: '编辑成功',
+					icon: 'success'
+				})
+				setTimeout(() => {
+					uni.redirectTo({
+						url: '/pagesRepairs/box/box'
+					})
+				}, 1500)
+			}
+		},
 		// 状态选择框选择回调
 		bindPickerChange(e) {
 			this.index = e.detail.value

+ 11 - 9
pagesRepairs/evaluate/evaluate.vue

@@ -36,7 +36,7 @@ export default {
 		// 评分改变回调
 		onChange(e) {
 			// console.log(e)
-			this.score = e.value * 2
+			this.score = e.value
 		},
 		// 确认提交按钮回调
 		async handleSub() {
@@ -65,15 +65,17 @@ export default {
 				}
 			})
 			// console.log(res)
-			uni.showToast({
-				title: '评价成功',
-				icon: 'success'
-			})
-			setTimeout(() => {
-				uni.redirectTo({
-					url: '/pagesRepairs/box/box'
+			if (res.code === '200') {
+				uni.showToast({
+					title: '评价成功',
+					icon: 'success'
 				})
-			}, 1500)
+				setTimeout(() => {
+					uni.redirectTo({
+						url: '/pagesRepairs/box/box'
+					})
+				}, 1500)
+			}
 		}
 	}
 }

+ 135 - 43
pagesRepairs/help/help.vue

@@ -4,7 +4,7 @@
 
 		<view class="box" v-if="type === '1'">
 			<img src="../../static/images/repairsImg/people.png" />
-			<view class="box_info">张三</view>
+			<view class="box_info">{{ info.userName }}</view>
 		</view>
 
 		<view class="title">协作对象</view>
@@ -12,23 +12,23 @@
 		<view class="box" @click="handleHelpPeople">
 			<img src="../../static/images/repairsImg/peoples.png" />
 			<view class="box_info" :class="{ color: !peoples }">{{ peoples ? peoples : '请选择协作对象' }}</view>
-			<img class="img" src="../../static/images/repairsImg/right.png" />
+			<img v-if="type !== '1'" class="img" src="../../static/images/repairsImg/right.png" />
 		</view>
 
 		<view class="title">转单语音说明</view>
 
 		<!-- 录音区域 -->
 		<view class="voice">
-			<view class="voice_box" v-if="!recordingPath" @click="handleRecording">
+			<view class="voice_box" v-if="!info.voice" @click="handleRecording">
 				<img src="../../static/images/repairsImg/voice.png" />
 			</view>
-			<view v-if="!recordingPath" @click="handleRecording">点击录音</view>
+			<view v-if="!info.voice" @click="handleRecording">点击录音</view>
 
-			<view class="item_recording" v-if="recordingPath" @click="handlePlayRecording">
+			<view class="item_recording" v-if="info.voice" @click="handlePlayRecording">
 				<img :src="recordingImg" />
-				{{ recordingTime }}″
+				{{ info.voiceLength || 0 }}″
 			</view>
-			<view class="recording_icon" v-if="recordingPath" @click="handleDeleteRecording">×</view>
+			<view class="recording_icon" v-if="info.voice && type !== '1'" @click="handleDeleteRecording">×</view>
 		</view>
 
 		<!-- 录音弹窗区域 -->
@@ -41,12 +41,12 @@
 		<view class="title">备注</view>
 
 		<view class="textarea">
-			<textarea placeholder-style="color:#CCCCCC" placeholder="请输入协作说明" v-model="desc"></textarea>
+			<textarea placeholder-style="color:#CCCCCC" placeholder="请输入协作说明" :disabled="type === '1'" v-model="info.remark"></textarea>
 		</view>
 
 		<view class="btn2" v-if="type === '1'">
-			<view class="btn_box type">拒绝</view>
-			<view class="btn_box type2">派单</view>
+			<view class="btn_box type" @click="handleDispose(0)">拒绝</view>
+			<view class="btn_box type2" @click="handleDispose(1)">派单</view>
 		</view>
 
 		<view class="btn" v-else @click="handleAffirm">确认</view>
@@ -62,19 +62,46 @@ export default {
 	},
 	data() {
 		return {
+			// 页面类型
 			type: null,
-			peoples: '',
-			desc: '',
-			// 录音文件路径
-			recordingPath: '',
 			// 录音图片地址
 			recordingImg: '../../static/images/repairsImg/recording.jpg',
-			// 录音时长
-			recordingTime: 0,
 			// 播放状态
 			playStatus: false,
 			// 定时器标识
-			timer: null
+			timer: null,
+			// 订单id
+			recordId: '',
+			info: {
+				// 申请人
+				userName: '',
+				// 协作对象数组
+				collaboratorDatas: [],
+				// 语音地址
+				voice: '',
+				// 备注
+				remark: '',
+				// 录音时长
+				voiceLength: 0
+			}
+		}
+	},
+	computed: {
+		// 协作对象
+		peoples() {
+			let temList = []
+			this.info.collaboratorDatas.forEach((ele) => {
+				temList.push(ele.userName)
+			})
+			let res = temList.toString()
+			return res
+		},
+		idList() {
+			let temList = []
+			this.info.collaboratorDatas.forEach((ele) => {
+				temList.push(ele.id)
+			})
+			return temList
 		}
 	},
 	mounted() {
@@ -87,46 +114,108 @@ export default {
 		console.log(options)
 		if (options.type) {
 			this.type = options.type
+			this.getHelpData()
 		}
+		this.recordId = options.id
 		uni.$on('addCheckList', this.addCheckList)
 	},
 	methods: {
-		addCheckList(e) {
-			// console.log(e)
-			let temList = []
-			e.data.forEach((ele) => {
-				temList.push(ele.name)
+		// 拒绝 派单 按钮回调
+		async handleDispose(type) {
+			const res = await this.$myRequest_repairs({
+				url: '/repairRecord/cooperationOrders',
+				method: 'post',
+				data: {
+					id: this.info.id,
+					collaborator: this.idList,
+					approverStatu: type
+				}
+			})
+			console.log(res)
+			if (res.code === '200') {
+				uni.showToast({
+					title: `${type === 0 ? '已拒绝该审核' : '派单成功'}`,
+					icon: 'none'
+				})
+				setTimeout(() => {
+					uni.reLaunch({
+						url: '/pagesRepairs/box/box'
+					})
+				}, 1500)
+			}
+		},
+		// 获取审核订单详细数据
+		async getHelpData() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairRecord/cooperationDetail',
+				data: {
+					recordId: this.recordId
+				}
 			})
-			this.peoples = temList.toString()
+			// console.log(res)
+			if (res.code === '200') {
+				this.info = res.data
+			}
+		},
+		addCheckList(e) {
+			this.info.collaboratorDatas = e.data
 		},
 		// 确认按钮回调
 		handleAffirm() {
+			if (!this.peoples) {
+				uni.showToast({
+					title: '请选择协作对象',
+					icon: 'none'
+				})
+				return
+			}
+			if (!this.info.voice) {
+				uni.showToast({
+					title: '请录入转单语音说明',
+					icon: 'none'
+				})
+				return
+			}
 			uni.showModal({
 				title: '提示',
 				content: '确认提交协作申请吗?',
-				success: (res) => {
+				success: async (res) => {
 					if (res.confirm) {
-						console.log(this.recordingPath)
-						console.log(this.desc)
-						console.log(this.peoples)
-						uni.showToast({
-							title: '提交协作申请成功,请等待管理员审核',
-							icon: 'none',
-							duration: 3000
+						const res = await this.$myRequest_repairs({
+							url: '/repairRecord/collaborateApply',
+							method: 'post',
+							data: {
+								recordId: this.recordId,
+								userId: uni.getStorageSync('repairsUserInfo').userId,
+								voice: this.info.voice,
+								voiceLength: this.info.voiceLength,
+								collaborator: this.info.collaboratorDatas,
+								remark: this.info.remark
+							}
 						})
-						setTimeout(() => {
-							uni.redirectTo({
-								url: '/pagesRepairs/box/box'
+						console.log(res)
+						if (res.code === '200') {
+							uni.showToast({
+								title: '提交协作申请成功,请等待管理员审核',
+								icon: 'none',
+								duration: 3000
 							})
-						}, 3000)
+							setTimeout(() => {
+								uni.reLaunch({
+									url: '/pagesRepairs/box/box'
+								})
+							}, 3000)
+						}
 					}
 				}
 			})
 		},
 		handleHelpPeople() {
-			uni.navigateTo({
-				url: '/pagesRepairs/helpPeople/helpPeople'
-			})
+			if (this.type !== '1') {
+				uni.navigateTo({
+					url: `/pagesRepairs/helpPeople/helpPeople?id=${this.recordId}`
+				})
+			}
 		},
 		// 点击录音按钮回调
 		handleRecording() {
@@ -176,7 +265,7 @@ export default {
 		},
 		// 点击录音播放回调
 		handlePlayRecording() {
-			innerAudioContext.src = this.recordingPath
+			innerAudioContext.src = this.info.voice
 			if (!this.playStatus) {
 				this.playStatus = true
 				innerAudioContext.play()
@@ -219,8 +308,8 @@ export default {
 					content: '确定删除录音吗?',
 					success: (res) => {
 						if (res.confirm) {
-							this.recordingPath = ''
-							this.recordingTime = 0
+							this.info.voice = ''
+							this.info.voiceLength = 0
 						}
 					}
 				})
@@ -228,8 +317,8 @@ export default {
 		},
 		// 自定义事件回调,获取录音文件路径
 		getTempFilePath(path, time) {
-			this.recordingPath = path
-			this.recordingTime = time
+			this.info.voice = path
+			this.info.voiceLength = time
 			this.$refs.popup_recording.close()
 		}
 	}
@@ -261,6 +350,9 @@ export default {
 
 		.box_info {
 			flex: 1;
+			overflow: hidden;
+			text-overflow: ellipsis;
+			white-space: nowrap;
 		}
 
 		.color {

+ 94 - 72
pagesRepairs/helpPeople/helpPeople.vue

@@ -15,14 +15,13 @@
 				<img src="../../static/images/repairsImg/photo.png" />
 				<view class="item_info">
 					<view class="info_msg">
-						{{ item.name }}
-						<view class="msg_work">{{ item.work }}</view>
+						{{ item.userName }}
+						<view class="msg_work">{{ item.workType }}</view>
 					</view>
-					<view class="info_phone">{{ item.phone }}</view>
+					<view class="info_phone">{{ item.userPhone }}</view>
 				</view>
-				<view class="item_type color_type" v-if="item.type === 1">接单中</view>
-				<view class="item_type color_type2" v-if="item.type === 2">订单饱和</view>
-				<view class="item_type color_type3" v-if="item.type === 3">停止接单</view>
+				<view class="item_type color_type2" v-if="item.state === '大量接单'">大量接单</view>
+				<view class="item_type color_type3" v-if="item.state === '停止接单'">停止接单</view>
 			</view>
 		</view>
 
@@ -37,88 +36,115 @@ export default {
 			// 搜索框绑定数据
 			searchValue: '',
 			// 协作人列表
-			list: [
-				{
-					id: 1,
-					name: '张三',
-					phone: '13659856958',
-					work: '电工',
-					type: 1,
-					checked: false
-				},
-				{
-					id: 2,
-					name: '李四',
-					phone: '13659856958',
-					work: '电工',
-					type: 2,
-					checked: false
-				},
-				{
-					id: 3,
-					name: '张三',
-					phone: '13659856958',
-					work: '电工',
-					type: 3,
-					checked: false
-				},
-				{
-					id: 4,
-					name: '张三',
-					phone: '13659856958',
-					work: '电工',
-					type: 1,
-					checked: false
-				},
-				{
-					id: 5,
-					name: '李四',
-					phone: '13659856958',
-					work: '电工',
-					type: 2,
-					checked: false
-				},
-				{
-					id: 6,
-					name: '张三',
-					phone: '13659856958',
-					work: '电工',
-					type: 3,
-					checked: false
-				}
-			],
+			list: [],
 			// 选中列表
 			checkList: [],
-			type: null
+			// 页面类型
+			type: null,
+			// 订单id
+			recordId: '',
+			info: {}
 		}
 	},
 	onLoad(options) {
-		console.log(options)
+		// console.log(options)
 		if (options.type) {
 			this.type = options.type
 			uni.setNavigationBarTitle({
 				title: '派单'
 			})
 		}
+		if (options.info) {
+			this.info = JSON.parse(options.info)
+		}
+		this.recordId = options.id
+		this.getData()
 	},
 	methods: {
+		// 获取协作人列表数组
+		async getData() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairUser/queryPageRepairUsers',
+				data: {
+					currentPage: 1,
+					pageCount: 999,
+					recordId: this.recordId,
+					keyWord: this.searchValue
+				}
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.list = res.data.list
+				this.list.forEach((ele) => {
+					ele.checked = false
+				})
+			}
+		},
 		// 确认派单按钮回调
 		handleDispatch() {
 			if (this.type) {
+				if (this.checkList.length > 1) {
+					uni.showToast({
+						title: '只能派单给一位师傅',
+						icon: 'none'
+					})
+					return
+				}
 				uni.showModal({
 					title: '提示',
-					content: '确定把单派给此员工吗?',
-					success: (res) => {
+					content: `确定把单派给${this.checkList[0].userName}吗?`,
+					success: async (res) => {
 						if (res.confirm) {
-							uni.showToast({
-								title: '派单成功',
-								icon: 'none'
-							})
-							setTimeout(() => {
-								uni.reLaunch({
-									url: '/pagesRepairs/box/box'
+							// 直接派单
+							if (this.type === '1') {
+								const res = await this.$myRequest_repairs({
+									url: '/repairRecord/receiveSendOrders',
+									method: 'post',
+									data: {
+										id: this.checkList[0].id,
+										acceptanceTime: this.checkList[0].acceptanceTime,
+										shiftId: this.checkList[0].shiftId,
+										articleId: this.checkList[0].articleId,
+										recordId: this.recordId
+									}
+								})
+								// console.log(res)
+								if (res.code === '200') {
+									uni.showToast({
+										title: '派单成功',
+										icon: 'success'
+									})
+									setTimeout(() => {
+										uni.reLaunch({
+											url: '/pagesRepairs/box/box'
+										})
+									}, 1500)
+								}
+							} else if (this.type === '2') {
+								// 转单审核同意时重新派单
+								const res = await this.$myRequest_repairs({
+									url: '/repairRecord/transfer',
+									method: 'post',
+									data: {
+										id: this.info.id,
+										userId: this.checkList[0].id,
+										approverStatu: 1,
+										remark: this.info.remark
+									}
 								})
-							}, 1500)
+								console.log(res)
+								if (res.code === '200') {
+									uni.showToast({
+										title: '派单成功',
+										icon: 'success'
+									})
+									setTimeout(() => {
+										uni.reLaunch({
+											url: '/pagesRepairs/box/box'
+										})
+									}, 1500)
+								}
+							}
 						}
 					}
 				})
@@ -221,10 +247,6 @@ export default {
 				margin-left: auto;
 				// font-size: 24rpx;
 			}
-
-			.color_type {
-				color: #6fb6b8;
-			}
 			.color_type2 {
 				color: #1e7dfb;
 			}

+ 236 - 142
pagesRepairs/home/home.vue

@@ -9,20 +9,20 @@
 			</view>
 			<view class="bottom">
 				<view class="bottom_box">
-					<view class="box_num">100</view>
+					<view class="box_num">{{ workCount }}</view>
 					<view class="box_info">工单数</view>
 				</view>
 
 				<view class="bottom_box">
-					<view class="box_num">10</view>
+					<view class="box_num">{{ processCount }}</view>
 					<view class="box_info">处理中</view>
 				</view>
 				<view class="bottom_box">
-					<view class="box_num">50</view>
+					<view class="box_num">{{ finishCount }}</view>
 					<view class="box_info">已完成</view>
 				</view>
 				<view class="bottom_box">
-					<view class="box_num">60</view>
+					<view class="box_num">{{ timeoutCount }}</view>
 					<view class="box_info">已超时</view>
 				</view>
 			</view>
@@ -31,26 +31,26 @@
 		<!-- 状态统计区域 维修师傅端 -->
 		<view class="top_types" v-else>
 			<view class="types_box">
-				<view class="box_num">100</view>
+				<view class="box_num">{{ workCount }}</view>
 				<view class="box_info">工单数</view>
 			</view>
 
 			<view class="types_box">
-				<view class="box_num">10</view>
+				<view class="box_num">{{ processCount }}</view>
 				<view class="box_info">处理中</view>
 			</view>
 			<view class="types_box">
-				<view class="box_num">50</view>
+				<view class="box_num">{{ finishCount }}</view>
 				<view class="box_info">已完成</view>
 			</view>
 			<view class="types_box">
-				<view class="box_num">60</view>
+				<view class="box_num">{{ timeoutCount }}</view>
 				<view class="box_info">已超时</view>
 			</view>
 		</view>
 
 		<!-- 排班区域 -->
-		<view class="watch">
+		<view class="watch" v-if="tableData.length">
 			<view class="watch_title">
 				<img src="../../static/images/repairsImg/watch.png" />
 				排班
@@ -60,27 +60,26 @@
 				<!-- 表头行 -->
 				<uni-tr>
 					<uni-th width="80" align="center">姓名</uni-th>
-					<uni-th width="50" align="center">工种</uni-th>
+					<uni-th width="60" align="center">工种</uni-th>
 					<uni-th width="80" align="center">接单状态</uni-th>
 					<uni-th width="70" align="center">值班班次</uni-th>
 				</uni-tr>
 				<!-- 表格数据行 -->
 				<uni-tr v-for="(item, index) in tableData" :key="index">
 					<!-- 姓名区域 -->
-					<uni-td align="center">{{ item.name }}</uni-td>
+					<uni-td align="center">{{ item.userName }}</uni-td>
 					<!-- 工种区域 -->
-					<uni-td align="center">{{ item.type }}</uni-td>
+					<uni-td align="center">{{ item.workTypeName }}</uni-td>
 					<!-- 状态区域 -->
 					<uni-td align="center">
 						<picker :disabled="!btns.includes('表格编辑')" @change="bindPickerChange($event, item)" :range="typeArray">
-							<view class="watch_color" v-if="item.status == '0'">{{ typeArray[item.status] }}</view>
-							<view class="watch_color2" v-if="item.status == '1'">{{ typeArray[item.status] }}</view>
-							<view class="watch_color3" v-if="item.status == '2'">{{ typeArray[item.status] }}</view>
+							<view class="watch_color2" v-if="item.state === 1">{{ typeArray[item.state - 1] }}</view>
+							<view class="watch_color3" v-if="item.state === 2">{{ typeArray[item.state - 1] }}</view>
 						</picker>
 					</uni-td>
 					<!-- 是否值班 -->
 					<uni-td align="center">
-						<view @click="handleChange(item, index)">{{ getCutting(item.work) }}</view>
+						<view @click="handleChange(item, index)">{{ getCutting(item.shifts || []) || '暂无排班' }}</view>
 					</uni-td>
 				</uni-tr>
 			</uni-table>
@@ -96,9 +95,9 @@
 					<view class="poop_body">
 						<view class="body_item" v-for="item in workArray" :key="item.id" @click="handleChangeWork(item)">
 							<view class="body_item_info">
-								{{ item.text }}
+								{{ item.name }}
 							</view>
-							<view class="body_item_icon" v-if="defaultList.some((ele) => ele.text == item.text)">✔</view>
+							<view class="body_item_icon" v-if="defaultList.some((ele) => ele.name == item.name)">✔</view>
 						</view>
 					</view>
 				</view>
@@ -106,7 +105,7 @@
 		</view>
 
 		<!-- 排行榜区域 -->
-		<view class="rank">
+		<view class="rank" v-if="btns.includes('图表')">
 			<view class="rank_title">
 				<img src="../../static/images/repairsImg/rank.png" />
 				工单完成排行榜
@@ -114,14 +113,14 @@
 			<!-- 排行榜柱状图 -->
 			<view class="rank_charts">
 				<!-- 加上canvas2d属性后 模拟器上图表显示异常,真机调试没有问题,开发时不添加canvas2d属性,发布时添加canvas2d属性 -->
-				<qiun-data-charts canvas2d type="bar" :opts="opts" :chartData="chartData" />
+				<qiun-data-charts type="bar" :opts="opts" :chartData="chartData" />
 			</view>
 		</view>
 
 		<!-- 悬浮按钮区域 -->
 		<view class="fixed">
 			<img src="../../static/images/repairsImg/add.png" @click="handleGoRepairs" />
-			<uni-badge :offset="[5, 5]" absolute="rightTop" text="8">
+			<uni-badge :offset="[5, 5]" absolute="rightTop" :text="msgTotal">
 				<img class="img" src="../../static/images/repairsImg/message.png" @click="handleGoMsg" />
 			</uni-badge>
 		</view>
@@ -139,36 +138,28 @@ export default {
 			// 改变的是第几个索引
 			changeIndex: 0,
 			// 排班状态数组
-			typeArray: ['接单中', '订单饱和', '停止接单'],
+			typeArray: ['大量接单', '停止接单'],
 			// 值班状态数组
-			workArray: [
-				{
-					id: 0,
-					text: '正常班次'
-				},
-				{
-					id: 1,
-					text: '值班班次'
-				}
-			],
+			workArray: [],
 			// 分段器数组数据
 			items: ['团队数据统计', '个人数据统计'],
 			// 分段器当前索引
 			current: 0,
 			// 柱状图数据
 			chartData: {
-				categories: ['张三', '李四', '王五', '老六', '刘八'],
+				categories: [],
 				series: [
 					{
 						name: '好评数',
-						data: [45, 36, 31, 33, 13]
+						data: []
 					},
 					{
 						name: '完成数',
-						data: [18, 27, 21, 24, 6]
+						data: []
 					}
 				]
 			},
+			// 柱状图配置
 			opts: {
 				color: ['#1890FF', '#91CB74'],
 				padding: [15, 30, 0, 5],
@@ -192,121 +183,185 @@ export default {
 				}
 			},
 			// 表格数据
-			// status状态: 0 接单中  1 订单饱和  2 停止接单
-			// work状态: 0 正常班次  1 值班班次
-			tableData: [
-				{
-					name: '张三',
-					type: '电工',
-					status: 0,
-					work: [
-						{
-							id: 0,
-							text: '正常班次'
-						},
-						{
-							id: 1,
-							text: '值班班次'
-						}
-					]
-				},
-				{
-					name: '张三三',
-					type: '泥工',
-					status: 1,
-					work: [
-						{
-							id: 1,
-							text: '值班班次'
-						}
-					]
-				},
-				{
-					name: '张三',
-					type: '电工',
-					status: 2,
-					work: [
-						{
-							id: 0,
-							text: '正常班次'
-						}
-					]
-				},
-				{
-					name: '张三三',
-					type: '泥工',
-					status: 0,
-					work: [
-						{
-							id: 1,
-							text: '值班班次'
-						}
-					]
-				},
-				{
-					name: '张三',
-					type: '电工',
-					status: 1,
-					work: [
-						{
-							id: 0,
-							text: '正常班次'
-						}
-					]
-				},
-				{
-					name: '张三三',
-					type: '泥工',
-					status: 2,
-					work: [
-						{
-							id: 0,
-							text: '正常班次'
-						}
-					]
-				}
-			]
+			tableData: [],
+			schoolId: '',
+			userId: '',
+			// 工单数单数
+			workCount: '',
+			// 处理中单数
+			processCount: '',
+			// 已完成单数
+			finishCount: '',
+			// 已超时单数
+			timeoutCount: '',
+			// 当前页
+			currentPage: 1,
+			// 每页多少条数据
+			pageCount: 100,
+			// 总条数
+			total: null,
+			// 信息列表
+			msgList: [],
+			// 信息总数
+			msgTotal: 0
 		}
 	},
 	mounted() {
 		console.log('主页页面加载')
 		const repairsUserInfo = uni.getStorageSync('repairsUserInfo')
 		this.btns = repairsUserInfo.btns
+		this.schoolId = repairsUserInfo.schoolId
+		this.userId = repairsUserInfo.userId
 		console.log(this.btns)
+		if (this.btns.includes('图表')) {
+			this.getChartData()
+		}
+		if (this.btns.includes('表格编辑')) {
+			this.getWatchClass()
+		}
+		if (this.btns.includes('首页分段器')) {
+			this.getTeamCount()
+		} else {
+			this.getCount()
+		}
+		this.getWatchData()
+		this.getMsgList()
 	},
 	methods: {
-		// 是否值班弹窗确定按钮回调
-		handlePopConfirm() {
-			uni.showModal({
-				title: '提示',
-				content: '确定修改是否值班状态吗?',
-				success: (res) => {
-					if (res.confirm) {
-						this.tableData[this.changeIndex].work = this.defaultList
-						console.log('用户点击确定')
-					} else if (res.cancel) {
-						console.log('用户点击取消')
-					}
+		// 获取信息列表数据
+		async getMsgList() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairSystemMessages/querySystemMessagePage',
+				data: {
+					currentPage: 1,
+					pageCount: 10,
+					userId: this.userId
+				}
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.msgTotal = res.data.totalCount
+				this.msgList = res.data.list
+			}
+		},
+		// 获取图表数据
+		async getChartData() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairUser/queryPositiveReviewPage',
+				data: {
+					currentPage: 1,
+					pageCount: 100,
+					schoolId: this.schoolId
 				}
 			})
+			// console.log(res)
+			if (res.code === '200') {
+				// 姓名数组
+				this.chartData.categories = res.data.list.map((ele) => ele.userName)
+				// 好评数数组
+				this.chartData.series[0].data = res.data.list.map((ele) => ele.evaluateCount)
+				// 完成数数组
+				this.chartData.series[1].data = res.data.list.map((ele) => ele.finishCount)
+			}
+		},
+		// 获取排班班次数组
+		async getWatchClass() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairShiftSettings/queryPageRepairShiftSettings',
+				data: {
+					currentPage: 1,
+					pageCount: 100,
+					name: ''
+				}
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.workArray = res.data.list
+			}
+		},
+		// 获取排班数据
+		async getWatchData() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairClassesSettings/queryPageUserClasses',
+				data: {
+					currentPage: this.currentPage,
+					pageCount: this.pageCount,
+					schoolId: this.schoolId
+				}
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.total = res.data.totalCount
+				this.tableData = res.data.list
+			}
+		},
+		// 获取团队数据统计单数
+		async getTeamCount() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairRecord/queryLogisticHomeCount',
+				data: {
+					schoolId: this.schoolId
+				}
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.workCount = res.data.workCount
+				this.processCount = res.data.processCount
+				this.finishCount = res.data.finishCount
+				this.timeoutCount = res.data.timeoutCount
+			}
+		},
+		// 获取个人数据统计单数
+		async getCount() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairRecord/queryMasterHomeCount',
+				data: {
+					userId: this.userId
+				}
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.workCount = res.data.workCount
+				this.processCount = res.data.processCount
+				this.finishCount = res.data.finishCount
+				this.timeoutCount = res.data.timeoutCount
+			}
+		},
+		// 是否值班弹窗确定按钮回调
+		handlePopConfirm() {
+			// uni.showModal({
+			// 	title: '提示',
+			// 	content: '确定修改是否值班状态吗?',
+			// 	success: (res) => {
+			// 		if (res.confirm) {
+			// 			this.tableData[this.changeIndex].shifts = this.defaultList
+			// 			console.log('用户点击确定')
+			// 		} else if (res.cancel) {
+			// 			console.log('用户点击取消')
+			// 		}
+			// 	}
+			// })
 			this.$refs.popup_work.close()
+			this.tableData[this.changeIndex].shifts = this.defaultList
+			// console.log(this.tableData[this.changeIndex])
+			this.handleEdit(this.tableData[this.changeIndex])
 		},
 		// 点击值班状态回调
 		handleChange(item, index) {
 			if (this.btns.includes('表格编辑')) {
 				this.$refs.popup_work.open('bottom')
 				this.changeIndex = index
-				this.defaultList = JSON.parse(JSON.stringify(item.work))
+				this.defaultList = JSON.parse(JSON.stringify(item.shifts || []))
 			}
 		},
 		// 切换值班状态回调
 		handleChangeWork(item) {
 			let temIndex
 			let flag = this.defaultList.some((ele, index) => {
-				if (ele.text == item.text) {
+				if (ele.name == item.name) {
 					temIndex = index
 				}
-				return ele.text == item.text
+				return ele.name == item.name
 			})
 			if (flag) {
 				this.defaultList.splice(temIndex, 1)
@@ -319,24 +374,60 @@ export default {
 
 		// 切换接单状态回调
 		bindPickerChange(e, item) {
-			uni.showModal({
-				title: '提示',
-				content: '确定修改接单状态吗?',
-				success: (res) => {
-					if (res.confirm) {
-						item.status = e.detail.value
-						console.log('用户点击确定')
-					} else if (res.cancel) {
-						console.log('用户点击取消')
-					}
+			// uni.showModal({
+			// 	title: '提示',
+			// 	content: '确定修改接单状态吗?',
+			// 	success: (res) => {
+			// 		if (res.confirm) {
+			// 			item.state = e.detail.value + 1
+			// 			console.log('用户点击确定')
+			// 		} else if (res.cancel) {
+			// 			console.log('用户点击取消')
+			// 		}
+			// 	}
+			// })
+			item.state = e.detail.value * 1 + 1
+			if (item.state === 1) {
+				item.stateStr = '大量接单'
+			} else {
+				item.stateStr = '停止接单'
+			}
+			this.handleEdit(item)
+		},
+		// 修改排班表请求
+		async handleEdit(item) {
+			const res = await this.$myRequest_repairs({
+				url: '/repairClassesSettings/updateUserClasses',
+				method: 'post',
+				data: {
+					id: item.id,
+					userName: item.userName,
+					userPhone: item.userPhone,
+					workTypeName: item.workTypeName,
+					state: item.state,
+					stateStr: item.stateStr,
+					classId: item.classId,
+					shifts: item.shifts
 				}
 			})
+			// console.log(res)
+			if (res.code === '200') {
+				uni.showToast({
+					title: '编辑成功',
+					icon: 'success'
+				})
+				setTimeout(() => {
+					this.getWatchData()
+					this.getWatchClass()
+				}, 1500)
+			}
 		},
 
 		// 点击悬浮消息按钮回调
 		handleGoMsg() {
+			const list = JSON.stringify(this.msgList)
 			uni.navigateTo({
-				url: '/pagesRepairs/message/message'
+				url: `/pagesRepairs/message/message?list=${list}&total=${this.msgTotal}`
 			})
 		},
 		// 点击悬浮加号按钮回调
@@ -351,16 +442,23 @@ export default {
 			if (this.current != e.currentIndex) {
 				this.current = e.currentIndex
 				console.log(this.current)
+				if (this.current === 0) {
+					// 团队数据
+					this.getTeamCount()
+				} else {
+					// 个人数据
+					this.getCount()
+				}
 			}
 		},
 		// 把数组每一项的第一个文字切割出来
 		getCutting(list) {
 			let str = ''
 			list.forEach((ele, index) => {
-				if (index + 1 == list.length && list.length > 1) {
-					str += '、' + ele.text.substring(0, 1)
+				if (index !== 0 && list.length > 1) {
+					str += '、' + ele.name.substring(0, 1)
 				} else {
-					str += ele.text.substring(0, 1)
+					str += ele.name.substring(0, 1)
 				}
 			})
 			return str
@@ -470,10 +568,6 @@ export default {
 			}
 		}
 
-		.watch_color {
-			color: #6fb6b8;
-		}
-
 		.watch_color2 {
 			color: #1e7dfb;
 		}

+ 2 - 2
pagesRepairs/index/index.vue

@@ -33,12 +33,12 @@ export default {
 			// 后勤路由
 			logisticsListInfo: {
 				routes: ['首页', '工单管理', '待处理池', '通讯录'],
-				btns: ['表格编辑', '延时', '派单', '审核', '分段器按钮']
+				btns: ['表格编辑', '延时', '派单', '审核', '分段器按钮', '图表']
 			},
 			// 管理者路由
 			adminListInfo: {
 				routes: ['首页', '工单管理', '待处理池', '通讯录'],
-				btns: ['首页分段器', '表格编辑', '工单管理分段器', '延时', '派单', '审核', '接单', '报价', '维修完成']
+				btns: ['首页分段器', '表格编辑', '工单管理分段器', '延时', '派单', '审核', '接单', '报价', '维修完成', '图表']
 			}
 		}
 	},

File diff suppressed because it is too large
+ 333 - 407
pagesRepairs/management/management.vue


+ 85 - 55
pagesRepairs/message/message.vue

@@ -1,16 +1,16 @@
 <template>
 	<view class="container">
 		<!-- 每一个消息区域 -->
-		<view class="box" v-for="item in imgList" :key="item.id">
-			<view class="box_time">{{ item.time }}</view>
+		<view class="box" v-for="item in msgList" :key="item.id" @click="handleRead(item)">
+			<view class="box_time">{{ item.updateTime }}</view>
 			<view class="box_info">
-				<view class="info_circle" :class="{ while: item.type === false }"></view>
+				<view class="info_circle" :class="{ while: item.isRead === 1 }"></view>
 				<view class="info_icon">
 					<img src="../../static/images/repairsImg/msg.png" />
 				</view>
 				<view class="info_msg">
-					<view class="msg_title">{{ item.title }}</view>
-					<view class="msg_order">订单号:{{ item.order }}</view>
+					<view class="msg_title">{{ item.content }}</view>
+					<view class="msg_order">订单号:{{ item.recordNo }}</view>
 				</view>
 			</view>
 		</view>
@@ -21,57 +21,80 @@
 export default {
 	data() {
 		return {
-			imgList: [
-				{
-					id: 1,
-					type: false,
-					title: '订单已完成请尽快确认!',
-					order: '06521649496',
-					time: '2023-07-07  12:25:25'
-				},
-				{
-					id: 2,
-					type: true,
-					title: '请尽快确认!',
-					order: '06521649496',
-					time: '2023-08-07  12:25:25'
-				},
-				{
-					id: 3,
-					type: false,
-					title: '已完成请尽快确认!',
-					order: '06521649496',
-					time: '2023-06-07  12:25:25'
-				},
-				{
-					id: 4,
-					type: false,
-					title: '订单已完成请尽快确认!',
-					order: '06521649496',
-					time: '2023-07-07  12:25:25'
-				},
-				{
-					id: 5,
-					type: true,
-					title: '请尽快确认!',
-					order: '06521649496',
-					time: '2023-08-07  12:25:25'
-				},
-				{
-					id: 6,
-					type: false,
-					title: '已完成请尽快确认!',
-					order: '06521649496',
-					time: '2023-06-07  12:25:25'
-				},
-				{
-					id: 7,
-					type: false,
-					title: '已完成请尽快确认!',
-					order: '06521649496',
-					time: '2023-06-07  12:25:25'
+			// 信息列表
+			msgList: [],
+			// 用户id
+			userId: '',
+			// 当前页
+			currentPage: 1,
+			// 每页多少条
+			pageCount: 10,
+			// 总条数
+			total: null
+		}
+	},
+	onLoad(options) {
+		const repairsUserInfo = uni.getStorageSync('repairsUserInfo')
+		this.userId = repairsUserInfo.userId
+		if (options.list) {
+			this.msgList = JSON.parse(options.list)
+		} else {
+			this.getMsgList()
+		}
+		this.total = options.total
+	},
+	onReachBottom() {
+		console.log(666)
+		if (this.total > this.msgList.length) {
+			this.currentPage++
+			this.getMsgList()
+		} else {
+			uni.showToast({
+				title: '没有更多数据了',
+				icon: 'none'
+			})
+		}
+	},
+	methods: {
+		// 点击信息回调
+		async handleRead(item) {
+			// 如果是未读信息
+			if (item.isRead === 0) {
+				const res = await this.$myRequest_repairs({
+					url: '/repairSystemMessages/readSystemMessage',
+					data: {
+						id: item.id
+					}
+				})
+				// console.log(res)
+				if (res.code === '200') {
+					uni.showToast({
+						title: '已读',
+						icon: 'none'
+					})
+					setTimeout(() => {
+						this.currentPage = 1
+						this.msgList = []
+						this.getMsgList()
+					}, 1500)
+				}
+			}
+		},
+		// 获取列表信息
+		async getMsgList() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairSystemMessages/querySystemMessagePage',
+				data: {
+					currentPage: this.currentPage,
+					pageCount: 10,
+					userId: this.userId
 				}
-			]
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.total = res.data.totalCount
+				this.msgList = [...this.msgList, ...res.data.list]
+			}
 		}
 	}
 }
@@ -112,6 +135,7 @@ export default {
 			.while {
 				background-color: #fff;
 			}
+
 			.info_icon {
 				margin: 0 8rpx;
 				width: 90rpx;
@@ -124,9 +148,15 @@ export default {
 			}
 
 			.info_msg {
+				flex: 1;
+				overflow: hidden;
+
 				.msg_title {
 					font-size: 32rpx;
 					font-weight: bold;
+					overflow: hidden;
+					text-overflow: ellipsis;
+					white-space: nowrap;
 				}
 
 				.msg_order {

+ 92 - 23
pagesRepairs/myRepairs/myRepairs.vue

@@ -132,10 +132,10 @@
 
 				<!-- 按钮 -->
 				<view class="item_btn" v-if="item.state !== '已取消'">
-					<view class="btn_box type" v-if="item.state === '待接单' || item.state === '维修中'" @click="handleExpedite">催单</view>
-					<view class="btn_box type" v-if="item.state === '待确认'" @click="handleBackOffice">转后勤</view>
-					<view class="btn_box type" v-if="item.state === '待确认'">支付</view>
-					<view class="btn_box type2" v-if="item.state === '待接单' || item.state === '维修中' || item.state === '待确认'" @click="handleRepeal">撤销</view>
+					<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>
 				<view class="item_btn2" v-else></view>
@@ -191,7 +191,9 @@ export default {
 			// 列表总数据
 			total: 0,
 			// 维修费用耗材明细列表
-			consumables: []
+			consumables: [],
+			// 当前操作的记录Id
+			recordId: ''
 		}
 	},
 	mounted() {
@@ -226,14 +228,19 @@ export default {
 					state: this.current - 0 + 1
 				}
 			})
-			console.log(res)
+			// console.log(res)
 			if (res.code === '200') {
 				this.list = [...this.list, ...res.data.list]
 				this.total = res.data.totalCount
 				// 当页面没有数据时,页面禁止滚动
 				if (this.list.length === 0) {
 					this.scrollY = false
+				} else {
+					this.scrollY = true
 				}
+			} else {
+				// 请求数据失败页面禁止滚动
+				this.scrollY = false
 			}
 		},
 
@@ -263,41 +270,88 @@ export default {
 		},
 
 		// 转后勤弹窗确定按钮回调
-		handleLogisticsConfirm() {
-			console.log(this.logisticsValue)
-			uni.showToast({
-				title: '留言成功',
-				icon: 'success'
+		async handleLogisticsConfirm() {
+			if (!this.logisticsValue) {
+				uni.showToast({
+					title: '留言不能为空',
+					icon: 'none'
+				})
+				return
+			}
+			const res = await this.$myRequest_repairs({
+				url: '/repairLeaveMessage/transferToLogistics',
+				method: 'post',
+				data: {
+					recordId: this.recordId,
+					userId: this.userId,
+					content: this.logisticsValue
+				}
 			})
-			this.$refs.popup_logistics[0].close()
+			// console.log(res)
+			if (res.code === '200') {
+				uni.showToast({
+					title: '转后勤成功',
+					icon: 'success'
+				})
+				this.$refs.popup_logistics[0].close()
+			} else {
+				uni.showToast({
+					title: res.message,
+					icon: 'fail'
+				})
+			}
 		},
 		// 催单按钮回调
-		handleExpedite() {
+		handleExpedite(id) {
 			uni.showModal({
 				title: '提示',
 				content: '确定催单吗?',
-				success: (res) => {
+				success: async (res) => {
 					if (res.confirm) {
-						uni.showToast({
-							title: '催单成功',
-							icon: 'success'
+						const res = await this.$myRequest_repairs({
+							url: '/repairRecord/repairRecordReminder',
+							data: {
+								recordId: id
+							}
 						})
+						// console.log(res)
+						if (res.code === '200') {
+							uni.showToast({
+								title: '催单成功',
+								icon: 'success'
+							})
+						}
 					}
 				}
 			})
 		},
 
 		// 撤销按钮回调
-		handleRepeal() {
+		handleRepeal(id) {
 			uni.showModal({
 				title: '提示',
 				content: '确定撤销吗?',
-				success: (res) => {
+				success: async (res) => {
 					if (res.confirm) {
-						uni.showToast({
-							title: '撤销成功',
-							icon: 'success'
+						const res = await this.$myRequest_repairs({
+							url: '/repairRecord/revokeRepairRecordById',
+							method: 'get',
+							data: {
+								id
+							}
 						})
+						// console.log(res)
+						if (res.code === '200') {
+							uni.showToast({
+								title: '撤销成功',
+								icon: 'success'
+							})
+							setTimeout(() => {
+								this.list = []
+								this.currentPage = 1
+								this.getRepairList()
+							}, 1500)
+						}
 					}
 				}
 			})
@@ -309,7 +363,8 @@ export default {
 			this.consumables = item.consumables
 		},
 		// 转后勤按钮回调
-		handleBackOffice() {
+		handleBackOffice(item) {
+			this.recordId = item.id
 			this.$refs.popup_logistics[0].open('center')
 		},
 		// 去评价按钮回调
@@ -338,6 +393,20 @@ export default {
 			uni.previewImage({
 				urls: img
 			})
+		},
+		// 点击支付按钮回调
+		async handlePay(item) {
+			console.log(item)
+			const res = await this.$myRequest_repairs({
+				url: '/repairPayRecord/repairPayment',
+				method: 'post',
+				data: {
+					recordId: item.id,
+					userId: this.userId,
+					price: item.price
+				}
+			})
+			console.log(res)
 		}
 	}
 }

+ 39 - 27
pagesRepairs/offer/offer.vue

@@ -6,12 +6,12 @@
 		<view class="detail_box" v-for="(item, index) in goodList" :key="index">
 			<view class="detail_box_item">
 				<view class="item_key">耗材名称</view>
-				<view class="item_value">{{ item.name }}</view>
+				<view class="item_value">{{ item.consumeName }}</view>
 			</view>
 			<view class="detail_box_item">
 				<view class="item_key">耗材数量</view>
 				<view class="item_value">
-					<uni-number-box v-model="item.num" :min="0" @change="bindChange($event, index)"></uni-number-box>
+					<uni-number-box v-model="item.number" :min="0" @change="bindChange($event, index)"></uni-number-box>
 				</view>
 			</view>
 			<view class="detail_box_item">
@@ -61,7 +61,9 @@ export default {
 			// 手机号码
 			phone: '',
 			// 耗材列表
-			goodList: []
+			goodList: [],
+			// 订单信息
+			info: {}
 		}
 	},
 	computed: {
@@ -69,7 +71,7 @@ export default {
 		countMoney() {
 			let countMoney = 0
 			this.goodList.forEach((ele) => {
-				countMoney += Number(ele.num) * Number(ele.price)
+				countMoney += Number(ele.number) * Number(ele.price)
 			})
 			if (countMoney) {
 				return countMoney
@@ -80,12 +82,13 @@ export default {
 	},
 	onLoad(options) {
 		// console.log(options)
-		let info = JSON.parse(decodeURIComponent(options.info))
-		this.worker = info.workerName
-		this.phone = info.workerPhone
+		this.info = JSON.parse(decodeURIComponent(options.info))
+		// console.log(this.info)
+		this.worker = this.info.maintenancerName
+		this.phone = this.info.maintenancerPhone
 		if (options.type) {
 			console.log('改价')
-			this.goodList = info.goodsList
+			this.goodList = this.info.goodsList
 			uni.setNavigationBarTitle({
 				title: '改价'
 			})
@@ -127,21 +130,29 @@ export default {
 			uni.showModal({
 				title: '提示',
 				content: '确认提交吗?',
-				success: (res) => {
+				success: async (res) => {
 					if (res.confirm) {
-						uni.showToast({
-							title: '提交成功',
-							icon: 'success'
+						const res = await this.$myRequest_repairs({
+							url: '/repairConsumables/insertMaintenanceConsumables',
+							method: 'post',
+							data: {
+								recordId: this.info.id,
+								totalPrice: this.countMoney,
+								consumes: this.goodList
+							}
 						})
-						setTimeout(() => {
-							uni.reLaunch({
-								url: '/pagesRepairs/box/box'
+						// console.log(res)
+						if (res.code === '200') {
+							uni.showToast({
+								title: '提交成功',
+								icon: 'success'
 							})
-						}, 1500)
-						console.log(this.goodList)
-						console.log(this.countMoney)
-						console.log(this.worker)
-						console.log(this.phone)
+							setTimeout(() => {
+								uni.reLaunch({
+									url: '/pagesRepairs/box/box'
+								})
+							}, 1500)
+						}
 					}
 				}
 			})
@@ -149,18 +160,19 @@ export default {
 		// 全局自定义事件
 		addConsumable(e) {
 			// console.log(e)
-
 			// 判断是否存在相同的耗材
 			let flag = this.goodList.some((ele) => {
-				return ele.name === e.data
+				return ele.consumeName === e.data.name
 			})
 
 			if (!flag) {
-				this.goodList.push({
-					name: e.data,
-					num: 1,
-					price: ''
-				})
+				this.$set(e.data, 'number', 1)
+				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.goodList.push(e.data)
 			}
 		},
 		// 耗材数量计数器改变回调

+ 129 - 94
pagesRepairs/pending/pending.vue

@@ -1,34 +1,34 @@
 <template>
-	<view class="container">
-		<view class="top_bg"></view>
-		<view class="body">
+	<scroll-view class="container" :scroll-y="scrollY" @scrolltolower="scrolltolower">
+		<view class="top_bg" v-if="dataList.length"></view>
+		<view class="body" v-if="dataList.length">
 			<!-- 每一个订单区域 -->
 			<view class="body_item" v-for="item in dataList" :key="item.id">
 				<!-- 工单编号 -->
 				<view class="item_title">
 					<img src="../../static/images/repairsImg/order.png" />
-					<view class="title_info">工单编号:{{ item.order }}</view>
+					<view class="title_info">工单编号:{{ item.recordNo }}</view>
 				</view>
 				<!-- 报修时间 -->
 				<view class="item_time">
 					<view class="time_msg">
 						报修时间:
-						<text>{{ item.time }}</text>
+						<text>{{ item.reportTime }}</text>
 					</view>
-					<view class="time_type">待接单</view>
+					<view class="time_type">{{ item.state }}</view>
 				</view>
 
 				<!-- 报修姓名 -->
 				<view class="item_box">
 					<view class="box_key">报修姓名:</view>
-					<view class="box_value">{{ item.name }}</view>
+					<view class="box_value">{{ item.userName }}</view>
 				</view>
 
 				<!-- 报修电话 -->
 				<view class="item_box">
 					<view class="box_key">报修电话:</view>
-					<view class="box_value phone" @click="handleCallPhone(item.phone)">
-						{{ item.phone }}
+					<view class="box_value phone" @click="handleCallPhone(item.userPhone)">
+						{{ item.userPhone }}
 						<img src="../../static/images/repairsImg/phone.png" />
 					</view>
 				</view>
@@ -36,7 +36,7 @@
 				<!-- 报修区域 -->
 				<view class="item_box">
 					<view class="box_key">报修区域:</view>
-					<view class="box_value">{{ item.area }}</view>
+					<view class="box_value">{{ item.areaName }}</view>
 				</view>
 
 				<!-- 详细地址 -->
@@ -48,7 +48,7 @@
 				<!-- 报修物品 -->
 				<view class="item_box">
 					<view class="box_key">报修物品:</view>
-					<view class="box_value">{{ item.goods }}</view>
+					<view class="box_value">{{ item.articleName }}</view>
 				</view>
 
 				<!-- 故障描述 -->
@@ -60,14 +60,14 @@
 				<!-- 上传图片 -->
 				<view class="item_img">
 					<view class="img_key">上传图片:</view>
-					<img class="img_value" mode="aspectFill" :src="item.img[0]" @click="handleLookImgs(item.img)" />
+					<img class="img_value" mode="aspectFill" :src="item.images[0]" @click="handleLookImgs(item.images)" />
 				</view>
 
 				<!-- 按钮区域 -->
 				<view class="item_btn">
-					<img src="../../static/images/repairsImg/close.png" @click="handleClose" />
-					<view class="btn_box type" v-if="btns.includes('延时')" @click="handleDelay">延时</view>
-					<view class="btn_box type" v-if="btns.includes('接单')" @click="handleOrderReceiving">接单</view>
+					<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>
 
@@ -78,10 +78,10 @@
 							:class="[{ active: activeIndex === index }, { radius: index === 0 }]"
 							class="close_box"
 							v-for="(ele, index) in closeList"
-							:key="index"
+							:key="ele.id"
 							@click="handleChangeItem(index)"
 						>
-							{{ ele }}
+							{{ ele.name }}
 						</view>
 						<view class="close_btn">
 							<view class="btn_box cancel" @click="$refs.popup_close[0].close()">取消</view>
@@ -91,107 +91,115 @@
 				</uni-popup>
 			</view>
 		</view>
-	</view>
+		<!-- 没有数据时展示的图片 -->
+		<view class="no_data" v-if="dataList.length === 0">
+			<img src="../../pagesClockIn/static/imgs/nodata.png" />
+			<view>暂无数据</view>
+		</view>
+	</scroll-view>
 </template>
 
 <script>
 export default {
 	data() {
 		return {
+			scrollY: true,
 			// 按钮权限
 			btns: [],
 			// 关闭按钮弹窗当前索引
 			activeIndex: 0,
 			// 关闭按钮弹窗选项数组
-			closeList: ['重复报单', '不属于维修范围', '已维修完成'],
+			closeList: [],
 			// 工单数据数组
-			dataList: [
-				{
-					id: 1,
-					order: '656262219626262',
-					overtime: true,
-					time: '2023.07.05  09:25:26',
-					type: 1,
-					name: '张三',
-					phone: '13659585689',
-					area: '行政楼',
-					address: '3楼309',
-					goods: '电脑',
-					description: '水龙头坏了',
-					img: [
-						'https://img1.baidu.com/it/u=920310517,1559263161&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
-						'https://13lz.cn/d/file/2021-06-12/f54cce5a0208c756c112407ec6ca1ac0.jpg',
-						'https://inews.gtimg.com/newsapp_bt/0/12555654161/1000'
-					]
-				},
-				{
-					id: 2,
-					order: '956262219626262',
-					overtime: false,
-					time: '2023.07.05  09:25:26',
-					type: 2,
-					name: '李四',
-					phone: '13659585689',
-					area: '行政楼',
-					address: '3楼309',
-					goods: '电脑',
-					description: '电脑坏了',
-					img: [
-						'https://img1.baidu.com/it/u=920310517,1559263161&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
-						'https://13lz.cn/d/file/2021-06-12/f54cce5a0208c756c112407ec6ca1ac0.jpg',
-						'https://inews.gtimg.com/newsapp_bt/0/12555654161/1000'
-					],
-					workerName: '老张',
-					workerPhone: '13659585689'
-				},
-				{
-					id: 3,
-					order: '956262219626262',
-					overtime: false,
-					time: '2023.07.05  09:25:26',
-					type: 3,
-					name: '李四',
-					phone: '13659585689',
-					area: '行政楼',
-					address: '3楼309',
-					goods: '电脑',
-					description: '电脑坏了',
-					img: [
-						'https://img1.baidu.com/it/u=920310517,1559263161&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
-						'https://13lz.cn/d/file/2021-06-12/f54cce5a0208c756c112407ec6ca1ac0.jpg',
-						'https://inews.gtimg.com/newsapp_bt/0/12555654161/1000'
-					],
-					workerName: '老张',
-					workerPhone: '13659585689',
-					money: 50
-				}
-			]
+			dataList: [],
+			// 当前页
+			currentPage: 1,
+			// 每页多少条
+			pageCount: 4,
+			// 总条数
+			total: null,
+			// 用户ID
+			userId: '',
+			// 订单id
+			orderId: ''
 		}
 	},
 	mounted() {
 		console.log('待处理池页面加载')
 		const repairsUserInfo = uni.getStorageSync('repairsUserInfo')
+		this.userId = repairsUserInfo.userId
 		this.btns = repairsUserInfo.btns
 		console.log(this.btns)
+		this.getData()
+		this.getCloseList()
 	},
 	methods: {
+		// 滚动到底部触发回调
+		scrolltolower() {
+			console.log('滚动到底部')
+			if (this.total > this.dataList.length) {
+				this.currentPage++
+				this.getData()
+			} else {
+				uni.showToast({
+					title: '没有更多数据了',
+					icon: 'none'
+				})
+			}
+		},
+		// 获取关闭订单原因数组
+		async getCloseList() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairClose/queryRepairCloses'
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.closeList = res.data
+			}
+		},
+		// 获取待处理订单数据
+		async getData() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairRecord/queryPendingOrder',
+				data: {
+					currentPage: this.currentPage,
+					pageCount: this.pageCount
+				}
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.total = res.data.totalCount
+				this.dataList = [...this.dataList, ...res.data.list]
+			}
+		},
 		// 接单按钮回调
-		handleOrderReceiving() {
+		handleOrderReceiving(item) {
 			uni.showModal({
 				content: '确定接单吗?',
 				title: '提示',
-				success: (res) => {
+				success: async (res) => {
 					if (res.confirm) {
-						uni.showToast({
-							title: '接单成功',
-							icon: 'success'
+						const res = await this.$myRequest_repairs({
+							url: '/repairRecord/receiveOrders',
+							data: {
+								recordId: item.id,
+								userId: this.userId
+							}
 						})
+						// console.log(res)
+						if (res.code === '200') {
+							uni.showToast({
+								title: '接单成功',
+								icon: 'success'
+							})
+						}
 					}
 				}
 			})
 		},
 		// 关闭图标点击回调
-		handleClose() {
+		handleClose(item) {
+			this.orderId = item.id
 			this.activeIndex = 0
 			this.$refs.popup_close[0].open('center')
 		},
@@ -200,14 +208,29 @@ export default {
 			uni.showModal({
 				title: '提示',
 				content: '确定关闭订单吗?',
-				success: (res) => {
+				success: async (res) => {
 					if (res.confirm) {
-						uni.showToast({
-							title: '关单成功',
-							icon: 'success'
+						const res = await this.$myRequest_repairs({
+							url: '/repairRecord/closeOrder',
+							data: {
+								recordId: this.orderId,
+								userId: this.userId,
+								reason: this.closeList[this.activeIndex].name
+							}
 						})
-						console.log(this.closeList[this.activeIndex])
-						this.$refs.popup_close[0].close()
+						// console.log(res)
+						if (res.code === '200') {
+							uni.showToast({
+								title: '关单成功',
+								icon: 'success'
+							})
+							this.$refs.popup_close[0].close()
+							setTimeout(() => {
+								this.dataList = []
+								this.currentPage = 1
+								this.getData()
+							}, 1500)
+						}
 					}
 				}
 			})
@@ -217,9 +240,9 @@ export default {
 			this.activeIndex = val
 		},
 		// 延时按钮回调
-		handleDelay() {
+		handleDelay(item) {
 			uni.navigateTo({
-				url: '/pagesRepairs/delay/delay'
+				url: `/pagesRepairs/delay/delay?id=${item.id}`
 			})
 		},
 		// 派单按钮回调
@@ -444,5 +467,17 @@ export default {
 			}
 		}
 	}
+
+	.no_data {
+		text-align: center;
+		color: #b3b3b3;
+		font-size: 24rpx;
+
+		img {
+			margin: 215rpx auto 0;
+			width: 480rpx;
+			height: 508rpx;
+		}
+	}
 }
 </style>

+ 82 - 61
pagesRepairs/repairRecord/repairRecord.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="container">
 		<view class="title">维修日期</view>
-		<uni-datetime-picker placeholder="请选择日期" type="date" v-model="repairDate" />
+		<uni-datetime-picker disabled placeholder="请选择日期" type="date" v-model="repairDate" />
 		<view class="title">维修内容</view>
 		<view class="textarea">
 			<textarea placeholder-style="color:#CCCCCC" placeholder="请输入维修内容" v-model="repairContent"></textarea>
@@ -30,35 +30,16 @@
 		</uni-popup>
 
 		<view class="title">关联耗材</view>
-
-		<!-- 每一个耗材盒子区域 -->
-		<!-- <view class="detail_box">
-			<view class="detail_box_item">
-				<view class="item_key">耗材名称</view>
-				<view class="item_value">螺丝钉</view>
-			</view>
-			<view class="detail_box_item">
-				<view class="item_key">耗材数量</view>
-				<view class="item_value">
-					<uni-number-box v-model="count" :min="0" @change="bindChange"></uni-number-box>
-				</view>
-			</view>
-			<view class="detail_box_item">
-				<view class="item_key">耗材单价</view>
-				<view class="item_value">0.5</view>
-			</view>
-		</view> -->
-
 		<!-- 每一个耗材盒子区域 -->
 		<view class="detail_box" v-for="(item, index) in goodList" :key="index">
 			<view class="detail_box_item">
 				<view class="item_key">耗材名称</view>
-				<view class="item_value">{{ item.name }}</view>
+				<view class="item_value">{{ item.consumeName }}</view>
 			</view>
 			<view class="detail_box_item">
 				<view class="item_key">耗材数量</view>
 				<view class="item_value">
-					<uni-number-box v-model="item.num" :min="0" @change="bindChange($event, index)"></uni-number-box>
+					<uni-number-box v-model="item.number" :min="0" @change="bindChange($event, index)"></uni-number-box>
 				</view>
 			</view>
 			<view class="detail_box_item">
@@ -85,14 +66,14 @@
 
 		<view class="box">
 			<img src="../../static/images/repairsImg/people.png" />
-			{{ worker }}
+			{{ info.maintenancerName }}
 		</view>
 
 		<view class="title">手机</view>
 
 		<view class="box">
 			<img src="../../static/images/repairsImg/phone2.png" />
-			{{ phone }}
+			{{ info.maintenancerPhone }}
 		</view>
 
 		<view class="title">现场拍照</view>
@@ -128,6 +109,8 @@
 
 <script>
 import recording from '../components/recording.vue'
+// 图片压缩方法
+import getLessLimitSizeImage from '../util/imageCompress.js'
 const innerAudioContext = uni.createInnerAudioContext()
 export default {
 	components: {
@@ -139,13 +122,8 @@ export default {
 			repairDate: '',
 			// 维修内容
 			repairContent: '',
-			// 维修师傅
-			worker: '张三',
-			// 手机号码
-			phone: '13659854589',
 			// 耗材列表
 			goodList: [],
-			count: 6,
 			// 显示的图片数据
 			imgList: [],
 			// 上传的图片数据
@@ -172,7 +150,9 @@ export default {
 			// 播放状态
 			playStatus: false,
 			// 定时器标识
-			timer: null
+			timer: null,
+			// 订单详情信息
+			info: {}
 		}
 	},
 	computed: {
@@ -180,7 +160,7 @@ export default {
 		countMoney() {
 			let countMoney = 0
 			this.goodList.forEach((ele) => {
-				countMoney += Number(ele.num) * Number(ele.price)
+				countMoney += Number(ele.number) * Number(ele.price)
 			})
 			if (countMoney) {
 				return countMoney
@@ -189,6 +169,10 @@ export default {
 			}
 		}
 	},
+	onLoad(options) {
+		this.info = JSON.parse(options.info)
+		this.getTodayTime()
+	},
 	mounted() {
 		//在ios下静音时播放没有声音,默认为true,改为false就好了。
 		uni.setInnerAudioOption({
@@ -197,6 +181,11 @@ export default {
 		uni.$on('addConsumable', this.addConsumable)
 	},
 	methods: {
+		// 获取今天日期 YY-MM-DD
+		getTodayTime() {
+			let today = new Date()
+			this.repairDate = `${today.getFullYear()}-${(today.getMonth() + 1).toString().padStart(2, 0)}-${today.getDate().toString().padStart(2, 0)}`
+		},
 		// 单价输入框输入回调
 		handleChangePrice(e, item) {
 			// 验证输入单价格式 只能是数字,小数点最多两位
@@ -213,32 +202,40 @@ export default {
 		// 全局自定义事件
 		addConsumable(e) {
 			// console.log(e)
-
 			// 判断是否存在相同的耗材
 			let flag = this.goodList.some((ele) => {
-				return ele.name === e.data
+				return ele.consumeName === e.data.name
 			})
 
 			if (!flag) {
-				this.goodList.push({
-					name: e.data,
-					num: 1,
-					price: ''
-				})
+				this.$set(e.data, 'number', 1)
+				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.goodList.push(e.data)
 			}
 		},
 		// 确认提交按钮回调
 		handleSub() {
-			if (!this.goodList.length) {
-				uni.showToast({
-					title: '请添加耗材',
-					icon: 'none'
-				})
-				return
-			}
-			if (this.countMoney <= 0) {
+			// if (!this.goodList.length) {
+			// 	uni.showToast({
+			// 		title: '请添加耗材',
+			// 		icon: 'none'
+			// 	})
+			// 	return
+			// }
+			// if (this.countMoney <= 0) {
+			// 	uni.showToast({
+			// 		title: '合计费用不能小于0元',
+			// 		icon: 'none'
+			// 	})
+			// 	return
+			// }
+			if (this.subImgList.length === 0) {
 				uni.showToast({
-					title: '合计费用不能小于0元',
+					title: '请上传现场照片',
 					icon: 'none'
 				})
 				return
@@ -246,25 +243,44 @@ export default {
 			uni.showModal({
 				title: '提示',
 				content: '确认提交吗?',
-				success: (res) => {
+				success: async (res) => {
 					if (res.confirm) {
-						console.log(this.repairDate)
+						// 维修内容
 						console.log(this.repairContent)
+						// 录音文件路径
 						console.log(this.recordingPath)
+						// 录音时长
+						console.log(this.recordingTime)
+						// 耗材集合
 						console.log(this.goodList)
+						// 总费用
 						console.log(this.countMoney)
-						console.log(this.worker)
-						console.log(this.phone)
+						// 现场拍照集合
 						console.log(this.subImgList)
-						uni.showToast({
-							title: '提交成功',
-							icon: 'success'
+						const res = await this.$myRequest_repairs({
+							url: '/repairRecord/finishOrder',
+							method: 'post',
+							data: {
+								recordId: this.info.id,
+								images: this.subImgList,
+								content: this.repairContent,
+								voice: this.recordingPath,
+								voiceLength: this.recordingTime,
+								consumes: this.goodList
+							}
 						})
-						setTimeout(() => {
-							uni.reLaunch({
-								url: '/pagesRepairs/box/box'
+						console.log(res)
+						if (res.code === '200') {
+							uni.showToast({
+								title: '提交成功',
+								icon: 'success'
 							})
-						}, 1500)
+							setTimeout(() => {
+								uni.reLaunch({
+									url: '/pagesRepairs/box/box'
+								})
+							}, 1500)
+						}
 					}
 				}
 			})
@@ -285,7 +301,7 @@ export default {
 		},
 		// 选择图片回调
 		select(e) {
-			console.log(e)
+			// console.log(e)
 			e.tempFiles.forEach((item) => {
 				//这里的id和页面中写的html代码的canvas的id要一致
 				let canvasId = 'zipCanvas'
@@ -301,11 +317,16 @@ export default {
 						title: '上传中'
 					})
 					uni.uploadFile({
-						url: `https://jiangxih3cpartner.com/reporting/file/fileUpDown`,
+						url: `https://chtech.ncjti.edu.cn/campusMaintenance/repair-api/repair/api/repairRecord/uploadFile`,
 						filePath: resPath,
 						name: 'file',
+						header: {
+							token: uni.getStorageSync('repairsUserInfo').token,
+							user_head: uni.getStorageSync('repairsUserInfo').userhead
+						},
 						success: (uploadFileRes) => {
-							this.subImgList.push(JSON.parse(uploadFileRes.data).data.join())
+							// console.log(JSON.parse(uploadFileRes.data))
+							this.subImgList.push(JSON.parse(uploadFileRes.data).data.resultUrl)
 							this.imgList.push({
 								url: item.path,
 								name: ''

+ 36 - 4
pagesRepairs/repairs/repairs.vue

@@ -2,7 +2,7 @@
 	<view class="container">
 		<!-- 公告区域 -->
 		<view class="notice">
-			<uni-notice-bar show-icon single speed="50" :scrollable="true" background-color="#fff" color="#000" :text="repairsNotice" />
+			<uni-notice-bar show-icon single speed="10" :scrollable="true" background-color="#fff" color="#000" :text="repairsNotice" />
 		</view>
 		<view class="gap"></view>
 
@@ -173,6 +173,8 @@ export default {
 			repairsNotice: '',
 			// 报修区域
 			repairsArea: '',
+			// 楼栋ID
+			buildId: null,
 			// 报修地址
 			repairsAddress: '',
 			// 报修物品
@@ -186,9 +188,9 @@ export default {
 			// 联系电话
 			repairsPhone: '',
 			// 紧急电话
-			urgencyPhone: '18320846714',
+			urgencyPhone: '',
 			// 服务电话
-			searchPhone: '18320846714',
+			searchPhone: '',
 			// 播放状态
 			playStatus: false,
 			// 定时器标识
@@ -223,8 +225,20 @@ export default {
 			obeyMuteSwitch: false
 		})
 		this.getRepairNotice()
+		this.getSetPhone()
 	},
 	methods: {
+		// 获取紧急电话和服务监督电话
+		async getSetPhone() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairSystemSetting/queryRepairSystemSetting'
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.urgencyPhone = res.data.emergencyCall
+				this.searchPhone = res.data.servicePhone
+			}
+		},
 		// 获取首页公告展示数据
 		async getRepairNotice() {
 			const res = await this.$myRequest_repairs({
@@ -249,15 +263,30 @@ export default {
 								url: '/repairRecord/insertRepairRecord',
 								method: 'post',
 								data: {
+									// 报修区域ID
 									areaId: this.repairsArea,
+									// 详细地址
 									address: this.repairsAddress,
+									// 报修物品ID
 									articleId: this.articleId,
+									// 故障描述
 									description: this.repairsDescription,
+									// 报修录音
 									voice: this.recordingPath,
+									// 报修录音时长
+									voiceLength: this.voiceLength,
+									// 故障图片集合
 									images: this.subImgList,
+									// 报修姓名
 									userName: this.repairsName,
+									// 报修电话
 									userPhone: this.repairsPhone,
-									userId: repairsUserInfo.userId
+									// 报修人ID
+									userId: repairsUserInfo.userId,
+									// 校区ID
+									schoolId: this.schoolId,
+									// 楼栋ID
+									buildId: this.buildId
 								}
 							})
 							// console.log(res)
@@ -278,6 +307,8 @@ export default {
 								this.subImgList = []
 								this.repairsName = ''
 								this.repairsPhone = ''
+								this.schoolId = null
+								this.buildId = null
 
 								// 不是用户报修的单,则跳转回首页
 								if (repairsUserInfo.routes.includes('首页')) {
@@ -360,6 +391,7 @@ export default {
 			console.log(e)
 			this.repairsArea = e.data
 			this.schoolId = e.schoolId
+			this.buildId = e.buildId
 		},
 		// 全局自定义事件
 		addRepairsGoods(e) {

+ 8 - 3
pagesRepairs/selectArea/selectArea.vue

@@ -34,8 +34,10 @@ export default {
 			items: [],
 			// 分段器当前索引
 			current: 0,
-			// 分段器当前索引ID
+			// 校区ID
 			schoolId: 0,
+			// 楼栋ID
+			buildId: null,
 			// 左边分类数组
 			leftList: [],
 			// 左边分类数组当前索引
@@ -80,6 +82,7 @@ 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
 			}
 		},
 		// 顶部分段器切换选项回调
@@ -97,6 +100,7 @@ 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) {
@@ -104,7 +108,8 @@ export default {
 			const repairsArea = this.items[this.current] + this.leftList[this.active_left] + this.rightList[this.active_right].name
 			uni.$emit('addRepairsArea', {
 				data: repairsArea,
-				schoolId: this.schoolId
+				schoolId: this.schoolId,
+				buildId: this.buildId
 			})
 			uni.navigateBack(1)
 		}
@@ -187,4 +192,4 @@ export default {
 ::v-deep .segmented-control {
 	height: 100rpx;
 }
-</style>
+</style>

+ 92 - 41
pagesRepairs/transferOrder/transferOrder.vue

@@ -4,23 +4,23 @@
 
 		<view class="box" v-if="type === '1'">
 			<img src="../../static/images/repairsImg/people.png" />
-			<view class="box_info">{{ applyPeople }}</view>
+			<view class="box_info">{{ info.userName }}</view>
 		</view>
 
 		<view class="title">转单语音说明</view>
 
 		<!-- 录音区域 -->
 		<view class="voice">
-			<view class="voice_box" v-if="!recordingPath" @click="handleRecording">
+			<view class="voice_box" v-if="!info.voice" @click="handleRecording">
 				<img src="../../static/images/repairsImg/voice.png" />
 			</view>
-			<view v-if="!recordingPath" @click="handleRecording">点击录音</view>
+			<view v-if="!info.voice" @click="handleRecording">点击录音</view>
 
-			<view class="item_recording" v-if="recordingPath" @click="handlePlayRecording">
+			<view class="item_recording" v-if="info.voice" @click="handlePlayRecording">
 				<img :src="recordingImg" />
-				{{ recordingTime }}″
+				{{ info.voiceLength || 0 }}″
 			</view>
-			<view class="recording_icon" v-if="recordingPath" @click="handleDeleteRecording">×</view>
+			<view class="recording_icon" v-if="info.voice && type !== '1'" @click="handleDeleteRecording">×</view>
 		</view>
 
 		<!-- 录音弹窗区域 -->
@@ -33,7 +33,7 @@
 		<view class="title">备注</view>
 
 		<view class="textarea">
-			<textarea placeholder-style="color:#CCCCCC" placeholder="请输入转单说明" v-model="desc"></textarea>
+			<textarea placeholder-style="color:#CCCCCC" placeholder="请输入转单说明" :disabled="type === '1'" v-model="info.remark"></textarea>
 		</view>
 
 		<view class="btn2" v-if="type === '1'">
@@ -53,21 +53,26 @@ export default {
 	},
 	data() {
 		return {
-			// 申请人
-			applyPeople: '张三',
+			// 页面类型
 			type: null,
-			// 备注输入框数据
-			desc: '',
-			// 录音文件路径
-			recordingPath: '',
 			// 录音图片地址
 			recordingImg: '../../static/images/repairsImg/recording.jpg',
-			// 录音时长
-			recordingTime: 0,
 			// 播放状态
 			playStatus: false,
 			// 定时器标识
-			timer: null
+			timer: null,
+			// 订单id
+			recordId: '',
+			info: {
+				// 申请人
+				userName: '',
+				// 语音地址
+				voice: '',
+				// 备注
+				remark: '',
+				// 语音时长
+				voiceLength: 0
+			}
 		}
 	},
 	mounted() {
@@ -80,54 +85,100 @@ export default {
 		console.log(options)
 		if (options.type) {
 			this.type = options.type
+			this.getData()
 		}
+		this.recordId = options.id
 	},
 	methods: {
+		// 获取转单审核详细数据
+		async getData() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairRecord/transferDetail',
+				data: {
+					recordId: this.recordId
+				}
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.info = res.data
+			}
+		},
 		// 拒绝按钮回调
 		handleRefuse() {
 			uni.showModal({
 				title: '提示',
 				content: '确定拒绝该审核吗?',
-				success: (res) => {
+				success: async (res) => {
 					if (res.confirm) {
-						uni.showToast({
-							title: '已拒绝该审核',
-							icon: 'none'
+						const res = await this.$myRequest_repairs({
+							url: '/repairRecord/transfer',
+							method: 'post',
+							data: {
+								id: this.info.id,
+								approverStatu: 0
+							}
 						})
-						setTimeout(() => {
-							uni.redirectTo({
-								url: '/pagesRepairs/box/box'
+						console.log(res)
+						if (res.code === '200') {
+							uni.showToast({
+								title: '已拒绝该审核',
+								icon: 'none'
 							})
-						}, 1500)
+							setTimeout(() => {
+								uni.reLaunch({
+									url: '/pagesRepairs/box/box'
+								})
+							}, 1500)
+						}
 					}
 				}
 			})
 		},
 		// 派单按钮回调
 		handleSendOrders() {
+			let info = JSON.stringify(this.info)
 			uni.navigateTo({
-				url: '/pagesRepairs/helpPeople/helpPeople?type=1'
+				url: `/pagesRepairs/helpPeople/helpPeople?type=2&id=${this.recordId}&info=${info}`
 			})
 		},
 		// 确认按钮回调
 		handleAffirm() {
+			if (!this.info.voice) {
+				uni.showToast({
+					title: '请录入转单语音说明',
+					icon: 'none'
+				})
+				return
+			}
 			uni.showModal({
 				title: '提示',
 				content: '确认提交转单申请吗?',
-				success: (res) => {
+				success: async (res) => {
 					if (res.confirm) {
-						console.log(this.recordingPath)
-						console.log(this.desc)
-						uni.showToast({
-							title: '提交转单申请成功,请等待管理员审核',
-							icon: 'none',
-							duration: 3000
+						const res = await this.$myRequest_repairs({
+							url: '/repairRecord/transferApply',
+							method: 'post',
+							data: {
+								recordId: this.recordId,
+								userId: uni.getStorageSync('repairsUserInfo').userId,
+								voice: this.info.voice,
+								voiceLength: this.info.voiceLength,
+								remark: this.info.remark
+							}
 						})
-						setTimeout(() => {
-							uni.redirectTo({
-								url: '/pagesRepairs/box/box'
+						console.log(res)
+						if (res.code === '200') {
+							uni.showToast({
+								title: '提交转单申请成功,请等待管理员审核',
+								icon: 'none',
+								duration: 3000
 							})
-						}, 3000)
+							setTimeout(() => {
+								uni.reLaunch({
+									url: '/pagesRepairs/box/box'
+								})
+							}, 3000)
+						}
 					}
 				}
 			})
@@ -180,7 +231,7 @@ export default {
 		},
 		// 点击录音播放回调
 		handlePlayRecording() {
-			innerAudioContext.src = this.recordingPath
+			innerAudioContext.src = this.info.voice
 			if (!this.playStatus) {
 				this.playStatus = true
 				innerAudioContext.play()
@@ -223,8 +274,8 @@ export default {
 					content: '确定删除录音吗?',
 					success: (res) => {
 						if (res.confirm) {
-							this.recordingPath = ''
-							this.recordingTime = 0
+							this.info.voice = ''
+							this.info.voiceLength = 0
 						}
 					}
 				})
@@ -232,8 +283,8 @@ export default {
 		},
 		// 自定义事件回调,获取录音文件路径
 		getTempFilePath(path, time) {
-			this.recordingPath = path
-			this.recordingTime = time
+			this.info.voice = path
+			this.info.voiceLength = time
 			this.$refs.popup_recording.close()
 		}
 	}

+ 2 - 1
pagesRepairs/util/api.js

@@ -21,8 +21,9 @@ export const myRequest_repairs = (options) => {
 						icon: 'none'
 					})
 				} else {
-					resolve(res.data)
+
 				}
+				resolve(res.data)
 			},
 			fail: (err) => {
 				uni.hideLoading();