Commit 0b255b50 authored by XieZhiXiong's avatar XieZhiXiong

feat: 添加代客维修申请

parent eb944260
......@@ -154,6 +154,13 @@ const route: RouterChild = {
hideInMenu: true,
noMargin: true,
},
// 代客维修申请
{
path: '/memberCenter/afterService/repairManage/repairValetApply/index',
name: 'repairValetApply',
component: '@/pages/afterService/repairManage/repairValetApply/index',
noMargin: true,
},
]
}
......
......@@ -662,6 +662,7 @@ export default {
'menu.afterService.repairManage.repairPrConfirm': '待确认维修申请单',
'menu.afterService.repairManage.repairPrConfirmDetail': '查看维修申请单',
'menu.afterService.repairManage.verifyRepairPrConfirm': '审核维修申请单',
'menu.afterService.repairManage.repairValetApply': '代客维修申请',
'menu.afterService.repairManage.orderPreview': '查看订单',
// 结算能力
......
......@@ -12,18 +12,11 @@ import { createFormActions, FormEffectHooks } from '@formily/antd';
import { getAsRepairGoodsGetDetailByConsumer, getAsRepairGoodsPageRepairGoods, GetAsRepairGoodsPageRepairGoodsResponseDetail, postAsRepairGoodsSave } from '@/services/AfterServiceV2Api';
import { getOrderBuyerDetail, getOrderCommonAfterSalePage } from '@/services/OrderNewV2Api';
import { normalizeFiledata, FileData, isJSONStr } from '@/utils';
import {
ORDER_TYPE_INQUIRY_CONTRACT,
ORDER_TYPE_BIDDING_CONTRACT,
ORDER_TYPE_TENDER_CONTRACT,
ORDER_TYPE2,
} from '@/constants/order';
import ReutrnEle from '@/components/ReturnEle';
import NiceForm from '@/components/NiceForm';
import StatusTag from '@/components/StatusTag';
import GoodsDrawer from '../../../../components/GoodsDrawer';
import { OrderListRes } from '../../../../components/GoodsDrawer/interface';
import AddressFormItem from '../../../../components/AddressFormItem';
import { addSchema } from './schema';
import { createEffects } from './effects';
import {
......@@ -630,9 +623,8 @@ const RepairForm: React.FC<BillsFormProps> = ({
beforeUpload,
}}
components={{
ArrayTable,
AddressFormItem,
OrderNo,
ArrayTable,
OrderNo,
}}
editable={isEdit || !id}
effects={($, actions) => {
......
......@@ -434,15 +434,18 @@ export const addSchema = (orderType: number): ISchema => {
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 12,
labelAlign: 'left',
},
properties: {
repairAddress: {
title: '维修地址',
type: 'string',
'x-component': 'AddressFormItem',
'x-component': 'CustomAddressSelect',
'x-component-props': {
dataSource: [],
isDefaultAddress: true,
addressType: 1,
echo: true,
},
'x-rules': [
{
......
/*
* @Author: XieZhiXiong
* @Date: 2021-12-03 09:56:25
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-12-03 09:56:25
* @Description:
*/
import { FormEffectHooks, FormPath } from '@formily/antd'
import { useBusinessEffects } from './useBusinessEffects';
import { getLogisticsSelectListReceiverAddress } from '@/services/LogisticsV2Api';
const { onFormMount$ } = FormEffectHooks;
export const createEffects = (context, actions) => {
const { setFieldState } = actions;
useBusinessEffects(context, actions);
onFormMount$().subscribe(() => {
// 获取收件地址
getLogisticsSelectListReceiverAddress().then(res => {
if (res.code === 1000) {
setFieldState('repairAddress', state => {
state.props['x-component-props'].dataSource = res.data;
});
}
});
});
};
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-12-03 09:57:51
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-12-03 10:31:06
* @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();
// 校验维修数量
onFieldInputChange$('repairGoodsList.*.repairCount').subscribe(fieldState => {
const { name, value } = fieldState;
// 已维修数量
const repairedCountValue = getFieldState(
FormPath.transform(name, /\d/, $1 => {
return `repairGoodsList.${$1}.extraData`
}),
state => state.value.remaining,
);
// 不需要做数量校验
// setFieldState(
// FormPath.transform(name, /\d/, $1 => {
// return `repairGoodsList.${$1}.repairCount`
// }),
// state => {
// if (+value > repairedCountValue) {
// state.errors = '填写值已超过最大可维修数量,请重新填写';
// } else {
// state.errors = '';
// }
// }
// );
});
// 供应会员、订单类型 联动 单据明细
onFieldInputChange$('*(supplierMember,orderType)').subscribe(fieldState => {
const replaceGoodsListValue = getFieldValue('repairGoodsList');
if (replaceGoodsListValue && replaceGoodsListValue.length) {
setFieldValue('repairGoodsList', []);
}
});
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
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