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.
87 lines
7.1 KiB
87 lines
7.1 KiB
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { |
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } |
|
return new (P || (P = Promise))(function (resolve, reject) { |
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } |
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } |
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } |
|
step((generator = generator.apply(thisArg, _arguments || [])).next()); |
|
}); |
|
}; |
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime"; |
|
import { PageContainer } from '@ant-design/pro-components'; |
|
import { Tabs, Form, Button, message } from "antd"; |
|
import { useRequest } from 'ahooks'; |
|
import ManagementStatus from './module/management.status'; |
|
import HiddenInformation from './module/hidden.information'; |
|
import RiskControl from './module/risk.control'; |
|
import MessageTask from './module/message.task'; |
|
import MessageServiceTask from './module/message.service.task'; |
|
import MessageTaskOther from './module/message.task.other'; |
|
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 ServiceAudit from './module/service.audit'; |
|
import { getStorage, useRoutes, themeMessage } from '@component/utils'; |
|
import { compact } from 'lodash'; |
|
import { getServiceResult, getServiceDetail, saveAndSubmitServiceReport, serviceReportPreviewPdf } from "./action"; |
|
import { useEffect, useRef } from 'react'; |
|
import { ExpertReportForm } from '@component/detail'; |
|
// client insurance,expert,enterprise |
|
export default function ({ client }) { |
|
var _a, _b, _c, _d; |
|
const { paramsParse } = useRoutes(); |
|
const { serviceId } = paramsParse; |
|
const managementStatusRef = useRef(); |
|
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, |
|
}); |
|
const { loading: pdfLoading, run: pdfRun } = useRequest(serviceReportPreviewPdf, { |
|
manual: true, |
|
onSuccess(data) { |
|
if (data) { |
|
message.success('导出预览报告成功'); |
|
} |
|
else { |
|
message.error('导出失败'); |
|
} |
|
} |
|
}); |
|
useEffect(() => run({ serviceId }), []); |
|
//reportCollection是否允许报告补录(1:是 2:否) |
|
let reportCollection = ((_a = data === null || data === void 0 ? void 0 : data.serviceData) === null || _a === void 0 ? void 0 : _a.isBackTracking) == 1; |
|
if (client && client == 'expert') { |
|
reportCollection = getStorage('reportCollection') != 2; |
|
} |
|
//服务方式 |
|
const service_type = (_b = data === null || data === void 0 ? void 0 : data.serviceData) === null || _b === void 0 ? void 0 : _b.serviceClassifyType; |
|
//服务执行状态 |
|
const status = Number((_c = data === null || data === void 0 ? void 0 : data.serviceData) === null || _c === void 0 ? void 0 : _c.status); |
|
function submitManagementStatus(required) { |
|
var _a; |
|
return __awaiter(this, void 0, void 0, function* () { |
|
return yield ((_a = managementStatusRef.current) === null || _a === void 0 ? void 0 : _a.onFinish(required)); |
|
}); |
|
} |
|
return (_jsx(PageContainer, Object.assign({ header: { |
|
title: null, |
|
}, loading: loading }, { children: _jsx(ServiceContext.Provider, Object.assign({ value: Object.assign(Object.assign({ serviceId, |
|
client }, data), { reportCollection, |
|
status }) }, { children: _jsxs(Tabs, Object.assign({ defaultActiveKey: "1", tabBarExtraContent: (_jsx(Button, Object.assign({ loading: pdfLoading, type: "link", onClick: () => pdfRun({ |
|
serviceId |
|
}) }, { children: "\u62A5\u544A\u9884\u89C8" }))) }, { children: [compact([reportCollection ? status : null, 3, 12, 22]).includes(status) && (_jsx(Tabs.TabPane, Object.assign({ tab: "\u670D\u52A1\u6210\u679C" }, { children: _jsx("div", Object.assign({ className: "page-content-detail-tabs" }, { children: ((_d = data.serviceData) === null || _d === void 0 ? void 0 : _d.isOrganReport) == '1' ? (_jsx(ExpertReportForm, { reSubmit: true, type: "edit", poltform: client })) : (_jsxs(_Fragment, { children: [_jsx(ServiceAudit, {}), ['fengxianbianshi', 'yinhuanpaicha'].includes(service_type) && (_jsx(ManagementStatus, { formRef: managementStatusRef, title: "\u4F01\u4E1A\u5B89\u5168\u7BA1\u7406\u73B0\u72B6" })), service_type === 'fengxianbianshi' && (_jsx(RiskControl, { title: "\u98CE\u9669\u8BC4\u4F30\u53CA\u7BA1\u63A7" })), service_type === 'yinhuanpaicha' && (_jsx(HiddenInformation, { title: "\u73B0\u573A\u4E8B\u6545\u9690\u60A3\u4FE1\u606F" })), ['ruchangpeixun', 'yingjiyanlian', 'jizhongfuwu'].includes(service_type) && _jsx(ServicePersonnel, { title: "\u53C2\u4E0E\u4EBA\u5458" }), ['fengxianbianshi', 'yinhuanpaicha'].includes(service_type) && (_jsx(MessageTask, { service: saveAndSubmitServiceReport, submitManagementStatus: submitManagementStatus, serviceData: data === null || data === void 0 ? void 0 : data.serviceData })), ['ruchangpeixun', 'yingjiyanlian', 'jizhongfuwu'].includes(service_type) && (_jsx(MessageServiceTask, { service: saveAndSubmitServiceReport, serviceData: data === null || data === void 0 ? void 0 : data.serviceData })), [ |
|
'biaozhunhuajianshe', |
|
'kejishebeianzhuang', |
|
'tongyongfuwu', |
|
].includes(service_type) && (_jsx(MessageTaskOther, { service: saveAndSubmitServiceReport, serviceData: data === null || data === void 0 ? void 0 : data.serviceData }))] })) })) }), "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"))] })) })) }))); |
|
}
|
|
|