|
@@ -1,7 +1,7 @@
|
|
|
/*
|
|
|
* @Author: your name
|
|
|
* @Date: 2021-09-14 10:22:09
|
|
|
- * @LastEditTime: 2021-10-18 10:36:18
|
|
|
+ * @LastEditTime: 2021-10-22 10:17:25
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
* @Description: In User Settings Edit
|
|
|
* @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/index.tsx
|
|
@@ -20,6 +20,7 @@ import MccsDrawerForm from '@/components/MccsDrawerForm/index';
|
|
|
import MccsClickableTabs from '@/components/MccsClickableTabs/index';
|
|
|
import MccsUpload from '@/components/MccsUpload/index';
|
|
|
import { MccsModal } from '@/components/MccsModal';
|
|
|
+import type { ProFormInstance } from '@ant-design/pro-form';
|
|
|
|
|
|
|
|
|
|
|
@@ -78,7 +79,7 @@ const columns = [
|
|
|
dataIndex: 'name',
|
|
|
hideInSearch: true,
|
|
|
width: '35%',
|
|
|
- ellipsis:true
|
|
|
+ ellipsis: true
|
|
|
},
|
|
|
{
|
|
|
title: '负责单位',
|
|
@@ -116,6 +117,7 @@ const columns = [
|
|
|
const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
const { columnsFromProps = [], headerConcig, isModeTwo } = props;
|
|
|
const { articleManagement } = useModel('allModels');
|
|
|
+ const drawerFormRef = useRef<ProFormInstance>();
|
|
|
const {
|
|
|
isLeaf,
|
|
|
treeData,
|
|
@@ -155,6 +157,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
|
|
|
const onVisibleChangeHandle = (visible: boolean) => {
|
|
|
//drawer展示控制
|
|
|
+ !visible && setArticleSettingFormInit({});//清空默认值
|
|
|
restModelData.setDrawerVisible(visible);
|
|
|
}
|
|
|
|
|
@@ -170,10 +173,10 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
//因为modalForm开启了request+params获取表单默认值,
|
|
|
//所以必须先设置默认值才能开启弹窗
|
|
|
if (formInitData) {
|
|
|
- const { fileUrl, recordTypeName,accountType, fileName } = formInitData;
|
|
|
+ const { fileUrl, recordTypeName, accountType, fileName } = formInitData;
|
|
|
// console.log({formInitData});
|
|
|
restModelData.setUploadFormInitValue({
|
|
|
- tab:{label:accountType,value:{label:recordTypeName,value:recordTypeName}},
|
|
|
+ tab: { label: accountType, value: { label: recordTypeName, value: recordTypeName } },
|
|
|
files: [{
|
|
|
uid: new Date().getTime(),
|
|
|
name: fileName,
|
|
@@ -184,10 +187,10 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
} else {
|
|
|
restModelData.setUploadFormInitValue({})
|
|
|
}
|
|
|
- restModelData.getUploadLedgerType().then(data=>{
|
|
|
+ restModelData.getUploadLedgerType().then(data => {
|
|
|
//设置上传台账类型
|
|
|
restModelData.setUploadLedgerTypeList(data);
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
restModelData.setModalVisible(true);
|
|
|
}
|
|
@@ -211,9 +214,9 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
}
|
|
|
|
|
|
|
|
|
- const uploadLedgerChangeHandle = (tabData:any)=>{
|
|
|
- //台账上传类型选择回调
|
|
|
- console.log({tabData});
|
|
|
+ const uploadLedgerChangeHandle = (tabData: any) => {
|
|
|
+ //台账上传类型选择回调
|
|
|
+ console.log({ tabData });
|
|
|
}
|
|
|
|
|
|
|
|
@@ -229,13 +232,13 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (restModelData.leafData) {
|
|
|
- const { responsibilityDepartmentId,responsibilityDepartmentName, responsibilityUserId, targetEvaluation,responsibilityUserName } = restModelData.leafData;
|
|
|
- if(responsibilityDepartmentName&&responsibilityDepartmentId){
|
|
|
+ const { responsibilityDepartmentId, responsibilityDepartmentName, responsibilityUserId, targetEvaluation, responsibilityUserName, accountType } = restModelData.leafData;
|
|
|
+ if (responsibilityDepartmentName && responsibilityDepartmentId) {
|
|
|
setArticleSettingFormInit({
|
|
|
- responsibilityDepartment:{label:responsibilityDepartmentName,value:responsibilityDepartmentId},
|
|
|
- responsibilityUser: {label:responsibilityUserName,value:responsibilityUserId},
|
|
|
- targetScores: targetEvaluation,
|
|
|
- articleType: 'A'
|
|
|
+ responsibilityDepartment: { label: responsibilityDepartmentName, value: responsibilityDepartmentId },
|
|
|
+ responsibilityUser: { label: responsibilityUserName, value: responsibilityUserId },
|
|
|
+ targetScores: { label: targetEvaluation, value: targetEvaluation },
|
|
|
+ articleType: { label: accountType, value: accountType },
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -261,14 +264,14 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
return (
|
|
|
<MccsPageContainer
|
|
|
config={headerConcig ? headerConcig : {
|
|
|
- content:!isModeTwo&&<div style={{textAlign:'right',fontSize:12,color: '#525866'}}>{restModelData.currentHospSelfScoreAndOthers}</div>
|
|
|
+ content: !isModeTwo && <div style={{ textAlign: 'right', fontSize: 12, color: '#525866' }}>{restModelData.currentHospSelfScoreAndOthers}</div>
|
|
|
}}
|
|
|
>
|
|
|
{
|
|
|
restModelData.modalVisible && (
|
|
|
<MccsModal title='台账上传' visible={restModelData.modalVisible}
|
|
|
onFinish={(values: any) => restModelData.uploadFile(values)}
|
|
|
- initialValues={!restModelData.uploadFormInitValue?{}:restModelData.uploadFormInitValue}
|
|
|
+ initialValues={!restModelData.uploadFormInitValue ? {} : restModelData.uploadFormInitValue}
|
|
|
onVisibleChange={onModalVisibleChange}
|
|
|
params={restModelData.uploadFormInitValue}
|
|
|
request={(params: any) => {
|
|
@@ -283,7 +286,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
},
|
|
|
]}>
|
|
|
<MccsClickableTabs
|
|
|
- disabled={(restModelData.uploadFormInitValue&&JSON.stringify(restModelData.uploadFormInitValue) != '{}') ? true : false}
|
|
|
+ disabled={(restModelData.uploadFormInitValue && JSON.stringify(restModelData.uploadFormInitValue) != '{}') ? true : false}
|
|
|
type='multi'
|
|
|
onChange={uploadLedgerChangeHandle}
|
|
|
data={restModelData.uploadLedgerTypeList}
|
|
@@ -303,10 +306,11 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
|
|
|
{
|
|
|
//条文设置/表格批量设置drawer弹窗
|
|
|
- restModelData.drawerVisible && (
|
|
|
+ restModelData.drawerVisible && (
|
|
|
<MccsDrawerForm
|
|
|
title={restModelData.drawerFormType == 'ARTICLE_SET' ? '条文设置' : '批量设置'}
|
|
|
width={500}
|
|
|
+ formRef={drawerFormRef}
|
|
|
visible={restModelData.drawerVisible}
|
|
|
initialValues={restModelData.drawerFormType == 'ARTICLE_SET' ? { ...articleSettingFormInit } : {}}
|
|
|
onFinish={(values: any) => restModelData.drawerFormType == 'ARTICLE_SET' ? restModelData.setArticle(values) : restModelData.batchSetting(values)}
|
|
@@ -314,15 +318,20 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
>
|
|
|
<div className='formItemTitle'>负责人及单位</div>
|
|
|
<Row gutter={16}>
|
|
|
- <Col className="gutter-row" span={8}>
|
|
|
+ <Col className="gutter-row" span={10}>
|
|
|
<ProFormSelect
|
|
|
name="responsibilityDepartment"
|
|
|
width='sm'
|
|
|
+ showSearch
|
|
|
request={getDepartmentRequest}
|
|
|
placeholder="选择单位"
|
|
|
fieldProps={{
|
|
|
labelInValue: true,
|
|
|
- onChange: (value, option) => getDepartment(value, option)
|
|
|
+ onChange: (value, option) => {
|
|
|
+ //责任单位修改时清空责任人
|
|
|
+ drawerFormRef.current?.setFieldsValue({ ...articleSettingFormInit, responsibilityUser: { label: '', value: '' } });
|
|
|
+ getDepartment(value, option)
|
|
|
+ }
|
|
|
}}
|
|
|
rules={[{ required: true, message: '请选择单位!' }]}
|
|
|
/>
|
|
@@ -352,7 +361,12 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
<div className='formItemTitle'>目标分数</div>
|
|
|
<Row >
|
|
|
<Col span={24}>
|
|
|
- <Form.Item name='targetScores'>
|
|
|
+ <Form.Item name='targetScores' rules={[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择目标分数!',
|
|
|
+ },
|
|
|
+ ]}>
|
|
|
<MccsClickableTabs
|
|
|
data={restModelData.targetScores}
|
|
|
/>
|
|
@@ -365,7 +379,12 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
<div className='formItemTitle'>条文组别</div>
|
|
|
<Row>
|
|
|
<Col span={24}>
|
|
|
- <Form.Item name='articleType'>
|
|
|
+ <Form.Item name='articleType' rules={[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择条文组别!',
|
|
|
+ },
|
|
|
+ ]}>
|
|
|
<MccsClickableTabs
|
|
|
data={restModelData.ruleTypes}
|
|
|
/>
|
|
@@ -445,7 +464,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
<MccsRecordList
|
|
|
title='台账记录'
|
|
|
list={restModelData.records}
|
|
|
- actionFunc={(data)=>restModelData.delHistoryRecordHandle(data)}
|
|
|
+ actionFunc={(data) => restModelData.delHistoryRecordHandle(data)}
|
|
|
actionNode={(data) => actionNodeFunc(data)}
|
|
|
/>
|
|
|
</TabPane>
|
|
@@ -453,7 +472,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
<div className='selfEvolutionArea'>
|
|
|
<div className='selfEvolutionTitle'>开始自评</div>
|
|
|
<MccsClickableTabs
|
|
|
- onChange={(value:{label:string,value:any}) => restModelData.onSelfEvolutionTabChange(value)}
|
|
|
+ onChange={(value: { label: string, value: any }) => restModelData.onSelfEvolutionTabChange(value)}
|
|
|
data={restModelData.targetScores}
|
|
|
value={restModelData.selectedSelfEvolution}
|
|
|
/>
|
|
@@ -475,7 +494,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
<MccsRecordList
|
|
|
title='台账记录'
|
|
|
list={restModelData.records}
|
|
|
- actionFunc={(data)=>{console.log({data})}}
|
|
|
+ actionFunc={(data) => { console.log({ data }) }}
|
|
|
//restModelData.delHistoryRecordHandle(data)
|
|
|
actionNode={(data) => actionNodeFunc(data)}
|
|
|
/>
|