Commit 228d9c81 authored by Bill's avatar Bill

fix: 修改投诉建议bug

parent 1c109f3a
......@@ -99,7 +99,7 @@ const SuggestAdd = () => {
const formatedValue = useMemo(() => {
if (!initialValue) {
return ;
return { type: 1 };
}
const { name, byUserName, byUserPhone, ...rest } = initialValue;
return {
......
......@@ -50,6 +50,7 @@ const CustomizeQueryList: React.FC<Iprops> = React.forwardRef((props: Iprops, re
const onRresh = (values: any) => {
const data = formatData?.(values) || values;
console.log("format",data);
tableRef.current?.reload(data);
}
......
......@@ -83,7 +83,7 @@ const SuggestAdd = () => {
setMemberModalValue([{
name: upperName,
memberId: memberId,
subRoleId: roleId
roleId: roleId
}])
setUserModalValue([
{
......@@ -99,12 +99,12 @@ const SuggestAdd = () => {
const formatedValue = useMemo(() => {
if (!initialValue) {
return ;
return { type: 1 };
}
const { name, byUserName, byUserPhone, ...rest } = initialValue;
const { upperName, byUserName, byUserPhone, ...rest } = initialValue;
return {
...rest,
memberName: name,
memberName: upperName,
byUserEditName: byUserName,
byUserEditPhone: byUserPhone,
}
......@@ -172,6 +172,7 @@ const SuggestAdd = () => {
userModalToggle(false)
}
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
......
......@@ -4,6 +4,7 @@ import { useMemo } from "react";
function useGetDetailCommon({ initialValue }) {
const basicInfo = useMemo(() => {
const isUpperMember = typeof initialValue?.upperName !== 'undefined';
return [
{
title: '事件主题',
......@@ -22,8 +23,8 @@ function useGetDetailCommon({ initialValue }) {
value: initialValue?.eventDesc
},
{
title: "会员名称",
value: initialValue?.name
title: isUpperMember ? '上级会员名称' : "会员名称",
value: isUpperMember ? initialValue?.upperName : initialValue?.name
},
{
title: "附件",
......
......@@ -170,7 +170,7 @@ export const complaintAddSchema: ISchema = {
]
},
attachments: {
title: '考察要求附件',
title: '事件附件',
type: 'object',
'x-component': 'FormilyUploadFiles',
}
......
......@@ -29,7 +29,7 @@ export const complaintAndSuggestListSchema: ISchema = {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
placeholder: '搜索会员名称',
tip: '输入 会员名称 进行搜索',
},
},
......@@ -58,10 +58,10 @@ export const complaintAndSuggestListSchema: ISchema = {
type: 'daterange',
default: undefined,
'x-component-props': {
placeholder: '会员等级(全部)',
placeholder: ['事件时间', "事件时间"],
allowClear: true,
style: {
width: 160,
width: 260,
},
},
},
......
......@@ -11,6 +11,7 @@ import CustomizeQueryList from '../../components/CustomizeQueryList';
import { Link } from 'umi';
import useColumns from '../../memberRectification/common/hooks/useColumns';
import { GetMemberComplaintSubPageRequest, GetMemberComplaintUpperPageRequest } from '@/services/MemberV2Api';
import moment from 'moment';
interface Iprops {};
......@@ -59,10 +60,7 @@ const List: React.FC<Iprops> = (props: Iprops) => {
}
const handleSubmit = async (params: {id: number}, type: "submit" | "delete") => {
const newList = [...currentIdIsInLoading];
newList.push(params.id);
const service = type === 'submit' ? PublicApi.postMemberComplaintSubSubmit : PublicApi.postMemberComplaintSubDelete;
setCurrentIdIsInLoading(newList)
const { data, code } = await service(params);
setCurrentIdIsInLoading((prev) => prev.filter((_item) => _item !== params.id));
if (code === 1000) {
......@@ -70,11 +68,22 @@ const List: React.FC<Iprops> = (props: Iprops) => {
}
}
const formatData = (value) => {
const { eventTimeStart, eventTimeEnd, ...rest } = value;
const newData = {
...rest,
eventTimeStart: eventTimeStart && moment(eventTimeStart, 'YYYY-MM-DD').startOf("day").format('YYYY-MM-DD HH:mm:ss'),
eventTimeEnd: eventTimeEnd && moment(eventTimeEnd, 'YYYY-MM-DD').endOf("day").format('YYYY-MM-DD HH:mm:ss')
}
return newData
}
return (
<Card>
<CustomizeQueryList
ref={ref}
columns={columns}
formatData={formatData}
schema={complaintAndSuggestListSchema}
fetchListData={handleFetch}
expressionScope={{
......
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