detailedList.jsx 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  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) => (
  186. <Tag color={getClockState(text).color}>{getClockState(text).title}</Tag>
  187. )
  188. },
  189. {
  190. title: "打卡状态",
  191. dataIndex: "clockIn",
  192. key: "clockIn",
  193. width: 60,
  194. render: (text) => (
  195. text === 1 ? '已打卡' :
  196. text === 0 ? '未打卡' : ''
  197. )
  198. },
  199. {
  200. title: "公出原因/计划",
  201. dataIndex: "remarks",
  202. key: "remarks",
  203. width: 155,
  204. render: (text) => {
  205. return (<div style={{wordBreak:"break-all"}}>{text}</div>)
  206. },
  207. },
  208. {
  209. title: "补充",
  210. dataIndex: "supplement",
  211. key: "supplement",
  212. width: 155,
  213. render: (text) => {
  214. return (<div style={{wordBreak:"break-all"}}>{text}</div>)
  215. },
  216. },
  217. {
  218. title: "审核/指导",
  219. dataIndex: "auditInfo",
  220. key: "auditInfo",
  221. width: 155,
  222. render: (text) => {
  223. return (<div style={{wordBreak:"break-all"}}>{text}</div>)
  224. },
  225. },
  226. {
  227. title: "操作",
  228. dataIndex: "annexUrl",
  229. key: "annexUrl",
  230. render: (text,record) => (
  231. <div>
  232. <Button
  233. type={"primary"}
  234. onClick={(e) => {
  235. e.stopPropagation();
  236. let arr1 = text || [];
  237. let arr2 = record.photoUrl || [];
  238. this.setState({
  239. annexUrlArr:splitUrl(arr1, ",", globalConfig.avatarHost + "/upload"),
  240. photoUrlArr:splitUrl(arr2, ",", globalConfig.avatarHost + "/upload"),
  241. },()=>{
  242. this.setState({
  243. imgListVisible:true
  244. })
  245. })
  246. }}
  247. >
  248. 查看附件
  249. </Button>
  250. </div>
  251. )
  252. },
  253. ],
  254. searchList:[
  255. {
  256. type:'departmentSelect',
  257. dataKey:'depId',
  258. placeholder:'请选择部门'
  259. },
  260. {
  261. type:'times',
  262. title:'公出时间',
  263. dataKey:'date',
  264. format: 'YYYY/MM'
  265. },
  266. ],
  267. searchList1:[
  268. {
  269. type:'select',
  270. dataKey:'status',
  271. placeholder:'请选择审核状态',
  272. selectList:()=>{
  273. let arr = [];
  274. for(let i of clockState){
  275. arr.push({
  276. value:i.id,
  277. label:i.title
  278. })
  279. }
  280. return arr;
  281. }
  282. },
  283. {
  284. type:'select',
  285. dataKey:'clockIn',
  286. placeholder:'请选择打卡状态',
  287. selectList:[
  288. {
  289. value:'0',
  290. label:'已打卡'
  291. },
  292. {
  293. value:'1',
  294. label:'未打卡'
  295. }
  296. ]
  297. },
  298. {
  299. type:'autoComplete',
  300. dataKey:'aid',
  301. api:'/api/admin/customer/listAdminByName',
  302. search:'adminName',
  303. placeholder:'请输入公出申请人'
  304. },
  305. {
  306. type:'autoComplete',
  307. dataKey:'sid',
  308. api:'/api/admin/customer/listAdminByName',
  309. search:'adminName',
  310. placeholder:'请输入跟单人'
  311. },
  312. ],
  313. columns2:[
  314. {
  315. title: "合同编号",
  316. dataIndex: "contractNo",
  317. key: "contractNo",
  318. },
  319. {
  320. title: "订单编号",
  321. dataIndex: "orderNo",
  322. key: "orderNo",
  323. },
  324. {
  325. title: "客户名称",
  326. dataIndex: "userName",
  327. key: "userName",
  328. render:text=>{
  329. return (
  330. <Tooltip title={text}>
  331. <div style={{
  332. maxWidth:'150px',
  333. overflow:'hidden',
  334. textOverflow: "ellipsis",
  335. whiteSpace:'nowrap',
  336. }}>{text}</div>
  337. </Tooltip>
  338. )
  339. }
  340. },
  341. {
  342. title: "订单部门",
  343. dataIndex: "depName",
  344. key: "depName",
  345. },
  346. {
  347. title: "下单时间",
  348. dataIndex: "createDate",
  349. key: "createTime",
  350. },
  351. {
  352. title: "合同签订时间",
  353. dataIndex: "signDate",
  354. key: "signDate",
  355. },
  356. {
  357. title: "流程状态",
  358. dataIndex: "processStatus",
  359. key: "processStatus",
  360. render: (text) => {
  361. return getProcessStatus(text);
  362. },
  363. },
  364. {
  365. title: "签单金额(万元)",
  366. dataIndex: "totalAmount",
  367. key: "totalAmount",
  368. },
  369. {
  370. title: "开票金额(万元)",
  371. dataIndex: "invoiceAmount",
  372. key: "invoiceAmount",
  373. },
  374. {
  375. title: "已收款(万元)",
  376. dataIndex: "settlementAmount",
  377. key: "settlementAmount",
  378. },
  379. {
  380. title: "结算状态",
  381. dataIndex: "liquidationStatus",
  382. key: "liquidationStatus",
  383. render: (text) => {
  384. return getLiquidationStatus(text);
  385. },
  386. },
  387. {
  388. title: "是否特批",
  389. dataIndex: "approval",
  390. key: "approval",
  391. render: (text) => {
  392. return getApprovedState(text);
  393. },
  394. },
  395. {
  396. title: "订单状态",
  397. dataIndex: "orderStatus",
  398. key: "orderStatus",
  399. render: (text) => {
  400. return getNewOrderStatus(text);
  401. },
  402. },
  403. {
  404. title: "财务负责人",
  405. dataIndex: "financeName",
  406. key: "financeName",
  407. },
  408. ],
  409. searchList2:[
  410. {
  411. type:'text',
  412. placeholder:'请输入订单编号',
  413. dataKey:'orderNo',
  414. },
  415. {
  416. type:'text',
  417. placeholder:'请输入客户名称',
  418. dataKey:'name',
  419. },
  420. {
  421. type:'text',
  422. placeholder:'请输入合同编号',
  423. dataKey:'contractNo',
  424. },
  425. {
  426. type:'select',
  427. dataKey:'liquidationStatus',
  428. placeholder:'请选择结算状态',
  429. selectList:[
  430. {
  431. value:'0',
  432. label:'首付待付请'
  433. },
  434. {
  435. value:'1',
  436. label:'尾款待付清'
  437. },
  438. {
  439. value:'2',
  440. label:'已付清'
  441. },
  442. ]
  443. },
  444. {
  445. type:'select',
  446. dataKey:'approval',
  447. placeholder:'请选择特批状态',
  448. selectList:[
  449. {
  450. value:'0',
  451. label:'非特批'
  452. },
  453. {
  454. value:'1',
  455. label:'特批'
  456. },
  457. ]
  458. },
  459. {
  460. type:'select',
  461. dataKey:'amountStatus',
  462. placeholder:'请选择签单金额',
  463. selectList:[
  464. {
  465. value:'0',
  466. label:'10万元以下'
  467. },
  468. {
  469. value:'1',
  470. label:'10~20万元'
  471. },
  472. {
  473. value:'2',
  474. label:'20~30万元'
  475. },
  476. {
  477. value:'3',
  478. label:'30~40万元'
  479. },
  480. {
  481. value:'4',
  482. label:'40万元以上'
  483. },
  484. ]
  485. },
  486. ],
  487. searchConfig:{}
  488. }
  489. }
  490. render() {
  491. return (
  492. <div>
  493. <Modal
  494. maskClosable={false}
  495. visible={this.props.visible}
  496. onOk={this.props.onCancel}
  497. onCancel={this.props.onCancel}
  498. width='1200px'
  499. title={this.props.recordInfor.name + '面谈表'}
  500. footer=''
  501. className="admin-desc-content">
  502. <div className="user-content">
  503. <TabelContent
  504. scroll={{ x: 0, y: 500}}
  505. searchList={this.state.searchList}
  506. columns={this.state.columns}
  507. searchConfig={this.props.searchConfig}
  508. tabelApi={'/api/admin/provinceFollowStatisticsList'}
  509. exportApi={'/api/admin/provinceFollowStatisticsListExport'}
  510. query={{
  511. province:this.props.recordInfor.id,
  512. }}
  513. onRowClick={()=>{}}
  514. searchOperation={(value)=>{
  515. for(let i of Object.keys(value)){
  516. if(i === 'sort' || i === 'pageNo' || i === 'pageSize'){
  517. delete value[i]
  518. }
  519. }
  520. this.setState({searchConfig:value})}
  521. }
  522. dataProcessing={(data)=>{
  523. let theArr = [];
  524. for (let i = 0; i < data.data.length; i++) {
  525. let thisdata = data.data[i];
  526. thisdata.key=i + 1;
  527. theArr.push(thisdata);
  528. }
  529. return theArr;
  530. }}
  531. />
  532. </div>
  533. {this.state.visible1 && <Modal
  534. maskClosable={false}
  535. visible={this.state.visible1}
  536. onOk={()=>{
  537. this.setState({
  538. visible1:false,
  539. uid:'',
  540. depId:''
  541. })
  542. }}
  543. onCancel={()=>{
  544. this.setState({
  545. visible1:false,
  546. uid:'',
  547. depId:''
  548. })
  549. }}
  550. width='1600px'
  551. title='公出详细列表'
  552. footer=''
  553. className="admin-desc-content">
  554. <div className="user-content">
  555. <TabelContent
  556. scroll={{ x: 1200 }}
  557. searchConfig={this.state.searchConfig}
  558. searchList={this.state.searchList1}
  559. columns={this.state.columns1}
  560. tabelApi={'/api/admin/release/publicReleaseDtails'}
  561. exportApi={'/api/admin/release/publicReleaseDtails/export'}
  562. query={{
  563. uid:this.state.uid,
  564. depId:this.state.depId,
  565. releaseStart:moment(this.state.searchConfig.date).startOf('month').format('YYYY-MM-DD'),
  566. releaseEnd:moment(this.state.searchConfig.date).endOf('month').format('YYYY-MM-DD')
  567. }}
  568. exportExecProcessing={(data)=>{
  569. data.uid = this.state.uid;
  570. data.depId = this.state.depId;
  571. return data;
  572. }}
  573. onRowClick={()=>{}}
  574. dataProcessing={(data)=>{
  575. let theArr = [];
  576. for (let i = 0; i < data.data.list.length; i++) {
  577. let thisdata = data.data.list[i];
  578. thisdata.key=(data.data.pageNo - 1) * data.data.pageSize + i + 1;
  579. theArr.push(thisdata);
  580. }
  581. return theArr;
  582. }}
  583. />
  584. </div>
  585. </Modal>}
  586. {this.state.visible2 && <Modal
  587. maskClosable={false}
  588. visible={this.state.visible2}
  589. onOk={()=>{
  590. this.setState({
  591. visible2:false,
  592. uid:'',
  593. depId:''
  594. })
  595. }}
  596. onCancel={()=>{
  597. this.setState({
  598. visible2:false,
  599. uid:'',
  600. depId:''
  601. })
  602. }}
  603. width='1600px'
  604. title='客户订单列表'
  605. footer=''
  606. className="admin-desc-content">
  607. <div className="user-content">
  608. <TabelContent
  609. scroll={{ x: 1200 }}
  610. searchConfig={this.state.searchConfig}
  611. searchList={this.state.searchList2}
  612. columns={this.state.columns2}
  613. tabelApi={'/api/admin/newOrder/orderNewList'}
  614. query={{
  615. uid:this.state.uid,
  616. depId:this.state.depId,
  617. specially: 8,
  618. starTime:moment(this.state.searchConfig.date).startOf('month').format('YYYY-MM-DD'),
  619. endTime:moment(this.state.searchConfig.date).endOf('month').format('YYYY-MM-DD')
  620. }}
  621. onRowClick={()=>{}}
  622. dataProcessing={(data)=>{
  623. let theArr = [];
  624. for (let i = 0; i < data.data.list.length; i++) {
  625. let thisdata = data.data.list[i];
  626. thisdata.key=(data.data.pageNo - 1) * data.data.pageSize + i + 1;
  627. theArr.push(thisdata);
  628. }
  629. return theArr;
  630. }}
  631. />
  632. </div>
  633. </Modal>}
  634. </Modal>
  635. {this.state.imgListVisible ? <Modal
  636. maskClosable={false}
  637. visible={this.state.imgListVisible}
  638. onOk={()=>{this.setState({
  639. imgListVisible:false
  640. })}}
  641. onCancel={()=>{this.setState({
  642. imgListVisible:false
  643. })}}
  644. width='500px'
  645. title='图片'
  646. footer=''>
  647. <div>
  648. <div>申请附件</div>
  649. <ImgList fileList={this.state.annexUrlArr} domId='publicStatistics'/>
  650. <div style={{paddingTop:'35px'}}>打卡照片</div>
  651. <ImgList fileList={this.state.photoUrlArr} domId='publicStatistics1'/>
  652. </div>
  653. </Modal> : null}
  654. </div>
  655. )
  656. }
  657. }
  658. export default DetailedList;