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

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

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