index.jsx 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061
  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) => {
  52. return (
  53. <div>{text}</div>
  54. );
  55. },
  56. },
  57. {
  58. title: "公出地点",
  59. dataIndex: "districtName",
  60. key: "districtName",
  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. contractNo: undefined,
  336. };
  337. this.loadData = this.loadData.bind(this);
  338. this.resetAll = this.resetAll.bind(this);
  339. this.changeList = this.changeList.bind(this);
  340. this.selectSuperId = this.selectSuperId.bind(this);
  341. this.supervisor = this.supervisor.bind(this);
  342. this.httpChange = this.httpChange.bind(this);
  343. this.blurChange = this.blurChange.bind(this);
  344. this.selectAuto = this.selectAuto.bind(this);
  345. this.httpChange1 = this.httpChange1.bind(this);
  346. this.blurChange1 = this.blurChange1.bind(this);
  347. this.selectAuto1 = this.selectAuto1.bind(this);
  348. this.getCustomer = this.getCustomer.bind(this);
  349. this.selectCustomerAuto = this.selectCustomerAuto.bind(this);
  350. this.httpCustomerChange = this.httpCustomerChange.bind(this);
  351. this.blurCustomerChange = this.blurCustomerChange.bind(this);
  352. this.exportExec = this.exportExec.bind(this);
  353. this.addRowColor = this.addRowColor.bind(this)
  354. }
  355. //获取上级组织
  356. selectSuperId() {
  357. $.ajax({
  358. method: "get",
  359. dataType: "json",
  360. crossDomain: false,
  361. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  362. data: {},
  363. success: function (data) {
  364. let theArr = [];
  365. if (data.error && data.error.length === 0) {
  366. for (let i = 0; i < data.data.length; i++) {
  367. let theData = data.data[i];
  368. theArr.push(
  369. <Select.Option value={theData.id} key={theData.id}>
  370. {theData.name}
  371. </Select.Option>
  372. );
  373. }
  374. this.setState({
  375. contactsOption: theArr,
  376. });
  377. } else {
  378. message.warning(data.error[0].message);
  379. }
  380. }.bind(this),
  381. }).always(
  382. function () {
  383. this.setState({
  384. loading: false,
  385. });
  386. }.bind(this)
  387. );
  388. }
  389. addRowColor(record) {
  390. if (record.assist === 1 || record.assist === 2 || record.assist === 3) {
  391. return 'light'
  392. } else {
  393. return 'dark'
  394. }
  395. }
  396. changeList(arr) {
  397. const newArr = [];
  398. this.state.columns.forEach((item) => {
  399. arr.forEach((val) => {
  400. if (val === item.title) {
  401. newArr.push(item);
  402. }
  403. });
  404. });
  405. this.setState({
  406. changeList: newArr,
  407. });
  408. }
  409. loadData(pageNo) {
  410. this.setState({
  411. loading: true,
  412. });
  413. $.ajax({
  414. method: "get",
  415. dataType: "json",
  416. crossDomain: false,
  417. url: globalConfig.context + "/api/admin/release/publicReleaseDtails",
  418. data: {
  419. pageNo: pageNo || 1,
  420. pageSize: this.state.pagination.pageSize,
  421. releaseStart: this.state.releaseDate[0] || undefined,
  422. releaseEnd: this.state.releaseDate[1] || undefined,
  423. aid: this.state.theTypes || undefined,
  424. sid: this.state.theTypes1 || undefined,
  425. uid: this.state.theCustomerTypes || undefined,
  426. status: this.state.status,
  427. clockIn: this.state.clockIn,
  428. deps: this.state.deps || undefined,
  429. publicType: this.state.type,
  430. contractNo: this.state.contractNo || undefined,
  431. },
  432. success: function (data) {
  433. ShowModal(this);
  434. let theArr = [];
  435. this.setState({
  436. loading: false,
  437. });
  438. if (data.error && data.error.length === 0) {
  439. for (let i = 0; i < data.data.list.length; i++) {
  440. let thisdata = data.data.list[i];
  441. thisdata.key = (data.data.pageNo - 1) * data.data.pageSize + i + 1;
  442. theArr.push(thisdata);
  443. }
  444. this.state.pagination.current = data.data.pageNo;
  445. this.state.pagination.total = data.data.totalCount;
  446. if (data.data && data.data.list && !data.data.list.length) {
  447. this.state.pagination.current = 0;
  448. this.state.pagination.total = 0;
  449. }
  450. this.setState({
  451. dataSource: theArr,
  452. pagination: this.state.pagination,
  453. pageNo: data.data.pageNo,
  454. });
  455. } else {
  456. message.warning(data.error[0].message);
  457. }
  458. }.bind(this),
  459. }).always(
  460. function () {
  461. this.setState({
  462. loading: false,
  463. });
  464. }.bind(this)
  465. );
  466. }
  467. resetAll() {
  468. this.setState(
  469. {
  470. releaseDate: [moment(Date.now() - 777600000).format('YYYY-MM-DD'), moment(Date.now()).format('YYYY-MM-DD')],
  471. theCustomerTypes: undefined,
  472. status: undefined,
  473. clockIn: undefined,
  474. deps: undefined,
  475. auto: "",
  476. auto1: "",
  477. customer: "",
  478. theTypes: undefined,
  479. theTypes1: undefined,
  480. type: undefined,
  481. contractNo: undefined,
  482. },
  483. () => {
  484. this.Cascaders.empty();
  485. this.loadData();
  486. }
  487. );
  488. }
  489. supervisor(e) {
  490. $.ajax({
  491. method: "get",
  492. dataType: "json",
  493. crossDomain: false,
  494. url: globalConfig.context + "/api/admin/customer/listAdminByName",
  495. data: {
  496. adminName: e,
  497. status: "2",
  498. },
  499. success: function (data) {
  500. if (data.error && data.error.length === 0) {
  501. this.setState({
  502. customerArr: data.data,
  503. });
  504. } else {
  505. message.warning(data.error[0].message);
  506. }
  507. }.bind(this),
  508. }).always(function () { }.bind(this));
  509. }
  510. supervisor1(e) {
  511. $.ajax({
  512. method: "get",
  513. dataType: "json",
  514. crossDomain: false,
  515. url: globalConfig.context + "/api/admin/customer/listAdminByName",
  516. data: {
  517. adminName: e,
  518. status: "2",
  519. },
  520. success: function (data) {
  521. if (data.error && data.error.length === 0) {
  522. this.setState({
  523. customerArr1: data.data,
  524. });
  525. } else {
  526. message.warning(data.error[0].message);
  527. }
  528. }.bind(this),
  529. }).always(function () { }.bind(this));
  530. }
  531. httpChange(e) {
  532. if (e.length >= 1) {
  533. this.supervisor(e);
  534. }
  535. this.setState({
  536. auto: e,
  537. });
  538. }
  539. httpChange1(e) {
  540. if (e.length >= 1) {
  541. this.supervisor1(e);
  542. }
  543. this.setState({
  544. auto1: e,
  545. });
  546. }
  547. selectAuto(value, options) {
  548. this.setState({
  549. auto: value,
  550. });
  551. }
  552. selectAuto1(value, options) {
  553. this.setState({
  554. auto1: value,
  555. });
  556. }
  557. httpCustomerChange(e) {
  558. if (e.length >= 1) {
  559. this.getCustomer(e);
  560. }
  561. this.setState({
  562. customer: e,
  563. });
  564. }
  565. selectCustomerAuto(value, options) {
  566. this.setState({
  567. customer: value,
  568. });
  569. }
  570. getCustomer(e) {
  571. $.ajax({
  572. method: "get",
  573. dataType: "json",
  574. crossDomain: false,
  575. url: globalConfig.context + "/api/admin/customer/getUserByName",
  576. data: {
  577. name: e,
  578. },
  579. success: function (data) {
  580. if (data.error && data.error.length === 0) {
  581. this.setState({
  582. customerList: data.data,
  583. });
  584. } else {
  585. message.warning(data.error[0].message);
  586. }
  587. }.bind(this),
  588. }).always(function () { }.bind(this));
  589. }
  590. blurCustomerChange(e) {
  591. let theType = "";
  592. let contactLists = this.state.customerList || [];
  593. if (e) {
  594. contactLists.map(function (item) {
  595. if (item.name == e.toString()) {
  596. theType = item.id;
  597. }
  598. });
  599. }
  600. this.setState({
  601. theCustomerTypes: theType,
  602. });
  603. }
  604. blurChange(e) {
  605. let theType = "";
  606. let contactLists = this.state.customerArr || [];
  607. if (e) {
  608. contactLists.map(function (item) {
  609. if (item.name == e.toString()) {
  610. theType = item.id;
  611. }
  612. });
  613. }
  614. this.setState({
  615. theTypes: theType,
  616. });
  617. }
  618. blurChange1(e) {
  619. let theType = "";
  620. let contactLists = this.state.customerArr1 || [];
  621. if (e) {
  622. contactLists.map(function (item) {
  623. if (item.name == e.toString()) {
  624. theType = item.id;
  625. }
  626. });
  627. }
  628. this.setState({
  629. theTypes1: theType,
  630. });
  631. }
  632. componentWillMount() {
  633. this.loadData();
  634. this.selectSuperId();
  635. }
  636. exportExec() {
  637. this.setState({
  638. exportPendingLoading: true,
  639. });
  640. message.config({
  641. duration: 20,
  642. });
  643. let loading = message.loading("下载中...");
  644. let data = {
  645. releaseStart: this.state.releaseDate[0] || undefined,
  646. releaseEnd: this.state.releaseDate[1] || undefined,
  647. aid: this.state.theTypes || undefined,
  648. sid: this.state.theTypes1 || undefined,
  649. uid: this.state.theCustomerTypes || undefined,
  650. status: this.state.status,
  651. clockIn: this.state.clockIn,
  652. // depId: this.state.depId,
  653. deps: this.state.deps || undefined,
  654. publicType: this.state.type,
  655. contractNo: this.state.contractNo || undefined
  656. };
  657. for (let i of Object.keys(data)) {
  658. if (i === "status" || i === "clockIn") {
  659. if (isNaN(parseInt(data[i]))) {
  660. delete data[i];
  661. }
  662. } else if (!data[i]) {
  663. delete data[i];
  664. }
  665. }
  666. $.ajax({
  667. method: "get",
  668. dataType: "json",
  669. crossDomain: false,
  670. url:
  671. globalConfig.context + "/api/admin/release/publicReleaseDtails/export",
  672. data,
  673. success: function (data) {
  674. if (data.error.length === 0) {
  675. this.download(data.data);
  676. } else {
  677. message.warning(data.error[0].message);
  678. }
  679. }.bind(this),
  680. }).always(
  681. function () {
  682. loading();
  683. this.setState({
  684. exportPendingLoading: false,
  685. });
  686. }.bind(this)
  687. );
  688. }
  689. download(fileName) {
  690. window.location.href =
  691. globalConfig.context + "/open/download?fileName=" + fileName;
  692. }
  693. // 公出日志
  694. getLog(e) {
  695. this.setState({
  696. loading: true,
  697. logVisible: true
  698. });
  699. $.ajax({
  700. method: "get",
  701. dataType: "json",
  702. url: globalConfig.context + "/api/admin/release/listPublicReleaseLog",
  703. data: {
  704. id: e,
  705. },
  706. success: function (data) {
  707. if (data.error.length === 0) {
  708. this.setState({
  709. logData: data.data || [],
  710. });
  711. } else {
  712. message.warning(data.error[0].message);
  713. }
  714. }.bind(this),
  715. }).always(
  716. function () {
  717. this.setState({
  718. loading: false,
  719. });
  720. }.bind(this)
  721. );
  722. }
  723. render() {
  724. const dataSources = this.state.customerArr || [];
  725. const dataSources1 = this.state.customerArr1 || [];
  726. const options = dataSources.map((group) => (
  727. <Select.Option key={group.id} value={group.name}>
  728. {group.name}
  729. </Select.Option>
  730. ));
  731. const options1 = dataSources1.map((group) => (
  732. <Select.Option key={group.id} value={group.name}>
  733. {group.name}
  734. </Select.Option>
  735. ));
  736. const customerList = this.state.customerList || [];
  737. const customerOptions = customerList.map((group) => (
  738. <Select.Option key={group.id} value={group.name}>
  739. {group.name}
  740. </Select.Option>
  741. ));
  742. return (
  743. <div>
  744. <div className="user-content">
  745. <div className="content-title">
  746. <span>公出详细列表(全部)</span>
  747. </div>
  748. <Tabs defaultActiveKey="1" className="test">
  749. <TabPane tab="搜索" key="1">
  750. <div
  751. className="user-search"
  752. style={{
  753. marginTop: "10px",
  754. marginLeft: "10px",
  755. marginRight: "10px",
  756. }}
  757. >
  758. <span>
  759. <Input
  760. placeholder="合同编号"
  761. style={{ width: 120, marginRight: 10 }}
  762. value={this.state.contractNo}
  763. onChange={(e) => {
  764. this.setState({
  765. contractNo: e.target.value,
  766. });
  767. }}
  768. />
  769. </span>
  770. <span>
  771. <AutoComplete
  772. className="certain-category-search"
  773. dropdownClassName="certain-category-search-dropdown"
  774. dropdownMatchSelectWidth={false}
  775. style={{ width: "120px" }}
  776. dataSource={customerOptions}
  777. placeholder="输入客户名称"
  778. value={this.state.customer}
  779. onChange={this.httpCustomerChange}
  780. filterOption={true}
  781. onBlur={this.blurCustomerChange}
  782. onSelect={this.selectCustomerAuto}
  783. >
  784. <Input />
  785. </AutoComplete>
  786. </span>
  787. <span>
  788. <Select
  789. placeholder="请选择审核状态"
  790. style={{ width: 120 }}
  791. value={this.state.status}
  792. onChange={(e) => {
  793. this.setState({ status: e });
  794. }}
  795. >
  796. {clockState.map((v, k) => (
  797. <Select.Option key={k} value={v.id}>
  798. {v.title}
  799. </Select.Option>
  800. ))}
  801. </Select>
  802. </span>
  803. <span>
  804. <Select
  805. placeholder="请选择打卡状态"
  806. style={{ width: 120 }}
  807. value={this.state.clockIn}
  808. onChange={(e) => {
  809. this.setState({ clockIn: e });
  810. }}
  811. >
  812. <Select.Option value={0}>未打卡</Select.Option>
  813. <Select.Option value={1}>已打卡</Select.Option>
  814. <Select.Option value={2}>异常打卡</Select.Option>
  815. </Select>
  816. </span>
  817. <span style={{ marginRight: "10px" }}>
  818. <Select
  819. placeholder="请选择公出类型"
  820. style={{ width: 120 }}
  821. value={this.state.type}
  822. onChange={(e) => {
  823. this.setState({ type: e });
  824. }}
  825. >
  826. <Select.Option value={0}>业务打卡</Select.Option>
  827. <Select.Option value={1}>技术打卡</Select.Option>
  828. <Select.Option value={2}>行政打卡</Select.Option>
  829. <Select.Option value={3}>技术协单</Select.Option>
  830. <Select.Option value={4}>协单助手</Select.Option>
  831. </Select>
  832. </span>
  833. <span>
  834. <AutoComplete
  835. className="certain-category-search"
  836. dropdownClassName="certain-category-search-dropdown"
  837. dropdownMatchSelectWidth={false}
  838. style={{ width: "120px" }}
  839. dataSource={options}
  840. placeholder="输入公出申请人"
  841. value={this.state.auto}
  842. onChange={this.httpChange}
  843. filterOption={true}
  844. onBlur={this.blurChange}
  845. onSelect={this.selectAuto}
  846. >
  847. <Input />
  848. </AutoComplete>
  849. </span>
  850. <span>
  851. <AutoComplete
  852. className="certain-category-search"
  853. dropdownClassName="certain-category-search-dropdown"
  854. dropdownMatchSelectWidth={false}
  855. style={{ width: "120px" }}
  856. dataSource={options1}
  857. placeholder="输入跟单人"
  858. value={this.state.auto1}
  859. onChange={this.httpChange1}
  860. filterOption={true}
  861. onBlur={this.blurChange1}
  862. onSelect={this.selectAuto1}
  863. >
  864. <Input />
  865. </AutoComplete>
  866. </span>
  867. <Cascaders
  868. ref={node => this.Cascaders = node}
  869. placeholder="请选择公出部门"
  870. id="id"
  871. name="name"
  872. children="list"
  873. height={28}
  874. onSel={(e) => {
  875. this.setState({
  876. deps: JSON.stringify(e),
  877. });
  878. }}
  879. />
  880. {/* <span style={{ marginRight: "10px" }}>
  881. <Select
  882. placeholder="请选择公出部门"
  883. style={{ width: 200 }}
  884. value={this.state.depId}
  885. onChange={(e) => {
  886. this.setState({ depId: e });
  887. }}
  888. notFoundContent="未获取到上级组织列表"
  889. >
  890. {this.state.contactsOption}
  891. </Select>
  892. </span> */}
  893. <span style={{ marginRight: "10px" }}>
  894. <span style={{ marginRight: "5px", marginBottom: "10px" }}>
  895. 公出时间 :
  896. </span>
  897. <RangePicker
  898. allowClear={window.adminData.shiroList.indexOf("11") == -1}
  899. disabledDate={(current) => {//“运营管理”角色只能查看部分时间段(暂时10天)的数据
  900. let iskeep = window.adminData.shiroList.indexOf("11") != -1
  901. return iskeep && current && current.valueOf() < Date.now() - 864000000;
  902. }}
  903. style={{ marginRight: "10px", marginBottom: "10px", width: 200 }}
  904. value={[
  905. this.state.releaseDate[0]
  906. ? moment(this.state.releaseDate[0])
  907. : null,
  908. this.state.releaseDate[1]
  909. ? moment(this.state.releaseDate[1])
  910. : null,
  911. ]}
  912. onChange={(data, dataString) => {
  913. this.setState({ releaseDate: dataString });
  914. }}
  915. />
  916. </span>
  917. <Button
  918. type="primary"
  919. onClick={() => {
  920. this.loadData();
  921. }}
  922. style={{ marginRight: "10px", marginBottom: "10px" }}
  923. >
  924. 搜索
  925. </Button>
  926. <Button
  927. onClick={this.resetAll}
  928. style={{ marginRight: "10px", marginBottom: "10px" }}
  929. >
  930. 重置
  931. </Button>
  932. </div>
  933. </TabPane>
  934. <TabPane tab="更改表格显示数据" key="2">
  935. <div style={{ marginLeft: 10 }}>
  936. <Spin spinning={this.state.loading}>
  937. <ChooseList
  938. columns={this.state.columns}
  939. changeFn={this.changeList}
  940. changeList={this.state.changeList}
  941. top={55}
  942. margin={11}
  943. />
  944. </Spin>
  945. </div>
  946. </TabPane>
  947. <TabPane tab="导出" key="3">
  948. <div style={{ float: "left" }}>
  949. <Button
  950. loading={this.state.exportPendingLoading}
  951. onClick={this.exportExec}
  952. style={{ margin: 10 }}
  953. >
  954. 导出excel
  955. </Button>
  956. </div>
  957. </TabPane>
  958. </Tabs>
  959. <div className="patent-table">
  960. <Spin spinning={this.state.loading}>
  961. <Table
  962. bordered
  963. size="middle"
  964. scroll={{ x: "120%" }}
  965. columns={
  966. this.state.changeList
  967. ? this.state.changeList
  968. : this.state.columns
  969. }
  970. dataSource={this.state.dataSource}
  971. pagination={this.state.pagination}
  972. rowClassName={this.addRowColor}
  973. />
  974. </Spin>
  975. </div>
  976. </div>
  977. {this.state.imgListVisible ? (
  978. <Modal
  979. maskClosable={false}
  980. visible={this.state.imgListVisible}
  981. onOk={() => {
  982. this.setState({
  983. imgListVisible: false,
  984. });
  985. }}
  986. onCancel={() => {
  987. this.setState({
  988. imgListVisible: false,
  989. });
  990. }}
  991. width="500px"
  992. title="图片"
  993. footer=""
  994. >
  995. <div>
  996. <div>申请附件</div>
  997. <ImgList
  998. fileList={this.state.annexUrlArr}
  999. domId="publicStatistics"
  1000. />
  1001. <div style={{ paddingTop: "35px" }}>打卡照片</div>
  1002. <ImgList
  1003. fileList={this.state.photoUrlArr}
  1004. domId="publicStatistics1"
  1005. />
  1006. </div>
  1007. </Modal>
  1008. ) : null}
  1009. {
  1010. this.state.logVisible &&
  1011. <Modal
  1012. maskClosable={false}
  1013. visible={this.state.logVisible}
  1014. width="700px"
  1015. title="公出日志"
  1016. footer=""
  1017. onCancel={() => {
  1018. this.setState({
  1019. logVisible: false,
  1020. });
  1021. }}
  1022. >
  1023. <Table
  1024. pagination={false}
  1025. columns={this.state.logColumns}
  1026. dataSource={this.state.logData}
  1027. />
  1028. </Modal>
  1029. }
  1030. </div>
  1031. );
  1032. }
  1033. }
  1034. export default PublicSummary;