Forráskód Böngészése

各个地方的专利查询

zhuliu 1 éve
szülő
commit
8db5eff9c5

+ 5 - 2
src/views/project/patentCollection/index.vue

@@ -329,6 +329,7 @@ export default {
     handleSearchValue({ searchStr, customFields }) {
       this.searchStr = searchStr
       this.customFields = customFields
+      this.queryParams.current = 1
       this.getList()
       this.$nextTick(()=>{
         this.$refs.customFields.close()
@@ -527,7 +528,7 @@ export default {
         customFields: this.customFields,
         orderDTOList: this.sort,//排序信息
       }
-
+      this.loading = true
       // this.$store.commit("SET_PATENT_PARAMS", params);
       this.$store.commit("SET_PATENT_RECORDS", []);
       this.$api.QueryPatent(params).then(res => {
@@ -545,10 +546,12 @@ export default {
           }
           this.isRefresh()
           this.getPatentFields()
+          this.loading = false
         }
       }).catch(error => {
         this.tableData = []
         this.total = 0
+        this.loading = false
       })
     },
     //排序
@@ -750,7 +753,7 @@ export default {
           path: '/allocationTask',
           query: {
             projectId: this.projectId,
-            searchOption: JSON.stringify(this.searchStr),//输入框检索条件
+            searchOption: this.searchStr,//输入框检索条件
             customFields: JSON.stringify(this.customFields),//右侧勾选自定义栏位的条件
             projectType:1
           }

+ 3 - 3
src/views/report/components/allocationTask/components/allocationTask.vue

@@ -109,7 +109,7 @@ export default {
     },
     oldSearchOption: {
       default: () => {
-        return {}
+        return ''
       }
     },
     customFields: {
@@ -188,7 +188,7 @@ export default {
       let params = {
         ...this.queryParams,//分页信息
         projectId: this.projectId,
-        searchQuery: this.$commonJS.objectToString(this.oldSearchOption),//检索条件
+        searchQuery: this.oldSearchOption,//检索条件
         customFields: this.customFields,
         orderDTOList: [],//排序信息
       }
@@ -295,7 +295,7 @@ export default {
         ...form,
         stringRequest: {
           projectId: this.projectId,
-          searchQuery: this.$commonJS.objectToString(this.oldSearchOption || {}),//列表上方检索条件
+          searchQuery: this.oldSearchOption,//列表上方检索条件
           customFields: this.customFields,//统计检索
         },//检索内容条件
         markedFields: this.markedFields,//自定义栏位

+ 5 - 5
src/views/report/components/allocationTask/index.vue

@@ -21,11 +21,11 @@ export default {
       return this.$route.query.projectId
     },
     searchOption() {//检索条件
-      if(this.$route.query.searchOption){
-        return JSON.parse(this.$route.query.searchOption)
-      }
-      return ''
-      
+      // if(this.$route.query.searchOption){
+      //   return JSON.parse(this.$route.query.searchOption)
+      // }
+      // return ''
+      return this.$route.query.searchOption
     },
     customFields() {//自定义字段检索条件
       if(this.$route.query.customFields){

+ 83 - 38
src/views/report/components/checkPatent/checkPatent.vue

@@ -6,14 +6,16 @@
         <el-header style="display: flex;align-items: center;">
           <slot name="head">
             <div id="step1">
-              <mySearch style="width: 500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption">
-              </mySearch>
+              <!-- <mySearch style="width: 500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption">
+              </mySearch> -->
+              <searchPatent ref="searchPatent" :searchFiled="searchFiled"
+              @searchValue="search"></searchPatent>
             </div>
           </slot>
           
         </el-header>
-        <el-main>
-          <Table :column="column" :tableData="tableData" :queryParams="queryParams" :refresh="refresh"
+        <el-main style="height:calc(100vh - 300px)">
+          <Table :column="column" :tableData="tableData" :queryParams="queryParams" :refresh="refresh" v-loading="loading"
             :patentNoList.sync="patentNoList" :projectId="projectId" @on-sort="handleSort"></Table>
         </el-main>
         <el-footer>
@@ -41,9 +43,11 @@
 
 <script>
 import Table from '@/views/project/patentCollection/components/views/Table.vue'
+import searchPatent from '@/views/report/components/patentList/components/searchPatent.vue';
 export default {
   components: {
-    Table
+    Table,
+    searchPatent
   },
   props: {
     customFields: {
@@ -53,7 +57,7 @@ export default {
     },
     oldSearchOption: {
       default: () => {
-        return {}
+        return ''
       }
     },
     sign:''
@@ -66,7 +70,7 @@ export default {
       //检索字段
       searchFiled: [],
       //检索条件
-      searchOption: {},
+      searchOption: '',
       // 分页信息
       queryParams: {
         current: 1,
@@ -155,34 +159,69 @@ export default {
     },
     //获取table栏位及分组字段、检索字段
     async getColumn() {
-      let params = ['patent']
-      await this.$api.getParamsCommon(params).then(res => {
+      let params = [{
+        tableName: 'patent',
+        projectId: 0,
+      }]
+      this.searchFiled = []
+      await this.$api.getQueryFields(params).then(res => {
         if (res.code == 200) {
-          let conditionDTOList = JSON.parse(JSON.stringify(res.data[0].conditionDTOList))
+          let conditionDTOList = JSON.parse(JSON.stringify(res.data.data[0].conditionDTOList))
+          let field = conditionDTOList.filter(item => {
+            return item.group == 'nos'
+          })
+          let custom = conditionDTOList.filter(item => {
+            return item.group == 'customField'
+          })
+          let customField = custom.filter(item => {
+            return item.type != 'tree' && item.type != 'Array'
+          })
+          let arr = field.concat(customField)
           // 搜索字段
-          this.searchFiled = this.$commonJS.getField(conditionDTOList, (u) => u.ifSearch == true, {
+          this.searchFiled = this.$commonJS.getField(arr, (u) => u.ifSearch == true, {
             label: 'name',
-            value: 'value',
+            value: 'field',
             type: 'type',
+            group: 'group',
+            fieldType: 'fieldType',
+            groupBy: 'groupBy',
+            children:'children'
           })
         }
       })
+      // let params = ['patent']
+      // await this.$api.getParamsCommon(params).then(res => {
+      //   if (res.code == 200) {
+      //     // let conditionDTOList = JSON.parse(JSON.stringify(res.data[0].conditionDTOList))
+      //     // // 搜索字段
+      //     // this.searchFiled = this.$commonJS.getField(conditionDTOList, (u) => u.ifSearch == true, {
+      //     //   label: 'name',
+      //     //   value: 'value',
+      //     //   type: 'type',
+      //     // })
+      //   }
+      // })
     },
     //检索
-    search(val) {
-      let params = {}
-      val.forEach(item => {
-        if (item.type == 3) {
-          params[item.value] = item.searchValue.map(itemValue => {
-            return itemValue.value
-          })
-        } else {
-          params[item.value] = item.searchValue.label
-        }
-      })
-      // 返回字符串
-      this.searchOption = this.$commonJS.ArrayToArray(val)
-      // 调用查询接口
+    // search(val) {
+    //   let params = {}
+    //   val.forEach(item => {
+    //     if (item.type == 3) {
+    //       params[item.value] = item.searchValue.map(itemValue => {
+    //         return itemValue.value
+    //       })
+    //     } else {
+    //       params[item.value] = item.searchValue.label
+    //     }
+    //   })
+    //   // 返回字符串
+    //   this.searchOption = this.$commonJS.ArrayToArray(val)
+    //   // 调用查询接口
+    //   this.queryParams.current = 1
+    //   this.getList()
+    // },
+    search({ searchStr, customFields }) {
+      this.searchOption = searchStr
       this.queryParams.current = 1
       this.getList()
     },
@@ -240,18 +279,20 @@ export default {
       //   ...this.oldSearchOption,
       //   ...this.searchOption
       // }
-      var searchOption1 = this.searchOption
-      if(this.searchOption.constructor == Object){
-        searchOption1 = this.$commonJS.objectToArray(this.searchOption)
-      }
-      if(this.oldSearchOption.constructor == Object){
-        oldSearchOption = this.$commonJS.objectToArray(this.oldSearchOption)
-      }
-      let searchOption = [
-        ...oldSearchOption,//固有检索字段
-        ...searchOption1
-      ]
-      var searchStr = this.$commonJS.objectToString(searchOption)
+      // var searchOption1 = this.searchOption
+      // if(this.searchOption.constructor == Object){
+      //   searchOption1 = this.$commonJS.objectToArray(this.searchOption)
+      // }
+      // if(this.oldSearchOption.constructor == Object){
+      //   oldSearchOption = this.$commonJS.objectToArray(this.oldSearchOption)
+      // }
+      // let searchOption = [
+      //   // ...oldSearchOption,//固有检索字段
+      //   ...searchOption1
+      // ]
+      // var str = this.$commonJS.objectToString(searchOption)
+      // var searchStr =  (this.oldSearchOption?(' AND ' + (this.oldSearchOption)):'')
+      var searchStr =  this.searchOption + ((this.searchOption && this.oldSearchOption)?' AND ':'') + (this.oldSearchOption || '')
       var patentNoStr = ''
       this.patentNos.forEach((item, index) =>{
         if (index == 0) {
@@ -267,13 +308,17 @@ export default {
         customFields: this.customFields,
         orderDTOList: this.sort,//排序信息
       }
+      this.loading = true
       this.$api.QueryPatent(params).then(res => {
         if (res.code == 200) {
           this.tableData = res.data.data
           this.total = res.data.total
+          this.loading = false
         }
       }).catch(error => {
+        this.tableData = []
         this.total = 0
+        this.loading = false
       })
     },
   },

+ 7 - 2
src/views/report/components/patentList/components/index.vue

@@ -46,7 +46,7 @@
               </div>
             </div>
           </el-header>
-          <el-main class="height_100">
+          <el-main class="height_100" v-loading="loading">
             <component :is='components' :tableData="tableData" :column="fieldList" :projectId="projectId"
               @on-sort="handleSort" :queryParams="queryParams" @clickPatentNo="handleClick"
               @ifHaveChild="handleIfHaveChild" :refresh='refresh' @index-setting="handleIndexSetting" :patentNoList.sync="patentNoList" @addSelect="getChoosePatentNo"></component>
@@ -193,6 +193,7 @@ export default {
       searchStr: '',
       // 存放自定义栏位的检索条件
       customFields: [],
+      loading:false,
     }
   },
   computed: {},
@@ -206,6 +207,7 @@ export default {
     handleSearchValue({ searchStr, customFields }) {
       this.searchStr = searchStr
       this.customFields = customFields
+      this.queryParams.current = 1
       this.getList()
       this.$refs.customFields.close()
     },
@@ -382,6 +384,7 @@ getPatentFields(){
         orderDTOList: this.sort,//排序信息
       }
       this.$store.commit("SET_PATENT_RECORDS", []);
+      this.loading = true
       this.$api.QueryPatent(params).then(res => {
         if (res.code == 200) {
           this.tableData = res.data.data
@@ -395,10 +398,12 @@ getPatentFields(){
           }
           this.isRefresh()
           this.getPatentFields()
+          this.loading = false
         }
       }).catch(error => {
         this.tableData = []
         this.total = 0
+        this.loading = false
       })
     },
     //排序
@@ -463,7 +468,7 @@ getPatentFields(){
           path: '/allocationTask',
           query: {
             projectId: this.projectId,
-            searchOption: JSON.stringify(this.searchStr),//输入框检索条件
+            searchOption: this.searchStr,//输入框检索条件
             customFields: JSON.stringify(this.customFields),//右侧勾选自定义栏位的条件
           }
         }

+ 5 - 2
src/views/report/components/patentList/components/searchPatent.vue

@@ -153,7 +153,7 @@ export default {
     },
   },
   mounted() {
-
+    this.getGroup()
   },
   methods: {
     // 点击检索式中的检索条件
@@ -294,7 +294,7 @@ export default {
     getSearchStorage() {
       let customFields = []
       let count = 0
-      console.log(this.searchStorageText)
+      // console.log(this.searchStorageText)
       this.searchStorageText.forEach((item, index) => {
         var sign = '='
         if(item.dele == 'patentCheck' && item.groupBy == 'company'){
@@ -357,6 +357,9 @@ export default {
 
 
     getGroup() {
+      if(!this.searchFiled||this.searchFiled.length == 0){
+        return ;
+      }
       let obj = {
         text: '文本',
         number: '号码',