myBillDetaile.jsx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  1. import React from 'react';
  2. import { Icon, Table, Modal, message, Spin, Input, Select, Button, Form ,Upload,Popconfirm,DatePicker} from 'antd';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import '../../userMangagement.less';
  6. import {getOrderType ,getOrderChannel , getOrderState, getProjectState,getPaymentState ,getApprovedState,getTransactionChannel,getTransactionProject } from '../../../../tools.js';
  7. import moment from 'moment';
  8. const MyBillDetaile = Form.create()(React.createClass({
  9. getInitialState() {
  10. return {
  11. loading: false,
  12. visible: false,
  13. seeOrderVisible:false
  14. };
  15. },
  16. //查看基本详情基本信息
  17. loaduser(record){
  18. if(record){
  19. this.setState({
  20. loading:true
  21. })
  22. $.ajax({
  23. method: "get",
  24. dataType: "json",
  25. crossDomain: false,
  26. url: globalConfig.context + '/api/admin/order/selectBillDetail',
  27. data: {
  28. billNo: record.billNo
  29. },
  30. success: function (data) {
  31. let thisData = data.data;
  32. if (!thisData) {
  33. if (data.error && data.error.length) {
  34. message.warning(data.error[0].message);
  35. };
  36. thisData = {};
  37. };
  38. this.setState({
  39. orderList:thisData,
  40. financialPayNo:thisData.financialPayNo,
  41. financialPayTime:thisData.financialPayTime?moment(thisData.financialPayTime,'YYYY-MM-DD HH:mm:ss'):undefined,
  42. times:thisData.financialPayTime,
  43. remarks:thisData.remarks,
  44. billNoId:record.billNo,
  45. });
  46. }.bind(this),
  47. }).always(function () {
  48. this.setState({
  49. loading: false
  50. });
  51. }.bind(this));
  52. }
  53. },
  54. //保存确认流水
  55. handleSubmit(state){
  56. if(!this.state.times){
  57. if(this.state.selTime==undefined){
  58. message.warning('请选择财务流水时间');
  59. return false;
  60. }
  61. };
  62. this.setState({
  63. loading: true
  64. });
  65. $.ajax({
  66. method: "POST",
  67. dataType: "json",
  68. crossDomain: false,
  69. url: globalConfig.context + '/api/admin/order/updateBill',
  70. data: {
  71. confirm:state?'1':'0',
  72. billNo:this.state.billNoId,
  73. orderNo:this.props.datauser.orderNo,
  74. financialPayNo:this.state.financialPayNo,
  75. financialPayTime:this.state.selTime==undefined?this.state.times:this.state.selTime,
  76. remarks:this.state.remarks
  77. }
  78. }).done(function(data) {
  79. this.setState({
  80. loading: false
  81. });
  82. if(!data.error.length) {
  83. message.success('操作成功!');
  84. this.handleOk()
  85. } else {
  86. message.warning(data.error[0].message);
  87. }
  88. }.bind(this));
  89. },
  90. //时间选择
  91. selTime(e,index){
  92. this.setState({
  93. financialPayTime:e,
  94. selTime:index
  95. })
  96. },
  97. //确认流水
  98. toVoidCancel(){
  99. this.handleSubmit(true)
  100. },
  101. handleOk(e) {
  102. this.setState({
  103. visible: false,
  104. });
  105. this.props.closeDesc(false, true);
  106. },
  107. handleCancel(e) {
  108. this.setState({
  109. visible: false,
  110. });
  111. this.props.closeDesc(false);
  112. },
  113. componentWillMount() {
  114. },
  115. nextCancel() {
  116. this.setState({
  117. addnextVisible: false
  118. })
  119. },
  120. //查看订单
  121. seeOrder(){
  122. this.setState({
  123. seeOrderVisible:true
  124. })
  125. this.seeOrderList()
  126. },
  127. seeOrderCancel(){
  128. this.setState({
  129. seeOrderVisible:false
  130. })
  131. },
  132. seeOrderList(){
  133. this.state.lookOrderList=[];
  134. $.ajax({
  135. method: "get",
  136. dataType: "json",
  137. crossDomain: false,
  138. url: globalConfig.context + '/api/admin/order/getServiceOrderDetail',
  139. data: {
  140. orderNo: this.props.datauser.orderNo
  141. },
  142. success: function (data) {
  143. let thisData = data.data;
  144. if (!thisData) {
  145. if (data.error && data.error.length) {
  146. message.warning(data.error[0].message);
  147. };
  148. thisData = {};
  149. };
  150. this.setState({
  151. id:thisData.id,
  152. lookOrderList:thisData,
  153. });
  154. }.bind(this),
  155. }).always(function () {
  156. this.setState({
  157. loading: false
  158. });
  159. }.bind(this));
  160. },
  161. componentWillReceiveProps(nextProps) { //props改变时触发
  162. this.state.visible = nextProps.showDesc;
  163. if(nextProps.userDetaile && nextProps.showDesc ) {
  164. this.loaduser(nextProps.datauser);
  165. }
  166. },
  167. render() {
  168. const FormItem = Form.Item
  169. const formItemLayout = {
  170. labelCol: { span: 8 },
  171. wrapperCol: { span: 14 },
  172. };
  173. const orderDetaiel=this.state.orderList || [];
  174. const seeOrderDetaiel=this.state.lookOrderList || [];
  175. return(
  176. <div>
  177. <Modal maskClosable={false} visible={this.state.visible}
  178. onOk={this.handleOk} onCancel={this.handleCancel}
  179. width='1200px'
  180. title='流水详情'
  181. footer=''
  182. className="admin-desc-content">
  183. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}}>
  184. <Spin spinning={this.state.loading}>
  185. <div className="clearfix">
  186. <div className="clearfix">
  187. <FormItem className="half-item"
  188. {...formItemLayout}
  189. label="平台流水号" >
  190. <span>{orderDetaiel.billNo}</span>
  191. </FormItem>
  192. <FormItem className="half-item"
  193. {...formItemLayout}
  194. label="平台流水时间" >
  195. <span>{orderDetaiel.createTime}</span>
  196. </FormItem>
  197. <FormItem className="half-item"
  198. {...formItemLayout}
  199. label="流水金额" >
  200. <span>{orderDetaiel.transactionAmount+'万元'}</span>
  201. </FormItem>
  202. <FormItem className="half-item"
  203. {...formItemLayout}
  204. label="流水科目" >
  205. <span>{getTransactionProject(orderDetaiel.transactionSubject)}</span>
  206. </FormItem>
  207. <FormItem className="half-item"
  208. {...formItemLayout}
  209. label="流水状态" >
  210. <span>{orderDetaiel.confirmSign?'已确认':'待确认'}</span>
  211. </FormItem>
  212. <FormItem className="half-item"
  213. {...formItemLayout}
  214. label="付款人名称" >
  215. <span>{orderDetaiel.payerName}</span>
  216. </FormItem>
  217. <FormItem className="half-item"
  218. {...formItemLayout}
  219. label="收款人名称" >
  220. <span>{orderDetaiel.payeeName}</span>
  221. </FormItem>
  222. <FormItem className="half-item"
  223. {...formItemLayout}
  224. label="交易外联" >
  225. <span>{getTransactionChannel(orderDetaiel.transactionChannel)}</span>
  226. </FormItem>
  227. <div className='clearfix'>
  228. <FormItem
  229. labelCol={{ span: 4 }}
  230. wrapperCol={{ span: 16 }}
  231. label="附言" >
  232. <span>{orderDetaiel.postscript}</span>
  233. </FormItem>
  234. </div>
  235. <div className='clearfix'>
  236. <FormItem className="half-item"
  237. {...formItemLayout}
  238. label="订单编号" >
  239. <span>{orderDetaiel.orderNo}</span>
  240. <Button style={{float:'right'}} onClick={this.seeOrder}>查看订单</Button>
  241. </FormItem>
  242. </div>
  243. <div className='clearfix'>
  244. <FormItem className="half-item"
  245. {...formItemLayout}
  246. label="订单负责人" >
  247. <span>{orderDetaiel.salesmanName}</span>
  248. </FormItem>
  249. <FormItem className="half-item"
  250. {...formItemLayout}
  251. label="财务负责人" >
  252. <span>{orderDetaiel.financeName}</span>
  253. </FormItem>
  254. <FormItem className="half-item"
  255. {...formItemLayout}
  256. label="流水确认时间" >
  257. <span>{orderDetaiel.confirmTime}</span>
  258. </FormItem>
  259. </div>
  260. {!this.props.rowClick?<div className='clearfix'>
  261. <FormItem className="half-item"
  262. {...formItemLayout}
  263. label="财务流水号" >
  264. <Input value={this.state.financialPayNo} style={{width:'240px'}} placeholder="请输入财务流水号"
  265. onChange={(e)=>{this.setState({financialPayNo:e.target.value})}} required="required" />
  266. </FormItem>
  267. <FormItem className="half-item"
  268. {...formItemLayout}
  269. label="财务流水时间" >
  270. <DatePicker style={{marginTop:'2px',width:'200px'}}
  271. showTime
  272. format="YYYY-MM-DD HH:mm:ss"
  273. placeholder="选择时间"
  274. value={this.state.financialPayTime}
  275. onChange={(e,time)=>{this.selTime(e,time)}}
  276. />
  277. <span className="mandatory">*</span>
  278. </FormItem>
  279. </div>:<div className='clearfix'>
  280. <FormItem className="half-item"
  281. {...formItemLayout}
  282. label="财务流水号" >
  283. <span>{orderDetaiel.financialPayNo}</span>
  284. </FormItem>
  285. <FormItem className="half-item"
  286. {...formItemLayout}
  287. label="财务流水时间" >
  288. <span>{orderDetaiel.financialPayTime}</span>
  289. </FormItem>
  290. </div>}
  291. {!this.props.rowClick?<div className='clearfix'>
  292. <FormItem
  293. labelCol={{ span: 4 }}
  294. wrapperCol={{ span: 16 }}
  295. label="财务备注" >
  296. <Input type="textarea" placeholder="请输入财务备注" rows={4} value={this.state.remarks}
  297. onChange={(e)=>{this.setState({remarks:e.target.value})}}/>
  298. </FormItem>
  299. </div>:<div className='clearfix'>
  300. <FormItem
  301. labelCol={{ span: 4 }}
  302. wrapperCol={{ span: 16 }}
  303. label="财务备注" >
  304. <span>{orderDetaiel.remarks}</span>
  305. </FormItem>
  306. </div>}
  307. {!this.props.rowClick?<div className='btnSave'>
  308. <Button className="setSave" type="primary" onClick={this.toVoidCancel}>保存信息</Button>
  309. <Button className="cancel" type="ghost" onClick={this.handleCancel}>返回</Button>
  310. </div>:''}
  311. </div>
  312. </div>
  313. </Spin>
  314. </Form >
  315. </Modal>
  316. <Modal maskClosable={false} visible={this.state.seeOrderVisible}
  317. onOk={this.seeOrderCancel} onCancel={this.seeOrderCancel}
  318. width='1200px'
  319. title= '查看订单'
  320. footer=''
  321. className="admin-desc-content">
  322. <Form layout="horizontal" id="demand-form">
  323. <Spin spinning={this.state.loading}>
  324. <div className="clearfix">
  325. <div className="clearfix">
  326. <FormItem className="half-item"
  327. {...formItemLayout}
  328. label="订单编号" >
  329. <span>{seeOrderDetaiel.orderNo}</span>
  330. </FormItem>
  331. <FormItem className="half-item"
  332. {...formItemLayout}
  333. label="下单时间" >
  334. <span>{seeOrderDetaiel.createTime}</span>
  335. </FormItem>
  336. <FormItem className="half-item"
  337. {...formItemLayout}
  338. label="客户名称" >
  339. <span>{seeOrderDetaiel.buyerName}</span>
  340. </FormItem>
  341. <FormItem className="half-item"
  342. {...formItemLayout}
  343. label="订单类型" >
  344. <span>{getOrderType(seeOrderDetaiel.orderType)}</span>
  345. </FormItem>
  346. <FormItem className="half-item"
  347. {...formItemLayout}
  348. label="订单外联" >
  349. <span>{getOrderChannel(seeOrderDetaiel.orderChannel)}</span>
  350. </FormItem>
  351. <FormItem className="half-item"
  352. {...formItemLayout}
  353. label="订单状态" >
  354. <span>{getOrderState(seeOrderDetaiel.orderStatus)}</span>
  355. </FormItem>
  356. <FormItem className="half-item"
  357. {...formItemLayout}
  358. label="已收款项" >
  359. <span>{seeOrderDetaiel.actuallyTotalAmount+'万元'}</span>
  360. </FormItem>
  361. <FormItem className="half-item"
  362. {...formItemLayout}
  363. label="结算状态" >
  364. <span>{getPaymentState(seeOrderDetaiel.liquidationStatus)}</span>
  365. </FormItem>
  366. <FormItem className="half-item"
  367. {...formItemLayout}
  368. label="市价订单金额" >
  369. <span>{seeOrderDetaiel.orderAmount+'万元'}</span>
  370. </FormItem>
  371. <FormItem className="half-item"
  372. {...formItemLayout}
  373. label="市价首款金额" >
  374. <span>{seeOrderDetaiel.firstPayment+'万元'}</span>
  375. </FormItem>
  376. <div className='clearfix'>
  377. <FormItem className="half-item"
  378. {...formItemLayout}
  379. label="实签订单金额" >
  380. <span>{seeOrderDetaiel.signTotalAmount+'万元'}</span>
  381. </FormItem>
  382. <FormItem className="half-item"
  383. {...formItemLayout}
  384. label="实签首款金额" >
  385. <span>{seeOrderDetaiel.signFirstPayment+'万元'}</span>
  386. </FormItem>
  387. <FormItem className="half-item"
  388. {...formItemLayout}
  389. label="特批立项" >
  390. <span>{getApprovedState(seeOrderDetaiel.approval)}</span>
  391. </FormItem>
  392. <div className='clearfix'>
  393. <FormItem
  394. labelCol={{ span: 4 }}
  395. wrapperCol={{ span: 16 }}
  396. label="订单留言" >
  397. <span>{seeOrderDetaiel.orderRemarks}</span>
  398. </FormItem>
  399. </div>
  400. </div>
  401. </div>
  402. <div className='clearfix'>
  403. <FormItem className="half-item"
  404. {...formItemLayout}
  405. label="订单负责人" >
  406. <span>{seeOrderDetaiel.salesmanName}</span>
  407. </FormItem>
  408. <FormItem className="half-item"
  409. {...formItemLayout}
  410. label="意向时间" >
  411. <span>{seeOrderDetaiel.createTime}</span>
  412. </FormItem>
  413. <FormItem className="half-item"
  414. {...formItemLayout}
  415. label="签单时间" >
  416. <span>{seeOrderDetaiel.signTime}</span>
  417. </FormItem>
  418. <FormItem className="half-item"
  419. {...formItemLayout}
  420. label="财务负责人" >
  421. <span>{seeOrderDetaiel.financeName}</span>
  422. </FormItem>
  423. <FormItem className="half-item"
  424. {...formItemLayout}
  425. label="项目负责人" >
  426. <span>{seeOrderDetaiel.technicianName}</span>
  427. </FormItem>
  428. <FormItem className="half-item"
  429. {...formItemLayout}
  430. label="立项时间" >
  431. <span>{seeOrderDetaiel.setUpTime}</span>
  432. </FormItem>
  433. <FormItem className="half-item"
  434. {...formItemLayout}
  435. label="项目状态" >
  436. <span>{getProjectState(seeOrderDetaiel.projectStage)}</span>
  437. </FormItem>
  438. </div>
  439. </div>
  440. </Spin>
  441. </Form >
  442. </Modal>
  443. </div>
  444. )
  445. }
  446. }));
  447. export default MyBillDetaile;