Administrator
2021-08-11 f5d88e4f31bec1d77721c0795afde3f3a571e9aa
src/views/securityUnit/index.vue
@@ -35,6 +35,14 @@
            @click.stop="rowSave"
            >新增</el-button
          >
          <el-button
            type="success"
            size="small"
            plain
            icon="el-icon-upload2"
            @click="handleImport1"
            >批量导入
          </el-button>
        </template>
        <template slot="menuLeft">
          <el-button
@@ -100,6 +108,24 @@
        </div>
      </div>
    </div>
    <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>
  </basic-container>
</template> 
@@ -120,6 +146,34 @@
    var w = 160,
      s = 12;
    return {
      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,
          },
        ],
      },
      loading: true, //保安单位基本信息
      selectionList: [],
      page: {
@@ -266,6 +320,19 @@
    },
  },
  methods: {
    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));