index.jsx 30 KB

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