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
黄庭坚
jinfa-platform
Commits
ee2f4da4
Commit
ee2f4da4
authored
Mar 09, 2022
by
Gavin Peng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2-220418' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into v2-220418
parents
88c0875d
f26e5e10
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
533 additions
and
92 deletions
+533
-92
commodity.ts
src/locales/zh-CN/commodity.ts
+2
-0
priceAttributeForm.tsx
...commodity/products/addProductsItem/priceAttributeForm.tsx
+2
-2
index.tsx
src/pages/commodity/products/index.tsx
+37
-1
productModal.tsx
src/pages/commodity/products/productModal.tsx
+380
-0
index.tsx
src/pages/repositories/index.tsx
+17
-6
index.tsx
src/pages/repositories/schema/index.tsx
+95
-83
No files found.
src/locales/zh-CN/commodity.ts
View file @
ee2f4da4
...
@@ -117,6 +117,7 @@ export default {
...
@@ -117,6 +117,7 @@ export default {
'commodity.products.buttonGroup.5'
:
'上架'
,
'commodity.products.buttonGroup.5'
:
'上架'
,
'commodity.products.buttonGroup.6'
:
'下架'
,
'commodity.products.buttonGroup.6'
:
'下架'
,
'commodity.products.buttonGroup.7'
:
'查看供应商品'
,
'commodity.products.buttonGroup.7'
:
'查看供应商品'
,
'commodity.products.buttonGroup.8'
:
'查看上游商品'
,
'commodity.products.operationHandler.1'
:
'复制'
,
'commodity.products.operationHandler.1'
:
'复制'
,
'commodity.products.operationHandler.2'
:
'提交审核'
,
'commodity.products.operationHandler.2'
:
'提交审核'
,
'commodity.products.operationHandler.3'
:
'修改'
,
'commodity.products.operationHandler.3'
:
'修改'
,
...
@@ -124,6 +125,7 @@ export default {
...
@@ -124,6 +125,7 @@ export default {
'commodity.products.operationHandler.5'
:
'上架'
,
'commodity.products.operationHandler.5'
:
'上架'
,
'commodity.products.operationHandler.6'
:
'下架'
,
'commodity.products.operationHandler.6'
:
'下架'
,
'commodity.products.operationHandler.7'
:
'查看供应商品'
,
'commodity.products.operationHandler.7'
:
'查看供应商品'
,
'commodity.products.operationHandler.8'
:
'查看上游商品'
,
'commodity.products.step0Description.text.1'
:
'点击下载 EXCEL文件模板'
,
'commodity.products.step0Description.text.1'
:
'点击下载 EXCEL文件模板'
,
'commodity.products.step0Description.text.2'
:
'按照模板整理货品资料'
,
'commodity.products.step0Description.text.2'
:
'按照模板整理货品资料'
,
'commodity.products.step0Description.text.3'
:
'点击导入按钮,导入整理好的货品资料'
,
'commodity.products.step0Description.text.3'
:
'点击导入按钮,导入整理好的货品资料'
,
...
...
src/pages/commodity/products/addProductsItem/priceAttributeForm.tsx
View file @
ee2f4da4
...
@@ -829,7 +829,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
...
@@ -829,7 +829,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
>
>
<
InputNumber
style=
{
{
width
:
'100%'
}
}
min=
{
0
}
placeholder=
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.form.minOrder.placeholder'
})
}
onChange=
{
(
e
:
number
)
=>
setMinOrderNumber
(
e
)
}
/>
<
InputNumber
style=
{
{
width
:
'100%'
}
}
min=
{
0
}
placeholder=
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.form.minOrder.placeholder'
})
}
onChange=
{
(
e
:
number
)
=>
setMinOrderNumber
(
e
)
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
{
/*
<Form.Item
<
Form
.
Item
name=
"type"
name=
"type"
label=
{
label=
{
<
span
>
<
span
>
...
@@ -846,7 +846,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
...
@@ -846,7 +846,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
<
Radio
value=
{
1
}
>
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.form.type.radio1'
})
}
</
Radio
>
<
Radio
value=
{
1
}
>
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.form.type.radio1'
})
}
</
Radio
>
<
Radio
value=
{
2
}
>
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.form.type.radio2'
})
}
</
Radio
>
<
Radio
value=
{
2
}
>
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.form.type.radio2'
})
}
</
Radio
>
</
Radio
.
Group
>
</
Radio
.
Group
>
</Form.Item>
*/
}
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
name=
"isCrossBorder"
name=
"isCrossBorder"
label=
{
label=
{
...
...
src/pages/commodity/products/index.tsx
View file @
ee2f4da4
import
React
,
{
useState
,
useEffect
,
useRef
,
useMemo
}
from
'react'
import
React
,
{
useState
,
useEffect
,
useRef
,
useMemo
}
from
'react'
import
{
history
,
useIntl
}
from
'umi'
import
{
history
,
useIntl
}
from
'umi'
import
{
Button
,
Form
,
Card
,
Modal
,
Result
,
Progress
,
Select
,
Tooltip
,
Checkbox
,
Row
,
Col
,
Dropdown
,
Menu
,
Space
,
message
,
Badge
}
from
'antd'
import
{
Button
,
Form
,
Card
,
Modal
,
Result
,
Progress
,
Select
,
Tooltip
,
Checkbox
,
Row
,
Col
,
Dropdown
,
Menu
,
Space
,
message
,
Badge
,
Table
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
import
{
PlusOutlined
,
PlusOutlined
,
...
@@ -38,6 +38,7 @@ import AuthButton from '@/components/AuthButton'
...
@@ -38,6 +38,7 @@ import AuthButton from '@/components/AuthButton'
import
{
AuthUrl
}
from
'@/components/AuthButton/AuthUrl'
import
{
AuthUrl
}
from
'@/components/AuthButton/AuthUrl'
import
allRouters
from
'../../../../config/router.config.json'
import
allRouters
from
'../../../../config/router.config.json'
import
{
postOrderCommonProductProcessFind
}
from
'@/services/OrderNewV2Api'
import
{
postOrderCommonProductProcessFind
}
from
'@/services/OrderNewV2Api'
import
{
ProductView
,
ProductSel
}
from
'./productModal'
const
{
confirm
}
=
Modal
;
const
{
confirm
}
=
Modal
;
...
@@ -71,6 +72,12 @@ const Products: React.FC<{}> = () => {
...
@@ -71,6 +72,12 @@ const Products: React.FC<{}> = () => {
const
[
giudeStep
,
setGiudeStep
]
=
useState
<
number
>
()
const
[
giudeStep
,
setGiudeStep
]
=
useState
<
number
>
()
const
[
inconformityProductIds
,
setInconformityProductIds
]
=
useState
<
number
[]
>
([])
const
[
inconformityProductIds
,
setInconformityProductIds
]
=
useState
<
number
[]
>
([])
// 上游弹窗
const
[
upModal
,
setUpModal
]
=
useState
(
false
)
const
[
uppId
,
setUpId
]
=
useState
<
number
>
();
const
[
upSelModal
,
setUpSelModal
]
=
useState
(
false
)
const
[
downSelModal
,
setDownSelModal
]
=
useState
(
false
)
// const [shopId, setShopId] = useState<any>()
// const [shopId, setShopId] = useState<any>()
const
shopIdRef
=
useRef
<
any
>
()
const
shopIdRef
=
useRef
<
any
>
()
/** 带参数查询,给表单带默认值 */
/** 带参数查询,给表单带默认值 */
...
@@ -141,6 +148,14 @@ const Products: React.FC<{}> = () => {
...
@@ -141,6 +148,14 @@ const Products: React.FC<{}> = () => {
render
:
t
=>
t
?
t
:
intl
.
formatMessage
({
id
:
'commodity.products.columns.upperMemberName.1'
})
render
:
t
=>
t
?
t
:
intl
.
formatMessage
({
id
:
'commodity.products.columns.upperMemberName.1'
})
},
},
{
{
title
:
'商品类型'
,
dataIndex
:
'CommodityType'
,
key
:
'CommodityType'
,
render
:
t
=>
{
return
t
===
1
?
'自营商品'
:
'上游供应商品'
}
},
{
title
:
intl
.
formatMessage
({
id
:
'commodity.products.columns.min'
}),
title
:
intl
.
formatMessage
({
id
:
'commodity.products.columns.min'
}),
dataIndex
:
'min'
,
dataIndex
:
'min'
,
key
:
'min'
,
key
:
'min'
,
...
@@ -185,6 +200,10 @@ const Products: React.FC<{}> = () => {
...
@@ -185,6 +200,10 @@ const Products: React.FC<{}> = () => {
history
.
push
(
`/memberCenter/commodityAbility/commodity/products/detail?id=
${
upId
}
`
)
history
.
push
(
`/memberCenter/commodityAbility/commodity/products/detail?id=
${
upId
}
`
)
}
}
const
upModalFn
=
(
id
:
number
)
=>
{
setUpId
(
id
);
setUpModal
(
true
);
};
/** 参照后台数据生成 */
/** 参照后台数据生成 */
const
renderOptionButton
=
(
record
)
=>
{
const
renderOptionButton
=
(
record
)
=>
{
...
@@ -207,6 +226,7 @@ const Products: React.FC<{}> = () => {
...
@@ -207,6 +226,7 @@ const Products: React.FC<{}> = () => {
[
intl
.
formatMessage
({
id
:
'commodity.products.buttonGroup.5'
})]:
record
.
isOnPublish
,
[
intl
.
formatMessage
({
id
:
'commodity.products.buttonGroup.5'
})]:
record
.
isOnPublish
,
[
intl
.
formatMessage
({
id
:
'commodity.products.buttonGroup.6'
})]:
record
.
isOffPublish
,
[
intl
.
formatMessage
({
id
:
'commodity.products.buttonGroup.6'
})]:
record
.
isOffPublish
,
[
intl
.
formatMessage
({
id
:
'commodity.products.buttonGroup.7'
})]:
record
.
isUpperCommodity
,
[
intl
.
formatMessage
({
id
:
'commodity.products.buttonGroup.7'
})]:
record
.
isUpperCommodity
,
[
intl
.
formatMessage
({
id
:
'commodity.products.buttonGroup.8'
})]:
record
.
type
===
2
,
}
}
const
operationHandler
=
{
const
operationHandler
=
{
...
@@ -217,6 +237,7 @@ const Products: React.FC<{}> = () => {
...
@@ -217,6 +237,7 @@ const Products: React.FC<{}> = () => {
[
intl
.
formatMessage
({
id
:
'commodity.products.operationHandler.5'
})]:
()
=>
clickUp
(
1
,
record
.
id
),
[
intl
.
formatMessage
({
id
:
'commodity.products.operationHandler.5'
})]:
()
=>
clickUp
(
1
,
record
.
id
),
[
intl
.
formatMessage
({
id
:
'commodity.products.operationHandler.6'
})]:
()
=>
clickUp
(
0
,
record
.
id
),
[
intl
.
formatMessage
({
id
:
'commodity.products.operationHandler.6'
})]:
()
=>
clickUp
(
0
,
record
.
id
),
[
intl
.
formatMessage
({
id
:
'commodity.products.operationHandler.7'
})]:
()
=>
previewUpper
(
record
.
upperCommodityId
),
[
intl
.
formatMessage
({
id
:
'commodity.products.operationHandler.7'
})]:
()
=>
previewUpper
(
record
.
upperCommodityId
),
[
intl
.
formatMessage
({
id
:
'commodity.products.operationHandler.8'
})]:
()
=>
upModalFn
(
record
.
id
),
}
}
return
(
return
(
...
@@ -624,6 +645,10 @@ const Products: React.FC<{}> = () => {
...
@@ -624,6 +645,10 @@ const Products: React.FC<{}> = () => {
return
message
.
error
(
intl
.
formatMessage
({
id
:
'commodity.products.schema.fastSchema.qingxuanzeshangjiashangpin'
}))
return
message
.
error
(
intl
.
formatMessage
({
id
:
'commodity.products.schema.fastSchema.qingxuanzeshangjiashangpin'
}))
}
}
selectedRowKeys
.
length
?
setExportQrcodeModal
(
true
)
:
message
.
error
(
intl
.
formatMessage
({
id
:
'commodity.products.handleBatchDelete.error'
}))
selectedRowKeys
.
length
?
setExportQrcodeModal
(
true
)
:
message
.
error
(
intl
.
formatMessage
({
id
:
'commodity.products.handleBatchDelete.error'
}))
}
else
if
(
e
.
key
===
'6'
)
{
setUpSelModal
(
true
)
}
else
if
(
e
.
key
===
'7'
)
{
setDownSelModal
(
true
)
}
}
}
}
...
@@ -722,6 +747,14 @@ const Products: React.FC<{}> = () => {
...
@@ -722,6 +747,14 @@ const Products: React.FC<{}> = () => {
<
Menu
.
Item
key=
"5"
icon=
{
<
ExportOutlined
/>
}
>
<
Menu
.
Item
key=
"5"
icon=
{
<
ExportOutlined
/>
}
>
{
intl
.
formatMessage
({
id
:
'commodity.products.menuMore.5'
})
}
{
intl
.
formatMessage
({
id
:
'commodity.products.menuMore.5'
})
}
</
Menu
.
Item
>
</
Menu
.
Item
>
<
Menu
.
Item
key=
"6"
icon=
{
<
ExportOutlined
/>
}
>
获取上游供应商品
{
/* {intl.formatMessage({ id: 'commodity.products.menuMore.5' })} */
}
</
Menu
.
Item
>
<
Menu
.
Item
key=
"7"
icon=
{
<
ExportOutlined
/>
}
>
获取下游销售商品
{
/* {intl.formatMessage({ id: 'commodity.products.menuMore.5' })} */
}
</
Menu
.
Item
>
</
Menu
>
</
Menu
>
)
)
...
@@ -904,6 +937,9 @@ const Products: React.FC<{}> = () => {
...
@@ -904,6 +937,9 @@ const Products: React.FC<{}> = () => {
<
p
>
{
intl
.
formatMessage
({
id
:
'commodity.products.textthree'
})
}
</
p
>
<
p
>
{
intl
.
formatMessage
({
id
:
'commodity.products.textthree'
})
}
</
p
>
<
p
>
{
intl
.
formatMessage
({
id
:
'commodity.products.textfour'
})
}
</
p
>
<
p
>
{
intl
.
formatMessage
({
id
:
'commodity.products.textfour'
})
}
</
p
>
</
Modal
>
</
Modal
>
<
ProductView
visible=
{
upModal
}
setVisible=
{
setUpModal
}
productId=
{
uppId
}
/>
<
ProductSel
visible=
{
upSelModal
}
setVisible=
{
setUpSelModal
}
title=
"upperMemberName"
/>
<
ProductSel
visible=
{
downSelModal
}
setVisible=
{
setDownSelModal
}
title=
"subMemberName"
/>
{
/* 选择上游商品 */
}
{
/* 选择上游商品 */
}
<
UpperProductModalTable
currentRef=
{
upperRef
}
type=
"checkbox"
tableRef=
{
ref
}
/>
<
UpperProductModalTable
currentRef=
{
upperRef
}
type=
"checkbox"
tableRef=
{
ref
}
/>
{
/* 商品上架引导 */
}
{
/* 商品上架引导 */
}
...
...
src/pages/commodity/products/productModal.tsx
0 → 100644
View file @
ee2f4da4
import
NiceForm
from
'@/components/NiceForm'
;
import
StandardTable
from
'@/components/StandardTable'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
;
import
useSetSearchValueInTable
from
'@/hooks/useSetSearchValueInTable'
;
// import {
// getProductCommodityGetSubCommodityListS2B,
// getProductCommodityGetUpperCommodityListS2B,
// } from '@/services/ProductV2Api';
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
Button
,
Modal
,
Table
}
from
'antd'
;
import
{
useEffect
,
useMemo
,
useRef
,
useState
}
from
'react'
;
import
{
getIntl
}
from
'umi'
;
import
{
searchBrandOptionEffect
,
searchCustomerCategoryOptionEffect
,
}
from
'./effect'
;
// 快捷修改单价高级筛选
export
const
newSchema
=
(
key
:
string
)
=>
({
type
:
'object'
,
properties
:
{
mageLayout
:
{
type
:
'object'
,
'x-component'
:
'flex-layout'
,
'x-component-props'
:
{
rowStyle
:
{
flexWrap
:
'nowrap'
,
},
colStyle
:
{
marginLeft
:
20
,
},
},
properties
:
{
productId
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'商品ID'
,
},
},
name
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
getIntl
().
formatMessage
({
id
:
'commodity.products.schema.productSchema.name'
,
}),
},
},
priceTypeList
:
{
type
:
'string'
,
enum
:
[
{
label
:
getIntl
().
formatMessage
({
id
:
'commodity.products.schema.productSchema.priceTypeList.1'
,
}),
value
:
1
,
},
{
label
:
getIntl
().
formatMessage
({
id
:
'commodity.products.schema.productSchema.priceTypeList.2'
,
}),
value
:
2
,
},
{
label
:
getIntl
().
formatMessage
({
id
:
'commodity.products.schema.productSchema.priceTypeList.3'
,
}),
value
:
3
,
},
{
label
:
getIntl
().
formatMessage
({
id
:
'commodity.products.schema.productSchema.priceTypeList.4'
,
}),
value
:
4
,
},
],
'x-component-props'
:
{
placeholder
:
getIntl
().
formatMessage
({
id
:
'commodity.products.schema.productSchema.priceTypeList.placeholder'
,
}),
style
:
{
width
:
'174px'
},
},
},
brandId
:
{
type
:
'string'
,
'x-component'
:
'CustomInputSearch'
,
'x-component-props'
:
{
placeholder
:
getIntl
().
formatMessage
({
id
:
'commodity.products.schema.productSchema.brandId'
,
}),
showSearch
:
true
,
showArrow
:
true
,
defaultActiveFirstOption
:
false
,
filterOption
:
false
,
notFoundContent
:
null
,
style
:
{
width
:
'174px'
},
searchValue
:
null
,
dataoption
:
[],
},
},
customerCategoryId
:
{
type
:
'string'
,
'x-component'
:
'CustomCategorySearch'
,
'x-component-props'
:
{
placeholder
:
getIntl
().
formatMessage
({
id
:
'commodity.products.schema.productSchema.customerCategoryId'
,
}),
showSearch
:
true
,
notFoundContent
:
null
,
style
:
{
width
:
'174px'
},
dataoption
:
[],
fieldNames
:
{
label
:
'title'
,
value
:
'id'
,
children
:
'children'
},
},
},
upgyhy
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
key
===
'upperMemberName'
?
'上游供应选择商品'
:
'下游销售选择商品'
,
},
},
submit
:
{
'x-component'
:
'Submit'
,
'x-mega-props'
:
{
span
:
1
,
},
'x-component-props'
:
{
children
:
''
,
},
},
},
},
},
});
export
const
ProductView
=
props
=>
{
// 查看上游弹窗
const
{
visible
,
setVisible
,
productId
}
=
props
;
const
columns
=
[
{
title
:
'序号'
,
dataIndex
:
'num'
,
key
:
'num'
,
},
{
title
:
'上游供应会员名称'
,
dataIndex
:
'upperMemberName'
,
key
:
'upperMemberName'
,
},
{
title
:
'上游供应商品ID'
,
dataIndex
:
'id'
,
key
:
'id'
,
},
{
title
:
'上游供应商品名称'
,
dataIndex
:
'name'
,
key
:
'name'
,
},
{
title
:
'品类'
,
dataIndex
:
'customerCategory'
,
key
:
'customerCategory'
,
render
:
text
=>
text
.
name
,
},
{
title
:
'品牌'
,
dataIndex
:
'brand'
,
key
:
'brand'
,
render
:
text
=>
text
.
name
,
},
{
title
:
'单位'
,
dataIndex
:
'unitName'
,
key
:
'unitName'
,
},
{
title
:
'商品定价'
,
dataIndex
:
'priceType'
,
key
:
'priceType'
,
render
:
text
=>
{
switch
(
text
)
{
case
1
:
return
'现货价格'
;
case
2
:
return
'价格需要询价'
;
case
3
:
return
'积分兑换商品'
;
}
},
},
{
title
:
'价格'
,
dataIndex
:
'min'
,
key
:
'min'
,
render
:
(
text
,
record
)
=>
{
return
`¥
${
text
}
~¥
${
record
.
max
}
`
;
},
},
];
const
[
dataSource
,
setDataSource
]
=
useState
<
any
>
([]);
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
);
useEffect
(()
=>
{
if
(
productId
)
{
// setLoading(true);
// getProductCommodityGetUpperCommodityListS2B().then(res => {
// if (res.code === 1000) {
// setDataSource(res.data.data);
// setLoading(false);
// }
// });
}
},
[
productId
]);
return
(
<
Modal
title=
"查看上游商品"
visible=
{
visible
}
width=
{
1200
}
onCancel=
{
()
=>
setVisible
(
false
)
}
confirmLoading=
{
loading
}
>
<
Table
dataSource=
{
dataSource
}
columns=
{
columns
}
/>
;
</
Modal
>
);
};
export
const
ProductSel
=
props
=>
{
// 选择商品
const
{
visible
,
setVisible
,
key
,
productId
}
=
props
;
/** 带参数查询,给表单带默认值 */
const
{
clear
}
=
useSetSearchValueInTable
();
const
ref
=
useRef
<
any
>
({});
const
[
rowSelection
,
RowCtl
]
=
useRowSelectionTable
({
customKey
:
'id'
});
const
columns
=
(
key
:
string
)
=>
{
const
arr
=
[
{
title
:
'商品ID'
,
dataIndex
:
'id'
,
key
:
'id'
,
},
{
title
:
'商品名称'
,
dataIndex
:
'name'
,
key
:
'name'
,
},
{
title
:
'品类'
,
dataIndex
:
'customerCategory'
,
key
:
'customerCategory'
,
render
:
text
=>
text
.
name
,
},
{
title
:
'品牌'
,
dataIndex
:
'brand'
,
key
:
'brand'
,
render
:
text
=>
text
.
name
,
},
{
title
:
'单位'
,
dataIndex
:
'unitName'
,
key
:
'unitName'
,
},
{
title
:
'商品定价'
,
dataIndex
:
'priceType'
,
key
:
'priceType'
,
render
:
text
=>
{
switch
(
text
)
{
case
1
:
return
'现货价格'
;
case
2
:
return
'价格需要询价'
;
case
3
:
return
'积分兑换商品'
;
}
},
},
{
title
:
`
${
key
===
'upperMemberName'
?
'上游供应会员'
:
'下游销售会员'
}
`
,
dataIndex
:
key
,
key
:
key
,
},
{
title
:
'单价'
,
dataIndex
:
'min'
,
key
:
'min'
,
render
:
(
text
,
record
)
=>
{
return
`¥
${
text
}
~¥
${
record
.
max
}
`
;
},
},
{
title
:
'状态'
,
dataIndex
:
'status'
,
key
:
'status'
,
},
];
if
(
key
===
'subMemberName'
)
{
arr
.
splice
(
7
,
1
);
}
return
arr
;
};
const
formActions
=
createFormActions
();
const
fetchData
=
(
item
:
any
)
=>
{
const
params
=
{
current
:
'1'
,
pageSize
:
'10'
,
productId
,
// name: '',
// priceType: '',
// customerCategoryName: '',
// memberName: '',
// brandName: '',
...
item
,
};
return
new
Promise
(
resolve
=>
{
// getProductCommodityGetSubCommodityListS2B(params).then(res => {
// resolve({
// totalCount: res.data.totalCount,
// data: res.data.data,
// });
// });
});
};
return
(
<
Modal
title=
{
key
===
'upperMemberName'
?
'选择上游供应商品'
:
'选择下游销售商品'
}
visible=
{
visible
}
width=
{
1200
}
// onOk={handleExportQrcode}
onCancel=
{
()
=>
setVisible
(
false
)
}
// confirmLoading={exportLoading}
>
<
StandardTable
columns=
{
columns
(
key
)
}
currentRef=
{
ref
}
rowSelection=
{
rowSelection
}
tableProps=
{
{
rowKey
:
'id'
,
}
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
controlRender=
{
<
NiceForm
actions=
{
formActions
}
onSubmit=
{
values
=>
ref
.
current
.
reload
(
values
)
}
expressionScope=
{
{
// controllerBtns,
}
}
effects=
{
(
$
,
actions
)
=>
{
FormEffectHooks
.
onFieldChange$
(
'brandId'
).
subscribe
(()
=>
{
searchBrandOptionEffect
(
actions
,
'brandId'
);
});
FormEffectHooks
.
onFieldChange$
(
'customerCategoryId'
).
subscribe
(
()
=>
{
searchCustomerCategoryOptionEffect
(
actions
,
'customerCategoryId'
,
);
},
);
}
}
schema=
{
newSchema
(
key
)
}
// onReset=
{()
=
>
{
// clear();
//
}
}
/
>
}
/>
{
/* <Table dataSource={dataSource} columns={columns} />; */
}
</
Modal
>
);
};
src/pages/repositories/index.tsx
View file @
ee2f4da4
...
@@ -97,15 +97,26 @@ const Repositories: React.FC<{}> = () => {
...
@@ -97,15 +97,26 @@ const Repositories: React.FC<{}> = () => {
dataIndex
:
'alreadyiInventory'
,
dataIndex
:
'alreadyiInventory'
,
key
:
'alreadyiInventory'
,
key
:
'alreadyiInventory'
,
},
},
// {
// title: intl.formatMessage({ id: 'repositories.columns.upperMemberName' }),
// dataIndex: 'upperMemberName',
// key: 'upperMemberName',
// },
// {
// title: intl.formatMessage({ id: 'repositories.columns.upperStockCount' }),
// dataIndex: 'upperStockCount',
// key: 'upperStockCount',
// },
{
{
title
:
intl
.
formatMessage
({
id
:
'repositories.columns.upperMemberName'
}),
title
:
<
span
>
dataIndex
:
'upperMemberName'
,
上游商品库存
 
key
:
'upperMemberName'
,
<
Tooltip
title=
'关联的所有上游供应会员的上游供应商品的库存总数量'
>
},
<
QuestionCircleOutlined
/>
{
</
Tooltip
>
title
:
intl
.
formatMessage
({
id
:
'repositories.columns.upperStockCount'
})
,
</
span
>
,
dataIndex
:
'upperStockCount'
,
dataIndex
:
'upperStockCount'
,
key
:
'upperStockCount'
,
key
:
'upperStockCount'
,
render
:
text
=>
text
||
'-'
,
},
},
{
{
title
:
intl
.
formatMessage
({
id
:
'repositories.columns.status'
}),
title
:
intl
.
formatMessage
({
id
:
'repositories.columns.status'
}),
...
...
src/pages/repositories/schema/index.tsx
View file @
ee2f4da4
...
@@ -4,6 +4,8 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
...
@@ -4,6 +4,8 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import
{
GlobalConfig
}
from
'@/global/config'
;
import
{
GlobalConfig
}
from
'@/global/config'
;
import
{
SHOP_TYPES
}
from
'@/constants'
;
import
{
SHOP_TYPES
}
from
'@/constants'
;
import
{
padRequiredMessage
}
from
'@/utils'
;
import
{
padRequiredMessage
}
from
'@/utils'
;
import
{
Tooltip
}
from
'antd'
;
import
{
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
// 将获取的商城转化为可用类型
// 将获取的商城转化为可用类型
const
getShopTypeMap
=
(()
=>
{
const
getShopTypeMap
=
(()
=>
{
...
@@ -281,6 +283,16 @@ export const repositDetailSchema: ISchema = padRequiredMessage({
...
@@ -281,6 +283,16 @@ export const repositDetailSchema: ISchema = padRequiredMessage({
title
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.repositDetailSchema.goodsName'
}),
title
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.repositDetailSchema.goodsName'
}),
default
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.repositDetailSchema.goodsName.default'
})
default
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.repositDetailSchema.goodsName.default'
})
},
},
sy
:
{
type
:
'string'
,
"x-component"
:
'Text'
,
title
:
<
span
>
上游商品库存
 
<
Tooltip
title=
'关联的所有上游供应会员的上游供应商品的库存总数量'
>
<
QuestionCircleOutlined
/>
</
Tooltip
>
</
span
>,
},
NO_SUBMIT3
:
{
NO_SUBMIT3
:
{
type
:
'string'
,
type
:
'string'
,
"x-component"
:
'Text'
,
"x-component"
:
'Text'
,
...
@@ -310,39 +322,39 @@ export const repositDetailSchema: ISchema = padRequiredMessage({
...
@@ -310,39 +322,39 @@ export const repositDetailSchema: ISchema = padRequiredMessage({
},
},
]
]
},
},
inventoryDeductWay
:
{
//
inventoryDeductWay: {
type
:
'radio'
,
//
type: 'radio',
title
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.repositDetailSchema.inventoryDeductWay'
}),
//
title: getIntl().formatMessage({ id: 'repositories.schema.repositDetailSchema.inventoryDeductWay' }),
"x-rules"
:
[
//
"x-rules": [
{
//
{
required
:
true
,
//
required: true,
message
:
getIntl
().
formatMessage
({
id
:
'common.form.input.placeholder'
})
//
message: getIntl().formatMessage({ id: 'common.form.input.placeholder' })
}
//
}
],
//
],
enum
:
[
//
enum: [
{
//
{
label
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.repositDetailSchema.inventoryDeductWay.1'
}),
//
label: getIntl().formatMessage({ id: 'repositories.schema.repositDetailSchema.inventoryDeductWay.1' }),
value
:
1
//
value: 1
},
//
},
// {
//
// {
// label: '按仓库位置远近扣除',
//
// label: '按仓库位置远近扣除',
// value: 2
//
// value: 2
// }
//
// }
],
//
],
default
:
1
//
default: 1
},
//
},
upperMemberName
:
{
//
upperMemberName: {
type
:
'string'
,
//
type: 'string',
title
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.repositDetailSchema.upperMemberName'
}),
//
title: getIntl().formatMessage({ id: 'repositories.schema.repositDetailSchema.upperMemberName' }),
"x-component"
:
'Text'
,
//
"x-component": 'Text',
default
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.repositDetailSchema.upperMemberName.default'
})
//
default: getIntl().formatMessage({ id: 'repositories.schema.repositDetailSchema.upperMemberName.default' })
},
//
},
upperStockCount
:
{
//
upperStockCount: {
type
:
'number'
,
//
type: 'number',
title
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.repositDetailSchema.upperStockCount'
}),
//
title: getIntl().formatMessage({ id: 'repositories.schema.repositDetailSchema.upperStockCount' }),
"x-component"
:
'Text'
,
//
"x-component": 'Text',
default
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.repositDetailSchema.upperStockCount.default'
})
//
default: getIntl().formatMessage({ id: 'repositories.schema.repositDetailSchema.upperStockCount.default' })
},
//
},
}
}
}
}
}
}
...
@@ -499,25 +511,25 @@ export const batchRepositDetailSchema: ISchema = padRequiredMessage({
...
@@ -499,25 +511,25 @@ export const batchRepositDetailSchema: ISchema = padRequiredMessage({
},
},
]
]
},
},
inventoryDeductWay
:
{
//
inventoryDeductWay: {
type
:
'radio'
,
//
type: 'radio',
title
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.batchRepositDetailSchema.inventoryDeductWay'
}),
//
title: getIntl().formatMessage({ id: 'repositories.schema.batchRepositDetailSchema.inventoryDeductWay' }),
'x-rules'
:
[{
//
'x-rules': [{
required
:
true
,
//
required: true,
message
:
`
${
getIntl
().
formatMessage
({
id
:
'common.text.pleaseSelect'
})}
`
//
message: `${getIntl().formatMessage({ id: 'common.text.pleaseSelect' })}`
}],
//
}],
enum
:
[
//
enum: [
{
//
{
label
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.batchRepositDetailSchema.inventoryDeductWay.1'
}),
//
label: getIntl().formatMessage({ id: 'repositories.schema.batchRepositDetailSchema.inventoryDeductWay.1' }),
value
:
1
//
value: 1
},
//
},
// {
//
// {
// label: '按仓库位置远近扣除',
//
// label: '按仓库位置远近扣除',
// value: 2
//
// value: 2
// }
//
// }
],
//
],
default
:
1
//
default: 1
}
//
}
}
}
}
}
}
}
...
@@ -758,37 +770,37 @@ export const repositTabOneSchema: ISchema = padRequiredMessage({
...
@@ -758,37 +770,37 @@ export const repositTabOneSchema: ISchema = padRequiredMessage({
}],
}],
title
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.repositTabOneSchema.inventory'
}),
title
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.repositTabOneSchema.inventory'
}),
},
},
inventoryDeductWay
:
{
//
inventoryDeductWay: {
type
:
'radio'
,
//
type: 'radio',
title
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.repositTabOneSchema.inventoryDeductWay'
}),
//
title: getIntl().formatMessage({ id: 'repositories.schema.repositTabOneSchema.inventoryDeductWay' }),
'x-rules'
:
[{
//
'x-rules': [{
required
:
true
,
//
required: true,
message
:
`
${
getIntl
().
formatMessage
({
id
:
'common.text.pleaseSelect'
})}
`
//
message: `${getIntl().formatMessage({ id: 'common.text.pleaseSelect' })}`
}],
//
}],
enum
:
[
//
enum: [
{
//
{
label
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.repositTabOneSchema.inventoryDeductWay.1'
}),
//
label: getIntl().formatMessage({ id: 'repositories.schema.repositTabOneSchema.inventoryDeductWay.1' }),
value
:
1
//
value: 1
},
//
},
// {
//
// {
// label: '按仓库位置远近扣除',
//
// label: '按仓库位置远近扣除',
// value: 2
//
// value: 2
// }
//
// }
],
//
],
default
:
1
//
default: 1
},
//
},
upperMemberName
:
{
//
upperMemberName: {
type
:
'string'
,
//
type: 'string',
title
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.repositTabOneSchema.upperMemberName'
}),
//
title: getIntl().formatMessage({ id: 'repositories.schema.repositTabOneSchema.upperMemberName' }),
"x-component"
:
'Text'
,
//
"x-component": 'Text',
default
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.repositTabOneSchema.upperMemberName.default'
})
//
default: getIntl().formatMessage({ id: 'repositories.schema.repositTabOneSchema.upperMemberName.default' })
},
//
},
upperStockCount
:
{
//
upperStockCount: {
type
:
'number'
,
//
type: 'number',
title
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.repositTabOneSchema.upperStockCount'
}),
//
title: getIntl().formatMessage({ id: 'repositories.schema.repositTabOneSchema.upperStockCount' }),
"x-component"
:
'Text'
,
//
"x-component": 'Text',
default
:
getIntl
().
formatMessage
({
id
:
'repositories.schema.repositTabOneSchema.upperStockCount.default'
})
//
default: getIntl().formatMessage({ id: 'repositories.schema.repositTabOneSchema.upperStockCount.default' })
},
//
},
}
}
}
}
}
}
...
...
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