Commit 6f57af4f authored by shenshaokai's avatar shenshaokai

Merge branch 'fix-20221102' into 'jinfa-20221102'

fix: bugID=37230 供应商导入-兼容适用区域字段没有填值问题 See merge request project/jinfa-platform!497
parents 7afbf640 54c39020
......@@ -238,7 +238,7 @@ const Receipt: React.ForwardRefRenderFunction<RefHandle, IProps> = (props, ref)
return item;
})
}
return list
return list.slice()
}
const invoiceModalConfirm = (value) => {
......
......@@ -443,7 +443,7 @@ const MemberDocCategoryPro: React.ForwardRefRenderFunction<MemberDocCategoryProR
const handleSubmit = (values: FormSubmitValueType) => {
if (onSubmit) {
const { maxAmount, categories, bankInfos, ...rest } = values;
const { maxAmount, categories, bankInfos, areaCodes, ...rest } = values;
let ret = true
bankInfos.map(val => {
if (!val.countryCode) {
......@@ -472,10 +472,19 @@ const MemberDocCategoryPro: React.ForwardRefRenderFunction<MemberDocCategoryProR
businessCategoryId: item.id ?? Date.now()
};
});
let areaCode = areaCodes
// 由于 适用区域字段 areaCodes 改成非必填了 兼容一下 可能传递数组里面空对象的情况
if (Array.isArray(areaCodes)) {
areaCode = areaCode.filter(item => Object.keys(item).length);
areaCode = areaCode.length ? areaCode : null
}
const res = onSubmit({
maxAmount: isNaN(+maxAmount) ? 0 : +maxAmount,
categories: formated,
memberBankInfos: bankInfos.map(item => ({ ...item, bankId: item.id ?? Date.now() })),
areaCodes: areaCode,
...rest,
});
if (res instanceof Promise) {
......
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