addAndEditReport.vue 44 KB

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