Commit 51f6da09 authored by dll's avatar dll

完成职位管理 打卡记录

parent 3006d946
...@@ -38,7 +38,7 @@ instance.interceptors.request.use(config => { ...@@ -38,7 +38,7 @@ instance.interceptors.request.use(config => {
// 代 // 代
// http://192.168.0.108/17500 // http://192.168.0.108/17500
const hostname = '192.168.0.108' const hostname = '192.168.0.116'
const port = '17500' const port = '17500'
// const hostname = '192.168.0.108' // const hostname = '192.168.0.108'
......
...@@ -81,13 +81,13 @@ ...@@ -81,13 +81,13 @@
fuzzy: false fuzzy: false
}, },
{ {
name: "deptId", name: "groupId",
type: "select", type: "select",
label: "全部考勤组", label: "全部考勤组",
fuzzy: false fuzzy: false
}, },
{ {
name: "deptId", name: "classId",
type: "select", type: "select",
label: "全部班次", label: "全部班次",
fuzzy: false fuzzy: false
...@@ -105,15 +105,15 @@ ...@@ -105,15 +105,15 @@
fuzzy: false fuzzy: false
}, },
{ {
name:'startTime', name:'attendanceDateStart',
type: "date", type: "date",
label: "考勤开始时间", label: "异常开始时间",
fuzzy: false fuzzy: false
}, },
{ {
name:'endTime', name:'attendanceDateEnd',
type: "date", type: "date",
label: "考勤结束时间", label: "异常结束时间",
fuzzy: false fuzzy: false
}, },
{ {
......
...@@ -311,43 +311,43 @@ ...@@ -311,43 +311,43 @@
name: "staffName", name: "staffName",
type: "text", type: "text",
label: "员工姓名", label: "员工姓名",
fuzzy: true fuzzy: false
}, },
{ {
name: "phone", name: "phone",
type: "text", type: "text",
label: "手机号", label: "手机号",
fuzzy: true fuzzy: false
}, },
{ {
name: "deptId", name: "deptId",
type: "select", type: "select",
label: "所属部门", label: "所属部门",
fuzzy: true fuzzy: false
}, },
{ {
name: "groupId", name: "groupId",
type: "select", type: "select",
label: "所属考勤组", label: "所属考勤组",
fuzzy: true fuzzy: false
}, },
{ {
name: "classId", name: "classId",
type: "select", type: "select",
label: "班次", label: "班次",
fuzzy: true fuzzy: false
}, },
{ {
name:'attendanceDateStart', name:'attendanceDateStart',
type: "date", type: "date",
label: "考勤开始时间", label: "考勤开始时间",
fuzzy: true fuzzy: false
}, },
{ {
name:'attendanceDateEnd', name:'attendanceDateEnd',
type: "date", type: "date",
label: "考勤结束时间", label: "考勤结束时间",
fuzzy: true fuzzy: false
} }
], ],
columns: [ columns: [
...@@ -355,10 +355,10 @@ ...@@ -355,10 +355,10 @@
{type: "index",label: "序号",width: 50}, {type: "index",label: "序号",width: 50},
{label: "打卡日期", prop: "attendanceDate", formatter: this.formatterDate}, {label: "打卡日期", prop: "attendanceDate", formatter: this.formatterDate},
{label: "员工姓名", prop: "staffName"}, {label: "员工姓名", prop: "staffName"},
{label: "考勤组", prop: "attendanceGroupName"}, {label: "考勤组", prop: "attendanceGroupName",formatter:this.formatters},
{label: "部门", prop: "deptName"}, {label: "部门", prop: "deptName",formatter:this.formatters},
{label: "职位", prop: "positionName"}, {label: "职位", prop: "positionName",formatter:this.formatters},
{label: "班次", prop: "shiftsName"}, {label: "班次", prop: "shiftsName",formatter:this.formatters},
// {label: "考勤打卡记录详细信息", // {label: "考勤打卡记录详细信息",
// width: 120, // width: 120,
// prop: "subColumns", // prop: "subColumns",
......
...@@ -123,25 +123,25 @@ ...@@ -123,25 +123,25 @@
fuzzy: false fuzzy: false
}, },
{ {
name: "deptId", name: "groupId",
type: "select", type: "select",
label: "全部考勤组", label: "全部考勤组",
fuzzy: false fuzzy: false
}, },
{ {
name: "deptId", name: "classId",
type: "select", type: "select",
label: "全部班次", label: "全部班次",
fuzzy: false fuzzy: false
}, },
{ {
name:'startTime', name:'attendanceDateStart',
type: "date", type: "date",
label: "考勤开始时间", label: "考勤开始时间",
fuzzy: false fuzzy: false
}, },
{ {
name:'endTime', name:'attendanceDateEnd',
type: "date", type: "date",
label: "考勤结束时间", label: "考勤结束时间",
fuzzy: false fuzzy: false
......
<template> <template>
<div className="page"> <div className="page">
<el-card style="height:80vh"> <el-card style="height:80vh;overflow:scroll-y">
<LayoutTable notPagination :data="tableData" ref="layoutTable" :config="tableConfig" notSearch></LayoutTable> <LayoutTable notPagination :data="tableData" ref="layoutTable" :config="tableConfig" notSearch></LayoutTable>
</el-card> </el-card>
<drawer-show ref="drawerform" @ok="getData" /> <drawer-show ref="drawerform" @ok="getData" />
......
<template>
<!-- 弹出框表单 -->
<el-dialog :title="title" :visible.sync="open" width="90%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field label="分组id" prop="groupId" v-model="form.groupId" placeholder="请输入分组id"/>
<Field label="分组名称" prop="groupName" v-model="form.groupName" placeholder="请输入分组名称"/>
<Field label="职位编码" prop="jobCode" v-model="form.jobCode" placeholder="请输入职位编码"/>
<Field label="职位名称" prop="jobName" v-model="form.jobName" placeholder="请输入职位名称"/>
<Field label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</template>
<script>
import form from "@/assets/mixins/formdialog";
import dialogShow from "./dialogshow";
export default {
mixins: [form],
components: {
dialogShow ,
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "职位信息",
// 是否显示弹出层
open: false,
toString:[
],
// 表单校验
rules: {
}
};
},
methods: {
/** 编辑 */
edit(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="job/edit";
this.getData();
this.pageInfo.type="edit"
this.title = "修改职位信息";
},
/** 新增 */
add(row) {
this.reset()
this.urls.currUrl = "job/add";
this.getData();
this.pageInfo.type="add"
this.title = "新增职位信息";
},
/** 查看*/
view(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="job/view";
this.getData();
this.pageInfo.type="view"
this.title = "职位信息详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
groupId : null,
groupName : "",
jobCode : "",
jobName : "",
remark : "",
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
size="50%"> size="50%">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" style="padding:20px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px" style="padding:20px">
<el-row> <el-row>
<Field v-if="title == '新增职位信息'" label="分组" prop="groupId" v-model="form.groupId" <Field v-if="from == 'job'" label="分组" prop="groupId" v-model="form.groupId"
:enumData="dict.group" type="select" placeholder="请选择分组"/> :enumData="dict.group" type="select" placeholder="请选择分组"/>
<Field label="分组名称" prop="groupName" v-model="form.groupName" placeholder="请输入分组名称" :maxLength="10" v-if="title == '新增分组信息'"/> <Field label="分组名称" prop="groupName" v-model="form.groupName" placeholder="请输入分组名称" :maxLength="10" v-if="from == 'group'"/>
<Field label="职位编码" prop="jobCode" :maxLength="10" v-model="form.jobCode" placeholder="请输入职位编码" v-if="title == '新增职位信息'"/> <Field label="职位编码" prop="jobCode" :maxLength="10" v-model="form.jobCode" placeholder="请输入职位编码" v-if="from == 'job'"/>
<Field label="职位名称" prop="jobName" :maxLength="10" v-model="form.jobName" placeholder="请输入职位名称" v-if="title == '新增职位信息'" /> <Field label="职位名称" prop="jobName" :maxLength="10" v-model="form.jobName" placeholder="请输入职位名称" v-if="from == 'job'" />
<Field label="类型" disabled prop="type" v-model="form.type" type="select" :enumData="dict.type" placeholder="请选择类型"/> <Field label="类型" disabled prop="type" v-model="form.type" type="select" :enumData="dict.type" placeholder="请选择类型"/>
<Field label="备注" prop="remark" :maxLength="50" v-model="form.remark" type="textarea" placeholder="请输入备注"/> <Field label="备注" prop="remark" :maxLength="50" v-model="form.remark" type="textarea" placeholder="请输入备注"/>
...@@ -57,17 +57,19 @@ ...@@ -57,17 +57,19 @@
methods: { methods: {
/** 编辑 */ /** 编辑 */
edit(row) { edit(from,row) {
this.reset() this.reset()
this.query = { id: row.id }; this.query = { id: row.id };
this.urls.currUrl ="job/edit"; this.urls.currUrl ="job/edit";
this.getData(); this.getData();
this.pageInfo.type="edit" this.pageInfo.type="edit"
this.title = "修改职位信息"; this.from = from
this.title = from === 'group'?"修改分组信息":'修改职位信息';
}, },
/** 新增 */ /** 新增 */
add(row) { add(row) {
// console.log(row,'添加') console.log(row,'添加')
this.from = row this.from = row
this.title = row === 'group'?"新增分组信息":'新增职位信息'; this.title = row === 'group'?"新增分组信息":'新增职位信息';
this.reset() this.reset()
...@@ -93,7 +95,7 @@ ...@@ -93,7 +95,7 @@
afterRender(data) { afterRender(data) {
// 固定新增类型 // 固定新增类型
if(this.title === '新增分组信息'){ if(this.from == 'group'){
this.form.type = '1' this.form.type = '1'
}else{ }else{
this.form.type = '2' this.form.type = '2'
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<Field label="工号" :maxLength="15" prop="workNum" v-model="form.workNum" placeholder="请输入工号"/> <Field label="工号" :maxLength="15" prop="workNum" v-model="form.workNum" placeholder="请输入工号"/>
</el-row> </el-row>
<form-buttons @submit='submitForm' noCancelBtn /> <form-buttons @submit='submitFormStaff' noCancelBtn />
</el-form> </el-form>
</el-drawer> </el-drawer>
<!-- 部门选择 --> <!-- 部门选择 -->
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
<script> <script>
import form from "@/assets/mixins/formdialog"; import form from "@/assets/mixins/formdialog";
import f from '../codeGen/form';
export default { export default {
name: "StaffDetail", name: "StaffDetail",
mixins: [form], mixins: [form],
...@@ -121,11 +122,20 @@ ...@@ -121,11 +122,20 @@
icon: "icon", icon: "icon",
}, },
ishowBumen:false, ishowBumen:false,
deptnode:{} deptnode:{},
jobid:''//当前职位
} }
}, },
methods: { methods: {
submitFormStaff(){
this.$post('/staff/save',this.form).then(res => {
if(res.code == 1){
this.open = false
this.$emit('ok')
}
})
},
renderContent: function (h, { node, data, store }) { renderContent: function (h, { node, data, store }) {
return ( return (
<span> <span>
...@@ -163,6 +173,7 @@ ...@@ -163,6 +173,7 @@
this.reset() this.reset()
this.urls.currUrl = "staff/add"; this.urls.currUrl = "staff/add";
this.getData(); this.getData();
this.jobid = row
this.pageInfo.type="add" this.pageInfo.type="add"
this.title = "新增员工基本信息"; this.title = "新增员工基本信息";
}, },
...@@ -181,6 +192,7 @@ ...@@ -181,6 +192,7 @@
}, },
/**获取数据后弹框 */ /**获取数据后弹框 */
afterRender(data) { afterRender(data) {
this.form.positionId = this.jobid.toString()
this.open = true; this.open = true;
}, },
......
...@@ -7,11 +7,10 @@ ...@@ -7,11 +7,10 @@
<el-col :span="6" :xs="12" class="mytree"> <el-col :span="6" :xs="12" class="mytree">
<div class="title"> <div class="title">
<el-button type="primary" size="mini" @click="saveFn('group')">新增分组</el-button> <el-button type="primary" size="mini" @click="saveFn('group')">新增分组</el-button>
<el-button type="success" size="mini" @click="saveFn('position')">新增职位</el-button> <el-button type="success" size="mini" @click="saveFn('job')">新增职位</el-button>
</div> </div>
<el-scrollbar style="height: 100%" class="mt20"> <el-scrollbar style="height: 100%" class="mt20">
<!-- 区分分组和职位 --> <!-- 区分分组和职位 -->
<!-- @node-click.self="handleNodeClick" -->
<el-tree <el-tree
size="mini" size="mini"
ref="siteTree" ref="siteTree"
...@@ -22,12 +21,11 @@ ...@@ -22,12 +21,11 @@
:props="{ :props="{
children:'children' children:'children'
}" }"
:load="loadNode"
highlight-current highlight-current
default-expand-all default-expand-all
:expand-on-click-node="false" :expand-on-click-node="false"
:render-content="renderContent" :render-content="renderContent"
@node-click.self="handleNodeClick"
> >
<template slot-scope="{ node, data }"> <template slot-scope="{ node, data }">
<span class="custom-tree-node"> <span class="custom-tree-node">
...@@ -56,29 +54,66 @@ ...@@ -56,29 +54,66 @@
</el-scrollbar> </el-scrollbar>
</el-col> </el-col>
<el-col :span="18" :xs="12" class="mytree"> <el-col :span="18" :xs="12" class="mytree">
<LayoutTable :data="tableData" :config="tableConfig" notSearch notAdd> <div class="mt20" style="font-size:14px" v-if="currentName">
<el-button type="success" size="mini" slot="table-head-left2"> {{currentName}} ({{this.staffList.length}})
</div>
<div class="mt10">
<el-button type="success" size="mini" @click="addStaff">
新增员工</el-button> 新增员工</el-button>
<el-button type="primary" @click="doExport" :disabled="isExport" <el-button type="primary" @click="doExport" :disabled="isExport"
size="mini" slot="table-head-left2">导出</el-button> size="mini">导出数据</el-button>
</LayoutTable>
<el-button type="danger" @click="allDelete" :disabled="isExport"
size="mini">批量删除</el-button>
</div>
<el-table :data="staffList" border class="mt20" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column label="姓名" prop="name"></el-table-column>
<el-table-column label="部门" prop="deptName"></el-table-column>
<el-table-column label="员工类型" prop="staffType"
>
<template slot-scope="scope">
<el-tag size='mini' v-show="scope.row.staffType == 1">全职</el-tag>
<el-tag size='mini' v-show="scope.row.staffType == 2">兼职</el-tag>
<el-tag size='mini' v-show="scope.row.staffType == 3">实习</el-tag>
</template>
</el-table-column>
<el-table-column label="手机号" prop="phoneNumber"></el-table-column>
<el-table-column label="添加时间" prop="createTime"></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" @click="deleteStaff(scope.row)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-col> </el-col>
</el-row> </el-row>
<drawer-show ref="drawerform" @ok="getData" /> <drawer-show ref="drawerform" @ok="getData"/>
<drawer-staff ref="drawerStaff" :bumentree="bumentree" @ok="refresh"></drawer-staff>
</div> </div>
</template> </template>
<script> <script>
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
import {handleTree} from "@/assets/utils/table";
import drawerShow from "./drawershow"; import drawerShow from "./drawershow";
import table from "@/assets/mixins/table"; import table from "@/assets/mixins/table";
import TabPane from "@/components/tabPane.vue" import TabPane from "@/components/tabPane.vue"
import drawershowStaff from './drawershowStaff.vue' import drawerStaff from './drawershowStaff.vue'
export default { export default {
name: "JobList", name: "JobList",
components: { components: {
drawerShow, drawerShow,
TabPane TabPane,
drawerStaff
}, },
mixins: [table], mixins: [table],
created() { created() {
...@@ -86,6 +121,9 @@ ...@@ -86,6 +121,9 @@
"page":1, "page":1,
"size":-1 "size":-1
} }
this.$post("/dept/treeselect", {}).then(({ data }) => {
this.bumentree = data.result
})
}, },
computed:{ computed:{
thirdList(){ thirdList(){
...@@ -97,32 +135,48 @@ ...@@ -97,32 +135,48 @@
} }
}, },
methods: { methods: {
handleSelectionChange(val) {
this.multipleSelection = val;
},
getStaff(){
this.$post('/job/info?id='+this.currentId).then(res => {
if(res.code == 1){
this.staffList = res.data.staffEntities
}
})
},
addStaff(){
this.$refs.drawerStaff.add(this.currentId)
},
refresh(){
// 请求
// 员工、职位列表
if(this.currentId){
this.getStaff()
}
this.getData()
},
handleNodeClick(node){ handleNodeClick(node){
console.log(node) if(!node.groupId){
return
}
this.currentId = node.id
this.currentName = node.jobName
this.getStaff()
}, },
// 获取数据后 // 获取数据后
afterRender(){ // 处理树结构
console.log(this.tableData.data) afterRender(data){
data.data = handleTree(data.data, "id", "groupId");
}, },
saveFn(from){ saveFn(from){
this.$refs.drawerform.add(from) this.$refs.drawerform.add(from)
}, },
async loadNode(node, resolve) {
if (node.level === 0) {
return;
}
resolve(data.result);
},
doExport(){ doExport(){
this.isExport = true; this.isExport = true;
let params = {} let params = {}
for(let value of this.config.search){ if(this.multipleSelection.length>0){
if(this.query[value.name]){ params['idList'] = this.multipleSelection
params[value.name] = this.query[value.name]
}
}
if(this.selection.length>0){
params['idList'] = this.selection
} }
this.$download("/job/exportExcel", { this.$download("/job/exportExcel", {
...params ...params
...@@ -162,7 +216,7 @@ ...@@ -162,7 +216,7 @@
this.toEdit(from,row) this.toEdit(from,row)
}, },
// 删除 // 删除分组或者职位
deleteFn(row){ deleteFn(row){
this.$confirm('此操作将永久删除该信息, 是否继续?', '提示', { this.$confirm('此操作将永久删除该信息, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -180,62 +234,46 @@ ...@@ -180,62 +234,46 @@
} }
}) })
}) })
},
// 删除员工
deleteStaff(row){
this.$confirm("此操作将永久删除该员工,是否继续",'提示',{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('/staff/delete?id='+row.id).then(res => {
if(res.code == 1){
this.$message.success('删除成功')
this.getStaff()
} }
})
})
}, },
data() { // 批量删除员工
return { allDelete(){
config: { if (!this.multipleSelection.length) {
return this.$message.warning('请选中一条记录');
search: [ }
// { let ids = this.multipleSelection.map(item => item.id).join(',')
// name: "groupName", this.$get('/staff/delete?',{id:ids}).then(res => {
// type: "text", if(res.code == 1){
// label: "分组名称", this.$message.success('删除成功')
// fuzzy: true this.getStaff()
// },
// {
// name: "jobCode",
// type: "text",
// label: "职位编码",
// fuzzy: true
// },
// {
// name: "jobName",
// type: "text",
// label: "职位名称",
// fuzzy: true
// },
],
columns: [
{type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
// {label: "分组名称", prop: "groupName"},
// {label: "职位编码", prop: "jobCode"},
// {label: "职位名称", prop: "jobName"},
{label: "姓名", prop: "staffName"},
{label: "部门", prop: "deptName"},
{label: "员工类型", prop: "staffType",formatter: this.formatterType},
{label: "手机号", prop: "phoneNumber"},
{label: "添加时间", prop: "createTime",formatter:this.formatterDateOnly},
{
label: "操作",
width: 240,
formatter: row => {
return (
<table-buttons noAdd noView noEdit row={row}
onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
)
} }
})
} }
],
}, },
data() {
return {
isExport:false, isExport:false,
saveFrom:'', saveFrom:'',
addShow:false, addShow:false,
staffList:[] staffList:[],
bumentree:[],
currentId:'',
currentName:'',
multipleSelection:[]
} }
} }
} }
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<span class="freshTime" slot="table-head-left2"> <span class="freshTime" slot="table-head-left2">
<i class="el-icon-refresh"></i> <i class="el-icon-refresh"></i>
<span>上次同步时间:2023-04-09 09:00:00</span> <span>上次同步时间:{{tableData.staff.refreshDate}}</span>
</span> </span>
</LayoutTable> </LayoutTable>
</el-row> </el-row>
...@@ -151,6 +151,7 @@ ...@@ -151,6 +151,7 @@
</template> </template>
<script> <script>
import {timestampToTime} from '@/assets/utils/dateFormat.js'
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
import drawerShow from "./drawershow"; import drawerShow from "./drawershow";
import table from "@/assets/mixins/table"; import table from "@/assets/mixins/table";
...@@ -250,6 +251,9 @@ ...@@ -250,6 +251,9 @@
submitFileForm() { submitFileForm() {
this.$refs.upload.submit(); this.$refs.upload.submit();
}, },
afterRender(data){
this.tableData.staff.refreshDate = timestampToTime(this.tableData.staff.refreshDate)
}
}, },
data() { data() {
return { return {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment