index.jsx 32 KB

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