|
@@ -142,7 +142,8 @@ export default {
|
|
|
return {
|
|
|
tableData:[],
|
|
|
btnLoading:false,
|
|
|
- evidences:[]
|
|
|
+ evidences:[],
|
|
|
+ hasSave:[]
|
|
|
};
|
|
|
},
|
|
|
watch: {},
|
|
@@ -249,12 +250,18 @@ export default {
|
|
|
},
|
|
|
//保存
|
|
|
save(){
|
|
|
-
|
|
|
- var data = this.tableData.filter(item=>{
|
|
|
- return item.name
|
|
|
- })
|
|
|
+ if(this.tableData.length == 0){
|
|
|
+ this.$message.warning('请先添加证据文献')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var dataList = []
|
|
|
+ let hasSave = JSON.parse(JSON.stringify(this.hasSave))
|
|
|
+ let data = this.tableData
|
|
|
for(var i = 0;i<data.length;i++){
|
|
|
if(data[i].name){
|
|
|
+ if(hasSave.indexOf(data[i].sysOrder) != -1){
|
|
|
+ continue
|
|
|
+ }
|
|
|
if(data[i].type == 0){
|
|
|
data[i].literatureNo = data[i].name
|
|
|
}else{
|
|
@@ -262,20 +269,27 @@ export default {
|
|
|
data[i].literatureNo = data[i].fileGuids[0]
|
|
|
}
|
|
|
}
|
|
|
+ hasSave.push(data[i].sysOrder)
|
|
|
+ dataList.push(data[i])
|
|
|
}
|
|
|
}
|
|
|
+ if(dataList.length == 0){
|
|
|
+ this.$message.warning('当前证据文献已导入')
|
|
|
+ return
|
|
|
+ }
|
|
|
var params = {
|
|
|
- updateBatchLiteratureDTOs:data,
|
|
|
+ updateBatchLiteratureDTOs:dataList,
|
|
|
projectId:this.projectId
|
|
|
}
|
|
|
this.btnLoading = true
|
|
|
this.$api.updateCompareLiteratureBatch(params).then(response=>{
|
|
|
if(response.code == 200){
|
|
|
- this.$message.success('任务已发起,等待导入中...')
|
|
|
+ this.$message.success('导入成功')
|
|
|
+ this.hasSave = hasSave
|
|
|
this.btnLoading = false
|
|
|
}
|
|
|
}).catch(error=>{
|
|
|
- this.$message.error('任务添加失败')
|
|
|
+ this.$message.error('导入失败')
|
|
|
this.btnLoading =false
|
|
|
})
|
|
|
},
|