From d1b058faa19088838b668d6c03dd71c2bcc7d5d3 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Thu, 09 Dec 2021 10:30:44 +0800
Subject: [PATCH] 用户角色控制修改
---
src/views/securityUnitChild/social.vue | 196 +++++++++++++++++++++++++++++++++---------------
1 files changed, 134 insertions(+), 62 deletions(-)
diff --git a/src/views/securityUnitChild/social.vue b/src/views/securityUnitChild/social.vue
index 5a05171..b1f756c 100644
--- a/src/views/securityUnitChild/social.vue
+++ b/src/views/securityUnitChild/social.vue
@@ -1,5 +1,7 @@
<template>
- <basic-container>
+ <basic-container
+ :class="[$store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '']"
+ >
<avue-crud
:option="option"
:table-loading="loading"
@@ -62,15 +64,28 @@
</template>
<script>
-import { getList, getDetail, add, update, remove } from "@/api/social/social";
+import {
+ getuseList,
+ getList,
+ getDetail,
+ add,
+ update,
+ remove,
+} from "@/api/social/social";
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) {
+ // deptid = this.userInfo
+ // console.log(this.$store.getters.userInfo.dept_id);
+ deptid = this.$store.getters.userInfo.dept_id;
+ }
return {
- form: {},
+ form: { cardid: "" },
+
query: {},
loading: true,
excelBox: false,
@@ -78,6 +93,7 @@
pageSize: 10,
currentPage: 1,
total: 0,
+ ...this.$store.state.control.changePageSize,
},
selectionList: [],
option: {
@@ -93,6 +109,7 @@
menu: false,
selection: true,
dialogClickModal: false,
+ ...this.$store.state.control.clearOtherBut,
column: [
{
label: "姓名",
@@ -100,11 +117,18 @@
width: 65,
labelWidth: 110,
-
+ change: (res) => {
+ this.changes(res);
+ },
+ dicUrl: "/api/blade-user/page-security-unit?deptId=" + deptid,
+ props: {
+ label: "realName",
+ value: "id",
+ },
search: true,
searchLabelWidth: 45,
searchSpan: 4,
-
+ type: "select",
rules: [
{
required: true,
@@ -117,7 +141,20 @@
label: "性别",
prop: "sex",
width: 55,
+ type: "select",
+ dicData: [
+ {
+ label: "男",
+ value: 1,
+ },
+ {
+ label: "女",
+ value: 2,
+ },
+ ],
labelWidth: 110,
+ addDisabled: true,
+ editDisabled: true,
rules: [
{
required: true,
@@ -126,39 +163,45 @@
},
],
},
- {
- label: "民族",
- prop: "nation",
- width: 55,
- labelWidth: 110,
- rules: [
- {
- required: true,
- message: "请输入民族",
- trigger: "blur",
- },
- ],
- },
- {
- label: "出生日期",
- labelWidth: 110,
- width: 90,
- prop: "birthday",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd",
- 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,
+ // width: 90,
+ // // addDisabled: true,
+ // // editDisabled: true,
+ // prop: "birthday",
+ // type: "date",
+ // format: "yyyy-MM-dd",
+ // valueFormat: "yyyy-MM-dd",
+ // rules: [
+ // {
+ // required: true,
+ // message: "请输入出生日期",
+ // trigger: "blur",
+ // },
+ // ],
+ // },
{
label: "联系电话",
prop: "telephone",
labelWidth: 110,
+ addDisabled: true,
+ editDisabled: true,
width: 98,
rules: [
{
@@ -172,6 +215,8 @@
label: "身份证号",
prop: "cardid",
labelWidth: 110,
+ addDisabled: true,
+ editDisabled: true,
width: 150,
rules: [
{
@@ -186,6 +231,8 @@
prop: "residence",
labelWidth: 110,
overHidden: true,
+ addDisabled: true,
+ editDisabled: true,
rules: [
{
required: true,
@@ -194,31 +241,35 @@
},
],
},
- {
- label: "居住地址 ",
- prop: "address",
- overHidden: true,
- labelWidth: 110,
- rules: [
- {
- required: true,
- message: "请输入居住地址 ",
- trigger: "blur",
- },
- ],
- },
- {
- label: "户籍性质",
- prop: "nature",
- labelWidth: 110,
- rules: [
- {
- required: true,
- message: "请输入户籍性质",
- trigger: "blur",
- },
- ],
- },
+ // {
+ // label: "居住地址 ",
+ // prop: "address",
+ // overHidden: true,
+ // addDisabled: true,
+ // editDisabled: true,
+ // labelWidth: 110,
+ // rules: [
+ // {
+ // required: true,
+ // message: "请输入居住地址 ",
+ // trigger: "blur",
+ // },
+ // ],
+ // },
+ // {
+ // label: "户籍性质",
+ // prop: "nature",
+ // // addDisabled: true,
+ // // editDisabled: true,
+ // labelWidth: 110,
+ // rules: [
+ // {
+ // required: true,
+ // message: "请输入户籍性质",
+ // trigger: "blur",
+ // },
+ // ],
+ // },
{
label: "个人缴费额",
prop: "amount",
@@ -278,7 +329,7 @@
res: "data",
},
tip: "请上传 .xls,.xlsx 标准格式文件",
- action: "/api/social/import-user",
+ action: "/api/social/import-user?deptid=" + deptid,
},
// {
// label: "数据覆盖",
@@ -329,6 +380,10 @@
this.deptid;
}
},
+ socialRE() {
+ this.$refs.crud.refreshTable();
+ this.$refs.crud.doLayout();
+ },
},
computed: {
...mapGetters(["permission", "userInfo"]),
@@ -349,6 +404,21 @@
},
},
methods: {
+ changes(val) {
+ if (val.value != "") {
+ getuseList(val.value).then((res) => {
+ // console.log(res);
+ var d = res.data.data;
+ this.form.cardid = d.cardid;
+ this.form.telephone = d.phone;
+ this.form.residence = d.nativeplace;
+ this.form.address = d.address;
+ this.form.sex = d.sex;
+ this.form.nation = d.nation;
+ this.form.birthday = d.birthday;
+ });
+ }
+ },
rowSave(row, done, loading) {
console.log(row);
row.deptid = this.deptid;
@@ -486,6 +556,8 @@
this.page.total = data.total;
this.data = data.records;
this.loading = false;
+ this.$refs.crud.refreshTable();
+ this.$refs.crud.doLayout();
this.selectionClear();
});
},
--
Gitblit v1.9.3