浏览代码

将专利数据库里面的专利导入到报告中

zhuliu 1 年之前
父节点
当前提交
6b9d2063da

+ 8 - 0
src/api/newApi/project.js

@@ -41,5 +41,13 @@ export default {
     groupPatentProject(data) {
         return axios.post("/xiaoshi/patentProject/groupPatentProject", data);
     },
+    /**
+     * 添加专利到报告中
+     * @param {*} data 
+     * @returns 
+     */
+    addProjectPatentToReport(data){
+        return axios.post("/xiaoshi/patentProject/addProjectPatentToReport", data);
+    },
     
 };

+ 17 - 16
src/views/project/patentCollection/components/dialog/PatentBatchIndex.vue

@@ -77,15 +77,15 @@ export default {
       // 自定义及架构数据源
       field: [],
       // 选择的数据
-      selectQuery: {},
+      // selectQuery: {},
       // 检索的数据
-      searchQuery: '',
+      searchQuery: null,
       // 自定义字段筛选的数据
-      customFields: [],
-      // 自定义字段选中或填写的值
-      selectValue: [],
-      // 排序
-      orderDTOList:[],
+      // customFields: [],
+      // // 自定义字段选中或填写的值
+      // selectValue: [],
+      // // 排序
+      // orderDTOList:[],
     }
   },
   mounted() {
@@ -204,12 +204,13 @@ export default {
     },
 
     // 打开弹窗
-    async open({ selectQuery, searchQuery, customFields ,orderDTOList }) {
+    async open(obj) {
       // console.log(selectQuery, searchQuery, customFields);
-      this.selectQuery = selectQuery
-      this.searchQuery = searchQuery
-      this.customFields = customFields
-      this.orderDTOList = orderDTOList
+      // this.selectQuery = selectQuery
+      // this.searchQuery = searchQuery
+      // this.customFields = customFields
+      // this.orderDTOList = orderDTOList
+      this.searchQuery = obj
       await this.getList()
       this.visible = true
     },
@@ -218,10 +219,10 @@ export default {
       let params = {
         projectId: this.projectId,
         taskId:this.taskId,
-        ...this.selectQuery,//选择的信息
-        searchQuery: this.searchQuery,//检索的信息
-        customFields: this.customFields,//自定义字段的信息
-        orderDTOList:this.orderDTOList,//排序
+        // ...this.selectQuery,//选择的信息
+        ...this.searchQuery,//检索的信息
+        // customFields: this.customFields,//自定义字段的信息
+        // orderDTOList:this.orderDTOList,//排序
         esCustomFieldDTOS: this.selectValue,
       }
       this.$api.batchAddCustomField(params).then(res => {

+ 7 - 6
src/views/project/patentCollection/components/mixins/fastSelectPatent.js

@@ -224,14 +224,14 @@ export const fastSelectPatent = {
      // 批量标引
      handleIndex() {
       let obj = {
-        selectQuery: {
-          isAdd: this.queryParams.isAdd,
-          isDelete: this.queryParams.isDelete,
-          startNumber: this.startNumber,
-          endNumber: this.endNumber,
-        },
+        isAdd: this.queryParams.isAdd,
+        isDelete: this.queryParams.isDelete,
+        startNumber: this.startNumber,
+        endNumber: this.endNumber,
+
         searchQuery: this.searchStr,
         customFields: this.customFields,
+        groupField:this.queryParams.groupField,
         orderDTOList:this.sort,
       }
       this.$refs.PatentBatchIndexVue.open(obj)
@@ -251,6 +251,7 @@ export const fastSelectPatent = {
           endNumber: this.endNumber,
           searchQuery: this.searchStr,
           customFields: this.customFields,
+          groupField:this.queryParams.groupField,
           orderDTOList:this.sort,
           projectId:this.projectId
         }

+ 77 - 7
src/views/project/patentCollection/index.vue

@@ -5,7 +5,7 @@
       <el-aside class="height_100" :width="showLeft ? '300px' : '0px'" v-show="showLeft">
         <div class="height_100">
           <customFields ref="customFields" :projectId="projectId" :searchOption="searchStr" :customFields="customFields"
-            @customTab="handleCustomFields" :searchPatentCheck="searchPatentCheck">
+            @customTab="handleCustomFields" :searchPatentCheck="searchPatentCheck" :groupField="queryParams.groupField">
           </customFields>
         </div>
       </el-aside>
@@ -48,7 +48,8 @@
                 </el-button>
               </el-tooltip>
             </el-button-group>
-            <el-dropdown trigger="click" split-button type="primary" size="small">
+            <el-button class="margin-left_10" type="primary" size="small" @click="handleFieldManage" v-if="toProjectId && toProjectName">显示栏位管理</el-button>
+            <el-dropdown v-else trigger="click" split-button type="primary" size="small">
               <span @click="handleFieldManage">显示栏位管理</span>
               <el-dropdown-menu slot="dropdown" class="text-align_center">
                 <el-dropdown-item @click.native="handleFile">报告文档</el-dropdown-item>
@@ -177,9 +178,13 @@
                     :disabled="!$permission('/workspace/folder/isRead')">已读</el-dropdown-item>
                   <el-dropdown-item @click.native="handleRead(0)"
                     :disabled="!$permission('/workspace/folder/isRead')">未读</el-dropdown-item> -->
-                  <el-dropdown-item @click.native="handleIndex">批量标引</el-dropdown-item>
-                  <el-dropdown-item @click.native="checkPatentWorth">价值曲线</el-dropdown-item>
-                  <el-dropdown-item @click.native="deletePatents">删除</el-dropdown-item>
+                  <el-dropdown-item v-if="toProjectId && toProjectName" @click.native="addPatentToReport(toProjectId)">加入到报告({{ toProjectName }})中</el-dropdown-item>
+                  <template v-else>
+                    <el-dropdown-item @click.native="handleIndex">批量标引</el-dropdown-item>
+                    <el-dropdown-item @click.native="checkPatentWorth">价值曲线</el-dropdown-item>
+                    <el-dropdown-item @click.native="deletePatents">删除</el-dropdown-item>
+                  </template>
+                  
                 </el-dropdown-menu>
               </el-dropdown>
             </div>
@@ -206,7 +211,7 @@
     <!-- 报告文档 -->
     <reportFileDrawer ref="reportFileDrawer"></reportFileDrawer>
     <!-- 创建FTO报告 -->
-    <addAndEditReport ref="addAndEditReport"></addAndEditReport>
+    <addAndEditReport ref="addAndEditReport" @addPatentToReport="addPatentToReport"></addAndEditReport>
     <!-- 批量那个标引 -->
     <PatentBatchIndexVue ref="PatentBatchIndexVue" @submit="submitIndex" :projectId="projectId"></PatentBatchIndexVue>
     <!-- 单个栏位标引 -->
@@ -319,6 +324,12 @@ export default {
     projectName() {
       return this.$route.query.projectName
     },
+    toProjectId(){
+      return this.$route.query.toProjectId
+    },
+    toProjectName(){
+      return this.$route.query.toProjectName
+    },
   },
   created() { },
   async mounted() {
@@ -384,6 +395,7 @@ export default {
         searchOption: {
           searchQuery: this.searchStr || '',
           customFields: this.customFields,
+          groupField:this.queryParams.groupField,
           orderDTOList: this.sort,
           moreConditions:true
         },
@@ -617,14 +629,65 @@ export default {
         signPatentNo: '',
         matterId: [],
         scenarioId: [],
+        assoReportId: this.projectId,
       }
-      this.$refs.addAndEditReport.open(form)
+      var havePatent = this.selectedTotal>0
+      this.$refs.addAndEditReport.open(form,havePatent)
+    },
+    //添加专利到报告中
+    addPatentToReport(reportId){
+      if(!reportId){
+        return 
+      }
+      var params = {
+        stringRequest:{
+          projectId: this.projectId,
+          searchQuery: this.searchStr,
+          customFields: this.customFields,
+          orderDTOList:this.sort,
+          groupField:this.queryParams.groupField
+        },
+        fromProjectId:this.projectId, //来源专题库项目id
+        startNumber:this.startNumber, //开始位置
+        endNumber:this.endNumber,//结束位置
+        toProjectId:reportId, //目标报告项目id
+        isAdd:this.queryParams.isAdd, //去除专利号
+        isDelete:this.queryParams.isDelete, //附加专利号
+      }
+      var message = this.$message({
+        type:'warning',
+        message: '正在将专利导入报告中...',
+        duration: 0 // 设置为0表示不自动关闭
+      })
+
+      this.$api.addProjectPatentToReport(params).then(res=>{
+        if(res.code == 200){
+          message.close()
+          this.$message(
+            {
+              type:'success',
+              message:'导入成功'
+            }
+          )
+        }
+      }).catch(error=>{
+        message.close()
+        this.$message(
+            {
+              type:'error',
+              message:'导入失败'
+            }
+          )
+      })
     },
     //切换同族
     onChangeFamily(key) {
       this.queryParams.current = 1
       this.queryParams.groupField = key
       this.getList()
+      this.$nextTick(()=>{
+        this.$refs.customFields.close()
+      })
     },
    
     //价值曲线
@@ -636,6 +699,7 @@ export default {
         endNumber: this.endNumber,
         searchQuery: this.searchStr,
         customFields: this.customFields,
+        groupField:this.queryParams.groupField,
         orderDTOList:this.sort,
         projectId: this.projectId,
       }
@@ -663,6 +727,7 @@ export default {
         endNumber: this.endNumber,
         searchQuery: this.searchStr,
         customFields: this.customFields,
+        groupField:this.queryParams.groupField,
         orderDTOList:this.sort,
       }
       if (!val) {
@@ -691,6 +756,7 @@ export default {
           projectId: this.projectId,
           searchQuery: this.searchStr || '',//检索条件
           customFields: this.customFields || [],//自定义字段的检索
+          groupField:this.queryParams.groupField,
           isAdd: this.queryParams.isAdd,
           isDelete: this.queryParams.isDelete,
           startNumber: this.startNumber,
@@ -702,6 +768,7 @@ export default {
           projectId: this.projectId,
           searchQuery: this.searchStr || '',//检索条件
           customFields: this.customFields || [],//自定义字段的检索
+          groupField:this.queryParams.groupField,
           isAdd: [],
           isDelete: [],
           startNumber: 1,
@@ -745,6 +812,7 @@ export default {
       var params = {
         searchQuery: this.searchStr || '',//检索条件
         customFields: this.customFields || [],
+        groupField:this.queryParams.groupField,
         orderDTOList: this.sort,//排序信息
         projectId:this.projectId
       }
@@ -766,6 +834,7 @@ export default {
           query: {
             projectId: this.projectId,
             searchOption: this.searchStr,//输入框检索条件
+            groupField:this.queryParams.groupField,
             customFields: JSON.stringify(this.customFields),//右侧勾选自定义栏位的条件
             projectType:1
           }
@@ -830,6 +899,7 @@ export default {
         endNumber: 0,
         searchQuery: this.searchStr,
         customFields: this.customFields,
+        groupField:this.queryParams.groupField,
         orderDTOList:this.sort,
       }
       if (field) {

+ 4 - 1
src/views/report/components/details/index.vue

@@ -13,7 +13,7 @@
         </el-menu>
       </el-aside>
       <el-main>
-        <component :is='componentName' :projectId="projectId" :projectType="projectType" :isOnly="activeMenu=='splitPatent'?true:false" :projectName="projectName" :patentNo="patentNo" :reportType="reportType" :patentType="reportMessage.patentType" :ifSecondInvalid="reportMessage.ifSecondInvalid" @refreshData="getReportMessage"></component>
+        <component :is='componentName' :projectId="projectId" :assProjectId="assProjectId" :projectType="projectType" :isOnly="activeMenu=='splitPatent'?true:false" :projectName="projectName" :patentNo="patentNo" :reportType="reportType" :patentType="reportMessage.patentType" :ifSecondInvalid="reportMessage.ifSecondInvalid" @refreshData="getReportMessage"></component>
       </el-main>
     </el-container>
 
@@ -57,6 +57,9 @@ export default {
     projectId() {
       return this.$route.query.projectId
     },
+    assProjectId(){
+      return this.$route.query.assProjectId || this.reportMessage.assoReportId
+    },
     projectName() {
       return this.$route.query.projectName
     },

+ 29 - 6
src/views/report/components/dialog/addAndEditReport.vue

@@ -233,7 +233,11 @@
           <el-input type='textarea' v-model="form.description" autocomplete="off" placeholder="请输入备注"></el-input>
         </el-form-item>
       </el-form>
+     
       <div slot="footer">
+        <div v-if="havePatent.show" style="padding:0 15px">
+          <el-checkbox v-model="havePatent.checked">将选择的专利作为该报告的相关专利</el-checkbox>
+        </div>
         <el-button @click="handleClose(false)">取 消</el-button>
         <!-- <el-button type="primary" @click="ifNext" v-if="form.reportType == 7 && !form.id">下一步</el-button> -->
         <el-button type="primary" :loading="patentLoading" @click="submit">确 定</el-button>
@@ -448,7 +452,11 @@ export default {
           value:0
         },
       ],
-      isExist:true
+      isExist:true,
+      havePatent:{
+        show:false,
+        checked:false
+      },
     };
   },
   watch: {},
@@ -669,8 +677,12 @@ export default {
     },
 
     //打开弹窗
-    async open(form) {
+    async open(form,havePatent) {
       this.patentLoading = false
+        this.havePatent={
+          show:havePatent,
+          checked:havePatent
+        }
       var a = '编辑'
       this.form = JSON.parse(JSON.stringify(form))
       this.eventList.data = []
@@ -758,6 +770,7 @@ export default {
           this.getPatentNo()
         }
       }
+
       // this.getEventList()
       this.showDialog = true
     },
@@ -808,7 +821,7 @@ export default {
     handleSelectProduct(val) {
       this.$set(this.form, 'signProjectId', val.id)
       if (this.form.signProjectId) {
-        this.form.signPatentNo=''
+        this.form.signPatentNo=val.name
       }
       this.$set(this.form, 'name', val.name + 'FTO调查')
     },
@@ -885,7 +898,7 @@ export default {
         return
       }
       var params = {
-        patentNo:this.form.signPatentNo
+        patentNo:this.form.signPatentNo.trim()
       }
       this.$api.queryPatentByNo(params).then(response=>{
         if(response.code == 200){
@@ -902,7 +915,7 @@ export default {
     //外部检索专利是否存在
     checkPatent2(){
       var params = {
-        patentNo:this.form.signPatentNo
+        patentNo:this.form.signPatentNo.trim()
       }
       this.$api.queryPatentByNoFromWeb(params).then(response=>{
         if(response.code == 200){
@@ -925,7 +938,7 @@ export default {
     patentImport(){
       var params = {
           "type": "2",
-          "searchCondition": this.form.signPatentNo,
+          "searchCondition": this.form.signPatentNo.trim(),
           "importContent": 1111,
       }
       this.$api.addImportTask(params).then(response=>{
@@ -1099,6 +1112,14 @@ export default {
       this.showDialog = false
       this.clear()
     },
+
+    //添加专利到报告中
+    addPatentToReport(reportId){
+      if(this.havePatent.checked){
+        this.$emit('addPatentToReport',reportId)
+      }
+    },
+
     //清空组件缓存数据
     clear() {
       // 清空事件相关
@@ -1122,6 +1143,7 @@ export default {
           this.splitClaim(response.data)
           this.saveFlowPath(response.data)
           this.handleClose(response.data)
+          
         }
       }).catch(error => {
         // 如果报告未创建成功,则赋值
@@ -1209,6 +1231,7 @@ export default {
       })
     },
     saveFlowPath(projectId){
+      this.addPatentToReport(projectId)
       if(!this.form.flowPath || this.form.id){
         return false
       }

+ 11 - 1
src/views/report/components/index.vue

@@ -635,6 +635,9 @@ export default {
         path:'/evidence',
         query:{
           projectId:row.id,
+          projectName:row.name,
+          projectType:2,
+          assProjectId:row.assoReportId,
           reportType:row.reportType,
           signPatentNo:row.signPatentNo,
           patentNo:row.signPatentNo
@@ -655,7 +658,14 @@ export default {
         {
           path:'/reportPatentList',
           query:{
-            projectId:row.id
+            projectId:row.id,
+            patentNo:row.signPatentNo,
+            signPatentNo:row.signPatentNo,
+            reportType: row.reportType,
+            status:row.status,
+            projectName:row.name,
+            projectType:2,
+            assProjectId:row.assoReportId
           }
         }
       )

+ 2 - 1
src/views/report/components/mixins/index.js

@@ -37,7 +37,8 @@ export default {
           reportType: row.reportType,
           status:row.status,
           projectName:row.name,
-          projectType:2
+          projectType:2,
+          assProjectId:row.assoReportId
         }
       })
       window.open(router.href, '_self')

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

@@ -54,6 +54,9 @@ export default {
         return []
       }
     },
+    groupField:{
+      default:''
+    },
     // 检索式的数组数据
     searchPatentCheck: {
       default: () => {
@@ -366,6 +369,7 @@ export default {
         taskId: this.taskId,//任务id
         countVOS: countVOS,//栏位的聚合入参
         customFields: this.customFields,//自定义栏位查询
+        groupField:this.groupField,
       }
       return await this.$api.esCountAnalysis(params).then(res => res.data)
       this.$api.esCountAnalysis(params).then(res => {

+ 17 - 1
src/views/report/components/patentList/components/index.vue

@@ -32,6 +32,7 @@
                         <el-dropdown-item command="2">专利号导入</el-dropdown-item>
                         <el-dropdown-item command="3">Excel导入</el-dropdown-item>
                         <el-dropdown-item command="4">检索导入</el-dropdown-item>
+                        <el-dropdown-item v-if="projectType == 2 && assProjectId" command="5">从专题库导入</el-dropdown-item>
                       </el-dropdown-menu>
                     </el-dropdown>
                   </el-dropdown-item>
@@ -139,6 +140,9 @@ export default {
     projectId: {
       default: 0
     },
+    assProjectId:{
+
+    },
     projectName:{
 
     },
@@ -460,7 +464,19 @@ getPatentFields(){
         case '4'://检索导入
           this.patentImport(4)
           break;
-
+        case '5':
+          const router = this.$router.resolve({
+            path: '/project/patentCollection',
+            query: {
+              id: this.assProjectId,//专利数据库id
+              projectName:this.projectName,//专利数据库名称
+              projectType:2,//专利数据库类型
+              toProjectId:this.projectId,
+              toProjectName:this.projectName
+            }
+          })
+          window.open(router.href, '_self');
+          break;
         default:
           break;
       }

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

@@ -1,7 +1,7 @@
 <template>
   <!--  -->
   <div>
-    <patentList :projectId="projectId" :projectName="projectName" :projectType="projectType" :taskId="taskId" :taskType="taskType" :reportType="reportType" :isResult="isResult" :handlerType="handlerType"></patentList>
+    <patentList :projectId="projectId" :projectName="projectName" :assProjectId="assProjectId" :projectType="projectType" :taskId="taskId" :taskType="taskType" :reportType="reportType" :isResult="isResult" :handlerType="handlerType"></patentList>
   </div>
 </template>
 
@@ -20,6 +20,9 @@ export default {
     projectId() {
       return this.$route.query.projectId || 0
     },
+    assProjectId(){
+      return this.$route.query.projectId
+    },
     projectName() {
       return this.$route.query.projectName
     },