mySettlementDetaile.jsx 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  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. const MySettlementDetaile = Form.create()(React.createClass({
  8. loadData(record) {
  9. this.state.data = [];
  10. this.setState({
  11. loading: true
  12. });
  13. $.ajax({
  14. method: "get",
  15. dataType: "json",
  16. crossDomain: false,
  17. url: globalConfig.context + '/api/admin/order/getOrderCommodity',
  18. data: {
  19. orderNo:record?record.orderNo:this.props.datauser.orderNo
  20. },
  21. success: function (data) {
  22. let theArr = [];
  23. if (!data.data) {
  24. if (data.error && data.error.length) {
  25. message.warning(data.error[0].message);
  26. };
  27. } else {
  28. for (let i = 0; i < data.data.length; i++) {
  29. let thisdata = data.data[i];
  30. theArr.push({
  31. key: i,
  32. id:thisdata.id,
  33. orderNo:thisdata.orderNo,
  34. commodityName:thisdata.commodityName,
  35. commodityType:thisdata.commodityType,
  36. commodityMode:thisdata.commodityMode,
  37. commodityQuantity:thisdata.commodityQuantity,
  38. commodityPrice:thisdata.commodityPrice,
  39. discountPrice:thisdata.discountPrice,
  40. commodityFirstPayment:thisdata.commodityFirstPayment,
  41. createTimes:thisdata.createTimes,
  42. discountFirstPayment:thisdata.discountFirstPayment,
  43. remarks:thisdata.remarks,
  44. });
  45. };
  46. }
  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. contractState:false,
  62. orgCodeUrl:[],
  63. lookflowList:[],
  64. checkedKeys: [],
  65. columns: [
  66. {
  67. title: '业务项目名称',
  68. dataIndex: 'commodityName',
  69. key: 'commodityName'
  70. }, {
  71. title: '项目类别',
  72. dataIndex: 'commodityType',
  73. key: 'commodityType',
  74. render:(text)=>{
  75. return (getOrderType(text))
  76. }
  77. },{
  78. title: '项目数量',
  79. dataIndex: 'commodityQuantity',
  80. key: 'commodityQuantity'
  81. }, {
  82. title: '服务市价(万元)',
  83. dataIndex: 'commodityPrice',
  84. key: 'commodityPrice'
  85. }, {
  86. title: '实签价格(万元)',
  87. dataIndex: 'discountPrice',
  88. key: 'discountPrice'
  89. }, {
  90. title: '下单时间',
  91. dataIndex: 'createTimes',
  92. key: 'createTimes'
  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. componentWillMount() {
  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. 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="clearfix">
  308. <div className="clearfix">
  309. <FormItem className="half-item"
  310. {...formItemLayout}
  311. label="订单编号" >
  312. <span>{orderDetaiel.orderNo}</span>
  313. </FormItem>
  314. <FormItem className="half-item"
  315. {...formItemLayout}
  316. label="下单时间" >
  317. <span>{orderDetaiel.createTime}</span>
  318. </FormItem>
  319. <FormItem className="half-item"
  320. {...formItemLayout}
  321. label="客户名称" >
  322. <span>{orderDetaiel.buyerName}</span>
  323. </FormItem>
  324. <FormItem className="half-item"
  325. {...formItemLayout}
  326. label="订单类型" >
  327. <span>{getOrderType(orderDetaiel.orderType)}</span>
  328. </FormItem>
  329. <FormItem className="half-item"
  330. {...formItemLayout}
  331. label="订单渠道" >
  332. <span>{getOrderChannel(orderDetaiel.orderChannel)}</span>
  333. </FormItem>
  334. <FormItem className="half-item"
  335. {...formItemLayout}
  336. label="订单状态" >
  337. <span>{getOrderState(orderDetaiel.orderStatus)}</span>
  338. </FormItem>
  339. <FormItem className="half-item"
  340. {...formItemLayout}
  341. label="已收款项" >
  342. <span>{orderDetaiel.actuallyTotalAmount+"万元"}</span>
  343. </FormItem>
  344. <FormItem className="half-item"
  345. {...formItemLayout}
  346. label="结算状态" >
  347. <span>{getPaymentState(orderDetaiel.liquidationStatus)}</span>
  348. </FormItem>
  349. <FormItem className="half-item"
  350. {...formItemLayout}
  351. label="市价订单金额" >
  352. <span>{orderDetaiel.orderAmount+"万元"}</span>
  353. </FormItem>
  354. <FormItem className="half-item"
  355. {...formItemLayout}
  356. label="市价首款金额" >
  357. <span>{orderDetaiel.firstPayment+"万元"}</span>
  358. </FormItem>
  359. <div className='clearfix'>
  360. <FormItem className="half-item"
  361. {...formItemLayout}
  362. label="实签订单金额" >
  363. <span>{orderDetaiel.signTotalAmount+"万元"}</span>
  364. </FormItem>
  365. <FormItem className="half-item"
  366. {...formItemLayout}
  367. label="实签首款金额" >
  368. <span>{orderDetaiel.signFirstPayment+"万元"}</span>
  369. </FormItem>
  370. <FormItem className="half-item"
  371. {...formItemLayout}
  372. label="特批立项" >
  373. <span>{getApprovedState(orderDetaiel.approval)}</span>
  374. </FormItem>
  375. <FormItem className="half-item"
  376. {...formItemLayout}
  377. label="合同编号" >
  378. <span>{orderDetaiel.contractNo}</span>
  379. </FormItem>
  380. <div className='clearfix'>
  381. <FormItem
  382. labelCol={{ span: 4 }}
  383. wrapperCol={{ span: 16 }}
  384. label="订单留言" >
  385. <span>{orderDetaiel.orderRemarks}</span>
  386. </FormItem>
  387. </div>
  388. </div>
  389. </div>
  390. <div className='clearfix'>
  391. <FormItem className="half-item"
  392. {...formItemLayout}
  393. label="订单负责人" >
  394. <span>{orderDetaiel.salesmanName}</span>
  395. </FormItem>
  396. <FormItem className="half-item"
  397. {...formItemLayout}
  398. label="业务品类" >
  399. <span>{orderDetaiel.projectType}</span>
  400. </FormItem>
  401. </div>
  402. <div className='clearfix'>
  403. <FormItem className="half-item"
  404. {...formItemLayout}
  405. label="意向时间" >
  406. <span>{orderDetaiel.createTime}</span>
  407. </FormItem>
  408. <FormItem className="half-item"
  409. {...formItemLayout}
  410. label="签单时间" >
  411. <span>{orderDetaiel.signTime}</span>
  412. </FormItem>
  413. <FormItem className="half-item"
  414. {...formItemLayout}
  415. label="财务负责人" >
  416. <span>{orderDetaiel.financeName}</span>
  417. <Button onClick={this.lookflow} style={{float:'right'}}>查看流水</Button>
  418. </FormItem>
  419. <FormItem className="half-item"
  420. {...formItemLayout}
  421. label="首付时间" >
  422. <span>{orderDetaiel.createTimez}</span>
  423. </FormItem>
  424. <FormItem className="half-item"
  425. {...formItemLayout}
  426. label="项目负责人" >
  427. <span>{orderDetaiel.technicianName}</span>
  428. </FormItem>
  429. <FormItem className="half-item"
  430. {...formItemLayout}
  431. label="立项时间" >
  432. <span>{orderDetaiel.setUpTime}</span>
  433. </FormItem>
  434. <FormItem className="half-item"
  435. {...formItemLayout}
  436. label="项目状态" >
  437. <span>{getProjectState(orderDetaiel.projectStage)}</span>
  438. </FormItem>
  439. </div>
  440. <div>
  441. <span style={{marginLeft:'50px',fontSize:'20px'}}>项目业务</span>
  442. </div>
  443. <div className="patent-table">
  444. <Spin spinning={this.state.loading}>
  445. <Table columns={this.state.columns}
  446. dataSource={this.state.dataSource}
  447. pagination={false}
  448. onRowClick={this.tableRowClick}
  449. />
  450. </Spin>
  451. </div>
  452. </div>
  453. </Spin>
  454. </Form >
  455. </Modal>
  456. <Modal maskClosable={false} visible={this.state.addnextVisible}
  457. onOk={this.nextCancel} onCancel={this.nextCancel}
  458. width='550px'
  459. title='查看明细服务'
  460. footer=''
  461. className="admin-desc-content">
  462. <Form layout="horizontal" id="demand-form">
  463. <Spin spinning={this.state.loading}>
  464. <div className="clearfix">
  465. <FormItem className="half-item"
  466. {...formItemLayout}
  467. label="服务名称" >
  468. <span>{editFws.commodityName}</span>
  469. </FormItem>
  470. <FormItem className="half-item"
  471. {...formItemLayout}
  472. label="市场价格" >
  473. <span>{editFws.commodityPrice+"万元"}</span>
  474. </FormItem>
  475. <FormItem className="half-item"
  476. {...formItemLayout}
  477. label="实签价格" >
  478. <span>{editFws.discountPrice+"万元"}</span>
  479. </FormItem>
  480. <FormItem className="half-item"
  481. {...formItemLayout}
  482. label="服务数量" >
  483. <span>{editFws.commodityQuantity}</span>
  484. </FormItem>
  485. <FormItem className="half-item"
  486. {...formItemLayout}
  487. label="市场首付金额" >
  488. <span>{editFws.commodityFirstPayment+"万元"}</span>
  489. </FormItem>
  490. <FormItem className="half-item"
  491. {...formItemLayout}
  492. label="签单首付金额" >
  493. <span>{editFws.discountFirstPayment+"万元"}</span>
  494. </FormItem>
  495. <div className='clearfix'>
  496. <FormItem
  497. labelCol={{ span: 4 }}
  498. wrapperCol={{ span: 16 }}
  499. label="服务说明" >
  500. <span>{editFws.remarks}</span>
  501. </FormItem>
  502. </div>
  503. </div>
  504. </Spin>
  505. </Form >
  506. </Modal>
  507. <Modal maskClosable={false} visible={this.state.lookVisible}
  508. onOk={this.lookCancel} onCancel={this.lookCancel}
  509. width='1300px'
  510. title= '查看流水'
  511. footer=''
  512. className="admin-desc-content">
  513. <Form layout="horizontal" id="demand-form">
  514. <Spin spinning={this.state.loading}>
  515. <div className="clearfix">
  516. <Table columns={this.state.flowList}
  517. dataSource={this.state.lookflowList}
  518. pagination={false}
  519. />
  520. </div>
  521. </Spin>
  522. </Form >
  523. </Modal>
  524. </div>
  525. )
  526. }
  527. }));
  528. export default MySettlementDetaile;