From e75e8758dda486481c3027d696c3a07b8679c955 Mon Sep 17 00:00:00 2001 From: Archer_cdm Date: Mon, 26 Dec 2022 10:35:16 +0800 Subject: [PATCH] =?UTF-8?q?=EF=BC=88+=EF=BC=89=E5=91=98=E5=B7=A5=E6=B2=9F?= =?UTF-8?q?=E9=80=9A=E7=BB=9F=E8=AE=A1=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=90=AD=E5=BB=BA+api=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/models/employee_communicate.js | 65 ++++ web/client/index.ejs | 2 +- web/client/index.html | 2 +- .../src/layout/components/header/contant.js | 14 +- .../containers/communication/detailModal.js | 38 ++ .../communication/employeeCommunication.jsx | 356 ++++++++---------- .../sections/humanAffairs/containers/index.js | 4 +- .../containers/personalTrainRecord.jsx | 2 +- .../src/sections/humanAffairs/nav-item.jsx | 20 +- .../src/sections/humanAffairs/routes.js | 26 +- 10 files changed, 296 insertions(+), 233 deletions(-) create mode 100644 api/app/lib/models/employee_communicate.js create mode 100644 web/client/src/sections/humanAffairs/containers/communication/detailModal.js diff --git a/api/app/lib/models/employee_communicate.js b/api/app/lib/models/employee_communicate.js new file mode 100644 index 0000000..b3ef80f --- /dev/null +++ b/api/app/lib/models/employee_communicate.js @@ -0,0 +1,65 @@ +/* eslint-disable*/ +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const EmployeeCommunicate = sequelize.define("employeeCommunicate", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + primaryKey: true, + field: "id", + autoIncrement: true, + }, + personalName: { + type: DataTypes.STRING, + allowNull: false, + field: "personalname", + }, + job: { + type: DataTypes.STRING, + allowNull: false, + field: "job", + }, + departmentName: { + type: DataTypes.STRING, + allowNull: false, + field: "departmentname", + }, + communicateDate: { + type: DataTypes.DATE, + allowNull: false, + field: "communicatedate", + }, + communicateContent: { + type: DataTypes.STRING, + allowNull: false, + field: "communicatecontent", + }, + communicateResult: { + type: DataTypes.STRING, + allowNull: false, + field: "communicateresult", + }, + valuation: { + type: DataTypes.STRING, + allowNull: false, + field: "valuation", + }, + communicateCondition: { + type: DataTypes.STRING, + allowNull: false, + field: "communicatecondition", + }, + nextPlan: { + type: DataTypes.STRING, + allowNull: true, + field: "nextplan", + } + }, { + tableName: "employee_communicate", + }); + dc.models.EmployeeCommunicate = EmployeeCommunicate; + return EmployeeCommunicate; +}; \ No newline at end of file diff --git a/web/client/index.ejs b/web/client/index.ejs index b5b01a5..33e77fe 100644 --- a/web/client/index.ejs +++ b/web/client/index.ejs @@ -9,7 +9,7 @@ - + diff --git a/web/client/index.html b/web/client/index.html index 5e2e4fc..3cb5af8 100644 --- a/web/client/index.html +++ b/web/client/index.html @@ -7,7 +7,7 @@ - + diff --git a/web/client/src/layout/components/header/contant.js b/web/client/src/layout/components/header/contant.js index fc9cba6..f798bab 100644 --- a/web/client/src/layout/components/header/contant.js +++ b/web/client/src/layout/components/header/contant.js @@ -79,14 +79,12 @@ const headerItems = [{ itemKey: "leaveManagement", text: "假勤管理", to: "/humanAffairs/employeeRelationship/leaveManagement/attendanceStatistics" - }, - // { - // fatherKey: "employeeRelationship", - // itemKey: "communication", - // text: "员工沟通", - // to: "/humanAffairs/employeeRelationship/communication/employeeCommunication" - // } -] + }, { + fatherKey: "employeeRelationship", + itemKey: "communication", + text: "员工沟通", + to: "/humanAffairs/employeeRelationship/communication/employeeCommunication" + }] }, { itemKey: "archivesCenter", text: "档案中心", diff --git a/web/client/src/sections/humanAffairs/containers/communication/detailModal.js b/web/client/src/sections/humanAffairs/containers/communication/detailModal.js new file mode 100644 index 0000000..c4e2010 --- /dev/null +++ b/web/client/src/sections/humanAffairs/containers/communication/detailModal.js @@ -0,0 +1,38 @@ +import React, { useEffect, useRef, useState } from 'react'; +import { connect } from "react-redux"; +import { Select, Modal, Form, Button, Toast } from "@douyinfe/semi-ui"; +const DetailModal = (props) => { + const { dispatch, actions, user, onCancel, dataToDetail, close } = props; + const { humanAffairs } = actions; + const [options, setOptions] = useState([]); + //初始化 + useEffect(() => { + + }, []); + + return ( + + 关闭 + + } + > + + + ) +} + +function mapStateToProps(state) { + const { auth, global } = state; + return { + user: auth.user, + actions: global.actions, + apiRoot: global.apiRoot + }; +} + +export default connect(mapStateToProps)(DetailModal); \ No newline at end of file diff --git a/web/client/src/sections/humanAffairs/containers/communication/employeeCommunication.jsx b/web/client/src/sections/humanAffairs/containers/communication/employeeCommunication.jsx index 6c94ea3..b4148f7 100644 --- a/web/client/src/sections/humanAffairs/containers/communication/employeeCommunication.jsx +++ b/web/client/src/sections/humanAffairs/containers/communication/employeeCommunication.jsx @@ -1,24 +1,22 @@ import React, { useEffect, useRef, useState, useMemo } from 'react'; import { connect } from 'react-redux'; import moment from 'moment' -import { Select, Input, Button, Popconfirm, Radio, Tooltip, Table, Pagination, Skeleton } from '@douyinfe/semi-ui'; -// import SalesMemberModal from './salesMemberModal' -// import ImportSalersModal from './importSalersModal' +import { Select, Input, Button, Tooltip, Table, Pagination, Skeleton, DatePicker } from '@douyinfe/semi-ui'; import { IconSearch } from '@douyinfe/semi-icons'; +import DetailModal from './detailModal'; import { SkeletonScreen } from "$components"; import '../../style.less' const EmployeeCommunication = (props) => { const { dispatch, actions } = props const { humanAffairs } = actions; - const [keywordTarget, setKeywordTarget] = useState('dep'); + const [keywordTarget, setKeywordTarget] = useState('person'); const [keyword, setKeyword] = useState('');//搜索内容 const [limits, setLimits] = useState()//每页实际条数 const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 - // const [modalV, setModalV] = useState(false); - // const [dataToEdit, setDataToEdit] = useState(null); - const [tableData, setTableData] = useState([]); - // const [importModalV, setImportModalV] = useState(false); + const [modalV, setModalV] = useState(false); + const [dataToDetail, setDataToDetail] = useState(null); + const [tableData, setTableData] = useState([{ id: 1, personalName: '危大伟', job: '软件前端开发工程师', departmentName: '软件开发部,软件开发部,软件开发部,软件开发部,软件开发部', communicateDate: '2022-12-29 14:21:33', communicateContent: '阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴', communicateResult: '啊啊啊啊啊啊啊啊啊啊是大大说所所所', valuation: '123当前时区无无群', communicateCondition: '驱蚊器翁群的法人', nextPlan: '呜呜呜呜呜呜呜呜呜呜呜我' }]); const page = useRef(query.page); function seachValueChange(value) { setKeyword(value) @@ -57,143 +55,147 @@ const EmployeeCommunication = (props) => { } } - // const closeAndFetch = () => { - // setModalV(false) - // getMemberSearchList(); - // } - - // const starHeader = (header) => { - // return
- // {header} - //
- // } - - // const getMultis = (arrStr) => {//默认展示2个 - // return
- // { - // arrStr.length ? - // arrStr.map((ite, idx) => { - // return ( - //
- // {idx < 2 ? - //
- // {ite} - //
: '' - // } - // { - // arrStr.length > 2 && idx == 2 ? - // - //
- // +{arrStr.length - 2} - //
- //
- // : '' - // } - //
- // ) - // }) : '-' - // } - //
- // } + const columns = [{ + title: '序号', + dataIndex: 'id', + key: 'id', + width: 60, + render: (text, record, index) => index + 1 + }, { + title: '被沟通人', + dataIndex: 'personalName', + key: 'personalName', + width: 100 + }, { + title: '岗位', + dataIndex: 'job', + key: 'job', + width: 100, + }, { + title: '部门', + dataIndex: 'departmentName', + key: 'departmentName', + width: 120, + render: (t, r) => { + return ( +
{r.departmentName}
+
) + } + }, { + title: '沟通时间', + dataIndex: 'communicateDate', + key: 'communicateDate', + width: 130, + }, { + title: '沟通内容', + dataIndex: 'communicateContent', + key: 'communicateContent', + width: 140, + render: (t, r) => { + return ( +
+ {t} +
+
) + } + }, { + title: '沟通成果', + dataIndex: 'communicateResult', + key: 'communicateResult', + width: 120, + render: (t, r) => { + return ( +
+ {t} +
+
) + } + }, { + title: '对被沟通人近期表现的评价', + dataIndex: 'valuation', + key: 'valuation', + width: 120, + render: (t, r) => { + return ( +
+ {t} +
+
) + } + }, { + title: '沟通情况反馈', + dataIndex: 'communicateCondition', + key: 'communicateCondition', + width: 120, + render: (t, r) => { + return ( +
+ {t} +
+
) + } + }, { + title: '下一步工作计划或提升方向', + dataIndex: 'nextPlan', + key: 'nextPlan', + width: 120, + render: (t, r) => { + return ( +
+ {t} +
+
) + } + }, { + title: '操作', + dataIndex: 'action', + width: 120, + render: (text, record) => { + return
+ onDetail(record)}>查看详情 +
+ } + }]; - // const columns = [{ - // title: '序号', - // dataIndex: 'id', - // key: 'id', - // width: 60, - // render: (text, record, index) => index + 1 - // }, { - // title: starHeader('姓名'), - // dataIndex: 'name', - // key: 'name', - // width: 80 - // }, - // { - // title: starHeader('部门名称'), - // dataIndex: 'department', - // key: 'department', - // width: 200, - // render: (text, r, index) => { - // let arrStr = text.map(t => t.name); - // return getMultis(arrStr); - // } - // }, { - // title: '销售区域(省/直辖市)', - // dataIndex: 'provinces', - // key: 'provinces', - // width: 160, - // render: (text, record, index) => { - // return getMultis(text?.split('、') || []); - // } - // }, { - // title: '销售区域(市)', - // dataIndex: 'cities', - // key: 'cities', - // width: 160, - // render: (text, record, index) => { - // return text ? getMultis(text?.split('、') || []) : '-'; - // } - // }, { - // title: '业务线', - // dataIndex: 'businessLines', - // key: 'businessLines', - // width: 140, - // render: (text, record, index) => { - // return text ? getMultis(text?.split('、') || []) : '-'; - // } - // }, { - // title: starHeader('岗位'), - // dataIndex: 'post', - // key: 'post', - // width: 120, - // render: (text, record) => {text || '-'} - // }, { - // title: starHeader('入职时间'), - // dataIndex: 'hireDate', - // key: 'hireDate', - // width: 120, - // render: (text, record) => {text || '-'} - // }, { - // title: starHeader('转正时间'), - // dataIndex: 'regularDate', - // key: 'regularDate', - // width: 120, - // render: (text, record) => {text || '-'} - // }, { - // title: starHeader('工龄'), - // dataIndex: 'workYears', - // key: 'workYears', - // width: 120, - // render: (_, r, index) => { - // return (r.hireDate ? {String(moment(new Date()).diff(r.hireDate, 'years', true)).substring(0, 3) + '年'} : '-') - // }, - // }, { - // title: '操作', - // dataIndex: 'action', - // width: 120, - // render: (text, record) => { - // return
- // onEdit(record)}>编辑   - // confirmDelete(record.pepUserId)} style={{ width: 330 }} - // > 删除 - //
- // } - // }]; + const onDetail = (data) => { + setModalV(true); + setDataToDetail(data); + } - // const onEdit = (data) => { - // setModalV(true); - // setDataToEdit(data); - // } + const closeAndFetch = () => { + setModalV(false) + } - // const confirmDelete = (pepUserId) => { - // dispatch(humanAffairs.delSalesMember({ pepUserId, msg: '删除销售人员信息' })).then(res => { - // if (res.success) { - // getMemberSearchList(); - // } - // }); - // } const scroll = useMemo(() => ({}), []); return (
@@ -211,20 +213,14 @@ const EmployeeCommunication = (props) => {
EMPLOYEE COMMUNICATION
- {/*
+
-
{ - setModalV(true); - setDataToEdit(null); - }}> - 新增 -
- + 被沟通人 + 岗位 + 部门
@@ -236,25 +232,23 @@ const EmployeeCommunication = (props) => { onChange={seachValueChange}>
+
+ 沟通时间: + +
-
+
导出
- -
- - 表格中带有认证标识" - - "信息的为系统基础数据,来源于项企PEP、钉钉等系统,其他数据均为导入或自定义数据 -
-
{ bordered={false} empty="暂无数据" pagination={false} - onChange={({ sorter }) => { - if (sorter.key == 'userCode') { - if (sorter.sortOrder == 'descend') { - setOrder({ orderBy: 'code', orderDirection: 'DESC' }) - } else { - setOrder({ orderBy: 'code', orderDirection: 'ASC' }) - } - } else if (sorter.key == 'age') { - if (sorter.sortOrder == 'descend') { - setOrder({ orderBy: 'age', orderDirection: 'DESC' }) - } else { - setOrder({ orderBy: 'age', orderDirection: 'ASC' }) - } - } else { - if (sorter.sortOrder == 'descend') { - setOrder({ orderBy: 'hiredate', orderDirection: 'DESC' }) - } else { - setOrder({ orderBy: 'hiredate', orderDirection: 'ASC' }) - } - } - }} onRow={handleRow} scroll={scroll} /> @@ -316,22 +289,15 @@ const EmployeeCommunication = (props) => {
-
*/} + - {/* { - modalV ? closeAndFetch()} onCancel={() => setModalV(false)} /> : '' } - { - importModalV ? { - setImportModalV(false); - getMemberSearchList(); - }} /> : '' - } */} - ) + ) } function mapStateToProps(state) { diff --git a/web/client/src/sections/humanAffairs/containers/index.js b/web/client/src/sections/humanAffairs/containers/index.js index 2c160d0..a9e9ae4 100644 --- a/web/client/src/sections/humanAffairs/containers/index.js +++ b/web/client/src/sections/humanAffairs/containers/index.js @@ -7,7 +7,7 @@ import DeptArchives from './deptArchives'; import AttendanceStatistics from './attendanceStatistics'; import LeaveStatistics from './leaveStatistics'; import OvertimeStatistics from './overtimeStatistics'; -// import EmployeeCommunication from './communication/employeeCommunication'; +import EmployeeCommunication from './communication/employeeCommunication'; //招聘 import AppointmentRecords from './appointmentRecords'; import PersonnelDistribution from './salersDistribution/personnelDistribution'; @@ -44,5 +44,5 @@ export { EmployeeAuth, FormMaintenance, PersonnelFilesDetail, PersonalTrainRecord, - // EmployeeCommunication + EmployeeCommunication }; \ No newline at end of file diff --git a/web/client/src/sections/humanAffairs/containers/personalTrainRecord.jsx b/web/client/src/sections/humanAffairs/containers/personalTrainRecord.jsx index d8a916e..6519c92 100644 --- a/web/client/src/sections/humanAffairs/containers/personalTrainRecord.jsx +++ b/web/client/src/sections/humanAffairs/containers/personalTrainRecord.jsx @@ -120,7 +120,7 @@ const PersonalTrainRecord = (props) => {
-
+
{ setImportModalV(true); }} diff --git a/web/client/src/sections/humanAffairs/nav-item.jsx b/web/client/src/sections/humanAffairs/nav-item.jsx index fc06084..931da09 100644 --- a/web/client/src/sections/humanAffairs/nav-item.jsx +++ b/web/client/src/sections/humanAffairs/nav-item.jsx @@ -38,17 +38,15 @@ export function getNavItem(user, dispatch) { }, { itemKey: 'overtimeStatistics', to: '/humanAffairs/employeeRelationship/leaveManagement/overtimeStatistics', text: '加班统计' }] - }, - // { - // itemKey: 'communication', - // text: '员工沟通', - // icon: , - // to: '/humanAffairs/employeeRelationship/communication/employeeCommunication', - // items: [{ - // itemKey: 'employeeCommunication', to: '/humanAffairs/employeeRelationship/communication/employeeCommunication', text: '员工沟通统计' - // }] - // }, - { + }, { + itemKey: 'communication', + text: '员工沟通', + icon: , + to: '/humanAffairs/employeeRelationship/communication/employeeCommunication', + items: [{ + itemKey: 'employeeCommunication', to: '/humanAffairs/employeeRelationship/communication/employeeCommunication', text: '员工沟通统计' + }] + }, { itemKey: 'recruitRecord', text: '招聘记录', icon: , diff --git a/web/client/src/sections/humanAffairs/routes.js b/web/client/src/sections/humanAffairs/routes.js index a91bfcc..8887c81 100644 --- a/web/client/src/sections/humanAffairs/routes.js +++ b/web/client/src/sections/humanAffairs/routes.js @@ -11,7 +11,7 @@ import { PersonnelFilesDetail, PersonalTrainRecord, DepartmentTrainRecord, - // EmployeeCommunication + EmployeeCommunication } from './containers'; export default [{ @@ -77,19 +77,17 @@ export default [{ component: OvertimeStatistics, breadcrumb: '加班统计', }] - }, - // { - // path: '/communication', - // key: 'communication', - // breadcrumb: '员工沟通', - // childRoutes: [{ - // path: '/employeeCommunication', - // key: 'employeeCommunication', - // component: EmployeeCommunication, - // breadcrumb: '员工沟通统计', - // }] - // } - ] + }, { + path: '/communication', + key: 'communication', + breadcrumb: '员工沟通', + childRoutes: [{ + path: '/employeeCommunication', + key: 'employeeCommunication', + component: EmployeeCommunication, + breadcrumb: '员工沟通统计', + }] + }] }, { path: '/recruit', key: 'recruit',