|
@@ -7,9 +7,10 @@ import {
|
|
|
} from 'react-native';
|
|
|
import {
|
|
|
Provider,
|
|
|
+ Picker,
|
|
|
Button,
|
|
|
List,
|
|
|
- Modal,
|
|
|
+ Modal, Toast,
|
|
|
} from '@ant-design/react-native';
|
|
|
import {connect} from 'react-redux';
|
|
|
import CallPhone from '../../components/CallPhone';
|
|
@@ -20,8 +21,31 @@ class ReportCustomerDetail extends Component {
|
|
|
// 报备客户详情
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
+ this.state = {
|
|
|
+ dispatchVisible: false,
|
|
|
+ user: '',
|
|
|
+ USERS: [],
|
|
|
+ };
|
|
|
};
|
|
|
|
|
|
+ componentDidMount() {
|
|
|
+ this._fetchData();
|
|
|
+ }
|
|
|
+
|
|
|
+ _fetchData = () => {
|
|
|
+ this.props.dispatch({
|
|
|
+ type: 'customer/getUser',
|
|
|
+ callback: (data) => {
|
|
|
+ let USERS = [];
|
|
|
+ data.map((item, index) => {
|
|
|
+ USERS.push({
|
|
|
+ value: item.value, label: item.lable,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ this.setState({USERS});
|
|
|
+ },
|
|
|
+ });
|
|
|
+ };
|
|
|
onSignRepeat = (item) => {
|
|
|
Modal.alert('提醒', '确定要标记为撞单客户吗?', [
|
|
|
{
|
|
@@ -42,8 +66,28 @@ class ReportCustomerDetail extends Component {
|
|
|
]);
|
|
|
};
|
|
|
|
|
|
+ dispatch = (item) => {
|
|
|
+ if (!this.state.user) {
|
|
|
+ Toast.info('请选择人员', 1);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.props.dispatch({
|
|
|
+ type: 'customer/dispatchUser',
|
|
|
+ payload: {id: item.id, user: this.state.user},
|
|
|
+ callback: () => {
|
|
|
+ DeviceEventEmitter.emit('backRefesh');
|
|
|
+ this.props.navigation.goBack();
|
|
|
+ },
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
render() {
|
|
|
const item = this.props.navigation.state.params.item;
|
|
|
+ const dispatchButtons = [
|
|
|
+ {text: '取消', onPress: () => this.setState({dispatchVisible: false})},
|
|
|
+ {text: '保存', onPress: () => this.dispatch(item)},
|
|
|
+ ];
|
|
|
return (
|
|
|
<View style={{flex: 1, backgroundColor: '#fff'}}>
|
|
|
<Provider>
|
|
@@ -115,11 +159,7 @@ class ReportCustomerDetail extends Component {
|
|
|
<View style={{flexDirection: 'row', justifyContent: 'center', backgroundColor: '#fff'}}>
|
|
|
<Button
|
|
|
type="primary"
|
|
|
- onPress={() => this.props.navigation.navigate('WriteTrackReport',
|
|
|
- {
|
|
|
- customer_id: this.state.getParm.touch_id,
|
|
|
- backKey: this.props.navigation.state.key,
|
|
|
- })}
|
|
|
+ onPress={() => this.setState({dispatchVisible: true})}
|
|
|
style={{width: '45%', margin: 5}}
|
|
|
>
|
|
|
<Text
|
|
@@ -134,6 +174,23 @@ class ReportCustomerDetail extends Component {
|
|
|
|
|
|
</View>
|
|
|
}
|
|
|
+ <Modal
|
|
|
+ transparent
|
|
|
+ maskClosable
|
|
|
+ visible={this.state.dispatchVisible}
|
|
|
+ footer={dispatchButtons}
|
|
|
+ >
|
|
|
+ <Picker
|
|
|
+ data={this.state.USERS}
|
|
|
+ cols={1}
|
|
|
+ value={this.state.user}
|
|
|
+ onChange={(val) => this.setState({user: val})}
|
|
|
+ >
|
|
|
+ <List.Item arrow="horizontal">
|
|
|
+ 选择人员
|
|
|
+ </List.Item>
|
|
|
+ </Picker>
|
|
|
+ </Modal>
|
|
|
</Provider>
|
|
|
</View>
|
|
|
);
|