customer-management.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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. 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(id) {
  132. this.confirmCustomerId = id;
  133. this.$refs.shpopup.open('center')
  134. },
  135. shconfirm(val) {
  136. this.judgeContent = val;
  137. this.confirmCustomer();
  138. this.$refs.shpopup.close()
  139. },
  140. addCustomer() {
  141. this.$common.to("/pages/enterprise-reg/enterprise-reg");
  142. },
  143. //------------------------------------------
  144. //上拉加载更多,分页模拟数据
  145. },
  146. onLoad() {
  147. console.log(222)
  148. },
  149. created() {
  150. this.perList = uni.getStorageSync('perList');
  151. this.getCustomerList();
  152. },
  153. onShow() {
  154. },
  155. }
  156. </script>
  157. <style lang="scss">
  158. .card-box {
  159. display: flex;
  160. width: 100%;
  161. flex-direction: column;
  162. .card {
  163. background-color: #fff;
  164. border-radius: 20rpx;
  165. margin: 20rpx 20rpx 0 20rpx;
  166. padding: 30rpx;
  167. box-sizing: border-box;
  168. display: flex;
  169. flex-direction: column;
  170. .t {
  171. width: 100%;
  172. display: flex;
  173. align-items: center;
  174. padding-bottom: 30rpx;
  175. border-bottom: 1rpx solid #f5f5f5;
  176. .icon {
  177. width: 40rpx;
  178. height: 40rpx;
  179. }
  180. .title {
  181. font-size: 30rpx;
  182. font-weight: bold;
  183. margin-left: 20rpx;
  184. }
  185. }
  186. .c {
  187. padding: 15rpx 0 30rpx 0;
  188. display: flex;
  189. flex-wrap: wrap;
  190. border-bottom: 1rpx solid #f5f5f5;
  191. .item {
  192. width: 50%;
  193. padding: 20rpx 0;
  194. display: flex;
  195. .car-num {
  196. background-color: #edf6ff;
  197. color: #0080ff;
  198. font-size: 44rpx;
  199. padding: 15rpx 0;
  200. text-align: center;
  201. width: 100%;
  202. border-radius: 10rpx;
  203. font-weight: bold;
  204. letter-spacing: 20rpx;
  205. }
  206. .p1 {
  207. font-size: 28rpx;
  208. color: #999;
  209. flex: 5;
  210. }
  211. .p2 {
  212. font-size: 28rpx;
  213. color: #191919;
  214. font-weight: bold;
  215. margin-left: 20rpx;
  216. flex: 7;
  217. .licence {
  218. width: 80%;
  219. height: 100rpx;
  220. }
  221. }
  222. }
  223. .car-num-item {
  224. width: 100%;
  225. display: flex;
  226. align-items: center;
  227. justify-content: center;
  228. }
  229. }
  230. .b {
  231. display: flex;
  232. width: 100%;
  233. align-items: center;
  234. justify-content: space-between;
  235. .btn {
  236. height: 70rpx;
  237. display: flex;
  238. align-items: center;
  239. justify-content: center;
  240. //width: calc(50% - 15rpx);
  241. width: 100%;
  242. margin: 30rpx 0 0 0;
  243. border-radius: 10rpx;
  244. border-width: 1rpx;
  245. box-sizing: border-box;
  246. }
  247. .b1 {
  248. background-color: #0080ff;
  249. color: #fff;
  250. }
  251. .b2 {
  252. background-color: #f7f7f7;
  253. color: #191919;
  254. }
  255. .b3 {
  256. background-color: #fff;
  257. color: #0080ff;
  258. border: 1rpx solid #0080ff;
  259. }
  260. }
  261. }
  262. }
  263. .t-btn {
  264. width: 400rpx;
  265. margin: 50rpx auto;
  266. height: 88rpx;
  267. font-weight: bold;
  268. display: flex;
  269. align-items: center;
  270. justify-content: center;
  271. border-radius: 10rpx;
  272. color: #191919;
  273. font-size: 28rpx;
  274. background-color: #fff;
  275. border: 1px solid #eee;
  276. }
  277. .popup-box {
  278. text-align: center;
  279. background-color: #fff;
  280. height: 280rpx;
  281. width: 560rpx;
  282. border-radius: 10rpx;
  283. }
  284. @import '@/common/common.scss'
  285. </style>