Ver código fonte

删除专利

zhuliu 1 ano atrás
pai
commit
e7a12e27c5

+ 10 - 0
src/api/newApi/patent.js

@@ -335,4 +335,14 @@ export default {
   selectProductByPatentNo(data) {
     return axios.post("/xiaoshi/patent/selectProductByPatentNo", data);
   },
+
+
+  /**
+   * 批量删除专利
+   * @param {*} data 
+   * @returns 
+   */
+  deletePatents(data) {
+    return axios.post("/xiaoshi/patent/deletePatents", data);
+  },
 }

+ 15 - 1
src/views/components/import/components/importPatent.vue

@@ -97,7 +97,7 @@
                         </template>
                         
                         <el-form-item label="选择需要上传的文件" v-if="form.type != 2" style="height: 230px;">
-                            <myUpload @on-change="onChange" :fileList="files"  :autoUpload="true"></myUpload>
+                            <myUpload @on-change="onChange" :fileList="files"  :autoUpload="true" @on-remove="onRemove"></myUpload>
                         </el-form-item>
                     </el-form>
                     <div class="foot">
@@ -130,6 +130,20 @@ export default {
   mounted() {
   },
   methods: {
+    onRemove(file, fileList) {
+      if (file.guid) {
+        let a = this.formData[0].systemFileList.findIndex(item => {
+          return item.guid == file.guid
+        })
+        this.formData[0].systemFileList.splice(a, 1)
+      } else {
+        let a = this.files.findIndex(item => {
+          return item.uid == file.uid
+        })
+        this.files.splice(a, 1)
+      }
+
+    },
 
     onChange(file, fileList) {
         this.files = [file.raw]

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

@@ -33,7 +33,7 @@
                     </div>
                   </el-checkbox-group>
                 </template>
-                <template v-if="item.type === 6">
+                <template v-if="item.type === 6 || item.type === 7||item.type === 8||item.type === 9">
                   <el-tree :ref="item.id" :data="item.option" node-key="id"
                     check-strictly default-expand-all :props="{ children: 'child', label: 'name' }">
                     <span class="custom-tree-node" slot-scope="{ node, data }">
@@ -176,21 +176,21 @@ export default {
       })
     },
     //获取产品或产品类别架构以及技术分类
-    queryProductCategory(item,type) {
+     queryProductCategory(item,type) {
       let params = {
         projectId: this.projectId,
         taskId: this.taskId || null,
         type: type,//类型:1产品类别,2产品,3技术分类,4自定义树
         typeId: item.id,//产品或类别id
       }
-      this.$api.queryTreeNodeTree(params).then(res => {
+       this.$api.queryTreeNodeTree(params).then(res => {
         if (res.code == 200) {
-          this.$set(item, 'option', response.data.data)
+          this.$set(item, 'option', res.data.data)
           this.$set(item, 'selected', [])
         }
       }).catch(err => {
-        this.$set(row, 'option', [])
-        this.$set(row, 'selected', [])
+        this.$set(item, 'option', [])
+        this.$set(item, 'selected', [])
       })
     },
 

+ 38 - 1
src/views/project/patentCollection/components/mixins/fastSelectPatent.js

@@ -227,7 +227,44 @@ export const fastSelectPatent = {
 
     //批量删除专利
     deletePatents(){
-
+      this.$confirm('确认删除选择的专利吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        var params = {
+          isAdd:this.queryParams.isAdd,
+          isDelete: this.queryParams.isDelete,
+          startNumber: this.startNumber,
+          endNumber: this.endNumber,
+          searchQuery: this.searchStr,
+          customFields: this.customFields,
+          orderDTOList:this.sort,
+          projectId:this.projectId
+        }
+        this.loading  =true
+        this.$api.deletePatents(params).then(res=>{
+          if(res.code == 200){
+            this.queryParams = {
+              current: 1,
+              size: 10,
+              groupField: '0',
+              selected: [],
+              isAdd: [],
+              isDelete: [],
+            }
+            this.endNumber = 0
+            this.startNumber = 0
+            this.getSelectedTotal()
+            this.loading = false
+            this.$message.success('删除成功')
+            this.getList()
+          }
+        }).catch(error=>{
+          this.loading = false
+          this.$message.error('删除失败')
+        })
+      })
     },
   },
 }

+ 34 - 25
src/views/report/components/patentList/components/customFields/components/tab1.vue

@@ -28,18 +28,21 @@
                       icon="el-icon-search" circle></el-button>
                   </div>
                 </div>
-                <el-checkbox-group v-model="item.check" @change="onChange">
-                  <div class="source-checkbox">
-                    <el-checkbox v-for="source in item.options" :label="source.id || source.name" :key="source.id || source.name" @change="(val)=>checkData(source.id || source.name,item,val)">
-                      <myTooltip :content="source.name" placement="top" effect="light">
-                        <span class="source-checkbox-label text noWrap" :title="source.name">{{ source.name }}</span>
-                      </myTooltip>
-                      <!-- <span class="source-checkbox-label" :title="source.name">{{ source.name }}</span> -->
-                      <span v-if="source.id" class="source-checkbox-count">({{ getCount(item, source.id) }})</span>
-                      <span v-else class="source-checkbox-count">({{ source.number }})</span>
-                    </el-checkbox>
-                  </div>
-                </el-checkbox-group>
+                <div class="content_list" v-loading="item.loading">
+                  <el-checkbox-group v-model="item.check" @change="onChange">
+                    <div class="source-checkbox">
+                      <el-checkbox v-for="source in item.options" :label="source.id || source.name" :key="source.id || source.name" @change="(val)=>checkData(source.id || source.name,item,val)">
+                        <myTooltip :content="source.name" placement="top" effect="light">
+                          <span class="source-checkbox-label text noWrap" :title="source.name">{{ source.name }}</span>
+                        </myTooltip>
+                        <!-- <span class="source-checkbox-label" :title="source.name">{{ source.name }}</span> -->
+                        <span v-if="source.id" class="source-checkbox-count">({{ getCount(item, source.id) }})</span>
+                        <span v-else class="source-checkbox-count">({{ source.number }})</span>
+                      </el-checkbox>
+                    </div>
+                  </el-checkbox-group>
+                </div>
+                
               </template>
 
               <!-- 专利本身 -->
@@ -65,19 +68,22 @@
                   <el-button @click.stop="handleSearch(item)" size="small" type="primary" class="margin-left_10"
                     icon="el-icon-search" circle></el-button>
                 </div>
-                <el-checkbox-group v-model="item.check" @change="onChange">
-                  <div class="source-checkbox">
-                    {{ item.value }}
-                    <el-checkbox v-for="source in item.options" :label="source.name" :key="source.name" @change="(val)=>checkData(source.name,item,val)">
-                      <myTooltip :content="source.name" placement="top" effect="light">
-                        <span class="source-checkbox-label text noWrap" :title="source.name">
-                        {{ ['LG','PT','SS'].includes(item.value) ? typeStatus[item.value][source.name] : source.name }}
-                        </span>
-                      </myTooltip>
-                      <span class="source-checkbox-count">({{ source.number }})</span>
-                    </el-checkbox>
-                  </div>
-                </el-checkbox-group>
+                <div class="content_list" v-loading="item.loading">
+                  <el-checkbox-group v-model="item.check" @change="onChange">
+                    <div class="source-checkbox">
+                      {{ item.value }}
+                      <el-checkbox v-for="source in item.options" :label="source.name" :key="source.name" @change="(val)=>checkData(source.name,item,val)">
+                        <myTooltip :content="source.name" placement="top" effect="light">
+                          <span class="source-checkbox-label text noWrap" :title="source.name">
+                          {{ ['LG','PT','SS'].includes(item.value) ? typeStatus[item.value][source.name] : source.name }}
+                          </span>
+                        </myTooltip>
+                        <span class="source-checkbox-count">({{ source.number }})</span>
+                      </el-checkbox>
+                    </div>
+                  </el-checkbox-group>
+                </div>
+                
               </template>
 
               <div class="patent-query-filter-search-bottom">
@@ -258,4 +264,7 @@ export default {
     white-space: nowrap;
   }
 }
+.content_list{
+  min-height: 50px;
+}
 </style>

+ 1 - 1
src/views/report/components/patentList/components/customFields/components/tab2.vue

@@ -13,7 +13,7 @@
         <el-collapse v-model="activeNames" @change="handleChange($event, 2)" style="margin: 0px 5px 0px 5px;">
           <el-collapse-item v-for="item in fieldTree" :title="item.name" :name="item.value + 'a' + item.filedKind"
             :key="item.value">
-            <div v-if="ifShow">
+            <div v-if="ifShow" v-loading="item.loading">
               <el-tree @check-change="onChangeTree($event, item)" :ref="item.value" :data="item.options" node-key="id"
                 check-strictly default-expand-all :props="{ children: 'child', label: 'name' }">
                 <span class="custom-tree-node" slot-scope="{ node, data }">

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

@@ -254,6 +254,7 @@ export default {
         // }
         if (row.filedKind != -1 && (row.type == 'Array' || row.type == 'tree')) {
           if (row.filedKind == 0) {
+            this.$set(row,'loading',true)
             const [num, option] = await Promise.allSettled([this.esCountAnalysis(row), this.queryCustomOption(row)])
             var nums = num.status == 'fulfilled' ? num.value.detailDTOS : []
             var options = option.status == 'fulfilled' ? option.value : []
@@ -270,6 +271,7 @@ export default {
               )
             }
             this.$set(row, 'options', options)
+            this.$set(row,'loading',false)
             if (!sign) {
              this.$set(row, 'check', []) 
             }
@@ -291,6 +293,7 @@ export default {
             this.$set(row, 'nums', nums)
           }
         } else {
+          this.$set(row,'loading',true)
           const [num] = await Promise.allSettled([this.esCountAnalysis(row)])
           var nums = num.status == 'fulfilled' ? num.value.detailDTOS : []
           // if(row.groupBy == "company"){
@@ -302,6 +305,7 @@ export default {
             }
           // }
           this.$set(row, 'options', nums)
+          this.$set(row,'loading',false)
           if (!sign) {
             this.$set(row, 'check', []) 
           }

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

@@ -88,6 +88,7 @@
                   </el-button>
                   <el-dropdown-menu slot="dropdown">
                     <el-dropdown-item @click.native="handleIndex">批量标引</el-dropdown-item>
+                    <el-dropdown-item @click.native="deletePatents" v-if="!taskId">删除</el-dropdown-item>
                   </el-dropdown-menu>
                 </el-dropdown>
               </div>