Ver código fonte

修改客户资料

huangbin 4 anos atrás
pai
commit
f32eb0355f

+ 17 - 20
src/views/information/custom/compoments/filterTable/index.vue

@@ -4,8 +4,8 @@
     <a-select label-in-value
               v-model:value="userinfotype"
               placeholder="全部客户类型"
-              style="width: 120px"
-              @change="handleChange">
+              @change="handleChange"
+              style="width: 120px">
       <a-select-option value="1">个人</a-select-option>
       <a-select-option value="2">企业</a-select-option>
     </a-select>
@@ -25,39 +25,37 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, ref, SetupContext } from 'vue';
-
-// 处理 客户类型
-function handleUserInfoType() {
-    interface Value {
-        key?: string;
-        label?: string;
-    }
-    const userinfotype = ref<number>(0);
-    function handleChange(value: Value) {
-        console.log(value);
-    }
-    return { userinfotype, handleChange };
-}
+import { defineComponent, ref, SetupContext, unref } from 'vue';
 
 // 搜索
 function handleSearch(context: SetupContext) {
     const nickname = ref<string>('');
     const name = ref<string>('');
     const phone = ref<string>('');
-
+    interface Value {
+        key: string;
+        value: string;
+    }
+    let useType = '';
+    const userinfotype = ref<number>(0);
+    function handleChange(value: Value) {
+        useType = value.value;
+        search();
+    }
     function search() {
-        const result = { nickname: [nickname.value], name: [name.value], mobile: [phone.value] };
+        const result = { nickname: [nickname.value], name: [name.value], mobile: [phone.value], userinfotype: [useType] };
         context.emit('search', result);
     }
     function reset() {
         nickname.value = '';
         name.value = '';
         phone.value = '';
+        userinfotype.value = 0;
+        useType = '';
         search();
     }
 
-    return { nickname, name, phone, search, reset };
+    return { nickname, name, phone, search, reset, userinfotype, handleChange };
 }
 
 export default defineComponent({
@@ -68,7 +66,6 @@ export default defineComponent({
             context.emit('add');
         }
         return {
-            ...handleUserInfoType(),
             ...handleSearch(context),
             add,
         };

+ 1 - 1
src/views/information/custom/list/normal-use/index.vue

@@ -57,7 +57,7 @@ function getCustomList() {
                 title: columntitle,
             };
             if (e.columntitle === '客户类型') {
-                item.onFilter = (value: string, record: QueryCustomInfoType) => record.userinfotype === value;
+                item.onFilter = (value: string, record: QueryCustomInfoType) => record.userinfotype.includes(String(value));
                 item.filteredValue = filtered.userinfotype || null;
             }
             if (e.columntitle === '客户简称') {