Commit e035996a authored by XieZhiXiong's avatar XieZhiXiong

fix: 修改售后相关bug

parent abaf37d3
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 15:09:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-21 11:44:17
* @LastEditTime: 2020-12-24 10:32:10
* @Description: 维修商品抽屉组件
*/
import React, { useState, useEffect } from 'react';
......@@ -246,6 +246,11 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
payload.push(atom);
});
});
if (!payload.length) {
this.setState({ loading: false });
return;
}
processEnumRes = await PublicApi.postOrderGetProcessEnum({
list: payload,
......
/*
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:30:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-11 10:29:51
* @Description: 联动逻辑相关
*/
import { Modal } from 'antd';
import { FormEffectHooks, FormPath } from '@formily/antd';
import { useLinkageUtils } from '@/utils/formEffectUtils';
const {
onFieldInputChange$,
onFieldValueChange$,
} = FormEffectHooks;
export const useBusinessEffects = (context, actions) => {
const {
getFieldValue,
setFieldValue,
getFieldState,
setFieldState,
} = actions;
const linkage = useLinkageUtils();
// 联动配送方式
onFieldValueChange$('deliveryType').subscribe(fieldState => {
const { name, value } = fieldState;
switch (value) {
// 物流
case 1: {
linkage.show('shippingAddress');
linkage.hide('pickupAddress');
break;
};
// 自提
case 2: {
linkage.hide('shippingAddress');
linkage.show('pickupAddress');
break;
};
// 无需物流
case 3: {
linkage.hide('*(shippingAddress,pickupAddress)');
break;
};
default:
break
};
});
// 校验换货数量
onFieldInputChange$('replaceGoodsList.*.replaceCount').subscribe(fieldState => {
const { name, value } = fieldState;
// 已换货数量
const replacedCountValue = getFieldState(
FormPath.transform(name, /\d/, $1 => {
return `replaceGoodsList.${$1}.extraData`
}),
state => state.value.replacedCount,
);
setFieldState(
FormPath.transform(name, /\d/, $1 => {
return `replaceGoodsList.${$1}.replaceCount`
}),
state => {
if (+value > replacedCountValue) {
state.errors = '填写值已超过最大可换货数量,请重新填写';
} else {
state.errors = '';
}
}
);
});
/*
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:30:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-24 10:36:02
* @Description: 联动逻辑相关
*/
import { Modal } from 'antd';
import { FormEffectHooks, FormPath } from '@formily/antd';
import { useLinkageUtils } from '@/utils/formEffectUtils';
const {
onFieldInputChange$,
onFieldValueChange$,
} = FormEffectHooks;
export const useBusinessEffects = (context, actions) => {
const {
getFieldValue,
setFieldValue,
getFieldState,
setFieldState,
} = actions;
const linkage = useLinkageUtils();
// 联动配送方式
onFieldValueChange$('deliveryType').subscribe(fieldState => {
const { name, value } = fieldState;
switch (value) {
// 物流
case 1: {
linkage.show('shippingAddress');
linkage.hide('pickupAddress');
break;
};
// 自提
case 2: {
linkage.hide('shippingAddress');
linkage.show('pickupAddress');
break;
};
// 无需物流
case 3: {
linkage.hide('*(shippingAddress,pickupAddress)');
break;
};
default:
break
};
});
// 校验换货数量
onFieldInputChange$('replaceGoodsList.*.replaceCount').subscribe(fieldState => {
const { name, value } = fieldState;
// 已换货数量
const replacedCountValue = getFieldState(
FormPath.transform(name, /\d/, $1 => {
return `replaceGoodsList.${$1}.extraData`
}),
state => state.value.replacedCount,
);
setFieldState(
FormPath.transform(name, /\d/, $1 => {
return `replaceGoodsList.${$1}.replaceCount`
}),
state => {
if (+value > replacedCountValue) {
state.errors = '填写值已超过最大可换货数量,请重新填写';
} else {
state.errors = '';
}
}
);
});
// 供应会员联动 单据明细
onFieldInputChange$('supplierMember').subscribe(fieldState => {
const replaceGoodsListValue = getFieldValue('replaceGoodsList');
if (replaceGoodsListValue && replaceGoodsListValue.length) {
setFieldValue('replaceGoodsList', []);
}
});
}
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:30:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-17 10:32:48
* @Description: 联动逻辑相关
*/
import { Modal } from 'antd';
import { FormEffectHooks, FormPath } from '@formily/antd';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import {
} from '@/constants';
import { PublicApi } from '@/services/api';
const {
onFieldInputChange$,
onFieldValueChange$,
} = FormEffectHooks;
export const useBusinessEffects = (context, actions) => {
const {
getFieldValue,
setFieldValue,
getFieldState,
setFieldState,
} = actions;
// const linkage = useLinkageUtils();
// 校验维修数量
onFieldInputChange$('repairGoodsList.*.repairCount').subscribe(fieldState => {
const { name, value } = fieldState;
// 已维修数量
const repairedCountValue = getFieldState(
FormPath.transform(name, /\d/, $1 => {
return `repairGoodsList.${$1}.extraData`
}),
state => state.value.repairedCount,
);
setFieldState(
FormPath.transform(name, /\d/, $1 => {
return `repairGoodsList.${$1}.repairCount`
}),
state => {
if (+value > repairedCountValue) {
state.errors = '填写值已超过最大可维修数量,请重新填写';
} else {
state.errors = '';
}
}
);
});
/*
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:30:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-17 10:32:48
* @Description: 联动逻辑相关
*/
import { Modal } from 'antd';
import { FormEffectHooks, FormPath } from '@formily/antd';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import {
} from '@/constants';
import { PublicApi } from '@/services/api';
const {
onFieldInputChange$,
onFieldValueChange$,
} = FormEffectHooks;
export const useBusinessEffects = (context, actions) => {
const {
getFieldValue,
setFieldValue,
getFieldState,
setFieldState,
} = actions;
// const linkage = useLinkageUtils();
// 校验维修数量
onFieldInputChange$('repairGoodsList.*.repairCount').subscribe(fieldState => {
const { name, value } = fieldState;
// 已维修数量
const repairedCountValue = getFieldState(
FormPath.transform(name, /\d/, $1 => {
return `repairGoodsList.${$1}.extraData`
}),
state => state.value.repairedCount,
);
setFieldState(
FormPath.transform(name, /\d/, $1 => {
return `repairGoodsList.${$1}.repairCount`
}),
state => {
if (+value > repairedCountValue) {
state.errors = '填写值已超过最大可维修数量,请重新填写';
} else {
state.errors = '';
}
}
);
});
// 供应会员联动 单据明细
onFieldInputChange$('supplierMember').subscribe(fieldState => {
const replaceGoodsListValue = getFieldValue('repairGoodsList');
if (replaceGoodsListValue && replaceGoodsListValue.length) {
setFieldValue('repairGoodsList', []);
}
});
}
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:30:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-09 16:18:45
* @Description: 联动逻辑相关
*/
import { FormEffectHooks, FormPath } from '@formily/antd';
import { useLinkageUtils } from '@/utils/formEffectUtils';
const {
onFieldInputChange$,
onFieldValueChange$,
} = FormEffectHooks;
export const useBusinessEffects = (context, actions) => {
const {
getFieldValue,
setFieldValue,
getFieldState,
setFieldState,
} = actions;
const linkage = useLinkageUtils();
// 联动配送方式
onFieldValueChange$('deliveryType').subscribe(fieldState => {
const { name, value } = fieldState;
switch (value) {
// 物流
case 1: {
linkage.show('shippingAddress');
linkage.hide('pickupAddress');
break;
};
// 自提
case 2: {
linkage.hide('shippingAddress');
linkage.show('pickupAddress');
break;
};
// 无需物流
case 3: {
linkage.hide('*(shippingAddress,pickupAddress)');
break;
};
default:
break
};
});
/*
* @Author: XieZhiXiong
* @Date: 2020-11-03 18:30:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-09 16:18:45
* @Description: 联动逻辑相关
*/
import { FormEffectHooks, FormPath } from '@formily/antd';
import { useLinkageUtils } from '@/utils/formEffectUtils';
const {
onFieldInputChange$,
onFieldValueChange$,
} = FormEffectHooks;
export const useBusinessEffects = (context, actions) => {
const {
getFieldValue,
setFieldValue,
getFieldState,
setFieldState,
} = actions;
const linkage = useLinkageUtils();
// 联动配送方式
onFieldValueChange$('deliveryType').subscribe(fieldState => {
const { name, value } = fieldState;
switch (value) {
// 物流
case 1: {
linkage.show('shippingAddress');
linkage.hide('pickupAddress');
break;
};
// 自提
case 2: {
linkage.hide('shippingAddress');
linkage.show('pickupAddress');
break;
};
// 无需物流
case 3: {
linkage.hide('*(shippingAddress,pickupAddress)');
break;
};
default:
break
};
});
// 供应会员联动 单据明细
onFieldInputChange$('supplierMember').subscribe(fieldState => {
const replaceGoodsListValue = getFieldValue('returnGoodsList');
if (replaceGoodsListValue && replaceGoodsListValue.length) {
setFieldValue('returnGoodsList', []);
}
});
}
\ No newline at end of file
......@@ -557,7 +557,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
>
<Card>
<NiceForm
initialValues={{
value={{
...detailInfo,
returnGoodsList: returnGoodsList.data,
}}
......
......@@ -110,7 +110,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
});
PublicApi.postAsReturnGoodsSetNeedReturnGoods({
returnId: +id,
returnGoodsId: record.orderRecordId,
returnGoodsId: record.returnGoodsId,
isNeed: record.isNeedReturn === 1 ? 0 : 1,
}).then(res => {
if (res.code === 1000) {
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 14:25:41
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-08 17:32:59
* @LastEditTime: 2020-12-24 10:04:24
* @Description: 退货申请单查询
*/
import React, { useState, useRef } from 'react';
......@@ -99,7 +99,7 @@ const ReturnPrReturn: React.FC = () => {
type="link"
onClick={() => history.push(`/memberCenter/afterService/returnManage/returnPrReturn/verify?id=${record.returnId}`)}
>
提交审核
退款
</Button>
</>
),
......
......@@ -186,7 +186,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
);
setBillInfo({
transactionTime: transactionTime ? moment(transactionTime).format('YYYY-MM-DD HH:mm:ss') : moment().format('YYYY-MM-DD HH:mm:ss'),
transactionTime: transactionTime ? moment(transactionTime).format('YYYY-MM-DD HH:mm:ss') : '',
orderNo:
relevanceInvoicesId ?
[
......@@ -1656,7 +1656,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
>
<Card>
<NiceForm
initialValues={billInfo}
value={billInfo}
expressionScope={{
TableAddButton,
renderListTableRemove,
......
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