OrderTask.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <view class="content_box">
  3. <view class="list_box marginTop">
  4. <u-list>
  5. <u-list-item v-for="(item, index) in list" :key="index">
  6. <view class="card_box" @click="goDetail(item)">
  7. <view class="item_box flex_between">
  8. <view class="rx-sc">
  9. <view class="round">{{Number(index)+1}}</view>
  10. <view class="orderId">{{item.code}} </view>
  11. </view>
  12. <view class="state">
  13. {{ dict.status[item.orderStatus] }}
  14. </view>
  15. </view>
  16. <view class="item_box rx-bc">
  17. <view class="item_one perce50 rx-sc">
  18. <view class="lable">设备名称:</view>
  19. <view class="deviceName">{{item.deviceName}}</view>
  20. </view>
  21. </view>
  22. <view class="item_box rx-bc">
  23. <view class="item_one perce50 rx-sc">
  24. <view class="lable">规则名称:</view>
  25. <view>{{item.ruleName}}</view>
  26. </view>
  27. </view>
  28. <view class="item_box rx-bc">
  29. <view class="item_one perce50 rx-sc">
  30. <view class="lable">截止时间:</view>
  31. <view>{{item.planFinishTime}}</view>
  32. </view>
  33. </view>
  34. </view>
  35. </u-list-item>
  36. <u-list-item v-if="list.length === 0">
  37. <view style='margin-top: 20vh;'>
  38. <u-empty iconSize='150' textSize='32' text='暂无工单'>
  39. </u-empty>
  40. </view>
  41. </u-list-item>
  42. </u-list>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. props: {
  49. type: {
  50. type: [String, Number]
  51. },
  52. list: {
  53. type: Array,
  54. default: () => []
  55. }
  56. },
  57. data() {
  58. return {
  59. dict: {
  60. status: {
  61. 0: '待接收',
  62. 2: '执行中',
  63. 3: '已完成'
  64. },
  65. //紧急程度
  66. urgent: {
  67. 1: '普通',
  68. 2: '紧急',
  69. 3: '重要'
  70. }
  71. }
  72. }
  73. },
  74. methods: {
  75. goDetail(item) {
  76. uni.navigateTo({
  77. url: `/pages/maintenance/detail/detail?id=${item.id}&planId=${item.planId}&code=${item.code}&&orderType=1`
  78. })
  79. },
  80. isClass() {
  81. switch (String(this.type)) {
  82. case '0':
  83. return 'd1'
  84. break
  85. case '1':
  86. return 'd2'
  87. break
  88. case '3':
  89. return 'd3'
  90. break
  91. default:
  92. break
  93. }
  94. }
  95. }
  96. }
  97. </script>
  98. <style lang="scss" scoped>
  99. .marginTop {
  100. border-top: 20rpx solid $page-bg;
  101. }
  102. // .content_box {
  103. // height: 100vh;
  104. // overflow: hidden;
  105. // display: flex;
  106. // flex-direction: column;
  107. // background-color: $page-bg;
  108. // }
  109. .list_box {
  110. flex: 1;
  111. overflow: hidden;
  112. padding: 16rpx 0;
  113. .u-list {
  114. height: 100% !important;
  115. }
  116. }
  117. .card_box {
  118. width: 750rpx;
  119. padding: 16rpx 32rpx;
  120. box-sizing: border-box;
  121. border-bottom: 2rpx solid #E1E1E1;
  122. .item_box {
  123. margin-top: 10rpx;
  124. .round {
  125. width: 40rpx;
  126. height: 40rpx;
  127. line-height: 40rpx;
  128. border-radius: 50%;
  129. background: $theme-color;
  130. color: #fff;
  131. text-align: center;
  132. font-size: 20rpx;
  133. }
  134. .orderId {
  135. color: #000;
  136. font-family: PingFang HK;
  137. font-size: 28rpx;
  138. font-style: normal;
  139. font-weight: 600;
  140. margin-left: 16rpx;
  141. }
  142. .item_one {
  143. width: 100%;
  144. font-size: 26rpx;
  145. font-style: normal;
  146. font-weight: 400;
  147. line-height: 38rpx;
  148. word-wrap: break-word;
  149. .lable {
  150. width: 150rpx;
  151. }
  152. .deviceName {
  153. width: calc(750rpx - 150rpx);
  154. display: -webkit-box;
  155. -webkit-box-orient: vertical;
  156. -webkit-line-clamp: 2;
  157. overflow: hidden;
  158. }
  159. }
  160. .gylx {
  161. color: $theme-color;
  162. }
  163. .perce50 {
  164. width: 100%;
  165. }
  166. }
  167. .flex_between {
  168. display: flex;
  169. justify-content: space-between;
  170. }
  171. }
  172. .state {
  173. font-size: 28rpx;
  174. color: #7f7f7f;
  175. background: #f1f1f1;
  176. display: inline;
  177. padding: 2px 5px;
  178. border-radius: 10px;
  179. }
  180. </style>