myRepairs.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  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">
  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">
  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">
  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: 1,
  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: 1,
  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: 2,
  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. onClickItem(index) {
  243. console.log(index)
  244. if (this.current != index) {
  245. this.current = index
  246. }
  247. if (this.current === 0) {
  248. this.list = this.dataList
  249. } else if (this.current === 1) {
  250. this.list = this.dataList2
  251. } else {
  252. this.list = this.dataList3
  253. }
  254. },
  255. checkFeeDetail() {
  256. this.$refs.popup_fee[0].open('center')
  257. },
  258. handleBackOffice() {
  259. this.$refs.popup_logistics[0].open('center')
  260. },
  261. handleEvaluate() {
  262. uni.navigateTo({
  263. url: '/pagesRepairs/evaluate/evaluate'
  264. })
  265. },
  266. handleLookDetail() {
  267. uni.navigateTo({
  268. url: '/pagesRepairs/repairDetails/repairDetails'
  269. })
  270. }
  271. }
  272. }
  273. </script>
  274. <style lang="scss" scoped>
  275. .container {
  276. display: flex;
  277. flex-direction: column;
  278. box-sizing: border-box;
  279. padding: 0 30rpx;
  280. width: 100vw;
  281. height: calc(100vh - 102rpx);
  282. .control {
  283. display: flex;
  284. box-sizing: border-box;
  285. margin: 26rpx 0 29rpx;
  286. padding: 6rpx;
  287. width: 100%;
  288. height: 88rpx;
  289. border-radius: 18rpx;
  290. background-color: #f2f2f2;
  291. .control_item {
  292. flex: 1;
  293. display: flex;
  294. justify-content: center;
  295. align-items: center;
  296. font-size: 32rpx;
  297. }
  298. .active {
  299. border-radius: 18rpx;
  300. background-color: #fff;
  301. }
  302. }
  303. .body {
  304. height: calc(100vh - 190rpx);
  305. overflow-y: auto;
  306. .body_item {
  307. margin: 10rpx 10rpx 30rpx;
  308. // height: 799rpx;
  309. border-radius: 11rpx;
  310. box-shadow: 0 0 8rpx #d9d9d9;
  311. .item_title {
  312. display: flex;
  313. align-items: center;
  314. padding: 0 30rpx;
  315. height: 87rpx;
  316. border-bottom: 1rpx solid #e6e6e6;
  317. img {
  318. width: 30rpx;
  319. height: 30rpx;
  320. }
  321. .title_info {
  322. margin: 0 21rpx 0 13rpx;
  323. font-size: 28rpx;
  324. }
  325. .title_type {
  326. width: 137rpx;
  327. height: 47rpx;
  328. line-height: 47rpx;
  329. text-align: center;
  330. border-radius: 136rpx;
  331. color: #ff5733;
  332. font-size: 24rpx;
  333. border: 1rpx solid #ff5733;
  334. }
  335. }
  336. .item_time {
  337. display: flex;
  338. justify-content: space-between;
  339. align-items: center;
  340. padding: 0 30rpx;
  341. height: 79rpx;
  342. .time_msg {
  343. font-size: 28rpx;
  344. color: #808080;
  345. text {
  346. color: #000000;
  347. }
  348. }
  349. .time_type {
  350. font-size: 32rpx;
  351. color: #ff5733;
  352. }
  353. .color_type {
  354. color: #1e7dfb;
  355. }
  356. .color_type2 {
  357. color: #6fb6b8;
  358. }
  359. }
  360. .item_box {
  361. display: flex;
  362. padding: 0 30rpx;
  363. height: 60rpx;
  364. font-size: 28rpx;
  365. .box_key {
  366. color: #808080;
  367. }
  368. .box_value {
  369. display: flex;
  370. img {
  371. margin-top: 5rpx;
  372. margin-left: 10rpx;
  373. width: 28rpx;
  374. height: 28rpx;
  375. }
  376. }
  377. .box_value2 {
  378. display: flex;
  379. img {
  380. margin-top: -2rpx;
  381. margin-left: 14rpx;
  382. width: 46rpx;
  383. height: 46rpx;
  384. }
  385. }
  386. .phone {
  387. color: #6fb6b8;
  388. }
  389. }
  390. .item_img {
  391. display: flex;
  392. align-items: center;
  393. padding: 0 30rpx;
  394. height: 120rpx;
  395. color: #808080;
  396. font-size: 28rpx;
  397. .img_key {
  398. }
  399. .img_value {
  400. width: 120rpx;
  401. height: 120rpx;
  402. border-radius: 14rpx;
  403. background-color: salmon;
  404. }
  405. }
  406. .item_btn {
  407. display: flex;
  408. align-items: center;
  409. justify-content: flex-end;
  410. padding: 0 30rpx;
  411. height: 153rpx;
  412. .btn_box {
  413. display: flex;
  414. justify-content: center;
  415. align-items: center;
  416. margin-left: 16rpx;
  417. width: 174rpx;
  418. height: 68rpx;
  419. font-size: 28rpx;
  420. border-radius: 11rpx;
  421. }
  422. .type {
  423. color: #fff;
  424. background-color: #6fb6b8;
  425. }
  426. .type2 {
  427. color: #6fb6b8;
  428. background-color: #fff;
  429. border: 1rpx solid #6fb6b8;
  430. }
  431. }
  432. .item_btn2 {
  433. height: 50rpx;
  434. }
  435. .pop_fee {
  436. padding-bottom: 50rpx;
  437. border-radius: 19rpx;
  438. background-color: #fff;
  439. .fee_title {
  440. display: flex;
  441. justify-content: space-between;
  442. align-items: center;
  443. box-sizing: border-box;
  444. padding: 0 31rpx 0 42rpx;
  445. width: 690rpx;
  446. height: 110rpx;
  447. font-size: 32rpx;
  448. font-weight: bold;
  449. border-radius: 19rpx 19rpx 0 0;
  450. border-bottom: 1rpx solid #e6e6e6;
  451. text {
  452. font-size: 45rpx;
  453. font-weight: 400;
  454. color: #808080;
  455. }
  456. }
  457. .fee_box {
  458. display: flex;
  459. align-items: center;
  460. padding-left: 42rpx;
  461. height: 80rpx;
  462. font-size: 28rpx;
  463. color: #808080;
  464. text {
  465. color: #000000;
  466. }
  467. }
  468. }
  469. .pop_logistics {
  470. border-radius: 19rpx;
  471. background-color: #fff;
  472. .logistics_title {
  473. display: flex;
  474. justify-content: center;
  475. align-items: center;
  476. width: 690rpx;
  477. height: 110rpx;
  478. font-size: 32rpx;
  479. font-weight: bold;
  480. border-radius: 19rpx 19rpx 0 0;
  481. border-bottom: 1rpx solid #e6e6e6;
  482. }
  483. .logistics_body {
  484. height: 440rpx;
  485. border-bottom: 1rpx solid #e6e6e6;
  486. textarea {
  487. box-sizing: border-box;
  488. margin: 35rpx 40rpx;
  489. padding: 20rpx;
  490. width: 610rpx;
  491. height: 370rpx;
  492. font-size: 28rpx;
  493. border-radius: 14rpx;
  494. border: 1rpx solid #e6e6e6;
  495. }
  496. }
  497. .logistics_btn {
  498. display: flex;
  499. align-items: center;
  500. justify-content: space-evenly;
  501. height: 121rpx;
  502. .btn_box {
  503. display: flex;
  504. justify-content: center;
  505. align-items: center;
  506. width: 203rpx;
  507. height: 72rpx;
  508. border-radius: 9rpx;
  509. font-size: 32rpx;
  510. }
  511. .cancel {
  512. background-color: #e5e5e5;
  513. color: #6fb6b8;
  514. }
  515. .confirm {
  516. background-color: #6fb6b8;
  517. color: #fff;
  518. }
  519. }
  520. }
  521. }
  522. }
  523. }
  524. </style>