index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='工单待办'></cus-header>
  4. <div class="tab">
  5. <div class="pre" :class="{'active':tIdx===0}" @tap="changeType(0)">待指派</div>
  6. <div class="pre" :class="{'active':tIdx===1}" @tap="changeType(1)">已指派(待维修)</div>
  7. <div class="pre" :class="{'active':tIdx===2}" @tap="changeType(2)">已维修</div>
  8. </div>
  9. <div class="boxs" v-if="list.length">
  10. <div class="box" v-for="(item,index) in list" :key="index" @tap="toDetail(item)">
  11. <div class="place">{{item.place}}</div>
  12. <div class="pre">报修类型<span>{{item.typename}}</span></div>
  13. <div class="pre">报修时间<span>{{item.time}}</span></div>
  14. <div class="type" :class="colorCfg[item.type]||'mr'">{{typeCfg[item.type]||'未知'}}</div>
  15. </div>
  16. </div>
  17. <template v-else>
  18. <page-empty :height="'calc(100vh - 100px)'"></page-empty>
  19. </template>
  20. </view>
  21. </template>
  22. <script>
  23. import pageEmpty from '@/components/pageEmpty/index.vue'
  24. export default {
  25. components:{
  26. pageEmpty
  27. },
  28. data(){
  29. return {
  30. typeCfg:{
  31. 1:'普通',
  32. 2:'紧急',
  33. 3:'非常紧急'
  34. },
  35. colorCfg:{
  36. 1:'pt',
  37. 2:'jj',
  38. 3:'fcjj'
  39. },
  40. tIdx:0,
  41. source:[
  42. {
  43. place:'B座13楼1301',
  44. typename:'水龙头漏水',
  45. time:'2024-12-28 10:32:35',
  46. type:3,//1普通 2紧急 3非常紧急
  47. status:1//1待指派 2已指派待维修 3已维修
  48. },
  49. {
  50. place:'B座13楼1301',
  51. typename:'水龙头漏水',
  52. time:'2024-12-28 10:32:35',
  53. type:2,//1普通 2紧急 3非常紧急
  54. status:2//1待指派 2已指派待维修 3已维修
  55. },
  56. {
  57. place:'B座13楼1301',
  58. typename:'水龙头漏水',
  59. time:'2024-12-28 10:32:35',
  60. type:1,//1普通 2紧急 3非常紧急
  61. status:3//1待指派 2已指派待维修 3已维修
  62. }
  63. ],
  64. list:[]
  65. }
  66. },
  67. onShow() {
  68. let pages = getCurrentPages();
  69. let last = pages[pages.length-1];
  70. let status = last.options?.status;
  71. this.tIdx = status ? (status-1) : 0;
  72. this.list = this.source.filter(l=>l.status==(status||1))
  73. },
  74. methods:{
  75. changeType(type){
  76. this.tIdx = type;
  77. this.list = this.source.filter(l=>l.status===(type+1))
  78. },
  79. toDetail(item){
  80. uni.navigateTo({
  81. url:'/pagesInspection/waitOrder/detail?order='+JSON.stringify(item)
  82. })
  83. }
  84. }
  85. }
  86. </script>
  87. <style scoped lang="less">
  88. .page{
  89. background: #F4F8FB;
  90. padding-bottom: 20rpx;
  91. box-sizing: border-box;
  92. .tab{
  93. width: 100%;
  94. height: 102rpx;
  95. background: #FFFFFF;
  96. display: flex;
  97. .pre{
  98. width: calc(100% / 3);
  99. height: 100%;
  100. display: flex;
  101. align-items: center;
  102. justify-content: center;
  103. font-family: PingFangSC, PingFang SC;
  104. font-weight: 400;
  105. font-size: 28rpx;
  106. color: #1D2129;
  107. line-height: 40rpx;
  108. position: relative;
  109. &.active{
  110. font-weight: bold;
  111. font-size: 32rpx;
  112. color: #198CFF;
  113. line-height: 45rpx;
  114. &::after{
  115. content: '';
  116. width: 36rpx;
  117. height: 8rpx;
  118. background: #198CFF;
  119. border-radius: 4rpx;
  120. position: absolute;
  121. left: 50%;
  122. margin-left: -18rpx;
  123. bottom: 8rpx;
  124. }
  125. }
  126. }
  127. }
  128. .boxs{
  129. width: 100%;
  130. padding: 0 24rpx;
  131. box-sizing: border-box;
  132. .box{
  133. margin-top: 20rpx;
  134. background: #FFFFFF;
  135. border-radius: 16rpx;
  136. padding: 36rpx 24rpx;
  137. position: relative;
  138. .place{
  139. font-family: PingFang-SC, PingFang-SC;
  140. font-weight: bold;
  141. font-size: 32rpx;
  142. color: #1D2129;
  143. line-height: 36rpx;
  144. overflow: hidden;
  145. white-space: nowrap;
  146. text-overflow: ellipsis;
  147. }
  148. .pre{
  149. font-family: PingFangSC, PingFang SC;
  150. font-weight: 400;
  151. font-size: 24rpx;
  152. color: #86909C;
  153. line-height: 24rpx;
  154. margin-top: 24rpx;
  155. span{
  156. font-size: 26rpx;
  157. color: #1D2129;
  158. margin-left: 40rpx;
  159. }
  160. }
  161. .type{
  162. height: 48rpx;
  163. padding: 0 19rpx;
  164. border-radius: 0rpx 16rpx 0rpx 16rpx;
  165. font-family: PingFangSC, PingFang SC;
  166. font-weight: 400;
  167. font-size: 26rpx;
  168. line-height: 48rpx;
  169. position: absolute;
  170. top: 0;
  171. right: 0;
  172. &.pt{
  173. background: rgba(20,204,140,.14);
  174. color: #14CC8C;
  175. }
  176. &.jj{
  177. background: rgba(254,164,0,.14);
  178. color: #FEA400;
  179. }
  180. &.fcjj{
  181. background: rgba(249,80,80,.14);
  182. color: #F95050;
  183. }
  184. &.mr{
  185. background: rgba(153,153,153,.14);
  186. color: #999999;
  187. }
  188. }
  189. }
  190. }
  191. }
  192. </style>