index.jsx 31 KB

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