Commit 5e1a0bb7 authored by XieZhiXiong's avatar XieZhiXiong

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

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