|
@@ -6,7 +6,7 @@ import {
|
|
ScrollView,
|
|
ScrollView,
|
|
Dimensions, DeviceEventEmitter,
|
|
Dimensions, DeviceEventEmitter,
|
|
} from 'react-native';
|
|
} from 'react-native';
|
|
-import {Tabs, Provider, Button, Modal, Toast, List} from '@ant-design/react-native';
|
|
|
|
|
|
+import {Tabs, Provider, Button, Modal, Toast, List, Picker} from '@ant-design/react-native';
|
|
import {createAction} from '../../utils';
|
|
import {createAction} from '../../utils';
|
|
import {connect} from 'react-redux';
|
|
import {connect} from 'react-redux';
|
|
import CallPhone from '../../components/CallPhone';
|
|
import CallPhone from '../../components/CallPhone';
|
|
@@ -31,6 +31,10 @@ class ReviewDetail extends Component {
|
|
customer: this.props.navigation.state.params.item.id,
|
|
customer: this.props.navigation.state.params.item.id,
|
|
},
|
|
},
|
|
moreModelVisible: false,
|
|
moreModelVisible: false,
|
|
|
|
+ dispatchVisible: false,
|
|
|
|
+
|
|
|
|
+ USERS: [],
|
|
|
|
+ new_user: '',
|
|
};
|
|
};
|
|
|
|
|
|
};
|
|
};
|
|
@@ -210,9 +214,44 @@ class ReviewDetail extends Component {
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ getUsers = () => {
|
|
|
|
+ this.setState({moreModelVisible: false, dispatchVisible: true});
|
|
|
|
+ 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});
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ againDispatch = (id) => {
|
|
|
|
+ if (!this.state.new_user) {
|
|
|
|
+ Toast.info('请选择人员', 1);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.props.dispatch({
|
|
|
|
+ type: 'customer/againDispatchUser',
|
|
|
|
+ payload: {id: id, user: this.state.new_user},
|
|
|
|
+ callback: () => {
|
|
|
|
+ DeviceEventEmitter.emit('backRefesh');
|
|
|
|
+ this.props.navigation.goBack();
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+
|
|
render() {
|
|
render() {
|
|
const {reviewRecordData, reviewRecordRState, customerDetail} = this.props.customer;
|
|
const {reviewRecordData, reviewRecordRState, customerDetail} = this.props.customer;
|
|
-
|
|
|
|
|
|
+ const dispatchButtons = [
|
|
|
|
+ {text: '取消', onPress: () => this.setState({dispatchVisible: false})},
|
|
|
|
+ {text: '保存', onPress: () => this.againDispatch(customerDetail.id)},
|
|
|
|
+ ];
|
|
return (
|
|
return (
|
|
<Provider>
|
|
<Provider>
|
|
<Tabs
|
|
<Tabs
|
|
@@ -325,12 +364,37 @@ class ReviewDetail extends Component {
|
|
>添加项目</Text>
|
|
>添加项目</Text>
|
|
</List.Item>
|
|
</List.Item>
|
|
|
|
|
|
|
|
+ <List.Item>
|
|
|
|
+ <Text
|
|
|
|
+ style={styles.modalText}
|
|
|
|
+ onPress={() => this.getUsers()
|
|
|
|
+ }
|
|
|
|
+ >重新分配</Text>
|
|
|
|
+ </List.Item>
|
|
|
|
+
|
|
<List.Item onPress={() => this.setState({moreModelVisible: false})}>
|
|
<List.Item onPress={() => this.setState({moreModelVisible: false})}>
|
|
<Text style={styles.modalText}>取消</Text>
|
|
<Text style={styles.modalText}>取消</Text>
|
|
</List.Item>
|
|
</List.Item>
|
|
</List>
|
|
</List>
|
|
</View>
|
|
</View>
|
|
</Modal>
|
|
</Modal>
|
|
|
|
+ <Modal
|
|
|
|
+ transparent
|
|
|
|
+ maskClosable
|
|
|
|
+ visible={this.state.dispatchVisible}
|
|
|
|
+ footer={dispatchButtons}
|
|
|
|
+ >
|
|
|
|
+ <Picker
|
|
|
|
+ data={this.state.USERS}
|
|
|
|
+ cols={1}
|
|
|
|
+ value={this.state.new_user}
|
|
|
|
+ onChange={(val) => this.setState({new_user: val})}
|
|
|
|
+ >
|
|
|
|
+ <List.Item arrow="horizontal">
|
|
|
|
+ 选择人员
|
|
|
|
+ </List.Item>
|
|
|
|
+ </Picker>
|
|
|
|
+ </Modal>
|
|
</Provider>
|
|
</Provider>
|
|
);
|
|
);
|
|
}
|
|
}
|