transportPerson.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <!--运输人员管理-->
  2. <template>
  3. <view id="transportPerson">
  4. <view class="tabTitle">
  5. <view class="tabTitle_li" @tap="tabClick(index)" :key="index" v-for="(item,index) in tabText">
  6. <view :class="{on:curTab==index}" class="tabTitle_text">{{item}}</view>
  7. <view :class="{on:curTab==index}" class="tabTitle_across"></view>
  8. </view>
  9. </view>
  10. <scroll-view scroll-y @scrolltolower="scrollGet" class="scroll-box">
  11. <view class="list" >
  12. <view class="list_li" @click="detailClick(item)" v-for="(item,index) in dataList" :key="index">
  13. <img class="for-back-img" src="@/pages_supplier/images/icon_ysry_ry.png">
  14. <text class="list_li_text">{{item.userName}}</text>
  15. <text class="list_li_text2">{{item.phone}}</text>
  16. <text class="list_li_text3" v-if="item.pastDue==1">证照过期</text>
  17. </view>
  18. </view>
  19. </scroll-view>
  20. <view class="empty" v-if="pageType==2">
  21. <img class="for-back-img" src=@/pages_supplier/images/img_ysrygl_zwsj.png">
  22. <view>暂无数据</view>
  23. </view>
  24. <view class="sub_btn" @click="addBtn()">新增运输人员</view>
  25. </view>
  26. </template>
  27. <script>
  28. import { transportUserList } from '@/api/apiDemo/index.js'
  29. export default {
  30. name: "transportPerson",
  31. data() {
  32. return {
  33. pageType:1,
  34. //列表请求参数
  35. params:{
  36. isAudit:1,//是否已经审核(0=未审核,1=已经审核,2=审核未通过
  37. },
  38. userType:uni.getStorageSync('userType'),
  39. curTab:0,
  40. tabText:['已通过','待审核','未通过'],
  41. dataList:[],
  42. }
  43. },
  44. onLoad() {
  45. },
  46. onShow() {
  47. },
  48. mounted(){
  49. this.getList();
  50. },
  51. methods: {
  52. //顶部tab点击
  53. tabClick(index) {
  54. this.curTab = index;
  55. if(index==0){
  56. this.params.isAudit=1
  57. }else if(index==1){
  58. this.params.isAudit=0
  59. }else if(index==2){
  60. this.params.isAudit=2
  61. }
  62. this.getList();
  63. },
  64. //滚动加载事件
  65. scrollGet(){
  66. if(this.getData.getType){
  67. this.getData.pageNum += 1;
  68. this.getList();
  69. }
  70. },
  71. addBtn(){
  72. uni.redirectTo({
  73. url:'/pages_supplier/transportPerson/transportPersonAdd?status=0'
  74. });
  75. },
  76. detailClick(d){
  77. let id=d.id;
  78. uni.redirectTo({
  79. url:'/pages_supplier/transportPerson/transportPersonDetail?id='+id
  80. });
  81. },
  82. //获取列表数据
  83. async getList(){
  84. let _this = this;
  85. _this.dataList=[];
  86. const {data} = await transportUserList(_this.params)
  87. if(data.code==200){
  88. let res=data.data;
  89. if(res.length>0){
  90. this.dataList=res
  91. this.pageType=1
  92. }else{
  93. this.pageType=2
  94. }
  95. }
  96. },
  97. }
  98. }
  99. </script>
  100. <style lang="stylus" scoped>
  101. #transportPerson {
  102. height: 100%;
  103. width: 100%;
  104. flex :1;
  105. display flex;
  106. flex-direction column
  107. overflow hidden
  108. .tabTitle{
  109. display flex;
  110. width:100%;
  111. height: 100rpx;
  112. background: #fff;
  113. margin-bottom 16rpx;
  114. .tabTitle_li{
  115. width:146rpx;
  116. text-align center;
  117. margin-top: 16rpx;
  118. .tabTitle_text{
  119. display: inline-block;
  120. font-size: 28rpx;
  121. font-family: PingFang SC;
  122. font-weight: 500;
  123. color: #333333;
  124. line-height: 64rpx;
  125. &.on{
  126. color:#0183FA;
  127. }
  128. }
  129. .tabTitle_across{
  130. width: 50rpx;
  131. height: 6rpx;
  132. background: #0183FA;
  133. border-radius: 3rpx;
  134. margin-left 50rpx;
  135. display none;
  136. &.on{
  137. display block;
  138. }
  139. }
  140. }
  141. }
  142. .scroll-box{
  143. // flex:1;
  144. overflow-y scroll;
  145. .list{
  146. background: #FFFFFF;
  147. border-radius: 20rpx;
  148. margin: 0 20rpx;
  149. padding: 0 20rpx;
  150. box-sizing: border-box;
  151. .list_li{
  152. height: 110rpx;
  153. display: flex;
  154. align-items: center;
  155. border-bottom:1px solid #f5f5f5;
  156. >img{
  157. width: 60rpx;
  158. height: 60rpx;
  159. }
  160. >text{
  161. font-size: 28rpx;
  162. font-family: PingFang SC;
  163. font-weight: 500;
  164. color: #333333;
  165. line-height: 28rpx;
  166. display: inline-block;
  167. }
  168. .list_li_text{
  169. margin-left: 30rpx;
  170. width: 126rpx;
  171. }
  172. .list_li_text2{
  173. margin-left: 30rpx;
  174. width: 322rpx;
  175. }
  176. .list_li_text3{
  177. font-size: 24rpx;
  178. font-family: PingFang SC;
  179. font-weight: 500;
  180. color: #FF3131;
  181. line-height: 24rpx;
  182. }
  183. }
  184. }
  185. }
  186. .empty{
  187. text-align: center;
  188. margin-top: 316rpx;
  189. >img{
  190. width: 336rpx;
  191. height: 222rpx;
  192. margin-left: 208rpx;
  193. }
  194. >view{
  195. font-size: 30rpx;
  196. font-family: PingFang SC;
  197. font-weight: 500;
  198. color: #E0E0E0;
  199. line-height: 30rpx;
  200. margin-top: 48rpx;
  201. }
  202. }
  203. /* 按钮 */
  204. .sub_btn{
  205. width: 650rpx;
  206. height: 100rpx;
  207. background: #0183FA;
  208. border-radius: 20rpx;
  209. font-size: 28rpx;
  210. font-family: PingFang SC;
  211. font-weight: 500;
  212. color: #FFFFFF;
  213. line-height: 100rpx;
  214. text-align: center;
  215. margin-left: 50rpx;
  216. position: fixed;
  217. bottom:30rpx;
  218. z-index: 1000;
  219. }
  220. }
  221. </style>