MergeInventor.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <!-- 合并发明人,合并权利人/申请人 -->
  3. <!-- 暂时没有用到 -->
  4. <div class="">
  5. <el-drawer class="custom-drawer-form" :title="mergeType == 2?'合并发明人':'合并申请人/权利人'" size="1000px" :visible.sync="drawer" direction="rtl"
  6. :before-close="close" destroy-on-close>
  7. <el-container class="patent-inventor-merge">
  8. <el-header style="display:flex;align-items:center;justify-content: space-between;">
  9. <div>
  10. <el-form :inline="true" class="margin-left_20">
  11. <el-form-item label="名称">
  12. <el-input v-model="queryParams.name" size="small" placeholder="请输入名称"></el-input>
  13. </el-form-item>
  14. <el-form-item>
  15. <el-button type="primary" size="small" @click="init">查询</el-button>
  16. </el-form-item>
  17. </el-form>
  18. <!-- 后端没有根据检索式检索 -->
  19. <!-- <mySearch style="width: 500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption">
  20. </mySearch> -->
  21. </div>
  22. <div>
  23. <el-button type="primary" size="small" @click="handleAdd()">新增</el-button>
  24. </div>
  25. </el-header>
  26. <el-main class="container-common-main">
  27. <el-table v-loading="loading" :data="tableData" border header-row-class-name="custom-table-header">
  28. <el-table-column type="index" label="#" width="55" align="center"></el-table-column>
  29. <el-table-column prop="name" label="名称" align="center" show-overflow-tooltip></el-table-column>
  30. <template v-if="mergeType == 0">
  31. <el-table-column prop="country" label="国家" align="center" show-overflow-tooltip></el-table-column>
  32. <el-table-column prop="address" label="地址" align="center" show-overflow-tooltip></el-table-column>
  33. </template>
  34. <el-table-column prop="createTime" label="更新时间" align="center" show-overflow-tooltip> </el-table-column>
  35. <el-table-column prop="remark" label="备注" align="center" show-overflow-tooltip></el-table-column>
  36. <el-table-column label="操作" align="center" width="150">
  37. <template slot-scope="scope">
  38. <el-dropdown split-button type="primary" size="small">
  39. <span @click="handleEdit(scope.row)">编辑</span>
  40. <el-dropdown-menu slot="dropdown" class="text-align_center">
  41. <el-dropdown-item class="color-red" @click.native="handleDelete(scope.row)">删除</el-dropdown-item>
  42. </el-dropdown-menu>
  43. </el-dropdown>
  44. </template>
  45. </el-table-column>
  46. </el-table>
  47. <div class="pagination">
  48. <el-pagination :current-page.sync="queryParams.pageNum" :page-size="queryParams.pageSize" :total="total"
  49. @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
  50. </div>
  51. </el-main>
  52. <el-footer class="footer-common">
  53. <el-button @click="close">关 闭</el-button>
  54. </el-footer>
  55. </el-container>
  56. </el-drawer>
  57. <mergeDialog ref="mergeDialog" :projectId="projectId" @close="close2"></mergeDialog>
  58. </div>
  59. </template>
  60. <script>
  61. import mergeDialog from './merge.vue'
  62. export default {
  63. components: {
  64. mergeDialog,
  65. },
  66. data() {
  67. return {
  68. drawer: false,
  69. loading: false,
  70. total: 0,
  71. tableData: [],
  72. projectId: 0,
  73. queryParams: {
  74. pageSize: 10,
  75. pageNum: 1,
  76. },
  77. //检索字段
  78. searchFiled: [
  79. {
  80. label: '名称',
  81. value: 'name',
  82. type: 'String',
  83. }
  84. ],
  85. //检索条件
  86. searchOption: {},
  87. // 判断是2发明人还是0权利人/申请人
  88. mergeType: '',
  89. }
  90. },
  91. mounted() {
  92. },
  93. methods: {
  94. init(){
  95. this.queryParams.pageNum = 1
  96. this.getList()
  97. },
  98. // 子组件传来的消息
  99. close2() {
  100. this.getList()
  101. },
  102. // 编辑合并弹窗
  103. handleEdit(row) {
  104. row.mergeType = this.mergeType
  105. this.$refs.mergeDialog.open(row, '编辑合并')
  106. },
  107. // 打开新增弹窗
  108. handleAdd() {
  109. this.$refs.mergeDialog.open({
  110. mergeType: this.mergeType,
  111. }, '新增合并')
  112. },
  113. // 打开合并发明人抽屉弹窗
  114. open(obj) {
  115. this.projectId = obj.projectId
  116. this.mergeType = obj.type
  117. this.drawer = true
  118. this.getList()
  119. },
  120. //获取检索条件检索
  121. search(val) {
  122. let params = {}
  123. val.forEach(item => {
  124. if (item.type == 3) {
  125. params[item.value] = item.searchValue.map(itemValue => {
  126. return itemValue.value
  127. })
  128. } else {
  129. params[item.value] = item.searchValue.label
  130. }
  131. })
  132. // 返回条件对象
  133. this.searchOption = this.$commonJS.ArrayToArray(val)
  134. // 调用查询接口
  135. this.queryParams.current = 1
  136. this.getList()
  137. },
  138. // 获取表格数据
  139. getList() {
  140. this.loading = true
  141. let params = {
  142. projectId: this.projectId,
  143. ...this.queryParams,
  144. searchQuery: this.$commonJS.objectToString(this.searchOption || {}),//检索条件
  145. type: this.mergeType,//2是发明人0是申请人/权利人
  146. }
  147. this.$api.selectMergePerson(params).then(response => {
  148. if (response.code == 200) {
  149. this.tableData = response.data.data
  150. this.total = response.data.total
  151. this.loading = false
  152. }
  153. }).catch(error => {
  154. this.loading = false
  155. })
  156. },
  157. // 分页信息
  158. handleCurrentChange(val) {
  159. this.queryParams.pageNum = val;
  160. this.getList();
  161. },
  162. // 关闭抽屉弹窗
  163. close() {
  164. this.drawer = false
  165. this.$emit('mergeClose')
  166. },
  167. // 删除表格数据
  168. handleDelete(row) {
  169. this.$confirm('确认删除本条数据吗?', '提示', {
  170. confirmButtonText: '确定',
  171. cancelButtonText: '取消',
  172. type: 'warning'
  173. }).then(() => {
  174. this.loading = true
  175. let params = {
  176. id: row.id,
  177. type: 2,
  178. }
  179. this.$api.delMergePerson(params).then(response => {
  180. if (response.code == 200) {
  181. this.$message.success('删除成功')
  182. this.loading = false
  183. this.getList()
  184. }
  185. }).catch(error => {
  186. this.loading = false
  187. })
  188. })
  189. },
  190. // 打开新增弹窗
  191. // handleAdd() {
  192. // this.$refs.mergeDialog.open({
  193. // // mergedName: [],
  194. // mergeType: 1,
  195. // }, '新增合并')
  196. // // this.$refs.patentInventorMergeManageDrawer.open({
  197. // // projectId: this.queryParams.projectId,
  198. // // // mergedName: [],
  199. // // name: '',
  200. // // remark: '',
  201. // // }, '新增合并')
  202. // },
  203. // // 编辑合并弹窗
  204. // handleEdit(row) {
  205. // row.mergeType = 1
  206. // this.$refs.mergeDialog.open(row, '编辑合并')
  207. // // row.projectId = this.projectId
  208. // // this.$refs.patentInventorMergeManageDrawer.open(row, '编辑合并')
  209. // },
  210. }
  211. }
  212. </script>
  213. <style lang="scss">
  214. .patent-inventor-merge {
  215. .pagination {
  216. text-align: center;
  217. margin: 20px 0;
  218. }
  219. }
  220. </style>