sunlupeng 7 månader sedan
förälder
incheckning
234156d0c7

+ 8 - 0
src/api/vip.js

@@ -47,3 +47,11 @@ export function setState(query) {
     params:query
   })
 }
+
+export function vipLevel(query) {
+  return request({
+    url: '/customer-vip/list/level',
+    method: 'get',
+    params: query
+  })
+}

+ 1 - 1
src/views/customer/business.vue

@@ -261,7 +261,7 @@ export default {
         })
     },
     handleDownload() {
-      window.location.href = process.env.BASE_API + '/customer-business/export?companyName=' + this.listQuery.companyName;
+      window.location.href = process.env.BASE_API + '/customer-business/export';
     },
     changeState(id, status) {
             setState({ id: id, status: status }).then(response => {

+ 1 - 1
src/views/customer/distributor.vue

@@ -299,7 +299,7 @@ export default {
         })
     },
     handleDownload() {
-      window.location.href = process.env.BASE_API + '/customer-distributor/export?companyName=' + this.listQuery.companyName + '&companyLevel=' + this.listQuery.companyLevel;
+      window.location.href = process.env.BASE_API + '/customer-distributor/export';
     },
     changeState(id, status) {
             setState({ id: id, status: status }).then(response => {

+ 2 - 2
src/views/customer/guest.vue

@@ -30,7 +30,7 @@
       <el-table-column align="center" min-width="100px" label="客户姓名" prop="customerName">
       </el-table-column>
 
-      <el-table-column align="center" min-width="80px" label="性别" prop="sex">
+      <el-table-column align="center" min-width="80px" label="性别" prop="sexStr">
       </el-table-column>
 
       <el-table-column align="center" min-width="80px" label="联系方式" prop="customerPhone">
@@ -258,7 +258,7 @@ export default {
       })
     },
     handleDownload() {
-      window.location.href = process.env.BASE_API + '/customer-guest/export?customerName=' + this.listQuery.customerName + '&sex=' + this.listQuery.sex + '&customerCode=' + this.listQuery.customerCode;
+      window.location.href = process.env.BASE_API + '/customer-guest/export';
     },
     changeState(id, status) {
       setState({ id: id, status: status }).then(response => {

+ 33 - 14
src/views/customer/vip.vue

@@ -9,12 +9,14 @@
         <el-option :key="item.type" v-for="item in sexList" :label="item.name" :value="item.type">
         </el-option>
       </el-select>
-      <el-input clearable class="filter-item" style="width: 200px;" placeholder="注册渠道"
-        v-model="listQuery.registerChannel">
-      </el-input>
-      <el-input clearable class="filter-item" style="width: 200px;" placeholder="会员等级"
-        v-model="listQuery.customerLevel">
-      </el-input>
+      <el-select class="filter-item" style="width: 200px" v-model="listQuery.registerChannel" clearable placeholder="注册渠道">
+        <el-option :key="item.dictLabel" v-for="item in register_channel" :label="item.dictLabel" :value="item.dictLabel">
+        </el-option>
+      </el-select>
+      <el-select class="filter-item" style="width: 200px" v-model="listQuery.customerLevel" clearable placeholder="会员等级">
+        <el-option :key="item.id" v-for="item in customer_level" :label="item.level" :value="item.level">
+        </el-option>
+      </el-select>
       <el-select v-model="listQuery.status" clearable placeholder="状态" class="filter-item" style="width: 200px;">
         <el-option :key="item.type" v-for="item in statusList" :label="item.name" :value="item.type">
         </el-option>
@@ -38,7 +40,7 @@
       <el-table-column align="center" min-width="100px" label="会员姓名" prop="customerName">
       </el-table-column>
 
-      <el-table-column align="center" min-width="80px" label="性别" prop="sex">
+      <el-table-column align="center" min-width="80px" label="性别" prop="sexStr">
       </el-table-column>
 
       <el-table-column align="center" min-width="80px" label="注册渠道" prop="registerChannel">
@@ -94,7 +96,10 @@
           </el-radio-group>
         </el-form-item>
         <el-form-item label="注册渠道" prop="registerChannel">
-          <el-input v-model="dataForm.registerChannel"></el-input>
+          <el-select v-model="dataForm.registerChannel" filterable placeholder="请选择" style="width: 100%">
+            <el-option :key="item.dictLabel" v-for="item in register_channel" :label="item.dictLabel" :value="item.dictLabel">
+            </el-option>
+          </el-select>
         </el-form-item>
         <el-form-item label="会员生日" prop="customerBirthday">
           <el-date-picker style="width: 100%;" v-model="dataForm.customerBirthday" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"></el-date-picker>
@@ -121,23 +126,26 @@
   </div>
 </template>
 <script>
-import { listVip, createVip, updateVip, deleteVip, setState } from '@/api/vip'
+import { listVip, createVip, updateVip, deleteVip, setState, vipLevel } from '@/api/vip';
+import { dataTypeList } from "@/api/public";
 import waves from '@/directive/waves' // 水波纹指令
 
 export default {
   directives: { waves },
   data() {
     return {
-      list: undefined,
+      register_channel:[],
+      customer_level:[],
+      list: [],
       total: undefined,
       listLoading: true,
       sexList: [
         {
-          type: 0,
+          type: '0',
           name: '男'
         },
         {
-          type: 1,
+          type: '1',
           name: '女'
         },
       ],
@@ -183,9 +191,20 @@ export default {
     }
   },
   created() {
-    this.getList()
+    this.getDictType();
+    this.getList();
   },
   methods: {
+    getDictType(){
+      //注册渠道
+      dataTypeList({ dictType: 'register_channel' }).then(response => {
+        this.register_channel = response.data.data;
+      });
+       //会员等级
+       vipLevel().then(response => {
+        this.customer_level = response.data.data;
+      });
+    },
     /** 重置按钮操作 */
     resetQuery() {
       this.listQuery = {
@@ -311,7 +330,7 @@ export default {
       })
     },
     handleDownload() {
-      window.location.href = process.env.BASE_API + '/customer-vip/export?customerName=' + this.listQuery.customerName + '&sex=' + this.listQuery.sex + '&registerChannel=' + this.listQuery.registerChannel + '&customerLevel=' + this.listQuery.customerLevel;
+      window.location.href = process.env.BASE_API + '/customer-vip/export';
     },
     changeState(id, status) {
       setState({ id: id, status: status }).then(response => {