Commit afddf914 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫
parents 36931760 8423690b
......@@ -86,6 +86,14 @@ const route: RouterChild = {
hideInMenu: true,
noMargin: true,
},
// 待新增退货发货单-新增
{
path: '/memberCenter/afterService/returnApplication/returnPrAddDeliver/add',
name: 'returnAddDeliverBill',
component: '@/pages/afterService/returnApplication/returnPrAddDeliver/addDeliverBill',
hideInMenu: true,
noMargin: true,
},
// 待新增退货发货单-订单详情
{
path: '/memberCenter/afterService/returnApplication/returnPrAddDeliver/orderDetail',
......
......@@ -146,6 +146,7 @@ registerVirtualBox('ColumnLayout', (_props) => {
const xComponentProps = props['x-component-props'] || {};
const {
column = 3,
gutter = 20,
} = xComponentProps;
const span = 24 / column;
......@@ -160,7 +161,7 @@ registerVirtualBox('ColumnLayout', (_props) => {
return (
<Row
gutter={20}
gutter={gutter}
>
{cols.map((item, index) => (
<Col key={index} span={span}>
......
......@@ -591,6 +591,7 @@ export default {
'menu.afterService.returnApplication.addReturnPrSubmit': '新建退货申请单',
'menu.afterService.returnApplication.editReturnPrSubmit': '编辑退货申请单',
'menu.afterService.returnApplication.returnPrAddDeliver': '待新增退货发货单',
'menu.afterService.returnApplication.returnAddDeliverBill': '新增退货发货单',
'menu.afterService.returnApplication.returnPrAddLogistics': '待新增物流单',
'menu.afterService.returnApplication.returnPrDeliver': '待退货发货',
'menu.afterService.returnApplication.verifyReturnPrDeliver': '退货发货',
......
/*
* @Author: XieZhiXiong
* @Date: 2021-08-04 15:53:06
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-04 16:49:47
* @Description: 新增退货发货单
*/
import React from 'react';
import { DOC_TYPE_RETURN_INVOICE } from '@/constants/commodity';
import BillsFormPage, { RelatedInfoType } from '@/pages/transaction/stockSellStorage/bills/components/BillsFormPage';
import { PATTERN_MAPS } from '@/constants/regExp';
import { usePageStatus } from '@/hooks/usePageStatus';
const ReturnAddDeliverBill = () => {
const { id } = usePageStatus();
const fetchRelatedInfo = (): Promise<RelatedInfoType> => {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve({
relatedNo: 'FPTY12',
memberName: '温州龙昌手袋有限公司',
address: '张三 / 185 2929 6758 广东省广州市海珠区新港东路1068号中洲中心北塔6楼',
logisticsTypeName: '物流',
});
}, 2000);
});
};
return (
<BillsFormPage
billType={DOC_TYPE_RETURN_INVOICE}
fetchRelatedInfo={fetchRelatedInfo}
/>
);
};
export default ReturnAddDeliverBill;
/*
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-04 11:29:53
* @Description:
*/
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from '../components/DetailInfo';
const ReturnPrAddDeliverDetail: React.FC = () => {
const { id, creditId } = usePageStatus();
const { id } = usePageStatus();
return (
<DetailInfo
......
......@@ -426,7 +426,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
<div className={styles.upload_left}>
<LinkOutlined style={{ marginRight: '5px' }} />
<Typography.Link
href={`/api/contract/contractTemplate/downloadContract?contractName=${file.albumName}&contractUrl=${file.albumURL}`}
href={`/api/contract/contractTemplate/downloadContract?contractName=${file.albumName}&contractUrl=${file.albumUrl}`}
target="_blank"
>
{file.albumName}
......
......@@ -105,21 +105,21 @@ const ChannelSeoAdded = () => {
label={<RequireItem label="标题" isRequire={true} brief={<Tooltip placement="top" title="用于显示在页面title标签的内容,便于搜索引擎抓取"><QuestionCircleOutlined /></Tooltip>} />}
rules={[{ required: true, message: "请输入标题" }]}
>
<Input maxLength={50} disabled={link === 'detail'} placeholder='最长100个字符,50个汉字' />
<Input maxLength={50} disabled={link === 'detail'} placeholder='最长50个汉字' />
</Form.Item>
<Form.Item
name='description'
label={<RequireItem label="描述" isRequire={true} brief={<Tooltip placement="top" title="用于显示在页面Description标签的内容,便于搜索引擎抓取"><QuestionCircleOutlined /></Tooltip>} />}
rules={[{ required: true, message: "请输入描述" }]}
>
<Input.TextArea disabled={link === 'detail'} rows={5} placeholder="最长200个字符,100个汉字" maxLength={100} />
<Input.TextArea disabled={link === 'detail'} rows={5} placeholder="最长200个汉字" maxLength={200} />
</Form.Item>
<Form.Item
name='keywords'
label={<RequireItem label="关键字" isRequire={true} brief={<Tooltip placement="top" title="用于显示在页面Keywords标签的内容,便于搜索引擎通过关键词搜索时抓取页面,多个关键词用豆号分隔"><QuestionCircleOutlined /></Tooltip>} />}
rules={[{ required: true, message: "请输入关键字" }]}
>
<Input.TextArea disabled={link === 'detail'} rows={5} placeholder="最长200个字符,100个汉字" maxLength={100} />
<Input.TextArea disabled={link === 'detail'} rows={5} placeholder="最长100个汉字" maxLength={100} />
</Form.Item>
</Form>
</TabPane>
......
......@@ -136,7 +136,7 @@ const FormList = (props: any) => {
bidCount: sourceType == '1' ? item.awardTaxProbability * item.purchaseCount / 100 : sourceType == '2' ? item.awardTenderRatio * item.inviteTenderMateriel.count / 100 : item.purchaseCount,
bidAmount: sourceType == '1' ? item.awardTaxProbability * item.purchaseCount / 100 * item.taxUnitPrice : sourceType == '2' ? item.awardTenderRatio * item.inviteTenderMateriel.count / 100 * item.price : item.price,
// productBrand
associatedType: _filter(sourceType, item, ['', '', '', '']),
associatedType: _filter(sourceType, item, ['', 'productAttributeJson', '', '']).split('-')[1],
associatedBrand: _filter(sourceType, item, ['', 'productBrand', '', '']),
associatedDataId: _filter(sourceType, item, ['', 'productId', 'commoditySkuId']), // 关联商品id
associatedMaterielNo: _filter(sourceType, item, ['', 'number', 'commodityAttribute']), // 关联物料编号
......@@ -147,6 +147,7 @@ const FormList = (props: any) => {
rowId: index,
}
})
console.log(data)
setData(data)
}
}).catch(err => {
......
......@@ -414,7 +414,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
<div className={styles.upload_left}>
<LinkOutlined style={{ marginRight: '5px' }} />
<Typography.Link
href={`/api/contract/contractTemplate/downloadContract?contractName=${file.albumName}&contractUrl=${file.albumURL}`}
href={`/api/contract/contractTemplate/downloadContract?contractName=${file.albumName}&contractUrl=${file.albumUrl}`}
target="_blank"
>
{file.albumName}
......
......@@ -106,21 +106,21 @@ const ShopSeoAdded = () => {
label={<RequireItem label="标题" isRequire={true} brief={<Tooltip placement="top" title="用于显示在页面title标签的内容,便于搜索引擎抓取"><QuestionCircleOutlined /></Tooltip>} />}
rules={[{ required: true, message: "请输入标题" }]}
>
<Input maxLength={50} disabled={link === 'detail'} placeholder='最长100个字符,50个汉字' />
<Input maxLength={50} disabled={link === 'detail'} placeholder='最长50个汉字' />
</Form.Item>
<Form.Item
name='description'
label={<RequireItem label="描述" isRequire={true} brief={<Tooltip placement="top" title="用于显示在页面Description标签的内容,便于搜索引擎抓取"><QuestionCircleOutlined /></Tooltip>} />}
rules={[{ required: true, message: "请输入描述" }]}
>
<Input.TextArea disabled={link === 'detail'} rows={5} placeholder="最长200个字符,100个汉字" maxLength={100} />
<Input.TextArea disabled={link === 'detail'} rows={5} placeholder="最长200个汉字" maxLength={200} />
</Form.Item>
<Form.Item
name='keywords'
label={<RequireItem label="关键字" isRequire={true} brief={<Tooltip placement="top" title="用于显示在页面Keywords标签的内容,便于搜索引擎通过关键词搜索时抓取页面,多个关键词用豆号分隔"><QuestionCircleOutlined /></Tooltip>} />}
rules={[{ required: true, message: "请输入关键字" }]}
>
<Input.TextArea disabled={link === 'detail'} rows={5} placeholder="最长200个字符,100个汉字" maxLength={100} />
<Input.TextArea disabled={link === 'detail'} rows={5} placeholder="最长100个汉字" maxLength={100} />
</Form.Item>
</Form>
</TabPane>
......
/*
* @Author: XieZhiXiong
* @Date: 2021-08-04 14:42:57
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-04 17:59:35
* @Description:
*/
import { FormPath, FormEffectHooks } from '@formily/antd';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { PublicApi } from '@/services/api';
import { useBusinessEffects } from './useBusinessEffects';
const {
onFieldMount$,
} = FormEffectHooks;
// 获取单据类型
const fetchInvoicesType = (): Promise<any[]> => {
return new Promise((resolve, reject) => {
PublicApi.getProductInvoicesTypeAll().then(res => {
if (res.code === 1000) {
resolve(res.data);
}
reject();
}).catch(() => {
reject();
});
});
};
// 获取仓库
const fetchInventory = (): Promise<any[]> => {
return new Promise((resolve, reject) => {
PublicApi.getProductWarehouseAll().then(res => {
if (res.code === 1000) {
resolve(res.data);
}
reject();
}).catch(() => {
reject();
});
});
};
export const createEffects = (context, actions) => {
const { setFieldState } = actions;
useBusinessEffects(context, actions);
useAsyncSelect('billType', fetchInvoicesType, ['name', 'id']);
useAsyncSelect('inventoryId', fetchInventory, ['name', 'id']);
};
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-08-04 14:43:14
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-04 18:00:12
* @Description:
*/
import { FormEffectHooks, FormPath, IFormActions } from '@formily/antd';
import { useLinkageUtils } from '@/utils/formEffectUtils';
const {
onFieldInputChange$,
onFieldValueChange$,
} = FormEffectHooks;
export const useBusinessEffects = (context, actions: IFormActions) => {
const { getFieldValue, setFieldState, setFieldValue, getFieldState } = actions;
const linkage = useLinkageUtils();
// 对应仓库改变
onFieldInputChange$('inventoryId').subscribe(fieldState => {
const current = fieldState.originAsyncData.find(item => item.id === fieldState.value);
if (current) {
linkage.value('inventoryRole', current.principal);
}
});
}
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-08-04 11:33:33
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-04 17:55:28
* @Description: 单据表单组件,提供基础的表单内容,单据明细相关由外部传入控制
*/
import React, { useEffect, useState } from 'react';
import { Button, Spin } from 'antd';
import { createFormActions, FormEffectHooks, ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd';
import { Radio, ArrayTable } from '@formily/antd-components';
import {
DOC_TYPE_PURCHASE_RECEIPT,
DOC_TYPE_SALES_INVOICE,
DOC_TYPE_PROCESS_RECEIPT,
DOC_TYPE_PROCESS_INVOICE,
DOC_TYPE_RETURN_INVOICE,
DOC_TYPE_RETURN_RECEIPT,
DOC_TYPE_EXCHANGE_RETURN_INVOICE,
DOC_TYPE_EXCHANGE_RETURN_RECEIPT,
DOC_TYPE_EXCHANGE_INVOICE,
DOC_TYPE_EXCHANGE_RECEIPT,
} from '@/constants/commodity';
import AnchorPage from '@/layouts/AnchorPage';
import NiceForm from '@/components/NiceForm';
import createSchema, { BillDetailSchemaType, BILL_DETAIL_KEY } from './schema';
import { createEffects } from './effects';
import EllipsisText from '../EllipsisText';
const TITLE_MAP = {
[DOC_TYPE_PURCHASE_RECEIPT]: '采购入库单',
[DOC_TYPE_SALES_INVOICE]: '销售发货单',
[DOC_TYPE_PROCESS_RECEIPT]: '加工入库单',
[DOC_TYPE_PROCESS_INVOICE]: '加工发货单',
[DOC_TYPE_RETURN_INVOICE]: '退货发货单',
[DOC_TYPE_RETURN_RECEIPT]: '退货入库单',
[DOC_TYPE_EXCHANGE_RETURN_INVOICE]: '换货退货发货单',
[DOC_TYPE_EXCHANGE_RETURN_RECEIPT]: '换货退货入货单',
[DOC_TYPE_EXCHANGE_INVOICE]: '换货发货单',
[DOC_TYPE_EXCHANGE_RECEIPT]: '换货入库单',
};
const formActions = createFormActions();
const {
onFieldValueChange$,
onFieldInputChange$,
onFormInputChange$,
} = FormEffectHooks;
export type RelatedInfoType = {
/**
* 关联单据编号
*/
relatedNo: string,
/**
* 会员名称
*/
memberName: string,
/**
* 收货地址 或 发货地址
*/
address: string,
/**
* 物流方式名称
*/
logisticsTypeName: string,
}
interface IProps {
/**
* 单据类型
*/
billType: number,
/**
* 是否可编辑的
*/
editable?: boolean,
/**
* 获取对应单据详情
*/
fetchRelatedInfo: () => Promise<RelatedInfoType>,
}
const BillsFormPage: React.FC<IProps> = (props: IProps) => {
const {
billType,
editable = true,
fetchRelatedInfo,
} = props;
const [relatedLoading, setRelatedLoading] = useState(false);
const [unsaved, setUnsaved] = useState(false);
const getRelatedInfo = () => {
if (fetchRelatedInfo) {
setRelatedLoading(true);
fetchRelatedInfo().then((res) => {
console.log('res', res)
}).finally(() => {
setRelatedLoading(false);
});
}
};
useEffect(() => {
getRelatedInfo();
}, []);
const anchorsArr = [
{
key: 'basicInfo',
name: '基本信息',
},
{
key: 'billDetail',
name: '单据明细',
},
];
const handleSubmit = (values: any) => {
};
return (
<Spin spinning={relatedLoading}>
<AnchorPage
title={TITLE_MAP[1]}
anchors={anchorsArr}
extra={(
<Button type="primary">保存</Button>
)}
>
<NiceForm
previewPlaceholder=" "
onSubmit={handleSubmit}
actions={formActions}
initialValues={{}}
components={{
RadioGroup: Radio.Group,
ArrayTable,
Text: EllipsisText,
}}
effects={($, actions) => {
createEffects($, actions);
onFormInputChange$().subscribe(() => {
if (!unsaved) {
setUnsaved(true);
}
});
}}
schema={createSchema(billType)}
editable={!!editable}
/>
</AnchorPage>
</Spin>
);
};
export default BillsFormPage;
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