import React from "react";
import $ from "jquery/src/ajax";
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,
} from "antd";
import {} from "@/tools";
import { getProvinceList } from "@/addressList";
const FormItem = Form.Item;
const { TabPane } = Tabs;
const { TextArea } = Input;
const PersonnelAll = React.createClass({
loadData(pageNo) {
this.state.data = [];
this.setState({
page: pageNo,
loading: true,
});
$.ajax({
method: "get",
dataType: "json",
crossDomain: false,
url: globalConfig.context + "/api/admin/orderProject/orderTaskList",
data: {
pageNo: pageNo || 1,
pageSize: this.state.pagination.pageSize,
specially: 1, //经理
name: this.state.nameSearch, //客户名称
orderNo: this.state.orderNoSearch, //订单编号
taskId: this.state.taskNoSearch, //任务编号
depId: this.state.departmenttSearch, //订单部门
taskStatus: this.state.taskStatus, //任务状态
adminName: this.state.adminName, //任务受理人
outsource: 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];
if (thisdata.splitList) {
thisdata.splitList.forEach((item) => {
item.key = item.id;
});
}
theArr.push({
key: thisdata.id,
orderNo: thisdata.orderNo, //订单编号
id: thisdata.id, //任务ID
taskName: thisdata.taskName, //名称
cname: thisdata.cname, //项目品类
receiverName: thisdata.receiverName, //受理人
projectStatus: thisdata.projectStatus, //项目状态
taskStatus: thisdata.taskStatus, //任务状态
taskDate: thisdata.taskDate, //分配时间
commodityQuantity: thisdata.commodityQuantity, //数量
userName: thisdata.userName, //用户名
depName: thisdata.depName, //部门名称
splitStatus: thisdata.splitStatus, //拆分状态
splitList: thisdata.splitList,
});
}
}
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 {
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: "name",
key: "name",
},
],
dataSource: [],
resVisible: false,
};
},
/* 分派 */
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() {
},
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({ orderNoSearch: e.target.value });
}}
/>
{
this.setState({ nameSearch: e.target.value });
}}
/>
{
this.setState({
contractNoSearch: e.target.value,
});
}}
/>
下单日期:
{
this.setState({ releaseDate: dataString });
}}
/>
最近收款:
{
this.setState({ shouKuanDate: 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({ native: 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({
xingzhi: e.target.value,
});
}}
/>
2
{
this.setState({
ruzhi: t,
});
}}
/>
{
this.setState({
zhuanzheng: t,
});
}}
/>
{
this.setState({
jintie: 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,
});
}}
/>
);
},
});
export default PersonnelAll;