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
9cb7b582
Commit
9cb7b582
authored
May 12, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat: 加工能力新增加工企业门户
parent
a2165aba
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
2767 additions
and
206 deletions
+2767
-206
channelRoute.ts
config/routes/channelRoute.ts
+23
-0
handlingRoute.ts
config/routes/handlingRoute.ts
+43
-37
index.ts
config/routes/index.ts
+8
-0
logisticsRoutes.ts
config/routes/logisticsRoutes.ts
+35
-29
index.less
src/components/CategorySelect/index.less
+31
-0
index.tsx
src/components/CategorySelect/index.tsx
+248
-0
index.less
src/components/InputSelect/index.less
+31
-0
index.tsx
src/components/InputSelect/index.tsx
+75
-0
index.ts
src/constants/index.ts
+51
-21
index.less
src/pages/channel/channelInfo/index.less
+39
-0
index.tsx
src/pages/channel/channelInfo/index.tsx
+102
-93
add.tsx
src/pages/channel/channelSeo/add.tsx
+132
-0
index.less
src/pages/channel/channelSeo/index.less
+0
-0
index.tsx
src/pages/channel/channelSeo/index.tsx
+191
-0
index.less
src/pages/handling/handlingInfo/index.less
+171
-0
index.tsx
src/pages/handling/handlingInfo/index.tsx
+711
-0
index.less
src/pages/logistics/logisticsInfo/index.less
+171
-0
index.tsx
src/pages/logistics/logisticsInfo/index.tsx
+666
-0
index.tsx
src/pages/shop/shopInfo/index.tsx
+37
-26
add.tsx
src/pages/shop/shopSeo/add.tsx
+2
-0
No files found.
config/routes/channelRoute.ts
View file @
9cb7b582
...
...
@@ -31,6 +31,29 @@ const ShopRoute: RouterChild = {
name
:
'渠道模板详情'
,
hideInMenu
:
true
,
component
:
'@/pages/channel/templateDetail'
,
},
{
path
:
'/memberCenter/channelAbility/channelSeo'
,
name
:
'店铺SEO设置'
,
component
:
'@/pages/channel/channelSeo'
,
},
{
path
:
'/memberCenter/channelAbility/channelSeo/add'
,
name
:
'新建SEO'
,
hideInMenu
:
true
,
component
:
'@/pages/channel/channelSeo/add'
,
},
{
path
:
'/memberCenter/channelAbility/channelSeo/edit'
,
name
:
'修改SEO'
,
hideInMenu
:
true
,
component
:
'@/pages/channel/channelSeo/add'
,
},
{
path
:
'/memberCenter/channelAbility/channelSeo/detail'
,
name
:
'查看SEO'
,
hideInMenu
:
true
,
component
:
'@/pages/channel/channelSeo/add'
,
}
]
...
...
config/routes/handlingRoute.ts
View file @
9cb7b582
...
...
@@ -8,25 +8,31 @@
const
HandlingRoute
=
{
path
:
'/memberCenter/handling'
,
name
:
'
handling
'
,
name
:
'
加工能力
'
,
icon
:
'maching'
,
routes
:
[
/** 加工企业门户 */
{
path
:
'/memberCenter/handling/infoManage'
,
name
:
'加工企业门户'
,
component
:
'@/pages/handling/handlingInfo'
,
},
//指派生产通知单
{
path
:
'/memberCenter/handling/assign'
,
name
:
'
assign
'
,
name
:
'
指派生产通知单
'
,
routes
:
[
// 指派生产通知单查询
{
path
:
'/memberCenter/handling/assign/query'
,
name
:
'
assignProductionAll
'
,
name
:
'
指派生产通知单查询
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/components/Query'
,
},
// // 指派生产通知单 -> 详情
{
path
:
'/memberCenter/handling/assign/query/detail'
,
name
:
'
assignProductionDetail
'
,
name
:
'
详情
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/detail'
,
hideInMenu
:
true
...
...
@@ -34,14 +40,14 @@ const HandlingRoute = {
// 指派生产通知单 -> 待新增生产通知单
{
path
:
'/memberCenter/handling/assign/tobeAddQuery'
,
name
:
'
assignProductionToBeAdd
'
,
name
:
'
待新增生产通知单
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/components/Query'
},
// 指派生产通知单 -> 新增成产通知单(新建)
{
path
:
'/memberCenter/handling/assign/tobeAddQuery/add'
,
name
:
'
assignProductionAdd
'
,
name
:
'
新增成产通知单(新建)
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/add'
,
hideInMenu
:
true
...
...
@@ -49,7 +55,7 @@ const HandlingRoute = {
// 指派生产通知单 -> 待新增生产通知单详情
{
path
:
'/memberCenter/handling/assign/tobeAddQuery/detail'
,
name
:
'
assignProductionDetail
'
,
name
:
'
待新增生产通知单详情
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/detail'
,
hideInMenu
:
true
...
...
@@ -57,7 +63,7 @@ const HandlingRoute = {
// 修改
{
path
:
'/memberCenter/handling/assign/tobeAddQuery/edit'
,
name
:
'
assignProductionEdit
'
,
name
:
'
修改
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/add'
,
hideInMenu
:
true
...
...
@@ -65,13 +71,13 @@ const HandlingRoute = {
// 指派生产通知单 -> 待审核通知单(一级)
{
path
:
'/memberCenter/handling/assign/pendingFirst'
,
name
:
'
examineFirst
'
,
name
:
'
待审核通知单(一级)
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/components/Query'
},
{
path
:
'/memberCenter/handling/assign/pendingFirst/detail'
,
name
:
'
examineFirstDetail
'
,
name
:
'
待审核通知单(一级)
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/detail'
,
hideInMenu
:
true
,
...
...
@@ -79,13 +85,13 @@ const HandlingRoute = {
// 指派生产通知单 -> 待审核通知单(二级)
{
path
:
'/memberCenter/handling/assign/pendingSecond'
,
name
:
'
examineSecond
'
,
name
:
'
待审核通知单(二级)
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/components/Query'
},
{
path
:
'/memberCenter/handling/assign/pendingSecond/detail'
,
name
:
'
examineSecondDetail
'
,
name
:
'
待审核通知单(二级)
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/detail'
,
hideInMenu
:
true
,
...
...
@@ -93,14 +99,14 @@ const HandlingRoute = {
// 指派生产通知单 -> 待提交生产通知单
{
path
:
'/memberCenter/handling/assign/pendingSubmit'
,
name
:
'
toBeSubmit
'
,
name
:
'
待提交生产通知单
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/components/Query'
},
// 指派生产通知单 -> 待提交生产通知单 详情
{
path
:
'/memberCenter/handling/assign/pendingSubmit/detail'
,
name
:
'
pendingSubmitDetail
'
,
name
:
'
待提交生产通知单
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/detail'
,
hideInMenu
:
true
,
...
...
@@ -108,14 +114,14 @@ const HandlingRoute = {
// 指派生产通知单 -> 待新增加工入库单
{
path
:
'/memberCenter/handling/assign/pendingAddProcessing'
,
name
:
'
processStock
'
,
name
:
'
待新增加工入库单
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/processStock'
,
// hideInMenu: true
},
{
path
:
'/memberCenter/handling/assign/pendingAddProcessing/detail'
,
name
:
'
processStockDetail
'
,
name
:
'
待新增加工入库单
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/detail'
,
hideInMenu
:
true
...
...
@@ -123,14 +129,14 @@ const HandlingRoute = {
// 指派生产通知单 -> 待收货生产通知单
{
path
:
'/memberCenter/handling/assign/pendingReceive'
,
name
:
'
toBeRecieve
'
,
name
:
'
待收货生产通知单
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/processStock'
},
// 指派生产通知单 -> 待收货生产通知单
{
path
:
'/memberCenter/handling/assign/pendingReceive/detail'
,
name
:
'
toBeRecieveDetail
'
,
name
:
'
待收货生产通知单
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/detail'
,
hideInMenu
:
true
,
...
...
@@ -141,18 +147,18 @@ const HandlingRoute = {
// 确认生产通知单
{
path
:
'/memberCenter/handling/confirm'
,
name
:
'
confirm
'
,
name
:
'
确认生产通知单
'
,
routes
:
[
// 确认生产通知单-生产通知单
{
path
:
'/memberCenter/handling/confirm/query'
,
name
:
'
confirmProductionQuery
'
,
name
:
'
生产通知单
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/confirm/Query'
,
},
{
path
:
'/memberCenter/handling/confirm/query/detail'
,
name
:
'
confirmProductionQuery
'
,
name
:
'
生产通知单
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/detail'
,
hideInMenu
:
true
...
...
@@ -160,14 +166,14 @@ const HandlingRoute = {
// 确认生产通知单 -> 待提交生产通知单
{
path
:
'/memberCenter/handling/confirm/pendingSubmit'
,
name
:
'
pendingSubmit
'
,
name
:
'
待提交生产通知单
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/confirm/Query'
},
// // 确认生产通知单 -> 待提交生产通知单详情
{
path
:
'/memberCenter/handling/confirm/pendingSubmit/detail'
,
name
:
'
confirmProductionQueryDetail
'
,
name
:
'
待提交生产通知单详情
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/detail'
,
hideInMenu
:
true
...
...
@@ -175,13 +181,13 @@ const HandlingRoute = {
// 确认生产通知单 -> 待审核通知单(一级)
{
path
:
'/memberCenter/handling/confirm/pendingFirst'
,
name
:
'
pendingFirst
'
,
name
:
'
待审核通知单(一级)
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/confirm/Query'
},
{
path
:
'/memberCenter/handling/confirm/pendingFirst/detail'
,
name
:
'
pendingFirstDetail
'
,
name
:
'
待审核通知单(一级)
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/detail'
,
hideInMenu
:
true
...
...
@@ -189,13 +195,13 @@ const HandlingRoute = {
// 确认生产通知单 -> 待审核通知单(二级)
{
path
:
'/memberCenter/handling/confirm/pendingSecond'
,
name
:
'
pendingSecond
'
,
name
:
'
待审核通知单(二级)
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/confirm/Query'
},
{
path
:
'/memberCenter/handling/confirm/pendingSecond/detail'
,
name
:
'
pendingSecondDetail
'
,
name
:
'
待审核通知单(二级)
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/detail'
,
hideInMenu
:
true
...
...
@@ -203,14 +209,14 @@ const HandlingRoute = {
// 确认生产通知单 -> 待确认生产通知单
{
path
:
'/memberCenter/handling/confirm/pendingConfirm'
,
name
:
'
pendingConfirm
'
,
name
:
'
待确认生产通知单
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/confirm/Query'
,
},
// // 确认生产通知单 -> 待确认生产通知单详情
{
path
:
'/memberCenter/handling/confirm/pendingConfirm/detail'
,
name
:
'
pendingConfirmDetail
'
,
name
:
'
待确认生产通知单详情
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/detail'
,
hideInMenu
:
true
...
...
@@ -218,14 +224,14 @@ const HandlingRoute = {
// 确认生产通知单 -> 待新增加工发货单
{
path
:
'/memberCenter/handling/confirm/processingInvoiceTobeAdd'
,
name
:
'
processingInvoiceTobeAdd
'
,
name
:
'
待新增加工发货单
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/processStock'
,
},
// 待确认生产通知单 -> 待新增加工发货单详情
{
path
:
'/memberCenter/handling/confirm/processingInvoiceTobeAdd/detail'
,
name
:
'
processingInvoiceTobeAddDetail
'
,
name
:
'
待新增加工发货单详情
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/detail'
,
hideInMenu
:
true
...
...
@@ -233,13 +239,13 @@ const HandlingRoute = {
// 确认生产通知单 -> 待新增物流单
{
path
:
'/memberCenter/handling/confirm/pendingAddLogistics'
,
name
:
'
pendingAddLogistics
'
,
name
:
'
待新增物流单
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/processStock'
,
},
{
path
:
'/memberCenter/handling/confirm/pendingAddLogistics/detail'
,
name
:
'
pendingAddLogisticsDetail
'
,
name
:
'
待新增物流单
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/detail'
,
hideInMenu
:
true
,
...
...
@@ -247,13 +253,13 @@ const HandlingRoute = {
// 确认生产通知单 -> 待发货生产通知单
{
path
:
'/memberCenter/handling/confirm/pendingDelivered'
,
name
:
'
pendingDelivered
'
,
name
:
'
待发货生产通知单
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/processStock'
,
},
{
path
:
'/memberCenter/handling/confirm/pendingDelivered/detail'
,
name
:
'
pendingDeliveredDetail
'
,
name
:
'
待发货生产通知单
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/detail'
,
hideInMenu
:
true
,
...
...
@@ -261,14 +267,14 @@ const HandlingRoute = {
// 确认生产通知单 -> 待确认回单生产通知单
{
path
:
'/memberCenter/handling/confirm/pendingReceipt'
,
name
:
'
pendingReceipt
'
,
name
:
'
待确认回单生产通知单
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/processStock'
},
// 确认生产通知单 -> 待确认回单生产通知单
{
path
:
'/memberCenter/handling/confirm/pendingReceipt/detail'
,
name
:
'
pendingReceiptDetail
'
,
name
:
'
待确认回单生产通知单
'
,
icon
:
'smile'
,
component
:
'@/pages/handling/assign/detail'
,
hideInMenu
:
true
,
...
...
config/routes/index.ts
View file @
9cb7b582
...
...
@@ -34,6 +34,14 @@ const memberCenterRoute = {
redirect
:
'/memberCenter/shopAbility/infoManage'
,
},
{
path
:
'/memberCenter/logisticsAbility'
,
redirect
:
'/memberCenter/logisticsAbility/infoManage'
,
},
{
path
:
'/memberCenter/handling'
,
redirect
:
'/memberCenter/handling/infoManage'
,
},
{
path
:
'/memberCenter/channelAbility'
,
redirect
:
'/memberCenter/channelAbility/infoManage'
,
},
...
...
config/routes/logisticsRoutes.ts
View file @
9cb7b582
...
...
@@ -10,112 +10,118 @@ import { RouterChild } from '../utils/index';
const
LogisticsRoute
:
RouterChild
=
{
path
:
'/memberCenter/logisticsAbility'
,
name
:
'
logisticsAbility
'
,
name
:
'
物流能力
'
,
icon
:
'logistics'
,
routes
:
[
/** 物流公司门户 */
{
path
:
'/memberCenter/logisticsAbility/infoManage'
,
name
:
'物流公司门户'
,
component
:
'@/pages/logistics/logisticsInfo'
,
},
{
// 物流管理模块
path
:
'/memberCenter/logisticsAbility/logistics'
,
name
:
'
logistics
'
,
name
:
'
物流管理模块
'
,
routes
:
[
// // 物流公司管理
{
path
:
'/memberCenter/logisticsAbility/logistics/company'
,
name
:
'
company
'
,
name
:
'
物流公司管理
'
,
component
:
'@/pages/logistics/list/company'
},
// 物流公司管理-新增
{
path
:
'/memberCenter/logisticsAbility/logistics/company/add'
,
name
:
'
addCompany
'
,
name
:
'
物流公司管理-新增
'
,
component
:
'@/pages/logistics/logisticsCompany/add'
,
hideInMenu
:
true
},
// 物流公司管理-编辑
{
path
:
'/memberCenter/logisticsAbility/logistics/company/edit'
,
name
:
'
editCompany
'
,
name
:
'
物流公司管理-编辑
'
,
component
:
'@/pages/logistics/logisticsCompany/edit'
,
hideInMenu
:
true
},
// 物流公司管理-详情
{
path
:
'/memberCenter/logisticsAbility/logistics/company/detail'
,
name
:
'
companyDetail
'
,
name
:
'
物流公司管理-详情
'
,
component
:
'@/pages/logistics/logisticsCompany/detail'
,
hideInMenu
:
true
},
// 发货地址
{
path
:
'/memberCenter/logisticsAbility/logistics/deliveryAddress'
,
name
:
'
deliveryAddress
'
,
name
:
'
发货地址
'
,
component
:
'@/pages/logistics/list/deliveryAddress'
},
// 发货地址-新增
{
path
:
'/memberCenter/logisticsAbility/logistics/deliveryAddress/add'
,
name
:
'
addDeliveryAddress
'
,
name
:
'
发货地址-新增
'
,
component
:
'@/pages/logistics/shippingAddress/add'
,
hideInMenu
:
true
},
// 发货地址-编辑
{
path
:
'/memberCenter/logisticsAbility/logistics/deliveryAddress/edit'
,
name
:
'
editDeliveryAddress
'
,
name
:
'
发货地址-编辑
'
,
component
:
'@/pages/logistics/shippingAddress/edit'
,
hideInMenu
:
true
},
// 收货地址
{
path
:
'/memberCenter/logisticsAbility/logistics/receivingAddress'
,
name
:
'
receivingAddress
'
,
name
:
'
收货地址
'
,
component
:
'@/pages/logistics/list/receivingAddress'
},
// 收货地址-新增
{
path
:
'/memberCenter/logisticsAbility/logistics/receivingAddress/add'
,
name
:
'
addReceivingAddress
'
,
name
:
'
收货地址-新增
'
,
component
:
'@/pages/logistics/receiptAddress/add'
,
hideInMenu
:
true
},
// 收货地址-编辑
{
path
:
'/memberCenter/logisticsAbility/logistics/receivingAddress/edit'
,
name
:
'
editReceivingAddress
'
,
name
:
'
收货地址-编辑
'
,
component
:
'@/pages/logistics/receiptAddress/edit'
,
hideInMenu
:
true
},
// 运费模板
{
path
:
'/memberCenter/logisticsAbility/logistics/template'
,
name
:
'
template
'
,
name
:
'
运费模板
'
,
component
:
'@/pages/logistics/list/template'
},
// 运费模板-新增
{
path
:
'/memberCenter/logisticsAbility/logistics/templateForm'
,
name
:
'
templateForm
'
,
name
:
'
运费模板-新增
'
,
component
:
'@/pages/logistics/list/components/templateForm'
,
hideInMenu
:
true
},
// 运费模板-新增
{
path
:
'/memberCenter/logisticsAbility/logistics/template/add'
,
name
:
'
addTemplate
'
,
name
:
'
运费模板-新增
'
,
component
:
'@/pages/logistics/list/components/templateForm'
,
hideInMenu
:
true
},
// 运费模板-编辑
{
path
:
'/memberCenter/logisticsAbility/logistics/template/edit'
,
name
:
'
editTemplate
'
,
name
:
'
运费模板-编辑
'
,
component
:
'@/pages/logistics/list/components/templateForm'
,
hideInMenu
:
true
},
// 运费模板-详情
{
path
:
'/memberCenter/logisticsAbility/logistics/template/detail'
,
name
:
'
templateDetail
'
,
name
:
'
运费模板-详情
'
,
component
:
'@/pages/logistics/list/components/templateForm'
,
hideInMenu
:
true
},
...
...
@@ -125,38 +131,38 @@ const LogisticsRoute: RouterChild = {
// 物流单提交
{
path
:
'/memberCenter/logisticsAbility/logisticsSubmit'
,
name
:
'
logisticsSubmit
'
,
name
:
'
物流单提交
'
,
routes
:
[
// 快递单查询
{
path
:
'/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList'
,
name
:
'
orderSubmitSearchList
'
,
name
:
'
快递单查询
'
,
component
:
'@/pages/logistics/logisticsSubmit/orderSearchList'
,
},
// 快递单查询-详情
{
path
:
'/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail'
,
name
:
'
orderSubmitDeatil
'
,
name
:
'
快递单查询-详情
'
,
component
:
'@/pages/logistics/components/orderSearchDetail'
,
hideInMenu
:
true
},
// 待提交物流单
{
path
:
'/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList'
,
name
:
'
toOrderSumitList
'
,
name
:
'
待提交物流单
'
,
component
:
'@/pages/logistics/logisticsSubmit/toOrderSumitList'
,
},
// 待提交物流单-新增
{
path
:
'/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/add'
,
name
:
'
addToOrderSubmit
'
,
name
:
'
待提交物流单-新增
'
,
component
:
'@/pages/logistics/addLogistics'
,
hideInMenu
:
true
},
// 待提交物流单-编辑
{
path
:
'/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/edit'
,
name
:
'
editToOrderSubmit
'
,
name
:
'
待提交物流单-编辑
'
,
component
:
'@/pages/logistics/addLogistics'
,
hideInMenu
:
true
},
...
...
@@ -166,38 +172,38 @@ const LogisticsRoute: RouterChild = {
// 物流单处理
{
path
:
'/memberCenter/logisticsAbility/logisticsResult'
,
name
:
'
logisticsResult
'
,
name
:
'
物流单处理
'
,
routes
:
[
// 快递单查询
{
path
:
'/memberCenter/logisticsAbility/logisticsResult/orderResultSearchList'
,
name
:
'
orderResultSearchList
'
,
name
:
'
快递单查询
'
,
component
:
'@/pages/logistics/logisticsResult/orderSearchList'
,
},
// 快递单查询-详情
{
path
:
'/memberCenter/logisticsAbility/logisticsResult/orderResultSearchList/detail'
,
name
:
'
orderResultDeatil
'
,
name
:
'
快递单查询-详情
'
,
component
:
'@/pages/logistics/components/orderSearchDetail'
,
hideInMenu
:
true
},
// 待确认物流单
{
path
:
'/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmList'
,
name
:
'
toOrderComfirmList
'
,
name
:
'
待确认物流单
'
,
component
:
'@/pages/logistics/logisticsResult/toOrderComfirmList'
,
},
// 待确认物流单-详情
{
path
:
'/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmList/detail'
,
name
:
'
orderResultDeatil
'
,
name
:
'
待确认物流单-详情
'
,
component
:
'@/pages/logistics/components/orderSearchDetail'
,
hideInMenu
:
true
},
// 待确认物流单-详情
{
path
:
'/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmList/option'
,
name
:
'
orderResultDeatil
'
,
name
:
'
待确认物流单-详情
'
,
component
:
'@/pages/logistics/components/orderSearchDetail'
,
hideInMenu
:
true
},
...
...
src/components/CategorySelect/index.less
0 → 100644
View file @
9cb7b582
.category_select_line {
display: flex;
&:not(:last-child) {
margin-bottom: 16px;
}
.opration_btn {
width: 32px;
height: 32px;
background: rgba(250, 251, 252, 1);
border: 1px solid rgba(235, 236, 240, 1);
color: #909399;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
margin-right: 16px;
cursor: pointer;
&:hover {
opacity: .8;
}
&.add {
background: rgba(0, 179, 122, 1);
border: 1px solid rgba(0, 179, 122, 1);
color: #ffffff;
}
}
}
src/components/CategorySelect/index.tsx
0 → 100644
View file @
9cb7b582
import
React
,
{
forwardRef
,
Fragment
,
useState
,
useEffect
}
from
'react'
;
import
{
Select
}
from
'antd'
;
import
{
PlusOutlined
,
MinusOutlined
}
from
'@ant-design/icons'
import
cx
from
'classnames'
import
style
from
'./index.less'
;
import
{
isEmpty
}
from
'@formily/antd/esm/shared'
import
{
PublicApi
}
from
'@/services/api'
;
const
{
Option
}
=
Select
;
interface
CategorySelectPropsType
{
dataSource
:
Array
<
{
firstId
:
number
;
firstName
:
string
;
secondId
:
number
;
secondName
:
string
;
thirdlyId
:
number
,
thirdlyName
:
string
;
index
:
number
;
}
>
,
onAdded
?:
Function
,
onReduce
?:
Function
,
onChange
?:
Function
,
}
const
CategoryCascader
:
React
.
FC
<
CategorySelectPropsType
>
=
(
props
)
=>
{
const
{
dataSource
,
onAdded
,
onReduce
,
onChange
}
=
props
;
const
[
firstData
,
setFirstData
]
=
useState
([]);
const
[
secondData
,
setSecondData
]
=
useState
({});
const
[
thirdlyData
,
setThirdlyData
]
=
useState
({});
useEffect
(()
=>
{
fetchCategoryList
()
},
[])
const
getFirstById
=
(
id
:
number
)
=>
{
let
result
=
0
firstData
&&
firstData
.
map
(
item
=>
{
if
(
item
.
value
===
id
)
{
result
=
item
}
})
return
result
}
const
getSecondById
=
(
id
:
number
,
firstId
:
string
)
=>
{
let
result
=
0
!
isEmpty
(
secondData
)
&&
secondData
[
firstId
].
map
(
item
=>
{
if
(
item
.
value
===
id
)
{
result
=
item
}
})
return
result
}
const
getThirdlyById
=
(
id
:
number
,
secondId
:
string
)
=>
{
let
result
=
0
!
isEmpty
(
thirdlyData
)
&&
thirdlyData
[
secondId
].
map
(
item
=>
{
if
(
item
.
value
===
id
)
{
result
=
item
}
})
return
result
}
const
fetchCategoryList
=
()
=>
{
PublicApi
.
getProductCustomerGetCustomerCategoryTree
().
then
(
res
=>
{
initCategoryData
(
res
.
data
)
})
}
const
initCategoryData
=
(
categoryList
:
any
)
=>
{
if
(
!
categoryList
)
{
return
}
const
tmpfirstData
=
[];
const
tempSecondData
=
{}
const
tempThirdlyData
=
{}
for
(
const
item
of
categoryList
)
{
tmpfirstData
.
push
({
lable
:
item
.
title
,
value
:
Number
(
item
.
id
)
})
if
(
item
.
children
)
{
const
tempsecondList
=
[];
for
(
const
secondItem
of
item
.
children
)
{
tempsecondList
.
push
({
lable
:
secondItem
.
title
,
value
:
Number
(
secondItem
.
id
)
})
if
(
secondItem
.
children
)
{
const
tempThirdlyList
=
[];
for
(
const
thirdlyItem
of
secondItem
.
children
)
{
tempThirdlyList
.
push
({
lable
:
thirdlyItem
.
title
,
value
:
Number
(
thirdlyItem
.
id
)
})
}
tempThirdlyData
[
secondItem
.
id
]
=
tempThirdlyList
;
}
}
tempSecondData
[
item
.
id
]
=
tempsecondList
}
}
console
.
log
(
tmpfirstData
,
tempSecondData
,
tempSecondData
)
setFirstData
(
tmpfirstData
);
setSecondData
(
tempSecondData
);
setThirdlyData
(
tempThirdlyData
);
}
const
handleFirstChange
=
(
value
:
number
,
index
:
number
)
=>
{
const
newData
=
JSON
.
parse
(
JSON
.
stringify
(
dataSource
));
const
firstById
:
any
=
getFirstById
(
value
);
newData
.
map
((
item
:
any
)
=>
{
if
(
item
.
index
===
index
)
{
item
.
firstId
=
value
item
.
firstName
=
firstById
.
lable
if
(
!
isEmpty
(
secondData
[
firstById
.
value
]))
{
item
.
secondId
=
secondData
[
firstById
.
value
][
0
].
value
item
.
secondName
=
secondData
[
firstById
.
value
][
0
].
lable
}
else
{
item
.
secondId
=
undefined
item
.
secondName
=
''
}
if
(
!
isEmpty
(
thirdlyData
[
secondData
[
firstById
.
value
][
0
].
value
]))
{
item
.
thirdlyId
=
thirdlyData
[
secondData
[
firstById
.
value
][
0
].
value
][
0
].
value
item
.
thirdlyName
=
thirdlyData
[
secondData
[
firstById
.
value
][
0
].
value
][
0
].
lable
}
else
{
item
.
thirdlyId
=
undefined
item
.
thirdlyName
=
''
}
}
return
item
})
onChange
(
newData
)
}
const
onSecondChange
=
(
value
:
number
,
firstId
:
string
,
index
:
number
)
=>
{
const
newData
=
JSON
.
parse
(
JSON
.
stringify
(
dataSource
))
const
secondById
:
any
=
getSecondById
(
value
,
firstId
)
newData
.
map
((
item
:
any
)
=>
{
if
(
item
.
index
===
index
)
{
item
.
secondId
=
secondById
.
value
;
item
.
secondName
=
secondById
.
lable
;
if
(
!
isEmpty
(
thirdlyData
[
secondById
.
value
]))
{
item
.
thirdlyId
=
thirdlyData
[
secondById
.
value
][
0
].
value
item
.
thirdlyName
=
thirdlyData
[
secondById
.
value
][
0
].
lable
}
else
{
item
.
thirdlyId
=
undefined
item
.
thirdlyName
=
''
}
}
return
item
})
onChange
(
newData
)
}
const
onThirdlyChange
=
(
value
:
number
,
secondId
:
string
,
index
:
number
)
=>
{
const
newData
=
JSON
.
parse
(
JSON
.
stringify
(
dataSource
))
const
thirdlyById
:
any
=
getThirdlyById
(
value
,
secondId
)
newData
.
map
((
item
:
any
)
=>
{
if
(
item
.
index
===
index
)
{
item
.
thirdlyId
=
thirdlyById
.
value
;
item
.
thirdlyName
=
thirdlyById
.
lable
;
}
return
item
})
onChange
(
newData
)
}
const
handleAddNewSelect
=
()
=>
{
onAdded
({
index
:
dataSource
[
dataSource
.
length
-
1
].
index
+
1
,
firstId
:
0
,
secondId
:
0
,
thirdlyId
:
0
,
firstName
:
''
,
secondName
:
''
,
thirdlyName
:
''
})
}
const
handleReduceSelect
=
(
index
:
number
)
=>
{
if
(
dataSource
.
length
>
1
)
{
onReduce
(
index
)
}
}
return
(
<
Fragment
>
{
dataSource
&&
dataSource
.
map
((
item
:
any
,
index
)
=>
(
<
div
className=
{
style
.
category_select_line
}
key=
{
`dataSourceItem-${index}`
}
>
<
Select
style=
{
{
width
:
180
}
}
value=
{
item
.
firstId
?
item
.
firstId
:
undefined
}
onChange=
{
(
value
)
=>
handleFirstChange
(
value
,
item
.
index
)
}
placeholder=
"请选择"
>
{
firstData
.
map
(
item
=>
(
<
Option
value=
{
item
.
value
}
key=
{
item
.
value
}
>
{
item
.
lable
}
</
Option
>
))
}
</
Select
>
<
Select
style=
{
{
marginLeft
:
16
,
width
:
180
}
}
value=
{
item
.
secondId
?
item
.
secondId
:
undefined
}
onChange=
{
(
value
)
=>
onSecondChange
(
value
,
item
.
firstId
,
item
.
index
)
}
placeholder=
"请选择"
>
{
(
item
.
firstId
&&
!
isEmpty
(
secondData
))
?
secondData
[
item
.
firstId
]
&&
secondData
[
item
.
firstId
].
map
((
item
:
any
)
=>
(
<
Option
value=
{
item
.
value
}
key=
{
item
.
value
}
>
{
item
.
lable
}
</
Option
>
))
:
null
}
</
Select
>
<
Select
style=
{
{
marginLeft
:
16
,
marginRight
:
24
,
width
:
180
}
}
value=
{
item
.
thirdlyId
?
item
.
thirdlyId
:
undefined
}
onChange=
{
(
value
)
=>
onThirdlyChange
(
value
,
item
.
secondId
,
item
.
index
)
}
placeholder=
"请选择"
>
{
(
item
.
secondId
&&
!
isEmpty
(
thirdlyData
))
?
thirdlyData
[
item
.
secondId
]
&&
thirdlyData
[
item
.
secondId
].
map
((
item
:
any
)
=>
(
<
Option
value=
{
item
.
value
}
key=
{
item
.
value
}
>
{
item
.
lable
}
</
Option
>
))
:
null
}
</
Select
>
{
index
===
dataSource
.
length
-
1
&&
(
<
div
className=
{
cx
(
style
.
opration_btn
,
style
.
add
)
}
onClick=
{
()
=>
handleAddNewSelect
()
}
>
<
PlusOutlined
/>
</
div
>
)
}
<
div
className=
{
style
.
opration_btn
}
onClick=
{
()
=>
handleReduceSelect
(
item
.
index
)
}
>
<
MinusOutlined
/>
</
div
>
</
div
>
))
}
</
Fragment
>
)
}
const
CategorySelect
:
React
.
FC
<
CategorySelectPropsType
>
=
forwardRef
((
props
)
=>
{
const
{
dataSource
,
onAdded
,
onReduce
,
onChange
}
=
props
;
return
(
<
div
className=
{
style
.
category_select
}
>
<
CategoryCascader
dataSource=
{
dataSource
}
onAdded=
{
onAdded
}
onReduce=
{
onReduce
}
onChange=
{
onChange
}
/>
</
div
>
)
})
CategorySelect
.
displayName
=
'CategorySelect'
;
export
default
CategorySelect
;
src/components/InputSelect/index.less
0 → 100644
View file @
9cb7b582
.input_select_line {
display: flex;
&:not(:last-child) {
margin-bottom: 16px;
}
.opration_btn {
width: 32px;
height: 32px;
background: rgba(250, 251, 252, 1);
border: 1px solid rgba(235, 236, 240, 1);
color: #909399;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
margin-right: 16px;
cursor: pointer;
&:hover {
opacity: .8;
}
&.add {
background: rgba(0, 179, 122, 1);
border: 1px solid rgba(0, 179, 122, 1);
color: #ffffff;
}
}
}
src/components/InputSelect/index.tsx
0 → 100644
View file @
9cb7b582
import
React
,
{
forwardRef
,
Fragment
}
from
'react'
;
import
{
Input
}
from
'antd'
;
import
cx
from
'classnames'
import
style
from
'./index.less'
;
import
{
isEmpty
}
from
'@formily/antd/esm/shared'
import
{
MinusOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
interface
InputSelectPropsType
{
dataSource
:
Array
<
string
>
,
onAdded
?:
Function
,
onReduce
?:
Function
,
onChange
?:
Function
,
}
const
InputCascader
:
React
.
FC
<
InputSelectPropsType
>
=
(
props
:
any
)
=>
{
const
{
dataSource
,
onAdded
,
onReduce
,
onChange
}
=
props
;
const
handleAddNewSelect
=
()
=>
{
onAdded
(
''
)
}
const
handleReduceSelect
=
(
index
:
number
)
=>
{
if
(
dataSource
.
length
>
1
)
{
onReduce
(
index
)
}
}
const
handleChangeInput
=
(
e
:
any
,
index
:
number
)
=>
{
const
{
value
}
=
e
.
target
;
const
newData
=
[...
dataSource
]
newData
[
index
]
=
value
;
onChange
(
newData
);
}
return
(
<
Fragment
>
{
dataSource
&&
dataSource
.
map
((
item
:
any
,
index
:
number
)
=>
(
<
div
className=
{
style
.
input_select_line
}
key=
{
`inputDataItem-${index}`
}
>
<
Input
placeholder=
'最长20个字符,10 个汉字'
style=
{
{
width
:
572
,
marginRight
:
24
}
}
value=
{
item
}
onChange=
{
(
value
)
=>
handleChangeInput
(
value
,
index
)
}
/>
{
index
===
dataSource
.
length
-
1
&&
(
<
div
className=
{
cx
(
style
.
opration_btn
,
style
.
add
)
}
onClick=
{
()
=>
handleAddNewSelect
()
}
>
<
PlusOutlined
/>
</
div
>
)
}
<
div
className=
{
style
.
opration_btn
}
onClick=
{
()
=>
handleReduceSelect
(
index
)
}
>
<
MinusOutlined
/>
</
div
>
</
div
>
))
}
</
Fragment
>
)
}
const
InputSelect
:
React
.
FC
<
InputSelectPropsType
>
=
forwardRef
((
props
)
=>
{
const
{
dataSource
,
onAdded
,
onReduce
,
onChange
}
=
props
;
return
(
<
div
>
<
InputCascader
dataSource=
{
dataSource
}
onAdded=
{
onAdded
}
onReduce=
{
onReduce
}
onChange=
{
onChange
}
/>
</
div
>
)
})
InputSelect
.
displayName
=
"InputSelect"
;
export
default
InputSelect
src/constants/index.ts
View file @
9cb7b582
...
...
@@ -521,15 +521,15 @@ export const ORDER_TYPE2_CHANNEL_POINTS = 8;
/**
* 采购询价合同
*/
export
const
ORDER_TYPE2_ENQUIRY_CONTRACT
=
9
;
/**
* 采购竞价合同
*/
export
const
ORDER_TYPE2_BIDDING_CONTRACT
=
10
;
/**
* 采购招标合同
*/
export
const
ORDER_TYPE2_TENDER_CONTRACT
=
11
;
export
const
ORDER_TYPE2_ENQUIRY_CONTRACT
=
9
;
/**
* 采购竞价合同
*/
export
const
ORDER_TYPE2_BIDDING_CONTRACT
=
10
;
/**
* 采购招标合同
*/
export
const
ORDER_TYPE2_TENDER_CONTRACT
=
11
;
export
const
ORDER_TYPE2
=
{
[
ORDER_TYPE2_INQUIRY
]:
'询价采购'
,
...
...
@@ -660,17 +660,17 @@ export enum OrderModalType {
/**
* 采购询价合同下单
*/
PURCHASE_ENQUIRY_CONTRACT_ORDER
=
32
,
PURCHASE_ENQUIRY_CONTRACT_ORDER
=
32
,
/**
* 采购招标合同下单
*/
PURCHASE_TENDER_CONTRACT_ORDER
=
33
,
PURCHASE_TENDER_CONTRACT_ORDER
=
33
,
/**
* 采购竞价合同下单
*/
PURCHASE_BIDDING_CONTRACT_ORDER
=
34
,
PURCHASE_BIDDING_CONTRACT_ORDER
=
34
,
}
...
...
@@ -1274,11 +1274,11 @@ export const BILL_TRADE_OPERATION_ORDER_PAY = 1;
/**
* 订单退款
*/
export
const
BILL_TRADE_OPERATION_ORDER_RETURN
=
2
;
export
const
BILL_TRADE_OPERATION_ORDER_RETURN
=
2
;
/**
* 还款
*/
export
const
BILL_TRADE_OPERATION_REPAYMENT
=
3
;
export
const
BILL_TRADE_OPERATION_REPAYMENT
=
3
;
export
const
BILL_TRADE_OPERATION
=
{
[
BILL_TRADE_OPERATION_ORDER_PAY
]:
'订单支付'
,
[
BILL_TRADE_OPERATION_ORDER_RETURN
]:
'订单退款'
,
...
...
@@ -1297,7 +1297,7 @@ export const CREDIT_INNER_STATUS_COMMITTED_FAILED = 2;
/**
* 提交审核成功
*/
export
const
CREDIT_INNER_STATUS_COMMITTED_SUCCESS
=
3
;
export
const
CREDIT_INNER_STATUS_COMMITTED_SUCCESS
=
3
;
/**
* 一级审核失败
*/
...
...
@@ -1955,10 +1955,10 @@ export const PAY_WAY_DEADLINE = 5;
/**
* 月结
*/
export
const
PAY_WAY_MONTH
=
6
;
/**
* 合同内清算
*/
export
const
PAY_WAY_MONTH
=
6
;
/**
* 合同内清算
*/
export
const
PAY_WAY_CONTRACT
=
7
;
/**
...
...
@@ -2084,8 +2084,8 @@ export enum BidInsideWorkState {
Qualifications_Check_Pass
=
8
,
/** 资格预审审核不通过 */
Qualifications_Check_Not_Pass
=
9
,
/** 待专家评标 */
Not_Selection_Tender
=
10
,
/** 待专家评标 */
Not_Selection_Tender
=
10
,
/** 待提交评标报告 */
Submitted_Selection_Tender
=
11
,
/** 待提交审核定标 */
...
...
@@ -2297,3 +2297,33 @@ export enum DOORTYPE {
/** 采购门户 */
PROCUREMENT_DOORTYPE
}
/** 年加工额 */
export
const
yearProcessAmount
=
[
{
label
:
'50万以下'
,
value
:
1
},
{
label
:
'50万-100万'
,
value
:
2
},
{
label
:
'101万-500万'
,
value
:
3
},
{
label
:
'501万-1000万'
,
value
:
4
},
{
label
:
'1001万-2000万'
,
value
:
5
},
{
label
:
'2000万以上'
,
value
:
6
},
]
/** 厂房面积 */
export
const
plantArea
=
[
{
label
:
'100平以下'
,
value
:
1
},
{
label
:
'100平-200平'
,
value
:
2
},
{
label
:
'201平-500平'
,
value
:
3
},
{
label
:
'501平-1000平'
,
value
:
4
},
{
label
:
'1001平-5000平'
,
value
:
5
},
{
label
:
'5000平以上'
,
value
:
6
},
]
/** 员工人数 */
export
const
staffNum
=
[
{
label
:
'10人以下'
,
value
:
1
},
{
label
:
'10-50人'
,
value
:
2
},
{
label
:
'51-100人'
,
value
:
3
},
{
label
:
'101-500人'
,
value
:
4
},
{
label
:
'501-1000人'
,
value
:
5
},
{
label
:
'1000人以上'
,
value
:
6
},
]
src/pages/channel/channelInfo/index.less
View file @
9cb7b582
...
...
@@ -121,3 +121,42 @@
}
}
}
.revise_style {
.upload_data {
width: 575px;
.upload_item {
padding: 5px 8px;
margin-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #ecf7ff;
.upload_left {
display: flex;
align-items: center;
color: #303133;
:global {
.anticon-file-word {
color: #4279df;
font-size: 20px;
margin-right: 8px;
}
}
}
.upload_right {
color: #00B37A;
cursor: pointer;
:global {
.anticon-delete {
margin-left: 19px;
color: #C0C4CC;
}
}
}
}
}
}
src/pages/channel/channelInfo/index.tsx
View file @
9cb7b582
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
Form
,
Input
,
Button
,
Tooltip
,
Select
,
message
}
from
'antd'
import
{
Form
,
Input
,
Button
,
Tooltip
,
Select
,
message
,
Upload
,
Typography
}
from
'antd'
import
{
Prompt
}
from
'umi'
import
{
inject
}
from
'mobx-react'
import
{
QuestionCircleOutlined
,
DeleteOutlined
,
CopyOutlined
}
from
'@ant-design/icons'
import
{
QuestionCircleOutlined
,
DeleteOutlined
,
CopyOutlined
,
LinkOutlined
,
UploadOutlined
}
from
'@ant-design/icons'
import
CitySelect
from
'@/components/CitySelect'
import
RequireItem
from
'@/components/RequireItem'
import
{
PublicApi
}
from
'@/services/api'
import
UploadImage
from
'@/components/UploadImage'
import
{
MALL_TYPE
}
from
'@/constants'
import
{
MALL_TYPE
,
UPLOAD_TYPE
}
from
'@/constants'
import
copy
from
'copy-to-clipboard'
import
cx
from
'classnames'
import
styles
from
'./index.less'
...
...
@@ -41,6 +41,34 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
const
[
shopInfo
,
setShopInfo
]
=
useState
<
GetTemplateWebMemberChannelWebFindCurrMemberChannelResponse
>
()
const
[
shopId
,
setShopId
]
=
useState
<
number
>
()
/** 上传公司画册 */
const
[
file
,
setFile
]
=
useState
<
any
>
({});
const
[
fileLoading
,
setFileLoading
]
=
useState
<
boolean
>
(
false
);
const
beforeDocUpload
=
(
file
:
any
)
=>
{
const
isLt50M
=
file
.
size
/
1024
/
1024
<
50
;
if
(
!
isLt50M
)
{
message
.
error
(
'上传文件大小不超过 50M!'
);
}
return
isLt50M
;
}
const
handleChange
=
({
file
})
=>
{
setFileLoading
(
true
);
if
(
file
.
response
)
{
if
(
file
.
response
.
code
!==
1000
)
{
setFileLoading
(
false
);
return
}
setFileLoading
(
false
);
setFile
({
albumName
:
file
.
name
,
albumUrl
:
file
.
response
.
data
,
})
}
}
const
fileRemove
=
()
=>
{
setFile
({})
}
useEffect
(()
=>
{
fetchShopInfo
()
fetchAllShop
()
...
...
@@ -63,33 +91,41 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
* 获取渠道信息
*/
const
fetchShopInfo
=
()
=>
{
const
{
memberId
}
=
getAuth
()
||
{}
const
{
memberId
}
=
getAuth
()
||
{}
const
param
:
any
=
{
memberId
}
PublicApi
.
getTemplateWebMemberChannelWebFindCurrMemberChannel
(
param
).
then
(
res
=>
{
const
data
=
res
.
data
if
(
res
.
code
===
1000
)
{
setShopInfo
(
data
)
setSelectCityData
(
initMemberShopArea
(
data
.
memberChannelAreas
))
setLogo
(
data
.
logo
)
setShopId
(
data
.
shopId
)
setWorkshopPics
(
data
.
workshopPics
||
[])
setHonorPics
(
data
.
honorPics
||
[])
setStoreUrl
(
""
)
setPromotionPic
(
data
.
promotionPic
||
""
)
form
.
setFieldsValue
({
describe
:
data
.
describe
,
customerUrl
:
data
.
customerUrl
,
logo
:
data
.
logo
,
memberChannelAreas
:
initMemberShopArea
(
data
.
memberChannelAreas
),
workshopPics
:
data
.
workshopPics
||
[],
honorPics
:
data
.
honorPics
||
[],
phone
:
data
.
phone
||
""
,
address
:
data
.
address
||
""
,
lng
:
data
.
lng
||
""
,
lat
:
data
.
lat
||
""
,
})
if
(
data
)
{
setShopInfo
(
data
)
setSelectCityData
(
initMemberShopArea
(
data
.
memberChannelAreas
))
setLogo
(
data
.
logo
)
setShopId
(
data
.
shopId
)
setWorkshopPics
(
data
.
workshopPics
||
[])
setHonorPics
(
data
.
honorPics
||
[])
setStoreUrl
(
""
)
setPromotionPic
(
data
.
promotionPic
||
""
)
if
(
data
.
albumName
&&
data
.
albumUrl
)
{
setFile
({
albumName
:
data
.
albumName
,
albumUrl
:
data
.
albumUrl
})
}
form
.
setFieldsValue
({
describe
:
data
.
describe
,
customerUrl
:
data
.
customerUrl
,
logo
:
data
.
logo
,
memberChannelAreas
:
initMemberShopArea
(
data
.
memberChannelAreas
),
workshopPics
:
data
.
workshopPics
||
[],
honorPics
:
data
.
honorPics
||
[],
phone
:
data
.
phone
||
""
,
address
:
data
.
address
||
""
,
lng
:
data
.
lng
||
""
,
lat
:
data
.
lat
||
""
,
})
}
}
})
}
...
...
@@ -154,14 +190,10 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
if
(
!
checkmemberChannelAreas
(
value
.
memberChannelAreas
))
{
return
}
// if (!shopId) {
// message.error("店铺链接不能为空")
// return
// }
value
.
storeUrl
=
storeUrl
||
`
${
siteUrl
}
/
${
GlobalConfig
.
channelRootRoute
}
`
value
.
shopId
=
shopId
value
.
albumName
=
file
.
albumName
;
value
.
albumUrl
=
file
.
albumUrl
;
setConfirmLoading
(
true
)
setConfirmLoading
(
true
)
PublicApi
.
postTemplateWebMemberChannelWebSaveCurrMemberChannel
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
fetchShopInfo
()
...
...
@@ -284,7 +316,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
if
(
!
shopInfo
)
{
return
null
}
if
(
shopId
&&
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
if
(
shopId
&&
shopInfo
.
memberId
)
{
const
resUrl
=
getMallItemAndSetUrl
(
shopId
)
return
resUrl
?
(
<
div
className=
{
styles
.
shop_url
}
>
...
...
@@ -402,6 +434,44 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"albumName"
label=
{
<
RequireItem
label=
"宣传画册"
/>
}
className=
{
styles
.
revise_style
}
>
<
div
className=
{
styles
.
upload_data
}
>
{
Object
.
keys
(
file
).
length
>
0
&&
(
<
div
className=
{
styles
.
upload_item
}
>
<
div
className=
{
styles
.
upload_left
}
>
<
LinkOutlined
style=
{
{
marginRight
:
'5px'
}
}
/>
<
Typography
.
Link
href=
{
`/api/contract/contractTemplate/downloadContract?contractName=${file.albumName}&contractUrl=${file.albumURL}`
}
target=
"_blank"
>
{
file
.
albumName
}
</
Typography
.
Link
>
</
div
>
<
div
className=
{
styles
.
upload_right
}
onClick=
{
fileRemove
}
>
<
DeleteOutlined
/>
</
div
>
</
div
>
)
}
</
div
>
{
Object
.
keys
(
file
).
length
===
0
&&
(
<
Upload
action=
"/api/file/file/upload"
data=
{
{
fileType
:
UPLOAD_TYPE
}
}
showUploadList=
{
false
}
accept=
'.pdf'
beforeUpload=
{
beforeDocUpload
}
onChange=
{
handleChange
}
>
<
Button
loading=
{
fileLoading
}
icon=
{
<
UploadOutlined
/>
}
>
上传文件
</
Button
>
<
div
style=
{
{
marginTop
:
'8px'
}
}
>
一次上传一个文件,每个附件大小不能超过 50M
</
div
>
</
Upload
>
)
}
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"shopId"
label=
{
<
RequireItem
label=
"店铺链接"
/>
}
>
...
...
@@ -417,67 +487,6 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
}
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"promotionPic"
label=
{
<
RequireItem
label=
"推广页"
/>
}
>
<
div
className=
{
styles
.
form_item_wrap
}
>
<
div
className=
{
styles
.
img_list
}
>
{
promotionPic
&&
(
<
div
className=
{
cx
(
styles
.
upload_btn
,
styles
.
large
,
styles
.
upload
)
}
>
<
div
className=
{
styles
.
delete_btn
}
onClick=
{
()
=>
setPromotionPic
(
""
)
}
><
DeleteOutlined
/></
div
>
<
img
className=
{
styles
.
upload_img
}
src=
{
promotionPic
}
/>
</
div
>
)
}
<
UploadImage
imgUrl=
{
""
}
large=
{
true
}
fileMaxSize=
{
1024
}
size=
"106x107"
onChange=
{
(
url
)
=>
handleAddPromotionPic
(
url
)
}
/>
</
div
>
</
div
>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"customerUrl"
label=
{
<
RequireItem
label=
"客服链接"
/>
}
rules=
{
[{
pattern
:
/
(
http|ftp|https
)
:
\/\/[\w\-
_
]
+
(\.[\w\-
_
]
+
)
+
([\w\-
.,@?^=%&:
/
~+#
]
*
[\w\-
@?^=%&
/
~+#
])?
/
,
message
:
'请输入正确的客服链接'
}]
}
>
<
Input
allowClear
autoComplete=
"off"
className=
{
styles
.
form_item
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"phone"
label=
{
<
RequireItem
label=
"联系电话"
/>
}
>
<
Input
allowClear
autoComplete=
"off"
className=
{
styles
.
form_item
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"address"
label=
{
<
RequireItem
label=
"详细地址"
/>
}
>
<
Input
allowClear
autoComplete=
"off"
className=
{
styles
.
form_item
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"lng"
label=
{
<
RequireItem
label=
"经度"
/>
}
>
<
Input
allowClear
autoComplete=
"off"
className=
{
styles
.
form_item
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"lat"
label=
{
<
RequireItem
label=
"纬度"
/>
}
>
<
Input
allowClear
autoComplete=
"off"
className=
{
styles
.
form_item
}
/>
</
Form
.
Item
>
<
Form
.
Item
label=
{
<
RequireItem
label=
""
/>
}
>
<
Button
loading=
{
confirmLoading
}
type=
"primary"
style=
{
{
marginRight
:
16
}
}
onClick=
{
handleSave
}
>
保存
</
Button
>
...
...
src/pages/channel/channelSeo/add.tsx
0 → 100644
View file @
9cb7b582
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
history
,
Prompt
}
from
'umi'
;
import
{
Card
,
Button
,
Tabs
,
Form
,
Select
,
Tooltip
,
Input
,
Typography
}
from
'antd'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
RequireItem
from
'@/components/RequireItem'
;
import
{
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
{
SELECT_NAME
,
DOORTYPE
}
from
'@/constants'
;
import
{
PublicApi
}
from
'@/services/api'
;
const
{
TabPane
}
=
Tabs
const
layout
:
any
=
{
colon
:
false
,
labelCol
:
{
style
:
{
width
:
'174px'
}
},
wrapperCol
:
{
span
:
9
},
labelAlign
:
"left"
}
const
ChannelSeoAdded
=
()
=>
{
const
{
query
:
{
id
},
pathname
}
=
history
.
location
;
const
link
=
pathname
.
split
(
'/'
)[
pathname
.
split
(
'/'
).
length
-
1
];
const
[
form
]
=
Form
.
useForm
()
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
<
boolean
>
(
false
);
const
[
formIsHalfFilledOut
,
setFormIsHalfFilledOut
]
=
useState
<
boolean
>
(
false
);
const
handleFormValueChange
=
()
=>
{
setFormIsHalfFilledOut
(
true
)
}
const
handleSave
=
(
e
:
any
)
=>
{
e
.
preventDefault
()
const
fetch
=
(
link
===
'add'
?
PublicApi
.
postTemplateWebSeoWebAdd
:
PublicApi
.
postTemplateWebSeoWebUpdate
);
form
.
validateFields
().
then
((
value
:
any
)
=>
{
const
type
:
number
=
value
.
type
;
const
link
:
string
=
value
.
link
;
const
params
=
{
id
,
...
value
,
link
:
`http://
${
link
}
`
,
doorType
:
DOORTYPE
.
PLACE_DOORTYPE
,
name
:
SELECT_NAME
[
type
]
}
setConfirmLoading
(
true
)
fetch
(
params
).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
setConfirmLoading
(
false
);
return
}
setConfirmLoading
(
false
)
setFormIsHalfFilledOut
(
false
)
history
.
goBack
();
}).
catch
(()
=>
{
setConfirmLoading
(
false
)
})
})
}
useEffect
(()
=>
{
if
(
id
)
{
PublicApi
.
getTemplateWebSeoWebGet
({
id
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
}
form
.
setFieldsValue
({...
res
.
data
})
})
}
},
[])
return
(
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
extra=
{
link
!==
'detail'
&&
<
Button
type=
"primary"
loading=
{
confirmLoading
}
onClick=
{
handleSave
}
>
保存
</
Button
>
}
>
<
Prompt
when=
{
formIsHalfFilledOut
}
message=
"您还有未保存的内容,是否确定要离开?"
/>
<
Card
>
<
Tabs
type=
"card"
>
<
TabPane
tab=
'基本信息'
key=
'1'
>
<
Form
{
...
layout
}
form=
{
form
}
hideRequiredMark=
{
true
}
onValuesChange=
{
handleFormValueChange
}
>
<
Form
.
Item
name=
'type'
label=
{
<
RequireItem
label=
"页面名称"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请选择页面名称"
}]
}
>
<
Select
disabled=
{
link
===
'detail'
}
>
<
Select
.
Option
value=
{
1
}
>
店铺首页
</
Select
.
Option
>
<
Select
.
Option
value=
{
2
}
>
关于我们
</
Select
.
Option
>
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
name=
'link'
label=
{
<
RequireItem
label=
"访问链接"
brief=
{
<
Tooltip
placement=
"top"
title=
"访问该页面的链接"
><
QuestionCircleOutlined
/></
Tooltip
>
}
/>
}
>
<
Input
disabled=
{
link
===
'detail'
}
addonBefore=
{
<
Typography
.
Text
type=
'secondary'
>
http://
</
Typography
.
Text
>
}
/>
</
Form
.
Item
>
<
Form
.
Item
name=
'title'
label=
{
<
RequireItem
label=
"标题"
isRequire=
{
true
}
brief=
{
<
Tooltip
placement=
"top"
title=
"用于显示在页面title标签的内容,便于搜索引擎抓取"
><
QuestionCircleOutlined
/></
Tooltip
>
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请输入标题"
}]
}
>
<
Input
disabled=
{
link
===
'detail'
}
placeholder=
'最长100个字符,50个汉字'
/>
</
Form
.
Item
>
<
Form
.
Item
name=
'description'
label=
{
<
RequireItem
label=
"描述"
isRequire=
{
true
}
brief=
{
<
Tooltip
placement=
"top"
title=
"用于显示在页面Description标签的内容,便于搜索引擎抓取"
><
QuestionCircleOutlined
/></
Tooltip
>
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请输入描述"
}]
}
>
<
Input
.
TextArea
disabled=
{
link
===
'detail'
}
rows=
{
5
}
placeholder=
"最长200个字符,100个汉字"
maxLength=
{
200
}
/>
</
Form
.
Item
>
<
Form
.
Item
name=
'keywords'
label=
{
<
RequireItem
label=
"关键字"
isRequire=
{
true
}
brief=
{
<
Tooltip
placement=
"top"
title=
"用于显示在页面Keywords标签的内容,便于搜索引擎通过关键词搜索时抓取页面,多个关键词用豆号分隔"
><
QuestionCircleOutlined
/></
Tooltip
>
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请输入关键字"
}]
}
>
<
Input
.
TextArea
disabled=
{
link
===
'detail'
}
rows=
{
5
}
placeholder=
"最长200个字符,100个汉字"
maxLength=
{
200
}
/>
</
Form
.
Item
>
</
Form
>
</
TabPane
>
</
Tabs
>
</
Card
>
</
PageHeaderWrapper
>
)
}
export
default
ChannelSeoAdded
;
src/pages/channel/channelSeo/index.less
0 → 100644
View file @
9cb7b582
src/pages/channel/channelSeo/index.tsx
0 → 100644
View file @
9cb7b582
import
React
,
{
ReactNode
,
useRef
}
from
'react'
;
import
{
ISchema
}
from
'@formily/antd'
;
import
{
history
}
from
'umi'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
Card
,
Row
,
Col
,
Button
,
Popconfirm
,
Typography
}
from
'antd'
;
import
{
StandardTable
}
from
'god'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
searchSelectGetSelectCategoryOptionEffect
}
from
'@/pages/transaction/effect/index'
;
import
{
PauseCircleOutlined
,
PlayCircleOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
const
ChannelSeo
=
()
=>
{
const
ref
=
useRef
<
any
>
({});
const
formActions
=
createFormActions
();
/** 修改状态 */
const
confirm
=
(
e
:
any
)
=>
{
const
status
=
e
.
status
===
1
?
0
:
1
;
PublicApi
.
postTemplateWebSeoWebUpdateStatus
({
id
:
e
.
id
,
status
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
}
ref
.
current
.
reload
();
})
}
/** 删除 */
const
handleDelete
=
(
id
:
number
)
=>
{
PublicApi
.
postTemplateWebSeoWebDelete
({
id
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
}
ref
.
current
.
reload
();
})
}
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'ID'
,
key
:
'id'
,
dataIndex
:
'id'
,
width
:
128
,
},
{
title
:
'页面名称'
,
key
:
'name'
,
dataIndex
:
'name'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Typography
.
Link
href=
{
`/memberCenter/shopAbility/shopSeo/detail?id=${record.id}`
}
>
{
text
}
</
Typography
.
Link
>
},
{
title
:
'访问链接'
,
key
:
'link'
,
dataIndex
:
'link'
,
},
{
title
:
'状态'
,
key
:
'status'
,
dataIndex
:
'status'
,
width
:
256
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
let
component
:
ReactNode
=
null
component
=
(
<
Popconfirm
title=
"确定要执行这个操作?"
onConfirm=
{
()
=>
confirm
(
record
)
}
okText=
"是"
cancelText=
"否"
>
<
Button
type=
"link"
style=
{
record
.
status
===
1
?
{
color
:
'#00B37A'
}
:
{
color
:
'red'
}
}
>
{
record
.
status
===
1
?
<>
有效
<
PlayCircleOutlined
/></>
:
<>
无效
<
PauseCircleOutlined
/></>
}
</
Button
>
</
Popconfirm
>
)
return
component
}
},
{
title
:
'操作'
,
key
:
'action'
,
dataIndex
:
'action'
,
width
:
256
,
render
:
(
_text
:
any
,
record
:
any
)
=>
(
<>
<
Popconfirm
title=
"确定要执行这个操作?"
onConfirm=
{
()
=>
handleDelete
(
record
.
id
)
}
disabled=
{
record
.
status
===
1
}
okText=
"是"
cancelText=
"否"
>
<
Button
disabled=
{
record
.
status
===
1
}
type=
'link'
>
删除
</
Button
>
</
Popconfirm
>
<
Button
disabled=
{
record
.
status
===
1
}
type=
'link'
onClick=
{
()
=>
history
.
push
(
`/memberCenter/shopAbility/shopSeo/edit?id=${record.id}`
)
}
>
修改
</
Button
>
</>
)
}
]
// 搜索
const
search
=
(
values
:
any
)
=>
{
ref
.
current
.
reload
(
values
)
}
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
(
resolve
=>
{
PublicApi
.
getTemplateWebSeoWebPage
({
...
params
,
doorType
:
2
}).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
}
const
controllerBtns
=
<
Row
>
<
Col
span=
{
6
}
>
<
Button
onClick=
{
()
=>
history
.
push
(
'/memberCenter/shopAbility/shopSeo/add'
)
}
type=
"primary"
icon=
{
<
PlusOutlined
/>
}
>
新建
</
Button
>
</
Col
>
</
Row
>
const
schema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
megalayout
:
{
type
:
'object'
,
"x-component"
:
'mega-layout'
,
"x-component-props"
:
{
grid
:
true
},
properties
:
{
ctl
:
{
type
:
'object'
,
"x-component"
:
"Children"
,
"x-component-props"
:
{
children
:
"{{controllerBtns}}"
}
},
name
:
{
type
:
'string'
,
"x-component"
:
"Search"
,
"x-mega-props"
:
{
},
"x-component-props"
:
{
placeholder
:
'页面名称'
,
advanced
:
false
}
}
}
}
}
}
return
(
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
tableProps=
{
{
rowKey
:
'id'
,
}
}
columns=
{
columns
}
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
controlRender=
{
<
NiceForm
actions=
{
formActions
}
expressionScope=
{
{
controllerBtns
}
}
onSubmit=
{
values
=>
search
(
values
)
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'name'
,
FORM_FILTER_PATH
)
FormEffectHooks
.
onFieldChange$
(
'category'
).
subscribe
(
state
=>
{
searchSelectGetSelectCategoryOptionEffect
(
actions
,
'category'
)
})
}
}
schema=
{
schema
}
>
</
NiceForm
>
}
/>
</
Card
>
</
PageHeaderWrapper
>
)
}
export
default
ChannelSeo
;
src/pages/handling/handlingInfo/index.less
0 → 100644
View file @
9cb7b582
.handling_info {
background-color: #ffffff;
padding: 32px 24px;
border-radius: 8px;
.add_template_form {
:global {
.ant-form-item-label>label::after {
display: none;
}
}
}
.form_item {
width: 572px;
resize: none;
}
.form_item_wrap {
display: flex;
flex-wrap: wrap;
align-items: center;
.size_require {
color: #C0C4CC;
}
}
.img_list {
display: flex;
flex-wrap: wrap;
}
.index_pics_list {
display: flex;
align-items: center;
}
.jump_link {
flex: 1;
}
.shop_url {
width: 572px;
color: #909399;
margin-top: 16px;
font-size: 12px;
display: flex;
&>label {
flex: 1;
width: 0;
display: block;
color: #303133;
margin-left: 8px;
margin-right: 15px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.copy_icon {
cursor: pointer;
}
}
.upload_btn {
position: relative;
width: 104px;
height: 104px;
display: flex;
align-items: center;
justify-content: center;
color: #909399;
flex-direction: column;
background: rgba(250, 251, 252, 1);
border-radius: 2px;
border: 1px dashed rgba(223, 225, 230, 1);
cursor: pointer;
margin-right: 24px;
overflow: hidden;
margin-bottom: 12px;
&.upload {
border: 1px solid rgba(223, 225, 230, 1);
background: #ffffff;
}
.upload_img {
height: 100%;
width: 100%;
display: block;
margin: 0 auto;
background-size: auto 100%;
background-position: center center;
background-repeat: no-repeat;
}
&>img {
width: 100%;
height: 100%;
}
&.large {
width: 175px;
height: 120px;
}
&>p {
margin-top: 12px;
}
.delete_btn {
position: absolute;
width: 24px;
height: 24px;
border-radius: 4px;
background: rgba(0, 0, 0, 0.45);
top: 8px;
right: 8px;
color: #ffffff;
text-align: center;
line-height: 24px;
&:hover {
cursor: pointer;
opacity: .8;
}
}
}
}
.revise_style {
.upload_data {
width: 575px;
.upload_item {
padding: 5px 8px;
margin-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #ecf7ff;
.upload_left {
display: flex;
align-items: center;
color: #303133;
:global {
.anticon-file-word {
color: #4279df;
font-size: 20px;
margin-right: 8px;
}
}
}
.upload_right {
color: #00B37A;
cursor: pointer;
:global {
.anticon-delete {
margin-left: 19px;
color: #C0C4CC;
}
}
}
}
}
}
src/pages/handling/handlingInfo/index.tsx
0 → 100644
View file @
9cb7b582
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
Form
,
Input
,
Button
,
Tooltip
,
Select
,
message
,
Upload
,
Typography
,
Tabs
}
from
'antd'
import
{
Prompt
}
from
'umi'
import
{
inject
}
from
'mobx-react'
import
{
QuestionCircleOutlined
,
DeleteOutlined
,
CopyOutlined
,
UploadOutlined
,
LinkOutlined
}
from
'@ant-design/icons'
import
CitySelect
from
'@/components/CitySelect'
import
RequireItem
from
'@/components/RequireItem'
import
{
PublicApi
}
from
'@/services/api'
import
UploadImage
from
'@/components/UploadImage'
import
copy
from
'copy-to-clipboard'
import
cx
from
'classnames'
import
styles
from
'./index.less'
import
{
getAuth
}
from
'@/utils/auth'
import
{
isEmpty
}
from
'@formily/antd/esm/shared'
import
{
UPLOAD_TYPE
}
from
'@/constants'
import
CategorySelect
from
'@/components/CategorySelect'
import
{
yearProcessAmount
,
plantArea
,
staffNum
}
from
'@/constants'
;
interface
HandlingInfoPropsType
{
SiteStore
:
{
siteUrl
:
string
;
siteId
:
number
;
}
}
const
{
TabPane
}
=
Tabs
;
const
defaultCityData
=
{
index
:
0
,
provinceCode
:
0
,
province
:
''
,
cityCode
:
0
,
city
:
''
}
const
defaultCategoryData
=
{
index
:
0
,
firstId
:
0
,
secondId
:
0
,
thirdlyId
:
0
,
firstName
:
''
,
secondName
:
''
,
thirdlyName
:
''
}
const
HandlingInfo
:
React
.
FC
<
HandlingInfoPropsType
>
=
(
props
)
=>
{
const
{
siteUrl
,
siteId
}
=
props
.
SiteStore
const
[
formIsHalfFilledOut
,
setFormIsHalfFilledOut
]
=
useState
(
false
)
const
[
form
]
=
Form
.
useForm
()
const
[
allMallList
,
setAllMallList
]
=
useState
([])
const
[
selectCityData
,
setSelectCityData
]
=
useState
<
any
>
([
defaultCityData
])
const
[
selectCategoryData
,
setSelectCategoryData
]
=
useState
<
any
>
([
defaultCategoryData
])
const
[
companyPics
,
setCompanyPics
]
=
useState
([])
// 厂房照片
const
[
honorPics
,
setHonorPics
]
=
useState
([])
// 资质荣誉
const
[
slideshowBOList
,
setSlideshowBOList
]
=
useState
([])
// 首页轮播图
const
[
logo
,
setLogo
]
=
useState
<
string
>
(
""
)
const
[
shopInfo
,
setShopInfo
]
=
useState
<
any
>
()
const
[
shopId
,
setShopId
]
=
useState
<
number
>
()
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
<
boolean
>
(
false
)
/** 上传公司画册 */
const
[
file
,
setFile
]
=
useState
<
any
>
({});
const
[
fileLoading
,
setFileLoading
]
=
useState
<
boolean
>
(
false
);
const
beforeDocUpload
=
(
file
:
any
)
=>
{
const
isLt50M
=
file
.
size
/
1024
/
1024
<
50
;
if
(
!
isLt50M
)
{
message
.
error
(
'上传文件大小不超过 50M!'
);
}
return
isLt50M
;
}
const
handleChange
=
({
file
})
=>
{
setFileLoading
(
true
);
if
(
file
.
response
)
{
if
(
file
.
response
.
code
!==
1000
)
{
setFileLoading
(
false
);
return
}
setFileLoading
(
false
);
setFile
({
albumName
:
file
.
name
,
albumUrl
:
file
.
response
.
data
,
})
}
}
const
fileRemove
=
()
=>
{
setFile
({})
}
useEffect
(()
=>
{
fetchShopInfo
()
fetchAllShop
()
},
[])
// 根据站点获取商城信息
const
fetchAllShop
=
()
=>
{
const
param
:
any
=
{
siteId
,
type
:
1
}
PublicApi
.
getManageShopFindShopsBySiteId
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setAllMallList
(
res
.
data
)
}
})
}
/**
* 获取店铺信息
*/
const
fetchShopInfo
=
()
=>
{
const
{
memberId
,
memberRoleId
}
=
getAuth
()
||
{}
const
param
:
any
=
{
memberId
,
roleId
:
memberRoleId
}
PublicApi
.
getTemplateWebMemberProcessWebFindCurrMemberProcess
().
then
(
res
=>
{
const
data
:
any
=
res
.
data
if
(
res
.
code
===
1000
)
{
if
(
data
)
{
setSelectCityData
(
initMemberShopArea
(
data
.
areaBOList
))
setSelectCategoryData
(
initMemberCategory
(
data
.
categoryBOList
))
setLogo
(
data
.
logo
)
setCompanyPics
(
data
.
companyPics
||
[])
setHonorPics
(
data
.
honorPics
||
[])
setSlideshowBOList
(
data
.
slideshowBOList
||
[])
if
(
data
.
albumName
&&
data
.
albumUrl
)
{
setFile
({
albumName
:
data
.
albumName
,
albumUrl
:
data
.
albumUrl
})
}
form
.
setFieldsValue
({
describe
:
data
.
describe
,
customerUrl
:
data
.
customerUrl
,
logo
:
data
.
logo
,
yearProcessAmount
:
data
.
yearProcessAmount
,
plantArea
:
data
.
plantArea
,
staffNum
:
data
.
staffNum
,
categoryBOList
:
initMemberCategory
(
data
.
categoryBOList
),
areaBOList
:
initMemberShopArea
(
data
.
areaBOList
),
companyPics
:
data
.
companyPics
||
[],
honorPics
:
data
.
honorPics
||
[],
slideshowBOList
:
data
.
slideshowBOList
||
[],
...
data
.
aboutSeo
,
})
}
}
})
}
const
initMemberShopArea
=
(
data
)
=>
{
if
(
!
isEmpty
(
data
))
{
return
data
.
map
((
item
,
index
)
=>
{
item
.
index
=
index
return
item
})
}
else
{
return
[
defaultCityData
]
}
}
const
initMemberCategory
=
(
data
)
=>
{
if
(
!
isEmpty
(
data
))
{
return
data
.
map
((
item
,
index
)
=>
{
item
.
index
=
index
return
item
})
}
else
{
return
[
defaultCategoryData
]
}
}
const
handleAddNewCategorySelect
=
(
item
:
any
)
=>
{
const
temp
=
[...
selectCategoryData
]
temp
.
push
(
item
)
setSelectCategoryData
(
temp
)
form
.
setFieldsValue
({
categoryBOList
:
temp
})
}
const
handleAddNewCitySelect
=
(
item
:
any
)
=>
{
const
temp
=
[...
selectCityData
]
temp
.
push
(
item
)
setSelectCityData
(
temp
)
form
.
setFieldsValue
({
areaBOList
:
temp
})
}
const
handleReduceCategorySelect
=
(
index
:
number
)
=>
{
let
temp
=
JSON
.
parse
(
JSON
.
stringify
(
selectCategoryData
))
temp
=
temp
.
filter
((
item
:
any
)
=>
item
.
index
!==
index
)
setSelectCategoryData
(
temp
)
form
.
setFieldsValue
({
categoryBOList
:
temp
})
}
const
handleReduceCitySelect
=
(
index
:
number
)
=>
{
let
temp
=
JSON
.
parse
(
JSON
.
stringify
(
selectCityData
))
temp
=
temp
.
filter
((
item
:
any
)
=>
item
.
index
!==
index
)
setSelectCityData
(
temp
)
form
.
setFieldsValue
({
areaBOList
:
temp
})
}
const
handleCityChange
=
(
data
:
any
)
=>
{
setSelectCityData
(
data
)
form
.
setFieldsValue
({
areaBOList
:
data
})
}
const
handleCategoryChang
=
(
data
:
any
)
=>
{
setSelectCategoryData
(
data
);
form
.
setFieldsValue
({
categoryBOList
:
data
})
}
const
handleDeleteWorkShopImgItem
=
(
itemInfo
:
any
)
=>
{
let
result
=
[...
companyPics
]
result
=
result
.
filter
(
item
=>
item
!==
itemInfo
)
setCompanyPics
(
result
)
form
.
setFieldsValue
({
companyPics
:
result
})
}
const
handleDeleteHonorPicsItem
=
(
itemInfo
:
any
)
=>
{
let
result
=
[...
honorPics
]
result
=
result
.
filter
(
item
=>
item
!==
itemInfo
)
setHonorPics
(
result
)
form
.
setFieldsValue
({
honorPics
:
result
})
}
const
handleDeleteIndexPicsItem
=
(
itemInfo
:
any
)
=>
{
let
result
=
[...
slideshowBOList
]
result
=
result
.
filter
(
item
=>
item
!==
itemInfo
)
setSlideshowBOList
(
result
)
form
.
setFieldsValue
({
slideshowBOList
:
result
})
}
const
handleSave
=
(
e
:
any
)
=>
{
e
.
preventDefault
()
form
.
validateFields
().
then
((
value
:
any
)
=>
{
// if (!checkcategoryBOList(value.categoryBOList)) {
// return
// }
if
(
!
checkareaBOList
(
value
.
areaBOList
))
{
return
}
value
.
albumName
=
file
.
albumName
;
value
.
albumUrl
=
file
.
albumUrl
;
value
.
aboutSeo
=
{
title
:
value
.
title
,
description
:
value
.
description
,
keywords
:
value
.
keywords
,
}
delete
value
.
slideshowBOList
value
.
slideshowBOList
=
slideshowBOList
delete
value
.
title
delete
value
.
keywords
delete
value
.
description
setConfirmLoading
(
true
)
PublicApi
.
postTemplateWebMemberProcessWebSaveCurrMemberProcess
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
fetchShopInfo
()
setFormIsHalfFilledOut
(
false
)
}
setConfirmLoading
(
false
)
}).
catch
(()
=>
{
setConfirmLoading
(
false
)
})
})
}
const
checkareaBOList
=
(
shopAreas
)
=>
{
if
(
isEmpty
(
shopAreas
))
{
message
.
destroy
()
message
.
error
(
'请选择归属地市'
)
return
false
}
return
shopAreas
.
every
(
item
=>
{
if
(
isEmpty
(
item
.
provinceCode
))
{
message
.
destroy
()
message
.
error
(
'请选择归属地市'
)
return
false
}
else
{
return
true
}
})
}
const
checkcategoryBOList
=
(
categoryBOList
)
=>
{
if
(
isEmpty
(
categoryBOList
))
{
message
.
destroy
()
message
.
error
(
'请选择主要加工种类'
)
return
false
}
return
categoryBOList
.
every
(
item
=>
{
console
.
log
(
item
)
if
(
isEmpty
(
item
))
{
message
.
destroy
()
message
.
error
(
'请选择主要加工种类'
)
return
false
}
else
{
return
true
}
})
}
const
handleCopyLinke
=
(
link
:
string
)
=>
{
if
(
copy
(
link
))
{
message
.
success
(
'复制成功!'
)
}
}
/**
* 添加厂房照片
* @param url
*/
const
handleAddworkshopPics
=
(
url
:
string
)
=>
{
setCompanyPics
([...
companyPics
,
url
])
form
.
setFieldsValue
({
companyPics
:
[...
companyPics
,
url
]
})
}
/**
* 添加荣誉图片
* @param url
*/
const
handleAddhonorPics
=
(
url
:
string
)
=>
{
setHonorPics
([...
honorPics
,
url
])
form
.
setFieldsValue
({
honorPics
:
[...
honorPics
,
url
]
})
}
/**
* 添加首页轮播图
* @param url
*/
const
handleAddIndexPics
=
(
url
:
string
)
=>
{
const
params
=
{
imgPath
:
url
,
link
:
''
,
}
setSlideshowBOList
([...
slideshowBOList
,
params
])
form
.
setFieldsValue
({
slideshowBOList
:
[...
slideshowBOList
,
params
]
})
}
const
handleInputIndexPicsItem
=
(
e
:
any
,
index
:
number
)
=>
{
const
{
value
}
=
e
.
target
;
const
result
=
[...
slideshowBOList
];
result
[
index
].
link
=
value
;
console
.
log
(
result
)
setSlideshowBOList
(
result
)
form
.
setFieldsValue
({
slideshowBOList
:
result
})
}
const
handleMallSelectChange
=
(
mallId
:
number
)
=>
{
setShopId
(
mallId
)
if
(
!
shopInfo
)
{
return
null
}
if
(
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
const
resUrl
=
getMallItemAndSetUrl
(
mallId
)
}
}
const
getMallItemAndSetUrl
=
(
mallId
)
=>
{
let
result
=
""
const
mallItem
=
allMallList
.
filter
(
item
=>
item
.
id
===
mallId
)[
0
]
if
(
!
mallItem
)
{
return
""
}
if
(
mallItem
.
environment
===
1
)
{
let
newSiteUrl
=
siteUrl
if
(
newSiteUrl
.
indexOf
(
'http'
)
<
0
)
{
newSiteUrl
=
`http://`
+
newSiteUrl
}
switch
(
mallItem
.
type
)
{
case
1
:
result
=
`
${
newSiteUrl
}
/shop?shopId=
${
btoa
(
JSON
.
stringify
({
shopId
:
shopInfo
.
id
,
memberId
:
shopInfo
.
memberId
,
roleId
:
shopInfo
.
roleId
}))}
`
break
case
2
:
result
=
`
${
newSiteUrl
}
/shop/pointsMall?shopId=
${
btoa
(
JSON
.
stringify
({
shopId
:
shopInfo
.
id
,
memberId
:
shopInfo
.
memberId
,
roleId
:
shopInfo
.
roleId
}))}
`
break
default
:
result
=
""
break
}
}
else
{
result
=
""
}
return
result
}
const
handleFormValueChange
=
()
=>
{
setFormIsHalfFilledOut
(
true
)
}
const
getSelectMallStoreUrl
=
()
=>
{
if
(
!
shopInfo
)
{
return
null
}
if
(
shopId
&&
shopInfo
.
memberId
)
{
const
resUrl
=
getMallItemAndSetUrl
(
shopId
)
return
resUrl
?
(
<
div
className=
{
styles
.
shop_url
}
>
<
span
>
当前店铺链接:
</
span
>
<
label
>
{
resUrl
}
</
label
>
<
CopyOutlined
className=
{
styles
.
copy_icon
}
onClick=
{
()
=>
handleCopyLinke
(
resUrl
)
}
/>
</
div
>
)
:
null
}
return
null
}
return
(
<
PageHeaderWrapper
extra=
{
<
Button
type=
"primary"
loading=
{
confirmLoading
}
onClick=
{
handleSave
}
>
保存
</
Button
>
}
>
<
Prompt
when=
{
formIsHalfFilledOut
}
message=
"您还有未保存的内容,是否确定要离开?"
/>
<
div
className=
{
styles
.
handling_info
}
>
<
Form
form=
{
form
}
className=
{
styles
.
add_template_form
}
hideRequiredMark=
{
true
}
onValuesChange=
{
handleFormValueChange
}
>
<
Tabs
type=
'card'
>
<
TabPane
tab=
'基本信息'
key=
'1'
forceRender
>
<
Form
.
Item
labelAlign=
"left"
name=
"categoryBOList"
label=
{
<
RequireItem
label=
"主要加工种类"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请选择主要加工种类"
}]
}
>
<
CategorySelect
dataSource=
{
selectCategoryData
}
onAdded=
{
handleAddNewCategorySelect
}
onReduce=
{
handleReduceCategorySelect
}
onChange=
{
handleCategoryChang
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"yearProcessAmount"
label=
{
<
RequireItem
label=
"年加工额"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请选择年加工额"
}]
}
>
<
Select
allowClear
value=
{
shopId
}
className=
{
styles
.
form_item
}
placeholder=
"请选择年加工额"
>
{
yearProcessAmount
.
map
(
item
=>
(
<
Select
.
Option
key=
{
item
.
value
}
value=
{
item
.
value
}
>
{
item
.
label
}
</
Select
.
Option
>
))
}
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"plantArea"
label=
{
<
RequireItem
label=
"厂房面积"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请选择厂房面积"
}]
}
>
<
Select
allowClear
value=
{
shopId
}
className=
{
styles
.
form_item
}
placeholder=
"请选择厂房面积"
>
{
plantArea
.
map
(
item
=>
(
<
Select
.
Option
key=
{
item
.
value
}
value=
{
item
.
value
}
>
{
item
.
label
}
</
Select
.
Option
>
))
}
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"staffNum"
label=
{
<
RequireItem
label=
"员工人数"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请选择员工人数"
}]
}
>
<
Select
allowClear
value=
{
shopId
}
className=
{
styles
.
form_item
}
placeholder=
"请选择员工人数"
>
{
staffNum
.
map
(
item
=>
(
<
Select
.
Option
key=
{
item
.
value
}
value=
{
item
.
value
}
>
{
item
.
label
}
</
Select
.
Option
>
))
}
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"areaBOList"
label=
{
<
RequireItem
label=
"归属地市"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请选择归属地市"
}]
}
>
<
CitySelect
selectData=
{
selectCityData
}
onAdd=
{
handleAddNewCitySelect
}
onReduce=
{
handleReduceCitySelect
}
onChange=
{
handleCityChange
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"logo"
label=
{
<
RequireItem
label=
"公司LOGO"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请上传公司LOGO"
}]
}
>
<
UploadImage
imgUrl=
{
logo
}
fileMaxSize=
{
50
}
size=
"275*50"
onChange=
{
(
val
)
=>
{
setLogo
(
val
)
form
.
setFieldsValue
({
logo
:
val
})
}
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"describe"
label=
{
<
RequireItem
label=
"公司简介"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请输入公司简介"
}]
}
>
<
Input
.
TextArea
rows=
{
5
}
className=
{
styles
.
form_item
}
placeholder=
"请输入公司简介"
maxLength=
{
200
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"companyPics"
label=
{
<
RequireItem
label=
"公司照片"
/>
}
>
<
div
className=
{
styles
.
form_item_wrap
}
>
<
div
className=
{
styles
.
img_list
}
>
{
companyPics
.
map
((
item
,
index
)
=>
(
<
div
key=
{
index
}
className=
{
cx
(
styles
.
upload_btn
,
styles
.
large
,
styles
.
upload
)
}
>
<
div
className=
{
styles
.
delete_btn
}
onClick=
{
()
=>
handleDeleteWorkShopImgItem
(
item
)
}
><
DeleteOutlined
/></
div
>
<
div
className=
{
styles
.
upload_img
}
style=
{
{
backgroundImage
:
`url(${item})`
}
}
/>
</
div
>
))
}
<
UploadImage
imgUrl=
{
""
}
large=
{
true
}
fileMaxSize=
{
1024
}
size=
"600x400"
onChange=
{
(
url
)
=>
handleAddworkshopPics
(
url
)
}
/>
</
div
>
</
div
>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"honorPics"
label=
{
<
RequireItem
label=
"资质荣誉"
brief=
{
<
Tooltip
placement=
"top"
title=
"如商标注册证书、品牌授权证书等证明材料"
><
QuestionCircleOutlined
/></
Tooltip
>
}
/>
}
>
<
div
className=
{
styles
.
form_item_wrap
}
>
<
div
className=
{
styles
.
img_list
}
>
{
honorPics
.
map
((
item
,
index
)
=>
(
<
div
key=
{
index
}
className=
{
cx
(
styles
.
upload_btn
,
styles
.
large
,
styles
.
upload
)
}
>
<
div
className=
{
styles
.
delete_btn
}
onClick=
{
()
=>
handleDeleteHonorPicsItem
(
item
)
}
><
DeleteOutlined
/></
div
>
<
img
className=
{
styles
.
upload_img
}
src=
{
item
}
/>
</
div
>
))
}
<
UploadImage
imgUrl=
{
""
}
large=
{
true
}
fileMaxSize=
{
1024
}
size=
"106x107"
onChange=
{
(
url
)
=>
handleAddhonorPics
(
url
)
}
/>
</
div
>
</
div
>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"albumName"
label=
{
<
RequireItem
label=
"宣传画册"
/>
}
className=
{
styles
.
revise_style
}
>
<
div
className=
{
styles
.
upload_data
}
>
{
Object
.
keys
(
file
).
length
>
0
&&
(
<
div
className=
{
styles
.
upload_item
}
>
<
div
className=
{
styles
.
upload_left
}
>
<
LinkOutlined
style=
{
{
marginRight
:
'5px'
}
}
/>
<
Typography
.
Link
href=
{
`/api/contract/contractTemplate/downloadContract?contractName=${file.albumName}&contractUrl=${file.albumURL}`
}
target=
"_blank"
>
{
file
.
albumName
}
</
Typography
.
Link
>
</
div
>
<
div
className=
{
styles
.
upload_right
}
onClick=
{
fileRemove
}
>
<
DeleteOutlined
/>
</
div
>
</
div
>
)
}
</
div
>
{
Object
.
keys
(
file
).
length
===
0
&&
(
<
Upload
action=
"/api/file/file/upload"
data=
{
{
fileType
:
UPLOAD_TYPE
}
}
showUploadList=
{
false
}
accept=
'.pdf'
beforeUpload=
{
beforeDocUpload
}
onChange=
{
handleChange
}
>
<
Button
loading=
{
fileLoading
}
icon=
{
<
UploadOutlined
/>
}
>
上传文件
</
Button
>
<
div
style=
{
{
marginTop
:
'8px'
}
}
>
一次上传一个文件,每个附件大小不能超过 50M
</
div
>
</
Upload
>
)
}
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"shopId"
label=
{
<
RequireItem
label=
"门户链接"
/>
}
>
<
Select
allowClear
value=
{
shopId
}
className=
{
styles
.
form_item
}
onChange=
{
handleMallSelectChange
}
>
{
allMallList
.
map
(
item
=>
(
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
>
{
item
.
name
}
</
Select
.
Option
>
))
}
</
Select
>
{
getSelectMallStoreUrl
()
}
</
Form
.
Item
>
</
TabPane
>
<
TabPane
tab=
'SEO'
key=
'2'
forceRender
>
<
Form
.
Item
labelAlign=
"left"
name=
"title"
rules=
{
[{
required
:
true
,
message
:
"请输入标题"
}]
}
label=
{
<
RequireItem
label=
"标题"
isRequire=
{
true
}
brief=
{
<
Tooltip
placement=
"top"
title=
"用于显示在页面title标签的内容,便于搜索引擎抓取"
><
QuestionCircleOutlined
/></
Tooltip
>
}
/>
}
>
<
Input
placeholder=
"最长100个字符,50个汉字"
maxLength=
{
100
}
className=
{
styles
.
form_item
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"description"
rules=
{
[{
required
:
true
,
message
:
"请输入描述"
}]
}
label=
{
<
RequireItem
label=
"描述"
isRequire=
{
true
}
brief=
{
<
Tooltip
placement=
"top"
title=
"用于显示在页面title标签的内容,便于搜索引擎抓取"
><
QuestionCircleOutlined
/></
Tooltip
>
}
/>
}
>
<
Input
.
TextArea
rows=
{
5
}
className=
{
styles
.
form_item
}
placeholder=
"最长200个字符,100个汉字"
maxLength=
{
200
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"keywords"
rules=
{
[{
required
:
true
,
message
:
"请输入关键字"
}]
}
label=
{
<
RequireItem
label=
"关键字"
isRequire=
{
true
}
brief=
{
<
Tooltip
placement=
"top"
title=
"用于显示在页面title标签的内容,便于搜索引擎抓取"
><
QuestionCircleOutlined
/></
Tooltip
>
}
/>
}
>
<
Input
.
TextArea
rows=
{
5
}
className=
{
styles
.
form_item
}
placeholder=
"最长200个字符,100个汉字"
maxLength=
{
200
}
/>
</
Form
.
Item
>
</
TabPane
>
<
TabPane
tab=
'首页轮播图'
key=
'3'
forceRender
>
<
Form
.
Item
labelAlign=
"left"
name=
"slideshowBOList"
label=
{
<
RequireItem
label=
"首页轮播图"
/>
}
>
<
div
>
<
div
className=
{
styles
.
form_item_wrap
}
>
{
slideshowBOList
.
map
((
item
,
index
)
=>
(
<
div
className=
{
cx
(
styles
.
index_pics_list
,
styles
.
form_item
)
}
>
<
div
key=
{
index
}
className=
{
cx
(
styles
.
upload_btn
,
styles
.
large
,
styles
.
upload
)
}
>
<
div
className=
{
styles
.
delete_btn
}
onClick=
{
()
=>
handleDeleteIndexPicsItem
(
item
)
}
><
DeleteOutlined
/></
div
>
<
img
className=
{
styles
.
upload_img
}
src=
{
item
.
imgPath
}
/>
</
div
>
<
div
className=
{
styles
.
jump_link
}
>
<
Typography
.
Text
type=
'secondary'
>
跳转链接:
</
Typography
.
Text
>
<
Input
addonBefore=
{
<
Typography
.
Text
type=
'secondary'
>
http://
</
Typography
.
Text
>
}
onChange=
{
(
value
)
=>
handleInputIndexPicsItem
(
value
,
index
)
}
value=
{
item
.
link
}
placeholder=
'轮播图跳转链接'
/>
</
div
>
</
div
>
))
}
</
div
>
<
UploadImage
imgUrl=
{
""
}
large=
{
true
}
fileMaxSize=
{
1024
}
size=
"xxxxx"
onChange=
{
(
url
)
=>
handleAddIndexPics
(
url
)
}
/>
</
div
>
</
Form
.
Item
>
</
TabPane
>
</
Tabs
>
</
Form
>
</
div
>
</
PageHeaderWrapper
>
)
}
export
default
inject
(
'SiteStore'
)(
HandlingInfo
)
src/pages/logistics/logisticsInfo/index.less
0 → 100644
View file @
9cb7b582
.logistics_info {
background-color: #ffffff;
padding: 32px 24px;
border-radius: 8px;
.add_template_form {
:global {
.ant-form-item-label>label::after {
display: none;
}
}
}
.form_item {
width: 572px;
resize: none;
}
.form_item_wrap {
display: flex;
flex-wrap: wrap;
align-items: center;
.size_require {
color: #C0C4CC;
}
}
.img_list {
display: flex;
flex-wrap: wrap;
}
.index_pics_list {
display: flex;
align-items: center;
}
.jump_link {
flex: 1;
}
.shop_url {
width: 572px;
color: #909399;
margin-top: 16px;
font-size: 12px;
display: flex;
&>label {
flex: 1;
width: 0;
display: block;
color: #303133;
margin-left: 8px;
margin-right: 15px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.copy_icon {
cursor: pointer;
}
}
.upload_btn {
position: relative;
width: 104px;
height: 104px;
display: flex;
align-items: center;
justify-content: center;
color: #909399;
flex-direction: column;
background: rgba(250, 251, 252, 1);
border-radius: 2px;
border: 1px dashed rgba(223, 225, 230, 1);
cursor: pointer;
margin-right: 24px;
overflow: hidden;
margin-bottom: 12px;
&.upload {
border: 1px solid rgba(223, 225, 230, 1);
background: #ffffff;
}
.upload_img {
height: 100%;
width: 100%;
display: block;
margin: 0 auto;
background-size: auto 100%;
background-position: center center;
background-repeat: no-repeat;
}
&>img {
width: 100%;
height: 100%;
}
&.large {
width: 175px;
height: 120px;
}
&>p {
margin-top: 12px;
}
.delete_btn {
position: absolute;
width: 24px;
height: 24px;
border-radius: 4px;
background: rgba(0, 0, 0, 0.45);
top: 8px;
right: 8px;
color: #ffffff;
text-align: center;
line-height: 24px;
&:hover {
cursor: pointer;
opacity: .8;
}
}
}
}
.revise_style {
.upload_data {
width: 575px;
.upload_item {
padding: 5px 8px;
margin-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #ecf7ff;
.upload_left {
display: flex;
align-items: center;
color: #303133;
:global {
.anticon-file-word {
color: #4279df;
font-size: 20px;
margin-right: 8px;
}
}
}
.upload_right {
color: #00B37A;
cursor: pointer;
:global {
.anticon-delete {
margin-left: 19px;
color: #C0C4CC;
}
}
}
}
}
}
src/pages/logistics/logisticsInfo/index.tsx
0 → 100644
View file @
9cb7b582
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
Form
,
Input
,
Button
,
Tooltip
,
Select
,
message
,
Upload
,
Typography
,
Tabs
}
from
'antd'
import
{
Prompt
}
from
'umi'
import
{
inject
}
from
'mobx-react'
import
{
QuestionCircleOutlined
,
DeleteOutlined
,
CopyOutlined
,
UploadOutlined
,
LinkOutlined
}
from
'@ant-design/icons'
import
CitySelect
from
'@/components/CitySelect'
import
RequireItem
from
'@/components/RequireItem'
import
{
PublicApi
}
from
'@/services/api'
import
UploadImage
from
'@/components/UploadImage'
import
copy
from
'copy-to-clipboard'
import
cx
from
'classnames'
import
styles
from
'./index.less'
import
{
getAuth
}
from
'@/utils/auth'
import
{
isEmpty
}
from
'@formily/antd/esm/shared'
import
{
UPLOAD_TYPE
}
from
'@/constants'
import
InputSelect
from
'@/components/InputSelect'
interface
LogisticsInfoPropsType
{
SiteStore
:
{
siteUrl
:
string
;
siteId
:
number
;
}
}
const
{
TabPane
}
=
Tabs
;
const
defaultCityData
=
{
index
:
0
,
provinceCode
:
0
,
province
:
''
,
cityCode
:
0
,
city
:
''
}
const
LogisticsInfo
:
React
.
FC
<
LogisticsInfoPropsType
>
=
(
props
)
=>
{
const
{
siteUrl
,
siteId
}
=
props
.
SiteStore
const
[
formIsHalfFilledOut
,
setFormIsHalfFilledOut
]
=
useState
(
false
)
const
[
form
]
=
Form
.
useForm
()
const
[
allMallList
,
setAllMallList
]
=
useState
([])
const
[
storeUrl
,
setStoreUrl
]
=
useState
<
string
>
(
''
)
const
[
selectCityData
,
setSelectCityData
]
=
useState
<
any
>
([
defaultCityData
])
const
[
companyPics
,
setCompanyPics
]
=
useState
([])
// 厂房照片
const
[
honorPics
,
setHonorPics
]
=
useState
([])
// 资质荣誉
const
[
slideshowBOList
,
setSlideshowBOList
]
=
useState
([])
// 首页轮播图
const
[
promotionPic
,
setPromotionPic
]
=
useState
<
string
>
(
''
)
const
[
logo
,
setLogo
]
=
useState
<
string
>
(
""
)
const
[
shopInfo
,
setShopInfo
]
=
useState
<
any
>
()
const
[
shopId
,
setShopId
]
=
useState
<
number
>
()
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
<
boolean
>
(
false
)
const
[
mainBusiness
,
setMainBusiness
]
=
useState
<
Array
<
string
>>
([
''
])
/** 上传公司画册 */
const
[
file
,
setFile
]
=
useState
<
any
>
({});
const
[
fileLoading
,
setFileLoading
]
=
useState
<
boolean
>
(
false
);
const
beforeDocUpload
=
(
file
:
any
)
=>
{
const
isLt50M
=
file
.
size
/
1024
/
1024
<
50
;
if
(
!
isLt50M
)
{
message
.
error
(
'上传文件大小不超过 50M!'
);
}
return
isLt50M
;
}
const
handleChange
=
({
file
})
=>
{
setFileLoading
(
true
);
if
(
file
.
response
)
{
if
(
file
.
response
.
code
!==
1000
)
{
setFileLoading
(
false
);
return
}
setFileLoading
(
false
);
setFile
({
albumName
:
file
.
name
,
albumUrl
:
file
.
response
.
data
,
})
}
}
const
fileRemove
=
()
=>
{
setFile
({})
}
useEffect
(()
=>
{
fetchShopInfo
()
fetchAllShop
()
},
[])
// 根据站点获取商城信息
const
fetchAllShop
=
()
=>
{
const
param
:
any
=
{
siteId
,
type
:
1
}
PublicApi
.
getManageShopFindShopsBySiteId
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setAllMallList
(
res
.
data
)
}
})
}
/**
* 获取店铺信息
*/
const
fetchShopInfo
=
()
=>
{
const
{
memberId
,
memberRoleId
}
=
getAuth
()
||
{}
const
param
:
any
=
{
memberId
,
roleId
:
memberRoleId
}
PublicApi
.
getTemplateWebMemberLogisticsWebFindCurrMemberLogistics
(
param
).
then
(
res
=>
{
const
data
:
any
=
res
.
data
if
(
res
.
code
===
1000
)
{
if
(
data
)
{
setShopInfo
(
data
)
setSelectCityData
(
initMemberShopArea
(
data
.
areaBOList
))
setLogo
(
data
.
logo
)
setCompanyPics
(
data
.
companyPics
||
[])
setHonorPics
(
data
.
honorPics
||
[])
setPromotionPic
(
data
.
promotionPic
||
""
)
setSlideshowBOList
(
data
.
slideshowBOList
||
[])
setMainBusiness
(
data
.
mainBusiness
||
[])
if
(
data
.
albumName
&&
data
.
albumUrl
)
{
setFile
({
albumName
:
data
.
albumName
,
albumUrl
:
data
.
albumUrl
})
}
form
.
setFieldsValue
({
describe
:
data
.
describe
,
customerUrl
:
data
.
customerUrl
,
logo
:
data
.
logo
,
areaBOList
:
initMemberShopArea
(
data
.
areaBOList
),
mainBusiness
:
data
.
mainBusiness
||
[],
companyPics
:
data
.
companyPics
||
[],
honorPics
:
data
.
honorPics
||
[],
slideshowBOList
:
data
.
slideshowBOList
||
[],
...
data
.
aboutSeo
,
})
}
}
})
}
const
initMemberShopArea
=
(
data
)
=>
{
if
(
!
isEmpty
(
data
))
{
return
data
.
map
((
item
,
index
)
=>
{
item
.
index
=
index
return
item
})
}
else
{
return
[
defaultCityData
]
}
}
const
handleAddNewInputSelect
=
(
item
:
any
)
=>
{
const
temp
=
[...
mainBusiness
];
temp
.
push
(
item
);
setMainBusiness
(
temp
);
form
.
setFieldsValue
({
mainBusiness
:
temp
})
}
const
handleReduceInputSelect
=
(
index
:
number
)
=>
{
let
temp
=
[...
mainBusiness
];
temp
=
temp
.
filter
((
_it
:
any
,
idx
:
number
)
=>
idx
!==
index
)
setMainBusiness
(
temp
);
form
.
setFieldsValue
({
mainBusiness
:
temp
})
}
const
handleInputChange
=
(
data
:
any
)
=>
{
console
.
log
(
data
,
100086
)
setMainBusiness
(
data
);
form
.
setFieldsValue
({
mainBusiness
:
data
})
}
const
handleAddNewCitySelect
=
(
item
:
any
)
=>
{
const
temp
=
[...
selectCityData
]
temp
.
push
(
item
)
setSelectCityData
(
temp
)
form
.
setFieldsValue
({
areaBOList
:
temp
})
}
const
handleReduceCitySelect
=
(
index
:
number
)
=>
{
let
temp
=
JSON
.
parse
(
JSON
.
stringify
(
selectCityData
))
temp
=
temp
.
filter
((
item
:
any
)
=>
item
.
index
!==
index
)
setSelectCityData
(
temp
)
form
.
setFieldsValue
({
areaBOList
:
temp
})
}
const
handleCityChange
=
(
data
:
any
)
=>
{
setSelectCityData
(
data
)
form
.
setFieldsValue
({
areaBOList
:
data
})
}
const
handleDeleteWorkShopImgItem
=
(
itemInfo
:
any
)
=>
{
let
result
=
[...
companyPics
]
result
=
result
.
filter
(
item
=>
item
!==
itemInfo
)
setCompanyPics
(
result
)
form
.
setFieldsValue
({
companyPics
:
result
})
}
const
handleDeleteHonorPicsItem
=
(
itemInfo
:
any
)
=>
{
let
result
=
[...
honorPics
]
result
=
result
.
filter
(
item
=>
item
!==
itemInfo
)
setHonorPics
(
result
)
form
.
setFieldsValue
({
honorPics
:
result
})
}
const
handleDeleteIndexPicsItem
=
(
itemInfo
:
any
)
=>
{
let
result
=
[...
slideshowBOList
]
result
=
result
.
filter
(
item
=>
item
!==
itemInfo
)
setSlideshowBOList
(
result
)
form
.
setFieldsValue
({
slideshowBOList
:
result
})
}
const
handleSave
=
(
e
:
any
)
=>
{
e
.
preventDefault
()
form
.
validateFields
().
then
((
value
:
any
)
=>
{
if
(
!
checkmainBusiness
(
value
.
mainBusiness
))
{
return
}
if
(
!
checkareaBOList
(
value
.
areaBOList
))
{
return
}
value
.
albumName
=
file
.
albumName
;
value
.
albumUrl
=
file
.
albumUrl
;
value
.
aboutSeo
=
{
title
:
value
.
title
,
description
:
value
.
description
,
keywords
:
value
.
keywords
,
}
delete
value
.
slideshowBOList
value
.
slideshowBOList
=
slideshowBOList
delete
value
.
title
delete
value
.
keywords
delete
value
.
description
setConfirmLoading
(
true
)
PublicApi
.
postTemplateWebMemberLogisticsWebSaveCurrMemberLogistics
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
fetchShopInfo
()
setFormIsHalfFilledOut
(
false
)
}
setConfirmLoading
(
false
)
}).
catch
(()
=>
{
setConfirmLoading
(
false
)
})
})
}
const
checkareaBOList
=
(
shopAreas
)
=>
{
if
(
isEmpty
(
shopAreas
))
{
message
.
destroy
()
message
.
error
(
'请选择归属地市'
)
return
false
}
return
shopAreas
.
every
(
item
=>
{
if
(
isEmpty
(
item
.
provinceCode
))
{
message
.
destroy
()
message
.
error
(
'请选择归属地市'
)
return
false
}
else
{
return
true
}
})
}
const
checkmainBusiness
=
(
shopMainBusiness
)
=>
{
if
(
isEmpty
(
shopMainBusiness
))
{
message
.
destroy
()
message
.
error
(
'请输入主营业务'
)
return
false
}
return
shopMainBusiness
.
every
(
item
=>
{
if
(
isEmpty
(
item
))
{
message
.
destroy
()
message
.
error
(
'请输入主营业务'
)
return
false
}
else
{
return
true
}
})
}
const
handleCopyLinke
=
(
link
:
string
)
=>
{
if
(
copy
(
link
))
{
message
.
success
(
'复制成功!'
)
}
}
/**
* 添加厂房照片
* @param url
*/
const
handleAddworkshopPics
=
(
url
:
string
)
=>
{
setCompanyPics
([...
companyPics
,
url
])
form
.
setFieldsValue
({
companyPics
:
[...
companyPics
,
url
]
})
}
/**
* 添加荣誉图片
* @param url
*/
const
handleAddhonorPics
=
(
url
:
string
)
=>
{
setHonorPics
([...
honorPics
,
url
])
form
.
setFieldsValue
({
honorPics
:
[...
honorPics
,
url
]
})
}
/**
* 添加首页轮播图
* @param url
*/
const
handleAddIndexPics
=
(
url
:
string
)
=>
{
const
params
=
{
imgPath
:
url
,
link
:
''
,
}
setSlideshowBOList
([...
slideshowBOList
,
params
])
form
.
setFieldsValue
({
slideshowBOList
:
[...
slideshowBOList
,
params
]
})
}
const
handleInputIndexPicsItem
=
(
e
:
any
,
index
:
number
)
=>
{
const
{
value
}
=
e
.
target
;
const
result
=
[...
slideshowBOList
];
result
[
index
].
link
=
value
;
console
.
log
(
result
)
setSlideshowBOList
(
result
)
form
.
setFieldsValue
({
slideshowBOList
:
result
})
}
const
handleMallSelectChange
=
(
mallId
:
number
)
=>
{
setShopId
(
mallId
)
if
(
!
shopInfo
)
{
return
null
}
if
(
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
const
resUrl
=
getMallItemAndSetUrl
(
mallId
)
setStoreUrl
(
resUrl
)
}
else
{
setStoreUrl
(
null
)
}
}
const
getMallItemAndSetUrl
=
(
mallId
)
=>
{
let
result
=
""
const
mallItem
=
allMallList
.
filter
(
item
=>
item
.
id
===
mallId
)[
0
]
if
(
!
mallItem
)
{
return
""
}
if
(
mallItem
.
environment
===
1
)
{
let
newSiteUrl
=
siteUrl
if
(
newSiteUrl
.
indexOf
(
'http'
)
<
0
)
{
newSiteUrl
=
`http://`
+
newSiteUrl
}
switch
(
mallItem
.
type
)
{
case
1
:
result
=
`
${
newSiteUrl
}
/shop?shopId=
${
btoa
(
JSON
.
stringify
({
shopId
:
shopInfo
.
id
,
memberId
:
shopInfo
.
memberId
,
roleId
:
shopInfo
.
roleId
}))}
`
break
case
2
:
result
=
`
${
newSiteUrl
}
/shop/pointsMall?shopId=
${
btoa
(
JSON
.
stringify
({
shopId
:
shopInfo
.
id
,
memberId
:
shopInfo
.
memberId
,
roleId
:
shopInfo
.
roleId
}))}
`
break
default
:
result
=
""
break
}
}
else
{
result
=
""
}
return
result
}
const
handleFormValueChange
=
()
=>
{
setFormIsHalfFilledOut
(
true
)
}
const
getSelectMallStoreUrl
=
()
=>
{
if
(
!
shopInfo
)
{
return
null
}
if
(
shopId
&&
shopInfo
.
memberId
)
{
const
resUrl
=
getMallItemAndSetUrl
(
shopId
)
return
resUrl
?
(
<
div
className=
{
styles
.
shop_url
}
>
<
span
>
当前店铺链接:
</
span
>
<
label
>
{
resUrl
}
</
label
>
<
CopyOutlined
className=
{
styles
.
copy_icon
}
onClick=
{
()
=>
handleCopyLinke
(
resUrl
)
}
/>
</
div
>
)
:
null
}
return
null
}
return
(
<
PageHeaderWrapper
extra=
{
<
Button
type=
"primary"
loading=
{
confirmLoading
}
onClick=
{
handleSave
}
>
保存
</
Button
>
}
>
<
Prompt
when=
{
formIsHalfFilledOut
}
message=
"您还有未保存的内容,是否确定要离开?"
/>
<
div
className=
{
styles
.
logistics_info
}
>
<
Form
form=
{
form
}
className=
{
styles
.
add_template_form
}
hideRequiredMark=
{
true
}
onValuesChange=
{
handleFormValueChange
}
>
<
Tabs
type=
'card'
>
<
TabPane
tab=
'基本信息'
key=
'1'
forceRender
>
<
Form
.
Item
labelAlign=
"left"
name=
"mainBusiness"
label=
{
<
RequireItem
label=
"主营业务"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请输入主营业务"
}]
}
>
<
InputSelect
dataSource=
{
mainBusiness
}
onAdded=
{
handleAddNewInputSelect
}
onReduce=
{
handleReduceInputSelect
}
onChange=
{
handleInputChange
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"areaBOList"
label=
{
<
RequireItem
label=
"归属地市"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请选择归属地市"
}]
}
>
<
CitySelect
selectData=
{
selectCityData
}
onAdd=
{
handleAddNewCitySelect
}
onReduce=
{
handleReduceCitySelect
}
onChange=
{
handleCityChange
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"logo"
label=
{
<
RequireItem
label=
"公司LOGO"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请上传公司LOGO"
}]
}
>
<
UploadImage
imgUrl=
{
logo
}
fileMaxSize=
{
50
}
size=
"275*50"
onChange=
{
(
val
)
=>
{
setLogo
(
val
)
form
.
setFieldsValue
({
logo
:
val
})
}
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"describe"
label=
{
<
RequireItem
label=
"公司简介"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请输入公司简介"
}]
}
>
<
Input
.
TextArea
rows=
{
5
}
className=
{
styles
.
form_item
}
placeholder=
"请输入公司简介"
maxLength=
{
200
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"companyPics"
label=
{
<
RequireItem
label=
"公司照片"
/>
}
>
<
div
className=
{
styles
.
form_item_wrap
}
>
<
div
className=
{
styles
.
img_list
}
>
{
companyPics
.
map
((
item
,
index
)
=>
(
<
div
key=
{
index
}
className=
{
cx
(
styles
.
upload_btn
,
styles
.
large
,
styles
.
upload
)
}
>
<
div
className=
{
styles
.
delete_btn
}
onClick=
{
()
=>
handleDeleteWorkShopImgItem
(
item
)
}
><
DeleteOutlined
/></
div
>
<
div
className=
{
styles
.
upload_img
}
style=
{
{
backgroundImage
:
`url(${item})`
}
}
/>
</
div
>
))
}
<
UploadImage
imgUrl=
{
""
}
large=
{
true
}
fileMaxSize=
{
1024
}
size=
"600x400"
onChange=
{
(
url
)
=>
handleAddworkshopPics
(
url
)
}
/>
</
div
>
</
div
>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"honorPics"
label=
{
<
RequireItem
label=
"资质荣誉"
brief=
{
<
Tooltip
placement=
"top"
title=
"如商标注册证书、品牌授权证书等证明材料"
><
QuestionCircleOutlined
/></
Tooltip
>
}
/>
}
>
<
div
className=
{
styles
.
form_item_wrap
}
>
<
div
className=
{
styles
.
img_list
}
>
{
honorPics
.
map
((
item
,
index
)
=>
(
<
div
key=
{
index
}
className=
{
cx
(
styles
.
upload_btn
,
styles
.
large
,
styles
.
upload
)
}
>
<
div
className=
{
styles
.
delete_btn
}
onClick=
{
()
=>
handleDeleteHonorPicsItem
(
item
)
}
><
DeleteOutlined
/></
div
>
<
img
className=
{
styles
.
upload_img
}
src=
{
item
}
/>
</
div
>
))
}
<
UploadImage
imgUrl=
{
""
}
large=
{
true
}
fileMaxSize=
{
1024
}
size=
"106x107"
onChange=
{
(
url
)
=>
handleAddhonorPics
(
url
)
}
/>
</
div
>
</
div
>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"albumName"
label=
{
<
RequireItem
label=
"宣传画册"
/>
}
className=
{
styles
.
revise_style
}
>
<
div
className=
{
styles
.
upload_data
}
>
{
Object
.
keys
(
file
).
length
>
0
&&
(
<
div
className=
{
styles
.
upload_item
}
>
<
div
className=
{
styles
.
upload_left
}
>
<
LinkOutlined
style=
{
{
marginRight
:
'5px'
}
}
/>
<
Typography
.
Link
href=
{
`/api/contract/contractTemplate/downloadContract?contractName=${file.albumName}&contractUrl=${file.albumURL}`
}
target=
"_blank"
>
{
file
.
albumName
}
</
Typography
.
Link
>
</
div
>
<
div
className=
{
styles
.
upload_right
}
onClick=
{
fileRemove
}
>
<
DeleteOutlined
/>
</
div
>
</
div
>
)
}
</
div
>
{
Object
.
keys
(
file
).
length
===
0
&&
(
<
Upload
action=
"/api/file/file/upload"
data=
{
{
fileType
:
UPLOAD_TYPE
}
}
showUploadList=
{
false
}
accept=
'.pdf'
beforeUpload=
{
beforeDocUpload
}
onChange=
{
handleChange
}
>
<
Button
loading=
{
fileLoading
}
icon=
{
<
UploadOutlined
/>
}
>
上传文件
</
Button
>
<
div
style=
{
{
marginTop
:
'8px'
}
}
>
一次上传一个文件,每个附件大小不能超过 50M
</
div
>
</
Upload
>
)
}
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"shopId"
label=
{
<
RequireItem
label=
"门户链接"
/>
}
>
<
Select
allowClear
value=
{
shopId
}
className=
{
styles
.
form_item
}
onChange=
{
handleMallSelectChange
}
>
{
allMallList
.
map
(
item
=>
(
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
>
{
item
.
name
}
</
Select
.
Option
>
))
}
</
Select
>
{
getSelectMallStoreUrl
()
}
</
Form
.
Item
>
</
TabPane
>
<
TabPane
tab=
'SEO'
key=
'2'
forceRender
>
<
Form
.
Item
labelAlign=
"left"
name=
"title"
rules=
{
[{
required
:
true
,
message
:
"请输入标题"
}]
}
label=
{
<
RequireItem
label=
"标题"
isRequire=
{
true
}
brief=
{
<
Tooltip
placement=
"top"
title=
"用于显示在页面title标签的内容,便于搜索引擎抓取"
><
QuestionCircleOutlined
/></
Tooltip
>
}
/>
}
>
<
Input
placeholder=
"最长100个字符,50个汉字"
maxLength=
{
100
}
className=
{
styles
.
form_item
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"description"
rules=
{
[{
required
:
true
,
message
:
"请输入描述"
}]
}
label=
{
<
RequireItem
label=
"描述"
isRequire=
{
true
}
brief=
{
<
Tooltip
placement=
"top"
title=
"用于显示在页面title标签的内容,便于搜索引擎抓取"
><
QuestionCircleOutlined
/></
Tooltip
>
}
/>
}
>
<
Input
.
TextArea
rows=
{
5
}
className=
{
styles
.
form_item
}
placeholder=
"最长200个字符,100个汉字"
maxLength=
{
200
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"keywords"
rules=
{
[{
required
:
true
,
message
:
"请输入关键字"
}]
}
label=
{
<
RequireItem
label=
"关键字"
isRequire=
{
true
}
brief=
{
<
Tooltip
placement=
"top"
title=
"用于显示在页面title标签的内容,便于搜索引擎抓取"
><
QuestionCircleOutlined
/></
Tooltip
>
}
/>
}
>
<
Input
.
TextArea
rows=
{
5
}
className=
{
styles
.
form_item
}
placeholder=
"最长200个字符,100个汉字"
maxLength=
{
200
}
/>
</
Form
.
Item
>
</
TabPane
>
<
TabPane
tab=
'首页轮播图'
key=
'3'
forceRender
>
<
Form
.
Item
labelAlign=
"left"
name=
"slideshowBOList"
label=
{
<
RequireItem
label=
"首页轮播图"
/>
}
>
<
div
>
<
div
className=
{
styles
.
form_item_wrap
}
>
{
slideshowBOList
.
map
((
item
,
index
)
=>
(
<
div
className=
{
cx
(
styles
.
index_pics_list
,
styles
.
form_item
)
}
>
<
div
key=
{
index
}
className=
{
cx
(
styles
.
upload_btn
,
styles
.
large
,
styles
.
upload
)
}
>
<
div
className=
{
styles
.
delete_btn
}
onClick=
{
()
=>
handleDeleteIndexPicsItem
(
item
)
}
><
DeleteOutlined
/></
div
>
<
img
className=
{
styles
.
upload_img
}
src=
{
item
.
imgPath
}
/>
</
div
>
<
div
className=
{
styles
.
jump_link
}
>
<
Typography
.
Text
type=
'secondary'
>
跳转链接:
</
Typography
.
Text
>
<
Input
addonBefore=
{
<
Typography
.
Text
type=
'secondary'
>
http://
</
Typography
.
Text
>
}
onChange=
{
(
value
)
=>
handleInputIndexPicsItem
(
value
,
index
)
}
value=
{
item
.
link
}
placeholder=
'轮播图跳转链接'
/>
</
div
>
</
div
>
))
}
</
div
>
<
UploadImage
imgUrl=
{
""
}
large=
{
true
}
fileMaxSize=
{
1024
}
size=
"xxxxx"
onChange=
{
(
url
)
=>
handleAddIndexPics
(
url
)
}
/>
</
div
>
</
Form
.
Item
>
</
TabPane
>
</
Tabs
>
{
/* <Form.Item
label={<RequireItem label="" />}
>
<Button loading={confirmLoading} type="primary" style={{ marginRight: 16 }} onClick={handleSave}>保存</Button>
</Form.Item> */
}
</
Form
>
</
div
>
</
PageHeaderWrapper
>
)
}
export
default
inject
(
'SiteStore'
)(
LogisticsInfo
)
src/pages/shop/shopInfo/index.tsx
View file @
9cb7b582
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
Form
,
Input
,
Button
,
Tooltip
,
Select
,
message
,
Upload
}
from
'antd'
import
{
Form
,
Input
,
Button
,
Tooltip
,
Select
,
message
,
Upload
,
Typography
}
from
'antd'
import
{
Prompt
}
from
'umi'
import
{
inject
}
from
'mobx-react'
import
{
QuestionCircleOutlined
,
DeleteOutlined
,
CopyOutlined
,
UploadOutlined
,
LinkOutlined
}
from
'@ant-design/icons'
...
...
@@ -98,28 +98,36 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
PublicApi
.
getTemplateWebMemberShopWebFindCurrMemberShop
(
param
).
then
(
res
=>
{
const
data
:
any
=
res
.
data
if
(
res
.
code
===
1000
)
{
setShopInfo
(
data
)
setSelectCityData
(
initMemberShopArea
(
data
.
memberShopAreas
))
setLogo
(
data
.
logo
)
setShopId
(
data
.
shopId
)
setWorkshopPics
(
data
.
workshopPics
||
[])
setHonorPics
(
data
.
honorPics
||
[])
setPromotionPic
(
data
.
promotionPic
||
""
)
if
(
data
.
shopId
&&
data
.
memberId
)
{
setStoreUrl
(
data
.
storeUrl
||
""
)
if
(
data
)
{
setShopInfo
(
data
)
setSelectCityData
(
initMemberShopArea
(
data
.
memberShopAreas
))
setLogo
(
data
.
logo
)
setShopId
(
data
.
shopId
)
setWorkshopPics
(
data
.
workshopPics
||
[])
setHonorPics
(
data
.
honorPics
||
[])
setPromotionPic
(
data
.
promotionPic
||
""
)
if
(
data
.
shopId
&&
data
.
memberId
)
{
setStoreUrl
(
data
.
storeUrl
||
""
)
}
if
(
data
.
albumName
&&
data
.
albumUrl
)
{
setFile
({
albumName
:
data
.
albumName
,
albumUrl
:
data
.
albumUrl
})
}
form
.
setFieldsValue
({
describe
:
data
.
describe
,
customerUrl
:
data
.
customerUrl
,
logo
:
data
.
logo
,
memberShopAreas
:
initMemberShopArea
(
data
.
memberShopAreas
),
workshopPics
:
data
.
workshopPics
||
[],
honorPics
:
data
.
honorPics
||
[],
phone
:
data
.
phone
||
""
,
address
:
data
.
address
||
""
,
lng
:
data
.
lng
||
""
,
lat
:
data
.
lat
||
""
,
})
}
form
.
setFieldsValue
({
describe
:
data
.
describe
,
customerUrl
:
data
.
customerUrl
,
logo
:
data
.
logo
,
memberShopAreas
:
initMemberShopArea
(
data
.
memberShopAreas
),
workshopPics
:
data
.
workshopPics
||
[],
honorPics
:
data
.
honorPics
||
[],
phone
:
data
.
phone
||
""
,
address
:
data
.
address
||
""
,
lng
:
data
.
lng
||
""
,
lat
:
data
.
lat
||
""
,
})
}
})
}
...
...
@@ -251,8 +259,6 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
const
handleMallSelectChange
=
(
mallId
:
number
)
=>
{
setShopId
(
mallId
)
// let selectItem = allMallList.filter(item => item.id === mallId)
setShopId
(
mallId
)
if
(
!
shopInfo
)
{
return
null
}
...
...
@@ -424,8 +430,13 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
{
Object
.
keys
(
file
).
length
>
0
&&
(
<
div
className=
{
styles
.
upload_item
}
>
<
div
className=
{
styles
.
upload_left
}
>
<
LinkOutlined
/>
<
span
>
{
file
.
albumName
}
</
span
>
<
LinkOutlined
style=
{
{
marginRight
:
'5px'
}
}
/>
<
Typography
.
Link
href=
{
`/api/contract/contractTemplate/downloadContract?contractName=${file.albumName}&contractUrl=${file.albumURL}`
}
target=
"_blank"
>
{
file
.
albumName
}
</
Typography
.
Link
>
</
div
>
<
div
className=
{
styles
.
upload_right
}
onClick=
{
fileRemove
}
>
<
DeleteOutlined
/>
...
...
src/pages/shop/shopSeo/add.tsx
View file @
9cb7b582
...
...
@@ -31,9 +31,11 @@ const ShopSeoAdded = () => {
const
fetch
=
(
link
===
'add'
?
PublicApi
.
postTemplateWebSeoWebAdd
:
PublicApi
.
postTemplateWebSeoWebUpdate
);
form
.
validateFields
().
then
((
value
:
any
)
=>
{
const
type
:
number
=
value
.
type
;
const
link
:
string
=
value
.
link
;
const
params
=
{
id
,
...
value
,
link
:
`http://
${
link
}
`
,
doorType
:
DOORTYPE
.
STORE_DOORTYPE
,
name
:
SELECT_NAME
[
type
]
}
...
...
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