<el-tabs v-model="activeName">
<el-tab-pane label="未审核" name="1">
<el-table
border
style="width: 100%"
:data="tableData"
ref="multipleTable"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="75" align="center"></el-table-column>
<el-table-column
type="index"
label="序号"
width="100"
align="center"
show-overflow-tooltip
></el-table-column>
<el-table-column label="申请名称" width="100" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<a
target="_blank"
@click="updatasee(scope.row.ID)"
style="cursor: pointer;color: #3B9AF9;"
>{{scope.row.SQMC}}</a>
</template>
</el-table-column>
<el-table-column
property="SQMS"
label="申请描述"
width="100"
align="center"
show-overflow-tooltip
></el-table-column>
<el-table-column property="ZXDWID" label="执行单位" align="center" show-overflow-tooltip></el-table-column>
<el-table-column property="ZXZQ" label="执行周期" align="center" show-tooltip-when-overflow></el-table-column>
<el-table-column property="SJLX" label="数据类型" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.SJLX == 0" >矢量数据</span>
<span v-if="scope.row.SJLX == 1" >影像数据</span>
<span v-if="scope.row.SJLX == 2" >POI数据</span>
<span v-if="scope.row.SJLX == 3" >大比例尺数据</span>
</template>
</el-table-column>
<el-table-column property="SJFW" label="数据范围" align="center" show-overflow-tooltip></el-table-column>
<el-table-column
property="SJFW"
label="数据范围级别"
width="130"
align="center"
show-overflow-tooltip
></el-table-column>
<el-table-column label="是否含有数据成果" width="160" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.SFHYSJCG == 0">否</span>
<span v-if="scope.row.SFHYSJCG == 1">是</span>
</template>
</el-table-column>
<el-table-column property="SQSJ" label="申请时间" align="center" show-overflow-tooltip></el-table-column>
<el-table-column property="BZ" label="备注" align="center" show-overflow-tooltip></el-table-column>
<el-table-column property="SHZT" label="审核状态" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.SHZT == 1">待审核</span>
<span v-if="scope.row.SHZT == 2">已审核</span>
</template>
</el-table-column>
<el-table-column
label="操作"
width="130"
align="center"
fixed="right"
v-if="activeName == '1'"
>
<template slot-scope="scope">
<a style="cursor:pointer;vertical-align: middle;">
<i title="审核" @click="jumpeditsh(scope.row.ID)" class="fa fa-edit fa-lg"></i>
</a>
<a style="cursor:pointer;margin-left:5px" @click="downsee(scope.row.ID)">
<i class="fa fa-download fa-lg" style="color: red;" title="导出"></i>
</a>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="已审核" name="2">
<el-table border style="width: 100%" :data="tableData">
<el-table-column
type="index"
label="序号"
width="100"
align="center"
show-overflow-tooltip
></el-table-column>
<el-table-column
property="SQMC"
label="申请名称"
width="100"
align="center"
show-overflow-tooltip
>
<template slot-scope="scope">
<a
target="_blank"
@click="updatasee(scope.row.ID)"
style="cursor: pointer;color: #3B9AF9;"
>{{scope.row.SQMC}}</a>
</template>
</el-table-column>
<el-table-column
property="SQMS"
label="申请描述"
width="100"
align="center"
show-overflow-tooltip
></el-table-column>
<el-table-column property="ZXDWID" label="执行单位" align="center" show-overflow-tooltip></el-table-column>
<el-table-column property="ZXZQ" label="执行周期" align="center" show-tooltip-when-overflow></el-table-column>
<el-table-column property="SJLX" label="数据类型" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.SJLX == 0" >矢量数据</span>
<span v-if="scope.row.SJLX == 1" >影像数据</span>
<span v-if="scope.row.SJLX == 2" >POI数据</span>
<span v-if="scope.row.SJLX == 3" >大比例尺数据</span>
</template>
</el-table-column>
<el-table-column property="SJFW" label="数据范围" align="center" show-overflow-tooltip></el-table-column>
<el-table-column
property="SJFW"
label="数据范围级别"
width="130"
align="center"
show-overflow-tooltip
></el-table-column>
<el-table-column
property="SFHYSJCG"
label="是否含有数据成果"
width="160"
align="center"
show-overflow-tooltip
>
<template slot-scope="scope">
<span v-if="scope.row.SFHYSJCG == 0">否</span>
<span v-if="scope.row.SFHYSJCG == 1">是</span>
</template>
</el-table-column>
<el-table-column property="SQSJ" label="申请时间" align="center" show-overflow-tooltip></el-table-column>
<el-table-column property="BZ" label="备注" align="center" show-overflow-tooltip></el-table-column>
<el-table-column property="SHZT" label="审核状态" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.SHZT == 1">待审核</span>
<span v-if="scope.row.SHZT == 2">已审核</span>
</template>
</el-table-column>
<el-table-column
label="操作"
width="130"
align="center"
fixed="right"
>
<template slot-scope="scope">
<a style="cursor:pointer;margin-left:5px" @click="downsee(scope.row.ID)">
<i class="fa fa-download fa-lg" style="color: red;" title="导出"></i>
</a>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
页面如上,elementUI中有一个方法,我觉得挺好的直接做判断就可以了
//选择表格中的某一项进行提交或退回
handleSelectionChange(val) {
let info = {};
if (this.activename == "1") {
this.$refs.multipleTable.clearSelection();
return false;
}
if (val.length > 1) {
this.$refs.multipleTable.clearSelection();
this.$message("仅能提交一条数据");
return false;
} else if (val.length == 1) {
info = val;
} else {
info = {};
}
this.sjdata = info[0];
}