index.jsx 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080
  1. import React, { Component } from "react";
  2. import {
  3. AutoComplete,
  4. Button,
  5. DatePicker,
  6. Input,
  7. message,
  8. Modal,
  9. Select,
  10. Spin,
  11. Table,
  12. Tabs,
  13. Tag,
  14. Tooltip,
  15. } from "antd";
  16. import { ShowModal, splitUrl, getClockState } from "@/tools";
  17. import { clockState } from "@/dataDic";
  18. import { ChooseList } from "../../order/orderNew/chooseList";
  19. import $ from "jquery/src/ajax";
  20. import "./index.less";
  21. import moment from "moment";
  22. import ImgList from "../../../common/imgList";
  23. import Cascaders from "../../../common/cascaders";
  24. const { TabPane } = Tabs;
  25. const { RangePicker } = DatePicker;
  26. class PublicSummary extends Component {
  27. constructor(props) {
  28. super(props);
  29. this.state = {
  30. pageNo: 1,
  31. loading: false,
  32. changeList: undefined,
  33. annexUrlArr: [],
  34. photoUrlArr: [],
  35. imgListVisible: false,
  36. logVisible: false,
  37. columns: [
  38. {
  39. title: "编号",
  40. dataIndex: "key",
  41. key: "key",
  42. width: 45,
  43. fixed: "left",
  44. },
  45. {
  46. title: "客户名称",
  47. dataIndex: "userName",
  48. key: "userName",
  49. width: 150,
  50. fixed: "left",
  51. render: (text, record) => {
  52. return (
  53. <div>
  54. <div>{text}</div>
  55. <div style={{ color: ["red", "green"][record.signBills] }}>
  56. {["未签单", "已签单"][record.signBills]}
  57. {record.signBills == 1 && `(${record.signTime})`}
  58. </div>
  59. </div >
  60. );
  61. },
  62. },
  63. {
  64. title: "公出地点",
  65. dataIndex: "districtName",
  66. key: "districtName",
  67. width: 120,
  68. render: (text) => {
  69. return (
  70. <div>{text}</div>
  71. );
  72. },
  73. },
  74. {
  75. title: "跟单人",
  76. dataIndex: "sname",
  77. key: "sname",
  78. width: 90,
  79. render: (text, record) => {
  80. return (
  81. <Tooltip title={text}>
  82. <div>{text}</div>
  83. </Tooltip>
  84. );
  85. },
  86. },
  87. {
  88. title: "公出人员",
  89. dataIndex: "aname",
  90. key: "aname",
  91. width: 190,
  92. render: (text, record) => {
  93. return (
  94. <Tooltip title={text}>
  95. <div>
  96. <p style={{ color: "red" }}>[ 打卡人:{text} ]</p>
  97. {record.assist !== 0 && <p style={{ color: "#8552A1" }} >[ 协单人:{record.assistAidName}]</p>}
  98. {!!record.assistantName && <p style={{ color: "#228fbd" }} >[ 协单助手:{record.assistantName}]</p>}
  99. </div>
  100. </Tooltip>
  101. );
  102. },
  103. },
  104. {
  105. title: "申请时间",
  106. dataIndex: "createTimes",
  107. key: "createTimes",
  108. width: 80,
  109. },
  110. {
  111. title: "公出时间",
  112. dataIndex: "releaseStarts",
  113. key: "releaseStarts",
  114. width: 130,
  115. render: (text, record) => (
  116. <div>
  117. <div>{text}</div>
  118. <div style={{ paddingLeft: "44px" }}>至</div>
  119. <div>{record.releaseEnds}</div>
  120. </div>
  121. ),
  122. },
  123. {
  124. title: "公出时长(时)",
  125. dataIndex: "duration",
  126. key: "duration",
  127. width: 50,
  128. },
  129. {
  130. title: "打卡时间",
  131. dataIndex: "clockInTimes",
  132. key: "clockInTimes",
  133. width: 120,
  134. render: (text, record) => (
  135. <div>
  136. {
  137. text.split("\n").map(it =>
  138. <div>{it}</div>
  139. )
  140. }
  141. <Tag color={["#F21212", "#34DE38", "#ffd400"][record.clockIn]}>{["未打卡", "已打卡", "异常打卡"][record.clockIn]}</Tag>
  142. </div>
  143. )
  144. },
  145. {
  146. title: "标签",
  147. dataIndex: "status",
  148. key: "status",
  149. width: 200,
  150. render: (text, record) => (
  151. <div>
  152. <div style={{ display: "flex", flexDirection: "row" }}>
  153. <Tag
  154. color={["#45b97c", "#69541b", "#f47920", "#8552a1", "#228fbd"][record.type]}
  155. >
  156. {
  157. record.type === 0
  158. ? "业务公出" : record.type === 1
  159. ? "技术公出" : record.type === 2
  160. ? "行政公出" : record.type === 3
  161. ? "技术协单" : record.type === 4
  162. ? "协单助手" : ""
  163. }
  164. </Tag>
  165. <Tag color={getClockState(text).color}>
  166. {getClockState(text).title}
  167. </Tag>
  168. {record.updateStatus == 1 && <Tag color="#1E90FF">改</Tag>}
  169. </div>
  170. {record.type === 1 && <div style={{ marginTop: 5 }}>{record.contractNo}</div>}
  171. {record.type === 1 && <div>{record.totalAmout + "(万元)"}</div>}
  172. </div>
  173. ),
  174. },
  175. {
  176. title: "公出目标",
  177. dataIndex: "remarks",
  178. key: "remarks",
  179. width: 280,
  180. render: (text) => {
  181. return (
  182. <div>{text}</div>
  183. );
  184. },
  185. },
  186. {
  187. title: "公出计划",
  188. dataIndex: "plan",
  189. key: "plan",
  190. width: 280,
  191. render: (text) => {
  192. return (
  193. <div>{text}</div>
  194. );
  195. },
  196. },
  197. {
  198. title: "预计效果",
  199. dataIndex: "expectedEffect",
  200. key: "expectedEffect",
  201. width: 280,
  202. render: (text) => {
  203. return (
  204. <div>{text}</div>
  205. );
  206. },
  207. },
  208. {
  209. title: "本次公出目标总结",
  210. dataIndex: "supplement",
  211. key: "supplement",
  212. width: 280,
  213. render: (text) => {
  214. return (
  215. <div>{text}</div>
  216. );
  217. },
  218. },
  219. {
  220. title: "下一次公出计划",
  221. dataIndex: "nextPlan",
  222. key: "nextPlan",
  223. width: 280,
  224. render: (text) => {
  225. return (
  226. <div>{text}</div>
  227. );
  228. },
  229. },
  230. {
  231. title: "审核/指导",
  232. dataIndex: "auditInfo",
  233. key: "auditInfo",
  234. width: 200,
  235. render: (text, record) => {
  236. return <div style={{ wordBreak: "break-all" }} >
  237. {record.auditTimes && `审核时间:${record.auditTimes}`}
  238. {text}
  239. </div >;
  240. },
  241. },
  242. {
  243. title: "操作",
  244. dataIndex: "annexUrl",
  245. key: "annexUrl",
  246. render: (text, record) => (
  247. <div>
  248. <Button
  249. type={"primary"}
  250. onClick={(e) => {
  251. e.stopPropagation();
  252. let arr1 = text || [];
  253. // let arr2 = record.photoUrl || [];
  254. let arr3 = record.list || [];
  255. this.setState(
  256. {
  257. annexUrlArr: splitUrl(arr1, ",", globalConfig.avatarHost + "/upload"),
  258. phoList: arr3,
  259. // photoUrlArr: splitUrl(arr2, ",", globalConfig.avatarHost + "/upload"),
  260. }, () => {
  261. this.setState({
  262. imgListVisible: true,
  263. });
  264. }
  265. );
  266. }}
  267. >
  268. 查看附件
  269. </Button>
  270. <Button
  271. type="primary"
  272. style={{ marginTop: 10 }}
  273. onClick={() => {
  274. this.getLog(record.id)
  275. }}
  276. >
  277. 公出日志
  278. </Button>
  279. </div>
  280. ),
  281. },
  282. ],
  283. logColumns: [
  284. {
  285. title: "状态",
  286. dataIndex: "status",
  287. key: "status",
  288. render: (text) => (
  289. <Tag color={getClockState(text, true).color}>
  290. {getClockState(text, true).title}
  291. </Tag>
  292. ),
  293. },
  294. {
  295. title: "操作人",
  296. dataIndex: "aname",
  297. key: "aname",
  298. },
  299. {
  300. title: "操作时间",
  301. dataIndex: "createTimes",
  302. key: "createTimes",
  303. },
  304. {
  305. title: "备注",
  306. dataIndex: "remarks",
  307. key: "remarks",
  308. render: (text) => {
  309. return (
  310. <Tooltip placement="topLeft" title={text}>
  311. <div
  312. style={{
  313. maxWidth: "250px",
  314. overflow: "hidden",
  315. textOverflow: "ellipsis",
  316. whiteSpace: "nowrap",
  317. }}
  318. >
  319. {text}
  320. </div>
  321. </Tooltip>
  322. );
  323. },
  324. }
  325. ],
  326. pagination: {
  327. defaultCurrent: 1,
  328. defaultPageSize: 10,
  329. showQuickJumper: true,
  330. pageSize: 10,
  331. onChange: function (page) {
  332. this.loadData(page);
  333. }.bind(this),
  334. showTotal: function (total) {
  335. return "共" + total + "条数据";
  336. },
  337. },
  338. dataSource: [],
  339. logData: [],
  340. releaseDate: [moment(Date.now() - 777600000).format('YYYY-MM-DD'), moment(Date.now()).format('YYYY-MM-DD')],
  341. status: undefined,
  342. clockIn: undefined,
  343. deps: undefined,
  344. theTypes: undefined,
  345. theTypes1: undefined,
  346. theCustomerTypes: undefined,
  347. contractNo: undefined,
  348. };
  349. this.loadData = this.loadData.bind(this);
  350. this.resetAll = this.resetAll.bind(this);
  351. this.changeList = this.changeList.bind(this);
  352. this.selectSuperId = this.selectSuperId.bind(this);
  353. this.supervisor = this.supervisor.bind(this);
  354. this.httpChange = this.httpChange.bind(this);
  355. this.blurChange = this.blurChange.bind(this);
  356. this.selectAuto = this.selectAuto.bind(this);
  357. this.httpChange1 = this.httpChange1.bind(this);
  358. this.blurChange1 = this.blurChange1.bind(this);
  359. this.selectAuto1 = this.selectAuto1.bind(this);
  360. this.getCustomer = this.getCustomer.bind(this);
  361. this.selectCustomerAuto = this.selectCustomerAuto.bind(this);
  362. this.httpCustomerChange = this.httpCustomerChange.bind(this);
  363. this.blurCustomerChange = this.blurCustomerChange.bind(this);
  364. this.exportExec = this.exportExec.bind(this);
  365. this.addRowColor = this.addRowColor.bind(this)
  366. }
  367. //获取上级组织
  368. selectSuperId() {
  369. $.ajax({
  370. method: "get",
  371. dataType: "json",
  372. crossDomain: false,
  373. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  374. data: {},
  375. success: function (data) {
  376. let theArr = [];
  377. if (data.error && data.error.length === 0) {
  378. for (let i = 0; i < data.data.length; i++) {
  379. let theData = data.data[i];
  380. theArr.push(
  381. <Select.Option value={theData.id} key={theData.id}>
  382. {theData.name}
  383. </Select.Option>
  384. );
  385. }
  386. this.setState({
  387. contactsOption: theArr,
  388. });
  389. } else {
  390. message.warning(data.error[0].message);
  391. }
  392. }.bind(this),
  393. }).always(
  394. function () {
  395. this.setState({
  396. loading: false,
  397. });
  398. }.bind(this)
  399. );
  400. }
  401. addRowColor(record) {
  402. if (record.assist === 1 || record.assist === 2 || record.assist === 3) {
  403. return 'light'
  404. } else {
  405. return 'dark'
  406. }
  407. }
  408. changeList(arr) {
  409. const newArr = [];
  410. this.state.columns.forEach((item) => {
  411. arr.forEach((val) => {
  412. if (val === item.title) {
  413. newArr.push(item);
  414. }
  415. });
  416. });
  417. this.setState({
  418. changeList: newArr,
  419. });
  420. }
  421. loadData(pageNo) {
  422. this.setState({
  423. loading: true,
  424. });
  425. $.ajax({
  426. method: "get",
  427. dataType: "json",
  428. crossDomain: false,
  429. url: globalConfig.context + "/api/admin/release/publicReleaseDtails",
  430. data: {
  431. pageNo: pageNo || 1,
  432. pageSize: this.state.pagination.pageSize,
  433. releaseStart: this.state.releaseDate[0] || undefined,
  434. releaseEnd: this.state.releaseDate[1] || undefined,
  435. aid: this.state.theTypes || undefined,
  436. sid: this.state.theTypes1 || undefined,
  437. uid: this.state.theCustomerTypes || undefined,
  438. status: this.state.status,
  439. clockIn: this.state.clockIn,
  440. deps: this.state.deps || undefined,
  441. publicType: this.state.type,
  442. contractNo: this.state.contractNo || undefined,
  443. },
  444. success: function (data) {
  445. ShowModal(this);
  446. let theArr = [];
  447. this.setState({
  448. loading: false,
  449. });
  450. if (data.error && data.error.length === 0) {
  451. for (let i = 0; i < data.data.list.length; i++) {
  452. let thisdata = data.data.list[i];
  453. thisdata.key = (data.data.pageNo - 1) * data.data.pageSize + i + 1;
  454. theArr.push(thisdata);
  455. }
  456. this.state.pagination.current = data.data.pageNo;
  457. this.state.pagination.total = data.data.totalCount;
  458. if (data.data && data.data.list && !data.data.list.length) {
  459. this.state.pagination.current = 0;
  460. this.state.pagination.total = 0;
  461. }
  462. this.setState({
  463. dataSource: theArr,
  464. pagination: this.state.pagination,
  465. pageNo: data.data.pageNo,
  466. });
  467. } else {
  468. message.warning(data.error[0].message);
  469. }
  470. }.bind(this),
  471. }).always(
  472. function () {
  473. this.setState({
  474. loading: false,
  475. });
  476. }.bind(this)
  477. );
  478. }
  479. resetAll() {
  480. this.setState(
  481. {
  482. releaseDate: [moment(Date.now() - 777600000).format('YYYY-MM-DD'), moment(Date.now()).format('YYYY-MM-DD')],
  483. theCustomerTypes: undefined,
  484. status: undefined,
  485. clockIn: undefined,
  486. deps: undefined,
  487. auto: "",
  488. auto1: "",
  489. customer: "",
  490. theTypes: undefined,
  491. theTypes1: undefined,
  492. type: undefined,
  493. contractNo: undefined,
  494. },
  495. () => {
  496. this.Cascaders.empty();
  497. this.loadData();
  498. }
  499. );
  500. }
  501. supervisor(e) {
  502. $.ajax({
  503. method: "get",
  504. dataType: "json",
  505. crossDomain: false,
  506. url: globalConfig.context + "/api/admin/customer/listAdminByName",
  507. data: {
  508. adminName: e,
  509. status: "2",
  510. },
  511. success: function (data) {
  512. if (data.error && data.error.length === 0) {
  513. this.setState({
  514. customerArr: data.data,
  515. });
  516. } else {
  517. message.warning(data.error[0].message);
  518. }
  519. }.bind(this),
  520. }).always(function () { }.bind(this));
  521. }
  522. supervisor1(e) {
  523. $.ajax({
  524. method: "get",
  525. dataType: "json",
  526. crossDomain: false,
  527. url: globalConfig.context + "/api/admin/customer/listAdminByName",
  528. data: {
  529. adminName: e,
  530. status: "2",
  531. },
  532. success: function (data) {
  533. if (data.error && data.error.length === 0) {
  534. this.setState({
  535. customerArr1: data.data,
  536. });
  537. } else {
  538. message.warning(data.error[0].message);
  539. }
  540. }.bind(this),
  541. }).always(function () { }.bind(this));
  542. }
  543. httpChange(e) {
  544. if (e.length >= 1) {
  545. this.supervisor(e);
  546. }
  547. this.setState({
  548. auto: e,
  549. });
  550. }
  551. httpChange1(e) {
  552. if (e.length >= 1) {
  553. this.supervisor1(e);
  554. }
  555. this.setState({
  556. auto1: e,
  557. });
  558. }
  559. selectAuto(value, options) {
  560. this.setState({
  561. auto: value,
  562. });
  563. }
  564. selectAuto1(value, options) {
  565. this.setState({
  566. auto1: value,
  567. });
  568. }
  569. httpCustomerChange(e) {
  570. if (e.length >= 1) {
  571. this.getCustomer(e);
  572. }
  573. this.setState({
  574. customer: e,
  575. });
  576. }
  577. selectCustomerAuto(value, options) {
  578. this.setState({
  579. customer: value,
  580. });
  581. }
  582. getCustomer(e) {
  583. $.ajax({
  584. method: "get",
  585. dataType: "json",
  586. crossDomain: false,
  587. url: globalConfig.context + "/api/admin/customer/getUserByName",
  588. data: {
  589. name: e,
  590. },
  591. success: function (data) {
  592. if (data.error && data.error.length === 0) {
  593. this.setState({
  594. customerList: data.data,
  595. });
  596. } else {
  597. message.warning(data.error[0].message);
  598. }
  599. }.bind(this),
  600. }).always(function () { }.bind(this));
  601. }
  602. blurCustomerChange(e) {
  603. let theType = "";
  604. let contactLists = this.state.customerList || [];
  605. if (e) {
  606. contactLists.map(function (item) {
  607. if (item.name == e.toString()) {
  608. theType = item.id;
  609. }
  610. });
  611. }
  612. this.setState({
  613. theCustomerTypes: theType,
  614. });
  615. }
  616. blurChange(e) {
  617. let theType = "";
  618. let contactLists = this.state.customerArr || [];
  619. if (e) {
  620. contactLists.map(function (item) {
  621. if (item.name == e.toString()) {
  622. theType = item.id;
  623. }
  624. });
  625. }
  626. this.setState({
  627. theTypes: theType,
  628. });
  629. }
  630. blurChange1(e) {
  631. let theType = "";
  632. let contactLists = this.state.customerArr1 || [];
  633. if (e) {
  634. contactLists.map(function (item) {
  635. if (item.name == e.toString()) {
  636. theType = item.id;
  637. }
  638. });
  639. }
  640. this.setState({
  641. theTypes1: theType,
  642. });
  643. }
  644. componentWillMount() {
  645. this.loadData();
  646. this.selectSuperId();
  647. }
  648. exportExec() {
  649. this.setState({
  650. exportPendingLoading: true,
  651. });
  652. message.config({
  653. duration: 20,
  654. });
  655. let loading = message.loading("下载中...");
  656. let data = {
  657. releaseStart: this.state.releaseDate[0] || undefined,
  658. releaseEnd: this.state.releaseDate[1] || undefined,
  659. aid: this.state.theTypes || undefined,
  660. sid: this.state.theTypes1 || undefined,
  661. uid: this.state.theCustomerTypes || undefined,
  662. status: this.state.status,
  663. clockIn: this.state.clockIn,
  664. // depId: this.state.depId,
  665. deps: this.state.deps || undefined,
  666. publicType: this.state.type,
  667. contractNo: this.state.contractNo || undefined
  668. };
  669. for (let i of Object.keys(data)) {
  670. if (i === "status" || i === "clockIn") {
  671. if (isNaN(parseInt(data[i]))) {
  672. delete data[i];
  673. }
  674. } else if (!data[i]) {
  675. delete data[i];
  676. }
  677. }
  678. $.ajax({
  679. method: "get",
  680. dataType: "json",
  681. crossDomain: false,
  682. url:
  683. globalConfig.context + "/api/admin/release/publicReleaseDtails/export",
  684. data,
  685. success: function (data) {
  686. if (data.error.length === 0) {
  687. this.download(data.data);
  688. } else {
  689. message.warning(data.error[0].message);
  690. }
  691. }.bind(this),
  692. }).always(
  693. function () {
  694. loading();
  695. this.setState({
  696. exportPendingLoading: false,
  697. });
  698. }.bind(this)
  699. );
  700. }
  701. download(fileName) {
  702. window.location.href =
  703. globalConfig.context + "/open/download?fileName=" + fileName;
  704. }
  705. // 公出日志
  706. getLog(e) {
  707. this.setState({
  708. loading: true,
  709. logVisible: true
  710. });
  711. $.ajax({
  712. method: "get",
  713. dataType: "json",
  714. url: globalConfig.context + "/api/admin/release/listPublicReleaseLog",
  715. data: {
  716. id: e,
  717. },
  718. success: function (data) {
  719. if (data.error.length === 0) {
  720. this.setState({
  721. logData: data.data || [],
  722. });
  723. } else {
  724. message.warning(data.error[0].message);
  725. }
  726. }.bind(this),
  727. }).always(
  728. function () {
  729. this.setState({
  730. loading: false,
  731. });
  732. }.bind(this)
  733. );
  734. }
  735. render() {
  736. const dataSources = this.state.customerArr || [];
  737. const dataSources1 = this.state.customerArr1 || [];
  738. const options = dataSources.map((group) => (
  739. <Select.Option key={group.id} value={group.name}>
  740. {group.name}
  741. </Select.Option>
  742. ));
  743. const options1 = dataSources1.map((group) => (
  744. <Select.Option key={group.id} value={group.name}>
  745. {group.name}
  746. </Select.Option>
  747. ));
  748. const customerList = this.state.customerList || [];
  749. const customerOptions = customerList.map((group) => (
  750. <Select.Option key={group.id} value={group.name}>
  751. {group.name}
  752. </Select.Option>
  753. ));
  754. return (
  755. <div>
  756. <div className="user-content">
  757. <div className="content-title">
  758. <span>公出详细列表(全部)</span>
  759. </div>
  760. <Tabs defaultActiveKey="1" className="test">
  761. <TabPane tab="搜索" key="1">
  762. <div
  763. className="user-search"
  764. style={{
  765. marginTop: "10px",
  766. marginLeft: "10px",
  767. marginRight: "10px",
  768. }}
  769. >
  770. <span>
  771. <Input
  772. placeholder="合同编号"
  773. style={{ width: 120, marginRight: 10 }}
  774. value={this.state.contractNo}
  775. onChange={(e) => {
  776. this.setState({
  777. contractNo: e.target.value,
  778. });
  779. }}
  780. />
  781. </span>
  782. <span>
  783. <AutoComplete
  784. className="certain-category-search"
  785. dropdownClassName="certain-category-search-dropdown"
  786. dropdownMatchSelectWidth={false}
  787. style={{ width: "120px" }}
  788. dataSource={customerOptions}
  789. placeholder="输入客户名称"
  790. value={this.state.customer}
  791. onChange={this.httpCustomerChange}
  792. filterOption={true}
  793. onBlur={this.blurCustomerChange}
  794. onSelect={this.selectCustomerAuto}
  795. >
  796. <Input />
  797. </AutoComplete>
  798. </span>
  799. <span>
  800. <Select
  801. placeholder="请选择审核状态"
  802. style={{ width: 120 }}
  803. value={this.state.status}
  804. onChange={(e) => {
  805. this.setState({ status: e });
  806. }}
  807. >
  808. {clockState.map((v, k) => (
  809. <Select.Option key={k} value={v.id}>
  810. {v.title}
  811. </Select.Option>
  812. ))}
  813. </Select>
  814. </span>
  815. <span>
  816. <Select
  817. placeholder="请选择打卡状态"
  818. style={{ width: 120 }}
  819. value={this.state.clockIn}
  820. onChange={(e) => {
  821. this.setState({ clockIn: e });
  822. }}
  823. >
  824. <Select.Option value={0}>未打卡</Select.Option>
  825. <Select.Option value={1}>已打卡</Select.Option>
  826. <Select.Option value={2}>异常打卡</Select.Option>
  827. </Select>
  828. </span>
  829. <span style={{ marginRight: "10px" }}>
  830. <Select
  831. placeholder="请选择公出类型"
  832. style={{ width: 120 }}
  833. value={this.state.type}
  834. onChange={(e) => {
  835. this.setState({ type: e });
  836. }}
  837. >
  838. <Select.Option value={0}>业务打卡</Select.Option>
  839. <Select.Option value={1}>技术打卡</Select.Option>
  840. <Select.Option value={2}>行政打卡</Select.Option>
  841. <Select.Option value={3}>技术协单</Select.Option>
  842. <Select.Option value={4}>协单助手</Select.Option>
  843. </Select>
  844. </span>
  845. <span>
  846. <AutoComplete
  847. className="certain-category-search"
  848. dropdownClassName="certain-category-search-dropdown"
  849. dropdownMatchSelectWidth={false}
  850. style={{ width: "120px" }}
  851. dataSource={options}
  852. placeholder="输入公出申请人"
  853. value={this.state.auto}
  854. onChange={this.httpChange}
  855. filterOption={true}
  856. onBlur={this.blurChange}
  857. onSelect={this.selectAuto}
  858. >
  859. <Input />
  860. </AutoComplete>
  861. </span>
  862. <span>
  863. <AutoComplete
  864. className="certain-category-search"
  865. dropdownClassName="certain-category-search-dropdown"
  866. dropdownMatchSelectWidth={false}
  867. style={{ width: "120px" }}
  868. dataSource={options1}
  869. placeholder="输入跟单人"
  870. value={this.state.auto1}
  871. onChange={this.httpChange1}
  872. filterOption={true}
  873. onBlur={this.blurChange1}
  874. onSelect={this.selectAuto1}
  875. >
  876. <Input />
  877. </AutoComplete>
  878. </span>
  879. <Cascaders
  880. ref={node => this.Cascaders = node}
  881. placeholder="请选择公出部门"
  882. id="id"
  883. name="name"
  884. children="list"
  885. height={28}
  886. onSel={(e) => {
  887. this.setState({
  888. deps: JSON.stringify(e),
  889. });
  890. }}
  891. />
  892. {/* <span style={{ marginRight: "10px" }}>
  893. <Select
  894. placeholder="请选择公出部门"
  895. style={{ width: 200 }}
  896. value={this.state.depId}
  897. onChange={(e) => {
  898. this.setState({ depId: e });
  899. }}
  900. notFoundContent="未获取到上级组织列表"
  901. >
  902. {this.state.contactsOption}
  903. </Select>
  904. </span> */}
  905. <span style={{ marginRight: "10px" }}>
  906. <span style={{ marginRight: "5px", marginBottom: "10px" }}>
  907. 公出时间 :
  908. </span>
  909. <RangePicker
  910. allowClear={window.adminData.shiroList.indexOf("11") == -1}
  911. disabledDate={(current) => {//“运营管理”角色只能查看部分时间段(暂时10天)的数据
  912. let iskeep = window.adminData.shiroList.indexOf("11") != -1
  913. return iskeep && current && current.valueOf() < Date.now() - 864000000;
  914. }}
  915. style={{ marginRight: "10px", marginBottom: "10px", width: 200 }}
  916. value={[
  917. this.state.releaseDate[0]
  918. ? moment(this.state.releaseDate[0])
  919. : null,
  920. this.state.releaseDate[1]
  921. ? moment(this.state.releaseDate[1])
  922. : null,
  923. ]}
  924. onChange={(data, dataString) => {
  925. this.setState({ releaseDate: dataString });
  926. }}
  927. />
  928. </span>
  929. <Button
  930. type="primary"
  931. onClick={() => {
  932. this.loadData();
  933. }}
  934. style={{ marginRight: "10px", marginBottom: "10px" }}
  935. >
  936. 搜索
  937. </Button>
  938. <Button
  939. onClick={this.resetAll}
  940. style={{ marginRight: "10px", marginBottom: "10px" }}
  941. >
  942. 重置
  943. </Button>
  944. </div>
  945. </TabPane>
  946. <TabPane tab="更改表格显示数据" key="2">
  947. <div style={{ marginLeft: 10 }}>
  948. <Spin spinning={this.state.loading}>
  949. <ChooseList
  950. columns={this.state.columns}
  951. changeFn={this.changeList}
  952. changeList={this.state.changeList}
  953. top={55}
  954. margin={11}
  955. />
  956. </Spin>
  957. </div>
  958. </TabPane>
  959. <TabPane tab="导出" key="3">
  960. <div style={{ float: "left" }}>
  961. <Button
  962. loading={this.state.exportPendingLoading}
  963. onClick={this.exportExec}
  964. style={{ margin: 10 }}
  965. >
  966. 导出excel
  967. </Button>
  968. </div>
  969. </TabPane>
  970. </Tabs>
  971. <div className="patent-table">
  972. <Spin spinning={this.state.loading}>
  973. <Table
  974. bordered
  975. size="middle"
  976. scroll={{ x: "120%" }}
  977. columns={
  978. this.state.changeList
  979. ? this.state.changeList
  980. : this.state.columns
  981. }
  982. dataSource={this.state.dataSource}
  983. pagination={this.state.pagination}
  984. rowClassName={this.addRowColor}
  985. />
  986. </Spin>
  987. </div>
  988. </div>
  989. {this.state.imgListVisible ? (
  990. <Modal
  991. maskClosable={false}
  992. visible={this.state.imgListVisible}
  993. onOk={() => {
  994. this.setState({
  995. imgListVisible: false,
  996. });
  997. }}
  998. onCancel={() => {
  999. this.setState({
  1000. imgListVisible: false,
  1001. });
  1002. }}
  1003. width="500px"
  1004. title="图片"
  1005. footer=""
  1006. >
  1007. <div>
  1008. <div style={{ paddingBottom: "20px", fontSize: "15px" }}>申请附件</div>
  1009. <ImgList
  1010. fileList={this.state.annexUrlArr}
  1011. domId="publicStatistics"
  1012. />
  1013. <div style={{ padding: "20px 0", fontSize: "15px" }}>打卡照片</div>
  1014. {
  1015. this.state.phoList.map(it =>
  1016. <div>
  1017. <div>{it.clockInTime}</div>
  1018. <ImgList
  1019. fileList={splitUrl(it.photoUrl, ",", globalConfig.avatarHost + "/upload")}
  1020. domId="publicStatistics1"
  1021. />
  1022. </div>
  1023. )
  1024. }
  1025. </div>
  1026. </Modal>
  1027. ) : null}
  1028. {
  1029. this.state.logVisible &&
  1030. <Modal
  1031. maskClosable={false}
  1032. visible={this.state.logVisible}
  1033. width="700px"
  1034. title="公出日志"
  1035. footer=""
  1036. onCancel={() => {
  1037. this.setState({
  1038. logVisible: false,
  1039. });
  1040. }}
  1041. >
  1042. <Table
  1043. pagination={false}
  1044. columns={this.state.logColumns}
  1045. dataSource={this.state.logData}
  1046. />
  1047. </Modal>
  1048. }
  1049. </div>
  1050. );
  1051. }
  1052. }
  1053. export default PublicSummary;