import addMessage from '../dialog/form.vue'
export default{
    components:{
        addMessage
    },
    props:{
        patent:{
            default:()=>{
                return {}
            }
        },
        patentNo:{
            default:''
        },
        projectId:{}
    },
    data() {
        return {
            tableData:[],
            queryParams:{
                patentNo:this.patentNo,
                current:1,
                size:10
            },
            total:0,
            loading:false
        }
    },
    watch:{
        patentNo(val){
            this.queryParams.patentNo = val
            this.getList()
        }
    },
    mounted() {
        this.getList()
    },
    methods: {
        handleCurrentChange(val){
            this.queryParams.current = val
            this.getList()
        },
        delFile(row,file){
            this.$confirm('是否删除该文件', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                var index = row.fileGuids.findIndex(item=>{
                    return item == file.guid
                })
                if(index != -1){
                    row.fileGuids.splice(index,1)
                }
                this.save(row)
            })
        },
        checkReport(row){
            let router = this.$router.resolve({
                path: '/reportDetails',
                query: {
                  projectId: row.projectId,
                  patentNo:row.signPatentNo,
                  signPatentNo:row.signPatentNo,
                  reportType: row.reportType,
                  status:row.status,
                }
            })
            window.open(router.href, '_blank')
        },
    },
}