From 236a0a1445692152d4d66d4f501e9b530f1ff822 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Tue, 16 Jan 2024 08:58:40 +0800
Subject: [PATCH] 派遣单位地图选点、派遣记录导入
---
src/views/dispatch/dispatchChildoperable.vue | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 105 insertions(+), 1 deletions(-)
diff --git a/src/views/dispatch/dispatchChildoperable.vue b/src/views/dispatch/dispatchChildoperable.vue
index b07e07c..4657f17 100644
--- a/src/views/dispatch/dispatchChildoperable.vue
+++ b/src/views/dispatch/dispatchChildoperable.vue
@@ -26,7 +26,39 @@
@current-change="currentChange"
@on-load="onLoad"
>
+ <template slot="menuLeft">
+
+ <el-button
+ type="success"
+ size="small"
+ plain
+ icon="el-icon-upload2"
+ v-if="permission.dispatch_import"
+ @click="handleImport"
+ >批量导入
+ </el-button>
+ </template>
</avue-crud>
+
+ <el-dialog
+ title="派遣单位导入"
+ append-to-body
+ :visible.sync="excelBox"
+ width="555px"
+ >
+ <avue-form
+ :option="excelOption"
+ v-model="excelForm"
+ :upload-after="uploadAfter"
+ >
+ <template slot="excelTemplate">
+ <el-button type="primary" @click="handleTemplate">
+ 点击下载<i class="el-icon-download el-icon--right"></i>
+ </el-button>
+ </template>
+ </avue-form>
+ </el-dialog>
+
</basic-container>
</template>
@@ -42,6 +74,7 @@
import { update, getSecurityDispatcherTree } from "@/api/system/user";
import { mapState } from "vuex";
import { mapGetters } from "vuex";
+import {getToken} from "@/util/auth";
export default {
data() {
@@ -287,7 +320,61 @@
}
]
},
- useifid: 266
+ useifid: 266,
+
+ excelBox: false,
+ excelForm: {},
+ excelOption: {
+ submitBtn: false,
+ emptyBtn: false,
+ column: [
+ {
+ label: "模板上传",
+ prop: "excelFile",
+ type: "upload",
+ drag: true,
+ loadText: "模板上传中,请稍等",
+ span: 24,
+ propsHttp: {
+ res: "data"
+ },
+ tip: "请上传 .xls,.xlsx 标准格式文件",
+ action: "/api/dispatcher/import-dispatcher"
+ },
+ // {
+ // label: "数据覆盖",
+ // prop: "isCovered",
+ // type: "switch",
+ // align: "center",
+ // width: 80,
+ // dicData: [
+ // {
+ // label: "否",
+ // value: 0,
+ // },
+ // {
+ // label: "是",
+ // value: 1,
+ // },
+ // ],
+ // value: 0,
+ // slot: true,
+ // rules: [
+ // {
+ // required: true,
+ // message: "请选择是否覆盖",
+ // trigger: "blur",
+ // },
+ // ],
+ // },
+ {
+ label: "模板下载",
+ prop: "excelTemplate",
+ formslot: true,
+ span: 24
+ }
+ ]
+ },
};
},
created() {
@@ -363,6 +450,23 @@
},
methods: {
+ handleTemplate() {
+ window.open(
+ `/api/dispatcher/export-template?${
+ this.website.tokenHeader
+ }=${getToken()}&`
+ );
+ },
+ handleImport() {
+ this.excelBox = true;
+ },
+ uploadAfter(res, done, loading, column) {
+ window.console.log(column);
+ this.excelBox = false;
+ this.refreshChange();
+ done();
+ },
+
handleChangeTABS(column) {
this.typeTABS = column;
if (column.prop == "tab1") {
--
Gitblit v1.9.3