management.vue 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178
  1. <template>
  2. <scroll-view class="container" :scroll-y="scrollY" @scrolltolower="scrolltolower">
  3. <view class="top_bg"></view>
  4. <!-- 状态统计区域 管理者端 -->
  5. <view class="top_types2" v-if="btns.includes('工单管理分段器')">
  6. <view class="top">
  7. <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text" activeColor="#6FB6B8"></uni-segmented-control>
  8. </view>
  9. <view class="bottom">
  10. <view class="bottom_box" :class="{ active: state === 1 }" @click="handleFilter(1)">
  11. <view class="box_num">{{ receivingCount }}</view>
  12. <view class="box_info">待接单</view>
  13. </view>
  14. <view class="bottom_box" :class="{ active: state === 2 }" @click="handleFilter(2)">
  15. <view class="box_num">{{ maintenanceCount }}</view>
  16. <view class="box_info">维修中</view>
  17. </view>
  18. <view class="bottom_box" :class="{ active: state === 3 }" @click="handleFilter(3)">
  19. <view class="box_num">{{ timeoutCount }}</view>
  20. <view class="box_info">已超时</view>
  21. </view>
  22. <view class="bottom_box" :class="{ active: state === 4 }" @click="handleFilter(4)">
  23. <view class="box_num">{{ examineCount }}</view>
  24. <view class="box_info">待审核</view>
  25. </view>
  26. <view class="bottom_box" :class="{ active: state === 5 }" v-if="current === 0" @click="handleFilter(5)">
  27. <view class="box_num">{{ finishedCount }}</view>
  28. <view class="box_info">已完成</view>
  29. </view>
  30. <view class="bottom_box" :class="{ active: state === 7 }" v-if="current === 0" @click="handleFilter(7)">
  31. <view class="box_num">{{ closedCount }}</view>
  32. <view class="box_info">已关单</view>
  33. </view>
  34. </view>
  35. </view>
  36. <!-- 状态统计区域 维修师傅 后勤端 -->
  37. <view class="top_types" v-else>
  38. <view class="types_box" :class="{ active: state === 1 }" @click="handleFilter(1)">
  39. <view class="box_num">{{ receivingCount }}</view>
  40. <view class="box_info">待接单</view>
  41. </view>
  42. <view class="types_box" :class="{ active: state === 2 }" @click="handleFilter(2)">
  43. <view class="box_num">{{ maintenanceCount }}</view>
  44. <view class="box_info">维修中</view>
  45. </view>
  46. <view class="types_box" :class="{ active: state === 3 }" @click="handleFilter(3)">
  47. <view class="box_num">{{ timeoutCount }}</view>
  48. <view class="box_info">已超时</view>
  49. </view>
  50. <view class="types_box" :class="{ active: state === 4 }" @click="handleFilter(4)">
  51. <view class="box_num">{{ examineCount }}</view>
  52. <view class="box_info">待审核</view>
  53. </view>
  54. <view class="types_box" v-if="btns.includes('分段器按钮')" :class="{ active: state === 6 }" @click="handleFilter(6)">
  55. <view class="box_num">{{ logisticsCount }}</view>
  56. <view class="box_info">待处理</view>
  57. </view>
  58. <view class="types_box" v-if="btns.includes('分段器按钮')" :class="{ active: state === 5 }" @click="handleFilter(5)">
  59. <view class="box_num">{{ finishedCount }}</view>
  60. <view class="box_info">已完成</view>
  61. </view>
  62. <view class="types_box" v-if="btns.includes('分段器按钮')" :class="{ active: state === 7 }" @click="handleFilter(7)">
  63. <view class="box_num">{{ closedCount }}</view>
  64. <view class="box_info">已关单</view>
  65. </view>
  66. </view>
  67. <!-- 订单列表区域 -->
  68. <view class="body">
  69. <!-- 每一个订单区域 -->
  70. <view class="body_item" v-for="item in dataList" :key="item.id" @click="handleGoDetail(item)">
  71. <!-- 工单编号 -->
  72. <view class="item_title">
  73. <img src="../../static/images/repairsImg/order.png" />
  74. <view class="title_info">工单编号:{{ item.recordNo }}</view>
  75. </view>
  76. <!-- 报修时间 -->
  77. <view class="item_time">
  78. <view class="time_msg">
  79. 报修时间:
  80. <text>{{ item.reportTime }}</text>
  81. </view>
  82. <view class="time_type" v-if="item.state === '待接单'">待接单</view>
  83. <view class="time_type" v-if="item.state === '待处理'">待处理</view>
  84. <view class="time_type color_type" v-if="item.state === '维修中'">维修中</view>
  85. <view class="time_type color_type" v-if="item.state === '协作审核'">协作审核</view>
  86. <view class="time_type color_type" v-if="item.state === '转单审核'">转单审核</view>
  87. <view class="time_type color_type2" v-if="item.state === '待审核'">待审核</view>
  88. <view class="time_type color_type3" v-if="item.state === '已完成'">已完成</view>
  89. <view class="time_type" v-if="item.state === '待确认'">待确认</view>
  90. <view class="time_type color_type4" v-if="item.state === '已关单'">已关单</view>
  91. </view>
  92. <!-- 报修姓名 -->
  93. <view class="item_box">
  94. <view class="box_key">报修姓名:</view>
  95. <view class="box_value">{{ item.userName }}</view>
  96. <view class="box_type" v-if="item.timeoutStr">超时未接</view>
  97. <view class="box_type" v-if="item.maintenanceTimeout">维修超时</view>
  98. </view>
  99. <!-- 报修电话 -->
  100. <view class="item_box">
  101. <view class="box_key">报修电话:</view>
  102. <view class="box_value phone" @click.stop="handleCallPhone(item.userPhone)">
  103. {{ item.userPhone }}
  104. <img src="../../static/images/repairsImg/phone.png" />
  105. </view>
  106. </view>
  107. <!-- 报修区域 -->
  108. <view class="item_box">
  109. <view class="box_key">报修区域:</view>
  110. <view class="box_value">{{ item.areaName }}</view>
  111. </view>
  112. <!-- 详细地址 -->
  113. <view class="item_box">
  114. <view class="box_key">详细地址:</view>
  115. <view class="box_value">{{ item.address }}</view>
  116. </view>
  117. <!-- 报修物品 -->
  118. <view class="item_box">
  119. <view class="box_key">报修物品:</view>
  120. <view class="box_value">{{ item.articleName }}</view>
  121. </view>
  122. <!-- 故障描述 -->
  123. <view class="item_box" v-if="item.description">
  124. <view class="box_key">故障描述:</view>
  125. <view class="box_value">{{ item.description }}</view>
  126. </view>
  127. <!-- 报修录音 -->
  128. <view class="item_box" v-if="item.voice">
  129. <view class="box_key">报修录音:</view>
  130. <view class="box_value">
  131. <view class="recording" @click.stop="handlePlayRecording(item)">
  132. <img class="voiceImg" :src="item.status ? '../../static/images/repairsImg/play_active.png' : '../../static/images/repairsImg/play.png'" />
  133. {{ item.voiceLength }}″
  134. </view>
  135. </view>
  136. </view>
  137. <!-- 上传图片 -->
  138. <view class="item_img">
  139. <view class="img_key">上传图片:</view>
  140. <img class="img_value" mode="aspectFill" :src="item.images[0]" @click.stop="handleLookImgs(item.images)" />
  141. </view>
  142. <!-- 维修师傅 -->
  143. <view class="item_time" v-if="item.state !== '待接单' && item.state !== '待确认' && item.maintenancerName">
  144. <view class="time_msg">
  145. 维修师傅:
  146. <text>{{ item.maintenancerName }}</text>
  147. </view>
  148. </view>
  149. <!-- 师傅电话 -->
  150. <view class="item_box" v-if="item.state !== '待接单' && item.state !== '待确认' && item.maintenancerPhone">
  151. <view class="box_key">师傅电话:</view>
  152. <view class="box_value phone" @click.stop="handleCallPhone(item.maintenancerPhone)">
  153. {{ item.maintenancerPhone }}
  154. <img src="../../static/images/repairsImg/phone.png" />
  155. </view>
  156. </view>
  157. <!-- 维修费用 -->
  158. <view class="item_box" v-if="item.price">
  159. <view class="box_key">维修费用:</view>
  160. <view class="box_value2 phone" @click.stop="checkFeeDetail(item)">
  161. {{ item.price }}元
  162. <img src="../../static/images/repairsImg/eye.png" />
  163. </view>
  164. </view>
  165. <!-- 按钮区域 -->
  166. <view class="item_btn">
  167. <!-- 关闭按钮 -->
  168. <img v-if="item.state === '待接单'" src="../../static/images/repairsImg/close.png" @click.stop="handleClose(item)" />
  169. <!-- 协作按钮 -->
  170. <img class="img" src="../../static/images/repairsImg/help.png" v-if="item.state === '待接单' && btns.includes('协作')" @click.stop="handleHelp(item)" />
  171. <!-- 延时按钮 -->
  172. <view class="btn_box type" v-if="(item.state === '待接单' || item.state === '维修中') && btns.includes('延时')" @click.stop="handleDelay(item)">延时</view>
  173. <!-- 接单按钮 -->
  174. <view
  175. class="btn_box type"
  176. v-if="item.state === '待接单' && btns.includes('接单') && (!btns.includes('首页分段器') || current === 1)"
  177. @click.stop="handleOrderReceiving(item)"
  178. >
  179. 接单
  180. </view>
  181. <!-- 转单按钮 -->
  182. <view class="btn_box type2" v-if="item.state === '待接单' && btns.includes('转单')" @click.stop="handleTransferOrder(item)">转单</view>
  183. <!-- 派单按钮 -->
  184. <!-- <view class="btn_box type2" v-if="item.state === '待接单' && btns.includes('派单')" @click.stop="handleSendOrder(item)">派单</view> -->
  185. <!-- 报价按钮 -->
  186. <view class="btn_box type" v-if="!item.price && item.state === '维修中' && btns.includes('报价')" @click.stop="handleOffer(item)">报价</view>
  187. <!-- 维修完成按钮 -->
  188. <view class="btn_box type2" v-if="item.state === '维修中' && btns.includes('维修完成')" @click.stop="handleFinish(item)">维修完成</view>
  189. <!-- 审核按钮 -->
  190. <view class="btn_box type" v-if="(item.state === '协作审核' || item.state === '转单审核') && btns.includes('审核')" @click.stop="handleAudit(item)">审核</view>
  191. <!-- 改价按钮 -->
  192. <view class="btn_box type" v-if="item.state === '待处理'" @click.stop="handleChangeOffer(item)">改价</view>
  193. <!-- 留言按钮 -->
  194. <view class="btn_box type2" v-if="item.state === '待处理'" @click.stop="handleLeaveWords(item)">留言</view>
  195. </view>
  196. </view>
  197. <!-- 关闭按钮弹窗 -->
  198. <uni-popup ref="popup_close" :is-mask-click="false">
  199. <view class="popup_close">
  200. <view
  201. :class="[{ active: activeIndex === index }, { radius: index === 0 }]"
  202. class="close_box"
  203. v-for="(ele, index) in closeList"
  204. :key="ele.id"
  205. @click="handleChangeItem(index)"
  206. >
  207. {{ ele.name }}
  208. </view>
  209. <view class="close_btn">
  210. <view class="btn_box cancel" @click="$refs.popup_close.close()">取消</view>
  211. <view class="btn_box confirm" @click="handleCloseConfirm">确定</view>
  212. </view>
  213. </view>
  214. </uni-popup>
  215. <!-- 留言弹窗 -->
  216. <uni-popup ref="popup_leaveWords" :is-mask-click="false">
  217. <view class="pop_leaveWords">
  218. <view class="leaveWords_title">留言</view>
  219. <view class="leaveWords_body">
  220. <textarea placeholder-style="color:#CCCCCC" placeholder="请输入您宝贵的留言" v-model="leaveWords"></textarea>
  221. </view>
  222. <view class="leaveWords_btn">
  223. <view class="btn_box cancel" @click="$refs.popup_leaveWords.close()">取消</view>
  224. <view class="btn_box confirm" @click="handleLeaveWordsConfirm">确定</view>
  225. </view>
  226. </view>
  227. </uni-popup>
  228. <!-- 维修费用弹窗 -->
  229. <uni-popup :is-mask-click="false" ref="popup_fee">
  230. <view class="pop_fee">
  231. <view class="fee_title">
  232. 维修费用
  233. <text @click="$refs.popup_fee.close()">×</text>
  234. </view>
  235. <view class="fee_content">
  236. <view class="fee_item" v-for="(element, index2) in goodsList" :key="index2">
  237. <view class="fee_box">
  238. 耗材:
  239. <text>{{ element.name }}</text>
  240. </view>
  241. <view class="fee_box">
  242. 耗材单价:
  243. <text>{{ element.price }}元</text>
  244. </view>
  245. <view class="fee_box">
  246. 耗材数量:
  247. <text>{{ element.num }}</text>
  248. </view>
  249. <view class="fee_box">
  250. 耗材费用:
  251. <text>{{ element.count }}元</text>
  252. </view>
  253. </view>
  254. </view>
  255. </view>
  256. </uni-popup>
  257. </view>
  258. <!-- 没有数据时展示的图片 -->
  259. <view class="no_data" v-if="dataList.length === 0">
  260. <img src="../../pagesClockIn/static/imgs/nodata.png" />
  261. <view>暂无数据</view>
  262. </view>
  263. </scroll-view>
  264. </template>
  265. <script>
  266. const innerAudioContext = uni.createInnerAudioContext()
  267. export default {
  268. data() {
  269. return {
  270. scrollY: true,
  271. // 按钮权限
  272. btns: [],
  273. // 留言弹窗输入框绑定数据
  274. leaveWords: '',
  275. // 顶部分段器数组
  276. items: ['团队工单', '个人工单'],
  277. // 顶部分段器数组当前索引
  278. current: 0,
  279. // 关闭按钮弹窗当前索引
  280. activeIndex: 0,
  281. // 关闭按钮弹窗选项数组
  282. closeList: [],
  283. // 订单列表
  284. dataList: [],
  285. // 维修费用弹窗数组
  286. goodsList: [],
  287. // 校区id
  288. schoolId: '',
  289. // 用户ID
  290. userId: '',
  291. // 待处理
  292. logisticsCount: '',
  293. // 待审核
  294. examineCount: '',
  295. // 待接单
  296. receivingCount: '',
  297. // 维修中
  298. maintenanceCount: '',
  299. // 已完成
  300. finishedCount: '',
  301. // 已超时
  302. timeoutCount: '',
  303. // 已关单
  304. closedCount: '',
  305. // 当前页
  306. currentPage: 1,
  307. // 每页多少条
  308. pageCount: 2,
  309. // 总条数 团队
  310. total: null,
  311. // 总条数 个人
  312. total2: null,
  313. // 订单状态参数
  314. state: 1,
  315. // 订单id
  316. orderId: ''
  317. }
  318. },
  319. mounted() {
  320. const repairsUserInfo = uni.getStorageSync('repairsUserInfo')
  321. this.schoolId = repairsUserInfo.schoolId
  322. this.userId = repairsUserInfo.userId
  323. this.btns = repairsUserInfo.btns
  324. if (this.btns.includes('工单管理分段器') || this.btns.includes('分段器按钮')) {
  325. // 管理员身份或者后勤
  326. this.getTeamCount()
  327. this.getTeamData()
  328. } else {
  329. // 维修师傅
  330. this.getCount()
  331. this.getData()
  332. }
  333. this.getCloseList()
  334. },
  335. methods: {
  336. // 滚动到底部触发回调
  337. scrolltolower() {
  338. if ((this.btns.includes('工单管理分段器') || this.btns.includes('分段器按钮')) && this.current === 0) {
  339. // 团队工单
  340. if (this.total > this.dataList.length) {
  341. this.currentPage++
  342. this.getTeamData()
  343. } else {
  344. uni.showToast({
  345. title: '没有更多数据了',
  346. icon: 'none'
  347. })
  348. }
  349. } else {
  350. // 个人工单
  351. if (this.total2 > this.dataList.length) {
  352. this.currentPage++
  353. this.getData()
  354. } else {
  355. uni.showToast({
  356. title: '没有更多数据了',
  357. icon: 'none'
  358. })
  359. }
  360. }
  361. },
  362. async getCloseList() {
  363. const res = await this.$myRequest_repairs({
  364. url: '/repairClose/queryRepairCloses'
  365. })
  366. // console.log(res)
  367. if (res.code === '200') {
  368. this.closeList = res.data
  369. }
  370. },
  371. handleFilter(state) {
  372. this.state = state
  373. this.dataList = []
  374. this.currentPage = 1
  375. this.handleResetData()
  376. },
  377. async getCount() {
  378. const res = await this.$myRequest_repairs({
  379. url: '/repairRecord/getTechnicianCountByUserId',
  380. data: {
  381. userId: this.userId
  382. }
  383. })
  384. // console.log(res)
  385. if (res.code === '200') {
  386. this.examineCount = res.data.examineCount
  387. this.maintenanceCount = res.data.maintenanceCount
  388. this.receivingCount = res.data.receivingCount
  389. this.timeoutCount = res.data.timeoutCount
  390. }
  391. },
  392. // 获取个人订单数据
  393. async getData() {
  394. const res = await this.$myRequest_repairs({
  395. url: '/repairRecord/getTechniciansByUserId',
  396. data: {
  397. currentPage: this.currentPage,
  398. pageCount: this.pageCount,
  399. state: this.state,
  400. userId: this.userId
  401. }
  402. })
  403. // console.log(res)
  404. if (res.code === '200') {
  405. this.total2 = res.data.totalCount
  406. res.data.list.forEach((ele) => {
  407. return (ele.status = false)
  408. })
  409. this.dataList = [...this.dataList, ...res.data.list]
  410. }
  411. },
  412. async getTeamCount() {
  413. const res = await this.$myRequest_repairs({
  414. url: '/repairRecord/queryTeamWorkCount',
  415. data: {
  416. schoolId: this.schoolId
  417. }
  418. })
  419. // console.log(res)
  420. if (res.code === '200') {
  421. this.examineCount = res.data.examineCount
  422. this.receivingCount = res.data.receivingCount
  423. this.maintenanceCount = res.data.maintenanceCount
  424. this.finishedCount = res.data.finishedCount
  425. this.timeoutCount = res.data.timeoutCount
  426. this.closedCount = res.data.closedCount
  427. this.logisticsCount = res.data.logisticsCount
  428. }
  429. },
  430. // 获取团队订单数据
  431. async getTeamData() {
  432. const res = await this.$myRequest_repairs({
  433. url: '/repairRecord/queryTeamWorkPage',
  434. data: {
  435. currentPage: this.currentPage,
  436. pageCount: this.pageCount,
  437. state: this.state,
  438. schoolId: this.schoolId
  439. }
  440. })
  441. // console.log(res)
  442. if (res.code === '200') {
  443. this.total = res.data.totalCount
  444. res.data.list.forEach((ele) => {
  445. return (ele.status = false)
  446. })
  447. this.dataList = [...this.dataList, ...res.data.list]
  448. }
  449. },
  450. // 留言弹窗确定按钮回调
  451. async handleLeaveWordsConfirm() {
  452. if (this.leaveWords) {
  453. const res = await this.$myRequest_repairs({
  454. url: '/repairRecord/mobileReply',
  455. method: 'post',
  456. data: {
  457. recordId: this.orderId,
  458. userId: this.userId,
  459. content: this.leaveWords
  460. }
  461. })
  462. // console.log(res)
  463. if (res.code === '200') {
  464. uni.showToast({
  465. title: '留言成功',
  466. icon: 'success',
  467. mask: true
  468. })
  469. this.$refs.popup_leaveWords.close()
  470. }
  471. } else {
  472. uni.showToast({
  473. title: '请输入留言内容',
  474. icon: 'none',
  475. mask: true
  476. })
  477. }
  478. },
  479. // 关闭弹窗确定按钮回调
  480. handleCloseConfirm() {
  481. uni.showModal({
  482. title: '提示',
  483. content: '确定关闭订单吗?',
  484. success: async (res) => {
  485. if (res.confirm) {
  486. const res = await this.$myRequest_repairs({
  487. url: '/repairRecord/closeOrder',
  488. data: {
  489. recordId: this.orderId,
  490. userId: this.userId,
  491. reason: this.closeList[this.activeIndex].name
  492. }
  493. })
  494. // console.log(res)
  495. if (res.code === '200') {
  496. uni.showToast({
  497. title: '关单成功',
  498. icon: 'success',
  499. mask: true
  500. })
  501. this.$refs.popup_close.close()
  502. setTimeout(() => {
  503. this.handleResetData()
  504. }, 1500)
  505. }
  506. }
  507. }
  508. })
  509. },
  510. // 重置当前页面获取最新数据
  511. handleResetData() {
  512. this.dataList = []
  513. this.currentPage = 1
  514. if ((this.btns.includes('工单管理分段器') || this.btns.includes('分段器按钮')) && this.current === 0) {
  515. // 管理员身份或者后勤
  516. this.getTeamCount()
  517. this.getTeamData()
  518. } else {
  519. // 维修师傅
  520. this.getCount()
  521. this.getData()
  522. }
  523. },
  524. // 接单按钮回调
  525. handleOrderReceiving(item) {
  526. uni.showModal({
  527. content: '确定接单吗?',
  528. title: '提示',
  529. success: async (res) => {
  530. if (res.confirm) {
  531. const res = await this.$myRequest_repairs({
  532. url: '/repairRecord/receiveOwnOrders',
  533. data: {
  534. recordId: item.id,
  535. userId: this.userId
  536. }
  537. })
  538. // console.log(res)
  539. if (res.code === '200') {
  540. uni.showToast({
  541. title: '接单成功',
  542. icon: 'success',
  543. mask: true
  544. })
  545. setTimeout(() => {
  546. this.handleResetData()
  547. }, 1500)
  548. }
  549. }
  550. }
  551. })
  552. },
  553. // 关闭图标点击回调
  554. handleClose(item) {
  555. this.orderId = item.id
  556. this.activeIndex = 0
  557. this.$refs.popup_close.open('center')
  558. },
  559. // 关闭按钮弹窗选中按钮时回调
  560. handleChangeItem(val) {
  561. this.activeIndex = val
  562. },
  563. // 报价按钮回调
  564. handleOffer(item) {
  565. let info = encodeURIComponent(JSON.stringify(item))
  566. uni.navigateTo({
  567. url: `/pagesRepairs/offer/offer?info=${info}`
  568. })
  569. },
  570. // 改价按钮回调
  571. handleChangeOffer(item) {
  572. let info = encodeURIComponent(JSON.stringify(item))
  573. uni.navigateTo({
  574. url: `/pagesRepairs/offer/offer?info=${info}&type=1`
  575. })
  576. },
  577. // 维修完成按钮回调
  578. handleFinish(item) {
  579. const info = JSON.stringify(item)
  580. uni.navigateTo({
  581. url: `/pagesRepairs/repairRecord/repairRecord?info=${info}`
  582. })
  583. },
  584. // 转单按钮回调
  585. handleTransferOrder(item) {
  586. uni.navigateTo({
  587. url: `/pagesRepairs/transferOrder/transferOrder?id=${item.id}`
  588. })
  589. },
  590. // 协作图标点击回调
  591. handleHelp(item) {
  592. uni.navigateTo({
  593. url: `/pagesRepairs/help/help?id=${item.id}`
  594. })
  595. },
  596. // 分段器切换回调
  597. onClickItem(e) {
  598. if (this.current != e.currentIndex) {
  599. this.current = e.currentIndex
  600. this.state = 1
  601. this.dataList = []
  602. this.currentPage = 1
  603. if (this.current === 0) {
  604. // 团队工单
  605. this.getTeamCount()
  606. this.getTeamData()
  607. } else {
  608. // 个人工单
  609. this.getCount()
  610. this.getData()
  611. }
  612. }
  613. },
  614. // 留言按钮回调
  615. handleLeaveWords(item) {
  616. this.orderId = item.id
  617. this.$refs.popup_leaveWords.open('center')
  618. },
  619. // 延时按钮回调
  620. handleDelay(item) {
  621. uni.navigateTo({
  622. url: `/pagesRepairs/delay/delay?id=${item.id}`
  623. })
  624. },
  625. // 派单按钮回调
  626. handleSendOrder(item) {
  627. uni.navigateTo({
  628. url: `/pagesRepairs/helpPeople/helpPeople?type=1&id=${item.id}`
  629. })
  630. },
  631. // 审核按钮回调
  632. handleAudit(item) {
  633. if (item.state === '转单审核') {
  634. uni.navigateTo({
  635. url: `/pagesRepairs/transferOrder/transferOrder?type=1&id=${item.id}`
  636. })
  637. } else if (item.state === '协作审核') {
  638. uni.navigateTo({
  639. url: `/pagesRepairs/help/help?type=1&id=${item.id}`
  640. })
  641. }
  642. },
  643. // 查看维修费用回调
  644. checkFeeDetail(item) {
  645. // console.log(item)
  646. this.goodsList = item.goodsList
  647. this.$refs.popup_fee.open('center')
  648. },
  649. // 点击电话号码回调
  650. handleCallPhone(phone) {
  651. uni.makePhoneCall({
  652. phoneNumber: phone
  653. })
  654. },
  655. // 点击图片回调
  656. handleLookImgs(img) {
  657. // console.log(img)
  658. uni.previewImage({
  659. urls: img
  660. })
  661. },
  662. // 点击录音播放回调
  663. handlePlayRecording(item) {
  664. this.dataList.forEach((ele) => {
  665. if (ele.id !== item.id) {
  666. ele.status = false
  667. }
  668. })
  669. innerAudioContext.src = item.voice
  670. if (!item.status) {
  671. item.status = true
  672. innerAudioContext.play()
  673. //播放结束
  674. innerAudioContext.onEnded(() => {
  675. item.status = false
  676. })
  677. } else {
  678. item.status = false
  679. innerAudioContext.stop()
  680. }
  681. },
  682. handleGoDetail(item) {
  683. uni.navigateTo({
  684. url: `/pagesRepairs/repairDetails/repairDetails?id=${item.id}`
  685. })
  686. }
  687. }
  688. }
  689. </script>
  690. <style lang="scss" scoped>
  691. .container {
  692. width: 100vw;
  693. height: calc(100vh - 152rpx);
  694. font-size: 32rpx;
  695. overflow-y: auto;
  696. .top_bg {
  697. height: 165rpx;
  698. background-color: #6fb6b8;
  699. }
  700. .top_types {
  701. display: flex;
  702. flex-wrap: wrap;
  703. justify-content: space-evenly;
  704. margin: auto;
  705. margin-top: -100rpx;
  706. width: 690rpx;
  707. border-radius: 10rpx;
  708. box-shadow: 0px 0px 4rpx rgba(0, 0, 0, 0.25);
  709. background-color: #fff;
  710. .types_box {
  711. width: 25%;
  712. height: 188rpx;
  713. display: flex;
  714. flex-direction: column;
  715. justify-content: center;
  716. align-items: center;
  717. .box_num {
  718. font-size: 46rpx;
  719. color: #ff5733;
  720. }
  721. .box_info {
  722. margin-top: 10rpx;
  723. font-size: 34rpx;
  724. }
  725. }
  726. .active {
  727. color: #fff;
  728. background-color: #6fb6b8;
  729. }
  730. }
  731. .top_types2 {
  732. box-sizing: border-box;
  733. margin: auto;
  734. margin-top: -100rpx;
  735. padding: 0 30rpx;
  736. width: 690rpx;
  737. // height: 402rpx;
  738. border-radius: 10rpx;
  739. box-shadow: 0px 0px 4rpx rgba(0, 0, 0, 0.25);
  740. background-color: #fff;
  741. .top {
  742. height: 112rpx;
  743. border-bottom: 1rpx solid #e6e6e6;
  744. }
  745. .bottom {
  746. display: flex;
  747. flex-wrap: wrap;
  748. justify-content: space-evenly;
  749. .bottom_box {
  750. width: 25%;
  751. height: 145rpx;
  752. display: flex;
  753. flex-direction: column;
  754. justify-content: center;
  755. align-items: center;
  756. .box_num {
  757. font-size: 46rpx;
  758. color: #ff5733;
  759. }
  760. .box_info {
  761. // margin-top: 10rpx;
  762. font-size: 34rpx;
  763. }
  764. }
  765. .active {
  766. color: #fff;
  767. background-color: #6fb6b8;
  768. }
  769. }
  770. }
  771. .body {
  772. box-sizing: border-box;
  773. padding: 0 30rpx 30rpx 30rpx;
  774. .body_item {
  775. margin-top: 20rpx;
  776. padding-bottom: 35rpx;
  777. border-radius: 11rpx;
  778. box-shadow: 0 0 8rpx #d9d9d9;
  779. .item_title {
  780. display: flex;
  781. align-items: center;
  782. padding: 0 30rpx;
  783. height: 87rpx;
  784. border-bottom: 1rpx solid #e6e6e6;
  785. img {
  786. width: 30rpx;
  787. height: 30rpx;
  788. }
  789. .title_info {
  790. margin-left: 16rpx;
  791. font-size: 32rpx;
  792. }
  793. }
  794. .item_time {
  795. display: flex;
  796. justify-content: space-between;
  797. align-items: center;
  798. padding: 0 30rpx;
  799. .time_msg {
  800. width: 500rpx;
  801. color: #808080;
  802. text {
  803. color: #000000;
  804. }
  805. }
  806. .time_type {
  807. flex: 1;
  808. box-sizing: border-box;
  809. padding-left: 10rpx;
  810. font-size: 32rpx;
  811. color: #ff5733;
  812. line-height: 60rpx;
  813. }
  814. .color_type {
  815. color: #1e7dfb;
  816. }
  817. .color_type2 {
  818. color: #d43030;
  819. }
  820. .color_type3 {
  821. color: #6fb6b8;
  822. }
  823. .color_type4 {
  824. color: #a6a6a6;
  825. }
  826. }
  827. .item_box {
  828. display: flex;
  829. padding: 0 30rpx;
  830. line-height: 60rpx;
  831. .box_key {
  832. width: 160rpx;
  833. color: #808080;
  834. }
  835. .box_value {
  836. flex: 1;
  837. display: flex;
  838. align-items: center;
  839. margin-right: auto;
  840. min-width: calc(100% - width: 160rpx;);
  841. img {
  842. margin-left: 10rpx;
  843. width: 45rpx;
  844. height: 45rpx;
  845. }
  846. .recording {
  847. display: flex;
  848. align-items: center;
  849. margin: 15rpx 0;
  850. width: 130rpx;
  851. height: 40rpx;
  852. color: #000;
  853. border-radius: 100rpx;
  854. border: 1rpx solid #cccccc;
  855. .voiceImg {
  856. margin: 0 12rpx;
  857. width: 30rpx;
  858. height: 30rpx;
  859. }
  860. }
  861. }
  862. .box_type {
  863. margin-left: 10rpx;
  864. width: 137rpx;
  865. height: 47rpx;
  866. line-height: 47rpx;
  867. text-align: center;
  868. border-radius: 136rpx;
  869. color: #ff5733;
  870. font-size: 24rpx;
  871. border: 1rpx solid #ff5733;
  872. }
  873. .box_value2 {
  874. display: flex;
  875. align-items: center;
  876. img {
  877. margin-top: -2rpx;
  878. margin-left: 14rpx;
  879. width: 46rpx;
  880. height: 46rpx;
  881. }
  882. }
  883. .phone {
  884. color: #6fb6b8;
  885. }
  886. }
  887. .item_img {
  888. display: flex;
  889. align-items: center;
  890. padding: 0 30rpx;
  891. height: 120rpx;
  892. color: #808080;
  893. .img_key {
  894. }
  895. .img_value {
  896. width: 120rpx;
  897. height: 120rpx;
  898. border-radius: 14rpx;
  899. }
  900. }
  901. .item_btn {
  902. display: flex;
  903. align-items: center;
  904. justify-content: flex-end;
  905. padding: 0 30rpx;
  906. line-height: 153rpx;
  907. img {
  908. margin-right: auto;
  909. margin-top: 45rpx;
  910. width: 56rpx;
  911. height: 56rpx;
  912. }
  913. .img {
  914. margin-right: auto;
  915. margin-left: -55rpx;
  916. margin-top: 45rpx;
  917. width: 62rpx;
  918. height: 62rpx;
  919. }
  920. .btn_box {
  921. display: flex;
  922. justify-content: center;
  923. align-items: center;
  924. margin-left: 16rpx;
  925. margin-top: 45rpx;
  926. width: 174rpx;
  927. height: 68rpx;
  928. border-radius: 11rpx;
  929. }
  930. .type {
  931. color: #fff;
  932. background-color: #6fb6b8;
  933. }
  934. .type2 {
  935. color: #6fb6b8;
  936. background-color: #fff;
  937. border: 1rpx solid #6fb6b8;
  938. }
  939. }
  940. }
  941. .popup_close {
  942. width: 690rpx;
  943. border-radius: 19rpx;
  944. background-color: #fff;
  945. .close_box {
  946. height: 100rpx;
  947. line-height: 100rpx;
  948. text-align: center;
  949. font-size: 32rpx;
  950. border: 1rpx solid #e6e6e6;
  951. }
  952. .radius {
  953. border-radius: 19rpx 19rpx 0 0;
  954. }
  955. .active {
  956. color: #fff;
  957. background-color: #6fb6b8;
  958. }
  959. .close_btn {
  960. display: flex;
  961. align-items: center;
  962. justify-content: space-evenly;
  963. margin-top: 100rpx;
  964. height: 121rpx;
  965. .btn_box {
  966. display: flex;
  967. justify-content: center;
  968. align-items: center;
  969. width: 203rpx;
  970. height: 72rpx;
  971. border-radius: 9rpx;
  972. font-size: 32rpx;
  973. }
  974. .cancel {
  975. background-color: #e5e5e5;
  976. color: #6fb6b8;
  977. }
  978. .confirm {
  979. background-color: #6fb6b8;
  980. color: #fff;
  981. }
  982. }
  983. }
  984. .pop_leaveWords {
  985. border-radius: 19rpx;
  986. background-color: #fff;
  987. .leaveWords_title {
  988. display: flex;
  989. justify-content: center;
  990. align-items: center;
  991. width: 690rpx;
  992. height: 110rpx;
  993. font-size: 32rpx;
  994. font-weight: bold;
  995. border-radius: 19rpx 19rpx 0 0;
  996. border-bottom: 1rpx solid #e6e6e6;
  997. }
  998. .leaveWords_body {
  999. height: 320rpx;
  1000. textarea {
  1001. box-sizing: border-box;
  1002. margin: 35rpx 40rpx;
  1003. padding: 20rpx;
  1004. width: 610rpx;
  1005. height: 312rpx;
  1006. // font-size: 28rpx;
  1007. border-radius: 14rpx;
  1008. border: 1rpx solid #e6e6e6;
  1009. }
  1010. }
  1011. .leaveWords_btn {
  1012. display: flex;
  1013. align-items: center;
  1014. justify-content: space-evenly;
  1015. height: 121rpx;
  1016. .btn_box {
  1017. display: flex;
  1018. justify-content: center;
  1019. align-items: center;
  1020. width: 203rpx;
  1021. height: 72rpx;
  1022. border-radius: 9rpx;
  1023. font-size: 32rpx;
  1024. }
  1025. .cancel {
  1026. background-color: #e5e5e5;
  1027. color: #6fb6b8;
  1028. }
  1029. .confirm {
  1030. background-color: #6fb6b8;
  1031. color: #fff;
  1032. }
  1033. }
  1034. }
  1035. .pop_fee {
  1036. padding-bottom: 50rpx;
  1037. border-radius: 19rpx;
  1038. background-color: #fff;
  1039. .fee_title {
  1040. display: flex;
  1041. justify-content: space-between;
  1042. align-items: center;
  1043. box-sizing: border-box;
  1044. padding: 0 31rpx 0 42rpx;
  1045. width: 690rpx;
  1046. height: 110rpx;
  1047. font-size: 32rpx;
  1048. font-weight: bold;
  1049. border-radius: 19rpx 19rpx 0 0;
  1050. border-bottom: 1rpx solid #e6e6e6;
  1051. text {
  1052. font-size: 45rpx;
  1053. font-weight: 400;
  1054. color: #808080;
  1055. }
  1056. }
  1057. .fee_content {
  1058. max-height: 50vh;
  1059. overflow-y: auto;
  1060. .fee_item {
  1061. border-bottom: 1rpx solid #e6e6e6;
  1062. .fee_box {
  1063. display: flex;
  1064. align-items: center;
  1065. padding-left: 42rpx;
  1066. height: 80rpx;
  1067. // font-size: 28rpx;
  1068. color: #808080;
  1069. text {
  1070. color: #000000;
  1071. }
  1072. }
  1073. }
  1074. }
  1075. }
  1076. }
  1077. .no_data {
  1078. text-align: center;
  1079. color: #b3b3b3;
  1080. font-size: 24rpx;
  1081. img {
  1082. margin: 42rpx auto 0;
  1083. width: 432rpx;
  1084. height: 456rpx;
  1085. }
  1086. }
  1087. }
  1088. </style>