index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. <template>
  2. <div class="height_100">
  3. <el-container v-if="showView">
  4. <el-header>
  5. <div id="step1">
  6. <mySearch style="width:500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption">
  7. </mySearch>
  8. </div>
  9. <div style="display:flex;">
  10. <div id="step2" v-if="[2].indexOf(isOperate) == -1" class="margin-right_10">
  11. <span>分组查询:</span>
  12. <el-select v-model="groupingValue" size="small" @change="changeGrouping" clearable style="width: 120px">
  13. <el-option v-for="item in groupingOption" :key="item.value" :label="item.name" :value="item.value">
  14. </el-option>
  15. </el-select>
  16. </div>
  17. <el-button-group id="step3" style="display:flex;justify-content:flex-start" v-if="[2].indexOf(isOperate) == -1">
  18. <el-button v-for="item in viewTypes" :key="item.component" size="small"
  19. :type="viewType == item.component ? 'primary' : ''" @click="onChange(item.component)">{{ item.name
  20. }}</el-button>
  21. </el-button-group>
  22. <div id="step4" class="margin-left_10">
  23. <el-dropdown size="small" v-if="$permission('/pcs/report/add')">
  24. <el-button type="primary" size="small">
  25. 创建报告<i class="el-icon-arrow-down el-icon--right"></i>
  26. </el-button>
  27. <el-dropdown-menu slot="dropdown" style="margin-top:0px"
  28. v-if="dictMessage.REPORT_TYPE && dictMessage.REPORT_TYPE.length > 0">
  29. <!-- 遍历按钮 -->
  30. <el-dropdown-item v-for="item in dictMessage.REPORT_TYPE.filter(item => !['6'].includes(item.value))"
  31. :key="item.label" @click.native="handleAnalyse(item.value)"
  32. v-if="$permission('/pcs/report/add/' + item.permission)">{{ item.label }}</el-dropdown-item>
  33. </el-dropdown-menu>
  34. </el-dropdown>
  35. <el-button type="primary" class="margin-left_10" size="small" @click="showField">显示栏位管理</el-button>
  36. </div>
  37. </div>
  38. </el-header>
  39. <el-main id="patent-list-container" class="main" v-loading="loading">
  40. <component :is="viewType" v-bind="$attrs" v-on="$listeners" :isOperate="isOperate" :tableData="dataList"
  41. :state="state" :queryParams="queryParams" @option="handleOption" @on-sort="handleSort" :groupBy="groupingValue"
  42. :groupingOption="groupingOption" :commonData="commonData" :searchOption="searchOption" :column="columnList" @params="getParams"></component>
  43. </el-main>
  44. <el-footer class="pagination" v-if="viewType != 'visual'">
  45. <el-pagination background layout="total,sizes, prev, pager, next, jumper" :current-page.sync="queryParams.current"
  46. :page-sizes="pageSize" :page-size.sync="queryParams.size" @current-change="handleCurrentChange"
  47. :handleMessage="handleMessage" @size-change="handleSizeChange" :total="total">
  48. </el-pagination>
  49. </el-footer>
  50. </el-container>
  51. <CreateReport ref="ReportForm" @getList="isGetList"></CreateReport>
  52. <fields ref="field" type="reportProject" @getFieldList="getFieldList"></fields>
  53. <Field-Drawer ref="FieldDrawer"></Field-Drawer>
  54. <reportFileDrawer ref="reportFileDrawer"></reportFileDrawer>
  55. <cronConclusion ref="cronConclusion" @save="getList"></cronConclusion>
  56. <exportReport ref="exportReport"></exportReport>
  57. <!-- 项目分享 -->
  58. <patentShare ref="patentShare"></patentShare>
  59. </div>
  60. </template>
  61. <script>
  62. import Table from './view/table.vue'
  63. import Card from './view/card.vue'
  64. import visual from './view/visual.vue'
  65. import mergeTable from './view/mergeTable.vue'
  66. import CreateReport from './dialog/addAndEditReport.vue'
  67. import fields from '@/views/components/dialog/fields.vue';
  68. import FieldDrawer from '@/views/components/drawer/Field.vue'
  69. import reportFileDrawer from './drawer/reportFileDrawer.vue'
  70. import cronConclusion from './dialog/cronConclusion.vue'
  71. import exportReport from './dialog/exportReport.vue'
  72. import patentShare from '@/views/components/drawer/Share.vue';
  73. export default {
  74. components: {
  75. Table,
  76. Card,
  77. visual,
  78. CreateReport,
  79. mergeTable,
  80. fields,
  81. FieldDrawer,
  82. reportFileDrawer,
  83. cronConclusion,
  84. exportReport,
  85. patentShare,
  86. },
  87. props: {
  88. isOperate: '',
  89. matterId: {},
  90. scenarioId: {},
  91. eventName: '',
  92. eventId: '',
  93. },
  94. data() {
  95. return {
  96. //视图类型
  97. viewTypes: [
  98. // {
  99. // name: '可视化',
  100. // component: 'visual'
  101. // },
  102. {
  103. name: '列表',
  104. component: 'Table'
  105. },
  106. {
  107. name: '卡片',
  108. component: 'Card'
  109. },
  110. ],
  111. //当前视图类型
  112. viewType: 'Table',
  113. //检索字段
  114. searchFiled: [],
  115. //检索条件
  116. searchOption: {
  117. name: localStorage.searchContent,
  118. reportType: localStorage.reportType ? [localStorage.reportType] : '',
  119. scenarioNames: this.scenarioId,
  120. matterNames: this.matterId,
  121. eventNames: this.eventName
  122. },
  123. //分组的值
  124. groupingValue: '',
  125. //分组
  126. groupingOption: [],
  127. //分页信息
  128. queryParams: {
  129. current: 1,
  130. size: 10,
  131. },
  132. //总数
  133. total: 0,
  134. //分页数量
  135. pageSize: [10, 20],
  136. //排序字段
  137. sort: [
  138. {
  139. "orderBy": "createTime",
  140. "orderType": 1
  141. }
  142. ],
  143. //加载
  144. loading: false,
  145. //报告数据集合
  146. dataList: [],
  147. // 报告分组数据集合
  148. commonData: [],
  149. // 栏位信息数组
  150. columnList: [],
  151. // 子组件新增、编辑报告成功发送的字符串
  152. handleMessage: '',
  153. showView: false,
  154. };
  155. },
  156. watch: {},
  157. computed: {
  158. dictMessage() {
  159. var a = this.$store.state.dictMessage.dictMessage
  160. if (a.REPORT_TYPE) {
  161. a.REPORT_TYPE.forEach(item => {
  162. if (['0', '1', '2'].includes(item.value)) {
  163. item.permission = 'invalid'
  164. } else if (item.value == 3) {
  165. item.permission = 'FTO'
  166. } else if (item.value == 4) {
  167. item.permission = 'tort'
  168. } else if (item.value == 5) {
  169. item.permission = 'avoidDesign'
  170. } else if (item.value == 7) {
  171. item.permission = 'reInvalid'
  172. }
  173. })
  174. }
  175. if (a.REPORT_TYPE) {
  176. // 报告类型
  177. this.searchFiled[1].options = a.REPORT_TYPE.map(item => {
  178. return {
  179. value: item.value,
  180. label: item.label
  181. }
  182. })
  183. // 报告状态
  184. this.searchFiled[2].options = a.REPORT_STATE.map(item => {
  185. return {
  186. value: item.value,
  187. label: item.label
  188. }
  189. })
  190. }
  191. return a
  192. },
  193. state() {
  194. var a = this.$store.state.dictMessage.dictMessage.REPORT_STATE
  195. var b = {}
  196. if (a) {
  197. a.forEach(item => {
  198. b[item.value] = item.label
  199. });
  200. return b
  201. }
  202. return []
  203. },
  204. scene() {
  205. var a = this.$store.state.dictMessage.scenario.map(item => {
  206. return {
  207. label: item.name,
  208. value: item.id
  209. }
  210. })
  211. var obj = this.searchFiled.find(item => { return item.label == '应用场景' })
  212. if (obj) {
  213. obj.options = a
  214. }
  215. return this.$store.state.dictMessage.scenario
  216. },
  217. matter() {
  218. var a = this.$store.state.dictMessage.matter.map(item => {
  219. return {
  220. label: item.name,
  221. value: item.id
  222. }
  223. })
  224. var obj = this.searchFiled.find(item => { return item.label == '调查类型' })
  225. if (obj) {
  226. obj.options = a
  227. }
  228. return this.$store.state.dictMessage.matter || []
  229. }
  230. },
  231. created() { },
  232. async mounted() {
  233. // 获取table栏位
  234. this.columnList = await this.$commonJS.getCustomField('reportProject')
  235. // 获取搜索/分组
  236. await this.getColumn()
  237. //获取报告清单
  238. this.getList()
  239. this.showViews()
  240. },
  241. methods: {
  242. //显示视图?
  243. showViews() {
  244. this.showView = false
  245. this.$nextTick(() => {
  246. this.showView = true
  247. })
  248. },
  249. // 显示栏位管理组件返回数据
  250. getFieldList(val) {
  251. this.columnList = val
  252. },
  253. // 显示栏位管理
  254. showField() {
  255. this.$refs.field.open(this.columnList)
  256. },
  257. //获取table栏位及分组字段、检索字段
  258. async getColumn() {
  259. let params = ['reportProject']
  260. await this.$api.getParamsCommon(params).then(res => {
  261. if (res.code == 200) {
  262. let conditionDTOList = JSON.parse(JSON.stringify(res.data[0].conditionDTOList))
  263. // 分组字段
  264. this.groupingOption = this.$commonJS.getField(conditionDTOList, (u) => u.ifGroup == true, {
  265. name: 'name',
  266. value: 'value',
  267. })
  268. // 搜索字段
  269. this.searchFiled = this.$commonJS.getField(conditionDTOList, (u) => u.ifSearch == true, {
  270. label: 'name',
  271. value: 'value',
  272. type: 'type',
  273. })
  274. //先获取报告类型,报告状态,相关事件,再为报告类型,报告状态,相关事件添加选项
  275. let arr = ['报告类型', '报告状态', '核心结论']
  276. arr.forEach(item => {
  277. let obj = this.searchFiled.find(item2 => {
  278. return item2.label == item
  279. })
  280. if (obj) {
  281. this.handleSearchArray(obj)
  282. }
  283. })
  284. //为应用场景添加选项
  285. var obj = this.searchFiled.find(item => { return item.label == '应用场景' })
  286. if (obj) {
  287. obj.options = this.scene.map(item => {
  288. return {
  289. label: item.name,
  290. value: item.id
  291. }
  292. })
  293. }
  294. var obj = this.searchFiled.find(item => { return item.label == '调查类型' })
  295. if (obj) {
  296. obj.options = this.matter.map(item => {
  297. return {
  298. label: item.name,
  299. value: item.id
  300. }
  301. })
  302. }
  303. }
  304. })
  305. this.showViews()
  306. },
  307. // 处理检索字段为array类型的问题
  308. handleSearchArray(obj) {
  309. switch (obj.label) {
  310. case '报告类型':
  311. if (this.dictMessage.REPORT_TYPE && this.dictMessage.REPORT_TYPE.length > 0) {
  312. let dict = this.dictMessage.REPORT_TYPE.filter(item => !['6'].includes(item.value))
  313. obj.options = dict.map(item => {
  314. return {
  315. label: item.label,
  316. value: item.value,
  317. }
  318. })
  319. }
  320. break;
  321. case '报告状态':
  322. obj.options = [
  323. { value: 0, label: '开卷审核' },
  324. { value: 1, label: '创建中' },
  325. { value: 2, label: '处理中' },
  326. { value: 3, label: '完成' },
  327. { value: 4, label: '取消开卷' },
  328. { value: 5, label: '补资料中' },
  329. ]
  330. break;
  331. case '核心结论':
  332. this.$api.queryCrons().then(res => {
  333. if (res.code == 200) {
  334. obj.options = res.data.data
  335. }
  336. })
  337. break;
  338. default:
  339. break;
  340. }
  341. },
  342. //接收检索条件
  343. search(val) {
  344. let params = {}
  345. val.forEach(item => {
  346. if (item.type == 3) {
  347. params[item.value] = item.searchValue.map(itemValue => {
  348. return itemValue.value
  349. })
  350. } else {
  351. params[item.value] = item.searchValue.label
  352. }
  353. })
  354. // 返回字符串
  355. this.searchOption = this.$commonJS.ArrayToArray(val)
  356. // 调用查询接口
  357. this.queryParams.current = 1
  358. this.getList()
  359. },
  360. //获取报告列表
  361. getList() {
  362. let params = {
  363. ...this.queryParams,//分页信息
  364. searchQuery: this.$commonJS.objectToString(this.searchOption),//检索条件
  365. orderDTOList: this.sort,//排序信息
  366. }
  367. this.loading = true
  368. this.$api.queryReportProject(params).then(res => {
  369. if (res.code == 200) {
  370. this.dataList = res.data.data
  371. this.total = res.data.total
  372. this.loading = false
  373. }
  374. }).catch(error => {
  375. this.dataList = []
  376. this.total = 0
  377. this.loading = false
  378. this.$message.error(error.message)
  379. })
  380. },
  381. // 获取分组数据
  382. getGrouping() {
  383. let params = {
  384. ...this.queryParams,//分页信息
  385. searchQuery: this.$commonJS.objectToString(this.searchOption),//检索条件
  386. orderDTOList: [
  387. {
  388. orderBy: this.groupingValue,
  389. orderType: this.sort[0].orderType
  390. }
  391. ],//排序
  392. groupBy: this.groupingValue,//分组信息
  393. }
  394. this.$api.groupReportProject(params).then(res => {
  395. if (res.code == 200) {
  396. this.commonData = res.data.data.values
  397. this.total = res.total
  398. }
  399. }).catch(error => {
  400. this.commonData = []
  401. this.total = 0
  402. this.$message.error(error.message)
  403. })
  404. },
  405. //排序
  406. handleSort({ column, prop, order }) {
  407. //如需要多个字段排序,则不需要清空
  408. var params = {
  409. sort: this.sort,
  410. column,
  411. prop,
  412. order,
  413. }
  414. this.sort = this.$commonJS.getSortData(params)
  415. this.queryParams.current = 1
  416. this.isGrouping()
  417. },
  418. //分页
  419. handleCurrentChange(val) {
  420. this.queryParams.current = val;
  421. this.isGrouping()
  422. },
  423. //切换页大小
  424. handleSizeChange(val) {
  425. this.queryParams.size = val
  426. this.isGrouping()
  427. // this.getList()
  428. },
  429. //切换视图
  430. onChange(type) {
  431. this.viewType = type
  432. if (type == 'visual') {
  433. this.$nextTick(() => {
  434. this.reportVisual()
  435. })
  436. return false
  437. }
  438. this.queryParams.size = this.viewType === 'Table' ? 10 : 12
  439. this.groupingValue = ''
  440. this.queryParams.current = 1
  441. this.getList()
  442. },
  443. //展示报告可视化
  444. reportVisual() {
  445. this.$api.reportVisual(this.queryParams).then(response => {
  446. if (response.code == 200) {
  447. // this.$refs.reportVisual.open(response.data)
  448. }
  449. })
  450. },
  451. //切换分组值
  452. changeGrouping(val) {
  453. if (val != '') {
  454. this.viewType = 'mergeTable'
  455. } else {
  456. this.viewType = 'Table'
  457. }
  458. this.queryParams.current = 1
  459. this.groupingValue = val
  460. this.isGrouping()
  461. },
  462. // 区分是否为分组
  463. isGrouping() {
  464. if (this.groupingValue != '') {//分组
  465. this.getGrouping()
  466. } else {//不分组
  467. this.getList()
  468. }
  469. },
  470. //打开创建报告弹窗
  471. handleAnalyse(id) {
  472. var form = {
  473. reportType: id,
  474. eventId: this.eventId,
  475. eventName: this.eventName,
  476. matterId: this.matterId || [],
  477. scenarioId: this.scenarioId || [],
  478. }
  479. this.$refs.ReportForm.open(form)
  480. },
  481. //操作列
  482. handleOption({ option, row, isLast }) {
  483. this.$s.setSession('params', row)
  484. switch (option) {
  485. case '0'://分享
  486. this.share(row)
  487. break
  488. case '1'://导出报告
  489. this.exportReport(row)
  490. break
  491. case '2'://报告文档
  492. this.handleFile(row)
  493. break
  494. case '5'://拆分特征
  495. this.handleDetails(row)
  496. break
  497. case '3'://自定义字段
  498. this.handleField(row)
  499. break
  500. case '4'://任务分配
  501. this.handleTask(row)
  502. break
  503. case '6'://导入专利
  504. this.handleImportPatent(row)
  505. break
  506. case '7'://删除
  507. this.handleDelete(row, isLast)
  508. break;
  509. case '8'://侵权分析技术特征对比
  510. // this.$s.setSession('reportMessage1', row)
  511. this.toTortIndex(row)
  512. break
  513. case '9'://回避设计
  514. this.handleDetails(row, '回避设计')
  515. break;
  516. case '10'://对比文件
  517. this.patentList(row)
  518. break
  519. case '11'://完成报告
  520. this.completeReport(row)
  521. break
  522. case '12'://追踪报告
  523. this.trackReport(row)
  524. break
  525. case '13'://添加无效理由和证据
  526. this.toInvalidIndex(row)
  527. break;
  528. case '14'://导入无效证据
  529. this.toInvalidEvidence(row)
  530. break;
  531. case '15'://录入产品信息
  532. this.toInformationEntry(row)
  533. break;
  534. case 'e'://编辑
  535. this.handleEdit(row)
  536. break
  537. }
  538. },
  539. //分享
  540. share(row){
  541. this.$refs.patentShare.open(row.id)
  542. },
  543. //导出报告
  544. exportReport(row){
  545. this.$refs.exportReport.open(row)
  546. },
  547. //追踪报告
  548. trackReport(row){
  549. var form = JSON.parse(JSON.stringify(row))
  550. this.$set(form,'associateReportName',row.volumeNumber?row.volumeNumber:row.name)
  551. this.$set(form,'associateReportId',row.id)
  552. this.$set(form,'cronIds',[])
  553. if(isNaN((row.name).substring((row.name).length-1))){
  554. form.name = row.name + '-V1'
  555. }else{
  556. var a= Number((row.name).substring((row.name).length-1)) + 1
  557. form.name = (row.name).substring(0,(row.name).length-1) + a
  558. }
  559. form.status = 1
  560. form.id = null
  561. form.track = true
  562. this.$refs.ReportForm.open(form)
  563. },
  564. //完成报告
  565. completeReport(row){
  566. this.$refs.cronConclusion.open(row)
  567. },
  568. //无效证据
  569. toInvalidEvidence(row){
  570. this.$router.push({
  571. path:'/evidence',
  572. query:{
  573. projectId:row.id,
  574. reportType:row.reportType,
  575. signPatentNo:row.signPatentNo,
  576. patentNo:row.signPatentNo
  577. }
  578. })
  579. },
  580. // 报告文档
  581. handleFile(row) {
  582. this.$refs.reportFileDrawer.open(row.id)
  583. },
  584. //自定义栏位管理
  585. handleField(row) {
  586. this.$refs.FieldDrawer.open(row.id)
  587. },
  588. //跳转到专利列表页面
  589. patentList(row){
  590. this.$router.push(
  591. {
  592. path:'/reportPatentList',
  593. query:{
  594. projectId:row.id
  595. }
  596. }
  597. )
  598. },
  599. // 跳转录入产品信息页面
  600. toInformationEntry(row) {
  601. var routerReport = this.$router.resolve({
  602. path: "/informationEntry",
  603. query: {
  604. patentNo: row.signPatentNo,
  605. projectId: row.id,
  606. reportType: row.reportType
  607. }
  608. })
  609. window.open(routerReport.href, '_blank');
  610. },
  611. // 跳转专利与产品关联比对
  612. toTortIndex(row) {
  613. var routerReport = this.$router.resolve(
  614. {
  615. path: '/patentDetails/' + row.signPatentNo,
  616. query: {
  617. projectId: row.id,
  618. reportType: row.reportType,
  619. taskType:3
  620. }
  621. }
  622. )
  623. // var routerReport = this.$router.resolve({
  624. // path: "/tortIndex",
  625. // query: {
  626. // patentNo: row.signPatentNo,
  627. // projectId: row.id,
  628. // reportType: row.reportType
  629. // }
  630. // })
  631. window.open(routerReport.href, '_blank');
  632. },
  633. // 跳转回避设计或拆分特征
  634. handleDetails(row, type) {
  635. if (type == '回避设计') {
  636. var router = this.$router.resolve({
  637. path: "/avoid",
  638. query: {
  639. patentNo: row.signPatentNo,
  640. reportId: row.id,
  641. }
  642. })
  643. window.open(router.href, '_blank');
  644. }
  645. },
  646. // 删除
  647. handleDelete(row, isLast) {
  648. this.handleDeletes([row.id], isLast)
  649. },
  650. // 批量删除报告
  651. handleDeletes(ids, isLast) {
  652. this.$confirm('此操作将永久删除该报告, 是否继续?', '提示', {
  653. confirmButtonText: '确定',
  654. cancelButtonText: '取消',
  655. type: 'warning'
  656. }).then(() => {
  657. this.$api.deleteReportProject(ids).then(res => {
  658. if (res.code == 200) {
  659. if (isLast) {
  660. this.isGrouping()
  661. } else {
  662. this.getList()
  663. }
  664. this.handleMessage = '删除成功'
  665. this.clearMessage()
  666. this.$message.success('删除报告成功')
  667. }
  668. }).catch(err => {
  669. this.$message.error(err.message)
  670. })
  671. }).catch(() => {
  672. this.$message.info("已取消删除")
  673. });
  674. },
  675. //编辑报告
  676. handleEdit(row) {
  677. this.$refs.ReportForm.open(row)
  678. },
  679. //接收可视化的参数
  680. getParams(params) {
  681. if (params.conclusionType == '-1') {
  682. this.searchOption.statuses = ['0', '1', '2', '4', '5']
  683. this.searchOption.types = [params.type]
  684. } else {
  685. this.searchOption.cronIds = [params.conclusionType]
  686. }
  687. var a = JSON.parse(JSON.stringify(this.searchOption))
  688. this.searchOption = a
  689. this.viewType = 'Table'
  690. this.queryParams.current = 1
  691. this.getList()
  692. },
  693. //创建报告子组件返回值
  694. isGetList(val) {
  695. this.handleMessage = val
  696. this.queryParams.current = 1
  697. this.isGrouping()
  698. this.clearMessage()
  699. },
  700. //清空信息
  701. clearMessage() {
  702. this.$emit('submit', true)
  703. this.$nextTick(() => {
  704. this.handleMessage = ''
  705. })
  706. },
  707. },
  708. };
  709. </script>
  710. <style lang="scss" scoped></style>