Commit 59c0c187 authored by XieZhiXiong's avatar XieZhiXiong

完善代码

parent 42eac60b
......@@ -344,6 +344,7 @@ const MemberForm: React.FC<MemberFormProps> = ({
// 根据会员角色,查询其他注册资料
onFieldValueChange$('roleId').subscribe(fieldState => {
if (!fieldState.value) {
setMemberItems([]);
return;
}
PublicApi.getMemberAbilitySubPageitemsDetail({
......
......@@ -65,6 +65,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
const [confirmLoading, setConfirmLoading] = useState(false);
const [unsaved, setUnsaved] = useState(false);
// 获取渠道代理 区域信息
const getAreasInfo = (
vals: { pcode: string, ccode: string }[] = [],
source: AreaItem[] = []
......
......@@ -173,7 +173,7 @@ const QuotaFormQuery: React.FC = () => {
useStateFilterSearchLinkageEffect(
$,
actions,
'applyNo',
'memberName',
FORM_FILTER_PATH,
);
useAsyncInitSelect(
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-29 10:03:06
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-29 10:03:43
* @LastEditTime: 2020-11-02 13:47:58
* @Description:
*/
import { ISchema } from '@formily/antd';
......@@ -16,13 +16,13 @@ export const listSearchSchema: ISchema = {
type: 'object',
'x-component': 'mega-layout',
properties: {
applyNo: {
memberName: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
tip: '输入 申请单号、会员归属 进行搜索',
tip: '输入 会员归属 进行搜索',
},
},
[FORM_FILTER_PATH]: {
......@@ -35,6 +35,13 @@ export const listSearchSchema: ISchema = {
columns: 6,
},
properties: {
applyNo: {
type: 'string',
'x-component-props': {
placeholder: '申请单号',
allowClear: true,
},
},
'[startTime, endTime]': {
type: 'string',
default: '',
......
......@@ -261,7 +261,7 @@ const QuotaPrSubmit: React.FC = () => {
useStateFilterSearchLinkageEffect(
$,
actions,
'applyNo',
'memberName',
FORM_FILTER_PATH,
);
useAsyncInitSelect(
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-29 10:03:06
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-29 10:03:43
* @LastEditTime: 2020-11-02 14:00:09
* @Description:
*/
import { ISchema } from '@formily/antd';
......@@ -16,13 +16,13 @@ export const listSearchSchema: ISchema = {
type: 'object',
'x-component': 'mega-layout',
properties: {
applyNo: {
memberName: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
tip: '输入 申请单号、会员归属 进行搜索',
tip: '输入 会员归属 进行搜索',
},
},
[FORM_FILTER_PATH]: {
......@@ -35,6 +35,13 @@ export const listSearchSchema: ISchema = {
columns: 6,
},
properties: {
applyNo: {
type: 'string',
'x-component-props': {
placeholder: '申请单号',
allowClear: true,
},
},
'[startTime, endTime]': {
type: 'string',
default: '',
......
......@@ -175,7 +175,7 @@ const QuotaFormQuery: React.FC = () => {
useStateFilterSearchLinkageEffect(
$,
actions,
'applyNo',
'memberName',
FORM_FILTER_PATH,
);
useAsyncInitSelect(
......
......@@ -16,13 +16,13 @@ export const listSearchSchema: ISchema = {
type: 'object',
'x-component': 'mega-layout',
properties: {
applyNo: {
memberName: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
tip: '输入 申请单号、会员归属 进行搜索',
tip: '输入 会员归属 进行搜索',
},
},
[FORM_FILTER_PATH]: {
......@@ -35,6 +35,13 @@ export const listSearchSchema: ISchema = {
columns: 6,
},
properties: {
applyNo: {
type: 'string',
'x-component-props': {
placeholder: '申请单号',
allowClear: true,
},
},
'[startTime, endTime]': {
type: 'string',
default: '',
......
......@@ -9,7 +9,7 @@ import {
} from 'antd';
import { FormOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi';
import { history, Prompt } from 'umi';
import moment from 'moment';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import { usePageStatus } from '@/hooks/usePageStatus';
......@@ -25,6 +25,9 @@ import EvaluationList from '../../components/EvaluationList';
import styles from './index.less';
const formActions = createFormActions();
const {
onFormInputChange$,
} = FormEffectHooks;
interface Unevaluated {
good: {
......@@ -48,6 +51,7 @@ const EvaluateOrder: React.FC = () => {
const [orderInfo, setOrderInfo] = useState<OrderInfo>(null);
const [infoLoading, setInfoLoading] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const [unsaved, setUnsaved] = useState(false);
const getOrderInfo = () => {
if (!id) {
......@@ -106,6 +110,7 @@ const EvaluateOrder: React.FC = () => {
commentSubmitDetailList: payload,
}).then(res => {
if (res.code === 1000) {
setUnsaved(false);
setTimeout(() => {
history.goBack();
}, 800);
......@@ -201,10 +206,18 @@ const EvaluateOrder: React.FC = () => {
}}
effects={($, actions) => {
createEffects($, actions);
onFormInputChange$().subscribe(() => {
if (!unsaved) {
setUnsaved(true);
}
});
}}
schema={evaluateSchema}
/>
</PageHeaderWrapper>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
</Spin>
);
};
......
......@@ -9,7 +9,7 @@ import {
} from 'antd';
import { FormOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi';
import { history, Prompt } from 'umi';
import moment from 'moment';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import { usePageStatus } from '@/hooks/usePageStatus';
......@@ -25,6 +25,9 @@ import EvaluationList from '../../components/EvaluationList';
import styles from './index.less';
const formActions = createFormActions();
const {
onFormInputChange$,
} = FormEffectHooks;
interface Unevaluated {
good: {
......@@ -48,6 +51,7 @@ const EvaluateOrder: React.FC = () => {
const [orderInfo, setOrderInfo] = useState<OrderInfo>(null);
const [infoLoading, setInfoLoading] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const [unsaved, setUnsaved] = useState(false);
const getOrderInfo = () => {
if (!id) {
......@@ -106,6 +110,7 @@ const EvaluateOrder: React.FC = () => {
commentSubmitDetailList: payload,
}).then(res => {
if (res.code === 1000) {
setUnsaved(false);
setTimeout(() => {
history.goBack();
}, 800);
......@@ -201,10 +206,18 @@ const EvaluateOrder: React.FC = () => {
}}
effects={($, actions) => {
createEffects($, actions);
onFormInputChange$().subscribe(() => {
if (!unsaved) {
setUnsaved(true);
}
});
}}
schema={evaluateSchema}
/>
</PageHeaderWrapper>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
</Spin>
);
};
......
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