managementDetaile.jsx 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  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 ManagementDetaile = 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. lookState:true,
  114. orgCodeUrl:[],
  115. checkedKeys: [],
  116. lookflowList:[],
  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. render:(text)=>{
  160. return text&&text.substr(0,9)+'…'
  161. }
  162. }, {
  163. title: '平台流水时间',
  164. dataIndex: 'createTime',
  165. key: 'createTime'
  166. }, {
  167. title: '流水金额',
  168. dataIndex: 'transactionAmount',
  169. key: 'transactionAmount'
  170. },{
  171. title: '付款人名称',
  172. dataIndex: 'payerName',
  173. key: 'payerName'
  174. }, {
  175. title: '收款人名称',
  176. dataIndex: 'payeeName',
  177. key: 'payeeName'
  178. },
  179. {
  180. title: '流水科目',
  181. dataIndex: 'transactionSubject',
  182. key: 'transactionSubject',
  183. render:(text)=>{return getTransactionProject(text) }
  184. }, {
  185. title: '流水渠道',
  186. dataIndex: 'transactionChannel',
  187. key: 'transactionChannel',
  188. render:(text)=>{return getTransactionChannel(text) }
  189. },{
  190. title: '财务流水号',
  191. dataIndex: 'financialPayNo',
  192. key: 'financialPayNo',
  193. }, {
  194. title: '财务流水时间',
  195. dataIndex: 'financialPayTime',
  196. key: 'financialPayTime',
  197. }, {
  198. title: '流水确认',
  199. dataIndex: 'confirmSign',
  200. key: 'confirmSign',
  201. render:(text)=>{return text?'已确认':'待确认' }
  202. },{
  203. title: '确认时间',
  204. dataIndex: 'confirmTime',
  205. key: 'confirmTime',
  206. }
  207. ]
  208. };
  209. },
  210. //查看基本详情基本信息
  211. loaduser(record){
  212. if(record){
  213. this.state.orderList=[]
  214. $.ajax({
  215. method: "get",
  216. dataType: "json",
  217. crossDomain: false,
  218. url: globalConfig.context + '/api/admin/order/getServiceOrderDetail',
  219. data: {
  220. orderNo: record.orderNo
  221. },
  222. success: function (data) {
  223. let thisData = data.data;
  224. if (!thisData) {
  225. if (data.error && data.error.length) {
  226. message.warning(data.error[0].message);
  227. };
  228. thisData = {};
  229. };
  230. this.setState({
  231. id:thisData.id,
  232. orderList:thisData,
  233. orderAmount:thisData.orderAmount,
  234. firstPayment:thisData.firstPayment,
  235. signTotalAmount:thisData.signTotalAmount,
  236. signFirstPayment:thisData.signFirstPayment,
  237. approval:thisData.approval==0?thisData.approval.toString():thisData.approval,
  238. orderRemarks:thisData.orderRemarks,
  239. orgCodeUrl: thisData.orgCodeUrl ? splitUrl(thisData.orgCodeUrl, ',', globalConfig.avatarHost + '/upload') : [],
  240. //签单
  241. orderNo:thisData.orderNo,//订单编号
  242. buyerName:thisData.buyerName,
  243. });
  244. }.bind(this),
  245. }).always(function () {
  246. this.setState({
  247. loading: false
  248. });
  249. }.bind(this));
  250. }
  251. },
  252. handleOk(e) {
  253. this.setState({
  254. visible: false,
  255. });
  256. this.props.closeDesc(false, true);
  257. },
  258. handleCancel(e) {
  259. this.setState({
  260. visible: false,
  261. });
  262. this.props.closeDesc(false);
  263. },
  264. nextCancel() {
  265. this.setState({
  266. addnextVisible: false
  267. })
  268. },
  269. lookflow(){
  270. this.setState({
  271. loading: true,
  272. lookVisible:true,
  273. })
  274. this.state.lookSource=[];
  275. $.ajax({
  276. method: "post",
  277. dataType: "json",
  278. crossDomain: false,
  279. url: globalConfig.context +'/api/admin/order/queryAllBill',
  280. data: {
  281. orderNo:this.props.datauser.orderNo,
  282. pageNo: 1,
  283. pageSize: 99,
  284. },
  285. success: function (data) {
  286. let theArr = [];
  287. if (!data.data) {
  288. if (data.error && data.error.length) {
  289. message.warning(data.error[0].message);
  290. };
  291. } else {
  292. for (let i = 0; i < data.data.list.length; i++) {
  293. let thisdata = data.data.list[i];
  294. theArr.push({
  295. key: i,
  296. billNo: thisdata.billNo,
  297. transactionAmount:thisdata.transactionAmount,
  298. createTime:thisdata.createTime,
  299. transactionAmount:thisdata.transactionAmount,
  300. payerName:thisdata.payerName,
  301. payeeName:thisdata.payeeName,
  302. transactionSubject:thisdata.transactionSubject,
  303. transactionChannel:thisdata.transactionChannel,
  304. financialPayNo:thisdata.financialPayNo,
  305. financialPayTime:thisdata.financialPayTime,
  306. orderNo:thisdata.orderNo,
  307. departmentName:thisdata.departmentName,
  308. salesmanName:thisdata.salesmanName,
  309. financeName:thisdata.financeName,
  310. confirmSign:thisdata.confirmSign,
  311. deleteSign:thisdata.deleteSign,
  312. confirmTime:thisdata.confirmTime
  313. });
  314. };
  315. };
  316. this.setState({
  317. lookflowList: theArr,
  318. });
  319. }.bind(this),
  320. }).always(function () {
  321. this.setState({
  322. loading: false
  323. });
  324. }.bind(this));
  325. },
  326. lookCancel(){
  327. this.setState({
  328. lookVisible:false
  329. })
  330. },
  331. tableRowClick(record, index) {
  332. this.setState({
  333. editFw:record,
  334. addnextVisible:true,
  335. });
  336. },
  337. componentWillMount() {
  338. },
  339. componentWillReceiveProps(nextProps) { //props改变时触发
  340. this.state.visible = nextProps.showDesc;
  341. if(nextProps.userDetaile && nextProps.showDesc ) {
  342. this.loaduser(nextProps.datauser);
  343. this.loadData(nextProps.datauser);
  344. }
  345. },
  346. render() {
  347. const FormItem = Form.Item
  348. const formItemLayout = {
  349. labelCol: { span: 8 },
  350. wrapperCol: { span: 14 },
  351. };
  352. const editFws=this.state.editFw || [];
  353. const orderDetaiel=this.state.orderList || [];
  354. return(
  355. <div>
  356. <Modal maskClosable={false} visible={this.state.visible}
  357. onOk={this.handleOk} onCancel={this.handleCancel}
  358. width='1000px'
  359. title='订单详情'
  360. footer=''
  361. className="admin-desc-content">
  362. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  363. <Spin spinning={this.state.loading}>
  364. <div className="clearfix">
  365. <div className="clearfix">
  366. <FormItem className="half-item"
  367. {...formItemLayout}
  368. label="订单编号" >
  369. <span>{orderDetaiel.orderNo}</span>
  370. </FormItem>
  371. <FormItem className="half-item"
  372. {...formItemLayout}
  373. label="下单时间" >
  374. <span>{orderDetaiel.createTime}</span>
  375. </FormItem>
  376. <FormItem className="half-item"
  377. {...formItemLayout}
  378. label="客户名称" >
  379. <span>{orderDetaiel.buyerName}</span>
  380. </FormItem>
  381. <FormItem className="half-item"
  382. {...formItemLayout}
  383. label="订单类型" >
  384. <span>{getOrderType(orderDetaiel.orderType)}</span>
  385. </FormItem>
  386. <FormItem className="half-item"
  387. {...formItemLayout}
  388. label="订单渠道" >
  389. <span>{getOrderChannel(orderDetaiel.orderChannel)}</span>
  390. </FormItem>
  391. <FormItem className="half-item"
  392. {...formItemLayout}
  393. label="订单状态" >
  394. <span>{getOrderState(orderDetaiel.orderStatus)}</span>
  395. </FormItem>
  396. <FormItem className="half-item"
  397. {...formItemLayout}
  398. label="已收款项" >
  399. <span>{orderDetaiel.actuallyTotalAmount}</span>
  400. </FormItem>
  401. <FormItem className="half-item"
  402. {...formItemLayout}
  403. label="结算状态" >
  404. <span>{getPaymentState(orderDetaiel.liquidationStatus)}</span>
  405. </FormItem>
  406. <FormItem className="half-item"
  407. {...formItemLayout}
  408. label="市价订单金额" >
  409. <span>{orderDetaiel.orderAmount}</span>
  410. </FormItem>
  411. <FormItem className="half-item"
  412. {...formItemLayout}
  413. label="市价首款金额" >
  414. <span>{orderDetaiel.firstPayment}</span>
  415. </FormItem>
  416. <div className='clearfix'>
  417. <FormItem className="half-item"
  418. {...formItemLayout}
  419. label="实签订单金额" >
  420. <span>{orderDetaiel.signTotalAmount}</span>
  421. </FormItem>
  422. <FormItem className="half-item"
  423. {...formItemLayout}
  424. label="实签首款金额" >
  425. <span>{orderDetaiel.signFirstPayment}</span>
  426. </FormItem>
  427. <FormItem className="half-item"
  428. {...formItemLayout}
  429. label="特批立项" >
  430. <span>{getApprovedState(orderDetaiel.approval)}</span>
  431. </FormItem>
  432. <div className="clearfix">
  433. <FormItem
  434. labelCol={{ span: 4 }}
  435. wrapperCol={{ span: 18 }}
  436. label="合同扫描件" >
  437. <Upload className="demandDetailShow-upload"
  438. listType="customer_sys_file"
  439. fileList={this.state.orgCodeUrl}
  440. onPreview={(file) => {
  441. this.setState({
  442. previewImage: file.url || file.thumbUrl,
  443. previewVisible: true,
  444. });
  445. }} >
  446. </Upload>
  447. <Modal maskClosable={false} footer={null}
  448. visible={this.state.previewVisible}
  449. onCancel={() => { this.setState({ previewVisible: false }) }}>
  450. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  451. </Modal>
  452. </FormItem>
  453. </div>
  454. <div className='clearfix'>
  455. <FormItem
  456. labelCol={{ span: 4 }}
  457. wrapperCol={{ span: 16 }}
  458. label="订单留言" >
  459. <span>{orderDetaiel.orderRemarks}</span>
  460. </FormItem>
  461. </div>
  462. </div>
  463. </div>
  464. <div className='clearfix'>
  465. <FormItem className="half-item"
  466. {...formItemLayout}
  467. label="订单负责人" >
  468. <span>{orderDetaiel.salesmanName}</span>
  469. </FormItem>
  470. </div>
  471. <div className='clearfix'>
  472. <FormItem className="half-item"
  473. {...formItemLayout}
  474. label="意向时间" >
  475. <span>{orderDetaiel.createTime}</span>
  476. </FormItem>
  477. <FormItem className="half-item"
  478. {...formItemLayout}
  479. label="签单时间" >
  480. <span>{orderDetaiel.signTime}</span>
  481. </FormItem>
  482. <FormItem className="half-item"
  483. {...formItemLayout}
  484. label="财务负责人" >
  485. <span>{orderDetaiel.financeName}</span>
  486. <Button onClick={this.lookflow} style={{float:'right'}}>查看流水</Button>
  487. </FormItem>
  488. <FormItem className="half-item"
  489. {...formItemLayout}
  490. label="项目负责人" >
  491. <span>{orderDetaiel.technicianName}</span>
  492. </FormItem>
  493. <FormItem className="half-item"
  494. {...formItemLayout}
  495. label="立项时间" >
  496. <span>{orderDetaiel.setUpTime}</span>
  497. </FormItem>
  498. </div>
  499. <div>
  500. <span style={{marginLeft:'50px',fontSize:'20px'}}>项目业务</span>
  501. </div>
  502. <div className="patent-table">
  503. <Spin spinning={this.state.loading}>
  504. <Table columns={this.state.columns}
  505. dataSource={this.state.dataSource}
  506. pagination={false}
  507. onRowClick={this.tableRowClick}
  508. />
  509. </Spin>
  510. </div>
  511. </div>
  512. </Spin>
  513. </Form >
  514. </Modal>
  515. <Modal maskClosable={false} visible={this.state.addnextVisible}
  516. onOk={this.nextCancel} onCancel={this.nextCancel}
  517. width='550px'
  518. title='查看明细服务'
  519. footer=''
  520. className="admin-desc-content">
  521. <Form layout="horizontal" id="demand-form">
  522. <Spin spinning={this.state.loading}>
  523. <div className="clearfix">
  524. <FormItem className="half-item"
  525. {...formItemLayout}
  526. label="服务名称" >
  527. <span>{editFws.commodityName}</span>
  528. </FormItem>
  529. <FormItem className="half-item"
  530. {...formItemLayout}
  531. label="市场价格" >
  532. <span>{editFws.commodityPrice}</span>
  533. </FormItem>
  534. <FormItem className="half-item"
  535. {...formItemLayout}
  536. label="实签价格" >
  537. <span>{editFws.discountPrice}</span>
  538. </FormItem>
  539. <FormItem className="half-item"
  540. {...formItemLayout}
  541. label="服务数量" >
  542. <span>{editFws.commodityQuantity}</span>
  543. </FormItem>
  544. <FormItem className="half-item"
  545. {...formItemLayout}
  546. label="商品规格" >
  547. <span>{editFws.commodityMode}</span>
  548. </FormItem>
  549. <FormItem className="half-item"
  550. {...formItemLayout}
  551. label="市场首付金额" >
  552. <span>{editFws.commodityFirstPayment}</span>
  553. </FormItem>
  554. <FormItem className="half-item"
  555. {...formItemLayout}
  556. label="签单首付金额" >
  557. <span>{editFws.discountFirstPayment}</span>
  558. </FormItem>
  559. <div className='clearfix'>
  560. <FormItem
  561. labelCol={{ span: 4 }}
  562. wrapperCol={{ span: 16 }}
  563. label="服务说明" >
  564. <span>{editFws.remarks}</span>
  565. </FormItem>
  566. </div>
  567. </div>
  568. </Spin>
  569. </Form >
  570. </Modal>
  571. <Modal maskClosable={false} visible={this.state.lookVisible}
  572. onOk={this.lookCancel} onCancel={this.lookCancel}
  573. width='1200px'
  574. title= '查看流水'
  575. footer=''
  576. className="admin-desc-content">
  577. <Form layout="horizontal" id="demand-form">
  578. <Spin spinning={this.state.loading}>
  579. <div className="clearfix">
  580. <Table columns={this.state.flowList}
  581. dataSource={this.state.lookflowList}
  582. pagination={false}
  583. />
  584. </div>
  585. </Spin>
  586. </Form >
  587. </Modal>
  588. </div>
  589. )
  590. }
  591. }));
  592. export default ManagementDetaile;