|
@@ -12,12 +12,13 @@
|
|
|
<el-button type="primary" size="small" @click="handleMerge">合并</el-button>
|
|
|
</el-header>
|
|
|
<el-main class="container-common-main">
|
|
|
- <el-table v-loading="loading" :data="tableData" border header-row-class-name="custom-table-header"
|
|
|
- v-el-table-infinite-scroll="getList" :infinite-scroll-distance="10" :infinite-scroll-disabled="disabled">
|
|
|
- <el-table-column align="center" width="55">
|
|
|
+ <!-- <el-table v-loading="loading" :data="tableData" border header-row-class-name="custom-table-header"
|
|
|
+ v-el-table-infinite-scroll="getList" :infinite-scroll-distance="10" :infinite-scroll-disabled="disabled"> -->
|
|
|
+ <el-table v-loading="loading" :data="tableData" border header-row-class-name="custom-table-header">
|
|
|
+ <el-table-column align="center" width="60">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-checkbox :label="scope.row.name" @change="onChange(scope.row)" v-if="!loading"
|
|
|
- :checked="mergedName.indexOf(scope.row.name) !== -1"></el-checkbox>
|
|
|
+ <el-checkbox @change="onChange(scope.row)" v-if="refresh"
|
|
|
+ :checked="mergedList.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>
|
|
@@ -25,10 +26,15 @@
|
|
|
<el-table-column prop="remark" label="备注" align="center" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column label="操作" align="center" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="primary" size="small" @click="handleEdit(scope.row)">编辑</el-button>
|
|
|
+ <el-button v-if="scope.row.mergeId" type="primary" size="small"
|
|
|
+ @click="handleEdit(scope.row)">编辑</el-button>
|
|
|
</template>
|
|
|
</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>
|
|
@@ -36,12 +42,13 @@
|
|
|
</el-container>
|
|
|
</el-drawer>
|
|
|
|
|
|
- <el-dialog :title="mergeTitle" :visible.sync="visible" width="900px" append-to-body destroy-on-close
|
|
|
- :before-close="close" top="3vh">
|
|
|
+ <el-dialog :title="mergeTitle" :visible.sync="visible" width="500px" append-to-body destroy-on-close
|
|
|
+ :before-close="closeDialog" top="3vh">
|
|
|
<div class="patent-applicant-merge-select">
|
|
|
- <template v-if="title.indexOf('新增') == -1">
|
|
|
+ <template v-if="ruleForm.id">
|
|
|
<el-divider content-position="left">基本信息</el-divider>
|
|
|
- <el-button type="primary" size="small" @click="handleSave">保存</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="handleSave"
|
|
|
+ style="display:flex;margin: 10px 0 10px 0px;">保存</el-button>
|
|
|
</template>
|
|
|
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px">
|
|
|
<el-form-item label="名称" prop="name">
|
|
@@ -69,15 +76,22 @@
|
|
|
<el-input v-model="ruleForm.remark" placeholder="请输入备注" type="textarea"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <template v-if="title.indexOf('新增') == -1">
|
|
|
- <el-divider content-position="left">合并信息</el-divider>
|
|
|
- <el-table :data="ruleForm.mergeTable" border header-row-class-name="custom-table-header">
|
|
|
- <el-table-column prop="name" label="当前名称" align="center" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="shortName" label="标准名称" align="center" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="country" label="国家" align="center" width="150"
|
|
|
+ <template v-if="ruleForm.id">
|
|
|
+ <div style="margin: 10px 0 10px 0px;">
|
|
|
+ <el-divider content-position="left">合并信息</el-divider>
|
|
|
+ </div>
|
|
|
+ <el-table :data="ruleForm.mergedName" border header-row-class-name="custom-table-header">
|
|
|
+ <el-table-column prop="name" label="合并人名称" align="center" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ {{ scope.row }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column prop="country" label="国家" align="center" width="150"
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="address" label="地址" align="center" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column label="操作" width="80" align="center">
|
|
|
+ <el-table-column prop="address" label="地址" align="center" show-overflow-tooltip></el-table-column> -->
|
|
|
+ <el-table-column label="操作" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<el-link type="danger" @click="handleDelete(scope.row)">移除</el-link>
|
|
|
</template>
|
|
@@ -87,7 +101,7 @@
|
|
|
</div>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="closeDialog">关 闭</el-button>
|
|
|
- <el-button v-if="title.indexOf('新增') != -1" type="primary" @click="handleSave">确认</el-button>
|
|
|
+ <el-button v-if="!ruleForm.id" type="primary" @click="handleSave">确认</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -111,8 +125,9 @@ export default {
|
|
|
loading: false,
|
|
|
// 表格的数据源
|
|
|
tableData: [],
|
|
|
- // 存放勾选的值
|
|
|
- mergedName: [],
|
|
|
+ // 存放勾选的值的数据(已合并的)
|
|
|
+ mergedData: null,
|
|
|
+ mergedList: [],
|
|
|
//检索字段
|
|
|
searchFiled: [
|
|
|
{
|
|
@@ -126,12 +141,15 @@ export default {
|
|
|
//禁用懒加载
|
|
|
disabled: true,
|
|
|
queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
},
|
|
|
// 总条数
|
|
|
total: 0,
|
|
|
// 判断是2发明人还是0申请人与权利人
|
|
|
mergeType: null,
|
|
|
+ // 刷新
|
|
|
+ refresh: true,
|
|
|
/**编辑合并人及基本信息 start*/
|
|
|
// 控制弹窗开关
|
|
|
visible: false,
|
|
@@ -166,14 +184,15 @@ export default {
|
|
|
let params = {
|
|
|
projectId: this.projectId,
|
|
|
name: this.ruleForm.name,
|
|
|
- item:row.name,
|
|
|
+ delName: row,
|
|
|
+ type: this.mergeType,
|
|
|
}
|
|
|
this.$confirm('此操作将删除该人员, 是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- this.$api.dele(params).then(res => {
|
|
|
+ this.$api.delMergedName(params).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message.success('移除人员成功')
|
|
|
this.$emit('close')
|
|
@@ -189,9 +208,10 @@ export default {
|
|
|
getMerge(row) {
|
|
|
let params = {
|
|
|
projectId: this.projectId,
|
|
|
- name: row.name,
|
|
|
+ id: row.mergeId,
|
|
|
+ type: this.mergeType,
|
|
|
}
|
|
|
- this.$api.query(params).then(res => {
|
|
|
+ this.$api.selectMergePersonDetail(params).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.ruleForm = res.data
|
|
|
}
|
|
@@ -206,7 +226,12 @@ export default {
|
|
|
// 关闭弹窗
|
|
|
closeDialog() {
|
|
|
this.$refs.ruleForm.resetFields()
|
|
|
- this.ruleForm = {}
|
|
|
+ if (this.ruleForm.needMergedName && this.ruleForm.needMergedName.length == 0) {
|
|
|
+ this.ruleForm = {
|
|
|
+ needMergedName: [],
|
|
|
+ mergeName: [],
|
|
|
+ }
|
|
|
+ }
|
|
|
this.visible = false
|
|
|
},
|
|
|
// 弹窗中的完成和保存事件
|
|
@@ -214,14 +239,15 @@ export default {
|
|
|
this.$refs.ruleForm.validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.ruleForm.projectId = this.projectId
|
|
|
+ this.ruleForm.type = this.mergeType
|
|
|
if (this.title.indexOf('新增') != -1) {//新增
|
|
|
- this.ruleForm.projectId = this.projectId
|
|
|
- this.ruleForm.mergedName = this.mergedName
|
|
|
+ // this.ruleForm.mergedName = this.mergedName
|
|
|
this.$api.mergePerson(this.ruleForm).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message.success('合并成功')
|
|
|
this.$emit('close')
|
|
|
- // this.getList()
|
|
|
+ this.mergedList = []
|
|
|
+ this.getList()
|
|
|
this.closeDialog()
|
|
|
// this.close()
|
|
|
}
|
|
@@ -231,16 +257,41 @@ export default {
|
|
|
if (res.code == 200) {
|
|
|
this.$message.success('编辑成功')
|
|
|
this.$emit('close')
|
|
|
- // this.getList()
|
|
|
+ this.getList()
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ onChange(row) {
|
|
|
+ const index = this.mergedList.indexOf(row.name)
|
|
|
+ if (index === -1) {
|
|
|
+ this.mergedList.push(row.name)
|
|
|
+ } else {
|
|
|
+ this.mergedList.splice(index, 1)
|
|
|
+ }
|
|
|
+ if (row.mergeId) {//已合并过的名称
|
|
|
+ const index2 = this.ruleForm.needMergedName.indexOf(row.name)
|
|
|
+ if (index2 === -1) {
|
|
|
+ this.ruleForm.needMergedName.push(row.name)
|
|
|
+ } else {
|
|
|
+ this.ruleForm.needMergedName.splice(index, 1)
|
|
|
+ }
|
|
|
+ this.mergedData = row
|
|
|
+
|
|
|
+ } else {//未合并的名称
|
|
|
+ const index3 = this.ruleForm.mergeName.indexOf(row.name)
|
|
|
+ if (index3 === -1) {
|
|
|
+ this.ruleForm.mergeName.push(row.name)
|
|
|
+ } else {
|
|
|
+ this.ruleForm.mergeName.splice(index, 1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
// 合并事件
|
|
|
handleMerge() {
|
|
|
- if (this.mergedName.length === 0) {
|
|
|
+ if (this.mergedList.length === 0) {
|
|
|
let text = this.mergeType == 2 ? '请选择发明人' : '请选择申请人/权利人'
|
|
|
this.$message.error(text)
|
|
|
return false
|
|
@@ -249,26 +300,32 @@ export default {
|
|
|
this.mergeTitle = '新增合并'
|
|
|
this.visible = true
|
|
|
} else {//编辑直接合并,不填写信息
|
|
|
- let params = {
|
|
|
- projectId: this.projectId,
|
|
|
- mergedName: this.mergedName,
|
|
|
- }
|
|
|
- this.$api.save(params).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.$message.success('合并成功')
|
|
|
- this.$emit('close')
|
|
|
- // this.getList()
|
|
|
- // this.close()
|
|
|
+ this.mergeTitle = '编辑合并'
|
|
|
+ if (this.ruleForm.needMergedName.length > 0) {
|
|
|
+ for (let k in this.mergedData) {
|
|
|
+ this.ruleForm[k] = this.mergedData[k]
|
|
|
}
|
|
|
- })
|
|
|
+ } else {
|
|
|
+ for (let k in this.mergedData) {
|
|
|
+ this.ruleForm[k] = ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(this.ruleForm);
|
|
|
+ this.visible = true
|
|
|
}
|
|
|
},
|
|
|
// 打开抽屉
|
|
|
open(row, title) {
|
|
|
this.mergeType = row.mergeType
|
|
|
this.title = title
|
|
|
- // this.getList()
|
|
|
+ this.ruleForm.needMergedName = [],
|
|
|
+ this.ruleForm.mergeName = [],
|
|
|
+ this.getList()
|
|
|
this.drawer = true
|
|
|
+ // 获取国家和地区的数据
|
|
|
+ if (this.mergeType == 0) {
|
|
|
+ this.getAllCountry()
|
|
|
+ }
|
|
|
},
|
|
|
//获取检索条件检索
|
|
|
search(val) {
|
|
@@ -288,17 +345,26 @@ export default {
|
|
|
this.queryParams.current = 1
|
|
|
this.getList()
|
|
|
},
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.queryParams.pageNum = val;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
// 获取发明人或者申请人、权利人数据,包括已合并的数据
|
|
|
getList() {
|
|
|
let params = {
|
|
|
...this.queryParams,//分页信息
|
|
|
searchQuery: this.$commonJS.objectToString(this.searchOption || {}),//检索条件
|
|
|
projectId: this.projectId,//项目id
|
|
|
+ type: this.mergeType,
|
|
|
}
|
|
|
- this.$api.query(params).then(res => {
|
|
|
+ this.$api.getMergePerson(params).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.tableData = res.data.data
|
|
|
this.total = res.data.total
|
|
|
+ this.refresh = false
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.refresh = true
|
|
|
+ })
|
|
|
}
|
|
|
}).catch(error => {
|
|
|
this.tableData = []
|
|
@@ -310,8 +376,8 @@ export default {
|
|
|
this.drawer = false
|
|
|
},
|
|
|
// 获取国家和地区
|
|
|
- getCommonData() {
|
|
|
- this.$api.getCommonData({ keys: 'COUNTRIES' }).then(response => {
|
|
|
+ getAllCountry() {
|
|
|
+ this.$api.getAllCountry().then(response => {
|
|
|
this.commonData = response.data
|
|
|
})
|
|
|
},
|