Ver Fonte

商品化专利

zhuhao há 1 ano atrás
pai
commit
b0606e5e9a

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

@@ -327,4 +327,12 @@ export default {
   delProductPatent(data) {
     return axios.post("/xiaoshi/patent/delProductPatent", data);
   },
+  /**
+   * 根据专利号查询相关产品
+   * @param {*} data 
+   * @returns 
+   */
+  selectProductByPatentNo(data) {
+    return axios.post("/xiaoshi/patent/selectProductByPatentNo", data);
+  },
 }

+ 58 - 58
src/views/product/components/commodity/commodity.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 商品化专利主页面 -->
-  <div class="commodity">
+  <div class="commodity height_100">
     <el-container>
       <el-header class="header">
         <div class="headerDiv_one">产品名称:{{ productName }}</div>
@@ -46,7 +46,7 @@
       </el-header>
       <el-main v-loading="loading">
         <component :is="viewSelected" :tableData="tableData" :queryParams="queryParams" :patentNoList.sync="patentNoList"
-          :column="customList" @on-sort="handleSort">
+          :column="customList" @on-sort="handleSort" @addSelect="getChoosePatentNo" :refresh='refresh' @clickPatentNo="handleClick">
         </component>
       </el-main>
       <el-footer style="display: flex;justify-content: space-between;align-items: center;">
@@ -56,7 +56,7 @@
               已勾选 <b>{{ selectedTotal }}</b> 条
             </span>
             <el-popover placement="bottom" title="" width="220" trigger="click">
-              <el-main class="patent-fast-edit-popover">
+              <el-main class="patent-fast-edit-popover" v-loading="selectNumberLoading">
                 <div class="btn" @click="handleCancelSelectNumber">取消选择</div>
                 <div class="btn" @click="handleSelectNumber(0)">本页选择</div>
               </el-main>
@@ -160,8 +160,26 @@ export default {
     this.customList = await this.$commonJS.getCustomField('patent', { productId: this.productId })
     await this.getColumn()
     // 获取专利信息
+    this.getList()
   },
   methods: {
+    // 点击专利号进行跳转
+    handleClick(row, location) {
+      var search = {
+        searchOption: this.searchOption,
+        location: location,
+      }
+      this.$s.setSession('search', search)
+      this.$router.push(
+        {
+          path: '/patentDetails/' + row.patentNo,
+          query: {
+            productId: this.productId,
+            projectType:'3',//判断是不是从专题库进入专利详情1为专题库2为报告(报告未传2)
+          }
+        }
+      )
+    },
     // 删除
     handleDel() {
       this.$confirm('此操作将永久删除选中的专利, 不可恢复, 是否继续?', '提示', {
@@ -169,9 +187,12 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        let params = this.isAdd
-        this.$api.del(params).then(response => {
-          if (response.code == 200) {
+        let params = {
+          productIds: [this.productId],
+          patentNos: this.patentNoList,
+        }
+        this.$api.delProductPatent(params).then(res => {
+          if (res.code == 200) {
             this.$message.success('删除成功')
             this.getList()
           }
@@ -213,16 +234,18 @@ export default {
       if (size) {
         this.queryParams.size = size
       }
+      this.queryParams.isAdd=[]
+      this.queryParams.isDelete=[]
       let params = {
         ...this.queryParams,//分页信息及区分同族类型
         productId: this.productId,
-        from:'product',
+        from: 'product',
         searchQuery: this.searchStr || '',//检索条件
         customFields: [],
         orderDTOList: this.sort,//排序信息
       }
       this.loading = true
-      // this.$store.commit("SET_PATENT_RECORDS", []);
+      this.$store.commit("SET_PATENT_RECORDS", []);
       this.$api.QueryPatent(params).then(res => {
         if (res.code == 200) {
           this.tableData = res.data.data
@@ -231,10 +254,10 @@ export default {
           // 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_PARAMS", params);
-          // this.$store.commit("SET_PATENT_RECORDS", res.data.data);
-          // if (this.quickSelect) {
-          //   this.commonSwitch()
-          // }
+          this.$store.commit("SET_PATENT_RECORDS", res.data.data);
+          if (this.quickSelect) {
+            this.commonSwitch()
+          }
           this.loading = false
           this.isRefresh()
         }
@@ -279,13 +302,13 @@ export default {
     handleCommand(even) {
       switch (even) {
         case '0'://Excel导入
-          this.patentImport(this.productId,1)
+          this.patentImport(this.productId, 1)
           break
         case '1'://专利号导入
-          this.patentImport(this.productId,2)
+          this.patentImport(this.productId, 2)
           break
         case '2'://检索条件导入
-          this.patentImport(this.productId,4)
+          this.patentImport(this.productId, 4)
           break
         case '3'://显示栏位管理
           this.handleFieldManage()
@@ -317,23 +340,27 @@ export default {
   },
 }
 </script>
-<style lang="scss">
+<style lang="scss"></style>
+<style lang="scss" scoped>
 .commodity {
-  .el-footer {
-    width: 100%;
-    position: fixed;
-    bottom: 0;
-    z-index: 1;
-    background: #fff;
+  .header {
+    height: 80px !important;
+    display: flex;
+    flex-wrap: wrap;
+    padding: 10px 0px !important;
   }
-}
 
-.btn1 {
-  background: #909399;
-}
+  .headerDiv_one {
+    width: 100%;
+    margin: 0 0 10px 10px
+  }
 
-.btn1:hover {
-  background-color: #a4a7ab;
+  .headerDiv_two {
+    width: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+  }
 }
 
 .patent-fast-edit-popover {
@@ -341,9 +368,11 @@ export default {
 
   .btn {
     color: #000;
-    line-height: 40px;
+    line-height: 30px;
     border-radius: 5px;
     padding-left: 10px;
+    text-align: left;
+    font-size: 14px;
     cursor: pointer;
 
     &:hover {
@@ -378,33 +407,4 @@ export default {
     }
   }
 }
-
-.patent-left {
-  margin-top: 69px;
-  overflow: hidden;
-  border-top: 1px solid rgb(228 231 237);
-}
-</style>
-<style lang="scss" scoped>
-.commodity {
-  .header {
-    height: 80px !important;
-    display: flex;
-    flex-wrap: wrap;
-    padding: 10px 0px !important;
-  }
-
-  .headerDiv_one {
-    width: 100%;
-    margin: 0 0 10px 10px
-  }
-
-  .headerDiv_two {
-    width: 100%;
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-  }
-
-}
 </style>

+ 2 - 2
src/views/product/components/dialog/addEditProduct.vue

@@ -75,8 +75,8 @@
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
           </el-upload>
         </el-form-item>
-        <el-form-item label="产品说明" prop="productExplain">
-          <el-input v-model="form.productExplain" type="textarea" :rows="2" placeholder="请输入产品说明"></el-input>
+        <el-form-item label="产品说明" prop="description">
+          <el-input v-model="form.description" type="textarea" :rows="2" placeholder="请输入产品说明"></el-input>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">

+ 1 - 1
src/views/product/components/view/productTable.vue

@@ -83,7 +83,7 @@ export default {
           {
             value:'name',
             type:'String',
-            name:'类别名称'
+            name:'产品名称'
           },
           {
             value:'marketTime',

+ 3 - 2
src/views/project/components/PatentKeywordsHighlight.vue

@@ -5,7 +5,7 @@
         <el-switch v-model="form.ifEnable" active-color="#13ce66" @change="onChange2"></el-switch>
         <div>
           <el-button type="primary" size="small" @click="handleAdd" :loading="btnLoading">新增</el-button>
-          <el-button type="success" size="small" @click="handleSave">保存</el-button>
+          <el-button v-if="projectType && projectType == 3" type="success" size="small" @click="handleSave">保存</el-button>
         </div>
       </el-header>
       <el-main class="patent-keywords-highlight-main">
@@ -49,7 +49,8 @@
 
 <script>
 export default {
-  props: ['projectId'],
+  // projectType从产品进来传3,控制高亮的保存是否显示
+  props: ['projectId','projectType'],
   data() {
     return {
       dataList: [],

+ 5 - 2
src/views/project/patentDetails/components/menu.vue

@@ -6,7 +6,7 @@
           <el-header
             style="width: 100%;display: flex;justify-content: space-evenly; align-items: center; height: 50px;line-height: 50px;">
             <el-popover ref="heightPopover" placement="bottom" title="高亮" width="320" trigger="click">
-              <patent-keywords-highlight :project-id="projectId" />
+              <patent-keywords-highlight :project-id="projectId" :projectType="projectType"/>
             </el-popover>
             <el-tooltip content="返回" placement="top">
               <el-button size="small" @click="other('goBack')"><i class="iconfont icon-fanhui"></i></el-button>
@@ -73,7 +73,7 @@
             </div>
         <el-tooltip content="设定高亮关键词" placement="right-end">
           <el-popover placement="right" title="关键词高亮" width="320" trigger="click" style="margin-top:20px">
-            <patent-keywords-highlight :project-id="projectId" />
+            <patent-keywords-highlight :project-id="projectId" :projectType="projectType"/>
             <div class="articles-Loop" slot="reference" style="">
               <i class="iconfont icon-wodegaoliang"></i>
             </div>
@@ -165,6 +165,9 @@ export default {
     },
     fromPath:{
       default:''
+    },
+    projectType: {//判断是不是从专题库进入专利详情1为专题库(专题库已传1)2为报告(报告未传2)3为产品(产品已传3)
+      default:null
     }
   },
   data() {

+ 1 - 1
src/views/project/patentDetails/components/patentDetails.vue

@@ -189,7 +189,7 @@ export default {
     },
     projectType: {
       type: String,
-      default: '2'//判断是不是从专题库进入专利详情1为专题库(专题库已传1)2为报告(报告未传2)
+      default: '2'//判断是不是从专题库进入专利详情1为专题库(专题库已传1)2为报告(报告未传2)3为产品(产品已传3)
     },
     value: {
       default: false

+ 87 - 23
src/views/project/patentDetails/components/patentMessage/pageProduct.vue

@@ -76,7 +76,7 @@
     </el-dialog>
 
     <marketing ref="marketing"></marketing>
-    <addEditProduct ref="addEditProduct" @getMessage="getList"></addEditProduct>
+    <addEditProduct ref="addEditProduct" @getMessage="ifIsChoose"></addEditProduct>
     <myImageViewer v-if="showImg" :on-close="closeViewer" :src="imgSrc"></myImageViewer>
   </div>
 </template>
@@ -111,7 +111,7 @@ export default {
         {
           value: 'name',
           type: 'String',
-          name: '类别名称'
+          name: '产品名称'
         },
         {
           value: 'marketTime',
@@ -168,16 +168,19 @@ export default {
   },
   watch: {
     patentNo() {
-      this.getList()
+      // this.getList()
+      this.ifIsChoose()
     }
   },
   computed: {},
   created() { },
-  mounted() {
-    this.getList()
+  async mounted() {
+    // this.getList()
+    await this.getColumn()
+    this.ifIsChoose()
   },
   methods: {
-    ifChoose() {
+    ifIsChoose() {
       if (this.isChoose) {
         this.getList()
       } else {
@@ -191,7 +194,7 @@ export default {
     chooseList(val) {
       let params = {
         productIds: val,
-        patentNos:this.patentNo
+        patentNos: this.patentNo
       }
       this.$api.addProductPatent(params).then(res => {
         if (res.code == 200) {
@@ -199,17 +202,29 @@ export default {
           this.closeProduct()
         }
       })
-      
+
     },
+    // 根据专利号获取添加的产品
     getPatentProduct() {
-      let params = {
-        patentNo: this.patentNo,
-        
+      var params = {
+        patentNo: this.patentNo[0],
+        queryRequest: {
+          ...this.queryParams,
+          searchQuery: this.$commonJS.objectToString(this.searchOption),
+          orderDTOList: this.sort,
+        },
+
       }
-      this.$api.query(params).then(res => {
-        if (res.code == 200) {
-          
+      this.$api.selectProductByPatentNo(params).then(response => {
+        if (response.code == 200) {
+          this.tableData = response.data.data
+          this.total = response.data.total
+          this.loading = false
         }
+      }).catch(error => {
+        this.tableData = []
+        this.total = 0
+        this.loading = false
       })
     },
     //打开选择产品或产品类别弹窗
@@ -218,9 +233,35 @@ export default {
     },
     //关闭弹窗
     closeProduct() {
-      this.checkList=[]
+      this.checkList = []
       this.productVisible = false
     },
+    //获取检索字段以及分组字段
+    async getColumn() {
+      let params = ['productCategory']
+      await this.$api.getParamsCommon(params).then(res => {
+        if (res.code == 200) {
+          // 显示栏位
+          this.columnList = res.data[0].conditionDTOList.filter(item => {
+            return item.name != 'Id' && item.ifShow == true
+          })
+          // 分组字段
+          let conditionDTOList = JSON.parse(JSON.stringify(res.data[0].conditionDTOList))
+          // 搜索字段
+          this.searchFiled = this.$commonJS.getField(conditionDTOList, (u) => u.ifSearch == true, {
+            label: 'name',
+            value: 'value',
+            type: 'type',
+          }).filter(item => {
+            return item.value.indexOf('_id') == -1
+          })
+        }
+      })
+      this.showView = false
+      this.$nextTick(() => {
+        this.showView = true
+      })
+    },
     //获取检索条件检索
     search(val) {
       let params = {}
@@ -237,17 +278,18 @@ export default {
       }
       this.searchOption = this.$commonJS.ArrayToArray(val)
       this.queryParams.current = 1
-      this.getList()
+      // this.getList()
+      this.ifIsChoose()
     },
     // 获取所有产品
     getList() {
-      var str = this.$commonJS.objectToString(this.searchOption)
-      if (!this.isChoose) {
-        str = str + `patentNo=${this.patentNo}`
-      }
+      // var str = this.$commonJS.objectToString(this.searchOption)
+      // if (!this.isChoose) {
+      //   str = str + `patentNo=${this.patentNo}`
+      // }
       var params = {
         ...this.queryParams,
-        searchQuery: str,
+        searchQuery: this.$commonJS.objectToString(this.searchOption),
         orderDTOList: this.sort,
       }
       this.loading = true
@@ -266,7 +308,8 @@ export default {
     // 分页信息
     handleCurrentChange(val) {
       this.queryParams.current = val
-      this.getList()
+      // this.getList()
+      this.ifIsChoose()
     },
     // 编辑产品相关的下拉菜单
     async handleCommand(option, row) {
@@ -304,6 +347,26 @@ export default {
           break;
       }
     },
+    deletes(row) {
+      this.$confirm('此操作将永久删除选中的专利, 不可恢复, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let params = {
+          productIds: [row.id],
+          patentNos: this.patentNo,
+        }
+        this.$api.delProductPatent(params).then(res => {
+          if (res.code == 200) {
+            this.$message.success('删除成功')
+            this.ifIsChoose()
+          }
+        })
+      }).catch(() => {
+        this.$message.info('已取消删除操作')
+      });
+    },
     // 排序方法
     sortChange({ column, prop, order }) {
       //如需要多个字段排序,则不需要清空
@@ -314,7 +377,8 @@ export default {
         order,
       }
       this.sort = this.$commonJS.getSortData(params)
-      this.getList()
+      // this.getList()
+      this.ifIsChoose()
     },
   },
 };