停车场项目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.

173 lines
3.4 KiB

  1. import React, { useState, useRef, useEffect } from "react";
  2. import {
  3. message,
  4. Pagination,
  5. Table,
  6. Space,
  7. Modal,
  8. Button,
  9. Tabs,
  10. Descriptions,
  11. Input,
  12. Steps,
  13. Select,
  14. Image,
  15. Timeline,
  16. Popover
  17. } from "antd";
  18. import { dictionary } from "@/config/common";
  19. import ajax from "@/services";
  20. import { TableModule } from "@/components";
  21. import "./index.scss";
  22. const { TextArea } = Input;
  23. function OrderRuleMgm() {
  24. // 详情弹窗
  25. const [detailVisible, setDetailVisible] = useState(false);
  26. // 列表数据
  27. const [tableData, setTableData] = useState([]);
  28. // 数据总数
  29. const [total, setTotal] = useState(0);
  30. // 详情数据
  31. const [detailData, setDetailData] = useState({});
  32. // 初始搜索条件
  33. const initFormData = {
  34. operator: "0",
  35. rule_name: "",
  36. };
  37. const columns = [
  38. {
  39. title: "运营商名称",
  40. dataIndex: "operator",
  41. key: "operator",
  42. align: "center",
  43. },
  44. {
  45. title: "规则名称",
  46. dataIndex: "plate",
  47. key: "plate",
  48. align: "center",
  49. },
  50. {
  51. title: "规则编码",
  52. dataIndex: "plate_color",
  53. key: "plate_color",
  54. align: "center",
  55. },
  56. {
  57. title: "创建人",
  58. dataIndex: "berth_id",
  59. key: "berth_id",
  60. width: 100,
  61. align: "center",
  62. },
  63. {
  64. title: "创建时间",
  65. dataIndex: "in_time",
  66. key: "in_time",
  67. align: "center",
  68. },
  69. {
  70. title: "操作",
  71. dataIndex: "operation",
  72. key: "operation",
  73. align: "center",
  74. fixed: "right",
  75. width: 100,
  76. render: (text, record, index) => {
  77. return (
  78. <>
  79. <Button type="primary" onClick={() => openModal(index, record)}>
  80. 详情
  81. </Button>
  82. </>
  83. )
  84. },
  85. },
  86. ];
  87. const formSearch = [
  88. {
  89. name: "operator",
  90. type: "Select",
  91. label: "商户名称",
  92. defaultValue: "0",
  93. placeholder: "请选择商户名称",
  94. },
  95. {
  96. name: "rule_name",
  97. type: "Input",
  98. label: "规则名称",
  99. placeholder: "请输入出场收费员",
  100. },
  101. {
  102. name: "timePeriod",
  103. type: "RangePicker",
  104. label: "时间段",
  105. },
  106. ];
  107. // 打开弹窗
  108. const openModal = (index, record) => {
  109. setDetailData(record)
  110. setDetailVisible(true);
  111. }
  112. // 检索
  113. const search = (params) => {
  114. ajax.getParkingList(params).then((res) => {
  115. if (res.status === 20000) {
  116. setTableData(res.data.list);
  117. setTotal(res.data.total);
  118. } else {
  119. message.error(res.message)
  120. }
  121. });
  122. }
  123. const handelAdd = () => {
  124. setDetailVisible(true)
  125. }
  126. return (
  127. <>
  128. <TableModule
  129. showSerial={true}
  130. isExport={false}
  131. diyButton={
  132. <Button
  133. type="primary"
  134. onClick={handelAdd}
  135. >
  136. 新增
  137. </Button>
  138. }
  139. columns={columns}
  140. tableData={tableData}
  141. formSearch={formSearch}
  142. pagename="停车记录查询"
  143. pageName={'orderRuleMgm'}
  144. initFormData={initFormData}
  145. total={total}
  146. search={search}
  147. exportUrl="/api/bpm/record/get_record_export"
  148. />
  149. <Modal
  150. open={detailVisible}
  151. width={1500}
  152. className="totalModal"
  153. onCancel={() => {
  154. setDetailVisible(false);
  155. }}
  156. destroyOnClose
  157. >
  158. </Modal>
  159. </>
  160. );
  161. }
  162. export default OrderRuleMgm;