|
@@ -4,7 +4,7 @@
|
|
|
* @Author: code4eat awesomedema@gmail.com
|
|
|
* @Date: 2022-12-16 09:42:52
|
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
|
- * @LastEditTime: 2023-05-11 12:01:54
|
|
|
+ * @LastEditTime: 2023-05-11 17:07:09
|
|
|
* @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
|
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
|
*/
|
|
@@ -36,6 +36,7 @@ import { getDeepestTreeData } from '@/utils/tooljs';
|
|
|
import { ColumnsType } from 'antd/es/table';
|
|
|
import { TableRowSelection } from 'antd/es/table/interface';
|
|
|
import { difference } from 'lodash';
|
|
|
+import { getCurrentCheckStatus } from '@/services/auth';
|
|
|
|
|
|
|
|
|
|
|
@@ -65,7 +66,7 @@ const EmployeeInfoCheck: React.FC = () => {
|
|
|
|
|
|
const [ifShowTip, set_ifShowTip] = useState(false);
|
|
|
|
|
|
- const [commitStatus, set_commitStatus] = useState('0');
|
|
|
+ const [commitStatus, set_commitStatus] = useState('0'); //提交状态
|
|
|
|
|
|
const [empInfoSearchKeywords, set_empInfoSearchKeywords] = useState('');
|
|
|
|
|
@@ -75,6 +76,8 @@ const EmployeeInfoCheck: React.FC = () => {
|
|
|
const [searchValue, setSearchValue] = useState('');
|
|
|
const [autoExpandParent, setAutoExpandParent] = useState(true);
|
|
|
|
|
|
+ const [auditType,set_auditType] = useState('0'); //审核状态
|
|
|
+
|
|
|
|
|
|
|
|
|
const tableRef = useRef<ActionType>();
|
|
@@ -155,6 +158,13 @@ const EmployeeInfoCheck: React.FC = () => {
|
|
|
set_currentComputeDate(resp);
|
|
|
}
|
|
|
|
|
|
+ const getCheckStatus = async (computeDate: string) => {
|
|
|
+ const resp = await getCurrentCheckStatus(computeDate);
|
|
|
+ if (resp) {
|
|
|
+ set_auditType(`${resp}`); //0 未审核 1 已审核
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
const getCurrentCommitStatus = async () => {
|
|
|
if (currentSelectedTreeNode) {
|
|
|
const resp = await getCurrentCommitStatusReq({
|
|
@@ -391,6 +401,7 @@ const EmployeeInfoCheck: React.FC = () => {
|
|
|
});
|
|
|
if (resp) {
|
|
|
message.success('提交成功!');
|
|
|
+ getTreeReqFunc(currentComputeDate as string);
|
|
|
getCurrentCommitStatus();
|
|
|
}
|
|
|
}
|
|
@@ -470,6 +481,7 @@ const EmployeeInfoCheck: React.FC = () => {
|
|
|
|
|
|
if (currentComputeDate) {
|
|
|
getTreeReqFunc(currentComputeDate);
|
|
|
+ getCheckStatus(currentComputeDate);
|
|
|
}
|
|
|
}, [currentComputeDate]);
|
|
|
|
|
@@ -602,16 +614,20 @@ const EmployeeInfoCheck: React.FC = () => {
|
|
|
</div>
|
|
|
|
|
|
<div className='btnGroupWrap'>
|
|
|
- <Popover open={ifShowTip} content={'当前处于提交中,无法操作!'} >
|
|
|
+ <Popover open={ifShowTip} content={auditType == '1'?'当前处于审核中,无法操作!':'当前处于提交中,无法操作!'} >
|
|
|
<div className={commitStatus != '0' ? 'btnGroup disabled' : 'btnGroup'}
|
|
|
- onMouseEnter={() => commitStatus == '0' ? set_ifShowTip(false) : set_ifShowTip(true)}
|
|
|
+ /**
|
|
|
+ * 当审核中,三个操作按钮都不可点击
|
|
|
+ * 当非审核中,生成和添加不可操作
|
|
|
+ */
|
|
|
+ onMouseEnter={() => auditType == '0' ? commitStatus == '1'?set_ifShowTip(true):set_ifShowTip(false) : set_ifShowTip(true)}
|
|
|
onMouseLeave={() => set_ifShowTip(false)}
|
|
|
>
|
|
|
<span key="2" onClick={commitStatus == '0' ? () => generateFunc() : () => { }}>生成</span>
|
|
|
<span key="3" onClick={commitStatus == '0' ? () => addPersonFunc() : () => { }}>添加</span>
|
|
|
</div>
|
|
|
</Popover>
|
|
|
- <div key="4" className='commit' onClick={() => commitBtnhandle()}>{commitStatus == '1' ? '取消提交' : '提交'}</div>
|
|
|
+ <div key="4" className={auditType == '1'?'commit disabled':'commit'} onClick={() => auditType == '0'?commitBtnhandle():()=>{}}>{commitStatus == '1' ? '取消提交' : '提交'}</div>
|
|
|
</div>
|
|
|
|
|
|
</div>
|