|
@@ -3,18 +3,36 @@
|
|
|
<el-container>
|
|
|
<el-header>
|
|
|
<div class="head">
|
|
|
- <el-button type="primary" size="small" @click="refreshData" class="margin-right_10">刷新</el-button>
|
|
|
- <el-button type="primary" size="small" v-if="isEdit" @click="cancel" class="margin-right_10">取消编辑</el-button>
|
|
|
- <el-button type="primary" size="small" v-if="isEdit" @click="save" class="margin-right_10">保存</el-button>
|
|
|
- <el-button type="primary" size="small" v-else @click="edit" class="margin-right_10">编辑</el-button>
|
|
|
+ <div class="headLeft">
|
|
|
+ <el-button type="primary" size="small" @click="refreshData" class="margin-right_10">刷新</el-button>
|
|
|
+ <el-button type="primary" size="small" v-if="isEdit" @click="cancel" class="margin-right_10">取消编辑</el-button>
|
|
|
+ <el-button type="primary" size="small" v-if="isEdit" @click="save" class="margin-right_10">保存</el-button>
|
|
|
+ <el-button type="primary" size="small" v-else @click="edit" class="margin-right_10">编辑</el-button>
|
|
|
+ <el-dropdown :hide-on-click="false" @visible-change="visibleChange">
|
|
|
+ <el-button type="primary" size="small" class="el-dropdown-link">
|
|
|
+ 显示栏位管理<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-checkbox-group v-model="checkList" @change="editColumn">
|
|
|
+ <el-dropdown-item v-for="item in column" :key="item.field">
|
|
|
+ <el-checkbox :label="item.field">{{ item.name }}</el-checkbox>
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-checkbox-group>
|
|
|
+
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ </div>
|
|
|
+
|
|
|
</div>
|
|
|
</el-header>
|
|
|
<el-main v-DivHeight="getDivHeight">
|
|
|
- <el-table v-loading="loading" :data="tableData" :maxHeight="tableHeight - 45" border :header-cell-style="{'text-align':'center'}" style="width: 100%">
|
|
|
+ <el-table v-loading="loading" :data="tableData" :maxHeight="tableHeight - 45" border :header-cell-style="{'text-align':'center'}" style="width: 100%"
|
|
|
+ @cell-dblclick="cellDblclick">
|
|
|
<el-table-column prop="sysOrder" label="序号" width="100" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
权要{{ scope.row.sysOrder+1 }}
|
|
|
+ <!-- <span v-if="!getClaimDel(scope.row)"><el-button type="text" size="small" @click="delClaim(scope.row)">删除</el-button></span> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -26,27 +44,50 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="content" label="修改后权要内容" >
|
|
|
+ <el-table-column v-for="item in column.filter(item=>!item.ifHidden)" :key="item.field" :prop="item.field" :label="item.name" :width="item.width || 'auto'" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <div>
|
|
|
- <span v-html="getModifyClaim(scope.row)"></span>
|
|
|
+ <div v-if="item.field == 'historyContent1'">
|
|
|
+ <my-RichText v-if="editMessage && editMessage.field == item.field && editMessage.row.sysOrder == scope.row.sysOrder" :autoFocus="true" :value="getModifyClaim(scope.row,1)" @blur="(value)=>changeMessage(item.field,scope.row,value)"></my-RichText>
|
|
|
+ <div v-else v-html="getModifyClaim(scope.row,1)"></div>
|
|
|
+ </div>
|
|
|
+ <div v-if="item.field == 'historyDescription1'">
|
|
|
+ <my-RichText v-if="editMessage && editMessage.field == item.field && editMessage.row.sysOrder == scope.row.sysOrder" :autoFocus="true" :value="getModifyDescription(scope.row,1)" @blur="(value)=>changeMessage(item.field,scope.row,value)"></my-RichText>
|
|
|
+ <div v-else v-html="getModifyDescription(scope.row,1)"></div>
|
|
|
+ </div>
|
|
|
+ <div v-if="item.field == 'historyContent2'">
|
|
|
+ <my-RichText v-if="editMessage && editMessage.field == item.field && editMessage.row.sysOrder == scope.row.sysOrder" :autoFocus="true" :value="getModifyClaim(scope.row,2)" @blur="(value)=>changeMessage(item.field,scope.row,value)"></my-RichText>
|
|
|
+ <div v-else v-html="getModifyClaim(scope.row,2)"></div>
|
|
|
+ </div>
|
|
|
+ <div v-if="item.field == 'historyDescription2'">
|
|
|
+ <my-RichText v-if="editMessage && editMessage.field == item.field && editMessage.row.sysOrder == scope.row.sysOrder" :autoFocus="true" :value="getModifyDescription(scope.row,2)" @blur="(value)=>changeMessage(item.field,scope.row,value)"></my-RichText>
|
|
|
+ <div v-else v-html="getModifyDescription(scope.row,2)"></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="content" label="第一次修改说明" v-if="firstModify">
|
|
|
+ <!-- <el-table-column prop="1" label="修改后权要内容" >
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
- <span v-html="getModifyDescription(scope.row,1)"></span>
|
|
|
+ <my-RichText v-if="editMessage && editMessage.field == '1' && editMessage.row.sysOrder == scope.row.sysOrder" :autoFocus="true" :value="getModifyClaim(scope.row)" @blur="(value)=>changeMessage('1',scope.row,value)"></my-RichText>
|
|
|
+ <div v-else v-html="getModifyClaim(scope.row)"></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="content" label="第二次修改说明" v-if="secondModify">
|
|
|
+ <el-table-column prop="2" label="修改说明">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
- <span v-html="getModifyDescription(scope.row,2)"></span>
|
|
|
+ <my-RichText v-if="editMessage && editMessage.field == '2' && editMessage.row.sysOrder == scope.row.sysOrder" :autoFocus="true" :value="getModifyDescription(scope.row,1)" @blur="(value)=>changeMessage('2',scope.row,value)"></my-RichText>
|
|
|
+ <div v-else v-html="getModifyDescription(scope.row,1)"></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column prop="3" label="第二次修改说明" v-if="secondModify">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <my-RichText v-if="editMessage && editMessage.field == '3' && editMessage.row.sysOrder == scope.row.sysOrder" :autoFocus="true" :value="getModifyDescription(scope.row,2)" @blur="(value)=>changeMessage('3',scope.row,value)"></my-RichText>
|
|
|
+ <div v-else v-html="getModifyDescription(scope.row,2)"></div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
<el-table-column prop="parentOrder" label="父权要" align="center" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
@@ -113,6 +154,8 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
tableData:[],
|
|
|
+ checkList:[],
|
|
|
+ currentCheckList:[],
|
|
|
loading:false,
|
|
|
isEdit:false,
|
|
|
claimType:[
|
|
@@ -126,16 +169,70 @@ export default {
|
|
|
}
|
|
|
],
|
|
|
firstModify:false,
|
|
|
- secondModify:false
|
|
|
+ secondModify:false,
|
|
|
+ editMessage:{
|
|
|
+ field:'',
|
|
|
+ row:{}
|
|
|
+ },
|
|
|
+ column:[]
|
|
|
};
|
|
|
},
|
|
|
watch: {},
|
|
|
computed: {},
|
|
|
created() {},
|
|
|
- mounted() {
|
|
|
+ async mounted() {
|
|
|
+ this.column = await this.$commonJS.getCustomField('claimManage')
|
|
|
+ this.checkList = this.column.map(item=>{
|
|
|
+ if(!item.ifHidden){
|
|
|
+ return item.field
|
|
|
+ }
|
|
|
+ })
|
|
|
this.getList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ editColumn(){
|
|
|
+ for (var i = 0; i < this.column.length; i++) {
|
|
|
+ this.column[i].order = i
|
|
|
+ if (this.checkList.includes(this.column[i].field)) {
|
|
|
+ this.column[i].ifHidden = false
|
|
|
+ } else {
|
|
|
+ this.column[i].ifHidden = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ visibleChange(val){
|
|
|
+ if(val){
|
|
|
+ this.currentCheckList = JSON.parse(JSON.stringify(this.checkList))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var sign = false
|
|
|
+ if(this.checkList.length != this.currentCheckList.length){
|
|
|
+ sign = true
|
|
|
+ }else{
|
|
|
+ for(var i = 0;i<this.checkList.length;i++){
|
|
|
+ var value = this.checkList[i]
|
|
|
+ var index = this.currentCheckList.indexOf(value)
|
|
|
+ if(index == -1){
|
|
|
+ sign = true
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!sign){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var params = {
|
|
|
+ tableName: 'claimManage',
|
|
|
+ value: this.column,
|
|
|
+ }
|
|
|
+ this.$api.setTableColumns(params).then((response) => {
|
|
|
+ if (response.code == 200) {
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ })
|
|
|
+ },
|
|
|
//是否有删除权要
|
|
|
getClaimDel(row){
|
|
|
if(row.patentClaimHistoryList){
|
|
@@ -147,6 +244,88 @@ export default {
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+ //添加权要删除历史
|
|
|
+ delClaim(row){
|
|
|
+ var params = {
|
|
|
+ claimId:row.id,
|
|
|
+ ifFirst:!this.secondModify
|
|
|
+ }
|
|
|
+ this.$api.deletePatentClaim(params).then(response=>{
|
|
|
+ if(response.code == 200){
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
+ }).catch(response=>{
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //双击单元格进行编辑
|
|
|
+ cellDblclick(row, column, cell, event){
|
|
|
+ this.editMessage = {
|
|
|
+ field:column.property,
|
|
|
+ row:JSON.parse(JSON.stringify(row))
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changeMessage(field,row,value){
|
|
|
+ var api = 'alterPatentClaim'
|
|
|
+ var params = {
|
|
|
+ claimId:row.id,
|
|
|
+ content:'',
|
|
|
+ description:'',
|
|
|
+ }
|
|
|
+ var obj = null
|
|
|
+ switch(field){
|
|
|
+ case 'historyContent1'://第一次修改后权利要求
|
|
|
+ obj = this.getModifyClaim(row,1,'object')
|
|
|
+ params.content = value
|
|
|
+ params.isFirst = true
|
|
|
+ if(obj){
|
|
|
+ params.description = obj.description
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 'historyContent2'://第一次修改后权利要求
|
|
|
+ obj = this.getModifyClaim(row,2,'object')
|
|
|
+ params.content = value
|
|
|
+ params.isFirst = false
|
|
|
+ if(obj){
|
|
|
+ params.description = obj.description
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 'historyDescription1'://第一次修改说明
|
|
|
+ obj = this.getModifyDescription(row,1,'object')
|
|
|
+ params.description = value
|
|
|
+ params.isFirst = true
|
|
|
+ if(obj){
|
|
|
+ params.content = obj.content
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 'historyDescription2'://第二次修改说明
|
|
|
+ obj = this.getModifyDescription(row,2,'object')
|
|
|
+ params.description = value
|
|
|
+ params.isFirst = false
|
|
|
+ if(obj){
|
|
|
+ params.content = obj.content
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if(obj){
|
|
|
+ params.patentClaimHistoryId = obj.id
|
|
|
+ api = 'editPatentClaimHistory'
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$api[api](params).then(response=>{
|
|
|
+ if(response.code == 200){
|
|
|
+ this.$message.success('编辑成功')
|
|
|
+ this.getList()
|
|
|
+ this.editMessage = {
|
|
|
+ field:'',
|
|
|
+ row:{}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch(error=>{
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
//导入数据
|
|
|
refreshData(){
|
|
|
this.$confirm('重置权利要求', '提示', {
|
|
@@ -172,29 +351,45 @@ export default {
|
|
|
|
|
|
},
|
|
|
//获取修改后权要
|
|
|
- getModifyClaim(row){
|
|
|
+ getModifyClaim(row,type,dataType='string'){
|
|
|
if(row.patentClaimHistoryList){
|
|
|
var obj = row.patentClaimHistoryList.find(item=>{
|
|
|
- return item.operateType == 0
|
|
|
+ if(type == 1){
|
|
|
+ return item.operateType != 2 && item.ifFirst
|
|
|
+ }else if(type == 2){
|
|
|
+ return item.operateType != 2 && !item.ifFirst
|
|
|
+ }
|
|
|
})
|
|
|
if(obj){
|
|
|
- return obj.content
|
|
|
+ if(dataType == 'string'){
|
|
|
+ return obj.content
|
|
|
+ }else if(dataType == 'object'){
|
|
|
+ return obj
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ return ''
|
|
|
}
|
|
|
}
|
|
|
return ''
|
|
|
},
|
|
|
//获取权要修改说明
|
|
|
- getModifyDescription(row,type){
|
|
|
+ getModifyDescription(row,type,dataType='string'){
|
|
|
if(row.patentClaimHistoryList){
|
|
|
var obj = row.patentClaimHistoryList.find(item=>{
|
|
|
if(type == 1){
|
|
|
- return item.ifFirst && item.description
|
|
|
+ return item.operateType != 2 && item.ifFirst
|
|
|
}else if(type == 2){
|
|
|
- return !item.ifFirst && item.description
|
|
|
+ return item.operateType != 2 && !item.ifFirst
|
|
|
}
|
|
|
})
|
|
|
if(obj){
|
|
|
- return obj.description
|
|
|
+ if(dataType == 'string'){
|
|
|
+ return obj.description
|
|
|
+ }else if(dataType == 'object'){
|
|
|
+ return obj
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ return ''
|
|
|
}
|
|
|
}
|
|
|
return ''
|
|
@@ -353,6 +548,12 @@ export default {
|
|
|
.head{
|
|
|
width:100%;
|
|
|
display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.headLeft{
|
|
|
+ width:100%;
|
|
|
+ display: flex;
|
|
|
flex-direction: row-reverse;
|
|
|
}
|
|
|
</style>
|