<template>
<basic-container>
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
>
自定义顶部按钮
<template slot="menuLeft">
<el-button
type="primary"
size="small"
icon="el-icon-download"
@click="exportFn"
>导出台账
</el-button>
</template>
自定义列表按钮
<template slot="menu" slot-scope="scope">
<el-button
type="text"
size="small"
icon="el-icon-view"
@click="lookFn(scope.row)"
>查看
</el-button>
</template>
<!-- <template slot-scope="{ row }" slot="category">
<el-tag>{{ row.categoryName }}</el-tag>
</template> -->
<!-- 申报日期/ -->
//自定义搜索
// declareTime 是prop的值
<template slot="declareTimeSearch">
<el-date-picker
v-model="createTimeRange"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="createTimeChange"
>
</el-date-picker>
</template>
自定义搜索
<template slot="jeqjSearch">
<div>
<el-input v-model="startAmount" style="width:100px;margin-right: 5px;"></el-input>
-<el-input v-model="endAmount" style="width:100px;margin-left: 5px;"></el-input>
</div>
</template>
</avue-crud>
</basic-container>
</template>
<script>
export default {
data() {
return {
processInsId:'',
// 开始金额。/
startAmount:'',
// 结束金额
endAmount:'',
dialogVisible: false,
createTimeRange: [],
form: {},
query: {},
loading: true,
search: {},
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
selectionList: [],
option: {
column: [
{
label: "申报日期",
prop: "declareTime",
search: true,
},
{
label: "金额区间",
prop: "jeqj",
search: true,
hide: true,
}
],
},
data: [],
};
},
methods: {
// 时间搜索
createTimeChange(val) {
if (val) {
this.$set(this.search, "declarerStartDate", val[0]);
this.$set(this.search, "declarerEndDate", val[1]);
} else {
this.$set(this.search, "declarerStartDate", "");
this.$set(this.search, "declarerEndDate", "");
}
},
//搜索方法
searchChange(params, done) {
var reg = /^[0-9]*$ /
//金额
if(reg.test(this.startAmount) || reg.test(this.endAmount)){
params.startAmount = this.startAmount
params.endAmount = this.endAmount
}else{
this.startAmount = ''
this.endAmount = ''
this.$message({
type: "warning",
message: "金额只能输入数字",
});
}
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
},
},
};
</script>
<style>
</style>
avue 自定义搜索内容
最新推荐文章于 2024-08-20 11:29:48 发布