index.jsx 30 KB

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