<template>
<div>
<el-table
:data="tableData"
stripe
style="width: 100%"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
:selectable="selectable"
>
</el-table-column>
<el-table-column
type="index"
width="50"
>
</el-table-column>
<el-table-column
prop="hash.username"
label="人员姓名"
>
</el-table-column>
<el-table-column
prop="hash.grantime"
label="获奖时间"
>
</el-table-column>
<el-table-column
prop="hash.content"
label="获奖内容"
>
</el-table-column>
<el-table-column label="附件">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="checkfilink(scope.row)">查看</el-button>
</template>
</el-table-column>
<el-table-column
label="审核状态"
>
<template slot-scope="scope">
<span v-if="scope.row.hash.status=='1'">审核通过</span>
<span v-if="scope.row.hash.status=='2'" style="color:red">审核不通过</span>
</template>
</el-table-column>
</el-table>
<el-pagination
@current-change="handleCurrentChange"
:currentPage.sync="pagobj.currentPage3"
:pageSize="pagobj.pagesize"
layout="total, prev, pager, next"
:total="pagobj.total"
style="margin:20px 0;text-align:center"
>
</el-pagination>
<el-dialog title="附件信息" :visible.sync="dialogVisible" width="40%">
<el-form labelWidth="150px">
<el-table
:data="flinklist"
stripe
style="width: 100%"
>
<el-table-column type="index" width="50" label="序号"></el-table-column>
<el-table-column prop="hash.filename" label="附件名"></el-table-column>
<el-table-column label="附件">
<template slot-scope="scope">
<el-button size="mini" type="primary"><a :href="scope.row.hash.fileurl" download="" target="_Blank" style="color:#fff">下 载</a></el-button>
</template>
</el-table-column>
</el-table>
<el-form-item>
<div> </div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="mini" type="primary" @click="dialogVisible = false">返 回</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
ts: this.newStore(),
dialogVisible: false,
flinklist:[],//拿到的附件数据
};
},
props: {
tableData: {
type: Array,
required: true,
},
pagobj: {
type: Object,
required: true,
},
},
methods:{
selectable(row){
if (row.hash.status=='1') {
return 0
}else{
return 1
}
},
// 编辑
checkfilink(item) {
console.log(item, "00000");
const req = {
handle: "0E56125B90D2898ACAD2C3968249185CCD3A43E9777C4E90",
filetype:'achieve',
mainid: item.hash.id
};
this.spost(this.ts, "/mainservlet", req).then(ts => {
if (ts.d.sflag == "success") {
this.flinklist=ts.d.data.operation1
console.log(ts.d.data, "0909");
this.dialogVisible = true;
}
});
},
handleSelectionChange(val){
console.log(val,'888');
this.$emit('itemvals',val)
},
handleCurrentChange() {
this.$parent.getperlist();
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible2 = true;
}
},
}
</script>