searchResult.vue 32 KB

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