addAndEditReport.vue 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269
  1. <template>
  2. <div>
  3. <el-dialog :title="title" :visible.sync="showDialog" width="1000px" :close-on-click-modal="false"
  4. @close="handleClose(false)" :append-to-body="true">
  5. <el-form :model="form" :rules="rules" ref="reportForm" label-width="120px" v-loading="loading"
  6. :element-loading-text="load_text" element-loading-spinner="el-icon-loading"
  7. element-loading-background-color="rgba(0, 0, 0, 0.8)">
  8. <el-row>
  9. <el-col :span="12">
  10. <template>
  11. <div>
  12. <el-form-item v-if="form.reportType == 3" label="标的产品" prop="signProjectIds">
  13. <el-autocomplete v-model="form.signProjectIds" value-key="name" v-SelectLazyLoading="productLoad"
  14. :fetch-suggestions="querySearchProduct" placeholder="请输入标的产品" :trigger-on-focus="false"
  15. @select="handleSelectProduct" @change="handleChangeProduct"
  16. style="width: 100%;"></el-autocomplete>
  17. </el-form-item>
  18. <el-form-item v-else label="标的专利" prop="signPatentNo">
  19. <div style="display:flex;align-items:center">
  20. <el-input v-model="form.signPatentNo" autocomplete="off" placeholder="请输入标的专利" @change="getPatentNo(1)"></el-input>
  21. <span v-if="patentLoading">
  22. <i class="el-icon-loading"></i>
  23. </span>
  24. </div>
  25. </el-form-item>
  26. </div>
  27. </template>
  28. </el-col>
  29. <el-col :span="12">
  30. <el-form-item label="报告名称" prop="name">
  31. <el-input v-model="form.name" autocomplete="off" placeholder="请输入报告名称"></el-input>
  32. </el-form-item>
  33. </el-col>
  34. </el-row>
  35. <template v-if="form.reportType == 7">
  36. <div>
  37. <el-row>
  38. <el-col :span="12">
  39. <el-form-item label="案件编号" prop="caseNumber">
  40. <el-input v-model="form.caseNumber" @change="getPatentNo" autocomplete="off" placeholder="请输入案件编号"></el-input>
  41. </el-form-item>
  42. </el-col>
  43. <el-col :span="12">
  44. <el-form-item label="无效宣告请求人" prop="invalidApplication">
  45. <el-input v-model="form.invalidApplication" autocomplete="off" placeholder="请输入无效宣告请求人"></el-input>
  46. </el-form-item>
  47. </el-col>
  48. </el-row>
  49. <el-row>
  50. <el-col :span="12">
  51. <el-form-item label="发文序号" prop="issueNumber">
  52. <el-input v-model="form.issueNumber" autocomplete="off" placeholder="请输入发文序号"></el-input>
  53. </el-form-item>
  54. </el-col>
  55. <el-col :span="12">
  56. <el-form-item label="发明创造名称" prop="inventionName">
  57. <el-input v-model="form.inventionName" autocomplete="off" placeholder="请输入发明创造名称"></el-input>
  58. </el-form-item>
  59. </el-col>
  60. </el-row>
  61. <!-- 新增 -->
  62. <el-row>
  63. <el-col :span="12">
  64. <el-form-item label="案件阶段" prop="caseStage">
  65. <el-select v-model="form.caseStage" placeholder="请选择案件阶段" style="width:100%">
  66. <el-option label="无效" value="无效"></el-option>
  67. <el-option label="行诉状态" value="行诉状态"></el-option>
  68. </el-select>
  69. </el-form-item>
  70. </el-col>
  71. <el-col :span="12">
  72. <el-form-item label="国知局受理年份" prop="acceptanceYear">
  73. <el-date-picker
  74. style="width:100%"
  75. value-format="yyyy-MM-dd"
  76. v-model="form.acceptanceYear"
  77. type="year"
  78. placeholder="请选择国知局受理年份">
  79. </el-date-picker>
  80. </el-form-item>
  81. </el-col>
  82. </el-row>
  83. <el-row>
  84. <el-col :span="12">
  85. <el-form-item label="请求人代理所" prop="requestorAgency">
  86. <el-input v-model="form.requestorAgency" autocomplete="off" placeholder="请输入请求人代理所"></el-input>
  87. </el-form-item>
  88. </el-col>
  89. <el-col :span="12">
  90. <el-form-item label="专利权人代理所" prop="holderAgency">
  91. <el-input v-model="form.holderAgency" autocomplete="off" placeholder="请输入专利权人代理所"></el-input>
  92. </el-form-item>
  93. </el-col>
  94. </el-row>
  95. </div>
  96. </template>
  97. <el-row>
  98. <el-col :span="12" v-if="form.reportType == 7">
  99. <el-form-item label="主被动类型" prop="actType">
  100. <el-select v-model="form.actType" placeholder="请选择" style="width:100%">
  101. <el-option
  102. v-for="item in actTypes "
  103. :key="item.value"
  104. :label="item.label"
  105. :value="item.value">
  106. </el-option>
  107. </el-select>
  108. </el-form-item>
  109. </el-col>
  110. <el-col :span="12">
  111. <el-form-item label="是否完成" v-if="!form.id" prop="status">
  112. <el-switch v-model="form.status" active-color="#13ce66" @change="changeStatus"
  113. :active-value="3" :inactive-value="2">
  114. </el-switch>
  115. </el-form-item>
  116. </el-col>
  117. </el-row>
  118. <template v-if="!form.id && form.status == 3">
  119. <div>
  120. <el-form-item label="报告结果" prop="cronIds">
  121. <el-checkbox-group v-model="form.cronIds">
  122. <el-checkbox v-for="item in conclusion" :key="item.value" :label="item.value">{{
  123. item.label }}</el-checkbox>
  124. </el-checkbox-group>
  125. </el-form-item>
  126. <el-form-item label="结果论述" prop="cronDescription">
  127. <el-input v-model="form.cronDescription" type="textarea" placeholder="请输入结果论述"></el-input>
  128. </el-form-item>
  129. <el-form-item label="后续跟进事项" prop="followUps">
  130. <span v-if="form.followUps"><span v-for="item in form.followUps" :key="item.name"
  131. style="margin-right:10px">{{ item.name }}</span></span>
  132. <span>
  133. <el-popover ref="popover" placement="bottom" @hide="hidePopover" trigger="click">
  134. <div>
  135. <addMatter :type="matterType" ref="addMatter"></addMatter>
  136. </div>
  137. <el-button slot="reference">添加后续事项</el-button>
  138. </el-popover>
  139. </span>
  140. </el-form-item>
  141. </div>
  142. </template>
  143. <el-row>
  144. <el-col :span="12">
  145. <el-form-item label="承担部门" prop="departmentId">
  146. <mySelectTree style="width:100%" v-model="form.departmentId" :options="departmentList"></mySelectTree>
  147. </el-form-item>
  148. </el-col>
  149. <el-col :span="12">
  150. <el-form-item label="负责人" prop="headId">
  151. <el-select style="width:100%" v-model="form.headId" placeholder="请选择负责人" filterable remote
  152. :popper-append-to-body="false" :remote-method="remoteMethodPerson" v-SelectLazyLoading="lazyLoadingPerson"
  153. :loading="personnelList.loading">
  154. <el-option v-for="item in personnelList.data" :key="Number(item.id)" :label="item.name"
  155. :value="Number(item.id)"></el-option>
  156. </el-select>
  157. </el-form-item>
  158. </el-col>
  159. </el-row>
  160. <el-row>
  161. <el-col :span="12">
  162. <template>
  163. <div>
  164. <el-form-item label="委托方" prop="entrustId" v-if="userinfo.tenantType == 1">
  165. <mySelectButton size='large' style="width:100%" @click="handleSelect">
  166. <div style="width:100%">
  167. <el-autocomplete style="width:100%" v-model="form.entrustName" ref="client" value-key="name"
  168. :fetch-suggestions="querySearch" v-SelectLazyLoading="loadClient" @input="input"
  169. placeholder="请输入内容" :trigger-on-focus="false" @select="handleChange">
  170. </el-autocomplete>
  171. </div>
  172. </mySelectButton>
  173. </el-form-item>
  174. <el-form-item label="委托部门" prop="departmentId" v-else>
  175. <mySelectTree style="width:100%" v-model="form.departmentId" :options="departmentList"></mySelectTree>
  176. </el-form-item>
  177. </div>
  178. </template>
  179. </el-col>
  180. <el-col :span="12">
  181. <el-form-item label="卷号" prop="volumeNumber">
  182. <el-input v-model="form.volumeNumber" autocomplete="off" placeholder="请输入卷号"></el-input>
  183. </el-form-item>
  184. </el-col>
  185. </el-row>
  186. <el-row>
  187. <el-col :span="24">
  188. <el-form-item label="产品/技术" prop="productOrTech">
  189. <el-input v-model="form.productOrTech" autocomplete="off" placeholder="请输入产品/技术"></el-input>
  190. </el-form-item>
  191. </el-col>
  192. </el-row>
  193. <el-row>
  194. <el-col :span="form.track ? 12 : 24">
  195. <el-form-item label="关联报告" prop="associateReportName">
  196. <el-input v-model="form.associateReportName" autocomplete="off" placeholder="请输入关联报告"></el-input>
  197. </el-form-item>
  198. </el-col>
  199. <el-col :span="12">
  200. <el-form-item label="需要复制的选项" v-show="form.track" prop="copyIds">
  201. <el-select v-model="form.copyIds" multiple clearable placeholder="请选择需要复制的选项" :popper-append-to-body="false"
  202. @change="changeCopyIds">
  203. <el-option v-for="item in copyList" :key="item.value" :label="item.label" :value="item.value"></el-option>
  204. </el-select>
  205. </el-form-item>
  206. </el-col>
  207. </el-row>
  208. <template >
  209. <div>
  210. <el-row>
  211. <el-col :span="24">
  212. <el-form-item label="事件:" prop="eventId">
  213. <mySelectButton size='large' style="width:100%" @click="addEvent">
  214. <div style="width:100%">
  215. <el-select style="width:100%" v-model="form.eventId" @change="changeEvent" filterable remote
  216. :disabled="eventList.disabled" clearable placeholder="请选择" :loading="eventList.loading"
  217. v-SelectLazyLoading="loadEvent" :remote-method="remoteEvent">
  218. <el-option v-for="item in eventList.data" :key="item.id" :label="item.name" :value="item.id">
  219. </el-option>
  220. </el-select>
  221. </div>
  222. <span slot="button">
  223. <i class="el-icon-plus"></i>
  224. </span>
  225. </mySelectButton>
  226. </el-form-item>
  227. </el-col>
  228. </el-row>
  229. <el-row v-if="show == true">
  230. <el-col :span="24">
  231. <el-form-item label="调查类型:" prop="matterIds" >
  232. <el-checkbox-group v-model="form.matterIds">
  233. <template>
  234. <el-checkbox v-for="item in dictAssociates" :key="item.id" :label="parseInt(item.id)">
  235. {{ item.name }}
  236. </el-checkbox>
  237. </template>
  238. </el-checkbox-group>
  239. </el-form-item>
  240. </el-col>
  241. </el-row>
  242. </div>
  243. </template>
  244. <template v-if="form.reportType == 7 && !form.id">
  245. <div>
  246. <el-form-item label="无效请求书" prop="flowPath">
  247. <div v-if="form.flowPath">
  248. <div v-if="form.flowPath.systemFileList && form.flowPath.systemFileList.length>0">
  249. <div v-for="item in form.flowPath.systemFileList" :key="item.guid">
  250. {{ item.name }}
  251. </div>
  252. </div>
  253. </div>
  254. <div v-else>
  255. <el-button type="text" size="small" @click="addFlowPath">添加无效请求书</el-button>
  256. </div>
  257. </el-form-item>
  258. </div>
  259. </template>
  260. <el-form-item :label="(!form.id && form.status == 3) ? '上传报告文档' : '上传附件'" prop="systemFileList">
  261. <myUpload :file-list="form.systemFileList" @on-change="onchangeFile" @on-remove="onRemove" style="height: 180px;" :autoUpload="true"></myUpload>
  262. </el-form-item>
  263. <el-form-item label="备注" prop="description">
  264. <el-input type='textarea' v-model="form.description" autocomplete="off" placeholder="请输入备注"></el-input>
  265. </el-form-item>
  266. </el-form>
  267. <div slot="footer">
  268. <el-button @click="handleClose(false)">取 消</el-button>
  269. <!-- <el-button type="primary" @click="ifNext" v-if="form.reportType == 7 && !form.id">下一步</el-button> -->
  270. <el-button type="primary" :loading="patentLoading" @click="submit">确 定</el-button>
  271. </div>
  272. </el-dialog>
  273. <!-- 审核弹窗,做公用组件 -->
  274. <el-dialog title="添加审核任务" :visible.sync="showTask" width="500px" @close="handleCloseTask" :append-to-body="true"
  275. :close-on-click-modal="false">
  276. <el-form :model="taskForm" :rules="TaskRules" ref="TaskForm" label-width="120px" v-loading="loading">
  277. <el-form-item label="任务名称:" prop="name">
  278. <el-input v-model="taskForm.name" type="text" placeholder="输入任务名称" />
  279. </el-form-item>
  280. <el-form-item label="审核人:" prop="handler">
  281. <el-select style="width:100%;" ref="select1" v-model="taskForm.handler" clearable filterable remote
  282. :remote-method="remoteMethodPerson" v-SelectLazyLoading="lazyLoadingPerson">
  283. <el-option v-for="item in personnelList.data" :key="item.id" :label="item.name" :value="item.id"
  284. placeholder="请选择审核人"></el-option>
  285. </el-select>
  286. </el-form-item>
  287. <el-form-item label="完成日期:" prop="deadLineTime">
  288. <el-date-picker style="width:100%" v-model="taskForm.deadLineTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetime"
  289. placeholder="选择日期">
  290. </el-date-picker>
  291. </el-form-item>
  292. <el-form-item label="审核备注:" prop="description">
  293. <el-input v-model="taskForm.description" type="textarea" placeholder="输入备注" />
  294. </el-form-item>
  295. </el-form>
  296. <span slot="footer" class="dialog-footer">
  297. <el-button @click="handleCloseTask">取 消</el-button>
  298. <el-button type="primary" @click="submitTask">确 定</el-button>
  299. </span>
  300. </el-dialog>
  301. <!-- 委托方弹窗 -->
  302. <el-dialog title="选择委托方" :visible.sync="visible" width="800px" :append-to-body="true" :close-on-click-modal="false"
  303. destroy-on-close :before-close="close2" top="10vh">
  304. <ClientTable :choseClient="true" @getClient="getClient"></ClientTable>
  305. </el-dialog>
  306. <!-- 添加无效请求书 -->
  307. <addFlowPath ref="addFlowPath" @save="getFlowPath"></addFlowPath>
  308. <addEvent ref="addEvent" @isSuccess="handleSuccess"></addEvent>
  309. </div>
  310. </template>
  311. <script>
  312. import { mapGetters } from 'vuex'
  313. import addMatter from '../matter/addMatters.vue'
  314. import ClientTable from '@/views/client'
  315. import addFlowPath from '@/views/report/InvalidResponse/components/dialog/editFlowPath.vue'
  316. import addEvent from '@/views/event/components/dialog/addEvent.vue';
  317. export default {
  318. components: {
  319. addMatter,
  320. ClientTable,
  321. addFlowPath,
  322. addEvent
  323. },
  324. props: {},
  325. data() {
  326. const isExist = (rule, value, callback) => {
  327. if (!this.form.signPatentNo && !this.form.signProjectIds) {//没有专利号进入报错提示
  328. if ([3].includes(Number(this.form.reportType))) {
  329. var text = '请输入标的产品'
  330. } else {
  331. var text = '请输入标的专利号'
  332. }
  333. callback(new Error(text))
  334. } else {
  335. callback()
  336. }
  337. }
  338. const isTime = (rule, value, callback) => {
  339. if (this.isEndTime) {
  340. this.isEndTimes = Date.parse(new Date)
  341. }
  342. let b = Date.parse(value)
  343. if (value) {
  344. if (b < this.isEndTimes) {
  345. callback(new Error('禁止选择现在及以前时间,请重新选择'))
  346. } else {
  347. callback()
  348. }
  349. } else {
  350. callback(new Error('请选择时间'))
  351. }
  352. }
  353. return {
  354. //弹窗标题
  355. title: '',
  356. //控制弹窗是否打开
  357. showDialog: false,
  358. //表单数据
  359. form: {
  360. matterIds: [],
  361. systemFileList: [],
  362. fileGuids: [],
  363. },
  364. //表单规则
  365. rules: {
  366. name: [{ required: true, message: '请输入报告名称', trigger: 'blur' },],
  367. signProjectIds: [{ required: true, validator: isExist, trigger: 'blur' },],//产品
  368. signPatentNo: [{ required: true, validator: isExist, trigger: 'blur' },],//专利
  369. headId: [{ required: true, message: '请选择负责人', trigger: 'change' },],
  370. entrustId: [{ required: true, message: '请选择委托方', trigger: 'change' },],
  371. },
  372. patentLoading:false,
  373. taskId:null,
  374. //加载
  375. loading: false,
  376. //加载时显示的文字
  377. load_text: '加载中',
  378. //应用场景
  379. commonData: {},
  380. //核心结论
  381. conclusion: [],
  382. //部门数据
  383. departmentList: [],
  384. //需要复制的选项集合
  385. copyList: [],
  386. //上传文件列表
  387. files: [],
  388. //核心结论类型字典
  389. reportAsDicItem: {
  390. "0": "INVALID_ASSESS",
  391. "1": "THIRD_ASSESS",
  392. "2": "STABILITY_ASSESS",
  393. "3": "FTO_ASSESS",
  394. "4": "TORT_ASSESS",
  395. "5": "AVOID_ASSESS",
  396. "7": "REINVALID_ASSESS",
  397. },
  398. //需要复制的内容字典
  399. reportAsDicItemCopy: {
  400. "0": "INVALID_COPY",
  401. "1": "THIRD_COPY",
  402. "2": "STABILITY_COPY",
  403. "3": "FTO_COPY",
  404. "4": "TORT_COPY",
  405. "5": "AVOID_COPY",
  406. "7":"INVALID_COPY"
  407. },
  408. /**
  409. * 委托方
  410. */
  411. clientList: {
  412. queryParams: {
  413. current: 1,
  414. size: 10
  415. },
  416. data: [],
  417. cb: null
  418. },
  419. visible: false,
  420. //人员列表懒加载
  421. personnelList: {
  422. queryParams: {
  423. current: 1,
  424. size: 10
  425. },
  426. data: []
  427. },
  428. //产品列表懒加载
  429. productList: {
  430. queryParams: {
  431. current: 1,
  432. size: 10
  433. },
  434. loading: false,
  435. name: '',
  436. data: [],
  437. },
  438. matterType: null,
  439. //事件列表
  440. eventList: {
  441. queryParams: {
  442. current: 1,
  443. size: 10
  444. },
  445. data: []
  446. },
  447. // 控制调查类型是否显示
  448. show: false,
  449. //调查类型列表
  450. dictAssociates: [],
  451. /*审核弹窗所需变量start*/
  452. showTask: false,
  453. // 任务表单
  454. taskForm: {},
  455. isEndTime: true,
  456. isEndTimes: null,
  457. // 任务表单校验
  458. TaskRules: {
  459. name: [{ required: true, message: '请输入任务名称', trigger: 'blur' },],
  460. handler: [{ required: true, message: '请选择审核人', trigger: 'change' },],
  461. deadLineTime: [{ required: true, validator: isTime, trigger: 'change' }],
  462. },
  463. /*审核弹窗所需变量end*/
  464. actTypes:[
  465. {
  466. label:'主动',
  467. value:1
  468. },
  469. {
  470. label:'被动',
  471. value:0
  472. },
  473. ],
  474. isExist:true
  475. };
  476. },
  477. watch: {},
  478. computed: {
  479. ...mapGetters(['webSocket', 'userinfo']),
  480. dictMessage() {
  481. return this.$store.state.dictMessage.dictMessage
  482. },
  483. scenario() {
  484. return this.$store.state.dictMessage.scenario || []
  485. }
  486. },
  487. created() { },
  488. mounted() {
  489. //获取所有部门列表
  490. this.getDepartment()
  491. this.initTask()
  492. },
  493. methods: {
  494. initTask() {
  495. this.webSocket.onmessage = (e) => {
  496. if(e.data.indexOf('{') == -1){
  497. return false
  498. }
  499. const { code, data, message } = JSON.parse(e.data)
  500. if (code === 903) {
  501. if (data.complete && data.taskId == this.taskId) {
  502. this.patentLoading = false
  503. }
  504. }
  505. }
  506. },
  507. /**
  508. * 人员
  509. */
  510. // 人员列表远程搜索
  511. remoteMethodPerson(query) {
  512. this.personnelList.data = []
  513. this.personnelList.queryParams.current = 1
  514. this.personnelList.queryParams.name = query
  515. this.getPermissionPersonnel(1)
  516. },
  517. // 获取所有人员列表懒加载
  518. lazyLoadingPerson() {
  519. if (this.personnelList.queryParams.current * this.personnelList.queryParams.size >= this.personnelList.queryParams.total) {
  520. return false
  521. }
  522. this.personnelList.queryParams.current += 1
  523. this.getPermissionPersonnel()
  524. },
  525. //获取所有人员列表(修改不要一次性获取,可以使用懒加载加远程搜索 )
  526. async getPermissionPersonnel(type) {
  527. this.personnelList.loading = true;
  528. await this.$api.getPermissionPersonnel(this.personnelList.queryParams).then((response) => {
  529. if (response.code == 200) {
  530. this.personnelList.loading = false;
  531. if(!type){
  532. var index = response.data.findIndex(item=>{
  533. return item.id == this.form.headId
  534. })
  535. if(index!=-1){
  536. response.data.splice(index,1)
  537. }
  538. this.personnelList.queryParams.total=response.pageColumn.total
  539. }
  540. this.personnelList.data.push(...response.data)
  541. // this.personnelList.queryParams.total = response.pageColumn.total
  542. }
  543. })
  544. },
  545. /**
  546. * 客户/委托方
  547. */
  548. //远程搜索委托方(建议调取接口获取)
  549. async querySearch(queryString, cb) {
  550. this.clientList.queryParams.current = 1
  551. this.clientList.queryParams.name = queryString
  552. this.clientList.data = []
  553. this.clientList.cb = cb
  554. await this.getClientList()
  555. // 调用 callback 返回建议列表的数据
  556. // cb(this.clientList.data);
  557. },
  558. loadClient() {
  559. if (this.clientList.queryParams.current * this.clientList.queryParams.size >= this.clientList.queryParams.total) {
  560. return false
  561. }
  562. this.clientList.queryParams.current += 1
  563. this.getClientList()
  564. },
  565. //获取委托方
  566. async getClientList() {
  567. await this.$api.getAdminClientList(this.clientList.queryParams).then(res => {
  568. if (res.code == 200) {
  569. this.clientList.data.push(...res.data.records)
  570. this.clientList.queryParams.total = res.data.total
  571. this.clientList.cb(this.clientList.data);
  572. }
  573. })
  574. },
  575. //输入框输入事件(委托方)
  576. input() {
  577. this.$set(this.form, 'entrustId', -1)
  578. },
  579. //切换选择委托方
  580. handleChange(row) {
  581. this.$set(this.form, 'entrustId', row.id)
  582. this.$set(this.form, 'entrustName', row.name)
  583. this.close2()
  584. },
  585. //打开选择委托方弹窗
  586. handleSelect() {
  587. this.visible = true
  588. },
  589. //获取委托方信息
  590. getClient(row) {
  591. this.$set(this.form, 'entrustId', row.id)
  592. this.$set(this.form, 'entrustName', row.name)
  593. this.close2()
  594. },
  595. //关闭委托方弹窗
  596. close2() {
  597. this.visible = false
  598. },
  599. /**
  600. * 事件处理
  601. */
  602. //打开事件弹窗
  603. addEvent() {
  604. var form = {
  605. }
  606. this.$refs.addEvent.open(form, 1)
  607. },
  608. //事件新增成功
  609. handleSuccess(){
  610. this.eventList.data=[]
  611. this.eventList.queryParams.current = 1
  612. this.eventList.name = ''
  613. this.getEventList()
  614. },
  615. /**
  616. * 事件
  617. */
  618. //懒加载事件
  619. loadEvent() {
  620. if (this.eventList.queryParams.current * this.eventList.queryParams.size >= this.eventList.queryParams.total) {
  621. return false
  622. }
  623. this.eventList.queryParams.current += 1
  624. this.getEventList()
  625. },
  626. //远程搜索
  627. remoteEvent(query) {
  628. this.eventList.data = []
  629. this.eventList.queryParams.current = 1
  630. this.eventList.name = query
  631. this.getEventList(1)
  632. },
  633. //获取事件列表
  634. async getEventList(type) {
  635. this.eventList.loading = true;
  636. let params = {
  637. ...this.eventList.queryParams,//分页信息
  638. searchQuery: this.eventList.name ? `name=${this.eventList.name}` : '',//检索条件
  639. orderDTOList: [{ orderBy: "createTime", orderType: 1 },]//排序
  640. }
  641. await this.$api.queryEvent(params).then(response => {
  642. if (response.code == 200) {
  643. this.eventList.loading = false;
  644. if (!type) {
  645. if (this.form.eventId) {
  646. var index = response.data.data.findIndex(item => {
  647. return item.id == this.form.eventId
  648. })
  649. if (index != -1) {
  650. response.data.data.splice(index, 1)
  651. }
  652. }
  653. this.eventList.queryParams.total = response.data.total
  654. }
  655. this.eventList.data.push(...response.data.data)
  656. // this.eventList.queryParams.total = response.data.total
  657. }
  658. })
  659. },
  660. //切换事件
  661. async changeEvent(val) {
  662. if (!val) {
  663. this.form.scenarioIds = []
  664. this.show = false
  665. this.form.matterIds = []
  666. return
  667. }
  668. var obj = this.eventList.data.find(item => {
  669. return item.id == val
  670. })
  671. if (obj) {
  672. this.form.scenarioIds = [obj.scenarioId]
  673. this.show = true
  674. await this.onChange()
  675. }
  676. },
  677. //调查类型选择切换
  678. async onChange() {
  679. if (this.form.scenarioIds.length != 0) {
  680. // this.$set(this.form,'matterIds',[])
  681. await this.$api.getMatter(this.form.scenarioIds).then(response => {
  682. this.show = true
  683. this.dictAssociates = response.data.data
  684. })
  685. } else {
  686. this.show = false
  687. }
  688. },
  689. //打开弹窗
  690. async open(form) {
  691. this.patentLoading = false
  692. var a = '编辑'
  693. this.form = JSON.parse(JSON.stringify(form))
  694. this.eventList.data = []
  695. this.eventList.name = ''
  696. if (this.form.id) {
  697. this.$set(this.form,'signProjectIds',this.form.signPatentNo || this.form.signProjectId)
  698. if (this.form.eventIds) {
  699. this.form.eventId = this.form.eventIds[0]
  700. this.show = true
  701. this.eventList.disabled = false
  702. let params = {
  703. current:1,
  704. size:1,
  705. searchQuery:`id=${this.form.eventId}`,//检索条件
  706. orderDTOList: []//排序
  707. }
  708. await this.$api.queryEvent(params).then(response => {
  709. if(response.code == 200){
  710. this.eventList.data.push(...response.data.data)
  711. this.eventList.queryParams.total = response.data.total
  712. }
  713. })
  714. this.changeEvent(this.form.eventId)
  715. }
  716. } else {
  717. this.$set(this.form, 'matterIds', form.matterId)
  718. this.form.scenarioIds = form.scenarioId
  719. this.$set(this.form, 'systemFileList', [])
  720. this.$set(this.form, 'fileGuids', [])
  721. this.eventList.disabled = false
  722. if (this.form.eventId) {
  723. this.eventList.disabled = true
  724. let params = {
  725. current:1,
  726. size:1,
  727. searchQuery:`id=${this.form.eventId}`,//检索条件
  728. orderDTOList: []//排序
  729. }
  730. await this.$api.queryEvent(params).then(response => {
  731. if(response.code == 200){
  732. this.eventList.data.push(...response.data.data)
  733. this.eventList.queryParams.total = response.data.total
  734. }
  735. })
  736. this.changeEvent(this.form.eventId)
  737. }else{
  738. this.getEventList()
  739. }
  740. a = '创建'
  741. }
  742. var reportType = this.dictMessage.REPORT_TYPE.filter(item => { return item.value == this.form.reportType })[0].label
  743. this.title = a + reportType + '报告'
  744. // 负责人
  745. if(!this.form.headId){
  746. this.$set(this.form,'headId',Number(this.userinfo.id))
  747. }else{
  748. this.$set(this.form,'headId',Number(this.form.headId))
  749. }
  750. this.personnelList.data = []
  751. if (this.form.headId) {
  752. this.personnelList.queryParams.id = this.form.headId
  753. await this.getPermissionPersonnel(1)
  754. this.personnelList.queryParams.id = null
  755. }
  756. this.getPermissionPersonnel()
  757. if(form.track){
  758. this.title = '添加追踪报告'
  759. this.copyList = this.dictMessage[this.reportAsDicItemCopy[this.form.reportType]]
  760. if(this.copyList){
  761. var index = this.copyList.findIndex(item=>{
  762. return item.label == '标引信息'
  763. })
  764. if(index!=-1){
  765. this.copyIndex = this.copyList[index]
  766. }
  767. }
  768. var arr = this.copyList?this.copyList.map(item=>{return item.value}):[]
  769. this.$set(this.form,'copyIds',arr)
  770. }
  771. if(!this.form.id){
  772. if(this.form.signPatentNo && !form.track){
  773. this.getPatentNo()
  774. }
  775. }
  776. // this.getEventList()
  777. this.showDialog = true
  778. },
  779. /**
  780. * 产品
  781. * @param {*} query
  782. */
  783. // 懒加载产品方法
  784. productLoad() {
  785. if (this.productList.queryParams.current * this.productList.queryParams.size >= this.productList.queryParams.total) {
  786. return false
  787. }
  788. this.productList.queryParams.current++
  789. this.queryProduct()
  790. },
  791. // 查询产品
  792. async queryProduct() {
  793. let params = {
  794. ...this.productList.queryParams,
  795. searchQuery:`product_name=${this.productList.name}`,
  796. }
  797. await this.$api.queryProduct(params).then(res => {
  798. if (res.code == 200) {
  799. this.productList.data.push(...res.data.data)
  800. this.productList.queryParams.total = res.data.total
  801. this.productList.cb(this.productList.data);
  802. }
  803. })
  804. },
  805. //获取下拉建议产品数据
  806. async querySearchProduct(queryString, cb) {
  807. this.productList.queryParams.current = 1
  808. this.productList.name = queryString
  809. this.productList.data = []
  810. this.productList.cb = cb
  811. await this.queryProduct()
  812. },
  813. // 产品输入框输入
  814. handleChangeProduct(val) {
  815. this.$set(this.form, 'signPatentNo', val)
  816. if (this.form.signProjectId) {
  817. this.form.signProjectId=''
  818. }
  819. this.$set(this.form, 'name', val + 'FTO调查')
  820. },
  821. // 产品输入框选择
  822. handleSelectProduct(val) {
  823. this.$set(this.form, 'signProjectId', val.id)
  824. if (this.form.signProjectId) {
  825. this.form.signPatentNo=''
  826. }
  827. this.$set(this.form, 'name', val.name + 'FTO调查')
  828. },
  829. //获取所有部门列表
  830. getDepartment() {
  831. this.$api.getPermissionDepartmentList().then((response) => {
  832. this.departmentList = response.data;
  833. });
  834. },
  835. //切换是否完成状态
  836. async changeStatus(val) {
  837. if (val == 3) {
  838. this.rules.headId[0].required = false
  839. this.rules.entrustId[0].required = false
  840. if (!this.form.id) {
  841. this.$set(this.form, 'cronIds', [])
  842. }
  843. let params = {
  844. reportType: this.form.reportType
  845. }
  846. // await this.$api.queryCrons(params).then(res => {
  847. // if (res.code == 200) {
  848. // this.conclusion = res.data.data
  849. // }
  850. // }).catch(error => {
  851. // this.conclusion = []
  852. // this.$message.error(error.message)
  853. // })
  854. this.conclusion = this.dictMessage[this.reportAsDicItem[this.form.reportType]]
  855. this.matterType = 2
  856. } else {
  857. this.rules.headId[0].required = true
  858. this.rules.entrustId[0].required = true
  859. this.matterType = null
  860. }
  861. },
  862. //获取专利号且填入报告名称
  863. getPatentNo(sign) {
  864. // if (!this.form.name) {
  865. var a = this.dictMessage.REPORT_TYPE.filter(item => { return item.value == this.form.reportType })[0].label
  866. if (this.form.signProjectId) {
  867. var product = this.productList.data.filter(item => {
  868. return item.id == this.form.signProjectId
  869. })
  870. var name = ''
  871. if(product.length>0){
  872. name +=`${product[0].name}-`
  873. }
  874. name+=a
  875. this.$set(this.form, 'name', name)
  876. } else {
  877. var name = ''
  878. if(this.form.caseNumber){
  879. name += `${this.form.caseNumber}-`
  880. }
  881. if(this.form.signPatentNo){
  882. name+=`${this.form.signPatentNo}-`
  883. }
  884. name+=a
  885. this.$set(this.form, 'name', name)
  886. }
  887. if(sign){
  888. this.checkPatent()
  889. }
  890. // }
  891. },
  892. //校验专利是否存在
  893. checkPatent(){
  894. if(!this.form.signPatentNo){
  895. return
  896. }
  897. var params = {
  898. patentNo:this.form.signPatentNo
  899. }
  900. this.$api.queryPatentByNo(params).then(response=>{
  901. if(response.code == 200){
  902. if(response.data){
  903. this.isExist = true
  904. this.patentLoading = false
  905. this.$set(this.form,'inventionName',response.data.title[0].text_content)
  906. }else{
  907. this.checkPatent2()
  908. }
  909. }
  910. })
  911. },
  912. //外部检索专利是否存在
  913. checkPatent2(){
  914. var params = {
  915. patentNo:this.form.signPatentNo
  916. }
  917. this.$api.queryPatentByNoFromWeb(params).then(response=>{
  918. if(response.code == 200){
  919. if(response.data){
  920. this.isExist = true
  921. this.patentImport()
  922. }else{
  923. this.isExist = false
  924. this.patentLoading = false
  925. this.$message.warning('该专利不存在')
  926. }
  927. }
  928. }).catch(error=>{
  929. this.isExist = false
  930. this.patentLoading = false
  931. this.$message.warning('该专利不存在')
  932. })
  933. },
  934. //导入专利
  935. patentImport(){
  936. var params = {
  937. "type": "2",
  938. "searchCondition": this.form.signPatentNo,
  939. "importContent": 1111,
  940. }
  941. this.$api.addImportTask(params).then(response=>{
  942. if(response.code == 200){
  943. this.taskId = response.data
  944. this.patentLoading = true
  945. }
  946. })
  947. },
  948. //修改需要复制的选项
  949. changeCopyIds(val) {
  950. if (Object.keys(this.copyIndex).length > 0) {
  951. var index = this.copyList.findIndex(item => {
  952. return item.label == '对比文件'
  953. })
  954. if (index != -1) {
  955. var id = this.copyList[index].value
  956. var index2 = this.copyList.findIndex(item => {
  957. return item.label == '标引信息'
  958. })
  959. if (val.indexOf(id) != -1) {
  960. if (index2 == -1) {
  961. this.copyList.splice(index + 1, 0, this.copyIndex)
  962. }
  963. } else {
  964. if (index2 != -1) {
  965. this.copyList.splice(index2, 1)
  966. this.form.copyIds.splice(this.form.copyIds.indexOf(this.copyIndex.value), 1)
  967. }
  968. }
  969. } else {
  970. }
  971. }
  972. },
  973. // 上传的文件监听
  974. onchangeFile(file, fileList) {
  975. if(!this.form.systemFileList){
  976. this.$set(this.form,'systemFileList',[])
  977. }
  978. if (file.guid) {
  979. let index = this.form.systemFileList.findIndex(item => {
  980. return item.uid == file.uid
  981. })
  982. if (index != -1) {
  983. this.form.systemFileList.splice(index, 1, file)
  984. }
  985. } else {
  986. this.form.systemFileList.push(file.raw)
  987. }
  988. },
  989. // 删除上传的文件
  990. onRemove(file, fileList) {
  991. let index = this.form.systemFileList.findIndex(item => {
  992. return item.uid == file.uid
  993. })
  994. if (index != -1) {
  995. this.form.systemFileList.splice(index, 1)
  996. }
  997. },
  998. hidePopover(){
  999. var a = this.$refs.addMatter.emitData()
  1000. if(a){
  1001. this.$set(this.form,'followUps',a)
  1002. }else{
  1003. return false
  1004. }
  1005. },
  1006. validMatter(){
  1007. return this.$refs.addMatter.emitData()
  1008. },
  1009. //提交填写的信息
  1010. submit() {
  1011. this.$refs.reportForm.validate((valid) => {
  1012. if (valid) {
  1013. if(!this.isExist){
  1014. this.$message.warning('标的专利不存在')
  1015. return false
  1016. }
  1017. this.form.type = 2//项目类型(1专利数据库 2报告 3专利挖掘项目)
  1018. // 判断文件是否都上传完毕
  1019. var guids = this.$commonJS.checkUploadFile(this.form.systemFileList)
  1020. if(!guids){
  1021. return false
  1022. }
  1023. this.form.fileGuids = guids
  1024. // this.$commonJS.allUploadFile(this.form)
  1025. //判断报告是否是已完成的
  1026. if(this.form.status == 3 && !this.form.id){
  1027. var validMatters = this.validMatter()
  1028. if(validMatters){
  1029. this.form.followUps = validMatters
  1030. }else{
  1031. return false
  1032. }
  1033. }
  1034. // 事件及调查类型处理
  1035. if (this.form.scenarioIds && this.form.scenarioIds.length > 0) {
  1036. var scenarioIds = JSON.parse(JSON.stringify(this.form.scenarioIds))
  1037. }
  1038. if (this.form.eventId) {
  1039. this.form.events = []
  1040. this.form.scenarioIds = []
  1041. if(this.form.matterIds.length>0){
  1042. this.form.matterIds.forEach(item => {
  1043. this.form.events.push(
  1044. {
  1045. matterId: item,
  1046. scenarioId: scenarioIds[0],
  1047. eventId: this.form.eventId
  1048. }
  1049. )
  1050. })
  1051. }else{
  1052. this.form.events.push(
  1053. {
  1054. matterId: null,
  1055. scenarioId: scenarioIds[0],
  1056. eventId: this.form.eventId
  1057. }
  1058. )
  1059. }
  1060. }
  1061. let formData = this.form
  1062. if (!this.form.id) {//新增报告
  1063. this.$confirm('是否需要进行审核?', '提示', {
  1064. confirmButtonText: '是',
  1065. cancelButtonText: '否',
  1066. closeOnClickModal: false,
  1067. distinguishCancelAndClose: true,
  1068. }).then(() => {//审核打开审核弹窗
  1069. this.showTask = true
  1070. this.$set(this.taskForm, 'name', this.form.name + '审核')
  1071. }).catch(action => {//不审核直接创建报告
  1072. // 直接完成传true
  1073. // formData.ifFinish = true
  1074. // 调用创建报告公用,接口
  1075. this.addReport(formData, scenarioIds)
  1076. });
  1077. } else {//编辑报告
  1078. this.$api.updateReportProject(formData).then(response => {
  1079. if (response.code == 200) {
  1080. this.files = []
  1081. this.$message.success('报告更新成功')
  1082. this.$emit('getList', '更新成功')
  1083. this.handleClose()
  1084. }
  1085. })
  1086. }
  1087. }
  1088. })
  1089. },
  1090. //关闭弹窗
  1091. handleClose(val) {
  1092. if (this.form.reportType == 7 && val) {
  1093. this.reportId = val
  1094. }
  1095. this.personnelList.queryParams.name = ''
  1096. this.$refs.reportForm.resetFields()
  1097. this.form = {
  1098. matterIds: [],
  1099. systemFileList: [],
  1100. fileGuids: [],
  1101. }
  1102. this.showDialog = false
  1103. this.clear()
  1104. },
  1105. //清空组件缓存数据
  1106. clear() {
  1107. // 清空事件相关
  1108. this.form.eventId = []
  1109. this.eventList.queryParams.current = 1
  1110. this.eventList.name = ''
  1111. this.eventList.data = []
  1112. // 清空负责人相关
  1113. this.personnelList.data = []
  1114. this.personnelList.queryParams.current = 1
  1115. this.personnelList.queryParams.name = null
  1116. },
  1117. // 创建报告创建接口公用
  1118. addReport(formData, scenarioIds) {
  1119. this.$api.addReportProject(formData).then(response => {
  1120. if (response.code == 200) {
  1121. this.files = []
  1122. this.$message.success('报告创建成功')
  1123. this.$emit('getList', '新增成功')
  1124. // response.data是创建成功后返回的报告id
  1125. this.splitClaim(response.data)
  1126. this.saveFlowPath(response.data)
  1127. this.handleClose(response.data)
  1128. }
  1129. }).catch(error => {
  1130. // 如果报告未创建成功,则赋值
  1131. if (scenarioIds && scenarioIds.length>0) {
  1132. this.form.scenarioIds = JSON.parse(JSON.stringify(scenarioIds))
  1133. }
  1134. this.show = true
  1135. })
  1136. },
  1137. //提交审核任务
  1138. submitTask() {
  1139. this.isEndTime = false
  1140. this.$refs.TaskForm.validate((valid) => {
  1141. if (valid) {
  1142. this.taskForm.handlerType = 0//内部人员0,外部人员1
  1143. this.taskForm.type = 1//任务类型,5为审核
  1144. let params = {
  1145. reportProjectDTO: this.form,
  1146. projectTaskDTO:this.taskForm,
  1147. }
  1148. this.$api.addReportOpenAuditTask(params).then(response => {
  1149. if (response.code == 200) {
  1150. this.files = []
  1151. this.$message.success('报告创建成功并发送审核')
  1152. this.$emit('getList', true)
  1153. this.handleCloseTask()
  1154. this.saveFlowPath2(response.data)
  1155. this.handleClose()
  1156. }
  1157. }).catch(error => {
  1158. // this.$message.error('报告创建失败')
  1159. this.handleCloseTask()
  1160. })
  1161. }
  1162. })
  1163. },
  1164. //关闭审核弹窗
  1165. handleCloseTask() {
  1166. this.matterType = null
  1167. this.$refs.TaskForm.resetFields()
  1168. this.taskForm = {}
  1169. this.showTask = false
  1170. this.isEndTime = true
  1171. },
  1172. //拆分权利要求并拆分
  1173. splitClaim(id){
  1174. if(this.form.reportType != 7){
  1175. return false
  1176. }
  1177. var params = {
  1178. projectId : id
  1179. }
  1180. this.$api.splitClaim(params).then(response=>{
  1181. if(response.code == 200){
  1182. }
  1183. })
  1184. },
  1185. //获取无效请求书信息
  1186. getFlowPath(val){
  1187. this.$set(this.form,'flowPath',val)
  1188. },
  1189. addFlowPath(){
  1190. this.$refs.addFlowPath.open(1,
  1191. {
  1192. systemFileList:[]
  1193. }
  1194. )
  1195. },
  1196. saveFlowPath2(taskId){
  1197. let params = {
  1198. current:1,
  1199. size:10,
  1200. searchQuery: `id=${taskId}`,//检索条件
  1201. orderDTOList:[],//排序信息
  1202. }
  1203. this.$api.queryProjectTask(params).then(response => {
  1204. if (response.code == 200) {
  1205. var data = response.data.data
  1206. var projectId = data[0].projectId
  1207. this.saveFlowPath(projectId)
  1208. }
  1209. }).catch(error => {
  1210. })
  1211. },
  1212. saveFlowPath(projectId){
  1213. if(!this.form.flowPath || this.form.id){
  1214. return false
  1215. }
  1216. var form = JSON.parse(JSON.stringify(this.form.flowPath))
  1217. form.projectId = projectId
  1218. this.$api.addInvalidRequestFile(form).then(response=>{
  1219. if(response.code == 200){
  1220. }
  1221. })
  1222. }
  1223. },
  1224. };
  1225. </script>
  1226. <style lang="scss">
  1227. // .el-input__inner{
  1228. // pointer-events: none;
  1229. // }
  1230. // .el-input__inner:empty{
  1231. // content:'--'
  1232. // }
  1233. </style>