Commit 46058aa3 authored by XieZhiXiong's avatar XieZhiXiong

chore: 替换接口

parent 55e7ad6b
import { ISchema } from '@formily/antd';
import Search from '@/components/NiceForm/components/Search';
import Submit from '@/components/NiceForm/components/Submit';
import { PATTERN_MAPS } from '@/constants/regExp';
import { UPLOAD_TYPE, DELIVERY_TYPE_ENUM } from '@/constants';
import { PublicApi } from '@/services/api';
// 供应会员列表列
const supplierColumns = [
{
title: '会员ID',
dataIndex: 'memberId',
align: 'center',
},
{
title: '会员名称',
dataIndex: 'name',
align: 'center',
},
{
title: '会员类型',
dataIndex: 'memberTypeName',
align: 'center',
},
{
title: '会员角色',
dataIndex: 'roleName',
align: 'center',
},
{
title: '会员等级',
dataIndex: 'levelTag',
align: 'center',
},
];
// 获取供应会员
const getSupplier = async (params) => {
const res = await PublicApi.getMemberManageUpperProviderPage({
...params,
})
if (res.code === 1000) {
return res.data;
}
return { totalCount: 0, data: [] };
};
const supplierSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'Mega-Layout',
properties: {
name: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: '搜索',
align: 'flex-start',
advanced: false,
tip: '输入 供应会员名称 进行搜索',
},
},
},
},
},
};
export const addBillSchema: ISchema = {
type: 'object',
properties: {
REPOSIT_TABS: {
type: 'object',
'x-component': 'tab',
'x-component-props': {
type: 'card',
},
properties: {
'tab-1': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '基本信息',
},
properties: {
MEGA_LAYOUT1: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 12,
labelAlign: 'left',
},
properties: {
applyAbstract: {
type: 'string',
title: '申请单摘要',
'x-rules': [
{
required: true,
message: '请填写申请单摘要',
},
{
limitByte: true, // 自定义校验规则
maxByte: 60,
}
],
},
// 这是用 Mega-Layout 设置独立作用域,不然会被 Form 的布局影响到弹窗的布局
MEGA_LAYOUT1_1: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
wrapperCol: 24,
},
properties: {
supplierMember: {
type: 'string',
title: '供应会员',
'x-component': 'CustomRelevance',
'x-component-props': {
title: '关联',
tip: '请选择对应单据',
modalProps: {
title: '选择会员',
},
columns: supplierColumns,
fetchTableData: getSupplier,
formilyProps: {
ctx: {
schema: supplierSchema,
components: {
Search,
Submit,
},
effects: ($, actions) => {
},
inline: false,
}
},
tableProps: {
rowKey: 'memberId',
lableKey: 'name',
},
},
'x-mega-props': {
wrapperCol: 12,
},
'x-rules': [
{
required: true,
message: '请选择供应会员',
},
],
},
},
},
applyNo: {
type: 'string',
title: '申请单号',
'x-component': 'Text',
},
applyTime: {
type: 'string',
title: '单据时间',
'x-component': 'Text',
},
outerStatus: {
type: 'string',
title: '外部状态',
'x-component': 'Children',
'x-component-props': {
children: '{{OuterStatus}}'
},
},
innerStatus: {
type: 'string',
title: '内部状态',
'x-component': 'Children',
'x-component-props': {
children: '{{InnerStatus}}'
},
},
},
},
},
},
'tab-2': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '单据明细',
},
properties: {
MEGA_LAYOUT2: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
labelAlign: 'left',
},
properties: {
addBtn: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{TableAddButton}}'
},
},
replaceGoodsList: {
type: 'array',
'x-component': 'ArrayTable',
'x-component-props': {
renderAddition: () => null,
renderRemove: '{{renderListTableRemove}}',
renderMoveDown: () => null,
renderMoveUp: () => null,
operationsWidth: 100,
operations: {
align: 'center',
},
},
'x-rules': [
{
required: true,
message: '请选择换货商品',
},
],
items: {
type: 'object',
properties: {
orderNo: {
type: 'string',
title: '订单号',
'x-component': 'Text',
},
productId: {
type: 'string',
title: '商品ID',
'x-component': 'Text',
},
productName: {
type: 'string',
title: '商品名称',
'x-component': 'Text',
},
category: {
type: 'string',
title: '品类',
'x-component': 'Text',
},
brand: {
type: 'string',
title: '品牌',
'x-component': 'Text',
},
unit: {
type: 'string',
title: '单位',
'x-component': 'Text',
},
purchaseCount: {
type: 'string',
title: '采购数量',
'x-component': 'Text',
},
purchasePrice: {
type: 'string',
title: '采购单价',
'x-component': 'Text',
},
purchaseAmount: {
type: 'string',
title: '采购金额',
'x-component': 'Text',
},
replaceCount: {
type: 'string',
title: '换货数量',
'x-component-props': {
allowClear: true,
style: {
maxWidth: 150,
},
},
'x-rules': [
{
required: true,
message: '请填写换货数量',
},
{
pattern: PATTERN_MAPS.weight,
message: '请填写正数,最多保留3位小数',
},
],
},
replaceReason: {
type: 'string',
title: '换货原因',
'x-component-props': {
allowClear: true,
style: {
maxWidth: 150,
},
},
'x-rules': [
{
required: true,
message: '请填写换货原因',
},
{
limitByte: true, // 自定义校验规则
maxByte: 60,
}
],
},
// 不用于展示,只用于收集值
id: {
type: 'string',
display: false,
},
// 其他数据,不用于展示,只用于收集值
extraData: {
type: 'string',
display: false,
},
},
}
},
},
},
},
},
'tab-3': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '相关附件',
},
properties: {
MEGA_LAYOUT3: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
labelAlign: 'left',
},
properties: {
proofFileList: {
title: '附件',
'x-component': 'AntUpload',
'x-component-props': {
action: '/api/file/file/upload/prefix',
data: {
fileType: UPLOAD_TYPE,
prefix: '/afterService/returnApplication/',
},
beforeUpload: '{{beforeUpload}}',
accept: '.xls, .xlsx, .doc, .docx, .wps, .pdf, .jpg, .png, .jpeg',
},
'x-rules': [
{
required: false,
message: '请上传附件',
},
],
description: '一次上传一个文件,每个附件大小不能超过20M',
},
},
},
},
},
'tab-4': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '退货收货地址',
},
properties: {
MEGA_LAYOUT4: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 12,
labelAlign: 'left',
},
properties: {
deliveryType: {
title: '配送方式',
type: 'string',
enum: DELIVERY_TYPE_ENUM,
'x-component-props': {
placeholder: '请选择',
},
'x-rules': [
{
required: true,
message: '请选择配送方式',
},
],
},
// 退货发货地址
shippingAddress: {
title: '退货发货地址',
type: 'string',
visible: false,
'x-component': 'AddressFormItem',
'x-component-props': {
dataSource: [],
},
'x-rules': [
{
required: true,
message: '请选择退货发货地址',
},
],
},
// 退货自提地址
pickupAddress: {
title: '退货自提地址',
type: 'string',
visible: false,
'x-component': 'AddressFormItem',
'x-component-props': {
dataSource: [],
},
'x-rules': [
{
required: true,
message: '请选择退货自提地址',
},
],
},
// 换货收货地址
deliveryAddress: {
title: '换货收货地址',
type: 'string',
'x-component': 'AddressFormItem',
'x-component-props': {
dataSource: [],
},
'x-rules': [
{
required: true,
message: '请选择换货收货地址',
},
],
},
},
},
},
},
},
},
},
import { ISchema } from '@formily/antd';
import Search from '@/components/NiceForm/components/Search';
import Submit from '@/components/NiceForm/components/Submit';
import { PATTERN_MAPS } from '@/constants/regExp';
import { UPLOAD_TYPE, DELIVERY_TYPE_ENUM } from '@/constants';
import { PublicApi } from '@/services/api';
// 供应会员列表列
const supplierColumns = [
{
title: '会员ID',
dataIndex: 'memberId',
align: 'center',
},
{
title: '会员名称',
dataIndex: 'name',
align: 'center',
},
{
title: '会员类型',
dataIndex: 'memberTypeName',
align: 'center',
},
{
title: '会员角色',
dataIndex: 'roleName',
align: 'center',
},
{
title: '会员等级',
dataIndex: 'levelTag',
align: 'center',
},
];
// 获取供应会员
const getSupplier = async (params) => {
const res = await PublicApi.getMemberManageAftersaleReplacePage({
...params,
})
if (res.code === 1000) {
return res.data;
}
return { totalCount: 0, data: [] };
};
const supplierSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'Mega-Layout',
properties: {
name: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: '搜索',
align: 'flex-start',
advanced: false,
tip: '输入 供应会员名称 进行搜索',
},
},
},
},
},
};
export const addBillSchema: ISchema = {
type: 'object',
properties: {
REPOSIT_TABS: {
type: 'object',
'x-component': 'tab',
'x-component-props': {
type: 'card',
},
properties: {
'tab-1': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '基本信息',
},
properties: {
MEGA_LAYOUT1: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 12,
labelAlign: 'left',
},
properties: {
applyAbstract: {
type: 'string',
title: '申请单摘要',
'x-rules': [
{
required: true,
message: '请填写申请单摘要',
},
{
limitByte: true, // 自定义校验规则
maxByte: 60,
}
],
},
// 这是用 Mega-Layout 设置独立作用域,不然会被 Form 的布局影响到弹窗的布局
MEGA_LAYOUT1_1: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
wrapperCol: 24,
},
properties: {
supplierMember: {
type: 'string',
title: '供应会员',
'x-component': 'CustomRelevance',
'x-component-props': {
title: '关联',
tip: '请选择对应单据',
modalProps: {
title: '选择会员',
},
columns: supplierColumns,
fetchTableData: getSupplier,
formilyProps: {
ctx: {
schema: supplierSchema,
components: {
Search,
Submit,
},
effects: ($, actions) => {
},
inline: false,
}
},
tableProps: {
rowKey: 'memberId',
lableKey: 'name',
},
},
'x-mega-props': {
wrapperCol: 12,
},
'x-rules': [
{
required: true,
message: '请选择供应会员',
},
],
},
},
},
applyNo: {
type: 'string',
title: '申请单号',
'x-component': 'Text',
},
applyTime: {
type: 'string',
title: '单据时间',
'x-component': 'Text',
},
outerStatus: {
type: 'string',
title: '外部状态',
'x-component': 'Children',
'x-component-props': {
children: '{{OuterStatus}}'
},
},
innerStatus: {
type: 'string',
title: '内部状态',
'x-component': 'Children',
'x-component-props': {
children: '{{InnerStatus}}'
},
},
},
},
},
},
'tab-2': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '单据明细',
},
properties: {
MEGA_LAYOUT2: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
labelAlign: 'left',
},
properties: {
addBtn: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{TableAddButton}}'
},
},
replaceGoodsList: {
type: 'array',
'x-component': 'ArrayTable',
'x-component-props': {
renderAddition: () => null,
renderRemove: '{{renderListTableRemove}}',
renderMoveDown: () => null,
renderMoveUp: () => null,
operationsWidth: 100,
operations: {
align: 'center',
},
},
'x-rules': [
{
required: true,
message: '请选择换货商品',
},
],
items: {
type: 'object',
properties: {
orderNo: {
type: 'string',
title: '订单号',
'x-component': 'Text',
},
productId: {
type: 'string',
title: '商品ID',
'x-component': 'Text',
},
productName: {
type: 'string',
title: '商品名称',
'x-component': 'Text',
},
category: {
type: 'string',
title: '品类',
'x-component': 'Text',
},
brand: {
type: 'string',
title: '品牌',
'x-component': 'Text',
},
unit: {
type: 'string',
title: '单位',
'x-component': 'Text',
},
purchaseCount: {
type: 'string',
title: '采购数量',
'x-component': 'Text',
},
purchasePrice: {
type: 'string',
title: '采购单价',
'x-component': 'Text',
},
purchaseAmount: {
type: 'string',
title: '采购金额',
'x-component': 'Text',
},
replaceCount: {
type: 'string',
title: '换货数量',
'x-component-props': {
allowClear: true,
style: {
maxWidth: 150,
},
},
'x-rules': [
{
required: true,
message: '请填写换货数量',
},
{
pattern: PATTERN_MAPS.weight,
message: '请填写正数,最多保留3位小数',
},
],
},
replaceReason: {
type: 'string',
title: '换货原因',
'x-component-props': {
allowClear: true,
style: {
maxWidth: 150,
},
},
'x-rules': [
{
required: true,
message: '请填写换货原因',
},
{
limitByte: true, // 自定义校验规则
maxByte: 60,
}
],
},
// 不用于展示,只用于收集值
id: {
type: 'string',
display: false,
},
// 其他数据,不用于展示,只用于收集值
extraData: {
type: 'string',
display: false,
},
},
}
},
},
},
},
},
'tab-3': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '相关附件',
},
properties: {
MEGA_LAYOUT3: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
labelAlign: 'left',
},
properties: {
proofFileList: {
title: '附件',
'x-component': 'AntUpload',
'x-component-props': {
action: '/api/file/file/upload/prefix',
data: {
fileType: UPLOAD_TYPE,
prefix: '/afterService/returnApplication/',
},
beforeUpload: '{{beforeUpload}}',
accept: '.xls, .xlsx, .doc, .docx, .wps, .pdf, .jpg, .png, .jpeg',
},
'x-rules': [
{
required: false,
message: '请上传附件',
},
],
description: '一次上传一个文件,每个附件大小不能超过20M',
},
},
},
},
},
'tab-4': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '退货收货地址',
},
properties: {
MEGA_LAYOUT4: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 12,
labelAlign: 'left',
},
properties: {
deliveryType: {
title: '配送方式',
type: 'string',
enum: DELIVERY_TYPE_ENUM,
'x-component-props': {
placeholder: '请选择',
},
'x-rules': [
{
required: true,
message: '请选择配送方式',
},
],
},
// 退货发货地址
shippingAddress: {
title: '退货发货地址',
type: 'string',
visible: false,
'x-component': 'AddressFormItem',
'x-component-props': {
dataSource: [],
},
'x-rules': [
{
required: true,
message: '请选择退货发货地址',
},
],
},
// 退货自提地址
pickupAddress: {
title: '退货自提地址',
type: 'string',
visible: false,
'x-component': 'AddressFormItem',
'x-component-props': {
dataSource: [],
},
'x-rules': [
{
required: true,
message: '请选择退货自提地址',
},
],
},
// 换货收货地址
deliveryAddress: {
title: '换货收货地址',
type: 'string',
'x-component': 'AddressFormItem',
'x-component-props': {
dataSource: [],
},
'x-rules': [
{
required: true,
message: '请选择换货收货地址',
},
],
},
},
},
},
},
},
},
},
};
\ No newline at end of file
import { ISchema } from '@formily/antd';
import Search from '@/components/NiceForm/components/Search';
import Submit from '@/components/NiceForm/components/Submit';
import { PATTERN_MAPS } from '@/constants/regExp';
import { UPLOAD_TYPE } from '@/constants';
import { PublicApi } from '@/services/api';
// 供应会员列表列
const supplierColumns = [
{
title: '会员ID',
dataIndex: 'memberId',
align: 'center',
},
{
title: '会员名称',
dataIndex: 'name',
align: 'center',
},
{
title: '会员类型',
dataIndex: 'memberTypeName',
align: 'center',
},
{
title: '会员角色',
dataIndex: 'roleName',
align: 'center',
},
{
title: '会员等级',
dataIndex: 'levelTag',
align: 'center',
},
];
// 获取供应会员
const getSupplier = async (params) => {
const res = await PublicApi.getMemberManageUpperProviderPage({
...params,
})
if (res.code === 1000) {
return res.data;
}
return { totalCount: 0, data: [] };
};
const supplierSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'Mega-Layout',
properties: {
name: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: '搜索',
align: 'flex-start',
advanced: false,
tip: '输入 供应会员名称 进行搜索',
},
},
},
},
},
};
export const addBillSchema: ISchema = {
type: 'object',
properties: {
REPOSIT_TABS: {
type: 'object',
'x-component': 'tab',
'x-component-props': {
type: 'card',
},
properties: {
'tab-1': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '基本信息',
},
properties: {
MEGA_LAYOUT1: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 12,
labelAlign: 'left',
},
properties: {
applyAbstract: {
type: 'string',
title: '申请单摘要',
'x-rules': [
{
required: true,
message: '请填写申请单摘要',
},
{
limitByte: true, // 自定义校验规则
maxByte: 60,
}
],
},
// 这是用 Mega-Layout 设置独立作用域,不然会被 Form 的布局影响到弹窗的布局
MEGA_LAYOUT1_1: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
wrapperCol: 24,
},
properties: {
supplierMember: {
type: 'string',
title: '供应会员',
'x-component': 'CustomRelevance',
'x-component-props': {
title: '关联',
tip: '请选择对应单据',
modalProps: {
title: '选择会员',
},
columns: supplierColumns,
fetchTableData: getSupplier,
formilyProps: {
ctx: {
schema: supplierSchema,
components: {
Search,
Submit,
},
effects: ($, actions) => {
},
inline: false,
}
},
tableProps: {
rowKey: 'memberId',
lableKey: 'name',
},
},
'x-mega-props': {
wrapperCol: 12,
},
'x-rules': [
{
required: true,
message: '请选择供应会员',
},
],
},
},
},
applyNo: {
type: 'string',
title: '申请单号',
'x-component': 'Text',
},
applyTime: {
type: 'string',
title: '单据时间',
'x-component': 'Text',
},
outerStatus: {
type: 'string',
title: '外部状态',
'x-component': 'Children',
'x-component-props': {
children: '{{OuterStatus}}'
},
},
innerStatus: {
type: 'string',
title: '内部状态',
'x-component': 'Children',
'x-component-props': {
children: '{{InnerStatus}}'
},
},
},
},
},
},
'tab-2': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '单据明细',
},
properties: {
MEGA_LAYOUT2: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
labelAlign: 'left',
},
properties: {
addBtn: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{TableAddButton}}'
},
},
repairGoodsList: {
type: 'array',
'x-component': 'ArrayTable',
'x-component-props': {
renderAddition: () => null,
renderRemove: '{{renderListTableRemove}}',
renderMoveDown: () => null,
renderMoveUp: () => null,
operationsWidth: 100,
operations: {
align: 'center',
},
},
'x-rules': [
{
required: true,
message: '请选择维修商品',
},
],
items: {
type: 'object',
properties: {
orderNo: {
type: 'string',
title: '订单号',
'x-component': 'Text',
},
productId: {
type: 'string',
title: '商品ID',
'x-component': 'Text',
},
productName: {
type: 'string',
title: '商品名称',
'x-component': 'Text',
},
category: {
type: 'string',
title: '品类',
'x-component': 'Text',
},
brand: {
type: 'string',
title: '品牌',
'x-component': 'Text',
},
unit: {
type: 'string',
title: '单位',
'x-component': 'Text',
},
// 采购数量
purchaseCount: {
type: 'string',
title: '采购数量',
'x-component': 'Text',
},
repairCount: {
type: 'string',
title: '维修数量',
'x-component-props': {
allowClear: true,
style: {
maxWidth: 150,
},
},
'x-rules': [
{
required: true,
message: '请填写维修数量',
},
{
pattern: PATTERN_MAPS.weight,
message: '请填写正数,最多保留3位小数',
},
],
},
repairReason: {
type: 'string',
title: '维修原因',
'x-component-props': {
allowClear: true,
style: {
maxWidth: 150,
},
},
'x-rules': [
{
required: true,
message: '请填写维修原因',
},
{
limitByte: true, // 自定义校验规则
maxByte: 60,
}
],
},
// 其他数据,不用于展示,只用于收集值
extraData: {
type: 'string',
display: false,
},
},
}
},
},
},
},
},
'tab-3': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '相关附件',
},
properties: {
MEGA_LAYOUT3: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
labelAlign: 'left',
},
properties: {
faultFileList: {
title: '附件',
'x-component': 'AntUpload',
'x-component-props': {
action: '/api/file/file/upload/prefix',
data: {
fileType: UPLOAD_TYPE,
prefix: '/afterService/repairApplication/',
},
beforeUpload: '{{beforeUpload}}',
accept: '.xls, .xlsx, .doc, .docx, .wps, .pdf, .jpg, .png, .jpeg',
},
'x-rules': [
{
required: false,
message: '请上传附件',
},
],
description: '一次上传一个文件,每个附件大小不能超过20M',
},
},
},
},
},
'tab-4': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '维修地址',
},
properties: {
MEGA_LAYOUT3: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
labelAlign: 'left',
},
properties: {
repairAddress: {
title: '维修地址',
type: 'string',
'x-component': 'AddressFormItem',
'x-component-props': {
dataSource: [],
},
'x-rules': [
{
required: true,
message: '请选择维修地址',
},
],
},
},
},
},
},
},
},
},
import { ISchema } from '@formily/antd';
import Search from '@/components/NiceForm/components/Search';
import Submit from '@/components/NiceForm/components/Submit';
import { PATTERN_MAPS } from '@/constants/regExp';
import { UPLOAD_TYPE } from '@/constants';
import { PublicApi } from '@/services/api';
// 供应会员列表列
const supplierColumns = [
{
title: '会员ID',
dataIndex: 'memberId',
align: 'center',
},
{
title: '会员名称',
dataIndex: 'name',
align: 'center',
},
{
title: '会员类型',
dataIndex: 'memberTypeName',
align: 'center',
},
{
title: '会员角色',
dataIndex: 'roleName',
align: 'center',
},
{
title: '会员等级',
dataIndex: 'levelTag',
align: 'center',
},
];
// 获取供应会员
const getSupplier = async (params) => {
const res = await PublicApi.getMemberManageAftersaleReplacePage({
...params,
})
if (res.code === 1000) {
return res.data;
}
return { totalCount: 0, data: [] };
};
const supplierSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'Mega-Layout',
properties: {
name: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: '搜索',
align: 'flex-start',
advanced: false,
tip: '输入 供应会员名称 进行搜索',
},
},
},
},
},
};
export const addBillSchema: ISchema = {
type: 'object',
properties: {
REPOSIT_TABS: {
type: 'object',
'x-component': 'tab',
'x-component-props': {
type: 'card',
},
properties: {
'tab-1': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '基本信息',
},
properties: {
MEGA_LAYOUT1: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 12,
labelAlign: 'left',
},
properties: {
applyAbstract: {
type: 'string',
title: '申请单摘要',
'x-rules': [
{
required: true,
message: '请填写申请单摘要',
},
{
limitByte: true, // 自定义校验规则
maxByte: 60,
}
],
},
// 这是用 Mega-Layout 设置独立作用域,不然会被 Form 的布局影响到弹窗的布局
MEGA_LAYOUT1_1: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
wrapperCol: 24,
},
properties: {
supplierMember: {
type: 'string',
title: '供应会员',
'x-component': 'CustomRelevance',
'x-component-props': {
title: '关联',
tip: '请选择对应单据',
modalProps: {
title: '选择会员',
},
columns: supplierColumns,
fetchTableData: getSupplier,
formilyProps: {
ctx: {
schema: supplierSchema,
components: {
Search,
Submit,
},
effects: ($, actions) => {
},
inline: false,
}
},
tableProps: {
rowKey: 'memberId',
lableKey: 'name',
},
},
'x-mega-props': {
wrapperCol: 12,
},
'x-rules': [
{
required: true,
message: '请选择供应会员',
},
],
},
},
},
applyNo: {
type: 'string',
title: '申请单号',
'x-component': 'Text',
},
applyTime: {
type: 'string',
title: '单据时间',
'x-component': 'Text',
},
outerStatus: {
type: 'string',
title: '外部状态',
'x-component': 'Children',
'x-component-props': {
children: '{{OuterStatus}}'
},
},
innerStatus: {
type: 'string',
title: '内部状态',
'x-component': 'Children',
'x-component-props': {
children: '{{InnerStatus}}'
},
},
},
},
},
},
'tab-2': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '单据明细',
},
properties: {
MEGA_LAYOUT2: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
labelAlign: 'left',
},
properties: {
addBtn: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{TableAddButton}}'
},
},
repairGoodsList: {
type: 'array',
'x-component': 'ArrayTable',
'x-component-props': {
renderAddition: () => null,
renderRemove: '{{renderListTableRemove}}',
renderMoveDown: () => null,
renderMoveUp: () => null,
operationsWidth: 100,
operations: {
align: 'center',
},
},
'x-rules': [
{
required: true,
message: '请选择维修商品',
},
],
items: {
type: 'object',
properties: {
orderNo: {
type: 'string',
title: '订单号',
'x-component': 'Text',
},
productId: {
type: 'string',
title: '商品ID',
'x-component': 'Text',
},
productName: {
type: 'string',
title: '商品名称',
'x-component': 'Text',
},
category: {
type: 'string',
title: '品类',
'x-component': 'Text',
},
brand: {
type: 'string',
title: '品牌',
'x-component': 'Text',
},
unit: {
type: 'string',
title: '单位',
'x-component': 'Text',
},
// 采购数量
purchaseCount: {
type: 'string',
title: '采购数量',
'x-component': 'Text',
},
repairCount: {
type: 'string',
title: '维修数量',
'x-component-props': {
allowClear: true,
style: {
maxWidth: 150,
},
},
'x-rules': [
{
required: true,
message: '请填写维修数量',
},
{
pattern: PATTERN_MAPS.weight,
message: '请填写正数,最多保留3位小数',
},
],
},
repairReason: {
type: 'string',
title: '维修原因',
'x-component-props': {
allowClear: true,
style: {
maxWidth: 150,
},
},
'x-rules': [
{
required: true,
message: '请填写维修原因',
},
{
limitByte: true, // 自定义校验规则
maxByte: 60,
}
],
},
// 其他数据,不用于展示,只用于收集值
extraData: {
type: 'string',
display: false,
},
},
}
},
},
},
},
},
'tab-3': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '相关附件',
},
properties: {
MEGA_LAYOUT3: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
labelAlign: 'left',
},
properties: {
faultFileList: {
title: '附件',
'x-component': 'AntUpload',
'x-component-props': {
action: '/api/file/file/upload/prefix',
data: {
fileType: UPLOAD_TYPE,
prefix: '/afterService/repairApplication/',
},
beforeUpload: '{{beforeUpload}}',
accept: '.xls, .xlsx, .doc, .docx, .wps, .pdf, .jpg, .png, .jpeg',
},
'x-rules': [
{
required: false,
message: '请上传附件',
},
],
description: '一次上传一个文件,每个附件大小不能超过20M',
},
},
},
},
},
'tab-4': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '维修地址',
},
properties: {
MEGA_LAYOUT3: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
labelAlign: 'left',
},
properties: {
repairAddress: {
title: '维修地址',
type: 'string',
'x-component': 'AddressFormItem',
'x-component-props': {
dataSource: [],
},
'x-rules': [
{
required: true,
message: '请选择维修地址',
},
],
},
},
},
},
},
},
},
},
};
\ No newline at end of file
......@@ -36,7 +36,7 @@ const supplierColumns = [
// 获取供应会员
const getSupplier = async (params) => {
const res = await PublicApi.getMemberManageUpperProviderPage({
const res = await PublicApi.getMemberManageAftersaleReplacePage({
...params,
})
if (res.code === 1000) {
......
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