Commit 59c0c187 authored by XieZhiXiong's avatar XieZhiXiong

完善代码

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