src/views/securityUnitChild/social.vue
@@ -1,8 +1,12 @@
<template>
  <basic-container
    :class="[$store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '']"
    :class="[
      $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize',
      $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : ''
    ]"
  >
    <avue-crud
      class="tablesss"
      v-if="visible"
      :option="option"
      :table-loading="loading"
@@ -71,7 +75,7 @@
  getDetail,
  add,
  update,
  remove,
  remove
} from "@/api/social/social";
import { mapGetters } from "vuex";
import { getToken } from "@/util/auth";
@@ -95,7 +99,7 @@
        pageSize: 10,
        currentPage: 1,
        total: 0,
        ...this.$store.state.control.changePageSize,
        ...this.$store.state.control.changePageSize
      },
      selectionList: [],
      option: {
@@ -119,13 +123,13 @@
            width: 65,
            labelWidth: 110,
            change: (res) => {
            change: res => {
              this.changes(res);
            },
            dicUrl: "/api/blade-user/page-security-unit?deptId=" + deptid,
            props: {
              label: "realName",
              value: "id",
              value: "id"
            },
            search: true,
            searchLabelWidth: 45,
@@ -135,9 +139,9 @@
              {
                required: true,
                message: "请输入姓名",
                trigger: "blur",
              },
            ],
                trigger: "blur"
              }
            ]
          },
          {
            label: "性别",
@@ -147,12 +151,12 @@
            dicData: [
              {
                label: "男",
                value: 1,
                value: 1
              },
              {
                label: "女",
                value: 2,
              },
                value: 2
              }
            ],
            labelWidth: 110,
            addDisabled: true,
@@ -161,9 +165,9 @@
              {
                required: true,
                message: "请输入性别",
                trigger: "blur",
              },
            ],
                trigger: "blur"
              }
            ]
          },
          // {
          //   label: "民族",
@@ -209,9 +213,9 @@
              {
                required: true,
                message: "请输入联系电话",
                trigger: "blur",
              },
            ],
                trigger: "blur"
              }
            ]
          },
          {
            label: "身份证号",
@@ -224,9 +228,9 @@
              {
                required: true,
                message: "请输入身份证号",
                trigger: "blur",
              },
            ],
                trigger: "blur"
              }
            ]
          },
          {
            label: "户籍所在地址",
@@ -239,9 +243,9 @@
              {
                required: true,
                message: "请输入户籍所在地址",
                trigger: "blur",
              },
            ],
                trigger: "blur"
              }
            ]
          },
          // {
          //   label: "居住地址  ",
@@ -280,9 +284,9 @@
              {
                required: true,
                message: "请输入个人缴费额",
                trigger: "blur",
              },
            ],
                trigger: "blur"
              }
            ]
          },
          {
            label: "参保时间",
@@ -296,10 +300,10 @@
              {
                required: true,
                message: "请输入参保时间",
                trigger: "blur",
              },
            ],
          },
                trigger: "blur"
              }
            ]
          }
          // {
          //   label: "所属机构",
          //   labelWidth: 110,
@@ -312,7 +316,7 @@
          //     value: "deptid",
          //   },
          // },
        ],
        ]
      },
      data: [],
      excelForm: {},
@@ -328,19 +332,19 @@
            loadText: "模板上传中,请稍等",
            span: 24,
            propsHttp: {
              res: "data",
              res: "data"
            },
            tip: "请上传 .xls,.xlsx 标准格式文件",
            action: "/api/social/import-user?deptid=" + deptid,
            action: "/api/social/import-user?deptid=" + deptid
          },
          {
            label: "模板下载",
            prop: "excelTemplate",
            formslot: true,
            span: 24,
          },
        ],
      },
            span: 24
          }
        ]
      }
    };
  },
  watch: {
@@ -358,16 +362,7 @@
    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;
@@ -379,21 +374,24 @@
        addBtn: this.vaildData(this.permission.social_add, true),
        viewBtn: this.vaildData(this.permission.social_view, false),
        delBtn: this.vaildData(this.permission.social_delete, false),
        editBtn: this.vaildData(this.permission.social_edit, false),
        editBtn: this.vaildData(this.permission.social_edit, false)
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
      this.selectionList.forEach(ele => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
    }
  },
  mounted() {
    this.$store.commit("setWindowSizeHeightAdd");
  },
  methods: {
    changes(val) {
      if (val.value != "") {
        getuseList(val.value).then((res) => {
        getuseList(val.value).then(res => {
          // console.log(res);
          var d = res.data.data;
          this.form.cardid = d.cardid;
@@ -415,11 +413,11 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          done();
        },
        (error) => {
        error => {
          loading();
          window.console.log(error);
        }
@@ -434,11 +432,11 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          done();
        },
        (error) => {
        error => {
          loading();
          console.log(error);
        }
@@ -448,7 +446,7 @@
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        type: "warning"
      })
        .then(() => {
          return remove(row.id);
@@ -457,7 +455,7 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
        });
    },
@@ -483,7 +481,7 @@
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        type: "warning"
      })
        .then(() => {
          return remove(this.ids);
@@ -492,14 +490,14 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          this.$refs.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
        getDetail(this.form.id).then(res => {
          this.form = res.data.data;
        });
      }
@@ -538,19 +536,19 @@
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
      ).then(res => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.$refs.crud.refreshTable();
        this.$refs.crud.doLayout();
        this.$store.commit("setWindowSizeHeightAdd");
        this.selectionClear();
      });
    },
  },
    }
  }
};
</script>
<style>
</style>
<style></style>