searchResult.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961
  1. <template>
  2. <div style="background: white; height: 100%">
  3. <el-container style="padding: 0 20px">
  4. <el-header class="workspace-content-container-header" style="display: flex; justify-content: space-between">
  5. <div>
  6. <el-button-group class="margin-left_10">
  7. <el-tooltip v-for="item in viewList" :key="item.value" class="item" effect="dark" :content="item.title"
  8. placement="top">
  9. <el-button @click="handleChangeView(item)" size="small" :type="viewSelected === item.value ? 'primary' : ''"
  10. :icon="item.btn"></el-button>
  11. </el-tooltip>
  12. </el-button-group>
  13. </div>
  14. <!-- <div style="max-width:calc(100% - 620px)">
  15. <p><span>条件:</span>{{ searchData.searchCondition }}</p>
  16. </div> -->
  17. <div style="max-width: 850px;margin-top: 0px;display: flex;justify-content: center;align-items: center;" v-if="condition.component != 'patentNoSearch'">
  18. <search :field="field" :searchResult="true" :searchValue="false" :countryList="queryParams.countryList"
  19. @search="search"></search>
  20. <p><el-link style="width: 50px;color: #409EFF;" @click="searches">检索式</el-link></p>
  21. </div>
  22. <div>
  23. <el-button type="primary" size="small" v-if="noveltySearch" @click="reporting">生成报告</el-button>
  24. <el-button v-if="outside || projectId" type="primary" size="small" @click="importToProject">{{condition.isUpdateCriteria?'保存定期更新条件':'导入专利'}}{{ (!outside && condition.importToType == 3)?'到查新检索报告':'' }}</el-button>
  25. <el-button size="small" type="warning" @click="handleFieldManage">显示栏位管理</el-button>
  26. </div>
  27. </el-header>
  28. <el-main id="patent-list-container" v-loading="loading">
  29. <div class="height_100">
  30. <component ref="patentViewList" :is="viewSelected" :semanteme="semanteme" :outside="outside" :retrieveRecordId="retrieveRecordId" :noveltySearch="noveltySearch" :column="columnList" :tableData="tableData" @clickPatentNo="handleClick" :canSort="condition.component != 'patentNoSearch'?true:false"
  31. @select-change="handleSelect" :selected.sync="queryParams.selected" :queryParams="queryParams" :patentNoList.sync="patentNoList" :refresh='true'
  32. :view-field="patentViewField" @on-sort="handleSort" @addSelect="getChoosePatentNo" :projectId="projectId" :contrastFileList="saveRemarkList" @saveRemark="saveRemark"></component>
  33. </div>
  34. </el-main>
  35. <el-footer class="workspace-content-patent-page foot-total">
  36. <div>
  37. <span v-if="selectedTotal > 0">
  38. 已勾选 <b>{{ selectedTotal }}</b> 条
  39. </span>
  40. <el-popover placement="bottom" title="" width="220" trigger="click">
  41. <el-main class="patent-fast-edit-popover" v-loading="selectNumberLoading">
  42. <div class="btn" @click="handleCancelSelectNumber">取消选择</div>
  43. <div class="btn" @click="handleSelectNumber(0)">本页选择</div>
  44. <!-- <div class="btn" @click="handleSelectNumber(1)">全部选择</div> -->
  45. <!-- <el-divider></el-divider>
  46. <div class="select-number">
  47. <span>从</span>
  48. <el-input size="mini" v-model="queryParams.startNumber" @change="change1"></el-input>
  49. <span>到</span>
  50. <el-input size="mini" v-model="queryParams.endNumber" @change="change2"></el-input>
  51. <el-button type="text" size="" @click="handleSelectNumber(2)">确定</el-button>
  52. </div> -->
  53. </el-main>
  54. <el-button type="info" size="small" class="margin-left_10" slot="reference"> 选择专利<i
  55. class="el-icon-arrow-down el-icon--right"></i></el-button>
  56. </el-popover>
  57. </div>
  58. <div class="foot-total">
  59. <span class="total">共{{ total }}条</span>
  60. <el-pagination background layout="total, sizes, prev, pager, next, jumper"
  61. :current-page.sync="queryParams.current" :page-size.sync="queryParams.size" :page-sizes="pageSizes"
  62. :page-count="getPageCount()" @current-change="handleCurrentChange" @size-change="changeSize">
  63. </el-pagination>
  64. </div>
  65. </el-footer>
  66. </el-container>
  67. <field ref="field" type="patent" :projectId="0" @getFieldList="getFieldList"></field>
  68. <!-- <projectListDialog ref="projectListDialog" :importData="searchData"></projectListDialog> -->
  69. <projectListDialog ref="projectListDialog" :importData="condition"></projectListDialog>
  70. <el-dialog custom-class="checkCondition" title="查看/编辑检索式" :visible.sync="visible" width="500px"
  71. :before-close="() => { visible = false }" :close-on-click-modal="false" append-to-body>
  72. <div>
  73. <el-input type="textarea" readonly :rows="4" v-model="condition.searchCondition"></el-input>
  74. </div>
  75. <span slot="footer" class="dialog-footer footer2">
  76. <div>
  77. <el-button @click="editSearchCondition">编 辑</el-button>
  78. </div>
  79. <div>
  80. <el-button @click="visible = false">取 消</el-button>
  81. <el-button type="primary" @click="searchFinish">检 索</el-button>
  82. <el-button type="primary" v-if="condition.reportType==1||condition.reportType == 2||condition.reportType == 3" @click="saveSearchCondition">保存检索式</el-button>
  83. </div>
  84. </span>
  85. </el-dialog>
  86. <addAndEditSearchRecords ref="addAndEditSearchRecords" :projectId="condition.importToId"></addAndEditSearchRecords>
  87. <inventionPointDialog v-if="noveltySearch" :projectId="projectId" :retrieveRecordId="retrieveRecordId" :contrastFileList="saveRemarkList" @updateInventionPoint="getPatentSimilarMess"></inventionPointDialog>
  88. <reportTemplateDialog ref="reportTemplateDialog"></reportTemplateDialog>
  89. </div>
  90. </template>
  91. <script>
  92. import { mapGetters } from 'vuex'
  93. import moment from 'moment';
  94. import PatentTableListView from "@/views/project/patentCollection/components/views/Table.vue";
  95. import PatentAbstractListView from "@/views/project/patentCollection/components/views/Abstract";
  96. import PatentPictureListView from "@/views/project/patentCollection/components/views/Picture";
  97. import field from '@/views/components/dialog/fields.vue';
  98. import projectListDialog from "./components/projectListDialog.vue";
  99. import search from '@/utils/model/search/search.vue'
  100. import addAndEditSearchRecords from '@/views/report/analysisAndOpinion/components/searchRecords/dialog/addAndEditSearchRecords.vue';
  101. import reportTemplateDialog from '@/views/noveltySearch/components/dialog/reportTemplate/reportTemplateDialog.vue';
  102. export default {
  103. components: {
  104. PatentTableListView,
  105. PatentAbstractListView,
  106. PatentPictureListView,
  107. field,
  108. projectListDialog,
  109. search,
  110. addAndEditSearchRecords,
  111. reportTemplateDialog
  112. },
  113. props: {
  114. searchData: {},
  115. noveltySearch:{},
  116. retrieveRecordId:{},
  117. projectId:{},
  118. outside:{
  119. type:Boolean,
  120. default:true
  121. },
  122. innerProjectId:{},
  123. semanteme:''
  124. },
  125. data() {
  126. return {
  127. columnList: [],
  128. pageSizes: [10, 20, 30, 40, 50],
  129. viewSelected: "patent-abstract-list-view",
  130. viewList: [
  131. {
  132. value: "patent-table-list-view",
  133. title: "表格视图",
  134. btn: "el-icon-tickets",
  135. },
  136. {
  137. value: "patent-abstract-list-view",
  138. title: "摘要视图",
  139. btn: "el-icon-news",
  140. },
  141. {
  142. value: "patent-picture-list-view",
  143. title: "图片视图",
  144. btn: "el-icon-picture-outline",
  145. },
  146. ],
  147. patentNoList: [],
  148. queryParams: {
  149. selected: [],
  150. current: 1,
  151. size: 10,
  152. isAdd: [],
  153. isDelete: [],
  154. OrderBy: "AD",
  155. OrderByType: "DESC",
  156. retrieveRecordId: this.retrieveRecordId,
  157. asCompare: this.asCompare
  158. },
  159. patentViewField: [],
  160. tableData: [],
  161. total: 0,
  162. selectNumberLoading: false,
  163. loading: false,
  164. selectedTotal: 0,
  165. startNumber: 1,
  166. endNumber: 0,
  167. quickSelect: false,
  168. quickSelectArr: [],
  169. /**检索式 */
  170. // 公用数据
  171. field: JSON.parse(JSON.stringify(this.$constants.searchField)),
  172. // 打开弹窗
  173. visible: false,
  174. // 检索式及其他信息
  175. condition: this.searchData,
  176. saveRemarkList:[]
  177. };
  178. },
  179. watch: {
  180. retrieveRecordId(){
  181. this.queryParams.retrieveRecordId = this.retrieveRecordId
  182. },
  183. noveltySearch(val){
  184. if(val){
  185. this.queryComparePatent()
  186. }
  187. }
  188. },
  189. computed: {
  190. userinfo(){
  191. return this.$s.getObj('userinfo')
  192. },
  193. },
  194. created() { },
  195. async mounted() {
  196. this.columnList = await this.$commonJS.getCustomField('patent',{ projectId: 0, taskId: null })
  197. if(this.noveltySearch){
  198. this.queryComparePatent()
  199. }
  200. await this.getList();
  201. },
  202. methods: {
  203. //查询对比文件
  204. queryComparePatent(){
  205. var params = {
  206. projectId:this.projectId
  207. }
  208. this.$api.queryComparePatent(params).then(response=>{
  209. if(response.code == 200){
  210. this.saveRemarkList = response.data.data
  211. }
  212. })
  213. },
  214. reporting(){
  215. this.$refs.reportTemplateDialog.open(this.projectId)
  216. },
  217. saveRemark(data){
  218. if(this.noveltySearch){
  219. this.queryComparePatent()
  220. }
  221. },
  222. //保存检索式
  223. saveSearchCondition(){
  224. var form = {
  225. searchCondition:this.condition.searchCondition,
  226. searchBase:'小世系统',
  227. allNum:this.total,
  228. searchPerson:this.userinfo.name,
  229. searchTime:moment().format("YYYY-MM-DD")
  230. }
  231. this.$refs.addAndEditSearchRecords.open(form)
  232. },
  233. handleClick(row, location) {
  234. var params = {
  235. ...this.searchData,
  236. ...this.queryParams,
  237. }
  238. var search = {
  239. searchOption: params,
  240. location: location,
  241. }
  242. if(!this.outside){
  243. search.searchOption = {
  244. searchQuery: this.condition.searchCondition || '',
  245. moreConditions:true
  246. }
  247. if(this.queryParams.OrderBy && this.queryParams.OrderByType){
  248. var orderDTOList = [
  249. {
  250. orderBy:this.queryParams.OrderBy,
  251. orderType:this.queryParams.OrderByType == 'DESC'?1:0
  252. }
  253. ]
  254. search.searchOption.orderDTOList = orderDTOList
  255. }
  256. }
  257. this.$s.setSession('search', search)
  258. this.$s.setSession('import',this.searchData)
  259. this.$router.push(
  260. {
  261. path: '/patentDetails/' + row.patentNo,
  262. query: {
  263. outside:this.outside,
  264. noveltySearch:this.noveltySearch,
  265. projectId:this.projectId,
  266. innerProjectId:this.innerProjectId || 0,
  267. retrieveRecordId:this.queryParams.retrieveRecordId
  268. }
  269. }
  270. )
  271. },
  272. //子组件返回检索式
  273. async search(val) {
  274. if (val.searchStr == '') {
  275. this.$message.error('检索信息不能为空')
  276. return false
  277. }
  278. if (val.isRepeat) {
  279. this.condition.searchCondition = `${this.condition.searchCondition} AND ${val.searchStr}`
  280. } else {
  281. this.condition.searchCondition = val.searchStr
  282. }
  283. if(val.data){
  284. var params = this.$s.getSession('conditionImport')
  285. if(params && params.data && params.data.component != 'AdvancedSearch' && params.data.component != 'patentNoSearch'){
  286. if(val.isRepeat){
  287. if(params.data.data && params.data.data.length>0){
  288. params.data.data.push(val.data[0])
  289. }else{
  290. params.data.data=[val.data[0]]
  291. }
  292. var data = []
  293. params.data.data.forEach(item=>{
  294. if(item.dataType == 3){
  295. if(item.value && item.value.length>0){
  296. data.push(item)
  297. }
  298. }else{
  299. if(item.value){
  300. data.push(item)
  301. }
  302. }
  303. })
  304. params.data.data = data
  305. }else{
  306. params.data.data = val.data
  307. }
  308. params.data.component = 'customSearch'
  309. this.$s.setSession('conditionImport',params)
  310. }else if(params.data.component == 'AdvancedSearch' || params.data.component == 'patentNoSearch'){
  311. params.data.data = this.condition.searchCondition
  312. params.data.component = 'AdvancedSearch'
  313. this.$s.setSession('conditionImport',params)
  314. }
  315. }
  316. await this.searchBth()
  317. },
  318. //编辑检索式,跳转到检索界面
  319. editSearchCondition(){
  320. var params = this.$s.getSession('conditionImport')
  321. if(!params || !params.data){
  322. var data = {
  323. DBType:this.condition.DBType,
  324. component:'AdvancedSearch',
  325. data:this.condition.searchCondition
  326. }
  327. this.$s.setSession('conditionImport',{
  328. data:data,
  329. })
  330. }
  331. this.$router.push({
  332. path: '/conditionImport',
  333. query:{
  334. isEdit:true,
  335. importData:JSON.stringify(this.searchData),
  336. noveltySearch:this.noveltySearch,
  337. projectId:this.projectId,
  338. }
  339. })
  340. },
  341. searchBth() {
  342. if(this.outside){
  343. this.queryParams.retrieveRecordId = null
  344. }
  345. this.queryParams.current = 1
  346. this.getList()
  347. if(this.outside){
  348. this.reLoadQuery()
  349. }
  350. },
  351. // 打开检索式弹窗
  352. searches() {
  353. this.visible = true
  354. },
  355. // 编辑、查看检索式
  356. async searchFinish() {
  357. await this.searchBth()
  358. this.visible = false
  359. },
  360. //导入到专题库
  361. importToProject() {
  362. if(this.outside){
  363. var form = {
  364. // ...this.searchData,
  365. ...this.condition,
  366. orderBy: this.queryParams.OrderBy,
  367. orderByType: this.queryParams.OrderByType,
  368. // startNumber: this.selectedTotal > 0 ? this.startNumber : 1,
  369. // endNumber: this.selectedTotal > 0 ? this.endNumber : this.total,
  370. patentNos: this.queryParams.isAdd,
  371. // isDeletePatentNos: this.queryParams.isDelete,
  372. }
  373. this.$refs.projectListDialog.open(form);
  374. return
  375. }
  376. if(!this.projectId){
  377. return
  378. }
  379. var params = {
  380. stringRequest:{
  381. projectId: this.innerProjectId,
  382. searchQuery: this.condition.searchCondition || '',
  383. orderDTOList:this.sort,
  384. },
  385. startNumber:1, //开始位置
  386. endNumber:(this.queryParams.isAdd && this.queryParams.isAdd.length>0)?0:this.total,//结束位置
  387. fromProjectId:this.innerProjectId, //来源专题库项目id
  388. toProjectId:this.projectId, //目标报告项目id
  389. isAdd:this.queryParams.isAdd, //去除专利号
  390. }
  391. if(this.queryParams.OrderBy && this.queryParams.OrderByType){
  392. var orderDTOList = [
  393. {
  394. orderBy:this.queryParams.OrderBy,
  395. orderType:this.queryParams.OrderByType == 'DESC'?1:0
  396. }
  397. ]
  398. params.stringRequest.orderDTOList = orderDTOList
  399. }
  400. var message = this.$message({
  401. type:'warning',
  402. message: '正在将专利导入报告中...',
  403. duration: 0 // 设置为0表示不自动关闭
  404. })
  405. this.$api.addProjectPatentToReport(params).then(res=>{
  406. if(res.code == 200){
  407. message.close()
  408. this.$message(
  409. {
  410. type:'success',
  411. message:'导入成功'
  412. }
  413. )
  414. }
  415. }).catch(error=>{
  416. message.close()
  417. this.$message(
  418. {
  419. type:'error',
  420. message:'导入失败'
  421. }
  422. )
  423. })
  424. },
  425. //切换页数
  426. async handleCurrentChange(val) {
  427. this.queryParams.current = val;
  428. this.patentNoList = []
  429. await this.getList();
  430. this.$nextTick(() => {
  431. if (this.quickSelect) {
  432. this.commonSwitch()
  433. } else {
  434. if (this.queryParams.isAdd.length > 0) {
  435. this.getHaveChoose([])
  436. }
  437. }
  438. })
  439. },
  440. //切换页大小
  441. async changeSize(val){
  442. this.queryParams.size = val
  443. this.queryParams.current = 1
  444. this.patentNoList = []
  445. await this.getList();
  446. this.$nextTick(() => {
  447. if (this.quickSelect) {
  448. this.commonSwitch()
  449. } else {
  450. if (this.queryParams.isAdd.length > 0) {
  451. this.getHaveChoose([])
  452. }
  453. }
  454. })
  455. },
  456. //获取最大页数
  457. getPageCount() {
  458. if(this.outside){
  459. var a = Math.ceil(Number(this.total) / Number(this.queryParams.size))
  460. return a > 200 ? 200 : a
  461. }else{
  462. return Math.ceil(Number(this.total) / Number(this.queryParams.size))
  463. }
  464. },
  465. //开始条数校验
  466. change1(val) {
  467. if (!isNaN(val)) {
  468. if (!val || val <= 0) {
  469. this.queryParams.startNumber = 1
  470. } else {
  471. if (this.queryParams.startNumber > this.total) {
  472. this.queryParams.startNumber = this.total
  473. }
  474. }
  475. } else {
  476. this.queryParams.startNumber = 1
  477. }
  478. },
  479. //结束条数校验
  480. change2(val) {
  481. if (!isNaN(val)) {
  482. if (!val || val <= 0) {
  483. this.queryParams.endNumber = this.total
  484. } else {
  485. if (this.queryParams.endNumber > this.total) {
  486. this.queryParams.endNumber = this.total
  487. }
  488. }
  489. } else {
  490. this.queryParams.endNumber = this.total
  491. }
  492. },
  493. //查询内部数据库数据
  494. async getInnerProjectPatent(){
  495. let params = {
  496. current: this.queryParams.current, //页码(最多 200 页)
  497. size: this.queryParams.size, //每页返回条数(最多 50 条)
  498. projectId: this.innerProjectId,
  499. searchQuery: this.condition.searchCondition || '',//检索条件
  500. semanteme:this.semanteme
  501. }
  502. if(this.queryParams.OrderBy && this.queryParams.OrderByType){
  503. var orderDTOList = [
  504. {
  505. orderBy:this.queryParams.OrderBy,
  506. orderType:this.queryParams.OrderByType == 'DESC'?1:0
  507. }
  508. ]
  509. params.orderDTOList = orderDTOList
  510. }
  511. this.loading = true;
  512. this.$store.commit("SET_PATENT_RECORDS", []);
  513. await this.$api.QueryPatent(params).then((response) => {
  514. if (response.code == 200) {
  515. this.total = response.data.total;
  516. this.$set(this.queryParams, 'startNumber', this.endNumber > 0 ? this.startNumber : 1)
  517. this.$set(this.queryParams, 'endNumber', this.endNumber > 0 ? this.endNumber : this.total)
  518. let records = response.data.data
  519. if(params.semanteme){
  520. records.forEach(item=>{
  521. if(!item.score){
  522. item.score = 'error'
  523. }else{
  524. var score = (item.score * 100 + '').substring(0, 5)
  525. item.score = Number(score)
  526. }
  527. })
  528. }
  529. this.tableData = records
  530. this.$store.commit("SET_PATENT_RECORDS", records);
  531. this.loading = false;
  532. }
  533. }).catch((error) => {
  534. this.loading = false;
  535. });
  536. },
  537. //查询专利
  538. async getList() {
  539. if(!this.outside){
  540. await this.getInnerProjectPatent()
  541. return
  542. }
  543. let queryParams = JSON.parse(JSON.stringify(this.queryParams));
  544. var params = {
  545. // CurrentQuery: this.searchData.searchCondition, //检索式
  546. // DBType: this.searchData.DBType, //”CN”或”WD”,表示检索中文库或世界库
  547. CurrentQuery: this.condition.searchCondition, //检索式
  548. DBType: this.condition.DBType, //”CN”或”WD”,表示检索中文库或世界库
  549. PageNum: this.queryParams.current, //页码(最多 200 页)
  550. RowCount: this.queryParams.size, //每页返回条数(最多 50 条)
  551. OrderBy: this.queryParams.OrderBy, //排序字段:“AD”,“PD”,“GD”, “ID”(检索引擎自生成字段,排序顺序固定)
  552. OrderByType: this.queryParams.OrderByType, //排序方式:“ASC”,“DESC” 即正序倒序
  553. retrieveRecordId: this.queryParams.retrieveRecordId,
  554. //专利号检索
  555. numberQuery:this.condition.NO,
  556. redisKey:this.condition.redisKey,
  557. };
  558. if(!this.queryParams.retrieveRecordId){
  559. params.projectId = this.projectId
  560. var conditionImport = this.$s.getSession('conditionImport')
  561. params.searchSetting=conditionImport?JSON.stringify(conditionImport):''
  562. }
  563. // console.log(this.$s.getSession('retrieveRecordId'),)
  564. queryParams.params = params;
  565. this.$store.commit("SET_PATENT_PARAMS", queryParams);
  566. this.$store.commit("SET_PATENT_RECORDS", []);
  567. this.loading = true;
  568. this.$commonJS.scrollToTop()
  569. await this.$api.patentSelect(params).then((response) => {
  570. if (response.code == 200) {
  571. this.total = response.data.total;
  572. this.$set(this.queryParams, 'startNumber', this.endNumber > 0 ? this.startNumber : 1)
  573. this.$set(this.queryParams, 'endNumber', this.endNumber > 0 ? this.endNumber : this.total)
  574. let records = response.data.data
  575. this.tableData = records
  576. params.retrieveRecordId = response.data.retrieveRecordId
  577. if(!this.queryParams.retrieveRecordId && response.data.retrieveRecordId && !response.data.redisKey){
  578. this.queryParams.retrieveRecordId = response.data.retrieveRecordId
  579. this.reLoadQuery()
  580. }
  581. this.$store.commit("SET_PATENT_PARAMS", queryParams);
  582. this.$store.commit("SET_PATENT_RECORDS", records);
  583. this.getImageAndStatus()
  584. this.getPatentSimilarMess()
  585. this.loading = false;
  586. if(response.data.redisKey && !this.condition.redisKey){
  587. this.condition.redisKey = response.data.redisKey
  588. this.condition.NO=''
  589. this.reLoadQuery()
  590. }
  591. }
  592. })
  593. .catch((error) => {
  594. this.loading = false;
  595. });
  596. },
  597. //刷新网页参数
  598. reLoadQuery(){
  599. this.$router.replace({
  600. path: '/searchResult',
  601. query: {
  602. data: JSON.stringify(this.condition),
  603. noveltySearch:this.noveltySearch,
  604. projectId:this.projectId,
  605. retrieveRecordId:this.queryParams.retrieveRecordId
  606. }
  607. })
  608. },
  609. //获取摘要附图和法律状态
  610. getImageAndStatus(){
  611. this.tableData.forEach(item=>{
  612. var params = {
  613. appNo: item.rowApplicationNo,
  614. }
  615. this.$api.getPictureGuid(params).then(response => {
  616. if (response.code == 200) {
  617. this.$set(item, 'pictureGuid', response.data)
  618. }
  619. })
  620. this.$api.getLegalStatus(params).then(response => {
  621. if (response.code == 200) {
  622. this.$set(item, 'legalStatus', response.data)
  623. }
  624. })
  625. })
  626. },
  627. //获取专利相似度
  628. getPatentSimilarMess(){
  629. if(this.tableData.length == 0 || !this.noveltySearch){
  630. return
  631. }
  632. this.tableData.forEach(item=>{
  633. let params = {
  634. projectId:this.projectId,
  635. patentScoreDTOList:[]
  636. }
  637. var obj = {
  638. patentNo:item.patentNo,
  639. appNo:item.appNo,
  640. rowApplicationNo:item.rowApplicationNo,
  641. publicNo:item.publicNo,
  642. grantNo:item.grantNo
  643. }
  644. params.patentScoreDTOList.push(obj)
  645. this.$api.getPatentSimilarMess(params).then(response=>{
  646. if(response.code == 200){
  647. var data = response.data.patentScoreDTOList
  648. if(!data){
  649. this.$set(item, 'score', 'error')
  650. return
  651. }
  652. for(var i = 0;i<this.tableData.length;i++){
  653. var item1 = this.tableData[i]
  654. var index = data.findIndex(j=>{
  655. return j.patentNo == item1.patentNo
  656. })
  657. if(index!=-1){
  658. var score = (data[index].score * 100 + '').substring(0, 5)
  659. this.$set(item1, 'score', Number(score))
  660. data.splice(index,1)
  661. }else{
  662. this.$set(item1, 'score', 'error')
  663. }
  664. }
  665. }
  666. }).catch(error=>{
  667. this.$set(item, 'score', 'error')
  668. })
  669. })
  670. return
  671. var params = {
  672. projectId:this.projectId,
  673. patentScoreDTOList:[]
  674. }
  675. this.tableData.forEach(item=>{
  676. var obj = {
  677. patentNo:item.patentNo,
  678. appNo:item.appNo,
  679. rowApplicationNo:item.rowApplicationNo,
  680. publicNo:item.publicNo,
  681. grantNo:item.grantNo
  682. }
  683. params.patentScoreDTOList.push(obj)
  684. })
  685. this.$api.getPatentSimilarMess(params).then(response=>{
  686. if(response.code == 200){
  687. var data = response.data.patentScoreDTOList
  688. for(var i = 0;i<this.tableData.length;i++){
  689. var item = this.tableData[i]
  690. var index = data.findIndex(j=>{
  691. return j.patentNo == item.patentNo
  692. })
  693. if(index!=-1){
  694. this.$set(item, 'score', data[index].score.toFixed(4))
  695. data.splice(index,1)
  696. }
  697. }
  698. }
  699. })
  700. },
  701. handleSelect(data) {
  702. // this.queryParams.selected = data
  703. },
  704. async handleChangeView(item) {
  705. // console.log(item)
  706. if (this.viewSelected == item.value) {
  707. return false
  708. }
  709. if (this.viewSelected != "patent-picture-list-view" && item.value != "patent-picture-list-view") {
  710. this.queryParams.size = 10;
  711. this.viewSelected = item.value;
  712. } else if (this.viewSelected == "patent-picture-list-view" || item.value == "patent-picture-list-view") {
  713. if (item.value === "patent-picture-list-view") {
  714. this.$set(this.queryParams, "size", 20);
  715. } else {
  716. this.queryParams.size = 10;
  717. }
  718. this.viewSelected = item.value;
  719. this.getList();
  720. }
  721. },
  722. async handleFieldManage() {
  723. this.$refs.field.open(this.columnList)
  724. },
  725. //获取自定义栏位
  726. getFieldList(data) {
  727. this.columnList = []
  728. this.$nextTick(()=>{
  729. this.columnList = data
  730. })
  731. },
  732. //快速选择
  733. handleSelectNumber(type) {
  734. switch (type) {
  735. case 0: //本页选择
  736. this.patentNoList = [...new Set(this.patentNoList.concat(this.tableData.map((item) => item.patentNo))),];
  737. this.queryParams.isAdd = [...new Set(this.queryParams.isAdd.concat(this.tableData.map((item) => item.patentNo))),];
  738. break;
  739. case 1: //全部选择
  740. this.startNumber = 1;
  741. this.endNumber = this.total;
  742. this.$set(this.queryParams, 'startNumber', 1)
  743. this.$set(this.queryParams, 'endNumber', this.total)
  744. case 2: //范围选择
  745. this.queryParams.isDelete = [];
  746. this.queryParams.isAdd = [];
  747. this.patentNoList = [];
  748. this.quickSelect = true;
  749. if (type == 2) {
  750. if (!Number(this.queryParams.startNumber) || !Number(this.queryParams.endNumber)) {
  751. this.$set(this.queryParams, 'startNumber', this.endNumber > 0 ? this.startNumber : 1)
  752. this.$set(this.queryParams, 'endNumber', this.endNumber > 0 ? this.endNumber : this.total)
  753. break;
  754. }
  755. this.startNumber = this.queryParams.startNumber;
  756. this.endNumber = this.queryParams.endNumber;
  757. }
  758. this.commonSwitch();
  759. break;
  760. }
  761. this.getSelectedTotal()
  762. },
  763. //每页全部选择或范围选择的专利
  764. commonSwitch() {
  765. var arr = []
  766. if (this.queryParams.size * this.queryParams.current >= this.startNumber) {
  767. if (this.queryParams.size * this.queryParams.current >= this.endNumber) {
  768. if (this.queryParams.size * (this.queryParams.current - 1) + 1 <= this.startNumber) {
  769. var a = this.startNumber - (this.queryParams.size * (this.queryParams.current - 1) + 1);
  770. var b = this.endNumber - (this.queryParams.size * (this.queryParams.current - 1) + 1);
  771. for (var y = a; y <= b; y++) {
  772. arr.push(this.tableData[y].applicationNo)
  773. }
  774. } else {
  775. var a = this.queryParams.size * (this.queryParams.current - 1) + 1 - (this.queryParams.size * (this.queryParams.current - 1) + 1);
  776. var b = this.endNumber - (this.queryParams.size * (this.queryParams.current - 1) + 1);
  777. for (var y = a; y <= b; y++) {
  778. arr.push(this.tableData[y].applicationNo)
  779. }
  780. }
  781. } else {
  782. if (this.queryParams.size * (this.queryParams.current - 1) + 1 <= this.startNumber) {
  783. var a = this.startNumber - (this.queryParams.size * (this.queryParams.current - 1) + 1);
  784. var b = this.queryParams.size * this.queryParams.current - (this.queryParams.size * (this.queryParams.current - 1) + 1);
  785. for (var y = a; y <= b; y++) {
  786. arr.push(this.tableData[y].applicationNo)
  787. }
  788. } else {
  789. var a = this.queryParams.size * (this.queryParams.current - 1) + 1 - (this.queryParams.size * (this.queryParams.current - 1) + 1);
  790. var b = this.queryParams.size * this.queryParams.current - (this.queryParams.size * (this.queryParams.current - 1) + 1);
  791. for (var y = a; y <= b; y++) {
  792. arr.push(this.tableData[y].applicationNo)
  793. }
  794. }
  795. }
  796. }
  797. // this.patentNoList = JSON.parse(JSON.stringify(arr))
  798. this.quickSelectArr = JSON.parse(JSON.stringify(arr))
  799. this.getHaveChoose(arr)
  800. },
  801. //获取已选择的专利
  802. getHaveChoose(arr) {
  803. var arr1 = [...new Set(arr.concat(this.queryParams.isAdd))]
  804. this.patentNoList = arr1.filter((x) => this.queryParams.isDelete.indexOf(x) == -1)
  805. },
  806. //获取已选择的总条数
  807. getSelectedTotal() {
  808. this.selectedTotal = Number(this.endNumber) - Number(this.startNumber) + 1 + Number(this.queryParams.isAdd.length) - Number(this.queryParams.isDelete.length)
  809. },
  810. //获取手动选择的专利
  811. getChoosePatentNo(patentNo) {
  812. if (this.quickSelect) {
  813. var index = this.queryParams.isDelete.findIndex(item => {
  814. return item == patentNo
  815. })
  816. if (index == -1) {
  817. var index2 = this.quickSelectArr.findIndex(item => {
  818. return item == patentNo
  819. })
  820. if (index2 == -1) {
  821. this.setIsAdd(patentNo)
  822. } else {
  823. this.queryParams.isDelete.push(patentNo)
  824. }
  825. } else {
  826. this.queryParams.isDelete.splice(index, 1)
  827. }
  828. } else {
  829. this.setIsAdd(patentNo)
  830. }
  831. this.getSelectedTotal()
  832. },
  833. //是否加入isAdd里面
  834. setIsAdd(patentNo) {
  835. var index = this.queryParams.isAdd.findIndex(item => {
  836. return item == patentNo
  837. })
  838. if (index != -1) {
  839. this.queryParams.isAdd.splice(index, 1)
  840. } else {
  841. this.queryParams.isAdd.push(patentNo)
  842. }
  843. },
  844. //取消选择
  845. handleCancelSelectNumber() {
  846. this.patentNoList = [];
  847. this.queryParams.isAdd = []
  848. this.queryParams.isDelete = []
  849. this.startNumber = 1
  850. this.queryParams.startNumber = 1
  851. this.queryParams.endNumber = this.total
  852. this.endNumber = 0
  853. this.quickSelect = false
  854. this.selectedTotal = 0
  855. // this.getList()
  856. },
  857. //排序
  858. handleSort(data) {
  859. const o = {
  860. publicAccreditDate: "GD",
  861. publicDate: "PD",
  862. applicationDate: "AD",
  863. };
  864. var orderType = {
  865. ascending: "ASC",
  866. descending: "DESC"
  867. }
  868. this.queryParams.OrderBy = o[data.prop] || data.prop;
  869. this.queryParams.OrderByType = orderType[data.order];
  870. this.getList();
  871. },
  872. },
  873. };
  874. </script>
  875. <style lang="scss" scoped>
  876. .footer2{
  877. display: flex;
  878. justify-content: space-between;
  879. align-items: center;
  880. }
  881. .total {
  882. margin-right: 10px;
  883. font-weight: 400;
  884. color: #606266;
  885. display: inline-block;
  886. font-size: 13px;
  887. min-width: 35.5px;
  888. height: 28px;
  889. line-height: 28px;
  890. vertical-align: top;
  891. box-sizing: border-box;
  892. }
  893. .foot-total {
  894. display: flex;
  895. justify-content: space-between;
  896. align-items: center;
  897. }
  898. .patent-fast-edit-popover {
  899. padding: 0 !important;
  900. .btn {
  901. color: #000;
  902. line-height: 30px;
  903. border-radius: 5px;
  904. padding-left: 10px;
  905. text-align: left;
  906. font-size: 14px;
  907. cursor: pointer;
  908. &:hover {
  909. background: #adadad;
  910. color: #fff;
  911. }
  912. }
  913. .disabled {
  914. cursor: not-allowed !important;
  915. }
  916. .bottom {
  917. text-align: right;
  918. color: #1e9fff;
  919. line-height: 40px;
  920. padding-left: 10px;
  921. font-size: 18px;
  922. }
  923. .el-divider--horizontal {
  924. margin: 10px 0 !important;
  925. }
  926. .select-number {
  927. .el-input {
  928. width: 70px;
  929. }
  930. span {
  931. padding: 0 3px;
  932. }
  933. }
  934. }
  935. </style>