Bläddra i källkod

Merge branch 'patentStatus' into product

zhuliu 2 veckor sedan
förälder
incheckning
7e7c390252

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

@@ -100,4 +100,63 @@ export default {
         return axios.post("/xiaoshi/patentProject/setProjectQuartz", data);
     },
 
+
+    /**
+     * 查询专利数据库相关人员
+     * @param {*} data 
+     * @returns 
+     */
+    queryRelatedPerson(data){
+        return axios.post("/xiaoshi/patentShare/queryRelatedPerson", data);
+    },
+
+    /**
+     * 添加/编辑专利状态更新周期
+     * @param {*} data 
+     * @returns 
+     */
+    updateNotifyCycle(data){
+        return axios.post("/xiaoshi/patentStatusMonitor/updateNotifyCycle", data);
+    },
+    /**
+     * 查询专题库专利状态监控周期
+     * @param {*} data 
+     * @returns 
+     */
+    queryNotifyCycle(data){
+        return axios.post("/xiaoshi/patentStatusMonitor/queryNotifyCycle", data);
+    },
+    /**
+     * 添加专利状态监控任务
+     * @param {*} data 
+     * @returns 
+     */
+    addPatentStatusMonitor(data){
+        return axios.post("/xiaoshi/patentStatusMonitor/add", data);
+    },
+    /**
+     * 查询专利状态监控任务
+     * @param {*} data 
+     * @returns 
+     */
+    queryPatentStatusMonitor(data){
+        return axios.post("/xiaoshi/patentStatusMonitor/query", data);
+    },
+    /**
+     * 删除专利状态监控任务
+     * @param {*} data 
+     * @returns 
+     */
+    deletePatentStatusMonitor(data){
+        return axios.post("/xiaoshi/patentStatusMonitor/delete", data);
+    },
+    /**
+     * 更新专利状态监控任务
+     * @param {*} data 
+     * @returns 
+     */
+    updatePatentStatusMonitor(data){
+        return axios.post("/xiaoshi/patentStatusMonitor/update", data);
+    },
+
 };

+ 2 - 1
src/assets/css/main.scss

@@ -48,7 +48,8 @@
     .el-dialog__body{
       padding-top: 15px;
       max-height: calc(100vh - 220px) !important;
-      overflow: auto;
+      overflow-y: auto;
+      overflow-x: hidden;
     }
   }
 }

+ 9 - 0
src/router/index.js

@@ -81,6 +81,15 @@ const routes = [
             component: () => import('@/views/project/components/updateCriteria/index.vue'),
           },
           {
+            path:'/patentStatusMonitor',
+            meta:{
+              title: '更新条件',
+              sign: 'patentStatusMonitor',
+              belong: 'project',
+            },
+            component: () => import('@/views/project/components/patentStatusMonitor/index.vue'),
+          },
+          {
             path: 'patentCollection',
             meta: {
               title: '专利列表',

+ 9 - 0
src/utils/common.js

@@ -563,6 +563,7 @@ treeToArray(data,prop={children:children}){
       this.sort = [
         {
           "orderBy": "createTime",
+          "orderByName":'创建时间',
           "orderType": 1
         }
       ]
@@ -576,10 +577,18 @@ treeToArray(data,prop={children:children}){
       })
       if (params) {
         params[sortProp1.orderType] = orderType[order]
+        if(!params.orderByName){
+          if(column){
+            params.orderByName = column.label || ''
+          }
+        }
       } else {
         params = {}
         params[sortProp1.orderBy] = prop
         params[sortProp1.orderType] = orderType[order]
+        if(column){
+          params.orderByName = column.label || ''
+        }
         sortData.push(params)
       }
     }

+ 91 - 0
src/views/project/components/patentStatusMonitor/components/dialog/emailNotifyCycle.vue

@@ -0,0 +1,91 @@
+<template>
+  <div>
+    <el-dialog title="邮件通知周期" :visible.sync="showDialog" width="500px" :close-on-click-modal="false" @close="handleClose" append-to-body>
+        <el-form :model="form" ref="form" label-width="120px" class="demo-ruleForm">
+            <el-form-item label="是否定期通知" prop="ifUpdate">
+                <el-switch
+                    v-model="form.ifUpdate"
+                    active-text="是"
+                    inactive-text="否">
+                </el-switch>
+            </el-form-item>
+            <el-form-item label="通知周期" v-if="form.ifUpdate" prop="notifyCycle">
+                <el-select
+                  v-model="form.notifyCycle"
+                  clearable
+                  placeholder="请选择通知周期"
+                  style="margin-right: 20px"
+                >
+                  <el-option
+                    v-for="item in updateCycles"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+        </el-form>
+        <span slot="footer" class="dialog-footer">
+            <el-button @click="handleClose">取 消</el-button>
+            <el-button type="primary" :loading="btnLoading" @click="submit">确 定</el-button>
+        </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {},
+  data() {
+    return {
+        showDialog:false,
+        btnLoading:false,
+        form:{},
+    };
+  },
+  watch: {},
+  computed: {
+    updateCycles(){
+        let updateCycle = this.$constants.updateCycle
+        return updateCycle
+    },
+  },
+  created() {},
+  mounted() {},
+  methods: {
+    open(form={}){
+        this.form = {
+            ...form
+        }
+        this.showDialog = true
+    },
+    handleClose(){
+        this.btnLoading = false
+        this.showDialog = false
+    },
+    submit(){
+        this.btnLoading = true
+        var form = {
+            ...this.form
+        }
+        if(!form.ifUpdate){
+            form.notifyCycle = ''
+        }
+        this.$api.updateNotifyCycle(form).then(response=>{
+            if(response.code == 200){
+                this.$message.success('更新成功')
+                this.$emit('update',response.data)
+                this.handleClose()
+            }
+        }).catch(error=>{
+            this.$message.error('更新失败')
+            this.btnLoading = false
+        })
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 33 - 0
src/views/project/components/patentStatusMonitor/index.vue

@@ -0,0 +1,33 @@
+<template>
+  <div class="height_100">
+    <patentStatusMonitor :projectId="projectId" :projectName="projectName"></patentStatusMonitor>
+  </div>
+</template>
+
+<script>
+import patentStatusMonitor from './patentStatusMonitor.vue';
+export default {
+  components: {
+    patentStatusMonitor
+  },
+  props: {},
+  data() {
+    return {
+    };
+  },
+  watch: {},
+  computed: {
+    projectId(){
+        return this.$route.query.projectId
+    },
+    projectName(){
+        return this.$route.query.projectName
+    }
+  },
+  created() {},
+  mounted() {},
+  methods: {},
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 324 - 0
src/views/project/components/patentStatusMonitor/patentStatusMonitor.vue

@@ -0,0 +1,324 @@
+<template>
+  <div class="height_100">
+    <el-container>
+        <el-header>
+            <div style="width:100%; padding:20px;display:flex;align-items: center;justify-content: space-between;">
+                <div>
+                    <span v-if="!update.ifUpdate">是否定期通知:{{ update.ifUpdate?'是':'否' }}</span>
+                    <span v-else>通知周期:<span>{{ getUpdateCycleName(update.notifyCycle) }}</span></span>
+                    <span style="margin-left:10px"><i class="iconfont icon-bianji" @click="editUpdate"></i></span>
+                </div>
+                <div style="">
+                    <el-button type="primary" size="small" @click="add">添加</el-button>
+                </div>
+            </div>
+        </el-header>
+        <el-main v-DivHeight="getDivHeight">
+            <el-table
+                ref="table"
+                :data="tableData"
+                row-key="id"
+                style="width: 100%"
+                :maxHeight="tableHeight - 40"
+                v-loading="loading"
+                @selection-change="handleSelectionChange"
+            >
+                <el-table-column type="selection" width="55" :reserve-selection="true">
+
+                </el-table-column>
+                <el-table-column prop="searchCondition" label="检索条件">
+                    <template slot-scope="scope">
+                        <div>
+                            <div v-if="scope.row.parameters">{{ scope.row.parameters }}</div>
+                            <div v-if="scope.row.patentNos && scope.row.patentNos.length">
+                                <!-- <div v-if="scope.row.stringRequest && scope.row.stringRequest.orderDTOList && scope.row.stringRequest.orderDTOList.length">
+                                    <div v-if="(scope.row.stringRequest.orderDTOList[0].orderType == 1 || scope.row.stringRequest.orderDTOList[0].orderType == 0) && scope.row.stringRequest.orderDTOList[0].orderByName">
+                                        您根据{{ scope.row.stringRequest.orderDTOList[0].orderByName }}进行{{ scope.row.stringRequest.orderDTOList[0].orderType ==1?'降序':'升序' }}排序
+                                    </div>
+                                </div>
+                                <div v-if="scope.row.endNumber>=scope.row.startNumber">
+                                    您选择了第{{ scope.row.startNumber }}到第{{ scope.row.endNumber }}件专利,并取消了
+                                </div> -->
+                                
+                                <el-popover
+                                    placement="bottom"
+                                    title="专利清单"
+                                    width="200"
+                                    trigger="click"
+                                    >
+                                    <div style="max-height:300px;overflow-y:auto">
+                                        <div v-for="(item,index) in scope.row.patentNos" :key="index" style="padding:5px 8px">
+                                            {{ index+1 }}、{{ item }}
+                                        </div>
+                                    </div>
+                                    <el-link type="primary" slot="reference">点击查看选择的专利</el-link>
+                                </el-popover>
+                            </div>
+                        </div>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="monitorType" label="监控方式" width="120">
+                    <template slot-scope="scope">
+                        <div>
+                            <span v-if="scope.row.patentNos && scope.row.patentNos.length">号码监控</span>
+                            <span v-else>检索条件监控</span>
+                        </div>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="targetSSs" label="目标法律状态" width="140">
+                    <template slot-scope="scope">
+                        <div v-html="getTargetSssName(scope.row.targetSSs)"></div>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="notifyPeople" label="邮件通知人员" width="250">
+                    <template slot-scope="scope">
+                        <div>
+                            <span v-for="(item,index) in scope.row.notifyPeople" :key="index">
+                                {{ item.name + '<' + item.email + '>'}}
+                                <span v-if="index<scope.row.notifyPeople.length-1">;</span>
+                            </span>
+                        </div>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="createName" label="创建人" width="120">
+                    <template slot-scope="scope">
+                    <div>
+                        {{ scope.row.createName }}
+                    </div>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="createTime" label="创建时间" width="120">
+                    <template slot-scope="scope">
+                    <div>
+                        {{ scope.row.createTime }}
+                    </div>
+                    </template>
+                </el-table-column>
+                <el-table-column label="操作" width="140">
+                    <template slot-scope="scope">
+                        <div class="icon">
+                            <span @click="editSearch(scope.row)" class="margin-left_10">
+                            <el-tooltip class="item" effect="dark" content="编辑" placement="top">
+                                <i class="iconfont icon-bianji"></i>
+                            </el-tooltip>
+                            </span>
+                            <span @click="delSearch(scope.row)" class="margin-left_10">
+                                <el-tooltip class="item" effect="dark" content="删除" placement="top">
+                                    <i class="iconfont icon-shanchu"></i>
+                                </el-tooltip>
+                            </span>
+                        </div>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </el-main>
+        <el-footer class="pagination" style="display:flex;justify-content:space-between;align-items:center">
+          <div style="display:flex;align-items:center">
+            <span v-if="multipleSelection.length > 0">
+              已勾选 <b>{{ multipleSelection.length }}</b> 条
+            </span>
+            <div v-show="multipleSelection.length" class="margin-left_10">
+              <el-button type="primary" size="small" @click="del">删除</el-button>
+            </div>
+          </div>
+          <div>
+            <el-pagination background layout="total, sizes, prev, pager, next, jumper"
+              :current-page.sync="queryParams.current" :page-size.sync="queryParams.size"
+              @current-change="handleCurrentChange" @size-change="changeSize" :total="total">
+            </el-pagination>
+          </div>
+
+        </el-footer>
+    </el-container>
+
+    <emailNotifyCycleDialog ref="emailNotifyCycleDialog" @update="getUpdateCycle"></emailNotifyCycleDialog>
+    <addPatentStatusMonitorDialog ref="addPatentStatusMonitorDialog" :projectId="projectId" @success="queryPatentStatusMonitor"></addPatentStatusMonitorDialog>
+  </div>
+</template>
+
+<script>
+import { getTableHeight } from '@/views/components/mixins'
+import emailNotifyCycleDialog from './components/dialog/emailNotifyCycle.vue';
+import addPatentStatusMonitorDialog from '../../patentCollection/components/dialog/addPatentStatusMonitor.vue';
+export default {
+  components: {
+    emailNotifyCycleDialog,
+    addPatentStatusMonitorDialog
+  },
+  props: {
+    projectId:{},
+    projectName:{}
+  },
+  mixins:[getTableHeight],
+  data() {
+    return {
+        update:{
+            ifUpdate:false
+        },
+        tableData:[],
+        multipleSelection:[],
+        loading:false,
+        queryParams:{
+            current:1,
+            size:10,
+            projectId:this.projectId
+        },
+        total:0,
+    };
+  },
+  watch: {},
+  computed: {
+    updateCycles(){
+        let updateCycle = this.$constants.updateCycle
+        return updateCycle
+    },
+    patentMonitorStatus(){
+        let patentMonitorStatus = this.$store.state.dictMessage.dictMessage.PATENT_MONITOR_STATUS || []
+        return patentMonitorStatus
+    }
+  },
+  created() {},
+  mounted() {
+    this.getUpdateCycle()
+    this.queryPatentStatusMonitor()
+  },
+  methods: {
+    getTargetSssName(targetSSs){
+        if(!targetSSs || targetSSs.length == 0){
+            return ''
+        }
+        let targetSssNames = []
+        for(let i = 0;i<targetSSs.length;i++){
+            let item = targetSSs[i]
+            let obj = this.patentMonitorStatus.find(item1=>{
+                return item == item1.value
+            })
+            if(obj){
+                targetSssNames.push(obj.label)
+            }
+        }
+        return targetSssNames.join('、')
+    },
+    add(){
+        this.$router.push(
+            {
+                path: '/project/patentCollection',
+                query: {
+                    id: this.projectId,
+                    projectName:this.projectName,
+                    projectType:1
+                }
+            }
+        )
+    },
+    getUpdateCycle(){
+        var params = {
+            projectId:this.projectId
+        }
+        this.$api.queryNotifyCycle(params).then(res=>{
+            if(res.code == 200){
+                this.update = res.data
+                if(res.data.notifyCycle){
+                    this.update.ifUpdate = true
+                }else{
+                    this.update.ifUpdate = false
+                }
+            }
+        })
+    },
+    getUpdateCycleName(updateCycle){
+        var arr = this.updateCycles
+        var obj = arr.find(item=>{
+            return item.value == updateCycle
+        })
+        if(obj){
+            return obj.label
+        }
+        return ''
+    },
+    queryPatentStatusMonitor(){
+        this.loading = true
+        this.$api.queryPatentStatusMonitor(this.queryParams).then(response=>{
+            if(response.code == 200){
+                this.tableData = response.data.data
+                this.total = response.data.total
+                this.loading = false
+            }
+        }).catch(error=>{
+            this.tableData = []
+            this.loading = false
+        })
+    },
+    handleSelectionChange(val){
+        this.multipleSelection = val
+    },
+    handleCurrentChange(val){
+        this.queryParams.current = val
+        this.queryPatentStatusMonitor()
+    },
+    //切换页大小
+    changeSize(val){
+      this.queryParams.size = val
+      this.queryParams.current = 1
+      this.queryPatentStatusMonitor()
+    },
+    del(){
+        var ids = this.multipleSelection.map(item=>{
+            return item.id
+        })
+        this.removeSearchRecords(ids,1)
+    },
+    delSearch(row){
+        this.removeSearchRecords([row.id])
+    },
+    editSearch(row){
+        var params = {
+            targetSSs:row.targetSSs || [],
+            status:row.status,
+            notifyPeople:row.notifyPeople || [],
+            id:row.id
+        }
+        this.$refs.addPatentStatusMonitorDialog.open(JSON.parse(JSON.stringify(params)))
+    },
+    removeSearchRecords(ids,type){
+        this.$confirm('确认删除本条数据吗?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+        }).then(() => {
+            this.$api.deletePatentStatusMonitor({ids:ids}).then(response=>{
+                if(response.code == 200){
+                    this.$message.success('删除成功')
+                    this.queryPatentStatusMonitor()
+                    if(type){
+                        this.multipleSelection = []
+                        this.$refs.table.clearSelection();
+                    }else{
+                        var id = response.data.data[0]
+                        var index = this.multipleSelection.findIndex(item=>{
+                            return item.id == id
+                        })
+                        if(index!=-1){
+                            this.multipleSelection.splice(index,1)
+                        }
+                    }
+                    
+                }
+            }).catch(error=>{
+                // this.$message.error('删除失败')
+            })
+        })
+    },
+    editUpdate(){
+        var form = {
+            ...this.update,
+            projectId:this.projectId
+        }
+        this.$refs.emailNotifyCycleDialog.open(form)
+    },
+    
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 1 - 0
src/views/project/components/view/card.vue

@@ -25,6 +25,7 @@
                     </el-dropdown-item>
                     <el-dropdown-item command="12">自定义栏位管理</el-dropdown-item>
                     <el-dropdown-item command="15">定期更新条件</el-dropdown-item>
+                    <el-dropdown-item command="16">法律状态监控</el-dropdown-item>
                   <el-dropdown-item command="11">任务分配</el-dropdown-item>
                   <el-dropdown-item command="14">导入导出历史</el-dropdown-item>
                     <el-dropdown-item command="3">任务清单</el-dropdown-item>

+ 1 - 0
src/views/project/components/view/table.vue

@@ -45,6 +45,7 @@
                 </el-dropdown-item>
                 <el-dropdown-item command="12">自定义栏位管理</el-dropdown-item>
                 <el-dropdown-item command="15">定期更新条件</el-dropdown-item>
+                <el-dropdown-item command="16">法律状态监控</el-dropdown-item>
                 <el-dropdown-item command="11">任务分配</el-dropdown-item>
                 <el-dropdown-item command="14">导入导出历史</el-dropdown-item>
                 <el-dropdown-item command="3">任务清单</el-dropdown-item>

+ 13 - 0
src/views/project/index.vue

@@ -476,11 +476,24 @@ export default {
         case '15'://定期更新条件
           this.updateCriteria(row)
           break
+        case '16'://法律状态监控
+          this.patentStatusMonitor(row)
+          break
         case 'e'://编辑
           this.handleEdit(row)
           break
       }
     },
+    //法律状态监控
+    patentStatusMonitor(row){
+      this.$router.push({
+        path: "/patentStatusMonitor",
+        query:{
+          projectId:row.id,
+          projectName:row.name
+        }
+      });
+    },
     //定期更新条件
     updateCriteria(row){
       this.$router.push({

+ 311 - 0
src/views/project/patentCollection/components/dialog/addPatentStatusMonitor.vue

@@ -0,0 +1,311 @@
+<template>
+  <div>
+    <el-dialog custom-class="" :title="`${form.id?'更新':'添加'}法律状态监控`" :visible.sync="visible" width="800px" 
+    :before-close="handleClose" :modal="true" :close-on-click-modal="false" :modal-append-to-body="false">
+        <el-form :model="form" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
+            <el-form-item label="目标法律状态" prop="targetSSs">
+                <div>
+                    <el-checkbox-group class="currentCheckbox" v-model="form.targetSSs">
+                        <el-checkbox v-for="item in patentMonitorStatus" :key="item.id" :label="Number(item.value)">{{ item.label }}</el-checkbox>
+                    </el-checkbox-group>
+                </div>
+            </el-form-item>
+            <el-form-item label="邮件通知人员" prop="people">
+                <el-select v-model="form.people" placeholder="请选择邮件通知人员" style="width: 100%;" filterable remote multiple @remove-tag="removePerson">
+                    <el-option v-for="item in relatedPerson" :key="item.id" :label="item.name + '<' + item.email + '>'" @click.native.stop="choosePerson(item)"
+                        :value="item.id">
+                        <span style="float: left">{{ item.name }}</span>
+                        <span style="float: left">
+                        {{'<' + item.email + '>' }}
+                        </span>
+                    </el-option>
+                </el-select>
+                <p style="position: absolute; right: 10px;top: -11px;width:20px">
+                    <i class="el-icon-circle-plus-outline" style="font-size:20px" @click="create(1)"></i>
+                </p>
+            </el-form-item>
+        </el-form>
+        <span slot="footer" class="dialog-footer">
+            <el-button @click="handleClose">取 消</el-button>
+            <el-button type="primary" :loading="loading" @click="submit">确 定</el-button>
+        </span>
+    </el-dialog>
+    <el-dialog title="创建人员" :visible.sync="visiblePerson" :close-on-click-modal="false" width="500px" append-to-body>
+      <el-form :model="createdPerson" :rules="createdPersonRules" ref="createdPerson">
+        <el-form-item label="姓名 :" prop="name">
+          <el-input v-model="createdPerson.name" placeholder="请输入姓名" />
+        </el-form-item>
+        <el-form-item label="邮箱 :" prop="email">
+          <el-input v-model="createdPerson.email" placeholder=" 请输入邮箱" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="closeCreated">取 消</el-button>
+        <el-button type="primary" @click="submitCreated">确定</el-button>
+      </div>
+    </el-dialog>
+    <emailNotifyCycleDialog ref="emailNotifyCycleDialog" @update="getUpdateCycle"></emailNotifyCycleDialog>
+  </div>
+</template>
+
+<script>
+import emailNotifyCycleDialog from '@/views/project/components/patentStatusMonitor/components/dialog/emailNotifyCycle.vue';
+export default {
+  components: {
+    emailNotifyCycleDialog
+  },
+  props: {
+    projectId:{}
+  },
+  data() {
+    const isEmail = (rule, value, callback) => {
+      const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
+      if (!this.createdPersonRules.email) {
+        return callback(new Error("邮箱不能为空"));
+      }
+      setTimeout(() => {
+        if (mailReg.test(value)) {
+          callback();
+        } else {
+          callback(new Error("请输入正确的邮箱格式"));
+        }
+      }, 100);
+    };
+    return {
+        visible:false,
+        loading:false,
+        form:{},
+        rules:{
+            targetSSs: [
+                { required: true, message: '请至少选择一个目标法律状态', trigger: 'change' }
+            ],
+        },
+        relatedPerson:[],
+        // 创建外来人员的信息
+        createdPerson: {},
+        // 控制创建人员弹窗
+        visiblePerson: false,
+        // 创建人员弹窗的校验
+        createdPersonRules: {
+            name: [{ required: true, message: "请输入姓名", trigger: "blur" },],
+            email: [{ required: true, validator: isEmail, trigger: "change" },],
+        },
+        notify:null
+    };
+  },
+  watch: {
+    projectId(){
+        this.queryRelatedPerson()
+        if(this.visible){
+            this.getUpdateCycle()
+        }else{
+          this.notify = null  
+        }
+        
+    },
+  },
+  computed: {
+    patentMonitorStatus(){
+        let patentMonitorStatus = this.$store.state.dictMessage.dictMessage.PATENT_MONITOR_STATUS || []
+        return patentMonitorStatus
+    }
+  },
+  created() {},
+  mounted() {},
+  methods: {
+    open(form){
+        this.form = {
+            targetSSs:[],
+            people:[],
+            notifyPeople:[],
+            ...form,
+        }
+        if(this.form.notifyPeople && this.form.notifyPeople.length){
+            this.form.notifyPeople.forEach(item=>{
+                if(item.id){
+                    this.form.people.push(item.id)
+                }else{
+                    let name = item.name + '<' + item.email + '>'
+                    this.form.people.push(name)
+                }
+            })
+        }
+        if(this.relatedPerson.length == 0){
+            this.queryRelatedPerson()
+        }
+        if(!this.notify){
+            this.getUpdateCycle()
+        }else{
+            if(!this.notify.notifyCycle){
+                this.openEmailNotifyCycleDialog()
+            }
+        }
+        this.visible = true
+    },
+    getUpdateCycle(){
+        if(!this.projectId){
+            return
+        }
+        var params = {
+            projectId:this.projectId
+        }
+        this.$api.queryNotifyCycle(params).then(res=>{
+            if(res.code == 200){
+                this.notify = res.data
+                if(res.data.notifyCycle){
+                    this.notify.ifUpdate = true
+                }else{
+                    this.notify.ifUpdate = false
+                    //打开添加周期的弹窗
+                    this.openEmailNotifyCycleDialog()
+                }
+            }
+        })
+    },
+    openEmailNotifyCycleDialog(){
+        var form = {
+            ...this.notify,
+            projectId:this.projectId
+        }
+        this.$refs.emailNotifyCycleDialog.open(form)
+    },
+    queryRelatedPerson(){
+        if(!this.projectId){
+            return
+        }
+        var params = {
+            projectId:this.projectId
+        }
+        this.relatedPerson = []
+        this.$api.queryRelatedPerson(params).then(response=>{
+            if(response.code == 200){
+                this.relatedPerson= response.data
+            }
+        }).catch(error=>{
+            // this.relatedPerson.push(
+            //     {
+            //         id:1,
+            //         name:"管理员",
+            //         email:"24435@qq.com"
+            //     }
+            // )
+            // this.relatedPerson.push(
+            //     {
+            //         id:2,
+            //         name:"管理员2",
+            //         email:"244352e@qq.com"
+            //     }
+            // )
+        })
+    },
+
+    handleClose(){
+        this.visible = false
+    },
+    submit(){
+        this.$refs.ruleForm.validate((valid,errorFields) => {
+            if (valid) {
+                this.loading = true
+                if(this.projectId){
+                    this.form.projectId = this.projectId
+                }
+                if(this.form.id){
+                    this.$api.updatePatentStatusMonitor(this.form).then(response=>{
+                        if(response.code == 200){
+                            this.loading = false
+                            this.$message.success('法律状态监控更新成功')
+                            this.handleClose()
+                            this.$emit('success')
+                        }   
+                    }).catch(()=>{
+                        this.loading = false
+                    }) 
+                }else{
+                   this.$api.addPatentStatusMonitor(this.form).then(response=>{
+                        if(response.code == 200){
+                            this.loading = false
+                            this.$message.success('法律状态监控添加成功')
+                            this.handleClose()
+                            this.$emit('success')
+                        }   
+                    }).catch(()=>{
+                        this.loading = false
+                    }) 
+                }
+                
+            } else {
+                const firstErrorField = Object.keys(errorFields)[0];
+                const firstErrorMessage = errorFields[firstErrorField][0].message;
+                this.$message.error(`${firstErrorMessage}`);
+                return false;
+            }
+        });
+    },
+    // 创建人员弹窗的关闭
+    closeCreated() {
+      this.$refs.createdPerson.resetFields()
+      this.createdPerson = {}
+      this.visiblePerson = false
+    },
+    // 创建人员弹窗的确定
+    submitCreated() {
+        this.$refs.createdPerson.validate((valid) => {
+            if (valid) {
+                let obj = this.relatedPerson.find(item=>{
+                    return item.name == this.createdPerson.name && item.email == this.createdPerson.email
+                })
+                if(obj){
+                    let id = obj.id
+                    let index = this.form.notifyPeople.findIndex(item=>{
+                        return item.id == id
+                    })
+                    if(index == -1){
+                        this.form.people.push(obj.id)
+                        this.form.notifyPeople.push(obj)
+                    }
+                    this.closeCreated()
+                    return
+                }
+                let index = this.form.notifyPeople.findIndex(item=>{
+                    return item.name == this.createdPerson.name && item.email == this.createdPerson.email
+                })
+                if(index == -1){
+                    let name = this.createdPerson.name + '<' + this.createdPerson.email + '>'
+                    this.form.people.push(name)
+                    this.form.notifyPeople.push(
+                        {
+                            ...this.createdPerson
+                        }
+                    )
+                }
+                this.closeCreated()
+            }
+        })
+    },
+    create() {
+      this.visiblePerson = true
+    },
+    removePerson(value){
+        let index = this.form.notifyPeople.findIndex(item=>{
+            return item.id == value
+        })
+        if(index != -1){
+            this.form.notifyPeople.splice(index,1)
+        }
+    },
+    choosePerson(value){
+        let id = value.id
+        let index = this.form.notifyPeople.findIndex(item=>{
+            return item.id == id
+        })
+        if(index != -1){
+            this.form.notifyPeople.splice(index,1)
+        }else{
+            this.form.notifyPeople.push(value)
+        }
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

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

@@ -57,6 +57,7 @@
             <el-dropdown v-else ref="myDropdown" trigger="click" :hide-on-click="false" split-button type="primary" size="small" @command="clickMyDropdown($event)">
               <span @click="handleFieldManage">显示栏位管理</span>
               <el-dropdown-menu slot="dropdown" class="text-align_center">
+                <el-dropdown-item @click.native="patentStatusMonitor">添加到法律状态监控</el-dropdown-item>
                 <el-dropdown-item @click.native="handleFile">报告文档</el-dropdown-item>
                 <!-- <el-dropdown-item @click.native="handleQuestion" v-if="$permission('/workspace/event')">事
                   件</el-dropdown-item> -->
@@ -224,6 +225,8 @@
     <patent-index-setting @submit="submitIndex(false)" :projectId="projectId" ref="patentIndexSetting" />
     <!-- 合并发明人/合并权利人、申请人 -->
     <patentMergeDrawer ref="patentMergeDrawer" :projectId="projectId" @mergeClose="mergeClose"></patentMergeDrawer>
+    <!-- 添加法律状态监控 -->
+    <addPatentStatusMonitorDialog ref="addPatentStatusMonitorDialog" :projectId="projectId" @success="toPatentStatusMonitor"></addPatentStatusMonitorDialog>
   </div>
 </template>
 
@@ -244,6 +247,7 @@ import PatentBatchIndexVue from './components/dialog/PatentBatchIndex.vue'
 import patentMergeDrawer from './components/drawer/merge.vue'
 import PatentIndexSetting from "./components/dialog/PatentIndexSetting"
 import PatentKeywordsHighlight from '../components/PatentKeywordsHighlight.vue'
+import addPatentStatusMonitorDialog from './components/dialog/addPatentStatusMonitor.vue'
 export default {
   mixins: [fastSelectPatent],
   components: {
@@ -259,7 +263,8 @@ export default {
     PatentBatchIndexVue,
     patentMergeDrawer,
     PatentIndexSetting,
-    PatentKeywordsHighlight
+    PatentKeywordsHighlight,
+    addPatentStatusMonitorDialog
   },
   props: {},
   data() {
@@ -660,6 +665,78 @@ export default {
     async handleFieldManage() {
       this.$refs.field.open(this.customList)
     },
+    //添加法律状态监控成功
+    toPatentStatusMonitor(){
+      const h = this.$createElement;
+      this.$msgbox({
+        title: '提示',
+        message: h('p', null, [
+          h('span', null, '添加法律状态监控成功,前往'),
+          h('span', {
+            style: 'color: #ff7d38;cursor: pointer;',
+            on: {
+              click: () => {//
+                let router = this.$router.resolve({
+                  path: '/patentStatusMonitor',
+                  query: {
+                    projectId:this.projectId,
+                    projectName:this.projectName
+                  }
+                })
+                window.open(router.href, '_blank')
+                this.$msgbox.close(false)
+              }
+            }
+          }, '法律状态监控',),
+          h('span', null, '查看')
+        ]),
+        type: 'success',
+        showConfirmButton: false,
+      }).then(action => {
+      });
+    },
+    //添加到法律状态监控
+    patentStatusMonitor(){
+      if(this.selectedTotal>0 && this.selectedTotal>50){
+        this.$message.warning('选择专利最多只能选择50件!')
+        return
+      }
+      let searchStorageText = []
+      if(this.$refs.searchPatent){
+        searchStorageText = this.$refs.searchPatent.searchStorageText
+      }
+      let parameters = ''
+      if(searchStorageText && searchStorageText.length>0){
+        searchStorageText.forEach((item)=>{
+          let value = item.value
+          let values = []
+          for(let i = 0;i<value.length;i++){
+            values.push(value[i].show)
+          }
+          let str = `${item.field.show}=(${values.join(' OR ')})`
+          if(parameters){
+            parameters = parameters + ' AND ' + str
+          }else{
+            parameters = str
+          }
+        })
+      }
+      var params = {
+        stringRequest:{
+          projectId: this.projectId,
+          searchQuery: this.searchStr,
+          customFields: this.customFields,
+          orderDTOList:this.sort,
+          groupField:this.queryParams.groupField
+        },
+        startNumber:this.startNumber, //开始位置
+        endNumber:this.endNumber,//结束位置
+        isAdd:this.queryParams.isAdd, //去除专利号
+        isDelete:this.queryParams.isDelete, //附加专利号
+        parameters:parameters
+      }
+      this.$refs.addPatentStatusMonitorDialog.open(params)
+    },
     //报告文档
     handleFile() {
       this.$refs.reportFileDrawer.open(this.projectId)