Commit 3e41d090 authored by Bill's avatar Bill

fix: 修改考评bug

parent 5bf0a9d0
......@@ -58,13 +58,13 @@ const memberCenterRoute = {
noMargin: true,
name: '修改个人信息'
},
// {
// path: `/memberCenter/home`,
// name: 'home',
// icon: 'home',
// key: 'home',
// component: '@/pages/home',
// },
{
path: `/memberCenter/home`,
name: 'home',
icon: 'home',
key: 'home',
component: '@/pages/home',
},
// ShopRoute,
// CommodityRoute,
// srm开发临时使用...
......@@ -75,9 +75,9 @@ const memberCenterRoute = {
// contracRoute,
//...
// AuthConfigRoute,
// MemberRoute,
// HandlingRoute,
...asyncRoutes,
MemberRoute,
HandlingRoute,
// ...asyncRoutes,
{
path: '/memberCenter/noAuth',
auth: false,
......
......@@ -581,6 +581,12 @@ const MemberRoute: RouterChild = {
hideInMenu: true,
},
{
path: '/memberCenter/memberAbility/memberEvaluate/createEvaluate/view',
name: '修改考评单',
component: '@/pages/member/memberEvaluate/createEvaluate/add',
hideInMenu: true,
},
{
path: '/memberCenter/memberAbility/memberEvaluate/createEvaluate/edit',
name: '修改考评单',
component: '@/pages/member/memberEvaluate/createEvaluate/add',
......
......@@ -3,7 +3,7 @@ import { Card, Space, Button } from 'antd'
import { StandardTable } from 'god';
import NiceForm from '@/components/NiceForm';
import useEvaluateColumn, { setColumnsByLinks } from '../hooks/useEvaluateColumn';
import { evaluationListSchema } from '../schema';
import { querySchema } from './schema';
import useFetchList from '../hooks/useFetchList';
import { createFormActions } from '@formily/antd';
import { PlusOutlined } from '@ant-design/icons';
......@@ -24,7 +24,12 @@ interface Iprops {};
const List: React.FC<Iprops> = (props: Iprops) => {
const { fetchListData } = useFetchList();
const { columns, fetchStatusOptions } = useEvaluateColumn<GetMemberAppraisalSummaryPageResponseDetail>(defaultColumns, [])
const { columns, fetchStatusOptions } = useEvaluateColumn<GetMemberAppraisalSummaryPageResponseDetail>(defaultColumns, [
{
title: "考评最终分",
dataIndex: "totalScore"
}
])
const controllerBtns = (
<div>
......@@ -45,7 +50,7 @@ const List: React.FC<Iprops> = (props: Iprops) => {
<Card>
<CustomizeQueryList
columns={columns}
schema={evaluationListSchema}
schema={querySchema}
fetchListData={handleFetch}
expressionScope={{
controllerBtns,
......
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
/**
* 会员考评页scheam
*/
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: 6,
},
properties: {
subject: {
type: 'string',
'x-component-props': {
placeholder: '考评主题',
allowClear: true,
style: {
width: 145,
},
},
},
'[appraisalDayStart,appraisalDayEnd]': {
type: 'daterange',
'x-component-props': {
placeholder: ['考评范围开始时间', '考评范围结束时间'],
allowClear: true,
style: {
width: 260,
},
},
},
status: {
type: 'string',
default: undefined,
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 scoringSchema: ISchema = {
type: 'object',
properties: {
items: {
"type": "array",
"x-component": "arraytable",
"x-component-props": {
// operations: false,
renderAddition: () => null,
renderRemove: () => null,
renderMoveDown: () => null,
renderMoveUp: () => null,
operations: false,
},
items: {
type: "object",
properties: {
id: {
title: "序号",
editable: false,
type: 'string',
"x-props": {
width: 65,
},
},
name: {
title: '考评项目',
type: 'string',
"x-component-props": {},
editable: false,
"x-props": {
width: 160,
}
},
content: {
title: '考评内容',
type: 'textarea',
editable: false,
'x-props': {
width: 424,
},
'x-component-props': {
row: 1,
style: {
height: 32,
}
}
},
'userName': {
title: "考评人",
type: 'string',
editable: false,
'x-props': {
width: 128,
},
// "x-component": "FormilySelectMember",
// "x-component-props": {
// children: '选择考评人'
// }
},
templates: {
title: '考评模板',
type: "object",
'x-component': 'FormilyUploadFiles',
'x-component-props': {
mode: 'link',
buttonText: '上传',
fileContainerClassName: 'customizeFileContainer'
},
editable: false,
"x-props": {
width: 180,
}
},
reports: {
title: '考评报告',
type: "object",
'x-component': 'FormilyUploadFiles',
'x-component-props': {
mode: 'link',
buttonText: '上传',
fileContainerClassName: 'customizeFileContainer'
},
"x-props": {
width: 180,
}
},
scoring: {
title: '考评计分',
type: 'string',
"x-props": {
width: 95,
},
'x-rules': [
{
required: true,
message: '请填写考评计分'
},
{
pattern: /^(?!0+(?:\.0+)?$)(?:[1-9]\d*|0)(?:\.\d{1,2})?$/,
message: '请填写数字,可保留两位小数'
}
],
"x-component-props": {}
},
}
}
}
}
}
......@@ -10,6 +10,7 @@ interface Iprops {
// handleFetch
// onOk: (selectRowKeys: string[] | number[], selectRowRecord: any[]) => void;
// fetchData: (params: any) => Promise<any>,
editable: boolean,
mutators: {
change: (params: any[]) => void
},
......@@ -21,7 +22,7 @@ const DEFAULT_RETURN_DATA = {
}
const EvaluateProject: React.FC<Iprops> & { isFieldComponent: boolean } = (props: Iprops) => {
const { value, mutators } = props;
const { value, mutators, editable } = props;
const { visible, toggle } = useModal();
const columns = useMemo(() => [
......@@ -46,7 +47,7 @@ const EvaluateProject: React.FC<Iprops> & { isFieldComponent: boolean } = (props
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
placeholder: '搜索评估项目',
tip: '输入 评估项目 进行搜索',
advanced: false,
},
......@@ -89,16 +90,17 @@ const EvaluateProject: React.FC<Iprops> & { isFieldComponent: boolean } = (props
mode={"checkbox"}
value={value}
/>
<div
style={{
display: editable ? 'flex' : 'none',
cursor: 'pointer',
width: '100%',
background: '#fbfbfb',
padding: '8px 0px',
display: "flex",
flexDirection: "row",
justifyContent: "center",
alignItems: "center"
alignItems: "center",
}}
onClick={() => toggle(true)}
>
......
......@@ -12,9 +12,9 @@ const memberSchema: ISchema = {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
placeholder: '搜索姓名',
align: 'flex-left',
tip: '输入用户名进行搜索',
tip: '输入名进行搜索',
},
},
[FORM_FILTER_PATH]: {
......@@ -24,7 +24,7 @@ const memberSchema: ISchema = {
grid: true,
full: true,
autoRow: true,
columns: 3,
columns: 4,
},
properties: {
orgName: {
......
......@@ -83,11 +83,14 @@ type SubmitDataType = {
}[],
}
const EvaluateAdd = () => {
const EvaluateAdd = (props) => {
const { location } = props;
const { visible, toggle } = useModal()
const { id } = usePageStatus();
const isEdit = useMemo(() => id && typeof id === 'string', [id]);
const params = useMemo(() => { return id ? { id: id.toString() } : null }, [id]);
const isPreview = location.pathname.includes('/memberCenter/memberAbility/memberEvaluate/createEvaluate/view');
const { loading, initialValue }= useInitialValue<GetMemberAppraisalWaitPublishGetResponse, { id: string }>(PublicApi.getMemberAppraisalWaitPublishGet, params)
const [ submibtloading, setSubmibtloading] = useState<boolean>(false);
const { memberColumns, memberSchema, handleFetchData } = useGetCommonSubMember(PublicApi.getMemberInspectMembers)
......@@ -95,8 +98,6 @@ const EvaluateAdd = () => {
const onSubmit = async (values: SubmitDataType) => {
const { items, appraisalDayStart, appraisalDayEnd, attachments, selectedProject, verifySteps, history: anyHistory, currentStep, ...rest } = values
// console.log(values);
// return ;
const projectList = items.map((_item) => {
const { sendAppraisal, memberName, score, templates, reports, type, ...otherProps } = _item;
return {
......@@ -279,13 +280,23 @@ const EvaluateAdd = () => {
}
}, [initialValue])
const titleRender = () => {
if (isPreview) {
return "查看考评单单"
}
if(isEdit) {
return "修改考评单"
}
return "新增考评单"
}
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
title={isEdit ? "修改整改通知单" : "新建整改通知单"}
title={titleRender()}
extra={
(
!isPreview && (
<Button
type="primary"
icon={<SaveOutlined />}
......@@ -299,7 +310,7 @@ const EvaluateAdd = () => {
>
<Card className={styles.card}>
<NiceForm
editable={true}
editable={!isPreview}
onSubmit={onSubmit}
initialValues={formatedInitialValue}
schema={evaluateAddSchema}
......@@ -314,12 +325,12 @@ const EvaluateAdd = () => {
}}
expressionScope={{
renderAddition: renderAddition,
connectMember: (
connectMember: !isPreview ? (
<div onClick={() => toggle(true)}>
<LinkOutlined />
<span style={{marginLeft: 4}}>选择</span>
</div>
),
) : null,
renderListTableRemove,
fetchUserData: fetchUserData
}}
......
......@@ -12,11 +12,13 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { PublicApi } from '@/services/api';
import CustomizeQueryList from '../../components/CustomizeQueryList';
import { Link } from 'react-router-dom';
import { GetMemberAppraisalWaitPublishPageRequest, GetMemberAppraisalWaitPublishPageResponse, GetMemberAppraisalWaitPublishPageResponseDetail } from '@/services/MemberV2Api/id9028';
import { GetMemberAppraisalWaitPublishPageRequest, GetMemberAppraisalWaitPublishPageResponse, GetMemberAppraisalWaitPublishPageResponseDetail } from '@/services/MemberV2Api';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
const defaultColumns = setColumnsByLinks();
const defaultColumns = setColumnsByLinks({
detail: "/memberCenter/memberAbility/memberEvaluate/createEvaluate/view"
});
interface Iprops {};
const List: React.FC<Iprops> = (props: Iprops) => {
......
......@@ -63,7 +63,7 @@ export const setColumnsByLinks = (link?: { [key: string]: string }) => {
<div style={{ display: 'flex', flexDirection: 'column', }}>
{
link?.['detail'] && (
<Link to={`${link?.['detail']}?id=${record.id}`}>{record.id}</Link>
<Link to={`${link?.['detail']}?id=${record.id}`}>{record.appraisalNo}</Link>
) || (
<span>{record.id}</span>
)
......@@ -83,9 +83,9 @@ function useEvaluateColumn<T extends { [key: string]: any } = any>(defaultColumn
const [statusOptions, setStatusOptions] = useState<OptionType[]>([]);
const fetchStatusOptions = useCallback(async () => {
const { code, data } = await PublicApi.getMemberInspectTypes();
const { code, data } = await PublicApi.getMemberAppraisalStatusList();
if (code === 1000) {
const formatedData = data.map((_item) => ({label: _item.text, value: _item.id}));
const formatedData = data.map((_item) => ({label: _item.message, value: _item.code}));
setStatusOptions(formatedData)
return formatedData
}
......
......@@ -42,7 +42,7 @@ function useGetDetailCommon(options: Options) {
return [
{
title: '考评单号',
value: initialValue?.id,
value: initialValue?.appraisalNo,
},
{
title: '会员名称',
......@@ -78,9 +78,7 @@ function useGetDetailCommon(options: Options) {
},
{
title: "内部状态",
value: <div>
一通报考评结果
</div>
value: initialValue?.statusName
},
{
title: "考评完成时间",
......
......@@ -31,7 +31,7 @@ export const evaluationListSchema: ISchema = {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
placeholder: '搜索会员名称',
tip: '输入 会员名称 进行搜索',
},
},
......@@ -59,25 +59,25 @@ export const evaluationListSchema: ISchema = {
'[appraisalDayStart,appraisalDayEnd]': {
type: 'daterange',
'x-component-props': {
placeholder: ['考评开始时间', '考评完成时间'],
placeholder: ['考评范围开始时间', '考评范围结束时间'],
allowClear: true,
style: {
width: 240,
},
},
},
status: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
style: {
width: 160,
width: 260,
},
},
},
// status: {
// type: 'string',
// default: undefined,
// enum: [],
// 'x-component-props': {
// placeholder: '内部状态(全部)',
// allowClear: true,
// style: {
// width: 160,
// },
// },
// },
submit: {
'x-component': 'Submit',
......
......@@ -43,10 +43,10 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
'[appraisalDayStart,appraisalDayEnd]': {
type: 'daterange',
'x-component-props': {
placeholder: ['考评开始时间', '考评完成时间'],
placeholder: ['考评范围开始时间', '考评范围结束时间'],
allowClear: true,
style: {
width: 240,
width: 260,
},
},
},
......
......@@ -137,10 +137,10 @@ const TobeEvaluateDetail = () => {
templates: _row.templates,
reports: _row.appraisalReport
})),
resultAttachments: value.resultAttachments.map((_item) => ({
resultAttachments: value.resultAttachments?.map((_item) => ({
name: _item.name,
url: _item.url
}))
})) || []
}
const { code, data } = await PublicApi.postMemberAppraisalWaitSubmitSubmit(postData as any);
setSubmitLoading(false)
......@@ -237,7 +237,9 @@ const TobeEvaluateDetail = () => {
>
<NiceForm
onSubmit={resultOnSubmit}
// initialValues={initialValue}
initialValues={{
notifyMember: 1
}}
expressionScope={createRichTextUtils()}
schema={evaluateScoreRes}
actions={resultForm}
......
......@@ -25,13 +25,12 @@ const List: React.FC<Iprops> = (props: Iprops) => {
{
title: '操作',
render: (_text, _record) => (
<Space>
{
_record.submit && (
<Link to={`/memberCenter/memberAbility/memberEvaluate/tobeSubmitSummary/detail?id=${_record.id}`}>提交</Link>
)
}
</Space>
_record.submitOrUpdate && (
<Space>
<Link to={`/memberCenter/memberAbility/memberEvaluate/tobeSubmitSummary/detail?id=${_record.id}`}>提交</Link>
<Link to={`/memberCenter/memberAbility/memberEvaluate/tobeSubmitSummary/detail?id=${_record.id}`}>修改</Link>
</Space>
)
)
}
])
......
......@@ -73,7 +73,7 @@ export const modifyEvaluateScore: ISchema = {
* 考评结果
*/
export const evaluateScoreRes = {
export const evaluateScoreRes: ISchema = {
type: 'object',
properties: {
layout: {
......@@ -88,18 +88,28 @@ export const evaluateScoreRes = {
totalScore: {
title: '考评最终分',
type: 'string',
require: true,
// require: true,
'x-rules': [
{
required: true,
message: "请填写考评最终分",
}
]
},
result: {
title: '考评结果',
type: 'textarea',
require: true,
'x-rules': [
{
required: true,
message: "请填写考评结果",
}
]
},
notifyMember: {
title: "{{ text('通知考评结果',help('将考评结果通知给考察对象')) }}",
type: "string",
'x-component': 'FormilyCheckbox',
require: true,
},
resultAttachments: {
title: '考评模板',
......
......@@ -169,7 +169,6 @@ const InspectionAdd = () => {
}
}, [initialValue])
console.log(memberModalValue);
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
......@@ -227,7 +226,7 @@ const InspectionAdd = () => {
mode={"radio"}
value={memberModalValue}
/>
<TableModal
<TableModal
visible={userModalVisible}
onClose={() => userModalToggle(false)}
title={"选择用户"}
......
......@@ -2,11 +2,11 @@ import { ColumnsType } from 'antd/es/table';
export const userColumns: ColumnsType<any> = [
{
title: '用户id',
title: '序号',
dataIndex: 'userId',
},
{
title: '会员名称',
title: '姓名',
dataIndex: 'name',
},
{
......
......@@ -96,7 +96,7 @@ export const InspectionAddSchema: ISchema = {
],
},
userName: {
title: '会员代表',
title: '考察代表',
type: 'string',
"x-component-props": {
// disabled: true,
......@@ -162,7 +162,7 @@ export const InspectionAddSchema: ISchema = {
],
},
reports: {
title: <div>考察要求附件 <span style={{color: "#ff4d4f"}}>*</span></div>,
title: <div>考察报告 <span style={{color: "#ff4d4f"}}>*</span></div>,
type: 'object',
required: true,
'x-component': 'FormilyUploadFiles',
......@@ -194,7 +194,7 @@ export const memberSchema: ISchema = {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
placeholder: '搜索会员名称',
tip: '输入 会员名称 进行搜索',
advanced: false,
},
......
......@@ -58,7 +58,7 @@ function useGetDetailCommon({ initialValue }: { initialValue: GetMemberRectifyWa
value: (
<div>
{
initialValue && initialValue?.outerVerifySteps?.[initialValue.currentOuterStep]?.['stepName']
initialValue && initialValue?.outerStatusName
}
</div>
)
......
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