From 942c56e44f51dbc3a9ac40db9b7a2d03b68eb6cd Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Thu, 26 Aug 2021 15:53:17 +0800
Subject: [PATCH] 样式

---
 src/views/dispatch/dispatch.vue |  108 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 107 insertions(+), 1 deletions(-)

diff --git a/src/views/dispatch/dispatch.vue b/src/views/dispatch/dispatch.vue
index 8db0d5d..c2815e6 100644
--- a/src/views/dispatch/dispatch.vue
+++ b/src/views/dispatch/dispatch.vue
@@ -28,8 +28,41 @@
             @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 +144,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,
@@ -128,7 +214,9 @@
             prop: "name",
             search: true,
             searchLabelWidth: 110,
+            overHidden: true,
             searchSpan: 4,
+            width: 210,
             // span: 12,
             labelWidth: 118,
           },
@@ -136,6 +224,7 @@
             label: "保安公司",
             prop: "deptId",
             type: "tree",
+            overHidden: true,
             dicUrl:
               "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
             props: {
@@ -155,7 +244,7 @@
               },
             ],
             labelWidth: 118,
-            width: 200,
+            width: 230,
             searchLabelWidth: 80,
             search: true,
             searchSpan: 4,
@@ -170,6 +259,7 @@
             // search: true,
             searchLabelWidth: 110,
             searchSpan: 4,
+            overHidden: true,
             // span: 12,
             labelWidth: 118,
           },
@@ -203,6 +293,7 @@
             searchLabelWidth: 80,
             search: true,
             searchSpan: 4,
+            overHidden: true,
             labelWidth: 118,
             type: "tree",
             dicUrl: "/api/jurisdiction/lazy-tree?parentId=0",
@@ -256,6 +347,7 @@
             label: "负责人联系方式",
             prop: "phone",
             labelWidth: 118,
+            width: 110,
           },
         ],
       },
@@ -472,6 +564,20 @@
         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