/* * @Author: code4eat awesomedema@gmail.com * @Date: 2023-03-03 11:30:33 * @LastEditors: code4eat awesomedema@gmail.com * @LastEditTime: 2024-12-31 13:58:04 * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ import KCIMPagecontainer from '@/components/KCIMPageContainer'; import { KCIMTable } from '@/components/KCIMTable'; import { createFromIconfontCN, InboxOutlined } from '@ant-design/icons'; import { ActionType, arrayMoveImmutable, ProFormText, ProFormTextArea, useRefFunction } from '@ant-design/pro-components'; import ProForm, { ModalForm, ProFormCascader, ProFormCheckbox, ProFormDatePicker, ProFormDateRangePicker, ProFormDependency, ProFormDigit, ProFormInstance, ProFormRadio, ProFormSelect, ProFormSwitch, ProFormUploadDragger } from '@ant-design/pro-form' import { ProColumns } from '@ant-design/pro-table'; import { Alert, Drawer, Dropdown, Form, Input, message, Popconfirm, Popover, Radio } from 'antd'; import { Fragment, Key, useEffect, useRef, useState } from 'react'; import { addData, delData, editData, getMyInfoReq, getTableDataReq } from './service'; import './style.less'; import { getDicDataBySysId } from '@/services/getDic'; import { authTimeType, KcimCenterSysId } from '@/constant'; import 'moment/locale/zh-cn'; import moment from 'moment'; import { sparse } from 'mathjs'; import AuthHisContent from './authHisttory'; import FormTabs from './tabs'; import { calculateDelayedDate } from '@/utils/tooljs'; import { debounce } from 'lodash'; import { useModel } from '@umijs/max'; const IconFont = createFromIconfontCN({ scriptUrl: '', }); export default function MyQualifications() { const { initialState, setInitialState } = useModel('@@initialState'); const formRef = useRef(); const drawerFormRef = useRef(); const [tableDataFilterParams, set_tableDataFilterParams] = useState(); const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState(''); const [drawerVisible, set_drawerVisible] = useState(false); const [currentEditRow, set_currentEditRow] = useState(undefined); const [currentSelectedTableRows, set_currentSelectedTableRows] = useState([]); const tableRef = useRef(); const [modalFormVisible, set_modalFormVisible] = useState(false); const [operationLevel, set_operationLevel] = useState([]); const [userInfo, set_userInfo] = useState(undefined); const [currentEditAttachment, set_currentEditAttachment] = useState(undefined); const columns: ProColumns[] = [ { title: '资质编码', ellipsis: true, renderText(text, record, index, action) { const { qualification: { code } } = record; return code }, }, { title: '资质名称', ellipsis: true, renderText(text, record, index, action) { const { qualification: { name } } = record; return name }, }, { title: '资质分类', ellipsis: true, renderText(text, record, index, action) { const { qualification: { qualificationTypeName } } = record; return qualificationTypeName }, }, { title: '特殊类别', ellipsis: true, width: 150, renderText(text, record, index, action) { const { qualification: { operationFlag, techFlag, operationLevelCode } } = record; return
{ techFlag == 1 && ( 医疗技术 ) } { operationFlag == 1 && operationLevelCode && ( { (operationLevel.filter((a) => a.value == operationLevelCode)).length > 0 ? (operationLevel.filter((a) => a.value == operationLevelCode))[0].name : '' } ) } { (!operationFlag && !techFlag) && () }
}, }, { title: '操作', key: 'option', width: 80, fixed: 'right', valueType: 'option', render: (_: any, record: any) => { return { set_currentEditRow(record); set_drawerVisible(true) }}>详情 }, }, ]; const getTableData = async (params: any) => { const resp = await getTableDataReq({ ...params }); if (resp) { return { data: resp.list, success: true } } else { return [] } } const getOperationLevelList = async () => { const resp = await getDicDataBySysId(KcimCenterSysId, 'SURGICAL_AND_OPERATIONAL_LEVELS'); if (resp) { set_operationLevel(resp.dataVoList); } } const updateTable = async (formVal: any, type: 'ADD' | 'EDIT') => { try { const { files, memo, id } = formVal; let result = {}; if (files[0].response) { const { name, response: { data: { downUrl } } } = files[0]; result = { id: type == 'EDIT' ? id : null, userId: userInfo.id, fileName: name, url: downUrl, description: memo }; } else { const { name ,url} = files[0]; result = { id: type == 'EDIT' ? id : null, userId: userInfo.id, fileName: name, url: url, description: memo }; } const resp = type == 'ADD' ? await addData(result) : await editData(result); if (resp) { set_currentEditAttachment(undefined); getUserInfo(); set_modalFormVisible(false); message.success('操作成功!'); } return true; } catch (error) { console.log({ error }); return false; } } const tableDataSearchHandle = (key: string) => { set_tableDataFilterParams({ ...tableDataFilterParams, current: 1, [key]: tableDataSearchKeywords }) } const getAuthPeriod = (code: number) => { const result = authTimeType.filter(a => a.value == code); return result.length > 0 ? result[0].label : '-' } const getUserInfo = async () => { const resp = await getMyInfoReq(); if (resp) { set_userInfo(resp); } } const delUseerAttachmentHandle = async (record: any) => { const resp = await delData(record.id); if (resp) { getUserInfo(); set_modalFormVisible(false); message.success('操作成功!'); } } const drapDownItems = (fileData: any) => [ { key: '1', label: ( { set_currentEditAttachment(fileData); set_modalFormVisible(true); }}>编辑 ), }, { key: '2', label: ( delUseerAttachmentHandle(fileData)} > 删除 ) }, ] useEffect(() => { if (drawerVisible) { getOperationLevelList(); } }, [drawerVisible]); useEffect(()=>{ if(!modalFormVisible){ set_currentEditAttachment(undefined); } },[modalFormVisible]); useEffect(() => { getUserInfo(); }, []); return ( { return updateTable(currentEditAttachment ? { ...currentEditAttachment, ...val } : { ...val }, currentEditAttachment ? 'EDIT' : 'ADD'); }} modalProps={{ destroyOnClose: true, onCancel: () => set_modalFormVisible(false), }} colProps={{ span: 24 }} grid submitter={{ searchConfig: { submitText: '确认', resetText: '取消', }, }} > 点击或将文件拖拽到这里上传} fieldProps={{ name: 'file', height: 140, multiple: false, headers: { token: initialState?.userData.token as string }, // onChange(info) { // const { status } = info.file; // if (status !== 'uploading') { // console.log(info.file, info.fileList); // } // if (status === 'done') { // message.success(`${info.file.name} 文件上传成功。`); // } else if (status === 'error') { // message.error(`${info.file.name} 文件上传失败。`); // } // }, // onDrop(e) { // console.log('拖拽上传的文件:', e.dataTransfer.files); // }, }} />
set_drawerVisible(false)}>
{'详情'}
{currentEditRow?.qualification?.name} { currentEditRow?.qualification?.techFlag == 1 && ( 医疗技术 ) } { currentEditRow?.qualification?.operationFlag == 1 && ( { ((operationLevel.filter((a) => a.value == currentEditRow?.qualification?.operationLevelCode))).length > 0 ? ((operationLevel.filter((a) => a.value == currentEditRow?.qualification?.operationLevelCode)))[0].name : '' } ) }
资质编码:{currentEditRow?.qualification?.code} 资质分类:{currentEditRow?.qualification?.qualificationTypeName} {currentEditRow?.qualification?.standard.length > 0 && (
{currentEditRow.qualification.standard}
)}
授权记录
{ currentEditRow?.applyList?.map((a: any, index: number) => { return
{(authTimeType.filter((b) => b.value == a.qualificationPeriod)).length > 0 ? (authTimeType.filter((b) => b.value == a.qualificationPeriod))[0].label : ''} |{`${a.beginDate}至${a.endDate}`} {a.applyAdjust.length > 0 && ( } title={false} > )}
{a.currentStatus}
}) }
我的资质
手术级别: { const resp = await getDicDataBySysId(KcimCenterSysId, 'SURGICAL_AND_OPERATIONAL_LEVELS'); if (resp) { set_operationLevel(resp.dataVoList); return resp.dataVoList.map((item: any) => ({ label: item.name, value: item.value })) } }} fieldProps={{ onChange(value, option) { set_tableDataFilterParams({ ...tableDataFilterParams, current: 1, operationLevelCode: value }) }, }} />
检索: tableDataSearchHandle('name')} /> } onChange={(e) => { set_tableDataSearchKeywords(e.target.value); if (e.target.value.length == 0) { set_tableDataSearchKeywords(''); set_tableDataFilterParams({ ...tableDataFilterParams, name: undefined }) } }} onPressEnter={(e) => { tableDataSearchHandle('name') }} />
a == '医疗技术') != -1 ? 1 : 0, operationFlag: checkedValue.findIndex((a) => a == '手术') != -1 ? 1 : 0, }) }, }} />
{currentSelectedTableRows.length > 0 && (
set_modalFormVisible(true)}>批量调整
)}
getTableData(params)} // dataSource={showList} tableAlertRender={false} />
{userInfo?.name}{userInfo?.gender&&}
{userInfo?.id}
{userInfo?.deptName??'-'}
科室
{userInfo?.title??'-'}
职称
{userInfo?.jobTitle??'-'}
职务
资质信息
资格证号:{userInfo?.qualificationCertificateNo??'-'}
执业类别:{userInfo?.practiceCate??'-'}
执业证号:{userInfo?.practiceCertificateNo??'-'}
执业专业:{userInfo?.major??'-'}
医师级别:{userInfo?.doctorLevel??'-'}
{ userInfo?.attachments.map((a: any, index: number) => (
{a.fileName}
{a.description}
...
)) }
) }