|
@@ -249,7 +249,7 @@
|
|
getSelectedTotal(){
|
|
getSelectedTotal(){
|
|
this.selectedTotal = Number(this.endNumber) - Number(this.startNumber) + 1 + Number(this.queryParams.isAdd.length) - Number(this.queryParams.isDelete.length)
|
|
this.selectedTotal = Number(this.endNumber) - Number(this.startNumber) + 1 + Number(this.queryParams.isAdd.length) - Number(this.queryParams.isDelete.length)
|
|
},
|
|
},
|
|
- Switch(type) {//选择...确定公用
|
|
|
|
|
|
+ async Switch(type) {//选择...确定公用
|
|
let params = { ...this.queryParams }
|
|
let params = { ...this.queryParams }
|
|
if (params.field.length == 0) {
|
|
if (params.field.length == 0) {
|
|
params.field = params.tree
|
|
params.field = params.tree
|
|
@@ -259,8 +259,51 @@
|
|
this.queryParams.selected = this.tableData.map(item => item.patentNo);
|
|
this.queryParams.selected = this.tableData.map(item => item.patentNo);
|
|
this.checkList = [...new Set(this.checkList.concat(this.queryParams.selected))]
|
|
this.checkList = [...new Set(this.checkList.concat(this.queryParams.selected))]
|
|
// this.endNumber = this.queryParams.endNumber
|
|
// this.endNumber = this.queryParams.endNumber
|
|
- this.selectedTotal = this.checkList.length
|
|
|
|
|
|
+ // this.selectedTotal = this.checkList.length
|
|
|
|
+ //
|
|
|
|
+
|
|
|
|
+ if(!this.quickSelect){
|
|
this.queryParams.isAdd=JSON.parse(JSON.stringify(this.checkList))
|
|
this.queryParams.isAdd=JSON.parse(JSON.stringify(this.checkList))
|
|
|
|
+ this.getSelectedTotal()
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ this.tableData.forEach((item,index)=>{
|
|
|
|
+ var position = (this.queryParams.current-1)*this.queryParams.size + index + 1
|
|
|
|
+ if(position>=this.startNumber){
|
|
|
|
+ if(this.endNumber>=this.queryParams.current * this.queryParams.size){
|
|
|
|
+ var index1 = this.queryParams.isDelete.findIndex(i=>{
|
|
|
|
+ return i == item.patentNo
|
|
|
|
+ })
|
|
|
|
+ if(index1!=-1){
|
|
|
|
+ this.queryParams.isDelete.splice(index1,1)
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ if(position<=this.endNumber){
|
|
|
|
+ var index1 = this.queryParams.isDelete.findIndex(i=>{
|
|
|
|
+ return i == item.patentNo
|
|
|
|
+ })
|
|
|
|
+ if(index1!=-1){
|
|
|
|
+ this.queryParams.isDelete.splice(index1,1)
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ var index2 = this.queryParams.isAdd.findIndex(i=>{
|
|
|
|
+ return i == item.patentNo
|
|
|
|
+ })
|
|
|
|
+ if(index2==-1){
|
|
|
|
+ this.queryParams.isAdd.push(item.patentNo)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ var index2 = this.queryParams.isAdd.findIndex(i=>{
|
|
|
|
+ return i == item.patentNo
|
|
|
|
+ })
|
|
|
|
+ if(index2==-1){
|
|
|
|
+ this.queryParams.isAdd.push(item.patentNo)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.getSelectedTotal()
|
|
this.getList()
|
|
this.getList()
|
|
break
|
|
break
|
|
case 1:
|
|
case 1:
|
|
@@ -285,7 +328,12 @@
|
|
// })
|
|
// })
|
|
this.queryParams.isDelete = []
|
|
this.queryParams.isDelete = []
|
|
this.queryParams.isAdd = []
|
|
this.queryParams.isAdd = []
|
|
- if(type == 2){
|
|
|
|
|
|
+ if (type == 2) {
|
|
|
|
+ if (!Number(this.queryParams.startNumber)||!Number(this.queryParams.endNumber)) {
|
|
|
|
+ this.queryParams.endNumber =this.endNumber>0?this.endNumber:this.total
|
|
|
|
+ this.queryParams.startNumber =this.endNumber>0?this.startNumber:1
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
this.startNumber = this.queryParams.startNumber
|
|
this.startNumber = this.queryParams.startNumber
|
|
this.endNumber = this.queryParams.endNumber
|
|
this.endNumber = this.queryParams.endNumber
|
|
}
|
|
}
|
|
@@ -294,9 +342,8 @@
|
|
this.checkList=[]
|
|
this.checkList=[]
|
|
this.queryParams.isDelete = []
|
|
this.queryParams.isDelete = []
|
|
this.queryParams.isAdd = []
|
|
this.queryParams.isAdd = []
|
|
- this.getList()
|
|
|
|
|
|
+ await this.getList()
|
|
this.commonSwitch()
|
|
this.commonSwitch()
|
|
- console.log(this.checkList);
|
|
|
|
this.quickSelect = true
|
|
this.quickSelect = true
|
|
|
|
|
|
break
|
|
break
|
|
@@ -566,7 +613,7 @@
|
|
// this.checkList = []
|
|
// this.checkList = []
|
|
// this.queryParams.endNumber=0
|
|
// this.queryParams.endNumber=0
|
|
await this.getList();
|
|
await this.getList();
|
|
- console.log(this.checkList);
|
|
|
|
|
|
+ // console.log(this.checkList);
|
|
if(this.quickSelect){
|
|
if(this.quickSelect){
|
|
this.commonSwitch()
|
|
this.commonSwitch()
|
|
}
|
|
}
|
|
@@ -583,7 +630,7 @@
|
|
}
|
|
}
|
|
this.queryParams.startNumber=this.startNumber,
|
|
this.queryParams.startNumber=this.startNumber,
|
|
this.queryParams.endNumber=this.endNumber,
|
|
this.queryParams.endNumber=this.endNumber,
|
|
- this.queryParams.reportId=this.reportId,
|
|
|
|
|
|
+ this.queryParams.reportId = this.reportId,
|
|
this.$api.deleteCompareNo(this.queryParams).then(res => {
|
|
this.$api.deleteCompareNo(this.queryParams).then(res => {
|
|
if (res.code==200) {
|
|
if (res.code==200) {
|
|
this.startNumber = 1
|
|
this.startNumber = 1
|
|
@@ -593,10 +640,10 @@
|
|
this.queryParams.isAdd=[]
|
|
this.queryParams.isAdd=[]
|
|
this.queryParams.isDelete=[]
|
|
this.queryParams.isDelete=[]
|
|
this.checkList = []
|
|
this.checkList = []
|
|
- for (let key in this.form) {
|
|
|
|
- this.queryParams[key]=''
|
|
|
|
- }
|
|
|
|
- this.form = {}
|
|
|
|
|
|
+ // for (let key in this.form) {
|
|
|
|
+ // this.queryParams[key]=''
|
|
|
|
+ // }
|
|
|
|
+ // this.form = {}
|
|
this.getList2()
|
|
this.getList2()
|
|
this.$emit("save", true);
|
|
this.$emit("save", true);
|
|
this.$message({
|
|
this.$message({
|
|
@@ -653,7 +700,7 @@
|
|
// this.checkList =JSON.parse(JSON.stringify([...new Set(this.checkList.concat(this.queryParams.selected))]))
|
|
// this.checkList =JSON.parse(JSON.stringify([...new Set(this.checkList.concat(this.queryParams.selected))]))
|
|
// this.selected = this.checkList
|
|
// this.selected = this.checkList
|
|
this.isFetch = true
|
|
this.isFetch = true
|
|
-
|
|
|
|
|
|
+
|
|
// this.selectedTotal=response.data.selectedTotal+(this.endNumber-this.startNumber+1)+this.queryParams.isAdd.length-this.queryParams.isDelete.length
|
|
// this.selectedTotal=response.data.selectedTotal+(this.endNumber-this.startNumber+1)+this.queryParams.isAdd.length-this.queryParams.isDelete.length
|
|
|
|
|
|
}).catch(error => {
|
|
}).catch(error => {
|