|
@@ -1,229 +0,0 @@
|
|
|
-<template>
|
|
|
- <div class="patent-inventor-merge-manage">
|
|
|
- <el-drawer class="custom-drawer-form" title="合并发明人" size="1000px" :visible.sync="drawer" direction="rtl"
|
|
|
- :before-close="close" destroy-on-close>
|
|
|
- <el-container>
|
|
|
- <el-header>
|
|
|
- <el-form :inline="true" class="margin-left_20">
|
|
|
- <el-form-item label="名称">
|
|
|
- <el-input v-model="queryParams.name" size="small" placeholder="请输入当前名称"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="" size="small" @click="getList">查询</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </el-header>
|
|
|
- <el-main class="container-common-main">
|
|
|
- <el-table v-loading="loading" :data="tableData" border header-row-class-name="custom-table-header">
|
|
|
- <el-table-column align="center" width="55">
|
|
|
- <!-- <template slot="header">
|
|
|
- <el-checkbox :checked="selectAll" @change="onChange3"></el-checkbox>
|
|
|
- </template> -->
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-checkbox :label="scope.row.name" @change="onChange(scope.row)" v-if="!loading"
|
|
|
- :checked="ruleForm.mergedName.indexOf(scope.row.name) !== -1"></el-checkbox>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="name" label="名称" align="center" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="address" label="地址" align="center" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="remark" label="备注" align="center" show-overflow-tooltip></el-table-column>
|
|
|
- </el-table>
|
|
|
- <div class="pagination">
|
|
|
- <el-pagination :current-page.sync="queryParams.pageNum" :page-size="queryParams.pageSize" :total="total"
|
|
|
- @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
|
|
|
- </div>
|
|
|
- </el-main>
|
|
|
- <el-footer class="footer-common">
|
|
|
- <el-button @click="close">关 闭</el-button>
|
|
|
- <el-button type="primary" @click="dialogVisible = true">确 定</el-button>
|
|
|
- </el-footer>
|
|
|
- </el-container>
|
|
|
- </el-drawer>
|
|
|
-
|
|
|
- <el-dialog :title="title" :visible.sync="dialogVisible" width="500px" append-to-body destroy-on-close
|
|
|
- :before-close="cancel">
|
|
|
- <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="55px">
|
|
|
- <el-form-item label="名称" prop="name">
|
|
|
- <el-input v-model="ruleForm.name" placeholder="请输入名称"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="地址" prop="address">
|
|
|
- <el-input v-model="ruleForm.address" placeholder="请输入地址" type="textarea"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="备注" prop="remark">
|
|
|
- <el-input v-model="ruleForm.remark" placeholder="请输入备注" type="textarea"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="cancel">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submit" :loading="btnLoading">确 定</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- selectAll: false,
|
|
|
- drawer: false,
|
|
|
- loading: false,
|
|
|
- btnLoading: false,
|
|
|
- total: 0,
|
|
|
- tableData: [],
|
|
|
- queryParams: {
|
|
|
- name: '',
|
|
|
- pageSize: 10,
|
|
|
- pageNum: 1,
|
|
|
- // order: 'desc',
|
|
|
- // ids:'',
|
|
|
- },
|
|
|
- title: '',
|
|
|
- dialogVisible: false,
|
|
|
- ruleForm: {},
|
|
|
- rules: {
|
|
|
- name: [{ required: true, message: '请输入名称', trigger: 'blur' },],
|
|
|
- },
|
|
|
- }
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- },
|
|
|
- methods: {
|
|
|
- open(row, title) {
|
|
|
- console.log(row);
|
|
|
- this.ruleForm = { ...row }
|
|
|
- if (row.id) {
|
|
|
-
|
|
|
- } else {
|
|
|
- this.ruleForm.mergedName = []
|
|
|
- }
|
|
|
- this.title = title
|
|
|
- this.drawer = true
|
|
|
- this.selectAll = false
|
|
|
- this.queryParams.projectId = row.projectId
|
|
|
- this.queryParams.pageNum = 1
|
|
|
- // this.queryParams.ids = row.inventorIds.toString()
|
|
|
- this.getList()
|
|
|
- },
|
|
|
- close() {
|
|
|
- this.drawer = false
|
|
|
- this.$emit('close')
|
|
|
- },
|
|
|
- onChange2() {
|
|
|
- this.ruleForm.provinceId = this.addressIds[0]
|
|
|
- this.ruleForm.cityId = this.addressIds[1]
|
|
|
- this.ruleForm.areaId = this.addressIds[2]
|
|
|
- },
|
|
|
- onChange(row) {
|
|
|
- const index = this.ruleForm.mergedName.indexOf(row.name)
|
|
|
- if (index === -1) {
|
|
|
- this.ruleForm.mergedName.push(row.name)
|
|
|
- } else {
|
|
|
- this.ruleForm.mergedName.splice(index, 1)
|
|
|
- }
|
|
|
- },
|
|
|
- onChange3() {
|
|
|
- this.selectAll = !this.selectAll
|
|
|
- if (this.selectAll) {
|
|
|
- let params = {
|
|
|
- ...this.queryParams,
|
|
|
- type: 2,//发明人
|
|
|
- }
|
|
|
- params.pageSize = 9999999
|
|
|
- this.loading = true
|
|
|
- this.$api.getPatentInventorList(params).then(response => {
|
|
|
- this.ruleForm.mergedName = response.data.records.map(item => item.name)
|
|
|
- this.loading = false
|
|
|
- }).catch(error => {
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.loading = true
|
|
|
- this.ruleForm.mergedName = []
|
|
|
- this.$nextTick(() => {
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- getList() {
|
|
|
- this.loading = true
|
|
|
- let params = {
|
|
|
- ...this.queryParams,
|
|
|
- type: 2,//发明人
|
|
|
- }
|
|
|
- this.$api.getMergePerson(params).then(response => {
|
|
|
- if (response.code == 200) {
|
|
|
- this.tableData = response.data.data
|
|
|
- this.total = response.data.total
|
|
|
- this.loading = false
|
|
|
- }
|
|
|
- }).catch(error => {
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
- },
|
|
|
- handleCurrentChange(val) {
|
|
|
- this.queryParams.pageNum = val;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- cancel() {
|
|
|
- this.dialogVisible = false
|
|
|
- },
|
|
|
- submit() {
|
|
|
- if (this.ruleForm.mergedName.length === 0) {
|
|
|
- this.$message.error('请选择发明人')
|
|
|
- return false
|
|
|
- }
|
|
|
- this.$refs.ruleForm.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- this.btnLoading = true
|
|
|
- // this.ruleForm.merge = true
|
|
|
- let params = {
|
|
|
- type: 2,//发明人
|
|
|
- ...this.ruleForm
|
|
|
- }
|
|
|
- if (this.ruleForm.id) {
|
|
|
- this.$api.updateMergePerson(params).then(response => {
|
|
|
- if (response.code == 200) {
|
|
|
- this.$message.success('编辑成功')
|
|
|
- this.btnLoading = false
|
|
|
- this.cancel()
|
|
|
- this.close()
|
|
|
- }
|
|
|
- }).catch(error => {
|
|
|
- this.btnLoading = false
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$api.mergePerson(params).then(response => {
|
|
|
- if (response.code == 200) {
|
|
|
- this.$message.success('新增成功')
|
|
|
- this.btnLoading = false
|
|
|
- this.cancel()
|
|
|
- this.close()
|
|
|
- }
|
|
|
-
|
|
|
- }).catch(error => {
|
|
|
- this.btnLoading = false
|
|
|
- })
|
|
|
- }
|
|
|
- } else {
|
|
|
- // console.log('error submit!!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="scss">
|
|
|
-.patent-inventor-merge-manage {
|
|
|
- .pagination {
|
|
|
- text-align: center;
|
|
|
- margin: 20px 0;
|
|
|
- }
|
|
|
-
|
|
|
- .el-checkbox__label {
|
|
|
- display: none !important;
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|