myBillDetaile.jsx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  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. 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. billNoId:record.billNo,
  41. });
  42. }.bind(this),
  43. }).always(function () {
  44. this.setState({
  45. loading: false
  46. });
  47. }.bind(this));
  48. }
  49. },
  50. //保存确认流水
  51. handleSubmit(state){
  52. if(this.state.selTime==undefined){
  53. message.warning('请选择财务流水时间');
  54. return false;
  55. };
  56. this.setState({
  57. loading: true
  58. });
  59. $.ajax({
  60. method: "POST",
  61. dataType: "json",
  62. crossDomain: false,
  63. url: globalConfig.context + '/api/admin/order/confrimBill',
  64. data: {
  65. confirm:state?'1':'0',
  66. billNo:this.state.billNoId,
  67. orderNo:this.props.datauser.orderNo,
  68. financialPayNo:this.state.financialPayNo,
  69. financialPayTime:this.state.selTime,
  70. remarks:this.state.remarks
  71. }
  72. }).done(function(data) {
  73. this.setState({
  74. loading: false
  75. });
  76. if(!data.error.length) {
  77. message.success('已确认!');
  78. this.handleOk()
  79. } else {
  80. message.warning(data.error[0].message);
  81. }
  82. }.bind(this));
  83. },
  84. //时间选择
  85. selTime(e,index){
  86. this.setState({
  87. financialPayTime:e,
  88. selTime:index
  89. })
  90. },
  91. //确认流水
  92. toVoidCancel(){
  93. this.handleSubmit(true)
  94. },
  95. //作废流水
  96. toVoid(){
  97. this.handleSubmit(false)
  98. },
  99. handleOk(e) {
  100. this.setState({
  101. visible: false,
  102. });
  103. this.props.closeDesc(false, true);
  104. },
  105. handleCancel(e) {
  106. this.setState({
  107. visible: false,
  108. });
  109. this.props.closeDesc(false);
  110. },
  111. componentWillMount() {
  112. },
  113. nextCancel() {
  114. this.setState({
  115. addnextVisible: false
  116. })
  117. },
  118. //查看订单
  119. seeOrder(){
  120. this.setState({
  121. seeOrderVisible:true
  122. })
  123. this.seeOrderList()
  124. },
  125. seeOrderCancel(){
  126. this.setState({
  127. seeOrderVisible:false
  128. })
  129. },
  130. seeOrderList(){
  131. this.state.lookOrderList=[];
  132. $.ajax({
  133. method: "get",
  134. dataType: "json",
  135. crossDomain: false,
  136. url: globalConfig.context + '/api/admin/order/getServiceOrderDetail',
  137. data: {
  138. orderNo: this.props.datauser.orderNo
  139. },
  140. success: function (data) {
  141. let thisData = data.data;
  142. if (!thisData) {
  143. if (data.error && data.error.length) {
  144. message.warning(data.error[0].message);
  145. };
  146. thisData = {};
  147. };
  148. this.setState({
  149. id:thisData.id,
  150. lookOrderList:thisData,
  151. });
  152. }.bind(this),
  153. }).always(function () {
  154. this.setState({
  155. loading: false
  156. });
  157. }.bind(this));
  158. },
  159. componentWillReceiveProps(nextProps) { //props改变时触发
  160. this.state.visible = nextProps.showDesc;
  161. if(nextProps.userDetaile && nextProps.showDesc ) {
  162. this.loaduser(nextProps.datauser);
  163. }
  164. },
  165. render() {
  166. const FormItem = Form.Item
  167. const formItemLayout = {
  168. labelCol: { span: 8 },
  169. wrapperCol: { span: 14 },
  170. };
  171. const orderDetaiel=this.state.orderList || [];
  172. const seeOrderDetaiel=this.state.lookOrderList || [];
  173. return(
  174. <div>
  175. <Modal maskClosable={false} visible={this.state.visible}
  176. onOk={this.handleOk} onCancel={this.handleCancel}
  177. width='1200px'
  178. title='流水详情'
  179. footer=''
  180. className="admin-desc-content">
  181. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}}>
  182. <Spin spinning={this.state.loading}>
  183. <div className="clearfix">
  184. <div className="clearfix">
  185. <FormItem className="half-item"
  186. {...formItemLayout}
  187. label="平台流水号" >
  188. <span>{orderDetaiel.billNo}</span>
  189. </FormItem>
  190. <FormItem className="half-item"
  191. {...formItemLayout}
  192. label="平台流水时间" >
  193. <span>{orderDetaiel.createTime}</span>
  194. </FormItem>
  195. <FormItem className="half-item"
  196. {...formItemLayout}
  197. label="流水金额" >
  198. <span>{orderDetaiel.transactionAmount+'万元'}</span>
  199. </FormItem>
  200. <FormItem className="half-item"
  201. {...formItemLayout}
  202. label="流水科目" >
  203. <span>{getTransactionProject(orderDetaiel.transactionSubject)}</span>
  204. </FormItem>
  205. <FormItem className="half-item"
  206. {...formItemLayout}
  207. label="流水状态" >
  208. <span>{orderDetaiel.confirmSign?'已确认':'待确认'}</span>
  209. </FormItem>
  210. <FormItem className="half-item"
  211. {...formItemLayout}
  212. label="付款人名称" >
  213. <span>{orderDetaiel.payerName}</span>
  214. </FormItem>
  215. <FormItem className="half-item"
  216. {...formItemLayout}
  217. label="收款人名称" >
  218. <span>{orderDetaiel.payeeName}</span>
  219. </FormItem>
  220. <FormItem className="half-item"
  221. {...formItemLayout}
  222. label="交易外联" >
  223. <span>{getTransactionChannel(orderDetaiel.transactionChannel)}</span>
  224. </FormItem>
  225. <div className='clearfix'>
  226. <FormItem
  227. labelCol={{ span: 4 }}
  228. wrapperCol={{ span: 16 }}
  229. label="附言" >
  230. <span>{orderDetaiel.postscript}</span>
  231. </FormItem>
  232. </div>
  233. <div className='clearfix'>
  234. <FormItem className="half-item"
  235. {...formItemLayout}
  236. label="订单编号" >
  237. <span>{orderDetaiel.orderNo}</span>
  238. <Button style={{float:'right'}} onClick={this.seeOrder}>查看订单</Button>
  239. </FormItem>
  240. </div>
  241. <div className='clearfix'>
  242. <FormItem className="half-item"
  243. {...formItemLayout}
  244. label="订单负责人" >
  245. <span>{orderDetaiel.salesmanName}</span>
  246. </FormItem>
  247. <FormItem className="half-item"
  248. {...formItemLayout}
  249. label="财务负责人" >
  250. <span>{orderDetaiel.financeName}</span>
  251. </FormItem>
  252. <FormItem className="half-item"
  253. {...formItemLayout}
  254. label="流水确认时间" >
  255. <span>{orderDetaiel.confirmTime}</span>
  256. </FormItem>
  257. </div>
  258. {!this.props.rowClick?<div className='clearfix'>
  259. <FormItem className="half-item"
  260. {...formItemLayout}
  261. label="财务流水号" >
  262. <Input value={this.state.financialPayNo} style={{width:'240px'}} placeholder="请输入财务流水号"
  263. onChange={(e)=>{this.setState({financialPayNo:e.target.value})}} required="required" />
  264. </FormItem>
  265. <FormItem className="half-item"
  266. {...formItemLayout}
  267. label="财务流水时间" >
  268. <DatePicker
  269. style={{marginTop:'0',width:'200px',height:'27px'}}
  270. showTime
  271. format="YYYY-MM-DD HH:mm:ss"
  272. placeholder="选择时间"
  273. value={this.state.financialPayTime}
  274. onChange={(e,time)=>{this.selTime(e,time)}}
  275. />
  276. <span className="mandatory">*</span>
  277. </FormItem>
  278. </div>:<div className='clearfix'>
  279. <FormItem className="half-item"
  280. {...formItemLayout}
  281. label="财务流水号" >
  282. <span>{orderDetaiel.financialPayNo}</span>
  283. </FormItem>
  284. <FormItem className="half-item"
  285. {...formItemLayout}
  286. label="财务流水时间" >
  287. <span>{orderDetaiel.financialPayTime}</span>
  288. </FormItem>
  289. </div>}
  290. {!this.props.rowClick?<div className='clearfix'>
  291. <FormItem
  292. labelCol={{ span: 4 }}
  293. wrapperCol={{ span: 16 }}
  294. label="财务备注" >
  295. <Input type="textarea" placeholder="请输入财务备注" rows={4} value={this.state.remarks}
  296. onChange={(e)=>{this.setState({remarks:e.target.value})}}/>
  297. </FormItem>
  298. </div>:<div className='clearfix'>
  299. <FormItem
  300. labelCol={{ span: 4 }}
  301. wrapperCol={{ span: 16 }}
  302. label="财务备注" >
  303. <span>{orderDetaiel.remarks}</span>
  304. </FormItem>
  305. </div>}
  306. {!this.props.rowClick?<div className='btnSave'>
  307. <Button className="setSave" type="primary" onClick={this.toVoidCancel}>确认流水</Button>
  308. <Button className="toVoid" type="danger" onClick={this.toVoid}>作废流水</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;