index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="10">
  4. <!--用户数据-->
  5. <el-col :span="24" :xs="24">
  6. <div class="panelCol">
  7. <div class="bgWhite">
  8. <div class="titleDiv">
  9. <span class="line"></span>
  10. <span class="title">客户信息列表</span>
  11. <el-button
  12. class="exportBtn"
  13. type="warning"
  14. icon="el-icon-download"
  15. size="mini"
  16. @click="handleExport"
  17. v-hasPermi="['system:role:export']"
  18. >导出</el-button>
  19. </div>
  20. <el-table v-loading="loading" :data="customerList">
  21. <el-table-column label="客户号" width="120" align="center" prop="custid" />
  22. <el-table-column label="姓名" align="center" prop="name" :show-overflow-tooltip="true" />
  23. <el-table-column label="证件类型" align="center" prop="idtype" :show-overflow-tooltip="true" >
  24. <template slot-scope="scope">
  25. <span>身份证</span>
  26. </template>
  27. </el-table-column>
  28. <el-table-column label="证件号码" width="160" align="center" prop="idcard" :show-overflow-tooltip="true" />
  29. <el-table-column label="性别" align="center" prop="gender" width="70">
  30. <template slot-scope="scope">
  31. <span v-if="scope.row.gender == 0">男</span>
  32. <span v-else>女</span>
  33. </template>
  34. </el-table-column>
  35. <el-table-column label="出生日期" align="center" width="150">
  36. <template slot-scope="scope">
  37. <span>{{ parseTime(scope.row.birthday,'{yy}-{mm}-{dd}') }}</span>
  38. </template>
  39. </el-table-column>
  40. <el-table-column label="年龄" align="center" prop="age" width="70" />
  41. <el-table-column label="客户等级" align="center" prop="level" width="80">
  42. <template slot-scope="scope">
  43. <span>{{levelText(scope.row.custclass)}}</span>
  44. </template>
  45. </el-table-column>
  46. <el-table-column
  47. label="操作"
  48. align="center"
  49. width="270"
  50. class-name="small-padding fixed-width"
  51. >
  52. <template slot-scope="scope">
  53. <el-button
  54. size="mini"
  55. icon="el-icon-copy-document"
  56. @click="toOverview(scope.row)"
  57. v-hasPermi="['business:customerInformation:overview']"
  58. >概览</el-button>
  59. <el-button
  60. v-if="scope.row.userId !== 1"
  61. size="mini"
  62. type="cyan"
  63. icon="el-icon-warning-outline"
  64. @click="toDetail(scope.row)"
  65. v-hasPermi="['business:customerInformation:detail']"
  66. >详情</el-button>
  67. </template>
  68. </el-table-column>
  69. </el-table>
  70. <pagination
  71. v-show="total>0"
  72. :total="total"
  73. :page.sync="queryParams.pageNum"
  74. :limit.sync="queryParams.pageSize"
  75. @pagination="getList"
  76. />
  77. </div>
  78. </div>
  79. </el-col>
  80. </el-row>
  81. </div>
  82. </template>
  83. <script>
  84. import { listCustomer } from "@/api/customerInformation/customerInformation.js";
  85. import axios from 'axios'
  86. export default {
  87. name: "CustomerList",
  88. data() {
  89. return {
  90. // 遮罩层
  91. loading: false,
  92. // 总条数
  93. total: 0,
  94. // 用户表格数据
  95. // userList: null,
  96. customerList: [],
  97. // 查询参数
  98. queryParams: {
  99. pageNum: 1,
  100. pageSize: 10
  101. },
  102. };
  103. },
  104. watch: {
  105. },
  106. created() {
  107. this.getList();
  108. },
  109. methods: {
  110. /** 查询用户列表 */
  111. getList() {
  112. let that = this;
  113. that.loading = true;
  114. Object.assign(
  115. that.queryParams,
  116. that.$route.params
  117. )
  118. console.log(that.queryParams)
  119. if(that.queryParams.education){
  120. that.queryParams.education = that.queryParams.education.join("&");
  121. }
  122. console.log(that.queryParams)
  123. listCustomer(that.queryParams).then(response => {
  124. console.log(response);
  125. this.customerList = response.data.list;
  126. this.total = response.data.total;
  127. this.loading = false;
  128. }
  129. );
  130. },
  131. /** 导出按钮操作 */
  132. handleExport() {
  133. this.download('system/user/export', {
  134. ...this.queryParams
  135. }, `user_${new Date().getTime()}.xlsx`)
  136. },
  137. toOverview(row){
  138. this.$router.push({ path:'/userInfoOverview', query: {id: row.id} })
  139. },
  140. toDetail(row){
  141. this.$router.push({ path:'/userInfoDetails', query: {id: row.id} })
  142. }
  143. }
  144. };
  145. </script>
  146. <style lang="scss" scoped>
  147. .titleDiv{
  148. height: 50px;
  149. line-height: 50px;
  150. .line{
  151. display: inline-block;
  152. height: 14px;
  153. width: 4px;
  154. border-radius: 2px;
  155. background: #013C89;
  156. vertical-align: middle;
  157. }
  158. .title{
  159. font-size: 16px;
  160. color: #013C89;
  161. margin-left: 14px;
  162. vertical-align: middle;
  163. }
  164. .exportBtn{
  165. float: right;
  166. margin-top: 10px;
  167. }
  168. }
  169. </style>