customer-management.vue 7.4 KB

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