index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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':params.status==1}" @tap="changeType(1)">待指派</div>
  6. <div class="pre" :class="{'active':params.status==2}" @tap="changeType(2)">已指派(待维修)</div>
  7. <div class="pre" :class="{'active':params.status==3}" @tap="changeType(3)">已维修</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.repairPosition||''}}</div>
  12. <div class="pre">报修类型<span>{{RepairType[item.repairType]||''}}</span></div>
  13. <div class="pre">报修时间<span>{{item.createDate||''}}</span></div>
  14. <div class="type" :class="colorCfg[item.urgency]||'mr'" v-if="params.status!==1">{{typeCfg[item.urgency]||'未知'}}</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. 3:'普通',
  32. 2:'紧急',
  33. 1:'非常紧急'
  34. },
  35. colorCfg:{
  36. 3:'pt',
  37. 2:'jj',
  38. 1:'fcjj'
  39. },
  40. RepairType:{},
  41. params:{
  42. page:1,
  43. limit:10,
  44. status:1
  45. },
  46. list:[]
  47. }
  48. },
  49. async onShow() {
  50. let pages = getCurrentPages();
  51. let last = pages[pages.length-1];
  52. let status = last.options?.status;
  53. if(status) this.params.status = status;
  54. this.getRepairTypeData();
  55. this.getList();
  56. },
  57. async onReachBottom() {
  58. if(this.isOver) return
  59. this.getRepairTypeData();
  60. this.getList();
  61. },
  62. methods:{
  63. changeType(status){
  64. this.params.page = 1;
  65. this.params.status = status;
  66. this.list = [];
  67. this.getList();
  68. },
  69. async getRepairTypeData(){
  70. let res = await this.$api.get('/sys/dict/data/getListByType/RepairType');
  71. if(res.data.code===0){
  72. res.data.data.forEach(d=>{
  73. this.RepairType[d.dictValue]=d.dictLabel;
  74. })
  75. }else this.$showToast(res.data.msg)
  76. },
  77. getList(){
  78. this.$api.get('/repairorder/page',this.params).then(res=>{
  79. if(res.data.code===0){
  80. if(this.list.length<res.data.data.total){
  81. this.params.page++;
  82. this.list = [...this.list,...res.data.data.list];
  83. }else this.isOver = true
  84. }else this.$showModal(res.data.msg)
  85. });
  86. },
  87. toDetail(item){
  88. uni.navigateTo({
  89. url:'/pagesInspection/waitOrder/detail?id='+item.id
  90. })
  91. }
  92. }
  93. }
  94. </script>
  95. <style scoped lang="less">
  96. .page{
  97. background: #F4F8FB;
  98. padding-bottom: 20rpx;
  99. box-sizing: border-box;
  100. .tab{
  101. width: 100%;
  102. height: 102rpx;
  103. background: #FFFFFF;
  104. display: flex;
  105. .pre{
  106. width: calc(100% / 3);
  107. height: 100%;
  108. display: flex;
  109. align-items: center;
  110. justify-content: center;
  111. font-family: PingFangSC, PingFang SC;
  112. font-weight: 400;
  113. font-size: 28rpx;
  114. color: #1D2129;
  115. line-height: 40rpx;
  116. position: relative;
  117. &.active{
  118. font-weight: bold;
  119. font-size: 32rpx;
  120. color: #198CFF;
  121. line-height: 45rpx;
  122. &::after{
  123. content: '';
  124. width: 36rpx;
  125. height: 8rpx;
  126. background: #198CFF;
  127. border-radius: 4rpx;
  128. position: absolute;
  129. left: 50%;
  130. margin-left: -18rpx;
  131. bottom: 8rpx;
  132. }
  133. }
  134. }
  135. }
  136. .boxs{
  137. width: 100%;
  138. padding: 0 24rpx;
  139. box-sizing: border-box;
  140. .box{
  141. margin-top: 20rpx;
  142. background: #FFFFFF;
  143. border-radius: 16rpx;
  144. padding: 36rpx 24rpx;
  145. position: relative;
  146. .place{
  147. font-family: PingFang-SC, PingFang-SC;
  148. font-weight: bold;
  149. font-size: 32rpx;
  150. color: #1D2129;
  151. line-height: 36rpx;
  152. overflow: hidden;
  153. white-space: nowrap;
  154. text-overflow: ellipsis;
  155. }
  156. .pre{
  157. font-family: PingFangSC, PingFang SC;
  158. font-weight: 400;
  159. font-size: 24rpx;
  160. color: #86909C;
  161. line-height: 24rpx;
  162. margin-top: 24rpx;
  163. span{
  164. font-size: 26rpx;
  165. color: #1D2129;
  166. margin-left: 40rpx;
  167. }
  168. }
  169. .type{
  170. height: 48rpx;
  171. padding: 0 19rpx;
  172. border-radius: 0rpx 16rpx 0rpx 16rpx;
  173. font-family: PingFangSC, PingFang SC;
  174. font-weight: 400;
  175. font-size: 26rpx;
  176. line-height: 48rpx;
  177. position: absolute;
  178. top: 0;
  179. right: 0;
  180. &.pt{
  181. background: rgba(20,204,140,.14);
  182. color: #14CC8C;
  183. }
  184. &.jj{
  185. background: rgba(254,164,0,.14);
  186. color: #FEA400;
  187. }
  188. &.fcjj{
  189. background: rgba(249,80,80,.14);
  190. color: #F95050;
  191. }
  192. &.mr{
  193. background: rgba(153,153,153,.14);
  194. color: #999999;
  195. }
  196. }
  197. }
  198. }
  199. }
  200. </style>