|
@@ -2,6 +2,7 @@ import React, { Component } from "react";
|
|
|
import { View, Input, Button, Text, Picker } from "@tarojs/components";
|
|
|
import Taro, { getCurrentInstance } from "@tarojs/taro";
|
|
|
import {
|
|
|
+ AtSearchBar,
|
|
|
AtCheckbox,
|
|
|
AtTextarea,
|
|
|
AtModal,
|
|
@@ -9,6 +10,7 @@ import {
|
|
|
AtModalContent,
|
|
|
AtModalAction,
|
|
|
AtInput,
|
|
|
+ AtIcon,
|
|
|
} from "taro-ui";
|
|
|
import Skeleton from "taro-skeleton";
|
|
|
import {
|
|
@@ -29,6 +31,8 @@ import "taro-ui/dist/style/components/timeline.scss";
|
|
|
import "taro-ui/dist/style/components/calendar.scss"; 2
|
|
|
import "taro-ui/dist/style/components/input.scss";
|
|
|
import "taro-ui/dist/style/components/checkbox.scss";
|
|
|
+import "taro-ui/dist/style/components/search-bar.scss";
|
|
|
+
|
|
|
import MessageNoticebar from "../../components/common/messageNoticebar";
|
|
|
import { industry, channelTypeList } from '../../utils/tools/config';
|
|
|
import { getChannel } from "../../utils/tools";
|
|
@@ -59,7 +63,7 @@ class CustomerProfile extends Component {
|
|
|
this.add = this.add.bind(this);
|
|
|
this.getUserList = this.getUserList.bind(this);
|
|
|
this.getBusinessProjectByName = this.getBusinessProjectByName.bind(this);
|
|
|
-
|
|
|
+ this.onSearchChange = this.onSearchChange.bind(this);
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
@@ -213,9 +217,9 @@ class CustomerProfile extends Component {
|
|
|
})
|
|
|
}
|
|
|
// 项目列表
|
|
|
- getBusinessProjectByName() {
|
|
|
+ getBusinessProjectByName(val) {
|
|
|
getBusinessProjectByName({
|
|
|
- businessName: "",
|
|
|
+ businessName: val || "",
|
|
|
})
|
|
|
.then((v) => {
|
|
|
if (v.error.length === 0) {
|
|
@@ -241,6 +245,12 @@ class CustomerProfile extends Component {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ onSearchChange(value) {
|
|
|
+ this.setState({
|
|
|
+ value,
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
getUserList() {
|
|
|
findCustomerContacts({
|
|
|
uid: this.$instance.router.params.id,
|
|
@@ -460,7 +470,7 @@ class CustomerProfile extends Component {
|
|
|
<View className="up"
|
|
|
onClick={e => {
|
|
|
e.stopPropagation()
|
|
|
- this.getBusinessProjectByName()
|
|
|
+ this.getBusinessProjectByName("")
|
|
|
this.setState({
|
|
|
upType: 5,
|
|
|
isOpened: true,
|
|
@@ -521,7 +531,7 @@ class CustomerProfile extends Component {
|
|
|
<View className="up"
|
|
|
onClick={e => {
|
|
|
e.stopPropagation()
|
|
|
- this.getBusinessProjectByName()
|
|
|
+ this.getBusinessProjectByName("")
|
|
|
this.setState({
|
|
|
upType: 5,
|
|
|
isOpened: true,
|
|
@@ -871,6 +881,46 @@ class CustomerProfile extends Component {
|
|
|
{
|
|
|
upType == 5 &&
|
|
|
<View>
|
|
|
+ <AtSearchBar
|
|
|
+ placeholder="请输入项目名称"
|
|
|
+ showActionButton
|
|
|
+ value={this.state.value}
|
|
|
+ onChange={this.onSearchChange}
|
|
|
+ onActionClick={() => {
|
|
|
+ this.getBusinessProjectByName(this.state.value);
|
|
|
+ }}
|
|
|
+ onClear={() => {
|
|
|
+ this.setState({
|
|
|
+ value: "",
|
|
|
+ }, () => { this.getBusinessProjectByName(this.state.value) });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ {
|
|
|
+ this.state.checkOptions.length > 0 &&
|
|
|
+ <View className="selproject">
|
|
|
+ 已选择:
|
|
|
+ {
|
|
|
+ this.state.checkOptions.map((v, i) =>
|
|
|
+ <View className="selptxt" key={i}
|
|
|
+ onClick={() => {
|
|
|
+ let list = this.state.checkOptions
|
|
|
+ for (var j = 0; j < list.length; j++) {
|
|
|
+ if (list[j] == v) {
|
|
|
+ list.splice(j, 1)
|
|
|
+ this.setState({
|
|
|
+ checkOptions: list,
|
|
|
+ info: Object.assign(info, {
|
|
|
+ intendedProject: list.toString(),
|
|
|
+ }),
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ >{v} <AtIcon className='atIcon' value='close-circle' size='12' color='#fff' /></View>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ </View>
|
|
|
+ }
|
|
|
<AtCheckbox
|
|
|
options={this.state.options}
|
|
|
selectedList={this.state.checkOptions}
|