index.jsx 34 KB

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