停车场项目web, 互联网仓库, 开发完成后, 需要将代码回传云桌面.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1407 lines
36 KiB

  1. import React, { useState, useRef, useEffect, createContext } from "react";
  2. import { Input, Select, message, Popover, Pagination, Table,Tree, DatePicker, Form, Radio, Upload, Space, Modal, Cascader, Button } from "antd";
  3. // import { dictionary, utils } from "@/config/common";
  4. import { pageSizeOptions } from '@/config/character.config.js'
  5. import { LoadingOutlined, PlusOutlined } from '@ant-design/icons';
  6. import moment from 'moment'
  7. import { FormInput, FormSelect, ImgUpload, SystemSearch, FormDatePicker, Icon, ResultFlow, ExportBtn, SearchTabs } from "@/components"
  8. import { useSessionStorageState, useUpdateEffect, useSize, useUpdate, useSetState } from 'ahooks';
  9. import ajax from "@/services"
  10. import "./index.scss";
  11. import status_normal from '@/assets/images/status_normal.png'
  12. import status_err from '@/assets/images/status_err.png'
  13. import warningIcon from "@/assets/images/warningIcon.png";
  14. import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
  15. import { assign } from "lodash";
  16. function FunctionMgm() {
  17. //默认
  18. const parameter = {
  19. tenantName: "",
  20. manage_type: "",
  21. note: "",
  22. updateAt: "",
  23. manage_type_name: "",
  24. pn: 1,
  25. page_size: Number(pageSizeOptions[0]), // 每页条数
  26. }
  27. //等待状态
  28. const [loading, setLoading] = useState(false) // 等待状态
  29. //表格数据
  30. const [tableData, setTableData] = useState([])
  31. //表头
  32. const columns = [
  33. {
  34. title: '序号',
  35. dataIndex: 'id',
  36. key: 'id',
  37. align: "center",
  38. },
  39. {
  40. title: '商户名称',
  41. key: 'tenantName',
  42. dataIndex: 'tenantName',
  43. align: "center",
  44. },
  45. {
  46. title: '经营业务类型',
  47. key: 'manage_type_name',
  48. dataIndex: 'manage_type_name',
  49. align: "center",
  50. },
  51. {
  52. title: '备注',
  53. key: 'note',
  54. dataIndex: 'note',
  55. align: "center",
  56. render: (text, record, index) => record?.note || "--",
  57. },
  58. {
  59. title: '创建时间',
  60. key: 'updateAt',
  61. dataIndex: 'updateAt',
  62. align: "center",
  63. },
  64. {
  65. title: '操作',
  66. key: 'operation',
  67. dataIndex: 'operation',
  68. align: "center",
  69. render: (text, record, index) => {
  70. return <>
  71. <div onClick={() => { updateBtn(record) }} trigger="hover" style={{ color: '#409EFF', cursor: "pointer" }}>编辑</div>
  72. </>
  73. },
  74. },
  75. ]
  76. //检索表单
  77. const [formData, setFormData] = useSetState(parameter)
  78. const [lastFormData, setLastFormData] = useState(formData)
  79. const lastFormDataRef = useRef(formData)
  80. const [searchForm]=Form.useForm()
  81. //商户名称下拉
  82. const [tenantPull, setTenantPull] = useState([])
  83. //总条数
  84. const [total, setTotal] = useState()
  85. //编辑开关
  86. const [updateVisible, setUpdateVisible] = useState(false)
  87. //更新表单
  88. const [updateForm]=Form.useForm()
  89. //绑定功能
  90. const treeData = [
  91. {
  92. title: '路内停车管理系统',
  93. key: '0',
  94. children: [
  95. {
  96. title: '停车场管理',
  97. key: '0-0',
  98. children: [
  99. {
  100. title: '停车场管理',
  101. key: '0-0-0',
  102. children: [
  103. {
  104. title: '【按钮】查询',
  105. key: '0-0-0-0',
  106. },
  107. {
  108. title: '【按钮】添加',
  109. key: '',
  110. },
  111. {
  112. title: '【按钮】编辑',
  113. key: '',
  114. },
  115. {
  116. title: '【按钮】查看',
  117. key: '',
  118. },
  119. {
  120. title: '【按钮】停车场配置',
  121. key: '',
  122. },
  123. ]
  124. },
  125. {
  126. title: '停车记录查询',
  127. key: '0-0-1',
  128. children: [
  129. {
  130. title: '【按钮】查询',
  131. key: '',
  132. },
  133. {
  134. title: '【按钮】详情',
  135. key: '',
  136. },
  137. ]
  138. },
  139. {
  140. title: '泊位列表',
  141. key: '0-0-0-1',
  142. children: [
  143. {
  144. title: '【按钮】查询',
  145. key: '',
  146. },
  147. {
  148. title: '【按钮】查看',
  149. key: '',
  150. },
  151. ]
  152. },
  153. ],
  154. },
  155. {
  156. title: '业务管理',
  157. key: '0-0-1',
  158. children: [
  159. {
  160. title: '计费规则管理',
  161. key: '',
  162. children: [
  163. {
  164. title: '【按钮】查询',
  165. key: '',
  166. },
  167. {
  168. title: '【按钮】添加',
  169. key: '',
  170. },
  171. {
  172. title: '【按钮】编辑',
  173. key: '',
  174. },
  175. {
  176. title: '【按钮】查看',
  177. key: '',
  178. },
  179. ]
  180. },
  181. {
  182. title: '白名单管理',
  183. key: '',
  184. children: [
  185. {
  186. title: '白名单记录',
  187. key: '',
  188. children: [
  189. {
  190. title: '【按钮】查询',
  191. key: '',
  192. },
  193. {
  194. title: '【按钮】导出',
  195. key: '',
  196. },
  197. {
  198. title: '【按钮】查看',
  199. key: '',
  200. },
  201. {
  202. title: '【按钮】修改',
  203. key: '',
  204. },
  205. {
  206. title: '【按钮】启用',
  207. key: '',
  208. },
  209. ]
  210. },
  211. {
  212. title: '白名单申请',
  213. key: '',
  214. children: [
  215. {
  216. title: '【按钮】查询',
  217. key: '',
  218. },
  219. {
  220. title: '【按钮】创建申请',
  221. key: '',
  222. },
  223. {
  224. title: '【按钮】查看',
  225. key: '',
  226. },
  227. {
  228. title: '【按钮】修改',
  229. key: '',
  230. },
  231. {
  232. title: '【按钮】删除',
  233. key: '',
  234. },
  235. ]
  236. },
  237. {
  238. title: '白名单审核',
  239. key: '',
  240. children: [
  241. {
  242. title: '【按钮】查询',
  243. key: '',
  244. },
  245. {
  246. title: '【按钮】审核',
  247. key: '',
  248. },
  249. ]
  250. },
  251. ]
  252. },
  253. ],
  254. },
  255. {
  256. title: '人员管理',
  257. key: '0-0-1',
  258. children: [
  259. {
  260. title: '人员管理',
  261. key: '',
  262. children: [
  263. {
  264. title: '【按钮】查询',
  265. key: '',
  266. },
  267. {
  268. title: '【按钮】添加',
  269. key: '',
  270. },
  271. {
  272. title: '【按钮】编辑',
  273. key: '',
  274. },
  275. {
  276. title: '【按钮】离职/在职',
  277. key: '',
  278. },
  279. ]
  280. },
  281. {
  282. title: '人员考勤',
  283. key: '',
  284. children: [
  285. {
  286. title: '【按钮】查询',
  287. key: '',
  288. },
  289. {
  290. title: '【按钮】添加',
  291. key: '',
  292. },
  293. ]
  294. },
  295. ],
  296. },
  297. {
  298. title: '设备管理',
  299. key: '0-0-0-1',
  300. children: [
  301. {
  302. title: '路内车场设备监控',
  303. key: '',
  304. children: [
  305. {
  306. title: '【按钮】查询',
  307. key: '',
  308. },
  309. {
  310. title: '【按钮】详情',
  311. key: '',
  312. },
  313. ]
  314. },
  315. {
  316. title: '路外车场设备监控',
  317. key: '',
  318. children: [
  319. {
  320. title: '【按钮】查询',
  321. key: '',
  322. },
  323. {
  324. title: '【按钮】详情',
  325. key: '',
  326. },
  327. ]
  328. },
  329. {
  330. title: '视频监控设备管理',
  331. key: '',
  332. children: [
  333. {
  334. title: '【按钮】查询',
  335. key: '',
  336. },
  337. {
  338. title: '【按钮】添加',
  339. key: '',
  340. },
  341. {
  342. title: '【按钮】编辑',
  343. key: '',
  344. },
  345. {
  346. title: '【按钮】删除',
  347. key: '',
  348. },
  349. {
  350. title: '【按钮】查看监控',
  351. key: '',
  352. },
  353. ]
  354. },
  355. {
  356. title: '杆位管理',
  357. key: '',
  358. children: [
  359. {
  360. title: '【按钮】查询',
  361. key: '',
  362. },
  363. {
  364. title: '【按钮】查看',
  365. key: '',
  366. },
  367. {
  368. title: '【按钮】导入',
  369. key: '',
  370. },
  371. {
  372. title: '【按钮】导出',
  373. key: '',
  374. },
  375. ]
  376. },
  377. {
  378. title: 'PDA管理',
  379. key: '',
  380. children: [
  381. {
  382. title: '【按钮】查询',
  383. key: '',
  384. },
  385. {
  386. title: '【按钮】添加',
  387. key: '',
  388. },
  389. {
  390. title: '【按钮】编辑',
  391. key: '',
  392. },
  393. {
  394. title: '【按钮】删除',
  395. key: '',
  396. },
  397. ]
  398. },
  399. {
  400. title: '品牌管理',
  401. key: '',
  402. children: [
  403. {
  404. title: '【按钮】查询',
  405. key: '',
  406. },
  407. {
  408. title: '【按钮】添加',
  409. key: '',
  410. },
  411. {
  412. title: '【按钮】编辑',
  413. key: '',
  414. },
  415. ]
  416. },
  417. ]
  418. },
  419. {
  420. title: '运营统计',
  421. key: '0-0-1',
  422. children: [
  423. {
  424. title: '停车场数据分析',
  425. key: '',
  426. children: [
  427. {
  428. title: '停车场实况数据',
  429. key: '',
  430. children: [
  431. {
  432. title: '【按钮】查询',
  433. key: '',
  434. },
  435. ]
  436. },
  437. {
  438. title: '停车场运营分析',
  439. key: '',
  440. children: [
  441. {
  442. title: '【按钮】查询',
  443. key: '',
  444. },
  445. ]
  446. },
  447. ]
  448. },
  449. ],
  450. },
  451. {
  452. title: '财务管理',
  453. key: '0-0-1',
  454. children: [
  455. {
  456. title: '停车场欠费订单',
  457. key: '',
  458. children: [
  459. {
  460. title: '【按钮】查询',
  461. key: '',
  462. },
  463. {
  464. title: '【按钮】导出',
  465. key: '',
  466. },
  467. ]
  468. },
  469. {
  470. title: '欠费追缴查询',
  471. key: '',
  472. children: [
  473. {
  474. title: '【按钮】查询',
  475. key: '',
  476. },
  477. {
  478. title: '【按钮】导出',
  479. key: '',
  480. },
  481. ]
  482. },
  483. {
  484. title: '停车场收入报表',
  485. key: '',
  486. children: [
  487. {
  488. title: '【按钮】查询',
  489. key: '',
  490. },
  491. {
  492. title: '【按钮】导出',
  493. key: '',
  494. },
  495. ]
  496. },
  497. {
  498. title: '营收总报表',
  499. key: '',
  500. children: [
  501. {
  502. title: '【按钮】查询',
  503. key: '',
  504. },
  505. {
  506. title: '【按钮】导出',
  507. key: '',
  508. },
  509. ]
  510. },
  511. {
  512. title: '收费员收入统计',
  513. key: '',
  514. children: [
  515. {
  516. title: '【按钮】查询',
  517. key: '',
  518. },
  519. {
  520. title: '【按钮】导出',
  521. key: '',
  522. },
  523. ]
  524. },
  525. {
  526. title: '支付渠道统计',
  527. key: '',
  528. children: [
  529. {
  530. title: '【按钮】查询',
  531. key: '',
  532. }
  533. ]
  534. },
  535. {
  536. title: '发票记录',
  537. key: '',
  538. children: [
  539. {
  540. title: '【按钮】查询',
  541. key: '',
  542. },
  543. {
  544. title: '【按钮】冲红重开',
  545. key: '',
  546. },
  547. ]
  548. },
  549. {
  550. title: '停车支付订单',
  551. key: '',
  552. children: [
  553. {
  554. title: '【按钮】查询',
  555. key: '',
  556. },
  557. {
  558. title: '【按钮】导出',
  559. key: '',
  560. },
  561. ]
  562. },
  563. ],
  564. },
  565. ],
  566. },
  567. {
  568. title: '路外停车管理系统',
  569. key: '0-0',
  570. children: [
  571. {
  572. title: '停车场管理',
  573. key: '0-0-0',
  574. children: [
  575. {
  576. title: '停车场管理',
  577. key: '0-0-0-0',
  578. children: [
  579. {
  580. title: '【按钮】查询',
  581. key: '',
  582. },
  583. {
  584. title: '【按钮】添加',
  585. key: '',
  586. },
  587. {
  588. title: '【按钮】编辑',
  589. key: '',
  590. },
  591. {
  592. title: '【按钮】查看',
  593. key: '',
  594. },
  595. {
  596. title: '【按钮】二维码下载',
  597. key: '',
  598. },
  599. {
  600. title: '【按钮】保存并同步',
  601. key: '',
  602. },
  603. {
  604. title: '【按钮】停车场配置',
  605. key: '',
  606. },
  607. ]
  608. },
  609. {
  610. title: '计费规则管理',
  611. key: '0-0-0-1',
  612. children: [
  613. {
  614. title: '【按钮】查询',
  615. key: '',
  616. },
  617. {
  618. title: '【按钮】添加',
  619. key: '',
  620. },
  621. {
  622. title: '【按钮】编辑',
  623. key: '',
  624. },
  625. {
  626. title: '【按钮】删除',
  627. key: '',
  628. },
  629. {
  630. title: '【按钮】查看',
  631. key: '',
  632. },
  633. ]
  634. },
  635. {
  636. title: '停车记录查询',
  637. key: '0-0-0-1',
  638. children: [
  639. {
  640. title: '【按钮】查询',
  641. key: '',
  642. },
  643. {
  644. title: '【按钮】详情',
  645. key: '',
  646. },
  647. ]
  648. },
  649. ],
  650. },
  651. {
  652. title: '人员管理',
  653. key: '0-0-1',
  654. children: [
  655. {
  656. title: '交接班报表',
  657. key: '',
  658. children: [
  659. {
  660. title: '【按钮】查询',
  661. key: '',
  662. },
  663. {
  664. title: '【按钮】查看',
  665. key: '',
  666. },
  667. ]
  668. },
  669. {
  670. title: 'MS收费员管理',
  671. key: '',
  672. children: [
  673. {
  674. title: '【按钮】查询',
  675. key: '',
  676. },
  677. {
  678. title: '【按钮】添加',
  679. key: '',
  680. },
  681. {
  682. title: '【按钮】编辑',
  683. key: '',
  684. },
  685. {
  686. title: '【按钮】在职/离职',
  687. key: '',
  688. },
  689. ]
  690. },
  691. ],
  692. },
  693. {
  694. title: '设备管理',
  695. key: '0-0-0-1',
  696. children: [
  697. {
  698. title: '视频监控设备管理',
  699. key: '',
  700. children: [
  701. {
  702. title: '【按钮】查询',
  703. key: '',
  704. },
  705. {
  706. title: '【按钮】添加',
  707. key: '',
  708. },
  709. {
  710. title: '【按钮】编辑',
  711. key: '',
  712. },
  713. {
  714. title: '【按钮】删除',
  715. key: '',
  716. },
  717. {
  718. title: '【按钮】查看监控',
  719. key: '',
  720. },
  721. ]
  722. },
  723. {
  724. title: '路外设备管理',
  725. key: '',
  726. children: [
  727. {
  728. title: '【按钮】查询',
  729. key: '',
  730. },
  731. {
  732. title: '【按钮】查看',
  733. key: '',
  734. }
  735. ]
  736. }
  737. ]
  738. },
  739. {
  740. title: '运营统计',
  741. key: '0-0-1',
  742. children: [
  743. {
  744. title: '停车场数据分析',
  745. key: '',
  746. children: [
  747. {
  748. title: '停车场实况数据',
  749. key: '',
  750. children: [
  751. {
  752. title: '【按钮】查询',
  753. key: '',
  754. },
  755. ]
  756. },
  757. {
  758. title: '停车场运营分析',
  759. key: '',
  760. children: [
  761. {
  762. title: '【按钮】查询',
  763. key: '',
  764. },
  765. ]
  766. },
  767. ]
  768. },
  769. ],
  770. },
  771. {
  772. title: '异常管理',
  773. key: '0-0-1',
  774. children: [
  775. {
  776. title: '抬杆记录',
  777. key: '',
  778. children: [
  779. {
  780. title: '【按钮】查询',
  781. key: '',
  782. },
  783. {
  784. title: '【按钮】导出',
  785. key: '',
  786. },
  787. ]
  788. },
  789. {
  790. title: '特殊放行记录',
  791. key: '',
  792. children: [
  793. {
  794. title: '【按钮】查询',
  795. key: '',
  796. },
  797. {
  798. title: '【按钮】导出',
  799. key: '',
  800. },
  801. ]
  802. },
  803. {
  804. title: '车牌修正记录',
  805. key: '',
  806. children: [
  807. {
  808. title: '【按钮】查询',
  809. key: '',
  810. },
  811. {
  812. title: '【按钮】导出',
  813. key: '',
  814. },
  815. ]
  816. }
  817. ],
  818. },
  819. {
  820. title: '财务管理',
  821. key: '0-0-1',
  822. children: [
  823. {
  824. title: '停车场支付订单',
  825. key: '',
  826. children: [
  827. {
  828. title: '【按钮】查询',
  829. key: '',
  830. },
  831. {
  832. title: '【按钮】导出',
  833. key: '',
  834. },
  835. ]
  836. },
  837. {
  838. title: '营收总报表',
  839. key: '',
  840. children: [
  841. {
  842. title: '【按钮】查询',
  843. key: '',
  844. },
  845. {
  846. title: '【按钮】导出',
  847. key: '',
  848. },
  849. ]
  850. },
  851. {
  852. title: '停车场收入报表',
  853. key: '',
  854. children: [
  855. {
  856. title: '【按钮】查询',
  857. key: '',
  858. },
  859. {
  860. title: '【按钮】导出',
  861. key: '',
  862. },
  863. ]
  864. },
  865. {
  866. title: '支付渠道统计',
  867. key: '',
  868. children: [
  869. {
  870. title: '【按钮】查询',
  871. key: '',
  872. },
  873. ]
  874. },
  875. ],
  876. },
  877. ],
  878. },
  879. {
  880. title: '充电管理系统',
  881. key: '0-0',
  882. children: [
  883. {
  884. title: '实时监控',
  885. key: '0-0-0',
  886. children: [
  887. {
  888. title: '电桩监控',
  889. key: '0-0-0-0',
  890. children: [
  891. {
  892. title: '【按钮】查询',
  893. key: '',
  894. },
  895. {
  896. title: '【按钮】查看详情',
  897. key: '',
  898. },
  899. {
  900. title: '【按钮】远程监控',
  901. key: '',
  902. },
  903. {
  904. title: '【按钮】状态变更记录',
  905. key: '',
  906. },
  907. ]
  908. },
  909. {
  910. title: '充电监控',
  911. key: '0-0-0-1',
  912. children: [
  913. {
  914. title: '【按钮】查询',
  915. key: '',
  916. },
  917. {
  918. title: '【按钮】查看详情',
  919. key: '',
  920. },
  921. ]
  922. },
  923. {
  924. title: '地锁监控',
  925. key: '0-0-0-1',
  926. children: [
  927. {
  928. title: '【按钮】查询',
  929. key: '',
  930. },
  931. {
  932. title: '【按钮】查看详情',
  933. key: '',
  934. },
  935. ]
  936. },
  937. {
  938. title: '充电泊位监控',
  939. key: '0-0-0-1',
  940. children: [
  941. {
  942. title: '【按钮】查询',
  943. key: '',
  944. },
  945. {
  946. title: '【按钮】查看详情',
  947. key: '',
  948. },
  949. ]
  950. },
  951. ],
  952. },
  953. {
  954. title: '记录查询',
  955. key: '0-0-1',
  956. children: [
  957. {
  958. title: '充电订单',
  959. key: '',
  960. children: [
  961. {
  962. title: '【按钮】查询',
  963. key: '',
  964. },
  965. {
  966. title: '【按钮】导出',
  967. key: '',
  968. },
  969. {
  970. title: '【按钮】查看详情',
  971. key: '',
  972. },
  973. ]
  974. },
  975. {
  976. title: '开锁记录',
  977. key: '',
  978. children: [
  979. {
  980. title: '【按钮】查询',
  981. key: '',
  982. }
  983. ]
  984. },
  985. {
  986. title: '预约订单',
  987. key: '',
  988. children: [
  989. {
  990. title: '【按钮】查询',
  991. key: '',
  992. },
  993. {
  994. title: '【按钮】导出',
  995. key: '',
  996. },
  997. {
  998. title: '【按钮】查看',
  999. key: '',
  1000. },
  1001. ]
  1002. },
  1003. {
  1004. title: '违规行为记录',
  1005. key: '',
  1006. children: [
  1007. {
  1008. title: '【按钮】查询',
  1009. key: '',
  1010. },
  1011. {
  1012. title: '【按钮】详情',
  1013. key: '',
  1014. },
  1015. ]
  1016. },
  1017. ],
  1018. },
  1019. ]
  1020. },
  1021. {
  1022. title: '系统管理',
  1023. key: '0-0',
  1024. children: [
  1025. {
  1026. title: '商户信息查看',
  1027. key: '0-0-0',
  1028. children: [
  1029. {
  1030. title: '【按钮】查询',
  1031. key: '0-0-0-0',
  1032. },
  1033. {
  1034. title: '【Tab】商户信息',
  1035. key: '',
  1036. children: [
  1037. {
  1038. title: '【按钮】查询',
  1039. key: '',
  1040. },
  1041. ]
  1042. },
  1043. {
  1044. title: '【Tab】发票配置',
  1045. key: '',
  1046. children: [
  1047. {
  1048. title: '【按钮】查询',
  1049. key: '',
  1050. },
  1051. ]
  1052. },
  1053. {
  1054. title: '计费规则管理',
  1055. key: '0-0-0-1',
  1056. children: [
  1057. {
  1058. title: '【按钮】查询',
  1059. key: '',
  1060. },
  1061. {
  1062. title: '【按钮】添加',
  1063. key: '',
  1064. },
  1065. {
  1066. title: '【按钮】编辑',
  1067. key: '',
  1068. },
  1069. {
  1070. title: '【按钮】删除',
  1071. key: '',
  1072. },
  1073. {
  1074. title: '【按钮】查看',
  1075. key: '',
  1076. },
  1077. ]
  1078. },
  1079. {
  1080. title: '停车记录查询',
  1081. key: '0-0-0-1',
  1082. children: [
  1083. {
  1084. title: '【按钮】查询',
  1085. key: '',
  1086. },
  1087. {
  1088. title: '【按钮】详情',
  1089. key: '',
  1090. },
  1091. ]
  1092. },
  1093. ],
  1094. },
  1095. {
  1096. title: '管理员管理',
  1097. key: '0-0-1',
  1098. children: [
  1099. {
  1100. title: '【按钮】查询',
  1101. key: '',
  1102. },
  1103. {
  1104. title: '【按钮】添加',
  1105. key: '',
  1106. },
  1107. {
  1108. title: '【按钮】编辑',
  1109. key: '',
  1110. },
  1111. {
  1112. title: '【按钮】离职',
  1113. key: '',
  1114. },
  1115. ],
  1116. },
  1117. {
  1118. title: '角色管理',
  1119. key: '0-0-1',
  1120. children: [
  1121. {
  1122. title: '【按钮】查询',
  1123. key: '',
  1124. },
  1125. {
  1126. title: '【按钮】添加',
  1127. key: '',
  1128. },
  1129. {
  1130. title: '【按钮】编辑',
  1131. key: '',
  1132. },
  1133. {
  1134. title: '【按钮】删除',
  1135. key: '',
  1136. },
  1137. ],
  1138. },
  1139. {
  1140. title: '组织架构',
  1141. key: '0-0-1',
  1142. children: [
  1143. {
  1144. title: '【按钮】查询',
  1145. key: '',
  1146. },
  1147. {
  1148. title: '【按钮】添加',
  1149. key: '',
  1150. },
  1151. {
  1152. title: '【按钮】编辑',
  1153. key: '',
  1154. },
  1155. {
  1156. title: '【按钮】删除',
  1157. key: '',
  1158. },
  1159. ],
  1160. },
  1161. {
  1162. title: '系统日志',
  1163. key: '0-0-1',
  1164. children: [
  1165. {
  1166. title: '【按钮】查询',
  1167. key: '',
  1168. },
  1169. {
  1170. title: '【按钮】查看',
  1171. key: '',
  1172. }
  1173. ],
  1174. },
  1175. ],
  1176. },
  1177. ];
  1178. //获取商户名称的下拉
  1179. const getTenantNamePull = () => {
  1180. ajax.ElectInvoice.getSelectOperator().then(
  1181. res => {
  1182. if (res.status == 20000) {
  1183. setTenantPull(res.data)
  1184. } else {
  1185. message.error(res.message)
  1186. }
  1187. }
  1188. ).catch(
  1189. err => { console.log(err); }
  1190. )
  1191. }
  1192. //获取表格数据
  1193. const getTable = (data) => {
  1194. setLoading(true)
  1195. ajax.getFunctionMgmTable(data).then(
  1196. res => {
  1197. if (res.status == 20000) {
  1198. setTableData(res.data.list)
  1199. setTotal(res.data.total_records)
  1200. setLoading(false)
  1201. } else {
  1202. message.error(res.message)
  1203. }
  1204. setLoading(false)
  1205. }
  1206. ).catch(
  1207. (err) => {
  1208. console.log(err)
  1209. }
  1210. )
  1211. }
  1212. //搜索数据
  1213. const getSearchData = () => {
  1214. const value=searchForm.getFieldsValue(['shop_name'])
  1215. setFormData(Object.assign({...formData,pn:1,page_size:Number(pageSizeOptions[0])}))
  1216. getTable({...value,pn:1,page_size:Number(pageSizeOptions[0])})
  1217. }
  1218. //切换分页
  1219. const changePn = (pn, length) => {
  1220. if (lastFormData.page_size === length) {
  1221. lastFormDataRef.current = Object.assign({}, lastFormData, { pn: pn })
  1222. const value=searchForm.getFieldsValue(['shop_name'])
  1223. setLastFormData(Object.assign(lastFormData,{...value},{pn: pn}))
  1224. getTable(lastFormData)
  1225. }
  1226. }
  1227. //切换每页条数
  1228. const changeLength = (pn, length) => {
  1229. setFormData(Object.assign({}, formData, { pn: 1, page_size: length }))
  1230. setLastFormData(Object.assign({}, lastFormData, { pn: 1, page_size: length }))
  1231. lastFormDataRef.current = Object.assign({}, lastFormData, { pn: 1, page_size: length })
  1232. getTable(Object.assign({}, lastFormData, { pn: 1, page_size: length }))
  1233. }
  1234. //重置数据
  1235. const getResetData = () => {
  1236. searchForm.setFieldsValue({
  1237. shop_name:""
  1238. })
  1239. getTable({...parameter})
  1240. }
  1241. //编辑
  1242. const updateBtn = (record) => {
  1243. setUpdateVisible(true)
  1244. updateForm.setFieldsValue(
  1245. {
  1246. shop_name:record.tenantName,
  1247. note:record.note
  1248. }
  1249. )
  1250. setFormData(record)
  1251. }
  1252. //点击取消-返回上一层
  1253. const createOncancel = () => {
  1254. setUpdateVisible(false)
  1255. }
  1256. //编辑后提交
  1257. const submitUpdate=()=>{
  1258. }
  1259. const onSelect = (selectedKeys, info) => {
  1260. console.log('selected', selectedKeys, info);
  1261. };
  1262. const onCheck = (checkedKeys, info) => {
  1263. console.log('onCheck', checkedKeys, info);
  1264. };
  1265. useEffect(
  1266. () => {
  1267. const value = searchForm.getFieldsValue(["operatorid", "phone", "name", "account", "status"])
  1268. getTenantNamePull()
  1269. getTable(formData)
  1270. }, []
  1271. )
  1272. return (
  1273. <div id="FunctionMgm" >
  1274. {
  1275. !updateVisible ?
  1276. <div className="merchant-info-table">
  1277. <div className="panel">
  1278. <div className="title">查询条件</div>
  1279. <div className="panel-1">
  1280. <Form
  1281. layout="inline"
  1282. form={searchForm}
  1283. >
  1284. <Form.Item
  1285. label="商户名称:"
  1286. name="shop_name"
  1287. className="search-form yisa-search"
  1288. >
  1289. <Select
  1290. className="yisa-select"
  1291. options={tenantPull}
  1292. placeholder="请选择"
  1293. />
  1294. </Form.Item>
  1295. <Form.Item
  1296. className="btnBox"
  1297. >
  1298. <Button className="reset" onClick={() => { getResetData() }}>
  1299. 清空
  1300. </Button>
  1301. <Button type="primary" className="submit" icon={<SearchOutlined />} onClick={() => { getSearchData() }}>
  1302. 查询
  1303. </Button>
  1304. </Form.Item>
  1305. </Form>
  1306. </div>
  1307. </div>
  1308. <div className="table-content">
  1309. <Table
  1310. columns={columns}
  1311. className="table"
  1312. pagination={false}
  1313. dataSource={tableData}
  1314. loading={loading}
  1315. scroll={{ y: "calc(100vh - 280px)" }}
  1316. ></Table>
  1317. <Pagination
  1318. className="pagination-common"
  1319. showSizeChanger
  1320. showQuickJumper
  1321. showTotal={() => {
  1322. if (total) {
  1323. return `${total}`
  1324. }
  1325. else return `共 0 条`
  1326. }
  1327. }
  1328. total={total}
  1329. current={formData.pn}
  1330. pageSize={formData.page_size}
  1331. pageSizeOptions={pageSizeOptions}
  1332. onChange={changePn}
  1333. onShowSizeChange={changeLength}
  1334. />
  1335. </div>
  1336. </div> : ''
  1337. }
  1338. {
  1339. updateVisible ?
  1340. <div className="updateCard">
  1341. <div className="title">商户功能管理</div>
  1342. <div>
  1343. <div className="form-note">
  1344. <Form
  1345. form={updateForm}
  1346. >
  1347. <Form.Item
  1348. label="商户名称"
  1349. name="tenantName"
  1350. >
  1351. {formData.tenantName}
  1352. </Form.Item>
  1353. <Form.Item
  1354. label="备注"
  1355. name="note"
  1356. >
  1357. <Input></Input>
  1358. </Form.Item>
  1359. <Form.Item className="btns">
  1360. <Button type="primary" >全部选择</Button>
  1361. <Button className="rest" type="primary" >全部取消</Button>
  1362. </Form.Item>
  1363. <Form.Item
  1364. label="绑定功能"
  1365. name="bind"
  1366. >
  1367. {/* <Tree
  1368. checkable
  1369. defaultExpandedKeys={['0-0-0', '0-0-1']}
  1370. defaultSelectedKeys={['0-0-0', '0-0-1']}
  1371. defaultCheckedKeys={['0-0-0', '0-0-1']}
  1372. onSelect={onSelect}
  1373. onCheck={onCheck}
  1374. treeData={treeData}
  1375. /> */}
  1376. </Form.Item>
  1377. <Form.Item>
  1378. <Button onClick={submitUpdate} type="primary" htmlType="submit">保存</Button>
  1379. <Button className="rest" onClick={createOncancel}>取消</Button>
  1380. </Form.Item>
  1381. </Form>
  1382. </div>
  1383. </div>
  1384. </div> : ''
  1385. }
  1386. </div>
  1387. )
  1388. }
  1389. export default FunctionMgm;