Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
65845357
Commit
65845357
authored
Jun 12, 2023
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改接口配置 + 联调企业客户
parent
2e2d1074
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
272 additions
and
153 deletions
+272
-153
env.config.js
config/env.config.js
+19
-2
groupMealRoute.js
config/groupMealRoute.js
+0
-6
SecurityLayout.jsx
src/layouts/SecurityLayout.jsx
+1
-0
CustomerInfo.jsx
src/pages/businessCustomer/components/CustomerInfo.jsx
+68
-45
MealSection.jsx
src/pages/businessCustomer/components/MealSection.jsx
+6
-6
index.jsx
src/pages/businessCustomer/index.jsx
+27
-4
service.js
src/pages/businessCustomer/service.js
+12
-13
index.js
src/pages/businessCustomer/staticData/index.js
+1
-1
bll.js
src/pages/businessGoods/service/bll.js
+44
-14
index.js
src/pages/businessGoods/service/index.js
+32
-31
goods.js
src/pages/businessGoods/staticData/goods.js
+3
-1
takeawayGoods.jsx
src/pages/businessGoods/takeawayGoods.jsx
+59
-30
No files found.
config/env.config.js
View file @
65845357
const
isProduction
=
process
.
env
.
NODE_ENV
===
'
production
'
;
const
isProduction
=
process
.
env
.
NODE_ENV
===
'
production
'
;
const
isPre
=
process
.
env
.
PRE_ENV
===
'
pre
'
;
const
isPre
=
process
.
env
.
PRE_ENV
===
'
pre
'
;
const
environment
=
'
sc
'
;
const
environment
=
'
sc
'
;
// 从tob进入的判断接口前缀
// 从tob进入的判断接口前缀
const
apiPrefix
=
const
getUrlParams
=
name
=>
{
sessionStorage
.
getItem
(
'
role
'
)
===
'
platform
'
?
'
/api/consoles
'
:
'
/api/merchants
'
;
const
regArg
=
new
RegExp
(
`(^|&)
${
name
}
=([^&]*)(&|$)`
);
const
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
regArg
);
if
(
r
!=
null
)
return
decodeURIComponent
(
r
[
2
]);
return
null
;
};
const
isPlatForm
=
+
getUrlParams
(
'
isMaster
'
)
===
1
;
const
apiPrefix
=
isPlatForm
?
'
/api/consoles
'
:
'
/api/merchants
'
;
const
envAPi
=
{
const
envAPi
=
{
api
:
`https://security-
${
environment
}
.liangkebang.net`
,
//'https://security-xyqb.liangkebang.net',
api
:
`https://security-
${
environment
}
.liangkebang.net`
,
//'https://security-xyqb.liangkebang.net',
kdspOpApi
:
`https://sc-merchant-api-
${
environment
}
.liangkebang.net`
,
kdspOpApi
:
`https://sc-merchant-api-
${
environment
}
.liangkebang.net`
,
...
@@ -15,6 +23,10 @@ const envAPi = {
...
@@ -15,6 +23,10 @@ const envAPi = {
opapiHost
:
`https://gw.yxmie.com`
,
opapiHost
:
`https://gw.yxmie.com`
,
wsApi
:
`wss://push-
${
environment
}
.liangkebang.net`
,
wsApi
:
`wss://push-
${
environment
}
.liangkebang.net`
,
msgApi
:
`https://msgapi-
${
environment
}
.liangkebang.net`
,
msgApi
:
`https://msgapi-
${
environment
}
.liangkebang.net`
,
keystoneApi
:
`https://sc-op-api-
${
environment
}
.liangkebang.net`
,
roleApi
:
isPlatForm
?
`https://sc-op-api-
${
environment
}
.liangkebang.net`
:
`https://sc-merchant-api-
${
environment
}
.liangkebang.net`
,
apiPrefix
,
apiPrefix
,
};
};
...
@@ -33,6 +45,8 @@ const prodApi = {
...
@@ -33,6 +45,8 @@ const prodApi = {
querysApi
:
'
https://sc-merchant-api.q-gp.com/admin/merchant/sc-settlement
'
,
querysApi
:
'
https://sc-merchant-api.q-gp.com/admin/merchant/sc-settlement
'
,
wsApi
:
'
wss://push.q-gp.com
'
,
wsApi
:
'
wss://push.q-gp.com
'
,
msgApi
:
'
https://msgapi.q-gp.com
'
,
msgApi
:
'
https://msgapi.q-gp.com
'
,
keystoneApi
:
'
//sc-op-api.q-gp.com
'
,
roleApi
:
isPlatForm
?
'
https://sc-op-api.q-gp.com
'
:
'
https://sc-merchant-api-pre.q-gp.com
'
,
apiPrefix
,
apiPrefix
,
};
};
...
@@ -47,6 +61,8 @@ const preProdApi = {
...
@@ -47,6 +61,8 @@ const preProdApi = {
querysApi
:
'
https://sc-settlement-api.q-gp.com
'
,
querysApi
:
'
https://sc-settlement-api.q-gp.com
'
,
wsApi
:
'
wss://push.q-gp.com
'
,
wsApi
:
'
wss://push.q-gp.com
'
,
msgApi
:
'
https://msgapi.q-gp.com
'
,
msgApi
:
'
https://msgapi.q-gp.com
'
,
keystoneApi
:
'
//sc-op-api-pre.q-gp.com
'
,
roleApi
:
isPlatForm
?
'
https://sc-op-api-pre.q-gp.com
'
:
'
https://sc-merchant-api-pre.q-gp.com
'
,
apiPrefix
,
apiPrefix
,
};
};
...
@@ -57,6 +73,7 @@ if (isPre) {
...
@@ -57,6 +73,7 @@ if (isPre) {
exportApi
=
prodApi
;
exportApi
=
prodApi
;
}
}
module
.
exports
=
exportApi
;
module
.
exports
=
exportApi
;
// let exportApi;
// let exportApi;
// isProduction ? (exportApi = prodApi) : (exportApi = envAPi);
// isProduction ? (exportApi = prodApi) : (exportApi = envAPi);
...
...
config/groupMealRoute.js
View file @
65845357
...
@@ -11,12 +11,6 @@ export default [
...
@@ -11,12 +11,6 @@ export default [
name
:
'
TakeawayGoods
'
,
name
:
'
TakeawayGoods
'
,
component
:
'
./businessGoods/takeawayGoods
'
,
component
:
'
./businessGoods/takeawayGoods
'
,
},
},
{
title
:
'
商户管理后台-企业团餐-外卖商品
'
,
path
:
'
/takeawayGoods
'
,
name
:
'
TakeawayGoods
'
,
component
:
'
./businessGoods/takeawayGoods
'
,
},
{
{
title
:
'
商户管理后台-企业团餐-外卖商品-添加商品
'
,
title
:
'
商户管理后台-企业团餐-外卖商品-添加商品
'
,
path
:
'
/takeawayGoodsInfo
'
,
path
:
'
/takeawayGoodsInfo
'
,
...
...
src/layouts/SecurityLayout.jsx
View file @
65845357
...
@@ -27,6 +27,7 @@ class SecurityLayout extends React.Component {
...
@@ -27,6 +27,7 @@ class SecurityLayout extends React.Component {
/* eslint-disable no-underscore-dangle */
/* eslint-disable no-underscore-dangle */
render
()
{
render
()
{
// 判断是否从tob进入
// 判断是否从tob进入
console
.
log
(
'
getUrlSearchParams -- 1 :>>
'
,
1111
);
const
searchPrams
=
getUrlSearchParams
();
const
searchPrams
=
getUrlSearchParams
();
const
isTob
=
searchPrams
.
source
===
'
tob
'
;
const
isTob
=
searchPrams
.
source
===
'
tob
'
;
if
(
isTob
)
{
if
(
isTob
)
{
...
...
src/pages/businessCustomer/components/CustomerInfo.jsx
View file @
65845357
...
@@ -46,6 +46,7 @@ const CustomerInfo = props => {
...
@@ -46,6 +46,7 @@ const CustomerInfo = props => {
// 关闭分组信息弹窗
// 关闭分组信息弹窗
const
handleCancel
=
()
=>
{
const
handleCancel
=
()
=>
{
props
.
reFresh
();
props
.
handleClose
(
false
);
props
.
handleClose
(
false
);
};
};
...
@@ -120,13 +121,17 @@ const CustomerInfo = props => {
...
@@ -120,13 +121,17 @@ const CustomerInfo = props => {
});
});
params
.
mealLimit
=
limits
;
params
.
mealLimit
=
limits
;
console
.
log
(
'
params :>>
'
,
params
);
console
.
log
(
'
params :>>
'
,
params
);
// let api = apiNewEnterprise;
let
api
=
apiNewEnterprise
;
// if (props.id) {
if
(
props
.
id
)
{
// params.id = props.id;
params
.
id
=
props
.
id
;
// api = apiEditEnterprise;
api
=
apiEditEnterprise
;
// }
}
// await api(params);
const
resp
=
await
api
(
params
);
notification
.
success
({
message
:
'
保存成功!
'
});
if
(
resp
)
{
handleCancel
();
props
.
reFresh
();
notification
.
success
({
message
:
'
保存成功!
'
});
}
};
};
// 风险提示
// 风险提示
...
@@ -179,62 +184,70 @@ const CustomerInfo = props => {
...
@@ -179,62 +184,70 @@ const CustomerInfo = props => {
};
};
// 改变餐段
// 改变餐段
const
onChangeMealSection
=
e
=>
{
const
onChangeMealSection
=
e
=>
{
console
.
log
(
'
e.target :>>
'
,
e
.
target
);
const
{
id
,
checked
,
label
}
=
e
.
target
;
const
{
id
,
checked
,
label
}
=
e
.
target
;
const
values
=
Object
.
assign
({},
meals
);
const
values
=
Object
.
assign
({},
meals
);
if
(
checked
)
{
if
(
checked
)
{
values
[
id
]
=
label
;
values
[
id
]
=
label
;
// values.push(value);
// } else if (values.includes(value)) {
// const index = values.findIndex(v => v === value);
// values.splice(index, 1);
}
else
{
}
else
{
delete
values
[
id
];
delete
values
[
id
];
}
}
console
.
log
(
'
values :>>
'
,
values
);
setMeals
(
values
);
setMeals
(
values
);
};
};
// 获取企业客户信息
// 获取企业客户信息
const
getInfo
=
async
()
=>
{
const
getInfo
=
async
()
=>
{
const
res
=
await
apiEnterpriseInfo
(
props
.
id
);
const
res
=
await
apiEnterpriseInfo
(
props
.
id
);
const
obj
=
Object
.
assign
({},
res
);
if
(
res
&&
res
.
data
)
{
if
(
res
.
mealTimePeriod
&&
res
.
mealTimePeriod
.
length
)
{
const
obj
=
Object
.
assign
({},
res
.
data
);
obj
.
mealTimePeriod
=
res
.
mealTimePeriod
.
map
(
item
=>
({
if
(
res
.
data
.
mealTimePeriod
&&
res
.
data
.
mealTimePeriod
.
length
)
{
mealPeriodType
:
`
${
item
.
mealPeriodType
}
`
,
const
m
=
moment
().
format
(
'
YYYY-MM-DD
'
);
time
:
[
moment
(
item
.
beginTime
),
moment
(
item
.
endTime
)],
obj
.
mealTimePeriod
=
res
.
data
.
mealTimePeriod
.
map
(
item
=>
({
}));
mealPeriodType
:
`
${
item
.
mealPeriodType
}
`
,
}
else
{
time
:
[
moment
(
`
${
m
}
${
item
.
beginTime
}
`
),
moment
(
`
${
m
}
${
item
.
endTime
}
`
)],
obj
.
mealTimePeriod
=
[];
}));
}
}
else
{
if
(
res
.
mealLimit
)
{
obj
.
mealTimePeriod
=
[];
}
obj
.
mealLimit
=
{};
obj
.
mealLimit
=
{};
res
.
mealLimit
.
forEach
(
item
=>
{
if
(
res
.
data
.
mealLimit
)
{
obj
.
mealLimit
[
`limit
${
item
.
mealPeriodType
}
`
]
=
{};
res
.
data
.
mealLimit
.
forEach
(
item
=>
{
item
.
limit
.
forEach
(
limit
=>
{
obj
.
mealLimit
[
`limit
${
item
.
mealPeriodType
}
`
]
=
{};
obj
.
mealLimit
[
`limit
${
item
.
mealPeriodType
}
`
][
limit
.
mealType
]
=
limit
.
limit
;
item
.
limit
.
forEach
(
limit
=>
{
obj
.
mealLimit
[
`limit
${
item
.
mealPeriodType
}
`
][
limit
.
mealType
]
=
limit
.
limit
;
});
});
});
}
obj
.
hideInfo
=
[];
if
(
+
res
.
data
.
hidePrice
)
{
obj
.
hideInfo
.
push
(
'
hidePrice
'
);
}
if
(
+
res
.
data
.
hideImage
)
{
obj
.
hideInfo
.
push
(
'
hideImage
'
);
}
obj
.
mealType
=
res
.
data
.
mealType
.
map
(
item
=>
`
${
item
}
`
);
console
.
log
(
'
obj :>>
'
,
obj
);
setMealTypes
(
obj
.
mealType
);
const
json
=
{};
res
.
data
.
mealTimePeriod
.
forEach
(
item
=>
{
json
[
item
.
mealPeriodType
]
=
mealSections
[
item
.
mealPeriodType
];
});
});
setMeals
(
json
);
form
.
setFieldsValue
(
obj
);
}
}
obj
.
hideInfo
=
[];
if
(
+
res
.
hidePrice
)
{
obj
.
hideInfo
.
push
(
'
hidePrice
'
);
}
if
(
+
res
.
hideImage
)
{
obj
.
hideInfo
.
push
(
'
hideImage
'
);
}
obj
.
mealType
=
res
.
mealType
.
map
(
item
=>
`
${
item
}
`
);
form
.
setFieldsValue
(
obj
);
};
};
// 获取自提点列表
// 获取自提点列表
const
getPickSelf
=
async
()
=>
{
const
getPickSelf
=
async
()
=>
{
const
res
=
await
apiEnterprisePickSelf
({});
const
res
=
await
apiEnterprisePickSelf
({});
setPickSelfList
(
if
(
res
&&
res
.
data
&&
res
.
data
.
records
)
{
res
.
map
(
item
=>
({
const
data
=
res
.
data
.
records
;
[
item
.
id
]:
{
text
:
item
.
name
},
setPickSelfList
(
})),
data
.
map
(
item
=>
({
);
value
:
item
.
id
,
label
:
item
.
pickselfName
,
})),
);
}
};
};
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -242,9 +255,14 @@ const CustomerInfo = props => {
...
@@ -242,9 +255,14 @@ const CustomerInfo = props => {
if
(
props
.
id
)
{
if
(
props
.
id
)
{
getInfo
();
getInfo
();
}
else
{
}
else
{
setMealTypes
([]);
setMeals
({});
form
.
resetFields
();
getPickSelf
();
getPickSelf
();
}
}
}
else
{
}
else
{
setMealTypes
([]);
setMeals
({});
form
.
setFieldsValue
({});
form
.
setFieldsValue
({});
}
}
},
[
props
.
visible
]);
},
[
props
.
visible
]);
...
@@ -274,7 +292,14 @@ const CustomerInfo = props => {
...
@@ -274,7 +292,14 @@ const CustomerInfo = props => {
</
Form
.
Item
>
</
Form
.
Item
>
{
!
props
.
id
&&
(
{
!
props
.
id
&&
(
<
Form
.
Item
label=
"企业取餐点"
name=
"pickselfIds"
>
<
Form
.
Item
label=
"企业取餐点"
name=
"pickselfIds"
>
<
Select
options=
{
pickSelfList
}
/>
<
Select
options=
{
pickSelfList
}
mode=
"multiple"
showSearch
filterOption=
{
(
v
,
option
)
=>
(
option
?.
label
??
''
).
toLowerCase
().
includes
(
v
.
toLowerCase
())
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
)
}
)
}
<
Form
.
Item
<
Form
.
Item
...
@@ -284,9 +309,7 @@ const CustomerInfo = props => {
...
@@ -284,9 +309,7 @@ const CustomerInfo = props => {
rules=
{
[{
required
:
true
,
message
:
'
请输入企业截止时间!
'
}]
}
rules=
{
[{
required
:
true
,
message
:
'
请输入企业截止时间!
'
}]
}
extra=
{
<
span
>
企业员工下单的截至时间,仅支持正整数,单位为分钟。
</
span
>
}
extra=
{
<
span
>
企业员工下单的截至时间,仅支持正整数,单位为分钟。
</
span
>
}
>
>
<
Row
>
<
InputNumber
min=
{
0
}
max=
{
600
}
addonAfter=
"分钟"
/>
<
InputNumber
min=
{
0
}
max=
{
600
}
addonAfter=
"分钟"
/>
</
Row
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
label=
"餐品类型"
label=
"餐品类型"
...
...
src/pages/businessCustomer/components/MealSection.jsx
View file @
65845357
...
@@ -9,16 +9,16 @@ const MealSection = props => (
...
@@ -9,16 +9,16 @@ const MealSection = props => (
<>
<>
{
Object
.
keys
(
mealSections
).
map
((
field
,
i
)
=>
(
{
Object
.
keys
(
mealSections
).
map
((
field
,
i
)
=>
(
<
Space
key=
{
field
}
align=
"baseline"
>
<
Space
key=
{
field
}
align=
"baseline"
>
<
Form
.
Item
label=
""
name=
{
[
fields
[
i
].
name
,
'
mealPeriodType
'
]
}
>
<
Form
.
Item
label=
""
name=
{
[
i
,
'
mealPeriodType
'
]
}
>
<
MealCheckbox
changeType=
{
props
.
onChange
}
meals=
{
props
.
meals
}
field=
{
field
}
/>
<
MealCheckbox
changeType=
{
props
.
onChange
}
meals=
{
props
.
meals
}
field=
{
field
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
name=
{
[
fields
[
i
].
name
,
'
time
'
]
}
name=
{
[
i
,
'
time
'
]
}
rules=
{
[
rules=
{
props
.
meals
[
field
]
?
{
type
:
'
array
'
,
required
:
true
,
message
:
'
请选择!
'
}
:
{},
props
.
meals
[
field
]
?
[{
type
:
'
array
'
,
required
:
true
,
message
:
'
请选择!
'
}]
:
[]
]
}
}
>
>
<
TimePicker
.
RangePicker
format=
"HH:mm"
/>
<
TimePicker
.
RangePicker
format=
"HH:mm"
minuteStep=
{
30
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
</
Space
>
</
Space
>
))
}
))
}
...
...
src/pages/businessCustomer/index.jsx
View file @
65845357
...
@@ -7,20 +7,30 @@ import CustomerInfo from './components/CustomerInfo';
...
@@ -7,20 +7,30 @@ import CustomerInfo from './components/CustomerInfo';
import
{
apiEnterpriseList
}
from
'
./service
'
;
import
{
apiEnterpriseList
}
from
'
./service
'
;
const
BusinessCustomer
=
()
=>
{
const
BusinessCustomer
=
()
=>
{
const
refTable
=
useRef
();
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
id
,
setId
]
=
useState
(
''
);
const
query
=
async
params
=>
{
const
query
=
async
params
=>
{
const
data
=
{
const
data
=
{
page
:
params
.
current
,
page
:
params
.
current
,
size
:
params
.
pageSize
,
size
:
params
.
pageSize
,
data
:
params
,
data
:
params
,
};
};
return
apiEnterpriseList
(
data
);
const
res
=
await
apiEnterpriseList
(
data
);
return
{
data
:
res
.
data
.
records
,
total
:
res
.
data
.
total
,
};
};
const
onEdit
=
v
=>
{
setId
(
v
);
setVisible
(
true
);
};
};
const
onEdit
=
async
()
=>
{};
return
(
return
(
<
div
>
<
div
>
<
ProTable
<
ProTable
actionRef=
{
refTable
}
search=
{
{
search=
{
{
collapsed
:
false
,
collapsed
:
false
,
collapseRender
:
()
=>
null
,
collapseRender
:
()
=>
null
,
...
@@ -32,13 +42,26 @@ const BusinessCustomer = () => {
...
@@ -32,13 +42,26 @@ const BusinessCustomer = () => {
bordered
bordered
options=
{
false
}
options=
{
false
}
toolBarRender=
{
()
=>
[
toolBarRender=
{
()
=>
[
<
Button
key=
"3"
icon=
{
<
PlusOutlined
/>
}
type=
"primary"
onClick=
{
()
=>
setVisible
(
!
0
)
}
>
<
Button
key=
"3"
icon=
{
<
PlusOutlined
/>
}
type=
"primary"
onClick=
{
()
=>
{
setId
(
''
);
setVisible
(
!
0
);
}
}
>
添加企业客户
添加企业客户
</
Button
>,
</
Button
>,
]
}
]
}
scroll=
{
{
x
:
'
100%
'
,
y
:
400
}
}
scroll=
{
{
x
:
'
100%
'
,
y
:
400
}
}
/>
/>
<
CustomerInfo
visible=
{
visible
}
handleClose=
{
setVisible
}
/>
<
CustomerInfo
visible=
{
visible
}
id=
{
id
}
reFresh=
{
()
=>
refTable
.
current
.
reload
()
}
handleClose=
{
setVisible
}
/>
</
div
>
</
div
>
);
);
};
};
...
...
src/pages/businessCustomer/service.js
View file @
65845357
...
@@ -3,16 +3,16 @@ import config from '@/../config/env.config';
...
@@ -3,16 +3,16 @@ import config from '@/../config/env.config';
// import qs from 'qs';
// import qs from 'qs';
const
{
kdspApi
,
goodsApi
}
=
config
;
const
{
roleApi
,
apiPrefix
}
=
config
;
/**
/**
* 获取企业客户列表
* 获取企业客户列表
* http://yapi.quantgroups.com/project/389/interface/api/65324
* http://yapi.quantgroups.com/project/389/interface/api/65324
*/
*/
export
async
function
apiEnterpriseList
(
data
)
{
export
async
function
apiEnterpriseList
(
data
)
{
return
request
.
post
(
'
/api/consoles/enterprise/pageList
'
,
{
return
request
.
post
(
`
${
apiPrefix
}
/enterprise/pageList`
,
{
data
,
data
,
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
}
}
/**
/**
...
@@ -20,8 +20,8 @@ export async function apiEnterpriseList(data) {
...
@@ -20,8 +20,8 @@ export async function apiEnterpriseList(data) {
* http://yapi.quantgroups.com/project/389/interface/api/65339
* http://yapi.quantgroups.com/project/389/interface/api/65339
*/
*/
export
async
function
apiEnterpriseInfo
(
id
)
{
export
async
function
apiEnterpriseInfo
(
id
)
{
return
request
.
get
(
`
/api/consoles
/enterprise/info?id=
${
id
}
`
,
{
return
request
.
get
(
`
${
apiPrefix
}
/enterprise/info?id=
${
id
}
`
,
{
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
}
}
/**
/**
...
@@ -29,9 +29,9 @@ export async function apiEnterpriseInfo(id) {
...
@@ -29,9 +29,9 @@ export async function apiEnterpriseInfo(id) {
* http://yapi.quantgroups.com/project/389/interface/api/65329
* http://yapi.quantgroups.com/project/389/interface/api/65329
*/
*/
export
async
function
apiNewEnterprise
(
data
)
{
export
async
function
apiNewEnterprise
(
data
)
{
return
request
.
post
(
'
/api/consoles/enterprise/save
'
,
{
return
request
.
post
(
`
${
apiPrefix
}
/enterprise/save`
,
{
data
,
data
,
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
}
}
/**
/**
...
@@ -39,9 +39,9 @@ export async function apiNewEnterprise(data) {
...
@@ -39,9 +39,9 @@ export async function apiNewEnterprise(data) {
* http://yapi.quantgroups.com/project/389/interface/api/65334
* http://yapi.quantgroups.com/project/389/interface/api/65334
*/
*/
export
async
function
apiEditEnterprise
(
data
)
{
export
async
function
apiEditEnterprise
(
data
)
{
return
request
.
post
(
'
/api/consoles/enterprise/update
'
,
{
return
request
.
post
(
`
${
apiPrefix
}
/enterprise/update`
,
{
data
,
data
,
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
}
}
...
@@ -49,9 +49,8 @@ export async function apiEditEnterprise(data) {
...
@@ -49,9 +49,8 @@ export async function apiEditEnterprise(data) {
* 查询自提点列表
* 查询自提点列表
* http://yapi.quantgroups.com/project/389/interface/api/65494
* http://yapi.quantgroups.com/project/389/interface/api/65494
*/
*/
export
async
function
apiEnterprisePickSelf
(
data
)
{
export
async
function
apiEnterprisePickSelf
()
{
return
request
.
post
(
'
/api/consoles/selfPickUpLocation/list
'
,
{
return
request
.
get
(
`
${
apiPrefix
}
/selfPickUpLocation/list`
,
{
data
,
prefix
:
roleApi
,
prefix
:
goodsApi
,
});
});
}
}
src/pages/businessCustomer/staticData/index.js
View file @
65845357
...
@@ -111,7 +111,7 @@ export const customerColumn = options => {
...
@@ -111,7 +111,7 @@ export const customerColumn = options => {
align
:
'
center
'
,
align
:
'
center
'
,
fixed
:
'
right
'
,
fixed
:
'
right
'
,
render
:
(
val
,
r
)
=>
(
render
:
(
val
,
r
)
=>
(
<
Button
key
=
"
edit
"
onClick
=
{()
=>
onEdit
(
r
,
'
edit
'
)}
>
<
Button
key
=
"
edit
"
onClick
=
{()
=>
onEdit
(
r
.
id
)}
>
编辑
编辑
<
/Button
>
<
/Button
>
),
),
...
...
src/pages/businessGoods/service/bll.js
View file @
65845357
...
@@ -2,34 +2,64 @@ import debounce from 'lodash/debounce';
...
@@ -2,34 +2,64 @@ import debounce from 'lodash/debounce';
import
{
apiEnterpriseList
,
apiShopList
,
apiShopListByPickSelfID
}
from
'
./index
'
;
import
{
apiEnterpriseList
,
apiShopList
,
apiShopListByPickSelfID
}
from
'
./index
'
;
// 获取企业列表
// 获取企业列表
export
const
getEnterpriseList
=
async
(
name
=
''
)
=>
{
export
const
getEnterpriseList
=
async
()
=>
{
const
res
=
await
apiEnterpriseList
({
name
});
const
res
=
await
apiEnterpriseList
({
page
:
1
,
size
:
10000
,
});
if
(
res
&&
res
.
data
&&
res
.
data
.
records
)
{
const
data
=
res
.
data
.
records
;
const
json
=
{};
data
.
forEach
(
item
=>
{
json
[
item
.
id
]
=
{
text
:
item
.
name
};
});
return
{
id
:
data
[
data
.
length
-
1
].
id
,
list
:
json
,
};
}
return
{
return
{
id
:
res
[
res
.
length
-
1
].
id
,
id
:
''
,
list
:
res
.
map
(
item
=>
({
list
:
{},
[
item
.
id
]:
{
text
:
item
.
name
},
})),
};
};
};
};
// 获取店铺列表
// 获取店铺列表
export
const
getShopList
=
debounce
(
async
e
=>
{
export
const
getShopList
=
debounce
(
async
e
=>
{
const
{
name
}
=
e
;
const
{
name
}
=
e
;
const
res
=
await
apiShopList
({
name
});
const
res
=
await
apiShopList
({
name
});
if
(
res
&&
res
.
data
&&
res
.
data
.
records
)
{
const
data
=
res
.
data
.
records
;
const
json
=
{};
data
.
forEach
(
item
=>
{
json
[
item
.
id
]
=
{
text
:
item
.
name
};
});
return
{
id
:
res
[
res
.
length
-
1
].
id
,
list
:
json
,
};
}
return
{
return
{
id
:
res
[
res
.
length
-
1
].
id
,
id
:
''
,
list
:
res
.
map
(
item
=>
({
list
:
{},
[
item
.
id
]:
{
text
:
item
.
name
},
})),
};
};
},
300
);
},
300
);
// 获取店铺列表通过自提点ID
// 获取店铺列表通过自提点ID
export
const
getShopListByPickSelf
=
async
e
=>
{
export
const
getShopListByPickSelf
=
async
e
=>
{
const
{
name
}
=
e
;
const
{
name
}
=
e
;
const
res
=
await
apiShopListByPickSelfID
({
name
});
const
res
=
await
apiShopListByPickSelfID
({
name
});
if
(
res
&&
res
.
data
&&
res
.
data
.
records
)
{
const
data
=
res
.
data
.
records
;
const
json
=
{};
data
.
forEach
(
item
=>
{
json
[
item
.
id
]
=
{
text
:
item
.
name
};
});
return
{
id
:
res
[
res
.
length
-
1
].
id
,
list
:
json
,
};
}
return
{
return
{
id
:
res
[
res
.
length
-
1
].
id
,
id
:
''
,
list
:
res
.
map
(
item
=>
({
list
:
{},
[
item
.
id
]:
{
text
:
item
.
name
},
})),
};
};
};
};
src/pages/businessGoods/service/index.js
View file @
65845357
import
request
from
'
@/utils/request
'
;
import
request
from
'
@/utils/request
'
;
import
config
from
'
@/../config/env.config
'
;
import
config
from
'
@/../config/env.config
'
;
const
{
kdspApi
,
goods
Api
,
apiPrefix
}
=
config
;
const
{
role
Api
,
apiPrefix
}
=
config
;
/**
/**
* 获取企业外卖商品列表
* 获取企业外卖商品列表
* http://yapi.quantgroups.com/project/389/interface/api/64794
* http://yapi.quantgroups.com/project/389/interface/api/64794
*/
*/
export
async
function
apiTakeawayList
(
param
)
{
export
async
function
apiTakeawayList
(
param
)
{
return
request
.
post
(
`
${
apiPrefix
}
/product/enterprise/main/pageList`
,
{
const
res
=
await
request
.
post
(
`
${
apiPrefix
}
/product/enterprise/main/pageList`
,
{
data
:
param
,
data
:
param
,
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
return
res
.
data
;
}
}
/**
/**
* 获取企业虚拟商品列表
* 获取企业虚拟商品列表
* http://yapi.quantgroups.com/project/389/interface/api/64794
* http://yapi.quantgroups.com/project/389/interface/api/64794
*/
*/
export
async
function
apiVirtualList
(
param
)
{
export
async
function
apiVirtualList
(
param
)
{
return
request
.
post
(
'
/api/consoles/product/enterprise/virtual/pageList
'
,
{
return
request
.
post
(
`
${
apiPrefix
}
/product/enterprise/virtual/pageList`
,
{
data
:
param
,
data
:
param
,
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
}
}
/**
/**
...
@@ -27,9 +28,9 @@ export async function apiVirtualList(param) {
...
@@ -27,9 +28,9 @@ export async function apiVirtualList(param) {
* http://yapi.quantgroups.com/project/389/interface/api/65324
* http://yapi.quantgroups.com/project/389/interface/api/65324
*/
*/
export
async
function
apiEnterpriseList
(
param
)
{
export
async
function
apiEnterpriseList
(
param
)
{
return
request
.
post
(
'
/api/consoles/enterprise/pageList
'
,
{
return
request
.
post
(
`
${
apiPrefix
}
/enterprise/pageList`
,
{
data
:
param
,
data
:
param
,
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
}
}
/**
/**
...
@@ -37,9 +38,9 @@ export async function apiEnterpriseList(param) {
...
@@ -37,9 +38,9 @@ export async function apiEnterpriseList(param) {
* http://yapi.quantgroups.com/project/389/interface/api/65289
* http://yapi.quantgroups.com/project/389/interface/api/65289
*/
*/
export
async
function
apiShopList
(
param
)
{
export
async
function
apiShopList
(
param
)
{
return
request
.
post
(
'
/api/consoles/shops/getListByName
'
,
{
return
request
.
post
(
`
${
apiPrefix
}
/shops/getListByName`
,
{
data
:
param
,
data
:
param
,
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
}
}
/**
/**
...
@@ -47,9 +48,9 @@ export async function apiShopList(param) {
...
@@ -47,9 +48,9 @@ export async function apiShopList(param) {
* http://yapi.quantgroups.com/project/389/interface/api/65444
* http://yapi.quantgroups.com/project/389/interface/api/65444
*/
*/
export
async
function
apiMealTimePeriod
(
param
)
{
export
async
function
apiMealTimePeriod
(
param
)
{
return
request
.
post
(
'
/api/consoles/product/enterprise/getMealTimePeriod
'
,
{
return
request
.
post
(
`
${
apiPrefix
}
/product/enterprise/getMealTimePeriod`
,
{
data
:
param
,
data
:
param
,
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
}
}
/**
/**
...
@@ -57,9 +58,9 @@ export async function apiMealTimePeriod(param) {
...
@@ -57,9 +58,9 @@ export async function apiMealTimePeriod(param) {
* http://yapi.quantgroups.com/project/389/interface/api/65099
* http://yapi.quantgroups.com/project/389/interface/api/65099
*/
*/
export
async
function
apiMealInfoUpdate
(
param
)
{
export
async
function
apiMealInfoUpdate
(
param
)
{
return
request
.
post
(
'
/api/consoles/product/enterprise/main/update
'
,
{
return
request
.
post
(
`
${
apiPrefix
}
/product/enterprise/main/update`
,
{
data
:
param
,
data
:
param
,
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
}
}
/**
/**
...
@@ -67,9 +68,9 @@ export async function apiMealInfoUpdate(param) {
...
@@ -67,9 +68,9 @@ export async function apiMealInfoUpdate(param) {
* http://yapi.quantgroups.com/project/389/interface/api/65109
* http://yapi.quantgroups.com/project/389/interface/api/65109
*/
*/
export
async
function
apiMealInfoDel
(
param
)
{
export
async
function
apiMealInfoDel
(
param
)
{
return
request
.
post
(
'
/api/consoles/product/enterprise/main/deleteById
'
,
{
return
request
.
post
(
`
${
apiPrefix
}
/product/enterprise/main/deleteById`
,
{
data
:
param
,
data
:
param
,
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
}
}
/**
/**
...
@@ -77,8 +78,8 @@ export async function apiMealInfoDel(param) {
...
@@ -77,8 +78,8 @@ export async function apiMealInfoDel(param) {
* http://yapi.quantgroups.com/project/389/interface/api/65494
* http://yapi.quantgroups.com/project/389/interface/api/65494
*/
*/
export
async
function
apiPickSelfList
()
{
export
async
function
apiPickSelfList
()
{
return
request
.
get
(
'
/api/consoles/selfPickUpLocation/list
'
,
{
return
request
.
get
(
`
${
apiPrefix
}
/selfPickUpLocation/list`
,
{
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
}
}
/**
/**
...
@@ -86,9 +87,9 @@ export async function apiPickSelfList() {
...
@@ -86,9 +87,9 @@ export async function apiPickSelfList() {
* http://yapi.quantgroups.com/project/389/interface/api/65449
* http://yapi.quantgroups.com/project/389/interface/api/65449
*/
*/
export
async
function
apiSelPickSelfList
(
param
)
{
export
async
function
apiSelPickSelfList
(
param
)
{
return
request
.
post
(
'
/api/consoles/product/enterprise/queryByEnterpriseId
'
,
{
return
request
.
post
(
`
${
apiPrefix
}
/product/enterprise/queryByEnterpriseId`
,
{
data
:
param
,
data
:
param
,
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
}
}
/**
/**
...
@@ -96,9 +97,9 @@ export async function apiSelPickSelfList(param) {
...
@@ -96,9 +97,9 @@ export async function apiSelPickSelfList(param) {
* http://yapi.quantgroups.com/project/389/interface/api/65479
* http://yapi.quantgroups.com/project/389/interface/api/65479
*/
*/
export
async
function
apiSelGoodsList
(
param
)
{
export
async
function
apiSelGoodsList
(
param
)
{
return
request
.
post
(
'
/api/consoles/product/enterprise/sku/page
'
,
{
return
request
.
post
(
`
${
apiPrefix
}
/product/enterprise/sku/page`
,
{
data
:
param
,
data
:
param
,
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
}
}
/**
/**
...
@@ -106,9 +107,9 @@ export async function apiSelGoodsList(param) {
...
@@ -106,9 +107,9 @@ export async function apiSelGoodsList(param) {
* http://yapi.quantgroups.com/project/389/interface/api/65479
* http://yapi.quantgroups.com/project/389/interface/api/65479
*/
*/
export
async
function
apiSelVirtualGoodsList
(
param
)
{
export
async
function
apiSelVirtualGoodsList
(
param
)
{
return
request
.
post
(
'
/api/consoles/product/enterprise/virtual/sku/page
'
,
{
return
request
.
post
(
`
${
apiPrefix
}
/product/enterprise/virtual/sku/page`
,
{
data
:
param
,
data
:
param
,
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
}
}
/**
/**
...
@@ -116,9 +117,9 @@ export async function apiSelVirtualGoodsList(param) {
...
@@ -116,9 +117,9 @@ export async function apiSelVirtualGoodsList(param) {
* http://yapi.quantgroups.com/project/389/interface/api/65094
* http://yapi.quantgroups.com/project/389/interface/api/65094
*/
*/
export
async
function
apiSaveGoodsList
(
param
)
{
export
async
function
apiSaveGoodsList
(
param
)
{
return
request
.
post
(
'
/api/consoles/product/enterprise/add
'
,
{
return
request
.
post
(
`
${
apiPrefix
}
/product/enterprise/add`
,
{
data
:
param
,
data
:
param
,
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
}
}
/**
/**
...
@@ -126,9 +127,9 @@ export async function apiSaveGoodsList(param) {
...
@@ -126,9 +127,9 @@ export async function apiSaveGoodsList(param) {
* http://yapi.quantgroups.com/project/389/interface/api/65484
* http://yapi.quantgroups.com/project/389/interface/api/65484
*/
*/
export
async
function
apiSaveVirtualGoodsList
(
param
)
{
export
async
function
apiSaveVirtualGoodsList
(
param
)
{
return
request
.
post
(
'
/api/consoles/products/enterprise/virtual/add
'
,
{
return
request
.
post
(
`
${
apiPrefix
}
/products/enterprise/virtual/add`
,
{
data
:
param
,
data
:
param
,
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
}
}
/**
/**
...
@@ -136,9 +137,9 @@ export async function apiSaveVirtualGoodsList(param) {
...
@@ -136,9 +137,9 @@ export async function apiSaveVirtualGoodsList(param) {
* http://yapi.quantgroups.com/project/389/interface/api/65504
* http://yapi.quantgroups.com/project/389/interface/api/65504
*/
*/
export
async
function
apiShopListByEnterpriseID
(
param
)
{
export
async
function
apiShopListByEnterpriseID
(
param
)
{
return
request
.
post
(
'
/api/consoles/product/enterprise/virtual/shops
'
,
{
return
request
.
post
(
`
${
apiPrefix
}
/product/enterprise/virtual/shops`
,
{
data
:
param
,
data
:
param
,
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
}
}
/**
/**
...
@@ -146,8 +147,8 @@ export async function apiShopListByEnterpriseID(param) {
...
@@ -146,8 +147,8 @@ export async function apiShopListByEnterpriseID(param) {
* http://yapi.quantgroups.com/project/389/interface/api/65539
* http://yapi.quantgroups.com/project/389/interface/api/65539
*/
*/
export
async
function
apiShopListByPickSelfID
(
param
)
{
export
async
function
apiShopListByPickSelfID
(
param
)
{
return
request
.
post
(
'
/api/consoles/product/enterprise/queryByEnterpriseIdAndPickSelfId
'
,
{
return
request
.
post
(
`
${
apiPrefix
}
/product/enterprise/queryByEnterpriseIdAndPickSelfId`
,
{
data
:
param
,
data
:
param
,
prefix
:
goods
Api
,
prefix
:
role
Api
,
});
});
}
}
src/pages/businessGoods/staticData/goods.js
View file @
65845357
...
@@ -48,6 +48,7 @@ export const takeawayGoodsColumn = options => {
...
@@ -48,6 +48,7 @@ export const takeawayGoodsColumn = options => {
setVisiblePrice
,
setVisiblePrice
,
setVisibleSaleSection
,
setVisibleSaleSection
,
setVisibleSort
,
setVisibleSort
,
onChangeEnterprise
,
}
=
options
;
}
=
options
;
return
[
return
[
{
{
...
@@ -57,6 +58,7 @@ export const takeawayGoodsColumn = options => {
...
@@ -57,6 +58,7 @@ export const takeawayGoodsColumn = options => {
fieldProps
:
{
fieldProps
:
{
showSearch
:
true
,
showSearch
:
true
,
filterOption
:
(
v
,
option
)
=>
(
option
?.
label
??
''
).
toLowerCase
().
includes
(
v
.
toLowerCase
()),
filterOption
:
(
v
,
option
)
=>
(
option
?.
label
??
''
).
toLowerCase
().
includes
(
v
.
toLowerCase
()),
onChange
:
onChangeEnterprise
,
},
},
valueEnum
:
enterprises
,
// companyEnum,
valueEnum
:
enterprises
,
// companyEnum,
},
},
...
@@ -67,7 +69,7 @@ export const takeawayGoodsColumn = options => {
...
@@ -67,7 +69,7 @@ export const takeawayGoodsColumn = options => {
fieldProps
:
{
fieldProps
:
{
showSearch
:
true
,
showSearch
:
true
,
},
},
request
:
getShopList
,
//
request: getShopList,
// valueEnum: {}, // shopEnum,
// valueEnum: {}, // shopEnum,
},
},
{
{
...
...
src/pages/businessGoods/takeawayGoods.jsx
View file @
65845357
...
@@ -6,7 +6,7 @@ import { PlusOutlined } from '@ant-design/icons';
...
@@ -6,7 +6,7 @@ import { PlusOutlined } from '@ant-design/icons';
import
{
takeawayGoodsColumn
}
from
'
./staticData/goods
'
;
import
{
takeawayGoodsColumn
}
from
'
./staticData/goods
'
;
import
utilStyle
from
'
@/utils/utils.less
'
;
import
utilStyle
from
'
@/utils/utils.less
'
;
import
{
apiTakeawayList
,
apiSelPickSelfList
,
apiMealInfoDel
,
apiMealInfoUpdate
}
from
'
./service
'
;
import
{
apiTakeawayList
,
apiSelPickSelfList
,
apiMealInfoDel
,
apiMealInfoUpdate
}
from
'
./service
'
;
import
{
getEnterpriseList
}
from
'
./service/bll
'
;
import
{
getEnterpriseList
,
getShopList
}
from
'
./service/bll
'
;
import
SaleDateModal
from
'
./components/SaleDateModal
'
;
import
SaleDateModal
from
'
./components/SaleDateModal
'
;
import
SaleSectionModal
from
'
./components/SaleSectionModal
'
;
import
SaleSectionModal
from
'
./components/SaleSectionModal
'
;
import
GoodPriceModal
from
'
./components/GoodPriceModal
'
;
import
GoodPriceModal
from
'
./components/GoodPriceModal
'
;
...
@@ -22,9 +22,10 @@ const TakeawayGoods = () => {
...
@@ -22,9 +22,10 @@ const TakeawayGoods = () => {
const
[
visibleSaleSection
,
setVisibleSaleSection
]
=
useState
(
false
);
// 可售餐段弹窗
const
[
visibleSaleSection
,
setVisibleSaleSection
]
=
useState
(
false
);
// 可售餐段弹窗
const
[
visiblePrice
,
setVisiblePrice
]
=
useState
(
false
);
// 修改企业商品价格弹窗
const
[
visiblePrice
,
setVisiblePrice
]
=
useState
(
false
);
// 修改企业商品价格弹窗
const
[
visibleSort
,
setVisibleSort
]
=
useState
(
false
);
// 商品排序弹窗
const
[
visibleSort
,
setVisibleSort
]
=
useState
(
false
);
// 商品排序弹窗
const
[
enterprises
,
setEnterprises
]
=
useState
([]);
// 企业列表
const
[
enterprises
,
setEnterprises
]
=
useState
({
1
:
{
text
:
'
领红包
'
}
});
// 企业列表
const
[
shopEnum
,
setShopEnum
]
=
useState
({});
// 店铺列表
const
[
activeKey
,
setActiveKey
]
=
useState
(
''
);
const
[
activeKey
,
setActiveKey
]
=
useState
(
''
);
const
[
enterpriseId
,
setEnterpriseId
]
=
useState
(
''
);
const
[
enterpriseId
,
setEnterpriseId
]
=
useState
(
'
1
'
);
const
[
pickSelfList
,
setPickSelfList
]
=
useState
([]);
// 取餐点列表
const
[
pickSelfList
,
setPickSelfList
]
=
useState
([]);
// 取餐点列表
const
[
recordID
,
setRecordID
]
=
useState
(
''
);
// 编辑的记录ID
const
[
recordID
,
setRecordID
]
=
useState
(
''
);
// 编辑的记录ID
...
@@ -36,9 +37,18 @@ const TakeawayGoods = () => {
...
@@ -36,9 +37,18 @@ const TakeawayGoods = () => {
const
data
=
{
const
data
=
{
page
:
params
.
current
,
page
:
params
.
current
,
size
:
params
.
pageSize
,
size
:
params
.
pageSize
,
data
:
params
,
data
:
Object
.
assign
(
{
enterpriseId
,
},
params
,
),
};
const
res
=
await
apiTakeawayList
(
data
);
return
{
data
:
res
.
records
,
total
:
res
.
total
,
};
};
return
apiTakeawayList
(
data
);
};
};
const
onDel
=
async
id
=>
{
const
onDel
=
async
id
=>
{
await
apiMealInfoDel
({
await
apiMealInfoDel
({
...
@@ -65,45 +75,64 @@ const TakeawayGoods = () => {
...
@@ -65,45 +75,64 @@ const TakeawayGoods = () => {
notification
.
success
({
message
:
'
保存成功
'
});
notification
.
success
({
message
:
'
保存成功
'
});
};
};
const
options
=
{
// 根据企业ID获取取餐点
setVisibleSaleDate
,
const
getPickSelf
=
async
id
=>
{
setVisibleSaleSection
,
const
res
=
await
apiSelPickSelfList
({
enterpriseId
:
id
});
setVisiblePrice
,
if
(
res
)
{
setVisibleSort
,
setPickSelfList
(
onDel
,
res
.
map
(
item
=>
({
setRecordID
,
key
:
item
.
pickSelfId
,
enterprises
,
label
:
<
span
>
{
item
.
pickSelfName
}
</
span
>,
onChangeFlag
,
})),
);
setActiveKey
(
res
[
0
].
pickSelfId
);
}
};
};
// 根据企业ID获取取餐点
// 根据企业ID获取取餐点
const
getPickSelf
=
async
()
=>
{
// const getShops
= async () => {
const
res
=
await
apiSelPickSelf
List
({});
// const res = await getShop
List({});
setPickSelfList
(
// setShopEnum(res.list);
res
.
map
(
item
=>
({
// };
key
:
item
.
pickSelfId
,
label
:
<
span
>
{
item
.
pickSelfName
}
</
span
>,
// 改变企业
})),
const
onChangeEnterprise
=
v
=>
{
);
setEnterpriseId
(
v
);
setActiveKey
(
res
[
0
].
pickSelfId
);
getPickSelf
(
v
);
};
};
// 获取企业列表
// 获取企业列表
const
getList
=
async
name
=>
{
const
getList
=
async
()
=>
{
const
obj
=
await
getEnterpriseList
(
name
);
const
obj
=
await
getEnterpriseList
();
setEnterprises
(
obj
.
list
);
if
(
obj
.
list
&&
Object
.
keys
(
obj
.
list
).
length
)
{
setEnterpriseId
(
obj
.
id
);
setEnterprises
(
obj
.
list
);
getPickSelf
(
obj
.
id
);
setEnterpriseId
(
obj
.
id
);
setPageLoading
(
true
);
getPickSelf
(
obj
.
id
);
setPageLoading
(
true
);
}
};
};
useEffect
(()
=>
{
useEffect
(()
=>
{
getList
(
''
);
getList
();
// getShops();
// setTimeout(() => {
// setTimeout(() => {
// // refTable.current.reload();
// // refTable.current.reload();
// }, 1000);
// }, 1000);
},
[]);
},
[]);
const
options
=
{
setVisibleSaleDate
,
setVisibleSaleSection
,
setVisiblePrice
,
setVisibleSort
,
onDel
,
setRecordID
,
enterprises
,
onChangeEnterprise
,
onChangeFlag
,
shopEnum
,
};
return
(
return
(
<
div
>
<
div
>
{
pageLoading
&&
(
{
pageLoading
&&
(
...
...
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