钟日健
2022-02-08 2c461eb9efb980d55dfd7407ee70088fc90a4a7a
src/views/securityUnitChild/social.vue
@@ -1,6 +1,9 @@
<template>
  <basic-container>
  <basic-container
    :class="[$store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '']"
  >
    <avue-crud
      v-if="visible"
      :option="option"
      :table-loading="loading"
      :data="data"
@@ -73,7 +76,7 @@
import { mapGetters } from "vuex";
import { getToken } from "@/util/auth";
export default {
  props: ["deptid"],
  props: ["deptid", "socialRE"],
  data() {
    var deptid = this.deptid;
    if (this.deptid == undefined) {
@@ -82,6 +85,7 @@
      deptid = this.$store.getters.userInfo.dept_id;
    }
    return {
      visible: true,
      form: { cardid: "" },
      query: {},
@@ -91,11 +95,12 @@
        pageSize: 10,
        currentPage: 1,
        total: 0,
        ...this.$store.state.control.changePageSize,
      },
      selectionList: [],
      option: {
        height: "auto",
        calcHeight: 30,
        // calcHeight: 30,
        tip: false,
        searchShow: true,
        align: "center",
@@ -106,6 +111,7 @@
        menu: false,
        selection: true,
        dialogClickModal: false,
        ...this.$store.state.control.clearOtherBut,
        column: [
          {
            label: "姓名",
@@ -147,10 +153,6 @@
                label: "女",
                value: 2,
              },
              {
                label: "未知",
                value: 3,
              },
            ],
            labelWidth: 110,
            addDisabled: true,
@@ -163,21 +165,21 @@
              },
            ],
          },
          {
            label: "民族",
            prop: "nation",
            addDisabled: true,
            editDisabled: true,
            width: 55,
            labelWidth: 110,
            rules: [
              {
                required: true,
                message: "请输入民族",
                trigger: "blur",
              },
            ],
          },
          // {
          //   label: "民族",
          //   prop: "nation",
          //   addDisabled: true,
          //   editDisabled: true,
          //   width: 55,
          //   labelWidth: 110,
          //   rules: [
          //     {
          //       required: true,
          //       message: "请输入民族",
          //       trigger: "blur",
          //     },
          //   ],
          // },
          // {
          //   label: "出生日期",
          //   labelWidth: 110,
@@ -231,8 +233,8 @@
            prop: "residence",
            labelWidth: 110,
            overHidden: true,
            addDisabled: true,
            editDisabled: true,
            addDisabled: false,
            editDisabled: false,
            rules: [
              {
                required: true,
@@ -331,33 +333,6 @@
            tip: "请上传 .xls,.xlsx 标准格式文件",
            action: "/api/social/import-user?deptid=" + deptid,
          },
          // {
          //   label: "数据覆盖",
          //   prop: "isCovered",
          //   type: "switch",
          //   align: "center",
          //   hide: true,
          //   width: 80,
          //   dicData: [
          //     {
          //       label: "否",
          //       value: 0,
          //     },
          //     {
          //       label: "是",
          //       value: 1,
          //     },
          //   ],
          //   value: 0,
          //   slot: true,
          //   rules: [
          //     {
          //       required: true,
          //       message: "请选择是否覆盖",
          //       trigger: "blur",
          //     },
          //   ],
          // },
          {
            label: "模板下载",
            prop: "excelTemplate",
@@ -380,9 +355,25 @@
          this.deptid;
      }
    },
    socialRE() {
      this.$refs.crud.refreshTable();
      this.$refs.crud.doLayout();
    },
    windowHeight() {
      console.log(this.windowHeight);
      this.option.height = this.windowHeight - 320;
      this.visible = false;
      this.$nextTick(() => {
        this.visible = true;
        this.refreshChange();
      });
    },
  },
  created() {
    this.option.height = this.windowHeight - 320;
  },
  computed: {
    ...mapGetters(["permission", "userInfo"]),
    ...mapGetters(["permission", "userInfo", "windowHeight"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.social_add, true),
@@ -407,7 +398,7 @@
          var d = res.data.data;
          this.form.cardid = d.cardid;
          this.form.telephone = d.phone;
          this.form.residence = d.nativeplace;
          this.form.residence = d.registered;
          this.form.address = d.address;
          this.form.sex = d.sex;
          this.form.nation = d.nation;
@@ -552,6 +543,8 @@
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.$refs.crud.refreshTable();
        this.$refs.crud.doLayout();
        this.selectionClear();
      });
    },