chenrui  2 年之前
父節點
當前提交
98514517f8
共有 2 個文件被更改,包括 89 次插入2 次删除
  1. 9 0
      src/api/statistics/statistics.js
  2. 80 2
      src/views/system/securityCheck/components/securityCheckHeader.vue

+ 9 - 0
src/api/statistics/statistics.js

@@ -88,4 +88,13 @@ export function routeall(query) {
     method: 'get',
     data: query
   })
+}
+
+// 代理人等级
+export function routepage(query) {
+  return request({
+    url: '/system/agent/page',
+    method: 'get',
+    data: query
+  })
 }

+ 80 - 2
src/views/system/securityCheck/components/securityCheckHeader.vue

@@ -82,7 +82,7 @@
         </a-form-item>
       </template>
       <template v-if="withInput">
-        <a-form-item prop="searchText" style="margin-right: 8px">
+        <!-- <a-form-item prop="searchText" style="margin-right: 8px">
           <a-auto-complete
             ref="autocomplete"
             v-model="formData.searchText"
@@ -95,7 +95,39 @@
             clearable
             @clear="inputClearHandler"
           />
-        </a-form-item>
+        </a-form-item> -->
+        <!-- <a-form-item prop="searchText" style="margin-right: 16px">
+          <a-select
+            mode="multiple"
+            :placeholder="searchPlaceholder"
+            :value="formData.searchText ? formData.searchText : undefined"
+            @change="handleChange"
+            allowClear
+          >
+            <a-select-option v-for="item in optionLists" :key="item.name" :value="item.name" :title="item.label">
+              {{ item.name }}
+            </a-select-option>
+          </a-select>
+        </a-form-item> -->
+        <a-select
+          :placeholder="searchPlaceholder"
+          v-model="formData.searchTexts"
+          allowClear
+          style="width: 200px"
+          show-search
+          mode="combobox"
+          :filter-option="filterManager"
+          @change="changeManager"
+        >
+          <a-select-option
+            :value="item.agentName"
+            v-for="(item, index) in locationsData"
+            :key="index"
+            :data_mobile="item.agentName"
+          >
+            {{ item.agentName }}
+          </a-select-option>
+        </a-select>
       </template>
       <template v-if="withSearchButton">
         <a-form-item style="margin-right: 16px">
@@ -118,6 +150,7 @@
 </template>
 
 <script>
+import { routepage } from '@/api/statistics/statistics.js'
 export default {
   props: {
     mode: {
@@ -199,6 +232,8 @@ export default {
   data() {
     return {
       changeButtonLoading: false,
+      locationsData: [],
+      locationsDatacopy: [],
       // optionLists: [
       //   {
       //     name: "全部",
@@ -228,6 +263,7 @@ export default {
         dateRangeRadio: '',
         selection: '',
         searchText: '',
+        searchTexts: '',
       },
       optionList: [],
       inputList: [],
@@ -243,6 +279,16 @@ export default {
     //   //   }
     //   // },
     // },
+    // 'formData.searchText': {
+    //   handler(val) {
+    //     if (!val) {
+    //       this.locationsData = []
+    //     } else {
+    //       this.locationsData = this.locationsDatacopy
+    //       debugger
+    //     }
+    //   },
+    // },
     'formData.dateRangeRadio': {
       handler(val) {
         function formatNumber(num) {
@@ -317,6 +363,7 @@ export default {
     },
   },
   activated() {
+    this.routepageall()
     if (Object.keys(this.$route.params).length == 0) {
       this.formData.dateRangeRadio = '当日'
     } else {
@@ -344,6 +391,37 @@ export default {
   },
   mounted() {},
   methods: {
+    changeManager(e) {
+      if (e) {
+        this.locationsData = JSON.parse(JSON.stringify(this.locationsDatacopy))
+        this.locationsDatacopy.forEach((element) => {
+          if (element.agentName == e) {
+            this.formData.searchText = element.agentId
+          }
+        })
+      } else {
+        this.locationsData = []
+      }
+    },
+    filterManager(input, option) {
+      // option.componentOptions.children[0].text.toLowerCase()为内容值
+      // option.data.attrs.data_mobile为绑定的属性值,可自行定义
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
+        option.data.attrs.data_mobile.indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    //代理人等级
+    async routepageall() {
+      try {
+        let params = {}
+        const result = await routepage()
+        // this.locationsData = result.data.list
+        this.locationsDatacopy = JSON.parse(JSON.stringify(result.data.list))
+      } catch (error) {
+        console.log(error)
+      }
+    },
     //导出
     exportexcel() {
       this.$emit('exportex')