Commit 65db2fd9 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫
parents 0729c408 64c7d643
import React, { useState, useEffect } from 'react';
import { Input, Space, Select, Button, Cascader } from 'antd';
import { useFieldState, FormPath, FormEffectHooks, useFormEffects } from '@formily/antd';
/**
* 筛选项 搜索和远程数据结合的 Cascader
* 属性Data数据暂存至schema的props下的dataOption
*/
const CustomCategorySearch = props => {
const justifyAlign = props.props['x-component-props'].align || 'flex-end'
const option = props.props['x-component-props'].dataoption
const [dataOption, setDataOption] = useState<any>([])
const [value, setValue] = useState<any>([])
useEffect(() => {
setDataOption(option)
}, [option])
useFormEffects(() => {
FormEffectHooks.onFormReset$().subscribe(() => {
setValue([])
})
})
const onChange = (value, selectedOptions) => {
props.mutators.change(value[value.length - 1])
setValue(value)
}
const displayRender = (label) => {
return label[label.length - 1];
}
return (
<Space size={20} style={{ justifyContent: justifyAlign, width: '100%' }}>
<Cascader
options={dataOption}
onChange={onChange}
value={value}
displayRender={displayRender}
{...props.props['x-component-props']}
/>
</Space>
);
};
CustomCategorySearch.defaultProps = {};
CustomCategorySearch.isFieldComponent = true;
export default CustomCategorySearch;
import React from 'react';
import SchemaForm, {
IAntdSchemaFormProps, createVirtualBox, registerVirtualBox, Schema, SchemaField, FormButtonGroup, Reset, createControllerBox, registerValidationRules,
} from '@formily/antd';
import { Button, Space, Row, Col, DatePicker } from 'antd';
import CustomUpload from './components/CustomUpload';
import CustomStatus from './components/CustomStatus';
import CustomAddArray from './components/CustomAddArray';
import CustomSlider from './components/CustomSlider';
import Search from './components/Search';
import CustomInputSearch from './components/CustomInputSearch'
import Submit from './components/Submit';
import Text from './components/Text';
import CardCheckBox from './components/CardCheckBox';
import MultTable from './components/MultTable';
import CustomRegistryPhone from './components/CustomRegistryPhone';
import CustomRelevance from './components/CustomRelevance';
import Children from './components/Children';
import CircleBox from './components/CircleBox';
import Phone from './components/Phone';
import CustomRadio from './components/CustomRadio';
import Select from './components/Select';
import SearchSelect from './components/SearchSelect';
import TableTagList from './components/TableTagList';
import './index.less'
import { Checkbox, Radio } from '@formily/antd-components';
import DateSelect from './components/DateSelect';
import DateRangePickerUnix from './components/DateRangePickerUnix';
import NumberRange from './components/NumberRange';
import VirtualChildren from './components/VirtualChildren';
import SmilingFace from './components/SmilingFace';
import SliderValidate from './components/SliderValidate';
import AntUpload from './components/AntUpload';
import { useLinkComponentProps } from './linkages/linkComponentProps';
import Loading from '../Loading';
export interface NiceFormProps extends IAntdSchemaFormProps {
loading?: boolean
}
const SchemaFormButtonGroup = createVirtualBox('schemaButtonGroup', FormButtonGroup)
const SchemaButton = createVirtualBox('schemaButton', Button)
const SchemaSubmit = createVirtualBox('schemaSubmit', Submit)
const SchemaReset = createVirtualBox('schemaReset', Reset)
export const FlexBox = createVirtualBox('flexBox', props => <Row {...props}/>)
// 自定义校验规则
registerValidationRules({
limitByte: (value, desc, rules) => {
const { allowChineseTransform = true, maxByte } = desc;
let str = value;
let message = `不能超过${maxByte}个字符`
if (allowChineseTransform) {
str = str.replace(/[\u4E00-\u9FA5]/g, "AA");
message += `,或者${maxByte / 2}个汉字`
}
return str.length > maxByte ? message : "";
}
});
// 该组件用于schema中嵌套表单, 不过控制台会出现警告
const schemaLayout = createControllerBox("schemaLayout", (_props) => {
const { schema } = _props;
const componentProps = schema.getExtendsComponentProps();
const { properties } = schema.toJSON();
const nestedSchema = new Schema({
type: "object",
properties
});
// const { visible, title, onCancel, footer, ...others } = componentProps;
return (
<NiceForm>
<SchemaField schema={nestedSchema}></SchemaField>
</NiceForm>
);
});
export const componentExport = {
CheckboxSingle: Checkbox,
CustomUpload,
CustomStatus,
CustomAddArray,
CustomSlider,
CustomRadio,
Search,
CustomInputSearch,
Submit,
Text,
CardCheckBox,
MultTable,
CustomRegistryPhone,
CustomRelevance,
Children,
CircleBox,
SchemaFormButtonGroup,
FlexBox,
Phone,
Select,
SearchSelect,
DateRangePicker: DatePicker.RangePicker,
TableTagList,
DateSelect,
DateRangePickerUnix,
NumberRange,
VirtualChildren,
SmilingFace,
SliderValidate,
RadioGroup: Radio.Group,
AntUpload,
}
const NiceForm: React.FC<NiceFormProps> = props => {
const { children, components, effects, expressionScope, loading = false, ...reset } = props;
const defineComponents = Object.assign(componentExport, components);
return (
<div style={{width: '100%', position: 'relative'}}>
<SchemaForm
colon={false}
components={defineComponents}
style={{opacity: loading ? 0 : 1, position: loading ? 'absolute' : 'initial'}}
effects={($, ctx) => {
// 自定义联动scope收集器
useLinkComponentProps(expressionScope)
// 组件联动
effects && effects($, ctx)
}}
expressionScope={expressionScope}
{...reset}
>
{children}
</SchemaForm>
{ loading && <Loading/> }
</div>
);
};
NiceForm.defaultProps = {};
export default NiceForm;
import React from 'react';
import SchemaForm, {
IAntdSchemaFormProps, createVirtualBox, registerVirtualBox, Schema, SchemaField, FormButtonGroup, Reset, createControllerBox, registerValidationRules,
} from '@formily/antd';
import { Button, Space, Row, Col, DatePicker } from 'antd';
import CustomUpload from './components/CustomUpload';
import CustomStatus from './components/CustomStatus';
import CustomAddArray from './components/CustomAddArray';
import CustomSlider from './components/CustomSlider';
import Search from './components/Search';
import CustomInputSearch from './components/CustomInputSearch';
import CustomCategorySearch from './components/CustomCategorySearch';
import Submit from './components/Submit';
import Text from './components/Text';
import CardCheckBox from './components/CardCheckBox';
import MultTable from './components/MultTable';
import CustomRegistryPhone from './components/CustomRegistryPhone';
import CustomRelevance from './components/CustomRelevance';
import Children from './components/Children';
import CircleBox from './components/CircleBox';
import Phone from './components/Phone';
import CustomRadio from './components/CustomRadio';
import Select from './components/Select';
import SearchSelect from './components/SearchSelect';
import TableTagList from './components/TableTagList';
import './index.less'
import { Checkbox, Radio } from '@formily/antd-components';
import DateSelect from './components/DateSelect';
import DateRangePickerUnix from './components/DateRangePickerUnix';
import NumberRange from './components/NumberRange';
import VirtualChildren from './components/VirtualChildren';
import SmilingFace from './components/SmilingFace';
import SliderValidate from './components/SliderValidate';
import AntUpload from './components/AntUpload';
import { useLinkComponentProps } from './linkages/linkComponentProps';
import Loading from '../Loading';
export interface NiceFormProps extends IAntdSchemaFormProps {
loading?: boolean
}
const SchemaFormButtonGroup = createVirtualBox('schemaButtonGroup', FormButtonGroup)
const SchemaButton = createVirtualBox('schemaButton', Button)
const SchemaSubmit = createVirtualBox('schemaSubmit', Submit)
const SchemaReset = createVirtualBox('schemaReset', Reset)
export const FlexBox = createVirtualBox('flexBox', props => <Row {...props}/>)
// 自定义校验规则
registerValidationRules({
limitByte: (value, desc, rules) => {
const { allowChineseTransform = true, maxByte } = desc;
let str = value;
let message = `不能超过${maxByte}个字符`
if (allowChineseTransform) {
str = str.replace(/[\u4E00-\u9FA5]/g, "AA");
message += `,或者${maxByte / 2}个汉字`
}
return str.length > maxByte ? message : "";
}
});
// 该组件用于schema中嵌套表单, 不过控制台会出现警告
const schemaLayout = createControllerBox("schemaLayout", (_props) => {
const { schema } = _props;
const componentProps = schema.getExtendsComponentProps();
const { properties } = schema.toJSON();
const nestedSchema = new Schema({
type: "object",
properties
});
// const { visible, title, onCancel, footer, ...others } = componentProps;
return (
<NiceForm>
<SchemaField schema={nestedSchema}></SchemaField>
</NiceForm>
);
});
export const componentExport = {
CheckboxSingle: Checkbox,
CustomUpload,
CustomStatus,
CustomAddArray,
CustomSlider,
CustomRadio,
Search,
CustomInputSearch,
CustomCategorySearch,
Submit,
Text,
CardCheckBox,
MultTable,
CustomRegistryPhone,
CustomRelevance,
Children,
CircleBox,
SchemaFormButtonGroup,
FlexBox,
Phone,
Select,
SearchSelect,
DateRangePicker: DatePicker.RangePicker,
TableTagList,
DateSelect,
DateRangePickerUnix,
NumberRange,
VirtualChildren,
SmilingFace,
SliderValidate,
RadioGroup: Radio.Group,
AntUpload,
}
const NiceForm: React.FC<NiceFormProps> = props => {
const { children, components, effects, expressionScope, loading = false, ...reset } = props;
const defineComponents = Object.assign(componentExport, components);
return (
<div style={{width: '100%', position: 'relative'}}>
<SchemaForm
colon={false}
components={defineComponents}
style={{opacity: loading ? 0 : 1, position: loading ? 'absolute' : 'initial'}}
effects={($, ctx) => {
// 自定义联动scope收集器
useLinkComponentProps(expressionScope)
// 组件联动
effects && effects($, ctx)
}}
expressionScope={expressionScope}
{...reset}
>
{children}
</SchemaForm>
{ loading && <Loading/> }
</div>
);
};
NiceForm.defaultProps = {};
export default NiceForm;
......@@ -15,6 +15,7 @@ import logo from '../../mockStatic/logo.png'
import MenuSlider from './components/MenuSlider'
import { getMatchMenu } from '@umijs/route-utils';
import { useGlobal } from '@/models/useGlobal';
import { MenuUnfoldOutlined, MenuFoldOutlined } from '@ant-design/icons';
export interface BasicLayoutProps extends ProLayoutProps {
breadcrumbNameMap: {
......@@ -71,9 +72,13 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
const [collapsed, setCollapsed] = useState(false)
const [selectedKeys, setSelectedKeys] = useState<string[] | undefined>([]);
// 获取全局状态
const [globalState, globalDispatch] = useGlobal()
const [globalState, globalDispatch] = useGlobal();
const isHome = location.pathname === '/memberCenter/home'
const handleMenuCollapse = (payload: boolean): void => {
if(isHome) {
return ;
}
setCollapsed(payload)
if (payload) {
setOpenKeys([])
......@@ -131,17 +136,24 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
}, [currentRouter, collapsed])
useLayoutEffect(() => {
if(location.pathname === '/memberCenter/home') {
if(isHome) {
setCollapsed(true)
} else {
setCollapsed(false);
}
}, [location.pathname])
const prolayoutStyle = isHome
? {
minHeight: '100vh',
minWidth: '1280px'
}
: {}
return (
<ProLayout
pageTitleRender={() => currentRouter ? currentRouter.name : window.location.href}
style={{ minHeight: '100vh', minWidth: "1500px" }}
style={prolayoutStyle}
logo={logo}
formatMessage={formatMessage}
menuHeaderRender={(logoDom, titleDom) => (
......@@ -151,6 +163,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
</Link>
)}
collapsed={collapsed}
collapsedButtonRender={(flag) => (isHome ? null : flag ? <MenuUnfoldOutlined /> : <MenuFoldOutlined/>) }
onCollapse={handleMenuCollapse}
disableContentMargin={currentRouter?.noMargin !== undefined}
breadcrumbRender={(routers = []) => [
......
......@@ -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-09-29 15:04:46
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-11 16:39:17
* @Description: 外部流转记录
*/
import React from 'react';
import { REPAIR_OUTER_STATUS } from '@/constants';
import MellowCard from '@/components/MellowCard';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import StatusTag from '@/components/StatusTag';
import { REPAIR_OUTER_STATUS_TAG_MAP } from '../../constants';
interface OuterCirculationRecordProps {
dataSource: {
roleName: string,
status: number | string,
operate: string,
operateTime: string,
opinion: string,
}[];
onPaginationChange?: (page: number, size: number) => void;
};
const OuterCirculationRecord: React.FC<OuterCirculationRecordProps> = ({
dataSource = [],
onPaginationChange,
}) => {
const columns: EditableColumns[] = [
{
title: '序号',
dataIndex: 'order',
align: 'center',
render: (_, record, index) => index + 1,
},
{
title: '操作角色',
dataIndex: 'roleName',
align: 'center',
},
{
title: '状态',
dataIndex: 'statusName',
align: 'center',
render: (text, record) => <StatusTag type={REPAIR_OUTER_STATUS_TAG_MAP[record.status]} title={text} />
},
{
title: '操作',
dataIndex: 'operate',
align: 'center',
ellipsis: true,
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
},
{
title: '审核意见',
dataIndex: 'opinion',
align: 'center',
ellipsis: true,
},
];
const handlePaginationChange = (page, size) => {
if (onPaginationChange) {
onPaginationChange(page, size);
}
};
return (
<MellowCard
title="外部流转记录"
>
<PolymericTable
rowKey="operateTime"
dataSource={dataSource}
columns={columns}
loading={false}
pagination={null}
/>
</MellowCard>
);
};
/*
* @Author: XieZhiXiong
* @Date: 2020-09-29 15:04:46
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-24 10:55:51
* @Description: 外部流转记录
*/
import React from 'react';
import { REPAIR_OUTER_STATUS } from '@/constants';
import MellowCard from '@/components/MellowCard';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import StatusTag from '@/components/StatusTag';
import { REPAIR_OUTER_STATUS_TAG_MAP } from '../../constants';
interface OuterCirculationRecordProps {
dataSource: {
roleName: string,
status: number | string,
operate: string,
operateTime: string,
opinion: string,
}[];
onPaginationChange?: (page: number, size: number) => void;
};
const OuterCirculationRecord: React.FC<OuterCirculationRecordProps> = ({
dataSource = [],
onPaginationChange,
}) => {
const columns: EditableColumns[] = [
{
title: '序号',
dataIndex: 'order',
align: 'center',
render: (_, record, index) => index + 1,
},
{
title: '操作角色',
dataIndex: 'roleName',
align: 'center',
},
{
title: '状态',
dataIndex: 'status',
align: 'center',
render: (text, record) => <StatusTag type={REPAIR_OUTER_STATUS_TAG_MAP[record.statusCode]} title={text} />
},
{
title: '操作',
dataIndex: 'operate',
align: 'center',
ellipsis: true,
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
},
{
title: '审核意见',
dataIndex: 'opinion',
align: 'center',
ellipsis: true,
},
];
const handlePaginationChange = (page, size) => {
if (onPaginationChange) {
onPaginationChange(page, size);
}
};
return (
<MellowCard
title="外部流转记录"
>
<PolymericTable
rowKey="operateTime"
dataSource={dataSource}
columns={columns}
loading={false}
pagination={null}
/>
</MellowCard>
);
};
export default OuterCirculationRecord;
\ No newline at end of file
/*
* @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-04 18:22:57
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-11 17:15:08
* @Description: 内、外部流转记录
*/
import React from 'react';
import {
Tabs,
Badge,
} from 'antd';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import MellowCard from '@/components/MellowCard';
import StatusTag from '@/components/StatusTag';
import {
REPAIR_OUTER_STATUS_TAG_MAP,
REPAIR_INNER_STATUS_BADGE_MAP,
} from '../../../constants';
import styles from './index.less';
export interface InnerHistoryItem {
step: number;
operator: string;
department: string;
jobTitle: string;
status: string;
operate: string;
operateTime: string,
opinion: string;
};
export interface OuterHistoryItem {
roleName: string;
status: string;
operate: string;
operateTime: string;
opinion: string;
};
interface FlowRecordsProps {
outerHistory?: OuterHistoryItem[];
innerHistory: InnerHistoryItem[];
};
const FlowRecords: React.FC<FlowRecordsProps> = ({ outerHistory = [], innerHistory }) => {
const outerColumns: EditableColumns[] = [
{
title: '序号',
dataIndex: 'index',
align: 'center',
render: (_, record, index) => index + 1,
},
{
title: '操作角色',
dataIndex: 'roleName',
align: 'center',
},
{
title: '状态',
dataIndex: 'statusName',
align: 'center',
render: (text, record) => (
<StatusTag type={REPAIR_OUTER_STATUS_TAG_MAP[record.status]} title={text} />
),
},
{
title: '操作',
dataIndex: 'operate',
align: 'center',
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
ellipsis: true,
},
{
title: '审核意见',
dataIndex: 'opinion',
align: 'center',
ellipsis: true,
},
];
const innerColumns: EditableColumns[] = [
{
title: '序号',
dataIndex: 'step',
align: 'center',
},
{
title: '操作人',
dataIndex: 'operator',
align: 'center',
},
{
title: '部门',
dataIndex: 'department',
align: 'center',
},
{
title: '职位',
dataIndex: 'jobTitle',
align: 'center',
},
{
title: '状态',
dataIndex: 'statusName',
align: 'center',
render: (text, record) => (
<Badge color={REPAIR_INNER_STATUS_BADGE_MAP[record.status]} text={text} />
),
},
{
title: '操作',
dataIndex: 'operate',
align: 'center',
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
ellipsis: true,
},
{
title: '审核意见',
dataIndex: 'opinion',
align: 'center',
ellipsis: true,
},
];
return (
<MellowCard>
<Tabs onChange={() => {}}>
{outerHistory ? (
<Tabs.TabPane tab="外部流转记录" key="1">
<PolymericTable
rowKey="operateTime"
dataSource={outerHistory}
columns={outerColumns}
loading={false}
pagination={null}
/>
</Tabs.TabPane>
) : null}
<Tabs.TabPane tab="内部流转记录" key="2">
<PolymericTable
rowKey="operateTime"
dataSource={innerHistory}
columns={innerColumns}
loading={false}
pagination={null}
/>
</Tabs.TabPane>
</Tabs>
</MellowCard>
);
};
/*
* @Author: XieZhiXiong
* @Date: 2020-11-04 18:22:57
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-24 10:55:25
* @Description: 内、外部流转记录
*/
import React from 'react';
import {
Tabs,
Badge,
} from 'antd';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import MellowCard from '@/components/MellowCard';
import StatusTag from '@/components/StatusTag';
import {
REPAIR_OUTER_STATUS_TAG_MAP,
REPAIR_INNER_STATUS_BADGE_MAP,
} from '../../../constants';
import styles from './index.less';
export interface InnerHistoryItem {
step: number;
operator: string;
department: string;
jobTitle: string;
status: string;
operate: string;
operateTime: string,
opinion: string;
};
export interface OuterHistoryItem {
roleName: string;
status: string;
operate: string;
operateTime: string;
opinion: string;
};
interface FlowRecordsProps {
outerHistory?: OuterHistoryItem[];
innerHistory: InnerHistoryItem[];
};
const FlowRecords: React.FC<FlowRecordsProps> = ({ outerHistory = [], innerHistory }) => {
const outerColumns: EditableColumns[] = [
{
title: '序号',
dataIndex: 'index',
align: 'center',
render: (_, record, index) => index + 1,
},
{
title: '操作角色',
dataIndex: 'roleName',
align: 'center',
},
{
title: '状态',
dataIndex: 'status',
align: 'center',
render: (text, record) => (
<StatusTag type={REPAIR_OUTER_STATUS_TAG_MAP[record.statusCode]} title={text} />
),
},
{
title: '操作',
dataIndex: 'operate',
align: 'center',
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
ellipsis: true,
},
{
title: '审核意见',
dataIndex: 'opinion',
align: 'center',
ellipsis: true,
},
];
const innerColumns: EditableColumns[] = [
{
title: '序号',
dataIndex: 'step',
align: 'center',
},
{
title: '操作人',
dataIndex: 'operator',
align: 'center',
},
{
title: '部门',
dataIndex: 'department',
align: 'center',
},
{
title: '职位',
dataIndex: 'jobTitle',
align: 'center',
},
{
title: '状态',
dataIndex: 'statusName',
align: 'center',
render: (text, record) => (
<Badge color={REPAIR_INNER_STATUS_BADGE_MAP[record.status]} text={text} />
),
},
{
title: '操作',
dataIndex: 'operate',
align: 'center',
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
ellipsis: true,
},
{
title: '审核意见',
dataIndex: 'opinion',
align: 'center',
ellipsis: true,
},
];
return (
<MellowCard>
<Tabs onChange={() => {}}>
{outerHistory ? (
<Tabs.TabPane tab="外部流转记录" key="1">
<PolymericTable
rowKey="operateTime"
dataSource={outerHistory}
columns={outerColumns}
loading={false}
pagination={null}
/>
</Tabs.TabPane>
) : null}
<Tabs.TabPane tab="内部流转记录" key="2">
<PolymericTable
rowKey="operateTime"
dataSource={innerHistory}
columns={innerColumns}
loading={false}
pagination={null}
/>
</Tabs.TabPane>
</Tabs>
</MellowCard>
);
};
export default FlowRecords;
\ 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
......@@ -11,7 +11,7 @@ import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { GetAsReturnGoodsPageReturnedGoodsResponse } from '@/services/AfterServiceApi';
import { normalizeFiledata, FileData, isJSONStr } from '@/utils';
import { PurchaseOrderInsideWorkStateTexts, ORDER_TYPE2 } from '@/constants';
import { PurchaseOrderOutWorkStateTexts, ORDER_TYPE2 } from '@/constants';
import ReutrnEle from '@/components/ReturnEle';
import StatusTag from '@/components/StatusTag';
import NiceForm from '@/components/NiceForm';
......@@ -93,7 +93,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
title: '订单状态',
dataIndex: 'externalState',
align: 'center',
render: text => PurchaseOrderInsideWorkStateTexts[text],
render: text => PurchaseOrderOutWorkStateTexts[text],
},
{
title: '订单类型',
......@@ -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>
</>
),
......
......@@ -16,7 +16,7 @@ import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { schema } from './schema';
import StatusTag from '../../components/StatusTag';
import StatusActions from '../../components/StatusActions';
import { PublicApi } from '@/services/api';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
import { Moment } from 'moment';
import { payStatus } from '../../common';
......@@ -35,15 +35,15 @@ interface SearchParams {
status?: number,
current: number,
pageSize: number,
}
const SettlementList = () => {
const ref = useRef<any>({})
/**
* 分页查询
* @param {params: SearchParams}
* @param {params: SearchParams}
*/
const fetchListData = async (params: any) => {
const searchParams = {
......@@ -57,7 +57,7 @@ const SettlementList = () => {
}
const columns = [
{
title: '结算单号',
title: '结算单号',
dataIndex: 'settlementNo',
render: (text, record) => {
const prefix = `/memberCenter/balance/accountsPayable/settlementList/`;
......@@ -71,7 +71,7 @@ const SettlementList = () => {
},
{title: '结算日期', dataIndex: 'settlementDate'},
{title: '结算方式', dataIndex: 'settlementWayName'},
{title: '结算方', dataIndex: 'settlementName'},
{title: '结算方', dataIndex: 'settlementName'},
{title: '结算单据', dataIndex: 'orderTypeName'},
{title: '总单数', dataIndex: 'totalCount'},
{title: '结算金额', dataIndex: 'amount'},
......@@ -91,8 +91,8 @@ const SettlementList = () => {
title: '操作',
render: (text: string, record: any) => {
return (
<StatusActions
status={record.status <= 2 ? record.status : 4 }
<StatusActions
status={record.status <= 2 ? record.status : 4 }
id={record.id}
excludes={[1, 3]}
settlementId={record.memberId || 1}
......@@ -106,7 +106,7 @@ const SettlementList = () => {
/**
* 上传凭证
* @param params
* @param params
*/
const handleUploadVoucher = (params: any) => {
console.log(params);
......@@ -141,7 +141,7 @@ const SettlementList = () => {
currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
<NiceForm
<NiceForm
actions={formActions}
components={{DatePicker}}
expressionScope={{}}
......@@ -159,6 +159,10 @@ const SettlementList = () => {
}}
schema={schema}
onSubmit={handleSearch}
onReset={() => {
formActions.setFieldValue('startTime', null);
formActions.setFieldValue('endTime', null);
}}
/>
}
/>
......
......@@ -22,8 +22,8 @@ export const schema: ISchema = {
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索(结算方)',
align: 'flex-left',
// tip: '输入通知单号、通知单摘要进行搜索',
align: 'flex-left',
// tip: '输入通知单号、通知单摘要进行搜索',
},
},
[FORM_FILTER_PATH]: {
......@@ -40,14 +40,17 @@ export const schema: ISchema = {
type: 'string',
'x-component': 'DatePicker',
'x-component-props': {
allowClear: true
allowClear: true,
placeholder: "结算时间(开始时间)"
}
},
endTime: {
type: 'string',
'x-component': 'DatePicker',
'x-component-props': {
allowClear: true
allowClear: true,
placeholder: "结算时间(结束时间)"
}
},
status: {
......@@ -61,8 +64,8 @@ export const schema: ISchema = {
],
default: 0,
'x-component-props': {
placeholder: '结算状态(全部)',
allowClear: true,
placeholder: '结算状态(全部)',
allowClear: true,
},
},
orderType: {
......@@ -74,8 +77,8 @@ export const schema: ISchema = {
],
default: 0,
'x-component-props': {
placeholder: '结算单据(全部)',
allowClear: true,
placeholder: '结算单据(全部)',
allowClear: true,
},
},
submit: {
......
......@@ -25,7 +25,7 @@ const RangePicker = DatePicker.RangePicker;
const formActions = createFormActions();
const columns = [
{
title: '订单号/类型',
title: '订单号/类型',
dataIndex: 'orderNo',
render: (text, record: any) => {
return (
......@@ -51,8 +51,8 @@ const columns = [
{title: '订单类型',dataIndex: 'orderTypeName'},
{title: '单据总额', dataIndex: 'orderAmount'},
{
title: '支付批次/环节',
dataIndex: 'batch',
title: '支付批次/环节',
dataIndex: 'batch',
render: (text, record) => {
return (
<div>
......@@ -65,7 +65,7 @@ const columns = [
{title: '支付金额', dataIndex: 'payAmount'},
{title: '支付时间', dataIndex: 'payTime'},
{
title: '开票状态',
title: '开票状态',
dataIndex: 'invoiceStatus',
filters: [
{ text: '未开票', value: 0 },
......@@ -81,7 +81,7 @@ const columns = [
}
},
{
title: '支付状态',
title: '支付状态',
dataIndex: 'status',
filters: [
{ text: '未支付', value: '未支付' },
......@@ -96,7 +96,7 @@ const columns = [
}
},
{
title: '操作',
title: '操作',
render: (text, record) => {
return (
<>
......@@ -105,13 +105,13 @@ const columns = [
({visible, show, cancel}) => {
return (
<>
<InvoiceCreate
id={record.id}
type={record.invoiceStatus}
title="开具发票"
width={800}
visible={visible}
onCancel={cancel}
<InvoiceCreate
id={record.id}
type={record.invoiceStatus}
title="开具发票"
width={800}
visible={visible}
onCancel={cancel}
refresh={() => formActions.submit()}
/>
<div className={styles.text} onClick={show}>{record.invoiceStatus == 1 ? '查看' : '开票'}</div>
......@@ -131,7 +131,7 @@ const SettlementList = () => {
/**
* 获取开票管理列表
* @param params
* @param params
*/
const fetchListData = async (params) => {
// /settle/accounts/member/settlement/pageReceiptInvoice
......@@ -159,7 +159,7 @@ const SettlementList = () => {
currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
<NiceForm
<NiceForm
components={{RangePicker}}
actions={formActions}
expressionScope={{
......@@ -179,10 +179,11 @@ const SettlementList = () => {
useAsyncSelect(
'payStatus',
fetchOptions(PublicApi.getSettleAccountsCommonGetPayStatus),
);
);
}}
schema={schema}
onSubmit={reload}
/>
}
/>
......
......@@ -39,7 +39,7 @@ const SettlementList = () => {
}
const columns = [
{
title: '结算单号',
title: '结算单号',
dataIndex: 'settlementNo',
render: (text, record) => {
const prefix = `/memberCenter/balance/accountsReceivable/settlementList/`;
......@@ -53,7 +53,7 @@ const SettlementList = () => {
},
{title: '结算日期', dataIndex: 'settlementDate'},
{title: '结算方式', dataIndex: 'settlementWayName'},
{title: '付款方', dataIndex: 'payName'},
{title: '付款方', dataIndex: 'payName'},
{title: '结算单据', dataIndex: 'orderTypeName'},
{title: '总单数', dataIndex: 'totalCount'},
{title: '结算金额', dataIndex: 'amount'},
......@@ -73,11 +73,11 @@ const SettlementList = () => {
title: '操作',
render: (text, record) => {
return (
<StatusActions
<StatusActions
excludes={[2]}
id={record.id}
type={RECEIABLE_BENEFICIARY}
status={record.status}
status={record.status}
settlementDate={record.settlementDate}
payName={record.payName}
handleReconciledComfirm={handleConfirm}
......@@ -105,7 +105,7 @@ const SettlementList = () => {
/**
* 确认未到款
* @param {onCancel:function, id: number, status: number}
* @param {onCancel:function, id: number, status: number}
*/
const handleComfirmInCompletePayment = (params: any) => {
PublicApi.postSettleAccountsMemberSettlementConfirmPayProve({id: params.id, status: params.status})
......@@ -119,7 +119,7 @@ const SettlementList = () => {
/**
* 确认到款
* @param {onCancel:function, id: number, status: number}
* @param {onCancel:function, id: number, status: number}
*/
const handleComfirmCompletePayment = (params: any) => {
PublicApi.postSettleAccountsMemberSettlementConfirmPayProve({id: params.id, status: params.status})
......@@ -152,7 +152,7 @@ const SettlementList = () => {
currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
<NiceForm
<NiceForm
components={{DatePicker}}
actions={formActions}
expressionScope={{}}
......@@ -170,6 +170,10 @@ const SettlementList = () => {
}}
schema={schema}
onSubmit={handleSearch}
onReset={() => {
formActions.setFieldValue('startTime', null);
formActions.setFieldValue('endTime', null);
}}
/>
}
/>
......
......@@ -45,7 +45,7 @@ interface infoType {
payName: string, // 付款方
orderTypeName: string, // 结算单据类型名称
totalCount: number, // 总单数
amount: number, // 结算金额
amount: number, // 结算金额
statusName: string // 结算状态名称
}
......@@ -82,7 +82,7 @@ const logisticsDetail: React.FC = () => {
const startTime = values.startTime?.format(format);
const endTime = values.endTime?.format(format);
ref.current.reload({...values, startTime, endTime});
}
}
return (
<PageHeaderWrapper
......@@ -92,21 +92,21 @@ const logisticsDetail: React.FC = () => {
style={{ padding: '0' }}
onBack={() => history.goBack()}
title={
<AvatarWrap
<AvatarWrap
info={{
aloneTxt: '单',
name: "结算单号:"
}}
}}
extra={(
<span style={{ fontSize: 12 }}>{infoDetail?.settlementNo}</span>
)}
/>
}
>
<Descriptions
column={3}
style={{
padding: '0 32px',
<Descriptions
column={3}
style={{
padding: '0 32px',
}}
>
<Descriptions.Item label="结算日期">{infoDetail?.settlementDate}</Descriptions.Item>
......@@ -129,7 +129,7 @@ const logisticsDetail: React.FC = () => {
currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
<NiceForm
<NiceForm
components={{RangePicker}}
actions={formActions}
expressionScope={{
......@@ -148,6 +148,10 @@ const logisticsDetail: React.FC = () => {
}}
schema={logisticsDetailSchema}
onSubmit={handleSearch}
onReset={() => {
formActions.setFieldValue('startTime', null);
formActions.setFieldValue('endTime', null);
}}
/>
}
/>
......@@ -157,4 +161,4 @@ const logisticsDetail: React.FC = () => {
)
}
export default logisticsDetail
\ No newline at end of file
export default logisticsDetail
......@@ -152,6 +152,12 @@ const ProductNoticeSettlementDetail: React.FC = () => {
}}
schema={detailSchema}
onSubmit={handleSearch}
onReset={() => {
formActions.setFieldValue('startTime', null);
formActions.setFieldValue('endTime', null);
formActions.setFieldValue('receiveStartTime', null);
formActions.setFieldValue('receiveEndTime', null);
}}
/>
}
/>
......
......@@ -22,8 +22,8 @@ export const schema: ISchema = {
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索(付款方)',
align: 'flex-left',
// tip: '输入通知单号、通知单摘要进行搜索',
align: 'flex-left',
// tip: '输入通知单号、通知单摘要进行搜索',
},
},
[FORM_FILTER_PATH]: {
......@@ -40,14 +40,17 @@ export const schema: ISchema = {
type: 'string',
'x-component': 'DatePicker',
'x-component-props': {
allowClear: true
allowClear: true,
placeholder: '结算日期(开始时间)'
}
},
endTime: {
type: 'string',
'x-component': 'DatePicker',
'x-component-props': {
allowClear: true
allowClear: true,
placeholder: '结算日期(开始时间)'
}
},
status: {
......@@ -61,8 +64,8 @@ export const schema: ISchema = {
],
default: 0,
'x-component-props': {
placeholder: '结算状态(全部)',
allowClear: true,
placeholder: '结算状态(全部)',
allowClear: true,
},
},
orderType: {
......@@ -74,8 +77,8 @@ export const schema: ISchema = {
],
default: 0,
'x-component-props': {
placeholder: '结算单据(全部)',
allowClear: true,
placeholder: '结算单据(全部)',
allowClear: true,
},
},
submit: {
......
/*
* @Author: your name
* @Date: 2020-10-20 09:37:53
* @Description: 平台代收账款结算
* @Description: 平台代收账款结算
*/
import React, { useRef } from 'react';
......@@ -39,11 +39,11 @@ const AccountReceivable = () => {
}
const columns = [
{
title: '结算单号',
title: '结算单号',
dataIndex: 'settlementNo',
render: (text, record) => {
return (
<EyePreview
<EyePreview
url={`/memberCenter/balance/platformSettlement/accountReceivable/detail?id=${record.id}`}
>{record.settlementNo}</EyePreview>
)
......@@ -71,11 +71,11 @@ const AccountReceivable = () => {
title: '操作',
render: (text, record) => {
return (
<StatusActions
<StatusActions
excludes={[2]}
id={record.id}
type={PLATFORM_BENEFICIARY}
status={record.status}
status={record.status}
settlementDate={record.settlementDate}
payName={"平台"}
handleReconciledComfirm={handleConfirm}
......@@ -87,7 +87,7 @@ const AccountReceivable = () => {
}
]
/**
* 确认对账
* @param {cancel: function, id: number} cancel 为关闭回调函数
......@@ -105,7 +105,7 @@ const AccountReceivable = () => {
/**
* 确认未到款
* @param {onCancel:function, id: number, status: number}
* @param {onCancel:function, id: number, status: number}
*/
const handleComfirmInCompletePayment = (params: any) => {
PublicApi.postSettleAccountsPlatformSettlementConfirmPayProve({id: params.id, status: params.status})
......@@ -119,7 +119,7 @@ const AccountReceivable = () => {
/**
* 确认到款
* @param {onCancel:function, id: number, status: number}
* @param {onCancel:function, id: number, status: number}
*/
const handleComfirmCompletePayment = (params: any) => {
///settle/accounts/platform/settlement/confirmPayProve
......@@ -154,7 +154,7 @@ const AccountReceivable = () => {
// rowSelection={rowSelection}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
<NiceForm
<NiceForm
actions={formActions}
expressionScope={{}}
components={{DatePicker}}
......@@ -167,6 +167,10 @@ const AccountReceivable = () => {
}}
schema={schema}
onSubmit={handleSearch}
onReset={() => {
formActions.setFieldValue('startTime', null);
formActions.setFieldValue('endTime', null);
}}
/>
}
/>
......@@ -175,4 +179,4 @@ const AccountReceivable = () => {
)
}
export default AccountReceivable
\ No newline at end of file
export default AccountReceivable
......@@ -18,8 +18,8 @@ export const schema: ISchema = {
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索结算单号',
align: 'flex-left',
tip: '输入 结算单号 进行搜索',
align: 'flex-left',
tip: '输入 结算单号 进行搜索',
},
},
[FORM_FILTER_PATH]: {
......@@ -36,14 +36,16 @@ export const schema: ISchema = {
type: 'string',
'x-component': 'DatePicker',
'x-component-props': {
allowClear: true
allowClear: true,
placeholder: '结算日期(开始时间)'
}
},
endTime: {
type: 'string',
'x-component': 'DatePicker',
'x-component-props': {
allowClear: true
allowClear: true,
placeholder: '结算日期(结束时间)'
}
},
status: {
......@@ -53,8 +55,8 @@ export const schema: ISchema = {
],
default: 0,
'x-component-props': {
placeholder: '结算状态(全部)',
allowClear: true,
placeholder: '结算状态(全部)',
allowClear: true,
},
},
submit: {
......@@ -127,8 +129,8 @@ export const detailSchema: ISchema = {
enum: orderTime,
default: 0,
'x-component-props': {
placeholder: '下单时间(全部)',
allowClear: true,
placeholder: '下单时间(全部)',
allowClear: true,
},
},
payTime: {
......@@ -136,8 +138,8 @@ export const detailSchema: ISchema = {
enum: payTime,
default: 0,
'x-component-props': {
placeholder: '支付时间(全部)',
allowClear: true,
placeholder: '支付时间(全部)',
allowClear: true,
},
},
......@@ -155,4 +157,4 @@ export const detailSchema: ISchema = {
},
},
},
};
\ No newline at end of file
};
......@@ -37,11 +37,11 @@ const Integral: React.FC = () => {
}
const columns = [
{
title: '结算单号',
title: '结算单号',
dataIndex: 'settlementNo',
render: (text, record) => {
return (
<EyePreview
<EyePreview
url={`/memberCenter/balance/platformSettlement/integral/detail?id=${record.id}`}
>{record.settlementNo}</EyePreview>
)
......@@ -52,7 +52,7 @@ const Integral: React.FC = () => {
{title: '总单数', dataIndex: 'totalCount'},
{title: '结算积分总数', dataIndex: 'score'},
{
title: '兑换比率',
title: '兑换比率',
dataIndex: 'ratio',
render: (text, record) => {
return (record.ratio * 100 + "%");
......@@ -76,11 +76,11 @@ const Integral: React.FC = () => {
render: (text, record) => {
return (
<>
<StatusActions
<StatusActions
excludes={[2]}
id={record.id}
type={SCORE_BENEFINCIARY}
status={record.status}
status={record.status}
settlementDate={record.settlementDate}
payName={"平台"}
handleReconciledComfirm={handleConfirm}
......@@ -109,7 +109,7 @@ const Integral: React.FC = () => {
/**
* 确认未到款
* @param {onCancel:function, id: number, status: number}
* @param {onCancel:function, id: number, status: number}
*/
const handleComfirmInCompletePayment = (params: any) => {
PublicApi.postSettleAccountsPlatformScoreSettlementConfirmPayProve({id: params.id, status: params.status})
......@@ -123,7 +123,7 @@ const Integral: React.FC = () => {
/**
* 确认到款
* @param {onCancel:function, id: number, status: number}
* @param {onCancel:function, id: number, status: number}
*/
const handleComfirmCompletePayment = (params: any) => {
PublicApi.postSettleAccountsPlatformScoreSettlementConfirmPayProve({id: params.id, status: params.status})
......@@ -155,7 +155,7 @@ const Integral: React.FC = () => {
currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
<NiceForm
<NiceForm
actions={formActions}
components={{DatePicker}}
expressionScope={{}}
......@@ -168,6 +168,10 @@ const Integral: React.FC = () => {
}}
schema={schema}
onSubmit={handleSearch}
onReset={() => {
formActions.setFieldValue('startTime', null);
formActions.setFieldValue('endTime', null);
}}
/>
}
/>
......@@ -176,4 +180,4 @@ const Integral: React.FC = () => {
)
}
export default Integral
\ No newline at end of file
export default Integral
......@@ -23,8 +23,8 @@ export const schema: ISchema = {
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
// tip: '输入通知单号、通知单摘要进行搜索',
align: 'flex-left',
// tip: '输入通知单号、通知单摘要进行搜索',
},
},
[FORM_FILTER_PATH]: {
......@@ -41,14 +41,16 @@ export const schema: ISchema = {
type: 'string',
'x-component': 'DatePicker',
'x-component-props': {
allowClear: true
allowClear: true,
placeholder: '结算日期(开始时间)'
}
},
endTime: {
type: 'string',
'x-component': 'DatePicker',
'x-component-props': {
allowClear: true
allowClear: true,
placeholder: '结算日期(结束时间)'
}
},
status: {
......@@ -61,8 +63,8 @@ export const schema: ISchema = {
{label: '待完成', value: 4},
],
'x-component-props': {
placeholder: '结算状态(全部)',
allowClear: true,
placeholder: '结算状态(全部)',
allowClear: true,
},
default: 0
},
......@@ -136,8 +138,8 @@ export const detailSchema: ISchema = {
enum: orderTime,
default: 0,
'x-component-props': {
placeholder: '下单时间(全部)',
allowClear: true,
placeholder: '下单时间(全部)',
allowClear: true,
},
},
payTime: {
......@@ -145,8 +147,8 @@ export const detailSchema: ISchema = {
enum: payTime,
default: 0,
'x-component-props': {
placeholder: '支付时间(全部)',
allowClear: true,
placeholder: '支付时间(全部)',
allowClear: true,
},
},
submit: {
......@@ -163,4 +165,4 @@ export const detailSchema: ISchema = {
},
},
},
};
\ No newline at end of file
};
......@@ -73,6 +73,9 @@ const MemberSettle: React.FC<{}> = () => {
{
title: '操作',
render: (text, record) => {
if(record.status == 1) {
return null
}
return (
<Space>
<Link to={`/memberCenter/balance/settleRules/memberSettleList/edit?id=${record.id}`}>修改</Link>
......
......@@ -21,10 +21,15 @@ export const searchBrandOptionEffect = (context: any, fieldName: string) => {
export const searchCustomerCategoryOptionEffect = (context: any, fieldName: string) => {
context.getFieldState(fieldName, state => {
PublicApi.getProductSelectGetSelectCustomerCategory({ name: state.props['x-component-props'].searchValue }).then(res => {
// PublicApi.getProductSelectGetSelectCustomerCategory({ name: state.props['x-component-props'].searchValue }).then(res => {
// context.setFieldState(fieldName, state => {
// state.props['x-component-props'].dataoption = res.data
// })
// })
PublicApi.getProductCustomerGetCustomerCategoryTree().then(res => {
context.setFieldState(fieldName, state => {
state.props['x-component-props'].dataoption = res.data
})
})
})
}
\ No newline at end of file
}
......@@ -66,17 +66,14 @@ export const goodsSchema: ISchema = {
},
customerCategoryId: {
type: 'string',
'x-component': 'CustomInputSearch',
'x-component': 'CustomCategorySearch',
'x-component-props': {
placeholder: '商品品类',
showSearch: true,
showArrow: true,
defaultActiveFirstOption: false,
filterOption: false,
notFoundContent: null,
style: { width: '174px' },
searchValue: null,
dataoption: []
dataoption: [],
fieldNames: { label: 'title', value: 'id', children: 'children' },
},
},
batch: {
......@@ -99,4 +96,4 @@ export const goodsSchema: ISchema = {
},
},
},
};
\ No newline at end of file
};
......@@ -21,10 +21,15 @@ export const searchBrandOptionEffect = (context: any, fieldName: string) => {
export const searchCustomerCategoryOptionEffect = (context: any, fieldName: string) => {
context.getFieldState(fieldName, state => {
PublicApi.getProductSelectGetSelectCustomerCategory({ name: state.props['x-component-props'].searchValue }).then(res => {
// PublicApi.getProductSelectGetSelectCustomerCategory({ name: state.props['x-component-props'].searchValue }).then(res => {
// context.setFieldState(fieldName, state => {
// state.props['x-component-props'].dataoption = res.data
// })
// })
PublicApi.getProductCustomerGetCustomerCategoryTree().then(res => {
context.setFieldState(fieldName, state => {
state.props['x-component-props'].dataoption = res.data
})
})
})
}
\ No newline at end of file
}
......@@ -65,7 +65,12 @@ export const searchBrandOptionEffect = (context: any, fieldName: string) => {
export const searchCustomerCategoryOptionEffect = (context: any, fieldName: string) => {
context.getFieldState(fieldName, state => {
PublicApi.getProductSelectGetSelectCustomerCategory({ name: state.props['x-component-props'].searchValue }).then(res => {
// PublicApi.getProductSelectGetSelectCustomerCategory({ name: state.props['x-component-props'].searchValue }).then(res => {
// context.setFieldState(fieldName, state => {
// state.props['x-component-props'].dataoption = res.data
// })
// })
PublicApi.getProductCustomerGetCustomerCategoryTree().then(res => {
context.setFieldState(fieldName, state => {
state.props['x-component-props'].dataoption = res.data
})
......
This diff is collapsed.
This diff is collapsed.
......@@ -246,7 +246,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
if(current === 1) {
const payOrderUrls = formRef.current.urlList
const checkedId = checked.id
if (!payOrderUrls || payOrderUrls.length === 0) {
if (!payOrderUrls || payOrderUrls.length === 0 || payOrderUrls.includes('')) {
message.error('请先上传凭证')
return;
}
......
......@@ -287,10 +287,9 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
// 确认全部发货单已收到回单
const handelReciveReturnOrder = async () => {
const res = await PublicApi.getOrderIsDeliveryCompleted({id: data.id})
const { code } = res
const res = await PublicApi.getOrderIsDeliveryCompleted({id: data.id}, {ctlType: "none"})
let tip = ''
if(code === 1000)
if(res.data)
tip = '是否确认本单全部发货单已收到回单?'
else
tip = '您还有未发货的商品,是否确认全部发货都已完成?'
......@@ -306,10 +305,9 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
// 继续发货
const handleContinueDeliver = async () => {
const res = await PublicApi.getOrderIsDeliveryCompleted({id: data.id})
const { code } = res
const res = await PublicApi.getOrderIsDeliveryCompleted({id: data.id}, {ctlType: 'none'})
let tip = ''
if(code === 1000)
if(res.data)
tip = '您商品都已发货.是否确认还需要继续发货?'
else
tip = '是否继续发货?'
......
......@@ -97,12 +97,12 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
modelRef.current.setVisible(true)
}
const [amountMoney, setAmountMoney] = useState<number>(sumPrice || sum + freePrice)
const [amountMoney, setAmountMoney] = useState<number>((sumPrice*1000)/1000 || (sum*1000 + freePrice*1000)/1000)
// 总计金额
useEffect(() => {
console.log(sumPrice || (sum*1000 + freePrice*1000)/1000, 'iiiiii')
setAmountMoney(() => sumPrice || (sum*1000 + freePrice*1000)/1000)
console.log((sumPrice*1000)/1000 || (sum*1000 + freePrice*1000)/1000, 'iiiiii')
setAmountMoney(() => (sumPrice*1000)/1000 || (sum*1000 + freePrice*1000)/1000)
}, [sum, freePrice, sumPrice])
const handleConfirm = () => {
......
import React, { useState, useCallback, useRef } from 'react';
import { OrderDetailContext } from '../../../_public/order/context';
import { PublicApi } from '@/services/api';
import { Button } from 'antd';
import OrderDetailHeader from '@/pages/transaction/components/OrderDetailHeader';
import OrderDetailWrapper from '@/pages/transaction/components/OrderDetailWrapper';
import PreLoading from '@/components/PreLoading';
import { useOrderDetail } from '../../../_public/order/effects/useOrderDetail';
import ApprovedOrderModal from '../../../components/approvedOrderModal';
import { history } from 'umi'
import { useHttpRequest } from '@/hooks/useHttpRequest';
import OrderDetailSection from '../../../components/orderDetailSection';
const ReadyConfirmReturnOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'saleOrder'})
const { run, loading } = useHttpRequest(PublicApi.postOrderReceiptOrderConfirmedAll)
// 提交表单
const handleSubmit = useCallback(async () => {
const params = {
id: Number(id),
state: 1
}
const result = await run(params)
if (result.code === 1000) {
history.goBack()
}
}, [])
return (
<div>
<OrderDetailContext.Provider value={formContext}>
<OrderDetailHeader
detailList={detailList}
detailData={formContext.data}
// extraRight={
// <Button type='primary' onClick={handleSubmit} loading={loading}>
// 确认全部已回单
// </Button>
// }
/>
<OrderDetailWrapper>
<PreLoading loading={!formContext.data} active paragraph={{rows: 6}}>
<OrderDetailSection formContext={formContext} type='saleOrder'/>
</PreLoading>
</OrderDetailWrapper>
</OrderDetailContext.Provider>
</div>
);
};
export default ReadyConfirmReturnOrderDetail;
\ No newline at end of file
import React, { useState, useCallback, useRef } from 'react';
import { OrderDetailContext } from '../../../_public/order/context';
import { PublicApi } from '@/services/api';
import { Button } from 'antd';
import OrderDetailHeader from '@/pages/transaction/components/OrderDetailHeader';
import OrderDetailWrapper from '@/pages/transaction/components/OrderDetailWrapper';
import PreLoading from '@/components/PreLoading';
import { useOrderDetail } from '../../../_public/order/effects/useOrderDetail';
import ApprovedOrderModal from '../../../components/approvedOrderModal';
import { history } from 'umi'
import { useHttpRequest } from '@/hooks/useHttpRequest';
import OrderDetailSection from '../../../components/orderDetailSection';
const ReadyConfirmReturnOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 'saleOrder'})
const { run, loading } = useHttpRequest(PublicApi.postOrderReceiptOrderConfirmedAll)
// 提交表单
// const handleSubmit = useCallback(async () => {
// const params = {
// id: Number(id),
// state: 1
// }
// const result = await run(params)
// if (result.code === 1000) {
// history.goBack()
// }
// }, [])
const handleSubmit = () => {
const deleveBox = document.querySelector('#deleveBox') as any
window.scrollTo(0, deleveBox.offsetTop)
}
return (
<div>
<OrderDetailContext.Provider value={formContext}>
<OrderDetailHeader
detailList={detailList}
detailData={formContext.data}
extraRight={
<Button type='primary' onClick={handleSubmit} loading={loading}>
确认全部已回单
</Button>
}
/>
<OrderDetailWrapper>
<PreLoading loading={!formContext.data} active paragraph={{rows: 6}}>
<OrderDetailSection formContext={formContext} type='saleOrder'/>
</PreLoading>
</OrderDetailWrapper>
</OrderDetailContext.Provider>
</div>
);
};
export default ReadyConfirmReturnOrderDetail;
......@@ -2,9 +2,10 @@
* @Author: XieZhiXiong
* @Date: 2020-12-22 18:01:50
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-22 18:01:51
* @LastEditTime: 2020-12-24 11:01:22
* @Description: 单据列表 弹窗表格列
*/
import moment from 'moment';
import {
ORDER_TYPE2,
PurchaseOrderInsideWorkStateTexts,
......@@ -109,6 +110,7 @@ export const machiningWarehousingColumns = [
title: '单据时间',
align: 'center',
dataIndex: 'createTime',
render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
},
{
title: '申请单状态',
......@@ -140,6 +142,7 @@ export const machiningDeliveryColumns = [
title: '单据时间',
align: 'center',
dataIndex: 'createTime',
render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
},
{
title: '申请单状态',
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-16 15:16:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-22 18:04:58
* @LastEditTime: 2020-12-23 20:20:35
* @Description: 联动逻辑相关
*/
import { Modal } from 'antd';
......@@ -140,8 +140,6 @@ const getParams = type => {
basicParams.columns = getAfterSaleColumns(true);
basicParams.fetchTableData = getRefundDeliveryList;
basicParams.formilyProps.ctx.schema = afterSaleBillSchema(true);
basicParams.tableProps.rowKey = 'applyNo';
basicParams.tableProps.lableKey = 'applyNo';
break;
}
......@@ -151,8 +149,6 @@ const getParams = type => {
basicParams.columns = getAfterSaleColumns(false);
basicParams.fetchTableData = getRefundWarehousingList;
basicParams.formilyProps.ctx.schema = afterSaleBillSchema(false);
basicParams.tableProps.rowKey = 'applyNo';
basicParams.tableProps.lableKey = 'applyNo';
break;
}
......@@ -162,8 +158,6 @@ const getParams = type => {
basicParams.columns = getAfterSaleColumns(true);
basicParams.fetchTableData = getExchangeReturnDeliveryList;
basicParams.formilyProps.ctx.schema = afterSaleBillSchema(true);
basicParams.tableProps.rowKey = 'applyNo';
basicParams.tableProps.lableKey = 'applyNo';
break;
}
......@@ -173,8 +167,6 @@ const getParams = type => {
basicParams.columns = getAfterSaleColumns(false);
basicParams.fetchTableData = getExchangeReturnWarehousingList;
basicParams.formilyProps.ctx.schema = afterSaleBillSchema(false);
basicParams.tableProps.rowKey = 'applyNo';
basicParams.tableProps.lableKey = 'applyNo';
break;
}
......@@ -184,8 +176,6 @@ const getParams = type => {
basicParams.columns = getAfterSaleColumns(true);
basicParams.fetchTableData = getExchangeDeliveryList;
basicParams.formilyProps.ctx.schema = afterSaleBillSchema(true);
basicParams.tableProps.rowKey = 'applyNo';
basicParams.tableProps.lableKey = 'applyNo';
break;
}
......@@ -195,8 +185,6 @@ const getParams = type => {
basicParams.columns = getAfterSaleColumns(false);
basicParams.fetchTableData = getExchangeWarehousingList;
basicParams.formilyProps.ctx.schema = afterSaleBillSchema(false);
basicParams.tableProps.rowKey = 'applyNo';
basicParams.tableProps.lableKey = 'applyNo';
break;
}
......
......@@ -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 ?
[
......@@ -448,12 +448,11 @@ const BillsForm: React.FC<BillsFormProps> = ({
supplyMembersName: supplierName,
supplyMembersId: parentMemberId,
supplyMembersRoleId: parentMemberRoleId,
deliveryType: returnGoodsAddress.deliveryType,
}
] :
[]
,
deliveryType: returnGoodsAddress.deliveryType,
transport: DELIVERY_TYPE[returnGoodsAddress.deliveryType],
});
}).finally(() => {
setInfoLoading(false);
......@@ -495,12 +494,11 @@ const BillsForm: React.FC<BillsFormProps> = ({
supplyMembersName: supplierName,
supplyMembersId: parentMemberId,
supplyMembersRoleId: parentMemberRoleId,
deliveryType: returnGoodsAddress.deliveryType,
}
] :
[]
,
deliveryType: returnGoodsAddress.deliveryType,
transport: DELIVERY_TYPE[returnGoodsAddress.deliveryType],
});
}).finally(() => {
setInfoLoading(false);
......@@ -543,12 +541,11 @@ const BillsForm: React.FC<BillsFormProps> = ({
supplyMembersName: supplierName,
supplyMembersId: parentMemberId,
supplyMembersRoleId: parentMemberRoleId,
deliveryType: returnGoodsAddress.deliveryType,
}
] :
[]
,
deliveryType: returnGoodsAddress.deliveryType,
transport: DELIVERY_TYPE[returnGoodsAddress.deliveryType],
});
}).finally(() => {
setInfoLoading(false);
......@@ -590,12 +587,11 @@ const BillsForm: React.FC<BillsFormProps> = ({
supplyMembersName: supplierName,
supplyMembersId: parentMemberId,
supplyMembersRoleId: parentMemberRoleId,
deliveryType: returnGoodsAddress.deliveryType,
}
] :
[]
,
deliveryType: returnGoodsAddress.deliveryType,
transport: DELIVERY_TYPE[returnGoodsAddress.deliveryType],
});
}).finally(() => {
setInfoLoading(false);
......@@ -616,6 +612,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
supplierName,
consumerName,
returnGoodsAddress,
replaceGoodsAddress,
applyNo,
parentMemberId,
parentMemberRoleId,
......@@ -638,12 +635,11 @@ const BillsForm: React.FC<BillsFormProps> = ({
supplyMembersName: supplierName,
supplyMembersId: parentMemberId,
supplyMembersRoleId: parentMemberRoleId,
deliveryType: replaceGoodsAddress.deliveryType,
}
] :
[]
,
deliveryType: returnGoodsAddress.deliveryType,
transport: DELIVERY_TYPE[returnGoodsAddress.deliveryType],
});
}).finally(() => {
setInfoLoading(false);
......@@ -663,6 +659,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
const {
supplierName,
returnGoodsAddress,
replaceGoodsAddress,
applyNo,
parentMemberId,
parentMemberRoleId,
......@@ -685,12 +682,11 @@ const BillsForm: React.FC<BillsFormProps> = ({
supplyMembersName: supplierName,
supplyMembersId: parentMemberId,
supplyMembersRoleId: parentMemberRoleId,
deliveryType: replaceGoodsAddress.deliveryType,
}
] :
[]
,
deliveryType: returnGoodsAddress.deliveryType,
transport: DELIVERY_TYPE[returnGoodsAddress.deliveryType],
,
});
}).finally(() => {
setInfoLoading(false);
......@@ -1660,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