approveOrderDetaile.jsx 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  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,getTransactionChannel ,getTransactionProject } from '../../../../tools.js';
  7. import OrderItemStatus from "../../../../common/orderItemStatus";
  8. import EnterpriseNameChange from "../../../../common/enterpriseNameChange";
  9. import ProjectOperation from "../../../../common/projectOperation";
  10. //图片组件
  11. const PicturesWall = React.createClass({
  12. getInitialState() {
  13. return {
  14. previewVisible: false,
  15. previewImage: '',
  16. fileList: [],
  17. }
  18. },
  19. handleCancel() {
  20. this.setState({ previewVisible: false })
  21. },
  22. handlePreview(file) {
  23. this.setState({
  24. previewImage: file.url || file.thumbUrl,
  25. previewVisible: true,
  26. });
  27. },
  28. handleChange(info) {
  29. let fileList = info.fileList;
  30. this.setState({ fileList });
  31. this.props.fileList(fileList);
  32. },
  33. componentWillReceiveProps(nextProps) {
  34. this.state.fileList = nextProps.pictureUrl;
  35. },
  36. render() {
  37. const { previewVisible, previewImage, fileList } = this.state;
  38. const uploadButton = (
  39. <div>
  40. <Icon type="plus" />
  41. <div className="ant-upload-text">点击上传</div>
  42. </div>
  43. );
  44. return (
  45. <div style={{display:"inline-block"}}>
  46. <Upload
  47. action={globalConfig.context + "/api/admin/superviser/uploadAdminImg"}
  48. data={{ 'sign': this.props.pictureSign }}
  49. listType="picture-card"
  50. fileList={fileList}
  51. onPreview={this.handlePreview}
  52. onChange={this.handleChange} >
  53. {fileList.length >= 4 ? null : uploadButton}
  54. </Upload>
  55. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  56. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  57. </Modal>
  58. </div>
  59. );
  60. }
  61. });
  62. const ApproveOrderDetaile = Form.create()(React.createClass({
  63. loadData(record) {
  64. this.state.data = [];
  65. this.setState({
  66. loading: true
  67. });
  68. $.ajax({
  69. method: "get",
  70. dataType: "json",
  71. crossDomain: false,
  72. url: globalConfig.context + '/api/admin/order/getOrderCommodity',
  73. data: {
  74. orderNo:record?record.orderNo:this.props.datauser.orderNo
  75. },
  76. success: function (data) {
  77. let theArr = [];
  78. if (!data.data) {
  79. if (data.error && data.error.length) {
  80. message.warning(data.error[0].message);
  81. };
  82. } else {
  83. for (let i = 0; i < data.data.length; i++) {
  84. let thisdata = data.data[i];
  85. theArr.push({
  86. key: i,
  87. id:thisdata.id,
  88. orderNo:thisdata.orderNo,
  89. commodityName:thisdata.commodityName,
  90. commodityType:thisdata.commodityType,
  91. commodityMode:thisdata.commodityMode,
  92. commodityQuantity:thisdata.commodityQuantity,
  93. commodityPrice:thisdata.commodityPrice,
  94. discountPrice:thisdata.discountPrice,
  95. commodityFirstPayment:thisdata.commodityFirstPayment,
  96. createTimes:thisdata.createTimes,
  97. discountFirstPayment:thisdata.discountFirstPayment,
  98. remarks:thisdata.remarks,
  99. });
  100. };
  101. }
  102. this.setState({
  103. dataSource: theArr,
  104. });
  105. }.bind(this),
  106. }).always(function () {
  107. this.setState({
  108. loading: false
  109. });
  110. }.bind(this));
  111. },
  112. getInitialState() {
  113. return {
  114. loading: false,
  115. visible: false,
  116. lookState:true,
  117. orgCodeUrl:[],
  118. lookflowList:[],
  119. checkedKeys: [],
  120. columns: [
  121. {
  122. title: '业务项目名称',
  123. dataIndex: 'commodityName',
  124. key: 'commodityName'
  125. }, {
  126. title: '项目类别',
  127. dataIndex: 'commodityType',
  128. key: 'commodityType',
  129. render:(text)=>{
  130. return (getOrderType(text))
  131. }
  132. },{
  133. title: '项目数量',
  134. dataIndex: 'commodityQuantity',
  135. key: 'commodityQuantity'
  136. }, {
  137. title: '服务市价(万元)',
  138. dataIndex: 'commodityPrice',
  139. key: 'commodityPrice'
  140. }, {
  141. title: '实签价格(万元)',
  142. dataIndex: 'discountPrice',
  143. key: 'discountPrice'
  144. }, {
  145. title: '下单时间',
  146. dataIndex: 'createTimes',
  147. key: 'createTimes'
  148. }, {
  149. title: '项目说明',
  150. dataIndex: 'remarks',
  151. key: 'remarks',
  152. render:(text)=>{
  153. return (text&&text.length>8?text.substr(0,8)+'…':text)
  154. }
  155. }
  156. ],
  157. flowList:[
  158. {
  159. title: '平台流水号',
  160. dataIndex: 'billNo',
  161. key: 'billNo',
  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. //订单详情
  270. xiangqings(record) {
  271. $.ajax({
  272. method: "get",
  273. dataType: "json",
  274. crossDomain: false,
  275. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  276. data: {
  277. orderNo: record?record.orderNo:this.props.datauser.orderNo,
  278. },
  279. success: function (data) {
  280. let thisdata = data.data;
  281. if (data.error.length || data.data.list == "") {
  282. if (data.error && data.error.length) {
  283. message.warning(data.error[0].message);
  284. }
  285. } else {
  286. this.setState({
  287. deleteSign:thisdata.deleteSign,
  288. });
  289. }
  290. }.bind(this),
  291. }).always(
  292. function () {
  293. }.bind(this)
  294. );
  295. },
  296. lookflow(){
  297. this.setState({
  298. loading: true,
  299. lookVisible:true,
  300. })
  301. this.state.lookSource=[];
  302. $.ajax({
  303. method: "get",
  304. dataType: "json",
  305. crossDomain: false,
  306. url: globalConfig.context +'/api/admin/order/getBillByOrderNo',
  307. data: {
  308. orderNo:this.props.datauser.orderNo,
  309. },
  310. success: function (data) {
  311. let theArr = [];
  312. if (!data.data) {
  313. if (data.error && data.error.length) {
  314. message.warning(data.error[0].message);
  315. };
  316. } else {
  317. for (let i = 0; i < data.data.length; i++) {
  318. let thisdata = data.data[i];
  319. theArr.push({
  320. key: i,
  321. billNo: thisdata.billNo,
  322. transactionAmount:thisdata.transactionAmount,
  323. createTime:thisdata.createTime,
  324. payerName:thisdata.payerName,
  325. payeeName:thisdata.payeeName,
  326. transactionSubject:thisdata.transactionSubject,
  327. transactionChannel:thisdata.transactionChannel,
  328. financialPayNo:thisdata.financialPayNo,
  329. financialPayTime:thisdata.financialPayTime,
  330. orderNo:thisdata.orderNo,
  331. departmentName:thisdata.departmentName,
  332. salesmanName:thisdata.salesmanName,
  333. financeName:thisdata.financeName,
  334. confirmSign:thisdata.confirmSign,
  335. deleteSign:thisdata.deleteSign,
  336. confirmTime:thisdata.confirmTime
  337. });
  338. };
  339. };
  340. this.setState({
  341. lookflowList: theArr,
  342. });
  343. }.bind(this),
  344. }).always(function () {
  345. this.setState({
  346. loading: false
  347. });
  348. }.bind(this));
  349. },
  350. lookCancel(){
  351. this.setState({
  352. lookVisible:false
  353. })
  354. },
  355. tableRowClick(record, index) {
  356. this.setState({
  357. editFw:record,
  358. projectOperationVisible:true,
  359. });
  360. },
  361. componentWillMount() {
  362. },
  363. componentWillReceiveProps(nextProps) { //props改变时触发
  364. this.state.visible = nextProps.showDesc;
  365. if(nextProps.userDetaile && nextProps.showDesc ) {
  366. this.loaduser(nextProps.datauser);
  367. this.loadData(nextProps.datauser);
  368. this.xiangqings(nextProps.datauser)
  369. }
  370. },
  371. render() {
  372. const FormItem = Form.Item
  373. const formItemLayout = {
  374. labelCol: { span: 8 },
  375. wrapperCol: { span: 14 },
  376. };
  377. const orderDetaiel=this.state.orderList || [];
  378. return(
  379. <div>
  380. <Modal maskClosable={false} visible={this.state.visible}
  381. onOk={this.handleOk} onCancel={this.handleCancel}
  382. width='1000px'
  383. title='订单详情'
  384. footer=''
  385. className="admin-desc-content">
  386. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  387. <Spin spinning={this.state.loading}>
  388. <div className="clearfix">
  389. <div className="clearfix">
  390. <div style={{position:"absolute",top:'-52px',left:'81px',zIndex:10000}}>
  391. <OrderItemStatus deleteSign={this.state.deleteSign}/>
  392. </div>
  393. <FormItem className="half-item"
  394. {...formItemLayout}
  395. label="订单编号" >
  396. <span>{orderDetaiel.orderNo}</span>
  397. </FormItem>
  398. <FormItem className="half-item"
  399. {...formItemLayout}
  400. label="下单时间" >
  401. <span>{orderDetaiel.createTime}</span>
  402. </FormItem>
  403. <FormItem className="half-item"
  404. {...formItemLayout}
  405. label="客户名称" >
  406. <span>
  407. {orderDetaiel.buyerName}
  408. <EnterpriseNameChange
  409. type='journal'
  410. style={{ marginLeft: 10 }}
  411. enterpriseId={orderDetaiel.buyerId}/>
  412. </span>
  413. </FormItem>
  414. <FormItem className="half-item"
  415. {...formItemLayout}
  416. label="订单类型" >
  417. <span>{getOrderType(orderDetaiel.orderType)}</span>
  418. </FormItem>
  419. <FormItem className="half-item"
  420. {...formItemLayout}
  421. label="订单渠道" >
  422. <span>{getOrderChannel(orderDetaiel.orderChannel)}</span>
  423. </FormItem>
  424. <FormItem className="half-item"
  425. {...formItemLayout}
  426. label="订单状态" >
  427. <span>{getOrderState(orderDetaiel.orderStatus)}</span>
  428. </FormItem>
  429. <FormItem className="half-item"
  430. {...formItemLayout}
  431. label="已收款项" >
  432. <span>{orderDetaiel.actuallyTotalAmount+'万元'}</span>
  433. </FormItem>
  434. <FormItem className="half-item"
  435. {...formItemLayout}
  436. label="结算状态" >
  437. <span>{getPaymentState(orderDetaiel.liquidationStatus)}</span>
  438. </FormItem>
  439. <FormItem className="half-item"
  440. {...formItemLayout}
  441. label="市价订单金额" >
  442. <span>{orderDetaiel.orderAmount+'万元'}</span>
  443. </FormItem>
  444. <FormItem className="half-item"
  445. {...formItemLayout}
  446. label="市价首款金额" >
  447. <span>{orderDetaiel.firstPayment+'万元'}</span>
  448. </FormItem>
  449. <div className='clearfix'>
  450. <FormItem className="half-item"
  451. {...formItemLayout}
  452. label="实签订单金额" >
  453. <span>{orderDetaiel.signTotalAmount+'万元'}</span>
  454. </FormItem>
  455. <FormItem className="half-item"
  456. {...formItemLayout}
  457. label="实签首款金额" >
  458. <span>{orderDetaiel.signFirstPayment+'万元'}</span>
  459. </FormItem>
  460. <FormItem className="half-item"
  461. {...formItemLayout}
  462. label="特批立项" >
  463. <span>{getApprovedState(orderDetaiel.approval)}</span>
  464. </FormItem>
  465. <FormItem className="half-item"
  466. {...formItemLayout}
  467. label="合同编号" >
  468. <span>{orderDetaiel.contractNo}</span>
  469. </FormItem>
  470. <div className='clearfix'>
  471. <FormItem
  472. labelCol={{ span: 4 }}
  473. wrapperCol={{ span: 16 }}
  474. label="订单留言" >
  475. <span>{orderDetaiel.orderRemarks}</span>
  476. </FormItem>
  477. </div>
  478. </div>
  479. </div>
  480. <div className='clearfix'>
  481. <FormItem className="half-item"
  482. {...formItemLayout}
  483. label="订单负责人" >
  484. <span>{orderDetaiel.salesmanName}</span>
  485. </FormItem>
  486. <FormItem className="half-item"
  487. {...formItemLayout}
  488. label="业务品类" >
  489. <span>{orderDetaiel.projectType}</span>
  490. </FormItem>
  491. </div>
  492. <div className='clearfix'>
  493. <FormItem className="half-item"
  494. {...formItemLayout}
  495. label="意向时间" >
  496. <span>{orderDetaiel.createTime}</span>
  497. </FormItem>
  498. <FormItem className="half-item"
  499. {...formItemLayout}
  500. label="签单时间" >
  501. <span>{orderDetaiel.signTime}</span>
  502. </FormItem>
  503. <FormItem className="half-item"
  504. {...formItemLayout}
  505. label="财务负责人" >
  506. <span>{orderDetaiel.financeName}</span>
  507. <Button onClick={this.lookflow} style={{float:'right'}}>查看流水</Button>
  508. </FormItem>
  509. <FormItem className="half-item"
  510. {...formItemLayout}
  511. label="项目负责人" >
  512. <span>{orderDetaiel.technicianName}</span>
  513. </FormItem>
  514. <FormItem className="half-item"
  515. {...formItemLayout}
  516. label="立项时间" >
  517. <span>{orderDetaiel.setUpTime}</span>
  518. </FormItem>
  519. <FormItem className="half-item"
  520. {...formItemLayout}
  521. label="项目状态" >
  522. <span>{getProjectState(orderDetaiel.projectStage)}</span>
  523. </FormItem>
  524. </div>
  525. <div>
  526. <span style={{marginLeft:'50px',fontSize:'20px'}}>业务项目</span>
  527. </div>
  528. <div className="patent-table">
  529. <Spin spinning={this.state.loading}>
  530. <Table size="middle" columns={this.state.columns}
  531. dataSource={this.state.dataSource}
  532. pagination={false}
  533. onRowClick={this.tableRowClick}
  534. />
  535. </Spin>
  536. </div>
  537. </div>
  538. </Spin>
  539. </Form >
  540. </Modal>
  541. {this.state.projectOperationVisible ? <ProjectOperation
  542. readOnly={true}
  543. orderNo={this.state.orderNo}
  544. visible={this.state.projectOperationVisible}
  545. dataInfor={this.state.editFw}
  546. onCancel={()=>{
  547. this.setState({
  548. projectOperationVisible: false,
  549. editFw:{},
  550. });
  551. }}
  552. /> : null}
  553. <Modal maskClosable={false} visible={this.state.lookVisible}
  554. onOk={this.lookCancel} onCancel={this.lookCancel}
  555. width='1300px'
  556. title= '查看流水'
  557. footer=''
  558. className="admin-desc-content">
  559. <Form layout="horizontal" id="demand-form">
  560. <Spin spinning={this.state.loading}>
  561. <div className="clearfix">
  562. <Table size="middle" columns={this.state.flowList}
  563. dataSource={this.state.lookflowList}
  564. pagination={false}
  565. />
  566. </div>
  567. </Spin>
  568. </Form >
  569. </Modal>
  570. </div>
  571. )
  572. }
  573. }));
  574. export default ApproveOrderDetaile;