@@ -141,7 +141,22 @@ const getNowFormatDate = () => {
var currentdate = year + seperator1 + month + seperator1 + strDate;
return currentdate;
}
-
+//获取当天+N日期
+const getNowNumFormatDate = (num) => {
+ var date = new Date();
+ var seperator1 = "-";
+ var year = date.getFullYear();
+ var month = date.getMonth() + 1;
+ var strDate = date.getDate()+num;
+ if (month >= 1 && month <= 9) {
+ month = "0" + month;
+ }
+ if (strDate >= 0 && strDate <= 9) {
+ strDate = "0" + strDate;
+ var currentdate = year + seperator1 + month + seperator1 + strDate;
+ return currentdate;
+}
const convertCurrency = (money) => {
//汉字的数字
var cnNums = new Array('零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖');
@@ -325,6 +340,7 @@ export default {
getListByUserId,
setAudit,
getNowFormatDate,
+ getNowNumFormatDate,
getProvinceAbbreviation,
convertCurrency,
filterUrban,
@@ -96,7 +96,8 @@
},
onNavigationBarButtonTap() {
this.parameter.warehouseName = this.costList[0].warehouseName
- this.parameter.startDate = helper.getNowFormatDate()
+ this.parameter.startDate = helper.getNowNumFormatDate(-1)
+ console.log(this.parameter.startDate)
this.parameter.endDate = helper.getNowFormatDate()
uni.showLoading({
title: '正在加载'