Commit 5e1a0bb7 authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复单据类型编号偶尔不存在的问题

parent a610a9b9
......@@ -332,7 +332,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
<Suspense fallback={null}>
<ProductList
title="换货商品"
rowKey="orderRecordId"
rowKey="detailId"
columns={productColumns}
loading={replaceGoodsLoading}
dataSource={replaceGoodsList.data}
......
......@@ -299,6 +299,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
replaceId: id || 0,
supplierMemberId: supplierMember[0].memberId,
supplierRoleId: supplierMember[0].roleId,
supplierMemberName: supplierMember[0].name,
replaceGoodsAddress: {
receiveAddress: deliveryAddress.fullAddress || '',
receiveUserName: deliveryAddress.receiverName || '',
......@@ -422,6 +423,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
unit: item.costPrice,
purchaseCount: item.purchaseCount,
purchasePrice: item.price,
purchaseAmount: +(item.price * item.purchaseCount).toFixed(2),
replacedCount: item.replaceCount || item.purchaseCount || 0, // 已换货数量
replaceReason: '',
};
......
......@@ -265,7 +265,7 @@ export const addBillSchema: ISchema = {
title: '采购单价',
'x-component': 'Text',
},
costPrice3: {
purchaseAmount: {
type: 'string',
title: '采购金额',
'x-component': 'Text',
......
......@@ -227,6 +227,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
};
const handleReturnAddressSubmit = values => {
console.log('values', values)
setReturnAddress(values);
};
......@@ -381,7 +382,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
<Suspense fallback={null}>
<ProductList
title="换货商品"
rowKey="orderRecordId"
rowKey="detailId"
columns={productColumns}
loading={replaceGoodsLoading}
dataSource={replaceGoodsList.data}
......
......@@ -113,7 +113,6 @@
&-main {
position: relative;
width: 328px;
height: 38px;
padding-bottom: 8px;
&::after {
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-16 15:16:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-03 15:40:31
* @LastEditTime: 2020-12-04 16:59:25
* @Description: 联动逻辑相关
*/
import { Modal } from 'antd';
......@@ -488,6 +488,20 @@ export const useBusinessEffects = (context, actions) => {
linkage.componentProps('orderNo', params);
});
// 根据 单据类型 联动 对应单据所选项
context('requestAsyncSelect').subscribe(fieldState => {
if (fieldState.name === 'invoicesTypeId') {
const invoicesTypeIdState = getFieldState('invoicesTypeId');
if (invoicesTypeIdState.value) {
const current = invoicesTypeIdState.originAsyncData.find(item => item.id === invoicesTypeIdState.value);
if (current) {
linkage.value('invoicesTypeCode', current.number);
}
};
}
});
// 对应仓库改变
onFieldInputChange$('inventoryId').subscribe(fieldState => {
const current = fieldState.originAsyncData.find(item => item.id === fieldState.value);
......
......@@ -665,6 +665,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
id,
orderNo,
deliveryType,
goodsCount,
...extraRest
},
itemName,
......@@ -677,6 +678,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
...extraRest,
goodsName: itemName,
storageCount: productCount,
productCount: goodsCount,
};
}),
supplyMembersName: memberName,
......@@ -709,6 +711,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
id,
orderNo,
deliveryType,
goodsCount,
...extraRest
},
itemName,
......@@ -721,6 +724,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
...extraRest,
goodsName: itemName,
storageCount: productCount,
productCount: goodsCount,
};
}),
})
......@@ -756,6 +760,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
id,
orderNo,
deliveryType,
goodsCount,
...extraRest
},
itemName,
......@@ -768,6 +773,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
...extraRest,
goodsName: itemName,
shipmentQuantity: productCount,
productCount: goodsCount,
};
}),
createMemberName: memberName,
......@@ -800,6 +806,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
id,
orderNo,
deliveryType,
goodsCount,
...extraRest
},
itemName,
......@@ -812,6 +819,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
...extraRest,
goodsName: itemName,
shipmentQuantity: productCount,
productCount: goodsCount,
};
}),
})
......
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