Commit 7b9af090 authored by Bill's avatar Bill

fix: 修改formily 因为版本导致table checkbox 多选无法获取值bug

parent fad1d835
......@@ -19,7 +19,23 @@ import { usePurchaseBidStore } from '@/store/purchaseBid';
// layout: 'sidemenu' | 'topmenu';
// }
const NOT_READ_MESSAGE = 1;
type WsMessage = {
action: "msg_no_read_message" | "purchase_bidding_message_supplier" | "purchase_bidding_message",
/**
* 信息数
*/
data: string,
/**
* 假设 memberId: 2 memberRoleId: 3, 那么 receiver: *:2:3
*/
receiver: string,
/**
* 发送者
*/
sender: string,
timestamp: number
}
const GlobalHeaderRight: React.FC<{ SiteStore?: any }> = (props) => {
const { SiteStore: { currentLayoutInfo } } = props;
const [message, setMessage] = useState<number>(0);
......@@ -37,19 +53,17 @@ const GlobalHeaderRight: React.FC<{ SiteStore?: any }> = (props) => {
const webSocketInit = useCallback(() => {
if (SOCKET_URL && (!ws.current || ws.current.readyState === 3) && userInfo) {
const url = `${SOCKET_URL}/message/websocket?memberId=${userInfo.memberId}&roleId=${userInfo.memberRoleId}&token=${userInfo.token}&source=${1}`;
console.log(url)
ws.current = new WebSocket(url);
// ws.current.onopen = (e) => {}
ws.current.onmessage = (e) => {
const data = JSON.parse(e.data);
console.log(data)
const data: WsMessage = JSON.parse(e.data);
if (data.action === 'purchase_bidding_message_supplier') {
setPurchaseBiddingMessageSupplier(data)
} else if (data.action === 'purchase_bidding_message') {
setPurchaseBiddingMessage(data)
}
if (data.type === NOT_READ_MESSAGE) {
setMessage(data.data);
if (data.action === 'msg_no_read_message') {
setMessage(+data.data);
}
};
ws.current.onclose = (e) => {
......
......@@ -7,8 +7,6 @@
import React, { useRef, useEffect, useState, useMemo } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { Card, PageHeader, Descriptions, Button, DatePicker} from 'antd';
import { history } from 'umi';
import AvatarWrap from '@/components/AvatarWrap';
import NiceForm from '@/components/NiceForm';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { createFormActions } from '@formily/antd';
......@@ -64,7 +62,7 @@ const logisticsDetail: React.FC = () => {
console.log(values);
const format = 'YYYY-MM-DD'
const startTime = values.startTime?.format(format);
const endTime = values.endTime ? values.endTime.format(format) + " 23:59:59" : "";
const endTime = values.endTime ? values.endTime.endOf("day").format(format) : "";
ref.current.reload({...values, startTime, endTime});
}
......
......@@ -114,7 +114,7 @@ const AllQuery = () => {
controlRender={
<NiceForm
actions={formActions}
expressionScope={{controllerBtns: controllerBtns()}}
components={{controllerBtns}}
onSubmit={handleSearch}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'noticeNo', FORM_FILTER_PATH);
......
......@@ -71,7 +71,7 @@ const AllQuery = () => {
return (
<PageHeaderWrapper
title={'生产通知单查询'}
title={'待审核生产通知单(一级)'}
>
<Card>
<StandardTable
......@@ -85,7 +85,7 @@ const AllQuery = () => {
controlRender={
<NiceForm
actions={formActions}
expressionScope={{controllerBtns: controllerBtns()}}
components={{controllerBtns}}
onSubmit={handleSearch}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'noticeNo', FORM_FILTER_PATH);
......
......@@ -74,7 +74,7 @@ const AllQuery = () => {
return (
<PageHeaderWrapper
title={'生产通知单查询'}
title={'待审核生产通知单(二级)'}
>
<Card>
<StandardTable
......@@ -88,7 +88,7 @@ const AllQuery = () => {
controlRender={
<NiceForm
actions={formActions}
expressionScope={{controllerBtns: controllerBtns()}}
components={{controllerBtns}}
onSubmit={handleSearch}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'noticeNo', FORM_FILTER_PATH);
......
......@@ -95,7 +95,7 @@ const TobeSubmit = () => {
controlRender={
<NiceForm
actions={formActions}
expressionScope={{controllerBtns: controllerBtns()}}
components={{controllerBtns}}
onSubmit={handleSearch}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'noticeNo', FORM_FILTER_PATH);
......
......@@ -88,16 +88,17 @@ export const pendingFirstQuerySchema: ISchema = {
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{batchUpdateBtn}}',
},
// 'x-component': 'Children',
// 'x-component-props': {
// children: '{{batchUpdateBtn}}',
// },
"x-component": 'controllerBtns'
},
noticeNo: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
placeholder: '搜索生产通知单号',
},
},
},
......
......@@ -104,10 +104,11 @@ export const querySchema: ISchema = {
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
// 'x-component': 'Children',
// 'x-component-props': {
// children: '{{controllerBtns}}',
// },
"x-component": 'controllerBtns'
},
noticeNo: {
type: 'string',
......
......@@ -50,14 +50,6 @@ const AllQuery = () => {
}
], filterRes);
// const handleSingleReviewOrDelete = async (postData: { id: number }) => {
// const service = PublicApi.postEnhanceProcessToBeFirstExamExam
// const { code } = await onSingleAction<PostEnhanceProcessToBeFirstExamExamResponse>(service, postData)
// if (code === 1000) {
// formActions.submit();
// }
// }
const handleSubmitToReviewOrDelete = async () => {
const selectedRowKeys = selectRowFns.selectedRowKeys;
const { code } = await handleAction<PostEnhanceProcessToBeFirstExamBatchExamPassResponse>(selectedRowKeys, PublicApi.postEnhanceProcessToBeFirstExamBatchExamPass)
......@@ -94,7 +86,7 @@ const AllQuery = () => {
controlRender={
<NiceForm
actions={formActions}
expressionScope={{batchUpdateBtn: controllerBtns()}}
components={{controllerBtns}}
onSubmit={handleSearch}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'noticeNo', FORM_FILTER_PATH);
......
......@@ -85,7 +85,7 @@ const AllQuery = () => {
controlRender={
<NiceForm
actions={formActions}
expressionScope={{batchUpdateBtn: controllerBtns()}}
components={{controllerBtns}}
onSubmit={handleSearch}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'noticeNo', FORM_FILTER_PATH);
......
......@@ -19,7 +19,7 @@ const EvaluateDetail = () => {
const { id } = usePageStatus();
const params = useMemo(() => { return id ? { id: id.toString() } : null }, [id]);
const { loading, initialValue }= useInitialValue<GetMemberAppraisalSummaryGetResponse, { id: string }>(PublicApi.getMemberAppraisalSummaryGet, params)
const { anchorHeader, basicInfoList, evaluateResultColumn } = useGetDetailCommon({blackList: ['result'], initialValue: initialValue})
const { anchorHeader, basicInfoList, evaluateResultColumn, auditProcess } = useGetDetailCommon({blackList: ['result'], initialValue: initialValue})
return (
<Spin spinning={loading}>
......@@ -29,24 +29,14 @@ const EvaluateDetail = () => {
// extra={headExtra && headExtra(detailInfo, returnAddress, exchangeAddress)}
>
<AuditProcess
innerVerifySteps={
initialValue && initialValue.verifySteps ?
initialValue.verifySteps.map(item => ({
step: item.step,
stepName: item.stepName,
roleName: item.roleName,
status: initialValue?.currentStep > item.step ? 'finish' : 'wait',
})) :
[]
}
innerVerifyCurrent={findLastIndexFlowState(initialValue?.verifySteps)}
{...auditProcess}
id="progress"
/>
<div style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn id="detail" data={basicInfoList} title="基本信息" column={3} />
</div>
<Card title="考评项目" id="project" style={{ margin: `${theme["@margin-md"]} 0` }}>
<Table columns={projectColumns} dataSource={initialValue?.items}></Table>
<Table columns={projectColumns} rowKey={"id"} dataSource={initialValue?.items}></Table>
</Card>
<div style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn id="result" data={evaluateResultColumn} title="考评结果" />
......
......@@ -69,12 +69,12 @@ const List: React.FC<Iprops> = (props: Iprops) => {
}
const handlePublic = useCallback(async (ids: number[]) => {
rowController.setSelectedRowKeys((prev: string[]) => prev.filter((_item) => !ids.includes(_item)));
setSubmitLoading(() => true)
const { code, data } = await PublicApi.postMemberAppraisalWaitPublishPublish({ids: ids});
setSubmitLoading(() => false)
if (code === 1000) {
rowController.setSelectedRowKeys((prev: string[]) => []);
ref.current?.submit();
}
}, [ref])
......
import React, { useMemo, useState } from 'react';
import { Progress } from 'antd';
import { GetMemberAppraisalResultGetResponse, GetMemberAppraisalSummaryGetResponse } from '@/services/MemberV2Api';
import { findLastIndexFlowState } from '@/utils';
/**
* 获取考评详情页的公共部分
......@@ -9,8 +10,14 @@ type Options = {
blackList: string[]
initialValue?: (GetMemberAppraisalSummaryGetResponse | GetMemberAppraisalResultGetResponse) & {
name: string,
upperName: string,
notifyMember: 1 | 0,
upperName?: string,
notifyMember: number,
verifySteps?: {
step: number,
stepName: string,
roleName: string
}[],
currentStep:number
},
}
......@@ -131,7 +138,36 @@ function useGetDetailCommon(options: Options) {
]
}, [initialValue])
return {anchorHeader, basicInfoList, evaluateResultColumn}
/**
* 获取当前工作流
*/
const auditProcess = useMemo(() => {
const innerVerifySteps: {
step: number,
stepName: string,
roleName: string,
status: 'finish' | 'wait',
}[] = initialValue && initialValue.verifySteps ?
initialValue.verifySteps.map(item => ({
step: item.step,
stepName: item.stepName,
roleName: item.roleName,
status: initialValue?.currentStep > item.step ? 'finish' : 'wait',
})) :
[]
const innerVerifyCurrent= findLastIndexFlowState(initialValue?.verifySteps)
const outerVerifyCurrent= 0
const outerVerifySteps=null
return {
innerVerifySteps,
outerVerifySteps,
innerVerifyCurrent,
outerVerifyCurrent
}
}, [initialValue])
return {anchorHeader, basicInfoList, evaluateResultColumn, auditProcess}
}
export default useGetDetailCommon;
......@@ -38,7 +38,7 @@ const TobeEvaluateDetail = () => {
const { id } = usePageStatus();
const params = useMemo(() => { return id ? { id: id.toString() } : null }, [id]);
const { loading, initialValue }= useInitialValue<GetMemberAppraisalSummaryGetResponse, { id: string }>(PublicApi.getMemberAppraisalSummaryGet, params)
const { anchorHeader, basicInfoList, evaluateResultColumn } = useGetDetailCommon({blackList: ['result'], initialValue: initialValue})
const { anchorHeader, basicInfoList, evaluateResultColumn, auditProcess } = useGetDetailCommon({blackList: ['result'], initialValue: initialValue})
const [hasScoring, setHasScoring] = useState<boolean>(false);
const [submitLoading, setSubmitLoading] = useState<boolean>(false);
......@@ -94,17 +94,7 @@ const TobeEvaluateDetail = () => {
}
>
<AuditProcess
innerVerifySteps={
initialValue && initialValue.verifySteps ?
initialValue.verifySteps.map(item => ({
step: item.step,
stepName: item.stepName,
roleName: item.roleName,
status: initialValue?.currentStep >= item.step ? 'finish' : 'wait',
})) :
[]
}
innerVerifyCurrent={findLastIndexFlowState(initialValue?.verifySteps)}
{...auditProcess}
id="progress"
/>
<div id="detail" style={{ margin: `${theme["@margin-md"]} 0` }}>
......
......@@ -22,7 +22,7 @@ const TobeEvaluateDetail = () => {
const { id } = usePageStatus();
const params = useMemo(() => { return id ? { id: id.toString() } : null }, [id]);
const { loading, initialValue }= useInitialValue<GetMemberAppraisalSummaryGetResponse, { id: string }>(PublicApi.getMemberAppraisalSummaryGet, params)
const { anchorHeader, basicInfoList, evaluateResultColumn } = useGetDetailCommon({blackList: [], initialValue: initialValue})
const { anchorHeader, basicInfoList, evaluateResultColumn, auditProcess } = useGetDetailCommon({blackList: [], initialValue: initialValue})
const [submitLoading, setSubmitLoading] = useState<boolean>(false)
const onSubmitRes = async () => {
setSubmitLoading(true)
......@@ -43,17 +43,7 @@ const TobeEvaluateDetail = () => {
}
>
<AuditProcess
innerVerifySteps={
initialValue && initialValue.verifySteps ?
initialValue.verifySteps.map(item => ({
step: item.step,
stepName: item.stepName,
roleName: item.roleName,
status: initialValue?.currentStep > item.step ? 'finish' : 'wait',
})) :
[]
}
innerVerifyCurrent={findLastIndexFlowState(initialValue?.verifySteps)}
{...auditProcess}
id="progress"
/>
<div style={{ margin: `${theme["@margin-md"]} 0` }}>
......
......@@ -42,11 +42,11 @@ const List: React.FC<Iprops> = (props: Iprops) => {
const handleBatchNotice = useCallback(async (ids: number[]) => {
rowController.setSelectedRowKeys((prev: string[]) => prev.filter((_item) => !ids.includes(_item)));
setSubmitLoading(true)
const { code, data } = await PublicApi.postMemberAppraisalWaitNotificationNotification({ids: ids});
setSubmitLoading(false)
if (code === 1000) {
rowController.setSelectedRowKeys([]);
ref.current?.submit();
}
}, [ref])
......
......@@ -21,7 +21,7 @@ const TobeEvaluateDetail = () => {
const { id } = usePageStatus();
const params = useMemo(() => { return id ? { id: id.toString() } : null }, [id]);
const { loading, initialValue }= useInitialValue<GetMemberAppraisalWaitAuditOneGetResponse, { id: string }>(PublicApi.getMemberAppraisalWaitAuditOneGet, params)
const { anchorHeader, basicInfoList, evaluateResultColumn } = useGetDetailCommon({blackList: ['result'], initialValue: initialValue})
const { anchorHeader, basicInfoList, evaluateResultColumn, auditProcess } = useGetDetailCommon({blackList: ['result'], initialValue: initialValue})
const { visible, toggle } = useModal();
......@@ -51,17 +51,7 @@ const TobeEvaluateDetail = () => {
}
>
<AuditProcess
innerVerifySteps={
initialValue && initialValue.verifySteps ?
initialValue.verifySteps.map(item => ({
step: item.step,
stepName: item.stepName,
roleName: item.roleName,
status: initialValue?.currentStep > item.step ? 'finish' : 'wait',
})) :
[]
}
innerVerifyCurrent={findLastIndexFlowState(initialValue?.verifySteps)}
{...auditProcess}
id="progress"
/>
<div style={{ margin: `${theme["@margin-md"]} 0` }}>
......
......@@ -41,11 +41,11 @@ const List: React.FC<Iprops> = (props: Iprops) => {
)
const handleBatchUpdate = useCallback(async (ids: number[]) => {
rowController.setSelectedRowKeys((prev: string[]) => prev.filter((_item) => !ids.includes(_item)));
setSubmitLoading(() => true)
const { code, data } = await PublicApi.postMemberAppraisalWaitAuditOneAuditBatch({ids: ids});
setSubmitLoading(() => false)
if (code === 1000) {
rowController.setSelectedRowKeys([]);
ref.current?.submit();
}
}, [ref])
......
......@@ -21,7 +21,7 @@ const TobeEvaluateDetail = () => {
const { id } = usePageStatus();
const params = useMemo(() => { return id ? { id: id.toString() } : null }, [id]);
const { loading, initialValue }= useInitialValue<GetMemberAppraisalWaitAuditTwoGetResponse, { id: string }>(PublicApi.getMemberAppraisalWaitAuditTwoGet, params)
const { anchorHeader, basicInfoList, evaluateResultColumn } = useGetDetailCommon({blackList: ['result'], initialValue: initialValue})
const { anchorHeader, basicInfoList, evaluateResultColumn, auditProcess } = useGetDetailCommon({blackList: ['result'], initialValue: initialValue})
const { visible, toggle } = useModal();
......@@ -51,17 +51,7 @@ const TobeEvaluateDetail = () => {
}
>
<AuditProcess
innerVerifySteps={
initialValue && initialValue.verifySteps ?
initialValue.verifySteps.map(item => ({
step: item.step,
stepName: item.stepName,
roleName: item.roleName,
status: initialValue?.currentStep > item.step ? 'finish' : 'wait',
})) :
[]
}
innerVerifyCurrent={findLastIndexFlowState(initialValue?.verifySteps)}
{...auditProcess}
id="progress"
/>
<div style={{ margin: `${theme["@margin-md"]} 0` }}>
......
......@@ -41,11 +41,12 @@ const List: React.FC<Iprops> = (props: Iprops) => {
)
const handleBatchUpdate = async (ids: string[]) => {
rowController.setSelectedRowKeys((prev: string[]) => prev.filter((_item) => !ids.includes(_item)));
setSubmitLoading(true)
const { code, data } = await PublicApi.postMemberAppraisalWaitAuditTwoAuditBatch({ids: ids});
const formatIds = ids.map((_item) => +ids);
const { code, data } = await PublicApi.postMemberAppraisalWaitAuditTwoAuditBatch({ids: formatIds});
setSubmitLoading(false)
if (code === 1000) {
rowController.setSelectedRowKeys([]);
ref.current?.submit();
}
}
......
......@@ -61,7 +61,7 @@ const TobeEvaluateDetail = () => {
const { id } = usePageStatus();
const params = useMemo(() => { return id ? { id: id.toString() } : null }, [id]);
const { loading, initialValue, setInitialValue, refresh }= useInitialValue<GetMemberAppraisalWaitSubmitGetResponse, { id: string }>(PublicApi.getMemberAppraisalWaitSubmitGet, params)
const { anchorHeader, basicInfoList, evaluateResultColumn } = useGetDetailCommon({blackList: ['result'], initialValue: initialValue})
const { anchorHeader, basicInfoList, evaluateResultColumn, auditProcess } = useGetDetailCommon({blackList: ['result'], initialValue: initialValue})
const [submitLoading, setSubmitLoading] = useState<boolean>(false);
const [ editingScoreData, setEditingScoreData ] = useState<any>({})
......@@ -164,17 +164,7 @@ const TobeEvaluateDetail = () => {
}
>
<AuditProcess
innerVerifySteps={
initialValue && initialValue.verifySteps ?
initialValue.verifySteps.map(item => ({
step: item.step,
stepName: item.stepName,
roleName: item.roleName,
status: initialValue?.currentStep >= item.step ? 'finish' : 'wait',
})) :
[]
}
innerVerifyCurrent={findLastIndexFlowState(initialValue?.verifySteps)}
{...auditProcess}
id="progress"
/>
<div id="detail" style={{ margin: `${theme["@margin-md"]} 0` }}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment