소스 검색

解决产品架构无法标引问题

zhuliu 4 달 전
부모
커밋
b60cdc31e2

+ 32 - 6
src/views/product/components/commodity/commodity.vue

@@ -3,7 +3,8 @@
   <div class="commodity height_100">
     <el-container>
       <el-header class="header">
-        <div class="headerDiv_one">产品名称:{{ productName }}</div>
+        <div class="headerDiv_one" v-if="productOrStructure == 2">产品名称:{{ productName }}</div>
+        <div class="headerDiv_one" v-if="productOrStructure == 3">架构名称:{{ structureName }}</div>
         <div class="headerDiv_two">
           <div>
             <!-- 检索信息 -->
@@ -25,7 +26,7 @@
             </div>
             <!-- 显示栏位管理等下拉菜单 -->
             <div>
-              <el-dropdown trigger="click" split-button type="primary" size="small">
+              <el-dropdown v-if="productOrStructure == 2" trigger="click" split-button type="primary" size="small" >
                 <span @click="handleCommand('3')">显示栏位管理</span>
                 <el-dropdown-menu slot="dropdown" class="text-align_center">
                   <el-dropdown-item>
@@ -40,18 +41,19 @@
                   </el-dropdown-item>
                 </el-dropdown-menu>
               </el-dropdown>
+              <el-button v-else type="primary" size="small" @click="handleCommand('3')">显示栏位管理</el-button>
             </div>
           </div>
         </div>
       </el-header>
       <el-main v-loading="loading">
         <component :is="viewSelected" :tableData="tableData" :queryParams="queryParams" :patentNoList.sync="patentNoList"
-          :column="customList" @on-sort="handleSort" @addSelect="getChoosePatentNo" :refresh='refresh' @clickPatentNo="handleClick">
+          :column="customList" @on-sort="handleSort" @addSelect="getChoosePatentNo" :refresh='productOrStructure==2?true:false' @clickPatentNo="handleClick">
         </component>
       </el-main>
       <el-footer style="display: flex;justify-content: space-between;align-items: center;">
         <div>
-          <div style="display:flex;align-items:center">
+          <div v-if="productOrStructure == 2" style="display:flex;align-items:center">
             <span v-if="selectedTotal > 0">
               已勾选 <b>{{ selectedTotal }}</b> 条
             </span>
@@ -106,7 +108,19 @@ export default {
     },
     projectType:{
       default:3
-    }
+    },
+    productOrStructure:{//类型,2是产品,3是架构
+      default:2
+    },
+    structureId:{//架构id
+      default:''
+    },
+    structureName:{//架构名称
+      default:''
+    },
+    categoryId:{//架构所属类别id
+      default:''
+    },
   },
   data() {
     return {
@@ -247,12 +261,24 @@ export default {
       this.queryParams.isDelete=[]
       let params = {
         ...this.queryParams,//分页信息及区分同族类型
-        productId: this.productId,
+        // productId: this.productId,
         from: 'product',
         searchQuery: this.searchStr || '',//检索条件
         customFields: [],
         orderDTOList: this.sort,//排序信息
       }
+      if(this.productOrStructure == 2){
+        params.productId = this.productId
+      }else if(this.productOrStructure == 3){
+        let obj = {
+          "fieldId": this.categoryId,
+          "fieldValue": [
+              this.structureId
+          ],
+          "ifHaveChild": true
+        }
+        params.customFields.push(obj)
+      }
       this.loading = true
       this.$store.commit("SET_PATENT_RECORDS", []);
       this.$api.QueryPatent(params).then(res => {

+ 15 - 3
src/views/product/components/commodity/index.vue

@@ -1,7 +1,7 @@
 <template>
   <!-- 商品化专利 -->
-  <div>
-    <commodity :productId="productId" :productName="productName" :projectType="projectType"></commodity>
+  <div class="height_100">
+    <commodity :productId="productId" :productName="productName" :projectType="projectType" :productOrStructure="productOrStructure" :structureId="structureId" :structureName="structureName" :categoryId="categoryId"></commodity>
   </div>
 </template>
 
@@ -18,7 +18,7 @@ export default {
   },
   computed:{
     productId(){
-      return this.$route.query.productId
+      return this.$route.query.productId || 0
     },
     productName(){
       return this.$route.query.productName
@@ -26,6 +26,18 @@ export default {
     projectType(){
       return this.$route.query.projectType
     },
+    productOrStructure(){//类型,2是产品,3是架构
+      return this.$route.query.type || 2
+    },
+    structureId(){//架构id
+      return this.$route.query.structureId
+    },
+    structureName(){//架构名称
+      return this.$route.query.structureName
+    },
+    categoryId(){//架构所属类别id
+      return this.$route.query.categoryId
+    },
   },
   mounted() {
 

+ 22 - 17
src/views/product/components/jsMind/components/mind.vue

@@ -263,6 +263,7 @@ export default {
                 </div>
                 `;
       } else if (modelInfo.MindType == 2) {//产品
+        // <p class="model-title-p model-patent" onclick="check(${modelInfo.MindId},${modelInfo.MindType},'${modelInfo.name}','${modelInfo.categoryId}')">相关专利:<span>${modelInfo.relevantProductNum}</span></p>
         return `
                 <div class="model-edit-card">
                   <div class="img" onclick="vm.checkImg('${ (modelInfo.systemFileList && modelInfo.systemFileList.length > 0)? this.$commonJS.checkViewer(modelInfo.systemFileList[0].guid): ""}')">
@@ -271,7 +272,7 @@ export default {
                   <div class="patent">
                       <p class="model-title-p"><span>${ modelInfo.name}</span></p>
                       <p class="model-title-p model-patent" onclick="check(${modelInfo.MindId},${modelInfo.MindType},'${modelInfo.name}','${modelInfo.categoryId}')">商品化专利:<span>${modelInfo.productNum}</span></p>
-                      <p class="model-title-p model-patent1" onclick="check1(${modelInfo.MindId},${modelInfo.MindType},'${modelInfo.name}','${modelInfo.categoryId}')">相关专利:<span>${modelInfo.relevantProductNum}</span></p>
+                     
                   </div>
                   <div class="icon" style="display:${modelInfo.hasChildren? "block":"none"}">
                       >>>
@@ -286,7 +287,7 @@ export default {
                   </div>
                     <div  class="patent">
                             <p class="model-title-p"><span>${ modelInfo.name}</span></p>
-                            <p class="model-title-p model-patent1" onclick="check1(${modelInfo.MindId},${modelInfo.MindType},'${modelInfo.pathName}','${modelInfo.productName}')">相关专利:<span>${modelInfo.relevantProductNum}</span></p>
+                            <p class="model-title-p model-patent" onclick="check(${modelInfo.MindId},${modelInfo.MindType},'${modelInfo.pathName}','${modelInfo.typeId}','${modelInfo.name}')">相关专利:<span>${modelInfo.relevantProductNum}</span></p>
                     </div>
                     <div class="icon" style="display:${ modelInfo.hasChildren? "block":"none"}">
                       >>>
@@ -301,9 +302,10 @@ export default {
      * @param {*} id 产品id或者架构id
      * @param {*} type 类型2是产品3是架构
      * @param {*} name 产品名称或者架构路径
-     * @param {*} categoryId 架构id 
+     * @param {*} categoryId 产品类别id
+     * @param {*} typeId 
      */
-    check(id, type,name,categoryId) {
+    check(id, type,name,categoryId,categoryName) {
       if (type == 2) {//产品
         var form = {
           name:name,
@@ -314,23 +316,26 @@ export default {
         let router = this.$router.resolve({
           path: '/commodity',
           query: {
-            productId:id,
-            productName:name,
+            productId:id,//产品id
+            productName:name,//产品名称
+            type:type
           }
         })
         window.open(router.href, '_blank')
       } 
-      // else if (type == 3) {//架构
-      //   name =productName + '/' + name.substring(0, name.length - 1);
-      //   const router = this.$router.resolve({
-      //     path: "/relatedPatentsIndex",
-      //     query: {
-      //       structureId: id,
-      //       name:name
-      //     },
-      //   });
-      //   window.open(router.href, "_blank");
-      // }
+      else if (type == 3) {//架构
+        name =categoryName + '/' + name.substring(0, name.length - 1);
+        const router = this.$router.resolve({
+          path: "/commodity",
+          query: {
+            structureId: id,//架构
+            structureName:name,//架构名称
+            type:type,
+            categoryId:categoryId,//所属类别id
+          },
+        });
+        window.open(router.href, "_blank");
+      }
       this.next = false;
     },
     // 筛选树结构

+ 8 - 2
src/views/project/patentCollection/components/dialog/PatentBatchIndex.vue

@@ -4,6 +4,12 @@
       <el-container class="patent-batch-index">
         <el-main class="patent-batch-index-main">
           <el-form>
+            <el-form-item label="标引操作规则:">
+              <el-select v-model="indexingRules"  placeholder="请选择标引操作规则" >
+                  <el-option label="覆盖原标引结果" :value="2"></el-option>
+                  <el-option label="新增标引结果" :value="1"></el-option>
+              </el-select>
+            </el-form-item>
             <el-form-item v-for="(item, index) in field" :key="index">
               <div slot="label">
                 <span>{{ index + 1 }}. {{ item.name }}</span>
@@ -86,6 +92,7 @@ export default {
       selectValue: [],
       // // 排序
       // orderDTOList:[],
+      indexingRules:2,//标引操作规则
     }
   },
   mounted() {
@@ -105,7 +112,7 @@ export default {
         projectId: this.projectId,
         fieldType: val.type,
         fieldId: val.id,
-        optionType: 2,//操作类型 0取消 1增加 2覆盖
+        optionType: this.indexingRules,//操作类型 0取消 1增加 2覆盖
         taskId: this.taskId
       }
       if ([0, 1, 2,4].includes(val.type)) {
@@ -116,7 +123,6 @@ export default {
       this.findSplice(val,obj)
     },
     findSplice(val,obj) {
-      console.log(this.selectValue,val,obj)
       let a = this.selectValue.findIndex(item => {
         return item.fieldId == val.id
       })

+ 2 - 4
src/views/project/patentDetails/components/PatentField.vue

@@ -224,7 +224,6 @@ export default {
     },
     // change与clickItem公用
     gong(data, item, checked) {
-      console.log(data,item)
       var params = {
         projectId: this.projectId,
         taskId: this.taskId,
@@ -234,6 +233,7 @@ export default {
         patentNo: this.patentNo,
         optionType: '',
       }
+      // 判断optionType  0取消1添加2覆盖
       if (item.type == 0 || item.type == 1 || item.type == 2 || item.type == 4) {
         if (item.type != 4) {
           params.fieldValue[0] = item.selectedValue
@@ -258,9 +258,7 @@ export default {
           }
         }
         params.optionType = 2
-      }
-      // 判断optionType  0取消1添加2覆盖
-      if (item.type == 6 || item.type == 5) {
+      }else {
         if (checked) {
           item.selectedValue.push(data.id)
           var name = ''