businFollow.jsx 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. import React from 'react';
  2. import {Form,Button,Spin,message,Modal} from 'antd';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import {getCompanyIntention ,getfllowSituation,getcustomerStatue,getContactType} from '@/tools.js';
  6. const FormItem =Form.Item;
  7. const BusinFollow =React.createClass({
  8. getInitialState(){
  9. return {
  10. loading:false
  11. }
  12. },
  13. businessFollowCancel(){
  14. this.setState({
  15. businessFollowModul:false
  16. })
  17. },
  18. componentWillReceiveProps(nextProps) {
  19. if(nextProps.data.ufbId&&nextProps.businessFollowModul){
  20. this.setState({
  21. businessFollowModul:true
  22. })
  23. this.listFollowUp(nextProps.data);
  24. }
  25. },
  26. listFollowUp(e) {
  27. $.ajax({
  28. method: "get",
  29. dataType: "json",
  30. crossDomain: false,
  31. url: globalConfig.context + "/api/admin/customer/toUpdateFollowOneBusiness",
  32. data: {
  33. ufbId: e.ufbId
  34. },
  35. success: function(data) {
  36. let thedata = data.data;
  37. if(!thedata) {
  38. if(data.error && data.error.length) {
  39. message.warning(data.error[0].message);
  40. };
  41. thedata = {};
  42. };
  43. this.setState({
  44. businessGlossoryIds: thedata.businessGlossoryId,
  45. followSituations: thedata.followSituation,
  46. customerStatuss: thedata.customerStatus,
  47. followTimes: thedata.followTime,
  48. createTimes: thedata.createTime,
  49. identifyNames: thedata.identifyName,
  50. contactTypes: parseInt(thedata.contactType),
  51. results: thedata.result,
  52. remarkss: thedata.remarks,
  53. adminNames: thedata.adminName,
  54. contactss: thedata.contacts,
  55. contactMobiles: thedata.contactMobile,
  56. ufbId: thedata.ufbId,
  57. followIds: thedata.followId,
  58. });
  59. }.bind(this),
  60. }).always(function() {
  61. this.setState({
  62. loading: false
  63. });
  64. }.bind(this));
  65. },
  66. render(){
  67. const formItemLayout = {
  68. labelCol: { span: 8 },
  69. wrapperCol: { span: 14 },
  70. };
  71. return(
  72. <Modal
  73. footer=''
  74. title="业务跟进详情"
  75. width='600px'
  76. visible={this.state.businessFollowModul}
  77. onOk={this.businessFollowCancel}
  78. onCancel={this.businessFollowCancel}
  79. >
  80. <div className="clearfix">
  81. <Form layout="horizontal" id="demand-form">
  82. <Spin spinning={this.state.loading}>
  83. <div className="clearfix">
  84. <FormItem className="half-item"
  85. {...formItemLayout}
  86. label="意向业务名称" >
  87. <span>{getCompanyIntention(this.state.businessGlossoryIds)}</span>
  88. </FormItem>
  89. <FormItem className="half-item"
  90. {...formItemLayout}
  91. label="意向时间" >
  92. <span>{this.state.createTimes}</span>
  93. </FormItem>
  94. <FormItem className="half-item"
  95. {...formItemLayout}
  96. label="客户名称" >
  97. <span>{this.state.identifyNames}</span>
  98. </FormItem>
  99. <FormItem className="half-item"
  100. {...formItemLayout}
  101. label="营销员" >
  102. <span>{this.state.adminNames}</span>
  103. </FormItem>
  104. <FormItem className="half-item"
  105. {...formItemLayout}
  106. label="意向业务进度" >
  107. <span>{getfllowSituation(this.state.followSituations)}</span>
  108. </FormItem>
  109. <FormItem className="half-item"
  110. {...formItemLayout}
  111. label="业务客户状态" >
  112. <span>{getcustomerStatue(this.state.customerStatuss)}</span>
  113. </FormItem>
  114. </div>
  115. <div className="clearfix">
  116. <FormItem className="half-item"
  117. {...formItemLayout}
  118. label="业务意向说明" >
  119. <span>{this.state.remarkss}</span>
  120. </FormItem>
  121. </div>
  122. <div className="clearfix">
  123. <div style={{fontSize:'18px',lineHeight:'30px'}}>拜访情况</div>
  124. <FormItem className="half-item"
  125. {...formItemLayout}
  126. label="拜访方式" >
  127. <span>{getContactType(this.state.contactTypes)}</span>
  128. </FormItem>
  129. <FormItem className="half-item"
  130. {...formItemLayout}
  131. label="联系人" >
  132. <span>{this.state.contactss}</span>
  133. </FormItem>
  134. <FormItem className="half-item"
  135. {...formItemLayout}
  136. label="联系电话" >
  137. <span>{this.state.contactMobiles}</span>
  138. </FormItem>
  139. <FormItem className="half-item"
  140. {...formItemLayout}
  141. label="拜访时间" >
  142. <span>{this.state.followTimes}</span>
  143. </FormItem>
  144. <FormItem className="half-item"
  145. {...formItemLayout}
  146. label="拜访人" >
  147. <span>{this.state.adminNames}</span>
  148. </FormItem>
  149. <div className="clearfix">
  150. <FormItem className="half-item"
  151. {...formItemLayout}
  152. label="拜访备注" >
  153. <span>{this.state.results}</span>
  154. </FormItem>
  155. </div>
  156. </div>
  157. </Spin>
  158. </Form>
  159. </div>
  160. </Modal>
  161. )
  162. }
  163. })
  164. export default BusinFollow;