Commit 2849fe6e authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 批量新增仓位保存按钮多次提交处理,商品上架引导查询交易流程配置添加shopType字段

parent fd8930eb
......@@ -470,6 +470,7 @@ const Products: React.FC<{}> = () => {
const params = {
shopIds: shops.map(item => item.shopId),
products,
shopType: shops.map(item => item.type)[0]
}
const { data, code } = await postOrderCommonProductProcessFind(params, {ctlType: 'none'})
if(code === 1000 && data.length > 0) {
......@@ -485,6 +486,7 @@ const Products: React.FC<{}> = () => {
const executePutaway = (params) => {
const fn = isBatch ? postProductCommodityPublishCommodityBatch : postProductCommodityPublishCommodity
const shopId = shopIdRef.current
console.log(shopId, 'shopId')
// @ts-ignore
fn(isBatch ? { storeId: shopId['id'], storeName: shopId['name'], storeLogo: shopId['logo'], shopList: checkedValues, idList: RowCtl.selectedRowKeys } : { storeId: shopId?.id || null, storeName: shopId?.name || null, storeLogo: shopId?.logo || null, ...params }).then((res) => {
if(res.code === 1000) {
......
import React from 'react'
import React, { useState } from 'react'
import { history, useIntl } from 'umi'
import { Button, Card, message } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
......@@ -21,10 +21,12 @@ const BatchAddRepository: React.FC<{}> = (props) => {
pageStatus
} = usePageStatus()
const [loading, setLoading] = useState<boolean>(false)
// 整体表单提交
const formSubmit = async (values) => {
setLoading(true)
const params = { ...values }
console.log(params, 'params')
if (params['applyMember']) {
params['applyMember'] = params['applyMember']
}
......@@ -41,7 +43,8 @@ const BatchAddRepository: React.FC<{}> = (props) => {
}))
}
if (!params['isAllMemberShare'] && !params['applyMember']?.length) {
message.error(intl.formatMessage({ id: 'repositories.batchAddRepository.error' }))
setLoading(false)
return message.error(intl.formatMessage({ id: 'repositories.batchAddRepository.error' }))
} else {
addSchemaAction.getFieldState('warehouseId', prevState => {
if (prevState.value) {
......@@ -56,6 +59,8 @@ const BatchAddRepository: React.FC<{}> = (props) => {
setTimeout(() => {
history.goBack()
}, 1000)
} else {
setLoading(true)
}
}
}
......@@ -69,7 +74,7 @@ const BatchAddRepository: React.FC<{}> = (props) => {
extra={(
pageStatus !== PageStatus.PREVIEW
? (
<Button key="1" onClick={() => addSchemaAction.submit()} type="primary" icon={<SaveOutlined />}>
<Button key="1" onClick={() => addSchemaAction.submit()} type="primary" icon={<SaveOutlined />} loading={loading}>
{intl.formatMessage({ id: 'repositories.batchAddRepository.extra' })}
</Button>
)
......
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