Commit 063cec32 authored by XieZhiXiong's avatar XieZhiXiong

change: 修改单据数量校验正则

parent 19509777
......@@ -21,12 +21,6 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import {
DEPENDENT_DOC_ORDER,
DEPENDENT_DOC_EXCHANGE,
DEPENDENT_DOC_RETURN,
DEPENDENT_DOC_PRODUCTION,
DEPENDENT_DOC_INTERNAL,
DOC_TYPE_PURCHASE_RECEIPT,
DOC_TYPE_SALES_INVOICE,
DOC_TYPE_PROCESS_RECEIPT,
......@@ -59,6 +53,23 @@ interface BillsFormProps {
relevanceInvoicesId: string, // 单据id,可能是待新增销售发货单,待新增采购入库单跳转过来的
};
function transforDirection(type) {
let flag = 0;
switch (type) {
case DOC_TYPE_PURCHASE_RECEIPT:
case DOC_TYPE_PROCESS_RECEIPT:
case DOC_TYPE_RETURN_RECEIPT:
case DOC_TYPE_EXCHANGE_RECEIPT:
case DOC_TYPE_EXCHANGE_RETURN_RECEIPT:
flag = 1;
break;
default:
break;
}
return flag;
};
const BillsForm: React.FC<BillsFormProps> = ({
id,
isEdit = false,
......@@ -154,9 +165,20 @@ const BillsForm: React.FC<BillsFormProps> = ({
const details = invoicesDetailsList ? invoicesDetailsList.map(item => ({
...item,
// 单据数量,需要判断是 入库 还是 发货 单 匹配对应的字段值
productCount: transforDirection(rest.invoicesTypeId) ? item.storageCount : item.shipmentQuantity,
product: item.productId,
amount: `¥${(+item.productCount * item.price).toFixed(2)}`,
deliveryType,
extraData: {
productName: item.productName,
deliveryType,
id: '', // 加工发货单需要,明细id
processNum: 0, // 加工发货单需要,加工数量
orderNo: item.orderNo, // 订单编号
goodsCount: item.productCount, // 采购数量
price: item.price, // 加工发货、入库单需要,加工单价
totalPrice: 0, // 加工发货、入库单需要,加工总价
},
})) : [];
addSchemaAction.setFieldState(
......
......@@ -504,7 +504,7 @@ export const addBillSchema: ISchema = {
message: '请输入单据数量',
},
{
pattern: PATTERN_MAPS.quantity,
pattern: PATTERN_MAPS.weight,
message: '请输入正确的数量',
},
],
......
......@@ -178,7 +178,7 @@ const Bills: React.FC<{}> = () => {
align: 'center',
render: (text: any, record: any) => (
<EyePreview
url={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.id}&preview=1`}
url={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.id}`}
>
{text}
</EyePreview>
......
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