myRepairs.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  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. <view class="img_value"></view>
  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">催单</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">撤销</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="请输入您宝贵的留言"></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="$refs.popup_logistics[0].close()">确定</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. items: ['未完成(2)', '待确认(4)', '已完成(5)'],
  146. current: 0,
  147. list: [],
  148. // type为 1 是 待接单,type为 2 是维修中,
  149. // type为 3 是 待确认,type为 4 是已完成,
  150. // type为 5 是已取消
  151. dataList: [
  152. {
  153. id: 1,
  154. order: '656262219626262',
  155. overtime: true,
  156. time: '2023.07.05 09:25:26',
  157. type: 1,
  158. name: '张三',
  159. phone: '13659585689',
  160. area: '行政楼',
  161. address: '3楼309',
  162. goods: '电脑',
  163. description: '水龙头坏了',
  164. img: ''
  165. },
  166. {
  167. id: 2,
  168. order: '956262219626262',
  169. overtime: false,
  170. time: '2023.07.05 09:25:26',
  171. type: 2,
  172. name: '李四',
  173. phone: '13659585689',
  174. area: '行政楼',
  175. address: '3楼309',
  176. goods: '电脑',
  177. description: '电脑坏了',
  178. img: ''
  179. }
  180. ],
  181. dataList2: [
  182. {
  183. id: 19999,
  184. order: '656262219626262',
  185. overtime: false,
  186. time: '2023.07.05 09:25:26',
  187. type: 3,
  188. name: '张三',
  189. phone: '13659585689',
  190. area: '行政楼',
  191. address: '3楼309',
  192. goods: '电脑',
  193. description: '水龙头坏了',
  194. img: '',
  195. workerName: '小李',
  196. workerPhone: '13659585689',
  197. money: 50
  198. }
  199. ],
  200. dataList3: [
  201. {
  202. id: 1854,
  203. order: '656262219626262',
  204. overtime: false,
  205. time: '2023.07.05 09:25:26',
  206. type: 4,
  207. name: '张三',
  208. phone: '13659585689',
  209. area: '行政楼',
  210. address: '3楼309',
  211. goods: '电脑',
  212. description: '水龙头坏了',
  213. img: '',
  214. workerName: '小李',
  215. workerPhone: '13659585689',
  216. money: 50
  217. },
  218. {
  219. id: 2789,
  220. order: '656262219626262',
  221. overtime: false,
  222. time: '2023.07.05 09:25:26',
  223. type: 5,
  224. name: '张三',
  225. phone: '13659585689',
  226. area: '行政楼',
  227. address: '3楼309',
  228. goods: '电脑',
  229. description: '水龙头坏了',
  230. img: '',
  231. workerName: '小李',
  232. workerPhone: '13659585689',
  233. money: 50
  234. }
  235. ]
  236. }
  237. },
  238. mounted() {
  239. this.list = this.dataList
  240. },
  241. methods: {
  242. // 分段器切换回调
  243. onClickItem(index) {
  244. console.log(index)
  245. if (this.current != index) {
  246. this.current = index
  247. }
  248. if (this.current === 0) {
  249. this.list = this.dataList
  250. } else if (this.current === 1) {
  251. this.list = this.dataList2
  252. } else {
  253. this.list = this.dataList3
  254. }
  255. },
  256. // 查看维修费用回调
  257. checkFeeDetail() {
  258. this.$refs.popup_fee[0].open('center')
  259. },
  260. // 转后勤按钮回调
  261. handleBackOffice() {
  262. this.$refs.popup_logistics[0].open('center')
  263. },
  264. // 去评价按钮回调
  265. handleEvaluate() {
  266. uni.navigateTo({
  267. url: '/pagesRepairs/evaluate/evaluate'
  268. })
  269. },
  270. // 点击工单编号区域回调
  271. handleLookDetail(item) {
  272. const detailInfo = JSON.stringify(item)
  273. uni.navigateTo({
  274. url: `/pagesRepairs/repairDetails/repairDetails?detailInfo=${detailInfo}`
  275. })
  276. },
  277. // 点击电话号码回调
  278. handleCallPhone(phone) {
  279. console.log(phone)
  280. uni.makePhoneCall({
  281. phoneNumber: phone
  282. })
  283. }
  284. }
  285. }
  286. </script>
  287. <style lang="scss" scoped>
  288. .container {
  289. display: flex;
  290. flex-direction: column;
  291. box-sizing: border-box;
  292. padding: 0 30rpx;
  293. width: 100vw;
  294. height: calc(100vh - 102rpx);
  295. overflow-y: auto;
  296. .control {
  297. display: flex;
  298. box-sizing: border-box;
  299. margin: 26rpx 0 29rpx;
  300. padding: 6rpx;
  301. width: 100%;
  302. height: 88rpx;
  303. border-radius: 18rpx;
  304. background-color: #f2f2f2;
  305. .control_item {
  306. flex: 1;
  307. display: flex;
  308. justify-content: center;
  309. align-items: center;
  310. height: 76rpx;
  311. font-size: 32rpx;
  312. }
  313. .active {
  314. border-radius: 18rpx;
  315. background-color: #fff;
  316. }
  317. }
  318. .body {
  319. // height: calc(100vh - 190rpx);
  320. // overflow-y: auto;
  321. .body_item {
  322. margin: 10rpx 10rpx 30rpx;
  323. // height: 799rpx;
  324. border-radius: 11rpx;
  325. box-shadow: 0 0 8rpx #d9d9d9;
  326. .item_title {
  327. display: flex;
  328. align-items: center;
  329. padding: 0 30rpx;
  330. height: 87rpx;
  331. border-bottom: 1rpx solid #e6e6e6;
  332. img {
  333. width: 30rpx;
  334. height: 30rpx;
  335. }
  336. .title_info {
  337. margin: 0 21rpx 0 13rpx;
  338. font-size: 28rpx;
  339. }
  340. .title_type {
  341. width: 137rpx;
  342. height: 47rpx;
  343. line-height: 47rpx;
  344. text-align: center;
  345. border-radius: 136rpx;
  346. color: #ff5733;
  347. font-size: 24rpx;
  348. border: 1rpx solid #ff5733;
  349. }
  350. }
  351. .item_time {
  352. display: flex;
  353. justify-content: space-between;
  354. align-items: center;
  355. padding: 0 30rpx;
  356. height: 79rpx;
  357. .time_msg {
  358. font-size: 28rpx;
  359. color: #808080;
  360. text {
  361. color: #000000;
  362. }
  363. }
  364. .time_type {
  365. font-size: 32rpx;
  366. color: #ff5733;
  367. }
  368. .color_type {
  369. color: #1e7dfb;
  370. }
  371. .color_type2 {
  372. color: #6fb6b8;
  373. }
  374. }
  375. .item_box {
  376. display: flex;
  377. padding: 0 30rpx;
  378. height: 60rpx;
  379. font-size: 28rpx;
  380. .box_key {
  381. color: #808080;
  382. }
  383. .box_value {
  384. display: flex;
  385. img {
  386. margin-top: 5rpx;
  387. margin-left: 10rpx;
  388. width: 28rpx;
  389. height: 28rpx;
  390. }
  391. }
  392. .box_value2 {
  393. display: flex;
  394. img {
  395. margin-top: -2rpx;
  396. margin-left: 14rpx;
  397. width: 46rpx;
  398. height: 46rpx;
  399. }
  400. }
  401. .phone {
  402. color: #6fb6b8;
  403. }
  404. }
  405. .item_img {
  406. display: flex;
  407. align-items: center;
  408. padding: 0 30rpx;
  409. height: 120rpx;
  410. color: #808080;
  411. font-size: 28rpx;
  412. .img_key {
  413. }
  414. .img_value {
  415. width: 120rpx;
  416. height: 120rpx;
  417. border-radius: 14rpx;
  418. background-color: salmon;
  419. }
  420. }
  421. .item_btn {
  422. display: flex;
  423. align-items: center;
  424. justify-content: flex-end;
  425. padding: 0 30rpx;
  426. height: 153rpx;
  427. .btn_box {
  428. display: flex;
  429. justify-content: center;
  430. align-items: center;
  431. margin-left: 16rpx;
  432. width: 174rpx;
  433. height: 68rpx;
  434. font-size: 28rpx;
  435. border-radius: 11rpx;
  436. }
  437. .type {
  438. color: #fff;
  439. background-color: #6fb6b8;
  440. }
  441. .type2 {
  442. color: #6fb6b8;
  443. background-color: #fff;
  444. border: 1rpx solid #6fb6b8;
  445. }
  446. }
  447. .item_btn2 {
  448. height: 50rpx;
  449. }
  450. .pop_fee {
  451. padding-bottom: 50rpx;
  452. border-radius: 19rpx;
  453. background-color: #fff;
  454. .fee_title {
  455. display: flex;
  456. justify-content: space-between;
  457. align-items: center;
  458. box-sizing: border-box;
  459. padding: 0 31rpx 0 42rpx;
  460. width: 690rpx;
  461. height: 110rpx;
  462. font-size: 32rpx;
  463. font-weight: bold;
  464. border-radius: 19rpx 19rpx 0 0;
  465. border-bottom: 1rpx solid #e6e6e6;
  466. text {
  467. font-size: 45rpx;
  468. font-weight: 400;
  469. color: #808080;
  470. }
  471. }
  472. .fee_box {
  473. display: flex;
  474. align-items: center;
  475. padding-left: 42rpx;
  476. height: 80rpx;
  477. font-size: 28rpx;
  478. color: #808080;
  479. text {
  480. color: #000000;
  481. }
  482. }
  483. }
  484. .pop_logistics {
  485. border-radius: 19rpx;
  486. background-color: #fff;
  487. .logistics_title {
  488. display: flex;
  489. justify-content: center;
  490. align-items: center;
  491. width: 690rpx;
  492. height: 110rpx;
  493. font-size: 32rpx;
  494. font-weight: bold;
  495. border-radius: 19rpx 19rpx 0 0;
  496. border-bottom: 1rpx solid #e6e6e6;
  497. }
  498. .logistics_body {
  499. height: 440rpx;
  500. border-bottom: 1rpx solid #e6e6e6;
  501. textarea {
  502. box-sizing: border-box;
  503. margin: 35rpx 40rpx;
  504. padding: 20rpx;
  505. width: 610rpx;
  506. height: 370rpx;
  507. font-size: 28rpx;
  508. border-radius: 14rpx;
  509. border: 1rpx solid #e6e6e6;
  510. }
  511. }
  512. .logistics_btn {
  513. display: flex;
  514. align-items: center;
  515. justify-content: space-evenly;
  516. height: 121rpx;
  517. .btn_box {
  518. display: flex;
  519. justify-content: center;
  520. align-items: center;
  521. width: 203rpx;
  522. height: 72rpx;
  523. border-radius: 9rpx;
  524. font-size: 32rpx;
  525. }
  526. .cancel {
  527. background-color: #e5e5e5;
  528. color: #6fb6b8;
  529. }
  530. .confirm {
  531. background-color: #6fb6b8;
  532. color: #fff;
  533. }
  534. }
  535. }
  536. }
  537. }
  538. }
  539. </style>