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(