myRepairs.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. <template>
  2. <view class="container">
  3. <!-- 顶部分段器区域 -->
  4. <view class="control">
  5. <view class="control_item" :class="{ active: current === index }" v-for="(item, index) in items" :key="index" @click="onClickItem(index)">{{ item }}</view>
  6. </view>
  7. <!-- 主体内容区域 -->
  8. <view class="body">
  9. <!-- 每一个记录区域 -->
  10. <view class="body_item" v-for="item in list" :key="item.id">
  11. <!-- 工单编号 -->
  12. <view class="item_title" @click="handleLookDetail(item)">
  13. <img src="../../static/images/repairsImg/order.png" />
  14. <view class="title_info">工单编号:{{ item.order }}</view>
  15. <view class="title_type" v-if="item.overtime">超时未接</view>
  16. </view>
  17. <!-- 报修时间 -->
  18. <view class="item_time">
  19. <view class="time_msg">
  20. 报修时间:
  21. <text>{{ item.time }}</text>
  22. </view>
  23. <view class="time_type" v-if="item.type === 1">待接单</view>
  24. <view class="time_type color_type" v-if="item.type === 2">维修中</view>
  25. <view class="time_type" v-if="item.type === 3">待确认</view>
  26. <view class="time_type color_type2" v-if="item.type === 4">已完成</view>
  27. <view class="time_type" v-if="item.type === 5">已取消</view>
  28. </view>
  29. <!-- 报修姓名 -->
  30. <view class="item_box">
  31. <view class="box_key">报修姓名:</view>
  32. <view class="box_value">{{ item.name }}</view>
  33. </view>
  34. <!-- 报修电话 -->
  35. <view class="item_box">
  36. <view class="box_key">报修电话:</view>
  37. <view class="box_value phone" @click="handleCallPhone('13820846714')">
  38. {{ item.phone }}
  39. <img src="../../static/images/repairsImg/phone.png" />
  40. </view>
  41. </view>
  42. <!-- 报修区域 -->
  43. <view class="item_box">
  44. <view class="box_key">报修区域:</view>
  45. <view class="box_value">{{ item.area }}</view>
  46. </view>
  47. <!-- 详细地址 -->
  48. <view class="item_box">
  49. <view class="box_key">详细地址:</view>
  50. <view class="box_value">{{ item.address }}</view>
  51. </view>
  52. <!-- 报修物品 -->
  53. <view class="item_box">
  54. <view class="box_key">报修物品:</view>
  55. <view class="box_value">{{ item.goods }}</view>
  56. </view>
  57. <!-- 故障描述 -->
  58. <view class="item_box">
  59. <view class="box_key">故障描述:</view>
  60. <view class="box_value">{{ item.description }}</view>
  61. </view>
  62. <!-- 上传图片 -->
  63. <view class="item_img">
  64. <view class="img_key">上传图片:</view>
  65. <img class="img_value" mode="aspectFill" :src="item.img[0]" @click="handleLookImgs(item.img)" />
  66. </view>
  67. <!-- 维修师傅 -->
  68. <view class="item_time" v-if="item.type === 3 || item.type === 4">
  69. <view class="time_msg">
  70. 维修师傅:
  71. <text>{{ item.workerName }}</text>
  72. </view>
  73. </view>
  74. <!-- 师傅电话 -->
  75. <view class="item_box" v-if="item.type === 3 || item.type === 4">
  76. <view class="box_key">师傅电话:</view>
  77. <view class="box_value phone" @click="handleCallPhone('13820846714')">
  78. {{ item.workerPhone }}
  79. <img src="../../static/images/repairsImg/phone.png" />
  80. </view>
  81. </view>
  82. <!-- 维修费用 -->
  83. <view class="item_box" v-if="item.type === 3 || item.type === 4">
  84. <view class="box_key">维修费用:</view>
  85. <view class="box_value2 phone" @click="checkFeeDetail">
  86. {{ item.money }}元
  87. <img src="../../static/images/repairsImg/eye.png" />
  88. </view>
  89. </view>
  90. <!-- 维修费用弹窗 -->
  91. <uni-popup :is-mask-click="false" ref="popup_fee">
  92. <view class="pop_fee">
  93. <view class="fee_title">
  94. 维修费用
  95. <text @click="$refs.popup_fee[0].close()">×</text>
  96. </view>
  97. <view class="fee_box">
  98. 耗材:
  99. <text>螺丝刀</text>
  100. </view>
  101. <view class="fee_box">
  102. 耗材单价:
  103. <text>1元</text>
  104. </view>
  105. <view class="fee_box">
  106. 耗材数量:
  107. <text>2</text>
  108. </view>
  109. <view class="fee_box">
  110. 耗材费用:
  111. <text>2元</text>
  112. </view>
  113. </view>
  114. </uni-popup>
  115. <!-- 按钮 -->
  116. <view class="item_btn" v-if="item.type !== 5">
  117. <view class="btn_box type" v-if="item.type === 1 || item.type === 2" @click="handleExpedite">催单</view>
  118. <view class="btn_box type" v-if="item.type === 3" @click="handleBackOffice">转后勤</view>
  119. <view class="btn_box type" v-if="item.type === 3">支付</view>
  120. <view class="btn_box type2" v-if="item.type < 4" @click="handleRepeal">撤销</view>
  121. <view class="btn_box type" v-if="item.type === 4" @click="handleEvaluate">去评价</view>
  122. </view>
  123. <view class="item_btn2" v-else></view>
  124. <!-- 转后勤弹窗 -->
  125. <uni-popup ref="popup_logistics" :is-mask-click="false">
  126. <view class="pop_logistics">
  127. <view class="logistics_title">转后勤</view>
  128. <view class="logistics_body">
  129. <textarea placeholder-style="color:#CCCCCC" placeholder="请输入您宝贵的留言" v-model="logisticsValue"></textarea>
  130. </view>
  131. <view class="logistics_btn">
  132. <view class="btn_box cancel" @click="$refs.popup_logistics[0].close()">取消</view>
  133. <view class="btn_box confirm" @click="handleLogisticsConfirm">确定</view>
  134. </view>
  135. </view>
  136. </uni-popup>
  137. </view>
  138. </view>
  139. </view>
  140. </template>
  141. <script>
  142. export default {
  143. data() {
  144. return {
  145. logisticsValue: '',
  146. items: ['未完成(2)', '待确认(4)', '已完成(5)'],
  147. current: 0,
  148. list: [],
  149. // type为 1 是 待接单,type为 2 是维修中,
  150. // type为 3 是 待确认,type为 4 是已完成,
  151. // type为 5 是已取消
  152. dataList: [
  153. {
  154. id: 1,
  155. order: '656262219626262',
  156. overtime: true,
  157. time: '2023.07.05 09:25:26',
  158. type: 1,
  159. name: '张三',
  160. phone: '13659585689',
  161. area: '行政楼',
  162. address: '3楼309',
  163. goods: '电脑',
  164. description: '水龙头坏了',
  165. img: [
  166. 'https://img1.baidu.com/it/u=920310517,1559263161&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
  167. 'https://13lz.cn/d/file/2021-06-12/f54cce5a0208c756c112407ec6ca1ac0.jpg',
  168. 'https://inews.gtimg.com/newsapp_bt/0/12555654161/1000'
  169. ]
  170. },
  171. {
  172. id: 2,
  173. order: '956262219626262',
  174. overtime: false,
  175. time: '2023.07.05 09:25:26',
  176. type: 2,
  177. name: '李四',
  178. phone: '13659585689',
  179. area: '行政楼',
  180. address: '3楼309',
  181. goods: '电脑',
  182. description: '电脑坏了',
  183. img: [
  184. 'https://img1.baidu.com/it/u=920310517,1559263161&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
  185. 'https://13lz.cn/d/file/2021-06-12/f54cce5a0208c756c112407ec6ca1ac0.jpg',
  186. 'https://inews.gtimg.com/newsapp_bt/0/12555654161/1000'
  187. ]
  188. }
  189. ],
  190. dataList2: [
  191. {
  192. id: 19999,
  193. order: '656262219626262',
  194. overtime: false,
  195. time: '2023.07.05 09:25:26',
  196. type: 3,
  197. name: '张三',
  198. phone: '13659585689',
  199. area: '行政楼',
  200. address: '3楼309',
  201. goods: '电脑',
  202. description: '水龙头坏了',
  203. img: [
  204. 'https://img1.baidu.com/it/u=920310517,1559263161&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
  205. 'https://13lz.cn/d/file/2021-06-12/f54cce5a0208c756c112407ec6ca1ac0.jpg',
  206. 'https://inews.gtimg.com/newsapp_bt/0/12555654161/1000'
  207. ],
  208. workerName: '小李',
  209. workerPhone: '13659585689',
  210. money: 50
  211. }
  212. ],
  213. dataList3: [
  214. {
  215. id: 1854,
  216. order: '656262219626262',
  217. overtime: false,
  218. time: '2023.07.05 09:25:26',
  219. type: 4,
  220. name: '张三',
  221. phone: '13659585689',
  222. area: '行政楼',
  223. address: '3楼309',
  224. goods: '电脑',
  225. description: '水龙头坏了',
  226. img: [
  227. 'https://img1.baidu.com/it/u=920310517,1559263161&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
  228. 'https://13lz.cn/d/file/2021-06-12/f54cce5a0208c756c112407ec6ca1ac0.jpg',
  229. 'https://inews.gtimg.com/newsapp_bt/0/12555654161/1000'
  230. ],
  231. workerName: '小李',
  232. workerPhone: '13659585689',
  233. money: 50
  234. },
  235. {
  236. id: 2789,
  237. order: '656262219626262',
  238. overtime: false,
  239. time: '2023.07.05 09:25:26',
  240. type: 5,
  241. name: '张三',
  242. phone: '13659585689',
  243. area: '行政楼',
  244. address: '3楼309',
  245. goods: '电脑',
  246. description: '水龙头坏了',
  247. img: [
  248. 'https://img1.baidu.com/it/u=920310517,1559263161&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
  249. 'https://13lz.cn/d/file/2021-06-12/f54cce5a0208c756c112407ec6ca1ac0.jpg',
  250. 'https://inews.gtimg.com/newsapp_bt/0/12555654161/1000'
  251. ],
  252. workerName: '小李',
  253. workerPhone: '13659585689',
  254. money: 50
  255. }
  256. ]
  257. }
  258. },
  259. mounted() {
  260. console.log(666)
  261. this.list = this.dataList
  262. },
  263. methods: {
  264. // 转后勤弹窗确定按钮回调
  265. handleLogisticsConfirm() {
  266. console.log(this.logisticsValue)
  267. uni.showToast({
  268. title: '留言成功',
  269. icon: 'none'
  270. })
  271. this.$refs.popup_logistics[0].close()
  272. },
  273. // 催单按钮回调
  274. handleExpedite() {
  275. uni.showModal({
  276. title: '提示',
  277. content: '确定催单吗?',
  278. success: (res) => {
  279. if (res.confirm) {
  280. uni.showToast({
  281. title: '催单成功',
  282. icon: 'none'
  283. })
  284. }
  285. }
  286. })
  287. },
  288. // 撤销按钮回调
  289. handleRepeal() {
  290. uni.showModal({
  291. title: '提示',
  292. content: '确定撤销吗?',
  293. success: (res) => {
  294. if (res.confirm) {
  295. uni.showToast({
  296. title: '撤销成功',
  297. icon: 'none'
  298. })
  299. }
  300. }
  301. })
  302. },
  303. // 分段器切换回调
  304. onClickItem(index) {
  305. console.log(index)
  306. if (this.current != index) {
  307. this.current = index
  308. }
  309. if (this.current === 0) {
  310. this.list = this.dataList
  311. } else if (this.current === 1) {
  312. this.list = this.dataList2
  313. } else {
  314. this.list = this.dataList3
  315. }
  316. },
  317. // 查看维修费用回调
  318. checkFeeDetail() {
  319. this.$refs.popup_fee[0].open('center')
  320. },
  321. // 转后勤按钮回调
  322. handleBackOffice() {
  323. this.$refs.popup_logistics[0].open('center')
  324. },
  325. // 去评价按钮回调
  326. handleEvaluate() {
  327. uni.navigateTo({
  328. url: '/pagesRepairs/evaluate/evaluate'
  329. })
  330. },
  331. // 点击工单编号区域回调
  332. handleLookDetail(item) {
  333. const detailInfo = encodeURIComponent(JSON.stringify(item))
  334. // console.log(detailInfo)
  335. uni.navigateTo({
  336. url: `/pagesRepairs/repairDetails/repairDetails?detailInfo=${detailInfo}`
  337. })
  338. },
  339. // 点击电话号码回调
  340. handleCallPhone(phone) {
  341. console.log(phone)
  342. uni.makePhoneCall({
  343. phoneNumber: phone
  344. })
  345. },
  346. // 点击图片回调
  347. handleLookImgs(img) {
  348. // console.log(img)
  349. uni.previewImage({
  350. urls: img
  351. })
  352. }
  353. }
  354. }
  355. </script>
  356. <style lang="scss" scoped>
  357. .container {
  358. display: flex;
  359. flex-direction: column;
  360. box-sizing: border-box;
  361. padding: 0 30rpx;
  362. width: 100vw;
  363. height: calc(100vh - 152rpx);
  364. overflow-y: auto;
  365. .control {
  366. display: flex;
  367. box-sizing: border-box;
  368. margin: 26rpx 0 29rpx;
  369. padding: 6rpx;
  370. width: 100%;
  371. height: 88rpx;
  372. border-radius: 18rpx;
  373. background-color: #f2f2f2;
  374. .control_item {
  375. flex: 1;
  376. display: flex;
  377. justify-content: center;
  378. align-items: center;
  379. height: 76rpx;
  380. font-size: 32rpx;
  381. }
  382. .active {
  383. border-radius: 18rpx;
  384. background-color: #fff;
  385. }
  386. }
  387. .body {
  388. // height: calc(100vh - 190rpx);
  389. // overflow-y: auto;
  390. .body_item {
  391. margin: 10rpx 10rpx 30rpx;
  392. // height: 799rpx;
  393. border-radius: 11rpx;
  394. box-shadow: 0 0 8rpx #d9d9d9;
  395. .item_title {
  396. display: flex;
  397. align-items: center;
  398. padding: 0 30rpx;
  399. height: 87rpx;
  400. border-bottom: 1rpx solid #e6e6e6;
  401. img {
  402. width: 30rpx;
  403. height: 30rpx;
  404. }
  405. .title_info {
  406. margin: 0 21rpx 0 13rpx;
  407. font-size: 28rpx;
  408. }
  409. .title_type {
  410. width: 137rpx;
  411. height: 47rpx;
  412. line-height: 47rpx;
  413. text-align: center;
  414. border-radius: 136rpx;
  415. color: #ff5733;
  416. font-size: 24rpx;
  417. border: 1rpx solid #ff5733;
  418. }
  419. }
  420. .item_time {
  421. display: flex;
  422. justify-content: space-between;
  423. align-items: center;
  424. padding: 0 30rpx;
  425. height: 79rpx;
  426. .time_msg {
  427. font-size: 28rpx;
  428. color: #808080;
  429. text {
  430. color: #000000;
  431. }
  432. }
  433. .time_type {
  434. font-size: 32rpx;
  435. color: #ff5733;
  436. }
  437. .color_type {
  438. color: #1e7dfb;
  439. }
  440. .color_type2 {
  441. color: #6fb6b8;
  442. }
  443. }
  444. .item_box {
  445. display: flex;
  446. padding: 0 30rpx;
  447. height: 60rpx;
  448. font-size: 28rpx;
  449. .box_key {
  450. color: #808080;
  451. }
  452. .box_value {
  453. display: flex;
  454. img {
  455. margin-top: 5rpx;
  456. margin-left: 10rpx;
  457. width: 28rpx;
  458. height: 28rpx;
  459. }
  460. }
  461. .box_value2 {
  462. display: flex;
  463. img {
  464. margin-top: -2rpx;
  465. margin-left: 14rpx;
  466. width: 46rpx;
  467. height: 46rpx;
  468. }
  469. }
  470. .phone {
  471. color: #6fb6b8;
  472. }
  473. }
  474. .item_img {
  475. display: flex;
  476. align-items: center;
  477. padding: 0 30rpx;
  478. height: 120rpx;
  479. color: #808080;
  480. font-size: 28rpx;
  481. .img_key {
  482. }
  483. .img_value {
  484. width: 120rpx;
  485. height: 120rpx;
  486. border-radius: 14rpx;
  487. }
  488. }
  489. .item_btn {
  490. display: flex;
  491. align-items: center;
  492. justify-content: flex-end;
  493. padding: 0 30rpx;
  494. height: 153rpx;
  495. .btn_box {
  496. display: flex;
  497. justify-content: center;
  498. align-items: center;
  499. margin-left: 16rpx;
  500. width: 174rpx;
  501. height: 68rpx;
  502. font-size: 28rpx;
  503. border-radius: 11rpx;
  504. }
  505. .type {
  506. color: #fff;
  507. background-color: #6fb6b8;
  508. }
  509. .type2 {
  510. color: #6fb6b8;
  511. background-color: #fff;
  512. border: 1rpx solid #6fb6b8;
  513. }
  514. }
  515. .item_btn2 {
  516. height: 50rpx;
  517. }
  518. .pop_fee {
  519. padding-bottom: 50rpx;
  520. border-radius: 19rpx;
  521. background-color: #fff;
  522. .fee_title {
  523. display: flex;
  524. justify-content: space-between;
  525. align-items: center;
  526. box-sizing: border-box;
  527. padding: 0 31rpx 0 42rpx;
  528. width: 690rpx;
  529. height: 110rpx;
  530. font-size: 32rpx;
  531. font-weight: bold;
  532. border-radius: 19rpx 19rpx 0 0;
  533. border-bottom: 1rpx solid #e6e6e6;
  534. text {
  535. font-size: 45rpx;
  536. font-weight: 400;
  537. color: #808080;
  538. }
  539. }
  540. .fee_box {
  541. display: flex;
  542. align-items: center;
  543. padding-left: 42rpx;
  544. height: 80rpx;
  545. font-size: 28rpx;
  546. color: #808080;
  547. text {
  548. color: #000000;
  549. }
  550. }
  551. }
  552. .pop_logistics {
  553. border-radius: 19rpx;
  554. background-color: #fff;
  555. .logistics_title {
  556. display: flex;
  557. justify-content: center;
  558. align-items: center;
  559. width: 690rpx;
  560. height: 110rpx;
  561. font-size: 32rpx;
  562. font-weight: bold;
  563. border-radius: 19rpx 19rpx 0 0;
  564. border-bottom: 1rpx solid #e6e6e6;
  565. }
  566. .logistics_body {
  567. height: 440rpx;
  568. border-bottom: 1rpx solid #e6e6e6;
  569. textarea {
  570. box-sizing: border-box;
  571. margin: 35rpx 40rpx;
  572. padding: 20rpx;
  573. width: 610rpx;
  574. height: 370rpx;
  575. font-size: 28rpx;
  576. border-radius: 14rpx;
  577. border: 1rpx solid #e6e6e6;
  578. }
  579. }
  580. .logistics_btn {
  581. display: flex;
  582. align-items: center;
  583. justify-content: space-evenly;
  584. height: 121rpx;
  585. .btn_box {
  586. display: flex;
  587. justify-content: center;
  588. align-items: center;
  589. width: 203rpx;
  590. height: 72rpx;
  591. border-radius: 9rpx;
  592. font-size: 32rpx;
  593. }
  594. .cancel {
  595. background-color: #e5e5e5;
  596. color: #6fb6b8;
  597. }
  598. .confirm {
  599. background-color: #6fb6b8;
  600. color: #fff;
  601. }
  602. }
  603. }
  604. }
  605. }
  606. }
  607. </style>