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({
......
......@@ -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,15 +98,17 @@ const WarehouseForm: React.FC<WarehouseFormProps> = ({
postProductWarehouseAddOrUpdate({
id: id,
...value,
}).then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack();
}, 800);
};
}).finally(() => {
setSubmitLoading(false);
});
})
.then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack();
}, 800);
}
})
.finally(() => {
setSubmitLoading(false);
});
setUnsaved(false);
};
......@@ -109,45 +118,48 @@ 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' })} />}
title={
!id ?
intl.formatMessage({ id: 'stockSellStorage.xinjiancangku' }) :
isEdit ?
intl.formatMessage({ id: 'stockSellStorage.bianjicangku' }) :
intl.formatMessage({ id: 'stockSellStorage.zhakancangku' })
}
extra={
(isEdit || !id)
? [
<Button
key="1"
type="primary"
icon={<SaveOutlined />}
loading={submitLoading}
onClick={() => formActions.submit()}
>
{intl.formatMessage({id: 'stockSellStorage.baocun'})}
</Button>,
]
: []
}
>
<Card>
<FormDetailContext.Provider value={providerValue}>
<FormDetailHeader
title={
!id
? intl.formatMessage({ id: 'stockSellStorage.xinjiancangku' })
: isEdit
? intl.formatMessage({ id: 'stockSellStorage.bianjicangku' })
: intl.formatMessage({ id: 'stockSellStorage.zhakancangku' })
}
schema={warehouseDetailSchema}
extraRight={
isEdit || !id
? [
<Button
key="1"
type="primary"
icon={<SaveOutlined />}
loading={submitLoading}
onClick={() => formActions.submit()}
>
{intl.formatMessage({ id: 'stockSellStorage.baocun' })}
</Button>,
]
: []
}
/>
<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>
);
};
......
......@@ -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