|
@@ -72,6 +72,17 @@
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
<el-button
|
|
|
|
+ type="info"
|
|
|
|
+ plain
|
|
|
|
+ icon="el-icon-upload2"
|
|
|
|
+ size="mini"
|
|
|
|
+ @click="handleImport"
|
|
|
|
+ v-hasPermi="['system:user:import']"
|
|
|
|
+ >导入小区
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
+ <el-button
|
|
type="warning"
|
|
type="warning"
|
|
plain
|
|
plain
|
|
icon="el-icon-download"
|
|
icon="el-icon-download"
|
|
@@ -90,16 +101,16 @@
|
|
<el-table-column label="主键id" align="center" prop="id" v-if="true"/>
|
|
<el-table-column label="主键id" align="center" prop="id" v-if="true"/>
|
|
<el-table-column label="小区名" align="center" prop="name"/>
|
|
<el-table-column label="小区名" align="center" prop="name"/>
|
|
<el-table-column label="负责工长" align="center" prop="userName">
|
|
<el-table-column label="负责工长" align="center" prop="userName">
|
|
-<!-- <template slot-scope="scope">-->
|
|
|
|
-<!-- {{ getUserName(scope.row.userId) }}-->
|
|
|
|
-<!-- </template>-->
|
|
|
|
|
|
+ <!-- <template slot-scope="scope">-->
|
|
|
|
+ <!-- {{ getUserName(scope.row.userId) }}-->
|
|
|
|
+ <!-- </template>-->
|
|
</el-table-column>
|
|
</el-table-column>
|
|
-<!-- <el-table-column label="是否释放" align="center" prop="releaseIs">-->
|
|
|
|
-<!-- <template slot-scope="scope">-->
|
|
|
|
-<!-- <dict-tag :options="dict.type.release_status" :value="scope.row.releaseIs"/>-->
|
|
|
|
-<!-- </template>-->
|
|
|
|
-<!-- </el-table-column>-->
|
|
|
|
-<!-- <el-table-column label="释放人" align="center" prop="releaseBy"/>-->
|
|
|
|
|
|
+ <!-- <el-table-column label="是否释放" align="center" prop="releaseIs">-->
|
|
|
|
+ <!-- <template slot-scope="scope">-->
|
|
|
|
+ <!-- <dict-tag :options="dict.type.release_status" :value="scope.row.releaseIs"/>-->
|
|
|
|
+ <!-- </template>-->
|
|
|
|
+ <!-- </el-table-column>-->
|
|
|
|
+ <!-- <el-table-column label="释放人" align="center" prop="releaseBy"/>-->
|
|
<el-table-column label="行政区" align="center" prop="district">
|
|
<el-table-column label="行政区" align="center" prop="district">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<dict-tag :options="dict.type.district" :value="scope.row.district"/>
|
|
<dict-tag :options="dict.type.district" :value="scope.row.district"/>
|
|
@@ -116,14 +127,14 @@
|
|
v-hasPermi="['gas:area:edit']"
|
|
v-hasPermi="['gas:area:edit']"
|
|
>修改
|
|
>修改
|
|
</el-button>
|
|
</el-button>
|
|
-<!-- <el-button-->
|
|
|
|
-<!-- size="mini"-->
|
|
|
|
-<!-- type="text"-->
|
|
|
|
-<!-- icon="el-icon-edit"-->
|
|
|
|
-<!-- @click="handleRelease(scope.row)"-->
|
|
|
|
-<!-- v-hasPermi="['gas:area:edit']"-->
|
|
|
|
-<!-- >释放-->
|
|
|
|
-<!-- </el-button>-->
|
|
|
|
|
|
+ <!-- <el-button-->
|
|
|
|
+ <!-- size="mini"-->
|
|
|
|
+ <!-- type="text"-->
|
|
|
|
+ <!-- icon="el-icon-edit"-->
|
|
|
|
+ <!-- @click="handleRelease(scope.row)"-->
|
|
|
|
+ <!-- v-hasPermi="['gas:area:edit']"-->
|
|
|
|
+ <!-- >释放-->
|
|
|
|
+ <!-- </el-button>-->
|
|
<el-button
|
|
<el-button
|
|
size="mini"
|
|
size="mini"
|
|
type="text"
|
|
type="text"
|
|
@@ -143,6 +154,45 @@
|
|
:limit.sync="queryParams.pageSize"
|
|
:limit.sync="queryParams.pageSize"
|
|
@pagination="getList"
|
|
@pagination="getList"
|
|
/>
|
|
/>
|
|
|
|
+ <!-- 用户导入对话框 -->
|
|
|
|
+ <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
|
|
+ <el-upload
|
|
|
|
+ ref="upload"
|
|
|
|
+ :limit="1"
|
|
|
|
+ accept=".xlsx, .xls"
|
|
|
|
+ :headers="upload.headers"
|
|
|
|
+ :action="upload.url + '?updateSupport=' + upload.updateSupport"
|
|
|
|
+ :disabled="upload.isUploading"
|
|
|
|
+ :on-progress="handleFileUploadProgress"
|
|
|
|
+ :on-success="handleFileSuccess"
|
|
|
|
+ :auto-upload="false"
|
|
|
|
+ drag
|
|
|
|
+ >
|
|
|
|
+ <i class="el-icon-upload"></i>
|
|
|
|
+ <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
|
+ <div class="el-upload__tip text-center" slot="tip">
|
|
|
|
+ <!--<div class="el-upload__tip" slot="tip">-->
|
|
|
|
+ <!--<el-checkbox v-model="upload.updateSupport"/>-->
|
|
|
|
+ <!--是否更新已经存在的用户数据-->
|
|
|
|
+ <!--</div>-->
|
|
|
|
+ <span>仅允许导入xls、xlsx格式文件。</span>
|
|
|
|
+ <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
|
|
|
|
+ @click="importTemplate"
|
|
|
|
+ >下载模板
|
|
|
|
+ </el-link>
|
|
|
|
+ </div>
|
|
|
|
+ </el-upload>
|
|
|
|
+ <div style="padding-top: 15px;line-height: 25px;font-size: 14px;">
|
|
|
|
+ 完成度:{{ bfb }}%
|
|
|
|
+ <progress max="100" :value="bfb" style="width: 200px;height: 18px;"></progress>
|
|
|
|
+ <br>
|
|
|
|
+ 导入结果:{{ jdtMsg }}
|
|
|
|
+ </div>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button type="primary" @click="submitFileForm">确 定</el-button>
|
|
|
|
+ <el-button @click="upload.open = false;bfb='0';jdtMsg=''">取 消</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
|
|
<!-- 添加或修改小区对话框 -->
|
|
<!-- 添加或修改小区对话框 -->
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
@@ -184,15 +234,44 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import {listArea, getArea, delArea, addArea, updateArea, releaseIs} from "@/api/gas/area";
|
|
|
|
|
|
+import {
|
|
|
|
+ listArea,
|
|
|
|
+ getArea,
|
|
|
|
+ delArea,
|
|
|
|
+ addArea,
|
|
|
|
+ updateArea,
|
|
|
|
+ releaseIs,
|
|
|
|
+ flushProgress,
|
|
|
|
+ clearFlushProgress
|
|
|
|
+} from "@/api/gas/area";
|
|
import {getWorker} from "@/api/gas/user";
|
|
import {getWorker} from "@/api/gas/user";
|
|
import el from "element-ui/src/locale/lang/el";
|
|
import el from "element-ui/src/locale/lang/el";
|
|
|
|
+import {getToken} from "@/utils/auth";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "Area",
|
|
name: "Area",
|
|
dicts: ['release_status', 'district', 'district'],
|
|
dicts: ['release_status', 'district', 'district'],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ //进度条
|
|
|
|
+ timeInterval: null,
|
|
|
|
+ bfb: '0',
|
|
|
|
+ jdtMsg: '',
|
|
|
|
+ // 用户导入参数
|
|
|
|
+ upload: {
|
|
|
|
+ // 是否显示弹出层(用户导入)
|
|
|
|
+ open: false,
|
|
|
|
+ // 弹出层标题(用户导入)
|
|
|
|
+ title: '',
|
|
|
|
+ // 是否禁用上传
|
|
|
|
+ isUploading: false,
|
|
|
|
+ // 是否更新已经存在的用户数据
|
|
|
|
+ updateSupport: 0,
|
|
|
|
+ // 设置上传的请求头部
|
|
|
|
+ headers: { Authorization: 'Bearer ' + getToken() },
|
|
|
|
+ // 上传的地址
|
|
|
|
+ url: process.env.VUE_APP_BASE_API + '/gas/area/importData'
|
|
|
|
+ },
|
|
// 按钮loading
|
|
// 按钮loading
|
|
buttonLoading: false,
|
|
buttonLoading: false,
|
|
// 遮罩层
|
|
// 遮罩层
|
|
@@ -249,6 +328,45 @@ export default {
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 文件上传中处理
|
|
|
|
+ handleFileUploadProgress(event, file, fileList) {
|
|
|
|
+ this.upload.isUploading = true
|
|
|
|
+ },
|
|
|
|
+ // 文件上传成功处理
|
|
|
|
+ handleFileSuccess(response, file, fileList) {
|
|
|
|
+ this.upload.isUploading = false
|
|
|
|
+ this.$refs.upload.clearFiles()
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ /** 下载模板操作 */
|
|
|
|
+ importTemplate() {
|
|
|
|
+ this.$download.excel('/gas/area/importTemplate')
|
|
|
|
+ },
|
|
|
|
+ // 提交上传文件
|
|
|
|
+ submitFileForm() {
|
|
|
|
+ const ther = this
|
|
|
|
+ this.timeInterval = setInterval(function() {
|
|
|
|
+ ther.flushProgress()
|
|
|
|
+ }, 1500)
|
|
|
|
+ this.$refs.upload.submit()
|
|
|
|
+ },
|
|
|
|
+ // 提交上传文件
|
|
|
|
+ flushProgress() {
|
|
|
|
+ flushProgress().then(response => {
|
|
|
|
+ this.bfb = parseInt(response.data.bfb) >= 100 ? 100 : response.data.bfb
|
|
|
|
+ this.jdtMsg = response.data.message
|
|
|
|
+ if (response.data.message != null && response.data.message != '') {
|
|
|
|
+ clearFlushProgress().then(response => {
|
|
|
|
+ })
|
|
|
|
+ clearInterval(this.timeInterval)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ /** 导入按钮操作 */
|
|
|
|
+ handleImport() {
|
|
|
|
+ this.upload.title = '用户导入'
|
|
|
|
+ this.upload.open = true
|
|
|
|
+ },
|
|
//释放
|
|
//释放
|
|
handleRelease(row) {
|
|
handleRelease(row) {
|
|
this.$modal.confirm('请确认照片是否下载!释放过程不可逆!是否释放?').then(() => {
|
|
this.$modal.confirm('请确认照片是否下载!释放过程不可逆!是否释放?').then(() => {
|