customer-management.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="top">
  5. <text class="title">客户管理</text>
  6. </view>
  7. </view>
  8. <view class="t-btn" @click="addCustomer()" v-if="perList.indexOf('tb-costomer-add')!==-1">+添加客户</view>
  9. <u-sticky offset-top="0">
  10. <u-tabs :list="tabs" @change="change" :current="current" :is-scroll="false"></u-tabs>
  11. </u-sticky>
  12. <view class="card-box">
  13. <view class="card" v-for="(customerItem,index) in customerItemList" :key="index">
  14. <view class="t">
  15. <image class="icon" src="../../static/home-icon-01.png"></image>
  16. <text class="title">{{customerItem.name}}</text>
  17. </view>
  18. <view class="c">
  19. <view class="item">
  20. <text class="p1">联系人:</text>
  21. <text class="p2">{{customerItem.dutyPeople}}</text>
  22. </view>
  23. <view class="item">
  24. <text class="p1">联系电话:</text>
  25. <text class="p2">{{customerItem.phone}}</text>
  26. </view>
  27. <view class="item">
  28. <text class="p1">营业执照:</text>
  29. <text class="p2">
  30. <image class="licence" :src="customerItem.businessLicence"></image>
  31. </text>
  32. </view>
  33. <view class="item">
  34. <text class="p1">状态:</text>
  35. <text class="p2">
  36. <text v-if="customerItem.judgeStatus==1">未审核</text>
  37. <text v-if="customerItem.judgeStatus==2">审核通过</text>
  38. <text v-if="customerItem.judgeStatus==3">审核不通过</text>
  39. </text>
  40. </view>
  41. </view>
  42. <view class="b">
  43. <view class="btn b1" v-if="customerItem.btnShow==1 " @click="sh(customerItem.id)">审核</view>
  44. </view>
  45. </view>
  46. </view>
  47. <!-- 没有数据时显示noData -->
  48. <noData v-if="customerItemList.length==0"></noData>
  49. <u-loadmore style="margin: 30rpx;" :status="status" />
  50. <uni-popup ref="shpopup" type="center">
  51. <uni-popup-dialog mode="input" type="success" title="确定审核吗?" placeholder="请输审核意见" :duration="2000" @confirm="shconfirm"></uni-popup-dialog>
  52. </uni-popup>
  53. </view>
  54. </template>
  55. <script>
  56. export default {
  57. data() {
  58. return {
  59. current: 0,
  60. pageNo: 1,
  61. pageSize: 3,
  62. dataCount: 0,
  63. status: 'loadmore',
  64. page: 0,
  65. tabs: [{
  66. name: '全部',
  67. },
  68. {
  69. name: '未审核',
  70. },
  71. {
  72. name: '审核通过',
  73. },
  74. {
  75. name: '禁用',
  76. }
  77. ],
  78. customerItemList: [],
  79. confirmCustomerId: '',
  80. judgeContent: '',
  81. perList: []
  82. }
  83. },
  84. methods: {
  85. getCustomerList() {
  86. this.$api.getCustomerList({
  87. current: this.current,
  88. pageNo: this.pageNo,
  89. pageSize: this.pageSize,
  90. dataCount: this.dataCount,
  91. }).then(resp => {
  92. let customerList = resp.data;
  93. for (let i in customerList) {
  94. if (customerList[i].judgeStatus == 1) {
  95. customerList[i].btnShow = 1;
  96. }
  97. }
  98. this.dataCount = resp.dataCount;
  99. this.pageNo = resp.pageNo;
  100. this.customerItemList = customerList;
  101. if (this.dataCount < this.pageSize * this.pageNo) this.status = 'nomore';
  102. })
  103. },
  104. confirmCustomer() {
  105. this.$api.confirmCustomer({
  106. customerId: this.confirmCustomerId,
  107. judgeContent: this.judgeContent,
  108. }).then(resp => {
  109. if (resp.code == 200) {
  110. this.getCustomerList();
  111. }
  112. })
  113. },
  114. //点击上方切换栏,根据点击项重新加载数据
  115. change(obj) {
  116. console.log(obj);
  117. this.current = obj.index;
  118. this.getCustomerList();
  119. // if(index==0){
  120. // //加载全部
  121. // }
  122. // if(index==1){
  123. // //加载未审核
  124. // }
  125. // if(index==2){
  126. // //只加载审核通过
  127. // }
  128. // if(index==3){
  129. // //只加载禁用
  130. // }
  131. },
  132. //点击按钮
  133. //------------------------------------------
  134. sh(id) {
  135. this.confirmCustomerId = id;
  136. this.$refs.shpopup.open('center')
  137. },
  138. shconfirm(val) {
  139. this.judgeContent = val;
  140. this.confirmCustomer();
  141. this.$refs.shpopup.close()
  142. },
  143. addCustomer() {
  144. this.$common.to("/pages/enterprise-reg/enterprise-reg");
  145. },
  146. //------------------------------------------
  147. //上拉加载更多,分页模拟数据
  148. onReachBottom() {
  149. console.log("上拉");
  150. if (this.dataCount > this.pageSize * this.pageNo) {
  151. this.status = 'loading';
  152. this.pageSize = parseInt(this.pageSize) + 3;
  153. this.getCustomerList();
  154. } else {
  155. this.status = 'nomore';
  156. }
  157. },
  158. },
  159. mounted() {
  160. this.getCustomerList();
  161. },
  162. onShow() {
  163. this.perList = uni.getStorageSync('perList');
  164. console.log(this.perList)
  165. },
  166. }
  167. </script>
  168. <style lang="scss">
  169. .card-box {
  170. display: flex;
  171. width: 100%;
  172. flex-direction: column;
  173. .card {
  174. background-color: #fff;
  175. border-radius: 20rpx;
  176. margin: 20rpx 20rpx 0 20rpx;
  177. padding: 30rpx;
  178. box-sizing: border-box;
  179. display: flex;
  180. flex-direction: column;
  181. .t {
  182. width: 100%;
  183. display: flex;
  184. align-items: center;
  185. padding-bottom: 30rpx;
  186. border-bottom: 1rpx solid #f5f5f5;
  187. .icon {
  188. width: 40rpx;
  189. height: 40rpx;
  190. }
  191. .title {
  192. font-size: 30rpx;
  193. font-weight: bold;
  194. margin-left: 20rpx;
  195. }
  196. }
  197. .c {
  198. padding: 15rpx 0 30rpx 0;
  199. display: flex;
  200. flex-wrap: wrap;
  201. border-bottom: 1rpx solid #f5f5f5;
  202. .item {
  203. width: 50%;
  204. padding: 20rpx 0;
  205. display: flex;
  206. .car-num {
  207. background-color: #edf6ff;
  208. color: #0080ff;
  209. font-size: 44rpx;
  210. padding: 15rpx 0;
  211. text-align: center;
  212. width: 100%;
  213. border-radius: 10rpx;
  214. font-weight: bold;
  215. letter-spacing: 20rpx;
  216. }
  217. .p1 {
  218. font-size: 28rpx;
  219. color: #999;
  220. flex: 5;
  221. }
  222. .p2 {
  223. font-size: 28rpx;
  224. color: #191919;
  225. font-weight: bold;
  226. margin-left: 20rpx;
  227. flex: 7;
  228. .licence {
  229. width: 80%;
  230. height: 100rpx;
  231. }
  232. }
  233. }
  234. .car-num-item {
  235. width: 100%;
  236. display: flex;
  237. align-items: center;
  238. justify-content: center;
  239. }
  240. }
  241. .b {
  242. display: flex;
  243. width: 100%;
  244. align-items: center;
  245. justify-content: space-between;
  246. .btn {
  247. height: 70rpx;
  248. display: flex;
  249. align-items: center;
  250. justify-content: center;
  251. //width: calc(50% - 15rpx);
  252. width: 100%;
  253. margin: 30rpx 0 0 0;
  254. border-radius: 10rpx;
  255. border-width: 1rpx;
  256. box-sizing: border-box;
  257. }
  258. .b1 {
  259. background-color: #0080ff;
  260. color: #fff;
  261. }
  262. .b2 {
  263. background-color: #f7f7f7;
  264. color: #191919;
  265. }
  266. .b3 {
  267. background-color: #fff;
  268. color: #0080ff;
  269. border: 1rpx solid #0080ff;
  270. }
  271. }
  272. }
  273. }
  274. .t-btn {
  275. width: 400rpx;
  276. margin: 50rpx auto;
  277. height: 88rpx;
  278. font-weight: bold;
  279. display: flex;
  280. align-items: center;
  281. justify-content: center;
  282. border-radius: 10rpx;
  283. color: #191919;
  284. font-size: 28rpx;
  285. background-color: #fff;
  286. border: 1px solid #eee;
  287. }
  288. .popup-box {
  289. text-align: center;
  290. background-color: #fff;
  291. height: 280rpx;
  292. width: 560rpx;
  293. border-radius: 10rpx;
  294. }
  295. @import '@/common/common.scss'
  296. </style>