Explorar o código

增加面谈历史记录功能

雷佳斌 hai 2 meses
pai
achega
95d1269d0c

+ 38 - 0
src/pages/customerProfile/components/InteractList.jsx

@@ -0,0 +1,38 @@
+import { View } from "@tarojs/components";
+import React, { Component } from "react";
+import { AtFloatLayout, AtTimeline } from "taro-ui";
+
+import 'taro-ui/dist/style/components/float-layout.scss';
+import 'taro-ui/dist/style/components/button.scss';
+
+
+class InteractList extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+    }
+
+    this.handleClose = this.handleClose.bind(this);
+  }
+
+  handleClose() {
+    this.props.onClose();
+  }
+
+  render() {
+    const hisItems = this.props.list.map(record => {
+        return { title: record.createTime, content: [record[this.props.type] || '空'] }
+    })
+    return (
+        <AtFloatLayout isOpened={this.props.isOpened} title={this.props.title} scrollY onClose={this.handleClose}>
+            <AtTimeline 
+                pending 
+                items={hisItems}
+            >
+            </AtTimeline>
+        </AtFloatLayout>
+    )
+  }
+}
+
+export default InteractList;

+ 31 - 2
src/pages/customerProfile/index.jsx

@@ -45,7 +45,7 @@ import { getChannel } from "../../utils/tools";
 import Superior from "../../components/common/superior";
 import CheckboxPicker from "../../components/common/CheckboxPicker";
 import AddressPicker from "../../components/common/addressPicker"
-
+import InteractList from "./components/InteractList";
 
 class CustomerProfile extends Component {
   $instance = getCurrentInstance();
@@ -79,7 +79,11 @@ class CustomerProfile extends Component {
       addItemShow: false,
       addItemType: '',
       addItemTitle: '',
-      addItemInputVal: ''
+      addItemInputVal: '',
+
+      interactShow: false,
+      interactShowType: '',
+      interactTitle: ''
     };
     this.queryByUidAll = this.queryByUidAll.bind(this);
     this.update = this.update.bind(this);
@@ -515,6 +519,15 @@ class CustomerProfile extends Component {
       }
   }
 
+  openInteractHis(type) {
+      console.log(this.state.dtails)
+    this.setState({
+        interactShow: true,
+        interactShowType: type,
+        interactTitle: '客户的难处历史记录'
+    });
+  }
+
   render() {
     const { dtails, upType, info, obj, userList } = this.state;
     return (
@@ -941,6 +954,7 @@ class CustomerProfile extends Component {
                             客户的难处
                             <Text className="txt">(20字以上)</Text>
                             </Text>
+                            <Text onClick={() => this.openInteractHis('earlyCommunication')}>历史记录</Text>
                         </View>
                         <View className="val">
                             <AtTextarea
@@ -959,6 +973,7 @@ class CustomerProfile extends Component {
                             客户的需求
                             <Text className="txt">(20字以上)</Text>
                             </Text>
+                            <Text onClick={() => this.openInteractHis('customerDemand')}>历史记录</Text>
                         </View>
                         <View className="val">
                             <AtTextarea
@@ -977,6 +992,7 @@ class CustomerProfile extends Component {
                             面谈思路
                             <Text className="txt">(20字以上)</Text>
                             </Text>
+                            <Text onClick={() => this.openInteractHis('interviewIdeas')}>历史记录</Text>
                         </View>
                         <View className="val">
                             <AtTextarea
@@ -995,6 +1011,7 @@ class CustomerProfile extends Component {
                             面谈达成的目的
                             <Text className="txt">(20字以上)</Text>
                             </Text>
+                            <Text onClick={() => this.openInteractHis('interviewPurpose')}>历史记录</Text>
                         </View>
                         <View className="val">
                             <AtTextarea
@@ -1013,6 +1030,7 @@ class CustomerProfile extends Component {
                             经理/上级面谈建议
                             <Text className="txt">(由经理/上级口述,本人整理,20字以上)</Text>
                             </Text>
+                            <Text onClick={() => this.openInteractHis('interviewRecommend')}>历史记录</Text>
                         </View>
                         <View className="val">
                             <AtTextarea
@@ -1693,6 +1711,17 @@ class CustomerProfile extends Component {
             onClose={() => {this.setState({multiplePickerShow: false})}}
             onConfirm={this.handleMultipleConfirm}
         ></CheckboxPicker>
+
+        {/* 沟通情况历史记录 */}
+        <InteractList
+            isOpened={this.state.interactShow}
+            list={dtails.interviewList || []}
+            type={this.state.interactShowType}
+            title={this.state.interactTitle}
+            onClose={() => {
+                this.setState({ interactShow: false })
+            }}
+        />
       </View>
     );
   }