patentTable.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <template>
  2. <div>
  3. <div style="display:flex;justify-content: flex-end;padding-bottom:20px">
  4. <!-- <el-button type="info" style="height:32px">
  5. <img src="../../../../../assets/img/filtrationSearch.png" alt="" style="width:20px">筛选
  6. </el-button> -->
  7. <div class="btn1" @click="sift" style="width:80px;height:32px;display:flex;justify-content:space-around;border-radius:5px; cursor: pointer;margin-right: 10px; background-color: #909399;">
  8. <img src="@/assets/img/filtrationSearch.png" alt="" style="width:16px;height:16px;margin-top:9px;margin-left:8px"><p style="margin:0 8px 0 0;line-height:32px;color:white;font-size:14px">筛选 </p>
  9. </div>
  10. <el-button type="primary" size="small" style="margin-right: 20px;" @click="choicePage">本页选择</el-button>
  11. <!-- <el-popover placement="bottom" title="" width="250" trigger="click">
  12. <el-main class="patent-fast-edit-popover">
  13. <div class="btn" @click="handleSelectNumber(0)">本页选择</div>
  14. <div class="btn" @click="handleSelectNumber(1)">全部选择</div>
  15. <el-divider></el-divider>
  16. <div class="select-number">
  17. <span>从</span>
  18. <el-input size="mini" v-model="queryParams.startNumber"></el-input>
  19. <span>到</span>
  20. <el-input size="mini" v-model="queryParams.endNumber"></el-input>
  21. <el-button type="text" size="" @click="handleSelectNumber(2)">确定</el-button>
  22. </div>
  23. </el-main>
  24. <el-button type="info" size="small" class="margin-left_10" slot="reference">
  25. 选择专利<i class="el-icon-arrow-down el-icon--right"></i>
  26. </el-button>
  27. </el-popover>-->
  28. <el-button type="text" size="small" class="margin-left_10" @click="handleCancelSelectNumber">取消选择</el-button>
  29. </div>
  30. <el-table
  31. :data="tableData?tableData:choiceTableData"
  32. border
  33. :row-key="getRowKeys"
  34. v-loading="loading"
  35. style="min-width: 100%; overflow:auto">
  36. <el-table-column width="80" align="center">
  37. <template slot-scope="scope">
  38. <div>
  39. <el-checkbox-group v-model="selected" style="display:inline-block">
  40. <el-checkbox :label="scope.row.patentNo" :disabled="scope.row.disabled" @change="getFunInfo(scope.row.patentNo)">
  41. <span v-if="choiceMark">{{ (scope.$index + 1) + ((choiceQueryParams.current - 1) * choiceQueryParams.size) }}</span>
  42. <span v-else>{{ (scope.$index + 1) + ((queryParams.current - 1) * queryParams.size) }}</span>
  43. </el-checkbox>
  44. </el-checkbox-group>
  45. </div>
  46. </template>
  47. </el-table-column>
  48. <el-table-column
  49. prop="patentNo"
  50. label="专利号"
  51. align="center"
  52. width="200px">
  53. <template slot-scope="scope">
  54. <div>
  55. <el-link type="primary" @click="toPatentDetails(scope.row.patentNo)">{{scope.row.patentNo}}</el-link>
  56. </div>
  57. <!-- <el-checkbox-group v-model="checkList" style="display:inline-block">
  58. <el-checkbox :label="scope.row.patentNo" @change="getFunInfo(scope.row.patentNo)">
  59. {{scope.row.patentNo}}
  60. </el-checkbox>
  61. </el-checkbox-group> -->
  62. </template>
  63. </el-table-column>
  64. <!-- <el-table-column
  65. prop="patentNo"
  66. label="专利号"
  67. align="center"
  68. width="200px">
  69. <template slot-scope="scope">
  70. <el-checkbox-group v-model="selected" style="display:inline-block">
  71. <el-checkbox :label="scope.row.patentNo" :disabled="scope.row.disabled" @change="getFunInfo(scope.row.patentNo)">
  72. {{scope.row.patentNo}}
  73. </el-checkbox>
  74. </el-checkbox-group>
  75. </template>
  76. </el-table-column> -->
  77. <el-table-column
  78. prop="name"
  79. label="专利标题"
  80. align="center"
  81. width="300px">
  82. </el-table-column>
  83. <el-table-column
  84. prop="simpleStatus"
  85. align="center"
  86. label="状态">
  87. </el-table-column>
  88. </el-table>
  89. <div class="pagination" v-if="choiceMark">
  90. <el-pagination :current-page.sync="choiceQueryParams.current" :page-size="choiceQueryParams.size" :total="Number(choiceTotal)" @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
  91. </div>
  92. <el-dialog v-if="choiceMark" title="筛选" :visible.sync="visible" width="600px" :before-close="close" append-to-body>
  93. <div style="height: 180px;">
  94. <el-form ref="choiceForm" :model="choiceForm" label-width="80px" label-position="left">
  95. <el-form-item label="对比结果">
  96. <el-select v-model="choiceForm.compareResult" clearable @change="change" placeholder="请选择对比结果" style="width: 100%;">
  97. <el-option
  98. v-for="item in options"
  99. :key="item.value"
  100. :label="item.label"
  101. :value="item.value">
  102. </el-option>
  103. </el-select>
  104. <!-- <el-input type="textarea" v-model="choiceForm.compareResult" placeholder="请输入查询内容"></el-input> -->
  105. </el-form-item>
  106. <el-form-item label="标题" >
  107. <el-input v-model="choiceForm.title" placeholder="请输入查询内容"></el-input>
  108. </el-form-item>
  109. <el-form-item label="专利号">
  110. <el-input v-model="choiceForm.patentNo" placeholder="请输入查询内容"></el-input>
  111. </el-form-item>
  112. </el-form>
  113. </div>
  114. <div slot="footer" class="dialog-footer">
  115. <el-button @click="close">取 消</el-button>
  116. <el-button type="primary" @click="screen">确 定</el-button>
  117. </div>
  118. </el-dialog>
  119. <el-dialog v-else title="筛选" :visible.sync="visible" width="1000px" max-height="600" :before-close="close" append-to-body>
  120. <div style="height: 500px">
  121. <el-form ref="form" :model="form" label-width="80px" label-position="left">
  122. <el-form-item label="标题">
  123. <el-input type="textarea" v-model="form.patentName" placeholder="请输入查询内容"></el-input>
  124. </el-form-item>
  125. <el-form-item label="摘要">
  126. <el-input type="textarea" v-model="form.abstractStr" placeholder="请输入查询内容"></el-input>
  127. </el-form-item>
  128. <el-form-item label="专利号">
  129. <el-input type="textarea" v-model="form.patentNo" placeholder="请输入查询内容"></el-input>
  130. </el-form-item>
  131. <el-form-item label="申请号">
  132. <el-input type="textarea" v-model="form.applicationNo" placeholder="请输入查询内容"></el-input>
  133. </el-form-item>
  134. <el-form-item label="申请人">
  135. <el-input type="textarea" v-model="form.applicationName" placeholder="请输入查询内容"></el-input>
  136. </el-form-item>
  137. <el-form-item label="权利人">
  138. <el-input type="textarea" v-model="form.obligeeName" placeholder="请输入查询内容"></el-input>
  139. </el-form-item>
  140. </el-form>
  141. </div>
  142. <div slot="footer" class="dialog-footer">
  143. <el-button @click="close">取 消</el-button>
  144. <el-button type="primary" @click="screen">确 定</el-button>
  145. </div>
  146. </el-dialog>
  147. </div>
  148. </template>
  149. <script>
  150. import { PatentDetails } from '@/views/components/common/mixins';
  151. export default{
  152. props:['tableData','isSubmit','queryParams','reportId',"choiceMarkA","isHandleSure"],
  153. mixins:[PatentDetails],
  154. data() {
  155. return {
  156. choiceTableData:[],
  157. choiceTotal:'',
  158. choiceMark:this.choiceMarkA,
  159. loading:false,
  160. visible:false,
  161. form: {},
  162. choiceForm: {},
  163. choiceFormS: {},
  164. // choiceScreen: false,
  165. // formS: {},
  166. // tableData:[],
  167. checkList:[],
  168. selected: [],
  169. formS: {},
  170. options: [
  171. {
  172. value: 1,
  173. label: '相同'
  174. },{
  175. value: 3,
  176. label: '等同'
  177. },{
  178. value: 0,
  179. label: '不相同'
  180. }, {
  181. value: 2,
  182. label: '待确定'
  183. }
  184. ],
  185. choiceQueryParams:{
  186. taskId:null,
  187. size:10,
  188. current:1,
  189. reportId:this.reportId,
  190. compareResult:null,
  191. },
  192. }
  193. },
  194. async mounted() {
  195. if (this.choiceMark) {
  196. await this.getList()
  197. }
  198. console.log(this.choiceTableData,this.tableData,this.selected,this.choiceMark,this.queryParams);
  199. },
  200. watch:{
  201. isSubmit(val){
  202. if(val){
  203. this.form = {}
  204. this.checkList=[]
  205. this.selected = []
  206. }
  207. },
  208. isHandleSure(val) {
  209. console.log(val);
  210. if (val) {
  211. console.log(this.selected,this.choiceFormS);
  212. let a = {
  213. selected:this.selected,
  214. choiceFormS:this.choiceFormS,
  215. }
  216. this.$emit("choiceFormSelected", a)
  217. }
  218. },
  219. // async choiceMark(val) {
  220. // if (val) {
  221. // await this.getList()
  222. // }
  223. // }
  224. },
  225. methods: {
  226. // opens(data) {
  227. // this.tableData=data
  228. // },
  229. async getList() {
  230. this.loading=true
  231. // if (this.choiceMark==true) {
  232. await this.$api.getComparedMessage(this.choiceQueryParams).then(response => {
  233. if (response.code == 200) {
  234. this.choiceTotal = response.data.total
  235. this.choiceTableData = response.data.records
  236. this.loading=false
  237. }
  238. })
  239. // }
  240. },
  241. handleCurrentChange(val) {
  242. this.choiceQueryParams.current = val;
  243. this.getList();
  244. },
  245. handleCancelSelectNumber() {//取消选择
  246. this.checkList = []
  247. this.selected=[]
  248. this.$emit('PersonPatent',this.checkList)
  249. // this.getList()
  250. },
  251. getRowKeys(row) {
  252. return row.id
  253. },
  254. getFunInfo(patentNo) {
  255. // if (this.choiceMark) {
  256. // if (this.selected.includes(patentNo)) {
  257. // this.selected.splice(
  258. // this.selected.indexOf(this.selected.find(function (element) {
  259. // return element === patentNo;
  260. // }
  261. // )
  262. // ), 1);
  263. // } else {
  264. // this.selected.push(patentNo)
  265. // }
  266. // this.$emit('onSelected',this.selected)
  267. // } else {
  268. if (this.checkList.includes(patentNo)) {
  269. this.checkList.splice(
  270. this.checkList.indexOf(this.checkList.find(function (element) {
  271. return element === patentNo;
  272. }
  273. )
  274. ), 1);
  275. } else {
  276. this.checkList.push(patentNo)
  277. }
  278. this.$emit('PersonPatent', this.checkList)
  279. if (this.choiceMark) {
  280. this.selected = this.checkList
  281. console.log(this.checkList,this.selected);
  282. }
  283. // }
  284. },
  285. sift() {
  286. this.visible = true
  287. },
  288. choicePage() {//本页选择
  289. if (this.choiceMark) {
  290. var choice = this.choiceTableData.map(item => item.patentNo);
  291. } else {
  292. var choice = this.tableData.map(item => item.patentNo);
  293. }
  294. this.selected = [...new Set(this.selected.concat(choice))]
  295. this.checkList = [...new Set(this.checkList.concat(choice))]
  296. this.$emit('PersonPatent',this.checkList)
  297. // this.getList()
  298. },
  299. close() {//筛选取消
  300. this.visible = false
  301. this.form = this.formS
  302. this.choiceForm = this.choiceFormS
  303. },
  304. screen() {//筛选确定
  305. // for (let key in this.form) {
  306. // this.queryParams[key]=this.form[key]
  307. // }
  308. // this.queryParams.patentName=this.form.patentName
  309. // this.getList()
  310. if (this.choiceMark) {
  311. this.choiceFormS = JSON.parse(JSON.stringify(this.choiceForm))
  312. if (Object.keys(this.choiceFormS).length != 0) {
  313. for (let k in this.choiceFormS) {
  314. this.choiceQueryParams[k]=this.choiceFormS[k]
  315. }
  316. }
  317. // this.choiceQueryParams.patentNo=this.choiceFormS.patentNo//专利号
  318. // this.choiceQueryParams.patentNo=this.choiceFormS.patentNo//标题
  319. // this.choiceQueryParams.compareResult = this.choiceFormS.compareResult//比对结果
  320. this.getList()
  321. console.log(this.choiceFormS);
  322. this.visible = false
  323. } else {
  324. this.formS = JSON.parse(JSON.stringify(this.form))
  325. this.$emit("onForm", this.formS)
  326. this.visible = false
  327. }
  328. // this.form = {}
  329. },
  330. change(val) {
  331. console.log(val);
  332. },
  333. },
  334. }
  335. </script>