|
|
@ -4,6 +4,7 @@ import { connect } from 'react-redux'; |
|
|
|
import { Modal, Form, Button, Notification } from '@douyinfe/semi-ui'; |
|
|
|
import { IconUpload } from '@douyinfe/semi-icons'; |
|
|
|
import cityData from '../../components/city.json'; |
|
|
|
import { businessLinesConst } from './constans' |
|
|
|
import XLSX from 'xlsx' |
|
|
|
//下载模板和上传文件读取
|
|
|
|
const ImportSalersModal = props => { |
|
|
@ -142,6 +143,19 @@ const ImportSalersModal = props => { |
|
|
|
return !noMark; |
|
|
|
} |
|
|
|
|
|
|
|
const judgeLines = (businessLines) => { |
|
|
|
if (!businessLines) {//可以不填
|
|
|
|
return true; |
|
|
|
} |
|
|
|
let noMark = 0; |
|
|
|
businessLines?.split('、')?.map(p => { |
|
|
|
if (businessLinesConst.indexOf(p) == -1) { |
|
|
|
noMark++ |
|
|
|
} |
|
|
|
}) |
|
|
|
return !noMark; |
|
|
|
} |
|
|
|
|
|
|
|
const judgeNull = (value) => { |
|
|
|
return value ? String(value).trim().replace(/\s*/g, "") : null; |
|
|
|
} |
|
|
@ -227,7 +241,11 @@ const ImportSalersModal = props => { |
|
|
|
error(`第${i + 2}行销售区域(市)错误`) |
|
|
|
return |
|
|
|
} |
|
|
|
//todo 业务线判断
|
|
|
|
let bValid = judgeLines(businessLines); |
|
|
|
if (!bValid) { |
|
|
|
error(`第${i + 2}行业务线错误`) |
|
|
|
return |
|
|
|
} |
|
|
|
postData.push({ |
|
|
|
pepUserId: rzExist.pepUserId, name, number, |
|
|
|
provinces: provinces || '', cities: cities || '', businessLines: businessLines || '', |
|
|
@ -254,6 +272,7 @@ const ImportSalersModal = props => { |
|
|
|
<div>姓名:必填,若与员工编号对应的项企用户姓名不同,将以项企数据为准;</div> |
|
|
|
<div>销售区域(省/直辖市):必填,省或直辖市顿号隔开,如“北京市、江西省、江苏省”;</div> |
|
|
|
<div>销售区域(市):非必填,归属所填省的地级市顿号隔开,如“南昌市、镇江市”。</div> |
|
|
|
<div>业务线:非必填,顿号隔开,如“智慧城市、工地”。</div> |
|
|
|
</div> |
|
|
|
</Form> |
|
|
|
</Modal > |
|
|
|