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.
96 lines
7.5 KiB
96 lines
7.5 KiB
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime"; |
|
import { PageContainer } from '@ant-design/pro-components'; |
|
import { Divider, Tabs, Button, message } from 'antd'; |
|
import { useRequest } from 'ahooks'; |
|
import ManagementStatus from './module/management.status/detail'; |
|
import HiddenInformation from './module/hidden.information'; |
|
import RiskControl from './module/risk.control'; |
|
import MessageTask from './module/message.task/detail'; |
|
import MessageServiceTask from './module/message.service.task/detail'; |
|
import MessageTaskOther from './module/message.task.other/detail'; |
|
import { getServiceResult, getServiceDetail, serviceReportExpert, } from './action'; |
|
import { ServiceContext } from './context'; |
|
import ServiceEvaluate from './component/service.evaluate'; |
|
import ServiceReturnVisit from './component/service.return.visit'; |
|
import ServiceRecord from './component/service.record'; |
|
import ServiceDetail from './component/service.detail'; |
|
import ServicePersonnel from './module/service.personnel'; |
|
import ServiceReview from './module/service.review'; |
|
import { useRoutes } from '@component/utils'; |
|
import ServiceAudit from './module/service.audit'; |
|
import { ExpertReportDetail } from '@component/detail'; |
|
import { DownloadFile } from '@component/ui'; |
|
import { DownloadOutlined } from '@ant-design/icons'; |
|
import React, { useEffect, useState } from 'react'; |
|
import { head } from "lodash"; |
|
// client: insurance,expert,enterprise |
|
export default function ({ client, isReview, hiddenUrl, riskUrl }) { |
|
var _a, _b, _c, _d, _e, _f; |
|
const { paramsParse } = useRoutes(); |
|
const { serviceId } = paramsParse; |
|
const [reportInfo, setReportInfo] = useState({ url: '', name: '' }); |
|
function getAllData(params) { |
|
return Promise.all([getServiceDetail, getServiceResult].map((item) => item(params))).then((data) => { |
|
return { |
|
serviceData: data[0], |
|
resultData: data[1], |
|
}; |
|
}); |
|
} |
|
const { data = {}, loading, run, } = useRequest(getAllData, { |
|
manual: true, |
|
onSuccess(result) { |
|
var _a; |
|
try { |
|
const report = JSON.parse((_a = result.serviceData) === null || _a === void 0 ? void 0 : _a.serviceReportUrl); |
|
const api = process.env.REACT_APP_API_URL; |
|
setReportInfo({ |
|
url: `${api === null || api === void 0 ? void 0 : api.replace("/base", "")}${head(report).url}`, |
|
name: head(report).name |
|
}); |
|
} |
|
catch (e) { |
|
console.log(e); |
|
} |
|
} |
|
}); |
|
useEffect(() => run({ serviceId }), []); |
|
const { loading: pdfLoading, run: pdfRun } = useRequest(serviceReportExpert, { |
|
manual: true, |
|
onSuccess(data) { |
|
if (data) { |
|
message.success('导出报告成功'); |
|
} |
|
else { |
|
message.error('导出失败'); |
|
} |
|
}, |
|
}); |
|
//服务方式 |
|
const service_type = (_a = data === null || data === void 0 ? void 0 : data.serviceData) === null || _a === void 0 ? void 0 : _a.serviceClassifyType; |
|
//服务执行状态 |
|
const status = Number((_b = data === null || data === void 0 ? void 0 : data.serviceData) === null || _b === void 0 ? void 0 : _b.status); |
|
const serviceNumber = (_c = data === null || data === void 0 ? void 0 : data.serviceData) === null || _c === void 0 ? void 0 : _c.serviceNumber; |
|
return (_jsx(PageContainer, Object.assign({ header: { |
|
title: null, |
|
}, loading: loading }, { children: _jsx(ServiceContext.Provider, Object.assign({ value: Object.assign(Object.assign({ serviceId, |
|
client, |
|
hiddenUrl, |
|
riskUrl }, data), { status, |
|
service_type }) }, { children: _jsxs(Tabs, Object.assign({ defaultActiveKey: "1", tabBarExtraContent: |
|
/*isOrganReport==2 正常流程 isOrganReport==1 简化流程*/ |
|
status === 11 ? Number((_d = data.serviceData) === null || _d === void 0 ? void 0 : _d.isOrganReport) == 1 ? ( |
|
// 专家补录 |
|
_jsx(DownloadFile, { exportText: '\u5BFC\u51FA\u670D\u52A1\u62A5\u544A', params: { |
|
url: reportInfo.url, |
|
fileName: reportInfo.name |
|
} })) : (_jsx(Button, Object.assign({ loading: pdfLoading, type: "link", icon: _jsx(DownloadOutlined, {}), onClick: () => pdfRun({ |
|
serviceNumber: serviceNumber, |
|
serviceId: serviceId, |
|
isRenew: 'Y', |
|
}) }, { children: "\u5BFC\u51FA\u670D\u52A1\u62A5\u544A" }))) : null }, { children: [![-1, 1, 2].includes(status) && (_jsx(Tabs.TabPane, Object.assign({ tab: "\u670D\u52A1\u6210\u679C" }, { children: _jsxs("div", Object.assign({ className: "page-content-detail-tabs" }, { children: [((_e = data.serviceData) === null || _e === void 0 ? void 0 : _e.isOrganReport) == '1' ? (_jsx(ExpertReportDetail, { type: "detail" })) : (_jsxs(_Fragment, { children: [_jsx(ServiceAudit, {}), ['fengxianbianshi', 'yinhuanpaicha'].includes(service_type) && _jsx(ManagementStatus, { title: "\u4F01\u4E1A\u5B89\u5168\u7BA1\u7406\u73B0\u72B6" }), _jsx(Divider, { className: "self-pro-divider" }), service_type === 'fengxianbianshi' && (_jsx(RiskControl, { readonly: true, title: "\u98CE\u9669\u8BC4\u4F30\u53CA\u7BA1\u63A7" })), _jsx(Divider, { className: "self-pro-divider" }), service_type === 'yinhuanpaicha' && (_jsx(HiddenInformation, { readonly: true, title: "\u73B0\u573A\u4E8B\u6545\u9690\u60A3\u4FE1\u606F" })), _jsx(Divider, { className: "self-pro-divider" }), ['ruchangpeixun', 'yingjiyanlian', 'jizhongfuwu'].includes(service_type) && _jsx(ServicePersonnel, { readonly: true, title: "\u53C2\u4E0E\u4EBA\u5458" }), _jsx(Divider, { className: "self-pro-divider" }), ['fengxianbianshi'].includes(service_type) && (_jsx(MessageTask, { peopleTitle: '风险管控负责人信息' })), ['yinhuanpaicha'].includes(service_type) && (_jsx(MessageTask, { peopleTitle: '事故隐患整改负责人' })), ['ruchangpeixun', 'yingjiyanlian', 'jizhongfuwu'].includes(service_type) && _jsx(MessageServiceTask, {}), [ |
|
'biaozhunhuajianshe', |
|
'kejishebeianzhuang', |
|
'tongyongfuwu', |
|
].includes(service_type) && _jsx(MessageTaskOther, {})] })), isReview && (_jsx(ServiceReview, { visibleReturnedBtn: (_f = data === null || data === void 0 ? void 0 : data.serviceData) === null || _f === void 0 ? void 0 : _f.visibleReturnedBtn }))] })) }), "1")), _jsx(Tabs.TabPane, Object.assign({ tab: "\u670D\u52A1\u4FE1\u606F" }, { children: _jsx("div", Object.assign({ className: "page-content-detail-tabs" }, { children: _jsx(ServiceDetail, {}) })) }), "2"), _jsx(Tabs.TabPane, Object.assign({ tab: "\u670D\u52A1\u8FC7\u7A0B\u8BB0\u5F55" }, { children: _jsx("div", Object.assign({ className: "page-content-detail-tabs" }, { children: _jsx(ServiceRecord, {}) })) }), "3"), status == 11 && (_jsx(Tabs.TabPane, Object.assign({ tab: "\u670D\u52A1\u8BC4\u4EF7" }, { children: _jsx("div", Object.assign({ className: "page-content-detail-tabs" }, { children: _jsx(ServiceEvaluate, {}) })) }), "4")), status == 11 && (_jsx(Tabs.TabPane, Object.assign({ tab: "\u670D\u52A1\u56DE\u8BBF" }, { children: _jsx("div", Object.assign({ className: "page-content-detail-tabs" }, { children: _jsx(ServiceReturnVisit, {}) })) }), "5"))] })) })) }))); |
|
}
|
|
|