Browse Source

任务的专利清单也添加批量标引

zhuliu 1 year ago
parent
commit
8a5d393746

+ 7 - 6
src/views/project/patentCollection/components/dialog/PatentBatchIndex.vue

@@ -68,7 +68,7 @@
 
 <script>
 export default {
-  props: ['projectId'],
+  props: ['projectId','taskId'],
   data() {
     return {
       // 控制弹窗的显示
@@ -129,19 +129,19 @@ export default {
         switch (val.type) {
           case 4:
           case 5:
-            this.queryCustomOption(item)
+            this.queryCustomOption(val)
             break;
           case 6:
-            this.queryProductCategory(item, 4)
+            this.queryProductCategory(val, 4)
             break;
           case 7://接口传值类型:1产品类别,2产品,3技术分类,4自定义树
-            this.queryProductCategory(item, 2)
+            this.queryProductCategory(val, 2)
             break;
           case 8:
-            this.queryProductCategory(item, 1)
+            this.queryProductCategory(val, 1)
             break;
           case 9:
-            this.queryProductCategory(item, 3)
+            this.queryProductCategory(val, 3)
             break;
         }
       }
@@ -208,6 +208,7 @@ export default {
     submit() {
       let params = {
         projectId: this.projectId,
+        taskId:this.taskId,
         ...this.selectQuery,//选择的信息
         searchQuery: this.searchQuery,//检索的信息
         customFields: this.customFields,//自定义字段的信息

+ 27 - 0
src/views/project/patentCollection/components/mixins/fastSelectPatent.js

@@ -32,9 +32,19 @@ export const fastSelectPatent = {
       quickSelectArr: [],
     }
   },
+  mounted() {
+    if(!this.taskType || this.taskType == 0){
+      this.refresh = true
+    }else{
+      this.refresh = false
+    }
+  },
   methods: {
     // 是否刷新
     isRefresh() {
+      if(!this.refresh){
+        return
+      }
       this.refresh = false
       this.$nextTick(() => {
         this.refresh = true
@@ -197,5 +207,22 @@ export const fastSelectPatent = {
         this.queryParams.endNumber = this.total
       }
     },
+
+
+     // 批量标引
+     handleIndex() {
+      let obj = {
+        selectQuery: {
+          isAdd: this.queryParams.isAdd,
+          isDelete: this.queryParams.isDelete,
+          startNumber: this.startNumber,
+          endNumber: this.endNumber,
+        },
+        searchQuery: this.searchStr,
+        customFields: this.customFields,
+        orderDTOList:this.sort,
+      }
+      this.$refs.PatentBatchIndexVue.open(obj)
+    },
   },
 }

+ 1 - 15
src/views/project/patentCollection/index.vue

@@ -610,21 +610,7 @@ export default {
       this.queryParams.groupField = key
       this.getList()
     },
-    // 批量标引
-    handleIndex() {
-      let obj = {
-        selectQuery: {
-          isAdd: this.queryParams.isAdd,
-          isDelete: this.queryParams.isDelete,
-          startNumber: this.startNumber,
-          endNumber: this.endNumber,
-        },
-        searchQuery: this.searchStr,
-        customFields: this.customFields,
-        orderDTOList:this.sort,
-      }
-      this.$refs.PatentBatchIndexVue.open(obj)
-    },
+   
     //价值曲线
     checkPatentWorth(){
       let obj = {

+ 193 - 4
src/views/report/components/patentList/components/index.vue

@@ -49,14 +49,59 @@
           <el-main class="height_100">
             <component :is='components' :tableData="tableData" :column="fieldList" :projectId="projectId"
               @on-sort="handleSort" :queryParams="queryParams" @clickPatentNo="handleClick"
-              @ifHaveChild="handleIfHaveChild"></component>
+              @ifHaveChild="handleIfHaveChild" :refresh='refresh' @index-setting="handleIndexSetting" :patentNoList.sync="patentNoList" @addSelect="getChoosePatentNo"></component>
           </el-main>
-          <el-footer class="pagination">
+          <!-- <el-footer class="pagination">
             <el-pagination background layout="total, sizes, prev, pager, next, jumper"
               :current-page.sync="queryParams.current" :page-sizes="sizeArr" :page-size.sync="queryParams.size"
               @current-change="handleCurrentChange" @size-change="getList" :total="total">
             </el-pagination>
-          </el-footer>
+          </el-footer> -->
+          <el-footer class="pagination" style="display:flex;justify-content:space-between;align-items:center">
+          <div>
+            <div style="display:flex;align-items:center" v-if="taskType == 0">
+              <span v-if="selectedTotal > 0">
+                已勾选 <b>{{ selectedTotal }}</b> 条
+              </span>
+              <el-popover placement="bottom" title="" width="220" trigger="click">
+                <el-main class="patent-fast-edit-popover" v-loading="selectNumberLoading">
+                  <div class="btn" @click="handleCancelSelectNumber">取消选择</div>
+                  <div class="btn" @click="handleSelectNumber(0)">本页选择</div>
+                  <div class="btn" @click="handleSelectNumber(1)">全部选择</div>
+                  <el-divider></el-divider>
+                  <div class="select-number">
+                    <span>从</span>
+                    <el-input size="mini" v-model="queryParams.startNumber" @change="change1"></el-input>
+                    <span>到</span>
+                    <el-input size="mini" v-model="queryParams.endNumber" @change="change2"></el-input>
+                    <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-popover>
+
+              <div v-show="patentNoList.length" class="margin-left_10">
+                <el-dropdown size="medium">
+                  <el-button type="primary" size="small">
+                    批量操作<i class="el-icon-arrow-down el-icon--right"></i>
+                  </el-button>
+                  <el-dropdown-menu slot="dropdown">
+                    <el-dropdown-item @click.native="handleIndex">批量标引</el-dropdown-item>
+                  </el-dropdown-menu>
+                </el-dropdown>
+              </div>
+            </div>
+          </div>
+         
+          <div>
+            <el-pagination background layout="total, sizes, prev, pager, next, jumper"
+              :current-page.sync="queryParams.current" :page-sizes="sizeArr" :page-size.sync="queryParams.size"
+              @current-change="handleCurrentChange" @size-change="getList" :total="total">
+            </el-pagination>
+          </div>
+
+        </el-footer>
         </el-container>
       </div>
       <div class="height_100 right" v-show="showRight">
@@ -65,7 +110,13 @@
       </div>
     </div>
 
+    
     <field ref="field" type="patent" :projectId="projectId" :taskId="taskId" @getFieldList="getFieldList"></field>
+
+     <!-- 批量那个标引 -->
+     <PatentBatchIndexVue ref="PatentBatchIndexVue" @submit="submitIndex" :taskId="taskId" :projectId="projectId"></PatentBatchIndexVue>
+    <!-- 单个栏位标引 -->
+    <patent-index-setting @submit="submitIndex" :taskId="taskId" :projectId="projectId" ref="patentIndexSetting" />
   </div>
 </template>
 
@@ -74,7 +125,12 @@ import field from '@/views/components/dialog/fields.vue';
 import PatentTableListView from '@/views/project/patentCollection/components/views/Table.vue'
 import customFields from './customFields/index.vue';
 import searchPatent from './searchPatent.vue'
+
+import { fastSelectPatent } from '@/views/project/patentCollection/components/mixins/fastSelectPatent'
+import PatentBatchIndexVue from '@/views/project/patentCollection/components/dialog/PatentBatchIndex.vue'
+import PatentIndexSetting from "@/views/project/patentCollection/components/dialog/PatentIndexSetting"
 export default {
+  mixins: [fastSelectPatent],
   props: {
     taskId: {
       default: null
@@ -100,6 +156,9 @@ export default {
     field,
     customFields,
     searchPatent,
+
+    PatentBatchIndexVue,
+    PatentIndexSetting
   },
   data() {
     return {
@@ -258,7 +317,57 @@ export default {
         }
       })
     },
-
+//查询专利自定义字段对应的值
+getPatentFields(){
+      var arr = this.fieldList.filter(item=>{
+        return item.ifPersonal && !item.ifHidden
+      })
+      if(arr.length == 0){
+        return false
+      }
+      if(this.tableData.length == 0){
+        return false
+      }
+      var patent = this.tableData[0]
+      var customFields = patent.customFields
+      if(customFields){
+        for(var i = 0;i<customFields.length;i++){
+          var index = arr.find(item=>{
+            return item.value == customFields[i].value
+          })
+          if(index != -1){
+            arr.splice(index,1)
+          }
+        }
+      }
+      var patentNos = this.tableData.map(item=>{
+        return item.patentNo
+      })
+      var params = {
+        projectId:this.projectId,
+        taskId:this.taskId,
+        patentNos:patentNos,
+        innerFields:arr.map(item=>{
+          return {
+            fieldType:item.type,
+            fieldId:item.value
+          }
+        })
+      }
+      this.$api.getPatentFields(params).then(response=>{
+        if(response.code == 200){
+          var data = response.data.data
+          for(var i = 0;i<data.length;i++){
+            var index = patentNos.findIndex(item=>{
+              return item == data[i].patentNo
+            })
+            if(index!=-1){
+              this.$set(this.tableData[index],'customFields',data[i].innerClassFields)
+            }
+          }
+        }
+      })
+    },
 
     //获取专利列表
     getList() {
@@ -270,10 +379,20 @@ export default {
         customFields: this.customFields || [],
         orderDTOList: this.sort,//排序信息
       }
+      this.$store.commit("SET_PATENT_RECORDS", []);
       this.$api.QueryPatent(params).then(res => {
         if (res.code == 200) {
           this.tableData = res.data.data
           this.total = res.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)
+          this.$store.commit("SET_PATENT_RECORDS", res.data.data);
+          if (this.quickSelect) {
+            this.commonSwitch()
+          }
+          this.isRefresh()
+          this.getPatentFields()
         }
       }).catch(error => {
         this.tableData = []
@@ -353,8 +472,32 @@ export default {
       this.fieldList = []
         this.$nextTick(()=>{
             this.fieldList = data
+            this.getPatentFields()
         })
     },
+
+    //自定义栏位以及标签设置值
+    async handleIndexSetting(patent, field) {
+      if(this.taskType != 0){
+        return
+      }
+      let obj = {
+        isAdd: [patent.patentNo],
+        isDelete: [],
+        startNumber: 1,
+        endNumber: 0,
+        searchQuery: this.searchStr,
+        customFields: this.customFields,
+        orderDTOList:this.sort,
+      }
+      if (field) {
+        this.$refs.patentIndexSetting.open(obj,patent, field)
+      }
+    },
+    submitIndex(){
+      this.getList()
+      this.$refs.customFields.refreshOptions(1)
+    },
   },
 }
 </script>
@@ -372,4 +515,50 @@ export default {
     width: 100%;
   }
 }
+</style>
+<style lang="scss" scoped>
+.patent-fast-edit-popover {
+  padding: 0 !important;
+
+  .btn {
+    color: #000;
+    line-height: 30px;
+    border-radius: 5px;
+    padding-left: 10px;
+    text-align: left;
+    font-size: 14px;
+    cursor: pointer;
+
+    &:hover {
+      background: #adadad;
+      color: #fff;
+    }
+  }
+
+  .disabled {
+    cursor: not-allowed !important;
+  }
+
+  .bottom {
+    text-align: right;
+    color: #1e9fff;
+    line-height: 40px;
+    padding-left: 10px;
+    font-size: 18px;
+  }
+
+  .el-divider--horizontal {
+    margin: 10px 0 !important;
+  }
+
+  .select-number {
+    .el-input {
+      width: 70px;
+    }
+
+    span {
+      padding: 0 3px;
+    }
+  }
+}
 </style>