|
|
@ -50,7 +50,12 @@ const SalesMemberModal = (props) => { |
|
|
|
|
|
|
|
function handleOk() { |
|
|
|
form.current.validate().then((values) => { |
|
|
|
if (peoplePro?.userCode) { |
|
|
|
if (peoplePro == 'noValid') { |
|
|
|
Notification.error({ |
|
|
|
content: '你填写的员工编号无对应的人员信息', |
|
|
|
duration: 2, |
|
|
|
}) |
|
|
|
} else if (peoplePro?.userCode) { |
|
|
|
if (values.userCode == peoplePro.userCode) { |
|
|
|
if (dataToEdit) { |
|
|
|
dispatch(humanAffairs.editSalesMember({ pepUserId: peoplePro.pepUserId, msg: '编辑销售人员信息', ...values })).then((res) => { |
|
|
@ -73,7 +78,7 @@ const SalesMemberModal = (props) => { |
|
|
|
} |
|
|
|
} else { |
|
|
|
Notification.error({ |
|
|
|
content: '你填写的员工编号无对应的人员信息', |
|
|
|
content: '请查询人员编号对应的员工信息', |
|
|
|
duration: 2, |
|
|
|
}) |
|
|
|
} |
|
|
@ -81,55 +86,63 @@ const SalesMemberModal = (props) => { |
|
|
|
} |
|
|
|
|
|
|
|
const memberSeach = (id) => {//搜索项企用户
|
|
|
|
dispatch(humanAffairs.getMemberSearch({ code: id })).then((res) => {//搜索项企用户
|
|
|
|
if (res.success) { |
|
|
|
if (res.payload.data.length) { |
|
|
|
let user = res.payload.data[0] |
|
|
|
let exist = rzMembers.find(m => m.pepUserId == user.pepUserId);//人员档案里面需要有
|
|
|
|
if (exist) { |
|
|
|
let item = { |
|
|
|
pepUserId: user.pepUserId, |
|
|
|
name: exist.userName, |
|
|
|
department: exist.departmrnt, |
|
|
|
hireDate: exist.hiredate, |
|
|
|
regularDate: exist.regularDate, |
|
|
|
userCode: user.userCode, |
|
|
|
post: user.userPost//岗位
|
|
|
|
} |
|
|
|
setPeoplePro(item) |
|
|
|
} |
|
|
|
} |
|
|
|
// dispatch(humanAffairs.getMemberSearch({ code: id })).then((res) => {//搜索项企用户
|
|
|
|
// if (res.success) {
|
|
|
|
// if (res.payload.data.length) {
|
|
|
|
// let user = res.payload.data[0]
|
|
|
|
let exist = rzMembers.find(m => m.userCode == id);//人员档案里面需要有
|
|
|
|
if (exist) { |
|
|
|
let item = { |
|
|
|
pepUserId: exist.pepUserId, |
|
|
|
name: exist.userName, |
|
|
|
department: exist.departmrnt, |
|
|
|
hireDate: exist.hiredate, |
|
|
|
regularDate: exist.regularDate, |
|
|
|
userCode: exist.userCode, |
|
|
|
post: exist.userPost//岗位
|
|
|
|
} |
|
|
|
}) |
|
|
|
setPeoplePro(item) |
|
|
|
} else { |
|
|
|
setPeoplePro('noValid') |
|
|
|
} |
|
|
|
// } else {
|
|
|
|
// setPeoplePro('noValid')
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
} |
|
|
|
|
|
|
|
const renderSimpleInfo = () => { |
|
|
|
let arrStr = peoplePro?.department?.map(t => t.name) || []; |
|
|
|
return <div> |
|
|
|
{ |
|
|
|
peoplePro?.name ? ( |
|
|
|
<div style={{ width: 749, height: 95, background: '#F4F5FC', border: '1px solid rgba(0, 90, 189, 0.2)', marginTop: 8, padding: '20px 83px 20px 50px' }}> |
|
|
|
<div style={{ display: 'flex' }}> |
|
|
|
{renderPeopleItem('姓名:', peoplePro.name)} |
|
|
|
<div style={{ display: 'flex', flexBasis: '50%' }}> |
|
|
|
<div style={{ width: 16, height: 16, marginRight: 9 }}> |
|
|
|
<img src="/assets/images/hrImg/department.png" alt="" style={{ width: '100%', height: '100%' }} /> |
|
|
|
peoplePro == 'noValid' ? |
|
|
|
<div style={{ background: '#F4F5FC', border: '1px solid rgba(0, 90, 189, 0.2)', marginTop: 8, padding: '10px 0px', textAlign: 'center', color: '#4A4A4A' }}> |
|
|
|
没有符合条件的结果 |
|
|
|
</div> : |
|
|
|
peoplePro?.name ? ( |
|
|
|
<div style={{ background: '#F4F5FC', border: '1px solid rgba(0, 90, 189, 0.2)', marginTop: 8, padding: '20px 83px 20px 50px' }}> |
|
|
|
<div style={{ display: 'flex' }}> |
|
|
|
{renderPeopleItem('姓名:', peoplePro.name)} |
|
|
|
<div style={{ display: 'flex', flexBasis: '50%' }}> |
|
|
|
<div style={{ width: 16, height: 16, marginRight: 9 }}> |
|
|
|
<img src="/assets/images/hrImg/department.png" alt="" style={{ width: '100%', height: '100%' }} /> |
|
|
|
</div> |
|
|
|
<div style={{ color: 'rgba(0,0,0,0.6)', fontSize: 12 }}> |
|
|
|
所属部门: |
|
|
|
</div> |
|
|
|
{getMultis(arrStr)} |
|
|
|
</div> |
|
|
|
<div style={{ color: 'rgba(0,0,0,0.6)', fontSize: 12 }}> |
|
|
|
所属部门: |
|
|
|
</div> |
|
|
|
{getMultis(arrStr)} |
|
|
|
</div> |
|
|
|
<div style={{ display: 'flex' }}> |
|
|
|
{renderPeopleItem('入职时间:', peoplePro.hireDate)} |
|
|
|
{renderPeopleItem('岗位:', peoplePro.post)} |
|
|
|
</div> <div style={{ display: 'flex' }}> |
|
|
|
{renderPeopleItem('转正时间:', peoplePro.regularDate)} |
|
|
|
{renderPeopleItem('工龄:', peoplePro.hireDate ? String(moment(new Date()).diff(peoplePro.hireDate, 'years', true)).substring(0, 3) + '年' : '-')} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style={{ display: 'flex' }}> |
|
|
|
{renderPeopleItem('入职时间:', peoplePro.hireDate)} |
|
|
|
{renderPeopleItem('岗位:', peoplePro.post)} |
|
|
|
</div> <div style={{ display: 'flex' }}> |
|
|
|
{renderPeopleItem('转正时间:', peoplePro.regularDate)} |
|
|
|
{renderPeopleItem('工龄:', peoplePro.hireDate ? String(moment(new Date()).diff(peoplePro.hireDate, 'years', true)).substring(0, 3) + '年' : '-')} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) : ('') |
|
|
|
) : ('') |
|
|
|
} |
|
|
|
</div> |
|
|
|
} |
|
|
@ -177,6 +190,7 @@ const SalesMemberModal = (props) => { |
|
|
|
showClear |
|
|
|
style={{ width: '100%' }} |
|
|
|
rules={[{ required: true, message: "请输入人员编号" }]} |
|
|
|
onChange={() => setPeoplePro({})} |
|
|
|
addonAfter={<div style={{ margin: '0px 12px', color: '#005ABD', cursor: "pointer", fontSize: 14 }} onClick={() => { |
|
|
|
let formList = form.current.getValues() |
|
|
|
if (formList.userCode) { |
|
|
|