From 92d0cf73df170131eba84490d875bc954eb7a708 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Wed, 11 Aug 2021 20:41:58 +0800
Subject: [PATCH] 报名考试修改

---
 src/views/securityUnitChild/index.vue |  292 ++++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 222 insertions(+), 70 deletions(-)

diff --git a/src/views/securityUnitChild/index.vue b/src/views/securityUnitChild/index.vue
index 9fa5108..3a6ff7c 100644
--- a/src/views/securityUnitChild/index.vue
+++ b/src/views/securityUnitChild/index.vue
@@ -29,67 +29,127 @@
         </template>
       </avue-crud>-->
       <!-- 表单组件 -->
-      <avue-form ref="form" v-model="obj0" :option="option0">
-        <!-- <template slot-scope="scope" slot="menuForm">
+      <basic-container>
+        <avue-form ref="form" v-model="obj0" :option="option0">
+          <!-- <template slot-scope="scope" slot="menuForm">
           <el-button @click="tip">自定义按钮</el-button>
         </template> -->
-      </avue-form>
+        </avue-form>
+      </basic-container>
     </span>
     <span v-else-if="typeTABS.prop === 'tab2'">
       <!-- <span v-if="typeTABS.prop === 'tab2'"> -->
-      <avue-crud
-        :option="option1"
-        :data="data1"
-        :page.sync="page1"
-        ref="crudrec1"
-        :table-loading="loading1"
-        @row-save="rowSave1"
-        @search-change="searchChange1"
-        @search-reset="searchReset1"
-        @row-update="rowUpdate1"
-        @row-del="rowDel1"
-        @selection-change="selectionChange1"
-        @refresh-change="refreshChange1"
-      >
-        <template slot="menuLeft">
-          <el-button
-            type="danger"
-            size="small"
-            plain
-            icon="el-icon-delete"
-            @click="handleDelete1"
-            >删 除
-          </el-button>
-        </template>
-      </avue-crud>
+      <basic-container>
+        <avue-crud
+          :option="option1"
+          :data="data1"
+          :page.sync="page1"
+          ref="crudrec1"
+          :table-loading="loading1"
+          @row-save="rowSave1"
+          @search-change="searchChange1"
+          @search-reset="searchReset1"
+          @row-update="rowUpdate1"
+          @row-del="rowDel1"
+          @selection-change="selectionChange1"
+          @refresh-change="refreshChange1"
+        >
+          <template slot="menuLeft">
+            <el-button
+              type="success"
+              size="small"
+              plain
+              icon="el-icon-upload2"
+              @click="handleImport"
+              >批量导入
+            </el-button>
+            <el-button
+              type="danger"
+              size="small"
+              plain
+              icon="el-icon-delete"
+              @click="handleDelete1"
+              >删 除
+            </el-button>
+          </template>
+        </avue-crud>
+      </basic-container>
     </span>
     <span v-else-if="typeTABS.prop === 'tab3'">
-      <avue-crud
-        :option="option2"
-        :data="data2"
-        :page.sync="page2"
-        ref="crudrec2"
-        :table-loading="loading2"
-        @row-save="rowSave2"
-        @search-change="searchChange2"
-        @search-reset="searchReset2"
-        @row-update="rowUpdate2"
-        @row-del="rowDel2"
-        @selection-change="selectionChange2"
-        @refresh-change="refreshChange2"
+      <basic-container>
+        <avue-crud
+          :option="option2"
+          :data="data2"
+          :page.sync="page2"
+          ref="crudrec2"
+          :table-loading="loading2"
+          @row-save="rowSave2"
+          @search-change="searchChange2"
+          @search-reset="searchReset2"
+          @row-update="rowUpdate2"
+          @row-del="rowDel2"
+          @selection-change="selectionChange2"
+          @refresh-change="refreshChange2"
+        >
+          <template slot="menuLeft">
+            <el-button
+              type="success"
+              size="small"
+              plain
+              icon="el-icon-upload2"
+              @click="handleImport1"
+              >批量导入
+            </el-button>
+            <el-button
+              type="danger"
+              size="small"
+              plain
+              icon="el-icon-delete"
+              @click="handleDelete2"
+              >删 除
+            </el-button>
+          </template>
+        </avue-crud>
+      </basic-container>
+    </span>
+
+    <el-dialog
+      title="出资人导入"
+      append-to-body
+      :visible.sync="excelBox"
+      width="555px"
+    >
+      <avue-form
+        :option="excelOption"
+        v-model="excelForm"
+        :upload-after="uploadAfter"
       >
-        <template slot="menuLeft">
-          <el-button
-            type="danger"
-            size="small"
-            plain
-            icon="el-icon-delete"
-            @click="handleDelete2"
-            >删 除
+        <template slot="excelTemplate">
+          <el-button type="primary" @click="handleTemplate">
+            点击下载<i class="el-icon-download el-icon--right"></i>
           </el-button>
         </template>
-      </avue-crud>
-    </span>
+      </avue-form>
+    </el-dialog>
+
+    <el-dialog
+      title="管理人导入"
+      append-to-body
+      :visible.sync="excelBox1"
+      width="555px"
+    >
+      <avue-form
+        :option="excelOption1"
+        v-model="excelForm1"
+        :upload-after="uploadAfter1"
+      >
+        <template slot="excelTemplate">
+          <el-button type="primary" @click="handleTemplate1">
+            点击下载<i class="el-icon-download el-icon--right"></i>
+          </el-button>
+        </template>
+      </avue-form>
+    </el-dialog>
   </div>
 </template> 
 
@@ -137,6 +197,62 @@
       ],
     };
     return {
+      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/car/import-examSubject",
+          },
+          {
+            label: "模板下载",
+            prop: "excelTemplate",
+            formslot: true,
+            span: 24,
+          },
+        ],
+      },
+
+      excelBox1: false, //管理人
+      excelForm1: {},
+      excelOption1: {
+        submitBtn: false,
+        emptyBtn: false,
+        column: [
+          {
+            label: "文件上传",
+            prop: "excelFile",
+            type: "upload",
+            drag: true,
+            loadText: "文件上传中,请稍等",
+            span: 24,
+            propsHttp: {
+              res: "data",
+            },
+            tip: "请上传 .xls,.xlsx 标准格式文件",
+            action: "/api/examSubjectChoices/import-examSubject",
+          },
+          {
+            label: "模板下载",
+            prop: "excelTemplate",
+            formslot: true,
+            span: 24,
+          },
+        ],
+      },
+
       typeTABS: {}, //标签页
       optionTABS: {
         column: [
@@ -182,7 +298,7 @@
       creditcode: "",
       //保安单位信息表单
       obj0: {
-        title: "我是头部标题",
+        // title: "我是头部标题",
       },
       option0: {
         emptyBtn: false,
@@ -201,10 +317,11 @@
       query1: {},
       data1: [],
       option1: {
-        card: true,
+        // card: true,
+        tip: false,
         searchSize: "mini",
-        searchMenuSpan: 6,
-        height: 547,
+        searchMenuSpan: 8,
+        height: 563,
         menuWidth: 200,
         align: "center",
         selection: true,
@@ -221,11 +338,13 @@
       query2: {},
       data2: [],
       option2: {
-        card: true,
+        // card: true,
+        tip: false,
         searchSize: "mini",
-        searchMenuSpan: 6,
-        height: 547,
+        searchMenuSpan: 8,
+        height: 563,
         menuWidth: 200,
+        menuAlign: "center",
         align: "center",
         selection: true,
         column: column2,
@@ -259,6 +378,34 @@
     },
   },
   methods: {
+    handleImport() {
+      //出资人
+      this.excelBox = true;
+    },
+    uploadAfter(res, done, loading, column) {
+      window.console.log(column);
+      this.excelBox = false;
+      this.refreshChange();
+      done();
+    },
+    handleTemplate() {
+      window.open(`/api/car/export-template`);
+    },
+
+    handleImport1() {
+      //管理人
+      this.excelBox1 = true;
+    },
+    uploadAfter1(res, done, loading, column) {
+      window.console.log(column);
+      this.excelBox1 = false;
+      // this.refreshChange();
+      done();
+    },
+    handleTemplate1() {
+      window.open(`/api/examSubjectChoices/export-template`);
+    },
+
     handleChangeTABS(column) {
       this.typeTABS = column;
       // this.$message.success(JSON.stringify(column));
@@ -595,6 +742,7 @@
     },
     rowUpdate2(row, index, done, loading) {
       console.log(row);
+      delete row.shareholdingratio;
       update2(row).then(
         () => {
           this.onLoad2(this.page2);
@@ -671,7 +819,7 @@
         const data = res.data.data;
         this.page2.total = data.total;
         this.data2 = data.records;
-        // console.log(this.data2);
+        console.log(this.data2);
         this.loading2 = false;
       });
     },
@@ -688,7 +836,7 @@
     var row = {};
     if (this.readLock("danweidata") != null) {
       row = JSON.parse(this.readLock("danweidata"));
-      this.obj0.title = row.enterprisename + "基本信息";
+      // this.obj0.title = row.enterprisename;
       for (var k in row) {
         this.obj0[k] = row[k];
       }
@@ -707,14 +855,14 @@
           // console.log("已删除");
 
           this.obj0 = {};
-          this.obj0.title = row.enterprisename + "该公司已删除";
+          this.obj0.enterprisename = row.enterprisename + "该公司已删除";
           window.localStorage.removeItem("danweidata");
-          this.creditcode = '';
+          this.creditcode = "";
         }
       }
     } else {
       // console.log("no");
-      this.obj0.title = "未选择查询单位";
+      this.obj0.enterprisename = "未选择查询单位";
     }
   },
   watch: {
@@ -732,12 +880,16 @@
   //   border: 1px solid #000;
   box-sizing: border-box;
 }
-.el-card__body {
-  padding-bottom: 5px !important;
-}
-.avue-crud__tip,
-.el-tag,
-.el-tag--light {
-  padding: 0 !important;
+// .el-card__body {
+//   padding-bottom: 5px !important;
+// }
+// .avue-crud__tip,
+// .el-tag,
+// .el-tag--light {
+//   padding: 0 !important;
+// }
+
+.el-collapse-item {
+  padding-top: 15px !important;
 }
 </style>
\ No newline at end of file

--
Gitblit v1.9.3