index.vue 4.6 KB

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