Commit 968311d7 authored by 前端-许佳敏's avatar 前端-许佳敏
parents 1b64ae16 ee9e16ad
......@@ -42,7 +42,7 @@ const Relevance = props => {
fetchTableData,
title = '选择',
tip = '', // 点击按钮前的提示,用于前提需要提示的场景
disabled = false,
disabled = false,
} = props.props['x-component-props'];
const tableRowKey = tableProps.rowKey || 'id';
......
......@@ -274,7 +274,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
orderNo,
id: +relevanceInvoicesId,
deliveryAddresId: +deliveryAddresId,
createMemberName,
memberName: createMemberName,
fullAddress: deliveryAddressInfo.fullAddress || '',
receiverName: deliveryAddressInfo.receiverName || '',
phone: deliveryAddressInfo.phone || '',
......@@ -292,7 +292,45 @@ const BillsForm: React.FC<BillsFormProps> = ({
// 加工入库单
case DOC_TYPE_PROCESS_RECEIPT: {
setInfoLoading(true);
PublicApi.getEnhanceSupplierToBeAddStorageDetails({
id: relevanceInvoicesId,
}).then(res => {
if (res.code !== 1000) {
return;
}
const {
processName,
receiverAddressId,
noticeNo,
receiveAddress,
receiveUserName,
receiveUserTel,
deliveryType,
} = res.data;
setBillInfo({
invoicesTypeId: intInvoicesTypeId,
relevanceInvoices: +relevanceInvoices,
orderNo:
relevanceInvoicesId ?
[
{
orderNo: noticeNo,
id: +relevanceInvoicesId,
deliveryAddresId: +receiverAddressId,
memberName: processName,
fullAddress: receiveAddress || '',
receiverName: receiveUserName || '',
phone: receiveUserTel || '',
}
] :
[]
,
});
}).finally(() => {
setInfoLoading(false);
});
break;
}
......@@ -325,11 +363,10 @@ const BillsForm: React.FC<BillsFormProps> = ({
orderNo: noticeNo,
id: +relevanceInvoicesId,
deliveryAddresId: +receiverAddressId,
supplierName,
memberName: supplierName,
fullAddress: receiveAddress || '',
receiverName: receiveUserName || '',
phone: receiveUserTel || '',
// isDefault: deliveryAddressInfo.isDefault,
}
] :
[]
......@@ -399,6 +436,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
</Button>
) : null;
// 提交
const handleSubmit = value => {
const {
invoicesTypeId,
......@@ -421,14 +459,6 @@ const BillsForm: React.FC<BillsFormProps> = ({
}));
const newTransactionTime = transactionTime ? moment(transactionTime).valueOf() : null;
const payload = {
orderNo: orderNo[0].orderNo,
relevanceInvoicesId: orderNo[0].id,
transactionTime: newTransactionTime,
invoicesDetailsRequests: newInvoicesDetailsRequests,
...rest,
};
setSubmitLoading(true);
switch (invoicesTypeId) {
// 采购入库单
......@@ -438,7 +468,14 @@ const BillsForm: React.FC<BillsFormProps> = ({
return;
}
PublicApi.postOrderPurchaseReceiptAdd({
...payload,
...rest,
orderNo: orderNo[0].orderNo,
relevanceInvoicesId: orderNo[0].id,
transactionTime: newTransactionTime,
invoicesDetailsRequests: newInvoicesDetailsRequests.map(item => ({
...item,
itemNmae: item.itemName,
})),
supplyMembersName: memberName,
})
.then(res => {
......@@ -459,11 +496,14 @@ const BillsForm: React.FC<BillsFormProps> = ({
}
PublicApi.postWarehouseInvoicesUpdata({
id: +id,
invoicesAbstract: payload.invoicesAbstract,
inventoryId: payload.inventoryId,
inventoryRole: payload.inventoryRole,
transactionTime: payload.transactionTime,
invoicesDetailsRequests: payload.invoicesDetailsRequests,
invoicesAbstract: rest.invoicesAbstract,
inventoryId: rest.inventoryId,
inventoryRole: rest.inventoryRole,
transactionTime: newTransactionTime,
invoicesDetailsRequests: newInvoicesDetailsRequests.map(item => ({
...item,
itemNmae: item.itemName,
})),
})
.then(res => {
if (res.code !== 1000) {
......@@ -487,7 +527,14 @@ const BillsForm: React.FC<BillsFormProps> = ({
return;
}
PublicApi.postOrderSalesInvoiceOrder({
...payload,
...rest,
orderNo: orderNo[0].orderNo,
relevanceInvoicesId: orderNo[0].id,
transactionTime: newTransactionTime,
invoicesDetailsRequests: newInvoicesDetailsRequests.map(item => ({
...item,
itemNmae: item.itemName,
})),
createMemberName: memberName,
})
.then(res => {
......@@ -508,11 +555,14 @@ const BillsForm: React.FC<BillsFormProps> = ({
}
PublicApi.postWarehouseInvoicesUpdata({
id: +id,
invoicesAbstract: payload.invoicesAbstract,
inventoryId: payload.inventoryId,
inventoryRole: payload.inventoryRole,
transactionTime: payload.transactionTime,
invoicesDetailsRequests: payload.invoicesDetailsRequests,
invoicesAbstract: rest.invoicesAbstract,
inventoryId: rest.inventoryId,
inventoryRole: rest.inventoryRole,
transactionTime: newTransactionTime,
invoicesDetailsRequests: newInvoicesDetailsRequests.map(item => ({
...item,
itemNmae: item.itemName,
})),
})
.then(res => {
if (res.code !== 1000) {
......@@ -531,13 +581,79 @@ const BillsForm: React.FC<BillsFormProps> = ({
// 加工入库单
case DOC_TYPE_PROCESS_RECEIPT: {
if (!id) {
if (isEdit) {
return;
}
PublicApi.postEnhanceSupplierToBeAddStorageSubmit({
produceNoticeOrderId: orderNo[0].id,
warehouseId: rest.inventoryId,
warehouseRole: rest.inventoryRole,
storageSummary: rest.invoicesAbstract,
storageTime: newTransactionTime,
storageDetailsDTOList: newInvoicesDetailsRequests.map(item => ({
...item,
produceNoticeOrderDetailId: item.id,
storageCount: item.productCount,
})),
})
.then(res => {
if (res.code !== 1000) {
return;
}
setUnsaved(false);
setTimeout(() => {
history.goBack();
}, 800);
}).finally(() => {
setSubmitLoading(false);
});
} else {
// update action
if (!isEdit) {
return;
}
}
break;
}
// 加工发货单
case DOC_TYPE_PROCESS_INVOICE: {
if (!id) {
if (isEdit) {
return;
}
PublicApi.postEnhanceProcessToBeAddDeliverySubmit({
produceNoticeOrderId: orderNo[0].id,
warehouseId: rest.inventoryId,
warehouseRole: rest.inventoryRole,
invoiceSummary: rest.invoicesAbstract,
invoiceTime: newTransactionTime,
invoiceDetailsDTOList: newInvoicesDetailsRequests.map(item => ({
...item,
produceNoticeOrderDetailId: item.id,
shipmentQuantity: item.productCount,
})),
})
.then(res => {
if (res.code !== 1000) {
return;
}
setUnsaved(false);
setTimeout(() => {
history.goBack();
}, 800);
}).finally(() => {
setSubmitLoading(false);
});
} else {
// update action
if (!isEdit) {
return;
}
}
break;
}
......@@ -582,7 +698,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
const atom = {
itemNo: item.code,
goodsId: item.id,
itemNmae: item.name,
itemName: item.name,
specifications: item.type,
category: item.customerCategory ? item.customerCategory.name : '',
brand: item.brand ? item.brand.name : '',
......
......@@ -419,7 +419,7 @@ export const addBillSchema: ISchema = {
title: '货号',
'x-component': 'Text',
},
itemNmae: {
itemName: {
type: 'string',
title: '货品名称',
'x-component': 'Text',
......@@ -508,6 +508,16 @@ export const addBillSchema: ISchema = {
type: 'string',
display: false,
},
// 明细 商品记录id(加工发货单需要),不用于展示,只收集值
id: {
type: 'string',
display: false,
},
// 订单号(加工发货单需要),不用于展示,只收集值
orderNo: {
type: 'string',
display: false,
},
},
}
},
......@@ -520,6 +530,7 @@ export const addBillSchema: ISchema = {
},
};
// 采购入库单、销售发货单订单 弹窗 search schema
export const purchaseOrderBillSchema: ISchema = {
type: 'object',
properties: {
......@@ -608,6 +619,138 @@ export const purchaseOrderBillSchema: ISchema = {
},
};
// 加工入库单 弹窗 search schema
export const machiningWarehousingBillSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'Mega-Layout',
properties: {
search: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: '搜索',
align: 'flex-start',
tip: '输入 通知单号 进行搜索',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 3,
},
properties: {
summary: {
type: 'string',
'x-component-props': {
placeholder: '通知单摘要',
allowClear: true,
},
},
processName: {
type: 'string',
'x-component-props': {
placeholder: '加工企业',
allowClear: true,
},
},
'[startTime, endTime]': {
type: 'string',
'x-component': 'DateSelect',
'x-component-props': {
placeholder: '单据时间',
allowClear: true,
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
}
}
},
},
},
},
},
};
// 加工发货单 弹窗 search schema
export const machiningDeliveryBillSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'Mega-Layout',
properties: {
search: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: '搜索',
align: 'flex-start',
tip: '输入 通知单号 进行搜索',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 3,
},
properties: {
summary: {
type: 'string',
'x-component-props': {
placeholder: '通知单摘要',
allowClear: true,
},
},
supplierName: {
type: 'string',
'x-component-props': {
placeholder: '供应会员',
allowClear: true,
},
},
'[startTime, endTime]': {
type: 'string',
'x-component': 'DateSelect',
'x-component-props': {
placeholder: '单据时间',
allowClear: true,
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
}
}
},
},
},
},
},
};
export const goodsSearchSchema: ISchema = {
type: 'object',
properties: {
......
......@@ -42,13 +42,7 @@ const Inventory: React.FC<{}> = () => {
title: '商品名称',
dataIndex: 'goodsName',
align: 'center',
render: (text: any, record: any) => (
<EyePreview
url={`/repositories/viewRepository?id=${record.id}&preview=1`}
>
{text}
</EyePreview>
),
render: (text: any, record: any) => text,
},
{
title: '规格型号',
......
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