|
@@ -27,6 +27,9 @@ import {
|
|
|
updateMainContact,
|
|
|
limitUser,
|
|
|
getBusinessProjectByName,
|
|
|
+ addProject,
|
|
|
+ queryProjectList,
|
|
|
+ delProject
|
|
|
} from "../../utils/servers/servers";
|
|
|
import "./index.less";
|
|
|
|
|
@@ -41,7 +44,7 @@ import "taro-ui/dist/style/components/search-bar.scss";
|
|
|
import "taro-ui/dist/style/components/tag.scss";
|
|
|
|
|
|
import MessageNoticebar from "../../components/common/messageNoticebar";
|
|
|
-import { industry, channelTypeList } from '../../utils/tools/config';
|
|
|
+import { industry, channelTypeList, yearList } from '../../utils/tools/config';
|
|
|
import { getChannel } from "../../utils/tools";
|
|
|
import Superior from "../../components/common/superior";
|
|
|
import CheckboxPicker from "../../components/common/CheckboxPicker";
|
|
@@ -57,12 +60,15 @@ class CustomerProfile extends Component {
|
|
|
upType: -1,
|
|
|
isOpened: false,
|
|
|
dtails: {},
|
|
|
+ projectList: [],
|
|
|
info: {},
|
|
|
sector: {},
|
|
|
isAdd: false,
|
|
|
obj: {},
|
|
|
userList: [],
|
|
|
+ allProjectList: [],
|
|
|
options: [],
|
|
|
+ checkProject: [],
|
|
|
checkOptions: [],
|
|
|
isSuperior: false,
|
|
|
channe: {},
|
|
@@ -104,6 +110,7 @@ class CustomerProfile extends Component {
|
|
|
isMask: false
|
|
|
})
|
|
|
this.queryByUidAll();
|
|
|
+ this.getProjectList();
|
|
|
if (!this.isLogin()) {
|
|
|
Taro.setStorageSync('currentPage', `/pages/customerProfile/index?id=${this.$instance.router.params.id}`)
|
|
|
}
|
|
@@ -125,7 +132,7 @@ class CustomerProfile extends Component {
|
|
|
let multiplePickerOptions = [];
|
|
|
let multiplePickerTitle = '';
|
|
|
let multiplePickerCheckedList = [];
|
|
|
- const { dtails } = this.state;
|
|
|
+ const { dtails, info } = this.state;
|
|
|
switch (type) {
|
|
|
case 'industry':
|
|
|
// 企业所属行业
|
|
@@ -138,10 +145,23 @@ class CustomerProfile extends Component {
|
|
|
multiplePickerOptions = industry;
|
|
|
multiplePickerCheckedList = !!dtails.externalInvestIndustry ? dtails.externalInvestIndustry.toString().split(',') : [];
|
|
|
multiplePickerTitle = '请选择对外投资控股的行业';
|
|
|
- break;
|
|
|
+ break;
|
|
|
+ case 'examineStatusOther':
|
|
|
+ // 复审年份
|
|
|
+ multiplePickerOptions = yearList;
|
|
|
+ multiplePickerCheckedList = info.examineStatusOther ? info.examineStatusOther.split(',') : [];
|
|
|
+ multiplePickerTitle = '请选择年份';
|
|
|
+ break;
|
|
|
+ case 'buyStatusOther':
|
|
|
+ // 复购/复审年份
|
|
|
+ multiplePickerOptions = yearList;
|
|
|
+ multiplePickerCheckedList = info.buyStatusOther ? info.buyStatusOther.split(',') : [];
|
|
|
+ multiplePickerTitle = '请选择年份';
|
|
|
+ break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
+
|
|
|
this.setState({
|
|
|
multiplePickerShow: true,
|
|
|
multiplePickerType: type,
|
|
@@ -152,26 +172,35 @@ class CustomerProfile extends Component {
|
|
|
}
|
|
|
|
|
|
handleMultipleConfirm(selectedIds, selectedLabels) {
|
|
|
- const { multiplePickerType, dtails } = this.state;
|
|
|
+ const { multiplePickerType, dtails, info } = this.state;
|
|
|
switch (multiplePickerType) {
|
|
|
case "industry":
|
|
|
// 企业所属行业
|
|
|
dtails.industry = selectedIds.join(',');
|
|
|
dtails.industryName = selectedLabels.join('、');
|
|
|
+ this.setState({ dtails })
|
|
|
break;
|
|
|
case "externalInvestIndustry":
|
|
|
// 对外投资控股的行业
|
|
|
dtails.externalInvestIndustry = selectedIds.join(',');
|
|
|
dtails.externalInvestIndustryName = selectedLabels.join('、');
|
|
|
+ this.setState({ dtails })
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 'examineStatusOther':
|
|
|
+ info.examineStatusOther = selectedIds.join(',');
|
|
|
+ this.setState({ info });
|
|
|
+ break;
|
|
|
+ case 'buyStatusOther':
|
|
|
+ info.buyStatusOther = selectedIds.join(',');
|
|
|
+ this.setState({ info });
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
- this.setState({ dtails })
|
|
|
}
|
|
|
|
|
|
bindRegionChange (e) {
|
|
|
- console.log('picker发送选择改变,携带值为', e.detail.value)
|
|
|
this.setState({
|
|
|
region: e.detail.value
|
|
|
})
|
|
@@ -446,8 +475,104 @@ class CustomerProfile extends Component {
|
|
|
// }).catch(() => {
|
|
|
|
|
|
// })
|
|
|
- this.setState({ isOpened: false, dtails: { ...this.state.dtails, ...this.state.info } })
|
|
|
+ if (this.state.upType == 5) {
|
|
|
+ this.postAddProject();
|
|
|
+ } else {
|
|
|
+ this.setState({ isOpened: false, dtails: { ...this.state.dtails, ...this.state.info } })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ postAddProject() {
|
|
|
+ const { checkProject, dtails, info } = this.state;
|
|
|
+ const params = { uid: dtails.id };
|
|
|
+ if (!checkProject.length) {
|
|
|
+ Taro.showToast({
|
|
|
+ title: "请选择要添加的项目",
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ params.pid = checkProject[0].id;
|
|
|
+ if (checkProject[0].cSort == 9) {
|
|
|
+ if (!info.examineStatus) {
|
|
|
+ Taro.showToast({
|
|
|
+ title: "请选择审核状态",
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ } else if (info.examineStatus == 2 && !info.examineStatusOther) {
|
|
|
+ Taro.showToast({
|
|
|
+ title: "请选择复审年份",
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ params.examineStatus = info.examineStatus;
|
|
|
+ params.examineStatusOther = info.examineStatus == 2 ? info.examineStatusOther : '';
|
|
|
+ }
|
|
|
+ } else if (checkProject[0].cSort == 6) {
|
|
|
+ if (!info.buyStatus) {
|
|
|
+ Taro.showToast({
|
|
|
+ title: "请选择复购状态",
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ } else if (info.buyStatus == 2 && !info.buyStatusOther) {
|
|
|
+ Taro.showToast({
|
|
|
+ title: "请选择复购/复审年份",
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ params.buyStatus = info.buyStatus;
|
|
|
+ params.buyStatusOther = info.buyStatus == 2 ? info.buyStatusOther : '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ addProject(params).then(res => {
|
|
|
+ if (res.error.length == 0) {
|
|
|
+ Taro.showToast({
|
|
|
+ title: "项目新增成功!",
|
|
|
+ });
|
|
|
+ this.setState({ isOpened: false })
|
|
|
+ this.getProjectList();
|
|
|
+ } else {
|
|
|
+ Taro.showToast({
|
|
|
+ title: v.error[0].message,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取项目列表
|
|
|
+ * @param {*} uid 客户编号
|
|
|
+ */
|
|
|
+ getProjectList(uid) {
|
|
|
+ const params = { uid: this.$instance.router.params.id, pageNo: 1, pageSize: 9999 }
|
|
|
+ queryProjectList(params).then(res => {
|
|
|
+ if (!res.error.length) {
|
|
|
+ this.setState({ projectList: res.data.list });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ handleDelProject(data) {
|
|
|
+ delProject(data.id, data).then(res => {
|
|
|
+ if (!res.error.length) {
|
|
|
+ Taro.showToast({
|
|
|
+ title: "删除成功!",
|
|
|
+ });
|
|
|
+ this.getProjectList();
|
|
|
+ } else {
|
|
|
+ Taro.showToast({
|
|
|
+ title: v.error[0].message,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
+
|
|
|
// 新建联系人
|
|
|
add() {
|
|
|
let data = this.state.obj
|
|
@@ -500,12 +625,13 @@ class CustomerProfile extends Component {
|
|
|
for (let i = 0; i < v.data.length; i++) {
|
|
|
let thisdata = v.data[i];
|
|
|
theArr.push({
|
|
|
- value: thisdata.bname,
|
|
|
+ value: thisdata.id,
|
|
|
label: thisdata.bname,
|
|
|
});
|
|
|
};
|
|
|
}
|
|
|
this.setState({
|
|
|
+ allProjectList: v.data,
|
|
|
options: theArr
|
|
|
})
|
|
|
} else {
|
|
@@ -618,7 +744,6 @@ class CustomerProfile extends Component {
|
|
|
}
|
|
|
|
|
|
openInteractHis(type) {
|
|
|
- console.log(this.state.dtails)
|
|
|
let interactTitle;
|
|
|
let interactList = this.state.dtails.interviewList;
|
|
|
switch (type) {
|
|
@@ -656,6 +781,26 @@ class CustomerProfile extends Component {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ renderProjectItemName(data) {
|
|
|
+ let name = data.name;
|
|
|
+ if (!!data.buyStatus) {
|
|
|
+ // 会员项目
|
|
|
+ if (data.buyStatus == 1) {
|
|
|
+ name = name + `(新购)`;
|
|
|
+ } else if (data.buyStatus == 2) {} {
|
|
|
+ name = name + `(复购${data.buyStatusOther})`;
|
|
|
+ }
|
|
|
+ } else if (!!data.examineStatus) {
|
|
|
+ // 高新项目
|
|
|
+ if (data.examineStatus == 1) {
|
|
|
+ name = name + `(初次审核)`;
|
|
|
+ } else if (data.examineStatus == 2) {
|
|
|
+ name = name + `(${data.examineStatusOther}年复审)`;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return name;
|
|
|
+ }
|
|
|
+
|
|
|
render() {
|
|
|
const { dtails, upType, info, obj, userList } = this.state;
|
|
|
return (
|
|
@@ -968,13 +1113,22 @@ class CustomerProfile extends Component {
|
|
|
uid: this.$instance.router.params.id,
|
|
|
intendedProject: dtails.intendedProject,
|
|
|
},
|
|
|
- checkOptions: !!dtails.intendedProject ? dtails.intendedProject.split(",") : []
|
|
|
+ checkOptions: []
|
|
|
})
|
|
|
}}
|
|
|
>新增</View>
|
|
|
}
|
|
|
</View>
|
|
|
- <View className="val">{dtails.intendedProject || "无"}</View>
|
|
|
+ <View className="val">{
|
|
|
+ this.state.projectList.map(item => {
|
|
|
+ return <View style={{ display: 'flex', alignItems: 'center' }}>
|
|
|
+ <Text style={{ fontSize: '30rpx' }} style={{marginRight: '10rpx'}}>
|
|
|
+ { this.renderProjectItemName(item) }
|
|
|
+ </Text>
|
|
|
+ <AtIcon value="close" size='15' color="#f00" onClick={() => {this.handleDelProject(item)}} />
|
|
|
+ </View>
|
|
|
+ })
|
|
|
+ }</View>
|
|
|
|
|
|
<View style={{marginTop: '60rpx'}}>
|
|
|
<View className="title">面谈已知企业情况</View>
|
|
@@ -1464,7 +1618,9 @@ class CustomerProfile extends Component {
|
|
|
isOpened={this.state.isOpened}
|
|
|
onClose={() => {
|
|
|
this.setState({
|
|
|
- isOpened: false
|
|
|
+ isOpened: false,
|
|
|
+ checkProject: [],
|
|
|
+ checkOptions: []
|
|
|
})
|
|
|
}}
|
|
|
>
|
|
@@ -1661,7 +1817,7 @@ class CustomerProfile extends Component {
|
|
|
}, () => { this.getBusinessProjectByName(this.state.value) });
|
|
|
}}
|
|
|
/>
|
|
|
- {
|
|
|
+ {/* {
|
|
|
this.state.checkOptions.length > 0 &&
|
|
|
<View className="selproject">
|
|
|
已选择:
|
|
@@ -1686,8 +1842,8 @@ class CustomerProfile extends Component {
|
|
|
)
|
|
|
}
|
|
|
</View>
|
|
|
- }
|
|
|
- <AtCheckbox
|
|
|
+ } */}
|
|
|
+ {/* <AtCheckbox
|
|
|
options={this.state.options}
|
|
|
selectedList={this.state.checkOptions}
|
|
|
onChange={e => {
|
|
@@ -1698,7 +1854,66 @@ class CustomerProfile extends Component {
|
|
|
}),
|
|
|
})
|
|
|
}}
|
|
|
- />
|
|
|
+ /> */}
|
|
|
+
|
|
|
+ {/* 高新项目 */}
|
|
|
+ { this.state.checkProject.length && this.state.checkProject[0].cSort == 9 ? <View style={{backgroundColor: '#eee', padding: '20rpx 24rpx', margin: '24rpx'}}>
|
|
|
+ <RadioGroup onChange={e => {
|
|
|
+ const { info } = this.state;
|
|
|
+ info.examineStatus = e.target.value;
|
|
|
+ this.setState({ info });
|
|
|
+ }}>
|
|
|
+ <Label className='radio-list__label'>
|
|
|
+ <Radio className='radio-list__radio' checked={info.examineStatus == 1} value={1}>初次审核</Radio>
|
|
|
+ </Label>
|
|
|
+ <Label className='radio-list__label'>
|
|
|
+ <Radio className='radio-list__radio' checked={info.examineStatus == 2} value={2}>复审</Radio>
|
|
|
+ </Label>
|
|
|
+ </RadioGroup>
|
|
|
+ { this.state.info.examineStatus == 2 && <View>
|
|
|
+ <Text>复审年份:</Text>
|
|
|
+ <Text style={{textDecoration: 'underline'}} onClick={() => this.handleOpenMultiplePicker('examineStatusOther')}>{ info.examineStatusOther || '请选择' }</Text>
|
|
|
+ </View> }
|
|
|
+ </View> : null}
|
|
|
+
|
|
|
+ {/* 会员项目 */}
|
|
|
+ { this.state.checkProject.length && this.state.checkProject[0].cSort == 6 ? <View style={{backgroundColor: '#eee', padding: '20rpx 24rpx', margin: '24rpx'}}>
|
|
|
+ <RadioGroup onChange={e => {
|
|
|
+ const { info } = this.state;
|
|
|
+ info.buyStatus = e.target.value;
|
|
|
+ this.setState({ info });
|
|
|
+ }}>
|
|
|
+ <Label className='radio-list__label'>
|
|
|
+ <Radio className='radio-list__radio' checked={info.buyStatus == 1} value={1}>新购</Radio>
|
|
|
+ </Label>
|
|
|
+ <Label className='radio-list__label'>
|
|
|
+ <Radio className='radio-list__radio' checked={info.buyStatus == 2} value={2}>复购/复审</Radio>
|
|
|
+ </Label>
|
|
|
+ </RadioGroup>
|
|
|
+ { this.state.info.buyStatus == 2 && <View>
|
|
|
+ <Text>复购/复审年份:</Text>
|
|
|
+ <Text style={{textDecoration: 'underline'}} onClick={() => this.handleOpenMultiplePicker('buyStatusOther')}>{ info.buyStatusOther || '请选择' }</Text>
|
|
|
+ </View> }
|
|
|
+ </View> : null}
|
|
|
+
|
|
|
+
|
|
|
+ { this.state.isOpened && <RadioGroup onChange={e => {
|
|
|
+ let currProject = this.state.allProjectList.find(item => item.id == e.target.value);
|
|
|
+ this.setState({
|
|
|
+ checkOptions: [e.target.value],
|
|
|
+ checkProject: [currProject]
|
|
|
+ });
|
|
|
+ }}>
|
|
|
+ {this.state.options.map((item, i) => {
|
|
|
+ return (
|
|
|
+ <View>
|
|
|
+ <Label className='radio-list__label' for={i} key={i}>
|
|
|
+ <Radio className='radio-list__radio' value={item.value} checked={this.state.checkOptions.indexOf(item.value) > -1}>{item.label}</Radio>
|
|
|
+ </Label>
|
|
|
+ </View>
|
|
|
+ )
|
|
|
+ })}
|
|
|
+ </RadioGroup>}
|
|
|
</View>
|
|
|
}
|
|
|
{
|
|
@@ -1773,7 +1988,13 @@ class CustomerProfile extends Component {
|
|
|
}
|
|
|
</AtModalContent>
|
|
|
<AtModalAction>
|
|
|
- <Button type='secondary' onClick={() => { this.setState({ isOpened: false }) }}>取消</Button>
|
|
|
+ <Button type='secondary' onClick={() => {
|
|
|
+ this.setState({
|
|
|
+ isOpened: false,
|
|
|
+ checkOptions: [],
|
|
|
+ checkProject: []
|
|
|
+ })
|
|
|
+ }}>取消</Button>
|
|
|
<Button type='primary' onClick={this.update}>确定修改</Button>
|
|
|
</AtModalAction>
|
|
|
</AtModal>
|
|
@@ -1871,7 +2092,7 @@ class CustomerProfile extends Component {
|
|
|
<Button type='secondary'
|
|
|
onClick={() => {
|
|
|
this.setState({
|
|
|
- isAdd: false
|
|
|
+ isAdd: false,
|
|
|
}, () => {
|
|
|
this.queryByUidAll()
|
|
|
})
|
|
@@ -1901,6 +2122,28 @@ class CustomerProfile extends Component {
|
|
|
</AtModalAction>
|
|
|
</AtModal>
|
|
|
|
|
|
+ {/* 新增项目 */}
|
|
|
+ <AtModal
|
|
|
+ isOpened={this.state.addProjectShow}
|
|
|
+ onClose={this.handleCloseAddItemDialog}
|
|
|
+ >
|
|
|
+ <AtModalHeader>新增对外投资控股的企业</AtModalHeader>
|
|
|
+ <AtModalContent>
|
|
|
+ <AtInput
|
|
|
+ required
|
|
|
+ name='mobile'
|
|
|
+ title='企业名称'
|
|
|
+ placeholder='请输入企业名称'
|
|
|
+ value={this.state.addItemInputVal}
|
|
|
+ onChange={value => this.setState({ addItemInputVal: value })}
|
|
|
+ />
|
|
|
+ </AtModalContent>
|
|
|
+ <AtModalAction>
|
|
|
+ <Button type='secondary' onClick={this.handleCloseAddItemDialog}>取消</Button>
|
|
|
+ <Button type='primary' onClick={this.handleAddItemSave}>保存</Button>
|
|
|
+ </AtModalAction>
|
|
|
+ </AtModal>
|
|
|
+
|
|
|
{/* 多选框 */}
|
|
|
<CheckboxPicker
|
|
|
isOpened={this.state.multiplePickerShow}
|