managementDetaile.2.jsx 11 KB

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