GuLiMmo
2023-12-09 6f8a5cd4a8a016e8f05bb96f8fe1b85774d14e04
员工信息表页面修改
1 files modified
37 ■■■■ changed files
src/views/employee/list.vue 37 ●●●● patch | view | raw | blame | history
src/views/employee/list.vue
@@ -28,6 +28,7 @@
import 'nprogress/nprogress.css';
import { getPostList } from '@/api/system/post';
import { getDeptTree } from '@/api/system/dept';
import func from "@/utils/func";
export default {
    data() {
@@ -73,8 +74,8 @@
                    },
                    {
                        label: "姓名",
                        // prop: "name",
                        prop: 'realName',
                        prop: "name",
                        // prop: 'realName',
                        type: "input",
                        search: true,
                        rules: [
@@ -104,7 +105,24 @@
                        dicData: [],
                        props: {
                            label: 'title',
                            value: 'id',
                            value: 'title',
                        },
                        control: (res, form) => {
                            this.selectObj.deptList.some(item => {
                                if (item.title === res) {
                                    form.deptId = item.id || ''
                                    return
                                } else {
                                    if (item.children) {
                                        item.children.some(cItem => {
                                            if (cItem.title === res) {
                                                form.deptId = item.id || ''
                                                return true
                                            }
                                        })
                                    }
                                }
                            })
                        },
                        rules: [
                            {
@@ -121,7 +139,12 @@
                        dicData: [],
                        props: {
                            label: 'postName',
                            value: 'id',
                            value: 'postName',
                        },
                        control: (res, form) => {
                            const value = this.selectObj.postList.find(item => item.postName === res)
                            form.postId = value?.id || ''
                        },
                        rules: [
                            {
@@ -187,7 +210,8 @@
                    // },
                ]
            },
            data: []
            data: [],
            selectObj: {}
        };
    },
    computed: {
@@ -220,6 +244,7 @@
            row.account = row.phone
            row.realName = row.name
            row.userType = 2
            row.roleId = this.$store.state.user.userInfo?.role_id || '1123598816738675202'
            // 转换值
            add(row).then(() => {
                this.onLoad(this.page);
@@ -355,6 +380,7 @@
                        item.dicData = res.data.data
                    }
                })
                this.selectObj.deptList = res.data.data
            });
            getPostList(tenantId).then(res => {
                this.option.column.forEach(item => {
@@ -362,6 +388,7 @@
                        item.dicData = res.data.data
                    }
                })
                this.selectObj.postList = res.data.data
            });
        },
    },