myBillDetaile.jsx 19 KB

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