diff --git a/src/views/timeSet/batch/Index.vue b/src/views/timeSet/batch/Index.vue index 33c1363f8fdf657be6fb4e06932b47d7c82f78d5..4be2b1e75274276622e743b325f0fd771ec664a9 100644 --- a/src/views/timeSet/batch/Index.vue +++ b/src/views/timeSet/batch/Index.vue @@ -1,8 +1,11 @@ <template> <div class="app-content"> - <div class="submit-btn"> - <a-button type="primary" class="search_input" style="margin-right: 10px;" @click="createBatch">添加</a-button> - </div> + <a-form :form="form" :model="searchForm" layout="inline" class="search_form"> + <a-form-item> + <a-button type="primary" class="search_input" style="margin-right: 10px;" @click="createBatch">添加</a-button> + <a-button type="primary" @click="search">刷新</a-button> + </a-form-item> + </a-form> <a-table :dataSource="tableData" :columns="columns" rowKey="id" :pagination="false" :loading="loading" bordered> <template slot="option" slot-scope="record"> <a-button type="link" size="small" @click="recordClick(record,'edit')">修改</a-button> @@ -20,12 +23,14 @@ import { getType } from '@/views/utils/auth' import batchEdit from '@/views/timeSet/batch/components/batchEdit' import moment from 'moment' - +import { isEmptyParams} from "@/views/utils/common" export default { name: 'batchSet', components: { batchEdit }, data () { return { + searchForm: { projType: getType(), timeType: 1, }, + form: this.$form.createForm(this, { name: 'advanced_search' }), tableData: [], columns: [ { key: '1', title: '申报年度', dataIndex: 'year', align: 'center' }, @@ -56,7 +61,8 @@ export default { moment, getListByPage () { this.loading = true - let par = { projType: getType(), timeType: 1, pageIndex: this.pagination.pageIndex, pageSize: this.pagination.pageSize } + let pars = isEmptyParams(this.searchForm) + let par = { ...pars, pageIndex: this.pagination.pageIndex, pageSize: this.pagination.pageSize } this.$api.batch.getListByPage(par).then(({ data = {} }) => { if (data) { const { dataList = [], total = 0 } = data @@ -66,6 +72,14 @@ export default { } }).catch(() => { this.loading = false }) }, + search () { + this.pagination.pageIndex = 1 + this.getListByPage() + }, + reset () { + this.pagination.pageIndex = 1 + this.getListByPage() + }, change () { this.getListByPage() }, diff --git a/src/views/timeSet/taskTimeSet/Index.vue b/src/views/timeSet/taskTimeSet/Index.vue index 99548f7c63645ce8657ce04fc310222620b6e6b2..f92d15c9ea9905850edb246ceb242225ad954e60 100644 --- a/src/views/timeSet/taskTimeSet/Index.vue +++ b/src/views/timeSet/taskTimeSet/Index.vue @@ -1,8 +1,11 @@ <template> <div class="app-content"> - <div class="submit-btn"> - <a-button type="primary" class="search_input" style="margin-right: 10px;" @click="createBatch">添加</a-button> - </div> + <a-form :form="form" :model="searchForm" layout="inline" class="search_form"> + <a-form-item> + <a-button type="primary" class="search_input" style="margin-right: 10px;" @click="createBatch">添加</a-button> + <a-button type="primary" @click="search">刷新</a-button> + </a-form-item> + </a-form> <a-table :dataSource="tableData" :columns="columns" rowKey="id" :pagination="false" :loading="loading" bordered> <template slot="option" slot-scope="record"> <a-button type="link" size="small" @click="recordClick(record,'edit')">修改</a-button> @@ -20,12 +23,14 @@ import { getType } from '@/views/utils/auth' import timeEdit from '@/views/timeSet/taskTimeSet/components/timeEdit' import moment from 'moment' - +import { isEmptyParams } from "@/views/utils/common" export default { name: 'taskTimeSet', components: { timeEdit }, data () { return { + searchForm: { projType: getType(), timeType: 2, }, + form: this.$form.createForm(this, { name: 'advanced_search' }), tableData: [], columns: [ { key: '1', title: '申报年度', dataIndex: 'year', align: 'center' }, @@ -54,7 +59,8 @@ export default { moment, getListByPage () { this.loading = true - let par = { projType: getType(), timeType: 2, pageIndex: this.pagination.pageIndex, pageSize: this.pagination.pageSize } + let pars = isEmptyParams(this.searchForm) + let par = { ...pars, pageIndex: this.pagination.pageIndex, pageSize: this.pagination.pageSize } this.$api.batch.getListByPage(par).then(({ data = {} }) => { if (data) { const { dataList = [], total = 0 } = data @@ -64,6 +70,14 @@ export default { } }).catch(() => { this.loading = false }) }, + search () { + this.pagination.pageIndex = 1 + this.getListByPage() + }, + reset () { + this.pagination.pageIndex = 1 + this.getListByPage() + }, change () { this.getListByPage() },