customer_see.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. import React, {Component} from 'react';
  2. import {
  3. View,
  4. Text,
  5. TextInput,
  6. KeyboardAvoidingView,
  7. ScrollView,
  8. Dimensions,
  9. TouchableOpacity,
  10. Image,
  11. } from 'react-native';
  12. import login_css from '../login/login_css';
  13. import public_css from '../../source/css/public_css';
  14. import {GetDataPost} from '../../data/encryption';
  15. import {RetrieveData} from '../../data/storage';
  16. import Spinner from 'react-native-loading-spinner-overlay';
  17. import loading_css from '../../source/css/loading_css';
  18. export default class customer_see extends Component {
  19. constructor(props) {
  20. super(props);
  21. this.companyId = this.props.route.params.companyId;
  22. this.state = {
  23. customer_name: '',
  24. customer_code: '',
  25. parent_code: '',
  26. ent_tax_id: '',
  27. short_code: '',
  28. email: '',
  29. address: '',
  30. contact_phone: '',
  31. bank_account: '',
  32. remark: '',
  33. mobile: '',
  34. req_channel: '',
  35. ip: '',
  36. };
  37. }
  38. render() {
  39. return (
  40. <View style={public_css.body}>
  41. <View style={login_css.inputView}>
  42. <View style={[public_css.view, public_css.lineTopBottom]}>
  43. <Text
  44. style={[
  45. public_css.text,
  46. {fontFamily: 'PingFang-SC-Regular', color: '#333333'},
  47. ]}>
  48. *客户姓名:
  49. </Text>
  50. <TextInput
  51. style={public_css.textInputStyle}
  52. value={this.state.customer_name}
  53. clearButtonMode="while-editing"
  54. secureTextEntry={false}
  55. editable={false}
  56. />
  57. </View>
  58. <View style={[public_css.view, public_css.lineTopBottom]}>
  59. <Text
  60. style={[
  61. public_css.text,
  62. {fontFamily: 'PingFang-SC-Regular', color: '#333333'},
  63. ]}>
  64. *客户企业税号:
  65. </Text>
  66. <TextInput
  67. style={public_css.textInputStyle}
  68. value={this.state.ent_tax_id}
  69. clearButtonMode="while-editing"
  70. secureTextEntry={false}
  71. editable={false}
  72. />
  73. </View>
  74. <View style={[public_css.view, public_css.lineTopBottom]}>
  75. <Text style={public_css.text}>联系电话:</Text>
  76. <TextInput
  77. style={public_css.textInputStyle}
  78. value={this.state.contact_phone}
  79. clearButtonMode="while-editing"
  80. secureTextEntry={false}
  81. editable={false}
  82. />
  83. </View>
  84. <View style={[public_css.view, public_css.lineTopBottom]}>
  85. <Text style={public_css.text}>地址:</Text>
  86. <TextInput
  87. style={public_css.textInputStyle}
  88. value={this.state.address}
  89. clearButtonMode="while-editing"
  90. secureTextEntry={false}
  91. editable={false}
  92. multiline={true}
  93. numberOfLines={2}
  94. textAlignVertical={'top'}
  95. />
  96. </View>
  97. <View style={[public_css.view, public_css.lineTopBottom]}>
  98. <Text style={public_css.text}>银行账号:</Text>
  99. <TextInput
  100. style={public_css.textInputStyle}
  101. value={this.state.bank_account}
  102. clearButtonMode="while-editing"
  103. secureTextEntry={false}
  104. editable={false}
  105. multiline={true}
  106. numberOfLines={2}
  107. textAlignVertical={'top'}
  108. />
  109. </View>
  110. <View style={[public_css.view, public_css.lineTopBottom]}>
  111. <Text style={public_css.text}>备注:</Text>
  112. <TextInput
  113. style={public_css.textInputStyle}
  114. value={this.state.remark}
  115. clearButtonMode="while-editing"
  116. secureTextEntry={false}
  117. editable={false}
  118. />
  119. </View>
  120. <View
  121. style={{
  122. backgroundColor: '#F6F6F6',
  123. width: Dimensions.get('window').width * 0.8,
  124. height: 40,
  125. alignItems: 'center',
  126. justifyContent: 'center',
  127. }}>
  128. <Text style={{color: '#A9A9A9', fontSize: 16}}>
  129. 填写联系方式,向你同步电子发票信息
  130. </Text>
  131. </View>
  132. <View style={[public_css.view, public_css.lineTopBottom]}>
  133. <Text style={public_css.text}>*客户手机号:</Text>
  134. <TextInput
  135. style={public_css.textInputStyle}
  136. clearButtonMode="while-editing"
  137. secureTextEntry={false}
  138. value={this.state.customer_mobile}
  139. editable={false}
  140. />
  141. </View>
  142. <View style={[public_css.view, public_css.lineTopBottom]}>
  143. <Text style={public_css.text}>*邮箱:</Text>
  144. <TextInput
  145. style={public_css.textInputStyle}
  146. clearButtonMode="while-editing"
  147. secureTextEntry={false}
  148. value={this.state.email}
  149. editable={false}
  150. />
  151. </View>
  152. </View>
  153. </View>
  154. );
  155. }
  156. componentDidMount(): void {
  157. this.getCompanyData();
  158. }
  159. getCompanyData = async () => {
  160. const res = await RetrieveData('token');
  161. if (res) {
  162. let token = res.substring(1, res.length - 1);
  163. const url = 'https://app.taxbk.cn:9443/sys/customer/findById';
  164. GetDataPost(
  165. url,
  166. token,
  167. {
  168. customerId: this.companyId,
  169. },
  170. false,
  171. 2,
  172. ).then(res => {
  173. this.setState({
  174. customer_name: res.data.customerName,
  175. customer_code: res.data.customerCode,
  176. parent_code: res.data.parentCode,
  177. ent_tax_id: res.data.entTaxId,
  178. short_code: res.data.shortCode,
  179. email: res.data.email,
  180. address: res.data.address,
  181. contact_phone: res.data.contactPhone,
  182. bank_account: res.data.bankAccount,
  183. remark: res.data.remark,
  184. });
  185. });
  186. }
  187. };
  188. }