enterprise_see.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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 enterprise_see extends Component {
  19. constructor(props) {
  20. super(props);
  21. this.ent = this.props.route.params.enterprise;
  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. <ScrollView>
  41. <View style={public_css.body}>
  42. <View style={login_css.inputView}>
  43. <View style={[public_css.view, public_css.lineTopBottom]}>
  44. <Text
  45. style={[
  46. public_css.text,
  47. {fontFamily: 'PingFang-SC-Regular', color: '#333333'},
  48. ]}>
  49. 企业税号:
  50. </Text>
  51. <TextInput
  52. style={public_css.textInputStyle}
  53. value={this.ent.entTaxId}
  54. clearButtonMode="while-editing"
  55. secureTextEntry={false}
  56. editable={false}
  57. />
  58. </View>
  59. <View style={[public_css.view, public_css.lineTopBottom]}>
  60. <Text
  61. style={[
  62. public_css.text,
  63. {fontFamily: 'PingFang-SC-Regular', color: '#333333'},
  64. ]}>
  65. 企业名称:
  66. </Text>
  67. <TextInput
  68. style={public_css.textInputStyle}
  69. value={this.ent.entName}
  70. clearButtonMode="while-editing"
  71. secureTextEntry={false}
  72. editable={false}
  73. />
  74. </View>
  75. <View style={[public_css.view, public_css.lineTopBottom]}>
  76. <Text style={public_css.text}>企业地址:</Text>
  77. <TextInput
  78. style={public_css.textInputStyle}
  79. value={this.ent.entAddress}
  80. clearButtonMode="while-editing"
  81. secureTextEntry={false}
  82. editable={false}
  83. />
  84. </View>
  85. <View style={[public_css.view, public_css.lineTopBottom]}>
  86. <Text style={public_css.text}>企业联系人:</Text>
  87. <TextInput
  88. style={public_css.textInputStyle}
  89. value={this.ent.entContactPerson}
  90. clearButtonMode="while-editing"
  91. secureTextEntry={false}
  92. editable={false}
  93. />
  94. </View>
  95. <View style={[public_css.view, public_css.lineTopBottom]}>
  96. <Text style={public_css.text}>企业法人:</Text>
  97. <TextInput
  98. style={public_css.textInputStyle}
  99. value={this.ent.entLegelPerson}
  100. clearButtonMode="while-editing"
  101. secureTextEntry={false}
  102. editable={false}
  103. />
  104. </View>
  105. <View style={[public_css.view, public_css.lineTopBottom]}>
  106. <Text style={public_css.text}>企业税局:</Text>
  107. <TextInput
  108. style={public_css.textInputStyle}
  109. value={this.ent.entTaxOfficeCode}
  110. clearButtonMode="while-editing"
  111. secureTextEntry={false}
  112. editable={false}
  113. />
  114. </View>
  115. <View style={[public_css.view, public_css.lineTopBottom]}>
  116. <Text style={public_css.text}>企业电话:</Text>
  117. <TextInput
  118. style={public_css.textInputStyle}
  119. clearButtonMode="while-editing"
  120. secureTextEntry={false}
  121. value={this.ent.entPhone}
  122. editable={false}
  123. />
  124. </View>
  125. <View style={[public_css.view, public_css.lineTopBottom]}>
  126. <Text style={public_css.text}>企业的服务状态:</Text>
  127. <TextInput
  128. style={public_css.textInputStyle}
  129. clearButtonMode="while-editing"
  130. secureTextEntry={false}
  131. value={
  132. this.ent.serviceStatus == 1
  133. ? '待初始化'
  134. : this.ent.serviceStatus == 2
  135. ? '初始化成功'
  136. : this.ent.serviceStatus == 3
  137. ? '服务状态有效'
  138. : this.ent.serviceStatus == 4
  139. ? '欠费'
  140. : ''
  141. }
  142. editable={false}
  143. />
  144. </View>
  145. </View>
  146. </View>
  147. </ScrollView>
  148. );
  149. }
  150. componentDidMount(): void {
  151. this.getCompanyData();
  152. }
  153. getCompanyData = async () => {
  154. const res = await RetrieveData('token');
  155. if (res) {
  156. let token = res.substring(1, res.length - 1);
  157. const url = '/sys/customer/findById';
  158. GetDataPost(
  159. url,
  160. token,
  161. {
  162. customerId: this.companyId,
  163. },
  164. false,
  165. 2,
  166. ).then(res => {
  167. this.setState({
  168. customer_name: res.data.customerName,
  169. customer_code: res.data.customerCode,
  170. parent_code: res.data.parentCode,
  171. ent_tax_id: res.data.entTaxId,
  172. short_code: res.data.shortCode,
  173. email: res.data.email,
  174. address: res.data.address,
  175. contact_phone: res.data.contactPhone,
  176. bank_account: res.data.bankAccount,
  177. remark: res.data.remark,
  178. });
  179. });
  180. }
  181. };
  182. }