Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 305fb80c
authored
Jun 03, 2026
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat 联调修改
1 parent
320185b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
19 deletions
src/common/format.js
src/views/systemConfig/ShopConfig/deliveryQuantity/components/periodDateRange.vue
src/common/format.js
View file @
305fb80
...
...
@@ -496,22 +496,6 @@ export function getMonthDateRange(targetMonth) {
}
/**
* 构建交付数归属周期日期选择器的 disabledDate
* @param {string} targetMonth yyyy-MM
*/
export
function
buildPeriodDatePickerOptions
(
targetMonth
)
{
return
{
disabledDate
:
(
time
)
=>
{
if
(
!
targetMonth
)
return
true
;
const
[
yearStr
,
monthStr
]
=
targetMonth
.
split
(
"-"
);
const
year
=
parseInt
(
yearStr
,
10
);
const
month
=
parseInt
(
monthStr
,
10
)
-
1
;
return
time
.
getFullYear
()
!==
year
||
time
.
getMonth
()
!==
month
;
},
};
}
/**
* 店面配置-门店主机厂交付数导入
* 限制:当前日期>20号:仅允许选择当前月份;当前日期≤20号:允许选择当前月份和上个月
*/
...
...
src/views/systemConfig/ShopConfig/deliveryQuantity/components/periodDateRange.vue
View file @
305fb80
...
...
@@ -22,7 +22,7 @@
</
template
>
<
script
>
import
{
getMonthDateRange
,
buildPeriodDatePickerOptions
}
from
'@/common/format'
import
{
getMonthDateRange
}
from
'@/common/format'
export
default
{
name
:
'PeriodDateRange'
,
...
...
@@ -44,7 +44,31 @@ export default {
return
{
innerRange
:
[],
isFullMonth
:
false
,
periodPickerOptions
:
buildPeriodDatePickerOptions
(
''
)
rangePickAnchor
:
null
}
},
computed
:
{
periodPickerOptions
()
{
const
monthRange
=
getMonthDateRange
(
this
.
targetMonth
)
return
{
onPick
:
({
minDate
,
maxDate
})
=>
{
if
(
maxDate
)
{
this
.
rangePickAnchor
=
null
}
else
if
(
minDate
)
{
this
.
rangePickAnchor
=
minDate
}
},
disabledDate
:
(
time
)
=>
{
if
(
!
monthRange
)
return
true
const
{
startDate
,
endDate
}
=
monthRange
const
timeStr
=
this
.
formatDateStr
(
time
)
if
(
timeStr
<
startDate
||
timeStr
>
endDate
)
return
true
if
(
!
this
.
rangePickAnchor
)
{
return
timeStr
!==
startDate
}
return
timeStr
<
startDate
||
timeStr
>
endDate
}
}
}
},
watch
:
{
...
...
@@ -56,8 +80,8 @@ export default {
}
},
targetMonth
(
val
,
oldVal
)
{
this
.
periodPickerOptions
=
buildPeriodDatePickerOptions
(
val
)
if
(
val
!==
oldVal
)
{
this
.
rangePickAnchor
=
null
this
.
innerRange
=
[]
this
.
isFullMonth
=
false
this
.
emitChange
([])
...
...
@@ -65,6 +89,12 @@ export default {
}
},
methods
:
{
formatDateStr
(
time
)
{
const
y
=
time
.
getFullYear
()
const
m
=
String
(
time
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
)
const
d
=
String
(
time
.
getDate
()).
padStart
(
2
,
'0'
)
return
`
${
y
}
-
${
m
}
-
${
d
}
`
},
syncFullMonthState
()
{
if
(
!
this
.
targetMonth
||
!
this
.
innerRange
||
this
.
innerRange
.
length
!==
2
)
{
this
.
isFullMonth
=
false
...
...
@@ -87,6 +117,7 @@ export default {
this
.
$emit
(
'change'
,
range
)
},
handleRangeChange
(
val
)
{
this
.
rangePickAnchor
=
null
if
(
!
val
||
val
.
length
!==
2
)
{
this
.
isFullMonth
=
false
this
.
emitChange
([])
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment