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

fix: 处理批量新增仓位报方式异常问题

parent 720c34c6
...@@ -34,7 +34,7 @@ const PriceManage: React.FC<{}> = () => { ...@@ -34,7 +34,7 @@ const PriceManage: React.FC<{}> = () => {
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
className: 'commonPickColor', className: 'commonPickColor',
render: (text: any, record: any) => render: (text, record) =>
<EyePreview <EyePreview
url={`/memberCenter/commodityAbility/priceManage/priceStrategy/setStrategy/detail?id=${record.id}&preview=1`} url={`/memberCenter/commodityAbility/priceManage/priceStrategy/setStrategy/detail?id=${record.id}&preview=1`}
...@@ -90,7 +90,7 @@ const PriceManage: React.FC<{}> = () => { ...@@ -90,7 +90,7 @@ const PriceManage: React.FC<{}> = () => {
title: intl.formatMessage({ id: 'priceManage.priceStrategy.columns.min' }), title: intl.formatMessage({ id: 'priceManage.priceStrategy.columns.min' }),
dataIndex: 'min', dataIndex: 'min',
key: 'min', key: 'min',
render: (text: any, reocrd: any) => { render: (text, reocrd) => {
if (reocrd.priceType === 1) { if (reocrd.priceType === 1) {
if (reocrd.max === reocrd.min) if (reocrd.max === reocrd.min)
return <>{intl.formatMessage({ id: 'priceManage.priceStrategy.columns.currency' })}{reocrd.min}</> return <>{intl.formatMessage({ id: 'priceManage.priceStrategy.columns.currency' })}{reocrd.min}</>
...@@ -111,7 +111,7 @@ const PriceManage: React.FC<{}> = () => { ...@@ -111,7 +111,7 @@ const PriceManage: React.FC<{}> = () => {
title: intl.formatMessage({ id: 'priceManage.priceStrategy.columns.isEnable' }), title: intl.formatMessage({ id: 'priceManage.priceStrategy.columns.isEnable' }),
dataIndex: 'isEnable', dataIndex: 'isEnable',
key: 'isEnable', key: 'isEnable',
render: (text: any, record: any) => ( render: (text, record) => (
<AuthButton btnCode='priceManage.state' > <AuthButton btnCode='priceManage.state' >
<StatusSwitch <StatusSwitch
handleConfirm={() => handleUpdateState(record)} handleConfirm={() => handleUpdateState(record)}
...@@ -138,7 +138,7 @@ const PriceManage: React.FC<{}> = () => { ...@@ -138,7 +138,7 @@ const PriceManage: React.FC<{}> = () => {
title: intl.formatMessage({ id: 'priceManage.priceStrategy.columns.option' }), title: intl.formatMessage({ id: 'priceManage.priceStrategy.columns.option' }),
dataIndex: 'option', dataIndex: 'option',
width: 128, width: 128,
render: (text: any, record: any) => { render: (text, record) => {
return ( return (
<> <>
<AuthButton btnCode='priceManage.edit' > <AuthButton btnCode='priceManage.edit' >
...@@ -155,7 +155,7 @@ const PriceManage: React.FC<{}> = () => { ...@@ -155,7 +155,7 @@ const PriceManage: React.FC<{}> = () => {
} }
]; ];
const fetchData = (params: any) => { const fetchData = (params) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getProductCommodityGetUnitPriceStrategyList(params).then(res => { getProductCommodityGetUnitPriceStrategyList(params).then(res => {
const { data } = res const { data } = res
...@@ -164,7 +164,7 @@ const PriceManage: React.FC<{}> = () => { ...@@ -164,7 +164,7 @@ const PriceManage: React.FC<{}> = () => {
}) })
} }
const handleUpdateState = (record: any) => { const handleUpdateState = (record) => {
postProductCommodityUpdateUnitPriceStrategyStatus({ id: record.id, isEnable: !record.isEnable }).then(res => { postProductCommodityUpdateUnitPriceStrategyStatus({ id: record.id, isEnable: !record.isEnable }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
setTimeout(() => { setTimeout(() => {
...@@ -174,11 +174,11 @@ const PriceManage: React.FC<{}> = () => { ...@@ -174,11 +174,11 @@ const PriceManage: React.FC<{}> = () => {
}) })
} }
const handleModify = (record: any) => { const handleModify = (record) => {
history.push(`${history.location.pathname}/edit?id=${record.id}`) history.push(`${history.location.pathname}/edit?id=${record.id}`)
} }
const handleDelete = (record: any) => { const handleDelete = (record) => {
postProductCommodityDeleteUnitPriceStrategy({ id: record.id }).then(res => { postProductCommodityDeleteUnitPriceStrategy({ id: record.id }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
setTimeout(() => { setTimeout(() => {
...@@ -208,7 +208,7 @@ const PriceManage: React.FC<{}> = () => { ...@@ -208,7 +208,7 @@ const PriceManage: React.FC<{}> = () => {
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
tableProps={{ rowKey: 'id' }} tableProps={{ rowKey: 'id' }}
fetchTableData={(params: any) => fetchData(params)} fetchTableData={(params) => fetchData(params)}
controlRender={ controlRender={
<NiceForm <NiceForm
actions={formActions} actions={formActions}
......
...@@ -55,6 +55,7 @@ const BatchAddRepository: React.FC<{}> = () => { ...@@ -55,6 +55,7 @@ const BatchAddRepository: React.FC<{}> = () => {
addSchemaAction.getFieldState('shopIds', state => { addSchemaAction.getFieldState('shopIds', state => {
params['shopIds'] = state.value.map(item => state.props['x-component-props'].dataSource.filter(_ => _.id === item)[0]) params['shopIds'] = state.value.map(item => state.props['x-component-props'].dataSource.filter(_ => _.id === item)[0])
}) })
params['inventoryDeductWay'] = 1
let res = await postProductFreightSpaceAddBatch(params) let res = await postProductFreightSpaceAddBatch(params)
if (res.code === 1000) { if (res.code === 1000) {
setTimeout(() => { setTimeout(() => {
......
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