Commit 94f2fd9b authored by Gavin Peng's avatar Gavin Peng

Merge branch 'v2-220418' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform into v2-220418

parents 72e89563 7760f1c5
......@@ -154,6 +154,7 @@ export default {
'stockSellStorage.anquankucun':'Safety Stock',
'stockSellStorage.kucun':'Inventory',
'stockSellStorage.tiaozhenganquankucun':'Adjust safety stock',
'stockSellStorage.piliangtiaozhenganquankucun': 'Bulk adjustment of safety stock',
'stockSellStorage.cangkudizhi':'Warehouse address',
'stockSellStorage.quedingyaoshanchugaicangwei':'Are you sure you want to delete this position? ',
'stockSellStorage.xinjiancangku':'New warehouse',
......
......@@ -154,6 +154,7 @@ export default {
'stockSellStorage.anquankucun': '안전 재고',
'stockSellStorage.kucun': '재고품',
'stockSellStorage.tiaozhenganquankucun': '보안 재고 조정',
'stockSellStorage.piliangtiaozhenganquankucun': '안전재고 일괄 조정',
'stockSellStorage.cangkudizhi': '창고 주소',
'stockSellStorage.quedingyaoshanchugaicangwei': '이 창고를 삭제하시겠습니까?',
'stockSellStorage.xinjiancangku': '새 창고',
......
......@@ -154,6 +154,7 @@ export default {
'stockSellStorage.anquankucun': '安全库存',
'stockSellStorage.kucun': '库存',
'stockSellStorage.tiaozhenganquankucun': '调整安全库存',
'stockSellStorage.piliangtiaozhenganquankucun': '批量调整安全库存',
'stockSellStorage.cangkudizhi': '仓库地址',
'stockSellStorage.quedingyaoshanchugaicangwei': '确定要删除该仓位吗?',
'stockSellStorage.xinjiancangku': '新建仓库',
......
......@@ -224,53 +224,53 @@ export const useBusinessEffects = (context, actions) => {
// 根据 单据类型 联动 对应单据所选项
onFieldInputChange$('invoicesTypeId').subscribe(fieldState => {
const newEnum = [...getFieldState('relevanceInvoices', state => state.props.enum)];
switch (fieldState.value) {
// 采购入库单、销售发货单只能选择 订单
case DOC_TYPE_PURCHASE_RECEIPT:
case DOC_TYPE_SALES_INVOICE: {
freeEnumItem(newEnum, 'value', DEPENDENT_DOC_ORDER);
break;
}
// 加工入库单、加工发货单只能选择 生产通知单
case DOC_TYPE_PROCESS_RECEIPT:
case DOC_TYPE_PROCESS_INVOICE: {
freeEnumItem(newEnum, 'value', DEPENDENT_DOC_PRODUCTION);
break;
}
// 退货发货单、退货入库单只能选择 退货申请单
case DOC_TYPE_RETURN_INVOICE:
case DOC_TYPE_RETURN_RECEIPT: {
freeEnumItem(newEnum, 'value', DEPENDENT_DOC_RETURN);
break;
}
// 换货退货发货单、换货退货入库单只能选择 换货申请单
case DOC_TYPE_EXCHANGE_RETURN_INVOICE:
case DOC_TYPE_EXCHANGE_RETURN_RECEIPT: {
freeEnumItem(newEnum, 'value', DEPENDENT_DOC_EXCHANGE);
break;
}
// 换货发货单、换货入库单只能选择 换货申请单
case DOC_TYPE_EXCHANGE_INVOICE:
case DOC_TYPE_EXCHANGE_RECEIPT: {
freeEnumItem(newEnum, 'value', DEPENDENT_DOC_EXCHANGE);
break;
}
// 其他的走内部单据
default: {
freeEnumItem(newEnum, 'value', DEPENDENT_DOC_INTERNAL);
break;
}
}
linkage.value('relevanceInvoices', undefined);
linkage.enum('relevanceInvoices', newEnum);
// const newEnum = [...getFieldState('relevanceInvoices', state => state.props.enum)];
// switch (fieldState.value) {
// // 采购入库单、销售发货单只能选择 订单
// case DOC_TYPE_PURCHASE_RECEIPT:
// case DOC_TYPE_SALES_INVOICE: {
// freeEnumItem(newEnum, 'value', DEPENDENT_DOC_ORDER);
// break;
// }
// // 加工入库单、加工发货单只能选择 生产通知单
// case DOC_TYPE_PROCESS_RECEIPT:
// case DOC_TYPE_PROCESS_INVOICE: {
// freeEnumItem(newEnum, 'value', DEPENDENT_DOC_PRODUCTION);
// break;
// }
// // 退货发货单、退货入库单只能选择 退货申请单
// case DOC_TYPE_RETURN_INVOICE:
// case DOC_TYPE_RETURN_RECEIPT: {
// freeEnumItem(newEnum, 'value', DEPENDENT_DOC_RETURN);
// break;
// }
// // 换货退货发货单、换货退货入库单只能选择 换货申请单
// case DOC_TYPE_EXCHANGE_RETURN_INVOICE:
// case DOC_TYPE_EXCHANGE_RETURN_RECEIPT: {
// freeEnumItem(newEnum, 'value', DEPENDENT_DOC_EXCHANGE);
// break;
// }
// // 换货发货单、换货入库单只能选择 换货申请单
// case DOC_TYPE_EXCHANGE_INVOICE:
// case DOC_TYPE_EXCHANGE_RECEIPT: {
// freeEnumItem(newEnum, 'value', DEPENDENT_DOC_EXCHANGE);
// break;
// }
// // 其他的走内部单据
// default: {
// freeEnumItem(newEnum, 'value', DEPENDENT_DOC_INTERNAL);
// break;
// }
// }
// linkage.value('relevanceInvoices', undefined);
// linkage.enum('relevanceInvoices', newEnum);
const invoicesDetailsRequestsVal = getFieldValue('invoicesDetailsRequests');
if (invoicesDetailsRequestsVal && invoicesDetailsRequestsVal.length) {
......@@ -836,90 +836,90 @@ export const useBusinessEffects = (context, actions) => {
);
const current = originAsyncData ? originAsyncData.find(item => item.id === goodId) : null;
switch (invoicesTypeIdVal) {
// 采购入库单、销售发货单
case DOC_TYPE_PURCHASE_RECEIPT:
case DOC_TYPE_SALES_INVOICE: {
if (current && +value > current.purchaseCount) {
Modal.destroyAll();
Modal.confirm({
title: intl.formatMessage({id: 'stockSellStorage.tishi'}),
content: intl.formatMessage({id: 'stockSellStorage.danjushuliangyichaoguoshang'}),
okText: intl.formatMessage({id: 'stockSellStorage.queren'}),
cancelText: intl.formatMessage({id: 'stockSellStorage.quxiao'}),
});
}
break;
}
// 加工入库单、加工发货单
case DOC_TYPE_PROCESS_RECEIPT:
case DOC_TYPE_PROCESS_INVOICE: {
if (current && +value > current.processNum) {
Modal.destroyAll();
Modal.confirm({
title: intl.formatMessage({id: 'stockSellStorage.tishi'}),
content: intl.formatMessage({id: 'stockSellStorage.danjushuliangyichaoguojia'}),
okText: intl.formatMessage({id: 'stockSellStorage.queren'}),
cancelText: intl.formatMessage({id: 'stockSellStorage.quxiao'}),
cancelButtonProps: {
style: {
display: 'none',
},
},
});
}
break;
}
// 换货退货发货单
case DOC_TYPE_EXCHANGE_RETURN_INVOICE:
// 换货退货入库单
case DOC_TYPE_EXCHANGE_RETURN_RECEIPT:
// 换货发货单
case DOC_TYPE_EXCHANGE_INVOICE:
// 换货入库单
case DOC_TYPE_EXCHANGE_RECEIPT: {
if (current && +value > current.replaceCount) {
Modal.destroyAll();
Modal.confirm({
title: intl.formatMessage({id: 'stockSellStorage.tishi'}),
content: intl.formatMessage({id: 'stockSellStorage.danjushuliangyichaoguohuan'}),
okText: intl.formatMessage({id: 'stockSellStorage.queren'}),
cancelText: intl.formatMessage({id: 'stockSellStorage.quxiao'}),
cancelButtonProps: {
style: {
display: 'none',
},
},
});
}
break;
}
// 退货发货单
case DOC_TYPE_RETURN_INVOICE:
// 退货入库单
case DOC_TYPE_RETURN_RECEIPT: {
if (current && +value > current.returnCount) {
Modal.destroyAll();
Modal.confirm({
title: intl.formatMessage({id: 'stockSellStorage.tishi'}),
content: intl.formatMessage({id: 'stockSellStorage.danjushuliangyichaoguotui'}),
okText: intl.formatMessage({id: 'stockSellStorage.queren'}),
cancelText: intl.formatMessage({id: 'stockSellStorage.quxiao'}),
cancelButtonProps: {
style: {
display: 'none',
},
},
});
}
break;
}
// switch (invoicesTypeIdVal) {
// // 采购入库单、销售发货单
// case DOC_TYPE_PURCHASE_RECEIPT:
// case DOC_TYPE_SALES_INVOICE: {
// if (current && +value > current.purchaseCount) {
// Modal.destroyAll();
// Modal.confirm({
// title: intl.formatMessage({id: 'stockSellStorage.tishi'}),
// content: intl.formatMessage({id: 'stockSellStorage.danjushuliangyichaoguoshang'}),
// okText: intl.formatMessage({id: 'stockSellStorage.queren'}),
// cancelText: intl.formatMessage({id: 'stockSellStorage.quxiao'}),
// });
// }
// break;
// }
// // 加工入库单、加工发货单
// case DOC_TYPE_PROCESS_RECEIPT:
// case DOC_TYPE_PROCESS_INVOICE: {
// if (current && +value > current.processNum) {
// Modal.destroyAll();
// Modal.confirm({
// title: intl.formatMessage({id: 'stockSellStorage.tishi'}),
// content: intl.formatMessage({id: 'stockSellStorage.danjushuliangyichaoguojia'}),
// okText: intl.formatMessage({id: 'stockSellStorage.queren'}),
// cancelText: intl.formatMessage({id: 'stockSellStorage.quxiao'}),
// cancelButtonProps: {
// style: {
// display: 'none',
// },
// },
// });
// }
// break;
// }
// // 换货退货发货单
// case DOC_TYPE_EXCHANGE_RETURN_INVOICE:
// // 换货退货入库单
// case DOC_TYPE_EXCHANGE_RETURN_RECEIPT:
// // 换货发货单
// case DOC_TYPE_EXCHANGE_INVOICE:
// // 换货入库单
// case DOC_TYPE_EXCHANGE_RECEIPT: {
// if (current && +value > current.replaceCount) {
// Modal.destroyAll();
// Modal.confirm({
// title: intl.formatMessage({id: 'stockSellStorage.tishi'}),
// content: intl.formatMessage({id: 'stockSellStorage.danjushuliangyichaoguohuan'}),
// okText: intl.formatMessage({id: 'stockSellStorage.queren'}),
// cancelText: intl.formatMessage({id: 'stockSellStorage.quxiao'}),
// cancelButtonProps: {
// style: {
// display: 'none',
// },
// },
// });
// }
// break;
// }
// // 退货发货单
// case DOC_TYPE_RETURN_INVOICE:
// // 退货入库单
// case DOC_TYPE_RETURN_RECEIPT: {
// if (current && +value > current.returnCount) {
// Modal.destroyAll();
// Modal.confirm({
// title: intl.formatMessage({id: 'stockSellStorage.tishi'}),
// content: intl.formatMessage({id: 'stockSellStorage.danjushuliangyichaoguotui'}),
// okText: intl.formatMessage({id: 'stockSellStorage.queren'}),
// cancelText: intl.formatMessage({id: 'stockSellStorage.quxiao'}),
// cancelButtonProps: {
// style: {
// display: 'none',
// },
// },
// });
// }
// break;
// }
// 内部单据
default: {
// default: {
// 成本价
const costPriceValue = getFieldState(
FormPath.transform(name, /\d/, $1 => {
......@@ -936,9 +936,9 @@ export const useBusinessEffects = (context, actions) => {
state.value = costPriceValue ? `${intl.formatMessage({ id: 'common.money' })}${(+value * costPriceValue).toFixed(2)}` : null;
}
);
break;
}
}
// break;
// }
// }
if (current) {
setFieldState(
......
......@@ -770,12 +770,12 @@ const BillsForm: React.FC<BillsFormProps> = ({
// 弹出单据明细
const handleAdd = () => {
const orderNoVal = addSchemaAction.getFieldValue('orderNo');
const relevanceInvoicesVal = addSchemaAction.getFieldValue('relevanceInvoices');
if (!orderNoVal && relevanceInvoicesVal !== DEPENDENT_DOC_INTERNAL) {
message.warning(intl.formatMessage({ id: 'stockSellStorage.qingxuanzeduiyingdanju' }));
return;
}
// const orderNoVal = addSchemaAction.getFieldValue('orderNo');
// const relevanceInvoicesVal = addSchemaAction.getFieldValue('relevanceInvoices');
// if (!orderNoVal && relevanceInvoicesVal !== DEPENDENT_DOC_INTERNAL) {
// message.warning(intl.formatMessage({ id: 'stockSellStorage.qingxuanzeduiyingdanju' }));
// return;
// }
setVisible(true);
};
......
......@@ -459,7 +459,7 @@ export const addBillSchema: ISchema = {
type: 'string',
title: intl.formatMessage({id: 'stockSellStorage.huohao'}),
'x-props': {
width: 120,
width: 150,
},
'x-component': 'Text',
'x-component-props': {
......@@ -470,7 +470,7 @@ export const addBillSchema: ISchema = {
type: 'string',
title: intl.formatMessage({id: 'stockSellStorage.huopinmingcheng'}),
'x-props': {
width: 120,
width: 150,
},
'x-component': 'Text',
'x-component-props': {
......@@ -481,7 +481,7 @@ export const addBillSchema: ISchema = {
type: 'string',
title: intl.formatMessage({id: 'stockSellStorage.guigexinghao'}),
'x-props': {
width: 120,
width: 150,
},
'x-component': 'Text',
'x-component-props': {
......@@ -492,7 +492,7 @@ export const addBillSchema: ISchema = {
type: 'string',
title: intl.formatMessage({id: 'stockSellStorage.pinlei'}),
'x-props': {
width: 120,
width: 150,
},
'x-component': 'Text',
'x-component-props': {
......@@ -503,7 +503,7 @@ export const addBillSchema: ISchema = {
type: 'string',
title: intl.formatMessage({id: 'stockSellStorage.pinpai'}),
'x-props': {
width: 120,
width: 150,
},
'x-component': 'Text',
'x-component-props': {
......@@ -514,7 +514,7 @@ export const addBillSchema: ISchema = {
type: 'string',
title: intl.formatMessage({id: 'stockSellStorage.danwei'}),
'x-props': {
width: 120,
width: 150,
},
'x-component': 'Text',
'x-component-props': {
......@@ -525,7 +525,7 @@ export const addBillSchema: ISchema = {
type: 'string',
title: intl.formatMessage({id: 'stockSellStorage.chengbenjia'}),
'x-props': {
width: 120,
width: 150,
},
'x-component': 'Text',
'x-component-props': {
......
......@@ -141,7 +141,10 @@ const Inventory: React.FC<{}> = () => {
// 修改安全库存
const handleSubmit = async values => {
setConfirmLoading(true);
if (!current) {
// selectedRowKeys 批量
return
}
const res = await postProductInventorySafetyUpdate({
id: current.id,
safetyInvoices: +values.safetyInvoices,
......@@ -162,7 +165,12 @@ const Inventory: React.FC<{}> = () => {
};
const controllerBtns = (
<AuthButton btnCode="bills.add">
<Button onClick={()=>console.log(selectedRowKeys,'selectedRowKeysselectedRowKeys')} style={{width: 154}}>批量调整安全库存</Button>
<Button
onClick={() => handleUpdateSafetyStock(undefined)}
style={{ width: 154 }}
>
{intl.formatMessage({ id: 'stockSellStorage.piliangtiaozhenganquankucun' })}
</Button>
</AuthButton>
);
return (
......@@ -182,7 +190,6 @@ const Inventory: React.FC<{}> = () => {
onSubmit={values => ref.current.reload(values)}
expressionScope={{
controllerBtns,
selectedRowKeys
}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
......
......@@ -9,65 +9,87 @@ export const inventorySchema: ISchema = {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
},
properties: {
ctl: {
topLayout: {
type: 'object',
'x-component': 'Children',
'x-component': 'mega-layout',
'x-component-props': {
children: '{{controllerBtns}}',
grid: true,
},
},
goodsName: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.sousuo'}),
tip: intl.formatMessage({id: 'stockSellStorage.shuruhuopinmingcheng'}),
// align: 'flex-left',
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
goodsName: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: intl.formatMessage({
id: 'stockSellStorage.sousuo',
}),
tip: intl.formatMessage({
id: 'stockSellStorage.shuruhuopinmingcheng',
}),
// align: 'flex-left',
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
'x-component': 'flex-layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 6,
rowStyle: {
flexWrap: 'nowrap',
},
colStyle: {
marginLeft: 20,
},
},
properties: {
itemNo: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.huohao'}),
placeholder: intl.formatMessage({
id: 'stockSellStorage.huohao',
}),
},
},
specifications: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.guigexinghao'}),
placeholder: intl.formatMessage({
id: 'stockSellStorage.guigexinghao',
}),
},
},
category: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.pinlei'}),
placeholder: intl.formatMessage({
id: 'stockSellStorage.pinlei',
}),
},
},
brand: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.pinpai'}),
placeholder: intl.formatMessage({
id: 'stockSellStorage.pinpai',
}),
},
},
warehouseId: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.cangku'}),
placeholder: intl.formatMessage({
id: 'stockSellStorage.cangku',
}),
},
enum: [],
},
......@@ -77,7 +99,7 @@ export const inventorySchema: ISchema = {
span: 1,
},
'x-component-props': {
children: intl.formatMessage({id: 'stockSellStorage.chaxun'}),
children: intl.formatMessage({ id: 'stockSellStorage.chaxun' }),
},
},
},
......@@ -99,15 +121,19 @@ export const safetyModalSchema: ISchema = {
properties: {
safetyInvoices: {
type: 'string',
title: intl.formatMessage({id: 'stockSellStorage.anquankucun'}),
title: intl.formatMessage({ id: 'stockSellStorage.anquankucun' }),
required: true,
'x-component-props': {
placeholder: intl.formatMessage({id: 'stockSellStorage.qingshuru'}),
placeholder: intl.formatMessage({
id: 'stockSellStorage.qingshuru',
}),
},
'x-rules': [
{
pattern: PATTERN_MAPS.weight,
message: intl.formatMessage({id: 'stockSellStorage.qingshuruzhengshu'}),
message: intl.formatMessage({
id: 'stockSellStorage.qingshuruzhengshu',
}),
},
],
},
......
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