|
|
@@ -144,21 +144,29 @@
|
|
|
});
|
|
|
},
|
|
|
getList(page) {
|
|
|
- let data = {
|
|
|
- merchantId: this.merchantId,
|
|
|
- productName: this.productName,
|
|
|
- pageNo: page.num,
|
|
|
- pageSize: page.size,
|
|
|
- writeOffTimeEnd: this.writeOffTimeEnd,
|
|
|
- writeOffTimeStart: this.writeOffTimeStart
|
|
|
- }
|
|
|
- this.$http.post("/app/writeOff/list", data).then(res => {
|
|
|
- if (res.data.code == 200) {
|
|
|
- console.log(res)
|
|
|
- this.list = this.list.concat(res.data.result.records)
|
|
|
- this.mescroll.endSuccess(res.data.result.records.length, res.data.result.total);
|
|
|
- }
|
|
|
- })
|
|
|
+
|
|
|
+ let data = {
|
|
|
+ merchantId: uni.getStorageSync('login_user_info').merchantId,
|
|
|
+ productName: this.productName,
|
|
|
+ pageNo: page.num,
|
|
|
+ pageSize: page.size,
|
|
|
+ writeOffTimeEnd: this.writeOffTimeEnd,
|
|
|
+ writeOffTimeStart: this.writeOffTimeStart
|
|
|
+ }
|
|
|
+ console.log(data.merchantId)
|
|
|
+ this.$http.post("/app/writeOff/list", data).then(res => {
|
|
|
+ if (res.data.code == 200 && res.data.result.records.length>0) {
|
|
|
+ this.list = this.list.concat(res.data.result.records)
|
|
|
+ this.mescroll.endSuccess(res.data.result.records.length, res.data.result.total);
|
|
|
+ }else{
|
|
|
+ this.mescroll.endErr()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(()=>{
|
|
|
+ this.mescroll.endErr()
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
searchList() {
|
|
|
this.list = []
|
|
|
@@ -187,24 +195,13 @@
|
|
|
this.getList(page);
|
|
|
},
|
|
|
getMonthRange(monthValue) {
|
|
|
- let year = new Date().getFullYear()
|
|
|
- const startDate = new Date(year, monthValue - 1, 1);
|
|
|
- const endDate = new Date(year, monthValue, 0);
|
|
|
- endDate.setHours(23, 59, 59, 999);
|
|
|
- const localStart = startDate.toLocaleString();
|
|
|
- const localEnd = endDate.toLocaleString();
|
|
|
- this.writeOffTimeStart = localStart
|
|
|
- this.writeOffTimeEnd = localEnd
|
|
|
- setTimeout(()=>{
|
|
|
- uni.showToast({
|
|
|
- icon:'none',
|
|
|
- title:this.writeOffTimeStart+'---'+this.writeOffTimeEnd
|
|
|
- })
|
|
|
- })
|
|
|
- // return {
|
|
|
- // start: startDate, // 当月第一天 00:00:00
|
|
|
- // end: endDate // 当月最后一天 23:59:59.999
|
|
|
- // };
|
|
|
+ let year = new Date().getFullYear();
|
|
|
+ const startDate = new Date(year, monthValue - 1, 1);
|
|
|
+ const endDate = new Date(year, monthValue, 0);
|
|
|
+ endDate.setHours(23, 59, 59, 999);
|
|
|
+
|
|
|
+ this.writeOffTimeStart = `${year}-${String(monthValue).padStart(2, '0')}-01 00:00:00`;
|
|
|
+ this.writeOffTimeEnd = `${year}-${String(monthValue).padStart(2, '0')}-${String(endDate.getDate()).padStart(2, '0')} 23:59:59`;
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
@@ -215,25 +212,11 @@
|
|
|
onShow() {
|
|
|
|
|
|
let that = this
|
|
|
- uni.getStorage({
|
|
|
- key: 'login_user_info',
|
|
|
- success: function(res) {
|
|
|
- that.merchantId = res.data.merchantId
|
|
|
- const date = new Date();
|
|
|
- // that.month = date.getMonth() + 1;
|
|
|
- // that.showMonth = date.toLocaleString("zh-CN", {
|
|
|
- // month: "long",
|
|
|
- // });
|
|
|
- let currentMonth = new Date().getMonth();
|
|
|
- that.showMonth = that.timelist[currentMonth].label;
|
|
|
- console.log(that.showMonth)
|
|
|
- uni.showToast({
|
|
|
- icon:'none',
|
|
|
- title:that.showMonth
|
|
|
- })
|
|
|
- that.getMonthRange(that.timelist[currentMonth].value)
|
|
|
- }
|
|
|
- })
|
|
|
+ const date = new Date();
|
|
|
+ let currentMonth = new Date().getMonth();
|
|
|
+ that.showMonth = that.timelist[currentMonth].label;
|
|
|
+ console.log(that.showMonth)
|
|
|
+ that.getMonthRange(that.timelist[currentMonth].value)
|
|
|
|
|
|
|
|
|
}
|