Browse Source

人事档案

HW 4 years ago
parent
commit
62b0e4f20f

+ 32 - 32
config/proxy.ts

@@ -6,44 +6,44 @@
  * https://pro.ant.design/docs/deploy
  */
 export default {
-  // dev: {
-  //   '/api/': {
-  //     target: 'http://uat.jishutao.com',
-  //     changeOrigin: true,                //target为域名时设为true
-  //   },
-  //   '/managesignin':{
-  //     target: 'http://uat.jishutao.com',
-  //     changeOrigin: true,                //target为域名时设为true
-  //   },
-  //   '/login':{
-  //     target: 'http://uat.jishutao.com',
-  //     changeOrigin: true,                //target为域名时设为true
-  //   }
-  // },
   dev: {
     '/api/': {
-      target: 'http://172.16.0.188:8080',
-      changeOrigin: false,                //target为域名时设为true
+      target: 'http://uat.jishutao.com',
+      changeOrigin: true,                //target为域名时设为true
     },
     '/managesignin':{
-      target: 'http://172.16.0.188:8080',
-      changeOrigin: false,                //target为域名时设为true
-    },
-    '/login':{
-      target: 'http://172.16.0.188:8080',
-      changeOrigin: false,                //target为域名时设为true
-    }
-  },
-  test: {
-    '/api/': {
       target: 'http://uat.jishutao.com',
-      changeOrigin: true,               //target为域名时设为true
+      changeOrigin: true,                //target为域名时设为true
     },
-  },
-  pre: {
-    '/api/': {
+    '/login':{
       target: 'http://uat.jishutao.com',
-      changeOrigin: true,
-    },
+      changeOrigin: true,                //target为域名时设为true
+    }
   },
+  // dev: {
+  //   '/api/': {
+  //     target: 'http://172.16.0.188:8080',
+  //     changeOrigin: false,                //target为域名时设为true
+  //   },
+  //   '/managesignin':{
+  //     target: 'http://172.16.0.188:8080',
+  //     changeOrigin: false,                //target为域名时设为true
+  //   },
+  //   '/login':{
+  //     target: 'http://172.16.0.188:8080',
+  //     changeOrigin: false,                //target为域名时设为true
+  //   }
+  // },
+  // test: {
+  //   '/api/': {
+  //     target: 'http://uat.jishutao.com',
+  //     changeOrigin: true,               //target为域名时设为true
+  //   },
+  // },
+  // pre: {
+  //   '/api/': {
+  //     target: 'http://uat.jishutao.com',
+  //     changeOrigin: true,
+  //   },
+  // },
 };

+ 1 - 1
config/routes.ts

@@ -44,7 +44,7 @@
   {
     path: '/statistics',
     component: './personnel/archives/statistics',
-    access: 'statistics',
+    // access: 'statistics',
   },
   {
     path: '/welcome',

+ 314 - 0
src/pages/personnel/archives/statistics/components/dataClassify/inauguration.jsx

@@ -0,0 +1,314 @@
+import React,{Component} from "react";
+import ProForm, {
+  ProFormSwitch,
+  ProFormText,
+  ProFormRadio,
+  ProFormCheckbox,
+  ProFormRate,
+  ProFormDatePicker,
+  ProFormSelect,
+  ProFormDigit,
+  ProFormDateTimePicker,
+  ProFormSlider,
+  ProFormDateTimeRangePicker,
+  ProFormDateRangePicker,
+  ProFormUploadButton,
+  ProFormUploadDragger,
+  ProFormFieldSet,
+} from '@ant-design/pro-form';
+import moment from "moment";
+import {getSelectSuperId} from "@/services/user";
+import {message} from "antd";
+import {selectLvlList} from '../../services/API';
+
+class Inauguration extends Component{
+  constructor(props) {
+    super(props);
+    this.state={
+    }
+  }
+
+  componentDidMount() {
+    this.formRef.current.setFieldsValue({
+      status: this.props.userInfor.status,
+      jobNature: this.props.userInfor.jobNature,
+      system: this.props.userInfor.system,
+      workingYear: this.props.userInfor.workingYear,
+      entryTime: this.props.userInfor.entryTime ? moment(this.props.userInfor.entryTime).format('YYYY-MM-DD') : undefined,
+      promotionTimes: this.props.userInfor.promotionTimes ? moment(this.props.userInfor.promotionTimes).format('YYYY-MM-DD') : undefined,
+      lvl: this.props.userInfor.lvl,
+      jobs: this.props.userInfor.jobs,
+      allowance: this.props.userInfor.allowance,
+      starName: this.props.userInfor.starName,
+    })
+  }
+
+  // 部门
+  departmentList = async() => {
+    const msg = await getSelectSuperId();
+    if(msg.error.length === 0){
+      let theArr = [];
+      msg.data.forEach((item) => {
+        theArr.push({
+          label: item.name,
+          value: item.id
+        });
+      });
+      return theArr;
+    }else{
+      message.warning(msg.error[0].message)
+    }
+    return [];
+  }
+
+  getSelectLvlList = async() => {
+    const msg = await selectLvlList();
+    if(msg.error.length === 0){
+      let theArr = [];
+      //request
+      console.log(this.formRef.current.getFieldsValue(['jobs']))
+      msg.data.filter(v=>v.jobs === this.formRef.current.getFieldsValue(['jobs']).jobs).forEach((item) => {
+        theArr.push({
+          label: item.lvlName,
+          value: item.lvl
+        });
+      });
+      return theArr;
+    }else{
+      message.warning(msg.error[0].message)
+    }
+    return [];
+  }
+
+  formRef = React.createRef();
+
+  render() {
+    return (
+      <>
+        <div
+          style={{
+            fontSize: '20px',
+            backgroundColor: 'skyblue',
+            textAlign: "center",
+            marginBottom: 10,
+            letterSpacing: '7px',
+            fontWeight: 'bold',
+            lineHeight:'20px',
+            paddingBottom: '14px',
+            paddingTop: '10px',
+          }}
+        >
+          任职信息
+        </div>
+        <ProForm
+          formRef={this.formRef}
+          onFinish={this.addEmployees}
+        >
+          <ProForm.Group>
+            <ProFormSelect
+              readonly={this.props.readonly}
+              width="s"
+              name="status"
+              label="员工状态"
+              placeholder="请选择员工状态"
+              options={[
+                {
+                  value: 0,
+                  label: '实习生',
+                },
+                {
+                  value: 1,
+                  label: '在职(试用期)',
+                },
+                {
+                  value: 2,
+                  label: '在职(合同期)',
+                },
+                {
+                  value: 3,
+                  label: '兼职',
+                },
+                {
+                  value: 4,
+                  label: '已离职',
+                },
+              ]}
+            />
+            <ProFormSelect
+              readonly={this.props.readonly}
+              width="s"
+              name="system"
+              label="所属系统"
+              placeholder="请选择所属系统"
+              options={[
+                {
+                  value: 0,
+                  label: '管理系统',
+                },
+                {
+                  value: 1,
+                  label: '营销系统',
+                },
+                {
+                  value: 2,
+                  label: '技术系统',
+                },
+              ]}
+            />
+            <ProFormSelect
+              readonly={this.props.readonly}
+              width="s"
+              name="jobNature"
+              label="工作性质"
+              placeholder="请选择工作性质"
+              options={[
+                {
+                  value: '0',
+                  label: '全职',
+                },
+                {
+                  value: '1',
+                  label: '兼职',
+                },
+                {
+                  value: '2',
+                  label: '其他',
+                },
+              ]}
+            />
+            <ProFormDatePicker
+              width="s"
+              label="入职时间"
+              name="entryTime"
+              placeholder="请选择入职时间"
+            />
+            <ProFormDatePicker
+              width="s"
+              label="转正时间"
+              name="promotionTimes"
+              placeholder="请选择转正时间"
+            />
+          </ProForm.Group>
+          <ProForm.Group>
+            <ProFormSelect
+              width="s"
+              label='所属公司'
+              name='depName'
+              placeholder="请选择所属公司"
+              request={this.departmentList}/>
+            <ProFormSelect
+              readonly={this.props.readonly}
+              width="s"
+              name="lvl"
+              label="级别"
+              placeholder="请选择级别"
+              options={[
+                {
+                  value: 0,
+                  label: '员工',
+                },
+                {
+                  value: 1,
+                  label: '主管',
+                },
+                {
+                  value: 2,
+                  label: '经理',
+                },
+                {
+                  value: 3,
+                  label: '总经理',
+                },
+                {
+                  value: 4,
+                  label: '副总裁',
+                },
+                {
+                  value: 5,
+                  label: '副总',
+                },
+                {
+                  value: 6,
+                  label: '总监',
+                },
+                {
+                  value: 7,
+                  label: '董事长',
+                },
+              ]}
+            />
+            <ProFormSelect
+              readonly={this.props.readonly}
+              width="s"
+              name="jobs"
+              label="职位"
+              placeholder="请选择职位"
+              options={[
+                {
+                  value: 1,
+                  label: '员工',
+                },
+                {
+                  value: 2,
+                  label: '试用营销员',
+                },
+                {
+                  value: 3,
+                  label: '试用营销储备经理',
+                },
+                {
+                  value: 4,
+                  label: '营销经理',
+                },
+                {
+                  value: 5,
+                  label: '总监合伙人',
+                },
+                {
+                  value: 6,
+                  label: '技术助理',
+                },
+                {
+                  value: 7,
+                  label: '咨询师',
+                },
+                {
+                  value: 8,
+                  label: '咨询师主管',
+                },
+                {
+                  value: 9,
+                  label: '咨询师经理',
+                },
+                {
+                  value: 10,
+                  label: '高级经理',
+                },
+              ]}
+            />
+            {this.formRef.current&&this.formRef.current.getFieldsValue(['jobs']).jobs ? <ProFormSelect
+              width="s"
+              label='星级'
+              name='starName'
+              placeholder="请选择星级"
+              request={this.getSelectLvlList}/> : null}
+            <ProFormDigit
+              readonly={this.props.readonly}
+              width="xs"
+              placeholder="请输入岗位津贴"
+              name="allowance"
+              label="岗位津贴"/>
+            <ProFormDigit
+              readonly
+              width="xs"
+              placeholder="请输入工龄"
+              name="workingYear"
+              label="工龄"/>
+          </ProForm.Group>
+        </ProForm>
+      </>
+    )
+  }
+}
+
+export default Inauguration;

+ 66 - 0
src/pages/personnel/archives/statistics/components/dataClassify/index.jsx

@@ -0,0 +1,66 @@
+import React,{Component} from "react";
+import { Tabs } from 'antd';
+import Inauguration from './inauguration';
+
+const { TabPane } = Tabs;
+
+class DataClassify extends Component{
+  constructor(props) {
+    super(props);
+    this.state={
+      activeKey: "1"
+    }
+    this.callback = this.callback.bind(this);
+  }
+
+  callback=(key)=>{
+    this.setState({
+      activeKey: key
+    })
+  }
+
+  componentDidMount() {
+    console.log(this.props.userInfor)
+  }
+
+  render() {
+    return (
+      <>
+        {
+          this.props.readonly ?
+            <div>
+              <Inauguration {...this.props}/>
+            </div>:
+            <Tabs defaultActiveKey="1" activeKey={this.state.activeKey} onChange={this.callback} tabBarGutter={85}>
+              <TabPane tab="任职信息" key="1">
+                <Inauguration {...this.props}/>
+              </TabPane>
+              <TabPane tab="联系信息" key="2">
+                Content of Tab Pane 2
+              </TabPane>
+              <TabPane tab="入职资料" key="3">
+                Content of Tab Pane 3
+              </TabPane>
+              <TabPane tab="晋升情况" key="4">
+                Content of Tab Pane 3
+              </TabPane>
+              <TabPane tab="合同情况" key="5">
+                Content of Tab Pane 3
+              </TabPane>
+              <TabPane tab="奖惩情况" key="6">
+                Content of Tab Pane 3
+              </TabPane>
+              <TabPane tab="离职情况" key="7">
+                Content of Tab Pane 3
+              </TabPane>
+              <TabPane tab="福利情况" key="8">
+                Content of Tab Pane 3
+              </TabPane>
+            </Tabs>
+        }
+      </>
+    )
+  }
+}
+
+export default DataClassify;

+ 142 - 13
src/pages/personnel/archives/statistics/components/newEmployees.jsx

@@ -6,10 +6,11 @@ import ProForm, {
   ProFormRadio,
   ProFormDigit, ProFormSelect
 } from "@ant-design/pro-form";
-import {Cascader, Form, message} from "antd";
+import {Input, Cascader, Form, message} from "antd";
 import {getAddressSelect,getNativePlace} from "@/utils/tools";
-import {addEmployees} from '../services/API';
-import {addressList,addressList1} from "@/utils/dataDic";
+import {addEmployees,checkEmployeeId,checkDoorId,updateEmployees} from '../services/API';
+
+const { Search } = Input;
 
 class NewEmployees extends Component{
   constructor(props) {
@@ -17,7 +18,12 @@ class NewEmployees extends Component{
     this.state={
       addressSelect:[],
       nativePlaceSelect:[],
+      verifyIdLoading: false,
+      doorIdLoading: false
     }
+    this.verifyId = this.verifyId.bind(this);
+    this.verifyDoor = this.verifyDoor.bind(this);
+    this.updateEmployees = this.updateEmployees.bind(this);
   }
 
   addEmployees= async (value)=>{
@@ -52,6 +58,45 @@ class NewEmployees extends Component{
     }
   }
 
+  updateEmployees=async (value)=>{
+    message.loading({content:'修改中...',key:'updateEmployees'});
+    // 户籍地址
+    value.residenceProvince = value.address ? value.address[0] || undefined : undefined;
+    value.residenceCity = value.address ? value.address[1] || undefined : undefined;
+    value.residenceArea = value.address ? value.address[2] || undefined : undefined;
+    // 现住地址
+    value.nowProvince = value.userNowAddress ? value.userNowAddress[0] || undefined : undefined;
+    value.nowCity = value.userNowAddress ? value.userNowAddress[1] || undefined : undefined;
+    value.nowArea = value.userNowAddress ? value.userNowAddress[2] || undefined : undefined;
+    // 籍贯
+    value.nativePlaceProvince = value.nativePlace ? value.nativePlace[0] || undefined : undefined;
+    value.nativePlaceCity = value.nativePlace ? value.nativePlace[1] || undefined : undefined;
+    // 性别
+    value.sex = value.sex === '男' ? 0 : value.sex === '女' ? 1 : undefined;
+    // 婚否
+    value.marriage = value.marriage === '未婚' ? 0 : value.marriage === '已婚' ? 1 : value.marriage === '离异' ? 2 : undefined;
+
+    value.id = this.props.userInfor.id;
+
+    delete value.address;
+    delete value.userNowAddress;
+    delete value.nativePlace;
+    try {
+      const msg = await updateEmployees(value);
+      if(msg.error.length === 0){
+        message.success({content:'修改成功',key:'updateEmployees',duration:2.5});
+        this.props.formRef.current.reload();
+        this.props.onCancel();
+        this.props.onUpdate();
+      }else{
+        message.error({content:msg.error[0].message,key:'updateEmployees',duration:2.5})
+      }
+    } catch (e){
+      console.log(e)
+      return false;
+    }
+  }
+
   setAddressList = async () => {
     let addressSelect = await getAddressSelect();
     addressSelect.unshift({
@@ -65,8 +110,80 @@ class NewEmployees extends Component{
     })
   }
 
+  verifyId = async () => {
+    let employeeId = this.formRef.current.getFieldsValue(['employeeId']).employeeId;
+    if(!employeeId){
+      message.warning('员工编号不能为空');
+      return;
+    }
+    message.loading({content:'检验中...',key:'verifyId'});
+    this.setState({
+      verifyIdLoading:true,
+    })
+    try {
+      const msg = await checkEmployeeId(employeeId,this.props.userInfor ? this.props.userInfor.id : undefined);
+      if(msg.error.length === 0){
+        message.success({content:'此编号未被占用',key:'verifyId',duration:2.5});
+      }else{
+        message.error({content:msg.error[0].message,key:'verifyId',duration:2.5})
+      }
+    }catch (error){
+      console.log(error)
+    }
+    this.setState({
+      verifyIdLoading:false,
+    })
+  }
+
+  verifyDoor = async () => {
+    let doorId = this.formRef.current.getFieldsValue(['doorId']).doorId;
+    if(!doorId){
+      message.warning('门禁编号不能为空');
+      return;
+    }
+    message.loading({content:'检验中...',key:'verifyDoor'});
+    this.setState({
+      doorIdLoading:true,
+    })
+    try {
+      const msg = await checkDoorId(doorId,this.props.userInfor ? this.props.userInfor.id : undefined);
+      if(msg.error.length === 0){
+        message.success({content:'此编号未被占用',key:'verifyDoor',duration:2.5});
+      }else{
+        message.error({content:msg.error[0].message,key:'verifyDoor',duration:2.5})
+      }
+    }catch (error){
+      console.log(error)
+    }
+    this.setState({
+      doorIdLoading:false,
+    })
+  }
+
   componentDidMount() {
     this.setAddressList();
+    if(this.props.userInfor){
+      let data = this.props.userInfor;
+      this.formRef.current.setFieldsValue({
+        employeeId: data.employeeId,
+        doorId: data.doorId,
+        name: data.name,
+        birthdays: data.birthdays,
+        idCard: data.idCard,
+        sex: data.sex === 0 ? '男' : '女',
+        address: [data.residenceProvince,data.residenceCity,data.residenceArea],
+        nativePlace: [data.nativePlaceProvince,data.nativePlaceCity],
+        residenceAddress: data.residenceAddress,
+        userNowAddress: [data.nowProvince,data.nowCity,data.nowArea],
+        nowAddress: data.nowAddress,
+        nation: data.nation,
+        certificationAuthority: data.certificationAuthority,
+        marriage: data.marriage === 0 ? '未婚' : data.marriage === 1 ? '已婚' : data.marriage === 2 ? '离异' : undefined,
+        son: data.son,
+        girl: data.girl,
+        politicalOutlook: data.politicalOutlook
+      })
+    }
   }
 
   formRef = React.createRef();
@@ -77,18 +194,17 @@ class NewEmployees extends Component{
         formRef={this.formRef}
         visible={this.props.visible}
         preserve={false}
-        title='新增人事档案'
+        title={this.props.userInfor ? '修改人事档案' : '新增人事档案'}
         modalProps={{
           destroyOnClose:true,
           onCancel: (e) => {e.stopPropagation();this.props.onCancel();},
         }}
-        onFinish={this.addEmployees}
+        onFinish={this.props.userInfor ? this.updateEmployees : this.addEmployees}
       >
         <ProForm.Group>
-          <ProFormText
-            width="m"
-            placeholder="请输入员工编号"
+          <Form.Item
             name="employeeId"
+            width="m"
             rules={[
               {
                 required:true,
@@ -99,11 +215,17 @@ class NewEmployees extends Component{
                 message: '员工编号不能包含中文',
               }
             ]}
-            label="员工编号"/>
-          <ProFormText
-            width="m"
-            placeholder="请输入门禁编号"
+            label="员工编号">
+            <Search
+              loading={this.state.verifyIdLoading}
+              style={{width:328}}
+              placeholder="请输入员工编号"
+              onSearch={this.verifyId}
+              enterButton="验证重复"/>
+          </Form.Item>
+          <Form.Item
             name="doorId"
+            width="m"
             rules={[
               {
                 required:true,
@@ -114,7 +236,14 @@ class NewEmployees extends Component{
                 message: '门禁编号不能包含中文',
               }
             ]}
-            label="门禁编号"/>
+            label="门禁编号">
+            <Search
+              loading={this.state.doorIdLoading}
+              style={{width:328}}
+              placeholder="请输入门禁编号"
+              onSearch={this.verifyDoor}
+              enterButton="验证重复"/>
+          </Form.Item>
         </ProForm.Group>
         <ProForm.Group>
           <ProFormText

+ 158 - 7
src/pages/personnel/archives/statistics/components/personnelDetails.jsx

@@ -1,22 +1,173 @@
 import React,{Component} from 'react';
 import Modal from '@/components/common/Modal';
+import {Button, Descriptions, message, Spin, Tooltip} from 'antd';
+import {getSelectBypdId} from '../services/API';
+import DataClassify from './dataClassify/index';
+import NewEmployees from "@/pages/personnel/archives/statistics/components/newEmployees";
 
 class PersonnelDetails extends Component{
   constructor(props) {
     super(props);
+    this.state={
+      doorDetails:{},
+      loading: false,
+      table: [
+        {
+          key: "员工编号",
+          value: "employeeId",
+        },
+        {
+          key: "姓名",
+          value: "name",
+        },
+        {
+          key: "出生日期",
+          value: "birthdays",
+        },
+        {
+          key: "出生月份",
+          value: "month",
+        },
+        {
+          key: "门禁编号",
+          value: "doorId",
+        },
+        {
+          key: "性别",
+          value: "sex",
+        },
+        {
+          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",
+        },
+        {
+          key: "政治面貌",
+          value: "politicalOutlookName",
+        },
+      ],
+      visible: false,
+      employeesVisible: false,
+      readonly: false,
+    }
+    this.getCheckDoorDetails = this.getCheckDoorDetails.bind(this);
+  }
+
+  getCheckDoorDetails= async ()=>{
+    this.setState({
+      loading: true
+    })
+    const {userInfo} = this.props;
+    const msg = await getSelectBypdId(userInfo.id);
+    if(msg.error.length === 0){
+      this.setState({
+        doorDetails: msg.data
+      })
+    }else{
+      message.warning(msg.error[0].message)
+    }
+    this.setState({
+      loading: false
+    })
+  }
+
+  componentDidMount() {
+    this.getCheckDoorDetails();
   }
 
   render() {
     const {userInfo} = this.props;
     return (
-      <Modal
-        title={userInfo.name+'人事档案'}
-        footer={null}
-        visible={this.props.visible}
-        onCancel={(e) => {e.stopPropagation();this.props.onCancel();}}
-      >
+      <>
+        <Modal
+          width={1240}
+          title={userInfo.name+'人事档案'}
+          footer={null}
+          visible={this.props.visible}
+          onCancel={(e) => {this.props.onCancel();}}
+        >
+          <Spin spinning={this.state.loading}>
+            <Button type="primary" style={{marginBottom:'20px'}} onClick={()=>{this.setState({readonly:!this.state.readonly})}}>{this.state.readonly ? '切换查看模式' : '切换编辑模式'}</Button>
+            <div style={{ cursor: 'pointer',paddingBottom:'20px'}} onClick={()=>{
+              this.setState({
+                employeesVisible: true,
+              })
+            }}>
+              <Descriptions
+                bordered
+                column={{ xxl: 4, xl: 4, lg: 4, md: 4, sm: 2, xs: 1 }}>
+                {
+                  this.state.table.map((value,key)=>(
+                    <Descriptions.Item label={value.key} key={key}>
+                        <Tooltip
+                          placement="top"
+                          title={
+                            value.value === 'sex' ? (this.state.doorDetails[value.value] === 0 ? '男' : '女') :
+                              value.value === 'son' ? this.state.doorDetails[value.value] + '/' + this.state.doorDetails['girl'] :
+                                this.state.doorDetails[value.value]
+                          }
+                        >
+                          {
+                            value.value === 'sex' ? (this.state.doorDetails[value.value] === 0 ? '男' : '女') :
+                              value.value === 'son' ? this.state.doorDetails[value.value] + '/' + this.state.doorDetails['girl'] :
+                                this.state.doorDetails[value.value] && this.state.doorDetails[value.value].length > 10 ?  this.state.doorDetails[value.value].slice(0,10)+'...':this.state.doorDetails[value.value]
+                          }
+                        </Tooltip>
+                    </Descriptions.Item>
+                  ))
+                }
+              </Descriptions>
+            </div>
+            {Object.keys(this.state.doorDetails).length > 0 ? <DataClassify
+              readonly={this.state.readonly}
+              userInfor={this.state.doorDetails}
+            /> : null}
 
-      </Modal>
+          </Spin>
+        </Modal>
+        {this.state.employeesVisible && <NewEmployees
+          userInfor={this.state.doorDetails}
+          formRef={this.props.formRef}
+          visible={this.state.employeesVisible}
+          onUpdate={this.getCheckDoorDetails}
+          onCancel={()=>{
+            this.setState({
+              employeesVisible: false,
+            })
+          }}
+        /> }
+      </>
     )
   }
 }

+ 3 - 0
src/pages/personnel/archives/statistics/components/personnelDetails.less

@@ -0,0 +1,3 @@
+.descriptionsItem{
+  cursor: pointer;
+}

+ 13 - 4
src/pages/personnel/archives/statistics/index.jsx

@@ -423,6 +423,7 @@ class Archives extends Component{
       ],
       visible:false,
       userInfo: {},
+      personnelVisible: false,
     }
   }
 
@@ -439,7 +440,7 @@ class Archives extends Component{
       });
       return theArr;
     }else{
-      message.info(msg.error[0].message)
+      message.warning(msg.error[0].message)
     }
     return [];
   }
@@ -487,8 +488,8 @@ class Archives extends Component{
             onClick: (e) => {
               e.stopPropagation();
               this.setState({
-                visible: true,
-                organizationInfor: record,
+                personnelVisible: true,
+                userInfo: record,
               })
             }
           })}
@@ -516,7 +517,15 @@ class Archives extends Component{
             })
           }}
         /> }
-        <PersonnelDetails userInfo={this.state.userInfo}/>
+        {this.state.personnelVisible ? <PersonnelDetails
+          formRef={ref}
+          visible={this.state.personnelVisible}
+          onCancel={()=>{
+            this.setState({
+              personnelVisible: false,
+            })
+          }}
+          userInfo={this.state.userInfo}/> : null}
       </>
     )
   }

+ 46 - 0
src/pages/personnel/archives/statistics/services/API.ts

@@ -7,3 +7,49 @@ export async function addEmployees(data: object){
     data
   })
 }
+
+// 验证员工编号重复
+export async function checkEmployeeId(employeeId: string,id: string){
+  return request('/api/admin/personnel/checkEmployeeId',{
+    params:{
+      employeeId,
+      id
+    }
+  })
+}
+
+// 验证门禁编号重复
+export async function checkDoorId(doorId: string,id: string){
+  return request('/api/admin/personnel/checkDoorId',{
+    params:{
+      doorId,
+      id
+    }
+  })
+}
+
+// 修改人事档案
+export async function updateEmployees(data: object){
+  return request('/api/admin/personnel/update',{
+    method:'post',
+    data
+  })
+}
+
+// 人事档案详情
+export async function getSelectBypdId(id: string){
+  return request('/api/admin/personnel/selectBypdId',{
+    params:{
+      id,
+    }
+  })
+}
+
+// 获得星级
+export async function selectLvlList(){
+  return request('/api/admin/personnel/selectLvlList')
+}
+
+
+
+