|
@@ -52,6 +52,16 @@
|
|
hasPermi="['organization:sqjgZhgl:add']"
|
|
hasPermi="['organization:sqjgZhgl:add']"
|
|
>新增</el-button>
|
|
>新增</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
+ <el-button
|
|
|
|
+ type="info"
|
|
|
|
+ plain
|
|
|
|
+ icon="el-icon-upload2"
|
|
|
|
+ size="mini"
|
|
|
|
+ @click="handleImport"
|
|
|
|
+ v-hasPermi="['organization:sqjgZhgl:importData']"
|
|
|
|
+ >导入</el-button>
|
|
|
|
+ </el-col>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
@@ -86,14 +96,6 @@
|
|
icon="el-icon-edit"
|
|
icon="el-icon-edit"
|
|
@click="handleUpdate(scope.row,true)"
|
|
@click="handleUpdate(scope.row,true)"
|
|
>详情</el-button>
|
|
>详情</el-button>
|
|
-<!-- v-hasPermi="['system:zhgl:edit']"-->
|
|
|
|
- <!--<el-button-->
|
|
|
|
- <!--size="mini"-->
|
|
|
|
- <!--type="text"-->
|
|
|
|
- <!--icon="el-icon-delete"-->
|
|
|
|
- <!--@click="handleDelete(scope.row,scope.$index)"-->
|
|
|
|
- <!--v-hasPermi="['system:zhgl:remove']"-->
|
|
|
|
- <!-->删除</el-button>-->
|
|
|
|
<el-dropdown @command="changDate" trigger="click">
|
|
<el-dropdown @command="changDate" trigger="click">
|
|
<span class="el-dropdown-link">
|
|
<span class="el-dropdown-link">
|
|
更多<i class="el-icon-arrow-down el-icon--right"></i>
|
|
更多<i class="el-icon-arrow-down el-icon--right"></i>
|
|
@@ -181,12 +183,43 @@
|
|
<el-button @click="cancel">取 消</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+
|
|
|
|
+ <!-- 用户导入对话框 -->
|
|
|
|
+ <el-dialog v-dialog-drag :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"
|
|
|
|
+ :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 slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button type="primary" @click="submitFileForm">确 定</el-button>
|
|
|
|
+ <el-button @click="upload.open = false">取 消</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import {addZhgl, addUserZhxx, delZhgl, getZhgl, listZhgl, updateZhgl} from "@/api/system/yljgsqZhgl";
|
|
import {addZhgl, addUserZhxx, delZhgl, getZhgl, listZhgl, updateZhgl} from "@/api/system/yljgsqZhgl";
|
|
import {chineseOne, Regular} from '@/utils/regular'
|
|
import {chineseOne, Regular} from '@/utils/regular'
|
|
|
|
+import { getToken } from '@/utils/auth'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "Zhgl",
|
|
name: "Zhgl",
|
|
@@ -212,6 +245,21 @@ export default {
|
|
title: "",
|
|
title: "",
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
open: false,
|
|
open: false,
|
|
|
|
+ // 用户导入参数
|
|
|
|
+ upload: {
|
|
|
|
+ // 是否显示弹出层(用户导入)
|
|
|
|
+ open: false,
|
|
|
|
+ // 弹出层标题(用户导入)
|
|
|
|
+ title: "",
|
|
|
|
+ // 是否禁用上传
|
|
|
|
+ isUploading: false,
|
|
|
|
+ // 是否更新已经存在的用户数据
|
|
|
|
+ updateSupport: 0,
|
|
|
|
+ // 设置上传的请求头部
|
|
|
|
+ headers: { Authorization: "Bearer " + getToken() },
|
|
|
|
+ // 上传的地址
|
|
|
|
+ url: process.env.VUE_APP_BASE_API + "/organization/sqJcxx/importData"
|
|
|
|
+ },
|
|
// 查询参数
|
|
// 查询参数
|
|
queryParams: {
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
@@ -364,6 +412,10 @@ export default {
|
|
this.queryParams.pageNum = 1;
|
|
this.queryParams.pageNum = 1;
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
|
|
+ // /** 打开导入表弹窗 */
|
|
|
|
+ // openImportTable() {
|
|
|
|
+ // this.$refs.import.show();
|
|
|
|
+ // },
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
resetQuery() {
|
|
resetQuery() {
|
|
this.resetForm("queryForm");
|
|
this.resetForm("queryForm");
|
|
@@ -463,7 +515,34 @@ export default {
|
|
this.getList();
|
|
this.getList();
|
|
this.$modal.msgSuccess("删除成功");
|
|
this.$modal.msgSuccess("删除成功");
|
|
}).catch(() => {});
|
|
}).catch(() => {});
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ /** 导入按钮操作 */
|
|
|
|
+ handleImport() {
|
|
|
|
+ this.upload.title = "用户导入";
|
|
|
|
+ this.upload.open = true;
|
|
|
|
+ },
|
|
|
|
+ /** 下载模板操作 */
|
|
|
|
+ importTemplate() {
|
|
|
|
+ this.download('organization/sqJcxx/importTemplate', {
|
|
|
|
+ }, `jgzh_template_${new Date().getTime()}.xlsx`)
|
|
|
|
+ },
|
|
|
|
+ // 文件上传中处理
|
|
|
|
+ handleFileUploadProgress(event, file, fileList) {
|
|
|
|
+ this.upload.isUploading = true;
|
|
|
|
+ },
|
|
|
|
+ // 文件上传成功处理
|
|
|
|
+ handleFileSuccess(response, file, fileList) {
|
|
|
|
+ this.upload.open = false;
|
|
|
|
+ this.upload.isUploading = false;
|
|
|
|
+ this.$refs.upload.clearFiles();
|
|
|
|
+ this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ // 提交上传文件
|
|
|
|
+ submitFileForm() {
|
|
|
|
+ this.$refs.upload.submit();
|
|
|
|
+ },
|
|
|
|
+
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|