Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
6c9f0218
Commit
6c9f0218
authored
Mar 28, 2022
by
wzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 价格库页面接口对接
parent
c7ef0a4d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
101 additions
and
73 deletions
+101
-73
detailLibrary.tsx
src/pages/priceManage/priceLibrary/detailLibrary.tsx
+36
-31
index.tsx
src/pages/priceManage/priceLibrary/index.tsx
+61
-38
index.tsx
src/pages/priceManage/schema/index.tsx
+4
-4
No files found.
src/pages/priceManage/priceLibrary/detailLibrary.tsx
View file @
6c9f0218
...
...
@@ -4,88 +4,93 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout';
import
StandardTable
from
'@/components/StandardTable'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
history
}
from
'umi'
;
import
{
getProductCommodityGetUnitPriceStrategyList
}
from
'@/services/ProductV2Api'
;
import
{
getProductPriceManagementGetGoodsPriceHistory
}
from
'@/services/ProductV2Api'
;
const
DetailLibrary
:
React
.
FC
<
{}
>
=
()
=>
{
const
ref
=
useRef
<
any
>
({});
const
{
goodsPriceId
}
=
history
.
location
.
query
;
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'物料编号'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
goodsCode
'
,
key
:
'
goodsCode
'
,
},
{
title
:
'物料名称'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
name
'
,
key
:
'
name
'
,
},
{
title
:
'规格型号'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
type
'
,
key
:
'
type
'
,
},
{
title
:
'品类'
,
dataIndex
:
'id'
,
key
:
'id'
,
dataIndex
:
'customerCategory'
,
key
:
'customerCategory'
,
render
:
text
=>
text
?.
name
,
},
{
title
:
'品牌'
,
dataIndex
:
'id'
,
key
:
'id'
,
dataIndex
:
'unitName'
,
key
:
'unitName'
,
render
:
text
=>
text
?.
name
,
},
{
title
:
'单位'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
unitName
'
,
key
:
'
unitName
'
,
},
{
title
:
'目录价'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
costPrice
'
,
key
:
'
costPrice
'
,
},
{
title
:
'市场价'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
marketPrice
'
,
key
:
'
marketPrice
'
,
},
{
title
:
'合同/订单价'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
orderPrice
'
,
key
:
'
orderPrice
'
,
},
{
title
:
'合同/订单'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
code
'
,
key
:
'
code
'
,
},
{
title
:
'供应会员ID'
,
dataIndex
:
'
i
d'
,
key
:
'
i
d'
,
dataIndex
:
'
upperMemberI
d'
,
key
:
'
upperMemberI
d'
,
},
{
title
:
'供应会员名称'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
upperMemberName
'
,
key
:
'
upperMemberName
'
,
},
{
title
:
'价格有效从'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
effectiveStartTime
'
,
key
:
'
effectiveStartTime
'
,
},
{
title
:
'价格有效到'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
effectiveEndTime
'
,
key
:
'
effectiveEndTime
'
,
},
];
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
(
resolve
=>
{
getProductCommodityGetUnitPriceStrategyList
(
params
).
then
(
res
=>
{
getProductPriceManagementGetGoodsPriceHistory
({
...
params
,
goodsPriceId
,
}).
then
(
res
=>
{
const
{
data
}
=
res
;
resolve
(
data
);
});
...
...
src/pages/priceManage/priceLibrary/index.tsx
View file @
6c9f0218
import
React
,
{
useRef
}
from
'react'
;
import
{
Button
,
Card
,
Input
}
from
'antd'
;
import
{
Button
,
Card
,
Input
,
message
}
from
'antd'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
StandardTable
from
'@/components/StandardTable'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
librarySearch
}
from
'../schema'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
history
,
useIntl
}
from
'umi'
;
import
{
getProductCommodityGetUnitPriceStrategyList
}
from
'@/services/ProductV2Api'
;
import
{
getProductPriceManagementGetGoodsPriceList
,
ProductPriceManagementAddGoodsPrice
,
}
from
'@/services/ProductV2Api'
;
import
AuthButton
from
'@/components/AuthButton'
;
const
formActions
=
createFormActions
();
...
...
@@ -21,84 +22,91 @@ const PriceLibrary: React.FC<{}> = () => {
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'物料编号'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
goodsCode
'
,
key
:
'
goodsCode
'
,
},
{
title
:
'物料名称'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
name
'
,
key
:
'
name
'
,
},
{
title
:
'规格型号'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
type
'
,
key
:
'
type
'
,
},
{
title
:
'品类'
,
dataIndex
:
'id'
,
key
:
'id'
,
dataIndex
:
'customerCategory'
,
key
:
'customerCategory'
,
render
:
text
=>
text
?.
name
,
},
{
title
:
'品牌'
,
dataIndex
:
'id'
,
key
:
'id'
,
dataIndex
:
'unitName'
,
key
:
'unitName'
,
render
:
text
=>
text
?.
name
,
},
{
title
:
'单位'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
unitName
'
,
key
:
'
unitName
'
,
},
{
title
:
'目录价'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
costPrice
'
,
key
:
'
costPrice
'
,
},
{
title
:
'市场价'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
render
:
text
=>
{
dataIndex
:
'
marketPrice
'
,
key
:
'
marketPrice
'
,
render
:
(
text
,
record
)
=>
{
return
(
<
Input
prefix=
{
intl
.
formatMessage
({
id
:
'priceManage.priceStrategy.columns.currency'
,
})
}
defaultValue=
{
text
}
onPressEnter=
{
(
e
:
any
)
=>
console
.
log
(
e
.
target
.
value
,
'eeeeeeeeeee'
)
}
onPressEnter=
{
(
e
:
any
)
=>
updatePrice
({
goodsPriceId
:
record
.
id
,
marketPrice
:
e
.
target
.
value
,
})
}
/>
);
},
},
{
title
:
'合同/订单价'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
orderPrice
'
,
key
:
'
orderPrice
'
,
},
{
title
:
'合同/订单'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
code
'
,
key
:
'
code
'
,
},
{
title
:
'供应会员ID'
,
dataIndex
:
'
i
d'
,
key
:
'
i
d'
,
dataIndex
:
'
upperMemberI
d'
,
key
:
'
upperMemberI
d'
,
},
{
title
:
'供应会员名称'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
upperMemberName
'
,
key
:
'
upperMemberName
'
,
},
{
title
:
'价格有效从'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
effectiveStartTime
'
,
key
:
'
effectiveStartTime
'
,
},
{
title
:
'价格有效到'
,
dataIndex
:
'
id
'
,
key
:
'
id
'
,
dataIndex
:
'
effectiveEndTime
'
,
key
:
'
effectiveEndTime
'
,
},
{
title
:
intl
.
formatMessage
({
...
...
@@ -106,7 +114,7 @@ const PriceLibrary: React.FC<{}> = () => {
}),
dataIndex
:
'option'
,
width
:
128
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
render
:
(
_
text
:
any
,
record
:
any
)
=>
{
return
(
<
AuthButton
btnCode=
""
>
<
Button
...
...
@@ -124,7 +132,7 @@ const PriceLibrary: React.FC<{}> = () => {
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
(
resolve
=>
{
getProduct
CommodityGetUnitPriceStrategy
List
(
params
).
then
(
res
=>
{
getProduct
PriceManagementGetGoodsPrice
List
(
params
).
then
(
res
=>
{
const
{
data
}
=
res
;
resolve
(
data
);
});
...
...
@@ -132,9 +140,24 @@ const PriceLibrary: React.FC<{}> = () => {
};
const
handleModify
=
(
record
:
any
)
=>
{
history
.
push
(
`
${
history
.
location
.
pathname
}
/detail?id=
${
record
.
id
}
`
);
history
.
push
(
`
${
history
.
location
.
pathname
}
/detail?goodsPriceId=
${
record
.
id
}
`
,
);
};
const
updatePrice
=
params
=>
{
ProductPriceManagementAddGoodsPrice
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
message
.
success
(
res
.
message
);
}
else
{
message
.
error
(
intl
.
formatMessage
({
id
:
`
${
res
.
code
}
`
,
defaultMessage
:
res
.
message
,
}),
);
}
});
};
return
(
<
PageHeaderWrapper
>
<
Card
>
...
...
src/pages/priceManage/schema/index.tsx
View file @
6c9f0218
...
...
@@ -488,25 +488,25 @@ export const librarySearch: ISchema = {
},
},
properties
:
{
wlbh
:
{
code
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'物料编号'
,
},
},
wlmc
:
{
name
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'物料名称'
,
},
},
pl
:
{
customerCategoryId
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'品类'
,
},
},
gyhymc
:
{
uppreMemberName
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'供应会员名称'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment