|
@@ -39,7 +39,13 @@
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<span v-if="scope.row.vVisible">
|
|
<span v-if="scope.row.vVisible">
|
|
<span v-if="scope.row.reportFiles">
|
|
<span v-if="scope.row.reportFiles">
|
|
- <div v-for="item in scope.row.reportFiles" style="margin:0;display:flex;justify-content:space-around;"><p style="margin:0;width:calc(100% - 40px);overflow: hidden;white-space: nowrap;text-overflow:ellipsis">{{item.name?item.name:item.fileName}}</p></div>
|
|
|
|
|
|
+ <div v-for="item in scope.row.reportFiles" style="margin:0;display:flex;justify-content:space-around;align-items:center;">
|
|
|
|
+ <p style="margin:0;width:calc(100% - 40px);overflow: hidden;white-space: nowrap;text-overflow:ellipsis;cursor: pointer">{{item.name?item.name+'.'+item.suffix:item.fileName}}</p>
|
|
|
|
+ <Menu :data="item" @delFile="delFile1(scope.row,item.id,scope.$index)"></Menu>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- <div v-for="item in scope.row.reportFiles" style="margin:0;display:flex;justify-content:space-around;">
|
|
|
|
+ <p style="margin:0;width:calc(100% - 40px);overflow: hidden;white-space: nowrap;text-overflow:ellipsis">{{item.name?item.name:item.fileName}}</p>
|
|
|
|
+ </div> -->
|
|
</span>
|
|
</span>
|
|
<span v-else><i class="el-icon-minus"></i></span>
|
|
<span v-else><i class="el-icon-minus"></i></span>
|
|
</span>
|
|
</span>
|
|
@@ -61,11 +67,11 @@
|
|
<el-table-column label="操作" width="160" align="center">
|
|
<el-table-column label="操作" width="160" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<div class="special">
|
|
<div class="special">
|
|
- <span v-if="scope.row.vVisible" class="items" @click="edit(scope.row)">编辑</span>
|
|
|
|
- <span v-else class="items" @click="edit(scope.row)">保存</span>
|
|
|
|
|
|
+ <span v-if="scope.row.vVisible" class="items" @click="edit(scope.row,scope.$index)">编辑</span>
|
|
|
|
+ <span v-else class="items" @click="edit(scope.row,scope.$index)">保存</span>
|
|
<span> | </span>
|
|
<span> | </span>
|
|
<span v-if="scope.row.vVisible" class="items" @click="deleteit(scope.row)">删除</span>
|
|
<span v-if="scope.row.vVisible" class="items" @click="deleteit(scope.row)">删除</span>
|
|
- <span v-else class="items" @click="close(scope.row)">取消</span>
|
|
|
|
|
|
+ <span v-else class="items" @click="cancel(scope.row,scope.$index)">取消</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -77,7 +83,11 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import Menu from '@/views/components/common/menu/index2.vue'
|
|
export default {
|
|
export default {
|
|
|
|
+ components:{
|
|
|
|
+ Menu
|
|
|
|
+ },
|
|
props:["patent"],
|
|
props:["patent"],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -174,7 +184,34 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
- edit(row) {
|
|
|
|
|
|
+ delFile1(row,id,index){
|
|
|
|
+ var index = row.reportFiles.findIndex(item=>{
|
|
|
|
+ return item.id == id
|
|
|
|
+ })
|
|
|
|
+ if(index!=-1){
|
|
|
|
+ row.reportFiles.splice(index,1)
|
|
|
|
+ }
|
|
|
|
+ this.update(row,index)
|
|
|
|
+ },
|
|
|
|
+ update(row,index){
|
|
|
|
+ let formData = new FormData()
|
|
|
|
+ if(row.fileList){
|
|
|
|
+ for (var i = 0; i < row.fileList.length; i++) {
|
|
|
|
+ formData.append("files", row.fileList[i]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ row.patentNo = this.patent.publicNo
|
|
|
|
+ formData.append("jsons", JSON.stringify(row));
|
|
|
|
+ if (row.id) {
|
|
|
|
+ this.$api.editInvalidRecord(formData).then(res => {
|
|
|
|
+ if (res.code==200) {
|
|
|
|
+ this.$message.success('修改成功')
|
|
|
|
+ this.getList2(row,index)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ edit(row,index) {
|
|
if (row.vVisible == false) {
|
|
if (row.vVisible == false) {
|
|
// let data = {
|
|
// let data = {
|
|
|
|
|
|
@@ -199,42 +236,34 @@ export default {
|
|
this.$api.editInvalidRecord(formData).then(res => {
|
|
this.$api.editInvalidRecord(formData).then(res => {
|
|
if (res.code==200) {
|
|
if (res.code==200) {
|
|
this.$message.success('修改成功')
|
|
this.$message.success('修改成功')
|
|
- this.getList()
|
|
|
|
|
|
+ this.getList2(row,index)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
this.$api.addInvalidRecord(formData).then(res => {
|
|
this.$api.addInvalidRecord(formData).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.$message.success('保存成功')
|
|
this.$message.success('保存成功')
|
|
- this.getList()
|
|
|
|
|
|
+ this.getList2(row,index)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
// this.isEdit = false
|
|
// this.isEdit = false
|
|
// row.vVisible = !row.vVisible
|
|
// row.vVisible = !row.vVisible
|
|
|
|
+ }else{
|
|
|
|
+ row.RowData = JSON.parse(JSON.stringify(row))
|
|
}
|
|
}
|
|
- // else{
|
|
|
|
- // if(this.isEdit){
|
|
|
|
- // this.$alert('您有修改未保存,请先保存修改', '提示', {
|
|
|
|
- // confirmButtonText: '确定',
|
|
|
|
- // callback: action => {
|
|
|
|
- // // this.$message({
|
|
|
|
- // // type: 'info',
|
|
|
|
- // // message: `action: ${ action }`
|
|
|
|
- // // });
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // }else{
|
|
|
|
- // // row.vVisible = !row.vVisible
|
|
|
|
- // this.isEdit = true
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // }
|
|
|
|
- // if(this.isEdit == false){
|
|
|
|
-
|
|
|
|
- // }
|
|
|
|
row.vVisible = !row.vVisible
|
|
row.vVisible = !row.vVisible
|
|
},
|
|
},
|
|
|
|
+ getList2(row,index){
|
|
|
|
+ this.$api.queryInvalidRecord(this.queryParams).then(res => {
|
|
|
|
+ if (res.code==200) {
|
|
|
|
+ if(!row.id){
|
|
|
|
+ this.$set(this.invalidData[index],'id',res.data.records[index].id)
|
|
|
|
+ }
|
|
|
|
+ this.$set(this.invalidData[index],'reportFiles',res.data.records[index].reportFiles)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
formatDateTime(date) {
|
|
formatDateTime(date) {
|
|
var y = date.getFullYear();
|
|
var y = date.getFullYear();
|
|
var m = date.getMonth() + 1;
|
|
var m = date.getMonth() + 1;
|
|
@@ -269,8 +298,18 @@ export default {
|
|
|
|
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- close() {
|
|
|
|
- this.getList()
|
|
|
|
|
|
+ cancel(row,index) {
|
|
|
|
+ if(row.id){
|
|
|
|
+ var index1 = this.invalidData.findIndex(item=>{
|
|
|
|
+ return item.id == row.id
|
|
|
|
+ })
|
|
|
|
+ if(index1!=-1){
|
|
|
|
+ this.$set(this.invalidData,index1,row.RowData)
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ this.invalidData.splice(index,1)
|
|
|
|
+ }
|
|
|
|
+ // this.getList()
|
|
},
|
|
},
|
|
getList() {
|
|
getList() {
|
|
this.$api.queryInvalidRecord(this.queryParams).then(res => {
|
|
this.$api.queryInvalidRecord(this.queryParams).then(res => {
|