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.
69 lines
3.9 KiB
69 lines
3.9 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 } from "react/jsx-runtime"; |
|
import { ModalForm, ProFormTextArea, FooterToolbar, } from '@ant-design/pro-components'; |
|
import { useServiceContext } from '../../context'; |
|
import { useRequest } from 'ahooks'; |
|
import { message, Space, Button, Col, Row, Modal } from 'antd'; |
|
import { getStorage, useRoutes, themeMessage } from '@component/utils'; |
|
import { onServiceInsureOrganReview, onServiceOrganReview } from '../../action'; |
|
import { useState } from 'react'; |
|
const serviceReviewAction = { |
|
insurance: onServiceInsureOrganReview, |
|
expert: onServiceOrganReview, |
|
}; |
|
export default function ({ visibleReturnedBtn }) { |
|
const { historyBack } = useRoutes(); |
|
const { serviceId, client } = useServiceContext(); |
|
const service = serviceReviewAction[client]; |
|
const [isSup] = useState(getStorage('isSup')); |
|
const { runAsync } = useRequest(service, { |
|
manual: true, |
|
onSuccess(result) { |
|
themeMessage(result, historyBack); |
|
}, |
|
onError(result) { |
|
message.error(result.message); |
|
}, |
|
}); |
|
const review = [ |
|
{ |
|
status: '5', |
|
title: '退回至下一级', |
|
supAudit: 'N', |
|
danger: true, |
|
hidden: client === 'expert', |
|
}, |
|
{ status: '4', title: '驳回修改', supAudit: 'N', danger: true }, |
|
{ status: '3', title: '提交上级审核', supAudit: 'Y' }, |
|
{ status: '3', title: '审核通过', supAudit: 'N' }, |
|
]; |
|
function onFinish(values, status, supAudit) { |
|
return __awaiter(this, void 0, void 0, function* () { |
|
values.auditStatus = status; |
|
values.serviceId = serviceId; |
|
values.supAudit = supAudit; |
|
yield runAsync(Object.assign({}, values)); |
|
}); |
|
} |
|
return (_jsx(FooterToolbar, { children: _jsx(Row, { children: _jsx(Col, Object.assign({ span: 24, style: { textAlign: 'center' } }, { children: _jsx(Space, Object.assign({ align: "center" }, { children: review.map((item) => { |
|
if (getStorage('isSup') != 1 && item.supAudit == 'Y') { |
|
return; |
|
} |
|
if (item === null || item === void 0 ? void 0 : item.hidden) |
|
return; |
|
if (visibleReturnedBtn != 2 && item.status == '5') |
|
return; |
|
return (_jsx(ModalForm, Object.assign({ title: "\u5BA1\u6838\u610F\u89C1", layout: "horizontal", labelCol: { span: 4 }, wrapperCol: { span: 16 }, submitTimeout: 2000, onFinish: (values) => onFinish(values, item.status, item.supAudit), trigger: (item === null || item === void 0 ? void 0 : item.danger) ? (_jsx(Button, Object.assign({ danger: true }, { children: item.title }))) : (_jsx(Button, Object.assign({ type: "primary" }, { children: item.title }))) }, { children: _jsx(ProFormTextArea, { name: "auditOpinion", fieldProps: { |
|
maxLength: 500, |
|
showCount: true, |
|
}, label: "\u5BA1\u6838\u610F\u89C1", rules: [{ required: true, message: '请输入审核意见' }], placeholder: "\u8BF7\u8F93\u5165\u5BA1\u6838\u610F\u89C1" }) }))); |
|
}) })) })) }) })); |
|
}
|
|
|