myBill.jsx 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. import React from 'react';
  2. import ReactDom from 'react-dom';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import { Form,Radio, Icon, Button, Input, Select, Spin, Table, Switch, message, Modal, Upload ,Popconfirm,Checkbox} from 'antd';
  6. import MyBillDetaile from "./myBillDetaile.jsx";
  7. import moment from 'moment';
  8. import '../../userMangagement.less';
  9. import {lvl,intentProgress,transactionProgress,contractProgress,projectProgress} from '../../../../dataDic.js';
  10. import {getIntentProgress,getTransactionProgress,getContractProgress,getProjectProgress,getTransactionChannel,getTransactionProject} from '../../../../tools.js';
  11. const MyBill=Form.create()(React.createClass({
  12. loadData(pageNo) {
  13. this.setState({
  14. loading: true
  15. });
  16. $.ajax({
  17. method: "post",
  18. dataType: "json",
  19. crossDomain: false,
  20. url: globalConfig.context + '/api/admin/order/listMyBill',
  21. data: {
  22. pageNo: pageNo || 1,
  23. pageSize: this.state.pagination.pageSize,
  24. payerName:this.state.draweeName,//付款人名称
  25. depId:this.state.departmenttSearch,//部门
  26. confirmSign:this.state.confirmSignSearch,//流水确认
  27. payeeName:this.state.payeeName,//收款人名称
  28. deleteSign:this.state.term,//是否有效
  29. orderNo:this.state.orderNumber,//订单编号
  30. salesmanName:this.state.orderLeader,//订单负责人
  31. },
  32. success: function (data) {
  33. let theArr = [];
  34. if (!data.data) {
  35. if (data.error && data.error.length) {
  36. message.warning(data.error[0].message);
  37. };
  38. } else {
  39. for (let i = 0; i < data.data.list.length; i++) {
  40. let thisdata = data.data.list[i];
  41. theArr.push({
  42. key: i,
  43. billNo: thisdata.billNo,
  44. transactionAmount:thisdata.transactionAmount,
  45. createTime:thisdata.createTime,
  46. transactionAmount:thisdata.transactionAmount,
  47. payerName:thisdata.payerName,
  48. payeeName:thisdata.payeeName,
  49. transactionSubject:thisdata.transactionSubject,
  50. transactionChannel:thisdata.transactionChannel,
  51. financialPayNo:thisdata.financialPayNo,
  52. financialPayTime:thisdata.financialPayTime,
  53. orderNo:thisdata.orderNo,
  54. departmentName:thisdata.departmentName,
  55. salesmanName:thisdata.salesmanName,
  56. financeName:thisdata.financeName,
  57. confirmSign:thisdata.confirmSign,
  58. deleteSign:thisdata.deleteSign,
  59. confirmTime:thisdata.confirmTime
  60. });
  61. };
  62. this.state.pagination.current = data.data.pageNo;
  63. this.state.pagination.total = data.data.totalCount;
  64. };
  65. if(!data.data.list.length){
  66. this.state.pagination.current=0
  67. this.state.pagination.total=0
  68. }
  69. this.setState({
  70. pageNo:pageNo,
  71. dataSource: theArr,
  72. pagination: this.state.pagination,
  73. selectedRowKeys:[]
  74. });
  75. }.bind(this),
  76. }).always(function () {
  77. this.setState({
  78. loading: false
  79. });
  80. }.bind(this));
  81. },
  82. //部门
  83. departmentList() {
  84. this.setState({
  85. loading: true
  86. });
  87. $.ajax({
  88. method: "get",
  89. dataType: "json",
  90. crossDomain: false,
  91. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  92. data: {
  93. },
  94. success: function(data) {
  95. let thedata = data.data;
  96. let theArr=[];
  97. if(!thedata) {
  98. if(data.error && data.error.length) {
  99. message.warning(data.error[0].message);
  100. };
  101. thedata = {};
  102. }else{
  103. thedata.map(function(item,index){
  104. theArr.push({
  105. key:index,
  106. name:item.name,
  107. id:item.id,
  108. })
  109. })
  110. }
  111. this.setState({
  112. departmentArr:theArr,
  113. })
  114. }.bind(this),
  115. }).always(function() {
  116. this.setState({
  117. loading: false
  118. });
  119. }.bind(this));
  120. },
  121. getInitialState() {
  122. return {
  123. datauser:{},
  124. selectedRowKeys: [],
  125. selectedRows: [],
  126. searchMore: true,
  127. departmentArr:[],
  128. loading: false,
  129. visible:false,
  130. showDesc:false,
  131. pagination: {
  132. defaultCurrent: 1,
  133. defaultPageSize: 10,
  134. showQuickJumper: true,
  135. pageSize: 10,
  136. onChange: function (page) {
  137. this.loadData(page);
  138. }.bind(this),
  139. showTotal: function (total) {
  140. return '共' + total + '条数据';
  141. }
  142. },
  143. columns: [
  144. {
  145. title: '平台流水号',
  146. dataIndex: 'billNo',
  147. key: 'billNo',
  148. render:(text)=>{
  149. return text&&text.substr(0,9)+'…'
  150. }
  151. }, {
  152. title: '平台流水时间',
  153. dataIndex: 'createTime',
  154. key: 'createTime'
  155. }, {
  156. title: '流水金额(万元)',
  157. dataIndex: 'transactionAmount',
  158. key: 'transactionAmount'
  159. },{
  160. title: '付款人名称',
  161. dataIndex: 'payerName',
  162. key: 'payerName'
  163. }, {
  164. title: '收款人名称',
  165. dataIndex: 'payeeName',
  166. key: 'payeeName'
  167. },
  168. {
  169. title: '流水科目',
  170. dataIndex: 'transactionSubject',
  171. key: 'transactionSubject',
  172. render:(text)=>{return getTransactionProject(text) }
  173. }, {
  174. title: '流水渠道',
  175. dataIndex: 'transactionChannel',
  176. key: 'transactionChannel',
  177. render:(text)=>{return getTransactionChannel(text) }
  178. },{
  179. title: '财务流水号',
  180. dataIndex: 'financialPayNo',
  181. key: 'financialPayNo',
  182. }, {
  183. title: '财务流水时间',
  184. dataIndex: 'financialPayTime',
  185. key: 'financialPayTime',
  186. }, {
  187. title: '流水确认',
  188. dataIndex: 'confirmSign',
  189. key: 'confirmSign',
  190. render:(text)=>{return text?'已确认':'待确认' }
  191. },{
  192. title: '确认时间',
  193. dataIndex: 'confirmTime',
  194. key: 'confirmTime',
  195. },{
  196. title: '订单编号',
  197. dataIndex: 'orderNo',
  198. key: 'orderNo',
  199. },{
  200. title: '订单负责人',
  201. dataIndex: 'salesmanName',
  202. key: 'salesmanName',
  203. },{
  204. title: '是否有效',
  205. dataIndex: 'deleteSign',
  206. key: 'deleteSign',
  207. render:(text)=>{return text==0?'有效':'作废' }
  208. },
  209. ],
  210. dataSource: [],
  211. };
  212. },
  213. //驳回
  214. reject(record){
  215. this.state.userDetaile=true;
  216. this.state.datauser = record;
  217. this.setState({
  218. rowClick:false,
  219. showDesc: true
  220. });
  221. },
  222. componentWillMount() {
  223. this.loadData()
  224. this.departmentList();
  225. },
  226. closeDesc(e, s) {
  227. this.state.userDetaile=false;
  228. this.state.showDesc = e;
  229. if (s) {
  230. this.loadData(this.state.pageNo);
  231. };
  232. },
  233. searchSwitch() {
  234. this.setState({
  235. searchMore: !this.state.searchMore
  236. });
  237. },
  238. search() {
  239. this.loadData();
  240. },
  241. reset() {
  242. this.state.draweeName='';
  243. this.state.payeeName='';
  244. this.state.term = undefined;
  245. this.state.orderNumber = '';
  246. this.state.confirmSignSearch=undefined;
  247. this.state.departmenttSearch = undefined;
  248. this.state.orderLeader = '';
  249. this.loadData();
  250. },
  251. tableRowClick(record, index) {
  252. this.state.userDetaile=true;
  253. this.state.datauser = record;
  254. this.setState({
  255. rowClick:true,
  256. signBillState:true,
  257. showDesc: true
  258. });
  259. },
  260. render() {
  261. const rowSelection = {
  262. selectedRowKeys: this.state.selectedRowKeys,
  263. onChange: (selectedRowKeys, selectedRows) => {
  264. this.setState({
  265. selectedRows: selectedRows.slice(-1),
  266. selectedRowKeys: selectedRowKeys.slice(-1)
  267. });
  268. },
  269. onSelectAll: (selected, selectedRows, changeRows) => {
  270. this.setState({
  271. selectedRowKeys:[]
  272. })
  273. },
  274. };
  275. let departmentArr = this.state.departmentArr || [];
  276. const hasSelected = this.state.selectedRowKeys.length > 0;
  277. return (
  278. <div className="user-content" >
  279. <div className="content-title">
  280. <span style={{fontSize:'16px'}}>结算流水查询</span>
  281. <div className="user-search">
  282. <Input placeholder="付款人名称" style={{width:'150px'}}
  283. value={this.state.draweeName}
  284. onChange={(e) => { this.setState({ draweeName: e.target.value }); }} />
  285. <Input placeholder="收款人名称" style={{width:'150px'}}
  286. value={this.state.payeeName}
  287. onChange={(e) => { this.setState({ payeeName: e.target.value }); }} />
  288. <Select placeholder="流水确认"
  289. style={{ width: 150 ,marginRight:'10px'}}
  290. value={this.state.confirmSignSearch}
  291. onChange={(e) => { this.setState({ confirmSignSearch: e }) }}>
  292. <Select.Option value='0'>待确认</Select.Option>
  293. <Select.Option value='1'>已确认</Select.Option>
  294. </Select>
  295. <Select placeholder="是否有效"
  296. style={{ width: 150 ,marginRight:'10px'}}
  297. value={this.state.term}
  298. onChange={(e) => { this.setState({ term: e }) }}>
  299. <Select.Option value='0'>有效</Select.Option>
  300. <Select.Option value='1'>作废</Select.Option>
  301. </Select>
  302. <Button type="primary" onClick={this.search} style={{marginLeft:'10px'}}>搜索</Button>
  303. <Button onClick={this.reset}>重置</Button>
  304. <span style={{marginLeft:'10px',marginRight:'20px'}}>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  305. </div>
  306. <div className='clearfix' style={{marginTop:'5px'}}>
  307. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
  308. <Input placeholder="订单编号" style={{width:'150px'}}
  309. value={this.state.orderNumber}
  310. onChange={(e) => { this.setState({ orderNumber: e.target.value }); }} />
  311. <Select placeholder="订单部门"
  312. style={{ width: 150 ,marginRight:'10px',marginLeft:'10px'}}
  313. value={this.state.departmenttSearch}
  314. onChange={(e) => { this.setState({ departmenttSearch: e }) }}>
  315. {
  316. departmentArr.map(function (item) {
  317. return <Select.Option key={item.id} >{item.name}</Select.Option>
  318. })
  319. }
  320. </Select>
  321. <Input placeholder="订单负责人" style={{width:'150px',marginBottom:'10px'}}
  322. value={this.state.orderLeader}
  323. onChange={(e) => { this.setState({ orderLeader: e.target.value }); }} />
  324. </div>
  325. </div>
  326. <div className="patent-table">
  327. <Spin spinning={this.state.loading}>
  328. <Table columns={this.state.columns}
  329. dataSource={this.state.dataSource}
  330. rowSelection={rowSelection}
  331. pagination={this.state.pagination}
  332. onRowClick={this.tableRowClick}
  333. />
  334. </Spin>
  335. </div>
  336. <MyBillDetaile
  337. rowClick={this.state.rowClick}
  338. userDetaile={this.state.userDetaile}
  339. datauser={this.state.datauser}
  340. showDesc={this.state.showDesc}
  341. closeDesc={this.closeDesc} />
  342. </div >
  343. </div>
  344. );
  345. }
  346. }));
  347. export default MyBill;