renyuan
This commit is contained in:
parent
9e91c90213
commit
c831b41b61
|
@ -15,3 +15,12 @@ export function getProcessYield(data) {
|
|||
data
|
||||
})
|
||||
}
|
||||
//到岗统计
|
||||
export function getatwork(data) {
|
||||
return request({
|
||||
url: '/srm/at_work/',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -418,12 +418,12 @@ export const asyncRoutes = [
|
|||
meta: { title: '人员列表', icon: 'example', perms: ['user_manage'] }
|
||||
},
|
||||
{
|
||||
path: 'personnel',
|
||||
name: 'personnel',
|
||||
component: () => import('@/views/personnel/user'),
|
||||
meta: { title: '考勤列表', icon: 'example', perms: ['user_manage'] }
|
||||
path: 'attendance',
|
||||
name: 'attendance',
|
||||
component: () => import('@/views/personnel/attendance'),
|
||||
meta: { title: '考勤列表', icon: 'example', perms: ['attendance_manage'] }
|
||||
} ,{
|
||||
path: 'userupdate',
|
||||
path: 'userupdate/:id',
|
||||
name: 'userupdate',
|
||||
component: () => import('@/views/personnel/userupdate'),
|
||||
meta: { title: '人员信息详情', icon: 'employee', perms: ['employee_detail'] },
|
||||
|
|
|
@ -0,0 +1,182 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="今日到岗">
|
||||
<el-table
|
||||
|
||||
:data="userList.results"
|
||||
style="width: 100%; margin-top: 6px"
|
||||
highlight-current-row
|
||||
row-key="id"
|
||||
height="100"
|
||||
stripe
|
||||
border
|
||||
v-el-height-adaptive-table="{ bottomOffset: 41 }"
|
||||
>
|
||||
<el-table-column type="index" width="50" label="序号" />
|
||||
<el-table-column align="center" label="工号">
|
||||
<template slot-scope="scope">{{ scope.row.number }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="姓名">
|
||||
<template slot-scope="scope">{{ scope.row.name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="到岗情况">
|
||||
<template slot-scope="scope">
|
||||
<el-tag type="success" v-if="scope.row.is_atwork">在岗</el-tag>
|
||||
|
||||
<el-tag type="danger" v-else>离岗</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="header-center" label="部门">
|
||||
<template v-if="scope.row.dept_" slot-scope="scope">{{
|
||||
scope.row.dept_.name
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="userList.count > 0"
|
||||
:total="userList.count"
|
||||
:page.sync="listQuery.page"
|
||||
:limit.sync="listQuery.page_size"
|
||||
@pagination="getList"
|
||||
/></el-tab-pane>
|
||||
<el-tab-pane label="到岗统计">
|
||||
<div class="container">
|
||||
|
||||
|
||||
<span class="demonstration">年、月</span>
|
||||
<el-date-picker
|
||||
v-model="value2"
|
||||
type="month"
|
||||
placeholder="选择年月">
|
||||
</el-date-picker>
|
||||
<el-button type="primary" @click="submit">主要按钮</el-button>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
|
||||
:data="atworkList"
|
||||
style="width: 100%; margin-top: 6px"
|
||||
highlight-current-row
|
||||
row-key="id"
|
||||
height="680"
|
||||
stripe
|
||||
border
|
||||
v-el-height-adaptive-table="{ bottomOffset: 41 }"
|
||||
>
|
||||
<el-table-column type="index" width="50" label="序号" />
|
||||
<el-table-column align="center" label="工号">
|
||||
<template slot-scope="scope">{{ scope.row.number }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="姓名">
|
||||
<template slot-scope="scope">{{ scope.row.name }}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="header-center" label="部门">
|
||||
<template slot-scope="scope">{{ scope.row.dept_name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="出勤天数">
|
||||
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
</el-tab-pane>
|
||||
|
||||
</el-tabs>
|
||||
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<style>
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: #409eff;
|
||||
}
|
||||
.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
line-height: 100px;
|
||||
text-align: center;
|
||||
}
|
||||
.avatar {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import { getEmployeeList } from "@/api/employee";
|
||||
import checkPermission from "@/utils/permission";
|
||||
|
||||
import {getatwork } from "@/api/srm";
|
||||
import { upUrl, upHeaders } from "@/api/file";
|
||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
export default {
|
||||
components: { Pagination, Treeselect },
|
||||
data() {
|
||||
return {
|
||||
userList: { count: 0 },
|
||||
atworkList: "",
|
||||
value3:null,
|
||||
value2:null,
|
||||
listLoading: true,
|
||||
listQuery: {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
},
|
||||
|
||||
atworkDate:{year:null,month:null},
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
this.getList();
|
||||
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
//今日到岗
|
||||
getList() {
|
||||
this.listQuery.fields='number,name,is_atwork,dept_';
|
||||
getEmployeeList(this.listQuery).then((response) => {
|
||||
if (response.data) {
|
||||
this.userList = response.data;
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
//到岗统计
|
||||
|
||||
submit()
|
||||
{
|
||||
|
||||
this.atworkDate.year=this.value2.getFullYear();
|
||||
this.atworkDate.month=this.value2.getMonth()+1;
|
||||
|
||||
getatwork(this.atworkDate).then((response) => {
|
||||
if (response.data) {
|
||||
this.atworkList = response.data;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
|
@ -2,9 +2,7 @@
|
|||
<div class="app-container">
|
||||
|
||||
<el-card>
|
||||
<div slot="header" class="clearfix">
|
||||
<span>用户</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
<el-input
|
||||
|
@ -39,7 +37,7 @@
|
|||
height="100"
|
||||
stripe
|
||||
border
|
||||
v-el-height-adaptive-table="{bottomOffset: 50}"
|
||||
v-el-height-adaptive-table="{bottomOffset: 41}"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column align="center" label="工号">
|
||||
|
@ -179,8 +177,7 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getOrgAll();
|
||||
this.getRoleAll();
|
||||
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
|
@ -212,18 +209,7 @@ export default {
|
|||
this.listLoading = false;
|
||||
});
|
||||
},
|
||||
getOrgAll() {
|
||||
this.treeLoding = true;
|
||||
getOrgAll().then(response => {
|
||||
this.orgData = genTree(response.data);
|
||||
this.treeLoding = false;
|
||||
});
|
||||
},
|
||||
getRoleAll() {
|
||||
getRoleAll().then(response => {
|
||||
this.roles = genTree(response.data);
|
||||
});
|
||||
},
|
||||
|
||||
resetFilter() {
|
||||
this.listQuery = {
|
||||
page: 1,
|
||||
|
|
|
@ -1,24 +1,56 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-row :gutter="2">
|
||||
<el-col :span="9" >
|
||||
<el-card style="height:655px" >
|
||||
|
||||
<div>基础信息</div>
|
||||
<el-form label-width="60px">
|
||||
<el-form-item label="姓名">{{userDate.name}}</el-form-item>
|
||||
<el-form-item label="账户">{{userDate.username}}</el-form-item>
|
||||
|
||||
<el-form-item label="角色">
|
||||
<el-tag
|
||||
v-for="(item, index) in userDate.roles_name"
|
||||
:key="index"
|
||||
style="margin:2px"
|
||||
>{{item}}</el-tag>
|
||||
<el-form ref="Form" :model="user" label-width="80px" label-position="right" :rules="rule1">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="user.name" placeholder="姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="账户" prop="username">
|
||||
<el-input v-model="user.username" placeholder="账户" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属部门" prop="dept">
|
||||
<el-cascader ref="cascader" :options="orgData" v-model="user.dept" :show-all-levels="false"></el-cascader>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="角色" prop="roles">
|
||||
<el-select v-model="user.roles" multiple placeholder="请选择" style="width:100%">
|
||||
<el-option
|
||||
v-for="item in roles"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="头像" prop="dept">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
:action="upUrl"
|
||||
accept="image/jpeg, image/gif, image/png, image/bmp"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
:headers="upHeaders"
|
||||
>
|
||||
<img v-if="user.avatar" :src="user.avatar" class="avatar" />
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon" />
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item size="large">
|
||||
<el-button type="primary" @click="submitFormuser" >保存</el-button>
|
||||
<el-button @click="goBack">返回</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机">{{userDate.phone}}</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-col :span="15" >
|
||||
<el-card style="height:655px" >
|
||||
<div>详细信息</div>
|
||||
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
|
||||
<el-row>
|
||||
|
@ -31,6 +63,8 @@
|
|||
:style="{width: '100%'}"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="学历" prop="qualification">
|
||||
<el-input
|
||||
v-model="formData.qualification"
|
||||
|
@ -39,7 +73,7 @@
|
|||
:style="{width: '100%'}"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
</el-col>
|
||||
|
||||
|
||||
|
@ -61,7 +95,8 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="在职状态" prop="job_state">
|
||||
<el-select
|
||||
v-model="formData.job_state"
|
||||
|
@ -77,6 +112,12 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="出生年月" prop="birthday">
|
||||
<el-date-picker
|
||||
v-model="formData.birthday"
|
||||
|
@ -87,12 +128,9 @@
|
|||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-row>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
||||
<el-form-item label="身份证号" prop="id_number">
|
||||
<el-input
|
||||
v-model="formData.id_number"
|
||||
|
@ -107,7 +145,7 @@
|
|||
|
||||
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="证件照" prop="photo">
|
||||
<el-upload
|
||||
:action="upUrl"
|
||||
|
@ -123,9 +161,8 @@
|
|||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="签名图片" prop="signature">
|
||||
<el-upload :action="upUrl" :headers="upHeaders" accept=".png, .jpeg, .jpg" :before-upload="beforeUpload" class="avatar-uploader"
|
||||
:show-file-list="false"
|
||||
|
@ -139,9 +176,10 @@
|
|||
<el-button @click="goBack">返回</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
<style>
|
||||
|
@ -186,21 +224,27 @@
|
|||
|
||||
import { upUrl, upHeaders } from "@/api/file"
|
||||
import { genSignature } from "@/api/util"
|
||||
import { getUser } from "@/api/user";
|
||||
import { getUser,updateUser } from "@/api/user";
|
||||
import { genTree } from "@/utils"
|
||||
import { getOrgAll } from "@/api/org"
|
||||
import { getRoleAll } from "@/api/role"
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import { getEmployee, updateEmployee } from "@/api/employee";
|
||||
const defaultForm = {
|
||||
user:{},
|
||||
};
|
||||
export default {
|
||||
name: "Employeedetail",
|
||||
components: {},
|
||||
components: { Treeselect },
|
||||
props: ["id"],
|
||||
data() {
|
||||
return {
|
||||
upHeaders: upHeaders(),
|
||||
upUrl: upUrl(),
|
||||
formData: Object.assign({}, defaultForm),
|
||||
userDate:[],
|
||||
user:[],
|
||||
orgData: [],
|
||||
roles: [],
|
||||
genderOptions: [
|
||||
{ value: "男", label: "男" },
|
||||
{ value: "女", label: "女" }
|
||||
|
@ -209,6 +253,7 @@ export default {
|
|||
{ value: 1, label: "在职" },
|
||||
{ value: 2, label: "离职" }
|
||||
],
|
||||
deptvalue:null,
|
||||
rules: {
|
||||
|
||||
ID_number: [
|
||||
|
@ -226,7 +271,8 @@ export default {
|
|||
created() {
|
||||
this.formData.id = this.$route.params.id;
|
||||
this.getDetail();
|
||||
|
||||
this.getOrgAll();
|
||||
this.getRoleAll();
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
|
@ -235,13 +281,38 @@ export default {
|
|||
this.formData = res.data;
|
||||
getUser(res.data.user).then(Response => {
|
||||
|
||||
this.userDate=Response.data;
|
||||
this.user=Response.data;
|
||||
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
getOrgAll() {
|
||||
|
||||
getOrgAll().then(response => {
|
||||
this.orgData = genTree(response.data);
|
||||
|
||||
});
|
||||
},
|
||||
getRoleAll() {
|
||||
getRoleAll({page:0}).then(response => {
|
||||
this.roles =response.data;
|
||||
});
|
||||
},
|
||||
|
||||
handleAvatarSuccess(res, file) {
|
||||
this.user.avatar = res.data.path
|
||||
},
|
||||
beforeAvatarUpload(file) {
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
this.$message.error("上传头像图片大小不能超过 2MB!");
|
||||
}
|
||||
return isLt2M;
|
||||
},
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.label.indexOf(value) !== -1;
|
||||
},
|
||||
beforeUpload(file) {
|
||||
const isLt1M = file.size / 1024 / 1024 < 1;
|
||||
if (!isLt1M) {
|
||||
|
@ -277,6 +348,26 @@ export default {
|
|||
},
|
||||
goBack() {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
submitFormuser() {
|
||||
this.$refs["Form"].validate(valid => {
|
||||
if (!valid) return;
|
||||
|
||||
|
||||
this.deptvalue= this.$refs['cascader'].getCheckedNodes();
|
||||
if( this.deptvalue!="")
|
||||
{
|
||||
this.user.dept=this.deptvalue[0].value;
|
||||
}
|
||||
|
||||
updateUser(this.user.id, this.user).then(res => {
|
||||
|
||||
this.$message({
|
||||
message: "编辑成功",
|
||||
type: "success",
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -88,9 +88,9 @@
|
|||
</el-table-column>
|
||||
<el-table-column align="header-center" label="部门">
|
||||
<template
|
||||
v-if="scope.row.dept_name != null"
|
||||
v-if="scope.row.dept"
|
||||
slot-scope="scope"
|
||||
>{{ scope.row.dept_name }}</template>
|
||||
>{{ scope.row.dept_.name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建日期">
|
||||
<template slot-scope="scope">
|
||||
|
|
Loading…
Reference in New Issue