Browse Source

(*)销售人员导入 加上“业务线”字段

master
wuqun 2 years ago
parent
commit
7f247430b1
  1. 4
      web/client/src/sections/humanAffairs/containers/salersDistribution/constans.jsx
  2. 21
      web/client/src/sections/humanAffairs/containers/salersDistribution/importSalersModal.js
  3. 2
      web/client/src/sections/humanAffairs/containers/salersDistribution/personnelDistribution.jsx
  4. 4
      web/client/src/sections/humanAffairs/containers/salersDistribution/salesMemberModal.js

4
web/client/src/sections/humanAffairs/containers/salersDistribution/constans.jsx

@ -0,0 +1,4 @@
export const businessLinesConst = ['市政', '地灾', '水利', '智慧城市', '工地',
'环保', '安防', '产品投标', '交通', '矿山', '产品线']

21
web/client/src/sections/humanAffairs/containers/salersDistribution/importSalersModal.js

@ -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 >

2
web/client/src/sections/humanAffairs/containers/salersDistribution/personnelDistribution.jsx

@ -137,7 +137,7 @@ const PersonnelDistribution = (props) => {
title: '业务线',
dataIndex: 'businessLines',
key: 'businessLines',
width: 120,
width: 140,
render: (text, record, index) => {
return text ? getMultis(text?.split('、') || []) : '-';
}

4
web/client/src/sections/humanAffairs/containers/salersDistribution/salesMemberModal.js

@ -3,7 +3,7 @@ import moment from 'moment';
import { connect } from "react-redux";
import { Select, Modal, Form, Notification } from "@douyinfe/semi-ui";
import cityData from '../../components/city.json';
const businessLines = ['市政', '地灾', '水利', '智慧城市', '工地', '环保', '安防', '产品投标', '交通', '矿山', '产品线']
import { businessLinesConst } from './constans'
const SalesMemberModal = (props) => {
const { dispatch, actions, user, meetingList, onConfirm, getMultis, onCancel, close, rzMembers, dataToEdit } = props;
const { humanAffairs } = actions;
@ -21,7 +21,7 @@ const SalesMemberModal = (props) => {
})
setOptions(optionItems);
let lineOptions = businessLines.map((l, index) => {
let lineOptions = businessLinesConst.map((l, index) => {
return <Select.Option value={l} key={index}>
{l}
</Select.Option>

Loading…
Cancel
Save