Quellcode durchsuchen

链属相关查询优化

sqg vor 4 Jahren
Ursprung
Commit
e0aafb2212

+ 54 - 36
front-vue/src/views/service/rel/companyRel.vue

@@ -40,7 +40,7 @@
             @keyup.enter.native="handleQuery"
           />
         </el-form-item> -->
-        <el-form-item label="类型" prop="scrQuery" size="large">
+      <el-form-item label="类型" prop="scrQuery" size="large">
           <el-select v-model="queryParams.scrQuery" clearable>
             <el-option
             v-for="dict in queryOptions"
@@ -105,7 +105,20 @@
         v-show="showSearch"
         label-width="auto"
       >
-        <el-form-item label="企业名称" prop="companyName" size="large">
+      <el-form-item label="类型" prop="scpQuery" size="large">
+          <el-select v-model="spareParams.scpQuery" clearable>
+            <el-option
+            v-for="dict in queryOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+            />
+          </el-select>
+      </el-form-item>
+      <el-form-item prop="scrValue" v-if="this.spareParams.scpQuery"  size="large">
+        <el-input v-model="spareParams.scpValue" placeholder="请输入关键字模糊查询" clearable maxlength="25"/>
+      </el-form-item>
+        <!-- <el-form-item label="企业名称" prop="companyName" size="large">
           <el-input
             maxlength="30"
             v-model="spareParams.companyName"
@@ -122,7 +135,7 @@
             clearable
             @keyup.enter.native="handleSpareQuery"
           />
-        </el-form-item>
+        </el-form-item> -->
         <el-form-item label="链属关系" prop="scrType" size="large">
           <el-select v-model="spareParams.scrType" placeholder="请选择链属关系" clearable>
             <el-option
@@ -659,9 +672,9 @@ export default {
         pageSize: 10,
         companyName: null,
         scySocialCode: null,
-        scrStatus: null,
-        scrType: null,
-        scpStatus: null,
+        scrStatus: "03",
+        scrType: "02",
+        scpStatus: "02",
         scrQuery: null,
         scrValue: null,
       },
@@ -671,7 +684,9 @@ export default {
         pageSize: 10,
         scySocialCode: null,
         companyName: null,
-        scrType: null
+        scrType: "02",
+        scpQuery: null,
+        scpValue: null,
       },
       //企业列表查询参数
       companyQueryParams: {
@@ -812,7 +827,9 @@ export default {
     this.getUser().then(() => {
       this.queryParams.scrQuery = "00";
     });
-    this.getSpare();
+    this.getSpare().then(() => {
+      this.spareParams.scpQuery = "00";
+    });;
     this.getCompanyList();
   },
   mounted() {
@@ -921,32 +938,32 @@ export default {
     /** 查询链属列表 */
     getList() {
       this.loading = true;
-      if (this.companyId == "000000") {
-        getListRel(this.queryParams).then(response => {
-          let list = response.data.records;
-          this.loginId = response.msg;
-          for (let i = 0; i < list.length; i++) {
-            if (list[i].launchCompanyId == response.msg) {
-              list[i].receive = false;
-              list[i].launch = true;
-              list[i].spare = false;
-            } else if (list[i].launchReceiveScrCompanyId == response.msg) {
-              list[i].launch = false;
-              list[i].receive = true;
-              list[i].spare = false;
-            } else if (list[i].scpCompanyId == response.msg) {
-              list[i].launch = false;
-              list[i].receive = false;
-              list[i].spare = true;
-            }
-          }
-          this.companyRelList = list;
-          console.log(12312313123);
-          console.log(this.companyRelList);
-          this.total = response.data.total;
-          this.loading = false;
-        });
-      } else {
+      // if (this.companyId == "000000") {
+      //   getListRel(this.queryParams).then(response => {
+      //     let list = response.data.records;
+      //     this.loginId = response.msg;
+      //     for (let i = 0; i < list.length; i++) {
+      //       if (list[i].launchCompanyId == response.msg) {
+      //         list[i].receive = false;
+      //         list[i].launch = true;
+      //         list[i].spare = false;
+      //       } else if (list[i].launchReceiveScrCompanyId == response.msg) {
+      //         list[i].launch = false;
+      //         list[i].receive = true;
+      //         list[i].spare = false;
+      //       } else if (list[i].scpCompanyId == response.msg) {
+      //         list[i].launch = false;
+      //         list[i].receive = false;
+      //         list[i].spare = true;
+      //       }
+      //     }
+      //     this.companyRelList = list;
+      //     console.log(12312313123);
+      //     console.log(this.companyRelList);
+      //     this.total = response.data.total;
+      //     this.loading = false;
+      //   });
+      // } else {
         listRel(this.queryParams).then(response => {
           let list = response.data.records;
           this.loginId = response.msg;
@@ -971,7 +988,7 @@ export default {
           this.total = response.data.total;
           this.loading = false;
         });
-      }
+      // }
     },
 
     // 未认证列表
@@ -980,6 +997,7 @@ export default {
       sparelist(this.spareParams).then(response => {
         this.spareOwnlist = response.data.records;
         this.spareTitol = response.data.total;
+        this.spareParams.scpQuery = "00";
         this.loading = false;
       });
     },
@@ -1420,8 +1438,8 @@ export default {
         } else {
           this.handleRel = false;
         }
-        return Promise.resolve(response);
         this.getList();
+        return Promise.resolve(response);
       }).catch(response => {
         this.loading = false;
         return Promise.reject("error");

+ 2 - 1
front-vue/src/views/service/rel/companyRelManage.vue

@@ -437,6 +437,7 @@
 <script>
 import {
   listRel,
+  getListRel,
   sparelist,
   listCompany,
   addRel,
@@ -759,7 +760,7 @@ export default {
     /** 查询链属列表 */
     getList() {
       this.loading = true;
-      listRel(this.queryParams).then(response => {
+      getListRel(this.queryParams).then(response => {
         let list = response.data.records;
         for (let i = 0; i < list.length; i++) {
           if (list[i].scpRelId != "" && list[i].scpRelId != null) {