|
@@ -33,7 +33,8 @@ import "taro-ui/dist/style/components/search-bar.scss";
|
|
|
import "taro-ui/dist/style/components/checkbox.scss";
|
|
|
|
|
|
import MessageNoticebar from "../../components/common/messageNoticebar";
|
|
|
-import AddressPicker from "../../components/common/addressPicker"
|
|
|
+import AddressPicker from "../../components/common/addressPicker";
|
|
|
+import CustomNatureSelect from "../../components/common/CustomNatureSelect";
|
|
|
|
|
|
class AddEnterprise extends Component {
|
|
|
$instance = getCurrentInstance();
|
|
@@ -58,6 +59,55 @@ class AddEnterprise extends Component {
|
|
|
],
|
|
|
channe: "",
|
|
|
selChannelType: 0,
|
|
|
+ levelList: [
|
|
|
+ { id: 0, title: "一般客户(一年以上预签)" },
|
|
|
+ { id: 1, title: "意向客户(半年内预签)" },
|
|
|
+ { id: 2, title: "重点客户(一个月内预签)" },
|
|
|
+ ],
|
|
|
+ naturePickerShow: false,
|
|
|
+ // natureOptions1: [{
|
|
|
+ // id: 1,
|
|
|
+ // title: "政府机构"
|
|
|
+ // }, {
|
|
|
+ // id: 2,
|
|
|
+ // title: "科研院所"
|
|
|
+ // }, {
|
|
|
+ // id: 3,
|
|
|
+ // title: "高等院校"
|
|
|
+ // }, {
|
|
|
+ // id: 4,
|
|
|
+ // title: "社会团体"
|
|
|
+ // }, {
|
|
|
+ // id: 5,
|
|
|
+ // title: "企业"
|
|
|
+ // }, {
|
|
|
+ // id: 0,
|
|
|
+ // title: "其他组织"
|
|
|
+ // }],
|
|
|
+ // natureOptions2: [{
|
|
|
+ // id: 1,
|
|
|
+ // title: "国企"
|
|
|
+ // }, {
|
|
|
+ // id: 2,
|
|
|
+ // title: "央企"
|
|
|
+ // }, {
|
|
|
+ // id: 3,
|
|
|
+ // title: "私企"
|
|
|
+ // }, {
|
|
|
+ // id: 4,
|
|
|
+ // title: "合资企业(含港澳台)"
|
|
|
+ // }, {
|
|
|
+ // id: 5,
|
|
|
+ // title: "外资控股"
|
|
|
+ // }],
|
|
|
+ // natureOptions3: [{
|
|
|
+ // id: 1,
|
|
|
+ // title: "上市公司",
|
|
|
+ // }, {
|
|
|
+ // id: 0,
|
|
|
+ // title: "非上市公司",
|
|
|
+ // }],
|
|
|
+ // natureList: []
|
|
|
};
|
|
|
this.checkUserName = this.checkUserName.bind(this);
|
|
|
this.onSearchChange = this.onSearchChange.bind(this);
|
|
@@ -66,7 +116,6 @@ class AddEnterprise extends Component {
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
|
-
|
|
|
}
|
|
|
|
|
|
componentDidShow() {
|
|
@@ -212,14 +261,47 @@ class AddEnterprise extends Component {
|
|
|
Taro.showToast({ title: "请选择意向合作项目", icon: "none" });
|
|
|
return
|
|
|
}
|
|
|
+ console.log(info.level)
|
|
|
+ if (info.level === undefined || info.level === null) {
|
|
|
+ Taro.showToast({ title: "请选择客户类型", icon: "none" });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!info.nature) {
|
|
|
+ Taro.showToast({ title: "请选择客户性质", icon: "none" });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (info.nature && info.nature[0] == 0 && !info.natureOther) {
|
|
|
+ Taro.showToast({ title: "请输入其他说明", icon: "none" });
|
|
|
+ return
|
|
|
+ }
|
|
|
info.societyTag = '0'
|
|
|
info.type = '1'
|
|
|
let addList = getProvince(info.province, info.city, info.area)
|
|
|
+
|
|
|
+ let enterpriseNature = undefined; // 企业性质 0=其他,1=国企,2=央企,3=私企,4=合资企业(含港澳台),5=外资控股
|
|
|
+ let listedNature = undefined; // 上市 0=否,1=是
|
|
|
+ if (info.nature.length >= 2) {
|
|
|
+ enterpriseNature = info.nature[1];
|
|
|
+ }
|
|
|
+ if (info.nature.length >= 3) {
|
|
|
+ listedNature = info.nature[2];
|
|
|
+ }
|
|
|
+
|
|
|
+ let params = { ...this.state.info };
|
|
|
+ params.nature = params.nature[0];
|
|
|
+ if(enterpriseNature) {
|
|
|
+ params.enterpriseNature = enterpriseNature;
|
|
|
+ }
|
|
|
+ if (listedNature) {
|
|
|
+ params.listedNature = listedNature;
|
|
|
+ }
|
|
|
+ delete params.natureName;
|
|
|
+
|
|
|
Taro.showLoading({
|
|
|
title: '保存中...',
|
|
|
})
|
|
|
addCustomer({
|
|
|
- ...info,
|
|
|
+ ...params,
|
|
|
...{
|
|
|
province: addList[0],
|
|
|
city: addList[1],
|
|
@@ -343,6 +425,18 @@ class AddEnterprise extends Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ handleNatureToggleShow(e, params) {
|
|
|
+ if (params) {
|
|
|
+ const { info } = this.state;
|
|
|
+ info.nature = e.id;
|
|
|
+ info.natureName = e.name.join('\/');
|
|
|
+ console.log(info)
|
|
|
+ this.setState({ info, naturePickerShow: false });
|
|
|
+ } else {
|
|
|
+ this.setState({ naturePickerShow: false });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
render() {
|
|
|
const { info, isOpened, pickerShow, isProject, checkOptions, channelTypeList, channe } = this.state;
|
|
|
return (
|
|
@@ -477,6 +571,71 @@ class AddEnterprise extends Component {
|
|
|
}}>{!!info.intendedProject ? info.intendedProject : "点击选择"}</View>
|
|
|
</View>
|
|
|
|
|
|
+ <View className="aitem">
|
|
|
+ <View className="atit">
|
|
|
+ <Text className="atip">*</Text>
|
|
|
+ 客户类型
|
|
|
+ </View>
|
|
|
+ <Picker
|
|
|
+ value={this.state.level}
|
|
|
+ range={this.state.levelList} rangeKey='title' mode='selector'
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({
|
|
|
+ levelName: this.state.levelList[e.detail.value].title,
|
|
|
+ level: e.detail.value,
|
|
|
+ info: Object.assign(info, {
|
|
|
+ level: Number(e.target.value),
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }}>
|
|
|
+ <View className={!!this.state.level ? "avals" : "aval"} style={{ width: "233px" }}>
|
|
|
+ {!!this.state.levelName ? this.state.levelName : "请选择"}
|
|
|
+ </View>
|
|
|
+ </Picker>
|
|
|
+ </View>
|
|
|
+
|
|
|
+ <View className="aitem">
|
|
|
+ <View className="atit">
|
|
|
+ <Text className="atip">*</Text>
|
|
|
+ 客户性质
|
|
|
+ </View>
|
|
|
+
|
|
|
+ <View className={!!info.natureName ? "avals" : "aval"} onClick={() => {
|
|
|
+ this.setState({ naturePickerShow: true }, () => {
|
|
|
+ console.log(this.state.naturePickerShow)
|
|
|
+ })
|
|
|
+ }}>
|
|
|
+ {!!info.natureName ? info.natureName : "点击选择"}
|
|
|
+ </View>
|
|
|
+ <CustomNatureSelect
|
|
|
+ pickerShow={this.state.naturePickerShow}
|
|
|
+ onHandleToggleShow={this.handleNatureToggleShow.bind(this)}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+
|
|
|
+ { info.nature && info.nature[0] == 0 ? (
|
|
|
+ <View className="aitem" style={{ alignItems: "flex-start" }}>
|
|
|
+ <View className="atit">
|
|
|
+ <Text className="atip">*</Text>
|
|
|
+ 其他说明
|
|
|
+ </View>
|
|
|
+ <View className="avals">
|
|
|
+ <AtTextarea
|
|
|
+ value={info.natureOther}
|
|
|
+ onChange={e => {
|
|
|
+ this.setState({
|
|
|
+ info: Object.assign(info, {
|
|
|
+ natureOther: e
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ maxLength={200}
|
|
|
+ placeholder='请输入其他说明'
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ ) : null}
|
|
|
+
|
|
|
<View className="bottom">
|
|
|
<AtButton type='primary' onClick={this.submit}>保存</AtButton>
|
|
|
{/* <AtButton type='secondary' size='small'>取消</AtButton> */}
|