accountTotal.jsx 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213
  1. import React from "react";
  2. import $ from "jquery/src/ajax";
  3. import moment from "moment";
  4. import {
  5. Button,
  6. Form,
  7. Input,
  8. Spin,
  9. Table,
  10. Select,
  11. message,
  12. Tabs,
  13. DatePicker,
  14. Modal,
  15. Tooltip,
  16. Tag,
  17. } from "antd";
  18. import { ChooseList } from "../../order/orderNew/chooseList";
  19. import { ShowModal, getAccountName, getSecondaryAccountName, getClockState } from "../../../tools"
  20. import { accountType, accountStatus } from "@/dataDic";
  21. import ShowModalDiv from "@/showModal.jsx";
  22. import OrderDetail from '../../order/orderNew/changeComponent/orderDetail';
  23. import './index.less';
  24. const FormItem = Form.Item;
  25. const { RangePicker } = DatePicker;
  26. const { TabPane } = Tabs;
  27. const AccountTotal = React.createClass({
  28. getInitialState() {
  29. return {
  30. searchValues: {
  31. targetType: 1
  32. }, // 列表筛选条件
  33. loading: false, //加载动画
  34. changeList: undefined, // 更改后的表格显示数据
  35. dataSource: [], // 列表数据
  36. departmentArr: [],
  37. pagination: {
  38. defaultCurrent: 1,
  39. defaultPageSize: 10,
  40. showQuickJumper: true,
  41. pageSize: 10,
  42. onChange: function (page) {
  43. this.loadData(page);
  44. }.bind(this),
  45. showTotal: function (total) {
  46. return "共" + total + "条数据";
  47. },
  48. },
  49. columns: [
  50. {
  51. title: "合同/客户",
  52. dataIndex: "contractNo",
  53. key: "contractNo",
  54. render: (text, record) => {
  55. return (
  56. this.state.searchValues["targetType"] == 1 ?
  57. <span>
  58. <span style={{ color: record.bidType == 1 && 'red' }}>{text}</span>
  59. {" / " + record.buyerName}
  60. </span>
  61. : <span>{record.depName}</span>
  62. );
  63. },
  64. },
  65. {
  66. title: "公出/实际/超出(时)",
  67. dataIndex: "maxDuration",
  68. key: "maxDuration",
  69. render: (text, record) => {
  70. return (
  71. <div className='receiveCount'
  72. onClick={(e) => {
  73. e.stopPropagation();
  74. this.getListC(record.contractNo)
  75. this.setState({
  76. visibleC: true
  77. })
  78. // this.tableRowClick(record)
  79. }}
  80. >
  81. {text + " / " + record.actualDuration + " / " + record.exceedDuration}
  82. </div>
  83. );
  84. },
  85. },
  86. {
  87. title: "合同总额/已收款(万元)",
  88. dataIndex: "totalAmount",
  89. key: "totalAmount",
  90. render: (text, record) => {
  91. return (
  92. <div
  93. className='receiveCount'
  94. onClick={(e) => {
  95. e.stopPropagation();
  96. this.xiangqing(record.orderNo)
  97. this.xiangmu(record.orderNo)
  98. this.jiedian(record.orderNo)
  99. this.jiedianNew(record.orderNo)
  100. this.setState({
  101. visibleD: true,
  102. orderNo: record.orderNo,
  103. })
  104. }}
  105. >
  106. {text + " / " + record.settlementAmount}
  107. </div>
  108. );
  109. },
  110. },
  111. {
  112. title: "报销总额(元)",
  113. dataIndex: "expenseAmount",
  114. key: "expenseAmount",
  115. render: (text, record) => {
  116. return (
  117. <div
  118. className='receiveCount'
  119. onClick={(e) => {
  120. e.stopPropagation();
  121. this.tableRowClick(record)
  122. }}
  123. >
  124. {text}
  125. </div>
  126. );
  127. },
  128. },
  129. {
  130. title: "已付成本(万元)",
  131. dataIndex: "paymentAmount",
  132. key: "paymentAmount",
  133. render: (text, record) => {
  134. return (
  135. <div
  136. className='receiveCount'
  137. onClick={(e) => {
  138. e.stopPropagation();
  139. this.tableRowClick(record)
  140. }}
  141. >
  142. {text}
  143. </div>
  144. );
  145. },
  146. },
  147. {
  148. title: "报销人数/天数/报销次数",
  149. dataIndex: "peopleCount",
  150. key: "peopleCount",
  151. render: (text, record) => {
  152. return (
  153. <div
  154. className='receiveCount'
  155. onClick={(e) => {
  156. e.stopPropagation();
  157. this.tableRowClick(record)
  158. }}
  159. >
  160. {text + " / " + record.days + " / " + record.expenseCount}
  161. </div>
  162. );
  163. },
  164. },
  165. {
  166. title: "报销未审核/驳回次数",
  167. dataIndex: "notExamine",
  168. key: "notExamine",
  169. render: (text, record) => {
  170. return (
  171. <div
  172. className='receiveCount'
  173. onClick={(e) => {
  174. e.stopPropagation();
  175. this.tableRowClick(record)
  176. }}
  177. >
  178. {text + " / " + record.rejectCount}
  179. </div>
  180. );
  181. },
  182. },
  183. ],
  184. visible: false,
  185. columnsA: [
  186. {
  187. title: "类型",
  188. dataIndex: "type",
  189. key: "type",
  190. render: (text, record) => {
  191. return (
  192. <span>
  193. {(text == 0 && !record.typeOther)
  194. ? getAccountName(record.sonType, record.sonTypeOther)
  195. : getSecondaryAccountName(text, record.typeOther)}
  196. </span>
  197. );
  198. },
  199. },
  200. {
  201. title: "报销时间",
  202. dataIndex: "releaseStart",
  203. key: "releaseStart",
  204. render: (text, record) => {
  205. return (
  206. <div>
  207. <div style={{ textAlign: "center" }}>{text}</div>
  208. <div style={{ textAlign: "center" }}>至</div>
  209. <div style={{ textAlign: "center" }}>{record.releaseEnd}</div>
  210. </div>
  211. );
  212. },
  213. },
  214. {
  215. title: "工时",
  216. dataIndex: "duration",
  217. key: "duration",
  218. },
  219. {
  220. title: "报销金额(元)",
  221. dataIndex: "amount",
  222. key: "amount",
  223. width: 70,
  224. },
  225. {
  226. title: "实报金额(元)",
  227. dataIndex: "realAmount",
  228. key: "realAmount",
  229. width: 70,
  230. },
  231. {
  232. title: "天数",
  233. dataIndex: "days",
  234. key: "days",
  235. },
  236. {
  237. title: "报销编号",
  238. dataIndex: "checkNo",
  239. key: "checkNo",
  240. },
  241. {
  242. title: "报销合同",
  243. dataIndex: "contractNo",
  244. key: "contractNo",
  245. },
  246. {
  247. title: "客户",
  248. dataIndex: "buyerName",
  249. key: "buyerName",
  250. },
  251. {
  252. title: "报销人",
  253. dataIndex: "aname",
  254. key: "aname",
  255. },
  256. {
  257. title: "财务负责人",
  258. dataIndex: "financeName",
  259. key: "financeName",
  260. },
  261. {
  262. title: "报销公司/支付公司",
  263. dataIndex: "payDepName",
  264. key: "payDepName",
  265. render: (text, record) => {
  266. return (
  267. <div>
  268. <div>{record.applyDepName || ""}</div>
  269. <div>{text || ""}</div>
  270. </div>
  271. );
  272. },
  273. },
  274. {
  275. title: "发起时间",
  276. dataIndex: "createTimeStr",
  277. key: "createTimeStr",
  278. },
  279. {
  280. title: "状态",
  281. dataIndex: "status",
  282. key: "status",
  283. render: (text, record) => {
  284. return (
  285. <span style={{ color: accountStatus[text].color }}>
  286. {accountStatus[text].label}
  287. </span>
  288. );
  289. },
  290. },
  291. ],
  292. dataSourceA: [],
  293. columnsC: [
  294. {
  295. title: "编号",
  296. dataIndex: "key",
  297. key: "key",
  298. width: 45,
  299. fixed: "left",
  300. },
  301. {
  302. title: "客户名称",
  303. dataIndex: "userName",
  304. key: "userName",
  305. width: 150,
  306. fixed: "left",
  307. render: (text, record) => {
  308. return (
  309. <div>
  310. <div>{text}</div>
  311. <div style={{ color: ["red", "green"][record.signBills] }}>
  312. {["未签单", "已签单"][record.signBills]}
  313. {record.signBills == 1 && `(${record.signTime})`}
  314. </div>
  315. </div >
  316. );
  317. },
  318. },
  319. {
  320. title: "公出地点",
  321. dataIndex: "districtName",
  322. key: "districtName",
  323. width: 120,
  324. render: (text) => {
  325. return (
  326. <div>{text}</div>
  327. );
  328. },
  329. },
  330. {
  331. title: "跟单人",
  332. dataIndex: "sname",
  333. key: "sname",
  334. width: 90,
  335. render: (text, record) => {
  336. return (
  337. <Tooltip title={text}>
  338. <div>{text}</div>
  339. </Tooltip>
  340. );
  341. },
  342. },
  343. {
  344. title: "公出人员",
  345. dataIndex: "aname",
  346. key: "aname",
  347. width: 190,
  348. render: (text, record) => {
  349. return (
  350. <Tooltip title={text}>
  351. <div>
  352. <p style={{ color: "red" }}>[ 打卡人:{text} ]</p>
  353. {record.assist !== 0 && <p style={{ color: "#8552A1" }} >[ 协单人:{record.assistAidName}]</p>}
  354. {!!record.assistantName && <p style={{ color: "#228fbd" }} >[ 协单助手:{record.assistantName}]</p>}
  355. </div>
  356. </Tooltip>
  357. );
  358. },
  359. },
  360. {
  361. title: "申请时间",
  362. dataIndex: "createTimes",
  363. key: "createTimes",
  364. width: 80,
  365. },
  366. {
  367. title: "公出时间",
  368. dataIndex: "releaseStarts",
  369. key: "releaseStarts",
  370. width: 130,
  371. render: (text, record) => (
  372. <div>
  373. <div>{text}</div>
  374. <div style={{ paddingLeft: "44px" }}>至</div>
  375. <div>{record.releaseEnds}</div>
  376. </div>
  377. ),
  378. },
  379. {
  380. title: "公出时长(时)",
  381. dataIndex: "duration",
  382. key: "duration",
  383. width: 50,
  384. },
  385. {
  386. title: "打卡时间",
  387. dataIndex: "clockInTimes",
  388. key: "clockInTimes",
  389. width: 80,
  390. render: (text, record) => (
  391. <span>
  392. <div style={{ width: 70 }}>{text}</div>
  393. {record.alone == 2 && record.assist == 1
  394. ? <Tag color="#58a3ff">无需打卡</Tag>
  395. : <Tag color={["#F21212", "#34DE38", "#ffd400"][record.clockIn]}>{["未打卡", "已打卡", "异常打卡"][record.clockIn]}</Tag>}
  396. </span>
  397. )
  398. },
  399. {
  400. title: "标签",
  401. dataIndex: "status",
  402. key: "status",
  403. width: 200,
  404. render: (text, record) => (
  405. <div>
  406. <div style={{ display: "flex", flexDirection: "row" }}>
  407. <Tag
  408. color={["#45b97c", "#69541b", "#f47920", "#8552a1", "#228fbd"][record.type]}
  409. >
  410. {
  411. record.type === 0
  412. ? "业务公出" : record.type === 1
  413. ? "技术公出" : record.type === 2
  414. ? "行政公出" : record.type === 3
  415. ? "技术协单" : record.type === 4
  416. ? "协单助手" : ""
  417. }
  418. </Tag>
  419. <Tag color={getClockState(text).color}>
  420. {getClockState(text).title}
  421. </Tag>
  422. {record.updateStatus == 1 && <Tag color="#1E90FF">改</Tag>}
  423. </div>
  424. {record.type === 1 && <div style={{ marginTop: 5 }}>{record.contractNo}</div>}
  425. {record.type === 1 && <div>{record.totalAmout + "(万元)"}</div>}
  426. </div>
  427. ),
  428. },
  429. {
  430. title: "公出目标",
  431. dataIndex: "remarks",
  432. key: "remarks",
  433. width: 280,
  434. render: (text) => {
  435. return (
  436. <div>{text}</div>
  437. );
  438. },
  439. },
  440. {
  441. title: "公出计划",
  442. dataIndex: "plan",
  443. key: "plan",
  444. width: 280,
  445. render: (text) => {
  446. return (
  447. <div>{text}</div>
  448. );
  449. },
  450. },
  451. {
  452. title: "预计效果",
  453. dataIndex: "expectedEffect",
  454. key: "expectedEffect",
  455. width: 280,
  456. render: (text) => {
  457. return (
  458. <div>{text}</div>
  459. );
  460. },
  461. },
  462. {
  463. title: "本次公出目标总结",
  464. dataIndex: "supplement",
  465. key: "supplement",
  466. width: 280,
  467. render: (text) => {
  468. return (
  469. <div>{text}</div>
  470. );
  471. },
  472. },
  473. {
  474. title: "下一次公出计划",
  475. dataIndex: "nextPlan",
  476. key: "nextPlan",
  477. width: 280,
  478. render: (text) => {
  479. return (
  480. <div>{text}</div>
  481. );
  482. },
  483. },
  484. {
  485. title: "审核/指导",
  486. dataIndex: "auditInfo",
  487. key: "auditInfo",
  488. width: 200,
  489. render: (text, record) => {
  490. return <div style={{ wordBreak: "break-all" }} >
  491. {record.auditTimes && `审核时间:${record.auditTimes}`}
  492. {text}
  493. </div >;
  494. },
  495. },
  496. ],
  497. dataSourceC: [],
  498. paginationC: {
  499. defaultCurrent: 1,
  500. defaultPageSize: 9999,
  501. showQuickJumper: true,
  502. pageSize: 9999,
  503. onChange: function (page) {
  504. this.getListC(page);
  505. }.bind(this),
  506. showTotal: function (total) {
  507. return "共" + total + "条数据";
  508. },
  509. },
  510. visibleC: false,
  511. visibleD: false,
  512. };
  513. },
  514. componentWillMount() {
  515. this.departmentList();
  516. this.loadData();
  517. },
  518. // 列表接口
  519. loadData(pageNo) {
  520. const { searchValues, pagination } = this.state;
  521. this.setState({
  522. loading: true,
  523. });
  524. let datas = Object.assign(searchValues, {
  525. // pageNo: pageNo || 1,
  526. // pageSize: pagination.pageSize,
  527. });
  528. $.ajax({
  529. method: "get",
  530. dataType: "json",
  531. crossDomain: false,
  532. url: globalConfig.context + "/api/admin/expenseCounts/getCounts",
  533. data: datas,
  534. success: function (data) {
  535. ShowModal(this);
  536. this.setState({
  537. loading: false,
  538. });
  539. if (data.error && data.error.length === 0) {
  540. if (data.data) {
  541. pagination.current = data.data.pageNo;
  542. pagination.total = data.data.totalCount;
  543. if (data.data && data.data && !data.data.length) {
  544. pagination.current = 0;
  545. pagination.total = 0;
  546. }
  547. this.setState({
  548. dataSource: data.data,
  549. pagination: this.state.pagination,
  550. pageNo: data.data.pageNo,
  551. totalAmount: data.data.totalAmount,
  552. });
  553. }
  554. } else {
  555. message.warning(data.error[0].message);
  556. }
  557. }.bind(this),
  558. }).always(
  559. function () {
  560. this.setState({
  561. loading: false,
  562. });
  563. }.bind(this)
  564. );
  565. },
  566. // 公出信息
  567. getListC(contractNo) {
  568. const { paginationC, } = this.state;
  569. this.setState({
  570. loading: true,
  571. });
  572. $.ajax({
  573. method: "get",
  574. dataType: "json",
  575. crossDomain: false,
  576. url: globalConfig.context + "/api/admin/release/publicReleaseAndCount",
  577. data: {
  578. pageNo: 1,
  579. pageSize: paginationC.pageSize,
  580. statusType: 1,
  581. contractNo,
  582. },
  583. success: function (data) {
  584. setTimeout(() => {
  585. this.setState({
  586. loading: false,
  587. });
  588. }, 300);
  589. if (data.error && data.error.length === 0) {
  590. if (data.data.list) {
  591. paginationC.current = data.data.pageNo;
  592. paginationC.total = data.data.totalCount;
  593. if (data.data && data.data.list && !data.data.list.length) {
  594. paginationC.current = 0;
  595. paginationC.total = 0;
  596. }
  597. }
  598. this.setState({
  599. dataSourceC: data.data.list,
  600. paginationC: this.state.paginationC,
  601. pageNoC: data.data.pageNo,
  602. peopleCount: data.data.peopleCount,
  603. count: data.data.count,
  604. durationCount: data.data.durationCount,
  605. });
  606. } else {
  607. message.warning(data.error[0].message);
  608. }
  609. }.bind(this),
  610. }).always(
  611. function () {
  612. }.bind(this)
  613. );
  614. },
  615. addRowColor(record) {
  616. if (record.assist === 1 || record.assist === 2 || record.assist === 3) {
  617. return 'light'
  618. } else {
  619. return 'dark'
  620. }
  621. },
  622. departmentList() {
  623. $.ajax({
  624. method: "get",
  625. dataType: "json",
  626. crossDomain: false,
  627. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  628. data: {},
  629. success: function (data) {
  630. let thedata = data.data;
  631. let theArr = [];
  632. if (!thedata) {
  633. if (data.error && data.error.length) {
  634. message.warning(data.error[0].message);
  635. }
  636. } else {
  637. thedata.map(function (item, index) {
  638. theArr.push({
  639. key: index,
  640. name: item.name,
  641. id: item.id
  642. });
  643. });
  644. }
  645. this.setState({
  646. departmentArr: theArr
  647. });
  648. }.bind(this)
  649. }).always(
  650. function () {
  651. }.bind(this)
  652. );
  653. },
  654. // 搜索
  655. search() {
  656. this.loadData();
  657. },
  658. // 重置
  659. reset() {
  660. this.setState({
  661. searchValues: {
  662. targetType: 1
  663. },
  664. }, () => {
  665. this.loadData();
  666. })
  667. },
  668. changeList(arr) {
  669. const newArr = [];
  670. this.state.columns.forEach((item) => {
  671. arr.forEach((val) => {
  672. if (val === item.title) {
  673. newArr.push(item);
  674. }
  675. });
  676. });
  677. this.setState({
  678. changeList: newArr,
  679. });
  680. },
  681. export() {
  682. this.setState({
  683. exportExecLoading: true
  684. })
  685. let loading = message.loading('加载中...');
  686. let data = this.state.searchValues;
  687. $.ajax({
  688. method: "get",
  689. dataType: "json",
  690. crossDomain: false,
  691. url: globalConfig.context + "/api/admin/expenseCounts/getCounts/Export",
  692. data,
  693. success: function (data) {
  694. if (data.error.length === 0) {
  695. this.download(data.data);
  696. } else {
  697. message.warning(data.error[0].message);
  698. }
  699. }.bind(this),
  700. }).always(function () {
  701. loading();
  702. this.setState({
  703. exportExecLoading: false
  704. })
  705. }.bind(this));
  706. },
  707. // 下载
  708. download(fileName) {
  709. window.location.href = globalConfig.context + "/open/download?fileName=" + fileName
  710. },
  711. // 清理缓存
  712. getCountsClear() {
  713. this.setState({
  714. loading: true,
  715. });
  716. $.ajax({
  717. method: "get",
  718. dataType: "json",
  719. crossDomain: false,
  720. url: globalConfig.context + "/api/admin/expenseCounts/getCountsClear",
  721. data: {},
  722. success: function (data) {
  723. ShowModal(this);
  724. this.setState({
  725. loading: false,
  726. });
  727. if (data.error && data.error.length === 0) {
  728. message.success("清除成功!")
  729. } else {
  730. message.warning(data.error[0].message);
  731. }
  732. }.bind(this),
  733. }).always(
  734. function () {
  735. this.setState({
  736. loading: false,
  737. });
  738. }.bind(this)
  739. );
  740. },
  741. tableRowClick(e) {
  742. this.setState({
  743. visible: true,
  744. contractNo: e.contractNo,
  745. }, () => {
  746. this.getListA()
  747. })
  748. },
  749. getListA() {
  750. this.setState({
  751. loading: true,
  752. });
  753. let data = {
  754. pageNo: 1,
  755. pageSize: 9999,
  756. contractNo: this.state.contractNo,
  757. };
  758. $.ajax({
  759. method: "get",
  760. dataType: "json",
  761. crossDomain: false,
  762. url: globalConfig.context + "/api/admin/expenseAccount/detailsList",
  763. data: data,
  764. success: function (data) {
  765. ShowModal(this);
  766. this.setState({
  767. loading: false,
  768. });
  769. if (data.error && data.error.length === 0) {
  770. if (data.data.list) {
  771. this.setState({
  772. dataSourceA: data.data.list,
  773. totalAmountA: data.data.totalAmount,
  774. });
  775. }
  776. } else {
  777. message.warning(data.error[0].message);
  778. }
  779. }.bind(this),
  780. }).always(
  781. function () {
  782. this.setState({
  783. loading: false,
  784. });
  785. }.bind(this)
  786. );
  787. },
  788. //订单详情
  789. xiangqing(orderNos) {
  790. this.setState({
  791. orderData: {}
  792. }, () => {
  793. $.ajax({
  794. method: "get",
  795. dataType: "json",
  796. crossDomain: false,
  797. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  798. data: {
  799. orderNo: orderNos
  800. },
  801. success: function (data) {
  802. if (data.error.length || data.data.list == "") {
  803. if (data.error && data.error.length) {
  804. message.warning(data.error[0].message);
  805. }
  806. } else {
  807. let thisdata = data.data;
  808. this.setState({
  809. orderUid: thisdata.uid,
  810. userName: thisdata.userName,
  811. primaryOrderNo: thisdata.primaryOrder,
  812. additionalOrder: thisdata.additionalOrder,
  813. contractNo: thisdata.contractNo,
  814. // arrears: thisdata.arrears,
  815. orderData: thisdata,
  816. isAddition: thisdata.additionalOrder ? true : false,
  817. deleteSign: thisdata.deleteSign,
  818. });
  819. }
  820. }.bind(this)
  821. });
  822. });
  823. },
  824. //项目列表
  825. xiangmu(orderNos) {
  826. $.ajax({
  827. method: "get",
  828. dataType: "json",
  829. crossDomain: false,
  830. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  831. data: {
  832. orderNo: orderNos
  833. },
  834. success: function (data) {
  835. let theArr = [];
  836. if (data.error.length || data.data.list == "") {
  837. if (data.error && data.error.length) {
  838. message.warning(data.error[0].message);
  839. }
  840. } else {
  841. for (let i = 0; i < data.data.length; i++) {
  842. let thisdata = data.data[i];
  843. thisdata.key = i;
  844. thisdata.sort = thisdata.cSort;
  845. theArr.push(thisdata);
  846. }
  847. }
  848. this.setState({
  849. dataSourceX: theArr
  850. });
  851. }.bind(this)
  852. });
  853. },
  854. //节点列表
  855. jiedian(orderNos) {
  856. $.ajax({
  857. method: "get",
  858. dataType: "json",
  859. crossDomain: false,
  860. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  861. data: {
  862. orderNo: orderNos
  863. },
  864. success: function (data) {
  865. let theArr = [];
  866. let thisData = [];
  867. if (data.error.length || data.data.list == "") {
  868. if (data.error && data.error.length) {
  869. message.warning(data.error[0].message);
  870. }
  871. } else {
  872. for (let i = 0; i < data.data.length; i++) {
  873. thisData = data.data[i];
  874. theArr.push({
  875. key: i,
  876. dunSubject: thisData.dunSubject
  877. ? thisData.dunSubject.toString()
  878. : "", //催款科目
  879. id: thisData.id, //节点Id
  880. money: thisData.money, //催款金额
  881. dunStatus: thisData.dunStatus //催款状态
  882. });
  883. }
  884. this.setState({
  885. contactList: theArr
  886. });
  887. }
  888. }.bind(this)
  889. });
  890. },
  891. jiedianNew(orderNos) {
  892. $.ajax({
  893. method: "get",
  894. dataType: "json",
  895. crossDomain: false,
  896. url:
  897. globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  898. data: {
  899. orderNo: orderNos
  900. },
  901. success: function (data) {
  902. if (data.error && data.error.length) {
  903. message.warning(data.error[0].message);
  904. } else {
  905. let theArr = [];
  906. let thisData = [];
  907. let arr = data.data || [];
  908. let totalCui = 0;
  909. for (let i = 0; i < arr.length; i++) {
  910. thisData = arr[i];
  911. totalCui += +thisData.money;
  912. theArr.push({
  913. key: i,
  914. dunSubject: thisData.dunSubject
  915. ? thisData.dunSubject.toString()
  916. : "", //催款科目
  917. id: thisData.id, //节点Id
  918. money: thisData.money, //催款金额
  919. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  920. commodityName: thisData.commodityName,
  921. projectType: thisData.projectType,
  922. dunTypeName: thisData.dunTypeName,
  923. status: thisData.status,
  924. waitDay: thisData.waitDay,
  925. effectiveCount: thisData.effectiveCount,
  926. startDate: thisData.startDate,
  927. dunType: thisData.dunType,
  928. appropriationRatio: thisData.appropriationRatio,
  929. customizeName: thisData.customizeName,
  930. customizeTimes: thisData.customizeTimes,
  931. tid: thisData.tid,
  932. });
  933. }
  934. if (!totalCui) {
  935. totalCui = 0;
  936. }
  937. totalCui = (Math.round(totalCui * 1000000) / 1000000).toFixed(6);
  938. this.setState({
  939. contactListNew: theArr,
  940. totalCui
  941. });
  942. }
  943. }.bind(this)
  944. }).always(
  945. function () {
  946. this.setState({
  947. loading: false
  948. });
  949. }.bind(this)
  950. );
  951. },
  952. getOrderLog(orderNo) {
  953. this.setState({
  954. rizhivisible: true
  955. });
  956. this.rizhi(orderNo);
  957. },
  958. rizhi(orderNo) {
  959. $.ajax({
  960. method: "get",
  961. dataType: "json",
  962. crossDomain: false,
  963. url: "/api/admin/newOrder/selectOrderLog",
  964. data: {
  965. orderNo: orderNo
  966. },
  967. success: function (data) {
  968. let theArr = [];
  969. let thisData = data.data;
  970. if (!thisData.length) {
  971. if (data.error && data.error.length) {
  972. message.warning(data.error[0].message);
  973. }
  974. thisData = {};
  975. } else {
  976. for (let i = 0; i < data.data.length; i++) {
  977. let thisdata = data.data[i];
  978. theArr.push({
  979. processName: thisdata.processName,
  980. adminName: thisdata.adminName,
  981. createDate: thisdata.createDate,
  982. remarks: thisdata.remarks
  983. });
  984. }
  985. }
  986. this.setState({
  987. dataSourcerizhi: theArr
  988. });
  989. }.bind(this)
  990. });
  991. },
  992. render() {
  993. const { searchValues, } = this.state
  994. return (
  995. <div className="user-content">
  996. <ShowModalDiv ShowModal={this.state.showModal} onClose={() => { this.setState({ showModal: false }) }} />
  997. <div className="content-title" style={{ marginBottom: 10 }}>
  998. <span style={{ fontWeight: 900, fontSize: 16 }}>报销总计</span>
  999. </div>
  1000. <Tabs defaultActiveKey="2" className="test">
  1001. <TabPane tab="搜索" key="2">
  1002. <div className="user-search" style={{ marginLeft: 10 }}>
  1003. <Select placeholder="" style={{ width: 140 }}
  1004. value={searchValues["targetType"]}
  1005. onChange={(e) => {
  1006. searchValues["targetType"] = e;
  1007. const _this = this;
  1008. this.setState({
  1009. searchValues: searchValues,
  1010. }, () => {
  1011. _this.search()
  1012. });
  1013. }}
  1014. >
  1015. <Select.Option value={0} >部门</Select.Option>
  1016. <Select.Option value={1} >订单</Select.Option>
  1017. </Select>
  1018. {
  1019. searchValues["targetType"] == 1 &&
  1020. <Input
  1021. placeholder="合同编号"
  1022. value={searchValues["contactNo"]
  1023. ? searchValues["contactNo"]
  1024. : ""}
  1025. onChange={(e) => {
  1026. searchValues["contactNo"] = e.target.value;
  1027. this.setState({
  1028. searchValues: searchValues,
  1029. });
  1030. }}
  1031. />
  1032. }
  1033. <Input
  1034. placeholder="客户名称"
  1035. value={searchValues["buyerName"]
  1036. ? searchValues["buyerName"]
  1037. : ""}
  1038. onChange={(e) => {
  1039. searchValues["buyerName"] = e.target.value;
  1040. this.setState({
  1041. searchValues: searchValues,
  1042. });
  1043. }}
  1044. />
  1045. <Select
  1046. placeholder="所属部门"
  1047. style={{ width: 200, marginRight: 10 }}
  1048. value={searchValues["depId"]
  1049. ? searchValues["depId"]
  1050. : undefined}
  1051. onChange={e => {
  1052. searchValues["depId"] = e;
  1053. this.setState({
  1054. searchValues: searchValues,
  1055. });
  1056. }}
  1057. >
  1058. {this.state.departmentArr.map(function (item) {
  1059. return <Select.Option key={item.id}>{item.name}</Select.Option>;
  1060. })}
  1061. </Select>
  1062. <span>报销时间:</span>
  1063. <RangePicker
  1064. style={{ width: 300 }}
  1065. value={[
  1066. searchValues.startTime ? moment(searchValues.startTime) : null,
  1067. searchValues.endTime ? moment(searchValues.endTime) : null,
  1068. ]}
  1069. onChange={(data, dataString) => {
  1070. this.setState({
  1071. searchValues: Object.assign(searchValues, {
  1072. startTime: dataString[0],
  1073. endTime: dataString[1],
  1074. }),
  1075. });
  1076. }}
  1077. />
  1078. <Button
  1079. type="primary"
  1080. onClick={this.search}
  1081. style={{ margin: "0 10px" }}
  1082. >搜索</Button>
  1083. <Button onClick={this.reset}>重置</Button>
  1084. <Button
  1085. type="primary"
  1086. onClick={this.getCountsClear}
  1087. style={{ marginLeft: 10 }}
  1088. >清理缓存</Button>
  1089. </div>
  1090. </TabPane>
  1091. <TabPane tab="更改表格显示数据" key="1">
  1092. <div style={{ marginLeft: 10 }}>
  1093. <ChooseList
  1094. columns={this.state.columns}
  1095. changeFn={this.changeList}
  1096. changeList={this.state.changeList}
  1097. top={55}
  1098. margin={11}
  1099. />
  1100. </div>
  1101. </TabPane>
  1102. <TabPane tab="导出" key="3">
  1103. <div style={{ float: "left" }}>
  1104. <Button
  1105. type="primary"
  1106. loading={this.state.exportPendingLoading}
  1107. onClick={this.export}
  1108. style={{ margin: 10 }}
  1109. >
  1110. 导出excel
  1111. </Button>
  1112. </div>
  1113. </TabPane>
  1114. </Tabs>
  1115. <div className="patent-table">
  1116. <Spin spinning={this.state.loading}>
  1117. <Table
  1118. bordered
  1119. columns={
  1120. this.state.changeList == undefined
  1121. ? this.state.columns
  1122. : this.state.changeList
  1123. }
  1124. dataSource={this.state.dataSource}
  1125. pagination={false}
  1126. size="small"
  1127. />
  1128. </Spin>
  1129. </div>
  1130. <Modal
  1131. visible={this.state.visible}
  1132. maskClosable={false}
  1133. footer={false}
  1134. width={1400}
  1135. onCancel={() => { this.setState({ visible: false }) }}
  1136. >
  1137. <Spin spinning={this.state.loading}>
  1138. <Table
  1139. columns={this.state.columnsA}
  1140. dataSource={this.state.dataSourceA}
  1141. bordered
  1142. size="middle"
  1143. pagination={false}
  1144. />
  1145. </Spin>
  1146. </Modal>
  1147. {
  1148. this.state.visibleD &&
  1149. <Modal
  1150. title="订单详情"
  1151. visible={this.state.visibleD}
  1152. maskClosable={false}
  1153. footer={false}
  1154. width={1200}
  1155. onCancel={() => { this.setState({ visibleD: false }) }}
  1156. >
  1157. <OrderDetail
  1158. orderData={this.state.orderData}
  1159. orderUid={this.state.orderUid}
  1160. getOrderLog={this.getOrderLog}
  1161. dataSourceX={this.state.dataSourceX}
  1162. contactList={this.state.contactList}
  1163. orderNo={this.state.orderNo}
  1164. totalCui={this.state.totalCui}
  1165. contactListNew={this.state.contactListNew}
  1166. />
  1167. </Modal>
  1168. }
  1169. <Modal
  1170. title="公出详情"
  1171. visible={this.state.visibleC}
  1172. maskClosable={false}
  1173. footer={false}
  1174. width={1400}
  1175. onCancel={() => { this.setState({ visibleC: false }) }}
  1176. >
  1177. <Spin spinning={this.state.loading}>
  1178. <Table
  1179. scroll={{ x: "120%" }}
  1180. columns={this.state.columnsC}
  1181. dataSource={this.state.dataSourceC}
  1182. bordered
  1183. size="middle"
  1184. pagination={false}
  1185. rowClassName={this.addRowColor}
  1186. />
  1187. </Spin>
  1188. </Modal>
  1189. </div>
  1190. );
  1191. },
  1192. });
  1193. export default AccountTotal;