Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
wmsApp
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6fb553e9
authored
Jul 30, 2024
by
LJM
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add
parent
8b6bb87e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
pages/arrivalRegister/registered.vue
pages/arrivalRegister/registered.vue
View file @
6fb553e9
...
...
@@ -5,7 +5,7 @@
<view
class=
"time-interval-box row verCenter bothSide"
>
<view
class=
"row verCenter"
>
<text
class=
"iconfont icon-juxing4"
></text>
<picker
mode=
"date"
@
change=
"bindTimeChange(1, $event)"
>
<picker
mode=
"date"
@
change=
"bindTimeChange(1, $event)"
:value=
"searchParams.arrival_time_begin"
>
<input
type=
"text"
class=
"uni-input"
placeholder=
"请选择起始时间"
placeholder-style=
"color:#919399"
v-model=
"searchParams.arrival_time_begin"
/>
</picker>
</view>
...
...
@@ -14,7 +14,7 @@
<view
class=
"time-interval-box row verCenter bothSide"
>
<view
class=
"row verCenter"
>
<text
class=
"iconfont icon-juxing4"
></text>
<picker
mode=
"date"
@
change=
"bindTimeChange(2, $event)"
>
<picker
mode=
"date"
@
change=
"bindTimeChange(2, $event)"
:value=
"searchParams.arrival_time_end"
>
<input
type=
"text"
class=
"uni-input"
placeholder=
"请选择结束时间"
placeholder-style=
"color:#919399"
v-model=
"searchParams.arrival_time_end"
/>
</picker>
</view>
...
...
@@ -199,6 +199,7 @@
export
default
{
data
()
{
const
{
startDate
,
endDate
}
=
this
.
getDefaultDateRange
();
// 获取默认日期范围
return
{
user_email
:
uni
.
getStorageSync
(
'name'
),
is_focus
:
true
,
//获取焦点动态化
...
...
@@ -216,8 +217,8 @@
hasMoreData
:
true
,
//是否分页加载
maxInputLength
:
7
,
searchParams
:
{
arrival_time_begin
:
''
,
arrival_time_end
:
''
,
arrival_time_begin
:
startDate
,
arrival_time_end
:
endDate
,
mobile_register_all_search
:
''
,
//全量搜索
stock_in_with_stock_in_items_inhouse
:
''
,
//入仓单号
box_sn
:
''
//箱号
...
...
@@ -243,6 +244,23 @@
this
.
getData
();
},
methods
:
{
// 获取默认的日期范围,返回最近一个月的起始和结束日期
getDefaultDateRange
()
{
const
currentDate
=
new
Date
();
const
endDate
=
this
.
formatDate
(
currentDate
);
// 结束日期为今天
currentDate
.
setMonth
(
currentDate
.
getMonth
()
-
1
);
// 将月份减去 1 得到一个月前的日期
const
startDate
=
this
.
formatDate
(
currentDate
);
// 起始日期为一个月前
return
{
startDate
,
endDate
};
// 返回一个对象,包含起始和结束日期
},
// 格式化日期为 YYYY-MM-DD 格式的字符串
formatDate
(
date
)
{
const
year
=
date
.
getFullYear
();
const
month
=
(
date
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
'0'
);
// 确保月份为两位数
const
day
=
date
.
getDate
().
toString
().
padStart
(
2
,
'0'
);
// 确保日期为两位数
return
`
${
year
}
-
${
month
}
-
${
day
}
`
;
// 返回格式化后的日期字符串
},
/**
* 时间选择
*/
...
...
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