1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273 |
- <template>
- <div>
- <el-dialog :title="title" :visible.sync="showDialog" width="1000px" :close-on-click-modal="false"
- @close="handleClose(false)" :append-to-body="true">
- <el-form :model="form" :rules="rules" ref="reportForm" label-width="120px" v-loading="loading"
- :element-loading-text="load_text" element-loading-spinner="el-icon-loading"
- element-loading-background-color="rgba(0, 0, 0, 0.8)">
- <el-row>
- <el-col :span="12">
- <template>
- <div>
- <el-form-item v-if="form.reportType == 3" label="标的产品" prop="signProjectIds">
- <el-autocomplete v-model="form.signProjectIds" value-key="name" v-SelectLazyLoading="productLoad"
- :fetch-suggestions="querySearchProduct" placeholder="请输入标的产品" :trigger-on-focus="false"
- @select="handleSelectProduct" @change="handleChangeProduct"
- style="width: 100%;"></el-autocomplete>
- </el-form-item>
- <el-form-item v-else label="标的专利" prop="signPatentNo">
- <div style="display:flex;align-items:center">
- <el-input v-model="form.signPatentNo" autocomplete="off" placeholder="请输入标的专利" @change="getPatentNo(1)"></el-input>
- <span v-if="patentLoading">
- <i class="el-icon-loading"></i>
- </span>
- </div>
-
- </el-form-item>
- </div>
- </template>
- </el-col>
- <el-col :span="12">
- <el-form-item label="报告名称" prop="name">
- <el-input v-model="form.name" autocomplete="off" placeholder="请输入报告名称"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <template v-if="form.reportType == 7">
- <div>
- <el-row>
- <el-col :span="12">
- <el-form-item label="案件编号" prop="caseNumber">
- <el-input v-model="form.caseNumber" @change="getPatentNo" autocomplete="off" placeholder="请输入案件编号"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="无效宣告请求人" prop="invalidApplication">
- <el-input v-model="form.invalidApplication" autocomplete="off" placeholder="请输入无效宣告请求人"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="发文序号" prop="issueNumber">
- <el-input v-model="form.issueNumber" autocomplete="off" placeholder="请输入发文序号"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="发明创造名称" prop="inventionName">
- <el-input v-model="form.inventionName" autocomplete="off" placeholder="请输入发明创造名称"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </div>
- </template>
- <el-row>
- <el-col :span="12" v-if="form.reportType == 7">
- <el-form-item label="主被动类型" prop="actType">
- <el-select v-model="form.actType" placeholder="请选择" style="width:100%">
- <el-option
- v-for="item in actTypes "
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="是否完成" v-if="!form.id" prop="status">
- <el-switch v-model="form.status" active-color="#13ce66" @change="changeStatus"
- :active-value="3" :inactive-value="2">
- </el-switch>
- </el-form-item>
- </el-col>
- </el-row>
-
- <template v-if="!form.id && form.status == 3">
- <div>
- <el-form-item label="核心结论" prop="cronIds">
- <el-checkbox-group v-model="form.cronIds">
- <el-checkbox v-for="item in conclusion" :key="item.value" :label="item.value">{{
- item.label }}</el-checkbox>
- </el-checkbox-group>
- </el-form-item>
- <el-form-item label="结论论述" prop="cronDescription">
- <el-input v-model="form.cronDescription" type="textarea" placeholder="请输入结论论述"></el-input>
- </el-form-item>
- <el-form-item label="后续跟进事项" prop="followUps">
- <span v-if="form.followUps"><span v-for="item in form.followUps" :key="item.name"
- style="margin-right:10px">{{ item.name }}</span></span>
- <span>
- <el-popover ref="popover" placement="bottom" @hide="hidePopover" trigger="click">
- <div>
- <addMatter :type="matterType" ref="addMatter"></addMatter>
- </div>
- <el-button slot="reference">添加后续事项</el-button>
- </el-popover>
- </span>
- </el-form-item>
- </div>
- </template>
- <el-row>
- <el-col :span="12">
- <el-form-item label="承担部门" prop="departmentId">
- <mySelectTree style="width:100%" v-model="form.departmentId" :options="departmentList"></mySelectTree>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="负责人" prop="headId">
- <el-select style="width:100%" v-model="form.headId" placeholder="请选择负责人" filterable remote
- :popper-append-to-body="false" :remote-method="remoteMethodPerson" v-SelectLazyLoading="lazyLoadingPerson"
- :loading="personnelList.loading">
- <el-option v-for="item in personnelList.data" :key="Number(item.id)" :label="item.name"
- :value="Number(item.id)"></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <template>
- <div>
- <el-form-item label="委托方" prop="entrustId" v-if="userinfo.tenantType == 1">
- <mySelectButton size='large' style="width:100%" @click="handleSelect">
- <div style="width:100%">
- <el-autocomplete style="width:100%" v-model="form.entrustName" ref="client" value-key="name"
- :fetch-suggestions="querySearch" v-SelectLazyLoading="loadClient" @input="input"
- placeholder="请输入内容" :trigger-on-focus="false" @select="handleChange">
- </el-autocomplete>
- </div>
- </mySelectButton>
- </el-form-item>
- <el-form-item label="委托部门" prop="departmentId" v-else>
- <mySelectTree style="width:100%" v-model="form.departmentId" :options="departmentList"></mySelectTree>
- </el-form-item>
- </div>
- </template>
- </el-col>
- <el-col :span="12">
- <el-form-item label="卷号" prop="volumeNumber">
- <el-input v-model="form.volumeNumber" autocomplete="off" placeholder="请输入卷号"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-form-item label="产品/技术" prop="productOrTech">
- <el-input v-model="form.productOrTech" autocomplete="off" placeholder="请输入产品/技术"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="form.track ? 12 : 24">
- <el-form-item label="关联报告" prop="associateReportName">
- <el-input v-model="form.associateReportName" autocomplete="off" placeholder="请输入关联报告"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="需要复制的选项" v-show="form.track" prop="copyIds">
- <el-select v-model="form.copyIds" multiple clearable placeholder="请选择需要复制的选项" :popper-append-to-body="false"
- @change="changeCopyIds">
- <el-option v-for="item in copyList" :key="item.value" :label="item.label" :value="item.value"></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <template >
- <div>
- <el-row>
- <el-col :span="24">
- <el-form-item label="事件:" prop="eventId">
- <mySelectButton size='large' style="width:100%" @click="addEvent">
- <div style="width:100%">
- <el-select style="width:100%" v-model="form.eventId" @change="changeEvent" filterable remote
- :disabled="eventList.disabled" clearable placeholder="请选择" :loading="eventList.loading"
- v-SelectLazyLoading="loadEvent" :remote-method="remoteEvent">
- <el-option v-for="item in eventList.data" :key="item.id" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- </div>
- <span slot="button">
- <i class="el-icon-plus"></i>
- </span>
- </mySelectButton>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="show == true">
- <el-col :span="24">
- <el-form-item label="调查类型:" prop="matterIds" >
- <el-checkbox-group v-model="form.matterIds">
- <template>
- <el-checkbox v-for="item in dictAssociates" :key="item.id" :label="parseInt(item.id)">
- {{ item.name }}
- </el-checkbox>
- </template>
- </el-checkbox-group>
- </el-form-item>
- </el-col>
- </el-row>
- </div>
- </template>
- <template v-if="form.reportType == 7 && !form.id">
- <div>
- <el-form-item label="无效请求书" prop="flowPath">
- <div v-if="form.flowPath">
- <div v-if="form.flowPath.systemFileList && form.flowPath.systemFileList.length>0">
- <div v-for="item in form.flowPath.systemFileList" :key="item.guid">
- {{ item.name }}
- </div>
- </div>
- </div>
- <div v-else>
- <el-button type="text" size="small" @click="addFlowPath">添加无效请求书</el-button>
- </div>
- </el-form-item>
- </div>
- </template>
- <el-form-item :label="(!form.id && form.status == 3) ? '上传报告文档' : '上传附件'" prop="systemFileList">
- <myUpload :file-list="form.systemFileList" @on-change="onchangeFile" @on-remove="onRemove" style="height: 180px;" :autoUpload="true"></myUpload>
- </el-form-item>
- <el-form-item label="备注" prop="description">
- <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>
- </div>
- </el-dialog>
- <!-- 审核弹窗,做公用组件 -->
- <el-dialog title="添加审核任务" :visible.sync="showTask" width="500px" @close="handleCloseTask" :append-to-body="true"
- :close-on-click-modal="false">
- <el-form :model="taskForm" :rules="TaskRules" ref="TaskForm" label-width="120px" v-loading="loading">
- <el-form-item label="任务名称:" prop="name">
- <el-input v-model="taskForm.name" type="text" placeholder="输入任务名称" />
- </el-form-item>
- <el-form-item label="审核人:" prop="handler">
- <el-select style="width:100%;" ref="select1" v-model="taskForm.handler" clearable filterable remote
- :remote-method="remoteMethodPerson" v-SelectLazyLoading="lazyLoadingPerson">
- <el-option v-for="item in personnelList.data" :key="item.id" :label="item.name" :value="item.id"
- placeholder="请选择审核人"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="完成日期:" prop="deadLineTime">
- <el-date-picker style="width:100%" v-model="taskForm.deadLineTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetime"
- placeholder="选择日期">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="审核备注:" prop="description">
- <el-input v-model="taskForm.description" type="textarea" placeholder="输入备注" />
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="handleCloseTask">取 消</el-button>
- <el-button type="primary" @click="submitTask">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 委托方弹窗 -->
- <el-dialog title="选择委托方" :visible.sync="visible" width="800px" :append-to-body="true" :close-on-click-modal="false"
- destroy-on-close :before-close="close2" top="10vh">
- <ClientTable :choseClient="true" @getClient="getClient"></ClientTable>
- </el-dialog>
-
- <!-- 添加无效请求书 -->
- <addFlowPath ref="addFlowPath" @save="getFlowPath"></addFlowPath>
- <addEvent ref="addEvent" @isSuccess="handleSuccess"></addEvent>
- </div>
- </template>
- <script>
- import { mapGetters } from 'vuex'
- import addMatter from '../matter/addMatters.vue'
- import ClientTable from '@/views/client'
- import addFlowPath from '@/views/report/InvalidResponse/components/dialog/editFlowPath.vue'
- import addEvent from '@/views/event/components/dialog/addEvent.vue';
- export default {
- components: {
- addMatter,
- ClientTable,
- addFlowPath,
- addEvent
- },
- props: {},
- data() {
- const isExist = (rule, value, callback) => {
- if (!this.form.signPatentNo && !this.form.signProjectIds) {//没有专利号进入报错提示
- if ([3].includes(Number(this.form.reportType))) {
- var text = '请输入标的产品'
- } else {
- var text = '请输入标的专利号'
- }
- callback(new Error(text))
- } else {
- callback()
- }
- }
- const isTime = (rule, value, callback) => {
- if (this.isEndTime) {
- this.isEndTimes = Date.parse(new Date)
- }
- let b = Date.parse(value)
- if (value) {
- if (b < this.isEndTimes) {
- callback(new Error('禁止选择现在及以前时间,请重新选择'))
- } else {
- callback()
- }
- } else {
- callback(new Error('请选择时间'))
- }
- }
- return {
- //弹窗标题
- title: '',
- //控制弹窗是否打开
- showDialog: false,
- //表单数据
- form: {
- matterIds: [],
- systemFileList: [],
- fileGuids: [],
- },
- //表单规则
- rules: {
- name: [{ required: true, message: '请输入报告名称', trigger: 'blur' },],
- signProjectIds: [{ required: true, validator: isExist, trigger: 'blur' },],//产品
- signPatentNo: [{ required: true, validator: isExist, trigger: 'blur' },],//专利
- headId: [{ required: true, message: '请选择负责人', trigger: 'change' },],
- entrustId: [{ required: true, message: '请选择委托方', trigger: 'change' },],
- },
- patentLoading:false,
- taskId:null,
- //加载
- loading: false,
- //加载时显示的文字
- load_text: '加载中',
- //应用场景
- commonData: {},
- //核心结论
- conclusion: [],
- //部门数据
- departmentList: [],
- //需要复制的选项集合
- copyList: [],
- //上传文件列表
- files: [],
- //核心结论类型字典
- reportAsDicItem: {
- "0": "INVALID_ASSESS",
- "1": "THIRD_ASSESS",
- "2": "STABILITY_ASSESS",
- "3": "FTO_ASSESS",
- "4": "TORT_ASSESS",
- "5": "AVOID_ASSESS",
- "7": "REINVALID_ASSESS",
- },
- //需要复制的内容字典
- reportAsDicItemCopy: {
- "0": "INVALID_COPY",
- "1": "THIRD_COPY",
- "2": "STABILITY_COPY",
- "3": "FTO_COPY",
- "4": "TORT_COPY",
- "5": "AVOID_COPY",
- "7":"INVALID_COPY"
- },
- /**
- * 委托方
- */
- clientList: {
- queryParams: {
- current: 1,
- size: 10
- },
- data: [],
- cb: null
- },
- visible: false,
- //人员列表懒加载
- personnelList: {
- queryParams: {
- current: 1,
- size: 10
- },
- data: []
- },
- //产品列表懒加载
- productList: {
- queryParams: {
- current: 1,
- size: 10
- },
- loading: false,
- name: '',
- data: [],
- },
- matterType: null,
- //事件列表
- eventList: {
- queryParams: {
- current: 1,
- size: 10
- },
- data: []
- },
- // 控制调查类型是否显示
- show: false,
- //调查类型列表
- dictAssociates: [],
- /*审核弹窗所需变量start*/
- showTask: false,
- // 任务表单
- taskForm: {},
- isEndTime: true,
- isEndTimes: null,
- // 任务表单校验
- TaskRules: {
- name: [{ required: true, message: '请输入任务名称', trigger: 'blur' },],
- handler: [{ required: true, message: '请选择审核人', trigger: 'change' },],
- deadLineTime: [{ required: true, validator: isTime, trigger: 'change' }],
- },
- /*审核弹窗所需变量end*/
- actTypes:[
- {
- label:'主动',
- value:1
- },
- {
- label:'被动',
- value:0
- },
- ],
- isExist:true,
- havePatent:{
- show:false,
- checked:false
- },
- };
- },
- watch: {},
- computed: {
- ...mapGetters(['webSocket', 'userinfo']),
- dictMessage() {
- return this.$store.state.dictMessage.dictMessage
- },
- scenario() {
- return this.$store.state.dictMessage.scenario || []
- }
- },
- created() { },
- mounted() {
- //获取所有部门列表
- this.getDepartment()
- this.initTask()
- },
- methods: {
- initTask() {
- this.webSocket.onmessage = (e) => {
- if(e.data.indexOf('{') == -1){
- return false
- }
- const { code, data, message } = JSON.parse(e.data)
- if (code === 903) {
- if (data.complete && data.taskId == this.taskId) {
- this.patentLoading = false
- }
- }
- }
- },
- /**
- * 人员
- */
- // 人员列表远程搜索
- remoteMethodPerson(query) {
- this.personnelList.data = []
- this.personnelList.queryParams.current = 1
- this.personnelList.queryParams.name = query
- this.getPermissionPersonnel(1)
- },
- // 获取所有人员列表懒加载
- lazyLoadingPerson() {
- if (this.personnelList.queryParams.current * this.personnelList.queryParams.size >= this.personnelList.queryParams.total) {
- return false
- }
- this.personnelList.queryParams.current += 1
- this.getPermissionPersonnel()
- },
- //获取所有人员列表(修改不要一次性获取,可以使用懒加载加远程搜索 )
- async getPermissionPersonnel(type) {
- this.personnelList.loading = true;
- await this.$api.getPermissionPersonnel(this.personnelList.queryParams).then((response) => {
- if (response.code == 200) {
- this.personnelList.loading = false;
- if(!type){
- var index = response.data.findIndex(item=>{
- return item.id == this.form.headId
- })
- if(index!=-1){
- response.data.splice(index,1)
- }
- this.personnelList.queryParams.total=response.pageColumn.total
- }
- this.personnelList.data.push(...response.data)
- // this.personnelList.queryParams.total = response.pageColumn.total
- }
- })
- },
- /**
- * 客户/委托方
- */
- //远程搜索委托方(建议调取接口获取)
- async querySearch(queryString, cb) {
- this.clientList.queryParams.current = 1
- this.clientList.queryParams.name = queryString
- this.clientList.data = []
- this.clientList.cb = cb
- await this.getClientList()
- // 调用 callback 返回建议列表的数据
- // cb(this.clientList.data);
- },
- loadClient() {
- if (this.clientList.queryParams.current * this.clientList.queryParams.size >= this.clientList.queryParams.total) {
- return false
- }
- this.clientList.queryParams.current += 1
- this.getClientList()
- },
- //获取委托方
- async getClientList() {
- await this.$api.getAdminClientList(this.clientList.queryParams).then(res => {
- if (res.code == 200) {
- this.clientList.data.push(...res.data.records)
- this.clientList.queryParams.total = res.data.total
- this.clientList.cb(this.clientList.data);
- }
- })
- },
- //输入框输入事件(委托方)
- input() {
- this.$set(this.form, 'entrustId', -1)
- },
- //切换选择委托方
- handleChange(row) {
- this.$set(this.form, 'entrustId', row.id)
- this.$set(this.form, 'entrustName', row.name)
- this.close2()
- },
- //打开选择委托方弹窗
- handleSelect() {
- this.visible = true
- },
- //获取委托方信息
- getClient(row) {
- this.$set(this.form, 'entrustId', row.id)
- this.$set(this.form, 'entrustName', row.name)
- this.close2()
- },
- //关闭委托方弹窗
- close2() {
- this.visible = false
- },
- /**
- * 事件处理
- */
- //打开事件弹窗
- addEvent() {
- var form = {
-
- }
- this.$refs.addEvent.open(form, 1)
- },
- //事件新增成功
- handleSuccess(){
- this.eventList.data=[]
- this.eventList.queryParams.current = 1
- this.eventList.name = ''
- this.getEventList()
- },
- /**
- * 事件
- */
- //懒加载事件
- loadEvent() {
- if (this.eventList.queryParams.current * this.eventList.queryParams.size >= this.eventList.queryParams.total) {
- return false
- }
- this.eventList.queryParams.current += 1
- this.getEventList()
- },
- //远程搜索
- remoteEvent(query) {
- this.eventList.data = []
- this.eventList.queryParams.current = 1
- this.eventList.name = query.trim()
- this.getEventList(1)
- },
- //获取事件列表
- async getEventList(type) {
- this.eventList.loading = true;
- let params = {
- ...this.eventList.queryParams,//分页信息
- searchQuery: this.eventList.name ? `name=${this.eventList.name}` : '',//检索条件
- orderDTOList: [{ orderBy: "createTime", orderType: 1 },]//排序
- }
- await this.$api.queryEvent(params).then(response => {
- if (response.code == 200) {
- this.eventList.loading = false;
- if (!type) {
- if (this.form.eventId) {
- var index = response.data.data.findIndex(item => {
- return item.id == this.form.eventId
- })
- if (index != -1) {
- response.data.data.splice(index, 1)
- }
- }
- this.eventList.queryParams.total = response.data.total
- }
- this.eventList.data.push(...response.data.data)
- // this.eventList.queryParams.total = response.data.total
- }
- })
- },
- //切换事件
- async changeEvent(val) {
- if (!val) {
- this.form.scenarioIds = []
- this.show = false
- this.$set(this.form,'matterIds',[])
- this.remoteEvent('')
- return
- }
- if(!this.form.matterIds){
- this.$set(this.form,'matterIds',[])
- }
- var obj = this.eventList.data.find(item => {
- return item.id == val
- })
- if (obj) {
- this.form.scenarioIds = [obj.scenarioId]
- this.show = true
- await this.onChange()
- }
- },
- //调查类型选择切换
- async onChange() {
- if (this.form.scenarioIds.length != 0) {
- // this.$set(this.form,'matterIds',[])
- await this.$api.getMatter(this.form.scenarioIds).then(response => {
- this.show = true
- this.dictAssociates = response.data.data
- })
- } else {
- this.show = false
- }
- },
- //打开弹窗
- 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 = []
- this.eventList.name = ''
- this.$set(this.form,'signProjectIds',this.form.signPatentNo || this.form.signProjectId)
- if (this.form.id) {
-
- if (this.form.eventIds && this.form.eventIds.length>0) {
- this.form.eventId = this.form.eventIds[0]
- this.show = true
- this.eventList.disabled = false
- let params = {
- current:1,
- size:1,
- searchQuery:`id=${this.form.eventId}`,//检索条件
- orderDTOList: []//排序
- }
- await this.$api.queryEvent(params).then(response => {
- if(response.code == 200){
- this.eventList.data.push(...response.data.data)
- this.eventList.queryParams.total = response.data.total
- }
- })
- this.changeEvent(this.form.eventId)
- }else{
- this.getEventList()
- }
- } else {
- this.$set(this.form, 'matterIds', form.matterId)
- this.form.scenarioIds = form.scenarioId
- this.$set(this.form, 'systemFileList', [])
- this.$set(this.form, 'fileGuids', [])
- this.eventList.disabled = false
- if (this.form.eventId) {
- this.eventList.disabled = true
- let params = {
- current:1,
- size:1,
- searchQuery:`id=${this.form.eventId}`,//检索条件
- orderDTOList: []//排序
- }
- await this.$api.queryEvent(params).then(response => {
- if(response.code == 200){
- this.eventList.data.push(...response.data.data)
- this.eventList.queryParams.total = response.data.total
- }
- })
- this.changeEvent(this.form.eventId)
- }else{
- this.getEventList()
- }
- a = '创建'
- }
- var reportType = this.dictMessage.REPORT_TYPE.filter(item => { return item.value == this.form.reportType })[0].label
- this.title = a + reportType + '报告'
- // 负责人
- if(!this.form.headId){
- this.$set(this.form,'headId',Number(this.userinfo.id))
- }else{
- this.$set(this.form,'headId',Number(this.form.headId))
- }
- this.personnelList.data = []
- if (this.form.headId) {
- this.personnelList.queryParams.id = this.form.headId
- await this.getPermissionPersonnel(1)
- this.personnelList.queryParams.id = null
- }
- this.getPermissionPersonnel()
- if(form.track){
- this.title = '添加追踪报告'
- this.copyList = this.dictMessage[this.reportAsDicItemCopy[this.form.reportType]]
- if(this.copyList){
- var index = this.copyList.findIndex(item=>{
- return item.label == '标引信息'
- })
- if(index!=-1){
- this.copyIndex = this.copyList[index]
- }
- }
-
- var arr = this.copyList?this.copyList.map(item=>{return item.value}):[]
- this.$set(this.form,'copyIds',arr)
- }
- if(!this.form.id){
- if(this.form.signPatentNo && !form.track){
- this.getPatentNo()
- }
- }
- // this.getEventList()
- this.showDialog = true
- },
- /**
- * 产品
- * @param {*} query
- */
- // 懒加载产品方法
- productLoad() {
- if (this.productList.queryParams.current * this.productList.queryParams.size >= this.productList.queryParams.total) {
- return false
- }
- this.productList.queryParams.current++
- this.queryProduct()
- },
- // 查询产品
- async queryProduct() {
- let params = {
- ...this.productList.queryParams,
- searchQuery:`product_name=${this.productList.name}`,
- }
- await this.$api.queryProduct(params).then(res => {
- if (res.code == 200) {
- this.productList.data.push(...res.data.data)
- this.productList.queryParams.total = res.data.total
- this.productList.cb(this.productList.data);
- }
- })
- },
- //获取下拉建议产品数据
- async querySearchProduct(queryString, cb) {
- this.productList.queryParams.current = 1
- this.productList.name = queryString
- this.productList.data = []
- this.productList.cb = cb
- await this.queryProduct()
- },
- // 产品输入框输入
- handleChangeProduct(val) {
- this.$set(this.form, 'signPatentNo', val)
- if (this.form.signProjectId) {
- this.form.signProjectId=''
- }
- this.$set(this.form, 'name', val + 'FTO调查')
- },
- // 产品输入框选择
- handleSelectProduct(val) {
- this.$set(this.form, 'signProjectId', val.id)
- if (this.form.signProjectId) {
- this.form.signPatentNo=val.name
- }
- this.$set(this.form, 'name', val.name + 'FTO调查')
- },
- //获取所有部门列表
- getDepartment() {
- this.$api.getPermissionDepartmentList().then((response) => {
- this.departmentList = response.data;
- });
- },
- //切换是否完成状态
- async changeStatus(val) {
- if (val == 3) {
- this.rules.headId[0].required = false
- this.rules.entrustId[0].required = false
- if (!this.form.id) {
- this.$set(this.form, 'cronIds', [])
- }
- let params = {
- reportType: this.form.reportType
- }
- // await this.$api.queryCrons(params).then(res => {
- // if (res.code == 200) {
- // this.conclusion = res.data.data
- // }
- // }).catch(error => {
- // this.conclusion = []
- // this.$message.error(error.message)
- // })
- this.conclusion = this.dictMessage[this.reportAsDicItem[this.form.reportType]]
- this.matterType = 2
- } else {
- this.rules.headId[0].required = true
- this.rules.entrustId[0].required = true
- this.matterType = null
- }
- },
- //获取专利号且填入报告名称
- getPatentNo(sign) {
- // if (!this.form.name) {
- var a = this.dictMessage.REPORT_TYPE.filter(item => { return item.value == this.form.reportType })[0].label
- if (this.form.signProjectId) {
- var product = this.productList.data.filter(item => {
- return item.id == this.form.signProjectId
- })
- var name = ''
- if(product.length>0){
- name +=`${product[0].name}-`
- }
- name+=a
- this.$set(this.form, 'name', name)
- } else {
- var name = ''
- if(this.form.caseNumber){
- name += `${this.form.caseNumber}-`
- }
- if(this.form.signPatentNo){
- name+=`${this.form.signPatentNo}-`
- }
- name+=a
- this.$set(this.form, 'name', name)
- }
- if(sign){
- this.checkPatent()
- }
-
- // }
- },
- //校验专利是否存在
- checkPatent(){
- if(!this.form.signPatentNo){
- return
- }
- var params = {
- patentNo:this.form.signPatentNo.trim()
- }
- this.$api.queryPatentByNo(params).then(response=>{
- if(response.code == 200){
- if(response.data){
- this.isExist = true
- this.patentLoading = false
- this.$set(this.form,'inventionName',response.data.title[0].text_content)
- }else{
- this.checkPatent2()
- }
- }
- })
- },
- //外部检索专利是否存在
- checkPatent2(){
- var params = {
- patentNo:this.form.signPatentNo.trim()
- }
- this.$api.queryPatentByNoFromWeb(params).then(response=>{
- if(response.code == 200){
- if(response.data){
- this.isExist = true
- this.patentImport()
- }else{
- this.isExist = false
- this.patentLoading = false
- this.$message.warning('该专利不存在')
- }
- }
- }).catch(error=>{
- this.isExist = false
- this.patentLoading = false
- this.$message.warning('该专利不存在')
- })
- },
- //导入专利
- patentImport(){
- var params = {
- "type": "2",
- "searchCondition": this.form.signPatentNo.trim(),
- "importContent": 1111,
- }
- this.$api.addImportTask(params).then(response=>{
- if(response.code == 200){
- this.taskId = response.data
- this.patentLoading = true
- }
- })
- },
- //修改需要复制的选项
- changeCopyIds(val) {
- if (Object.keys(this.copyIndex).length > 0) {
- var index = this.copyList.findIndex(item => {
- return item.label == '对比文件'
- })
- if (index != -1) {
- var id = this.copyList[index].value
- var index2 = this.copyList.findIndex(item => {
- return item.label == '标引信息'
- })
- if (val.indexOf(id) != -1) {
- if (index2 == -1) {
- this.copyList.splice(index + 1, 0, this.copyIndex)
- }
- } else {
- if (index2 != -1) {
- this.copyList.splice(index2, 1)
- this.form.copyIds.splice(this.form.copyIds.indexOf(this.copyIndex.value), 1)
- }
- }
- } else {
- }
- }
- },
- // 上传的文件监听
- onchangeFile(file, fileList) {
- if(!this.form.systemFileList){
- this.$set(this.form,'systemFileList',[])
- }
- if (file.guid) {
- let index = this.form.systemFileList.findIndex(item => {
- return item.uid == file.uid
- })
- if (index != -1) {
- this.form.systemFileList.splice(index, 1, file)
- }
- } else {
- this.form.systemFileList.push(file.raw)
- }
- },
- // 删除上传的文件
- onRemove(file, fileList) {
- let index = this.form.systemFileList.findIndex(item => {
- return item.uid == file.uid
- })
- if (index != -1) {
- this.form.systemFileList.splice(index, 1)
- }
- },
- hidePopover(){
- var a = this.$refs.addMatter.emitData()
- if(a){
- this.$set(this.form,'followUps',a)
- }else{
- return false
- }
- },
- validMatter(){
- return this.$refs.addMatter.emitData()
- },
- //提交填写的信息
- submit() {
- this.$refs.reportForm.validate((valid) => {
- if (valid) {
- if(!this.isExist){
- this.$message.warning('标的专利不存在')
- return false
- }
- this.form.type = 2//项目类型(1专利数据库 2报告 3专利挖掘项目)
- // 判断文件是否都上传完毕
- var guids = this.$commonJS.checkUploadFile(this.form.systemFileList)
- if(!guids){
- return false
- }
- this.form.fileGuids = guids
- // this.$commonJS.allUploadFile(this.form)
-
- //判断报告是否是已完成的
- if(this.form.status == 3 && !this.form.id){
- var validMatters = this.validMatter()
- if(validMatters){
- this.form.followUps = validMatters
- }else{
- return false
- }
- }else if(this.form.status != 3 && !this.form.id){
- this.form.cronIds = []
- this.form.cronDescription=''
- this.followUps = []
- }
-
- if(this.form.status == 3){
- this.form.ifFinish = true
- }else{
- this.form.ifFinish = false
- }
- // 事件及调查类型处理
- if (this.form.scenarioIds && this.form.scenarioIds.length > 0) {
- var scenarioIds = JSON.parse(JSON.stringify(this.form.scenarioIds))
- }
- if (this.form.eventId) {
- this.form.events = []
- this.form.scenarioIds = []
- if(this.form.matterIds.length>0){
- this.form.matterIds.forEach(item => {
- this.form.events.push(
- {
- matterId: item,
- scenarioId: scenarioIds[0],
- eventId: this.form.eventId
- }
- )
- })
- }else{
- this.form.events.push(
- {
- matterId: null,
- scenarioId: scenarioIds[0],
- eventId: this.form.eventId
- }
- )
- }
-
- }
- let formData = this.form
- if (!this.form.id) {//新增报告
- this.$confirm('是否需要进行审核?', '提示', {
- confirmButtonText: '是',
- cancelButtonText: '否',
- closeOnClickModal: false,
- distinguishCancelAndClose: true,
- }).then(() => {//审核打开审核弹窗
- this.showTask = true
- this.$set(this.taskForm, 'name', this.form.name + '审核')
- }).catch(action => {//不审核直接创建报告
- // 直接完成传true
- // formData.ifFinish = true
- // 调用创建报告公用,接口
- this.addReport(formData, scenarioIds)
- });
- } else {//编辑报告
- this.$api.updateReportProject(formData).then(response => {
- if (response.code == 200) {
- this.files = []
- this.$message.success('报告更新成功')
- this.$emit('getList', '更新成功')
- this.handleClose()
- }
- })
- }
- }
- })
- },
- //关闭弹窗
- handleClose(val) {
- if (this.form.reportType == 7 && val) {
- this.reportId = val
- }
- this.personnelList.queryParams.name = ''
- this.$refs.reportForm.resetFields()
- this.form = {
- matterIds: [],
- systemFileList: [],
- fileGuids: [],
- }
- this.show = false
- this.showDialog = false
- this.clear()
- },
- //添加专利到报告中
- addPatentToReport(reportId){
- if(this.havePatent.checked){
- this.$emit('addPatentToReport',reportId)
- }
- },
- //清空组件缓存数据
- clear() {
- // 清空事件相关
- this.form.eventId = []
- this.eventList.queryParams.current = 1
- this.eventList.name = ''
- this.eventList.data = []
- // 清空负责人相关
- this.personnelList.data = []
- this.personnelList.queryParams.current = 1
- this.personnelList.queryParams.name = null
- },
- // 创建报告创建接口公用
- addReport(formData, scenarioIds) {
- this.$api.addReportProject(formData).then(response => {
- if (response.code == 200) {
- this.files = []
- this.$message.success('报告创建成功')
- this.$emit('getList', '新增成功')
- // response.data是创建成功后返回的报告id
- this.splitClaim(response.data)
- this.saveFlowPath(response.data)
- this.handleClose(response.data)
-
- }
- }).catch(error => {
- // 如果报告未创建成功,则赋值
- if (scenarioIds && scenarioIds.length>0) {
- this.form.scenarioIds = JSON.parse(JSON.stringify(scenarioIds))
- }
- this.show = true
- })
- },
- //提交审核任务
- submitTask() {
- this.isEndTime = false
- this.$refs.TaskForm.validate((valid) => {
- if (valid) {
- this.taskForm.handlerType = 0//内部人员0,外部人员1
- this.taskForm.type = 1//任务类型,5为审核
- let params = {
- reportProjectDTO: this.form,
- projectTaskDTO:this.taskForm,
- }
- this.$api.addReportOpenAuditTask(params).then(response => {
- if (response.code == 200) {
- this.files = []
- this.$message.success('报告创建成功并发送审核')
- this.$emit('getList', true)
- this.handleCloseTask()
- this.saveFlowPath2(response.data)
- this.handleClose()
- }
- }).catch(error => {
- // this.$message.error('报告创建失败')
- this.handleCloseTask()
- })
- }
- })
- },
- //关闭审核弹窗
- handleCloseTask() {
- this.matterType = null
- this.$refs.TaskForm.resetFields()
- this.taskForm = {}
- this.showTask = false
- this.isEndTime = true
- },
- //拆分权利要求并拆分
- splitClaim(id){
- if(this.form.reportType != 7){
- return false
- }
- var params = {
- projectId : id
- }
- this.$api.splitClaim(params).then(response=>{
- if(response.code == 200){
- }
- })
- },
- //获取无效请求书信息
- getFlowPath(val){
- this.$set(this.form,'flowPath',val)
- },
- addFlowPath(){
- this.$refs.addFlowPath.open(1,
- {
- systemFileList:[]
- }
- )
- },
- saveFlowPath2(taskId){
- let params = {
- current:1,
- size:10,
- searchQuery: `id=${taskId}`,//检索条件
- orderDTOList:[],//排序信息
- }
- this.$api.queryProjectTask(params).then(response => {
- if (response.code == 200) {
- var data = response.data.data
- var projectId = data[0].projectId
- this.saveFlowPath(projectId)
- }
- }).catch(error => {
- })
- },
- saveFlowPath(projectId){
- this.addPatentToReport(projectId)
- if(!this.form.flowPath || this.form.id){
- return false
- }
- var form = JSON.parse(JSON.stringify(this.form.flowPath))
- form.projectId = projectId
- this.$api.addInvalidRequestFile(form).then(response=>{
- if(response.code == 200){
- }
- })
- }
- },
- };
- </script>
- <style lang="scss">
- // .el-input__inner{
- // pointer-events: none;
- // }
- // .el-input__inner:empty{
- // content:'--'
- // }
- </style>
|