detailedList.jsx 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703
  1. import React, { Component } from 'react';
  2. import { Button, Modal, Tag, Tooltip, } from "antd";
  3. import './index.less';
  4. import TabelContent from "../../../../common/tabelContent";
  5. import { splitUrl, getClockState } from "@/tools";
  6. import ImgList from "../../../../common/imgList";
  7. import { clockState } from "@/dataDic";
  8. import { getApprovedState, getLiquidationStatus, getNewOrderStatus, getProcessStatus } from "../../../../tools";
  9. import moment from 'moment';
  10. class DetailedList extends Component {
  11. constructor(props) {
  12. super(props);
  13. this.state = {
  14. columns: [
  15. {
  16. title: "编号",
  17. dataIndex: "key",
  18. key: "key",
  19. width: 120,
  20. },
  21. {
  22. title: "面谈部门",
  23. dataIndex: "name",
  24. key: "name",
  25. width: 320,
  26. },
  27. {
  28. title: "客户类型",
  29. dataIndex: "newUser",
  30. key: "newUser",
  31. width: 100,
  32. render: (text) => (
  33. text === 0 ? '新客户' :
  34. text === 1 ? '老客户' : ''
  35. )
  36. },
  37. {
  38. title: "面谈客户",
  39. dataIndex: "nickname",
  40. key: "nickname",
  41. width: 220,
  42. },
  43. {
  44. title: "面谈数",
  45. dataIndex: "quantity",
  46. key: "quantity",
  47. className: 'projectTable',
  48. width: 150,
  49. onCellClick: (record, event) => {
  50. event.stopPropagation();
  51. this.setState({
  52. visible1: true,
  53. uid: record.uid,
  54. depId: record.id,
  55. })
  56. },
  57. },
  58. {
  59. title: "签单数",
  60. dataIndex: "sign",
  61. key: "sign",
  62. className: 'projectTable',
  63. width: 150,
  64. onCellClick: (record, event) => {
  65. event.stopPropagation();
  66. this.setState({
  67. visible2: true,
  68. uid: record.uid,
  69. depId: record.id,
  70. })
  71. },
  72. },
  73. ],
  74. columns1: [
  75. {
  76. title: "编号",
  77. dataIndex: "key",
  78. key: "key",
  79. width: 45
  80. },
  81. {
  82. title: "客户名称",
  83. dataIndex: "nickname",
  84. key: "nickname",
  85. width: 140,
  86. render: (text) => {
  87. return (
  88. <div style={{
  89. width: 140,
  90. wordBreak: 'break-all',
  91. }}>{text}</div>
  92. )
  93. },
  94. },
  95. {
  96. title: "跟单人",
  97. dataIndex: "sname",
  98. key: "sname",
  99. width: 100,
  100. render: (text) => {
  101. return (
  102. <Tooltip title={text}>
  103. <div style={{
  104. width: 100,
  105. overflow: 'hidden',
  106. textOverflow: "ellipsis",
  107. whiteSpace: 'nowrap',
  108. }}>{text}</div>
  109. </Tooltip>
  110. )
  111. },
  112. },
  113. {
  114. title: "公出申请人",
  115. dataIndex: "aname",
  116. key: "aname",
  117. width: 100,
  118. render: (text) => {
  119. return (
  120. <Tooltip title={text}>
  121. <div style={{
  122. width: 100,
  123. overflow: 'hidden',
  124. textOverflow: "ellipsis",
  125. whiteSpace: 'nowrap',
  126. }}>{text}</div>
  127. </Tooltip>
  128. )
  129. },
  130. },
  131. {
  132. title: "申请时间",
  133. dataIndex: "createTimes",
  134. key: "createTimes",
  135. width: 130
  136. },
  137. {
  138. title: "公出时间",
  139. dataIndex: "releaseStarts",
  140. key: "releaseStarts",
  141. width: 130,
  142. render: (text, record) => (
  143. <div>
  144. <div>{text}</div>
  145. <div style={{ paddingLeft: '44px' }}>至</div>
  146. <div>{record.releaseEnds}</div>
  147. </div>
  148. )
  149. },
  150. {
  151. title: "公出地点",
  152. dataIndex: "userName",
  153. key: "userName",
  154. width: 120,
  155. render: (text) => {
  156. return (
  157. <Tooltip title={text}>
  158. <div style={{
  159. width: 120,
  160. overflow: 'hidden',
  161. textOverflow: "ellipsis",
  162. whiteSpace: 'nowrap',
  163. }}>{text}</div>
  164. </Tooltip>
  165. )
  166. },
  167. },
  168. {
  169. title: "公出时长(时)",
  170. dataIndex: "duration",
  171. key: "duration",
  172. width: 50
  173. },
  174. {
  175. title: "打卡时间",
  176. dataIndex: "clockInTimes",
  177. key: "clockInTimes",
  178. width: 130
  179. },
  180. {
  181. title: "审核状态",
  182. dataIndex: "status",
  183. key: "status",
  184. width: 40,
  185. render: (text, record) => (
  186. <div style={{ display: "flex", flexDirection: "row" }}>
  187. <Tag color={getClockState(text).color}>
  188. {getClockState(text).title}
  189. </Tag>
  190. {record.updateStatus === 1 && (
  191. <Tag color="#1E90FF">改</Tag>
  192. )}
  193. </div>
  194. // <Tag color={getClockState(text).color}>{getClockState(text).title}</Tag>
  195. )
  196. },
  197. {
  198. title: "打卡状态",
  199. dataIndex: "clockIn",
  200. key: "clockIn",
  201. width: 60,
  202. render: (text) => (
  203. <span
  204. style={{ color: ["#F21212", "#34DE38"][text] }}
  205. >
  206. {["未打卡", "已打卡"][text]}
  207. </span>
  208. )
  209. },
  210. {
  211. title: "公出类型",
  212. dataIndex: "type",
  213. key: "type",
  214. width: 70,
  215. render: (text) =>
  216. <span
  217. style={{ color: ["#1D4FEA", "#1E90FF", "#FF5500", "red"][text] }}
  218. >
  219. {
  220. text === 0
  221. ? "业务公出" : text === 1
  222. ? "技术公出" : text === 2
  223. ? "行政公出" : text === 3
  224. ? "技术协单" : ""
  225. }
  226. </span>
  227. },
  228. {
  229. title: "公出原因/计划",
  230. dataIndex: "remarks",
  231. key: "remarks",
  232. width: 155,
  233. render: (text) => {
  234. return (<div style={{ wordBreak: "break-all" }}>{text}</div>)
  235. },
  236. },
  237. {
  238. title: "补充",
  239. dataIndex: "supplement",
  240. key: "supplement",
  241. width: 155,
  242. render: (text) => {
  243. return (<div style={{ wordBreak: "break-all" }}>{text}</div>)
  244. },
  245. },
  246. {
  247. title: "审核/指导",
  248. dataIndex: "auditInfo",
  249. key: "auditInfo",
  250. width: 155,
  251. render: (text) => {
  252. return (<div style={{ wordBreak: "break-all" }}>{text}</div>)
  253. },
  254. },
  255. {
  256. title: "操作",
  257. dataIndex: "annexUrl",
  258. key: "annexUrl",
  259. render: (text, record) => (
  260. <div>
  261. <Button
  262. type={"primary"}
  263. onClick={(e) => {
  264. e.stopPropagation();
  265. let arr1 = text || [];
  266. let arr2 = record.photoUrl || [];
  267. this.setState({
  268. annexUrlArr: splitUrl(arr1, ",", globalConfig.avatarHost + "/upload"),
  269. photoUrlArr: splitUrl(arr2, ",", globalConfig.avatarHost + "/upload"),
  270. }, () => {
  271. this.setState({
  272. imgListVisible: true
  273. })
  274. })
  275. }}
  276. >
  277. 查看附件
  278. </Button>
  279. </div>
  280. )
  281. },
  282. ],
  283. searchList: [
  284. {
  285. type: 'newDepartmentSelect',
  286. dataKey: 'deps',
  287. placeholder: '请选择部门'
  288. },
  289. {
  290. type: 'times',
  291. title: '公出时间',
  292. dataKey: 'date',
  293. format: 'YYYY/MM'
  294. },
  295. ],
  296. searchList1: [
  297. {
  298. type: 'select',
  299. dataKey: 'status',
  300. placeholder: '请选择审核状态',
  301. selectList: () => {
  302. let arr = [];
  303. for (let i of clockState) {
  304. arr.push({
  305. value: i.id,
  306. label: i.title
  307. })
  308. }
  309. return arr;
  310. }
  311. },
  312. {
  313. type: 'select',
  314. dataKey: 'clockIn',
  315. placeholder: '请选择打卡状态',
  316. selectList: [
  317. {
  318. value: '0',
  319. label: '已打卡'
  320. },
  321. {
  322. value: '1',
  323. label: '未打卡'
  324. }
  325. ]
  326. },
  327. {
  328. type: 'autoComplete',
  329. dataKey: 'aid',
  330. api: '/api/admin/customer/listAdminByName',
  331. search: 'adminName',
  332. placeholder: '请输入公出申请人'
  333. },
  334. {
  335. type: 'autoComplete',
  336. dataKey: 'sid',
  337. api: '/api/admin/customer/listAdminByName',
  338. search: 'adminName',
  339. placeholder: '请输入跟单人'
  340. },
  341. ],
  342. columns2: [
  343. {
  344. title: "合同编号",
  345. dataIndex: "contractNo",
  346. key: "contractNo",
  347. },
  348. {
  349. title: "订单编号",
  350. dataIndex: "orderNo",
  351. key: "orderNo",
  352. },
  353. {
  354. title: "客户名称",
  355. dataIndex: "userName",
  356. key: "userName",
  357. render: text => {
  358. return (
  359. <Tooltip title={text}>
  360. <div
  361. // style={{
  362. // maxWidth: '150px',
  363. // overflow: 'hidden',
  364. // textOverflow: "ellipsis",
  365. // whiteSpace: 'nowrap',
  366. // }}
  367. >{text}</div>
  368. </Tooltip>
  369. )
  370. }
  371. },
  372. {
  373. title: "订单部门",
  374. dataIndex: "depName",
  375. key: "depName",
  376. },
  377. {
  378. title: "下单时间",
  379. dataIndex: "createDate",
  380. key: "createTime",
  381. },
  382. {
  383. title: "合同签订时间",
  384. dataIndex: "signDate",
  385. key: "signDate",
  386. },
  387. {
  388. title: "流程状态",
  389. dataIndex: "processStatus",
  390. key: "processStatus",
  391. render: (text, record) => {
  392. return getProcessStatus(text, record.examineName, record.approval);
  393. },
  394. },
  395. {
  396. title: "签单金额(万元)",
  397. dataIndex: "totalAmount",
  398. key: "totalAmount",
  399. },
  400. {
  401. title: "开票金额(万元)",
  402. dataIndex: "invoiceAmount",
  403. key: "invoiceAmount",
  404. },
  405. {
  406. title: "已收款(万元)",
  407. dataIndex: "settlementAmount",
  408. key: "settlementAmount",
  409. },
  410. {
  411. title: "结算状态",
  412. dataIndex: "liquidationStatus",
  413. key: "liquidationStatus",
  414. render: (text) => {
  415. return getLiquidationStatus(text);
  416. },
  417. },
  418. {
  419. title: "是否特批",
  420. dataIndex: "approval",
  421. key: "approval",
  422. render: (text) => {
  423. return getApprovedState(text);
  424. },
  425. },
  426. {
  427. title: "订单状态",
  428. dataIndex: "orderStatus",
  429. key: "orderStatus",
  430. render: (text) => {
  431. return getNewOrderStatus(text);
  432. },
  433. },
  434. {
  435. title: "财务负责人",
  436. dataIndex: "financeName",
  437. key: "financeName",
  438. },
  439. ],
  440. searchList2: [
  441. {
  442. type: 'text',
  443. placeholder: '请输入订单编号',
  444. dataKey: 'orderNo',
  445. },
  446. {
  447. type: 'text',
  448. placeholder: '请输入客户名称',
  449. dataKey: 'name',
  450. },
  451. {
  452. type: 'text',
  453. placeholder: '请输入合同编号',
  454. dataKey: 'contractNo',
  455. },
  456. {
  457. type: 'select',
  458. dataKey: 'liquidationStatus',
  459. placeholder: '请选择结算状态',
  460. selectList: [
  461. {
  462. value: '0',
  463. label: '首付待付请'
  464. },
  465. {
  466. value: '1',
  467. label: '尾款待付清'
  468. },
  469. {
  470. value: '2',
  471. label: '已付清'
  472. },
  473. ]
  474. },
  475. {
  476. type: 'select',
  477. dataKey: 'approval',
  478. placeholder: '请选择特批状态',
  479. selectList: [
  480. {
  481. value: '0',
  482. label: '非特批'
  483. },
  484. {
  485. value: '1',
  486. label: '特批'
  487. },
  488. ]
  489. },
  490. {
  491. type: 'select',
  492. dataKey: 'amountStatus',
  493. placeholder: '请选择签单金额',
  494. selectList: [
  495. {
  496. value: '0',
  497. label: '10万元以下'
  498. },
  499. {
  500. value: '1',
  501. label: '10~20万元'
  502. },
  503. {
  504. value: '2',
  505. label: '20~30万元'
  506. },
  507. {
  508. value: '3',
  509. label: '30~40万元'
  510. },
  511. {
  512. value: '4',
  513. label: '40万元以上'
  514. },
  515. ]
  516. },
  517. ],
  518. searchConfig: {}
  519. }
  520. }
  521. render() {
  522. return (
  523. <div>
  524. <Modal
  525. maskClosable={false}
  526. visible={this.props.visible}
  527. onOk={this.props.onCancel}
  528. onCancel={this.props.onCancel}
  529. width='1200px'
  530. title={this.props.recordInfor.name + '面谈表'}
  531. footer=''
  532. className="admin-desc-content">
  533. <div className="user-content">
  534. <TabelContent
  535. scroll={{ x: 0, y: 500 }}
  536. searchList={this.state.searchList}
  537. columns={this.state.columns}
  538. searchConfig={this.props.searchConfig}
  539. tabelApi={'/api/admin/provinceFollowStatisticsList'}
  540. exportApi={'/api/admin/provinceFollowStatisticsListExport'}
  541. query={{
  542. province: this.props.recordInfor.id,
  543. type: this.props.recordInfor.type
  544. }}
  545. onRowClick={() => { }}
  546. searchOperation={(value) => {
  547. for (let i of Object.keys(value)) {
  548. if (i === 'sort' || i === 'pageNo' || i === 'pageSize') {
  549. delete value[i]
  550. }
  551. }
  552. this.setState({ searchConfig: value })
  553. }
  554. }
  555. dataProcessing={(data) => {
  556. let theArr = [];
  557. for (let i = 0; i < data.data.length; i++) {
  558. let thisdata = data.data[i];
  559. thisdata.key = i + 1;
  560. theArr.push(thisdata);
  561. }
  562. return theArr;
  563. }}
  564. />
  565. </div>
  566. {this.state.visible1 && <Modal
  567. maskClosable={false}
  568. visible={this.state.visible1}
  569. onOk={() => {
  570. this.setState({
  571. visible1: false,
  572. uid: '',
  573. depId: ''
  574. })
  575. }}
  576. onCancel={() => {
  577. this.setState({
  578. visible1: false,
  579. uid: '',
  580. depId: ''
  581. })
  582. }}
  583. width='1600px'
  584. title='公出详细列表'
  585. footer=''
  586. className="admin-desc-content">
  587. <div className="user-content">
  588. <TabelContent
  589. scroll={{ x: 1200 }}
  590. searchConfig={JSON.parse(JSON.stringify(this.state.searchConfig))}
  591. searchList={this.state.searchList1}
  592. columns={this.state.columns1}
  593. tabelApi={'/api/admin/release/publicReleaseDtails'}
  594. exportApi={'/api/admin/release/publicReleaseDtails/export'}
  595. query={{
  596. uid: this.state.uid,
  597. depId: this.state.depId,
  598. releaseStart: moment(this.state.searchConfig.date).startOf('month').format('YYYY-MM-DD'),
  599. releaseEnd: moment(this.state.searchConfig.date).endOf('month').format('YYYY-MM-DD')
  600. }}
  601. exportExecProcessing={(data) => {
  602. data.uid = this.state.uid;
  603. data.depId = this.state.depId;
  604. return data;
  605. }}
  606. onRowClick={() => { }}
  607. dataProcessing={(data) => {
  608. let theArr = [];
  609. for (let i = 0; i < data.data.list.length; i++) {
  610. let thisdata = data.data.list[i];
  611. thisdata.key = (data.data.pageNo - 1) * data.data.pageSize + i + 1;
  612. theArr.push(thisdata);
  613. }
  614. return theArr;
  615. }}
  616. />
  617. </div>
  618. </Modal>}
  619. {this.state.visible2 && <Modal
  620. maskClosable={false}
  621. visible={this.state.visible2}
  622. onOk={() => {
  623. this.setState({
  624. visible2: false,
  625. uid: '',
  626. depId: ''
  627. })
  628. }}
  629. onCancel={() => {
  630. this.setState({
  631. visible2: false,
  632. uid: '',
  633. depId: ''
  634. })
  635. }}
  636. width='1600px'
  637. title='客户订单列表'
  638. footer=''
  639. className="admin-desc-content">
  640. <div className="user-content">
  641. <TabelContent
  642. scroll={{ x: 1200 }}
  643. searchConfig={JSON.parse(JSON.stringify(this.state.searchConfig))}
  644. searchList={this.state.searchList2}
  645. columns={this.state.columns2}
  646. tabelApi={'/api/admin/newOrder/orderNewList'}
  647. query={{
  648. uid: this.state.uid,
  649. depId: this.state.depId,
  650. specially: 8,
  651. starTime: moment(this.state.searchConfig.date).startOf('month').format('YYYY-MM-DD'),
  652. endTime: moment(this.state.searchConfig.date).endOf('month').format('YYYY-MM-DD')
  653. }}
  654. onRowClick={() => { }}
  655. dataProcessing={(data) => {
  656. let theArr = [];
  657. for (let i = 0; i < data.data.list.length; i++) {
  658. let thisdata = data.data.list[i];
  659. thisdata.key = (data.data.pageNo - 1) * data.data.pageSize + i + 1;
  660. theArr.push(thisdata);
  661. }
  662. return theArr;
  663. }}
  664. />
  665. </div>
  666. </Modal>}
  667. </Modal>
  668. {this.state.imgListVisible ? <Modal
  669. maskClosable={false}
  670. visible={this.state.imgListVisible}
  671. onOk={() => {
  672. this.setState({
  673. imgListVisible: false
  674. })
  675. }}
  676. onCancel={() => {
  677. this.setState({
  678. imgListVisible: false
  679. })
  680. }}
  681. width='500px'
  682. title='图片'
  683. footer=''>
  684. <div>
  685. <div>申请附件</div>
  686. <ImgList fileList={this.state.annexUrlArr} domId='publicStatistics' />
  687. <div style={{ paddingTop: '35px' }}>打卡照片</div>
  688. <ImgList fileList={this.state.photoUrlArr} domId='publicStatistics1' />
  689. </div>
  690. </Modal> : null}
  691. </div>
  692. )
  693. }
  694. }
  695. export default DetailedList;