index.jsx 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. import React,{Component} from 'react';
  2. import $ from "jquery/src/ajax";
  3. import {
  4. Spin,
  5. Table,
  6. message,
  7. Tooltip, Tabs, Button,Modal
  8. } from "antd";
  9. import {ShowModal,getProjectStatus} from "@/tools";
  10. import FilterColumn from './filterColumn';
  11. import DetailsModal from './detailsModal/index';
  12. import OrderPaymentModal from './component/orderPaymentModal';
  13. import './index.less';
  14. import CheckProject from "../../../components/checkProject";
  15. import PayRecord from "../../../components/checkProject/payRecord";
  16. const { TabPane } = Tabs;
  17. class PayApplyReject extends Component{
  18. constructor(props) {
  19. super(props);
  20. this.state={
  21. loading: true,
  22. columns: [
  23. {
  24. title: "支付编号",
  25. dataIndex: "key",
  26. key: "key",
  27. },
  28. {
  29. title: "项目编号",
  30. dataIndex: "tid",
  31. key: "tid",
  32. },
  33. {
  34. title: "项目名称",
  35. dataIndex: "pname",
  36. key: "pname",
  37. },
  38. {
  39. title: "项目状态",
  40. dataIndex: "projectStatus",
  41. key: "projectStatus",
  42. render: (text) => {
  43. return getProjectStatus(text);
  44. },
  45. },
  46. {
  47. title: "分类名称",
  48. dataIndex: "cname",
  49. key: "cname",
  50. },
  51. {
  52. title: "合同编号",
  53. dataIndex: "contractNo",
  54. key: "contractNo",
  55. },
  56. {
  57. title: "订单编号",
  58. dataIndex: "orderNo",
  59. key: "orderNo",
  60. },
  61. {
  62. title: "客户名称",
  63. dataIndex: "userName",
  64. key: "userName",
  65. render: (text) => {
  66. return (
  67. <Tooltip placement="bottom" title={text && text.length > 9 ? text : ''}>
  68. {text && text.length > 9 ? text.substr(0, 9) + "..." : text}
  69. </Tooltip>
  70. )
  71. },
  72. },
  73. {
  74. title: "部门名称",
  75. dataIndex: "depName",
  76. key: "depName",
  77. render: (text) => {
  78. return (
  79. <Tooltip placement="bottom" title={text && text.length > 9 ? text : ''}>
  80. {text && text.length > 9 ? text.substr(0, 9) + "..." : text}
  81. </Tooltip>
  82. )
  83. },
  84. },
  85. // {
  86. // title: "实际总付款",
  87. // dataIndex: "costAmount",
  88. // key: "costAmount",
  89. // },
  90. {
  91. title: "付款类型",
  92. dataIndex: "chooseType",
  93. key: "chooseType",
  94. render: (text) => {
  95. return text == 0 ? '第三方成本' :
  96. text == 1 ? '催款节点' :'官费';
  97. },
  98. },
  99. {
  100. title: "本次申请金额",
  101. dataIndex: "applicationAmount",
  102. key: "applicationAmount",
  103. render: (text) => {
  104. return isNaN(parseFloat(text)) ? text : parseFloat(text);
  105. }
  106. },
  107. {
  108. title: "已支付",
  109. dataIndex: "paymentAmount",
  110. key: "paymentAmount",
  111. render: (text) => {
  112. return isNaN(parseFloat(text)) ? text : parseFloat(text);
  113. },
  114. },
  115. {
  116. title: "申请人",
  117. dataIndex: "aname",
  118. key: "aname",
  119. },
  120. {
  121. title: "财务名称",
  122. dataIndex: "financeName",
  123. key: "financeName",
  124. },
  125. {
  126. title: "状态",
  127. dataIndex: "status",
  128. key: "status",
  129. render: (text) => {
  130. return text === 0 ? '审核' :
  131. text === 1 ? '待支付' :
  132. text === 2 ? '驳回' :
  133. text === 3 ? '已支付' :
  134. text === 4 ? '已取消' : '';
  135. },
  136. },
  137. {
  138. title: "创建时间",
  139. dataIndex: "createTime",
  140. key: "createTime",
  141. },
  142. {
  143. title: '操作',
  144. dataIndex: 'action',
  145. key: 'action',
  146. render: (text, record) => {
  147. return (
  148. <div style={{
  149. display:'flex',
  150. alignItems:'center',
  151. }}>
  152. <Button type="primary" size="small" onClick={(e) => {
  153. e.stopPropagation();
  154. this.setState({
  155. payRecordVisible: true,
  156. orderPaymentsId: record.id,
  157. tid: record.tid,
  158. projectType: record.projectType,
  159. })
  160. }}>
  161. {
  162. record.status === 0 ? '待审核' :
  163. record.status === 1 ? '待支付' :
  164. record.status === 2 ? '查看详情' : '查看详情'
  165. }
  166. </Button>
  167. <Button
  168. type="primary"
  169. style={{
  170. marginLeft: "10px",
  171. background: "orangered",
  172. border: "none"
  173. }}
  174. size="small"
  175. onClick={(e) => {
  176. e.stopPropagation();
  177. this.setState({
  178. paymentVisible: true,
  179. tid: record.tid,
  180. projectType: record.projectType,
  181. })
  182. }}>
  183. 付款记录
  184. </Button>
  185. </div>
  186. )
  187. }
  188. }
  189. ],
  190. dataSource: [],
  191. selectedRowKeys: [],
  192. pagination: {
  193. defaultCurrent: 1,
  194. defaultPageSize: 10,
  195. showQuickJumper: true,
  196. pageSize: 10,
  197. onChange: function (page) {
  198. this.loadData(page);
  199. }.bind(this),
  200. showTotal: function (total) {
  201. return "共" + total + "条数据";
  202. },
  203. },
  204. page: 1,
  205. selectInfor: {},
  206. visible: false,
  207. paymentVisible: false,
  208. tid: 0,
  209. projectType: 0,
  210. payRecordVisible: false,
  211. orderPaymentsId: 0,
  212. }
  213. }
  214. componentDidMount() {
  215. this.loadData()
  216. }
  217. loadData(pageNo,data={}) {
  218. this.setState({
  219. loading: true,
  220. });
  221. data.pageNo = pageNo || 1;
  222. data.pageSize = this.state.pagination.pageSize;
  223. data.status = 2; //驳回状态
  224. $.ajax({
  225. method: "get",
  226. dataType: "json",
  227. crossDomain: false,
  228. url: globalConfig.context + "/api/admin/company/selectPaymentList",
  229. data: data,
  230. success: function (data) {
  231. ShowModal(this);
  232. let theArr = [];
  233. if (data.error.length || data.data.list == "") {
  234. if (data.error && data.error.length) {
  235. message.warning(data.error[0].message);
  236. }
  237. } else {
  238. this.setState({
  239. page: data.data.pageNo
  240. });
  241. for (let i = 0; i < data.data.list.length; i++) {
  242. let thisdata = data.data.list[i];
  243. let obj = thisdata;
  244. obj.key = thisdata.id;
  245. theArr.push(obj);
  246. }
  247. this.state.pagination.total = data.data.totalCount;
  248. }
  249. if (data.data && data.data.list && !data.data.list.length) {
  250. this.state.pagination.total = 0;
  251. }
  252. this.setState({
  253. dataSource: theArr,
  254. pageNo: pageNo,
  255. pagination: this.state.pagination,
  256. });
  257. }.bind(this),
  258. }).always(
  259. function () {
  260. this.setState({
  261. loading: false,
  262. });
  263. }.bind(this)
  264. );
  265. }
  266. tableRowClick(record){
  267. this.setState({
  268. visible: true,
  269. selectInfor: record,
  270. })
  271. }
  272. render() {
  273. return (
  274. <div className="user-content">
  275. <div className="content-title">
  276. <span>付款驳回列表</span>
  277. </div>
  278. <div style={{paddingTop:'10px'}}>
  279. <FilterColumn
  280. {...this.props}
  281. onSearch={(data)=>{
  282. this.setState({
  283. searchInfor: data
  284. });
  285. this.loadData(1,data);
  286. }}
  287. onResetSearch={()=>{
  288. this.setState({
  289. searchInfor: {}
  290. });
  291. this.loadData();
  292. }}
  293. />
  294. </div>
  295. <div className="patent-table">
  296. <Spin spinning={this.state.loading}>
  297. <Table
  298. columns={this.state.columns}
  299. dataSource={this.state.dataSource}
  300. pagination={this.state.pagination}
  301. onRowClick={(record)=>{
  302. this.tableRowClick(record)
  303. }}
  304. scroll={{ x: "max-content", y: 0 }}
  305. bordered
  306. size="small"
  307. />
  308. </Spin>
  309. </div>
  310. {
  311. this.state.visible ?
  312. <DetailsModal
  313. tid={this.state.selectInfor.tid}
  314. orderNo={this.state.selectInfor.orderNo}
  315. projectType={this.state.selectInfor.projectType}
  316. projectStatus={this.state.selectInfor.projectStatus}
  317. taskName={this.state.selectInfor.pname}
  318. taskID={this.state.selectInfor.tid}
  319. visible={this.state.visible}
  320. refreshList={()=>{
  321. this.loadData(this.state.page,this.state.searchInfor);
  322. }}
  323. visitCancel={()=>{
  324. this.setState({
  325. visible: false
  326. })
  327. }}/> : <div/>
  328. }
  329. {this.state.paymentVisible ?
  330. <OrderPaymentModal
  331. tid={this.state.tid}
  332. visible={this.state.paymentVisible}
  333. projectType={this.state.projectType}
  334. onCancer={()=>{
  335. this.setState({
  336. paymentVisible: false,
  337. tid: 0,
  338. projectType: 0,
  339. });
  340. this.loadData(this.state.page,this.state.searchInfor);
  341. }}
  342. onSuccess={()=>{
  343. this.setState({
  344. paymentVisible: false,
  345. tid: 0,
  346. projectType: 0,
  347. });
  348. this.loadData(this.state.page,this.state.searchInfor);
  349. }}/> :
  350. <div/>
  351. }
  352. {this.state.payRecordVisible ? <PayRecord
  353. {...this.props}
  354. payId={this.state.orderPaymentsId}
  355. visible={this.state.payRecordVisible}
  356. tid={this.state.tid}
  357. projectType={this.state.projectType}
  358. changeVisible={()=>{
  359. this.loadData(this.state.page,this.state.searchInfor);
  360. this.setState({
  361. payRecordVisible: false,
  362. orderPaymentsId: 0,
  363. tid: 0,
  364. projectType: 0,
  365. })
  366. }}
  367. /> : <div/>}
  368. </div>
  369. );
  370. }
  371. }
  372. export default PayApplyReject