Commit 2764e4ab authored by wangxl's avatar wangxl

444

parent a3a999e9
<template> <template>
<div class="app-content"> <div class="app-content">
<div class="submit-btn"> <a-form :form="form" :model="searchForm" layout="inline" class="search_form">
<a-button type="primary" class="search_input" style="margin-right: 10px;" @click="createBatch">添加</a-button> <a-form-item>
</div> <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> <a-table :dataSource="tableData" :columns="columns" rowKey="id" :pagination="false" :loading="loading" bordered>
<template slot="option" slot-scope="record"> <template slot="option" slot-scope="record">
<a-button type="link" size="small" @click="recordClick(record,'edit')">修改</a-button>&nbsp; <a-button type="link" size="small" @click="recordClick(record,'edit')">修改</a-button>&nbsp;
...@@ -20,12 +23,14 @@ ...@@ -20,12 +23,14 @@
import { getType } from '@/views/utils/auth' import { getType } from '@/views/utils/auth'
import batchEdit from '@/views/timeSet/batch/components/batchEdit' import batchEdit from '@/views/timeSet/batch/components/batchEdit'
import moment from 'moment' import moment from 'moment'
import { isEmptyParams} from "@/views/utils/common"
export default { export default {
name: 'batchSet', name: 'batchSet',
components: { batchEdit }, components: { batchEdit },
data () { data () {
return { return {
searchForm: { projType: getType(), timeType: 1, },
form: this.$form.createForm(this, { name: 'advanced_search' }),
tableData: [], tableData: [],
columns: [ columns: [
{ key: '1', title: '申报年度', dataIndex: 'year', align: 'center' }, { key: '1', title: '申报年度', dataIndex: 'year', align: 'center' },
...@@ -56,7 +61,8 @@ export default { ...@@ -56,7 +61,8 @@ export default {
moment, moment,
getListByPage () { getListByPage () {
this.loading = true 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 = {} }) => { this.$api.batch.getListByPage(par).then(({ data = {} }) => {
if (data) { if (data) {
const { dataList = [], total = 0 } = data const { dataList = [], total = 0 } = data
...@@ -66,6 +72,14 @@ export default { ...@@ -66,6 +72,14 @@ export default {
} }
}).catch(() => { this.loading = false }) }).catch(() => { this.loading = false })
}, },
search () {
this.pagination.pageIndex = 1
this.getListByPage()
},
reset () {
this.pagination.pageIndex = 1
this.getListByPage()
},
change () { change () {
this.getListByPage() this.getListByPage()
}, },
......
<template> <template>
<div class="app-content"> <div class="app-content">
<div class="submit-btn"> <a-form :form="form" :model="searchForm" layout="inline" class="search_form">
<a-button type="primary" class="search_input" style="margin-right: 10px;" @click="createBatch">添加</a-button> <a-form-item>
</div> <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> <a-table :dataSource="tableData" :columns="columns" rowKey="id" :pagination="false" :loading="loading" bordered>
<template slot="option" slot-scope="record"> <template slot="option" slot-scope="record">
<a-button type="link" size="small" @click="recordClick(record,'edit')">修改</a-button>&nbsp; <a-button type="link" size="small" @click="recordClick(record,'edit')">修改</a-button>&nbsp;
...@@ -20,12 +23,14 @@ ...@@ -20,12 +23,14 @@
import { getType } from '@/views/utils/auth' import { getType } from '@/views/utils/auth'
import timeEdit from '@/views/timeSet/taskTimeSet/components/timeEdit' import timeEdit from '@/views/timeSet/taskTimeSet/components/timeEdit'
import moment from 'moment' import moment from 'moment'
import { isEmptyParams } from "@/views/utils/common"
export default { export default {
name: 'taskTimeSet', name: 'taskTimeSet',
components: { timeEdit }, components: { timeEdit },
data () { data () {
return { return {
searchForm: { projType: getType(), timeType: 2, },
form: this.$form.createForm(this, { name: 'advanced_search' }),
tableData: [], tableData: [],
columns: [ columns: [
{ key: '1', title: '申报年度', dataIndex: 'year', align: 'center' }, { key: '1', title: '申报年度', dataIndex: 'year', align: 'center' },
...@@ -54,7 +59,8 @@ export default { ...@@ -54,7 +59,8 @@ export default {
moment, moment,
getListByPage () { getListByPage () {
this.loading = true 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 = {} }) => { this.$api.batch.getListByPage(par).then(({ data = {} }) => {
if (data) { if (data) {
const { dataList = [], total = 0 } = data const { dataList = [], total = 0 } = data
...@@ -64,6 +70,14 @@ export default { ...@@ -64,6 +70,14 @@ export default {
} }
}).catch(() => { this.loading = false }) }).catch(() => { this.loading = false })
}, },
search () {
this.pagination.pageIndex = 1
this.getListByPage()
},
reset () {
this.pagination.pageIndex = 1
this.getListByPage()
},
change () { change () {
this.getListByPage() this.getListByPage()
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment