| | |
| | | @handleQuery="getList(1)" |
| | | @clear="clear" |
| | | /> |
| | | <div style="margin: 16px 0 0" v-permissions="['business:visits:create', 'business:visits:exportExcel']"> |
| | | <el-button type="primary" @click="handleEdit()" icon="el-icon-plus" v-permissions="['business:visits:create']">新建</el-button> |
| | | <el-button type="primary" :loading="exLoading" @click="exportExcel" v-permissions="['business:visits:exportExcel']">导出</el-button> |
| | | </div> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="dataList" |
| | |
| | | :pagination="pagination" |
| | | /> |
| | | <ReportDetail v-if="isShowReport" ref="VisReportDetailRef" /> |
| | | <OperaVisitsReportWindow @close="isShowEdit = false" @success="getList" v-if="isShowEdit" ref="operaVisitsWindowRef" /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import QueryForm from '@/components/common/QueryForm' |
| | | // import ReportDetail from './page-components/ReportDetail.vue' |
| | | import ReportDetail from '@/views/task/visReportDetail.vue' |
| | | import { fetchList } from '@/api/business/visits' |
| | | import OperaVisitsReportWindow from '@/components/business/operaVisitsReportWindow.vue' |
| | | import { fetchList, exportExcel } from '@/api/business/visits' |
| | | export default { |
| | | components: { |
| | | ReportDetail, |
| | | QueryForm, |
| | | Pagination |
| | | Pagination, |
| | | OperaVisitsReportWindow |
| | | }, |
| | | data () { |
| | | return { |
| | | isShowEdit: false, |
| | | exLoading: false, |
| | | |
| | | isShowReport: false, |
| | | activeTab: '0', |
| | | filters: {}, |
| | | filters: { |
| | | type: 2 |
| | | }, |
| | | dataList: [], |
| | | queryFormConfig: { |
| | | formItems: [ |
| | |
| | | this.getList() |
| | | }, |
| | | methods: { |
| | | exportExcel () { |
| | | this.$dialog.exportConfirm('确认导出吗?') |
| | | .then(() => { |
| | | this.exLoading = true |
| | | exportExcel({ |
| | | page: this.pagination.page, |
| | | capacity: 1000000, |
| | | model: this.filters |
| | | }) |
| | | .then(response => { |
| | | this.download(response) |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.exLoading = false |
| | | }) |
| | | }) |
| | | }, |
| | | handleEdit () { |
| | | this.isShowEdit = true |
| | | this.$nextTick(() => { |
| | | this.$refs.operaVisitsWindowRef.isShowModal = true |
| | | }) |
| | | }, |
| | | handleDetail (row) { |
| | | this.isShowReport = true |
| | | this.$nextTick(() => { |
| | |
| | | const { pagination, filters } = this |
| | | pagination.page = page || pagination.page |
| | | fetchList({ |
| | | model: { ...filters, type: 2 }, |
| | | model: { ...filters }, |
| | | ...pagination |
| | | }).then(res => { |
| | | this.dataList = res.records || [] |
| | | }) |
| | | }, |
| | | clear () { |
| | | this.filters = {} |
| | | this.filters = { |
| | | type: 2 |
| | | } |
| | | this.getList(0) |
| | | }, |
| | | handleSizeChange (capacity) { |