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
f9a4fdd5
Commit
f9a4fdd5
authored
Jan 17, 2023
by
杨鑫
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/expiration-date-up' into 'master'
Feature/expiration date up See merge request
!75
parents
47411217
cf426141
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
72 additions
and
18 deletions
+72
-18
env.config.js
config/env.config.js
+1
-1
index.jsx
src/components/GaoDeMap/index.jsx
+1
-3
staticdata.js
src/pages/GoodsManage/staticdata.js
+2
-0
FormRuleSetting.jsx
src/pages/ServiceGoods/components/FormRuleSetting.jsx
+48
-12
storeModal.jsx
src/pages/chainStoreManage/components/storeModal.jsx
+19
-1
services.js
src/pages/chainStoreManage/services.js
+1
-1
No files found.
config/env.config.js
View file @
f9a4fdd5
const
isProduction
=
process
.
env
.
NODE_ENV
===
'
production
'
;
const
isPre
=
process
.
env
.
PRE_ENV
===
'
pre
'
;
const
environment
=
'
sc1
'
;
const
environment
=
'
xyqb
'
;
const
envAPi
=
{
api
:
`https://security-
${
environment
}
.liangkebang.net`
,
//'https://security-xyqb.liangkebang.net',
kdspOpApi
:
`https://sc-merchant-api-
${
environment
}
.liangkebang.net`
,
...
...
src/components/GaoDeMap/index.jsx
View file @
f9a4fdd5
...
...
@@ -34,11 +34,9 @@ export default props => {
const
geocoder
=
new
window
.
AMap
.
Geocoder
({
city
,
});
geocoder
.
getLocation
(
addrInfo
.
address
,
(
status
,
result
)
=>
{
if
(
status
===
'
complete
'
&&
result
.
geocodes
.
length
)
{
const
{
lng
,
lat
}
=
result
.
geocodes
[
0
].
location
;
console
.
log
(
result
.
geocodes
[
0
].
location
);
setLnglat
([
lng
,
lat
]);
setLnglatText
(
`
${
lng
}
,
${
lat
}
`
);
}
else
{
...
...
@@ -73,7 +71,7 @@ export default props => {
created
:
getPoint
,
click
:
onGetPoint
,
}
}
zoom=
{
1
5
}
zoom=
{
1
4
}
>
<
Marker
position=
{
lnglat
}
></
Marker
>
</
Map
>
...
...
src/pages/GoodsManage/staticdata.js
View file @
f9a4fdd5
...
...
@@ -315,6 +315,8 @@ const filterServiceItem = (type, serviceItem) => {
resetTime
(
serviceItem
.
purchaseStartTime
),
resetTime
(
serviceItem
.
purchaseEndTime
),
],
// 购买开始时间
validityPeriodType
:
serviceItem
.
validityPeriodType
,
validityPeriodDays
:
serviceItem
.
validityPeriodDays
,
shopIds
:
serviceItem
.
shopIds
||
[],
// 适用门店列表
unavailableDate
:
serviceItem
.
unavailableDate
,
// 不可用日期
useTimeDescription
:
serviceItem
.
useTimeDescription
,
// 使用时间
...
...
src/pages/ServiceGoods/components/FormRuleSetting.jsx
View file @
f9a4fdd5
import
{
Form
,
Input
,
Select
,
Checkbox
,
DatePicker
}
from
'
antd
'
;
import
React
,
{
useEffect
,
forwardRef
,
useImperativeHandle
,
useContext
}
from
'
react
'
;
import
{
Form
,
Input
,
Select
,
Checkbox
,
DatePicker
,
Radio
,
InputNumber
}
from
'
antd
'
;
import
React
,
{
useEffect
,
forwardRef
,
useImperativeHandle
,
useContext
,
useState
}
from
'
react
'
;
import
moment
from
'
moment
'
;
import
{
WeeksList
,
formItemLayout
}
from
'
../config
'
;
import
{
ServiceContext
}
from
'
../context
'
;
...
...
@@ -23,6 +23,7 @@ const FormRuleSetting = forwardRef((props, ref) => {
const
{
editData
,
supplierIdList
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
const
customer
=
useContext
(
ServiceContext
);
const
[
dateType
,
setDateType
]
=
useState
(
1
);
// 判断是否有禁用的店铺 禁用店铺不显示
const
getIsInShops
=
arr
=>
{
...
...
@@ -41,6 +42,11 @@ const FormRuleSetting = forwardRef((props, ref) => {
const
shopIds
=
getIsInShops
(
editData
.
shopIds
);
goodInfo
.
shopIds
=
shopIds
;
}
console
.
log
(
'
goodInfo :>>
'
,
goodInfo
);
if
(
goodInfo
.
validityPeriodType
)
{
console
.
log
(
'
+goodInfo.validityPeriodType :>>
'
,
+
goodInfo
.
validityPeriodType
);
setDateType
(
+
goodInfo
.
validityPeriodType
);
}
form
.
setFieldsValue
(
goodInfo
);
}
},
[
customer
.
isEdit
,
customer
.
isUseCache
,
editData
]);
...
...
@@ -48,20 +54,27 @@ const FormRuleSetting = forwardRef((props, ref) => {
const
onCheck
=
async
()
=>
{
try
{
const
{
useTime
,
purchaseTime
,
...
values
}
=
await
form
.
validateFields
();
return
{
useStartTime
:
formatTime
(
useTime
[
0
]),
useEndTime
:
formatTime
(
useTime
[
1
]),
const
params
=
{
purchaseStartTime
:
formatTime
(
purchaseTime
[
0
]),
purchaseEndTime
:
formatTime
(
purchaseTime
[
1
]),
temp
:
'
serviceItem
'
,
...
values
,
};
if
(
useTime
&&
useTime
.
length
===
2
)
{
params
.
useStartTime
=
formatTime
(
useTime
[
0
]);
params
.
useEndTime
=
formatTime
(
useTime
[
1
]);
}
return
params
;
}
catch
(
errorInfo
)
{
return
null
;
}
};
const
onChangeDateType
=
e
=>
{
const
v
=
+
e
.
target
.
value
;
setDateType
(
v
);
};
const
getFormValues
=
debounce
(()
=>
{
const
values
=
form
.
getFieldsValue
();
props
.
onValuesChange
({
serviceItem
:
values
});
...
...
@@ -81,7 +94,8 @@ const FormRuleSetting = forwardRef((props, ref) => {
form=
{
form
}
name=
"register"
initialValues=
{
{
useTime
:
[],
// 使用开始时间
// useTime: [], // 使用开始时间
validityPeriodType
:
1
,
// 有效期类型
// useEndTime: '', // 使用结束时间
purchaseTime
:
[],
// 购买开始时间
// purchaseEndTime: '2022-07-27 06', // 购买结束时间
...
...
@@ -102,12 +116,34 @@ const FormRuleSetting = forwardRef((props, ref) => {
defaultPickerValue=
{
[
nowDateTime
,
nowDateTimeEnd
]
}
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"useTime"
label=
"有效期"
{
...
rangeConfig
}
>
<
RangePicker
format=
"YYYY-MM-DD HH:mm:ss"
defaultPickerValue=
{
[
nowDateTime
,
nowDateTimeEnd
]
}
/>
<
Form
.
Item
name=
"validityPeriodType"
label=
"有效期类型"
rules=
{
[{
required
:
true
,
message
:
'
请选择有效期类型!
'
}]
}
>
<
Radio
.
Group
onChange=
{
onChangeDateType
}
>
<
Radio
value=
{
1
}
>
固定日期
</
Radio
>
<
Radio
value=
{
2
}
disabled
>
指定范围
</
Radio
>
</
Radio
.
Group
>
</
Form
.
Item
>
{
dateType
===
1
?
(
<
Form
.
Item
name=
"useTime"
label=
"有效期"
{
...
rangeConfig
}
>
<
RangePicker
format=
"YYYY-MM-DD HH:mm:ss"
defaultPickerValue=
{
[
nowDateTime
,
nowDateTimeEnd
]
}
/>
</
Form
.
Item
>
)
:
(
<
Form
.
Item
name=
"validityPeriodDays"
label=
"有效期天数"
rules=
{
[{
required
:
true
,
message
:
'
请输入有效期天数!
'
}]
}
>
<
InputNumber
min=
{
1
}
max=
{
36000
}
/>
</
Form
.
Item
>
)
}
<
Form
.
Item
name=
"shopIds"
label=
"适用门店"
...
...
src/pages/chainStoreManage/components/storeModal.jsx
View file @
f9a4fdd5
...
...
@@ -76,6 +76,22 @@ const StoreModal = props => {
});
};
const
getAreas
=
arr
=>
{
let
areas
=
areaAddr
;
let
addr
=
''
;
arr
.
forEach
(
c
=>
{
let
index
=
0
;
areas
.
forEach
((
item
,
i
)
=>
{
if
(
item
.
value
===
c
)
{
addr
+=
item
.
label
;
index
=
i
;
}
});
areas
=
areas
[
index
].
children
;
});
return
addr
;
};
// 显示地图
const
openMap
=
v
=>
{
const
values
=
getFieldsValue
();
...
...
@@ -96,9 +112,10 @@ const StoreModal = props => {
}
});
}
const
labels
=
getAreas
(
values
.
addr
);
setMapInfo
({
provice
,
address
:
values
.
address
,
address
:
labels
+
values
.
address
,
});
setVisibleMap
(
v
);
};
...
...
@@ -218,6 +235,7 @@ const StoreModal = props => {
title=
"门店信息"
visible=
{
visible
}
width=
"800px"
destroyOnClose
maskClosable=
{
false
}
onOk=
{
()
=>
onSubmit
()
}
onCancel=
{
()
=>
handleCancel
()
}
...
...
src/pages/chainStoreManage/services.js
View file @
f9a4fdd5
...
...
@@ -30,7 +30,7 @@ export async function searchList(params) {
// 停启用门店
export
async
function
apiEnableStore
({
id
,
state
})
{
const
data
=
await
request
.
get
(
`/api/merchants/shops/state/edit/
${
id
}
/
${
state
}
`
,
{
const
data
=
await
request
.
get
(
`/api/merchants/shops/state
s
/edit/
${
id
}
/
${
state
}
`
,
{
prefix
:
kdspApi
,
});
return
data
.
businessCode
;
...
...
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