zhuhao 1 rok temu
rodzic
commit
abf1f823d1

+ 206 - 152
src/views/components/import/conditionImport/searchResult.vue

@@ -1,21 +1,25 @@
 <template>
   <div style="background: white; height: 100%">
     <el-container style="padding: 0 20px">
-      <el-header
-        class="workspace-content-container-header"
-        style="display: flex; justify-content: space-between"
-      >
+      <el-header class="workspace-content-container-header" style="display: flex; justify-content: space-between">
         <div>
           <el-button-group class="margin-left_10">
-            <el-tooltip v-for="item in viewList" :key="item.value" class="item" effect="dark" :content="item.title" placement="top">
-              <el-button @click="handleChangeView(item)" size="small" :type="viewSelected === item.value ? 'primary' : ''" :icon="item.btn"></el-button>
+            <el-tooltip v-for="item in viewList" :key="item.value" class="item" effect="dark" :content="item.title"
+              placement="top">
+              <el-button @click="handleChangeView(item)" size="small" :type="viewSelected === item.value ? 'primary' : ''"
+                :icon="item.btn"></el-button>
             </el-tooltip>
           </el-button-group>
-          
+
         </div>
-        
-        <div style="max-width:calc(100% - 620px)">
+
+        <!-- <div style="max-width:calc(100% - 620px)">
           <p><span>条件:</span>{{ searchData.searchCondition }}</p>
+        </div> -->
+        <div style="max-width: 800px;margin-top: 0px;display: flex;justify-content: center;align-items: center;">
+          <search :field="field" :searchResult="true" :searchValue="false" :countryList="queryParams.countryList"
+            @search="search"></search>
+          <p><el-link style="width: 50px;margin-left: -60px;color: #409EFF;" @click="searches">检索式</el-link></p>
         </div>
         <div>
           <el-button type="primary" size="small" @click="importToProject">导入专利</el-button>
@@ -24,23 +28,14 @@
       </el-header>
       <el-main id="patent-list-container" v-loading="loading">
         <div class="height_100">
-          <component
-            ref="patentViewList"
-            :is="viewSelected"
-            :column="columnList"
-            :tableData="tableData"
-            @select-change="handleSelect"
-            :selected.sync="queryParams.selected"
-            :patentNoList.sync="patentNoList"
-            :view-field="patentViewField"
-            @on-sort="handleSort"
-            @addSelect="getChoosePatentNo"
-          ></component>
+          <component ref="patentViewList" :is="viewSelected" :column="columnList" :tableData="tableData"
+            @select-change="handleSelect" :selected.sync="queryParams.selected" :patentNoList.sync="patentNoList"
+            :view-field="patentViewField" @on-sort="handleSort" @addSelect="getChoosePatentNo"></component>
         </div>
       </el-main>
       <el-footer class="workspace-content-patent-page foot-total">
         <div>
-          <span v-if="selectedTotal>0" >
+          <span v-if="selectedTotal > 0">
             已勾选 <b>{{ selectedTotal }}</b> 条
           </span>
           <el-popover placement="bottom" title="" width="220" trigger="click">
@@ -57,29 +52,35 @@
                 <el-button type="text" size="" @click="handleSelectNumber(2)">确定</el-button>
               </div>
             </el-main>
-            <el-button type="info" size="small" class="margin-left_10" slot="reference"> 选择专利<i class="el-icon-arrow-down el-icon--right"></i></el-button>
+            <el-button type="info" size="small" class="margin-left_10" slot="reference"> 选择专利<i
+                class="el-icon-arrow-down el-icon--right"></i></el-button>
           </el-popover>
         </div>
         <div class="foot-total">
           <span class="total">共{{ total }}条</span>
-            <el-pagination
-              background
-              layout="total, sizes, prev, pager, next, jumper"
-              :current-page.sync="queryParams.current"
-              :page-size.sync="queryParams.size"
-              :page-sizes="pageSizes"
-              :page-count="getPageCount()"
-              @current-change="handleCurrentChange"
-              @size-change="getList"
-            >
-            </el-pagination>
+          <el-pagination background layout="total, sizes, prev, pager, next, jumper"
+            :current-page.sync="queryParams.current" :page-size.sync="queryParams.size" :page-sizes="pageSizes"
+            :page-count="getPageCount()" @current-change="handleCurrentChange" @size-change="getList">
+          </el-pagination>
         </div>
       </el-footer>
     </el-container>
 
 
     <field ref="field" type="patentProject" @getFieldList="getFieldList"></field>
-    <projectListDialog ref="projectListDialog" :importData="searchData"></projectListDialog>
+    <!-- <projectListDialog ref="projectListDialog" :importData="searchData"></projectListDialog> -->
+    <projectListDialog ref="projectListDialog" :importData="condition"></projectListDialog>
+
+    <el-dialog custom-class="checkCondition" title="查看/编辑检索式" :visible.sync="visible" width="500px"
+      :before-close="() => { visible = false }" :close-on-click-modal="false">
+      <div>
+        <el-input type="textarea" :rows="4" v-model="condition.searchCondition"></el-input>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="visible = false">取 消</el-button>
+        <el-button type="primary" @click="searchFinish">检 索</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -89,21 +90,23 @@ import PatentAbstractListView from "@/views/project/patentCollection/components/
 import PatentPictureListView from "@/views/project/patentCollection/components/views/Picture";
 import field from '@/views/components/dialog/fields.vue';
 import projectListDialog from "./components/projectListDialog.vue";
+import search from '@/utils/model/search/search.vue'
 export default {
   components: {
     PatentTableListView,
     PatentAbstractListView,
     PatentPictureListView,
     field,
-    projectListDialog
+    projectListDialog,
+    search,
   },
   props: {
-    searchData:{}
+    searchData: {}
   },
   data() {
     return {
-      columnList:[],
-      pageSizes:[10, 20, 30, 40, 50],
+      columnList: [],
+      pageSizes: [10, 20, 30, 40, 50],
       viewSelected: "patent-table-list-view",
       viewList: [
         {
@@ -129,21 +132,28 @@ export default {
         size: 10,
         isAdd: [],
         isDelete: [],
-        OrderBy:"AD",
-        OrderByType:"DESC",
-        retrieveRecordId:this.retrieveRecordId,
-        asCompare:this.asCompare
+        OrderBy: "AD",
+        OrderByType: "DESC",
+        retrieveRecordId: this.retrieveRecordId,
+        asCompare: this.asCompare
       },
       patentViewField: [],
-      tableData:[],
+      tableData: [],
       total: 0,
       selectNumberLoading: false,
       loading: false,
-      selectedTotal:0,
+      selectedTotal: 0,
       startNumber: 1,
       endNumber: 0,
       quickSelect: false,
-      quickSelectArr:[],
+      quickSelectArr: [],
+      /**检索式 */
+      // 公用数据
+      field: JSON.parse(JSON.stringify(this.$constants.searchField)),
+      // 打开弹窗
+      visible: false,
+      // 检索式及其他信息
+      condition: this.searchData,
     };
   },
   watch: {},
@@ -152,27 +162,60 @@ export default {
       return this.$store.state.patent.records;
     },
   },
-  created() {},
+  created() { },
   async mounted() {
     this.columnList = await this.$commonJS.getCustomField('patent')
-    if(this.$s.getSession('queryParams')&&this.$s.getSession('queryParams').params.retrieveRecordId){
-        this.queryParams.retrieveRecordId = this.$s.getSession('queryParams').params.retrieveRecordId
-      }
-    
-  await this.getList();
-    
+    if (this.$s.getSession('queryParams') && this.$s.getSession('queryParams').params.retrieveRecordId) {
+      this.queryParams.retrieveRecordId = this.$s.getSession('queryParams').params.retrieveRecordId
+    }
+
+    await this.getList();
+
   },
   methods: {
+    //子组件返回检索式 
+    async search(val) {
+      if (val.searchStr == '') {
+        this.$message.error('检索信息不能为空')
+        return false
+      }
+      if (val.isRepeat) {
+        this.condition.searchCondition = `${this.condition.searchCondition} AND ${val.searchStr}`
+      } else {
+        this.condition.searchCondition = val.searchStr
+      }
+      await this.searchBth()
+    },
+    searchBth() {
+      this.queryParams.retrieveRecordId = null
+      this.$router.push({
+        path: '/searchResult',
+        query: {
+          data: JSON.stringify(this.condition),
+        }
+      })
+      // this.getList()
+    },
+    // 打开检索式弹窗
+    searches() {
+      this.visible = true
+    },
+    // 编辑、查看检索式
+    async searchFinish() {
+      await this.searchBth()
+      this.visible = false
+    },
     //导入到专题库
     importToProject() {
       var form = {
-        ...this.searchData,
-        orderBy:this.queryParams.OrderBy,
-        orderByType:this.queryParams.OrderByType,
-        startNumber:this.selectedTotal>0?this.startNumber:1,
-        endNumber:this.selectedTotal>0?this.endNumber:this.total,
-        isAddPatentNos:this.queryParams.isAdd,
-        isDeletePatentNos:this.queryParams.isDelete,
+        // ...this.searchData,
+        ...this.condition,
+        orderBy: this.queryParams.OrderBy,
+        orderByType: this.queryParams.OrderByType,
+        startNumber: this.selectedTotal > 0 ? this.startNumber : 1,
+        endNumber: this.selectedTotal > 0 ? this.endNumber : this.total,
+        isAddPatentNos: this.queryParams.isAdd,
+        isDeletePatentNos: this.queryParams.isDelete,
       }
       this.$refs.projectListDialog.open(form);
     },
@@ -181,36 +224,36 @@ export default {
       this.queryParams.current = val;
       this.patentNoList = []
       await this.getList();
-      this.$nextTick(()=>{
-        if(this.quickSelect){
+      this.$nextTick(() => {
+        if (this.quickSelect) {
           this.commonSwitch()
-        }else{
-          if(this.queryParams.isAdd.length>0){
+        } else {
+          if (this.queryParams.isAdd.length > 0) {
             this.getHaveChoose([])
           }
         }
       })
     },
     //获取最大页数
-    getPageCount(){
-      var a = Math.ceil(Number(this.total)/Number(this.queryParams.size))
-      return a>200?200:a
+    getPageCount() {
+      var a = Math.ceil(Number(this.total) / Number(this.queryParams.size))
+      return a > 200 ? 200 : a
     },
     //开始条数校验
     change1(val) {
       if (!isNaN(val)) {
-         if (!val || val <= 0) {
-          this.queryParams.startNumber=1
+        if (!val || val <= 0) {
+          this.queryParams.startNumber = 1
         } else {
-          if (this.queryParams.startNumber>this.total) {
-            this.queryParams.startNumber=this.total
+          if (this.queryParams.startNumber > this.total) {
+            this.queryParams.startNumber = this.total
           }
         }
       } else {
-        this.queryParams.startNumber=1
+        this.queryParams.startNumber = 1
       }
     },
-     //结束条数校验
+    //结束条数校验
     change2(val) {
       if (!isNaN(val)) {
         if (!val || val <= 0) {
@@ -220,21 +263,23 @@ export default {
             this.queryParams.endNumber = this.total
           }
         }
-      }else {
-        this.queryParams.endNumber=this.total
+      } else {
+        this.queryParams.endNumber = this.total
       }
     },
     //查询专利
     async getList() {
       let queryParams = JSON.parse(JSON.stringify(this.queryParams));
       var params = {
-        CurrentQuery: this.searchData.searchCondition, //检索式
-        DBType: this.searchData.DBType, //”CN”或”WD”,表示检索中文库或世界库
+        // CurrentQuery: this.searchData.searchCondition, //检索式
+        // DBType: this.searchData.DBType, //”CN”或”WD”,表示检索中文库或世界库
+        CurrentQuery: this.condition.searchCondition, //检索式
+        DBType: this.condition.DBType, //”CN”或”WD”,表示检索中文库或世界库
         PageNum: this.queryParams.current, //页码(最多 200 页)
         RowCount: this.queryParams.size, //每页返回条数(最多 50 条)
         OrderBy: this.queryParams.OrderBy, //排序字段:“AD”,“PD”,“GD”, “ID”(检索引擎自生成字段,排序顺序固定)
         OrderByType: this.queryParams.OrderByType, //排序方式:“ASC”,“DESC” 即正序倒序
-        retrieveRecordId:this.queryParams.retrieveRecordId
+        retrieveRecordId: this.queryParams.retrieveRecordId
       };
       // console.log(this.$s.getSession('retrieveRecordId'),)
       queryParams.params = params;
@@ -242,37 +287,37 @@ export default {
       this.$store.commit("SET_PATENT_RECORDS", []);
       this.loading = true;
       await this.$api.patentSelect(params).then((response) => {
-          if (response.code == 200) {
-            this.total = response.data.total;
-            this.$set(this.queryParams,'startNumber',this.endNumber > 0 ? this.startNumber : 1)
-              this.$set(this.queryParams,'endNumber',this.endNumber > 0 ? this.endNumber : this.total)
-            let records = response.data.data
-            this.tableData = records
-            params.retrieveRecordId = response.data.retrieveRecordId
-            this.queryParams.retrieveRecordId = response.data.retrieveRecordId
-            this.$store.commit("SET_PATENT_PARAMS", queryParams);
-            this.$s.setSession('queryParams',queryParams)
-            this.$store.commit("SET_PATENT_RECORDS", records);
-            this.loading = false;
-          }
-        })
+        if (response.code == 200) {
+          this.total = response.data.total;
+          this.$set(this.queryParams, 'startNumber', this.endNumber > 0 ? this.startNumber : 1)
+          this.$set(this.queryParams, 'endNumber', this.endNumber > 0 ? this.endNumber : this.total)
+          let records = response.data.data
+          this.tableData = records
+          params.retrieveRecordId = response.data.retrieveRecordId
+          this.queryParams.retrieveRecordId = response.data.retrieveRecordId
+          this.$store.commit("SET_PATENT_PARAMS", queryParams);
+          this.$s.setSession('queryParams', queryParams)
+          this.$store.commit("SET_PATENT_RECORDS", records);
+          this.loading = false;
+        }
+      })
         .catch((error) => {
           this.loading = false;
         });
-        
+
     },
     handleSelect(data) {
       // this.queryParams.selected = data
     },
     async handleChangeView(item) {
       // console.log(item)
-      if(this.viewSelected==item.value){
+      if (this.viewSelected == item.value) {
         return false
       }
-      if(this.viewSelected!="patent-picture-list-view" && item.value!="patent-picture-list-view"){
+      if (this.viewSelected != "patent-picture-list-view" && item.value != "patent-picture-list-view") {
         this.queryParams.size = 10;
         this.viewSelected = item.value;
-      }else if(this.viewSelected=="patent-picture-list-view" || item.value=="patent-picture-list-view"){
+      } else if (this.viewSelected == "patent-picture-list-view" || item.value == "patent-picture-list-view") {
         if (item.value === "patent-picture-list-view") {
           this.$set(this.queryParams, "size", 20);
         } else {
@@ -299,17 +344,17 @@ export default {
         case 1: //全部选择
           this.startNumber = 1;
           this.endNumber = this.total;
-          this.$set(this.queryParams,'startNumber',1)
-          this.$set(this.queryParams,'endNumber',this.total)
+          this.$set(this.queryParams, 'startNumber', 1)
+          this.$set(this.queryParams, 'endNumber', this.total)
         case 2: //范围选择
           this.queryParams.isDelete = [];
           this.queryParams.isAdd = [];
           this.patentNoList = [];
           this.quickSelect = true;
           if (type == 2) {
-            if (!Number(this.queryParams.startNumber) ||!Number(this.queryParams.endNumber)) {
-              this.$set(this.queryParams,'startNumber',this.endNumber > 0 ? this.startNumber : 1)
-              this.$set(this.queryParams,'endNumber',this.endNumber > 0 ? this.endNumber : this.total)
+            if (!Number(this.queryParams.startNumber) || !Number(this.queryParams.endNumber)) {
+              this.$set(this.queryParams, 'startNumber', this.endNumber > 0 ? this.startNumber : 1)
+              this.$set(this.queryParams, 'endNumber', this.endNumber > 0 ? this.endNumber : this.total)
               break;
             }
             this.startNumber = this.queryParams.startNumber;
@@ -324,30 +369,30 @@ export default {
     commonSwitch() {
       var arr = []
       if (this.queryParams.size * this.queryParams.current >= this.startNumber) {
-        if (this.queryParams.size * this.queryParams.current >=this.endNumber) {
-          if (this.queryParams.size * (this.queryParams.current - 1) + 1 <=this.startNumber) {
-            var a =this.startNumber -(this.queryParams.size * (this.queryParams.current - 1) + 1);
-            var b =this.endNumber -(this.queryParams.size * (this.queryParams.current - 1) + 1);
+        if (this.queryParams.size * this.queryParams.current >= this.endNumber) {
+          if (this.queryParams.size * (this.queryParams.current - 1) + 1 <= this.startNumber) {
+            var a = this.startNumber - (this.queryParams.size * (this.queryParams.current - 1) + 1);
+            var b = this.endNumber - (this.queryParams.size * (this.queryParams.current - 1) + 1);
             for (var y = a; y <= b; y++) {
               arr.push(this.tableData[y].applicationNo)
             }
           } else {
-            var a =this.queryParams.size * (this.queryParams.current - 1) +1 -(this.queryParams.size * (this.queryParams.current - 1) + 1);
-            var b = this.endNumber -(this.queryParams.size * (this.queryParams.current - 1) + 1);
+            var a = this.queryParams.size * (this.queryParams.current - 1) + 1 - (this.queryParams.size * (this.queryParams.current - 1) + 1);
+            var b = this.endNumber - (this.queryParams.size * (this.queryParams.current - 1) + 1);
             for (var y = a; y <= b; y++) {
               arr.push(this.tableData[y].applicationNo)
             }
           }
         } else {
-          if (this.queryParams.size * (this.queryParams.current - 1) + 1 <=this.startNumber) {
-            var a =this.startNumber -(this.queryParams.size * (this.queryParams.current - 1) + 1);
-            var b =this.queryParams.size * this.queryParams.current -(this.queryParams.size * (this.queryParams.current - 1) + 1);
+          if (this.queryParams.size * (this.queryParams.current - 1) + 1 <= this.startNumber) {
+            var a = this.startNumber - (this.queryParams.size * (this.queryParams.current - 1) + 1);
+            var b = this.queryParams.size * this.queryParams.current - (this.queryParams.size * (this.queryParams.current - 1) + 1);
             for (var y = a; y <= b; y++) {
               arr.push(this.tableData[y].applicationNo)
             }
           } else {
-            var a =this.queryParams.size * (this.queryParams.current - 1) +1 -(this.queryParams.size * (this.queryParams.current - 1) + 1);
-            var b =this.queryParams.size * this.queryParams.current -(this.queryParams.size * (this.queryParams.current - 1) + 1);
+            var a = this.queryParams.size * (this.queryParams.current - 1) + 1 - (this.queryParams.size * (this.queryParams.current - 1) + 1);
+            var b = this.queryParams.size * this.queryParams.current - (this.queryParams.size * (this.queryParams.current - 1) + 1);
             for (var y = a; y <= b; y++) {
               arr.push(this.tableData[y].applicationNo)
             }
@@ -359,59 +404,59 @@ export default {
       this.getHaveChoose(arr)
     },
     //获取已选择的专利
-    getHaveChoose(arr){
+    getHaveChoose(arr) {
       var arr1 = [...new Set(arr.concat(this.queryParams.isAdd))]
-      this.patentNoList = arr1.filter((x) => this.queryParams.isDelete.indexOf(x)==-1)
+      this.patentNoList = arr1.filter((x) => this.queryParams.isDelete.indexOf(x) == -1)
     },
     //获取已选择的总条数
-    getSelectedTotal(){
+    getSelectedTotal() {
       this.selectedTotal = Number(this.endNumber) - Number(this.startNumber) + 1 + Number(this.queryParams.isAdd.length) - Number(this.queryParams.isDelete.length)
     },
     //获取手动选择的专利
-    getChoosePatentNo(patentNo){
-      if(this.quickSelect){
-        var index = this.queryParams.isDelete.findIndex(item=>{
+    getChoosePatentNo(patentNo) {
+      if (this.quickSelect) {
+        var index = this.queryParams.isDelete.findIndex(item => {
           return item == patentNo
         })
-        if(index == -1){
-          var index2 = this.quickSelectArr.findIndex(item=>{
+        if (index == -1) {
+          var index2 = this.quickSelectArr.findIndex(item => {
             return item == patentNo
           })
-          if(index2==-1){
+          if (index2 == -1) {
             this.setIsAdd(patentNo)
-          }else{
+          } else {
             this.queryParams.isDelete.push(patentNo)
           }
-        }else{
-          this.queryParams.isDelete.splice(index,1)
+        } else {
+          this.queryParams.isDelete.splice(index, 1)
         }
-      }else{
+      } else {
         this.setIsAdd(patentNo)
       }
       this.getSelectedTotal()
     },
     //是否加入isAdd里面
-    setIsAdd(patentNo){
-      var index = this.queryParams.isAdd.findIndex(item=>{
-          return item == patentNo
-        })
-      if(index!=-1){
-        this.queryParams.isAdd.splice(index,1)
-      }else{
+    setIsAdd(patentNo) {
+      var index = this.queryParams.isAdd.findIndex(item => {
+        return item == patentNo
+      })
+      if (index != -1) {
+        this.queryParams.isAdd.splice(index, 1)
+      } else {
         this.queryParams.isAdd.push(patentNo)
       }
     },
     //取消选择
     handleCancelSelectNumber() {
-        this.patentNoList = [];
-        this.queryParams.isAdd = []
-        this.queryParams.isDelete = []
-        this.startNumber = 1
-        this.queryParams.startNumber = 1
-        this.queryParams.endNumber = this.total
-        this.endNumber = 0
-        this.quickSelect = false
-        this.selectedTotal = 0
+      this.patentNoList = [];
+      this.queryParams.isAdd = []
+      this.queryParams.isDelete = []
+      this.startNumber = 1
+      this.queryParams.startNumber = 1
+      this.queryParams.endNumber = this.total
+      this.endNumber = 0
+      this.quickSelect = false
+      this.selectedTotal = 0
       // this.getList()
     },
     //排序
@@ -430,25 +475,28 @@ export default {
 };
 </script>
 <style lang="scss" scoped>
-.total{
+.total {
   margin-right: 10px;
-    font-weight: 400;
-    color: #606266;
-    display: inline-block;
-    font-size: 13px;
-    min-width: 35.5px;
-    height: 28px;
-    line-height: 28px;
-    vertical-align: top;
-    box-sizing: border-box;
+  font-weight: 400;
+  color: #606266;
+  display: inline-block;
+  font-size: 13px;
+  min-width: 35.5px;
+  height: 28px;
+  line-height: 28px;
+  vertical-align: top;
+  box-sizing: border-box;
 }
-.foot-total{
+
+.foot-total {
   display: flex;
   justify-content: space-between;
   align-items: center;
 }
+
 .patent-fast-edit-popover {
   padding: 0 !important;
+
   .btn {
     color: #000;
     line-height: 30px;
@@ -457,14 +505,17 @@ export default {
     text-align: left;
     font-size: 14px;
     cursor: pointer;
+
     &:hover {
       background: #adadad;
       color: #fff;
     }
   }
+
   .disabled {
     cursor: not-allowed !important;
   }
+
   .bottom {
     text-align: right;
     color: #1e9fff;
@@ -472,13 +523,16 @@ export default {
     padding-left: 10px;
     font-size: 18px;
   }
+
   .el-divider--horizontal {
     margin: 10px 0 !important;
   }
+
   .select-number {
     .el-input {
       width: 70px;
     }
+
     span {
       padding: 0 3px;
     }

+ 3 - 1
src/views/components/import/conditionImport/searchResultIndex.vue

@@ -15,7 +15,9 @@ export default {
     return {
     };
   },
-  watch: {},
+  watch: {
+
+  },
   computed: {
     searchData(){
         return JSON.parse(this.$route.query.data)