accountTotal.jsx 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211
  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. <Tag color={["#F21212", "#34DE38", "#ffd400"][record.clockIn]}>{["未打卡", "已打卡", "异常打卡"][record.clockIn]}</Tag>
  394. </span>
  395. )
  396. },
  397. {
  398. title: "标签",
  399. dataIndex: "status",
  400. key: "status",
  401. width: 200,
  402. render: (text, record) => (
  403. <div>
  404. <div style={{ display: "flex", flexDirection: "row" }}>
  405. <Tag
  406. color={["#45b97c", "#69541b", "#f47920", "#8552a1", "#228fbd"][record.type]}
  407. >
  408. {
  409. record.type === 0
  410. ? "业务公出" : record.type === 1
  411. ? "技术公出" : record.type === 2
  412. ? "行政公出" : record.type === 3
  413. ? "技术协单" : record.type === 4
  414. ? "协单助手" : ""
  415. }
  416. </Tag>
  417. <Tag color={getClockState(text).color}>
  418. {getClockState(text).title}
  419. </Tag>
  420. {record.updateStatus == 1 && <Tag color="#1E90FF">改</Tag>}
  421. </div>
  422. {record.type === 1 && <div style={{ marginTop: 5 }}>{record.contractNo}</div>}
  423. {record.type === 1 && <div>{record.totalAmout + "(万元)"}</div>}
  424. </div>
  425. ),
  426. },
  427. {
  428. title: "公出目标",
  429. dataIndex: "remarks",
  430. key: "remarks",
  431. width: 280,
  432. render: (text) => {
  433. return (
  434. <div>{text}</div>
  435. );
  436. },
  437. },
  438. {
  439. title: "公出计划",
  440. dataIndex: "plan",
  441. key: "plan",
  442. width: 280,
  443. render: (text) => {
  444. return (
  445. <div>{text}</div>
  446. );
  447. },
  448. },
  449. {
  450. title: "预计效果",
  451. dataIndex: "expectedEffect",
  452. key: "expectedEffect",
  453. width: 280,
  454. render: (text) => {
  455. return (
  456. <div>{text}</div>
  457. );
  458. },
  459. },
  460. {
  461. title: "本次公出目标总结",
  462. dataIndex: "supplement",
  463. key: "supplement",
  464. width: 280,
  465. render: (text) => {
  466. return (
  467. <div>{text}</div>
  468. );
  469. },
  470. },
  471. {
  472. title: "下一次公出计划",
  473. dataIndex: "nextPlan",
  474. key: "nextPlan",
  475. width: 280,
  476. render: (text) => {
  477. return (
  478. <div>{text}</div>
  479. );
  480. },
  481. },
  482. {
  483. title: "审核/指导",
  484. dataIndex: "auditInfo",
  485. key: "auditInfo",
  486. width: 200,
  487. render: (text, record) => {
  488. return <div style={{ wordBreak: "break-all" }} >
  489. {record.auditTimes && `审核时间:${record.auditTimes}`}
  490. {text}
  491. </div >;
  492. },
  493. },
  494. ],
  495. dataSourceC: [],
  496. paginationC: {
  497. defaultCurrent: 1,
  498. defaultPageSize: 9999,
  499. showQuickJumper: true,
  500. pageSize: 9999,
  501. onChange: function (page) {
  502. this.getListC(page);
  503. }.bind(this),
  504. showTotal: function (total) {
  505. return "共" + total + "条数据";
  506. },
  507. },
  508. visibleC: false,
  509. visibleD: false,
  510. };
  511. },
  512. componentWillMount() {
  513. this.departmentList();
  514. this.loadData();
  515. },
  516. // 列表接口
  517. loadData(pageNo) {
  518. const { searchValues, pagination } = this.state;
  519. this.setState({
  520. loading: true,
  521. });
  522. let datas = Object.assign(searchValues, {
  523. // pageNo: pageNo || 1,
  524. // pageSize: pagination.pageSize,
  525. });
  526. $.ajax({
  527. method: "get",
  528. dataType: "json",
  529. crossDomain: false,
  530. url: globalConfig.context + "/api/admin/expenseCounts/getCounts",
  531. data: datas,
  532. success: function (data) {
  533. ShowModal(this);
  534. this.setState({
  535. loading: false,
  536. });
  537. if (data.error && data.error.length === 0) {
  538. if (data.data) {
  539. pagination.current = data.data.pageNo;
  540. pagination.total = data.data.totalCount;
  541. if (data.data && data.data && !data.data.length) {
  542. pagination.current = 0;
  543. pagination.total = 0;
  544. }
  545. this.setState({
  546. dataSource: data.data,
  547. pagination: this.state.pagination,
  548. pageNo: data.data.pageNo,
  549. totalAmount: data.data.totalAmount,
  550. });
  551. }
  552. } else {
  553. message.warning(data.error[0].message);
  554. }
  555. }.bind(this),
  556. }).always(
  557. function () {
  558. this.setState({
  559. loading: false,
  560. });
  561. }.bind(this)
  562. );
  563. },
  564. // 公出信息
  565. getListC(contractNo) {
  566. const { paginationC, } = this.state;
  567. this.setState({
  568. loading: true,
  569. });
  570. $.ajax({
  571. method: "get",
  572. dataType: "json",
  573. crossDomain: false,
  574. url: globalConfig.context + "/api/admin/release/publicReleaseAndCount",
  575. data: {
  576. pageNo: 1,
  577. pageSize: paginationC.pageSize,
  578. statusType: 1,
  579. contractNo,
  580. },
  581. success: function (data) {
  582. setTimeout(() => {
  583. this.setState({
  584. loading: false,
  585. });
  586. }, 300);
  587. if (data.error && data.error.length === 0) {
  588. if (data.data.list) {
  589. paginationC.current = data.data.pageNo;
  590. paginationC.total = data.data.totalCount;
  591. if (data.data && data.data.list && !data.data.list.length) {
  592. paginationC.current = 0;
  593. paginationC.total = 0;
  594. }
  595. }
  596. this.setState({
  597. dataSourceC: data.data.list,
  598. paginationC: this.state.paginationC,
  599. pageNoC: data.data.pageNo,
  600. peopleCount: data.data.peopleCount,
  601. count: data.data.count,
  602. durationCount: data.data.durationCount,
  603. });
  604. } else {
  605. message.warning(data.error[0].message);
  606. }
  607. }.bind(this),
  608. }).always(
  609. function () {
  610. }.bind(this)
  611. );
  612. },
  613. addRowColor(record) {
  614. if (record.assist === 1 || record.assist === 2 || record.assist === 3) {
  615. return 'light'
  616. } else {
  617. return 'dark'
  618. }
  619. },
  620. departmentList() {
  621. $.ajax({
  622. method: "get",
  623. dataType: "json",
  624. crossDomain: false,
  625. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  626. data: {},
  627. success: function (data) {
  628. let thedata = data.data;
  629. let theArr = [];
  630. if (!thedata) {
  631. if (data.error && data.error.length) {
  632. message.warning(data.error[0].message);
  633. }
  634. } else {
  635. thedata.map(function (item, index) {
  636. theArr.push({
  637. key: index,
  638. name: item.name,
  639. id: item.id
  640. });
  641. });
  642. }
  643. this.setState({
  644. departmentArr: theArr
  645. });
  646. }.bind(this)
  647. }).always(
  648. function () {
  649. }.bind(this)
  650. );
  651. },
  652. // 搜索
  653. search() {
  654. this.loadData();
  655. },
  656. // 重置
  657. reset() {
  658. this.setState({
  659. searchValues: {
  660. targetType: 1
  661. },
  662. }, () => {
  663. this.loadData();
  664. })
  665. },
  666. changeList(arr) {
  667. const newArr = [];
  668. this.state.columns.forEach((item) => {
  669. arr.forEach((val) => {
  670. if (val === item.title) {
  671. newArr.push(item);
  672. }
  673. });
  674. });
  675. this.setState({
  676. changeList: newArr,
  677. });
  678. },
  679. export() {
  680. this.setState({
  681. exportExecLoading: true
  682. })
  683. let loading = message.loading('加载中...');
  684. let data = this.state.searchValues;
  685. $.ajax({
  686. method: "get",
  687. dataType: "json",
  688. crossDomain: false,
  689. url: globalConfig.context + "/api/admin/expenseCounts/getCounts/Export",
  690. data,
  691. success: function (data) {
  692. if (data.error.length === 0) {
  693. this.download(data.data);
  694. } else {
  695. message.warning(data.error[0].message);
  696. }
  697. }.bind(this),
  698. }).always(function () {
  699. loading();
  700. this.setState({
  701. exportExecLoading: false
  702. })
  703. }.bind(this));
  704. },
  705. // 下载
  706. download(fileName) {
  707. window.location.href = globalConfig.context + "/open/download?fileName=" + fileName
  708. },
  709. // 清理缓存
  710. getCountsClear() {
  711. this.setState({
  712. loading: true,
  713. });
  714. $.ajax({
  715. method: "get",
  716. dataType: "json",
  717. crossDomain: false,
  718. url: globalConfig.context + "/api/admin/expenseCounts/getCountsClear",
  719. data: {},
  720. success: function (data) {
  721. ShowModal(this);
  722. this.setState({
  723. loading: false,
  724. });
  725. if (data.error && data.error.length === 0) {
  726. message.success("清除成功!")
  727. } else {
  728. message.warning(data.error[0].message);
  729. }
  730. }.bind(this),
  731. }).always(
  732. function () {
  733. this.setState({
  734. loading: false,
  735. });
  736. }.bind(this)
  737. );
  738. },
  739. tableRowClick(e) {
  740. this.setState({
  741. visible: true,
  742. contractNo: e.contractNo,
  743. }, () => {
  744. this.getListA()
  745. })
  746. },
  747. getListA() {
  748. this.setState({
  749. loading: true,
  750. });
  751. let data = {
  752. pageNo: 1,
  753. pageSize: 9999,
  754. contractNo: this.state.contractNo,
  755. };
  756. $.ajax({
  757. method: "get",
  758. dataType: "json",
  759. crossDomain: false,
  760. url: globalConfig.context + "/api/admin/expenseAccount/detailsList",
  761. data: data,
  762. success: function (data) {
  763. ShowModal(this);
  764. this.setState({
  765. loading: false,
  766. });
  767. if (data.error && data.error.length === 0) {
  768. if (data.data.list) {
  769. this.setState({
  770. dataSourceA: data.data.list,
  771. totalAmountA: data.data.totalAmount,
  772. });
  773. }
  774. } else {
  775. message.warning(data.error[0].message);
  776. }
  777. }.bind(this),
  778. }).always(
  779. function () {
  780. this.setState({
  781. loading: false,
  782. });
  783. }.bind(this)
  784. );
  785. },
  786. //订单详情
  787. xiangqing(orderNos) {
  788. this.setState({
  789. orderData: {}
  790. }, () => {
  791. $.ajax({
  792. method: "get",
  793. dataType: "json",
  794. crossDomain: false,
  795. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  796. data: {
  797. orderNo: orderNos
  798. },
  799. success: function (data) {
  800. if (data.error.length || data.data.list == "") {
  801. if (data.error && data.error.length) {
  802. message.warning(data.error[0].message);
  803. }
  804. } else {
  805. let thisdata = data.data;
  806. this.setState({
  807. orderUid: thisdata.uid,
  808. userName: thisdata.userName,
  809. primaryOrderNo: thisdata.primaryOrder,
  810. additionalOrder: thisdata.additionalOrder,
  811. contractNo: thisdata.contractNo,
  812. // arrears: thisdata.arrears,
  813. orderData: thisdata,
  814. isAddition: thisdata.additionalOrder ? true : false,
  815. deleteSign: thisdata.deleteSign,
  816. });
  817. }
  818. }.bind(this)
  819. });
  820. });
  821. },
  822. //项目列表
  823. xiangmu(orderNos) {
  824. $.ajax({
  825. method: "get",
  826. dataType: "json",
  827. crossDomain: false,
  828. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  829. data: {
  830. orderNo: orderNos
  831. },
  832. success: function (data) {
  833. let theArr = [];
  834. if (data.error.length || data.data.list == "") {
  835. if (data.error && data.error.length) {
  836. message.warning(data.error[0].message);
  837. }
  838. } else {
  839. for (let i = 0; i < data.data.length; i++) {
  840. let thisdata = data.data[i];
  841. thisdata.key = i;
  842. thisdata.sort = thisdata.cSort;
  843. theArr.push(thisdata);
  844. }
  845. }
  846. this.setState({
  847. dataSourceX: theArr
  848. });
  849. }.bind(this)
  850. });
  851. },
  852. //节点列表
  853. jiedian(orderNos) {
  854. $.ajax({
  855. method: "get",
  856. dataType: "json",
  857. crossDomain: false,
  858. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  859. data: {
  860. orderNo: orderNos
  861. },
  862. success: function (data) {
  863. let theArr = [];
  864. let thisData = [];
  865. if (data.error.length || data.data.list == "") {
  866. if (data.error && data.error.length) {
  867. message.warning(data.error[0].message);
  868. }
  869. } else {
  870. for (let i = 0; i < data.data.length; i++) {
  871. thisData = data.data[i];
  872. theArr.push({
  873. key: i,
  874. dunSubject: thisData.dunSubject
  875. ? thisData.dunSubject.toString()
  876. : "", //催款科目
  877. id: thisData.id, //节点Id
  878. money: thisData.money, //催款金额
  879. dunStatus: thisData.dunStatus //催款状态
  880. });
  881. }
  882. this.setState({
  883. contactList: theArr
  884. });
  885. }
  886. }.bind(this)
  887. });
  888. },
  889. jiedianNew(orderNos) {
  890. $.ajax({
  891. method: "get",
  892. dataType: "json",
  893. crossDomain: false,
  894. url:
  895. globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  896. data: {
  897. orderNo: orderNos
  898. },
  899. success: function (data) {
  900. if (data.error && data.error.length) {
  901. message.warning(data.error[0].message);
  902. } else {
  903. let theArr = [];
  904. let thisData = [];
  905. let arr = data.data || [];
  906. let totalCui = 0;
  907. for (let i = 0; i < arr.length; i++) {
  908. thisData = arr[i];
  909. totalCui += +thisData.money;
  910. theArr.push({
  911. key: i,
  912. dunSubject: thisData.dunSubject
  913. ? thisData.dunSubject.toString()
  914. : "", //催款科目
  915. id: thisData.id, //节点Id
  916. money: thisData.money, //催款金额
  917. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  918. commodityName: thisData.commodityName,
  919. projectType: thisData.projectType,
  920. dunTypeName: thisData.dunTypeName,
  921. status: thisData.status,
  922. waitDay: thisData.waitDay,
  923. effectiveCount: thisData.effectiveCount,
  924. startDate: thisData.startDate,
  925. dunType: thisData.dunType,
  926. appropriationRatio: thisData.appropriationRatio,
  927. customizeName: thisData.customizeName,
  928. customizeTimes: thisData.customizeTimes,
  929. tid: thisData.tid,
  930. });
  931. }
  932. if (!totalCui) {
  933. totalCui = 0;
  934. }
  935. totalCui = (Math.round(totalCui * 1000000) / 1000000).toFixed(6);
  936. this.setState({
  937. contactListNew: theArr,
  938. totalCui
  939. });
  940. }
  941. }.bind(this)
  942. }).always(
  943. function () {
  944. this.setState({
  945. loading: false
  946. });
  947. }.bind(this)
  948. );
  949. },
  950. getOrderLog(orderNo) {
  951. this.setState({
  952. rizhivisible: true
  953. });
  954. this.rizhi(orderNo);
  955. },
  956. rizhi(orderNo) {
  957. $.ajax({
  958. method: "get",
  959. dataType: "json",
  960. crossDomain: false,
  961. url: "/api/admin/newOrder/selectOrderLog",
  962. data: {
  963. orderNo: orderNo
  964. },
  965. success: function (data) {
  966. let theArr = [];
  967. let thisData = data.data;
  968. if (!thisData.length) {
  969. if (data.error && data.error.length) {
  970. message.warning(data.error[0].message);
  971. }
  972. thisData = {};
  973. } else {
  974. for (let i = 0; i < data.data.length; i++) {
  975. let thisdata = data.data[i];
  976. theArr.push({
  977. processName: thisdata.processName,
  978. adminName: thisdata.adminName,
  979. createDate: thisdata.createDate,
  980. remarks: thisdata.remarks
  981. });
  982. }
  983. }
  984. this.setState({
  985. dataSourcerizhi: theArr
  986. });
  987. }.bind(this)
  988. });
  989. },
  990. render() {
  991. const { searchValues, } = this.state
  992. return (
  993. <div className="user-content">
  994. <ShowModalDiv ShowModal={this.state.showModal} onClose={() => { this.setState({ showModal: false }) }} />
  995. <div className="content-title" style={{ marginBottom: 10 }}>
  996. <span style={{ fontWeight: 900, fontSize: 16 }}>报销总计</span>
  997. </div>
  998. <Tabs defaultActiveKey="2" className="test">
  999. <TabPane tab="搜索" key="2">
  1000. <div className="user-search" style={{ marginLeft: 10 }}>
  1001. <Select placeholder="" style={{ width: 140 }}
  1002. value={searchValues["targetType"]}
  1003. onChange={(e) => {
  1004. searchValues["targetType"] = e;
  1005. const _this = this;
  1006. this.setState({
  1007. searchValues: searchValues,
  1008. }, () => {
  1009. _this.search()
  1010. });
  1011. }}
  1012. >
  1013. <Select.Option value={0} >部门</Select.Option>
  1014. <Select.Option value={1} >订单</Select.Option>
  1015. </Select>
  1016. {
  1017. searchValues["targetType"] == 1 &&
  1018. <Input
  1019. placeholder="合同编号"
  1020. value={searchValues["contactNo"]
  1021. ? searchValues["contactNo"]
  1022. : ""}
  1023. onChange={(e) => {
  1024. searchValues["contactNo"] = e.target.value;
  1025. this.setState({
  1026. searchValues: searchValues,
  1027. });
  1028. }}
  1029. />
  1030. }
  1031. <Input
  1032. placeholder="客户名称"
  1033. value={searchValues["buyerName"]
  1034. ? searchValues["buyerName"]
  1035. : ""}
  1036. onChange={(e) => {
  1037. searchValues["buyerName"] = e.target.value;
  1038. this.setState({
  1039. searchValues: searchValues,
  1040. });
  1041. }}
  1042. />
  1043. <Select
  1044. placeholder="所属部门"
  1045. style={{ width: 200, marginRight: 10 }}
  1046. value={searchValues["depId"]
  1047. ? searchValues["depId"]
  1048. : undefined}
  1049. onChange={e => {
  1050. searchValues["depId"] = e;
  1051. this.setState({
  1052. searchValues: searchValues,
  1053. });
  1054. }}
  1055. >
  1056. {this.state.departmentArr.map(function (item) {
  1057. return <Select.Option key={item.id}>{item.name}</Select.Option>;
  1058. })}
  1059. </Select>
  1060. <span>报销时间:</span>
  1061. <RangePicker
  1062. style={{ width: 300 }}
  1063. value={[
  1064. searchValues.startTime ? moment(searchValues.startTime) : null,
  1065. searchValues.endTime ? moment(searchValues.endTime) : null,
  1066. ]}
  1067. onChange={(data, dataString) => {
  1068. this.setState({
  1069. searchValues: Object.assign(searchValues, {
  1070. startTime: dataString[0],
  1071. endTime: dataString[1],
  1072. }),
  1073. });
  1074. }}
  1075. />
  1076. <Button
  1077. type="primary"
  1078. onClick={this.search}
  1079. style={{ margin: "0 10px" }}
  1080. >搜索</Button>
  1081. <Button onClick={this.reset}>重置</Button>
  1082. <Button
  1083. type="primary"
  1084. onClick={this.getCountsClear}
  1085. style={{ marginLeft: 10 }}
  1086. >清理缓存</Button>
  1087. </div>
  1088. </TabPane>
  1089. <TabPane tab="更改表格显示数据" key="1">
  1090. <div style={{ marginLeft: 10 }}>
  1091. <ChooseList
  1092. columns={this.state.columns}
  1093. changeFn={this.changeList}
  1094. changeList={this.state.changeList}
  1095. top={55}
  1096. margin={11}
  1097. />
  1098. </div>
  1099. </TabPane>
  1100. <TabPane tab="导出" key="3">
  1101. <div style={{ float: "left" }}>
  1102. <Button
  1103. type="primary"
  1104. loading={this.state.exportPendingLoading}
  1105. onClick={this.export}
  1106. style={{ margin: 10 }}
  1107. >
  1108. 导出excel
  1109. </Button>
  1110. </div>
  1111. </TabPane>
  1112. </Tabs>
  1113. <div className="patent-table">
  1114. <Spin spinning={this.state.loading}>
  1115. <Table
  1116. bordered
  1117. columns={
  1118. this.state.changeList == undefined
  1119. ? this.state.columns
  1120. : this.state.changeList
  1121. }
  1122. dataSource={this.state.dataSource}
  1123. pagination={false}
  1124. size="small"
  1125. />
  1126. </Spin>
  1127. </div>
  1128. <Modal
  1129. visible={this.state.visible}
  1130. maskClosable={false}
  1131. footer={false}
  1132. width={1400}
  1133. onCancel={() => { this.setState({ visible: false }) }}
  1134. >
  1135. <Spin spinning={this.state.loading}>
  1136. <Table
  1137. columns={this.state.columnsA}
  1138. dataSource={this.state.dataSourceA}
  1139. bordered
  1140. size="middle"
  1141. pagination={false}
  1142. />
  1143. </Spin>
  1144. </Modal>
  1145. {
  1146. this.state.visibleD &&
  1147. <Modal
  1148. title="订单详情"
  1149. visible={this.state.visibleD}
  1150. maskClosable={false}
  1151. footer={false}
  1152. width={1200}
  1153. onCancel={() => { this.setState({ visibleD: false }) }}
  1154. >
  1155. <OrderDetail
  1156. orderData={this.state.orderData}
  1157. orderUid={this.state.orderUid}
  1158. getOrderLog={this.getOrderLog}
  1159. dataSourceX={this.state.dataSourceX}
  1160. contactList={this.state.contactList}
  1161. orderNo={this.state.orderNo}
  1162. totalCui={this.state.totalCui}
  1163. contactListNew={this.state.contactListNew}
  1164. />
  1165. </Modal>
  1166. }
  1167. <Modal
  1168. title="公出详情"
  1169. visible={this.state.visibleC}
  1170. maskClosable={false}
  1171. footer={false}
  1172. width={1400}
  1173. onCancel={() => { this.setState({ visibleC: false }) }}
  1174. >
  1175. <Spin spinning={this.state.loading}>
  1176. <Table
  1177. scroll={{ x: "120%" }}
  1178. columns={this.state.columnsC}
  1179. dataSource={this.state.dataSourceC}
  1180. bordered
  1181. size="middle"
  1182. pagination={false}
  1183. rowClassName={this.addRowColor}
  1184. />
  1185. </Spin>
  1186. </Modal>
  1187. </div>
  1188. );
  1189. },
  1190. });
  1191. export default AccountTotal;