Commit b211790c by 张立顺

feat v4.34.1 功能需求开发

1 parent 5daf2302
...@@ -18,7 +18,7 @@ export const appId = 'wx570d9331f9ace0bd' ...@@ -18,7 +18,7 @@ export const appId = 'wx570d9331f9ace0bd'
* 4预发布 * 4预发布
* 5cdptest * 5cdptest
*/ */
let index = 1 let index = 0
const accountInfo = wx.getAccountInfoSync() const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync() const systemInfo = wx.getSystemInfoSync()
......
...@@ -89,5 +89,6 @@ ...@@ -89,5 +89,6 @@
} }
] ]
} }
} },
"libVersion": "2.30.4"
} }
\ No newline at end of file \ No newline at end of file
...@@ -243,14 +243,15 @@ export const checkScene = options => { ...@@ -243,14 +243,15 @@ export const checkScene = options => {
const pagePath = { const pagePath = {
createArchives: 'tabWorkOrder/pages/createArchives/createArchives', createArchives: 'tabWorkOrder/pages/createArchives/createArchives',
createOrder: 'tabWorkOrder/pages/createOrder/createOrder', createOrder: 'tabWorkOrder/pages/createOrder/createOrder',
followUpOrder: 'tabDate/pages/detail' followUpOrder: 'tabDate/pages/detail',
staffDaily: 'tabWorkOrder/pages/staffDaily/staffDaily'
} }
options.path = pagePath[query.page] options.path = pagePath[query.page]
} }
console.log(options, 'options') console.log(options, 'options')
wx.$SCENE = options wx.$SCENE = options
console.log(options.path, 'options.path') 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) { // if (!userInfo) {
// console.log(userInfo); // console.log(userInfo);
console.log('未登录,请登录。') console.log('未登录,请登录。')
......
...@@ -49,6 +49,9 @@ module.exports = { ...@@ -49,6 +49,9 @@ module.exports = {
userStat(data) { userStat(data) {
return api.post('dj.api.smartcarlife.user.stat', data) return api.post('dj.api.smartcarlife.user.stat', data)
}, },
/** 查询当周员工日报是否填写列表 */
staffDailyReportDetailWeeklyList(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.weekly.list', data)
},
} }
...@@ -4,7 +4,9 @@ import api from '../../api.js' ...@@ -4,7 +4,9 @@ import api from '../../api.js'
import NP from 'number-precision' import NP from 'number-precision'
import { env } from '~/config' import { env } from '~/config'
import { getYQInfo, get4SStoreList } from '~/store/index' import { getYQInfo, get4SStoreList } from '~/store/index'
import router from '../../../router/index.js'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/' const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
var util = require('~/utils/timeFormat/time-utils.js')
const app = getApp() const app = getApp()
let time = null let time = null
Page({ Page({
...@@ -146,7 +148,8 @@ Page({ ...@@ -146,7 +148,8 @@ Page({
scene: 1 scene: 1
} }
get4SStoreList(params).then(result => { get4SStoreList(params).then(result => {
if (!userInfo?.isSuper && !result?.length) { // 缓存记录登录信息 但关联未4s if (!userInfo?.isSuper && !result?.length) {
// 缓存记录登录信息 但关联未4s
userInfo.shopMerchantId = null userInfo.shopMerchantId = null
userInfo.shopMerchantName = null userInfo.shopMerchantName = null
userInfo.sceneType = null userInfo.sceneType = null
...@@ -281,9 +284,7 @@ Page({ ...@@ -281,9 +284,7 @@ Page({
['dateObj.label']: label + '份', ['dateObj.label']: label + '份',
['dateObj.dataMonth']: selectDate ['dateObj.dataMonth']: selectDate
}) })
let { let { merchantRange } = this.data
merchantRange
} = this.data
this.getOutputValue({ this.getOutputValue({
merchantRange merchantRange
}) })
...@@ -555,6 +556,91 @@ Page({ ...@@ -555,6 +556,91 @@ Page({
} }
} }
}, },
staffDailyReport(userInfo) {
let { isStaff } = this.data
// 获取当前日期
if (isStaff) {
const { merchantId, merchantName, name, uuid, shopMerchantId, shopMerchantName } = userInfo
let timeBean = util.getWeekDayList(0)
let params = {
yqMerchantId: merchantId,
yqMerchantName: merchantName,
staffName: name,
staffUuid: uuid,
// shopMerchantId: shopMerchantId,
// shopMerchantName: shopMerchantName
merchantId: shopMerchantId,
merchantName: shopMerchantName,
...timeBean
}
api.staffDailyReportDetailWeeklyList(params).then(res => {
let { code, data, message } = res
if (code == 0) {
console.log(data, 'data')
// timeBean.weekDayList = timeBean.weekDayList.map((item, index) => {
// // item.weeklyList = data[index]
// item.hasDailyValue = data.includes(item.date)
// return item
// })
// timeBean
let dateStaffPop = wx.$storage.get('dateStaffPop')
// 判断 有没有填写日报
let hasNeedReport = timeBean.weekDayList.find((item, index) => {
// item.hasDailyValue =
return !data.includes(item.date) && !item.disabled
})
console.log(hasNeedReport, 'hasNeedReport')
let nowDate = new Date().format('yyyy-MM-dd')
let num = 0
if (dateStaffPop?.date && nowDate == dateStaffPop?.date) {
num = dateStaffPop?.num || 0
num = num + 1
} else {
num = num + 1
}
if (num <= 2 && hasNeedReport) {
// if (num <= 2) {
// wx.$util.showToast('驻店日报未填写,请及时填写')
wx.showModal({
title: '日报提醒',
content: '您有未填写的日报,请点击前往。',
showCancel: true,
cancelText: '取消', // '取消
cancelColor: '#292D33',
confirmText: '前往填写',
confirmColor: '#347BFF',
success(res) {
if (res.confirm) {
wx.$router.go('tabWorkOrder.staffDaily', {
reportDate: hasNeedReport.date
})
}
}
})
// }
}
// let num = hasNeedReport ? dateStaffPop?.num + 1 : dateStaffPop?.num
console.log(num)
wx.$storage.set('dateStaffPop', {
date: new Date().format('yyyy-MM-dd'),
num
})
console.log(hasNeedReport, 'hasNeedReport')
this.setData({
// weeklyList: data
// timeBean
})
} else {
wx.$util.showToast(message)
}
})
// this.setData({
// timeBean: util.getWeekDayList(this.data.selectWeek)
// })
}
},
onRoute(options) { onRoute(options) {
options && this.checkShowOrderPop(options) options && this.checkShowOrderPop(options)
// options && options.resetStoreList && this.get4SStoreList() // options && options.resetStoreList && this.get4SStoreList()
...@@ -562,7 +648,7 @@ Page({ ...@@ -562,7 +648,7 @@ Page({
// listStatus 0 待跟进 1已升级 2战败 3待支付 // listStatus 0 待跟进 1已升级 2战败 3待支付
if (options?.isGoPage) { if (options?.isGoPage) {
// status 1待跟进(有inviteRecordId跳转预约详情无跳转待跟进工单页面 微信支付跳转工单确认页面)3待支付(跳转工单确认页面)constructionFlag(已施工页面) // status 1待跟进(有inviteRecordId跳转预约详情无跳转待跟进工单页面 微信支付跳转工单确认页面)3待支付(跳转工单确认页面)constructionFlag(已施工页面)
let pageName = (options?.status == 1 && options?.pageParams?.id) ? 'tabDate.detail' : (options.status == 3 || (options.status == 1 && options.selectPayType == 1)) ? 'tabWorkOrder.confirmOrder' : options.constructionFlag == 'Y' && options.status != 10 ? 'tabWorkOrder.constructionOrderDetail' : 'tabWorkOrder.orderDetail' let pageName = options?.status == 1 && options?.pageParams?.id ? 'tabDate.detail' : options.status == 3 || (options.status == 1 && options.selectPayType == 1) ? 'tabWorkOrder.confirmOrder' : options.constructionFlag == 'Y' && options.status != 10 ? 'tabWorkOrder.constructionOrderDetail' : 'tabWorkOrder.orderDetail'
wx.$router.go(`${pageName}?id=${options?.pageParams?.id}&orderCode=${options?.pageParams?.orderCode}`, { ...options?.pageParams }) wx.$router.go(`${pageName}?id=${options?.pageParams?.id}&orderCode=${options?.pageParams?.orderCode}`, { ...options?.pageParams })
} }
}, },
...@@ -622,6 +708,15 @@ Page({ ...@@ -622,6 +708,15 @@ Page({
icon: 'business_data' icon: 'business_data'
} }
] ]
// 判断是超管再加 这个菜单
if (userInfo.isSuper) {
menu.push({
name: '驻店日报',
url: 'tabWorkOrder.staffDaily',
recordId: 13,
icon: 'staffreport'
})
}
} }
if (checklist.includes(userInfo?.accountName)) { if (checklist.includes(userInfo?.accountName)) {
menu = menu.filter(e => e.name != '预约管理') menu = menu.filter(e => e.name != '预约管理')
...@@ -659,6 +754,8 @@ Page({ ...@@ -659,6 +754,8 @@ Page({
} }
// 如果是员工 开启订单补录轮询 // 如果是员工 开启订单补录轮询
this.getWaitOrder() this.getWaitOrder()
// 如果是员工 判读是否要填写日报
this.staffDailyReport(userInfo)
if (userInfo) { if (userInfo) {
this.initData(userInfo) this.initData(userInfo)
this.setData({ this.setData({
......
...@@ -178,6 +178,7 @@ page ::-webkit-scrollbar { ...@@ -178,6 +178,7 @@ page ::-webkit-scrollbar {
grid-template-columns: repeat(4, 100rpx); grid-template-columns: repeat(4, 100rpx);
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding-bottom: 50rpx;
.label { .label {
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 24rpx; font-size: 24rpx;
......
...@@ -63,11 +63,18 @@ export default { ...@@ -63,11 +63,18 @@ export default {
icon: 'business_data' icon: 'business_data'
}, },
{ {
name: '驻店日报',
url: 'tabWorkOrder.staffDaily',
recordId: 13,
icon: 'staffreport'
},
{
name: '生意助手', name: '生意助手',
type:"mini", type: "mini",
recordId: 12, recordId: 12,
icon: 'boutique-syzs' icon: 'boutique-syzs'
} },
], ],
totalTableSum: [ totalTableSum: [
{ {
...@@ -114,7 +121,7 @@ export default { ...@@ -114,7 +121,7 @@ export default {
index: 2, index: 2,
url: 'pages.tabDateIndex', url: 'pages.tabDateIndex',
icon: 'icon_14', icon: 'icon_14',
activeIndex:1 activeIndex: 1
}, },
{ {
name: '待预约客户', name: '待预约客户',
...@@ -122,23 +129,23 @@ export default { ...@@ -122,23 +129,23 @@ export default {
index: 3, index: 3,
url: 'pages.tabDateIndex', url: 'pages.tabDateIndex',
icon: 'icon_2', icon: 'icon_2',
activeIndex:2 activeIndex: 2
}, },
{ {
name: '转化订单', name: '转化订单',
itemName: 'totalUpgrade', itemName: 'totalUpgrade',
index: 4, index: 4,
url:'pages.index', url: 'pages.index',
icon: 'icon_17', icon: 'icon_17',
activeIndex:2 activeIndex: 2
}, },
{ {
name: '战败订单', name: '战败订单',
itemName: 'totalNotUpgrade', itemName: 'totalNotUpgrade',
index: 5, index: 5,
url:'pages.index', url: 'pages.index',
icon: 'icon_16', icon: 'icon_16',
activeIndex:3 activeIndex: 3
}, },
{ {
name: '客单价', name: '客单价',
......
...@@ -171,5 +171,9 @@ module.exports = { ...@@ -171,5 +171,9 @@ module.exports = {
/** 查询当周员工日报是否填写列表 */ /** 查询当周员工日报是否填写列表 */
staffDailyReportDetailWeeklyList(data) { staffDailyReportDetailWeeklyList(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.weekly.list', 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)
} }
} }
...@@ -6,27 +6,39 @@ Component({ ...@@ -6,27 +6,39 @@ Component({
/** * 组件的属性列表 * 用于组件自定义设置 */ /** * 组件的属性列表 * 用于组件自定义设置 */
properties: { properties: {
timeBean: { // 属性名 在wxml调用组件时利用该属性传递组件显示的数据 timeBean: {
// 属性名 在wxml调用组件时利用该属性传递组件显示的数据
type: Object, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型) type: Object, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)
value: ''// 属性初始值(可选),如果未指定则会根据类型选择一个 value: '' // 属性初始值(可选),如果未指定则会根据类型选择一个
}, }
// weeklyList: {
// type: Array,
// value: []
// }
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
lastWeek:function(e){ //点击了上一周 lastWeek: function (e) {
this.triggerEvent("lastWeek") //点击了上一周
this.triggerEvent('lastWeek')
}, },
nextWeek:function(e){ //点击了下一周 nextWeek: function (e) {
this.triggerEvent("nextWeek") //点击了下一周
this.triggerEvent('nextWeek')
}, },
itemClick: function (e) { //点击了某一日,传递该日的下标 itemClick: function (e) {
//点击了某一日,传递该日的下标
// 超过当前时间不可点击
if (e.currentTarget.dataset.disabled) {
return
}
var index = e.currentTarget.dataset.index var index = e.currentTarget.dataset.index
this.triggerEvent("dayClick", index); this.triggerEvent('dayClick', index)
}, }
} }
}) })
...@@ -35,9 +35,26 @@ ...@@ -35,9 +35,26 @@
background: #347BFF; 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 { .timeType {
font-size: 35rpx; font-size: 35rpx;
font-weight: bold; font-weight: bold;
// margin-right: auto;
} }
.dateType { .dateType {
...@@ -56,6 +73,10 @@ ...@@ -56,6 +73,10 @@
background-color: gainsboro; background-color: gainsboro;
} }
.lastweek {
width: 144rpx;
}
.line-shadow { .line-shadow {
height: 3rpx; height: 3rpx;
width: 100%; width: 100%;
...@@ -84,6 +105,23 @@ ...@@ -84,6 +105,23 @@
-moz-osx-font-smoothing: grayscale; -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--> <!--tabWorkOrder/pages/staffDaily/weekCalendar/weekCalendar.wxml-->
<!--compoents/weekCalendar/weekCalendar.wxml--> <!--compoents/weekCalendar/weekCalendar.wxml-->
<view class='line'></view> <view class="line"></view>
<view class="row">
<view class='row'> <view class="row" bindtap="lastWeek">
<view class='row' bindtap='lastWeek'> <text class="iconfont icon-sanjiaoleft" style="padding:15rpx;color:#999999"></text>
<text class='iconfont icon-sanjiaoleft' style='padding:15rpx;color:#999999'></text> <view style="font-size:28rpx;color:#999999">上一周</view>
<view style='font-size:28rpx;color:#999999'>上一周</view>
</view> </view>
<view class='timeType'>{{timeBean.yearMonth}}</view> <view class="timeType">{{timeBean.yearMonth}}</view>
<view class='row' bindtap='nextWeek'> <view class="row lastweek" bindtap="nextWeek">
<view style='font-size:28rpx; color:#999999'>下一周</view> <block wx:if="{{ !timeBean.isInCurrentWeek }}">
<text class='iconfont icon-sanjiaoright' style='padding:15rpx;color:#999999'></text> <view style="font-size:28rpx; color:#999999">下一周</view>
<text class="iconfont icon-sanjiaoright" style="padding:15rpx;color:#999999"></text>
</block>
</view> </view>
</view> </view>
<view class="row">
<view class='row'> <view
<view wx:for="0123456" data-index="{{index}}" class='{{index==timeBean.selectDay?"select-column":"column"}}' bindtap='itemClick' wx:key="index"> wx:for="{{ [0,1,2,3,4,5,6] }}"
<view class='weekType'>{{timeBean.weekDayList[index].week}}</view> data-index="{{ index }}"
<view class='dateType'>{{timeBean.weekDayList[index].day}}</view> data-disabled="{{ timeBean.weekDayList[index].disabled }}"
<text class='iconfont icon-mifan' style='color:#fff'></text> 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> </view>
<view class="line-shadow"></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='suspension' bindtap='addMenuClick'>
<text class='iconfont icon-tianjia' style='font-size:60rpx; color:#fff;'></text>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -119,17 +119,17 @@ page { ...@@ -119,17 +119,17 @@ page {
height: calc(100% - 100rpx); height: calc(100% - 100rpx);
} }
.box .remark_box { .remark_box {
padding: 20rpx; padding: 20rpx;
} }
.box .remark_box .label { .remark_box .label {
font-size: 28rpx; font-size: 28rpx;
color: #292D33; color: #292D33;
margin: 20rpx 0 24rpx 20rpx; margin: 20rpx 0 24rpx 20rpx;
} }
.box .remark_box .textArea_box { .remark_box .textArea_box {
font-size: 28rpx; font-size: 28rpx;
background: #F7F8FA; background: #F7F8FA;
border: 2rpx solid #EFF0F2; border: 2rpx solid #EFF0F2;
...@@ -137,11 +137,11 @@ page { ...@@ -137,11 +137,11 @@ page {
padding: 24rpx; padding: 24rpx;
} }
.box .remark_box .textArea_box .textarea { .remark_box .textArea_box .textarea {
height: 130rpx; height: 130rpx;
} }
.box .remark_box .textArea_box .currentWordNumber { .remark_box .textArea_box .currentWordNumber {
color: #BEC1C7; color: #BEC1C7;
text-align: right; text-align: right;
} }
...@@ -351,3 +351,82 @@ page { ...@@ -351,3 +351,82 @@ page {
border-radius: 12rpx; border-radius: 12rpx;
color: #FFFFFF; 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 \ No newline at end of file
...@@ -24,46 +24,13 @@ ...@@ -24,46 +24,13 @@
</view> </view>
<view class="box"> <view class="box">
<gl-cell-staff border valueAlign="right" labelText="每日按门店填写新车交付数" label="新车交付数" requiredAfter labelWidth="375rpx" required> <gl-cell-staff border valueAlign="right" labelText="每日按门店填写新车交付数" label="新车交付数" requiredAfter labelWidth="375rpx" required>
<input <input placeholder="点击输入" class="input" placeholder-class="placeholder-class" maxlength="3" type="number" value="{{ orderObj.deliveryCount }}" bindinput="input" data-name="deliveryCount" disabled="{{ (role != 'staff'|| !orderObj.isDateWithin7Days) && (role != 'super'|| !orderObj.isDateWithin60Days) }}" always-embed></input>
placeholder="点击输入"
class="input"
placeholder-class="placeholder-class"
maxlength="3"
type="number"
value="{{ orderObj.deliveryCount }}"
bindinput="input"
data-name="deliveryCount"
disabled="{{ role != 'staff' && role != 'super' }}"
always-embed
></input>
</gl-cell-staff> </gl-cell-staff>
<gl-cell-staff border valueAlign="right" labelText="每日填写本人该业务的接待客户数" label="到店流量(太阳膜)" requiredAfter labelWidth="375rpx" required> <gl-cell-staff border valueAlign="right" labelText="每日填写本人该业务的接待客户数" label="到店流量(太阳膜)" requiredAfter labelWidth="375rpx" required>
<input <input placeholder="点击输入" class="input" type="number" placeholder-class="placeholder-class" maxlength="3" value="{{ orderObj.filmToShopCount }}" bindinput="input" data-name="filmToShopCount" disabled="{{ role != 'staff' || !orderObj.isDateWithin7Days }}" always-embed></input>
placeholder="点击输入"
class="input"
type="number"
placeholder-class="placeholder-class"
maxlength="3"
value="{{ orderObj.filmToShopCount }}"
bindinput="input"
data-name="filmToShopCount"
disabled="{{ role != 'staff' }}"
always-embed
></input>
</gl-cell-staff> </gl-cell-staff>
<gl-cell-staff border valueAlign="right" labelText="每日填写本人该业务的接待客户数" label="到店流量(会员权益)" requiredAfter labelWidth="375rpx" required> <gl-cell-staff border valueAlign="right" labelText="每日填写本人该业务的接待客户数" label="到店流量(会员权益)" requiredAfter labelWidth="375rpx" required>
<input <input placeholder="点击输入" class="input" type="number" placeholder-class="placeholder-class" maxlength="3" value="{{ orderObj.equityToShopCount }}" bindinput="input" data-name="equityToShopCount" disabled="{{ role != 'staff' || !orderObj.isDateWithin7Days }}" always-embed></input>
placeholder="点击输入"
class="input"
type="number"
placeholder-class="placeholder-class"
maxlength="3"
value="{{ orderObj.equityToShopCount }}"
bindinput="input"
data-name="equityToShopCount"
disabled="{{ role != 'staff' }}"
always-embed
></input>
</gl-cell-staff> </gl-cell-staff>
<view class="user-portrait"> <view class="user-portrait">
<view wx:for="{{ formData }}" wx:key="index"> <view wx:for="{{ formData }}" wx:key="index">
...@@ -84,16 +51,7 @@ ...@@ -84,16 +51,7 @@
/> />
</view> --> </view> -->
<view wx:if="{{ item.optionList }}" class="check-block"> <view wx:if="{{ item.optionList }}" class="check-block">
<view <view class="check-box {{ subItem.active ? 'active' : '' }}" wx:for="{{ item.optionList }}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx" bindtap="click" data-pidx="{{ index }}" data-idx="{{ idx }}">
class="check-box {{ subItem.active ? 'active' : '' }}"
wx:for="{{ item.optionList }}"
wx:for-item="subItem"
wx:for-index="idx"
wx:key="idx"
bindtap="click"
data-pidx="{{ index }}"
data-idx="{{ idx }}"
>
{{subItem.confName}} {{subItem.confName}}
<image wx:if="{{ item.isMult && subItem.active }}" class="mult" src="../../images/check-active.png"></image> <image wx:if="{{ item.isMult && subItem.active }}" class="mult" src="../../images/check-active.png"></image>
</view> </view>
...@@ -103,44 +61,41 @@ ...@@ -103,44 +61,41 @@
<view class="remark_box"> <view class="remark_box">
<view class="label">备注</view> <view class="label">备注</view>
<view class="textArea_box"> <view class="textArea_box">
<textarea <textarea value="{{ orderObj.remark }}" maxlength="800" placeholder="请输入" class="textarea" bindinput="remarkInput" disabled="{{ role != 'staff' || !orderObj.isDateWithin7Days }}" />
value="{{ orderObj.remark }}"
maxlength="800"
placeholder="请输入"
class="textarea"
bindinput="remarkInput"
disabled="{{ role != 'staff' }}"
/>
<view class="currentWordNumber">{{currentWordNumber || 0}} / 800</view> <view class="currentWordNumber">{{currentWordNumber || 0}} / 800</view>
</view> </view>
</view> </view>
</view> </view>
<view class="approvalFromSuperiorsCon"> <view class="approvalFromSuperiorsCon">
<view class="title">上级批复</view> <view class="title">
上级批复
<text class="data">({{timeBean.starDayLabel+ '-' + timeBean.endDayLabel}})</text>
</view>
<view class="tips">数据来源生意助手小程序,每周更新</view> <view class="tips">数据来源生意助手小程序,每周更新</view>
<!-- approval --> <!-- approval -->
<view class="approvalBox"> <view class="approvalBox">
<block wx:if="{{approvalList.length}}">
<view class="title">历史记录</view> <view class="title">历史记录</view>
<block wx:for="{{ approvalList }}" wx:key="index" wx:for-item="item" wx:for-index="idx"> <block wx:for="{{ approvalList }}" wx:key="index" wx:for-item="item" wx:for-index="idx">
<view class="item"> <view class="item">
<view class="content">{{ item.remark }}</view> <view class="content">{{ item.approvedContent }}</view>
<view class="time">{{ item.createTime }} 区域督导</view> <view class="time">{{ item.createdDate }} {{item.approvedBy}}</view>
</view>
</block>
</block>
<block wx:if="{{!approvalList.length}}">
<view class="nothingTips">
<gl-image class="camera-icon" webp src="/no_data_bg.png"></gl-image>
暂无数据
</view> </view>
</block> </block>
<block> <view class="remark_box" wx:if="{{ role == 'other' }}">
<view class="label">填写批复</view> <view class="label">填写批复</view>
<view class="textArea_box"> <view class="textArea_box">
<textarea <textarea value="{{ approvedContent }}" maxlength="800" placeholder="请输入" class="textarea" bindinput="approveRemarkInput" disabled="{{ role != 'staff' }}" />
value="{{ orderObj.remark }}" <view class="currentWordNumber">{{approvedContentCurrentWordNumber || 0}} / 800</view>
maxlength="800" </view>
placeholder="请输入"
class="textarea"
bindinput="remarkInput"
disabled="{{ role != 'staff' }}"
/>
<view class="currentWordNumber">{{currentWordNumber || 0}} / 800</view>
</view> </view>
</block>
</view> </view>
</view> </view>
</view> </view>
...@@ -153,12 +108,5 @@ ...@@ -153,12 +108,5 @@
</view> </view>
</view> </view>
</view> </view>
<store-picker <store-picker subIndex="{{ subIndex }}" pickList="{{ rangeList }}" show="{{ showPicker }}" bindsearch="getListShop4s" bindconfirm="changePicker" pickerType="{{ pickerType }}" />
subIndex="{{ subIndex }}"
pickList="{{ rangeList }}"
show="{{ showPicker }}"
bindsearch="getListShop4s"
bindconfirm="changePicker"
pickerType="{{ pickerType }}"
/>
<!-- </block> --> <!-- </block> -->
\ No newline at end of file \ No newline at end of file
...@@ -20,7 +20,8 @@ export const STORAGE_OBJECTkEY = { ...@@ -20,7 +20,8 @@ export const STORAGE_OBJECTkEY = {
posterId: 'posterId', posterId: 'posterId',
noSignInUuid: 'noSignInUuid', noSignInUuid: 'noSignInUuid',
outTradeNo: 'outTradeNo', outTradeNo: 'outTradeNo',
crowdFundingParams: 'crowdFundingParams' crowdFundingParams: 'crowdFundingParams',
dateStaffPop: 'dateStaffPop'
} }
// export const IMG_VERSION = () => { // export const IMG_VERSION = () => {
......
...@@ -3,59 +3,82 @@ ...@@ -3,59 +3,82 @@
* var weekDay = {week: '',day: ''} * var weekDay = {week: '',day: ''}
* 参数:selectWeek 0为本周,数字代表前几周或者后几周,例如1是下一周 * 参数:selectWeek 0为本周,数字代表前几周或者后几周,例如1是下一周
*/ */
function getWeekDayList(selectWeek) { function getWeekDayList(selectWeek, selectDay) {
// 1.获取周一对应得时间 // 1.获取周一对应得时间
// 2.用循环七次添加周一到周日对应得周几和几号 // 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 var mondayTime = selectWeekTime - (getWeekNumber(selectWeekTime) - 1) * 24 * 60 * 60 * 1000
// console.log(mondayTime, 'mondayTime')
var timeBean = { var timeBean = {
selectDay: 0, selectDay: 0,
yearMonth: '', yearMonth: '',
weekDayList: [] weekDayList: []
} }
timeBean.yearMonth = getYearMonth(selectWeekTime)
const yearLabel = getYearMonth(selectWeekTime, '/')
// 获取当前时间戳(以毫秒为单位)
const currentTimestamp = Date.now()
for (var i = 0; i < 7; i++) { for (var i = 0; i < 7; i++) {
var weekDay = { var weekDay = {
week: '', week: '',
day: '' day: '',
disabled: '',
date: ''
} }
weekDay.week = getWeek(mondayTime + i * 24 * 60 * 60 * 1000) let dataStr = mondayTime + i * 24 * 60 * 60 * 1000
weekDay.day = getMyDay(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) timeBean.weekDayList.push(weekDay)
if (i == 0) { 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(selectDay)
timeBean.selectDay = getCurrenrWeek()
timeBean.formatYearMonth = getFormatYearMonth(selectWeekTime) timeBean.formatYearMonth = getFormatYearMonth(selectWeekTime)
return timeBean return timeBean
} }
//获取当前时间戳 -- //获取当前时间戳 --
function getCurrentTimeStamp() { function getCurrentTimeStamp(selectDay) {
var timestamp = new Date().getTime() var timestamp
if (selectDay) {
timestamp = new Date(selectDay).getTime()
} else {
timestamp = new Date().getTime()
}
return timestamp return timestamp
} }
//获取当前周几 //获取当前周几
function getCurrenrWeek() { function getCurrenrWeek(selectDay) {
var str = '6012345'.charAt(new Date().getDay()) let str
if (selectDay) {
str = '6012345'.charAt(new Date(selectDay).getDay())
} else {
str = '6012345'.charAt(new Date().getDay())
}
return str return str
} }
//时间戳获得年月 //时间戳获得年月
function getYearMonth(res) { function getYearMonth(res, unit = '-') {
var time = new Date(res) var time = new Date(res)
var y = time.getFullYear() var y = time.getFullYear()
var m = time.getMonth() + 1 var m = time.getMonth() + 1
// 将月份转换成两位数的字符串 // 将月份转换成两位数的字符串
// var formattedMonth = month < 10 ? '0' + month : '' + month; // var formattedMonth = month < 10 ? '0' + month : '' + month;
return y + '-' + m return y + unit + m
} }
//时间戳获得年月 //时间戳获得年月
function getFormatYearMonth(res) { function getFormatYearMonth(res) {
...@@ -92,7 +115,98 @@ function getWeekNumber(res) { ...@@ -92,7 +115,98 @@ function getWeekNumber(res) {
return '0123456'.charAt(new Date(y + '-' + m + '-' + d).getDay()) 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 = { module.exports = {
//把方法共享,让引用的地方可以调用 //把方法共享,让引用的地方可以调用
getWeekDayList: getWeekDayList getWeekDayList: getWeekDayList,
isDateWithin7Days: isDateWithin7Days,
isDateWithin60Days: isDateWithin60Days
} }
...@@ -95,7 +95,7 @@ const setUserInfo = userInfo => { ...@@ -95,7 +95,7 @@ const setUserInfo = userInfo => {
// console.log(userInfo) // console.log(userInfo)
// userInfo.loginrole // userInfo.loginrole
const loginRole = userInfo.loginRole const loginRole = userInfo.loginRole
userInfo.isSuper = userInfo?.isSuper?true:false userInfo.isSuper = userInfo?.isSuper ? true : false
if (loginRole && loginRole == 3) { if (loginRole && loginRole == 3) {
userInfo.userType = 1 userInfo.userType = 1
} }
...@@ -112,6 +112,7 @@ const removeStorage = () => { ...@@ -112,6 +112,7 @@ const removeStorage = () => {
wx.removeStorageSync('noSignInUuid') wx.removeStorageSync('noSignInUuid')
wx.removeStorageSync('dj_boutique_user_info') wx.removeStorageSync('dj_boutique_user_info')
wx.removeStorageSync('dj_boutique_sessionId') wx.removeStorageSync('dj_boutique_sessionId')
wx.removeStorageSync('dateStaffPop')
} }
const showNoAccess = () => { const showNoAccess = () => {
...@@ -233,7 +234,7 @@ const pointRecord = clickEventType => { ...@@ -233,7 +234,7 @@ const pointRecord = clickEventType => {
* @param {boolean} immediate - 是否立即执行一次。若为true,第一次触发会立即执行一次函数。 * @param {boolean} immediate - 是否立即执行一次。若为true,第一次触发会立即执行一次函数。
* @returns {Function} - 返回一个经过防抖处理的函数。 * @returns {Function} - 返回一个经过防抖处理的函数。
*/ */
const debounce = (func, delay, immediate)=> { const debounce = (func, delay, immediate) => {
let timeoutId; // 用于保存定时器ID let timeoutId; // 用于保存定时器ID
return function (...args) { return function (...args) {
...@@ -257,7 +258,7 @@ const debounce = (func, delay, immediate)=> { ...@@ -257,7 +258,7 @@ const debounce = (func, delay, immediate)=> {
func.apply(context, args); func.apply(context, args);
} }
}; };
} }
/** 刷新工单管理 预约管理数据 */ /** 刷新工单管理 预约管理数据 */
const refreshPageData = (notRefreshOrder) => { const refreshPageData = (notRefreshOrder) => {
...@@ -269,7 +270,7 @@ const refreshPageData = (notRefreshOrder) => { ...@@ -269,7 +270,7 @@ const refreshPageData = (notRefreshOrder) => {
/** 数组去重保留第二项数据 */ /** 数组去重保留第二项数据 */
const arrayUnique = (arr, name) => { const arrayUnique = (arr, name) => {
var hash = {} var hash = {}
return arr.reduce(function(acc, cru, index) { return arr.reduce(function (acc, cru, index) {
if (!hash[cru[name]]) { if (!hash[cru[name]]) {
hash[cru[name]] = { index: index } hash[cru[name]] = { index: index }
acc.push(cru) acc.push(cru)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!