瀏覽代碼

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-app

gjy 2 年之前
父節點
當前提交
e8768d638d
共有 2 個文件被更改,包括 19 次插入2 次删除
  1. 17 1
      common/helper.js
  2. 2 1
      pages/user/contractLook/inventoryCost.vue

+ 17 - 1
common/helper.js

@@ -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,

+ 2 - 1
pages/user/contractLook/inventoryCost.vue

@@ -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: '正在加载'