customer-management.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  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)">审核</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. loadMore() {
  86. this.status = 'loading';
  87. if (this.dataCount > this.pageSize * this.pageNo) {
  88. this.pageSize = parseInt(this.pageSize) + 3;
  89. this.getCustomerList();
  90. } else {
  91. this.status = 'nomore';
  92. }
  93. },
  94. getCustomerList() {
  95. this.$api.getCustomerList({
  96. current: this.current,
  97. pageNo: this.pageNo,
  98. pageSize: this.pageSize,
  99. dataCount: this.dataCount,
  100. }).then(resp => {
  101. let customerList = resp.data;
  102. for (let i in customerList) {
  103. if (customerList[i].judgeStatus == 1) {
  104. customerList[i].btnShow = 1;
  105. }
  106. }
  107. this.dataCount = resp.dataCount;
  108. this.pageNo = resp.pageNo;
  109. this.customerItemList = customerList;
  110. if (this.dataCount < this.pageSize * this.pageNo) this.status = 'nomore';
  111. })
  112. },
  113. confirmCustomer() {
  114. this.$api.confirmCustomer({
  115. customerId: this.confirmCustomerId,
  116. judgeContent: this.judgeContent,
  117. }).then(resp => {
  118. if (resp.code == 200) {
  119. this.getCustomerList();
  120. }
  121. })
  122. },
  123. //点击上方切换栏,根据点击项重新加载数据
  124. change(obj) {
  125. console.log(obj);
  126. this.current = obj.index;
  127. this.getCustomerList();
  128. },
  129. //点击按钮
  130. //------------------------------------------
  131. sh(data) {
  132. this.$common.to('/pages/customer-management/customer-judge?id='+data.id+'&name='+data.name)
  133. },
  134. shconfirm(val) {
  135. this.judgeContent = val;
  136. this.confirmCustomer();
  137. this.$refs.shpopup.close()
  138. },
  139. addCustomer() {
  140. this.$common.to("/pages/enterprise-reg/enterprise-reg");
  141. },
  142. //------------------------------------------
  143. //上拉加载更多,分页模拟数据
  144. },
  145. onLoad() {
  146. console.log(222)
  147. },
  148. created() {
  149. this.perList = uni.getStorageSync('perList');
  150. this.getCustomerList();
  151. },
  152. onShow() {
  153. },
  154. }
  155. </script>
  156. <style lang="scss">
  157. .card-box {
  158. display: flex;
  159. width: 100%;
  160. flex-direction: column;
  161. .card {
  162. background-color: #fff;
  163. border-radius: 20rpx;
  164. margin: 20rpx 20rpx 0 20rpx;
  165. padding: 30rpx;
  166. box-sizing: border-box;
  167. display: flex;
  168. flex-direction: column;
  169. .t {
  170. width: 100%;
  171. display: flex;
  172. align-items: center;
  173. padding-bottom: 30rpx;
  174. border-bottom: 1rpx solid #f5f5f5;
  175. .icon {
  176. width: 40rpx;
  177. height: 40rpx;
  178. }
  179. .title {
  180. font-size: 30rpx;
  181. font-weight: bold;
  182. margin-left: 20rpx;
  183. }
  184. }
  185. .c {
  186. padding: 15rpx 0 30rpx 0;
  187. display: flex;
  188. flex-wrap: wrap;
  189. border-bottom: 1rpx solid #f5f5f5;
  190. .item {
  191. width: 50%;
  192. padding: 20rpx 0;
  193. display: flex;
  194. .car-num {
  195. background-color: #edf6ff;
  196. color: #0080ff;
  197. font-size: 44rpx;
  198. padding: 15rpx 0;
  199. text-align: center;
  200. width: 100%;
  201. border-radius: 10rpx;
  202. font-weight: bold;
  203. letter-spacing: 20rpx;
  204. }
  205. .p1 {
  206. font-size: 28rpx;
  207. color: #999;
  208. flex: 5;
  209. }
  210. .p2 {
  211. font-size: 28rpx;
  212. color: #191919;
  213. font-weight: bold;
  214. margin-left: 20rpx;
  215. flex: 7;
  216. .licence {
  217. width: 80%;
  218. height: 100rpx;
  219. }
  220. }
  221. }
  222. .car-num-item {
  223. width: 100%;
  224. display: flex;
  225. align-items: center;
  226. justify-content: center;
  227. }
  228. }
  229. .b {
  230. display: flex;
  231. width: 100%;
  232. align-items: center;
  233. justify-content: space-between;
  234. .btn {
  235. height: 70rpx;
  236. display: flex;
  237. align-items: center;
  238. justify-content: center;
  239. //width: calc(50% - 15rpx);
  240. width: 100%;
  241. margin: 30rpx 0 0 0;
  242. border-radius: 10rpx;
  243. border-width: 1rpx;
  244. box-sizing: border-box;
  245. }
  246. .b1 {
  247. background-color: #0080ff;
  248. color: #fff;
  249. }
  250. .b2 {
  251. background-color: #f7f7f7;
  252. color: #191919;
  253. }
  254. .b3 {
  255. background-color: #fff;
  256. color: #0080ff;
  257. border: 1rpx solid #0080ff;
  258. }
  259. }
  260. }
  261. }
  262. .t-btn {
  263. width: 400rpx;
  264. margin: 50rpx auto;
  265. height: 88rpx;
  266. font-weight: bold;
  267. display: flex;
  268. align-items: center;
  269. justify-content: center;
  270. border-radius: 10rpx;
  271. color: #191919;
  272. font-size: 28rpx;
  273. background-color: #fff;
  274. border: 1px solid #eee;
  275. }
  276. .popup-box {
  277. text-align: center;
  278. background-color: #fff;
  279. height: 280rpx;
  280. width: 560rpx;
  281. border-radius: 10rpx;
  282. }
  283. @import '@/common/common.scss'
  284. </style>