|
@@ -1,7 +1,9 @@
|
|
|
/*
|
|
|
* @Author: your name
|
|
|
* @Date: 2022-03-07 11:05:19
|
|
|
- * @LastEditTime: 2022-03-14 09:55:53
|
|
|
+
|
|
|
+ * @LastEditTime: 2022-03-14 11:48:28
|
|
|
+
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
|
* @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/drawer/set.tsx
|
|
@@ -12,10 +14,11 @@
|
|
|
import MccsDrawerForm from '@/components/MccsDrawerForm/index';
|
|
|
import { ProFormDependency, ProFormInstance, ProFormSelect } from '@ant-design/pro-form';
|
|
|
import MccsClickableTabs from '@/components/MccsClickableTabs/index';
|
|
|
-import { useRef } from 'react'
|
|
|
+import { useEffect, useRef, useState } from 'react'
|
|
|
|
|
|
import { Form, Row, Col } from 'antd'
|
|
|
import { useModel } from 'umi';
|
|
|
+import MultiResponsibilitySelecter from './multi';
|
|
|
|
|
|
|
|
|
|
|
@@ -40,20 +43,22 @@ const SetDrawer = () => {
|
|
|
|
|
|
const drawerFormRef = useRef<ProFormInstance>();
|
|
|
|
|
|
+ const [ifsetTargetScore, setifsetTargetScore] = useState(true); //设置目标分数是否必填
|
|
|
+
|
|
|
|
|
|
|
|
|
const onVisibleChangeHandle = (visible: boolean) => {
|
|
|
//drawer展示控制
|
|
|
- if(visible){
|
|
|
- if(restModelData.leafData){
|
|
|
+ if (visible) {
|
|
|
+ if (restModelData.leafData) {
|
|
|
getDepartmentUsers(restModelData.leafData?.reviewArticle.responsibilityDepartmentId);
|
|
|
}
|
|
|
}
|
|
|
- !visible && articleManagement.setArticleSettingFormInit({});//清空默认值
|
|
|
+ !visible && restModelData.setArticleSettingFormInit(undefined);//清空默认值
|
|
|
restModelData.setDrawerVisible(visible);
|
|
|
}
|
|
|
-
|
|
|
- const setTitle = (type:string) => {
|
|
|
+
|
|
|
+ const setTitle = () => {
|
|
|
|
|
|
if (restModelData.drawerFormType == 'ARTICLE_SET') {
|
|
|
return '条文设置'
|
|
@@ -61,10 +66,11 @@ const SetDrawer = () => {
|
|
|
if (restModelData.drawerFormType == 'BATCHSETTING') {
|
|
|
return '批量设置'
|
|
|
}
|
|
|
+ return ''
|
|
|
}
|
|
|
|
|
|
- const onFinishHandle = (values:any)=>{
|
|
|
-
|
|
|
+ const onFinishHandle = (values: any) => {
|
|
|
+
|
|
|
if (restModelData.drawerFormType == 'ARTICLE_SET') {
|
|
|
restModelData.setArticle(values)
|
|
|
}
|
|
@@ -73,95 +79,118 @@ const SetDrawer = () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ useEffect(() => {
|
|
|
+ if (articleManagement.articleSettingFormInit && articleManagement.articleSettingFormInit.targetScores) {
|
|
|
+ setifsetTargetScore(true);
|
|
|
+ } else {
|
|
|
+ setifsetTargetScore(false);
|
|
|
+ }
|
|
|
+ }, [articleManagement.articleSettingFormInit?.targetScores]);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
return (
|
|
|
<MccsDrawerForm
|
|
|
- title={setTitle(restModelData.drawerFormType?restModelData.drawerFormType:'')}
|
|
|
+ title={setTitle()}
|
|
|
width={500}
|
|
|
formRef={drawerFormRef}
|
|
|
visible={restModelData.drawerVisible}
|
|
|
- initialValues={restModelData.drawerFormType == 'ARTICLE_SET' ? { ...articleManagement.articleSettingFormInit } : {}}
|
|
|
+ initialValues={restModelData.drawerFormType == 'ARTICLE_SET' ? { ...articleManagement.articleSettingFormInit } : undefined}
|
|
|
onFinish={(values: any) => onFinishHandle(values)}
|
|
|
onVisibleChange={onVisibleChangeHandle}
|
|
|
>
|
|
|
- <div>
|
|
|
- <div className='formItemTitle'>负责人及单位</div>
|
|
|
- <Row gutter={16}>
|
|
|
- <Col className="gutter-row" span={10}>
|
|
|
- <ProFormSelect
|
|
|
- name="responsibilityDepartment"
|
|
|
- width='sm'
|
|
|
- showSearch
|
|
|
- request={getDepartmentRequest}
|
|
|
- placeholder="选择单位"
|
|
|
- fieldProps={{
|
|
|
- labelInValue: true,
|
|
|
- onChange: (item, option) => {
|
|
|
- //责任单位修改时清空责任人
|
|
|
- drawerFormRef.current?.setFieldsValue({ ...articleManagement.articleSettingFormInit, responsibilityUser: { label: '', value: '' } });
|
|
|
- getDepartmentUsers(item.value, option)
|
|
|
- }
|
|
|
- }}
|
|
|
- rules={[{ required: true, message: '请选择单位!' }]}
|
|
|
- />
|
|
|
- </Col>
|
|
|
-
|
|
|
- <Col className="gutter-row" span={8}>
|
|
|
- <ProFormDependency name={['responsibilityDepartment']}>
|
|
|
- {({ responsibilityDepartment }) => {
|
|
|
- return (
|
|
|
- <ProFormSelect
|
|
|
- name="responsibilityUser"
|
|
|
- width='sm'
|
|
|
- disabled={!responsibilityDepartment || JSON.stringify(responsibilityDepartment) == '{}'}
|
|
|
- options={departmentManagers}
|
|
|
- placeholder="选择负责人"
|
|
|
- fieldProps={{
|
|
|
- labelInValue: true,
|
|
|
- }}
|
|
|
- rules={[{ required: true, message: '请选择负责人!' }]}
|
|
|
- />
|
|
|
- )
|
|
|
- }}
|
|
|
- </ProFormDependency>
|
|
|
- </Col>
|
|
|
- </Row>
|
|
|
- <div className='formItemTitle'>目标分数</div>
|
|
|
- <Row >
|
|
|
- <Col span={24}>
|
|
|
- <Form.Item name='targetScores' rules={[
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '请选择目标分数!',
|
|
|
- },
|
|
|
- ]}>
|
|
|
- <MccsClickableTabs
|
|
|
- data={restModelData.targetScores}
|
|
|
+ <div>
|
|
|
+ <div className='formItemTitle require'>负责人及单位</div>
|
|
|
+ <Row gutter={16}>
|
|
|
+ <Col className="gutter-row" span={10}>
|
|
|
+ <ProFormSelect
|
|
|
+ name="responsibilityDepartment"
|
|
|
+ width='sm'
|
|
|
+ showSearch
|
|
|
+ request={getDepartmentRequest}
|
|
|
+ placeholder="选择单位"
|
|
|
+ fieldProps={{
|
|
|
+ labelInValue: true,
|
|
|
+ onChange: (item, option) => {
|
|
|
+ //责任单位修改时清空责任人
|
|
|
+ drawerFormRef.current?.setFieldsValue({ ...articleManagement.articleSettingFormInit, responsibilityUser: { label: '', value: '' } });
|
|
|
+ getDepartmentUsers(item.value, option)
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ rules={[{ required: true, message: '请选择单位!' }]}
|
|
|
+ />
|
|
|
+ </Col>
|
|
|
+
|
|
|
+ <Col className="gutter-row" span={8}>
|
|
|
+ <ProFormDependency name={['responsibilityDepartment']}>
|
|
|
+ {({ responsibilityDepartment }) => {
|
|
|
+ return (
|
|
|
+ <ProFormSelect
|
|
|
+ name="responsibilityUser"
|
|
|
+ width='sm'
|
|
|
+ disabled={!responsibilityDepartment || JSON.stringify(responsibilityDepartment) == '{}'}
|
|
|
+ options={departmentManagers}
|
|
|
+ placeholder="选择负责人"
|
|
|
+ fieldProps={{
|
|
|
+ labelInValue: true,
|
|
|
+ }}
|
|
|
+ rules={[{ required: true, message: '请选择负责人!' }]}
|
|
|
/>
|
|
|
- </Form.Item>
|
|
|
- </Col>
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ </ProFormDependency>
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+
|
|
|
+ <div className='formItemTitle require'>合作负责人及单位</div>
|
|
|
+ <Row >
|
|
|
+ <Col span={24}>
|
|
|
+ <Row gutter={24}>
|
|
|
+ <MultiResponsibilitySelecter />
|
|
|
</Row>
|
|
|
- {
|
|
|
- true && (
|
|
|
- <>
|
|
|
- <div className='formItemTitle'>条文组别</div>
|
|
|
- <Row>
|
|
|
- <Col span={24}>
|
|
|
- <Form.Item name='articleType' rules={[
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '请选择条文组别!',
|
|
|
- },
|
|
|
- ]}>
|
|
|
- <MccsClickableTabs
|
|
|
- data={restModelData.ruleTypes}
|
|
|
- />
|
|
|
- </Form.Item>
|
|
|
- </Col>
|
|
|
- </Row>
|
|
|
- </>
|
|
|
- )
|
|
|
- }
|
|
|
- </div>
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+
|
|
|
+ <div className={ifsetTargetScore ? 'formItemTitle require' : 'formItemTitle'}>目标分数{ifsetTargetScore && <span onClick={() => setifsetTargetScore(false)}>暂不设置</span>}</div>
|
|
|
+ <Row >
|
|
|
+ <Col span={24}>
|
|
|
+ <Form.Item name='targetScores' rules={[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择目标分数!',
|
|
|
+ },
|
|
|
+ ]}>
|
|
|
+ <MccsClickableTabs
|
|
|
+ clear={!ifsetTargetScore}
|
|
|
+ data={restModelData.targetScores}
|
|
|
+ />
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ {
|
|
|
+ true && (
|
|
|
+ <>
|
|
|
+ <div className='formItemTitle require'>条文组别</div>
|
|
|
+ <Row>
|
|
|
+ <Col span={24}>
|
|
|
+ <Form.Item name='articleType' rules={[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择条文组别!',
|
|
|
+ },
|
|
|
+ ]}>
|
|
|
+ <MccsClickableTabs
|
|
|
+ data={restModelData.ruleTypes}
|
|
|
+ />
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ </>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ </div>
|
|
|
</MccsDrawerForm>
|
|
|
)
|
|
|
}
|