|
|
@ -3,10 +3,12 @@ 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 = ['市政', '地灾', '水利', '智慧城市', '工地', '环保', '安防', '产品投标', '交通', '矿山', '产品线'] |
|
|
|
const SalesMemberModal = (props) => { |
|
|
|
const { dispatch, actions, user, meetingList, onConfirm, getMultis, onCancel, close, rzMembers, dataToEdit } = props; |
|
|
|
const { humanAffairs } = actions; |
|
|
|
const form = useRef();//表单
|
|
|
|
const [lineOptions, setLineOptions] = useState([]); |
|
|
|
const [options, setOptions] = useState([]); |
|
|
|
const [cityOptions, setCityOptions] = useState([]); |
|
|
|
const [peoplePro, setPeoplePro] = useState({}); //人员信息
|
|
|
@ -18,6 +20,14 @@ const SalesMemberModal = (props) => { |
|
|
|
</Select.Option> |
|
|
|
}) |
|
|
|
setOptions(optionItems); |
|
|
|
|
|
|
|
let lineOptions = businessLines.map((l, index) => { |
|
|
|
return <Select.Option value={l} key={index}> |
|
|
|
{l} |
|
|
|
</Select.Option> |
|
|
|
}) |
|
|
|
setLineOptions(lineOptions); |
|
|
|
|
|
|
|
if (dataToEdit) { |
|
|
|
setPeoplePro(dataToEdit); |
|
|
|
onChange(dataToEdit.provinces?.split('、') || []);//市options
|
|
|
@ -59,6 +69,7 @@ const SalesMemberModal = (props) => { |
|
|
|
if (values.userCode == peoplePro.userCode) { |
|
|
|
values.provinces = values.provinces.join('、') |
|
|
|
values.cities = values.cities.join('、') |
|
|
|
values.businessLines = values.businessLines.join('、') |
|
|
|
if (dataToEdit) { |
|
|
|
dispatch(humanAffairs.editSalesMember({ pepUserId: peoplePro.pepUserId, msg: '编辑销售人员信息', ...values })).then((res) => { |
|
|
|
if (res.success) { |
|
|
@ -163,14 +174,6 @@ const SalesMemberModal = (props) => { |
|
|
|
</div> |
|
|
|
} |
|
|
|
|
|
|
|
// const handleDeselect = (value) => {//删除
|
|
|
|
// let ranges = cityData.find(td => td.name == value)?.children || []
|
|
|
|
// if (ranges) {
|
|
|
|
// let formList = form.current.getValues().cities;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
const onClear = () => { |
|
|
|
form.current.setValue('cities', []) |
|
|
|
} |
|
|
@ -212,36 +215,36 @@ const SalesMemberModal = (props) => { |
|
|
|
placeholder='请选择销售区域(省/直辖市)' |
|
|
|
multiple filter |
|
|
|
style={{ width: '100%' }} |
|
|
|
// optionFilterProp='children'
|
|
|
|
// getPopupContainer={triggerNode => triggerNode.parentNode}
|
|
|
|
// filterOption={(input, option) => option.props.children
|
|
|
|
// .toLowerCase().indexOf(input.toLowerCase()) >= 0}
|
|
|
|
// value={selectedKeys || []}
|
|
|
|
onClear={() => onClear()} |
|
|
|
onChange={value => onChange(value)} |
|
|
|
//onDeselect={value => handleDeselect(value)}
|
|
|
|
maxTagCount={5} |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Form.Select> |
|
|
|
<Form.Select |
|
|
|
initValue={dataToEdit?.cities || []} |
|
|
|
initValue={dataToEdit?.cities ? dataToEdit?.cities?.split('、') : []} |
|
|
|
label="销售区域(市)" |
|
|
|
field='cities' |
|
|
|
showClear |
|
|
|
placeholder='请选择销售区域(市)' |
|
|
|
multiple filter |
|
|
|
style={{ width: '100%' }} |
|
|
|
// optionFilterProp='children'
|
|
|
|
// getPopupContainer={triggerNode => triggerNode.parentNode}
|
|
|
|
// filterOption={(input, option) => option.props.children
|
|
|
|
// .toLowerCase().indexOf(input.toLowerCase()) >= 0}
|
|
|
|
// value={selectedKeys || []}
|
|
|
|
//onDeselect={value => handleDeselect(value)}
|
|
|
|
maxTagCount={5} |
|
|
|
> |
|
|
|
{cityOptions} |
|
|
|
</Form.Select> |
|
|
|
<Form.Select |
|
|
|
initValue={dataToEdit?.businessLines ? dataToEdit?.businessLines?.split('、') : []} |
|
|
|
label="业务线" |
|
|
|
field='businessLines' |
|
|
|
showClear |
|
|
|
placeholder='请选择业务线' |
|
|
|
multiple filter |
|
|
|
style={{ width: '100%' }} |
|
|
|
maxTagCount={5} |
|
|
|
> |
|
|
|
{lineOptions} |
|
|
|
</Form.Select> |
|
|
|
</Form> |
|
|
|
</Modal> |
|
|
|
) |
|
|
|