OrderTask.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <view class="content_box">
  3. <!-- 站号筛选 -->
  4. <view class="group-tab-bar rx-sc" v-if="clientEnvironmentId==10">
  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. clientEnvironmentId:
  71. uni.getStorageSync("userInfo") &&
  72. uni.getStorageSync("userInfo").clientEnvironmentId,
  73. groupTabs: [
  74. { label: '全部', groupId: null },
  75. { label: '5号站', groupId: '2008729845612720129' },
  76. { label: '6号站', groupId: '2008729929536548865' },
  77. { label: '7号站', groupId: '2008730320160468994' }
  78. ],
  79. dict: {
  80. status: {
  81. 0: '待接收',
  82. 2: '执行中',
  83. 3: '已完成'
  84. },
  85. //紧急程度
  86. urgent: {
  87. 1: '普通',
  88. 2: '紧急',
  89. 3: '重要'
  90. }
  91. }
  92. }
  93. },
  94. methods: {
  95. goDetail(item) {
  96. uni.navigateTo({
  97. url: `/pages/maintenance/detail/detail?id=${item.id}&planId=${item.planId}&code=${item.code}&&orderType=1`
  98. })
  99. },
  100. switchGroup(groupId) {
  101. this.$emit('changeGroup', groupId)
  102. },
  103. isClass() {
  104. switch (String(this.type)) {
  105. case '0':
  106. return 'd1'
  107. break
  108. case '1':
  109. return 'd2'
  110. break
  111. case '3':
  112. return 'd3'
  113. break
  114. default:
  115. break
  116. }
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="scss" scoped>
  122. .group-tab-bar {
  123. background: #fff;
  124. padding: 16rpx 32rpx;
  125. border-bottom: 2rpx solid #e1e1e1;
  126. gap: 16rpx;
  127. }
  128. .group-tab-item {
  129. padding: 8rpx 24rpx;
  130. font-size: 28rpx;
  131. color: #666;
  132. border-radius: 32rpx;
  133. background: #f5f5f5;
  134. white-space: nowrap;
  135. &.active {
  136. background: $theme-color;
  137. color: #fff;
  138. }
  139. }
  140. .marginTop {
  141. border-top: 20rpx solid $page-bg;
  142. }
  143. // .content_box {
  144. // height: 100vh;
  145. // overflow: hidden;
  146. // display: flex;
  147. // flex-direction: column;
  148. // background-color: $page-bg;
  149. // }
  150. .list_box {
  151. flex: 1;
  152. overflow: hidden;
  153. padding: 16rpx 0;
  154. .u-list {
  155. height: 100% !important;
  156. }
  157. }
  158. .card_box {
  159. width: 750rpx;
  160. padding: 16rpx 32rpx;
  161. box-sizing: border-box;
  162. border-bottom: 2rpx solid #E1E1E1;
  163. .item_box {
  164. margin-top: 10rpx;
  165. .round {
  166. width: 40rpx;
  167. height: 40rpx;
  168. line-height: 40rpx;
  169. border-radius: 50%;
  170. background: $theme-color;
  171. color: #fff;
  172. text-align: center;
  173. font-size: 20rpx;
  174. }
  175. .orderId {
  176. color: #000;
  177. font-family: PingFang HK;
  178. font-size: 28rpx;
  179. font-style: normal;
  180. font-weight: 600;
  181. margin-left: 16rpx;
  182. }
  183. .item_one {
  184. width: 100%;
  185. font-size: 26rpx;
  186. font-style: normal;
  187. font-weight: 400;
  188. line-height: 38rpx;
  189. word-wrap: break-word;
  190. .lable {
  191. width: 150rpx;
  192. }
  193. .deviceName {
  194. width: calc(750rpx - 150rpx);
  195. display: -webkit-box;
  196. -webkit-box-orient: vertical;
  197. -webkit-line-clamp: 2;
  198. overflow: hidden;
  199. }
  200. }
  201. .gylx {
  202. color: $theme-color;
  203. }
  204. .perce50 {
  205. width: 100%;
  206. }
  207. }
  208. .flex_between {
  209. display: flex;
  210. justify-content: space-between;
  211. }
  212. }
  213. .state {
  214. font-size: 28rpx;
  215. color: #7f7f7f;
  216. background: #f1f1f1;
  217. display: inline;
  218. padding: 2px 5px;
  219. border-radius: 10px;
  220. }
  221. </style>