Commit 72353d79 authored by 前端-彭佳文's avatar 前端-彭佳文

Merge branch 'v2-220418' into 'v2-220418'

V2 220418 See merge request GavinPeng/pro-platform!9
parents a7bfd3ac deea026b
......@@ -749,9 +749,9 @@ const Products: React.FC<{}> = () => {
<Menu.Item key="6" icon={<ExportOutlined />}>
{intl.formatMessage({ id: 'commodity.products.huoqushangyougongyingshangpin'})}
</Menu.Item>
<Menu.Item key="7" icon={<ExportOutlined />}>
{/* <Menu.Item key="7" icon={<ExportOutlined />}>
{intl.formatMessage({ id: 'commodity.products.huoquxiayouxiaoshoushangpin'})}
</Menu.Item>
</Menu.Item> */}
</Menu>
)
......
......@@ -283,7 +283,7 @@ export const repositDetailSchema: ISchema = padRequiredMessage({
title: getIntl().formatMessage({ id: 'repositories.schema.repositDetailSchema.goodsName' }),
default: getIntl().formatMessage({ id: 'repositories.schema.repositDetailSchema.goodsName.default' })
},
sy: {
upperStockCount: {
type: 'string',
"x-component": 'Text',
title: <span>
......
......@@ -199,7 +199,7 @@ const Bills: React.FC<{}> = () => {
{
title: intl.formatMessage({ id: 'stockSellStorage.danjuleixing' }),
align: 'center',
dataIndex: 'invoicesType',
dataIndex: 'invoicesTypeName',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.danjuzhaiyao' }),
......@@ -215,12 +215,12 @@ const Bills: React.FC<{}> = () => {
{
title: intl.formatMessage({ id: 'stockSellStorage.duiyingcangku' }),
align: 'center',
dataIndex: 'inventory',
dataIndex: 'warehouseName',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.jiaoyishijian' }),
align: 'center',
dataIndex: 'transactionTime',
dataIndex: 'invoicesTime',
render: text => text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '',
},
// {
......
......@@ -85,7 +85,7 @@ export const billsSchema: ISchema = {
},
enum: [],
},
inventory: {
warehouseId: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.duiyingcangku'}),
......@@ -96,7 +96,7 @@ export const billsSchema: ISchema = {
},
enum: [],
},
'[startTransactionTime, endTransactionTime]': {
'[invoicesTimeStart, invoicesTimeEnd]': {
type: 'string',
'x-component': 'dateSelect',
'x-component-props': {
......
......@@ -6,7 +6,7 @@ import { SaveOutlined } from '@ant-design/icons';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import ReutrnEle from '@/components/ReturnEle';
import NiceForm from '@/components/NiceForm';
import { getProductInvoicesTypeDetails, postProductInvoicesTypeAdd, postProductInvoicesTypeUpdate } from '@/services/ProductV2Api';
import { getProductInvoicesTypeDetails, postProductInvoicesTypeAddOrUpdate } from '@/services/ProductV2Api';
import { billsTypeDetailSchema } from './schema';
const formActions = createFormActions();
......@@ -50,36 +50,16 @@ const BillTypeForm: React.FC<BillTypeFormProps> = ({
}, []);
const handleSubmit = value => {
if (!id) {
if (isEdit) {
return;
}
setSubmitLoading(true);
postProductInvoicesTypeAdd({ ...value })
.then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack()
}, 800);
};
})
.finally(() => {
setSubmitLoading(false);
});
} else {
if (!isEdit) {
return;
setSubmitLoading(true);
postProductInvoicesTypeAddOrUpdate({
id: id,
...value,
}).then(res => {
if (res.code === 1000) {
history.goBack();
}
setSubmitLoading(true);
postProductInvoicesTypeUpdate({
id: id,
...value,
}).then(res => {
if (res.code === 1000) {
history.goBack();
}
});
}
});
setUnsaved(false);
};
......
......@@ -10,7 +10,7 @@ import {
import { createFormActions } from '@formily/antd';
import StandardTable from '@/components/StandardTable';
import { PlusOutlined } from '@ant-design/icons';
import { getProductInvoicesTypeList, postProductInvoicesTypeStateUpdate, postProductInvoicesTypeDelete } from '@/services/ProductV2Api';
import { getProductInvoicesTypeList, postProductInvoicesTypeStartOrStop, getProductInvoicesTypeDelete } from '@/services/ProductV2Api';
import EyePreview from '@/components/EyePreview';
import StatusSwitch from '@/components/StatusSwitch';
import { ColumnType } from 'antd/lib/table/interface';
......@@ -131,7 +131,7 @@ const billsType: React.FC<{}> = () => {
};
const handleModify = (record: any) => {
postProductInvoicesTypeStateUpdate({
postProductInvoicesTypeStartOrStop({
id: record.id,
state: record.state === DOC_TYPE_STATUS_EFFECTIVE ? DOC_TYPE_STATUS_INVALID : DOC_TYPE_STATUS_EFFECTIVE,
}).then(res => {
......@@ -142,7 +142,7 @@ const billsType: React.FC<{}> = () => {
};
const handleDelete = record => {
postProductInvoicesTypeDelete({
getProductInvoicesTypeDelete({
id: record.id,
}).then(res => {
if (res.code === 1000) {
......
import React, { useState, useEffect, useRef } from 'react';
import { getIntl, history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Input, Card, Space, Modal, Button } from 'antd';
import { Input, Card, Space, Modal, Button, message } from 'antd';
import { SettingOutlined } from '@ant-design/icons';
import StandardTable from '@/components/StandardTable';
import { ColumnType } from 'antd/lib/table/interface';
......@@ -13,7 +13,7 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import {
getProductInventoryList,
getProductWarehouseAll,
postProductInventorySafetyUpdate,
postProductInventorySafetyBatchUpdate,
} from '@/services/ProductV2Api';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { inventorySchema, safetyModalSchema } from './schema';
......@@ -44,7 +44,7 @@ const Inventory: React.FC<{}> = () => {
{
title: intl.formatMessage({ id: 'stockSellStorage.huohao' }),
align: 'center',
dataIndex: 'itemNo',
dataIndex: 'goodsNo',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.huopinmingcheng' }),
......@@ -80,17 +80,17 @@ const Inventory: React.FC<{}> = () => {
},
{
title: intl.formatMessage({ id: 'stockSellStorage.cangku' }),
dataIndex: 'warehouse',
dataIndex: 'warehouseName',
align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.kucun' }),
dataIndex: 'inventory',
dataIndex: 'inventoryCount',
align: 'center',
},
{
title: intl.formatMessage({ id: 'stockSellStorage.jine' }),
dataIndex: 'price',
dataIndex: 'totalPrice',
align: 'center',
render: text => ${text}`,
},
......@@ -101,7 +101,7 @@ const Inventory: React.FC<{}> = () => {
<SettingOutlined />
</Space>
),
dataIndex: 'safeStock',
dataIndex: 'safeInventoryCount',
align: 'center',
render: (text, record) => (
<div
......@@ -141,14 +141,19 @@ const Inventory: React.FC<{}> = () => {
// 修改安全库存
const handleSubmit = async values => {
setConfirmLoading(true);
if (!current) {
// selectedRowKeys 批量
const params = {
ids: selectedRowKeys,
safetyInvoices: +values.safetyInvoices,
};
if (current) {
params.ids = [current.id];
} else if (selectedRowKeys.length === 0){
message.error('请选择物料选项')
setConfirmLoading(false);
setModalVisible(false);
return
}
const res = await postProductInventorySafetyUpdate({
id: current.id,
safetyInvoices: +values.safetyInvoices,
});
const res = await postProductInventorySafetyBatchUpdate(params);
if (res.code === 1000) {
setModalVisible(false);
......@@ -169,7 +174,9 @@ const Inventory: React.FC<{}> = () => {
onClick={() => handleUpdateSafetyStock(undefined)}
style={{ width: 154 }}
>
{intl.formatMessage({ id: 'stockSellStorage.piliangtiaozhenganquankucun' })}
{intl.formatMessage({
id: 'stockSellStorage.piliangtiaozhenganquankucun',
})}
</Button>
</AuthButton>
);
......
......@@ -52,7 +52,7 @@ export const inventorySchema: ISchema = {
},
},
properties: {
itemNo: {
goodsNo: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({
......
......@@ -10,7 +10,7 @@ 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, postProductWarehouseAdd, postProductWarehouseUpdate } from '@/services/ProductV2Api';
import { getProductWarehouseDetails, postProductWarehouseAddOrUpdate } from '@/services/ProductV2Api';
import styles from './index.less';
const intl = getIntl();
......@@ -87,38 +87,19 @@ const WarehouseForm: React.FC<WarehouseFormProps> = ({
};
const handleSubmit = value => {
if (!id) {
if (isEdit) {
return;
}
setSubmitLoading(true);
postProductWarehouseAdd({ ...value }).then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack();
}, 800);
};
}).finally(() => {
setSubmitLoading(false);
});
} else {
if (!isEdit) {
return;
}
setSubmitLoading(true);
postProductWarehouseUpdate({
id: id,
...value,
}).then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack();
}, 800);
};
}).finally(() => {
setSubmitLoading(false);
});
}
setSubmitLoading(true);
postProductWarehouseAddOrUpdate({
id: id,
...value,
}).then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack();
}, 800);
};
}).finally(() => {
setSubmitLoading(false);
});
setUnsaved(false);
};
......
......@@ -11,7 +11,7 @@ import StandardTable from '@/components/StandardTable';
import { ColumnType } from 'antd/lib/table/interface';
import { createFormActions } from '@formily/antd';
import { PlusOutlined } from '@ant-design/icons';
import { getProductWarehouseList, postProductWarehouseStartRoStop, postProductWarehouseDelete } from '@/services/ProductV2Api';
import { getProductWarehouseList, postProductWarehouseStartOrStop, getProductWarehouseDelete } from '@/services/ProductV2Api';
import EyePreview from '@/components/EyePreview';
import StatusSwitch from '@/components/StatusSwitch';
import NiceForm from '@/components/NiceForm';
......@@ -135,7 +135,7 @@ const WareHouse: React.FC<{}> = () => {
};
const handleModify = record => {
postProductWarehouseStartRoStop({
postProductWarehouseStartOrStop({
id: record.id,
state: record.state === POSITION_STATUS_EFFECTIVE ? POSITION_STATUS_INVALID : POSITION_STATUS_EFFECTIVE,
}).then(res => {
......@@ -146,7 +146,7 @@ const WareHouse: React.FC<{}> = () => {
};
const handleDelete = record => {
postProductWarehouseDelete({
getProductWarehouseDelete({
id: record.id,
}).then(res => {
if (res.code === 1000) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment