index.jsx 33 KB

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