From 2b6b6132ebc576384a109072b611ab7aa49c6e0a Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Mon, 23 Aug 2021 14:28:20 +0800
Subject: [PATCH] 派遣单位新增批量导入
---
src/views/dispatch/dispatch.vue | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 103 insertions(+), 0 deletions(-)
diff --git a/src/views/dispatch/dispatch.vue b/src/views/dispatch/dispatch.vue
index 8db0d5d..62292e5 100644
--- a/src/views/dispatch/dispatch.vue
+++ b/src/views/dispatch/dispatch.vue
@@ -28,8 +28,43 @@
@click="handleDelete"
>删 除
</el-button>
+
+ <el-button
+ type="success"
+ size="small"
+ plain
+ icon="el-icon-upload2"
+ @click="handleImport"
+ >批量导入
+ </el-button>
</template>
+
+ <template slot-scope="{ row }" slot="jurisdiction">
+ {{row.jurisdiction==-1?"":row.jurisdiction}}
+ </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>
+
<!-- </span>
<span v-else-if="typeTABS.prop === 'tab2'">
<avue-crud
@@ -111,6 +146,59 @@
},
query: {},
data: [],
+ 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/dispatcherUnit/import-dispatcherUnit",
+ },
+ // {
+ // 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,
+ },
+ ],
+ },
option: {
tip: false,
// card: true,
@@ -472,6 +560,21 @@
this.loading = false;
});
},
+
+ handleTemplate() {
+ window.open(`/api/dispatcherUnit/export-template`);
+ },
+ handleImport() {
+ this.excelBox = true;
+ },
+ uploadAfter(res, done, loading, column) {
+ window.console.log(column);
+ this.excelBox = false;
+ this.refreshChange();
+ done();
+ },
+
+
//派遣服务公司登记
//派遣记录
--
Gitblit v1.9.3