Browse Source

校园报修添加转线下功能

xiaoxin 2 years ago
parent
commit
e0dda29d9d

+ 1 - 1
pages.json

@@ -246,7 +246,7 @@
 			}, {
 				"path": "transferOrder/transferOrder",
 				"style": {
-					"navigationBarTitleText": "转单审核",
+					"navigationBarTitleText": "转单审核-线上",
 					"disableScroll": true,
 					"navigationBarBackgroundColor": "#6FB6B8",
 					"navigationBarTextStyle": "white",

+ 11 - 10
pages/index/index.vue

@@ -7,18 +7,14 @@
 			<view class="menu">
 				<navigator :url="'/pages/reshui/reshui'" open-type="navigate" class="menu_item">
 					<image src="../../static/images/shower2x.png" mode=""></image>
-					<text>墨轩湖1-16栋</text>
+					<text>墨轩湖1-14栋</text>
 					<text>洗浴</text>
 				</navigator>
 				<navigator :url="'/pagesElectric/jiaofei/jiaofei?o=index'" open-type="navigate" class="menu_item">
 					<image src="../../static/images/recharge2x.png" mode=""></image>
-					<text>墨轩湖1-16栋</text>
+					<text>墨轩湖1-14栋</text>
 					<text>水电充值</text>
 				</navigator>
-				<!-- <navigator :url="'/pages/web/web'" open-type="navigate" class="menu_item">
-					<image src="../../static/images/1.png" mode=""></image>
-					<text>墨轩湖17-22栋水电充值</text>
-				</navigator> -->
 				<navigator :url="'/pagesAir/shareAir/shareAir'" open-type="navigate" class="menu_item">
 					<image src="../../static/images/air.png" mode=""></image>
 					<text>共享空调</text>
@@ -35,16 +31,21 @@
 					<image src="../../static/images/clockIn.png" mode=""></image>
 					<text>校园打卡</text>
 				</navigator>
+
+				<!-- <navigator :url="'/pages/web/web'" open-type="navigate" class="menu_item">
+					<image src="../../static/images/1.png" mode=""></image>
+					<text>课表</text>
+				</navigator> -->
 				<!-- <navigator :url="'/pagesClockIn/money/money'" open-type="navigate" class="menu_item">
 					<image src="../../static/images/money.png" mode=""></image>
 					<text>学费缴纳</text>
 				</navigator> -->
-				<view class="menu_item">
-					<text></text>
-				</view>
 				<!-- <view class="menu_item">
 					<text></text>
 				</view> -->
+				<view class="menu_item">
+					<text></text>
+				</view>
 			</view>
 		</view>
 		<view v-if="showLogin">
@@ -480,4 +481,4 @@ export default {
 		}
 	}
 }
-</style>
+</style>

File diff suppressed because it is too large
+ 1650 - 1650
pages/reshui/reshui.vue


+ 22 - 3
pages/web/web.vue

@@ -1,13 +1,32 @@
 <template>
-	<web-view src="https://chtech.ncjti.edu.cn/rxsd/wxms/"></web-view>
+	<web-view :src="webSrc"></web-view>
 </template>
 
 <script>
 export default {
 	data() {
-		return {}
+		return {
+			webSrc: ''
+		}
 	},
-	methods: {}
+	onLoad() {
+		const value = uni.getStorageSync('userinfo_storage_key')
+		if (value) {
+			const cardNumber = value.card_number
+			this.webSrc = `https://chtech.ncjti.edu.cn/classSchedule/#/?number=${cardNumber}`
+		} else {
+			uni.showToast({
+				title: '请授权后再查看课表',
+				icon: 'none',
+				duration: 2000
+			})
+			setTimeout(() => {
+				uni.reLaunch({
+					url: '/pages/index/index'
+				})
+			}, 2000)
+		}
+	}
 }
 </script>
 

+ 42 - 5
pagesRepairs/helpPeople/helpPeople.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>
@@ -35,11 +35,12 @@ export default {
 		return {
 			// 搜索框绑定数据
 			searchValue: '',
-			// 协作人列表
+			// 列表
 			list: [],
 			// 选中列表
 			checkList: [],
 			// 页面类型
+			// 空 为协作人列表 1 2 为派单人列表 3 为转线下员工列表
 			type: null,
 			// 订单id
 			recordId: '',
@@ -54,7 +55,11 @@ export default {
 			uni.setNavigationBarTitle({
 				title: '派单'
 			})
-			this.getData()
+			if (this.type === '3') {
+				this.getDataOffline()
+			} else {
+				this.getData()
+			}
 		} else {
 			this.getHelpData()
 		}
@@ -63,6 +68,25 @@ export default {
 		}
 	},
 	methods: {
+		// 获取转线下员工列表数组
+		async getDataOffline() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairUser/queryPageOfflineUsers',
+				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
+				})
+			}
+		},
 		// 获取协作人列表数组
 		async getHelpData() {
 			const res = await this.$myRequest_repairs({
@@ -142,10 +166,11 @@ export default {
 										})
 									}, 1500)
 								}
-							} else if (this.type === '2') {
+							} else if (this.type === '2' || this.type === '3') {
 								// 转单审核同意时重新派单
+								// 2为线上 3为线下
 								const res = await this.$myRequest_repairs({
-									url: '/repairRecord/transfer',
+									url: this.type === '2' ? '/repairRecord/transfer' : '/repairRecord/offline',
 									method: 'post',
 									data: {
 										id: this.info.id,
@@ -185,6 +210,18 @@ export default {
 				return item.checked
 			})
 			this.checkList = temList
+		},
+		handleSearch() {
+			this.list = []
+			if (this.type) {
+				if (this.type === '3') {
+					this.getDataOffline()
+				} else {
+					this.getData()
+				}
+			} else {
+				this.getHelpData()
+			}
 		}
 	}
 }

+ 16 - 4
pagesRepairs/home/home.vue

@@ -2,7 +2,7 @@
 	<view class="container">
 		<view class="top_bg"></view>
 
-		<!-- 状态统计区域 后勤管理端 -->
+		<!-- 状态统计区域 管理端 -->
 		<view class="top_types2" v-if="btns.includes('首页分段器')">
 			<view class="top">
 				<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text" activeColor="#6FB6B8"></uni-segmented-control>
@@ -25,10 +25,14 @@
 					<view class="box_num">{{ timeoutCount }}</view>
 					<view class="box_info">已超时</view>
 				</view>
+				<view class="bottom_box">
+					<view class="box_num">{{ offlineCount }}</view>
+					<view class="box_info">转线下</view>
+				</view>
 			</view>
 		</view>
 
-		<!-- 状态统计区域 维修师傅端 -->
+		<!-- 状态统计区域 后勤 维修师傅端 -->
 		<view class="top_types" v-else>
 			<view class="types_box">
 				<view class="box_num">{{ workCount }}</view>
@@ -39,6 +43,10 @@
 				<view class="box_num">{{ processCount }}</view>
 				<view class="box_info">处理中</view>
 			</view>
+			<view class="types_box" v-if="btns.includes('分段器按钮')">
+				<view class="box_num">{{ offlineCount }}</view>
+				<view class="box_info">转线下</view>
+			</view>
 			<view class="types_box">
 				<view class="box_num">{{ finishCount }}</view>
 				<view class="box_info">已完成</view>
@@ -112,7 +120,7 @@
 			</view>
 			<!-- 排行榜柱状图 -->
 			<view class="rank_charts">
-				<!-- 加上canvas2d属性后 模拟器上图表显示异常,真机调试没有问题,开发时不添加canvas2d属性,发布时添加canvas2d属性 -->
+				<!-- 加上canvas2d属性后 模拟器上图表显示异常,真机没有问题,开发时不添加canvas2d属性,发布时添加canvas2d属性 -->
 				<qiun-data-charts canvas2d type="bar" :opts="opts" :chartData="chartData" />
 			</view>
 		</view>
@@ -178,7 +186,7 @@ export default {
 						activeBgOpacity: 0.08,
 						linearType: 'custom',
 						barBorderCircle: true,
-						seriesGap: 2
+						seriesGap: 0
 					}
 				}
 			},
@@ -194,6 +202,8 @@ export default {
 			finishCount: '',
 			// 已超时单数
 			timeoutCount: '',
+			// 转线下
+			offlineCount: '',
 			// 当前页
 			currentPage: 1,
 			// 每页多少条数据
@@ -289,6 +299,7 @@ export default {
 				this.processCount = res.data.processCount
 				this.finishCount = res.data.finishCount
 				this.timeoutCount = res.data.timeoutCount
+				this.offlineCount = res.data.offlineCount
 			}
 		},
 		// 获取个人数据统计单数
@@ -305,6 +316,7 @@ export default {
 				this.processCount = res.data.processCount
 				this.finishCount = res.data.finishCount
 				this.timeoutCount = res.data.timeoutCount
+				this.offlineCount = res.data.offlineCount
 			}
 		},
 		// 是否值班弹窗确定按钮回调

+ 1 - 1
pagesRepairs/index/index.vue

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

+ 69 - 14
pagesRepairs/management/management.vue

@@ -25,6 +25,12 @@
 					<view class="box_num">{{ examineCount }}</view>
 					<view class="box_info">待审核</view>
 				</view>
+
+				<view class="bottom_box" :class="{ active: state === 8 }" v-if="current === 0" @click="handleFilter(8)">
+					<view class="box_num">{{ offlineCount }}</view>
+					<view class="box_info">转线下</view>
+				</view>
+
 				<view class="bottom_box" :class="{ active: state === 5 }" v-if="current === 0" @click="handleFilter(5)">
 					<view class="box_num">{{ finishedCount }}</view>
 					<view class="box_info">已完成</view>
@@ -61,6 +67,11 @@
 				<view class="box_info">待处理</view>
 			</view>
 
+			<view class="types_box" v-if="btns.includes('分段器按钮')" :class="{ active: state === 8 }" @click="handleFilter(8)">
+				<view class="box_num">{{ offlineCount }}</view>
+				<view class="box_info">转线下</view>
+			</view>
+
 			<view class="types_box" v-if="btns.includes('分段器按钮')" :class="{ active: state === 5 }" @click="handleFilter(5)">
 				<view class="box_num">{{ finishedCount }}</view>
 				<view class="box_info">已完成</view>
@@ -90,12 +101,15 @@
 					<view class="time_type" v-if="item.state === '待接单'">待接单</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 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 color_type2" v-if="item.state === '待审核'">待审核</view>
 					<view class="time_type color_type3" v-if="item.state === '已完成'">已完成</view>
 					<view class="time_type" v-if="item.state === '待确认'">待确认</view>
 					<view class="time_type color_type4" v-if="item.state === '已关单'">已关单</view>
+					<view class="time_type color_type4" v-if="item.state === '已取消'">已取消</view>
+					<view class="time_type color_type" v-if="item.state === '转线下'">转线下</view>
 				</view>
 
 				<!-- 报修姓名 -->
@@ -193,9 +207,20 @@
 					<!-- 关闭按钮 -->
 					<img v-if="item.state === '待接单'" src="../../static/images/repairsImg/close.png" @click.stop="handleClose(item)" />
 					<!-- 协作按钮 -->
-					<img class="img" src="../../static/images/repairsImg/help.png" v-if="item.state === '待接单' && btns.includes('协作')" @click.stop="handleHelp(item)" />
+					<img
+						class="img"
+						src="../../static/images/repairsImg/help.png"
+						v-if="item.state === '待接单' && btns.includes('协作') && (!btns.includes('首页分段器') || current === 1)"
+						@click.stop="handleHelp(item)"
+					/>
 					<!-- 延时按钮 -->
-					<view class="btn_box type" v-if="(item.state === '待接单' || item.state === '维修中') && btns.includes('延时')" @click.stop="handleDelay(item)">延时</view>
+					<view
+						class="btn_box type"
+						v-if="(item.state === '待接单' || item.state === '维修中') && btns.includes('延时') && current === 0"
+						@click.stop="handleDelay(item)"
+					>
+						延时
+					</view>
 					<!-- 接单按钮 -->
 					<view
 						class="btn_box type"
@@ -204,16 +229,28 @@
 					>
 						接单
 					</view>
-					<!-- 转单按钮 -->
-					<view class="btn_box type2" v-if="item.state === '待接单' && btns.includes('转单')" @click.stop="handleTransferOrder(item)">转单</view>
+					<!-- 转单操作按钮 -->
+					<view
+						class="btn_box type2"
+						v-if="(item.state === '待接单' || item.state === '维修中') && btns.includes('转单') && (!btns.includes('首页分段器') || current === 1)"
+						@click.stop="handleTransferOrder(item)"
+					>
+						转单操作
+					</view>
 					<!-- 派单按钮 -->
-					<!-- <view class="btn_box type2" v-if="item.state === '待接单' && btns.includes('派单')" @click.stop="handleSendOrder(item)">派单</view> -->
+					<view class="btn_box type2" v-if="item.state === '待接单' && btns.includes('派单') && current === 0" @click.stop="handleSendOrder(item)">派单</view>
 					<!-- 报价按钮 -->
 					<view class="btn_box type" v-if="!item.price && item.state === '维修中' && btns.includes('报价')" @click.stop="handleOffer(item)">报价</view>
 					<!-- 维修完成按钮 -->
 					<view class="btn_box type2" v-if="item.state === '维修中' && btns.includes('维修完成')" @click.stop="handleFinish(item)">维修完成</view>
 					<!-- 审核按钮 -->
-					<view class="btn_box type" v-if="(item.state === '协作审核' || item.state === '转单审核') && btns.includes('审核')" @click.stop="handleAudit(item)">审核</view>
+					<view
+						class="btn_box type"
+						v-if="(item.state === '协作待审核' || item.state === '转单待审核' || item.state === '转线下待审核') && btns.includes('审核')"
+						@click.stop="handleAudit(item)"
+					>
+						审核
+					</view>
 					<!-- 改价按钮 -->
 					<view class="btn_box type" v-if="item.state === '待处理'" @click.stop="handleChangeOffer(item)">改价</view>
 					<!-- 留言按钮 -->
@@ -361,6 +398,8 @@ export default {
 			timeoutCount: '',
 			// 已关单
 			closedCount: '',
+			// 转线下单
+			offlineCount: '',
 			// 当前页
 			currentPage: 1,
 			// 每页多少条
@@ -496,6 +535,7 @@ export default {
 				this.timeoutCount = res.data.timeoutCount
 				this.closedCount = res.data.closedCount
 				this.logisticsCount = res.data.logisticsCount
+				this.offlineCount = res.data.offlineCount
 			}
 		},
 		// 获取团队订单数据
@@ -549,6 +589,7 @@ export default {
 		},
 		// 关闭弹窗取消按钮回调
 		handleCloseCancel() {
+			this.activeIndex = 0
 			this.recordingPath = ''
 			this.recordingTime = 0
 			this.closeNote = ''
@@ -594,7 +635,7 @@ export default {
 								icon: 'success',
 								mask: true
 							})
-							this.$refs.popup_close.close()
+							this.handleCloseCancel()
 							setTimeout(() => {
 								this.handleResetData()
 							}, 1500)
@@ -649,7 +690,6 @@ export default {
 		// 关闭图标点击回调
 		handleClose(item) {
 			this.orderId = item.id
-			this.activeIndex = 0
 			this.$refs.popup_close.open('center')
 		},
 		// 关闭按钮弹窗选中按钮时回调
@@ -679,8 +719,19 @@ export default {
 		},
 		// 转单按钮回调
 		handleTransferOrder(item) {
-			uni.navigateTo({
-				url: `/pagesRepairs/transferOrder/transferOrder?id=${item.id}`
+			uni.showActionSheet({
+				itemList: ['转线上', '转线下'],
+				success: (res) => {
+					if (res.tapIndex === 0) {
+						uni.navigateTo({
+							url: `/pagesRepairs/transferOrder/transferOrder?id=${item.id}`
+						})
+					} else if (res.tapIndex === 1) {
+						uni.navigateTo({
+							url: `/pagesRepairs/transferOrder/transferOrder?id=${item.id}&mode=1`
+						})
+					}
+				}
 			})
 		},
 		// 协作图标点击回调
@@ -726,11 +777,15 @@ export default {
 		},
 		// 审核按钮回调
 		handleAudit(item) {
-			if (item.state === '转单审核') {
+			if (item.state === '转单审核') {
 				uni.navigateTo({
 					url: `/pagesRepairs/transferOrder/transferOrder?type=1&id=${item.id}`
 				})
-			} else if (item.state === '协作审核') {
+			} else if (item.state === '转线下待审核') {
+				uni.navigateTo({
+					url: `/pagesRepairs/transferOrder/transferOrder?type=2&id=${item.id}`
+				})
+			} else if (item.state === '协作待审核') {
 				uni.navigateTo({
 					url: `/pagesRepairs/help/help?type=1&id=${item.id}`
 				})

+ 5 - 2
pagesRepairs/myRepairs/myRepairs.vue

@@ -24,8 +24,11 @@
 					</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 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 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>

+ 326 - 34
pagesRepairs/pending/pending.vue

@@ -85,30 +85,46 @@
 
 			<!-- 关闭按钮弹窗 -->
 			<uni-popup ref="popup_close" :is-mask-click="false">
-				<view class="popup_close" @click.stop="">
-					<view
-						:class="[{ active: activeIndex === index }, { radius: index === 0 }]"
-						class="close_box"
-						v-for="(ele, index) in closeList"
-						:key="ele.id"
-						@click="handleChangeItem(index)"
-					>
-						{{ ele.name }}
+				<view class="popup_close">
+					<view class="close_reason">
+						关单原因:
+						<picker @change="bindPickerChange" :value="activeIndex" :range="closeList" range-key="name">
+							<view class="picker_input">
+								{{ closeList[activeIndex].name }}
+								<img src="../../static/images/repairsImg/bottom.png" />
+							</view>
+						</picker>
 					</view>
-					<view class="close_btn">
-						<view
-							class="btn_box cancel"
-							@click="
-								$refs.popup_close.close()
-								isClick = false
-							"
-						>
-							取消
+
+					<view class="close_note">备注(二选一):</view>
+
+					<view class="close_voice">
+						<view class="voice_box" v-if="!recordingPath" @click="handleRecording">
+							<img src="../../static/images/repairsImg/voice.png" />
 						</view>
+						<view v-if="!recordingPath" @click="handleRecording">点击录音</view>
+						<view class="item_recording" v-if="recordingPath" @click="handlePlayRecordingPop">
+							<img :src="recordingImg" />
+							{{ recordingTime }}″
+						</view>
+						<view class="recording_icon" v-if="recordingPath" @click="handleDeleteRecording">×</view>
+					</view>
+
+					<textarea class="close_input" placeholder-style="color:#CCCCCC" placeholder="请输入备注" v-model="closeNote"></textarea>
+
+					<view class="close_btn">
+						<view class="btn_box cancel" @click="handleCloseCancel">取消</view>
 						<view class="btn_box confirm" @click="handleCloseConfirm">确定</view>
 					</view>
 				</view>
 			</uni-popup>
+
+			<!-- 录音弹窗区域 -->
+			<uni-popup :safe-area="true" background-color="#fff" ref="popup_recording">
+				<view class="popup_recording">
+					<recording @getTempFilePath="getTempFilePath" />
+				</view>
+			</uni-popup>
 		</view>
 		<!-- 没有数据时展示的图片 -->
 		<view class="no_data" v-if="dataList.length === 0">
@@ -119,8 +135,12 @@
 </template>
 
 <script>
+import recording from '../components/recording.vue'
 const innerAudioContext = uni.createInnerAudioContext()
 export default {
+	components: {
+		recording
+	},
 	data() {
 		return {
 			scrollY: true,
@@ -145,7 +165,19 @@ export default {
 			// 校区Id
 			schoolId: '',
 			// 每一个订单点击时是否触发事件 true 不触发  false 触发
-			isClick: false
+			isClick: false,
+			// 关闭订单备注
+			closeNote: '',
+			// 录音文件路径
+			recordingPath: '',
+			// 录音时长
+			recordingTime: 0,
+			// 录音图片地址
+			recordingImg: '../../static/images/repairsImg/recording.jpg',
+			// 播放状态
+			playStatus: false,
+			// 定时器标识
+			timer: null
 		}
 	},
 	mounted() {
@@ -233,11 +265,26 @@ export default {
 		handleClose(item) {
 			this.isClick = true
 			this.orderId = item.id
-			this.activeIndex = 0
 			this.$refs.popup_close.open('center')
 		},
 		// 关闭弹窗确定按钮回调
 		handleCloseConfirm() {
+			if (this.closeNote && this.recordingPath) {
+				uni.showToast({
+					title: '录音和备注二选一,不能同时选择',
+					icon: 'none',
+					mask: true
+				})
+				return
+			}
+			if (!this.closeNote && !this.recordingPath) {
+				uni.showToast({
+					title: '请录音或者输入备注,二选一',
+					icon: 'none',
+					mask: true
+				})
+				return
+			}
 			uni.showModal({
 				title: '提示',
 				content: '确定关闭订单吗?',
@@ -248,7 +295,9 @@ export default {
 							data: {
 								recordId: this.orderId,
 								userId: this.userId,
-								reason: this.closeList[this.activeIndex].name
+								reason: this.closeList[this.activeIndex].name,
+								remark: this.recordingPath ? this.recordingPath : this.closeNote,
+								voiceLength: this.recordingPath ? this.recordingTime : ''
 							}
 						})
 						// console.log(res)
@@ -258,7 +307,7 @@ export default {
 								icon: 'success',
 								mask: true
 							})
-							this.$refs.popup_close.close()
+							this.handleCloseCancel()
 							setTimeout(() => {
 								this.dataList = []
 								this.currentPage = 1
@@ -326,6 +375,123 @@ export default {
 			uni.navigateTo({
 				url: `/pagesRepairs/repairDetails/repairDetails?id=${item.id}`
 			})
+		},
+		// 关闭按钮弹窗选中按钮时回调
+		bindPickerChange(e) {
+			this.activeIndex = e.detail.value
+		},
+		// 点击录音按钮回调
+		handleRecording() {
+			uni.getSetting({
+				success: (res) => {
+					if (!res.authSetting['scope.record']) {
+						uni.authorize({
+							scope: 'scope.record',
+							success(res) {
+								// 授权成功
+								uni.showToast({
+									title: '授权成功',
+									icon: 'none'
+								})
+							},
+							fail() {
+								uni.showModal({
+									content: '检测到您没打开麦克风权限,是否去设置打开?',
+									confirmText: '确认',
+									cancelText: '取消',
+									success: (res) => {
+										if (res.confirm) {
+											uni.openSetting({
+												success: (res) => {}
+											})
+										} else {
+											uni.showToast({
+												title: '获取麦克风权限失败',
+												icon: 'none'
+											})
+										}
+									}
+								})
+							}
+						})
+					} else {
+						this.$refs.popup_recording.open('bottom')
+					}
+				},
+				fail() {
+					uni.showToast({
+						title: '获取麦克风权限失败',
+						icon: 'none'
+					})
+				}
+			})
+		},
+		// 点击录音播放回调
+		handlePlayRecordingPop() {
+			innerAudioContext.src = this.recordingPath
+			if (!this.playStatus) {
+				this.playStatus = true
+				innerAudioContext.play()
+
+				this.timer = setInterval(() => {
+					if (this.recordingImg == '../../static/images/repairsImg/recording.jpg') {
+						this.recordingImg = '../../static/images/repairsImg/recording2.jpg'
+					} else if (this.recordingImg == '../../static/images/repairsImg/recording2.jpg') {
+						this.recordingImg = '../../static/images/repairsImg/recording3.jpg'
+					} else if (this.recordingImg == '../../static/images/repairsImg/recording3.jpg') {
+						this.recordingImg = '../../static/images/repairsImg/recording.jpg'
+					}
+				}, 300)
+
+				//播放结束
+				innerAudioContext.onEnded(() => {
+					clearInterval(this.timer)
+					this.timer = null
+					this.recordingImg = '../../static/images/repairsImg/recording.jpg'
+					this.playStatus = false
+				})
+			} else {
+				clearInterval(this.timer)
+				this.recordingImg = '../../static/images/repairsImg/recording.jpg'
+				this.playStatus = false
+				innerAudioContext.stop()
+			}
+		},
+		// 删除录音回调
+		handleDeleteRecording() {
+			if (this.playStatus) {
+				uni.showToast({
+					title: '播放中不能删除',
+					icon: 'none',
+					mask: true
+				})
+			} else {
+				uni.showModal({
+					title: '提示',
+					content: '确定删除录音吗?',
+					success: (res) => {
+						if (res.confirm) {
+							this.recordingPath = ''
+							this.recordingTime = 0
+						}
+					}
+				})
+			}
+		},
+		// 关闭弹窗取消按钮回调
+		handleCloseCancel() {
+			this.isClick = false
+			this.activeIndex = 0
+			this.recordingPath = ''
+			this.recordingTime = 0
+			this.closeNote = ''
+			this.$refs.popup_close.close()
+		},
+		// 自定义事件回调,获取录音文件路径
+		getTempFilePath(path, time) {
+			this.recordingPath = path
+			this.recordingTime = time
+			this.$refs.popup_recording.close()
 		}
 	}
 }
@@ -499,25 +665,145 @@ export default {
 		}
 
 		.popup_close {
+			// width: 690rpx;
+			// border-radius: 19rpx;
+			// background-color: #fff;
+
+			// .close_box {
+			// 	height: 100rpx;
+			// 	line-height: 100rpx;
+			// 	text-align: center;
+			// 	font-size: 32rpx;
+			// 	border: 1rpx solid #e6e6e6;
+			// }
+
+			// .radius {
+			// 	border-radius: 19rpx 19rpx 0 0;
+			// }
+
+			// .active {
+			// 	color: #fff;
+			// 	background-color: #6fb6b8;
+			// }
+
+			// .close_btn {
+			// 	display: flex;
+			// 	align-items: center;
+			// 	justify-content: space-evenly;
+			// 	margin-top: 100rpx;
+			// 	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;
+			// 	}
+			// }
+
 			width: 690rpx;
 			border-radius: 19rpx;
 			background-color: #fff;
 
-			.close_box {
-				height: 100rpx;
-				line-height: 100rpx;
-				text-align: center;
-				font-size: 32rpx;
-				border: 1rpx solid #e6e6e6;
+			.close_reason {
+				padding-top: 50rpx;
+				margin-left: 80rpx;
+				display: flex;
+				align-items: center;
+
+				.picker_input {
+					display: flex;
+					justify-content: space-between;
+					align-items: center;
+					padding: 10rpx 20rpx;
+					width: 300rpx;
+					border-radius: 14rpx;
+					border: 1rpx solid #e6e6e6;
+
+					img {
+						width: 40rpx;
+						height: 40rpx;
+					}
+				}
 			}
 
-			.radius {
-				border-radius: 19rpx 19rpx 0 0;
+			.close_note {
+				margin: 20rpx 0 20rpx 80rpx;
 			}
 
-			.active {
-				color: #fff;
-				background-color: #6fb6b8;
+			.close_voice {
+				display: flex;
+				align-items: center;
+				margin-top: 30rpx;
+				margin-left: 80rpx;
+				width: 500rpx;
+				height: 94rpx;
+				font-size: 32rpx;
+				color: #cccccc;
+				border-radius: 10rpx;
+				border: 1rpx solid #cccccc;
+
+				.voice_box {
+					display: flex;
+					justify-content: center;
+					align-items: center;
+					margin: 0 38rpx 0 33rpx;
+					width: 101rpx;
+					height: 47rpx;
+					border-radius: 33rpx;
+					box-shadow: 0px 0px 4rpx rgba(0, 0, 0, 0.25);
+
+					img {
+						width: 33rpx;
+						height: 33rpx;
+					}
+				}
+
+				.item_recording {
+					margin-left: 35rpx;
+					display: flex;
+					align-items: center;
+					width: 230rpx;
+					height: 65rpx;
+					color: #000;
+					border-radius: 100rpx;
+					border: 1rpx solid #cccccc;
+
+					img {
+						margin: 0 12rpx;
+						width: 40rpx;
+						height: 40rpx;
+					}
+				}
+
+				.recording_icon {
+					margin-left: auto;
+					margin-right: 35rpx;
+					font-size: 40rpx;
+				}
+			}
+
+			.close_input {
+				box-sizing: border-box;
+				margin: 35rpx 40rpx 35rpx 80rpx;
+				padding: 20rpx;
+				width: 520rpx;
+				height: 312rpx;
+				border-radius: 14rpx;
+				border: 1rpx solid #e6e6e6;
 			}
 
 			.close_btn {
@@ -549,6 +835,12 @@ export default {
 			}
 		}
 
+		.popup_recording {
+			width: 100%;
+			height: 460rpx;
+			background-color: #fff;
+		}
+
 		.body_events {
 			pointer-events: none;
 		}
@@ -566,4 +858,4 @@ export default {
 		}
 	}
 }
-</style>
+</style>

+ 43 - 11
pagesRepairs/transferOrder/transferOrder.vue

@@ -1,8 +1,8 @@
 <template>
 	<view class="container">
-		<view class="title" v-if="type === '1'">申请人</view>
+		<view class="title" v-if="type">申请人</view>
 
-		<view class="box" v-if="type === '1'">
+		<view class="box" v-if="type">
 			<img src="../../static/images/repairsImg/people.png" />
 			<view class="box_info">{{ info.userName }}</view>
 		</view>
@@ -20,7 +20,7 @@
 				<img :src="recordingImg" />
 				{{ info.voiceLength || 0 }}″
 			</view>
-			<view class="recording_icon" v-if="info.voice && type !== '1'" @click="handleDeleteRecording">×</view>
+			<view class="recording_icon" v-if="info.voice && !type" @click="handleDeleteRecording">×</view>
 		</view>
 
 		<!-- 录音弹窗区域 -->
@@ -33,10 +33,10 @@
 		<view class="title">备注</view>
 
 		<view class="textarea">
-			<textarea placeholder-style="color:#CCCCCC" :placeholder="type === '1' ? '无备注' : '请输入转单说明'" :disabled="type === '1'" v-model="info.remark"></textarea>
+			<textarea placeholder-style="color:#CCCCCC" :placeholder="type ? '无备注' : '请输入转单说明'" :disabled="type" v-model="info.remark"></textarea>
 		</view>
 
-		<view class="btn2" v-if="type === '1'">
+		<view class="btn2" v-if="type">
 			<view class="btn_box type" @click="handleRefuse">拒绝</view>
 			<view class="btn_box type2" @click="handleSendOrders">派单</view>
 		</view>
@@ -54,7 +54,10 @@ export default {
 	data() {
 		return {
 			// 页面类型
+			// 空 代表转单申请 1 代表线上转单审核 2 代表线下转单审核
 			type: null,
+			// 空 代表转线上 1 代表转线下
+			mode: null,
 			// 录音图片地址
 			recordingImg: '../../static/images/repairsImg/recording.jpg',
 			// 播放状态
@@ -85,11 +88,27 @@ export default {
 		this.recordId = options.id
 		if (options.type) {
 			this.type = options.type
-			this.getData()
+			if (this.type === '1') {
+				uni.setNavigationBarTitle({
+					title: '转单审核-线上'
+				})
+				this.getData()
+			} else if (this.type === '2') {
+				uni.setNavigationBarTitle({
+					title: '转单审核-线下'
+				})
+				this.getDataOffline()
+			}
+		}
+		if (options.mode) {
+			this.mode = options.mode
+			uni.setNavigationBarTitle({
+				title: '转单审核-线下'
+			})
 		}
 	},
 	methods: {
-		// 获取转单审核详细数据
+		// 获取转单审核详细数据-线上
 		async getData() {
 			const res = await this.$myRequest_repairs({
 				url: '/repairRecord/transferDetail',
@@ -102,6 +121,19 @@ export default {
 				this.info = res.data
 			}
 		},
+		// 获取转单审核详细数据-线下
+		async getDataOffline() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairRecord/offlineDetail',
+				data: {
+					recordId: this.recordId
+				}
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.info = res.data
+			}
+		},
 		// 拒绝按钮回调
 		handleRefuse() {
 			uni.showModal({
@@ -120,7 +152,7 @@ export default {
 							}, 1500)
 						} else {
 							const result = await this.$myRequest_repairs({
-								url: '/repairRecord/transfer',
+								url: this.type === '1' ? '/repairRecord/transfer' : '/repairRecord/offline',
 								method: 'post',
 								data: {
 									id: this.info.id,
@@ -149,7 +181,7 @@ export default {
 		handleSendOrders() {
 			let info = JSON.stringify(this.info)
 			uni.navigateTo({
-				url: `/pagesRepairs/helpPeople/helpPeople?type=2&id=${this.recordId}&info=${info}`
+				url: `/pagesRepairs/helpPeople/helpPeople?type=${this.type === '1' ? '2' : '3'}&id=${this.recordId}&info=${info}`
 			})
 		},
 		// 确认按钮回调
@@ -167,7 +199,7 @@ export default {
 				success: async (res) => {
 					if (res.confirm) {
 						const res = await this.$myRequest_repairs({
-							url: '/repairRecord/transferApply',
+							url: this.mode ? '/repairRecord/offlineApply' : '/repairRecord/transferApply',
 							method: 'post',
 							data: {
 								recordId: this.recordId,
@@ -448,4 +480,4 @@ export default {
 		}
 	}
 }
-</style>
+</style>