mySettlementDetaile.jsx 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  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,getOrderChannel,getOrderType,getTransactionProject,getTransactionChannel} from '../../../../tools.js';
  7. //图片组件
  8. const PicturesWall = React.createClass({
  9. getInitialState() {
  10. return {
  11. previewVisible: false,
  12. previewImage: '',
  13. fileList: [],
  14. }
  15. },
  16. handleCancel() {
  17. this.setState({ previewVisible: false })
  18. },
  19. handlePreview(file) {
  20. this.setState({
  21. previewImage: file.url || file.thumbUrl,
  22. previewVisible: true,
  23. });
  24. },
  25. handleChange(info) {
  26. let fileList = info.fileList;
  27. this.setState({ fileList });
  28. this.props.fileList(fileList);
  29. },
  30. componentWillReceiveProps(nextProps) {
  31. this.state.fileList = nextProps.pictureUrl;
  32. },
  33. render() {
  34. const { previewVisible, previewImage, fileList } = this.state;
  35. const uploadButton = (
  36. <div>
  37. <Icon type="plus" />
  38. <div className="ant-upload-text">点击上传</div>
  39. </div>
  40. );
  41. return (
  42. <div style={{display:"inline-block"}}>
  43. <Upload
  44. action={globalConfig.context + "/api/admin/superviser/uploadAdminImg"}
  45. data={{ 'sign': this.props.pictureSign }}
  46. listType="picture-card"
  47. fileList={fileList}
  48. onPreview={this.handlePreview}
  49. onChange={this.handleChange} >
  50. {fileList.length >= 4 ? null : uploadButton}
  51. </Upload>
  52. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  53. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  54. </Modal>
  55. </div>
  56. );
  57. }
  58. });
  59. const MySettlementDetaile = Form.create()(React.createClass({
  60. loadData(record) {
  61. this.state.data = [];
  62. this.setState({
  63. loading: true
  64. });
  65. $.ajax({
  66. method: "get",
  67. dataType: "json",
  68. crossDomain: false,
  69. url: globalConfig.context + '/api/admin/order/getOrderCommodity',
  70. data: {
  71. orderNo:record?record.orderNo:this.props.datauser.orderNo
  72. },
  73. success: function (data) {
  74. let theArr = [];
  75. if (!data.data) {
  76. if (data.error && data.error.length) {
  77. message.warning(data.error[0].message);
  78. };
  79. } else {
  80. for (let i = 0; i < data.data.length; i++) {
  81. let thisdata = data.data[i];
  82. theArr.push({
  83. key: i,
  84. id:thisdata.id,
  85. orderNo:thisdata.orderNo,
  86. commodityName:thisdata.commodityName,
  87. commodityType:thisdata.commodityType,
  88. commodityMode:thisdata.commodityMode,
  89. commodityQuantity:thisdata.commodityQuantity,
  90. commodityPrice:thisdata.commodityPrice,
  91. discountPrice:thisdata.discountPrice,
  92. commodityFirstPayment:thisdata.commodityFirstPayment,
  93. createTimes:thisdata.createTimes,
  94. discountFirstPayment:thisdata.discountFirstPayment,
  95. remarks:thisdata.remarks,
  96. });
  97. };
  98. }
  99. this.setState({
  100. dataSource: theArr,
  101. });
  102. }.bind(this),
  103. }).always(function () {
  104. this.setState({
  105. loading: false
  106. });
  107. }.bind(this));
  108. },
  109. getInitialState() {
  110. return {
  111. loading: false,
  112. visible: false,
  113. contractState:false,
  114. orgCodeUrl:[],
  115. lookflowList:[],
  116. checkedKeys: [],
  117. columns: [
  118. {
  119. title: '业务项目名称',
  120. dataIndex: 'commodityName',
  121. key: 'commodityName'
  122. }, {
  123. title: '项目类别',
  124. dataIndex: 'commodityType',
  125. key: 'commodityType',
  126. render:(text)=>{
  127. return (getOrderType(text))
  128. }
  129. },{
  130. title: '项目数量',
  131. dataIndex: 'commodityQuantity',
  132. key: 'commodityQuantity'
  133. }, {
  134. title: '服务市价',
  135. dataIndex: 'commodityPrice',
  136. key: 'commodityPrice'
  137. }, {
  138. title: '实签价格',
  139. dataIndex: 'discountPrice',
  140. key: 'discountPrice'
  141. }, {
  142. title: '下单时间',
  143. dataIndex: 'createTimes',
  144. key: 'createTimes'
  145. }, {
  146. title: '项目说明',
  147. dataIndex: 'remarks',
  148. key: 'remarks',
  149. render:(text)=>{
  150. return (text&&text.length>8?text.substr(0,8)+'…':text)
  151. }
  152. }
  153. ],
  154. flowList:[
  155. {
  156. title: '平台流水号',
  157. dataIndex: 'billNo',
  158. key: 'billNo',
  159. }, {
  160. title: '平台流水时间',
  161. dataIndex: 'createTime',
  162. key: 'createTime'
  163. }, {
  164. title: '流水金额',
  165. dataIndex: 'transactionAmount',
  166. key: 'transactionAmount'
  167. },{
  168. title: '付款人名称',
  169. dataIndex: 'payerName',
  170. key: 'payerName'
  171. }, {
  172. title: '收款人名称',
  173. dataIndex: 'payeeName',
  174. key: 'payeeName'
  175. },
  176. {
  177. title: '流水科目',
  178. dataIndex: 'transactionSubject',
  179. key: 'transactionSubject',
  180. render:(text)=>{return getTransactionProject(text) }
  181. }, {
  182. title: '流水渠道',
  183. dataIndex: 'transactionChannel',
  184. key: 'transactionChannel',
  185. render:(text)=>{return getTransactionChannel(text) }
  186. },{
  187. title: '财务流水号',
  188. dataIndex: 'financialPayNo',
  189. key: 'financialPayNo',
  190. }, {
  191. title: '财务流水时间',
  192. dataIndex: 'financialPayTime',
  193. key: 'financialPayTime',
  194. }, {
  195. title: '流水确认',
  196. dataIndex: 'confirmSign',
  197. key: 'confirmSign',
  198. render:(text)=>{return text?'已确认':'待确认' }
  199. },{
  200. title: '确认时间',
  201. dataIndex: 'confirmTime',
  202. key: 'confirmTime',
  203. }
  204. ]
  205. };
  206. },
  207. //查看基本详情基本信息
  208. loaduser(record){
  209. if(record){
  210. this.state.orderList=[]
  211. $.ajax({
  212. method: "get",
  213. dataType: "json",
  214. crossDomain: false,
  215. url: globalConfig.context + '/api/admin/order/getServiceOrderDetail',
  216. data: {
  217. orderNo: record.orderNo
  218. },
  219. success: function (data) {
  220. let thisData = data.data;
  221. if (!thisData) {
  222. if (data.error && data.error.length) {
  223. message.warning(data.error[0].message);
  224. };
  225. thisData = {};
  226. };
  227. this.setState({
  228. id:thisData.id,
  229. orderList:thisData,
  230. orderAmount:thisData.orderAmount,
  231. firstPayment:thisData.firstPayment,
  232. signTotalAmount:thisData.signTotalAmount,
  233. signFirstPayment:thisData.signFirstPayment,
  234. approval:thisData.approval==0?thisData.approval.toString():thisData.approval,
  235. orderRemarks:thisData.orderRemarks,
  236. orgCodeUrl: thisData.orgCodeUrl ? splitUrl(thisData.orgCodeUrl, ',', globalConfig.avatarHost + '/upload') : [],
  237. //签单
  238. orderNo:thisData.orderNo,//订单编号
  239. buyerName:thisData.buyerName,
  240. });
  241. }.bind(this),
  242. }).always(function () {
  243. this.setState({
  244. loading: false
  245. });
  246. }.bind(this));
  247. }
  248. },
  249. handleOk(e) {
  250. this.setState({
  251. visible: false,
  252. });
  253. this.props.closeDesc(false, true);
  254. },
  255. handleCancel(e) {
  256. this.setState({
  257. visible: false,
  258. });
  259. this.props.closeDesc(false);
  260. },
  261. componentWillMount() {
  262. },
  263. nextCancel() {
  264. this.setState({
  265. addnextVisible: false
  266. })
  267. },
  268. lookflow(){
  269. this.setState({
  270. loading: true,
  271. lookVisible:true,
  272. })
  273. this.state.lookSource=[];
  274. $.ajax({
  275. method: "post",
  276. dataType: "json",
  277. crossDomain: false,
  278. url: globalConfig.context +'/api/admin/order/queryAllBill',
  279. data: {
  280. orderNo:this.props.datauser.orderNo,
  281. pageNo: 1,
  282. pageSize: 99,
  283. },
  284. success: function (data) {
  285. let theArr = [];
  286. if (!data.data) {
  287. if (data.error && data.error.length) {
  288. message.warning(data.error[0].message);
  289. };
  290. } else {
  291. for (let i = 0; i < data.data.list.length; i++) {
  292. let thisdata = data.data.list[i];
  293. theArr.push({
  294. key: i,
  295. billNo: thisdata.billNo,
  296. transactionAmount:thisdata.transactionAmount,
  297. createTime:thisdata.createTime,
  298. transactionAmount:thisdata.transactionAmount,
  299. payerName:thisdata.payerName,
  300. payeeName:thisdata.payeeName,
  301. transactionSubject:thisdata.transactionSubject,
  302. transactionChannel:thisdata.transactionChannel,
  303. financialPayNo:thisdata.financialPayNo,
  304. financialPayTime:thisdata.financialPayTime,
  305. orderNo:thisdata.orderNo,
  306. departmentName:thisdata.departmentName,
  307. salesmanName:thisdata.salesmanName,
  308. financeName:thisdata.financeName,
  309. confirmSign:thisdata.confirmSign,
  310. deleteSign:thisdata.deleteSign,
  311. confirmTime:thisdata.confirmTime
  312. });
  313. };
  314. };
  315. this.setState({
  316. lookflowList: theArr,
  317. });
  318. }.bind(this),
  319. }).always(function () {
  320. this.setState({
  321. loading: false
  322. });
  323. }.bind(this));
  324. },
  325. lookCancel(){
  326. this.setState({
  327. lookVisible:false
  328. })
  329. },
  330. tableRowClick(record, index) {
  331. this.setState({
  332. editFw:record,
  333. addnextVisible:true,
  334. });
  335. },
  336. componentWillReceiveProps(nextProps) { //props改变时触发
  337. this.state.visible = nextProps.showDesc;
  338. if(nextProps.userDetaile && nextProps.showDesc ) {
  339. this.loaduser(nextProps.datauser);
  340. this.loadData(nextProps.datauser);
  341. }
  342. },
  343. render() {
  344. const FormItem = Form.Item
  345. const formItemLayout = {
  346. labelCol: { span: 8 },
  347. wrapperCol: { span: 14 },
  348. };
  349. const editFws=this.state.editFw || [];
  350. const orderDetaiel=this.state.orderList || [];
  351. return(
  352. <div>
  353. <Modal maskClosable={false} visible={this.state.visible}
  354. onOk={this.handleOk} onCancel={this.handleCancel}
  355. width='1000px'
  356. title='查看订单详情'
  357. footer=''
  358. className="admin-desc-content">
  359. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  360. <Spin spinning={this.state.loading}>
  361. <div className="clearfix">
  362. <div className="clearfix">
  363. <FormItem className="half-item"
  364. {...formItemLayout}
  365. label="订单编号" >
  366. <span>{orderDetaiel.orderNo}</span>
  367. </FormItem>
  368. <FormItem className="half-item"
  369. {...formItemLayout}
  370. label="下单时间" >
  371. <span>{orderDetaiel.createTime}</span>
  372. </FormItem>
  373. <FormItem className="half-item"
  374. {...formItemLayout}
  375. label="客户名称" >
  376. <span>{orderDetaiel.buyerName}</span>
  377. </FormItem>
  378. <FormItem className="half-item"
  379. {...formItemLayout}
  380. label="订单类型" >
  381. <span>{getOrderType(orderDetaiel.orderType)}</span>
  382. </FormItem>
  383. <FormItem className="half-item"
  384. {...formItemLayout}
  385. label="订单渠道" >
  386. <span>{getOrderChannel(orderDetaiel.orderChannel)}</span>
  387. </FormItem>
  388. <FormItem className="half-item"
  389. {...formItemLayout}
  390. label="订单状态" >
  391. <span>{getOrderState(orderDetaiel.orderStatus)}</span>
  392. </FormItem>
  393. <FormItem className="half-item"
  394. {...formItemLayout}
  395. label="已收款项" >
  396. <span>{orderDetaiel.actuallyTotalAmount}</span>
  397. </FormItem>
  398. <FormItem className="half-item"
  399. {...formItemLayout}
  400. label="结算状态" >
  401. <span>{getPaymentState(orderDetaiel.liquidationStatus)}</span>
  402. </FormItem>
  403. <FormItem className="half-item"
  404. {...formItemLayout}
  405. label="市价订单金额" >
  406. <span>{orderDetaiel.orderAmount}</span>
  407. </FormItem>
  408. <FormItem className="half-item"
  409. {...formItemLayout}
  410. label="市价首款金额" >
  411. <span>{orderDetaiel.firstPayment}</span>
  412. </FormItem>
  413. <div className='clearfix'>
  414. <FormItem className="half-item"
  415. {...formItemLayout}
  416. label="实签订单金额" >
  417. <span>{orderDetaiel.signTotalAmount}</span>
  418. </FormItem>
  419. <FormItem className="half-item"
  420. {...formItemLayout}
  421. label="实签首款金额" >
  422. <span>{orderDetaiel.signFirstPayment}</span>
  423. </FormItem>
  424. <FormItem className="half-item"
  425. {...formItemLayout}
  426. label="特批立项" >
  427. <span>{getApprovedState(orderDetaiel.approval)}</span>
  428. </FormItem>
  429. <div className="clearfix">
  430. <FormItem
  431. labelCol={{ span: 4 }}
  432. wrapperCol={{ span: 18 }}
  433. label="合同扫描件" >
  434. <Upload className="demandDetailShow-upload"
  435. listType="customer_sys_file"
  436. fileList={this.state.orgCodeUrl}
  437. onPreview={(file) => {
  438. this.setState({
  439. previewImage: file.url || file.thumbUrl,
  440. previewVisible: true,
  441. });
  442. }} >
  443. </Upload>
  444. <Modal maskClosable={false} footer={null}
  445. visible={this.state.previewVisible}
  446. onCancel={() => { this.setState({ previewVisible: false }) }}>
  447. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  448. </Modal>
  449. </FormItem>
  450. </div>
  451. <div className='clearfix'>
  452. <FormItem
  453. labelCol={{ span: 4 }}
  454. wrapperCol={{ span: 16 }}
  455. label="订单留言" >
  456. <span>{orderDetaiel.orderRemarks}</span>
  457. </FormItem>
  458. </div>
  459. </div>
  460. </div>
  461. <div className='clearfix'>
  462. <FormItem className="half-item"
  463. {...formItemLayout}
  464. label="订单负责人" >
  465. <span>{orderDetaiel.salesmanName}</span>
  466. </FormItem>
  467. </div>
  468. <div className='clearfix'>
  469. <FormItem className="half-item"
  470. {...formItemLayout}
  471. label="意向时间" >
  472. <span>{orderDetaiel.createTime}</span>
  473. </FormItem>
  474. <FormItem className="half-item"
  475. {...formItemLayout}
  476. label="签单时间" >
  477. <span>{orderDetaiel.signTime}</span>
  478. </FormItem>
  479. <FormItem className="half-item"
  480. {...formItemLayout}
  481. label="财务负责人" >
  482. <span>{orderDetaiel.financeName}</span>
  483. <Button onClick={this.lookflow} style={{float:'right'}}>查看流水</Button>
  484. </FormItem>
  485. <FormItem className="half-item"
  486. {...formItemLayout}
  487. label="首付时间" >
  488. <span>{orderDetaiel.createTimez}</span>
  489. </FormItem>
  490. <FormItem className="half-item"
  491. {...formItemLayout}
  492. label="项目负责人" >
  493. <span>{orderDetaiel.technicianName}</span>
  494. </FormItem>
  495. <FormItem className="half-item"
  496. {...formItemLayout}
  497. label="立项时间" >
  498. <span>{orderDetaiel.setUpTime}</span>
  499. </FormItem>
  500. </div>
  501. <div>
  502. <span style={{marginLeft:'50px',fontSize:'20px'}}>项目业务</span>
  503. </div>
  504. <div className="patent-table">
  505. <Spin spinning={this.state.loading}>
  506. <Table columns={this.state.columns}
  507. dataSource={this.state.dataSource}
  508. pagination={false}
  509. onRowClick={this.tableRowClick}
  510. />
  511. </Spin>
  512. </div>
  513. </div>
  514. </Spin>
  515. </Form >
  516. </Modal>
  517. <Modal maskClosable={false} visible={this.state.addnextVisible}
  518. onOk={this.nextCancel} onCancel={this.nextCancel}
  519. width='550px'
  520. title='查看明细服务'
  521. footer=''
  522. className="admin-desc-content">
  523. <Form layout="horizontal" id="demand-form">
  524. <Spin spinning={this.state.loading}>
  525. <div className="clearfix">
  526. <FormItem className="half-item"
  527. {...formItemLayout}
  528. label="服务名称" >
  529. <span>{editFws.commodityName}</span>
  530. </FormItem>
  531. <FormItem className="half-item"
  532. {...formItemLayout}
  533. label="市场价格" >
  534. <span>{editFws.commodityPrice}</span>
  535. </FormItem>
  536. <FormItem className="half-item"
  537. {...formItemLayout}
  538. label="实签价格" >
  539. <span>{editFws.discountPrice}</span>
  540. </FormItem>
  541. <FormItem className="half-item"
  542. {...formItemLayout}
  543. label="服务数量" >
  544. <span>{editFws.commodityQuantity}</span>
  545. </FormItem>
  546. <FormItem className="half-item"
  547. {...formItemLayout}
  548. label="商品规格" >
  549. <span>{editFws.commodityMode}</span>
  550. </FormItem>
  551. <FormItem className="half-item"
  552. {...formItemLayout}
  553. label="市场首付金额" >
  554. <span>{editFws.commodityFirstPayment}</span>
  555. </FormItem>
  556. <FormItem className="half-item"
  557. {...formItemLayout}
  558. label="签单首付金额" >
  559. <span>{editFws.discountFirstPayment}</span>
  560. </FormItem>
  561. <div className='clearfix'>
  562. <FormItem
  563. labelCol={{ span: 4 }}
  564. wrapperCol={{ span: 16 }}
  565. label="服务说明" >
  566. <span>{editFws.remarks}</span>
  567. </FormItem>
  568. </div>
  569. </div>
  570. </Spin>
  571. </Form >
  572. </Modal>
  573. <Modal maskClosable={false} visible={this.state.lookVisible}
  574. onOk={this.lookCancel} onCancel={this.lookCancel}
  575. width='1300px'
  576. title= '查看流水'
  577. footer=''
  578. className="admin-desc-content">
  579. <Form layout="horizontal" id="demand-form">
  580. <Spin spinning={this.state.loading}>
  581. <div className="clearfix">
  582. <Table columns={this.state.flowList}
  583. dataSource={this.state.lookflowList}
  584. pagination={false}
  585. />
  586. </div>
  587. </Spin>
  588. </Form >
  589. </Modal>
  590. </div>
  591. )
  592. }
  593. }));
  594. export default MySettlementDetaile;