Order.jsx 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import { getTaOrgIssueId } from "@/services/taorgissue";
  2. import { Cell, CellGroup, Steps, Tag } from "@antmjs/vantui";
  3. import { View } from "@tarojs/components";
  4. import React, { useEffect, useMemo, useState } from "react";
  5. import dayjs from "dayjs";
  6. import styles from "../index.module.less";
  7. import { APPLY_READY, getIssueStatus } from "@/utils/biz";
  8. import Icon from "@/components/Icon";
  9. import { color } from "echarts";
  10. import { colors } from "@/components/IssueCard";
  11. export default (props) => {
  12. const { id } = props;
  13. const [steps, setSteps] = useState([]);
  14. useEffect(() => {
  15. if (id) {
  16. getTaOrgIssueId(id).then((res) => {
  17. console.log(res);
  18. const data = res.map((x) => {
  19. return { ...x, text: x.orgName };
  20. });
  21. setSteps(data);
  22. });
  23. }
  24. }, [id]);
  25. function SorySteps(params) {
  26. const { steps } = params;
  27. const sortedSteps = steps.sort((a, b) => {
  28. if (a.createDate < b.createDate) return -1;
  29. if (a.createDate > b.createDate) return 1;
  30. return 0;
  31. });
  32. return sortedSteps.map((it, index, array) => {
  33. // const { value: bizStatus = 0, label: statusText } = getIssueStatus({
  34. // ...(it || {}),
  35. // expireDate: it?.createDate,
  36. // processNode: it?.processNode || it?.applyType,
  37. // processStatus: it?.processStatus || it?.verifyStatus || APPLY_READY,
  38. // });
  39. // const [bg1, bg2] = colors[bizStatus];
  40. let nextOrgName = null;
  41. if (index == 0) {
  42. nextOrgName = "平台";
  43. } else if (index <= array.length - 1) {
  44. nextOrgName = array[index - 1].orgName;
  45. }
  46. return (
  47. <View key={it.orgIssueId} className={styles["page_order"]}>
  48. <Cell
  49. title={
  50. <>
  51. <View>{nextOrgName}</View>
  52. <View>
  53. {dayjs(it.createDate).format("YYYY-MM-DD HH:mm:ss")}
  54. </View>
  55. </>
  56. }
  57. renderRightIcon={
  58. <>
  59. <View>{it.orgName}</View>
  60. <View>&ensp;&ensp;</View>
  61. </>
  62. }
  63. />
  64. {/* <View className={styles["org_order"]}>
  65. <div>
  66. {nextOrgName} ----{it.orgName}
  67. </div>
  68. <div>{dayjs(it.createDate).format("YYYY-MM-DD HH:mm:ss")}</div>
  69. </View> */}
  70. </View>
  71. );
  72. });
  73. }
  74. return (
  75. <CellGroup style={{ marginTop: "20px" }}>
  76. <Cell title="交办历史" />
  77. <SorySteps steps={steps} />
  78. </CellGroup>
  79. );
  80. };