Commit b211790c by 张立顺

feat v4.34.1 功能需求开发

1 parent 5daf2302
......@@ -18,7 +18,7 @@ export const appId = 'wx570d9331f9ace0bd'
* 4预发布
* 5cdptest
*/
let index = 1
let index = 0
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
......
......@@ -89,5 +89,6 @@
}
]
}
}
},
"libVersion": "2.30.4"
}
\ No newline at end of file
......@@ -243,14 +243,15 @@ export const checkScene = options => {
const pagePath = {
createArchives: 'tabWorkOrder/pages/createArchives/createArchives',
createOrder: 'tabWorkOrder/pages/createOrder/createOrder',
followUpOrder: 'tabDate/pages/detail'
followUpOrder: 'tabDate/pages/detail',
staffDaily: 'tabWorkOrder/pages/staffDaily/staffDaily'
}
options.path = pagePath[query.page]
}
console.log(options, 'options')
wx.$SCENE = options
console.log(options.path, 'options.path')
if (!userInfo && !['pages/accountItems/accountItems', 'pages/wxLogin/wxLogin'].includes(options.path)) {
if (!userInfo && !['pages/accountItems/accountItems', 'pages/wxLogin/wxLogin', 'tabWorkOrder/pages/staffDaily/staffDaily'].includes(options.path)) {
// if (!userInfo) {
// console.log(userInfo);
console.log('未登录,请登录。')
......
......@@ -49,6 +49,9 @@ module.exports = {
userStat(data) {
return api.post('dj.api.smartcarlife.user.stat', data)
},
/** 查询当周员工日报是否填写列表 */
staffDailyReportDetailWeeklyList(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.weekly.list', data)
},
}
......@@ -178,6 +178,7 @@ page ::-webkit-scrollbar {
grid-template-columns: repeat(4, 100rpx);
justify-content: space-between;
align-items: center;
padding-bottom: 50rpx;
.label {
font-family: PingFangSC-Regular;
font-size: 24rpx;
......
......@@ -63,11 +63,18 @@ export default {
icon: 'business_data'
},
{
name: '驻店日报',
url: 'tabWorkOrder.staffDaily',
recordId: 13,
icon: 'staffreport'
},
{
name: '生意助手',
type:"mini",
type: "mini",
recordId: 12,
icon: 'boutique-syzs'
}
},
],
totalTableSum: [
{
......@@ -114,7 +121,7 @@ export default {
index: 2,
url: 'pages.tabDateIndex',
icon: 'icon_14',
activeIndex:1
activeIndex: 1
},
{
name: '待预约客户',
......@@ -122,23 +129,23 @@ export default {
index: 3,
url: 'pages.tabDateIndex',
icon: 'icon_2',
activeIndex:2
activeIndex: 2
},
{
name: '转化订单',
itemName: 'totalUpgrade',
index: 4,
url:'pages.index',
url: 'pages.index',
icon: 'icon_17',
activeIndex:2
activeIndex: 2
},
{
name: '战败订单',
itemName: 'totalNotUpgrade',
index: 5,
url:'pages.index',
url: 'pages.index',
icon: 'icon_16',
activeIndex:3
activeIndex: 3
},
{
name: '客单价',
......
......@@ -171,5 +171,9 @@ module.exports = {
/** 查询当周员工日报是否填写列表 */
staffDailyReportDetailWeeklyList(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.weekly.list', data)
},
/** 批复员工日报 */
staffDailyReportApprove(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.approve', data)
}
}
......@@ -3,30 +3,42 @@ Component({
options: {
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
/** * 组件的属性列表 * 用于组件自定义设置 */
properties: {
timeBean: { // 属性名 在wxml调用组件时利用该属性传递组件显示的数据
type: Object, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)
value: ''// 属性初始值(可选),如果未指定则会根据类型选择一个
},
timeBean: {
// 属性名 在wxml调用组件时利用该属性传递组件显示的数据
type: Object, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)
value: '' // 属性初始值(可选),如果未指定则会根据类型选择一个
}
// weeklyList: {
// type: Array,
// value: []
// }
},
/**
* 组件的方法列表
*/
methods: {
lastWeek:function(e){ //点击了上一周
this.triggerEvent("lastWeek")
lastWeek: function (e) {
//点击了上一周
this.triggerEvent('lastWeek')
},
nextWeek:function(e){ //点击了下一周
this.triggerEvent("nextWeek")
nextWeek: function (e) {
//点击了下一周
this.triggerEvent('nextWeek')
},
itemClick: function (e) { //点击了某一日,传递该日的下标
itemClick: function (e) {
//点击了某一日,传递该日的下标
// 超过当前时间不可点击
if (e.currentTarget.dataset.disabled) {
return
}
var index = e.currentTarget.dataset.index
this.triggerEvent("dayClick", index);
},
this.triggerEvent('dayClick', index)
}
}
})
\ No newline at end of file
})
......@@ -35,9 +35,26 @@
background: #347BFF;
}
.disabled {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-bottom: 5rpx;
padding-top: 5rpx;
margin-left: 5rpx;
margin-right: 5rpx;
margin-top: 10rpx;
flex: 1;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
background: #797979;
}
.timeType {
font-size: 35rpx;
font-weight: bold;
// margin-right: auto;
}
.dateType {
......@@ -56,6 +73,10 @@
background-color: gainsboro;
}
.lastweek {
width: 144rpx;
}
.line-shadow {
height: 3rpx;
width: 100%;
......@@ -84,6 +105,23 @@
-moz-osx-font-smoothing: grayscale;
}
.item {
position: relative;
}
.empty {
box-sizing: border-box;
position: absolute;
border-radius: 22rpx;
top: 35rpx;
right: 7rpx;
font-size: 22rpx;
z-index: 2;
padding: 0 4rpx;
background-color: red;
color: #fff;
}
/**
*字体图标,左右箭头,书,米饭,可以修改界面对图标进行修改替换
*/
......
<!--tabWorkOrder/pages/staffDaily/weekCalendar/weekCalendar.wxml-->
<!--compoents/weekCalendar/weekCalendar.wxml-->
<view class='line'></view>
<view class='row'>
<view class='row' bindtap='lastWeek'>
<text class='iconfont icon-sanjiaoleft' style='padding:15rpx;color:#999999'></text>
<view style='font-size:28rpx;color:#999999'>上一周</view>
</view>
<view class='timeType'>{{timeBean.yearMonth}}</view>
<view class='row' bindtap='nextWeek'>
<view style='font-size:28rpx; color:#999999'>下一周</view>
<text class='iconfont icon-sanjiaoright' style='padding:15rpx;color:#999999'></text>
</view>
<view class="line"></view>
<view class="row">
<view class="row" bindtap="lastWeek">
<text class="iconfont icon-sanjiaoleft" style="padding:15rpx;color:#999999"></text>
<view style="font-size:28rpx;color:#999999">上一周</view>
</view>
<view class="timeType">{{timeBean.yearMonth}}</view>
<view class="row lastweek" bindtap="nextWeek">
<block wx:if="{{ !timeBean.isInCurrentWeek }}">
<view style="font-size:28rpx; color:#999999">下一周</view>
<text class="iconfont icon-sanjiaoright" style="padding:15rpx;color:#999999"></text>
</block>
</view>
</view>
<view class='row'>
<view wx:for="0123456" data-index="{{index}}" class='{{index==timeBean.selectDay?"select-column":"column"}}' bindtap='itemClick' wx:key="index">
<view class='weekType'>{{timeBean.weekDayList[index].week}}</view>
<view class='dateType'>{{timeBean.weekDayList[index].day}}</view>
<text class='iconfont icon-mifan' style='color:#fff'></text>
</view>
<view class="row">
<view
wx:for="{{ [0,1,2,3,4,5,6] }}"
data-index="{{ index }}"
data-disabled="{{ timeBean.weekDayList[index].disabled }}"
class="item {{ index==timeBean.selectDay?'select-column':'column' }} {{ timeBean.weekDayList[index].disabled?'disabled':'' }}"
bindtap="itemClick"
wx:key="index"
>
<view class="weekType">{{timeBean.weekDayList[index].week}}</view>
<view class="dateType">{{timeBean.weekDayList[index].day}}</view>
<text class="empty" wx:if="{{ !timeBean.weekDayList[index].disabled && !timeBean.weekDayList[index].hasDailyValue }}">空</text>
</view>
</view>
<view class='line-shadow'></view>
<view class='suspension' bindtap='addMenuClick'>
<text class='iconfont icon-tianjia' style='font-size:60rpx; color:#fff;'></text>
<view class="line-shadow"></view>
<view class="suspension" bindtap="addMenuClick">
<text class="iconfont icon-tianjia" style="font-size:60rpx; color:#fff;"></text>
</view>
\ No newline at end of file
......@@ -119,17 +119,17 @@ page {
height: calc(100% - 100rpx);
}
.box .remark_box {
.remark_box {
padding: 20rpx;
}
.box .remark_box .label {
.remark_box .label {
font-size: 28rpx;
color: #292D33;
margin: 20rpx 0 24rpx 20rpx;
}
.box .remark_box .textArea_box {
.remark_box .textArea_box {
font-size: 28rpx;
background: #F7F8FA;
border: 2rpx solid #EFF0F2;
......@@ -137,11 +137,11 @@ page {
padding: 24rpx;
}
.box .remark_box .textArea_box .textarea {
.remark_box .textArea_box .textarea {
height: 130rpx;
}
.box .remark_box .textArea_box .currentWordNumber {
.remark_box .textArea_box .currentWordNumber {
color: #BEC1C7;
text-align: right;
}
......@@ -350,4 +350,83 @@ page {
background: #347BFF;
border-radius: 12rpx;
color: #FFFFFF;
}
.approvalFromSuperiorsCon {
.title {
font-family: PingFangSC-SNaNrpxibold;
font-weight: 600;
font-size: 28rpx;
color: #292D33;
margin: 32rpx 0 12rpx;
}
.data {
// font-weight: 400;
font-size: 24rpx;
color: #292D33;
}
.tips {
// font-weight: 400;
font-size: 24rpx;
color: #999EA8;
line-height: 36rpx;
margin-bottom: 32rpx;
}
.approvalBox {
width: 100%;
box-sizing: border-box;
background: #FFFFFF;
box-shadow: 0 4rpx 20rpx 0 #0000001a;
border-radius: 16rpx;
.title {
height: 88rpx;
line-height: 88rpx;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 28rpx;
color: #292D33;
padding-left: 40rpx;
border-bottom: 1rpx solid #EFF0F2;
}
.item {
box-sizing: border-box;
padding: 24rpx;
border-bottom: 1rpx solid #EFF0F2;
.content {
font-size: 28rpx;
color: #292D33;
}
.time {
font-size: 24rpx;
color: #999EA8;
text-align: right;
}
}
}
}
.camera-icon {
width: 172rpx;
height: 172rpx;
padding-bottom: 20rpx;
}
.nothingTips {
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 432rpx;
font-size: 24rpx;
color: #BEC1C7;
text-align: center;
}
\ No newline at end of file
......@@ -20,7 +20,8 @@ export const STORAGE_OBJECTkEY = {
posterId: 'posterId',
noSignInUuid: 'noSignInUuid',
outTradeNo: 'outTradeNo',
crowdFundingParams: 'crowdFundingParams'
crowdFundingParams: 'crowdFundingParams',
dateStaffPop: 'dateStaffPop'
}
// export const IMG_VERSION = () => {
......
......@@ -3,59 +3,82 @@
* var weekDay = {week: '',day: ''}
* 参数:selectWeek 0为本周,数字代表前几周或者后几周,例如1是下一周
*/
function getWeekDayList(selectWeek) {
function getWeekDayList(selectWeek, selectDay) {
// 1.获取周一对应得时间
// 2.用循环七次添加周一到周日对应得周几和几号
var selectWeekTime = getCurrentTimeStamp() + selectWeek * 7 * 24 * 60 * 60 * 1000
var selectWeekTime = getCurrentTimeStamp(selectDay) + selectWeek * 7 * 24 * 60 * 60 * 1000
var mondayTime = selectWeekTime - (getWeekNumber(selectWeekTime) - 1) * 24 * 60 * 60 * 1000
// console.log(mondayTime, 'mondayTime')
var timeBean = {
selectDay: 0,
yearMonth: '',
weekDayList: []
}
timeBean.yearMonth = getYearMonth(selectWeekTime)
const yearLabel = getYearMonth(selectWeekTime, '/')
// 获取当前时间戳(以毫秒为单位)
const currentTimestamp = Date.now()
for (var i = 0; i < 7; i++) {
var weekDay = {
week: '',
day: ''
day: '',
disabled: '',
date: ''
}
weekDay.week = getWeek(mondayTime + i * 24 * 60 * 60 * 1000)
weekDay.day = getMyDay(mondayTime + i * 24 * 60 * 60 * 1000)
let dataStr = mondayTime + i * 24 * 60 * 60 * 1000
weekDay.week = getWeek(dataStr)
weekDay.day = getMyDay(dataStr)
weekDay.date = getDataFormat(dataStr)
weekDay.disabled = dataStr > currentTimestamp
timeBean.weekDayList.push(weekDay)
if (i == 0) {
timeBean.starDay = getMyDay(mondayTime + i * 24 * 60 * 60 * 1000)
timeBean.starDay = getMyDay(dataStr)
timeBean.starDayLabel = getYearMonth(dataStr, '/') + '/' + weekDay.day
timeBean.reportStartDate = getDataFormat(dataStr)
}
if (i == 6) {
timeBean.endDayLabel = getYearMonth(dataStr, '/') + '/' + weekDay.day
timeBean.reportEndDate = getDataFormat(dataStr)
// console.log(dataStr)
timeBean.isInCurrentWeek = isTimestampInCurrentWeek(dataStr)
}
// if ( i == 6) {
// timeBean.endDay =
// }
}
timeBean.yearMonth = getYearMonth(selectWeekTime)
timeBean.selectDay = getCurrenrWeek()
timeBean.selectDay = getCurrenrWeek(selectDay)
timeBean.formatYearMonth = getFormatYearMonth(selectWeekTime)
return timeBean
}
//获取当前时间戳 --
function getCurrentTimeStamp() {
var timestamp = new Date().getTime()
function getCurrentTimeStamp(selectDay) {
var timestamp
if (selectDay) {
timestamp = new Date(selectDay).getTime()
} else {
timestamp = new Date().getTime()
}
return timestamp
}
//获取当前周几
function getCurrenrWeek() {
var str = '6012345'.charAt(new Date().getDay())
function getCurrenrWeek(selectDay) {
let str
if (selectDay) {
str = '6012345'.charAt(new Date(selectDay).getDay())
} else {
str = '6012345'.charAt(new Date().getDay())
}
return str
}
//时间戳获得年月
function getYearMonth(res) {
function getYearMonth(res, unit = '-') {
var time = new Date(res)
var y = time.getFullYear()
var m = time.getMonth() + 1
// 将月份转换成两位数的字符串
// var formattedMonth = month < 10 ? '0' + month : '' + month;
return y + '-' + m
return y + unit + m
}
//时间戳获得年月
function getFormatYearMonth(res) {
......@@ -92,7 +115,98 @@ function getWeekNumber(res) {
return '0123456'.charAt(new Date(y + '-' + m + '-' + d).getDay())
}
//时间戳转年月份 --
function getDataFormat(res) {
// const timestamp = 1675372800000; // 时间戳,单位为毫秒
const date = new Date(res)
const year = date.getFullYear().toString()
const month = ('0' + (date.getMonth() + 1)).slice(-2)
const day = ('0' + date.getDate()).slice(-2)
return `${year}-${month}-${day}`
}
function isTimestampInCurrentWeek(timestamp) {
const currentDate = new Date()
const currentDay = currentDate.getDay() // 获取当前日期是星期几
// 计算当前周的起始日期(周一)
const currentWeekStart = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate() - currentDay + 1)
// 计算当前周的结束日期(周日)
const currentWeekEnd = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate() + (7 - currentDay), 23, 59, 59, 999)
const targetDate = new Date(timestamp) // 不再乘以1000
return targetDate >= currentWeekStart && targetDate <= currentWeekEnd
}
function getWeeksDiff(startDate, endDate) {
// 设置一周的第一天为周一
const firstDayOfWeek = 1 // 0表示周日,1表示周一,以此类推
// 获取开始日期和结束日期的时间戳(单位:毫秒)
const startTimestamp = new Date(startDate).getTime()
const endTimestamp = new Date(endDate).getTime()
// 获取结束日期是一周的第几天
const endDateObj = new Date(endDate)
let dayOfWeek = endDateObj.getDay()
// 如果结束日期是一周的第一天(周一),则不需要调整
if (dayOfWeek === firstDayOfWeek) {
dayOfWeek = 0
}
// 计算结束日期距离一周第一天的天数差
const daysDiff = (dayOfWeek + 7 - firstDayOfWeek) % 7
// 计算结束日期距离一周第一天的周数差
const weeksDiff = Math.floor((endTimestamp + daysDiff * 24 * 3600 * 1000 - startTimestamp) / (7 * 24 * 3600 * 1000))
return weeksDiff
}
function isDateWithin7Days(date) {
// console.log(date, 'date');
const oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数
const currentDate = new Date() // 当前日期
const targetDate = new Date(date) // 给定的日期
// 计算给定日期与当前日期的时间差(以毫秒为单位)
const diffMilliseconds = targetDate - currentDate
// 计算时间差对应的天数
const diffDays = Math.floor(diffMilliseconds / oneDay)
// console.log(diffDays, 'diffDays');
return diffDays >= -7
}
function isDateWithin60Days(date) {
const oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数
const currentDate = new Date() // 当前日期
const targetDate = new Date(date) // 给定的日期
// 计算给定日期与当前日期的时间差(以毫秒为单位)
const diffMilliseconds = targetDate - currentDate
// 计算时间差对应的天数
const diffDays = Math.floor(diffMilliseconds / oneDay)
return diffDays >= -60
}
// 示例用法
// const inputDate = '2024-02-15';
// const isWithin7Days = isDateWithin7Days(inputDate);
// console.log(isWithin7Days); // 输出:true
// // 示例用法
// const startDate = '2024-02-19'; // 开始日期
// const endDate = '2024-02-25'; // 结束日期
// const weeksDiff = getWeeksDiff(startDate, endDate);
// console.log("开始日期距离结束日期的周数差:", weeksDiff);
module.exports = {
//把方法共享,让引用的地方可以调用
getWeekDayList: getWeekDayList
getWeekDayList: getWeekDayList,
isDateWithin7Days: isDateWithin7Days,
isDateWithin60Days: isDateWithin60Days
}
......@@ -95,7 +95,7 @@ const setUserInfo = userInfo => {
// console.log(userInfo)
// userInfo.loginrole
const loginRole = userInfo.loginRole
userInfo.isSuper = userInfo?.isSuper?true:false
userInfo.isSuper = userInfo?.isSuper ? true : false
if (loginRole && loginRole == 3) {
userInfo.userType = 1
}
......@@ -109,9 +109,10 @@ const setSessionId = sessionId => {
wx.setStorageSync('dj_boutique_sessionId', sessionId)
}
const removeStorage = () => {
wx.removeStorageSync('noSignInUuid')
wx.removeStorageSync('noSignInUuid')
wx.removeStorageSync('dj_boutique_user_info')
wx.removeStorageSync('dj_boutique_sessionId')
wx.removeStorageSync('dj_boutique_sessionId')
wx.removeStorageSync('dateStaffPop')
}
const showNoAccess = () => {
......@@ -152,9 +153,9 @@ var type = function (data) {
data instanceof Element
? 'element' // 为了统一DOM节点类型输出
: toString
.call(data)
.replace(/\[object\s(.+)\]/, '$1')
.toLowerCase()
.call(data)
.replace(/\[object\s(.+)\]/, '$1')
.toLowerCase()
return dataType
}
/**
......@@ -233,31 +234,31 @@ const pointRecord = clickEventType => {
* @param {boolean} immediate - 是否立即执行一次。若为true,第一次触发会立即执行一次函数。
* @returns {Function} - 返回一个经过防抖处理的函数。
*/
const debounce = (func, delay, immediate)=> {
let timeoutId; // 用于保存定时器ID
return function (...args) {
const context = this; // 保存函数执行时的上下文环境
const executeLater = function () {
// 定义一个延迟执行的函数
timeoutId = null; // 清空定时器ID,用于标记函数可以再次执行
if (!immediate) {
// 如果不是立即执行模式,则执行函数
func.apply(context, args);
}
};
const callNow = immediate && !timeoutId; // 是否立即执行的条件
clearTimeout(timeoutId); // 清除之前的定时器
timeoutId = setTimeout(executeLater, delay); // 创建一个新的定时器
if (callNow) {
// 如果满足立即执行的条件,则立即执行函数
const debounce = (func, delay, immediate) => {
let timeoutId; // 用于保存定时器ID
return function (...args) {
const context = this; // 保存函数执行时的上下文环境
const executeLater = function () {
// 定义一个延迟执行的函数
timeoutId = null; // 清空定时器ID,用于标记函数可以再次执行
if (!immediate) {
// 如果不是立即执行模式,则执行函数
func.apply(context, args);
}
};
}
const callNow = immediate && !timeoutId; // 是否立即执行的条件
clearTimeout(timeoutId); // 清除之前的定时器
timeoutId = setTimeout(executeLater, delay); // 创建一个新的定时器
if (callNow) {
// 如果满足立即执行的条件,则立即执行函数
func.apply(context, args);
}
};
}
/** 刷新工单管理 预约管理数据 */
const refreshPageData = (notRefreshOrder) => {
......@@ -266,10 +267,10 @@ const refreshPageData = (notRefreshOrder) => {
wx.$orderListDateListScreenRefresh = true
}
/** 数组去重保留第二项数据 */
/** 数组去重保留第二项数据 */
const arrayUnique = (arr, name) => {
var hash = {}
return arr.reduce(function(acc, cru, index) {
return arr.reduce(function (acc, cru, index) {
if (!hash[cru[name]]) {
hash[cru[name]] = { index: index }
acc.push(cru)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!