1
lzhe
2024-09-23 a1c29120c31c968d90fb8e97efe04584efee2f28
1
已修改2个文件
39 ■■■■ 文件已修改
src/views/master/person/main/personPerson.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/master/person/main/save.vue 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/master/person/main/personPerson.vue
@@ -2,7 +2,7 @@
 * @Author: lzhe lzhe@example.com
 * @Date: 2024-03-26 10:28:33
 * @LastEditors: lzhe lzhe@example.com
 * @LastEditTime: 2024-06-03 17:07:14
 * @LastEditTime: 2024-09-23 15:32:56
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/master/person/main/personPerson.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
src/views/master/person/main/save.vue
@@ -38,9 +38,26 @@
                </el-col>
                <el-col :span="12">
                    <el-form-item label="部门">
                        <el-select v-model="addPersonForm.organizationId" filterable style="width: 100%" placeholder="部门">
                        <!-- <el-select v-model="addPersonForm.organizationId" filterable style="width: 100%" placeholder="部门">
                            <el-option v-for="item in organizationList" :key="item.id" :label="item.name" :value="item.id"/>
                        </el-select>
                        </el-select> -->
                        <!-- <el-tree-select
                            multiple
                            show-checkbox
                            default-expand-all
                            size="small"
                            @change = "organizationIdChange"
                            v-model="addPersonForm.organizationId"
                            clearable
                            node-key="id"
                            placeholder="部门"
                            ref="parentTree"
                            :data="parentData"
                            :props="{ label: 'title' }"
                            style="width:80%;"
                            :default-checked-keys="selectedIds"
                            :render-after-expand="false" /> -->
                            <el-tree-select @change= "parentIdChange" v-model="addPersonForm.organizationId" clearable placeholder="上级部门" default-expand-all check-on-click-nod :data="departmentList" check-strictly :props="{ label: 'name' }" node-key="id" ref="parentTree" style="width: 100%" />
                    </el-form-item>
                </el-col>
                <el-col :span="12">
@@ -81,6 +98,9 @@
        emits: ['success', 'closed'],
        data() {
            return {
                departmentList: [],
                parentData: {},
                selectedIds: [],
                deptIdList: [],
                userIdList: [],
                organizationList: [],
@@ -102,7 +122,7 @@
                    status: "",
                    postId: "",
                    email: "",
                    organizationId: "",
                    organizationId: [],
                    pinCode: "",
                    hireDate: "",
                    jobNumber: "",
@@ -139,6 +159,10 @@
            this.getdeptId();  //数据权限调整
        },
        methods: {
            parentIdChange(val) {
                // var $parentId = this.$refs.parentTree.getCurrentNode().title;
                // this.depatmentForm.$parentId = $parentId;
            },
            getdeptId() {  //数据权限调整
                this.$HTTP.get(`/api/blade-system/data-scope-manager/tree`).then(res=> {
                    if(res.code == 200) {
@@ -153,10 +177,13 @@
                    }
                })
            },
            getOrganizationList() {  //部门
            getOrganizationList() {
                this.$HTTP.get(`/api/blade-cps/organization/tree?groupType=group_organization&groupCategory=1`).then(res=> {
                    if(res.code == 200) {
                        this.organizationList = res.data;
                        this.departmentList = res.data;
                        console.log(res.data[0].id)
                        this.addPersonForm.organizationId = res.data[0].id;
                        console.log(this.addPersonForm.organizationId)
                    }
                })
            },