OrderTask.vue 4.6 KB

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