Commit 47364487 authored by XieZhiXiong's avatar XieZhiXiong

Merge branch 'dev-srm' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform into dev-srm

parents 3e68dedb 438a5749
......@@ -365,6 +365,7 @@ const MemberRoute: RouterChild = {
name: 'memberQuery',
component: '@/pages/member/memberQuery/index',
},
// 会员信息查询-详情
{
path: '/memberCenter/memberAbility/profile/query/detail',
......@@ -435,7 +436,41 @@ const MemberRoute: RouterChild = {
noMargin: true,
component: '@/pages/member/memberQuery/updateMember',
},
// 会员整改管理
{
path: '/memberCenter/memberAbility/profile/memberRectification',
name: '会员整改管理',
component: "@/pages/member/memberQuery/rectificationQuery"
},
{
path: '/memberCenter/memberAbility/profile/memberRectification/detail',
name: "会员整改详情",
component: "@/pages/member/memberQuery/rectificationQuery/detail",
hideInMenu: true,
noMargin: true,
},
{
path: '/memberCenter/memberAbility/profile/memberRectification/edit',
name: "进行整改",
component: "@/pages/member/memberQuery/rectificationQuery/detail",
hideInMenu: true,
noMargin: true,
},
// 考评结果查询
{
path: '/memberCenter/memberAbility/profile/memberEvaluate',
name: '会员考评结果管理',
component: "@/pages/member/memberQuery/evaluate"
},
{
path: '/memberCenter/memberAbility/profile/memberEvaluate/detail',
name: '会员考评结果详情',
component: "@/pages/member/memberQuery/evaluate/detail",
hideInMenu: true,
noMargin: true,
},
],
},
// 会员考察
{
......@@ -595,9 +630,23 @@ const MemberRoute: RouterChild = {
component: '@/pages/member/memberRectification/rectificationAdd/index',
},
{
path: '/memberCenter/memberAbility/memberRectification/rectificationAdd/edit',
name: '修改整改通知单',
component: '@/pages/member/memberRectification/rectificationAdd/add',
hideInMenu: true
},
{
path: '/memberCenter/memberAbility/memberRectification/rectificationAdd/add',
name: '新增整改通知单',
component: '@/pages/member/memberRectification/rectificationAdd/add',
hideInMenu: true
},
{
path: '/memberCenter/memberAbility/memberRectification/rectificationAdd/view',
name: '会员整改详情',
component: '@/pages/member/memberRectification/rectificationAdd/add',
// noMargin: true,
hideInMenu: true
},
{
path: '/memberCenter/memberAbility/memberRectification/tobeConfirmRectification',
......@@ -609,7 +658,7 @@ const MemberRoute: RouterChild = {
name: '待确认整改通知单详情',
component: '@/pages/member/memberRectification/tobeConfirmRectification/detail',
noMargin: true,
// hideInMenu: true
hideInMenu: true
},
]
},
......
......@@ -40,7 +40,7 @@ const FormilyRangeTime: React.FC<Iprops> = (props: Iprops) => {
return (
<div>
<RangeTime rangeTime={momentValue} onChange={onChange} {...componentProps} />
<RangeTime disabled={!editable} rangeTime={momentValue} onChange={onChange} {...componentProps} />
{
hasError && (
<p style={{marginBottom: 0, color: '#ff4d4f'}} >{ruleErrors.join(",")}</p>
......
import React, { CSSProperties, useEffect, useState } from 'react';
import React, { CSSProperties, useCallback, useEffect, useState } from 'react';
import { DatePicker } from 'antd';
import cx from 'classnames';
import styles from './index.less';
......@@ -14,11 +14,18 @@ interface Iprops {
* placeholader
*/
placeholader?: [string, string],
/**
* 规定起始时间是否大于当前日期
*/
shouldGtCurrent?: boolean,
onChange?: ((rangeTime: Moment[]) => void) | null,
disabled?: boolean
}
const RangeTime: React.FC<Iprops> = (props: Iprops) => {
const { containerStyle, rangeTime, onChange, placeholader } = props;
const { containerStyle, rangeTime, onChange, placeholader, shouldGtCurrent, disabled } = props;
const currentDay = moment();
const [innerRangeTime, setInnerRangeTime] = useState({
startTime: null,
endTime: null
......@@ -41,16 +48,23 @@ const RangeTime: React.FC<Iprops> = (props: Iprops) => {
setInnerRangeTime(newObject)
}
const getDisableDate = (current: Moment, mode: "startTime" | "endTime") => {
const getDisableDate = useCallback((current: Moment, mode: "startTime" | "endTime") => {
const reverseMode = mode === 'startTime' ? 'endTime' : 'startTime';
// const time
const modeTime = innerRangeTime[reverseMode];
// current 为当前日历上的日期, 如果返回值为true,那么表示当前日期为禁用状态
if(!modeTime) {
if(shouldGtCurrent) {
return current < currentDay.endOf('day');
}
return false
}
// 如果我当前选择的是startTime, 并选择了结束时间,那么
return mode === 'startTime' ? current > innerRangeTime[reverseMode].endOf('day') : current < innerRangeTime[reverseMode].endOf('day')
}
if (mode === 'startTime') {
return shouldGtCurrent ? (current < currentDay.endOf('day') || current > modeTime.endOf('day')) : current > modeTime.endOf('day')
} else {
//现在的时间要大于开始的时间, true 为禁用
return shouldGtCurrent ? (current < currentDay.endOf('day') || current < modeTime.endOf('day')) : current < modeTime.endOf('day')
}
}, [innerRangeTime])
return (
<div className={cx(styles.container, containerStyle)}>
......@@ -60,6 +74,7 @@ const RangeTime: React.FC<Iprops> = (props: Iprops) => {
value={innerRangeTime.startTime} onChange={(date: Moment, dateString: string) => handleChange(date, dateString, "startTime")}
disabledDate={(current) => getDisableDate(current, 'startTime')}
placeholder={placeholader[0]}
disabled={disabled}
/>
</div>
<span className={styles.splitChar}>~</span>
......@@ -70,6 +85,7 @@ const RangeTime: React.FC<Iprops> = (props: Iprops) => {
onChange={(date: Moment, dateString: string) => handleChange(date, dateString, "endTime")}
disabledDate={(current) => getDisableDate(current, 'endTime')}
placeholder={placeholader[1]}
disabled={disabled}
/>
</div>
</div>
......@@ -80,7 +96,9 @@ RangeTime.defaultProps = {
containerStyle: {},
rangeTime: [],
onChange: null,
placeholader: ["开始时间", "结束时间"]
placeholader: ["开始时间", "结束时间"],
shouldGtCurrent: true,
disabled: false
}
export default RangeTime
......@@ -65,11 +65,15 @@ const coordinationList = () => {
align: 'center',
render: (text, record) =>
<div>
<EyePreview
type="button"
>
{text}
</EyePreview>
{
text &&
<EyePreview
type={record.sourceType == 1 ? record.sourceId ? 'link' : "button" : 'link'}
url={record.sourceType == 1 ? `/memberCenter/procurementAbility/confirmOffer/offerInquire/demand/preview?id=${record.sourceId}&number${record.sourceNo}` : `/memberCenter/procurementAbility/callForBids/callForBidsSearch/detail?id=${record.sourceId}`}
>
{text}
</EyePreview>
}
<p>{record.sourceTypeName}</p>
</div>
},
......
......@@ -74,7 +74,7 @@ const table = (props: any) => {
dataIndex: 'orderAmount', align: 'center',
render: (text, record) =>
<div>
<div>{record.orderType == 2 ? `-${text}` : ''}</div>
<div>{record.orderType == 2 ? `-${text}` : text}</div>
</div>
},
......
......@@ -82,8 +82,8 @@ const QueryList = () => {
{
text &&
<EyePreview
type={record.sourceId ? 'link' : 'button'}
url={`/memberCenter/procurementAbility/offter/view?id${record.sourceId}&number${record.sourceNo}`}
type={record.sourceType == 1 ? record.sourceId ? 'link' : "button" : 'link'}
url={record.sourceType == 1 ? `/memberCenter/procurementAbility/confirmOffer/offerInquire/demand/preview?id=${record.sourceId}&number${record.sourceNo}` : `/memberCenter/procurementAbility/callForBids/callForBidsSearch/detail?id=${record.sourceId}`}
>
{text}
</EyePreview>
......@@ -178,7 +178,7 @@ const QueryList = () => {
content: '正在操作',
duration: 0,
});
console.log('Success:', values);
PublicApi.postContractManageInvalid(values).then(res => {
console.log(res);
if (res.code === 1000) {
......
......@@ -82,7 +82,8 @@ const addList = () => {
{
text &&
<EyePreview
url={`/memberCenter/contract/manage/QueryList/QueryListdetails`}
type={record.sourceType == 1 ? record.sourceId ? 'link' : "button" : 'link'}
url={record.sourceType == 1 ? `/memberCenter/procurementAbility/confirmOffer/offerInquire/demand/preview?id=${record.sourceId}&number${record.sourceNo}` : `/memberCenter/procurementAbility/callForBids/callForBidsSearch/detail?id=${record.sourceId}`}
>
{text}
</EyePreview>
......
......@@ -62,6 +62,13 @@ const BiddingList = () => {
compare: (a, b) => a.bidWinnerAmount - b.bidWinnerAmount,
multiple: 1,
},
render: (text) => {
return (
<div>
{text}
</div>
)
}
},
{
title: '外部状态',
......
import React, { Fragment } from 'react';
import styles from './center.less';
import { PublicApi } from '@/services/api'
import { Link } from 'umi'
import Layout from './layout';
import Authorize from '../Authorize';
import useViewRequest from '../../hooks/useViewRequest';
import { GetReportMemberHomeGetPurchaseTallyResponse } from '@/services/ReportV2Api';
import { BellOutlined } from '@ant-design/icons';
import {Button} from 'antd';
interface Iprops {};
const url = '/memberCenter/handling/assign/query'
const KEY_TITLE = {
purchaseInquiryList: '采购询价 ',
quotedPriceList: '报价',
confirmQuotedPriceList: '确认报价',
biddingList: '采购竞价',
onlineBiddingList: '在线竞价',
inviteTenderList: '招标',
tenderList: '投标',
needPlanList: '需求计划',
purchasePlanList: '采购计划'
}
const PurchaseCenter: React.FC<Iprops> = () => {
const { loading, responseData, isError, ref } = useViewRequest<GetReportMemberHomeGetPurchaseTallyResponse, any>(PublicApi.getReportMemberHomeGetPurchaseTally, {})
return (
<Layout
viewRef={ref}
title="采购中心"
tips="提供在线采购询价、在线报价、在线招投标、在线竞价、制订采购计划、创建采购门户等功能"
extra={
<Authorize
url={url}
>
<div>
<Link to={url}>进入采购中心</Link>
</div>
</Authorize>
}
loading={loading}
isError={isError}
>
<Fragment>
{
(
<div className={styles.ding_tips}>
<div>
<BellOutlined />
<span style={{marginLeft: '12px'}}>您还没有创建采购门户,请先创建采购门户</span>
</div>
<Button size="small" type="primary">点击创建</Button>
</div>
)
}
{
responseData && Object.keys(responseData).map((record: keyof GetReportMemberHomeGetPurchaseTallyResponse) => {
return (
<div className={styles.wrapRow} key={record}>
<span className={styles.rowTitle}>{KEY_TITLE?.[record]}</span>
<div className={styles.rowValues}>
{
responseData[record]?.map((_item, key) => {
return (
<div className={styles.wrapCol} key={key}>
<div className={styles.colTitle}>{_item.name}</div>
{
_item.link
? <Link to={_item.link} className={styles.colValue}>{_item.count}</Link>
: <div className={styles.colValue}>{_item.count}</div>
}
</div>
)
})
}
</div>
</div>
)
})
}
</Fragment>
</Layout>
)
}
export default PurchaseCenter
import { usePageStatus } from '@/hooks/usePageStatus';
import React, { useCallback, useEffect, useState } from 'react';
/**
......
......@@ -30,7 +30,8 @@ interface Iprops {
rowKey: string | ((record) => any)
},
mode: 'checkbox' | 'radio'
mode: 'checkbox' | 'radio',
customizeRadio?: boolean,
/**
* rowSelection
*/
......@@ -51,7 +52,7 @@ interface Iprops {
}
const TableModal: React.FC<Iprops> = (props: Iprops) => {
const { title, visible, schema, columns, effects, tableProps, mode, expressionScope, fetchData, onClose, onOk, value, format } = props;
const { title, visible, schema, columns, effects, tableProps, mode, expressionScope, fetchData, onClose, onOk, value, format, customizeRadio } = props;
const ref = useRef<any>({});
const isFirstLoad = useRef<boolean>(true)
const [selectRow, setSelectRow] = useState<number[] | string[]>(() => {
......@@ -95,7 +96,8 @@ const TableModal: React.FC<Iprops> = (props: Iprops) => {
}, [visible])
const onSelectChange = (record, selected: boolean, selectedRows) => {
const keys = selectedRows.map((_item) => typeof tableProps.rowKey === 'string' ? _item[tableProps.rowKey as string] : tableProps.rowKey(_item));
const recordRows = customizeRadio || mode === 'radio' ? selectedRows.slice(-1) : selectedRows;
const keys = recordRows.map((_item) => typeof tableProps.rowKey === 'string' ? _item[tableProps.rowKey as string] : tableProps.rowKey(_item));
setSelectRowRecord(selectedRows)
setSelectRow(keys)
};
......@@ -122,9 +124,10 @@ const TableModal: React.FC<Iprops> = (props: Iprops) => {
fetchTableData={fetchData}
currentRef={ref}
rowSelection={{
type: mode,
type: customizeRadio && mode === 'radio' ? 'checkbox' : mode,
onSelect: onSelectChange,
selectedRowKeys: selectRow,
hideSelectAll: customizeRadio,
}}
formRender={(child, ps) => (
<div style={{display: "flex", flexDirection: 'row', justifyContent: 'space-between'}}>
......@@ -156,7 +159,8 @@ TableModal.defaultProps = {
},
value: [],
expressionScope: {},
format: null
format: null,
customizeRadio: false,
}
export default TableModal;
......@@ -32,8 +32,6 @@ const commonColumns = [
</div>
)
}
// filters: [],
// onFilter: (_value, record) => record.type === _value,
},
{
title: '考评完成时间',
......
......@@ -95,7 +95,7 @@ function useGetDetailCommon(options: Options) {
title: '考评最终分',
value: (
<div style={{width: '60px', height: '30px'}}>
<Progress type="dashboard" percent={initialValue?.totalScore} gapDegree={145} width={60} />
<Progress type="dashboard" percent={initialValue?.totalScore || 0} gapDegree={145} width={60} />
</div>
)
},
......
......@@ -108,8 +108,13 @@ const InspectionAdd = () => {
const handleUserOnOk = (selectRowKeys: string[] | number[], selectRowRecord: GetMemberInspectUsersResponse["data"] ) => {
const target = selectRowRecord[0];
formActions.setFieldValue('tabs.tab-1.layout.userName', target.name)
formActions.setFieldValue('tabs.tab-1.layout.userId', target.userId)
formActions.setFieldValue('tabs.tab-1.layout.userName', target?.name)
formActions.setFieldValue('tabs.tab-1.layout.userId', target?.userId)
const disabled = target?.userId
formActions.setFieldState('tabs.tab-1.layout.userName', (state) => {
state.props['x-component-props'].disabled = disabled;
})
setUserModalValue(selectRowRecord);
userModalToggle(false)
}
......@@ -124,10 +129,18 @@ const InspectionAdd = () => {
const handleOnSubmit = async (values: SubmitDataType) => {
console.log(values);
const { name, userName, score, ...rest } = values;
const { name, userName, score, attachments, reports, ...rest } = values;
const postTempData = {
...rest,
score: +score,
attachments: attachments?.map((_row) => ({
name: _row.name,
url: _row.url
})),
reports: reports?.map((_row) => ({
name: _row.name,
url: _row.url
})),
}
const service = isEdit ? PublicApi.postMemberInspectUpdate : PublicApi.postMemberInspectAdd;
const postData: EditPostData | PostData = isEdit ? { ...postTempData, id: id } : postTempData;
......@@ -215,6 +228,7 @@ const InspectionAdd = () => {
title={"选择用户"}
columns={userColumns}
schema={userSchema}
customizeRadio
onOk={handleUserOnOk}
fetchData={handleFetchUserData}
effects={($,actions) => {
......
......@@ -99,7 +99,7 @@ export const InspectionAddSchema: ISchema = {
title: '会员代表',
type: 'string',
"x-component-props": {
disabled: true,
// disabled: true,
addonAfter: "{{connectUser}}"
},
},
......
import React from "react"
import { Link } from 'umi'
export const commonColumns = [
{
title: '考评单号/主题',
dataIndex: 'des',
render: (text, record) => {
return (
<div style={{ display: 'flex', flexDirection: 'column', }}>
<Link to={`/memberCenter/memberAbility/profile/memberEvaluate/detail?id=${record.id}`}>{record.id}</Link>
<p>{record.subject}</p>
</div>
)
}
},
{
title: '会员名称',
dataIndex: 'name',
},
{
title: '考评范围',
dataIndex: 'type',
render: (text, record) => {
return (
<div>
{`${record.appraisalDayStart} 至 ${record.appraisalDayEnd}`}
</div>
)
}
},
{
title: '考评完成时间',
dataIndex: 'completeDay',
sorter: (_a, _b) => _a.date - _b.date,
},
{
title: '考评最终分',
dataIndex: 'totalScore',
}
]
import React, { useMemo } from 'react';
import { Spin, Card, Steps, Table, Progress, Button } from 'antd';
import AnchorPage from '@/layouts/AnchorPage';
import theme from '../../../../../config/lingxi.theme.config';
import { projectColumns, recordColumn } from '../../memberEvaluate/columns/detail';
import CustomizeColumn from '@/components/CustomizeColumn';
import AuditProcess from '@/components/AuditProcess';
import useGetDetailCommon from '../../memberEvaluate/hooks/useGetDetailCommon';
import { usePageStatus } from '@/hooks/usePageStatus';
import useInitialValue from '../../common/hooks/useInitialValue';
import { PublicApi } from '@/services/api';
import { GetMemberAppraisalSummaryGetResponse } from '@/services/MemberV2Api';
import { findLastIndexFlowState } from '@/utils';
import FlowRecords from '@/components/FlowRecords';
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})
return (
<Spin spinning={loading}>
<AnchorPage
title={initialValue?.subject}
anchors={anchorHeader}
// 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)}
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} rowKey="id" dataSource={initialValue?.items}></Table>
</Card>
<div style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn id="result" data={evaluateResultColumn} title="考评结果" />
</div>
<div id="record">
<FlowRecords
innerRowkey="id"
innerColumns={recordColumn as any}
innerDataSource={initialValue?.history}
/>
</div>
</AnchorPage>
</Spin>
)
}
export default EvaluateDetail;
import React from 'react';
import { Card, Space } from 'antd'
import useEvaluateColumn from '../../memberEvaluate/hooks/useEvaluateColumn';
import { querySchema } from '../../memberEvaluate/tobeEvaluate/schema';
import useFetchList from '../../memberEvaluate/hooks/useFetchList';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { PublicApi } from '@/services/api';
import CustomizeQueryList from '../../components/CustomizeQueryList';
import { GetMemberAppraisalWaitGradePageResponseDetail } from '@/services/MemberV2Api';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { commonColumns } from './common/columns';
interface Iprops {};
const List: React.FC<Iprops> = (props: Iprops) => {
const { fetchListData } = useFetchList();
const handleFetch = async (params) => {
const result = fetchListData(PublicApi.getMemberAppraisalSummaryPage, params);
return result
}
return (
<Card>
<CustomizeQueryList
columns={commonColumns}
schema={querySchema}
fetchListData={handleFetch}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'name', FORM_FILTER_PATH);
}}
/>
</Card>
)
}
export default List
import React, { useMemo, useState } from 'react';
import { Spin, Card, Table, Button, Drawer } from 'antd';
import AnchorPage from '@/layouts/AnchorPage';
import CustomizeColumn from '@/components/CustomizeColumn';
import AuditProcess from '@/components/AuditProcess';
import { PublicApi } from '@/services/api';
import theme from '../../../../../config/lingxi.theme.config';
import useGetAnchorHeader from '../../memberRectification/common/hooks/useGetAnchorHeader';
import useGetDetailCommon from '../../memberRectification/common/hooks/useGetDetailCommon';
import { usePageStatus } from '@/hooks/usePageStatus';
import useInitialValue from '@/pages/handling/common/hooks/useInitialValue';
import { GetMemberRectifyWaitAddGetResponse } from '@/services/MemberV2Api';
import { findLastIndexFlowState } from '@/utils';
import FlowRecords from '@/components/FlowRecords';
import { innerColumns, outerColumns } from '../../memberRectification//common/columns/historyColumn'
import useModal from '../../memberEvaluate/hooks/useModal';
import { createFormActions } from '@formily/antd';
import NiceForm from '@/components/NiceForm';
import { rectificationReportSchema } from './schema'
import { history } from 'umi';
import FormilyUploadFiles from '@/components/UploadFiles/FormilyUploadFiles';
const formActions = createFormActions()
const rectificationAddDetail = () => {
const { visible, toggle } = useModal();
const { headers } = useGetAnchorHeader(["editInfo", "result"])
const { id } = usePageStatus();
const params = useMemo(() => { return id ? { id: id.toString() } : null }, [id]);
const { loading, initialValue }= useInitialValue<GetMemberRectifyWaitAddGetResponse, { id: string }>(PublicApi.getMemberRectifyManageGet, params)
const { basicInfo, editInfo, resultInfo } = useGetDetailCommon({initialValue});
const [submitLoading, setSubmitLoading] = useState<boolean>(false);
const outerVerifySteps = useMemo(() => {
if (!initialValue?.outerVerifySteps) {
return []
}
return initialValue.outerVerifySteps.map(item => ({
step: item.step,
stepName: item.stepName,
roleName: item.roleName,
status: (initialValue?.currentOuterStep > item.step ? 'finish' : 'wait') as 'finish' | 'wait',
}))
}, [initialValue])
const onSubmitRes = () => {
formActions.submit()
}
const handleSubmit = async (value: { reportDigest: string, reportAttachments: { label: string, url: string }[] }) => {
setSubmitLoading(true)
const { data, code } = await PublicApi.postMemberRectifyManageUpdateReport({
id: id,
reportDigest: value.reportDigest,
reportAttachments: value.reportAttachments.map((_row) => ({
name: _row.label,
url: _row.url,
}))
})
setSubmitLoading(false)
if (code === 1000) {
toggle(false);
history.goBack();
}
}
return (
<Spin spinning={loading}>
<AnchorPage
title={initialValue?.subject}
anchors={headers}
>
<AuditProcess
outerVerifySteps={outerVerifySteps}
outerVerifyCurrent={findLastIndexFlowState(initialValue?.outerVerifySteps)}
id="progress"
/>
<div id="basicInfo" style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn data={basicInfo} title="基本信息" column={3} />
</div>
<div id="editInfo" style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn data={editInfo} title="整改信息" column={1} />
</div>
<div id="result" style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn data={resultInfo} title="整改结果" column={1} />
</div>
<div id="record">
<FlowRecords
innerRowkey="id"
innerColumns={innerColumns as any}
innerDataSource={initialValue?.innerHistory}
outerRowkey="id"
outerColumns={outerColumns as any}
outerDataSource={initialValue?.outerHistory}
/>
</div>
<Drawer
visible={visible}
onClose={() => toggle(false)}
width={440}
title="确认整改结果"
footer={
<div style={{ textAlign: 'right'}}>
<Button onClick={() => toggle(false)} style={{ marginRight: 8 }}>
取消
</Button>
<Button loading={submitLoading} onClick={onSubmitRes} type="primary">
提交
</Button>
</div>
}
>
<NiceForm
schema={rectificationReportSchema}
actions={formActions}
onSubmit={handleSubmit}
components={{FormilyUploadFiles}}
/>
</Drawer>
</AnchorPage>
</Spin>
)
}
export default rectificationAddDetail
import React, { useCallback, useRef, useState } from 'react';
import { Card, Space, Button, Spin } from 'antd'
import { setColumnsByLinks } from '../../memberRectification/common/columns/queryColumns';
import { rectificationListSchema } from '../../memberRectification/common/schema';
import { querySchema } from './schema';
import useFetchList from '../../memberEvaluate/hooks/useFetchList';
import { PlusOutlined } from '@ant-design/icons';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { PublicApi } from '@/services/api';
import CustomizeQueryList from '../../components/CustomizeQueryList';
import { Link } from 'umi';
import useColumns from '../../memberRectification/common/hooks/useColumns';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
interface Iprops {};
const queryColumns = setColumnsByLinks({
detail: '/memberCenter/memberAbility/profile/memberRectification/detail'
})
const List: React.FC<Iprops> = (props: Iprops) => {
const { fetchListData } = useFetchList();
const ref = useRef<any>({})
const [ currentIdIsInLoading, setCurrentIdIsInLoading ] = useState<number[]>([])
const { columns, fetchStatusOptions } = useColumns(queryColumns, [
{
title: "操作",
render: (text, record) => {
const isloading = currentIdIsInLoading.includes(record.id);
return (
<Space>
<Spin spinning={isloading}>
<a onClick={() => handleSendNotice(record.id)}>整改</a>
</Spin>
<Link to={`/memberCenter/memberAbility/profile/memberRectification/edit?id=${record.id}`}>修改</Link>
</Space>
)
}
}
], { fetchStatusListApi: PublicApi.getMemberRectifyManageStatusList })
const handleFetch = async (params) => {
const result = fetchListData(PublicApi.getMemberRectifyManagePage, params);
return result
}
const handleSendNotice = useCallback(async(id: number) => {
const newList = [...currentIdIsInLoading];
newList.push(id);
setCurrentIdIsInLoading(newList)
const { data, code } = await PublicApi.postMemberRectifyManageRectify({id: id});
setCurrentIdIsInLoading((prev) => prev.filter((_item) => _item !== id));
if (code === 1000) {
ref.current?.submit();
}
}, [currentIdIsInLoading])
return (
<Card>
<CustomizeQueryList
ref={ref}
columns={columns}
schema={querySchema}
fetchListData={handleFetch}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions,'name', FORM_FILTER_PATH,);
useAsyncSelect('status', fetchStatusOptions);
}}
/>
</Card>
)
}
export default List
import { FORM_FILTER_PATH } from "@/formSchema/const";
import { ISchema } from "@formily/antd";
export const querySchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索会员名称',
align: 'flex-left',
tip: '输入会员名称进行搜索',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 3,
},
properties: {
subject: {
type: 'string',
'x-component-props': {
placeholder: '考评主题',
allowClear: true,
style: {
width: 160,
},
},
},
'[rectifyDayStart,rectifyDayEnd]': {
type: 'daterange',
'x-component-props': {
placeholder: ['考评开始时间', '考评完成时间'],
allowClear: true,
style: {
width: 240,
},
},
},
status: {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '外部状态',
allowClear: true,
style: {
width: 160,
},
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
export const rectificationReportSchema: ISchema = {
type: "object",
properties: {
tabs: {
type: "object",
"x-component": "tab",
properties: {
"tab-1": {
type: "object",
"x-component": "tabpane",
"x-component-props": {
"tab": "基本信息"
},
properties: {
layout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 10,
labelAlign: 'left'
},
properties: {
reportDigest: {
title: '摘要',
type: 'textarea',
'x-rules': [
{
limitByte: true, // 自定义校验规则
maxByte: 120
}
],
'x-component-props': {
placeholder: '最长120个字符,60个汉字'
}
},
reportAttachments: {
title: '考察要求附件',
type: 'object',
'x-component': 'FormilyUploadFiles',
}
}
}
}
},
}
}
}
}
import { ColumnsType } from 'antd/es/table';
export const outerColumns: ColumnsType<any> = [
{
title: "流转顺序号",
dataIndex: 'id',
},
{
title: '操作角色',
dataIndex: "operatorRoleName"
},
{
title: '状态',
dataIndex: "outerStatusName"
},
{
title: "操作",
dataIndex: "operation"
},
{
title: '操作时间',
dataIndex: "createTime"
},
{
title: '备注',
dataIndex: "remark"
},
];
export const innerColumns: ColumnsType<any> = [
{
title: "流转记录",
dataIndex: "id"
},
{
title: "操作人",
dataIndex: "operatorName"
},
{
title: "部门",
dataIndex: 'operatorOrgName'
},
{
title: '职位',
dataIndex: "operatorJobTitle"
},
{
title: '状态',
dataIndex: 'innerStatusName '
},
{
title: '操作',
dataIndex: 'operation'
},
{
title: "操作时间",
dataIndex: "createTime"
},
{
title: "审核意见",
dataIndex: 'remark'
}
]
import React from 'react';
import { ColumnsType } from 'antd/es/table';
import { Link } from 'umi';
import StatusTag from '@/components/StatusTag';
/**
* 列表页column
*/
const OuterStatusType = ['success', 'warning', 'default', 'danger', 'primary', 'nobility'];
const listColumns: ColumnsType<any> = [
{
title: '修改单号/主题',
dataIndex: 'no',
render: (text, record) => {
return (
<div>
<span>RN0001</span>
<span>MX20物料未达标</span>
</div>
)
}
title: '会员名称',
dataIndex: 'name',
},
{
title: '会员名称',
dataIndex: 'memberName',
title: '整改期限开始日期',
dataIndex: 'rectifyDayStart',
sorter: (a, b) => a.rectifyDayStart - b.rectifyDayStart,
},
{
title: '整改开始日期',
dataIndex: 'startTime',
sorter: (a, b) => a.startTime - b.startTime,
title: '整改期限截止日期',
dataIndex: 'rectifyDayEnd',
sorter: (a, b) => a.rectifyDayEnd - b.rectifyDayEnd,
},
{
title: '整改结束日期',
dataIndex: 'endTime',
sorter: (a, b) => a.endTime - b.endTime,
title: '整改结果',
dataIndex: 'result',
},
{
title: '外部状态',
dataIndex: 'outerStatus'
dataIndex: 'outerStatusName',
render: (text, record) => {
const offset = record.status % OuterStatusType.length;
return <StatusTag type={OuterStatusType[offset] as 'success'} title={record.outerStatusName} />
}
}
]
export default listColumns;
export const setColumnsByLinks = (link?: { [key: string]: string }) => {
const linksColumns: ColumnsType<any> = [
{
title: '整改单号/主题',
dataIndex: 'des',
render: (text, record) => {
return (
<div style={{ display: 'flex', flexDirection: 'column', }}>
{
link?.['detail'] && (
<Link to={`${link?.['detail']}?id=${record.id}`}>{record.rectifyNo}</Link>
) || (
<span>{record.id}</span>
)
}
<p>{record.subject}</p>
</div>
)
}
},
]
return linksColumns.concat(listColumns);
}
// export default listColumns;
import React, { useMemo, useState } from 'react';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { ColumnsType } from 'antd/es/table';
import { PublicApi } from '@/services/api';
export default function useColumns<T>(columnsList: ColumnsType<T>, actionColumn?: ColumnsType<T> ) {
type OptionType = {
label: string,
value: string
}
/**
* 我分成每个模块都有一个column的hook, 合并action 列以及 状态列筛选列,这里请求方法直接写死算了
* 但其实可以把整个hook提取出来,整成公用的
* @param columnsList
* @param actionColumn
* @returns
*/
export default function useColumns<T>(columnsList: ColumnsType<T>, actionColumn?: ColumnsType<T>, options?: { [key: string]: any } ) {
const [columns, setColumns] = useState(() => {
return columnsList.concat(actionColumn || []);
});
const [statusOptions, setStatusOptions] = useState<OptionType[]>([]);
const defaultOptions = useMemo(() => options, [options])
const fetchStatusOptions = useCallback(async () => {
const defaultApi = defaultOptions && defaultOptions.fetchStatusListApi || PublicApi.getMemberRectifySummaryStatusList
const { code, data } = await defaultApi();
if (code === 1000) {
const formatedData = data.map((_item) => ({label: _item.message, value: _item.code}));
setStatusOptions(formatedData)
return formatedData
}
return [];
}, [defaultOptions])
const setColumnsWithFilterOption = (optionMap: {[key: string]: {text: string, value: string}[]}) => {
const newColumns = [...columns];
const keys = Object.keys(optionMap);
newColumns.forEach((_item: ColumnsType<T>[0] & {dataIndex: string}) => {
if(_item.dataIndex && keys.includes(_item.dataIndex)) {
_item.filters = optionMap[_item.dataIndex];
}
})
setColumns(newColumns);
}
useEffect(() => {
if(statusOptions.length === 0) {
return ;
}
const mapKeys = {
status: statusOptions,
}
const keys = Object.keys(mapKeys) || []
const map = {};
keys.forEach((_item: "status") => {
map[_item] = mapKeys[_item].map((_row) => ({ text: _row.label, ..._row }))
})
setColumnsWithFilterOption(map)
}, [statusOptions])
const cacheColumns = useMemo(() => columns, [columns])
return { columns: cacheColumns, setColumns };
return { columns: cacheColumns, setColumns, fetchStatusOptions };
}
import { GetMemberRectifyWaitAddGetResponse } from '@/services/MemberV2Api';
import React from 'react';
import { useMemo } from "react";
type Info = {
reportDigest?: string,
agreeResult?: 0 | 1,
resultRemark?: string
reportAttachments?: {
name: string,
url: string
}[]
}
function useGetDetailCommon({ initialValue }) {
function useGetDetailCommon({ initialValue }: { initialValue: GetMemberRectifyWaitAddGetResponse & Info }) {
const basicInfo = useMemo(() => {
return [
{
title: '整改单号',
value: '123'
value: initialValue?.id
},
{
title: "会员名称",
value: '温州皮革厂'
value: initialValue?.name
},
{
title: '整改要求',
value: '合格率达到90%'
value: initialValue?.require
},
{
title: '整改主题',
value: 'Mx20为达标'
value: initialValue?.subject
},
{
title: "整改期限",
value: '2020-12-01'
value: (
<div>
{initialValue?.rectifyDayStart}{initialValue?.rectifyDayEnd}
</div>
)
},
{
title: "整改文件",
value: (
<div>123</div>
<div style={{display: 'flex', flexDirection: 'column'}}>
{
initialValue?.attachments?.map((_item) => {
return (
<a key={_item.url} href={_item.url}>{_item.name}</a>
)
})
}
</div>
)
},
{
title: "外部状态",
value: (
<div>确认整改结果通过</div>
<div>
{
initialValue && initialValue?.outerVerifySteps?.[initialValue.currentOuterStep]?.['stepName']
}
</div>
)
},
{
title: "整改原因",
value: (
<div>质检部门</div>
)
value: initialValue?.reason
}
]
}, [initialValue])
......@@ -50,12 +74,20 @@ function useGetDetailCommon({ initialValue }) {
return [
{
title: '摘要',
value: '123'
value: initialValue?.reportDigest
},
{
title: '整改报告文件',
value: (
<div>123</div>
<div style={{display: 'flex', flexDirection: 'column'}}>
{
initialValue?.reportAttachments?.map((_item) => {
return (
<a key={_item.url} href={_item.url}>{_item.name}</a>
)
})
}
</div>
)
}
]
......@@ -65,11 +97,11 @@ function useGetDetailCommon({ initialValue }) {
return [
{
title: '修改结果',
value: '123'
value: initialValue?.agreeResult ? '整改通过' : '整改不通过'
},
{
title: '结果原因',
value: '整改通过'
value: initialValue?.resultRemark
}
]
}, [initialValue])
......
......@@ -23,13 +23,13 @@ export const rectificationAddSchema: ISchema = {
labelAlign: 'left'
},
properties: {
theme: {
title: '考评主题',
subject: {
title: '整改主题',
type: 'string',
'x-rules': [
{
required: true,
message: '请填写通知单摘要'
message: '请填写整改主题'
},
{
limitByte: true, // 自定义校验规则
......@@ -40,42 +40,81 @@ export const rectificationAddSchema: ISchema = {
placeholder: '最长60个字符,30个汉字'
}
},
// memberName: {
// title: '会员名称',
// type: 'string',
// "x-component-props": {
// disabled: true,
// addonAfter: "{{connectMember}}"
// },
// "x-rules": [
// {
// required: true,
// message: '请选择会员名称'
// }
// ],
// },
date: {
name: {
title: '会员名称',
type: 'string',
"x-component-props": {
disabled: true,
addonAfter: "{{connectMember}}"
},
"x-rules": [
{
required: true,
message: '请选择会员名称'
}
],
},
subMemberId: {
title: '会员id',
type: "string",
display: false,
},
subRoleId: {
title: '会员roldid',
type: "string",
display: false,
},
'[rectifyDayStart, rectifyDayEnd]': {
type: 'object',
title: "考察范围",
title: "整改期限",
'x-component': "FormilyRangeTime",
"x-rules": [
{
required: true,
message: '请选择考察范围'
message: '请选择整改期限'
}
],
},
completeDate: {
title: '考评完成时间',
type: 'date',
reason: {
title: '整改原因',
type: 'textarea',
"x-component-props": {
style: {
width: '100%'
}
},
'x-rules': [
{
required: true,
message: '请填写整改原因'
},
{
limitByte: true, // 自定义校验规则
maxByte: 120
}
],
},
require: {
title: '整改要求',
type: 'textarea',
"x-component-props": {
style: {
width: '100%'
}
},
'x-rules': [
{
required: true,
message: '请填写整改要求'
},
{
limitByte: true, // 自定义校验规则
maxByte: 120
}
],
},
files: {
attachments: {
title: '考察要求附件',
type: 'object',
'x-component': 'FormilyUploadFiles',
......
......@@ -44,7 +44,7 @@ export const rectificationListSchema: ISchema = {
},
},
properties: {
theme: {
subject: {
type: 'string',
'x-component-props': {
placeholder: '修改主题',
......@@ -54,7 +54,7 @@ export const rectificationListSchema: ISchema = {
},
},
},
time: {
'[rectifyDayStart, rectifyDayEnd]': {
type: 'daterange',
default: undefined,
'x-component-props': {
......
import React, { useEffect, useState } from 'react';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { Card, Button } from 'antd';
import { history } from 'umi';
import { history, Prompt } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { LinkOutlined, SaveOutlined } from '@ant-design/icons';
import SchemaForm, { createFormActions } from '@formily/antd';
import SchemaForm, { createFormActions, FormEffectHooks } from '@formily/antd';
import ReutrnEle from '@/components/ReturnEle';
import NiceForm from '@/components/NiceForm';
import { rectificationAddSchema } from '../common/schema/add';
import FormilyUploadFiles from '@/components/UploadFiles/FormilyUploadFiles'
import FormilyRangeTime from '@/components/RangeTime/FormilyRangeTime';
import TableModal from '../../components/TableModal';
import useModal from '../../memberEvaluate/hooks/useModal';
import { PublicApi } from '@/services/api';
import { useGetCommonSubMember } from '../../common/hooks/useGetCommonSubMember';
import { GetMemberInspectMembersResponse, GetMemberRectifyWaitAddGetResponse, } from '@/services/MemberV2Api';
import { Moment } from 'moment';
import { usePageStatus } from '@/hooks/usePageStatus';
import useInitialValue from '../../common/hooks/useInitialValue';
import moment from 'moment';
const {
onFormInputChange$,
} = FormEffectHooks;
type SubmitData = {
/**
* 选择会员信息
*/
name: string,
subRoleId: number,
subMemberId: number,
reason: string,
require: string,
rectifyDayStart: Moment,
rectifyDayEnd: Moment,
subject: string,
attachments: {
name: string,
url: string,
}[]
}
const formActions = createFormActions()
const format = 'YYYY-MM-DD';
const InspectionAdd = (props) => {
const { location } = props;
const { visible, toggle } = useModal()
const { memberColumns, memberSchema, handleFetchData } = useGetCommonSubMember(PublicApi.getMemberInspectMembers)
const [memberModalValue, setMemberModalValue] = useState([])
const [submitLoading, setSubmitLoading] = useState<boolean>(false)
const InspectionAdd = () => {
const [initialValue, setInitialValue] = useState({
files: [{
uid: '3',
name: 'zzz.png',
url: 'http://www.baidu.com/zzz.png',
}],
completeDate: '2021-05-20',
});
// useEffect(() => {
// async function init() {
// return new Promise<void>((resolve) => {
// setTimeout(() => {
// setInitialValue({
// files: [
// {
// uid: '3',
// name: 'zzz.png',
// url: 'http://www.baidu.com/zzz.png',
// },
// ],
// })
// resolve()
// }, 3000)
// })
// }
// init()
// }, [])
const isPreview = location.pathname.includes('/memberCenter/memberAbility/memberRectification/rectificationAdd/view');
const { id } = usePageStatus();
const isEdit = useMemo(() => id && typeof id === 'string', [id]);
const params = useMemo(() => { return id ? { id: id.toString() } : null }, [id]);
const { loading, initialValue }= useInitialValue<GetMemberRectifyWaitAddGetResponse, { id: string }>(PublicApi.getMemberRectifyWaitAddGet, params)
const [unsaved, setUnsaved] = useState(false);
const handleSubmit = (value: any) => {
console.log(value);
/**
* 格式化初始化值
*/
const formatedInitialValue = useMemo(() => {
if (!isEdit || !initialValue) {
return {}
}
const { rectifyDayStart, rectifyDayEnd, ...rest } = initialValue;
return {
rectifyDayStart: moment(rectifyDayStart, 'YYYY-MM-DD'),
rectifyDayEnd: moment(rectifyDayEnd, 'YYYY-MM-DD'),
...rest,
}
}, [initialValue])
useEffect(() => {
if (initialValue) {
setMemberModalValue([{
subMemberId: initialValue.subMemberId,
subRoleId: initialValue.subRoleId,
name: initialValue.name
}])
}
}, [initialValue])
const handleSubmit = useCallback(async (value: SubmitData) => {
const { name, rectifyDayStart, rectifyDayEnd, attachments, ...rest } = value;
const tempPostData = {
rectifyDayStart: rectifyDayStart.format(format),
rectifyDayEnd: rectifyDayEnd.format(format),
attachments: attachments?.map((_row) => ({
name: _row.name,
url: _row.url
})),
...rest,
}
setSubmitLoading(() => true)
const service = isEdit ? PublicApi.postMemberRectifyWaitAddUpdate : PublicApi.postMemberRectifyWaitAddAdd;
const postData = isEdit ? { ...tempPostData, id: id } : tempPostData
const { data, code } =await service(postData);
setSubmitLoading(() => false)
setUnsaved(() => false)
if (code === 1000) {
history.goBack()
}
}, [isEdit, id])
const handleOnOk = (selectRowKeys: string[] | number[], selectRowRecord: GetMemberInspectMembersResponse["data"] ) => {
const target = selectRowRecord[0];
formActions.setFieldValue('tabs.tab-1.layout.name', target.name)
formActions.setFieldValue('tabs.tab-1.layout.subMemberId', target.subMemberId);
formActions.setFieldValue('tabs.tab-1.layout.subRoleId', target.subRoleId);
setMemberModalValue(selectRowRecord)
toggle(false)
}
const titleRender = () => {
if (isPreview) {
return "查看整改通知单"
}
if(isEdit) {
return "修改整改通知单"
}
return "新增整改通知到哪"
}
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
title="生产通知单"
title={titleRender()}
extra={
(
<Button
key={1}
type="primary"
icon={<SaveOutlined />}
// loading={submitLoading}
onClick={() => formActions.submit()}
>
!isPreview && (
<Button type="primary" loading={submitLoading} icon={<SaveOutlined />} onClick={() => formActions.submit()}>
保存
</Button>
)
......@@ -67,22 +141,43 @@ const InspectionAdd = () => {
<Card>
<NiceForm
onSubmit={handleSubmit}
editable={true}
value={initialValue}
editable={!isPreview}
initialValues={formatedInitialValue}
schema={rectificationAddSchema}
actions={formActions}
components={{FormilyUploadFiles, FormilyRangeTime}}
expressionScope={{
connectMember: (
<div>
connectMember: !isPreview ? (
<div onClick={() => toggle(true)}>
<LinkOutlined style={{marginRight: 4}}/>
选择
</div>
)
) : null
}}
effects={() => {
onFormInputChange$().subscribe(() => {
if (!unsaved) {
setUnsaved(true);
}
});
}}
effects={() => {}}
/>
</Card>
<TableModal
visible={visible}
onClose={() => toggle(false)}
title={"选择会员"}
columns={memberColumns}
schema={memberSchema}
onOk={handleOnOk}
fetchData={handleFetchData}
tableProps={{
rowKey: (record) => `${record.subMemberId}_${record.subRoleId}`,
}}
mode={"radio"}
value={memberModalValue}
/>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
</PageHeaderWrapper>
)
}
......
import React, { useMemo } from 'react';
import { Spin, Card, Table, Button } from 'antd';
import AnchorPage from '@/layouts/AnchorPage';
import CustomizeColumn from '@/components/CustomizeColumn';
import AuditProcess from '@/components/AuditProcess';
import { PublicApi } from '@/services/api';
import theme from '../../../../../config/lingxi.theme.config';
import useGetAnchorHeader from '../common/hooks/useGetAnchorHeader';
import useGetDetailCommon from '../common/hooks/useGetDetailCommon';
import { usePageStatus } from '@/hooks/usePageStatus';
import useInitialValue from '@/pages/handling/common/hooks/useInitialValue';
import { GetMemberRectifyWaitAddGetResponse } from '@/services/MemberV2Api';
import { findLastIndexFlowState } from '@/utils';
import FlowRecords from '@/components/FlowRecords';
import { innerColumns, outerColumns } from '../common/columns/historyColumn'
const rectificationAddDetail = () => {
const { headers } = useGetAnchorHeader(["editInfo", "result"])
const { id } = usePageStatus();
const params = useMemo(() => { return id ? { id: id.toString() } : null }, [id]);
const { loading, initialValue }= useInitialValue<GetMemberRectifyWaitAddGetResponse, { id: string }>(PublicApi.getMemberRectifyWaitAddGet, params)
const { basicInfo, editInfo, resultInfo } = useGetDetailCommon({initialValue})
return (
<Spin spinning={loading}>
<AnchorPage
title={initialValue?.subject}
anchors={headers}
>
<AuditProcess
outerVerifySteps={
initialValue && initialValue.outerVerifySteps ?
initialValue.outerVerifySteps.map(item => ({
step: item.step,
stepName: item.stepName,
roleName: item.roleName,
status: initialValue?.currentOuterStep > item.step ? 'finish' : 'wait',
})) :
[]
}
outerVerifyCurrent={findLastIndexFlowState(initialValue?.outerVerifySteps)}
id="progress"
/>
<div id="basicInfo" style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn data={basicInfo} title="基本信息" column={3} />
</div>
{/* <div id="editInfo" style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn data={editInfo} title="整改信息" column={1} />
</div>
<div id="result" style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn data={resultInfo} title="整改结果" column={1} />
</div> */}
<div id="record">
<FlowRecords
innerRowkey="id"
innerColumns={innerColumns as any}
innerDataSource={initialValue?.innerHistory}
outerRowkey="id"
outerColumns={outerColumns as any}
outerDataSource={initialValue?.outerHistory}
/>
</div>
</AnchorPage>
</Spin>
)
}
export default rectificationAddDetail
import React from 'react';
import { Card, Space, Button } from 'antd'
import queryColumns from '../common/columns/queryColumns';
import React, { useCallback, useRef, useState } from 'react';
import { Card, Space, Button, Spin } from 'antd'
import { setColumnsByLinks } from '../common/columns/queryColumns';
import { rectificationListSchema } from '../common/schema';
import useFetchList from '../../memberEvaluate/hooks/useFetchList';
import { PlusOutlined } from '@ant-design/icons';
......@@ -10,16 +10,42 @@ import { PublicApi } from '@/services/api';
import CustomizeQueryList from '../../components/CustomizeQueryList';
import { Link } from 'umi';
import useColumns from '../common/hooks/useColumns';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
interface Iprops {};
const queryColumns = setColumnsByLinks({
detail: '/memberCenter/memberAbility/memberRectification/rectificationAdd/view'
})
const List: React.FC<Iprops> = (props: Iprops) => {
const { fetchListData } = useFetchList();
const { columns } = useColumns(queryColumns)
const ref = useRef<any>({});
const [ currentIdIsInLoading, setCurrentIdIsInLoading ] = useState<number[]>([])
const { columns, fetchStatusOptions } = useColumns(queryColumns, [
{
title: "操作",
render: (text, record) => {
const {sendOrUpdateOrDel} = record;
const loading = currentIdIsInLoading.includes(record.id)
return (
<Space>
<Spin spinning={loading}>
<a onClick={() => handleSendNotice(record.id, "send")}>发送整改通知</a>
</Spin>
<Link to={`/memberCenter/memberAbility/memberRectification/rectificationAdd/edit?id=${record.id}`}>修改</Link>
<Spin spinning={loading}>
<a onClick={() => handleSendNotice(record.id, "remove")}>删除</a>
</Spin>
</Space>
)
}
}
])
const controllerBtns = (
<div>
<Link to={"/memberCenter/memberAbility/memberEvaluate/evaluate/createEvaluate/add"}>
<Link to={"/memberCenter/memberAbility/memberRectification/rectificationAdd/add"}>
<Button type="primary" icon={<PlusOutlined />}>
新建
</Button>
......@@ -27,14 +53,27 @@ const List: React.FC<Iprops> = (props: Iprops) => {
</div>
)
const handleSendNotice = useCallback(async(id: number, type: "send" | 'remove') => {
const newList = [...currentIdIsInLoading];
newList.push(id);
setCurrentIdIsInLoading(newList)
const service = type === 'send' ? PublicApi.postMemberRectifyWaitAddSend : PublicApi.postMemberRectifyWaitAddDelete
const { data, code } = await service({id: id});
setCurrentIdIsInLoading((prev) => prev.filter((_item) => _item !== id));
if (code === 1000) {
ref.current?.submit();
}
}, [currentIdIsInLoading])
const handleFetch = async (params) => {
const result = fetchListData(PublicApi.getMemberAbilitySubPage, params);
const result = fetchListData(PublicApi.getMemberRectifyWaitAddPage, params);
return result
}
return (
<Card>
<CustomizeQueryList
ref={ref}
columns={columns}
schema={rectificationListSchema}
fetchListData={handleFetch}
......@@ -43,6 +82,7 @@ const List: React.FC<Iprops> = (props: Iprops) => {
}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'name', FORM_FILTER_PATH);
useAsyncSelect('status', fetchStatusOptions);
}}
/>
</Card>
......
import React from 'react';
import React, { useMemo } from 'react';
import { Spin, Card, Table, Button } from 'antd';
import { CheckCircleOutlined } from '@ant-design/icons';
import AnchorPage from '@/layouts/AnchorPage';
import CustomizeColumn from '@/components/CustomizeColumn';
import AuditProcess from '@/components/AuditProcess';
import { PublicApi } from '@/services/api';
// import { projectColumns, recordColumn } from '../columns/detail';
// import useGetDetailCommon from '../hooks/useGetDetailCommon';
// import useFetchInfo from '../hooks/useFetchInfo';
// import useModal from '../hooks/useModal';
import theme from '../../../../../config/lingxi.theme.config';
import ExamVerify, { SubmitDataTypes } from '@/components/ExamVerify';
import useFetchInfo from '../../memberEvaluate/hooks/useFetchInfo';
import useGetAnchorHeader from '../common/hooks/useGetAnchorHeader';
import useGetDetailCommon from '../common/hooks/useGetDetailCommon';
import { usePageStatus } from '@/hooks/usePageStatus';
import useInitialValue from '@/pages/handling/common/hooks/useInitialValue';
import { GetMemberRectifyWaitAddGetResponse } from '@/services/MemberV2Api';
import { findLastIndexFlowState } from '@/utils';
import FlowRecords from '@/components/FlowRecords';
import { innerColumns, outerColumns } from '../common/columns/historyColumn'
const TobeEvaluateDetail = () => {
const { initialValue } = useFetchInfo(PublicApi.getMemberAbilitySubGet, { id: 1})
const { headers } = useGetAnchorHeader()
const rectificationAddDetail = () => {
const { headers } = useGetAnchorHeader(["editInfo", "result"])
const { id } = usePageStatus();
const params = useMemo(() => { return id ? { id: id.toString() } : null }, [id]);
const { loading, initialValue }= useInitialValue<GetMemberRectifyWaitAddGetResponse, { id: string }>(PublicApi.getMemberRectifyWaitAddGet, params)
const { basicInfo, editInfo, resultInfo } = useGetDetailCommon({initialValue})
const onSubmitRes = () => {
}
const outerVerifySteps = useMemo(() => {
if (!initialValue?.outerVerifySteps) {
return []
}
return initialValue.outerVerifySteps.map(item => ({
step: item.step,
stepName: item.stepName,
roleName: item.roleName,
status: (initialValue?.currentOuterStep > item.step ? 'finish' : 'wait') as 'finish' | 'wait',
}))
}, [initialValue])
return (
<Spin spinning={false}>
<Spin spinning={loading}>
<AnchorPage
title={`温州市隆昌皮业有限公式`}
title={initialValue?.subject}
anchors={headers}
>
<AuditProcess title="流转进度" id="progress" />
<div style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn id="detail" data={basicInfo} title="基本信息" column={3} />
<AuditProcess
outerVerifySteps={outerVerifySteps}
outerVerifyCurrent={findLastIndexFlowState(initialValue?.outerVerifySteps)}
id="progress"
/>
<div id="basicInfo" style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn data={basicInfo} title="基本信息" column={3} />
</div>
<div style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn id="result" data={editInfo} title="整改信息" column={1} />
<div id="editInfo" style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn data={editInfo} title="整改信息" column={1} />
</div>
<div id="result" style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn data={resultInfo} title="整改结果" column={1} />
</div>
<div style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn id="result" data={resultInfo} title="整改结果" column={1} />
<div id="record">
<FlowRecords
innerRowkey="id"
innerColumns={innerColumns as any}
innerDataSource={initialValue?.innerHistory}
outerRowkey="id"
outerColumns={outerColumns as any}
outerDataSource={initialValue?.outerHistory}
/>
</div>
{/* <div style={{ margin: `${theme["@margin-md"]} 0` }}>
<Card title="流转记录" id="record" extra={<Button>内部流转</Button>}>
<Table columns={recordColumn}></Table>
</Card>
</div> */}
</AnchorPage>
</Spin>
)
}
export default TobeEvaluateDetail
export default rectificationAddDetail
import React from 'react';
import { Card, Space, Button } from 'antd'
import queryColumns from '../common/columns/queryColumns';
import { setColumnsByLinks } from '../common/columns/queryColumns';
import { rectificationListSchema } from '../common/schema';
import useFetchList from '../../memberEvaluate/hooks/useFetchList';
import { PlusOutlined } from '@ant-design/icons';
......@@ -10,25 +10,28 @@ import { PublicApi } from '@/services/api';
import CustomizeQueryList from '../../components/CustomizeQueryList';
import { Link } from 'umi';
import useColumns from '../common/hooks/useColumns';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
interface Iprops {};
const queryColumns = setColumnsByLinks({
detail: '/memberCenter/memberAbility/memberRectification/rectification/detail'
})
const List: React.FC<Iprops> = (props: Iprops) => {
const { fetchListData } = useFetchList();
const { columns } = useColumns(queryColumns)
const { columns, fetchStatusOptions } = useColumns(queryColumns)
const controllerBtns = (
<div>
<Link to={"/memberCenter/memberAbility/memberEvaluate/evaluate/createEvaluate/add"}>
<Button type="primary">
<PlusOutlined /> 新建
</Button>
<Link to={"/memberCenter/memberAbility/memberRectification/rectificationAdd/add"}>
<Button type="primary" icon={<PlusOutlined />}>新建</Button>
</Link>
</div>
)
const handleFetch = async (params) => {
const result = fetchListData(PublicApi.getMemberAbilitySubPage, params);
const result = fetchListData(PublicApi.getMemberRectifySummaryPage, params);
return result
}
......@@ -42,12 +45,8 @@ const List: React.FC<Iprops> = (props: Iprops) => {
controllerBtns,
}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'name',
FORM_FILTER_PATH,
);
useStateFilterSearchLinkageEffect($, actions,'name', FORM_FILTER_PATH,);
useAsyncSelect('status', fetchStatusOptions);
}}
/>
</Card>
......
import React from 'react';
import React, { useMemo, useState } from 'react';
import { Spin, Card, Table, Button, Drawer } from 'antd';
import AnchorPage from '@/layouts/AnchorPage';
import CustomizeColumn from '@/components/CustomizeColumn';
import AuditProcess from '@/components/AuditProcess';
import { PublicApi } from '@/services/api';
import theme from '../../../../../config/lingxi.theme.config';
import ExamVerify, { SubmitDataTypes } from '@/components/ExamVerify';
import useFetchInfo from '../../memberEvaluate/hooks/useFetchInfo';
import useGetAnchorHeader from '../common/hooks/useGetAnchorHeader';
import useGetDetailCommon from '../common/hooks/useGetDetailCommon';
import useModal from '../../memberEvaluate/hooks/useModal';
import SchemaForm, { createFormActions } from '@formily/antd';
import NiceForm from '@/components/NiceForm';
import confirmEditResultSchema from './schema';
import { GetMemberRectifyWaitAddGetResponse } from '@/services/MemberV2Api';
import { usePageStatus } from '@/hooks/usePageStatus';
import useInitialValue from '../../common/hooks/useInitialValue';
import FlowRecords from '@/components/FlowRecords';
import { innerColumns, outerColumns } from '../common/columns/historyColumn'
import { findLastIndexFlowState } from '@/utils';
import { history } from 'umi';
const formActions = createFormActions()
const TobeEvaluateDetail = () => {
const { initialValue } = useFetchInfo(PublicApi.getMemberAbilitySubGet, { id: 1})
const { visible, toggle } = useModal();
const { headers } = useGetAnchorHeader()
const { basicInfo, editInfo, resultInfo } = useGetDetailCommon({initialValue})
const { headers } = useGetAnchorHeader(["editInfo", "result"])
const { id } = usePageStatus();
const params = useMemo(() => { return id ? { id: id.toString() } : null }, [id]);
const { loading, initialValue }= useInitialValue<GetMemberRectifyWaitAddGetResponse, { id: string }>(PublicApi.getMemberRectifyWaitAddGet, params)
const { basicInfo, editInfo, resultInfo } = useGetDetailCommon({initialValue});
const [submitLoading, setSubmitLoading] = useState<boolean>(false);
const outerVerifySteps = useMemo(() => {
if (!initialValue?.outerVerifySteps) {
return []
}
return initialValue.outerVerifySteps.map(item => ({
step: item.step,
stepName: item.stepName,
roleName: item.roleName,
status: (initialValue?.currentOuterStep > item.step ? 'finish' : 'wait') as 'finish' | 'wait',
}))
}, [initialValue])
const onSubmitRes = () => {
// formActions.submit()
toggle(true);
formActions.submit()
}
const handleSubmit = (value: { result: string, reason: string }) => {
console.log(value);
const handleSubmit = async (value: { result: 0 | 1, reason: string }) => {
setSubmitLoading(true)
const { data, code } = await PublicApi.postMemberRectifyWaitConfirmConfirm({
id: id,
agree: value.result,
reason: value.reason
})
setSubmitLoading(false)
if (code === 1000) {
toggle(false);
history.goBack();
}
}
return (
<Spin spinning={false}>
<Spin spinning={loading}>
<AnchorPage
title={`温州市隆昌皮业有限公式`}
title={initialValue?.subject}
anchors={headers}
extra={
<Button type="primary" onClick={onSubmitRes}>确认整改结果</Button>
<Button type="primary" onClick={() => toggle(true)}>提交</Button>
}
>
<AuditProcess title="流转进度" id="progress" />
<div style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn id="detail" data={basicInfo} title="基本信息" column={3} />
<AuditProcess
outerVerifySteps={outerVerifySteps}
outerVerifyCurrent={findLastIndexFlowState(initialValue?.outerVerifySteps)}
id="progress"
/>
<div id="basicInfo" style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn data={basicInfo} title="基本信息" column={3} />
</div>
<div style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn id="result" data={editInfo} title="整改信息" column={1} />
<div id="editInfo" style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn data={editInfo} title="整改信息" column={1} />
</div>
<div style={{ margin: `${theme["@margin-md"]} 0` }}>
<CustomizeColumn id="result" data={resultInfo} title="整改结果" column={1} />
<div id="record">
<FlowRecords
innerRowkey="id"
innerColumns={innerColumns as any}
innerDataSource={initialValue?.innerHistory}
outerRowkey="id"
outerColumns={outerColumns as any}
outerDataSource={initialValue?.outerHistory}
/>
</div>
{/* <div style={{ margin: `${theme["@margin-md"]} 0` }}>
<Card title="流转记录" id="record" extra={<Button>内部流转</Button>}>
<Table columns={recordColumn}></Table>
</Card>
</div> */}
</AnchorPage>
<Drawer
visible={visible}
......@@ -65,9 +99,9 @@ const TobeEvaluateDetail = () => {
footer={
<div style={{ textAlign: 'right'}}>
<Button onClick={() => toggle(false)} style={{ marginRight: 8 }}>
奇效
取消
</Button>
<Button onClick={() => toggle(true)} type="primary">
<Button loading={submitLoading} onClick={onSubmitRes} type="primary">
提交
</Button>
</div>
......
import React from 'react';
import { Card, Space, Button } from 'antd'
import queryColumns from '../common/columns/queryColumns';
import { setColumnsByLinks } from '../common/columns/queryColumns';
import { querySchema } from './schema';
import useFetchList from '../../memberEvaluate/hooks/useFetchList';
import { PlusOutlined } from '@ant-design/icons';
......@@ -10,15 +10,32 @@ import { PublicApi } from '@/services/api';
import CustomizeQueryList from '../../components/CustomizeQueryList';
import { Link } from 'umi';
import useColumns from '../common/hooks/useColumns';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
interface Iprops {};
const queryColumns = setColumnsByLinks({
detail: '/memberCenter/memberAbility/memberRectification/tobeConfirmRectification/detail'
})
const List: React.FC<Iprops> = (props: Iprops) => {
const { fetchListData } = useFetchList();
const { columns } = useColumns(queryColumns)
const { columns, fetchStatusOptions } = useColumns(queryColumns, [
{
title: "操作",
render: (text, record) => {
const {sendOrUpdateOrDel} = record;
return (
<Space>
<Link to={`/memberCenter/memberAbility/memberRectification/tobeConfirmRectification/detail?id=${record.id}`}>确认</Link>
</Space>
)
}
}
])
const handleFetch = async (params) => {
const result = fetchListData(PublicApi.getMemberAbilitySubPage, params);
const result = fetchListData(PublicApi.getMemberRectifyWaitConfirmPage, params);
return result
}
......@@ -29,12 +46,8 @@ const List: React.FC<Iprops> = (props: Iprops) => {
schema={querySchema}
fetchListData={handleFetch}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'name',
FORM_FILTER_PATH,
);
useStateFilterSearchLinkageEffect($, actions,'name', FORM_FILTER_PATH,);
useAsyncSelect('status', fetchStatusOptions);
}}
/>
</Card>
......
......@@ -16,6 +16,10 @@ const confirmEditResultSchema: ISchema = {
result: {
title: '整改结果',
type: 'string',
enum: [
{ label: '整改不通过', value: 0},
{ label: "整改通过", value: 1 }
],
'x-rules': [
{
required: true,
......
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