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
7ff0590c
Commit
7ff0590c
authored
Mar 10, 2022
by
wzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 商品弹窗接口对接
parent
ee2f4da4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
212 additions
and
92 deletions
+212
-92
commodity.ts
src/locales/en-US/commodity.ts
+25
-0
commodity.ts
src/locales/ko-KR/commodity.ts
+25
-0
commodity.ts
src/locales/zh-CN/commodity.ts
+0
-0
index.tsx
src/pages/commodity/products/index.tsx
+2
-5
productModal.tsx
src/pages/commodity/products/productModal.tsx
+160
-87
No files found.
src/locales/en-US/commodity.ts
View file @
7ff0590c
...
...
@@ -116,6 +116,7 @@ export default {
'commodity.products.buttonGroup.5'
:
'On shelf'
,
'commodity.products.buttonGroup.6'
:
'Remove'
,
'commodity.products.buttonGroup.7'
:
'View supply products'
,
'commodity.products.buttonGroup.8'
:
'View upstream goods'
,
'commodity.products.operationHandler.1'
:
'Copy'
,
'commodity.products.operationHandler.2'
:
'Submit for review'
,
'commodity.products.operationHandler.3'
:
'Modify'
,
...
...
@@ -123,6 +124,7 @@ export default {
'commodity.products.operationHandler.5'
:
'On shelf'
,
'commodity.products.operationHandler.6'
:
'Remove'
,
'commodity.products.operationHandler.7'
:
'View supply products'
,
'commodity.products.operationHandler.8'
:
'View upstream goods'
,
'commodity.products.step0Description.text.1'
:
'Click to download EXCEL file template'
,
'commodity.products.step0Description.text.2'
:
'According to the template to organize product information'
,
'commodity.products.step0Description.text.3'
:
'Click the import button to import the organized product information'
,
...
...
@@ -1121,4 +1123,27 @@ export default {
'commodity.putawayGuide.modal.button.3'
:
'Configuring the Order Process'
,
'commodity.putawayGuide.modal.h3.4'
:
'Goods shelves'
,
'commodity.products.huoqushangyougongyingshangpin'
:
'Get upstream supply products'
,
'commodity.products.huoquxiayouxiaoshoushangpin'
:
'Get downstream sales products'
,
'commodity.products.shangyougongyingxuanzeshangpin'
:
'Upstream supply selection products'
,
'commodity.products.xiayouxiaoshouxuanzeshangpin'
:
'Selected products for downstream sales'
,
'commodity.products.xuhao'
:
'serial number'
,
'commodity.products.shangyougongyinghuiyuanmingcheng'
:
'Upstream supply member name'
,
'commodity.products.shangyougongyingshangpinID'
:
'Upstream supply commodity ID'
,
'commodity.products.shangyougongyingshangpinmingcheng'
:
'Upstream supply product name'
,
'commodity.products.pinlei'
:
'category'
,
'commodity.products.pinpai'
:
'brand'
,
'commodity.products.danwei'
:
'Units'
,
'commodity.products.shangpindingjia'
:
'Commodity pricing'
,
'commodity.products.jiage'
:
'price'
,
'commodity.products.zhakanshangyoushangpin'
:
'View upstream products'
,
'commodity.products.guanbi'
:
'off'
,
'commodity.products.shangpinID'
:
'Commodity ID'
,
'commodity.products.shangpinmingcheng'
:
'Product name'
,
'commodity.products.shangyougongyinghuiyuan'
:
'Upstream supply member'
,
'commodity.products.xiayouxiaoshouhuiyuan'
:
'Downstream sales member'
,
'commodity.products.danjia'
:
'unit price'
,
'commodity.products.zhuangtai'
:
'Status'
,
'commodity.products.xuanzeshangyougongyingshangpin'
:
'Select upstream supply products'
,
'commodity.products.xuanzexiayouxiaoshoushangpin'
:
'Select downstream products for sale'
,
}
src/locales/ko-KR/commodity.ts
View file @
7ff0590c
...
...
@@ -117,6 +117,7 @@ export default {
'commodity.products.buttonGroup.5'
:
'상가'
,
'commodity.products.buttonGroup.6'
:
'내리다'
,
'commodity.products.buttonGroup.7'
:
'공급 품목 보기'
,
'commodity.products.buttonGroup.8'
:
'업스트림 상품 보기'
,
'commodity.products.operationHandler.1'
:
'복제하다'
,
'commodity.products.operationHandler.2'
:
'제출 심사'
,
'commodity.products.operationHandler.3'
:
'수정'
,
...
...
@@ -124,6 +125,7 @@ export default {
'commodity.products.operationHandler.5'
:
'상가'
,
'commodity.products.operationHandler.6'
:
'내리다'
,
'commodity.products.operationHandler.7'
:
'공급 품목 보기'
,
'commodity.products.operationHandler.8'
:
'업스트림 상품 보기'
,
'commodity.products.step0Description.text.1'
:
'클릭하여 EXCEL 파일 템플릿 다운로드'
,
'commodity.products.step0Description.text.2'
:
'양식에 따라 물품 자료를 정리하다.'
,
'commodity.products.step0Description.text.3'
:
'가져오기 버튼을 클릭하여 정리된 물품 자료를 가져오기'
,
...
...
@@ -1121,4 +1123,27 @@ export default {
'commodity.putawayGuide.modal.button.3'
:
'주문 프로세스 설정'
,
'commodity.putawayGuide.modal.h3.4'
:
'진열대 상품'
,
'commodity.products.huoqushangyougongyingshangpin'
:
'상류 공급 제품 가져오기'
,
'commodity.products.huoquxiayouxiaoshoushangpin'
:
'다운스트림 판매 제품 가져오기'
,
'commodity.products.shangyougongyingxuanzeshangpin'
:
'상류 공급 선택 제품'
,
'commodity.products.xiayouxiaoshouxuanzeshangpin'
:
'다운스트림 판매를 위해 선택한 제품'
,
'commodity.products.xuhao'
:
'일련 번호'
,
'commodity.products.shangyougongyinghuiyuanmingcheng'
:
'상류 공급 구성원 이름'
,
'commodity.products.shangyougongyingshangpinID'
:
'상류 공급 상품 ID'
,
'commodity.products.shangyougongyingshangpinmingcheng'
:
'상류 공급 제품 이름'
,
'commodity.products.pinlei'
:
'카테고리'
,
'commodity.products.pinpai'
:
'브랜드'
,
'commodity.products.danwei'
:
'단위'
,
'commodity.products.shangpindingjia'
:
'상품 가격'
,
'commodity.products.jiage'
:
'가격'
,
'commodity.products.zhakanshangyoushangpin'
:
'업스트림 제품 보기'
,
'commodity.products.guanbi'
:
'꺼짐'
,
'commodity.products.shangpinID'
:
'상품 ID'
,
'commodity.products.shangpinmingcheng'
:
'제품명'
,
'commodity.products.shangyougongyinghuiyuan'
:
'상류 공급 멤버'
,
'commodity.products.xiayouxiaoshouhuiyuan'
:
'다운스트림 판매 회원'
,
'commodity.products.danjia'
:
'단가'
,
'commodity.products.zhuangtai'
:
'상태'
,
'commodity.products.xuanzeshangyougongyingshangpin'
:
'상류 공급 제품 선택'
,
'commodity.products.xuanzexiayouxiaoshoushangpin'
:
'판매할 다운스트림 제품 선택'
,
}
src/locales/zh-CN/commodity.ts
View file @
7ff0590c
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/pages/commodity/products/index.tsx
View file @
7ff0590c
...
...
@@ -49,7 +49,6 @@ const formActions = createFormActions();
const
Products
:
React
.
FC
<
{}
>
=
()
=>
{
const
intl
=
useIntl
();
const
ref
=
useRef
<
any
>
({})
const
judgeShopRef
=
useRef
<
boolean
>
(
true
)
const
[
upForm
]
=
Form
.
useForm
()
const
[
importModal
,
setImportModal
]
=
useState
(
false
)
const
[
deleteBatchModal
,
setDeleteBatchModal
]
=
useState
(
false
)
...
...
@@ -748,12 +747,10 @@ const Products: React.FC<{}> = () => {
{
intl
.
formatMessage
({
id
:
'commodity.products.menuMore.5'
})
}
</
Menu
.
Item
>
<
Menu
.
Item
key=
"6"
icon=
{
<
ExportOutlined
/>
}
>
获取上游供应商品
{
/* {intl.formatMessage({ id: 'commodity.products.menuMore.5' })} */
}
{
intl
.
formatMessage
({
id
:
'commodity.products.huoqushangyougongyingshangpin'
})
}
</
Menu
.
Item
>
<
Menu
.
Item
key=
"7"
icon=
{
<
ExportOutlined
/>
}
>
获取下游销售商品
{
/* {intl.formatMessage({ id: 'commodity.products.menuMore.5' })} */
}
{
intl
.
formatMessage
({
id
:
'commodity.products.huoquxiayouxiaoshoushangpin'
})
}
</
Menu
.
Item
>
</
Menu
>
)
...
...
src/pages/commodity/products/productModal.tsx
View file @
7ff0590c
...
...
@@ -7,6 +7,8 @@ import useSetSearchValueInTable from '@/hooks/useSetSearchValueInTable';
// import {
// getProductCommodityGetSubCommodityListS2B,
// getProductCommodityGetUpperCommodityListS2B,
// postProductCommodityChoiceSubCommodity,
// postProductCommodityChoiceUpperCommodity,
// } from '@/services/ProductV2Api';
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
...
...
@@ -48,33 +50,25 @@ export const newSchema = (key: string) => ({
}),
},
},
priceType
List
:
{
priceType
:
{
type
:
'string'
,
enum
:
[
// {
// label: '所有',
// value: '',
// },
{
label
:
getIntl
().
formatMessage
({
id
:
'commodity.
products.schema.productSchema.priceTypeList
.1'
,
id
:
'commodity.
checkProduct.priceType
.1'
,
}),
value
:
1
,
},
{
label
:
getIntl
().
formatMessage
({
id
:
'commodity.
products.schema.productSchema.priceTypeList
.2'
,
id
:
'commodity.
checkProduct.priceType
.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
({
...
...
@@ -84,7 +78,7 @@ export const newSchema = (key: string) => ({
style
:
{
width
:
'174px'
},
},
},
brand
Id
:
{
brand
Name
:
{
type
:
'string'
,
'x-component'
:
'CustomInputSearch'
,
'x-component-props'
:
{
...
...
@@ -101,7 +95,7 @@ export const newSchema = (key: string) => ({
dataoption
:
[],
},
},
customerCategory
Id
:
{
customerCategory
Name
:
{
type
:
'string'
,
'x-component'
:
'CustomCategorySearch'
,
'x-component-props'
:
{
...
...
@@ -115,13 +109,17 @@ export const newSchema = (key: string) => ({
fieldNames
:
{
label
:
'title'
,
value
:
'id'
,
children
:
'children'
},
},
},
upgyhy
:
{
memberName
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
key
===
'upperMemberName'
?
'上游供应选择商品'
:
'下游销售选择商品'
,
?
getIntl
().
formatMessage
({
id
:
'commodity.products.shangyougongyingxuanzeshangpin'
,
})
:
getIntl
().
formatMessage
({
id
:
'commodity.products.xiayouxiaoshouxuanzeshangpin'
,
}),
},
},
submit
:
{
...
...
@@ -143,59 +141,73 @@ export const ProductView = props => {
const
{
visible
,
setVisible
,
productId
}
=
props
;
const
columns
=
[
{
title
:
'序号'
,
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.xuhao'
})
,
dataIndex
:
'num'
,
key
:
'num'
,
},
{
title
:
'上游供应会员名称'
,
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.shangyougongyinghuiyuanmingcheng'
,
}),
dataIndex
:
'upperMemberName'
,
key
:
'upperMemberName'
,
},
{
title
:
'上游供应商品ID'
,
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.shangyougongyingshangpinID'
,
}),
dataIndex
:
'id'
,
key
:
'id'
,
},
{
title
:
'上游供应商品名称'
,
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.shangyougongyingshangpinmingcheng'
,
}),
dataIndex
:
'name'
,
key
:
'name'
,
},
{
title
:
'品类'
,
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.pinlei'
})
,
dataIndex
:
'customerCategory'
,
key
:
'customerCategory'
,
render
:
text
=>
text
.
name
,
render
:
text
=>
text
?
.
name
,
},
{
title
:
'品牌'
,
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.pinpai'
})
,
dataIndex
:
'brand'
,
key
:
'brand'
,
render
:
text
=>
text
.
name
,
render
:
text
=>
text
?
.
name
,
},
{
title
:
'单位'
,
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.danwei'
})
,
dataIndex
:
'unitName'
,
key
:
'unitName'
,
},
{
title
:
'商品定价'
,
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.shangpindingjia'
,
}),
dataIndex
:
'priceType'
,
key
:
'priceType'
,
render
:
text
=>
{
switch
(
text
)
{
case
1
:
return
'现货价格'
;
return
getIntl
().
formatMessage
({
id
:
'commodity.checkProduct.priceType.1'
,
});
case
2
:
return
'价格需要询价'
;
return
getIntl
().
formatMessage
({
id
:
'commodity.checkProduct.priceType.2'
,
});
case
3
:
return
'积分兑换商品'
;
return
getIntl
().
formatMessage
({
id
:
'commodity.checkProduct.priceType.3'
,
});
}
},
},
{
title
:
'价格'
,
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.jiage'
})
,
dataIndex
:
'min'
,
key
:
'min'
,
render
:
(
text
,
record
)
=>
{
...
...
@@ -204,27 +216,58 @@ export const ProductView = props => {
},
];
const
[
dataSource
,
setDataSource
]
=
useState
<
any
>
([]);
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
);
// const fetchData = (item: any) => {
// const params = {
// current: '1',
// pageSize: '10',
// productId,
// ...item,
// };
// return new Promise(resolve => {
// getProductCommodityGetUpperCommodityListS2B(params).then(res => {
// resolve({
// totalCount: res.data.totalCount,
// data: res.data.data,
// });
// });
// });
// };
useEffect
(()
=>
{
if
(
productId
)
{
// setLoading(true);
// getProductCommodityGetUpperCommodityListS2B().then(res => {
// const params = {
// current: '1',
// pageSize: '50',
// productId,
// };
// getProductCommodityGetUpperCommodityListS2B(params).then(res => {
// if (res.code === 1000) {
// setDataSource(res.data.data);
// setLoading(false);
// }
// });
}
},
[
productId
]);
return
(
<
Modal
title=
"查看上游商品"
title=
{
getIntl
().
formatMessage
({
id
:
'commodity.products.zhakanshangyoushangpin'
,
})
}
visible=
{
visible
}
width=
{
1200
}
onCancel=
{
()
=>
setVisible
(
false
)
}
confirmLoading=
{
loading
}
footer=
{
<
Button
onClick=
{
()
=>
setVisible
(
false
)
}
>
{
getIntl
().
formatMessage
({
id
:
'commodity.products.guanbi'
})
}
</
Button
>
}
>
<
Table
dataSource=
{
dataSource
}
columns=
{
columns
}
/>
;
{
/* <StandardTable
columns={columns}
tableProps={{
rowKey: 'id',
}}
fetchTableData={(params: any) => fetchData(params)}
/> */
}
<
Table
dataSource=
{
dataSource
}
columns=
{
columns
}
/>
</
Modal
>
);
};
...
...
@@ -233,60 +276,79 @@ export const ProductSel = props => {
// 选择商品
const
{
visible
,
setVisible
,
key
,
productId
}
=
props
;
/** 带参数查询,给表单带默认值 */
const
{
clear
}
=
useSetSearchValueInTable
();
//
const { clear } = useSetSearchValueInTable();
const
ref
=
useRef
<
any
>
({});
const
[
rowSelection
,
RowCtl
]
=
useRowSelectionTable
({
customKey
:
'id'
});
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
);
const
columns
=
(
key
:
string
)
=>
{
const
arr
=
[
{
title
:
'商品ID'
,
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.shangpinID'
})
,
dataIndex
:
'id'
,
key
:
'id'
,
},
{
title
:
'商品名称'
,
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.shangpinmingcheng'
,
}),
dataIndex
:
'name'
,
key
:
'name'
,
},
{
title
:
'品类'
,
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.pinlei'
})
,
dataIndex
:
'customerCategory'
,
key
:
'customerCategory'
,
render
:
text
=>
text
.
name
,
render
:
text
=>
text
?
.
name
,
},
{
title
:
'品牌'
,
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.pinpai'
})
,
dataIndex
:
'brand'
,
key
:
'brand'
,
render
:
text
=>
text
.
name
,
render
:
text
=>
text
?
.
name
,
},
{
title
:
'单位'
,
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.danwei'
})
,
dataIndex
:
'unitName'
,
key
:
'unitName'
,
},
{
title
:
'商品定价'
,
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.shangpindingjia'
,
}),
dataIndex
:
'priceType'
,
key
:
'priceType'
,
render
:
text
=>
{
switch
(
text
)
{
case
1
:
return
'现货价格'
;
return
getIntl
().
formatMessage
({
id
:
'commodity.checkProduct.priceType.1'
,
});
case
2
:
return
'价格需要询价'
;
return
getIntl
().
formatMessage
({
id
:
'commodity.checkProduct.priceType.2'
,
});
case
3
:
return
'积分兑换商品'
;
return
getIntl
().
formatMessage
({
id
:
'commodity.checkProduct.priceType.3'
,
});
}
},
},
{
title
:
`
${
key
===
'upperMemberName'
?
'上游供应会员'
:
'下游销售会员'
}
`
,
title
:
`
${
key
===
'upperMemberName'
?
getIntl
().
formatMessage
({
id
:
'commodity.products.shangyougongyinghuiyuan'
,
})
:
getIntl
().
formatMessage
({
id
:
'commodity.products.xiayouxiaoshouhuiyuan'
,
})
}
`
,
dataIndex
:
key
,
key
:
key
,
},
{
title
:
'单价'
,
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.danjia'
})
,
dataIndex
:
'min'
,
key
:
'min'
,
render
:
(
text
,
record
)
=>
{
...
...
@@ -294,7 +356,7 @@ export const ProductSel = props => {
},
},
{
title
:
'状态'
,
title
:
getIntl
().
formatMessage
({
id
:
'commodity.products.zhuangtai'
})
,
dataIndex
:
'status'
,
key
:
'status'
,
},
...
...
@@ -317,25 +379,57 @@ export const ProductSel = props => {
// brandName: '',
...
item
,
};
return
new
Promise
(
resolve
=>
{
// getProductCommodityGetSubCommodityListS2B(params).then(res => {
// resolve({
// totalCount: res.data.totalCount,
// data: res.data.data,
// });
// });
// const fn =
// key === 'upperMemberName'
// ? getProductCommodityGetUpperCommodityListS2B
// : getProductCommodityGetSubCommodityListS2B;
// return new Promise(resolve => {
// fn(params).then(res => {
// resolve({
// totalCount: res.data.totalCount,
// data: res.data.data,
// });
// });
// });
return
Promise
.
resolve
({
totalCount
:
1
,
data
:
[
{
id
:
1
,
name
:
'234'
,
},
],
});
};
const
handleOk
=
()
=>
{
// setLoading(true)
// const fn =
// key === 'upperMemberName'
// ? postProductCommodityChoiceSubCommodity
// : postProductCommodityChoiceUpperCommodity;
// fn({ idList: RowCtl.selectedRowKeys }).then(res => {
// if (res.code === 1000) {
// setVisible(false);
// }
// setLoading(false)
// });
};
return
(
<
Modal
title=
{
key
===
'upperMemberName'
?
'选择上游供应商品'
:
'选择下游销售商品'
key
===
'upperMemberName'
?
getIntl
().
formatMessage
({
id
:
'commodity.products.xuanzeshangyougongyingshangpin'
,
})
:
getIntl
().
formatMessage
({
id
:
'commodity.products.xuanzexiayouxiaoshoushangpin'
,
})
}
visible=
{
visible
}
width=
{
1200
}
// onOk={handleExportQrcode
}
onOk=
{
handleOk
}
onCancel=
{
()
=>
setVisible
(
false
)
}
// confirmLoading={exportL
oading}
confirmLoading=
{
l
oading
}
>
<
StandardTable
columns=
{
columns
(
key
)
}
...
...
@@ -349,28 +443,7 @@ export const ProductSel = props => {
<
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();
//
}
}
/>
}
/>
...
...
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