myBill.jsx 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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} from '../../../tools.js';
  11. const MyBill=Form.create()(React.createClass({
  12. loadData(pageNo) {
  13. this.state.data = [];
  14. this.setState({
  15. loading: true
  16. });
  17. $.ajax({
  18. method: "post",
  19. dataType: "json",
  20. crossDomain: false,
  21. url: globalConfig.context + '/api/admin/roles',
  22. data: {
  23. pageNo: pageNo || 1,
  24. pageSize: this.state.pagination.pageSize,
  25. draweeName:this.state.draweeName,//付款人名称
  26. payeeName:this.state.payeeName,//付款人名称
  27. term:this.state.term,//是否有效
  28. orderNumber:this.state.orderNumber,//订单编号
  29. orderDepartment:this.state.orderDepartment,//订单部门
  30. orderLeader: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. id: thisdata.id,
  44. roleName: thisdata.roleName,
  45. creater:thisdata.creater,
  46. createTime:thisdata.createTimez,
  47. });
  48. };
  49. this.state.pagination.current = data.data.pageNo;
  50. this.state.pagination.total = data.data.totalCount;
  51. };
  52. if(!data.data.list.length){
  53. this.state.pagination.current=0
  54. this.state.pagination.total=0
  55. }
  56. this.setState({
  57. dataSource: theArr,
  58. pagination: this.state.pagination,
  59. selectedRowKeys:[]
  60. });
  61. }.bind(this),
  62. }).always(function () {
  63. this.setState({
  64. loading: false
  65. });
  66. }.bind(this));
  67. },
  68. getInitialState() {
  69. return {
  70. datauser:{},
  71. selectedRowKeys: [],
  72. selectedRows: [],
  73. searchMore: true,
  74. loading: false,
  75. visible:false,
  76. showDesc:false,
  77. pagination: {
  78. defaultCurrent: 1,
  79. defaultPageSize: 10,
  80. showQuickJumper: true,
  81. pageSize: 10,
  82. onChange: function (page) {
  83. this.loadData(page);
  84. }.bind(this),
  85. showTotal: function (total) {
  86. return '共' + total + '条数据';
  87. }
  88. },
  89. columns: [
  90. {
  91. title: '平台流水号',
  92. dataIndex: 'roleName',
  93. key: 'roleName'
  94. }, {
  95. title: '平台流水时间',
  96. dataIndex: 'creater',
  97. key: 'creater'
  98. }, {
  99. title: '流水金额',
  100. dataIndex: 'creater7',
  101. key: 'creater7'
  102. },{
  103. title: '付款人名称',
  104. dataIndex: 'roleName1',
  105. key: 'roleName1'
  106. }, {
  107. title: '收款人名称',
  108. dataIndex: 'c',
  109. key: 'c'
  110. },
  111. {
  112. title: '流水科目',
  113. dataIndex: 'creater1',
  114. key: 'creater1'
  115. }, {
  116. title: '流水方式',
  117. dataIndex: 'createTime1',
  118. key: 'createTime1',
  119. render:(text)=>{return getIntentProgress(text) }
  120. },{
  121. title: '财务流水号',
  122. dataIndex: 'roleName2',
  123. key: 'roleName2',
  124. render:(text)=>{return getTransactionProgress(text) }
  125. }, {
  126. title: '财务流水时间',
  127. dataIndex: 'creater2',
  128. key: 'creater2',
  129. render:(text)=>{return getContractProgress(text) }
  130. }, {
  131. title: '流水确认',
  132. dataIndex: 'creatu',
  133. key: 'creatu',
  134. render:(text)=>{return getProjectProgress(text) }
  135. },{
  136. title: '确认时间',
  137. dataIndex: 'cre',
  138. key: 'cre',
  139. render:(text)=>{return getProjectProgress(text) }
  140. },{
  141. title: '订单编号',
  142. dataIndex: 'crea1tu',
  143. key: 'crea1tu',
  144. render:(text)=>{return getProjectProgress(text) }
  145. },{
  146. title: '订单负责人',
  147. dataIndex: 'c2re',
  148. key: 'c2re',
  149. render:(text)=>{return getProjectProgress(text) }
  150. },{
  151. title: '是否有效',
  152. dataIndex: 'c22re',
  153. key: 'c22re',
  154. render:(text)=>{return getProjectProgress(text) }
  155. },
  156. {
  157. title: '操作',
  158. dataIndex: 'operation',
  159. key: 'operation',
  160. render: (text, record, index) => {
  161. return <div>
  162. <Button style={{marginRight:'5px'}} type="danger" onClick={(e) =>{this.reject(record) }}>作废</Button>
  163. <Button style={{marginRight:'5px'}} type="primary" onClick={(e) =>{this.reject(record) }}>确认</Button>
  164. </div>
  165. }
  166. }
  167. ],
  168. dataSource: [],
  169. };
  170. },
  171. //操作分配
  172. confirmDelet(index){
  173. this.setState({
  174. userDetaile:false,
  175. });
  176. this.contactList(1,index.id)
  177. },
  178. //驳回
  179. reject(record){
  180. this.state.userDetaile=true;
  181. this.state.datauser = record;
  182. this.setState({
  183. showDesc: true
  184. });
  185. },
  186. componentWillMount() {
  187. this.loadData();
  188. },
  189. // tableRowClick(record, index) {
  190. // this.state.userDetaile=true;
  191. // this.state.datauser = record;
  192. // this.setState({
  193. // showDesc: true
  194. // });
  195. // },
  196. closeDesc(e, s) {
  197. this.state.userDetaile=false;
  198. this.state.showDesc = e;
  199. if (s) {
  200. this.loadData();
  201. };
  202. },
  203. searchSwitch() {
  204. this.setState({
  205. searchMore: !this.state.searchMore
  206. });
  207. },
  208. search() {
  209. this.loadData();
  210. },
  211. //分配时搜索
  212. searchOrder() {
  213. this.contactList();
  214. },
  215. //分配时重置
  216. resetOrder() {
  217. this.contactList();
  218. },
  219. reset() {
  220. this.state.draweeName='';
  221. this.state.payeeName='';
  222. this.state.pipelining = undefined;
  223. this.state.term = undefined;
  224. this.state.orderNumber = '';
  225. this.state.orderDepartment = '';
  226. this.state.orderLeader = '';
  227. this.loadData();
  228. },
  229. render() {
  230. const rowSelection = {
  231. selectedRowKeys: this.state.selectedRowKeys,
  232. onChange: (selectedRowKeys, selectedRows) => {
  233. this.setState({
  234. selectedRows: selectedRows.slice(-1),
  235. selectedRowKeys: selectedRowKeys.slice(-1)
  236. });
  237. },
  238. onSelectAll: (selected, selectedRows, changeRows) => {
  239. this.setState({
  240. selectedRowKeys:[]
  241. })
  242. },
  243. };
  244. const hasSelected = this.state.selectedRowKeys.length > 0;
  245. return (
  246. <div className="user-content" >
  247. <div className="content-title">
  248. <span style={{fontSize:'16px'}}>我的结算流水</span>
  249. <div className="user-search">
  250. <Input placeholder="付款人名称" style={{width:'150px'}}
  251. value={this.state.draweeName}
  252. onChange={(e) => { this.setState({ draweeName: e.target.value }); }} />
  253. <Input placeholder="收款人名称" style={{width:'150px'}}
  254. value={this.state.payeeName}
  255. onChange={(e) => { this.setState({ payeeName: e.target.value }); }} />
  256. <Select placeholder="流水确认"
  257. style={{ width: 150 ,marginRight:'10px'}}
  258. value={this.state.pipelining}
  259. onChange={(e) => { this.setState({ pipelining: e }) }}>
  260. {
  261. lvl.map(function (item) {
  262. return <Select.Option key={item.value} >{item.key}</Select.Option>
  263. })
  264. }
  265. </Select>
  266. <Select placeholder="是否有效"
  267. style={{ width: 150 ,marginRight:'10px'}}
  268. value={this.state.term}
  269. onChange={(e) => { this.setState({ term: e }) }}>
  270. <Select.Option value='0'>无效</Select.Option>
  271. <Select.Option value='1'>有效</Select.Option>
  272. </Select>
  273. <Button type="primary" onClick={this.search} style={{marginLeft:'10px'}}>搜索</Button>
  274. <Button onClick={this.reset}>重置</Button>
  275. <span style={{marginLeft:'10px',marginRight:'20px'}}>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  276. </div>
  277. <div className='clearfix' style={{marginTop:'5px'}}>
  278. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
  279. <Input placeholder="订单编号" style={{width:'150px'}}
  280. value={this.state.orderNumber}
  281. onChange={(e) => { this.setState({ orderNumber: e.target.value }); }} />
  282. <Input placeholder="订单部门" style={{width:'150px',marginLeft:'10px',marginRight:'10px'}}
  283. value={this.state.orderDepartment}
  284. onChange={(e) => { this.setState({ orderDepartment: e.target.value }); }} />
  285. <Input placeholder="订单负责人" style={{width:'150px'}}
  286. value={this.state.orderLeader}
  287. onChange={(e) => { this.setState({ orderLeader: e.target.value }); }} />
  288. </div>
  289. </div>
  290. <div className="patent-table">
  291. <Spin spinning={this.state.loading}>
  292. <Table columns={this.state.columns}
  293. dataSource={this.state.dataSource}
  294. rowSelection={rowSelection}
  295. pagination={this.state.pagination}
  296. />
  297. </Spin>
  298. </div>
  299. <MyBillDetaile
  300. confirmDelet={this.confirmDelet}
  301. userDetaile={this.state.userDetaile}
  302. datauser={this.state.datauser}
  303. showDesc={this.state.showDesc}
  304. closeDesc={this.closeDesc} />
  305. </div >
  306. </div>
  307. );
  308. }
  309. }));
  310. export default MyBill;