import React from "react"; import $ from "jquery/src/ajax"; import moment from "moment"; import "@/manageCenter/financialManage/distribute/public.less"; import { ChooseList } from "../../order/orderNew/chooseList"; import { citySelect, provinceList, areaSelect, Birthplace } from "@/areaList"; import "./personnelList.less" import { Button, Form, Input, Select, Spin, Table, message, Modal, Tabs, Tag, RangePicker, DatePicker, Radio, Cascader, Upload, Tooltip, } from "antd"; import { splitUrl } from "@/tools"; import { getProvinceList } from "@/addressList"; import PicModal from "./picModal" const FormItem = Form.Item; const { TabPane } = Tabs; const { TextArea } = Input; const PersonnelAll = React.createClass({ loadData(pageNo) { this.state.data = []; this.setState({ loading: true, }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/personnel/selectList", data: { pageNo: pageNo || 1, pageSize: this.state.pagination.pageSize, name: this.state.nameSearch, status: this.state.nameSearch, company: this.state.nameSearch, sex: this.state.nameSearch, marriage: this.state.nameSearch, politicalOutlook: this.state.nameSearch, birthdayMonth: this.state.nameSearch, promotionStart: this.state.promotionTime[0], promotionEnd: this.state.promotionTime[1], entryStart: this.state.entryTime[0], entryStart: this.state.entryTime[1], quitStart: this.state.quitTime[0], quitEnd: this.state.quitTime[1], system: this.state.systemSearch, workingYears: this.state.workingYearsSearch, education: this.state.educationSearch, contractStart: this.state.contractTime[0], contractEnd: this.state.contractTime[1], }, success: function (data) { let theArr = []; if (!data.data || !data.data.list) { if (data.error && data.error.length) { message.warning(data.error[0].message); } } else { for (let i = 0; i < data.data.list.length; i++) { let thisdata = data.data.list[i]; thisdata.key = thisdata.id theArr.push(thisdata) } } this.state.pagination.current = data.data.pageNo; this.state.pagination.total = data.data.totalCount; if (data.data && data.data.list && !data.data.list.length) { this.state.pagination.current = 0; this.state.pagination.total = 0; } this.setState({ dataSource: theArr, pagination: this.state.pagination, }); }.bind(this), }).always( function () { this.setState({ loading: false, }); }.bind(this) ); }, getInitialState() { return { ModalData: [], contractTime: [], quitTime: [], promotionTime: [], entryTime: [], pic: [], previewImage: "", peoVisible: false, phoneVisible: false, isAddPeo: false, searchMore: true, stayVisible: false, assignVisible: false, releaseDate: [], residence: [], nativePlace: [], now: [], roleName: "", shouKuanDate: [], boHuivisible: false, departmentArr: [], selectedRowKeys: [], selectedRows: [], paginations: false, loading: false, pagination: { defaultCurrent: 1, defaultPageSize: 10, showQuickJumper: true, pageSize: 10, onChange: function (page) { this.loadData(page); }.bind(this), showTotal: function (total) { return "共" + total + "条数据"; }, }, columns: [ { title: "人事编号", dataIndex: "id", key: "id", }, { title: "门禁编号", dataIndex: "doorId", key: "doorId", }, { title: "名称", dataIndex: "name", key: "name", }, { title: "员工状态", dataIndex: "status", key: "status", render: (text) => { if (text == 0) { return "在职(试用期)"; } else if (text == 1) { return "在职(正式工)"; } else if (text == 2) { return "离职"; } }, }, { title: "所属系统", dataIndex: "system", key: "system", render: (text) => { if (text == 0) { return "管理系统"; } else if (text == 1) { return "营销系统"; } else if (text == 2) { return "技术系统"; } }, }, { title: "公司名称", dataIndex: "depName", key: "depName", }, { title: "职位名称", dataIndex: "jobsName", key: "jobsName", }, { title: "等级名称", dataIndex: "starName", key: "starName", }, { title: "入职时间", dataIndex: "entryTimes", key: "entryTimes", }, { title: "转正时间", dataIndex: "promotionTimes", key: "promotionTimes", }, { title: "生日日期", dataIndex: "birthdays", key: "birthdays", }, { title: "性别", dataIndex: "sex", key: "sex", render: (text) => { if (text == 0) { return "男"; } else if (text == 1) { return "女"; } }, }, { title: "子/女", dataIndex: "son", key: "son", render: (text, record) => { return {text + "/" + record.girl}; }, }, { title: "政治面貌", dataIndex: "politicalOutlook", key: "politicalOutlook", render: (text) => { if (text == 0) { return "群众"; } else if (text == 1) { return "中共预备党员"; } else if (text == 2) { return "中共党员"; } else if (text == 3) { return "致公党员"; } }, }, { title: "教育经历", dataIndex: "education", key: "education", render: (text) => { if (text == 0) { return "高中/中专"; } else if (text == 1) { return "专科/高职"; } else if (text == 2) { return "本科"; } else if (text == 3) { return "研究生"; } else if (text == 5) { return "博士"; } }, }, { title: "毕业学校", dataIndex: "school", key: "school", }, { title: "专业", dataIndex: "major", key: "major", }, { title: "职称", dataIndex: "title", key: "title", }, { title: "晋升备注", dataIndex: "promotionRemarks", key: "promotionRemarks", }, { title: "晋升时间", dataIndex: "promotionTime", key: "promotionTime", }, { title: "合同时间", dataIndex: "contractStart", key: "contractStart", render: (text, record) => { if (text) { return text + "~" + record.contractEnd; } }, }, { title: "手机号码", dataIndex: "mobile", key: "mobile", }, { title: "电话", dataIndex: "fixedTel", key: "fixedTel", }, { title: "身份证", dataIndex: "idCard", key: "idCard", }, { title: "发证机构", dataIndex: "certificationAuthority", key: "certificationAuthority", }, { title: "户籍地址", dataIndex: "residenceName", key: "residenceName", }, { title: "籍贯", dataIndex: "nativePlaceName", key: "nativePlaceName", }, { title: "现住地址", dataIndex: "nowName", key: "nowName", }, { title: "离职时间", dataIndex: "quitTime", key: "quitTime", }, { title: "工作年限", dataIndex: "workingYear", key: "workingYear", }, { title: "年龄", dataIndex: "age", key: "age", }, { title: "出生月份", dataIndex: "month", key: "month", }, ], dataSource: [], resVisible: false, table: [ { key: "员工编号", value: "id", }, { key: "姓名", value: "name", }, { key: "出生日期", value: "birthdays", }, { key: "出生月份", value: "month", }, { key: "门禁编号", value: "doorId", }, { key: "性别", value: "sex", render: (e) => { if (e == 0) { return "男"; } else if (e == 1) { return "女"; } }, }, { key: "年龄", value: "age", }, { key: "民族", value: "nation", }, { key: "户籍地址", value: "residenceName", }, { key: "籍贯", value: "nativePlaceName", }, { key: "身份证", value: "idCard", }, { key: "领证机关", value: "certificationAuthority", }, { key: "现住地址", value: "nowName", }, { key: "婚姻状态", value: "marriageName", }, { key: "子/女", value: "son", render: (e, i) => { return e + "/" + i } }, { key: "政治面貌", value: "politicalOutlookName", }, ], }; }, /* 分派 */ evaluate(record, nub) { this.state.assignData = record; this.setState( { nub, }, () => { this.setState({ assignVisible: true, }); } ); }, componentWillMount() { let areaArr = getProvinceList(); let Area = areaSelect(areaArr); let Birthplaces = Birthplace(areaArr); this.setState({ Area, Birthplaces: Birthplaces, }); //城市 let Province = []; areaArr.map(function (item) { var id = String(item.id); Province.push( {item.name} ); }); this.state.Provinces = Province; this.loadData(); this.departmentList() }, departmentList() { $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/organization/selectSuperId", data: {}, success: function (data) { let thedata = data.data; let theArr = []; if (!thedata) { if (data.error && data.error.length) { message.warning(data.error[0].message); } } else { thedata.map(function (item, index) { theArr.push({ key: index, name: item.name, id: item.id }); }); } this.setState({ departmentArr: theArr }); }.bind(this) }); }, changeList(arr) { const newArr = []; this.state.columns.forEach((item) => { arr.forEach((val) => { if (val === item.title) { newArr.push(item); } }); }); this.setState({ changeList: newArr, }); }, addPeo() { this.setState({ peoVisible: true, isAddPeo: true }) }, addPeoCancel() { this.setState({ peoVisible: false, isAddPeo: false, name: undefined, doorId: undefined, sex: undefined, nation: undefined, residence: [], residenceAddress: undefined, nativePlace: [], now: [], nowAddress: undefined, idCard: undefined, certificationAuthority: undefined, marriage: undefined, politicalOutlook: undefined, son: undefined, girl: undefined, birthdays: undefined, marriage: undefined, }); }, addOk() { this.setState({ loading: true, }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/personnel/add", data: { name: this.state.name, doorId: this.state.doorId, sex: this.state.sex, nation: this.state.nation, residenceProvince: this.state.residence[0], residenceCity: this.state.residence[1], residenceArea: this.state.residence[2], residenceAddress: this.state.residenceAddress, nativePlaceProvince: this.state.nativePlace[0], nativePlaceCity: this.state.nativePlace[1], nowProvince: this.state.now[0], nowCity: this.state.now[1], nowArea: this.state.now[2], nowAddress: this.state.nowAddress, idCard: this.state.idCard, certificationAuthority: this.state.certificationAuthority, marriage: this.state.marriage, politicalOutlook: this.state.politicalOutlook, son: this.state.son, girl: this.state.girl, birthdays: this.state.birthdays, marriage: this.state.marriage, }, success: function (data) { let theArr = []; if (data.error && data.error.length) { message.warning(data.error[0].message); } else { message.success("添加成功!"); this.loadData(); this.addPeoCancel(); } }.bind(this), }).always( function () { this.setState({ loading: false, }); }.bind(this) ); }, editPeo() { }, stayModal() { this.setState({ stayVisible: true }) }, stayCancel() { this.setState({ stayVisible: false }) }, editStay() { }, phoneModal() { this.setState({ phoneVisible: true }); }, phoneCancel() { this.setState({ phoneVisible: false }); }, editPhone() { }, entryModal() { this.setState({ entryVisible: true }); }, entryCancel() { this.setState({ entryVisible: false }) }, cancel() { this.setState({ visible: false }) }, tableRowClick(record) { this.setState({ visible: true, }) this.setState({ loading: true, }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/personnel/selectBypdId", data: { id: record.id }, success: function (data) { let theArr = []; if (data.error && data.error.length) { message.warning(data.error[0].message); } else { this.setState({ ModalData: data.data }) } }.bind(this), }).always( function () { this.setState({ loading: false, }); }.bind(this) ); }, search() { this.loadData() }, reset() { this.state.nameSearch = undefined this.state.statusSearch = undefined; this.state.departmenttList = undefined; this.state.sexSearch = undefined; this.state.marriageSearch = undefined; this.state.politicalOutlookSearch = undefined; this.state.birthdayMonthSearch = undefined; this.state.systemSearch = undefined; this.state.workingYearsSearch = undefined; this.state.educationSearch = undefined; this.state.promotionTime = []; this.state.entryTime = []; this.state.quitTime = []; this.state.contractTime = []; this.loadData() }, peoStatus(e) { if(e == 0) { return "在职(试用期)" }else if(e == 1) { return "在职(正式工)" }else if(e == 2) { return "离职" } }, jobStatus(e, i) { if(e == 0) { return "全职" }else if(e == 1) { return "兼职" }else if(e == 2) { return i } }, educationStatus(e) { if(e == 0) { return "高中/中专" }else if(e == 1) { return "专科/高职" }else if(e == 2) { return "本科" }else if(e == 3) { return "研究生" }else if(e == 5) { return "博士" } }, picToArr(e) { let arr = e.split(",") console.log(arr); return arr }, render() { const rowSelection = { selectedRowKeys: this.state.selectedRowKeys, onChange: (selectedRowKeys, selectedRows) => { this.setState({ selectedRows: selectedRows.slice(-1), selectedRowKeys: selectedRowKeys.slice(-1), }); }, }; const { RangePicker } = DatePicker; const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 16 }, }; let departmentArr = this.state.departmentArr || []; return (
人事档案统计
{ this.setState({ nameSearch: e.target.value }); }} /> 转正日期: { this.setState({ promotionTime: dataString }); }} /> 入职时间: { this.setState({ entryTime: dataString }); }} /> 离职时间: { this.setState({ quitTime: dataString }); }} /> 合同时间: { this.setState({ contractTime: dataString }); }} />
{ this.loadData(); this.addPeoCancel(); }} >

{this.state.isAddPeo ? "新增人事档案" : "修改人事档案"}

{ this.setState({ contractNoSearch: e.target.value, }); }} /> { this.setState({ doorId: e.target.value, }); }} />
{ this.setState({ name: e.target.value, }); }} /> { this.setState({ birthdays: t, }); }} />
{ this.setState({ sex: e.target.value }); }} value={this.state.sex} > { this.setState({ nation: e.target.value, }); }} />
{ this.setState({ residence: e }); console.log(e, pre); }} /> {/* * */} { this.setState({ residenceAddress: e.target.value, }); }} />
{ this.setState({ now: e }); console.log(e, pre); }} /> {/* * */} { this.setState({ nowAddress: e.target.value, }); }} />
{ this.setState({ nativePlace: e }); console.log(e, pre); }} /> {/* * */} { // let reg = /^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/; this.setState({ idCard: e.target.value, }); }} />
{ // let reg = /^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/; this.setState({ certificationAuthority: e.target.value, }); }} /> {/* * */} { this.setState({ marriage: e.target.value }); }} value={this.state.marriage} > 未婚 已婚 离异
儿子: { this.setState({ son: e.target.value, }); }} /> 女儿: { this.setState({ girl: e.target.value, }); }} />
{ this.loadData(); this.stayCancel(); }} >

修改任职信息

{ this.setState({ jobNature: e.target.value }); }} value={this.state.jobNature} > 全职 兼职 其他 { this.setState({ jobNatureRemarks: e.target.value, }); }} /> 2
{ this.setState({ entryTimes: t, }); }} /> { this.setState({ promotionTimes: t, }); }} />
{ this.setState({ allowance: e.target.value, }); }} />
{ this.loadData(); this.phoneCancel(); }} >

修改联系信息

{ this.setState({ phone: e.target.value, }); }} /> { this.setState({ bgs: e.target.value, }); }} />
{ this.setState({ lianxiren: e.target.value, }); }} /> { this.setState({ jjphone: e.target.value, }); }} />
{ this.setState({ lianxiren: e.target.value, }); }} /> { this.setState({ jjphone: e.target.value, }); }} />
{ this.setState({ lianxiren: e.target.value, }); }} /> { this.setState({ jjphone: e.target.value, }); }} />
{ this.loadData(); this.entryCancel(); }} >

修改入职信息

{ this.setState({ school: e.target.value, }); }} />
{ this.setState({ zhuanye: e.target.value, }); }} /> { this.setState({ zhicheng: e.target.value, }); }} />
{ this.setState({ beizhu: e.target.value, }); }} />
{ this.setState({ previewImage: file.url || file.thumbUrl, previewVisible: true, }); }} />
{ this.loadData(); this.cancel(); }} >

{this.state.ModalData.name + "人事档案"}

    {this.state.table.map((item) => { let value = item.value; if (item.render) { let fn = item.render; return (
  • {item.key}
    {fn( this.state.ModalData[value], value == "son" ? this.state.ModalData.girl : 0 )}
  • ); } return (
  • {item.key}
    {this.state.ModalData[value] && this.state.ModalData[value].length > 10 ? this.state.ModalData[value].substring(0, 10) + "..." : this.state.ModalData[value]}
  • ); })}
任职信息
{this.state.ModalData.statusName} {this.state.ModalData.systemName}
{this.jobStatus( this.state.ModalData.jobNature, this.state.ModalData.jobNatureRemarks )} {this.state.ModalData.workingYear}
{this.state.ModalData.entryTimes} {this.state.ModalData.promotionTimes}
{this.state.ModalData.entryTimes} {this.state.ModalData.lvlName}
{this.state.ModalData.jobsName} {this.state.ModalData.allowance}
{this.state.ModalData.starName}
联系信息
{this.state.ModalData.mobile} {this.state.ModalData.fixedTel}
{this.state.ModalData.contactList && this.state.ModalData.contactList.length > 0 ? ( this.state.ModalData.contactList.map((item, index) => { return (
{item.emergencyContact} {item.emergencyMobile}
); }) ) : (
暂无紧急联系人信息
)}
入职资料
{this.state.ModalData.personnelEntry ? this.state.ModalData.personnelEntry.school : ""} {this.state.ModalData.personnelEntry ? this.educationStatus( this.state.ModalData.personnelEntry.education ) : ""}
{this.state.ModalData.personnelEntry ? this.state.ModalData.personnelEntry.major : ""} {this.state.ModalData.personnelEntry ? this.state.ModalData.personnelEntry.title : ""}
附件:
晋升情况
{this.state.ModalData.promotionList && this.state.ModalData.promotionList.length > 0 ? ( this.state.ModalData.promotionList.map((item, index) => { return (
{item.oldJobsName + "--->" + item.newJobsName} {item.oldLvlName + "--->" + item.newLvlName}
{item.promotionTimes} {item.promotionRemarks}
附件:
); }) ) : (
暂无晋升情况
)}
合同情况
{this.state.ModalData.contractList && this.state.ModalData.contractList.length > 0 ? ( this.state.ModalData.contractList.map((item, index) => { return (
{item.startTimes} {item.endTimes}
{item.contractRemarks}
附件:
); }) ) : (
暂无合同情况
)}
奖惩情况
{this.state.ModalData.chooseList && this.state.ModalData.chooseList.length > 0 ? ( this.state.ModalData.chooseList.map((item, index) => { return (
{item.chooseRemarks} {item.effectTimes}
附件:
); }) ) : (
暂无奖惩情况
)}
离职情况
{this.state.ModalData.quitList && this.state.ModalData.quitList.length > 0 ? ( this.state.ModalData.quitList.map((item, index) => { return (
{item.effectTimes} {item.quitRemarks}
附件:
); }) ) : (
暂无奖惩情况
)}
); }, }); export default PersonnelAll;