This commit is contained in:
oepraxxx 2022-03-17 21:28:16 +08:00
parent 3b60dc9654
commit 641fee0e4e
3 changed files with 151 additions and 0 deletions

View File

@ -0,0 +1,4 @@
/**
* OA 系统
*/
package com.oa.system;

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询员工信息列表
export function listEmployee(query) {
return request({
url: '/oa/employee/list',
method: 'get',
params: query
})
}
// 查询员工信息详细
export function getEmployee(userId) {
return request({
url: '/oa/employee/' + userId,
method: 'get'
})
}
// 新增员工信息
export function addEmployee(data) {
return request({
url: '/oa/employee',
method: 'post',
data: data
})
}
// 修改员工信息
export function updateEmployee(data) {
return request({
url: '/oa/employee',
method: 'put',
data: data
})
}
// 删除员工信息
export function delEmployee(userId) {
return request({
url: '/oa/employee/' + userId,
method: 'delete'
})
}

View File

@ -0,0 +1,103 @@
<template>
<div class="app-container">
<el-descriptions title="个人中心" :v-model="employee">
<el-descriptions-item label="部门"></el-descriptions-item>
<el-descriptions-item v-model="form.phone" label="手机号"></el-descriptions-item>
<el-descriptions-item label="居住地">苏州市</el-descriptions-item>
<el-descriptions-item label="备注">
<el-tag size="small">学校</el-tag>
</el-descriptions-item>
<el-descriptions-item label="联系地址">江苏省苏州市吴中区吴中大道 1188 </el-descriptions-item>
</el-descriptions>
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
<!-- 添加或修改员工信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="部门id" prop="deptId">
<el-input v-model="form.deptId" placeholder="请输入部门id" />
</el-form-item>
<el-form-item label="职位id" prop="postId">
<el-input v-model="form.postId" placeholder="请输入职位id" />
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入电话" />
</el-form-item>
<el-form-item label="身份证" prop="idCard">
<el-input v-model="form.idCard" placeholder="请输入身份证" />
</el-form-item>
<el-form-item label="银行卡" prop="bankCard">
<el-input v-model="form.bankCard" placeholder="请输入银行卡" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getEmployee, updateEmployee } from "@/api/oa/employee";
export default {
name: "Employee",
data() {
return {
//
loading: true,
//
total: 0,
//
employee: {},
//
title: "",
//
open: false,
form: {},
//
rules: {
}
};
},
created() {
this.getEmployee();
},
methods: {
/** 查询员工信息 */
getEmployee() {
this.loading = true;
getEmployee('100001').then(response => {
this.employee = response.data;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const userId = row.userId || this.ids
getEmployee(userId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改员工信息";
});
},
}
};
</script>