Commit 0a61b3f2 authored by wzy's avatar wzy

feat: 进销存新建仓库ui修改

parent 6c7e448d
......@@ -18,33 +18,33 @@ const intl = getIntl();
export const purchaseOrderColumns: any[] = [
{
title: intl.formatMessage({ id: 'stockSellStorage.dingdanhao' }),
align: 'center',
// align: 'center',
dataIndex: 'orderNo',
},
{
title: intl.formatMessage({id: 'stockSellStorage.dingdanzhaiyao'}),
align: 'center',
// align: 'center',
dataIndex: 'orderThe',
},
{
title: intl.formatMessage({id: 'stockSellStorage.huiyuanmingcheng'}),
align: 'center',
// align: 'center',
dataIndex: 'supplyMembersName',
},
{
title: intl.formatMessage({id: 'stockSellStorage.xiadanshijian'}),
align: 'center',
// align: 'center',
dataIndex: 'createTime',
},
{
title: intl.formatMessage({id: 'stockSellStorage.dingdanleixing'}),
align: 'center',
// align: 'center',
dataIndex: 'type',
render: text => ORDER_TYPE2[text],
},
{
title: intl.formatMessage({id: 'stockSellStorage.dingdanzhuangtai'}),
align: 'center',
// align: 'center',
dataIndex: 'interiorState',
render: text => PurchaseOrderInsideWorkStateTexts[text],
},
......@@ -56,33 +56,33 @@ export const purchaseOrderColumns: any[] = [
export const salesOrderColumns: any[] = [
{
title: intl.formatMessage({ id: 'stockSellStorage.dingdanhao' }),
align: 'center',
// align: 'center',
dataIndex: 'orderNo',
},
{
title: intl.formatMessage({id: 'stockSellStorage.dingdanzhaiyao'}),
align: 'center',
// align: 'center',
dataIndex: 'orderThe',
},
{
title: intl.formatMessage({id: 'stockSellStorage.huiyuanmingcheng'}),
align: 'center',
// align: 'center',
dataIndex: 'createMemberName',
},
{
title: intl.formatMessage({id: 'stockSellStorage.xiadanshijian'}),
align: 'center',
// align: 'center',
dataIndex: 'createTime',
},
{
title: intl.formatMessage({id: 'stockSellStorage.dingdanleixing'}),
align: 'center',
// align: 'center',
dataIndex: 'type',
render: text => ORDER_TYPE2[text],
},
{
title: intl.formatMessage({id: 'stockSellStorage.dingdanzhuangtai'}),
align: 'center',
// align: 'center',
dataIndex: 'interiorState',
render: text => PurchaseOrderInsideWorkStateTexts[text],
},
......@@ -94,28 +94,28 @@ export const salesOrderColumns: any[] = [
export const machiningWarehousingColumns = [
{
title: intl.formatMessage({id: 'stockSellStorage.tongzhidanhao'}),
align: 'center',
// align: 'center',
dataIndex: 'noticeNo',
},
{
title: intl.formatMessage({id: 'stockSellStorage.tongzhidanzhaiyao'}),
align: 'center',
// align: 'center',
dataIndex: 'summary',
},
{
title: intl.formatMessage({id: 'stockSellStorage.jiagongqiyemingcheng'}),
align: 'center',
// align: 'center',
dataIndex: 'processName',
},
{
title: intl.formatMessage({id: 'stockSellStorage.danjushijian'}),
align: 'center',
// align: 'center',
dataIndex: 'createTime',
render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
},
{
title: intl.formatMessage({id: 'stockSellStorage.shenqingdanzhuangtai'}),
align: 'center',
// align: 'center',
dataIndex: 'outerStatusName',
},
];
......@@ -126,28 +126,28 @@ export const machiningWarehousingColumns = [
export const machiningDeliveryColumns = [
{
title: intl.formatMessage({id: 'stockSellStorage.tongzhidanhao'}),
align: 'center',
// align: 'center',
dataIndex: 'noticeNo',
},
{
title: intl.formatMessage({id: 'stockSellStorage.tongzhidanzhaiyao'}),
align: 'center',
// align: 'center',
dataIndex: 'summary',
},
{
title: intl.formatMessage({id: 'stockSellStorage.gongyinghuiyuan'}),
align: 'center',
// align: 'center',
dataIndex: 'supplierName',
},
{
title: intl.formatMessage({id: 'stockSellStorage.danjushijian'}),
align: 'center',
// align: 'center',
dataIndex: 'createTime',
render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
},
{
title: intl.formatMessage({id: 'stockSellStorage.shenqingdanzhuangtai'}),
align: 'center',
// align: 'center',
dataIndex: 'outerStatusName',
},
];
......@@ -159,31 +159,31 @@ export const getAfterSaleColumns = (isPurchaser?: boolean) => {
return [
{
title: intl.formatMessage({id: 'stockSellStorage.shenqingdanhao'}),
align: 'center',
// align: 'center',
dataIndex: 'applyNo',
},
{
title: intl.formatMessage({id: 'stockSellStorage.shenqingdanzhaiyao'}),
align: 'center',
// align: 'center',
dataIndex: 'applyAbstract',
},
isPurchaser ? {
title: intl.formatMessage({id: 'stockSellStorage.gongyinghuiyuan'}),
align: 'center',
// align: 'center',
dataIndex: 'supplierName',
} : {
title: intl.formatMessage({id: 'stockSellStorage.caigouhuiyuan'}),
align: 'center',
// align: 'center',
dataIndex: 'consumerName',
},
{
title: intl.formatMessage({id: 'stockSellStorage.danjushijian'}),
align: 'center',
// align: 'center',
dataIndex: 'applyTime',
},
{
title: intl.formatMessage({id: 'stockSellStorage.shenqingdanzhuangtai'}),
align: 'center',
// align: 'center',
dataIndex: 'outerStatusName',
},
];
......
......@@ -85,33 +85,33 @@ const BillsForm: React.FC<BillsFormProps> = ({
{
title: intl.formatMessage({ id: 'stockSellStorage.huohao' }),
dataIndex: 'id',
align: 'center',
// align: 'center',
render: (_, record) => record.code,
},
{
title: intl.formatMessage({ id: 'stockSellStorage.huopinmingcheng' }),
dataIndex: 'name',
align: 'center',
// align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.materialGroup' }),
dataIndex: ['materialGroup', 'name'],
align: 'center',
// align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.guigexinghao' }),
dataIndex: 'type',
align: 'center',
// align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.pinlei' }),
dataIndex: ['customerCategory', 'name'],
align: 'center',
// align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.pinpai' }),
dataIndex: ['brand', 'name'],
align: 'center',
// align: 'center',
},
];
......@@ -309,7 +309,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
: []
}
/>
<Card style={{ margin: 24 }}>
<div style={{ margin: 12 }}>
<NiceForm
value={billInfo}
previewPlaceholder=" "
......@@ -318,7 +318,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
renderListTableRemove,
}}
components={{
RadioGroup: Radio.Group,
// RadioGroup: Radio.Group,
ArrayTable,
Text: EllipsisText,
}}
......@@ -337,7 +337,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
actions={addSchemaAction}
schema={addBillSchema}
/>
</Card>
</div>
<ModalTable
modalTitle={intl.formatMessage({
......
......@@ -89,29 +89,21 @@ const orderDetailSchema: ISchema = {
},
};
export const addBillSchema: ISchema = {
type: 'object',
properties: {
REPOSIT_TABS: {
type: 'object',
'x-component': 'tab',
'x-component-props': {
type: 'card',
},
properties: {
'tab-1': {
const basicsInfo: ISchema = {
"x-index": 0,
type: 'object',
'x-component': 'tabpane',
"x-component": 'MellowCard',
'x-component-props': {
tab: intl.formatMessage({id: 'stockSellStorage.jibenxinxi'}),
id: 'basicsInfo',
title: intl.formatMessage({id: 'stockSellStorage.jibenxinxi'}),
},
properties: {
MEGA_LAYOUT1: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 12,
labelCol: 6,
wrapperCol: 16,
labelAlign: 'left',
grid: true,
full: true,
......@@ -175,12 +167,15 @@ export const addBillSchema: ISchema = {
},
},
},
},
'tab-2': {
}
const DocumentDetail: ISchema = {
"x-index": 1,
type: 'object',
'x-component': 'tabpane',
"x-component": 'MellowCard',
'x-component-props': {
tab: intl.formatMessage({id: 'stockSellStorage.danjumingxi'}),
id: 'DocumentDetail',
title: intl.formatMessage({id: 'stockSellStorage.danjumingxi'}),
},
properties: {
MEGA_LAYOUT2: {
......@@ -350,11 +345,15 @@ export const addBillSchema: ISchema = {
},
},
},
},
},
},
},
};
}
export const addBillSchema: ISchema = {
type: 'object',
properties: {
basicsInfo,
DocumentDetail,
}
}
// 采购入库单、销售发货单订单 弹窗 search schema
export const purchaseOrderBillSchema: ISchema = {
......
......@@ -189,7 +189,7 @@ const Bills: React.FC<{}> = () => {
{
title: intl.formatMessage({ id: 'stockSellStorage.danjuhao' }),
dataIndex: 'invoicesNo',
align: 'center',
// align: 'center',
render: (text: any, record: any) => (
<EyePreview
type={AuthUrl('bills.see') ? 'link' : 'button'}
......@@ -201,29 +201,29 @@ const Bills: React.FC<{}> = () => {
},
{
title: intl.formatMessage({ id: 'stockSellStorage.danjuleixing' }),
align: 'center',
// align: 'center',
dataIndex: 'invoicesTypeName',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.danjuzhaiyao' }),
align: 'center',
// align: 'center',
dataIndex: 'invoicesAbstract',
ellipsis: true,
},
{
title: intl.formatMessage({ id: 'stockSellStorage.duiyingcangku' }),
align: 'center',
// align: 'center',
dataIndex: 'warehouseName',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.jiaoyishijian' }),
align: 'center',
// align: 'center',
dataIndex: 'invoicesTime',
render: text => (text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''),
},
{
title: intl.formatMessage({ id: 'stockSellStorage.danjuzhuangtai' }),
align: 'center',
// align: 'center',
dataIndex: 'state',
filters: [
{
......@@ -244,7 +244,7 @@ const Bills: React.FC<{}> = () => {
{
title: intl.formatMessage({ id: 'stockSellStorage.caozuo' }),
dataIndex: 'actions',
align: 'center',
// align: 'center',
render: (_, record: any) => {
return record.source === 1 ? (
<>
......
......@@ -29,17 +29,17 @@ const billsType: React.FC<{}> = () => {
{
title: 'ID',
dataIndex: 'id',
align: 'center',
// align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.danjuleixingbianhao' }),
dataIndex: 'number',
align: 'center',
// align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.danjumingcheng' }),
dataIndex: 'name',
align: 'center',
// align: 'center',
render: (text: any, record: any) => {
return (
<EyePreview
......@@ -54,7 +54,7 @@ const billsType: React.FC<{}> = () => {
{
title: intl.formatMessage({ id: 'stockSellStorage.fangxiang' }),
dataIndex: 'direction',
align: 'center',
// align: 'center',
render: text => {
return <span>{DOC_DIRECTION[text]}</span>;
},
......@@ -62,7 +62,7 @@ const billsType: React.FC<{}> = () => {
{
title: intl.formatMessage({ id: 'stockSellStorage.zhuangtai' }),
dataIndex: 'status',
align: 'center',
// align: 'center',
sorter: (a, b) => a.state - b.state,
render: (text: any, record: any) => (
......@@ -79,7 +79,7 @@ const billsType: React.FC<{}> = () => {
{
title: intl.formatMessage({ id: 'stockSellStorage.caozuo' }),
dataIndex: 'option',
align: 'center',
// align: 'center',
render: (text: any, record: any) => (
<>
{record.state === DOC_TYPE_STATUS_INVALID && (
......
......@@ -61,60 +61,60 @@ const Inventory: React.FC<{}> = () => {
const columns: ColumnType<any>[] = [
{
title: intl.formatMessage({ id: 'stockSellStorage.huohao' }),
align: 'center',
// align: 'center',
dataIndex: 'goodsNo',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.huopinmingcheng' }),
dataIndex: 'goodsName',
align: 'center',
// align: 'center',
render: (text: any, record: any) => text,
},
{
title: intl.formatMessage({ id: 'stockSellStorage.materialGroup' }),
dataIndex: 'goodsGroup',
align: 'center',
// align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.guigexinghao' }),
dataIndex: 'specifications',
align: 'center',
// align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.pinlei' }),
dataIndex: 'category',
align: 'center',
// align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.pinpai' }),
dataIndex: 'brand',
align: 'center',
// align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.danwei' }),
dataIndex: 'unit',
align: 'center',
// align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.chengbenjia' }),
dataIndex: 'costPrice',
align: 'center',
// align: 'center',
render: text => ${text}`,
},
{
title: intl.formatMessage({ id: 'stockSellStorage.cangku' }),
dataIndex: 'warehouseName',
align: 'center',
// align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.kucun' }),
dataIndex: 'inventoryCount',
align: 'center',
// align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.jine' }),
dataIndex: 'totalPrice',
align: 'center',
// align: 'center',
render: text => ${text}`,
},
{
......@@ -125,7 +125,7 @@ const Inventory: React.FC<{}> = () => {
</Space>
),
dataIndex: 'safeInventoryCount',
align: 'center',
// align: 'center',
render: (text, record) => (
<div
className={styles.safe}
......
......@@ -9,22 +9,29 @@ import NiceForm from '@/components/NiceForm';
import { warehouseDetailSchema } from './schema';
import { useLinkEnumEffect } from '@/components/NiceForm/linkages/linkEnum';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { getManageAreaAll, getManageCountryAreaGetTelCode } from '@/services/ManageV2Api';
import { getProductWarehouseDetails, postProductWarehouseAddOrUpdate } from '@/services/ProductV2Api';
import {
getManageAreaAll,
getManageCountryAreaGetTelCode,
} from '@/services/ManageV2Api';
import {
getProductWarehouseDetails,
postProductWarehouseAddOrUpdate,
} from '@/services/ProductV2Api';
import styles from './index.less';
import FormDetailHeader from '@/components/FormDetailHeader';
import { FormDetailContext } from '@/formSchema/context';
import { useFormDetail } from '@/formSchema/effects/useFormDetail';
const intl = getIntl();
const formActions = createFormActions();
const {
onFormInputChange$,
} = FormEffectHooks;
const { onFormInputChange$ } = FormEffectHooks;
interface WarehouseFormProps {
id?: string;
validateId?: string;
// 是否是编辑的
isEdit?: boolean;
};
}
const WarehouseForm: React.FC<WarehouseFormProps> = ({
id,
......@@ -91,13 +98,15 @@ const WarehouseForm: React.FC<WarehouseFormProps> = ({
postProductWarehouseAddOrUpdate({
id: id,
...value,
}).then(res => {
})
.then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack();
}, 800);
};
}).finally(() => {
}
})
.finally(() => {
setSubmitLoading(false);
});
setUnsaved(false);
......@@ -109,23 +118,26 @@ const WarehouseForm: React.FC<WarehouseFormProps> = ({
</div>
);
const { formContext } = useFormDetail();
const providerValue = {
// detailData: initFormValue,
schemaActions: warehouseDetailSchema,
formContext,
};
return (
<Spin spinning={infoLoading}>
<PageHeaderWrapper
style={{
padding: 24,
}}
onBack={() => history.goBack()}
backIcon={<ReutrnEle description={intl.formatMessage({ id: 'stockSellStorage.fanhui' })} />}
<FormDetailContext.Provider value={providerValue}>
<FormDetailHeader
title={
!id ?
intl.formatMessage({ id: 'stockSellStorage.xinjiancangku' }) :
isEdit ?
intl.formatMessage({ id: 'stockSellStorage.bianjicangku' }) :
intl.formatMessage({ id: 'stockSellStorage.zhakancangku' })
!id
? intl.formatMessage({ id: 'stockSellStorage.xinjiancangku' })
: isEdit
? intl.formatMessage({ id: 'stockSellStorage.bianjicangku' })
: intl.formatMessage({ id: 'stockSellStorage.zhakancangku' })
}
extra={
(isEdit || !id)
schema={warehouseDetailSchema}
extraRight={
isEdit || !id
? [
<Button
key="1"
......@@ -134,20 +146,20 @@ const WarehouseForm: React.FC<WarehouseFormProps> = ({
loading={submitLoading}
onClick={() => formActions.submit()}
>
{intl.formatMessage({id: 'stockSellStorage.baocun'})}
{intl.formatMessage({ id: 'stockSellStorage.baocun' })}
</Button>,
]
: []
}
>
<Card>
/>
<Card style={{ margin: 12 }}>
<NiceForm
previewPlaceholder="' '"
editable={isEdit || !id}
expressionScope={{
AddressLabel,
}}
effects={($, { setFieldState }) => {
effects={($, actions) => {
useLinkEnumEffect('areaResponses', result =>
result.map(v => ({
label: v.name,
......@@ -160,6 +172,8 @@ const WarehouseForm: React.FC<WarehouseFormProps> = ({
setUnsaved(true);
}
});
// 注入表单完成进度
formContext.useAttachmentChangeForContext(actions);
}}
initialValues={info}
onSubmit={handleSubmit}
......@@ -167,8 +181,13 @@ const WarehouseForm: React.FC<WarehouseFormProps> = ({
schema={warehouseDetailSchema}
/>
</Card>
</PageHeaderWrapper>
<Prompt when={unsaved} message={intl.formatMessage({id: 'stockSellStorage.ninhaiyouweibaocundenei'})} />
</FormDetailContext.Provider>
<Prompt
when={unsaved}
message={intl.formatMessage({
id: 'stockSellStorage.ninhaiyouweibaocundenei',
})}
/>
</Spin>
);
};
......
......@@ -5,13 +5,24 @@ const intl = getIntl();
export const warehouseDetailSchema: ISchema = {
type: 'object',
properties: {
BASIC_INFO: {
type: 'object',
"x-component": 'MellowCard',
'x-component-props': {
title: intl.formatMessage({id: 'stockSellStorage.jibenxinxi'}),
},
properties: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 12,
wrapperCol: 18,
labelAlign: 'left',
grid: true,
full: true,
autoRow: true,
columns: 2,
},
properties: {
name: {
......@@ -32,12 +43,24 @@ export const warehouseDetailSchema: ISchema = {
],
required: true,
},
principal: {
type: 'string',
title: intl.formatMessage({ id: 'stockSellStorage.cangkufuzhairen' }),
'x-component-props': {},
'x-rules': [
{
limitByte: true, // 自定义校验规则
maxByte: 16,
}
],
},
MEGA_LAYOUT1: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
label: '{{AddressLabel}}',
wrapperCol: 24,
columns: 1,
},
required: true,
properties: {
......@@ -138,23 +161,13 @@ export const warehouseDetailSchema: ISchema = {
},
},
},
principal: {
type: 'string',
title: intl.formatMessage({ id: 'stockSellStorage.cangkufuzhairen' }),
'x-component-props': {},
'x-rules': [
{
limitByte: true, // 自定义校验规则
maxByte: 16,
}
],
},
MEGA_LAYOUT2: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
label: intl.formatMessage({ id: 'stockSellStorage.lianxidianhua' }),
wrapperCol: 24,
columns: 1,
},
properties: {
MEGA_LAYOUT2_1: {
......@@ -163,6 +176,8 @@ export const warehouseDetailSchema: ISchema = {
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 2,
},
properties: {
telCode: {
......@@ -174,9 +189,9 @@ export const warehouseDetailSchema: ISchema = {
},
tel: {
type: 'string',
'x-mega-props': {
span: 3,
},
// 'x-mega-props': {
// span: 3,
// },
'x-component-props': {
placeholder: intl.formatMessage({ id: 'stockSellStorage.qingshurunideshoujihao' }),
maxLength: 11,
......@@ -195,4 +210,6 @@ export const warehouseDetailSchema: ISchema = {
},
},
},
}
}
};
......@@ -30,12 +30,12 @@ const WareHouse: React.FC<{}> = () => {
{
title: 'ID',
dataIndex: 'id',
align: 'center',
// align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.cangkumingcheng' }),
dataIndex: 'name',
align: 'center',
// align: 'center',
render: (text: any, record: any) => {
return (
<EyePreview
......@@ -50,22 +50,22 @@ const WareHouse: React.FC<{}> = () => {
{
title: intl.formatMessage({ id: 'stockSellStorage.cangkudizhi' }),
dataIndex: 'address',
align: 'center',
// align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.cangkufuzhairen' }),
dataIndex: 'principal',
align: 'center',
// align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.lianxidianhua' }),
dataIndex: 'tel',
align: 'center',
// align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.zhuangtai' }),
dataIndex: 'state',
align: 'center',
// align: 'center',
sorter: (a, b) => a.state - b.state,
render: (text: any, record: any) => {
return (
......@@ -83,7 +83,7 @@ const WareHouse: React.FC<{}> = () => {
{
title: intl.formatMessage({ id: 'stockSellStorage.caozuo' }),
dataIndex: 'option',
align: 'center',
// align: 'center',
render: (text: any, record: any) => (
<>
{record.state === POSITION_STATUS_INVALID && (
......
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