MergeApplicant.vue 7.0 KB

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