Bläddra i källkod

filterCustomTable

huangbin 4 år sedan
förälder
incheckning
226e108477

+ 2 - 1
src/views/platinum/platinum_customer_info/list/setup.ts

@@ -8,13 +8,14 @@ export function handleSearch(querytype: 1 | 2 | 3 | 4, queryTable: Function) {
     function search(value: any) {
         const { includesub, name, nickname, userid, userinfotype } = value;
         const param: QueryCustomerInfoReq = {
-            includesub,     // 是否包含子级 1-包含
+            // includesub,     // 是否包含子级 1-包含
             querytype,  // 查询类型 1:未提交(网上开户表) 2:待审核(网上开户表) 3:正常 4:停用
             customername: name[0],  // 客户名称(模糊匹配)
             nickname: nickname[0],     // 昵称(模糊匹配)
             userinfotype: userinfotype[0] ? userinfotype[0] : 0,
             userid: userid[0] ? userid[0] : getUserId()
         };
+        (includesub !== undefined) && (param.includesub = includesub)
         cache = param
         queryTable(queryCustomerInfo, param);
     }

+ 79 - 0
src/views/platinum/platinum_customer_info/list/unsubmit/compoments/filterTable/index.vue

@@ -0,0 +1,79 @@
+<template>
+  <!-- 过滤客户资料表格 -->
+  <div class="filterTable">
+    <FilterOption :selectList="selectList"
+                  :inputList="inputList"
+                  :fixedBtnList="fixedBtnList">
+    </FilterOption>
+    <slot></slot>
+  </div>
+</template>
+
+<script lang="ts">
+import FilterOption from '@/common/components/filter/index.vue';
+import { defineComponent } from 'vue';
+import { handleFilter, InputList, SelectList } from '@/common/setup/filter';
+import { ref } from 'vue';
+import { queryTableList } from '@/common/setup/table/list';
+import { initData } from '@/common/methods';
+import { queryParentAreaList } from '@/services/go/ermcp/qhj';
+import { QhjParentAreaList } from '@/services/go/ermcp/qhj/interface';
+
+export default defineComponent({
+    name: 'filter-custom-unsubmit',
+    components: { FilterOption },
+    setup(props, context) {
+        const select = ref<SelectList[]>([
+            {
+                value: undefined,
+                key: 'userinfotype',
+                placeholder: '全部客户类型',
+                list: [
+                    { value: 1, lable: '个人' },
+                    { value: 2, lable: '企业' },
+                ],
+            },
+            {
+                value: undefined,
+                key: 'userid',
+                placeholder: '请选择子机构',
+                list: [],
+            },
+        ]);
+        const input: InputList[] = [
+            { value: '', placeholder: '模糊搜索客户简称', key: 'nickname' },
+            { value: '', placeholder: '模糊搜索客户名称', key: 'name' },
+            // { value: '', placeholder: '模糊搜索手机号码', key: 'phone' },
+        ];
+        // 是否包含子级 1-包含
+        const includesub = ref<boolean>(false);
+        const param = {
+            search(result: any) {
+                result.includesub = includesub.value ? 1 : 0;
+            },
+            reset() {
+                includesub.value = false;
+            },
+        };
+        const { selectList, inputList, fixedBtnList } = handleFilter(select, input, context, param);
+        const { queryTable } = queryTableList<QhjParentAreaList>();
+        initData(() => {
+            queryTable(queryParentAreaList).then((res) => {
+                select.value[1].list = res.map((e) => {
+                    return { value: e.userid, lable: e.accountname };
+                });
+            });
+        });
+
+        return {
+            selectList,
+            includesub,
+            inputList,
+            fixedBtnList,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;

+ 1 - 1
src/views/platinum/platinum_customer_info/list/unsubmit/index.vue

@@ -39,7 +39,7 @@
 <script lang="ts">
 import { defineComponent, initData, getTableColumns, getTableEvent, queryTableList, contextMenu, BtnList, _getBtnList } from '@/common/export/table';
 
-import { filterCustomTable } from '../../compoments';
+import filterCustomTable from './compoments/filterTable/index.vue';
 import { getStatusName } from '@/common/constants/enumsName';
 import { getCardTypeEnumItemName } from '@/common/constants/enumsName';
 import Middle from '@/views/platinum/platinum_customer_info/compoments/controlModal/index.vue';