Commit 7bcd597e by zhangxw

日报相关bug修复

1 parent 0d48c5a5
...@@ -116,7 +116,9 @@ Page({ ...@@ -116,7 +116,9 @@ Page({
// 获取上一天的日期 // 获取上一天的日期
let previousDate = new Date(currentDate) let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1) previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd" // 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0] let formattedDate = previousDate.toISOString().split('T')[0]
console.log('formattedDate', formattedDate); console.log('formattedDate', formattedDate);
...@@ -201,6 +203,9 @@ Page({ ...@@ -201,6 +203,9 @@ Page({
checkDeliveryTarget() { checkDeliveryTarget() {
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
let currentDate = new Date() let currentDate = new Date()
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = currentDate.getHours() + 8
currentDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd" // 格式化日期为"yyyy-mm-dd"
let formattedDate = currentDate.toISOString().split('T')[0] let formattedDate = currentDate.toISOString().split('T')[0]
// 驻店负责人 loginRoleOnSelectMerchant 跟随门店配置是否是驻店负责人 // 驻店负责人 loginRoleOnSelectMerchant 跟随门店配置是否是驻店负责人
......
...@@ -217,7 +217,9 @@ Page({ ...@@ -217,7 +217,9 @@ Page({
// 获取上一天的日期 // 获取上一天的日期
let previousDate = new Date(currentDate); let previousDate = new Date(currentDate);
previousDate.setDate(currentDate.getDate() - 1); previousDate.setDate(currentDate.getDate() - 1);
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd" // 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split("T")[0]; let formattedDate = previousDate.toISOString().split("T")[0];
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
var dateContrast = function (params) { var dateContrast = function (params) {
var oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数 var oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数
var currentDate = getDate().getTime() // 当前日期 var currentDate = getDate().getTime() // 当前日期
var targetDate = getDate(params).getTime() // 给定的日期 var targetDate = getDate(params + ' 00:00:00').getTime() // 给定的日期 零点的时间戳
return targetDate < currentDate + oneDay return targetDate < currentDate + oneDay
} }
...@@ -10,7 +10,7 @@ var dateContrast = function (params) { ...@@ -10,7 +10,7 @@ var dateContrast = function (params) {
var isShowBtns = function (date) { var isShowBtns = function (date) {
var oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数 var oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数
var currentDate = getDate() // 当前日期 var currentDate = getDate() // 当前日期
var targetDate = getDate(date) // 给定的日期 var targetDate = getDate(date + ' 00:00:00') // 给定的日期
// 计算给定日期与当前日期的时间差(以毫秒为单位) // 计算给定日期与当前日期的时间差(以毫秒为单位)
var diffMilliseconds = targetDate - currentDate var diffMilliseconds = targetDate - currentDate
// 计算时间差对应的天数 // 计算时间差对应的天数
......
...@@ -208,7 +208,9 @@ Component({ ...@@ -208,7 +208,9 @@ Component({
// 获取上一天的日期 // 获取上一天的日期
let previousDate = new Date(currentDate) let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1) previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd" // 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0] let formattedDate = previousDate.toISOString().split('T')[0]
wx.$router.go('tabWorkOrder.staffDaily', { wx.$router.go('tabWorkOrder.staffDaily', {
......
...@@ -124,7 +124,9 @@ Page({ ...@@ -124,7 +124,9 @@ Page({
// 获取上一天的日期 // 获取上一天的日期
let previousDate = new Date(currentDate) let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1) previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd" // 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0] let formattedDate = previousDate.toISOString().split('T')[0]
wx.$router.go('tabWorkOrder.upgradeStaffDaily', { wx.$router.go('tabWorkOrder.upgradeStaffDaily', {
...@@ -420,6 +422,7 @@ Page({ ...@@ -420,6 +422,7 @@ Page({
}, },
}); });
} else { } else {
console.log(item)
wx.$router.go(item.url); wx.$router.go(item.url);
} }
} else { } else {
...@@ -897,7 +900,9 @@ Page({ ...@@ -897,7 +900,9 @@ Page({
// 获取上一天的日期 // 获取上一天的日期
let previousDate = new Date(currentDate); let previousDate = new Date(currentDate);
previousDate.setDate(currentDate.getDate() - 1); previousDate.setDate(currentDate.getDate() - 1);
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd" // 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split("T")[0]; let formattedDate = previousDate.toISOString().split("T")[0];
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false; if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false;
......
...@@ -72,12 +72,12 @@ export default { ...@@ -72,12 +72,12 @@ export default {
recordId: 12, recordId: 12,
icon: "boutique-syzs", icon: "boutique-syzs",
}, },
{ // {
name: "驻店日报", // name: "驻店日报",
url: "tabWorkOrder.staffDaily", // url: "tabWorkOrder.staffDaily",
recordId: 13, // recordId: 13,
icon: "staffreport", // icon: "staffreport",
}, // },
{ {
name: "营销素材", name: "营销素材",
url: "/pages/materails/index", url: "/pages/materails/index",
......
...@@ -452,7 +452,9 @@ Page({ ...@@ -452,7 +452,9 @@ Page({
// 获取上一天的日期 // 获取上一天的日期
let previousDate = new Date(currentDate) let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1) previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd" // 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0] let formattedDate = previousDate.toISOString().split('T')[0]
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
......
...@@ -313,7 +313,9 @@ Page({ ...@@ -313,7 +313,9 @@ Page({
// 获取上一天的日期 // 获取上一天的日期
let previousDate = new Date(currentDate) let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1) previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd" // 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0] let formattedDate = previousDate.toISOString().split('T')[0]
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
......
...@@ -425,7 +425,9 @@ Page({ ...@@ -425,7 +425,9 @@ Page({
// 获取上一天的日期 // 获取上一天的日期
let previousDate = new Date(currentDate) let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1) previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd" // 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0] let formattedDate = previousDate.toISOString().split('T')[0]
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
......
...@@ -528,7 +528,9 @@ Page({ ...@@ -528,7 +528,9 @@ Page({
// 获取上一天的日期 // 获取上一天的日期
let previousDate = new Date(currentDate) let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1) previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd" // 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0] let formattedDate = previousDate.toISOString().split('T')[0]
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
......
...@@ -343,7 +343,9 @@ Page({ ...@@ -343,7 +343,9 @@ Page({
// 获取上一天的日期 // 获取上一天的日期
let previousDate = new Date(currentDate) let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1) previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd" // 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0] let formattedDate = previousDate.toISOString().split('T')[0]
if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
......
...@@ -295,16 +295,10 @@ Page({ ...@@ -295,16 +295,10 @@ Page({
}); });
}, },
click(e) { click(e) {
role != "staff"; let { pidx, idx } = e.detail
let { role, orderObj } = this.data;
if (role != "staff" || !orderObj.isDateWithin7Days) return;
let { pidx, idx } = e.currentTarget.dataset;
this.setData({ this.setData({
[`formData[${pidx}].optionList[${idx}].active`]: [`formData[${pidx}].optionList[${idx}].active`]: !this.data.formData[pidx].optionList[idx].active
!this.data.formData[pidx].optionList[idx].active, })
});
}, },
/** /**
* 点击了上一周,选择周数字减一,然后直接调用工具类中一个方法获取到数据 * 点击了上一周,选择周数字减一,然后直接调用工具类中一个方法获取到数据
...@@ -447,15 +441,20 @@ Page({ ...@@ -447,15 +441,20 @@ Page({
trafficProblemList = trafficProblemList || []; trafficProblemList = trafficProblemList || [];
formData.forEach((element) => { formData.forEach((element) => {
if (element.name == "trafficProblemList") { if (element.name == "trafficProblemList") {
element.selectedList = []
element.selectedStr = ''
element.optionList = element.optionList.map((option) => { element.optionList = element.optionList.map((option) => {
option.active = false; option.active = false;
trafficProblemList.map((item) => { trafficProblemList.map((item) => {
if (option.confId == item) { if (option.confId == item) {
option.active = true; option.active = true;
element.selectedList.push(option)
} }
}); });
return option; return option;
}); });
element.selectedStr = element.selectedList?.map(v => { return v.confName })?.join(';')
return element
} }
}); });
// } // }
...@@ -463,15 +462,20 @@ Page({ ...@@ -463,15 +462,20 @@ Page({
packageProblemList = packageProblemList || []; packageProblemList = packageProblemList || [];
formData.forEach((element) => { formData.forEach((element) => {
if (element.name == "packageProblemList") { if (element.name == "packageProblemList") {
element.selectedList = []
element.selectedStr = ''
element.optionList = element.optionList.map((option) => { element.optionList = element.optionList.map((option) => {
option.active = false; option.active = false;
packageProblemList.map((item) => { packageProblemList.map((item) => {
if (option.confId == item) { if (option.confId == item) {
option.active = true; option.active = true;
element.selectedList.push(option)
} }
}); });
return option; return option;
}); });
element.selectedStr = element.selectedList?.map(v => { return v.confName })?.join(';')
return element
} }
}); });
// } // }
...@@ -479,15 +483,20 @@ Page({ ...@@ -479,15 +483,20 @@ Page({
skillProblemList = skillProblemList || []; skillProblemList = skillProblemList || [];
formData.forEach((element) => { formData.forEach((element) => {
if (element.name == "skillProblemList") { if (element.name == "skillProblemList") {
element.selectedList = []
element.selectedStr = ''
element.optionList = element.optionList.map((option) => { element.optionList = element.optionList.map((option) => {
option.active = false; option.active = false;
skillProblemList.map((item) => { skillProblemList.map((item) => {
if (option.confId == item) { if (option.confId == item) {
option.active = true; option.active = true;
element.selectedList.push(option)
} }
}); });
return option; return option;
}); });
element.selectedStr = element.selectedList?.map(v => { return v.confName })?.join(';')
return element
} }
}); });
// } // }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</view> </view>
</view> </view>
</navigation-bar> </navigation-bar>
<view style="margin-top:{{ statusBarHeight }}px"> <view style="margin-top:{{ navBarHeight }}px">
<weekCalendar timeBean="{{ timeBean }}" bind:lastWeek="lastWeek" bind:nextWeek="nextWeek" bind:dayClick="dayClick"></weekCalendar> <weekCalendar timeBean="{{ timeBean }}" bind:lastWeek="lastWeek" bind:nextWeek="nextWeek" bind:dayClick="dayClick"></weekCalendar>
</view> </view>
<view class="main {{ isFullSucreen?'isFullSucreen':'' }}"> <view class="main {{ isFullSucreen?'isFullSucreen':'' }}">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!