index.tsx 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. /*
  2. * @Author: your name
  3. * @Date: 2022-02-21 09:40:09
  4. * @LastEditTime: 2022-02-21 11:42:38
  5. * @LastEditors: Please set LastEditors
  6. * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  7. * @FilePath: /MedicalQualificationMana/src/pages/qualificationReview/index.tsx
  8. */
  9. import { useEffect, useState } from 'react'
  10. import KCTable from "@/components/kcTable";
  11. import MQPageContainer from "@/components/MQPageContainer";
  12. import { getMineQualifiApplyList, QualificationDataType } from "@/service/qualification";
  13. import { ProColumns } from "@ant-design/pro-table";
  14. import { ProFormRadio, ProFormCheckbox, ProFormDependency, ProFormTextArea,ProFormDigit } from '@ant-design/pro-form';
  15. import { Button, Form } from 'antd';
  16. import KCModal from '@/components/KCModal';
  17. import './style.less';
  18. export default () => {
  19. const columns: ProColumns<QualificationDataType>[] = [
  20. {
  21. title: 'id',
  22. dataIndex: 'id',
  23. hideInTable: true
  24. },
  25. {
  26. title: '资质类目',
  27. dataIndex: 'qualificationClass',
  28. hideInSearch: false,
  29. valueType: 'cascader'
  30. },
  31. {
  32. title: '资质编号',
  33. dataIndex: 'qualificationNum',
  34. },
  35. {
  36. title: '资质名称',
  37. dataIndex: 'qualificationName',
  38. hideInSearch: false
  39. },
  40. {
  41. title: '被授予人',
  42. dataIndex: '',
  43. hideInSearch: false
  44. },
  45. {
  46. title: '佐证材料',
  47. dataIndex: 'supportMaterial',
  48. },
  49. {
  50. title: '授权依据',
  51. dataIndex: 'authorBasis',
  52. },
  53. {
  54. title: '科审',
  55. dataIndex: '1',
  56. },
  57. {
  58. title: '医务审',
  59. dataIndex: '2',
  60. },
  61. {
  62. title: '院审',
  63. dataIndex: '3',
  64. },
  65. {
  66. title: '申请日期',
  67. dataIndex: 'applyDate',
  68. hideInSearch: false,
  69. valueType: 'dateRange'
  70. }
  71. ]
  72. const [modalVisible, setModalVisible] = useState(false);
  73. const [modalActType, setModalActType] = useState<'review' | 'authorize' | undefined>(undefined);
  74. const getTableData = async (params: any) => {
  75. const resp = await getMineQualifiApplyList({ params });
  76. if (resp) {
  77. const { list = [], current, totalCount } = resp;
  78. return {
  79. data: list,
  80. success: true,
  81. total: totalCount,
  82. }
  83. }
  84. return {
  85. data: [],
  86. success: false
  87. }
  88. }
  89. const onVisibleChangeHandle = (bool: boolean) => {
  90. setModalVisible(bool);
  91. }
  92. const showModalHandle = (type: 'review' | 'authorize') => {
  93. setModalVisible(true);
  94. setModalActType(type)
  95. }
  96. useEffect(() => {
  97. }, [])
  98. return (
  99. <MQPageContainer className="QualificationApplication">
  100. <KCModal className='QualificationApplicationModal' visible={modalVisible} onVisibleChange={onVisibleChangeHandle} width={600}
  101. title={modalActType == 'authorize' ? '临时授权' : '审核操作'} layout='horizontal'>
  102. {
  103. modalActType == 'review' ? (
  104. //审核操作
  105. <>
  106. <ProFormRadio.Group
  107. name="radio-group"
  108. label="选择操作"
  109. options={[
  110. {
  111. label: '通过',
  112. value: 'a',
  113. },
  114. {
  115. label: '驳回',
  116. value: 'b',
  117. },
  118. ]}
  119. />
  120. <ProFormDependency name={['name']}>
  121. {
  122. ({ name }) => {
  123. return (
  124. <>
  125. <ProFormCheckbox.Group
  126. name="checkbox"
  127. label="驳回原因"
  128. options={['农业', '制造业', '互联网']}
  129. />
  130. <ProFormTextArea
  131. name="text"
  132. label="其他驳回原因"
  133. placeholder="请输入"
  134. fieldProps={{}}
  135. />
  136. </>
  137. )
  138. }
  139. }
  140. </ProFormDependency>
  141. </>
  142. ) : (
  143. <>
  144. <ProFormRadio.Group
  145. name="radio-group"
  146. label="选择操作"
  147. options={[
  148. {
  149. label: '三个月',
  150. value: 'a',
  151. },
  152. {
  153. label: '自定义',
  154. value: 'b',
  155. },
  156. ]}
  157. />
  158. <ProFormDependency name={['name']}>
  159. {
  160. ({ name }) => {
  161. return (
  162. <Form.Item wrapperCol={{span:12}}>
  163. <ProFormDigit
  164. label="自定义天数"
  165. name="input-number"
  166. min={1}
  167. max={360}
  168. placeholder='请输入数字'
  169. fieldProps={{
  170. precision: 0,
  171. addonAfter:'天'
  172. }}
  173. />
  174. </Form.Item>
  175. )
  176. }
  177. }
  178. </ProFormDependency>
  179. <div className='bottomTip' dangerouslySetInnerHTML={{__html:'* 确定要给予选择的 <span>16个</span> 资质临时授,起止时间为<span>16个</span>到<span>16个</span>'}}></div>
  180. </>
  181. )
  182. }
  183. </KCModal>
  184. <KCTable
  185. columns={columns}
  186. request={(params) => getTableData(params)}
  187. rowKey='id'
  188. toolbar={{
  189. actions: [
  190. <Button key="primary" onClick={() => showModalHandle('authorize')}>临时授权</Button>,
  191. <Button key="primary" type="primary" onClick={() => showModalHandle('review')}>院审批</Button>,
  192. ]
  193. }}
  194. />
  195. </MQPageContainer>
  196. );
  197. }