index.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068
  1. <template>
  2. <div class="height_100">
  3. <el-container>
  4. <!-- 统计 -->
  5. <el-aside class="height_100" :width="showLeft ? '300px' : '0px'" v-show="showLeft">
  6. <div class="height_100">
  7. <customFields ref="customFields" :projectId="projectId" :searchOption="searchStr" :customFields="customFields"
  8. @customTab="handleCustomFields" :searchPatentCheck="searchPatentCheck" :groupField="queryParams.groupField">
  9. </customFields>
  10. </div>
  11. </el-aside>
  12. <!-- 专利列表 -->
  13. <el-container>
  14. <el-header style="display:flex;justify-content:space-between">
  15. <div style="display:flex">
  16. <el-tooltip class="item" effect="dark" :content="(showLeft ? '隐藏' : '显示') + '左侧菜单'" placement="top">
  17. <i :class="showLeft ? 'el-icon-s-fold' : 'el-icon-s-unfold'"
  18. style="font-size: 25px;position: relative; top: 5px; color: #2f2f2f; cursor: pointer"
  19. @click="showLeft = !showLeft"></i>
  20. </el-tooltip>
  21. <searchPatent ref="searchPatent" :searchFiled="searchFiled" :searchPatentCheck="searchPatentCheck"
  22. @searchValue="handleSearchValue"></searchPatent>
  23. <!-- <mySearch :SearchFields="searchFiled" @search="search" :searchValue="searchOption"></mySearch> -->
  24. <el-popover placement="bottom" title="关键词高亮" width="320" trigger="click">
  25. <patent-keywords-highlight :project-id="projectId" />
  26. <el-button slot="reference" size="small" type="primary" class="margin-right_10 margin-left_10">
  27. 高亮<i class="el-icon-arrow-down el-icon--right"></i>
  28. </el-button>
  29. </el-popover>
  30. <el-button size="small" type="success" @click="handleAnalyses" style="font-size:16px;padding:0px 9px;font-wight:0"><i class="el-icon-s-data" style="font-size:18px;"></i> 图表分析</el-button>
  31. </div>
  32. <div style="display:flex;align-items:center;">
  33. <div id="step2">
  34. <span>分组:</span>
  35. <el-select v-model="queryParams.groupField" size="small"
  36. @change="onChangeFamily" style="width:200px">
  37. <el-option v-for="(item, key) in familyObj" :key="key" :label="item" :value="key">
  38. </el-option>
  39. </el-select>
  40. </div>
  41. <el-button-group class="margin-left_10">
  42. <el-tooltip v-for="item in viewList" :key="item.value" class="item" effect="dark" :content="item.title"
  43. placement="top">
  44. <el-button @click="handleChangeView(item)" size="small"
  45. :type="viewSelected === item.value ? 'primary' : ''">
  46. <i :class="item.btn" style="font-size: 12px !important;"></i>
  47. </el-button>
  48. </el-tooltip>
  49. </el-button-group>
  50. <el-button class="margin-left_10" type="primary" size="small" @click="handleFieldManage" v-if="toProjectId && toProjectName">显示栏位管理</el-button>
  51. <el-dropdown v-else trigger="click" split-button type="primary" size="small">
  52. <span @click="handleFieldManage">显示栏位管理</span>
  53. <el-dropdown-menu slot="dropdown" class="text-align_center">
  54. <el-dropdown-item @click.native="handleFile">报告文档</el-dropdown-item>
  55. <!-- <el-dropdown-item @click.native="handleQuestion" v-if="$permission('/workspace/event')">事
  56. 件</el-dropdown-item> -->
  57. <el-dropdown-item @click.native="handleField" v-disabled="false">自定义栏位管理</el-dropdown-item>
  58. <!-- <el-dropdown-item @click.native="exportPDF">导出PDF首页</el-dropdown-item> -->
  59. <el-dropdown-item>
  60. <el-dropdown @command="patentImport($event)" trigger="hover" placement="right-start">
  61. <p>
  62. 专利导入<i class="el-icon-arrow-right el-icon--right"></i>
  63. </p>
  64. <el-dropdown-menu slot="dropdown">
  65. <el-dropdown-item command="1"> Excel导入 </el-dropdown-item>
  66. <el-dropdown-item command="2">专利号导入 </el-dropdown-item>
  67. <el-dropdown-item command="4">检索条件导入 </el-dropdown-item>
  68. </el-dropdown-menu>
  69. </el-dropdown>
  70. </el-dropdown-item>
  71. <el-dropdown-item>
  72. <el-dropdown trigger="hover" placement="right-start">
  73. <p>
  74. 导出PDF首页<i class="el-icon-arrow-right el-icon--right"></i>
  75. </p>
  76. <el-dropdown-menu slot="dropdown">
  77. <el-dropdown-item @click.native="exportPDF(false)">当前全部</el-dropdown-item>
  78. <el-dropdown-item @click.native="exportPDF(true)">当前所选</el-dropdown-item>
  79. </el-dropdown-menu>
  80. </el-dropdown>
  81. </el-dropdown-item>
  82. <!-- <el-dropdown-item @click.native="handleBatch"
  83. :disabled="!($permission('/workspace/folder/batchUploadSpecification') && $r(projectId, [1, 2]))">批量上传说明书</el-dropdown-item>
  84. <el-dropdown-item> -->
  85. <el-dropdown trigger="hover" placement="right-start">
  86. <p>
  87. 导出Excel档<i class="el-icon-arrow-right el-icon--right"></i>
  88. </p>
  89. <el-dropdown-menu slot="dropdown">
  90. <el-dropdown-item @click.native="handleExport(false)">当前全部</el-dropdown-item>
  91. <el-dropdown-item @click.native="handleExport(true)">当前所选</el-dropdown-item>
  92. </el-dropdown-menu>
  93. </el-dropdown>
  94. <!-- <el-dropdown-item>
  95. <el-dropdown trigger="hover" placement="right-start">
  96. <p>
  97. {{ familyObj[queryParams.groupField] }}<i class="el-icon-arrow-right el-icon--right"></i>
  98. </p>
  99. <el-dropdown-menu slot="dropdown">
  100. <el-dropdown-item v-for="(item, key) in familyObj" :key="key" @click.native="onChangeFamily(key)">{{
  101. item }}</el-dropdown-item>
  102. </el-dropdown-menu>
  103. </el-dropdown>
  104. </el-dropdown-item> -->
  105. <el-dropdown-item>
  106. <el-dropdown trigger="hover" placement="right-start">
  107. <p>
  108. 合并<i class="el-icon-arrow-right el-icon--right"></i>
  109. </p>
  110. <el-dropdown-menu slot="dropdown">
  111. <el-dropdown-item @click.native="handleMerge(2)">发明人</el-dropdown-item>
  112. <el-dropdown-item @click.native="handleMerge(0)">申请人/权利人</el-dropdown-item>
  113. </el-dropdown-menu>
  114. </el-dropdown>
  115. </el-dropdown-item>
  116. <el-dropdown-item>
  117. <el-dropdown trigger="hover" placement="right-start">
  118. <p>
  119. 创建报告<i class="el-icon-arrow-right el-icon--right"></i>
  120. </p>
  121. <el-dropdown-menu slot="dropdown" style="margin-top:0px">
  122. <!-- 遍历按钮 -->
  123. <el-dropdown-item @click.native="handleAnalysesFto">FTO调查</el-dropdown-item>
  124. </el-dropdown-menu>
  125. </el-dropdown>
  126. </el-dropdown-item>
  127. <!-- <el-dropdown-item @click.native="handleAnalyses">图表分析</el-dropdown-item> -->
  128. <el-dropdown-item @click.native="handleAllocation">任务分配</el-dropdown-item>
  129. <el-dropdown-item @click.native="taskList">任务清单</el-dropdown-item>
  130. <el-dropdown-item @click.native="importAndExportHistory">导入导出历史</el-dropdown-item>
  131. </el-dropdown-menu>
  132. </el-dropdown>
  133. </div>
  134. </el-header>
  135. <el-main v-loading="loading">
  136. <div class="height_100">
  137. <component ref="patentViewList" :is="viewSelected" @download="handleDownload" @change-read="handleChangeRead"
  138. :projectId="projectId" :patentNoList.sync="patentNoList" @addSelect="getChoosePatentNo"
  139. @clickPatentNo="handleClick" :column="customList" @index-setting="handleIndexSetting" @on-sort="handleSort"
  140. :queryParams="queryParams" :tableData="tableData" :refresh='refresh'></component>
  141. </div>
  142. </el-main>
  143. <el-footer class="pagination" style="display:flex;justify-content:space-between;align-items:center">
  144. <div style="display:flex;align-items:center">
  145. <span v-if="selectedTotal > 0">
  146. 已勾选 <b>{{ selectedTotal }}</b> 条
  147. </span>
  148. <el-popover placement="bottom" title="" width="220" trigger="click">
  149. <el-main class="patent-fast-edit-popover" v-loading="selectNumberLoading">
  150. <div class="btn" @click="handleCancelSelectNumber">取消选择</div>
  151. <div class="btn" @click="handleSelectNumber(0)">本页选择</div>
  152. <div class="btn" @click="handleSelectNumber(1)">全部选择</div>
  153. <el-divider></el-divider>
  154. <div class="select-number">
  155. <span>从</span>
  156. <el-input size="mini" v-model="queryParams.startNumber" @change="change1"></el-input>
  157. <span>到</span>
  158. <el-input size="mini" v-model="queryParams.endNumber" @change="change2"></el-input>
  159. <el-button type="text" size="" @click="handleSelectNumber(2)">确定</el-button>
  160. </div>
  161. </el-main>
  162. <el-button type="info" size="small" class="margin-left_10" slot="reference"> 选择专利<i
  163. class="el-icon-arrow-down el-icon--right"></i></el-button>
  164. </el-popover>
  165. <div v-show="selectedTotal > 0" class="margin-left_10">
  166. <el-dropdown size="medium">
  167. <el-button type="primary" size="small">
  168. 批量操作<i class="el-icon-arrow-down el-icon--right"></i>
  169. </el-button>
  170. <el-dropdown-menu slot="dropdown">
  171. <!-- <el-dropdown-item @click.native="handleRead(1)"
  172. :disabled="!$permission('/workspace/folder/isRead')">已读</el-dropdown-item>
  173. <el-dropdown-item @click.native="handleRead(0)"
  174. :disabled="!$permission('/workspace/folder/isRead')">未读</el-dropdown-item> -->
  175. <el-dropdown-item v-if="toProjectId && toProjectName" @click.native="addPatentToReport(toProjectId)">加入到报告({{ toProjectName }})中</el-dropdown-item>
  176. <template v-else>
  177. <el-dropdown-item @click.native="handleIndex">批量标引</el-dropdown-item>
  178. <el-dropdown-item @click.native="checkPatentWorth">价值曲线</el-dropdown-item>
  179. <el-dropdown-item @click.native="deletePatents">删除</el-dropdown-item>
  180. </template>
  181. </el-dropdown-menu>
  182. </el-dropdown>
  183. </div>
  184. <!-- 编辑暂时隐藏,默认置为true -->
  185. <!-- <div class="margin-left_10">
  186. <el-checkbox @change="changeRefresh" :checked="refresh">
  187. <span>编辑</span>
  188. </el-checkbox>
  189. </div> -->
  190. </div>
  191. <div>
  192. <el-pagination background layout="total, sizes, prev, pager, next, jumper"
  193. :current-page.sync="queryParams.current" :page-sizes="sizeArr" :page-size.sync="queryParams.size"
  194. @current-change="handleCurrentChange" @size-change="changeSize" :total="total">
  195. </el-pagination>
  196. </div>
  197. </el-footer>
  198. </el-container>
  199. </el-container>
  200. <Field-Drawer ref="FieldDrawer"></Field-Drawer>
  201. <field ref="field" type="patent" :projectId="projectId" @getFieldList="getFieldList"></field>
  202. <!-- 报告文档 -->
  203. <reportFileDrawer ref="reportFileDrawer"></reportFileDrawer>
  204. <!-- 创建FTO报告 -->
  205. <addAndEditReport ref="addAndEditReport" @addPatentToReport="addPatentToReport"></addAndEditReport>
  206. <!-- 批量那个标引 -->
  207. <PatentBatchIndexVue ref="PatentBatchIndexVue" @submit="submitIndex(true)" :projectId="projectId"></PatentBatchIndexVue>
  208. <!-- 单个栏位标引 -->
  209. <patent-index-setting @submit="submitIndex(false)" :projectId="projectId" ref="patentIndexSetting" />
  210. <!-- 合并发明人/合并权利人、申请人 -->
  211. <patentMergeDrawer ref="patentMergeDrawer" :projectId="projectId" @mergeClose="mergeClose"></patentMergeDrawer>
  212. </div>
  213. </template>
  214. <script>
  215. import { downLoad2, getTreeDataList, getTreeLastChildren, getPatentCountry } from "@/utils"
  216. import { fastSelectPatent } from './components/mixins/fastSelectPatent'
  217. import FieldDrawer from '@/views/components/drawer/Field.vue'
  218. import PatentAbstractListView from './components/views/Abstract'
  219. import PatentTableListView from './components/views/Table.vue'
  220. import PatentPictureListView from './components/views/Picture'
  221. // import PatentPDFListView from './components/views/PDF.vue'
  222. import field from '@/views/components/dialog/fields.vue';
  223. import customFields from '@/views/report/components/patentList/components/customFields/index.vue';
  224. import searchPatent from '@/views/report/components/patentList/components/searchPatent.vue';
  225. import reportFileDrawer from '@/views/report/components/drawer/reportFileDrawer.vue'
  226. import addAndEditReport from '@/views/report/components/dialog/addAndEditReport.vue'
  227. import PatentBatchIndexVue from './components/dialog/PatentBatchIndex.vue'
  228. import patentMergeDrawer from './components/drawer/merge.vue'
  229. import PatentIndexSetting from "./components/dialog/PatentIndexSetting"
  230. import PatentKeywordsHighlight from '../components/PatentKeywordsHighlight.vue'
  231. export default {
  232. mixins: [fastSelectPatent],
  233. components: {
  234. FieldDrawer,
  235. PatentAbstractListView,
  236. PatentTableListView,
  237. PatentPictureListView,
  238. field,
  239. customFields,
  240. searchPatent,
  241. reportFileDrawer,
  242. addAndEditReport,
  243. PatentBatchIndexVue,
  244. patentMergeDrawer,
  245. PatentIndexSetting,
  246. PatentKeywordsHighlight
  247. },
  248. props: {},
  249. data() {
  250. return {
  251. //是否隐藏左侧
  252. showLeft: true,
  253. //检索字段
  254. searchFiled: [],
  255. // //检索条件
  256. // searchOption: {
  257. // name: localStorage.searchContent,
  258. // },
  259. //视图方式
  260. viewList: [
  261. {
  262. value: 'patent-table-list-view',
  263. title: '表格视图',
  264. btn: 'el-icon-tickets',
  265. },
  266. {
  267. value: 'patent-abstract-list-view',
  268. title: '摘要视图',
  269. btn: 'el-icon-news',
  270. },
  271. {
  272. value: 'patent-picture-list-view',
  273. title: '图片视图',
  274. btn: 'el-icon-picture-outline',
  275. },
  276. // {
  277. // value: 'PatentPDFListView',
  278. // title: 'PDF视图',
  279. // btn: 'iconfont icon-pdf',
  280. // }
  281. ],
  282. //选择的视图
  283. viewSelected: "patent-abstract-list-view",
  284. //显示栏位
  285. customList: [],
  286. //同族
  287. familyObj: {
  288. '0': '不区分同族',
  289. // 'simpleFamilyId': '简单同族',
  290. 'inpadocFamilyId': '同族',
  291. // 'patsnapFamilyId': '扩展同族',
  292. },
  293. //页大小
  294. sizeArr: [10, 20, 30, 40, 50, 100],
  295. //排序
  296. sort: [],
  297. //加载
  298. loading: false,
  299. // 统计勾选的值(专利著录(专利本身))
  300. searchPatentCheck: [],
  301. // 存放专利本身检索条件
  302. searchStr: '',
  303. // 存放自定义栏位的检索条件
  304. customFields: [],
  305. };
  306. },
  307. watch: {},
  308. computed: {
  309. // 专题库id
  310. projectId() {
  311. return this.$route.query.id
  312. },
  313. projectName() {
  314. return this.$route.query.projectName
  315. },
  316. toProjectId(){
  317. return this.$route.query.toProjectId
  318. },
  319. toProjectName(){
  320. return this.$route.query.toProjectName
  321. },
  322. },
  323. created() { },
  324. async mounted() {
  325. this.customList = await this.$commonJS.getCustomField('patent', { projectId: this.projectId, taskId: this.taskId })
  326. await this.getColumn()
  327. // 获取专利信息
  328. this.getList()
  329. },
  330. methods: {
  331. // 处理后的条件
  332. handleSearchValue({ searchStr, customFields }) {
  333. this.searchStr = searchStr
  334. this.customFields = customFields
  335. this.queryParams.current = 1
  336. this.handleCancelSelectNumber()
  337. this.getList()
  338. this.$nextTick(()=>{
  339. this.$refs.customFields.close()
  340. })
  341. },
  342. // 统计组件传的值
  343. handleCustomFields(val) {
  344. this.searchPatentCheck = []
  345. val.forEach(item => {
  346. if (item.check && item.check.length > 0) {
  347. if (item.filedKind == -1) {
  348. this.searchPatentCheck.push(item)
  349. } else {
  350. var checkName = []
  351. if (item.type == 'Array' || item.type == 'tree' || item.type == 'DateTime') {
  352. if(item.type == 'tree'){
  353. checkName = item.checkData.map(item=>item.name)
  354. }else{
  355. checkName = item.options.filter(item2 => item.check.includes(item2.id || item2.name)).map(item3 => item3.name);
  356. }
  357. }
  358. var obj = {
  359. value: item.value,
  360. name: item.name,
  361. filedKind: item.filedKind,
  362. check: item.check,
  363. checkData:item.checkData,
  364. checkName: checkName,//自定义栏位多选
  365. type: item.type,
  366. // ifHaveChild: this.ifHaveChild
  367. ifHaveChild: item.ifHaveChild
  368. }
  369. // return
  370. this.searchPatentCheck.push(obj)
  371. }
  372. }
  373. })
  374. this.$nextTick(() => {
  375. this.$refs.searchPatent.search2()
  376. })
  377. },
  378. // 点击专利号进行跳转
  379. handleClick(row, location) {
  380. var search = {
  381. searchOption: {
  382. searchQuery: this.searchStr || '',
  383. customFields: this.customFields,
  384. groupField:this.queryParams.groupField,
  385. orderDTOList: this.sort,
  386. moreConditions:true
  387. },
  388. location: location,
  389. }
  390. this.$s.setSession('search', search)
  391. this.$router.push(
  392. {
  393. path: '/patentDetails/' + row.patentNo,
  394. query: {
  395. projectId: this.projectId,
  396. projectType:'1',//判断是不是从专题库进入专利详情1为专题库2为报告(报告未传2)
  397. projectName:this.projectName
  398. }
  399. }
  400. )
  401. },
  402. //获取table栏位及分组字段、检索字段
  403. //获取检索字段
  404. async getColumn() {
  405. // let params = ['patent']//原获取检索字段
  406. // await this.$api.getParamsCommon(params).then(res => {
  407. // if (res.code == 200) {
  408. // let conditionDTOList = JSON.parse(JSON.stringify(res.data[0].conditionDTOList))
  409. // // 搜索字段
  410. // this.searchFiled = this.$commonJS.getField(conditionDTOList, (u) => u.ifSearch == true, {
  411. // label: 'name',
  412. // value: 'value',
  413. // type: 'type',
  414. // })
  415. // }
  416. // })
  417. let params = [{
  418. tableName: 'patent',
  419. projectId: this.projectId,
  420. }]
  421. await this.$api.getQueryFields(params).then(res => {
  422. if (res.code == 200) {
  423. let conditionDTOList = JSON.parse(JSON.stringify(res.data.data[0].conditionDTOList))
  424. let field = conditionDTOList.filter(item => {
  425. return item.group == 'nos'
  426. })
  427. let custom = conditionDTOList.filter(item => {
  428. return item.group == 'customField'
  429. })
  430. let customField = custom.filter(item => {
  431. return item.type != 'tree' && item.type != 'Array'
  432. })
  433. let arr = field.concat(customField)
  434. // 搜索字段
  435. this.searchFiled = this.$commonJS.getField(arr, (u) => u.ifSearch == true, {
  436. label: 'name',
  437. value: 'field',
  438. type: 'type',
  439. group: 'group',
  440. fieldType: 'fieldType',
  441. groupBy: 'groupBy',
  442. children:'children'
  443. })
  444. }
  445. })
  446. },
  447. //检索
  448. // search(val) {
  449. // let params = {}
  450. // val.forEach(item => {
  451. // if (item.type == 3) {
  452. // params[item.value] = item.searchValue.map(itemValue => {
  453. // return itemValue.value
  454. // })
  455. // } else {
  456. // params[item.value] = item.searchValue.label
  457. // }
  458. // })
  459. // // 返回字符串
  460. // this.searchOption = params
  461. // // 调用查询接口
  462. // this.queryParams.current = 1
  463. // this.getList()
  464. // },
  465. //切换视图
  466. async handleChangeView(item) {
  467. this.viewSelected = item.value
  468. this.queryParams.current = 1
  469. // if (this.viewSelected == 'PatentPDFListView') {
  470. // return false
  471. // }
  472. if (this.viewSelected === 'patent-picture-list-view') {
  473. this.$set(this.queryParams, 'size', 20)
  474. } else {
  475. this.queryParams.size = 10
  476. }
  477. this.getList()
  478. },
  479. //查询专利自定义字段对应的值
  480. getPatentFields(){
  481. var arr = this.customList.filter(item=>{
  482. return item.ifPersonal && !item.ifHidden
  483. })
  484. if(arr.length == 0){
  485. return false
  486. }
  487. if(this.tableData.length == 0){
  488. return false
  489. }
  490. var patent = this.tableData[0]
  491. var customFields = patent.customFields
  492. if(customFields){
  493. for(var i = 0;i<customFields.length;i++){
  494. var index = arr.find(item=>{
  495. return item.value == customFields[i].value
  496. })
  497. if(index != -1){
  498. arr.splice(index,1)
  499. }
  500. }
  501. }
  502. var patentNos = this.tableData.map(item=>{
  503. return item.patentNo
  504. })
  505. var params = {
  506. projectId:this.projectId,
  507. patentNos:patentNos,
  508. innerFields:arr.map(item=>{
  509. return {
  510. fieldType:item.type,
  511. fieldId:item.value
  512. }
  513. })
  514. }
  515. this.$api.getPatentFields(params).then(response=>{
  516. if(response.code == 200){
  517. var data = response.data.data
  518. for(var i = 0;i<data.length;i++){
  519. var index = patentNos.findIndex(item=>{
  520. return item == data[i].patentNo
  521. })
  522. if(index!=-1){
  523. this.$set(this.tableData[index],'customFields',data[i].innerClassFields)
  524. }
  525. }
  526. }
  527. })
  528. },
  529. //获取专利信息
  530. getList(size) {
  531. if (size) {
  532. this.queryParams.size = size
  533. }
  534. let params = {
  535. ...this.queryParams,//分页信息及区分同族类型
  536. projectId: this.projectId,
  537. searchQuery: this.searchStr || '',//检索条件
  538. customFields: this.customFields,
  539. orderDTOList: this.sort,//排序信息
  540. }
  541. this.loading = true
  542. // this.$store.commit("SET_PATENT_PARAMS", params);
  543. this.$store.commit("SET_PATENT_RECORDS", []);
  544. this.$api.QueryPatent(params).then(res => {
  545. if (res.code == 200) {
  546. this.tableData = res.data.data
  547. this.total = res.data.total
  548. this.$set(this.queryParams, 'startNumber', this.endNumber > 0 ? this.startNumber : 1)
  549. this.$set(this.queryParams, 'endNumber', this.endNumber > 0 ? this.endNumber : this.total)
  550. // this.$store.commit("SET_PATENT_PARAMS", params);
  551. this.$store.commit("SET_PATENT_RECORDS", res.data.data);
  552. if (this.quickSelect) {
  553. this.commonSwitch()
  554. }
  555. this.isRefresh()
  556. this.getPatentFields()
  557. this.loading = false
  558. }
  559. }).catch(error => {
  560. this.tableData = []
  561. this.total = 0
  562. this.loading = false
  563. })
  564. },
  565. //排序
  566. handleSort({ column, prop, order }) {
  567. //如需要多个字段排序,则不需要清空
  568. var params = {
  569. sort: this.sort,
  570. column,
  571. prop,
  572. order,
  573. }
  574. this.sort = this.$commonJS.getSortData(params)
  575. this.queryParams.current = 1
  576. this.getList()
  577. },
  578. //分页
  579. handleCurrentChange(val) {
  580. this.queryParams.current = val;
  581. this.getList();
  582. },
  583. //切换页大小
  584. changeSize(val){
  585. this.queryParams.size = val
  586. this.queryParams.current = 1
  587. this.getList()
  588. },
  589. //自定义栏位管理
  590. async handleField() {
  591. if(!(await this.$permission.projectPermission(this.projectId))){
  592. this.$showPermissionDialog()
  593. return false
  594. }
  595. this.$refs.FieldDrawer.open(this.projectId)
  596. },
  597. //获取显示栏位
  598. getFieldList(data) {
  599. this.customList = []
  600. this.$nextTick(()=>{
  601. this.customList = data
  602. this.getPatentFields()
  603. })
  604. },
  605. //显示栏位管理
  606. async handleFieldManage() {
  607. this.$refs.field.open(this.customList)
  608. },
  609. //报告文档
  610. handleFile() {
  611. this.$refs.reportFileDrawer.open(this.projectId)
  612. },
  613. //创建FTO报告
  614. handleAnalysesFto() {
  615. if(!this.$permission.FunPermissions('xiaoshi/report/FTO')){
  616. this.$showPermissionDialog()
  617. return false
  618. }
  619. var form = {
  620. reportType: 3,
  621. signPatentNo: '',
  622. matterId: [],
  623. scenarioId: [],
  624. assoReportId: this.projectId,
  625. }
  626. var havePatent = this.selectedTotal>0
  627. this.$refs.addAndEditReport.open(form,havePatent)
  628. },
  629. //添加专利到报告中
  630. addPatentToReport(reportId){
  631. if(!reportId){
  632. return
  633. }
  634. var params = {
  635. stringRequest:{
  636. projectId: this.projectId,
  637. searchQuery: this.searchStr,
  638. customFields: this.customFields,
  639. orderDTOList:this.sort,
  640. groupField:this.queryParams.groupField
  641. },
  642. fromProjectId:this.projectId, //来源专题库项目id
  643. startNumber:this.startNumber, //开始位置
  644. endNumber:this.endNumber,//结束位置
  645. toProjectId:reportId, //目标报告项目id
  646. isAdd:this.queryParams.isAdd, //去除专利号
  647. isDelete:this.queryParams.isDelete, //附加专利号
  648. }
  649. var message = this.$message({
  650. type:'warning',
  651. message: '正在将专利导入报告中...',
  652. duration: 0 // 设置为0表示不自动关闭
  653. })
  654. this.$api.addProjectPatentToReport(params).then(res=>{
  655. if(res.code == 200){
  656. message.close()
  657. this.$message(
  658. {
  659. type:'success',
  660. message:'导入成功'
  661. }
  662. )
  663. }
  664. }).catch(error=>{
  665. message.close()
  666. this.$message(
  667. {
  668. type:'error',
  669. message:'导入失败'
  670. }
  671. )
  672. })
  673. },
  674. //切换同族
  675. onChangeFamily(key) {
  676. this.queryParams.current = 1
  677. this.queryParams.groupField = key
  678. this.handleCancelSelectNumber()
  679. this.getList()
  680. this.$nextTick(()=>{
  681. this.$refs.customFields.refreshOptions(1)
  682. })
  683. },
  684. //价值曲线
  685. async checkPatentWorth(){
  686. if(!(await this.$permission.projectPermission(this.projectId))){
  687. this.$showPermissionDialog()
  688. return false
  689. }
  690. let obj = {
  691. isAdd: this.queryParams.isAdd,
  692. isDelete: this.queryParams.isDelete,
  693. startNumber: this.startNumber,
  694. endNumber: this.endNumber,
  695. searchQuery: this.searchStr,
  696. customFields: this.customFields,
  697. groupField:this.queryParams.groupField,
  698. orderDTOList:this.sort,
  699. projectId: this.projectId,
  700. }
  701. let router = this.$router.resolve({
  702. path: '/patentWorth',
  703. query: {
  704. searchData:JSON.stringify(obj)
  705. }
  706. })
  707. window.open(router.href, '_blank')
  708. },
  709. //导出专利
  710. async handleExport(val) {
  711. if (val) {
  712. if ( this.endNumber < 1 && this.queryParams.isAdd.length == 0) {
  713. this.$message.error('请先选择专利')
  714. return false
  715. }
  716. }
  717. let obj = {
  718. isAdd: this.queryParams.isAdd,
  719. isDelete: this.queryParams.isDelete,
  720. startNumber: this.startNumber,
  721. endNumber: this.endNumber,
  722. searchQuery: this.searchStr,
  723. customFields: this.customFields,
  724. groupField:this.queryParams.groupField,
  725. orderDTOList:this.sort,
  726. }
  727. if (!val) {
  728. // 如果是导出全部,endNumber是当前的全部专利
  729. obj.endNumber=this.total
  730. }
  731. let router = this.$router.resolve({
  732. path: '/exportPatent',
  733. query: {
  734. projectId: this.projectId,
  735. condition: JSON.stringify(obj)
  736. }
  737. })
  738. window.open(router.href, '_blank')
  739. },
  740. //PDF首页导出
  741. exportPDF(sign) {
  742. if (sign) {
  743. if ( this.endNumber < 1 && this.queryParams.isAdd.length == 0) {
  744. this.$message.error('请先选择专利')
  745. return false
  746. }
  747. }
  748. if(sign){
  749. var params = {
  750. projectId: this.projectId,
  751. searchQuery: this.searchStr || '',//检索条件
  752. customFields: this.customFields || [],//自定义字段的检索
  753. groupField:this.queryParams.groupField,
  754. isAdd: this.queryParams.isAdd,
  755. isDelete: this.queryParams.isDelete,
  756. startNumber: this.startNumber,
  757. endNumber: this.endNumber,
  758. orderDTOList:this.sort,
  759. }
  760. }else{
  761. var params = {
  762. projectId: this.projectId,
  763. searchQuery: this.searchStr || '',//检索条件
  764. customFields: this.customFields || [],//自定义字段的检索
  765. groupField:this.queryParams.groupField,
  766. isAdd: [],
  767. isDelete: [],
  768. startNumber: 1,
  769. endNumber: this.total,//默认是当前全部
  770. orderDTOList:this.sort,
  771. }
  772. }
  773. this.$api.exportPDFFirstPage(params).then(res => {
  774. if (res.code == 200) {
  775. const h = this.$createElement;
  776. this.$msgbox({
  777. title: '提示',
  778. message: h('p', null, [
  779. h('span', null, '任务正在导入,查看任务进度请前往 '),
  780. h('span', {
  781. style: 'color: #ff7d38;cursor: pointer;',
  782. on: {
  783. click: () => {//
  784. let router = this.$router.resolve({
  785. path: '/taskList',
  786. query: {
  787. importToId: this.projectId,
  788. }
  789. })
  790. window.open(router.href, '_blank')
  791. this.$msgbox.close(false)
  792. }
  793. }
  794. }, '立即前往',)
  795. ]),
  796. type: 'warning',
  797. showConfirmButton: false,
  798. }).then(action => {
  799. });
  800. }
  801. })
  802. },
  803. //图表分析
  804. async handleAnalyses() {
  805. var params = {
  806. searchQuery: this.searchStr || '',//检索条件
  807. customFields: this.customFields || [],
  808. groupField:this.queryParams.groupField,
  809. orderDTOList: this.sort,//排序信息
  810. projectId:this.projectId
  811. }
  812. const router = this.$router.resolve({
  813. path: '/customChart',
  814. query: {
  815. projectId: this.projectId,
  816. search:JSON.stringify(params),
  817. patentNum:this.total
  818. }
  819. })
  820. window.open(router.href, '_blank');
  821. },
  822. // 跳转分配任务页面
  823. async handleAllocation() {
  824. if(!(await this.$permission.projectPermission(this.projectId))){
  825. this.$showPermissionDialog()
  826. return false
  827. }
  828. this.$router.push(
  829. {
  830. path: '/allocationTask',
  831. query: {
  832. projectId: this.projectId,
  833. searchOption: this.searchStr,//输入框检索条件
  834. groupField:this.queryParams.groupField,
  835. customFields: JSON.stringify(this.customFields),//右侧勾选自定义栏位的条件
  836. projectType:1
  837. }
  838. }
  839. )
  840. },
  841. //任务清单
  842. async taskList(){
  843. if(!(await this.$permission.projectPermission(this.projectId))){
  844. this.$showPermissionDialog()
  845. return false
  846. }
  847. this.$router.push(
  848. {
  849. path:'/myTask',
  850. query:{
  851. projectId:this.projectId
  852. }
  853. }
  854. )
  855. },
  856. //导入导出历史
  857. async importAndExportHistory(){
  858. if(!(await this.$permission.projectPermission(this.projectId))){
  859. this.$showPermissionDialog()
  860. return false
  861. }
  862. this.$router.push({
  863. path: "/taskList",
  864. query:{
  865. importToId:this.projectId
  866. }
  867. });
  868. },
  869. //专利导入
  870. async patentImport(type){
  871. if(!(await this.$permission.projectPermission(this.projectId))){
  872. this.$showPermissionDialog()
  873. return false
  874. }
  875. var form = {
  876. importToId:this.projectId,
  877. importToType:0,
  878. type:type,
  879. }
  880. this.$commonJS.toImportParent(form,type)
  881. },
  882. //合并发明人//合并申请人、权利人
  883. async handleMerge(type) {
  884. if(!(await this.$permission.projectPermission(this.projectId))){
  885. this.$showPermissionDialog()
  886. return false
  887. }
  888. let obj = {
  889. projectId: this.projectId,
  890. mergeType: type
  891. }
  892. let title = type == 2?'合并发明人':'合并申请人/权利人'
  893. this.$refs.patentMergeDrawer.open(obj,title)
  894. },
  895. // 合并发明人、申请人、权利人后子组件发送的消息
  896. mergeClose() {
  897. this.getList()
  898. this.$refs.customFields.refreshOptions(1)
  899. },
  900. //自定义栏位以及标签设置值
  901. async handleIndexSetting(patent, field) {
  902. if(!(await this.$permission.projectPermission(this.projectId))){
  903. // this.$showPermissionDialog()
  904. return false
  905. }
  906. let obj = {
  907. isAdd: [patent.patentNo],
  908. isDelete: [],
  909. startNumber: 1,
  910. endNumber: 0,
  911. searchQuery: this.searchStr,
  912. customFields: this.customFields,
  913. groupField:this.queryParams.groupField,
  914. orderDTOList:this.sort,
  915. }
  916. if (field) {
  917. this.$refs.patentIndexSetting.open(obj,patent, field)
  918. }
  919. },
  920. submitIndex(value){
  921. if(value){
  922. this.handleCancelSelectNumber()
  923. }
  924. this.getList()
  925. this.$refs.customFields.refreshOptions(1)
  926. },
  927. //下载PDF
  928. async handleDownload(patent) {
  929. const { data } = await this.$api.getPatentInstructionList({ current: 1, size: 9999, patentNo: patent.patentNo })
  930. if (data.records.length !== 0) {
  931. downLoad2(data.records[0].url)
  932. } else {
  933. this.$alert('专利暂未上传说明书文档', '请求错误', {
  934. confirmButtonText: '确定',
  935. type: 'error',
  936. callback: action => { }
  937. });
  938. }
  939. },
  940. //切换已读未读
  941. handleChangeRead(ids, status) {
  942. let params = {
  943. patentIds: ids,
  944. projectId: this.projectId,
  945. status: status,
  946. folder: this.queryParams.folder
  947. }
  948. this.fastEditLoading = true
  949. this.$api.updatePatentReadStatus(params).then(response => {
  950. this.$refs.patentQueryFilter.getPatentReadTotal()
  951. this.fastEditLoading = false
  952. this.getList()
  953. }).catch(error => {
  954. this.fastEditLoading = false
  955. })
  956. },
  957. //自定义栏位以及标签设置值
  958. // handleIndexSetting(patent, field) {
  959. // if (field) {
  960. // this.$refs.patentIndexSetting.open(this.queryParams.projectId, patent, field)
  961. // }
  962. // },
  963. //取消编辑
  964. // changeRefresh() {
  965. // this.patentNoList = []
  966. // // this.refresh = !this.refresh
  967. // },
  968. },
  969. };
  970. </script>
  971. <style lang="scss" scoped>
  972. .patent-fast-edit-popover {
  973. padding: 0 !important;
  974. .btn {
  975. color: #000;
  976. line-height: 30px;
  977. border-radius: 5px;
  978. padding-left: 10px;
  979. text-align: left;
  980. font-size: 14px;
  981. cursor: pointer;
  982. &:hover {
  983. background: #adadad;
  984. color: #fff;
  985. }
  986. }
  987. .disabled {
  988. cursor: not-allowed !important;
  989. }
  990. .bottom {
  991. text-align: right;
  992. color: #1e9fff;
  993. line-height: 40px;
  994. padding-left: 10px;
  995. font-size: 18px;
  996. }
  997. .el-divider--horizontal {
  998. margin: 10px 0 !important;
  999. }
  1000. .select-number {
  1001. .el-input {
  1002. width: 70px;
  1003. }
  1004. span {
  1005. padding: 0 3px;
  1006. }
  1007. }
  1008. }
  1009. </style>