|
@@ -14,7 +14,8 @@ import {
|
|
|
AtIcon,
|
|
|
AtButton,
|
|
|
AtTag,
|
|
|
- AtRadio
|
|
|
+ AtRadio,
|
|
|
+ AtInputNumber
|
|
|
} from "taro-ui";
|
|
|
import Skeleton from "taro-skeleton";
|
|
|
import {
|
|
@@ -83,7 +84,8 @@ class CustomerProfile extends Component {
|
|
|
|
|
|
interactShow: false,
|
|
|
interactShowType: '',
|
|
|
- interactTitle: ''
|
|
|
+ interactTitle: '',
|
|
|
+ interactList: []
|
|
|
};
|
|
|
this.queryByUidAll = this.queryByUidAll.bind(this);
|
|
|
this.update = this.update.bind(this);
|
|
@@ -196,7 +198,23 @@ class CustomerProfile extends Component {
|
|
|
.then((v) => {
|
|
|
if (v.error.length === 0) {
|
|
|
this.setState({
|
|
|
- dtails: v.data
|
|
|
+ dtails: {
|
|
|
+ ...v.data,
|
|
|
+ companyCount: v.data.companyCount || 0,
|
|
|
+ socialSecurityCount: v.data.socialSecurityCount || 0,
|
|
|
+ externalInvestCount: v.data.externalInvestCount || 0,
|
|
|
+ financialRevenue: v.data.financialRevenue || 0,
|
|
|
+ financialTax: v.data.financialTax || 0,
|
|
|
+ financialProperty: v.data.financialProperty || 0,
|
|
|
+ financialRd: v.data.financialRd || 0,
|
|
|
+ earlyCommunication: '',
|
|
|
+ customerDemand: '',
|
|
|
+ interviewIdeas: '',
|
|
|
+ interviewPurpose: '',
|
|
|
+ interviewRecommend: '',
|
|
|
+ interviewFeedback: '',
|
|
|
+ followUpPlan: ''
|
|
|
+ }
|
|
|
})
|
|
|
} else {
|
|
|
setTimeout(() => {
|
|
@@ -216,6 +234,75 @@ class CustomerProfile extends Component {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ validParams(params) {
|
|
|
+ let flag = true;
|
|
|
+ let message = '';
|
|
|
+ if (!params.locationProvince) {
|
|
|
+ message = '请选择企业所在地省市区';
|
|
|
+ flag = false;
|
|
|
+ } else if (!params.industry) {
|
|
|
+ message = '请选择企业所属行业';
|
|
|
+ flag = false;
|
|
|
+ } else if (!params.businessScope) {
|
|
|
+ message = '主营产品不能为空';
|
|
|
+ flag = false;
|
|
|
+ } else if (params.companyCount === '' || params.companyCount === undefined || params.companyCount === null) {
|
|
|
+ message = '请输入母/子公司数';
|
|
|
+ flag = false;
|
|
|
+ } else if (params.socialSecurityCount === '' || params.socialSecurityCount === undefined || params.socialSecurityCount === null) {
|
|
|
+ message = '请输入社保人数';
|
|
|
+ flag = false;
|
|
|
+ } else if (params.externalInvestCount === '' || params.externalInvestCount === undefined || params.externalInvestCount === null) {
|
|
|
+ message = '请输入对外投资控股的企业数';
|
|
|
+ flag = false;
|
|
|
+ } else if (params.financialRevenue === '' || params.financialRevenue === undefined || params.financialRevenue === null) {
|
|
|
+ message = '请输入营收数据';
|
|
|
+ flag = false;
|
|
|
+ } else if (params.financialTax === '' || params.financialTax === undefined || params.financialTax === null) {
|
|
|
+ message = '请输入税收数据';
|
|
|
+ flag = false;
|
|
|
+ } else if (params.financialProperty === '' || params.financialProperty === undefined || params.financialProperty === null) {
|
|
|
+ message = '请输入资产数据';
|
|
|
+ flag = false;
|
|
|
+ } else if (params.financialRd === '' || params.financialRd === undefined || params.financialRd === null) {
|
|
|
+ message = '请输入研发费用';
|
|
|
+ flag = false;
|
|
|
+ } else if (!params.externalInvestIndustry) {
|
|
|
+ message = '请选择对外投资控股的行业';
|
|
|
+ flag = false;
|
|
|
+ } else if (!params.externalInvestName) {
|
|
|
+ message = '请选择对外投资控股的企业';
|
|
|
+ flag = false;
|
|
|
+ } else if (!params.earlyCommunication || (params.earlyCommunication && params.earlyCommunication.length < 20)) {
|
|
|
+ message = '请输入客户的难处,并且在20字以上';
|
|
|
+ flag = false;
|
|
|
+ } else if (!params.customerDemand || (params.customerDemand && params.customerDemand.length < 20)) {
|
|
|
+ message = '请输入客户的需求,并且在20字以上';
|
|
|
+ flag = false;
|
|
|
+ } else if (!params.interviewIdeas || (params.interviewIdeas && params.interviewIdeas.length < 20)) {
|
|
|
+ message = '请输入面谈思路,并且在20字以上';
|
|
|
+ flag = false;
|
|
|
+ } else if (!params.interviewPurpose || (params.interviewPurpose && params.interviewPurpose.length < 20)) {
|
|
|
+ message = '请输入面谈达成的目的,并且在20字以上';
|
|
|
+ flag = false;
|
|
|
+ } else if (!params.interviewRecommend || (params.interviewRecommend && params.interviewRecommend.length < 20)) {
|
|
|
+ message = '请输入经理/上级面谈建议,并且在20字以上';
|
|
|
+ flag = false;
|
|
|
+ } else {
|
|
|
+ if (this.state.dtails.interviewList.length) {
|
|
|
+ if (!params.interviewFeedback || (params.interviewFeedback && params.interviewFeedback.length < 20)) {
|
|
|
+ message = '请输入面谈后的反馈,并且在20字以上';
|
|
|
+ flag = false;
|
|
|
+ } else if (!params.followUpPlan || (params.followUpPlan && params.followUpPlan.length < 20)) {
|
|
|
+ message = '请输入后续跟进计划,并且在20字以上';
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return { flag, message };
|
|
|
+ }
|
|
|
+
|
|
|
onSaveAllData() {
|
|
|
const { dtails } = this.state;
|
|
|
const params = {
|
|
@@ -255,12 +342,23 @@ class CustomerProfile extends Component {
|
|
|
locationArea: dtails.locationArea,
|
|
|
locationAreaName: dtails.locationAreaName,
|
|
|
standard: dtails.standard,
|
|
|
+ businessScope: dtails.businessScope
|
|
|
};
|
|
|
for (let key in params) {
|
|
|
if (params[key] === undefined || params[key] === 'undefined' || params[key] === null || params[key] === 'null') {
|
|
|
delete params[key];
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ const { flag, message } = this.validParams(params);
|
|
|
+ if (!flag) {
|
|
|
+ Taro.showToast({
|
|
|
+ title: message,
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
updateUser(params).then((v) => {
|
|
|
if (v.error.length === 0) {
|
|
|
Taro.showToast({
|
|
@@ -521,10 +619,40 @@ class CustomerProfile extends Component {
|
|
|
|
|
|
openInteractHis(type) {
|
|
|
console.log(this.state.dtails)
|
|
|
+ let interactTitle;
|
|
|
+ let interactList = this.state.dtails.interviewList;
|
|
|
+ switch (type) {
|
|
|
+ case 'earlyCommunication':
|
|
|
+ interactTitle = '客户的难处历史记录';
|
|
|
+ break;
|
|
|
+ case 'customerDemand':
|
|
|
+ interactTitle = '客户的需求历史记录';
|
|
|
+ break;
|
|
|
+ case 'interviewIdeas':
|
|
|
+ interactTitle = '面谈思路历史记录';
|
|
|
+ break;
|
|
|
+ case 'interviewPurpose':
|
|
|
+ interactTitle = '面谈达成的目的历史记录';
|
|
|
+ break;
|
|
|
+ case 'interviewRecommend':
|
|
|
+ interactTitle = '经理/上级面谈建议历史记录';
|
|
|
+ break;
|
|
|
+ case 'interviewFeedback':
|
|
|
+ interactTitle = '面谈后反馈历史记录';
|
|
|
+ interactList = interactList.slice(1, interactList.length);
|
|
|
+ break;
|
|
|
+ case 'followUpPlan':
|
|
|
+ interactTitle = '后续跟进计划历史记录';
|
|
|
+ interactList = interactList.slice(1, interactList.length);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
this.setState({
|
|
|
interactShow: true,
|
|
|
interactShowType: type,
|
|
|
- interactTitle: '客户的难处历史记录'
|
|
|
+ interactTitle,
|
|
|
+ interactList
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -725,8 +853,10 @@ class CustomerProfile extends Component {
|
|
|
</View>
|
|
|
<View className="val" style={{ display: 'flex', alignItems: 'center' }}>
|
|
|
母/子公司数:
|
|
|
- <View style={{width: '180rpx'}}>
|
|
|
- <AtInput
|
|
|
+ <View style={{width: '120rpx'}}>
|
|
|
+ <AtInputNumber
|
|
|
+ min={0}
|
|
|
+ max={99999}
|
|
|
value={dtails.companyCount}
|
|
|
name='companyCount'
|
|
|
type='number'
|
|
@@ -741,8 +871,10 @@ class CustomerProfile extends Component {
|
|
|
</View>
|
|
|
<View className="val" style={{ display: 'flex', alignItems: 'center' }}>
|
|
|
社保人数:
|
|
|
- <View style={{width: '180rpx'}}>
|
|
|
- <AtInput
|
|
|
+ <View style={{width: '120rpx'}}>
|
|
|
+ <AtInputNumber
|
|
|
+ min={0}
|
|
|
+ max={99999}
|
|
|
value={dtails.socialSecurityCount}
|
|
|
name='socialSecurityCount'
|
|
|
type='number'
|
|
@@ -757,8 +889,10 @@ class CustomerProfile extends Component {
|
|
|
</View>
|
|
|
<View className="val" style={{ display: 'flex', alignItems: 'center' }}>
|
|
|
对外投资控股的企业数:
|
|
|
- <View style={{width: '180rpx'}}>
|
|
|
- <AtInput
|
|
|
+ <View style={{width: '120rpx'}}>
|
|
|
+ <AtInputNumber
|
|
|
+ min={0}
|
|
|
+ max={99999}
|
|
|
value={dtails.externalInvestCount}
|
|
|
name='externalInvestCount'
|
|
|
type='number'
|
|
@@ -884,8 +1018,10 @@ class CustomerProfile extends Component {
|
|
|
<View className="tit">2.财务数据</View>
|
|
|
<View className="val" style={{display: 'flex', alignItems: 'center'}}>
|
|
|
营收(万元):
|
|
|
- <View style={{width: '180rpx'}}>
|
|
|
- <AtInput
|
|
|
+ <View style={{width: '120rpx'}}>
|
|
|
+ <AtInputNumber
|
|
|
+ min={0}
|
|
|
+ max={99999}
|
|
|
value={dtails.financialRevenue}
|
|
|
name='financialRevenue'
|
|
|
type='number'
|
|
@@ -900,8 +1036,10 @@ class CustomerProfile extends Component {
|
|
|
</View>
|
|
|
<View className="val" style={{display: 'flex', alignItems: 'center'}}>
|
|
|
税收(万元):
|
|
|
- <View style={{width: '180rpx'}}>
|
|
|
- <AtInput
|
|
|
+ <View style={{width: '120rpx'}}>
|
|
|
+ <AtInputNumber
|
|
|
+ min={0}
|
|
|
+ max={99999}
|
|
|
value={dtails.financialTax}
|
|
|
name='financialTax'
|
|
|
type='number'
|
|
@@ -916,8 +1054,10 @@ class CustomerProfile extends Component {
|
|
|
</View>
|
|
|
<View className="val" style={{display: 'flex', alignItems: 'center'}}>
|
|
|
资产(万元):
|
|
|
- <View style={{width: '180rpx'}}>
|
|
|
- <AtInput
|
|
|
+ <View style={{width: '120rpx'}}>
|
|
|
+ <AtInputNumber
|
|
|
+ min={0}
|
|
|
+ max={99999}
|
|
|
value={dtails.financialProperty}
|
|
|
name='financialProperty'
|
|
|
type='number'
|
|
@@ -933,8 +1073,10 @@ class CustomerProfile extends Component {
|
|
|
</View>
|
|
|
<View className="val" style={{display: 'flex', alignItems: 'center'}}>
|
|
|
研发费用(万元):
|
|
|
- <View style={{width: '180rpx'}}>
|
|
|
- <AtInput
|
|
|
+ <View style={{width: '120rpx'}}>
|
|
|
+ <AtInputNumber
|
|
|
+ min={0}
|
|
|
+ max={99999}
|
|
|
value={dtails.financialRd}
|
|
|
name='financialRd'
|
|
|
type='number'
|
|
@@ -954,7 +1096,10 @@ class CustomerProfile extends Component {
|
|
|
客户的难处
|
|
|
<Text className="txt">(20字以上)</Text>
|
|
|
</Text>
|
|
|
- <Text onClick={() => this.openInteractHis('earlyCommunication')}>历史记录</Text>
|
|
|
+ { dtails.interviewList.length ? (
|
|
|
+ <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('earlyCommunication')}></AtIcon>
|
|
|
+ ) : null }
|
|
|
+
|
|
|
</View>
|
|
|
<View className="val">
|
|
|
<AtTextarea
|
|
@@ -973,7 +1118,10 @@ class CustomerProfile extends Component {
|
|
|
客户的需求
|
|
|
<Text className="txt">(20字以上)</Text>
|
|
|
</Text>
|
|
|
- <Text onClick={() => this.openInteractHis('customerDemand')}>历史记录</Text>
|
|
|
+ { dtails.interviewList.length ? (
|
|
|
+ <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('customerDemand')}></AtIcon>
|
|
|
+ ) : null }
|
|
|
+
|
|
|
</View>
|
|
|
<View className="val">
|
|
|
<AtTextarea
|
|
@@ -992,7 +1140,10 @@ class CustomerProfile extends Component {
|
|
|
面谈思路
|
|
|
<Text className="txt">(20字以上)</Text>
|
|
|
</Text>
|
|
|
- <Text onClick={() => this.openInteractHis('interviewIdeas')}>历史记录</Text>
|
|
|
+ { dtails.interviewList.length ? (
|
|
|
+ <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('interviewIdeas')}></AtIcon>
|
|
|
+ ) : null }
|
|
|
+
|
|
|
</View>
|
|
|
<View className="val">
|
|
|
<AtTextarea
|
|
@@ -1011,7 +1162,9 @@ class CustomerProfile extends Component {
|
|
|
面谈达成的目的
|
|
|
<Text className="txt">(20字以上)</Text>
|
|
|
</Text>
|
|
|
- <Text onClick={() => this.openInteractHis('interviewPurpose')}>历史记录</Text>
|
|
|
+ { dtails.interviewList.length ? (
|
|
|
+ <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('interviewPurpose')}></AtIcon>
|
|
|
+ ) : null }
|
|
|
</View>
|
|
|
<View className="val">
|
|
|
<AtTextarea
|
|
@@ -1030,7 +1183,9 @@ class CustomerProfile extends Component {
|
|
|
经理/上级面谈建议
|
|
|
<Text className="txt">(由经理/上级口述,本人整理,20字以上)</Text>
|
|
|
</Text>
|
|
|
- <Text onClick={() => this.openInteractHis('interviewRecommend')}>历史记录</Text>
|
|
|
+ { dtails.interviewList.length ? (
|
|
|
+ <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('interviewRecommend')}></AtIcon>
|
|
|
+ ) : null }
|
|
|
</View>
|
|
|
<View className="val">
|
|
|
<AtTextarea
|
|
@@ -1045,6 +1200,50 @@ class CustomerProfile extends Component {
|
|
|
/>
|
|
|
</View>
|
|
|
|
|
|
+ { dtails.interviewList && dtails.interviewList.length ? (
|
|
|
+ <>
|
|
|
+ <View className="tit">
|
|
|
+ <Text>
|
|
|
+ 面谈后的反馈
|
|
|
+ <Text className="txt">(20字以上)</Text>
|
|
|
+ </Text>
|
|
|
+ <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('interviewFeedback')}></AtIcon>
|
|
|
+ </View>
|
|
|
+ <View className="val">
|
|
|
+ <AtTextarea
|
|
|
+ value={dtails.interviewFeedback}
|
|
|
+ maxLength={200}
|
|
|
+ placeholder='请编写本次面谈后的反馈~'
|
|
|
+ height={70}
|
|
|
+ onChange={value => {
|
|
|
+ dtails.interviewFeedback = value;
|
|
|
+ this.setState({ dtails });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+
|
|
|
+ <View className="tit">
|
|
|
+ <Text>
|
|
|
+ 后续跟进计划
|
|
|
+ <Text className="txt">(20字以上)</Text>
|
|
|
+ </Text>
|
|
|
+ <AtIcon value='clock' size='20' color='#1E90FF' onClick={() => this.openInteractHis('followUpPlan')}></AtIcon>
|
|
|
+ </View>
|
|
|
+ <View className="val">
|
|
|
+ <AtTextarea
|
|
|
+ value={dtails.followUpPlan}
|
|
|
+ maxLength={200}
|
|
|
+ placeholder='请编写后续跟进计划~'
|
|
|
+ height={70}
|
|
|
+ onChange={value => {
|
|
|
+ dtails.followUpPlan = value;
|
|
|
+ this.setState({ dtails });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ </>
|
|
|
+ ) : null }
|
|
|
+
|
|
|
<AtButton type="primary" onClick={this.onSaveAllData.bind(this)}>保存</AtButton>
|
|
|
</View>
|
|
|
</View>
|
|
@@ -1715,7 +1914,7 @@ class CustomerProfile extends Component {
|
|
|
{/* 沟通情况历史记录 */}
|
|
|
<InteractList
|
|
|
isOpened={this.state.interactShow}
|
|
|
- list={dtails.interviewList || []}
|
|
|
+ list={this.state.interactList}
|
|
|
type={this.state.interactShowType}
|
|
|
title={this.state.interactTitle}
|
|
|
onClose={() => {
|