Browse Source

合并代码解决冲突

master
deartibers 2 years ago
parent
commit
3129a6bf1e
  1. 65
      api/app/lib/controllers/member/index.js
  2. 1
      api/app/lib/index.js
  3. 418
      api/app/lib/models/member.js
  4. 4
      api/app/lib/utils/member.js
  5. 6
      api/config.js
  6. 131
      web/client/src/sections/humanAffairs/containers/import-members-modal.js
  7. 14
      web/client/src/sections/humanAffairs/containers/personnelFiles.jsx
  8. 2
      web/client/src/sections/humanAffairs/containers/table-input-rule.js

65
api/app/lib/controllers/member/index.js

@ -221,7 +221,7 @@ async function list (ctx) {
)
.replace(/_/g, '')
}
obj[nextKey] = u[k]
obj[nextKey] = u[k] == '1970-01-01 00:00:00.000000' ? null : u[k]
}
returnD.push({
...obj,
@ -234,7 +234,7 @@ async function list (ctx) {
name: u.roleName
}] : [],
del: undefined,
pepuserid: undefined
pepuserid: undefined,
})
}
})
@ -382,6 +382,7 @@ async function vacateStatistics (ctx) {
async function exportData (ctx) {
try {
const { models } = ctx.fs.dc;
const { clickHouse, opts: { qiniu } } = ctx.app.fs
const { simpleExcelDown, memberList } = ctx.app.fs.utils
const { keywordTarget, keyword, limit, page, state, keys = '' } = ctx.query
@ -391,6 +392,7 @@ async function exportData (ctx) {
const optionKeys = keys.split(',')
let exportD = []
let pepUserIds = []
userRes.forEach(u => {
let existUser = exportD.find(r => r.pepUserId == u.pepUserId)
if (existUser) {
@ -419,8 +421,9 @@ async function exportData (ctx) {
)
.replace(/_/g, '')
}
obj[nextKey] = u[k]
obj[nextKey] = u[k] == '1970-01-01 00:00:00.000000' ? null : u[k]
}
pepUserIds.push(u.pepUserId)
exportD.push({
...obj,
departmrnt: u.depId ? [{
@ -444,7 +447,7 @@ async function exportData (ctx) {
let header = [].concat(preHeader)
for (let k in tableAttributes) {
const comment = tableAttributes[k].comment
if (k != 'id' && comment) {
if (k != 'id' && k != 'pepUserId' && comment) {
if ([].includes(k)) {
// 截住不想导出的字段
continue
@ -456,6 +459,56 @@ async function exportData (ctx) {
})
}
}
header = header.concat([{
title: '累计加班次数',
key: 'overTimeCount',
}, {
title: '累计加班总时长 / h',
key: 'overTimeDuration',
}, {
title: '累计请假次数',
key: 'vacateCount',
}, {
title: '累计请假总时长 / h',
key: 'vacateDuration',
},])
// 查询累计加班次数及总时长
const statisticOvertimeRes = await clickHouse.hr.query(`
SELECT
pep_user_id AS pepUserId,
count(id) AS count,
sum(duration) AS duration
FROM
overtime
WHERE pep_user_id IN (${pepUserIds.join(',')})
GROUP BY pep_user_id
`).toPromise()
const statisticVacateRes = await clickHouse.hr.query(`
SELECT
pep_user_id AS pepUserId,
count(id) AS count,
sum(duration) AS duration
FROM
vacate
WHERE pep_user_id IN (${pepUserIds.join(',')})
GROUP BY pep_user_id
`).toPromise()
exportD.forEach(d => {
d.departmrnt = d.departmrnt.map(dep => dep.name).join('、')
d.role = d.role.map(r => r.name).join('、')
d.idPhoto ? d.idPhoto = qiniu.domain + '/' + d.idPhoto : ''
d.vitae ? d.vitae = qiniu.domain + '/' + d.vitae : ''
const corOverTime = statisticOvertimeRes.find(so => so.pepUserId == d.pepUserId)
d.overTimeCount = corOverTime ? corOverTime.count : 0
d.overTimeDuration = corOverTime ? (corOverTime.duration / 3600).toFixed(1) : 0
const corVacate = statisticVacateRes.find(so => so.pepUserId == d.pepUserId)
d.vacateCount = corVacate ? corVacate.count : 0
d.vacateDuration = corVacate ? (corVacate.duration / 3600).toFixed(1) : 0
})
const fileName = `人员信息_${moment().format('YYYYMMDDHHmmss')}` + '.csv'
const filePath = await simpleExcelDown({ data: exportD, header, fileName: fileName })
@ -475,7 +528,7 @@ async function exportData (ctx) {
}
async function addMembersBulk (ctx) {
let errorMsg = { message: '批量添加员工信息失败' };
let errorMsg = { message: '导入员工信息失败' };
const transaction = await ctx.fs.dc.orm.transaction();
try {
const models = ctx.fs.dc.models;
@ -486,7 +539,7 @@ async function addMembersBulk (ctx) {
attributes: ['pepUserId']
});
data.map(d => {
let exist = memberList.find(d => d.pepUserId == d.number);//项企的人员编号字段还没有
let exist = memberList.find(m => m.pepUserId == d.pepUserId);//项企的人员编号字段还没有
if (exist) {
editMembers.push(d);
} else {

1
api/app/lib/index.js

@ -16,6 +16,7 @@ module.exports.entry = function (app, router, opts) {
app.fs.logger.log('info', '[FS-AUTH]', 'Inject auth and api mv into router.');
app.fs.api = app.fs.api || {};
app.fs.opts = opts || {};
app.fs.utils = app.fs.utils || {};
app.fs.api.authAttr = app.fs.api.authAttr || {};
app.fs.api.logAttr = app.fs.api.logAttr || {};

418
api/app/lib/models/member.js

@ -2,213 +2,213 @@
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Member = sequelize.define("member", {
pepUserId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: "项企用户id",
primaryKey: true,
field: "pep_user_id",
autoIncrement: false,
unique: "member_pep_user_id_uindex"
},
idNumber: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "证件号",
primaryKey: false,
field: "id_number",
autoIncrement: false
},
idPhoto: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "证件照",
primaryKey: false,
field: "id_photo",
autoIncrement: false
},
gender: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "性别",
primaryKey: false,
field: "gender",
autoIncrement: false
},
birthday: {
type: DataTypes.DATEONLY,
allowNull: true,
defaultValue: null,
comment: "出生年月",
primaryKey: false,
field: "birthday",
autoIncrement: false
},
nativePlace: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "籍贯",
primaryKey: false,
field: "native_place",
autoIncrement: false
},
marital: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "婚育状态",
primaryKey: false,
field: "marital",
autoIncrement: false
},
politicsStatus: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "整治面貌",
primaryKey: false,
field: "politics_status",
autoIncrement: false
},
phoneNumber: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "phone_number",
autoIncrement: false
},
workPlace: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "工作地点",
primaryKey: false,
field: "work_place",
autoIncrement: false
},
graduatedFrom: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "毕业院校",
primaryKey: false,
field: "graduated_from",
autoIncrement: false
},
educationBackground: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "学历",
primaryKey: false,
field: "education_background",
autoIncrement: false
},
specialty: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "专业",
primaryKey: false,
field: "specialty",
autoIncrement: false
},
graduationDate: {
type: DataTypes.DATEONLY,
allowNull: true,
defaultValue: null,
comment: "毕业时间",
primaryKey: false,
field: "graduation_date",
autoIncrement: false
},
hiredate: {
type: DataTypes.DATEONLY,
allowNull: true,
defaultValue: null,
comment: "入职时间",
primaryKey: false,
field: "hiredate",
autoIncrement: false
},
turnProbationPeriod: {
type: DataTypes.DATEONLY,
allowNull: true,
defaultValue: null,
comment: "转试用期时间",
primaryKey: false,
field: "turn_probation_period",
autoIncrement: false
},
regularDate: {
type: DataTypes.DATEONLY,
allowNull: true,
defaultValue: null,
comment: "转正时间",
primaryKey: false,
field: "regular_date",
autoIncrement: false
},
dimissionDate: {
type: DataTypes.DATEONLY,
allowNull: true,
defaultValue: null,
comment: "离职时间",
primaryKey: false,
field: "dimission_date",
autoIncrement: false
},
experienceYear: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: "工作经验/年",
primaryKey: false,
field: "experience_year",
autoIncrement: false
},
occupationalHistory: {
type: DataTypes.TEXT,
allowNull: true,
defaultValue: null,
comment: "工作经历",
primaryKey: false,
field: "occupational_history",
autoIncrement: false
},
vitae: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "简历",
primaryKey: false,
field: "vitae",
autoIncrement: false
},
del: {
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "del",
autoIncrement: false
}
}, {
tableName: "member",
comment: "",
indexes: []
});
dc.models.Member = Member;
return Member;
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Member = sequelize.define("member", {
pepUserId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: "项企用户id",
primaryKey: true,
field: "pep_user_id",
autoIncrement: false,
unique: "member_pep_user_id_uindex"
},
idNumber: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "证件号",
primaryKey: false,
field: "id_number",
autoIncrement: false
},
idPhoto: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "证件照",
primaryKey: false,
field: "id_photo",
autoIncrement: false
},
gender: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "性别",
primaryKey: false,
field: "gender",
autoIncrement: false
},
birthday: {
type: DataTypes.DATEONLY,
allowNull: true,
defaultValue: null,
comment: "出生年月",
primaryKey: false,
field: "birthday",
autoIncrement: false
},
nativePlace: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "籍贯",
primaryKey: false,
field: "native_place",
autoIncrement: false
},
marital: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "婚育状态",
primaryKey: false,
field: "marital",
autoIncrement: false
},
politicsStatus: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "整治面貌",
primaryKey: false,
field: "politics_status",
autoIncrement: false
},
phoneNumber: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: '手机号码',
primaryKey: false,
field: "phone_number",
autoIncrement: false
},
workPlace: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "工作地点",
primaryKey: false,
field: "work_place",
autoIncrement: false
},
graduatedFrom: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "毕业院校",
primaryKey: false,
field: "graduated_from",
autoIncrement: false
},
educationBackground: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "学历",
primaryKey: false,
field: "education_background",
autoIncrement: false
},
specialty: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "专业",
primaryKey: false,
field: "specialty",
autoIncrement: false
},
graduationDate: {
type: DataTypes.DATEONLY,
allowNull: true,
defaultValue: null,
comment: "毕业时间",
primaryKey: false,
field: "graduation_date",
autoIncrement: false
},
hiredate: {
type: DataTypes.DATEONLY,
allowNull: true,
defaultValue: null,
comment: "入职时间",
primaryKey: false,
field: "hiredate",
autoIncrement: false
},
turnProbationPeriod: {
type: DataTypes.DATEONLY,
allowNull: true,
defaultValue: null,
comment: "转试用期时间",
primaryKey: false,
field: "turn_probation_period",
autoIncrement: false
},
regularDate: {
type: DataTypes.DATEONLY,
allowNull: true,
defaultValue: null,
comment: "转正时间",
primaryKey: false,
field: "regular_date",
autoIncrement: false
},
dimissionDate: {
type: DataTypes.DATEONLY,
allowNull: true,
defaultValue: null,
comment: "离职时间",
primaryKey: false,
field: "dimission_date",
autoIncrement: false
},
experienceYear: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: "工作经验/年",
primaryKey: false,
field: "experience_year",
autoIncrement: false
},
occupationalHistory: {
type: DataTypes.TEXT,
allowNull: true,
defaultValue: null,
comment: "工作经历",
primaryKey: false,
field: "occupational_history",
autoIncrement: false
},
vitae: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "简历",
primaryKey: false,
field: "vitae",
autoIncrement: false
},
del: {
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "del",
autoIncrement: false
}
}, {
tableName: "member",
comment: "",
indexes: []
});
dc.models.Member = Member;
return Member;
};

4
api/app/lib/utils/member.js

@ -67,7 +67,7 @@ module.exports = function (app, opts) {
INNER JOIN ${pepEmis}.user AS user
ON member.pep_user_id = user.id
${keywordTarget == 'number' && keyword ? `
AND user.id LIKE '%${keyword}%'
AND toString(user.id) LIKE '%${keyword}%'
`: ''}
${keywordTarget == 'name' && keyword ? `
AND user.name LIKE '%${keyword}%'
@ -138,7 +138,7 @@ module.exports = function (app, opts) {
${whereOption.length ? `WHERE ${whereOption.join(' AND ')}` : ''}
`).toPromise()
return userRes
}

6
api/config.js

@ -107,6 +107,12 @@ const product = {
'INTERNALLY_TERMINATED' //流程异常结束
]
},
qiniu: {
domain: QINIU_DOMAIN_QNDMN_RESOURCE,
bucket: QINIU_BUCKET_RESOURCE,
accessKey: QINIU_AK,
secretKey: QINIU_SK
},
redis: {
host: IOTA_REDIS_SERVER_HOST,
port: IOTA_REDIS_SERVER_PORT,

131
web/client/src/sections/humanAffairs/containers/import-members-modal.js

@ -1,4 +1,5 @@
'use strict';
import moment from 'moment';
import React, { useState } from 'react';
import { connect } from 'react-redux';
import { Modal, Form, Button, Notification } from '@douyinfe/semi-ui';
@ -10,7 +11,7 @@ import ExportJsonExcel from 'js-export-excel';
import { rule } from './table-input-rule'
//下载模板和上传文件读取
const ImportMembersModal = props => {
const { dispatch, onCancel } = props
const { dispatch, onCancel, xqMembers } = props
const [msg, setMsg] = useState('')
const [loading, setLoading] = useState('')
const [postData, setPostData] = useState([])
@ -20,13 +21,13 @@ const ImportMembersModal = props => {
setLoading(true)
dispatch(membersBulkAdd(postData)).then(res => {
if (res.success) {
Notification.success('导入员工信息成功')
//Notification.success({ content: '导入员工信息成功', duration: 2 })
onCancel()
}
setLoading(false)
})
} else {
Notification.warn('没有数据可以提交,请上传数据文件')
Notification.warning({ content: '没有数据可以提交,请上传数据文件', duration: 2 })
}
}
@ -110,6 +111,9 @@ const ImportMembersModal = props => {
const judgePlace = (place) => {
let valid = true;
if (!place) {//可以不填
return valid;
}
if (place.split('-').length == 1) {//判断籍贯
if (['北京市', '上海市', '天津市', '重庆市'].indexOf(place) == -1) {
valid = false;
@ -132,10 +136,35 @@ const ImportMembersModal = props => {
return valid;
}
const judgeTimeValid = (time) => {
let valid = true;
if (!time) {
return valid;//可以不填
}
const ymd = /^((19|20)[0-9]{2})[\/\-]((0[1-9])|(1[0-2]))[\/\-]((0[1-9])|((1|2)[0-9])|(3[0-1]))$/;//年月日
if (time instanceof Date) {
let timeStr = moment(time).format('YYYY/MM/DD');
if (!ymd.test(timeStr)) {
valid = false;
}
} else {
valid = false;
}
return valid;
}
const judgeNull = (value) => {
return value ? String(value).trim().replace(/\s*/g, "") : null;
}
const judgeNullTime = (v) => {
//注意的点:xlsx将excel中的时间内容解析后,会小一天
//如2020/8/1,xlsx会解析成 Fri Jul 31 2020 23:59:17 GMT+0800 小了43秒
let a = new Date(v);
a.setTime(a.getTime() + 43 * 1000);
return v ? a : null;
}
return (
<Modal
title="导入信息" visible={true}
@ -154,6 +183,10 @@ const ImportMembersModal = props => {
label={'员工信息'} labelPosition='left'
action={'/'} accept={fileLimit}
maxSize={200} limit={1}
onRemove={(currentFile, fileList, fileItem) => {
setMsg('');
setPostData([]);
}}
customRequest={(data) => {
const { file, onSuccess, onError } = data
getFileBlob(file.url).then(res => {
@ -173,7 +206,7 @@ const ImportMembersModal = props => {
const zmsz = /^[A-Za-z0-9]+$/;//字母数字组合
const pattern = /^1[3|4|5|6|7|8|9]\d{9}$/;
const sfz = /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;//身份证
const ymd = /^((19|20)[0-9]{2})[\/\-]((0[1-9])|(1[0-2]))[\/\-]((0[1-9])|((1|2)[0-9])|(3[0-1]))$/;//年月日
//const ymd = /^((19|20)[0-9]{2})[\/\-]((0[1-9])|(1[0-2]))[\/\-]((0[1-9])|((1|2)[0-9])|(3[0-1]))$/;//年月日
const num0 = /^\d+$/;//正整数+0
for (let i = 0; i < res.length; i++) {
let d = res[i];
@ -182,7 +215,7 @@ const ImportMembersModal = props => {
let name = judgeNull(d['姓名']);
let idNumber = judgeNull(d['证件号']);
let gender = judgeNull(d['性别(男/女)']);
let birthday = judgeNull(d['出生年月日(例2022/02/01)']);
let birthday = judgeNullTime(d['出生年月日(例2022/02/01)']);//-------判断时间
let nativePlace = judgeNull(d['籍贯']);
let marital = judgeNull(d['婚育状态(已婚/未婚/已婚已育)']);
@ -192,12 +225,12 @@ const ImportMembersModal = props => {
let graduatedFrom = judgeNull(d['毕业院校']);
let educationBackground = judgeNull(d['学历']);
let specialty = judgeNull(d['专业']);
let graduationDate = judgeNull(d['毕业时间']);
let graduationDate = judgeNullTime(d['毕业时间']);//-------------------判断时间
let hiredate = judgeNull(d['入职时间']);
let turnProbationPeriod = judgeNull(d['转试用期时间']);
let regularDate = judgeNull(d['转正时间']);
let dimissionDate = judgeNull(d['离职日期']);
let hiredate = judgeNullTime(d['入职时间']);//-------------------------判断时间
let turnProbationPeriod = judgeNullTime(d['转试用期时间']);//-----------判断时间
let regularDate = judgeNullTime(d['转正时间']);//----------------------判断时间
let dimissionDate = judgeNullTime(d['离职日期']);//---------------------判断时间
let experienceYear = judgeNull(d['工作经验(年)']);
let occupationalHistory = judgeNull(d['历史工作经历与职务']);
@ -217,18 +250,20 @@ const ImportMembersModal = props => {
error(`${i + 1}行姓名为空,请填写`)
return
}
if (!sfz.test(idNumber)) {
if (idNumber && !sfz.test(idNumber)) {
error(`${i + 1}行证件号错误`)
return
}
if (['男', '女'].indexOf(gender) == -1) {
if (gender && ['男', '女'].indexOf(gender) == -1) {
error(`${i + 1}行性别错误`)
return
}
// if (!ymd.test(birthday)) {
// error(`第${i + 1}行出生年月日错误,请填写yyyy/mm/dd格式`)
// return
// }
let bsdValid = judgeTimeValid(birthday);
if (!bsdValid) {
error(`${i + 1}行出生年月日错误,请填写yyyy/mm/dd格式`)
return
}
let jgValid = judgePlace(nativePlace);
if (!jgValid) {
@ -236,15 +271,15 @@ const ImportMembersModal = props => {
return
}
if (['已婚', '未婚', '已婚已育'].indexOf(marital) == -1) {
if (marital && ['已婚', '未婚', '已婚已育'].indexOf(marital) == -1) {
error(`${i + 1}行婚育状态错误`)
return
}
if (['群众', '党员'].indexOf(politicsStatus) == -1) {
if (politicsStatus && ['群众', '党员'].indexOf(politicsStatus) == -1) {
error(`${i + 1}行政治面貌错误`)
return
}
if (!pattern.test(phoneNumber)) {
if (phoneNumber && !pattern.test(phoneNumber)) {
error(`${i + 1}行联系方式错误`)
return
}
@ -253,43 +288,49 @@ const ImportMembersModal = props => {
error(`${i + 1}行工作地点错误`)
return
}
if (['小学', '初中', '高中', '大专', '本科', '研究生', '博士'].indexOf(educationBackground) == -1) {
if (educationBackground && ['小学', '初中', '高中', '大专', '本科', '研究生', '博士'].indexOf(educationBackground) == -1) {
error(`${i + 1}行学历错误`)
return
}
// if (!ymd.test(graduationDate)) {
// error(`第${i + 1}行毕业时间错误,请填写yyyy/mm/dd格式`)
// return
// }
// if (!ymd.test(hiredate)) {
// error(`第${i + 1}行入职时间错误,请填写yyyy/mm/dd格式`)
// return
// }
// if (!ymd.test(turnProbationPeriod)) {
// error(`第${i + 1}行转试用期时间错误,请填写yyyy/mm/dd格式`)
// return
// }
// if (!ymd.test(regularDate)) {
// error(`第${i + 1}行转正时间错误,请填写yyyy/mm/dd格式`)
// return
// }
// if (!ymd.test(dimissionDate)) {
// error(`第${i + 1}行离职日期错误,请填写yyyy/mm/dd格式`)
// return
// }
if (!num0.test(experienceYear)) {
let byValid = judgeTimeValid(graduationDate);
if (!byValid) {
error(`${i + 1}行毕业时间错误,请填写yyyy/mm/dd格式`)
return
}
let rzhValid = judgeTimeValid(hiredate);
if (!rzhValid) {
error(`${i + 1}行入职时间错误,请填写yyyy/mm/dd格式`)
return
}
let shyValid = judgeTimeValid(turnProbationPeriod);
if (!shyValid) {
error(`${i + 1}行转试用期时间错误,请填写yyyy/mm/dd格式`)
return
}
let zhzhValid = judgeTimeValid(regularDate);
if (!zhzhValid) {
error(`${i + 1}行转正时间错误,请填写yyyy/mm/dd格式`)
return
}
let lzhValid = judgeTimeValid(dimissionDate);
if (!lzhValid) {
error(`${i + 1}行离职日期错误,请填写yyyy/mm/dd格式`)
return
}
if (experienceYear && !num0.test(experienceYear)) {
error(`${i + 1}行工作经验(年)错误,请填写非负整数`)
return
}
postData.push({//人员编号 待办todotodo
pepUserId: 555, name, idNumber, gender, birthday, nativePlace, marital,
politicsStatus, phoneNumber, workPlace, graduatedFrom, educationBackground, specialty, graduationDate,
hiredate, turnProbationPeriod, regularDate, dimissionDate, experienceYear, occupationalHistory
hiredate, turnProbationPeriod, regularDate, dimissionDate, experienceYear, occupationalHistory,
del: false
})
}
if (postData.length) {
setPostData(postData)
}
//if (postData.length) {
setPostData(postData)
//}
let msg = '文件解析完成,点击确定按钮上传保存!'
setMsg(msg)
onSuccess({ message: msg })

14
web/client/src/sections/humanAffairs/containers/personnelFiles.jsx

@ -3,12 +3,12 @@ import { connect } from 'react-redux';
import { Select, Input, Button, CheckboxGroup, Tooltip } from '@douyinfe/semi-ui';
import { IconSearch } from '@douyinfe/semi-icons';
import PersonnelModal from '../components/personnelModal';
import ExportMembersModal from './import-members-modal'
import ImportMembersModal from './import-members-modal'
import '../style.less'
import moment from 'moment'
const Rest = (props) => {
const { dispatch, actions, history, user, loading, socket } = props
const { dispatch, actions, history, user, loading, socket, xqMembers } = props
const { humanAffairs } = actions;
let [departmentValue, setDepartmentValue] = useState('');
@ -275,20 +275,20 @@ const Rest = (props) => {
</PersonnelModal> : ''
}
{
exportModalVs ? <ExportMembersModal user={user}
onCancel={() => setExportModalVs(false)} /> : ''
exportModalVs ? <ImportMembersModal user={user}
onCancel={() => setExportModalVs(false)} xqMembers={xqMembers} /> : ''
}
</>
)
}
function mapStateToProps (state) {
const { auth, global, members, webSocket } = state;
function mapStateToProps(state) {
const { auth, global, MemberSearch, webSocket } = state;
return {
// loading: members.isRequesting,
user: auth.user,
actions: global.actions,
// members: members.data,
xqMembers: MemberSearch.data,
// socket: webSocket.socket
};
}

2
web/client/src/sections/humanAffairs/containers/table-input-rule.js

@ -5,6 +5,6 @@ export const rule = [
"地址:格式为“省-市”,如“江苏省-镇江市”,直辖市直接显示市,如“北京市”;",
"政治面貌:党员或群众;",
"学历:小学、初中、高中、大专、本科、研究生或博士;",
"工作经验:0或正数;",
"工作经验:0或正数;",
"没有的数据可不填写。"
]
Loading…
Cancel
Save