1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import React from 'react';
  2. import Taro from '@tarojs/taro';
  3. import { View } from '@tarojs/components';
  4. import Page from '@/layouts/index';
  5. import { Cell, CellGroup, Field, Radio, RadioGroup } from '@antmjs/vantui';
  6. import { getTaIssueApplyById } from '@/services/taissueapply';
  7. import { getDtStr } from '@/utils/date';
  8. import { PROCESS_APPLY_DELAY } from '@/utils/biz';
  9. import Issue from '../components/Issue';
  10. import useTitle from '../useTitle';
  11. const getVerifyStatus = (st) => {
  12. console.log("***************st******************",st)
  13. if (!st || st == 'ready') return '未审批';
  14. return st == 'pass' ? '通过' : '驳回';
  15. }
  16. export default (props) => {
  17. const router = Taro.useRouter();
  18. const { id, applyType, issueId } = router.params;
  19. const [loading, setLoading] = React.useState(false);
  20. const [applyInfo, setApplyInfo] = React.useState({});
  21. useTitle(applyType);
  22. React.useEffect(() => {
  23. if (id) {
  24. setLoading(true);
  25. getTaIssueApplyById(id).then(res => {
  26. setApplyInfo(res);
  27. setLoading(false);
  28. }).catch(() => {
  29. setLoading(false);
  30. });
  31. }
  32. }, [id]);
  33. return (
  34. <Page loading={loading}>
  35. <Issue issueId={issueId} />
  36. <CellGroup style={{marginTop: '20px'}}>
  37. {
  38. applyInfo.applyType == PROCESS_APPLY_DELAY && (
  39. <Cell
  40. title="延期日期"
  41. value={applyInfo.content}
  42. />
  43. )
  44. }
  45. <Cell title="申请说明" />
  46. <Field
  47. readonly
  48. type="textarea"
  49. autosize={{ minHeight: '120px' }}
  50. value={applyInfo.remark}
  51. />
  52. </CellGroup>
  53. <CellGroup style={{marginTop: '20px'}}>
  54. <Cell
  55. title="审批结果"
  56. value={getVerifyStatus(applyInfo.verifyStatus)}
  57. />
  58. <Cell title="审批说明" />
  59. <Field
  60. readonly
  61. type="textarea"
  62. autosize={{ minHeight: '120px' }}
  63. value={applyInfo.verifyDesc}
  64. />
  65. <Cell
  66. title="审核日期"
  67. value={getDtStr(applyInfo.verifyDate)}
  68. />
  69. </CellGroup>
  70. </Page>
  71. )
  72. }