|
@@ -0,0 +1,188 @@
|
|
|
+<template>
|
|
|
+ <div class="page">
|
|
|
+ <el-dialog title="走访信息" :close-on-click-modal="false" v-dialogDrag :visible.sync="visible">
|
|
|
+ <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm"
|
|
|
+ @keyup.enter.native="refreshList()" @submit.native.prevent>
|
|
|
+ <!-- 搜索框-->
|
|
|
+ <el-form-item prop="name" title="企业名称">
|
|
|
+ <el-input size="small" v-model="searchForm.name" placeholder="企业名称" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="des1" title="属地">
|
|
|
+ <el-select v-model="searchForm.des1" placeholder="请选择">
|
|
|
+ <el-option v-for="item in areaList" :key="item" :label="item" :value="item">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="createTime">
|
|
|
+ <el-date-picker size="mini" v-model="searchForm.createTime" type="daterange" align="right" unlink-panels
|
|
|
+ range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
|
|
|
+ <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <div style="height: calc(70vh - 80px);">
|
|
|
+ <vxe-table border="inner" auto-resize resizable height="auto" :loading="loading" size="small"
|
|
|
+ ref="lyServiceTable" show-header-overflow show-overflow highlight-hover-row :menu-config="{}"
|
|
|
+ :print-config="{}" :export-config="{
|
|
|
+ remote: true,
|
|
|
+ filename: `走访统计${moment(new Date()).format(
|
|
|
+ 'YYYY-MM-DD'
|
|
|
+ )}`,
|
|
|
+ sheetName: '走访统计',
|
|
|
+ exportMethod: exportMethod,
|
|
|
+ types: ['xlsx'],
|
|
|
+ modes: ['current', 'selected', 'all'],
|
|
|
+ }" :data="dataList" :checkbox-config="{}">
|
|
|
+ <vxe-column type="seq" width="80" title="序号"></vxe-column>
|
|
|
+ <vxe-column field="name" title="企业">
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column field="des14" title="挂钩干部">
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column field="des1" title="属地">
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column field="sum" title="是否走访">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.sum==null?'否':'已走访' }}
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ </vxe-table>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="small" @click="visible = false">关闭</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import lyServiceService from '@/api/service/lyServiceService'
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ searchForm: {
|
|
|
+ name: '',
|
|
|
+ des1: '',
|
|
|
+ createTime: [],
|
|
|
+ state:''
|
|
|
+ },
|
|
|
+ dataList: [],
|
|
|
+ areaList: [],
|
|
|
+ loading: false,
|
|
|
+ visible: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init(date,state) {
|
|
|
+ this.searchForm.state = state
|
|
|
+ date[0] = new Date(date[0]);
|
|
|
+ this.searchForm.createTime = date
|
|
|
+ this.visible = true
|
|
|
+ this.loading = false
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.getAreaInfo()
|
|
|
+ this.refreshList()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取数据列表
|
|
|
+ refreshList() {
|
|
|
+ this.loading = true
|
|
|
+ this.searchForm.beginTime = this.searchForm.createTime[0]
|
|
|
+ this.searchForm.endTime = this.searchForm.createTime[1]
|
|
|
+ lyServiceService.getCompanyInfo({
|
|
|
+ ...this.searchForm
|
|
|
+ }).then(({
|
|
|
+ data
|
|
|
+ }) => {
|
|
|
+ this.dataList = data
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getAreaInfo() {
|
|
|
+ this.areaList = []
|
|
|
+ lyServiceService.getAreaInfo().then(({
|
|
|
+ data
|
|
|
+ }) => {
|
|
|
+ for (var index = 0; index < data.length; index++) {
|
|
|
+ this.areaList.push(data[index].des1);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ // 下载模板
|
|
|
+ downloadTpl() {
|
|
|
+ this.loading = true
|
|
|
+ lyServiceService.exportTemplate().then(({
|
|
|
+ data
|
|
|
+ }) => {
|
|
|
+ // 将二进制流文件写入excel表,以下为重要步骤
|
|
|
+ this.$utils.downloadExcel(data, '请假表单导入模板')
|
|
|
+ this.loading = false
|
|
|
+ }).catch(function(err) {
|
|
|
+ this.loading = false
|
|
|
+ if (err.response) {
|
|
|
+ console.log(err.response)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 自定义服务端导入
|
|
|
+ importMethod({
|
|
|
+ file
|
|
|
+ }) {
|
|
|
+ // 处理表单
|
|
|
+ const formBody = new FormData()
|
|
|
+ formBody.append('file', file)
|
|
|
+ this.loading = true
|
|
|
+ lyServiceService.importExcel(formBody).then(({
|
|
|
+ data
|
|
|
+ }) => {
|
|
|
+ this.$message.success({
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ message: data
|
|
|
+ })
|
|
|
+ this.refreshList()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 自定义服务端导出
|
|
|
+ exportMethod({
|
|
|
+ options
|
|
|
+ }) {
|
|
|
+ // 传给服务端的参数
|
|
|
+ const params = {
|
|
|
+ current: this.tablePage.currentPage,
|
|
|
+ size: this.tablePage.pageSize,
|
|
|
+ orders: this.tablePage.orders,
|
|
|
+ ...this.searchForm,
|
|
|
+ filename: options.filename,
|
|
|
+ sheetName: options.sheetName,
|
|
|
+ isHeader: options.isHeader,
|
|
|
+ original: options.original,
|
|
|
+ mode: options.mode,
|
|
|
+ selectIds: options.mode === 'selected' ? options.data.map((item) => item.id) : [],
|
|
|
+ exportFields: options.columns.map((column) => column.property && column.property.split('.')[0])
|
|
|
+ }
|
|
|
+ this.loading = true
|
|
|
+ return lyServiceService.exportExcel(params).then(({
|
|
|
+ data
|
|
|
+ }) => {
|
|
|
+ // 将二进制流文件写入excel表,以下为重要步骤
|
|
|
+ this.$utils.downloadExcel(data, options.filename)
|
|
|
+ this.loading = false
|
|
|
+ }).catch(function(err) {
|
|
|
+ if (err.response) {
|
|
|
+ console.log(err.response)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ resetSearch() {
|
|
|
+ this.$refs.searchForm.resetFields()
|
|
|
+ this.refreshList()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|