index.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <template>
  2. <view class="container">
  3. <uni-navbar title="路线申请"></uni-navbar>
  4. <view class="box" style="overflow: hidden;">
  5. <u-button class="commonMt custom-style" shape="circle" @click="addLine"
  6. color="linear-gradient(to top, #F59A02, #FFD334)">
  7. <view class="button-class">
  8. <image style="width: 29rpx;height: 29rpx;" src="../../static/images/transport/plus.png"
  9. mode="widthFix">
  10. </image>
  11. <text style="margin-left: 19rpx;">新增路线</text>
  12. </view>
  13. </u-button>
  14. <view class="box2">
  15. <view class="commonMb">
  16. <view class="small-box commonBj" @click="changeState(item)" v-for="(item,index) in list"
  17. :key="item.id">
  18. <view class="small-box-middle">
  19. <view class="middle-left">
  20. <view class="circle-green circle-style">
  21. </view>
  22. <view class="small-box-middle-line-left">
  23. </view>
  24. <view class="circle-red circle-style">
  25. </view>
  26. </view>
  27. <view class="middle-middle">
  28. <view class="position-start">
  29. <view class="green bold size24 textStyle">{{item.startName}}</view>
  30. </view>
  31. <view class="position-end">
  32. <text class="red bold size24 textStyle ">{{item.endName}}</text>
  33. </view>
  34. </view>
  35. <view class="middle-right">
  36. <view :class="changeStateClass(item.auditState)" class="small-box-top-right">
  37. <text>{{item.auditState===0? '待审批':item.auditState===-1?'驳 回':'通 过'}}</text>
  38. </view>
  39. </view>
  40. <!-- <view class="small-box-middle-startAndEnd" style="margin-bottom: -6rpx;">
  41. <view class="circle-green circle-style">
  42. </view>
  43. <text class="green textStyle" style="width: 70%;">{{item.startName}}</text>
  44. </view>
  45. <view class="small-box-middle-line">
  46. <view class="small-box-middle-line-left">
  47. </view>
  48. <view :class="changeStateClass(item.auditState)" class="small-box-top-right">
  49. <text>{{item.auditState===0? '待审批':item.auditState===-1?'驳 回':'通 过'}}</text>
  50. </view>
  51. </view>
  52. <view class="small-box-middle-startAndEnd" style="margin-top: -6rpx;">
  53. <view class="circle-red circle-style">
  54. </view>
  55. <text class="red textStyle" style="width: 70%;">{{item.endName}}</text>
  56. </view> -->
  57. </view>
  58. <view class="small-box-bottom mt23">
  59. <view class="small-box-bottom-left">
  60. <image style="width: 25rpx;height: 25rpx;margin-left: 10rpx;"
  61. src="../../static/images/path/enterprise.png" mode="widthFix"></image>
  62. <text class="ml19 font-size-style">发起部门:{{item.startDept}}</text>
  63. </view>
  64. <view class="small-box-bottom-left">
  65. <image style="width: 25rpx;height: 25rpx;" src="../../static/images/transport/time.png"
  66. mode="widthFix">
  67. </image>
  68. <text class="mr15 ml19 font-size-style">发起时间:{{changeTime(item.createTime)}}</text>
  69. </view>
  70. <!-- <text class="mr15 ml19 font-size-style">发起时间:2022/8/24 16:46</text> -->
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </template>
  79. <script>
  80. import {
  81. routeList
  82. } from "../../api/company/path.js"
  83. export default {
  84. data() {
  85. return {
  86. list: []
  87. }
  88. },
  89. methods: {
  90. changeTime(time) {
  91. if (time) {
  92. return time.slice(0, time.length - 3).replace(/-/g, "/")
  93. } else {
  94. return '无'
  95. }
  96. },
  97. routeList() {
  98. routeList().then(res => {
  99. console.log(res, 'res');
  100. this.list = res.rows;
  101. })
  102. },
  103. addLine() {
  104. this.$tab.navigateTo('/pages/addPath/index')
  105. },
  106. changeStateClass(state) {
  107. switch (state) {
  108. case 0:
  109. return 'state-class1'
  110. case -1:
  111. return 'state-class2'
  112. case 1:
  113. return 'state-class3'
  114. }
  115. },
  116. changeDate(date) {
  117. return date.substring(0, 4) + '年' + date.substring(4, 6) + '月' + date.substring(6)
  118. },
  119. changeState(item) {
  120. console.log('item', item);
  121. if (item.auditState == '-1') {
  122. this.$tab.navigateTo('/pages/addPath/index?id=' + item.id)
  123. } else if (item.auditState == '1') {
  124. this.$tab.navigateTo('/pages/pathInfo/index?id=' + item.id)
  125. }
  126. }
  127. },
  128. onShow() {
  129. console.log('初始化了', '111');
  130. this.routeList()
  131. }
  132. }
  133. </script>
  134. <style lang="scss" scoped>
  135. //
  136. .deepRed {
  137. color: #E54504
  138. }
  139. .deepGreen {
  140. color: #088243
  141. }
  142. .custom-style {
  143. font-size: 28rpx;
  144. height: 66rpx;
  145. line-height: 66rpx;
  146. font-size: 28rpx;
  147. font-weight: bold;
  148. color: #FFFFFF;
  149. margin-bottom: 25rpx;
  150. .button-class {
  151. display: flex;
  152. justify-content: center;
  153. align-items: center;
  154. }
  155. }
  156. .small-box-top-right {
  157. text-align: center;
  158. width: 103rpx;
  159. height: 45rpx;
  160. border-radius: 15rpx;
  161. font-size: 26rpx;
  162. font-weight: bold;
  163. color: #FFFFFF;
  164. line-height: 45rpx;
  165. margin-left: 30rpx;
  166. }
  167. .small-box {
  168. margin-bottom: 30rpx;
  169. margin-top: 20rpx;
  170. padding: 22rpx;
  171. .small-box-top {
  172. display: flex;
  173. justify-content: space-between;
  174. align-items: center;
  175. .small-box-top-left {
  176. display: flex;
  177. align-items: center;
  178. uni-text {
  179. font-size: 28rpx;
  180. font-weight: bold;
  181. color: #333333;
  182. margin-left: 18rpx;
  183. }
  184. }
  185. }
  186. .small-box-date {
  187. display: flex;
  188. align-items: center;
  189. margin-top: 24rpx;
  190. }
  191. .small-box-bottom {
  192. display: flex;
  193. justify-content: space-between;
  194. align-items: center;
  195. .small-box-bottom-left {
  196. display: flex;
  197. align-items: center;
  198. }
  199. }
  200. }
  201. .ml19 {
  202. margin-left: 10rpx;
  203. }
  204. .mt23 {
  205. margin-top: 23rpx;
  206. }
  207. .mr15 {
  208. margin-right: 15rpx;
  209. }
  210. .font-size-style {
  211. font-size: 24rpx;
  212. font-weight: 400;
  213. color: #485B93;
  214. }
  215. .state-class1 {
  216. background: linear-gradient(90deg, #F59A02 0%, #FFD334 100%);
  217. }
  218. .state-class2 {
  219. background: linear-gradient(90deg, #FF2D04 0%, #FFA53E 100%);
  220. }
  221. .state-class3 {
  222. background: linear-gradient(90deg, #3FC377 0%, #83D992 100%);
  223. }
  224. </style>