|
@@ -137,33 +137,26 @@ export default{
|
|
|
getCompareRecordData(column,props=[]){
|
|
|
var key = 'compareRecord'
|
|
|
if(!this.editModel && !this.hasCopy[key]){
|
|
|
-
|
|
|
- if(this.dataObj.compareRecord && this.dataObj.compareRecord.length>0){
|
|
|
+
|
|
|
+ if(this.dataObj.compareLiterature && this.dataObj.compareLiterature.length>0){
|
|
|
var data = []
|
|
|
var that = this
|
|
|
- var compareRecord = this.groupBy(this.dataObj.compareRecord,'patentNo')
|
|
|
- var patents = Object.keys(compareRecord)
|
|
|
- patents.forEach(async (item,index) => {
|
|
|
- //获取专利信息
|
|
|
+ var compareRecord = {}
|
|
|
+ if(this.dataObj.compareRecord && this.dataObj.compareRecord.length>0){
|
|
|
+ compareRecord = this.groupBy(this.dataObj.compareRecord,'patentNo')
|
|
|
+ }
|
|
|
+ this.dataObj.compareLiterature.forEach(async (item,index)=>{
|
|
|
+ item.patentNo = item.literatureNo
|
|
|
var compareRecord1 = {
|
|
|
- patentNo:item,
|
|
|
- data:compareRecord[item]
|
|
|
+ patentNo:item.literatureNo,
|
|
|
+ data:compareRecord[item.patentNo]||[],
|
|
|
+ compareLiterature:item,
|
|
|
+ noveltyCompareRecordVOS:item.noveltyCompareRecordVOS
|
|
|
}
|
|
|
if(props.indexOf('patentMessage') !=-1){
|
|
|
- var patent = await that.getPatentMessage(item)
|
|
|
+ var patent = await that.getPatentMessage(item.patentNo)
|
|
|
compareRecord1.patentMessage = patent
|
|
|
}
|
|
|
- if(props.indexOf('noveltyRemark') !=-1){
|
|
|
- var obj = this.dataObj.compareLiterature.find(file=>{
|
|
|
- return file.literatureNo == item
|
|
|
- })
|
|
|
- if(obj){
|
|
|
- if(obj.noveltyCompareRecordVOS && obj.noveltyCompareRecordVOS.length>0){
|
|
|
- compareRecord1.noveltyCompareRecordVOS = obj.noveltyCompareRecordVOS
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
var obj = {
|
|
|
index:index+1
|
|
|
}
|
|
@@ -173,11 +166,53 @@ export default{
|
|
|
|
|
|
})
|
|
|
data.push(obj)
|
|
|
- });
|
|
|
+
|
|
|
+ })
|
|
|
this.$set(this.reportData,'compareRecord',data)
|
|
|
}else{
|
|
|
this.$set(this.reportData,'compareRecord',[{index:1}])
|
|
|
}
|
|
|
+
|
|
|
+ // if(this.dataObj.compareRecord && this.dataObj.compareRecord.length>0){
|
|
|
+ // var data = []
|
|
|
+ // var that = this
|
|
|
+ // var compareRecord = this.groupBy(this.dataObj.compareRecord,'patentNo')
|
|
|
+ // var patents = Object.keys(compareRecord)
|
|
|
+ // patents.forEach(async (item,index) => {
|
|
|
+ // //获取专利信息
|
|
|
+ // var compareRecord1 = {
|
|
|
+ // patentNo:item,
|
|
|
+ // data:compareRecord[item]
|
|
|
+ // }
|
|
|
+ // if(props.indexOf('patentMessage') !=-1){
|
|
|
+ // var patent = await that.getPatentMessage(item)
|
|
|
+ // compareRecord1.patentMessage = patent
|
|
|
+ // }
|
|
|
+ // if(props.indexOf('noveltyRemark') !=-1){
|
|
|
+ // var obj = this.dataObj.compareLiterature.find(file=>{
|
|
|
+ // return file.literatureNo == item
|
|
|
+ // })
|
|
|
+ // if(obj){
|
|
|
+ // if(obj.noveltyCompareRecordVOS && obj.noveltyCompareRecordVOS.length>0){
|
|
|
+ // compareRecord1.noveltyCompareRecordVOS = obj.noveltyCompareRecordVOS
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // var obj = {
|
|
|
+ // index:index+1
|
|
|
+ // }
|
|
|
+ // column.forEach(co=>{
|
|
|
+ // var field = co.key
|
|
|
+ // obj[field] = that.$commonJS.getColumnData(compareRecord1,co)
|
|
|
+
|
|
|
+ // })
|
|
|
+ // data.push(obj)
|
|
|
+ // });
|
|
|
+ // this.$set(this.reportData,'compareRecord',data)
|
|
|
+ // }else{
|
|
|
+ // this.$set(this.reportData,'compareRecord',[{index:1}])
|
|
|
+ // }
|
|
|
this.hasCopy[key] = true
|
|
|
}
|
|
|
if(this.reportData.compareRecord.length == 0){
|
|
@@ -187,12 +222,25 @@ export default{
|
|
|
},
|
|
|
delCompareRecord(data,index){
|
|
|
data.splice(index,1)
|
|
|
+ for(var i = index;i++;i<data.length){
|
|
|
+ var item = data[i]
|
|
|
+ if(item.index == 0 || item.index){
|
|
|
+ item.index = Number(item.index) - 1
|
|
|
+ }else{
|
|
|
+ item.index = i + 1
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
},
|
|
|
addCompareRecord(data,index){
|
|
|
data.splice(index+1,0,{index:index+1})
|
|
|
for(var i = index+1;i++;i<data.length){
|
|
|
var item = data[i]
|
|
|
- item.index = Number(item.index) + 1
|
|
|
+ if(item.index == 0 || item.index){
|
|
|
+ item.index = Number(item.index) + 1
|
|
|
+ }else{
|
|
|
+ item.index = i + 1
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
async getPatentMessage(patentNo){
|