managementDetaile.2.jsx 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. import React from 'react';
  2. import { Icon, Table, Modal, message, Spin, Input, Select, Button, Form ,Upload,Popconfirm,AutoComplete} from 'antd';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import '../../userMangagement.less';
  6. import {getApprovedState,getPaymentState,getOrderState,getProjectState,getOrderChannel,getOrderType,getTransactionProject,getTransactionChannel} from '../../../../tools.js';
  7. import AdminCustomerStatistics from '../../../customer/customerManagement/adminCustomerStatistics.jsx'
  8. const ManagementDetaile = Form.create()(React.createClass({
  9. loadData(record) {
  10. this.state.data = [];
  11. this.setState({
  12. loading: true
  13. });
  14. $.ajax({
  15. method: "get",
  16. dataType: "json",
  17. crossDomain: false,
  18. url: globalConfig.context + '/api/admin/customer/selectAdminCustomerList',
  19. data: {
  20. depId:this.state.name,
  21. startTime:this.state.startTime,
  22. end:this.state.end
  23. },
  24. success: function (data) {
  25. let theArr = [];
  26. if (!data.data) {
  27. if (data.error && data.error.length) {
  28. message.warning(data.error[0].message);
  29. };
  30. } else {
  31. for (let i = 0; i < data.data.length; i++) {
  32. let thisdata = data.data[i];
  33. theArr.push({
  34. key: i,
  35. id:thisdata.id,
  36. name:thisdata.name,
  37. sourceName:thisdata.sourceName,
  38. contacts:thisdata.contacts,
  39. contactMobile:thisdata.contactMobile,
  40. createTime:thisdata.createTime,
  41. followTime:thisdata.followTime,
  42. orderNo:thisdata.orderNo,
  43. });
  44. };
  45. }
  46. this.setState({
  47. dataSource: theArr,
  48. });
  49. }.bind(this),
  50. }).always(function () {
  51. this.setState({
  52. loading: false
  53. });
  54. }.bind(this));
  55. },
  56. getInitialState() {
  57. return {
  58. loading: false,
  59. visible: false,
  60. lookState:true,
  61. orgCodeUrl:[],
  62. checkedKeys: [],
  63. lookflowList:[],
  64. columns: [
  65. {
  66. title: '客户名称',
  67. dataIndex: 'name',
  68. key: 'name'
  69. }, {
  70. title: '来源',
  71. dataIndex: 'sourceName',
  72. key: 'sourceName',
  73. render:(text)=>{
  74. return (getOrderType(text))
  75. }
  76. },{
  77. title: '联系人',
  78. dataIndex: 'contacts',
  79. key: 'contacts'
  80. }, {
  81. title: '联系人电话',
  82. dataIndex: 'contactMobile',
  83. key: 'contactMobile'
  84. }, {
  85. title: '创建时间',
  86. dataIndex: 'createTime',
  87. key: 'createTime'
  88. }, {
  89. title: '跟进时间',
  90. dataIndex: 'followTime',
  91. key: 'followTime'
  92. },
  93. // {
  94. // title: '项目说明',
  95. // dataIndex: 'remarks',
  96. // key: 'remarks',
  97. // render:(text)=>{
  98. // return (text&&text.length>8?text.substr(0,8)+'…':text)
  99. // }
  100. // }
  101. ],
  102. flowList:[
  103. {
  104. title: '平台流水号',
  105. dataIndex: 'billNo',
  106. key: 'billNo',
  107. }, {
  108. title: '平台流水时间',
  109. dataIndex: 'createTime',
  110. key: 'createTime'
  111. }, {
  112. title: '流水金额(万元)',
  113. dataIndex: 'transactionAmount',
  114. key: 'transactionAmount'
  115. },{
  116. title: '付款人名称',
  117. dataIndex: 'payerName',
  118. key: 'payerName'
  119. }, {
  120. title: '收款人名称',
  121. dataIndex: 'payeeName',
  122. key: 'payeeName'
  123. },
  124. {
  125. title: '流水科目',
  126. dataIndex: 'transactionSubject',
  127. key: 'transactionSubject',
  128. render:(text)=>{return getTransactionProject(text) }
  129. }, {
  130. title: '流水渠道',
  131. dataIndex: 'transactionChannel',
  132. key: 'transactionChannel',
  133. render:(text)=>{return getTransactionChannel(text) }
  134. },{
  135. title: '财务流水号',
  136. dataIndex: 'financialPayNo',
  137. key: 'financialPayNo',
  138. }, {
  139. title: '财务流水时间',
  140. dataIndex: 'financialPayTime',
  141. key: 'financialPayTime',
  142. }, {
  143. title: '流水确认',
  144. dataIndex: 'confirmSign',
  145. key: 'confirmSign',
  146. render:(text)=>{return text?'已确认':'待确认' }
  147. },{
  148. title: '确认时间',
  149. dataIndex: 'confirmTime',
  150. key: 'confirmTime',
  151. }
  152. ]
  153. };
  154. },
  155. //查看基本详情基本信息
  156. loaduser(record){
  157. if(record){
  158. this.state.orderList=[]
  159. $.ajax({
  160. method: "get",
  161. dataType: "json",
  162. crossDomain: false,
  163. url: globalConfig.context + '/api/admin/order/getServiceOrderDetail',
  164. data: {
  165. orderNo: record.orderNo
  166. },
  167. success: function (data) {
  168. let thisData = data.data;
  169. if (!thisData) {
  170. if (data.error && data.error.length) {
  171. message.warning(data.error[0].message);
  172. };
  173. thisData = {};
  174. };
  175. this.setState({
  176. id:thisData.id,
  177. orderList:thisData,
  178. orderAmount:thisData.orderAmount,
  179. firstPayment:thisData.firstPayment,
  180. signTotalAmount:thisData.signTotalAmount,
  181. signFirstPayment:thisData.signFirstPayment,
  182. approval:thisData.approval==0?thisData.approval.toString():thisData.approval,
  183. orderRemarks:thisData.orderRemarks,
  184. orgCodeUrl: thisData.orgCodeUrl ? splitUrl(thisData.orgCodeUrl, ',', globalConfig.avatarHost + '/upload') : [],
  185. //签单
  186. orderNo:thisData.orderNo,//订单编号
  187. buyerName:thisData.buyerName,
  188. });
  189. }.bind(this),
  190. }).always(function () {
  191. this.setState({
  192. loading: false
  193. });
  194. }.bind(this));
  195. }
  196. },
  197. handleOk(e) {
  198. this.setState({
  199. visible: false,
  200. });
  201. this.props.closeDesc(false, true);
  202. },
  203. handleCancel(e) {
  204. this.setState({
  205. visible: false,
  206. });
  207. this.props.closeDesc(false);
  208. },
  209. nextCancel() {
  210. this.setState({
  211. addnextVisible: false
  212. })
  213. },
  214. lookflow(){
  215. this.setState({
  216. loading: true,
  217. lookVisible:true,
  218. })
  219. this.state.lookSource=[];
  220. $.ajax({
  221. method: "get",
  222. dataType: "json",
  223. crossDomain: false,
  224. url: globalConfig.context +'/api/admin/order/getBillByOrderNo',
  225. data: {
  226. orderNo:this.props.datauser.orderNo,
  227. },
  228. success: function (data) {
  229. let theArr = [];
  230. if (!data.data) {
  231. if (data.error && data.error.length) {
  232. message.warning(data.error[0].message);
  233. };
  234. } else {
  235. for (let i = 0; i < data.data.length; i++) {
  236. let thisdata = data.data[i];
  237. theArr.push({
  238. key: i,
  239. billNo: thisdata.billNo,
  240. transactionAmount:thisdata.transactionAmount,
  241. createTime:thisdata.createTime,
  242. transactionAmount:thisdata.transactionAmount,
  243. payerName:thisdata.payerName,
  244. payeeName:thisdata.payeeName,
  245. transactionSubject:thisdata.transactionSubject,
  246. transactionChannel:thisdata.transactionChannel,
  247. financialPayNo:thisdata.financialPayNo,
  248. financialPayTime:thisdata.financialPayTime,
  249. orderNo:thisdata.orderNo,
  250. departmentName:thisdata.departmentName,
  251. salesmanName:thisdata.salesmanName,
  252. financeName:thisdata.financeName,
  253. confirmSign:thisdata.confirmSign,
  254. deleteSign:thisdata.deleteSign,
  255. confirmTime:thisdata.confirmTime
  256. });
  257. };
  258. };
  259. this.setState({
  260. lookflowList: theArr,
  261. });
  262. }.bind(this),
  263. }).always(function () {
  264. this.setState({
  265. loading: false
  266. });
  267. }.bind(this));
  268. },
  269. lookCancel(){
  270. this.setState({
  271. lookVisible:false
  272. })
  273. },
  274. tableRowClick(record, index) {
  275. this.setState({
  276. editFw:record,
  277. addnextVisible:true,
  278. });
  279. },
  280. componentWillMount() {
  281. },
  282. componentWillReceiveProps(nextProps) { //props改变时触发
  283. this.state.visible = nextProps.showDesc;
  284. if(nextProps.userDetaile && nextProps.showDesc ) {
  285. this.loaduser(nextProps.datauser);
  286. this.loadData(nextProps.datauser);
  287. }
  288. },
  289. render() {
  290. const FormItem = Form.Item
  291. const formItemLayout = {
  292. labelCol: { span: 8 },
  293. wrapperCol: { span: 14 },
  294. };
  295. const editFws=this.state.editFw || [];
  296. const orderDetaiel=this.state.orderList || [];
  297. return(
  298. <div>
  299. <Modal maskClosable={false} visible={this.state.visible}
  300. onOk={this.handleOk} onCancel={this.handleCancel}
  301. width='1000px'
  302. title='订单详情'
  303. footer=''
  304. className="admin-desc-content">
  305. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  306. <Spin spinning={this.state.loading}>
  307. <div className="patent-table">
  308. <Spin spinning={this.state.loading}>
  309. <Table columns={this.state.columns}
  310. dataSource={this.state.dataSource}
  311. pagination={false}
  312. onRowClick={this.tableRowClick}
  313. />
  314. </Spin>
  315. </div>
  316. </Spin>
  317. </Form >
  318. </Modal>
  319. </div>
  320. )
  321. }
  322. }));
  323. export default ManagementDetaile;