index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <view class="work-container">
  3. <view class="header">
  4. <u-search placeholder="请输入客户名称" :clearabled="true" @clear="searchDept" @custom="searchDept" v-model="search.deptName" @search="searchDept"></u-search>
  5. </view>
  6. <view style="margin-top: 10px">
  7. <uni-card v-if="item.parentId !==0" v-for="item in deptList" :title="item.deptName" :extra="item.createTime">
  8. <view style="position: relative">
  9. <view>联系人:{{item.leader}}</view>
  10. <view>联系电话:{{item.phone}}</view>
  11. <view style="width: 50px;position: absolute;right:-10px;bottom:0px"><u-button @click="toUser(item)" type="primary" :plain="true" size="mini" text="查看人员"></u-button>
  12. </view>
  13. <view style="width: 50px;position: absolute;right:100rpx;bottom:0rpx"><u-button type="success" @click="toDeviceList(item)" :plain="true" size="mini" text="查看设备"></u-button>
  14. </view>
  15. </view>
  16. </uni-card>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import authObj from '@/plugins/auth.js';
  22. import {getDeptList,getUserListByDept} from '@/api/user/user';
  23. import UText from "../../uni_modules/uview-ui/components/u-text/u-text";
  24. export default {
  25. components: {UText},
  26. data() {
  27. return {
  28. deptList:[],
  29. search:{
  30. deptName:""
  31. }
  32. }
  33. },
  34. onLoad(){
  35. this.getDeptList();
  36. },
  37. methods: {
  38. searchDept(){
  39. this.getDeptList();
  40. },
  41. toUser(item){
  42. uni.navigateTo({
  43. url: '/pages/user/list?deptId='+item.deptId
  44. });
  45. },
  46. toDeviceList(item){
  47. uni.navigateTo({
  48. url: '/pages/device/index?deptId='+item.deptId
  49. });
  50. },
  51. getDeptList(){
  52. getDeptList(this.search.deptName).then(res=>{
  53. this.deptList = res.data;
  54. });
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="scss">
  60. /* #ifndef APP-NVUE */
  61. .u-collapse-content{
  62. display: flex;
  63. flex-direction: column;
  64. }
  65. page {
  66. display: flex;
  67. flex-direction: column;
  68. box-sizing: border-box;
  69. background-color: #fff;
  70. min-height: 100%;
  71. height: auto;
  72. }
  73. view {
  74. font-size: 14px;
  75. line-height: inherit;
  76. }
  77. /* #endif */
  78. .text {
  79. text-align: center;
  80. font-size: 26rpx;
  81. margin-top: 10rpx;
  82. }
  83. .grid-item-box {
  84. flex: 1;
  85. /* #ifndef APP-NVUE */
  86. display: flex;
  87. /* #endif */
  88. flex-direction: column;
  89. align-items: center;
  90. justify-content: center;
  91. padding: 15px 0;
  92. }
  93. .uni-margin-wrap {
  94. width: 690rpx;
  95. width: 100%;
  96. ;
  97. }
  98. .swiper {
  99. height: 300rpx;
  100. }
  101. .swiper-box {
  102. height: 150px;
  103. }
  104. .swiper-item {
  105. /* #ifndef APP-NVUE */
  106. display: flex;
  107. /* #endif */
  108. flex-direction: column;
  109. justify-content: center;
  110. align-items: center;
  111. color: #fff;
  112. height: 300rpx;
  113. line-height: 300rpx;
  114. }
  115. @media screen and (min-width: 500px) {
  116. .uni-swiper-dot-box {
  117. width: 400px;
  118. /* #ifndef APP-NVUE */
  119. margin: 0 auto;
  120. /* #endif */
  121. margin-top: 8px;
  122. }
  123. .image {
  124. width: 100%;
  125. }
  126. }
  127. </style>