center-tab.jsx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. import React, { useState } from 'react';
  2. import { Spin, Table, Modal , message } from 'antd';
  3. import { $Axios, format } from '../../common/publish';
  4. import select_data from '../../common/ssq';
  5. import '../center-tab/center-tab.scss'
  6. const { Column, ColumnGroup } = Table;
  7. export default class centerTab extends React.Component {
  8. constructor(props) {
  9. super(props)
  10. this.state = {
  11. headTxt: '商户入网 > 商户入网列表',
  12. select_data: select_data,
  13. data: [],
  14. columns: [
  15. {
  16. title: '序号',
  17. dataIndex: 'num',
  18. key: 'num',
  19. },
  20. {
  21. title: '签约名称',
  22. dataIndex: 'signedName',
  23. key: 'signedName',
  24. },
  25. {
  26. title: '商户简称',
  27. dataIndex: 'signedShorthand',
  28. key: 'signedShorthand',
  29. },
  30. {
  31. title: '入网时间',
  32. dataIndex: 'createTime',
  33. key: 'createTime',
  34. },
  35. {
  36. title: '操作',
  37. dataIndex: 'cz',
  38. key: 'cz',
  39. row: { xxx: 'xxx' },
  40. render: (text, record, index) => <a onClick={() => this.xqClick(text, record, index)}>查看详情</a>,
  41. },
  42. ],
  43. pNo: 1,
  44. isModalVisible: false,
  45. bankCardInfo: null,
  46. baseInfo: null,
  47. merchantInfo: null,
  48. tk_data: [],
  49. tklodins: false,
  50. cityList : [],
  51. areaList : [],
  52. isModalVisibleImg : false,
  53. paginationProps: {
  54. showSizeChanger: false,//设置每页显示数据条数
  55. showQuickJumper: false,
  56. showTotal: () => `共${this.state.total}条`,
  57. pageSize: 10,
  58. total: null, //数据的总的条数
  59. onChange: (current) => this.changePage(current), //点击当前页码
  60. },
  61. lodings : true
  62. }
  63. }
  64. componentDidMount() {
  65. this.initData()
  66. }
  67. changePage(e) {
  68. this.state.params.pNo = e
  69. this.setState({
  70. current: e
  71. });
  72. this.initData();
  73. }
  74. initData() {
  75. let that_ = this;
  76. that_.setState({
  77. lodings: true
  78. })
  79. let url = '/payment/merchant.query.groovy'
  80. let params = {
  81. action: "queryList",//查询商户入网列表
  82. merchantStatus: 1, //当前固定为1 //商户状态0待激活1活动中2关闭3删除4已冻结5清退6退驻
  83. pSize: 10,//每页条数
  84. pNo: this.state.pNo, //最后一个排序号,即最后一条记录的id值
  85. queryType: 1,//用户权限 1最高权限 2商城权限 3商户权限
  86. appName: '' // queryType=2时为指定商户appname,:queryType=3时为二级商户所属上级parentAppName
  87. }
  88. $Axios('get', url, params, (res) => {
  89. let status = res.data.head.status;
  90. if (status == 200) {
  91. let data = res.data.body.list;
  92. let arr = [];
  93. data.map((item, index) => {
  94. let obj = {
  95. num: index + 1,
  96. key: item.id,
  97. name: item.name,
  98. signedName: item.signedName == '' ? '--' : item.signedName,
  99. signedShorthand: item.signedShorthand == '' ? '--' : item.signedShorthand,
  100. createTime: format(item.createTime),
  101. appName: item.appName
  102. }
  103. arr.push(obj)
  104. });
  105. let total = res.data.body.totalCount;
  106. that_.state.paginationProps.total = total
  107. that_.setState({
  108. data: arr,
  109. total: total, //数据的总的条数
  110. lodings: false
  111. })
  112. }
  113. })
  114. }
  115. xqClick = (text, record, index) => {
  116. this.queryData(record)
  117. this.setState({
  118. isModalVisible: true
  119. });
  120. }
  121. queryData(record) {
  122. let that_ = this;
  123. that_.setState({
  124. tklodins : false
  125. })
  126. let url = '/payment/merchant.query.groovy'
  127. let params = {
  128. appName: record.appName,//当前需要查询用户的 appName
  129. action: 'queryInfo' // 查询当前商户信息
  130. }
  131. $Axios('get', url, params, (res) => {
  132. let status = res.data.head.status;
  133. if (status == 200) {
  134. let bankCardInfo = JSON.parse(res.data.body.bankCardInfo);
  135. let baseInfo = JSON.parse(res.data.body.baseInfo);
  136. let merchantInfo = JSON.parse(res.data.body.merchantInfo);
  137. let certificateInfo = merchantInfo.certificateInfo;
  138. let data = [
  139. { txt: '签约类型', value: '被分账方' , type : false},
  140. { txt: '签约名称', value: baseInfo.signedName , type : false },
  141. { txt: '商户简称', value: baseInfo.signedShorthand , type : false },
  142. { txt: '商户手机号', value: baseInfo.contactPhone , type : false },
  143. { txt: '商户邮箱', value: baseInfo.contactEmail , type : false },
  144. { txt: '经营地址省', value: this.businessAddressProvince(baseInfo.businessAddressProvince,1).provinceName , type : false },
  145. { txt: '经营地址市' , value : this.businessAddressProvince(baseInfo.businessAddressCity,2).cityName , type : false},
  146. { txt: '经营地址区' , value : this.businessAddressProvince(baseInfo.businessAddressArea,3).areaName , type : false},
  147. { txt: '经营地址' , value : baseInfo.businessAddress , type : false},
  148. { txt: '业务类型' , value : this.businessClassification(baseInfo.businessClassification) , type : false},
  149. { txt: '证书类型' , value : this.cerType(baseInfo.cerType) , type : false},
  150. { txt: '签约性质' , value : this.registerRole(baseInfo.registerRole) , type : false},
  151. { txt: '法人姓名' , value : certificateInfo.legalPersonName == undefined ? '' : certificateInfo.legalPersonName , type : false},
  152. { txt: '法人职业' , value : this.profession(certificateInfo.profession) , type : false},
  153. { txt: '法人证件类型' , value : this.legalPersonIdType(certificateInfo.legalPersonIdType) , type : false},
  154. { txt: '证件号码' , value : certificateInfo.legalPersonIdNo == undefined ? '' : certificateInfo.legalPersonIdNo , type : false},
  155. { txt: '企业证件类型' , value : this.cerNoType(certificateInfo.cerNoType) , type : false},
  156. { txt: '企业资质证书编号' , value : certificateInfo.cerNo == undefined ? '' : certificateInfo.cerNo , type : false},
  157. { txt: '营业面积' , value : this.sellingArea(certificateInfo.sellingArea,1) , type : false},
  158. { txt: '公司员工规模' , value : this.sellingArea(certificateInfo.staffSize,2) , type : false},
  159. { txt: '交易场景说明' , value : this.tradingScenarios(certificateInfo.tradingScenarios == undefined ? [] : certificateInfo.tradingScenarios) , type : false},
  160. { txt: '网站网址' , value : certificateInfo.webSite == undefined ? '' : certificateInfo.webSite , type : false},
  161. { txt: '网站名称' , value : certificateInfo.webSiteName == undefined ? '' : certificateInfo.webSiteName , type : false},
  162. { txt: 'ICP备案号' , value : certificateInfo.icp == undefined ? '' : certificateInfo.icp , type : false},
  163. { txt: 'APP名称' , value : certificateInfo.appName == undefined ? '' : certificateInfo.appName , type : false},
  164. { txt: '公众号/小程序/生活号' , value : certificateInfo.wechatAppletName == undefined ? '' : certificateInfo.wechatAppletName , type : false},
  165. { txt: '营业执照照片路径' , value : certificateInfo.businessLicensePath == undefined ? '' : certificateInfo.businessLicensePath , type : true},
  166. { txt: '开户许可证照片路径' , value : certificateInfo.openAccountPath == undefined ? '' : certificateInfo.openAccountPath , type : true},
  167. { txt: '法人证件人像面路径' , value : certificateInfo.legalIdCardProsPath == undefined ? '' : certificateInfo.legalIdCardProsPath , type : true},
  168. { txt: '法人证件国徽面路径' , value : certificateInfo.legalIdCardConsPath == undefined ? '' : certificateInfo.legalIdCardConsPath , type : true},
  169. { txt: '法人手持证件影印件路径' , value : certificateInfo.holdingIdCardPath == undefined ? '' : certificateInfo.holdingIdCardPath , type : true},
  170. { txt: '商户网址截图影印件路径' , value : certificateInfo.webSitePath == undefined ? '' : certificateInfo.webSitePath , type : true},
  171. { txt: '公众号/小程序/生活号业务流程截图影印件路径 ' , value : certificateInfo.wechatAppletPath == undefined ? '' : certificateInfo.wechatAppletPath , type : true},
  172. { txt: '商户网址截图影印件路径' , value : certificateInfo.appPath == undefined ? '' : certificateInfo.appPath , type : true},
  173. { txt: '法人银行卡图影印件路径' , value : certificateInfo.legalPersonBankCardPath == undefined ? '' : certificateInfo.legalPersonBankCardPath , type : true},
  174. { txt: '其他资质文件路径' , value : certificateInfo.otherCerPath == undefined ? '' : certificateInfo.otherCerPath , type : true},
  175. { txt: '开户行' , value : this.bankCode(bankCardInfo.bankCode) , type : false},
  176. { txt: '支行名称' , value : bankCardInfo.bankBranchName == undefined ? '' : bankCardInfo.bankBranchName , type : false},
  177. { txt: '开户名称' , value : bankCardInfo.accountName == undefined ? '' : bankCardInfo.accountName , type : false},
  178. { txt: '开户账号' , value : bankCardInfo.bankCardNo == undefined ? '' : bankCardInfo.bankCardNo , type : false},
  179. { txt: '市编码' , value : bankCardInfo.cityCode == undefined ? '' : bankCardInfo.cityCode , type : false},
  180. { txt: '省编码' , value : bankCardInfo.provinceCode == undefined ? '' : bankCardInfo.provinceCode , type : false},
  181. { txt: '结算银行卡属性' , value : this.accountType(bankCardInfo.accountType,1) , type : false},
  182. { txt: '清算方式' , value : this.accountType(bankCardInfo.liquidationType,2) , type : false},
  183. { txt: '提现费率类型' , value : bankCardInfo.withdrawRateType == undefined ? '' : bankCardInfo.withdrawRateType , type : false},
  184. { txt: '提现费率' , value : bankCardInfo.withdrawRate == undefined ? '' : bankCardInfo.withdrawRate , type : false},
  185. ]
  186. that_.setState({
  187. tk_data: data,
  188. tklodins : true
  189. },function(){
  190. that_.setState({
  191. isModalVisible: true,
  192. })
  193. });
  194. }else{
  195. console.log(123)
  196. let txt = res.data.body.msg
  197. that_.setState({
  198. isModalVisible: true,
  199. })
  200. message.error(txt);
  201. }
  202. console.log(status)
  203. })
  204. }
  205. handleOk_c() {
  206. this.setState({
  207. isModalVisible: false
  208. })
  209. }
  210. bankCode(e){ //开户行反查
  211. console.log(e)
  212. let s;
  213. if(e !== '' && e !== undefined){
  214. s = this.state.select_data.contractS.find((item, index) => { return e == item.value }).txt;
  215. }
  216. return s
  217. }
  218. accountType(e,n){//结算银行卡属性反查 && 清算方式liquidationType
  219. let s;
  220. if(e !== '' && e !== undefined){
  221. if(n == 1){
  222. if(e == 'PUBLIC'){
  223. s = '对公'
  224. }else if(e == 'PRIVATE'){
  225. s = '对私'
  226. }
  227. }else{
  228. if(e == 'WITHDRAW'){
  229. s = '提现'
  230. }else if(e == 'SETTLE'){
  231. s = '结算'
  232. }
  233. }
  234. }
  235. return s
  236. }
  237. tradingScenarios(e){//交易场景说明反查
  238. let s;
  239. if(e && e.length > 0){
  240. e.map((item,index) => {
  241. s += `${item}`
  242. });
  243. }
  244. return s
  245. }
  246. sellingArea(e,n){ //营业面积与员工规模反查
  247. let s;
  248. if(e !== '' && e !== undefined){
  249. if(n == 1){
  250. if(e == 'A'){
  251. s = '500平米以上'
  252. }else if(e == 'B'){
  253. s = '200-500平米(含)'
  254. }else if(e == 'C'){
  255. s = '200平米以下'
  256. }
  257. }else{
  258. if(e == 'A'){
  259. s = '100人以上'
  260. }else if(e == 'B'){
  261. s = '50-100人(含)'
  262. }else if(e == 'C'){
  263. s = '50人以下'
  264. }
  265. }
  266. }
  267. return s
  268. }
  269. cerNoType(e){ //企业证件类型反查
  270. let s;
  271. if(e !== '' && e !== undefined){
  272. s = this.state.select_data.cerNoTypeW.find((item, index) => { return e == item.value }).txt;
  273. }
  274. return s
  275. }
  276. legalPersonIdType(e){ //法人证件类型反查
  277. let s;
  278. if(e !== '' && e !== undefined){
  279. s = this.state.select_data.certificateW.find((item, index) => { return e == item.value }).txt;
  280. }
  281. return s
  282. }
  283. legalPersonIdType(e){ //法人证件类型反查
  284. let s;
  285. if(e !== '' && e !== undefined){
  286. s = this.state.select_data.certificateW.find((item, index) => { return e == item.value }).txt;
  287. }
  288. return s
  289. }
  290. profession(e){//法人职业反查
  291. let s;
  292. if(e !== '' && e !== undefined){
  293. s = this.state.select_data.contractW.find((item, index) => { return e == item.value }).txt;
  294. }
  295. return s
  296. }
  297. registerRole(e){ //签约性质反查
  298. let s;
  299. if(e !== '' && e !== undefined){
  300. s = this.state.select_data.contract.find((item, index) => { return e == item.value }).txt;
  301. }
  302. return s
  303. }
  304. cerType(e){ //证书类型反查
  305. let s;
  306. if(e !== '' && e !== undefined){
  307. s = this.state.select_data.certificate.find((item, index) => { return e == item.value }).txt;
  308. }
  309. return s
  310. }
  311. businessClassification(e){//业务类型反查
  312. let s;
  313. if(e !== '' && e !== undefined){
  314. s = this.state.select_data.fication.find((item, index) => { return e == item.value }).txt;
  315. }
  316. return s
  317. }
  318. businessAddressProvince(e,n) { //经营地反查
  319. let provinceName,cityName,areaName,cityList,areaList;
  320. if(n == 1){
  321. provinceName = this.state.select_data.Area.find((item, index) => { return e == item.provinceCode }).provinceName;
  322. cityList = this.state.select_data.Area.find((item, index) => { return e == item.provinceCode }).mallCityList;
  323. this.setState({
  324. cityList : cityList
  325. })
  326. }
  327. if(n == 2){
  328. cityName = this.state.cityList.find((item, index) => { return e == item.cityCode }).cityName;
  329. areaList = this.state.cityList.find((item, index) => { return e == item.cityCode }).mallAreaList;
  330. this.setState({
  331. areaList : areaList
  332. })
  333. }
  334. if(n == 3){
  335. areaName = this.state.areaList.find((item, index) => { return e == item.areaCode }).areaName;
  336. }
  337. return { provinceName ,cityName ,areaName }
  338. }
  339. cktuImg(url){
  340. this.setState({
  341. isModalVisibleImg : true
  342. })
  343. console.log(url)
  344. }
  345. handleOk_img(){
  346. this.setState({
  347. isModalVisibleImg : false
  348. })
  349. }
  350. render() {
  351. const { data, columns, headTxt, isModalVisible, tk_data, tklodins ,isModalVisibleImg,paginationProps ,lodings } = this.state;
  352. return (
  353. <div className='wrap_table'>
  354. <div className='header_center'>
  355. {headTxt}
  356. </div>
  357. <div className='tables'>
  358. <Table
  359. columns={columns}
  360. dataSource={data}
  361. pagination={paginationProps}
  362. loading={lodings}
  363. />
  364. </div>
  365. <Modal title="详细信息"
  366. wrapClassName={'webs'}
  367. footer={[]}
  368. visible={isModalVisible}
  369. closable={true}
  370. onCancel={this.handleOk_c.bind(this)}
  371. >
  372. {
  373. tklodins == false && <div style={{
  374. width: '100%',
  375. height: '300px',
  376. textAlign : 'center',
  377. fontSize : '20px',
  378. color : '#ccc',
  379. lineHeight : '300px',
  380. overflow:'auto'
  381. }}>
  382. <Spin tip="加载中请稍后..."></Spin>
  383. </div>
  384. }
  385. {
  386. (tklodins == true && tk_data !== []) && <div style={{maxHeight:'300px',overflow : 'auto'}}>
  387. {tk_data.map((item, index) => (
  388. //item.type == false ? <div key={index} style={{height:'50px',lineHeight :'50px'}} value={item.value}>{item.txt} : {item.value}</div> : <div key={index} style={{height:'50px',lineHeight :'50px'}} >{item.txt} : <Button type="primary" onClick={ (e) => this.cktuImg(item.value) } >查看图片</Button></div>
  389. <div key={index} style={{height:'50px',lineHeight :'50px'}} value={item.value}>{item.txt} : {item.value}</div>
  390. ))}
  391. </div>
  392. }
  393. </Modal>
  394. <Modal title="图片详情"
  395. wrapClassName={'webs'}
  396. footer={[]}
  397. visible={isModalVisibleImg}
  398. closable={true}
  399. onCancel={this.handleOk_img.bind(this)}
  400. >
  401. <div style={{
  402. width: '100%',
  403. height: '300px',
  404. textAlign : 'center',
  405. fontSize : '20px',
  406. color : '#ccc',
  407. lineHeight : '300px',
  408. overflow:'auto'
  409. }}>
  410. <Spin tip="加载中请稍后..."></Spin>
  411. </div>
  412. </Modal>
  413. </div>
  414. )
  415. }
  416. }