Commit c699b9f3 by 张立顺

feat 功能开发

1 parent 33a8eedd
Showing 25 changed files with 1547 additions and 27 deletions
// const api = wx.$request
import api from '~/utils/request/request.js'
// const api = wx.$request
module.exports = {
/** 查询当周员工日报是否填写列表 */
dailyReportWeekly(data) {
return api.post({
method: 'dj.api.sale.staff.dailyReport.weekly.list',
...data,
})
},
/** 销售员工日报详情查询 */
dailyReportWeeklyDetail(data) {
return api.post({
method: 'dj.api.sale.staff.dailyReport.detail',
...data,
})
},
/** 销售员工日报填报 */
dailyReportSave(data) {
return api.post({
method: 'dj.api.sale.staff.dailyReport.save',
...data,
})
},
/** 大区经理、总监视角销售人员日报查询 */
dailyReportSelect(data) {
return api.post({
method: 'dj.api.manager.staff.dailyReport.select',
...data,
})
},
}
var replaceItemText = function (item) {
var reg = getRegExp(';~;', 'g')
// return item.replace(reg, ' ')
return item ? item.replace(reg, ' ') : null
}
var isIncludesItem = function (list, item) {
//
// console.log(list.indexOf(item))
// var flag = list.indexOf(item)
return list.indexOf(item) != -1
}
var formatPosition = function (item, positionTypeList) {
var filterData = positionTypeList.filter(function (v) {
return v.positionValue == item
})
return (
(filterData.length && filterData[0] && filterData[0].positionName) || ''
)
}
var isDateWithin7Days = function (date) {
// console.log(date, 'date');
var oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数
var currentDate = getDate() // 当前日期
var targetDate = getDate(date) // 给定的日期
// 计算给定日期与当前日期的时间差(以毫秒为单位)
var diffMilliseconds = targetDate - currentDate
// 计算时间差对应的天数
var diffDays = Math.floor(diffMilliseconds / oneDay)
// console.log(diffDays, 'diffDays');
return diffDays >= -7
}
var isDateWithin1Days = function (date) {
// console.log(date, 'date');
var oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数
var currentDate = getDate() // 当前日期
var targetDate = getDate(date) // 给定的日期
// 计算给定日期与当前日期的时间差(以毫秒为单位)
var diffMilliseconds = targetDate - currentDate
// 计算时间差对应的天数
var diffDays = Math.floor(diffMilliseconds / oneDay)
// console.log(diffDays, 'diffDays');
return diffDays >= -1
}
var isDateWithin60Days = function (date) {
var oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数
var currentDate = getDate() // 当前日期
var targetDate = getDate(date) // 给定的日期
// 计算给定日期与当前日期的时间差(以毫秒为单位)
var diffMilliseconds = targetDate - currentDate
// 计算时间差对应的天数
var diffDays = Math.floor(diffMilliseconds / oneDay)
return diffDays >= -60
}
var filterIncludes = function (item, arr) {
return arr.indexOf(item) > -1
}
var filterTemplateList = function (arr, value) {
if (value == 3) {
return arr.filter(function (item) {
return item.templateValue != 3
})
} else {
return arr
}
}
var filterDisabled = function (role, date, disabledStatus) {
// console.log(role, weeklyList)
if (role == 'staff') {
// 员工七天内可操作
return (
// && !disabledStatus
// (weeklyList.indexOf(date) > -1 ) ||
!isDateWithin1Days(date)
)
} else{
return false;
}
// else if (role == 'super') {
// // 超管60天内可操作
// return (
// (weeklyList.indexOf(date) > -1 && !disabledStatus) ||
// !isDateWithin60Days(date)
// )
// } else {
// return !disabledStatus
// }
}
var filterShowBtn = function (list) {
var arr = list.filter(function (val) {
return val.status == 2
})
return arr
}
// 判断子订单数据和退款申请已选子订单数据状态
var filterOrderStatus = function (infoData) {
var flag = true
var subOrderList = infoData.subOrderList
var refundApplyDetailList = infoData.refundApplyDetailList
subOrderList.forEach(function (val) {
refundApplyDetailList && refundApplyDetailList.forEach(function (v) {
if (val.subOrderCode == v.subOrderCode && val.status == 2) flag = false
})
})
return flag
}
// 判断退款详情是否可操作
var filterRefundDisabled = function (infoData, userInfo,) {
var afterStatus = infoData.afterStatus
var subOrderList = infoData.subOrderList
var refundApplyDetailList = infoData.refundApplyDetailList
var loginRole = userInfo.loginRole
var flag = false
subOrderList.forEach(function (val) {
refundApplyDetailList && refundApplyDetailList.forEach(function (v) {
if (val.subOrderCode == v.subOrderCode && val.status == 2) flag = true
})
})
return afterStatus === 0
|| (afterStatus && afterStatus != 5)
|| loginRole == 3
|| (afterStatus == 5 && flag)
}
/*
* 导出
*/
module.exports = {
replaceItemText: replaceItemText,
isIncludesItem: isIncludesItem,
formatPosition: formatPosition,
filterIncludes: filterIncludes,
filterDisabled: filterDisabled,
filterTemplateList: filterTemplateList,
filterShowBtn: filterShowBtn,
filterOrderStatus: filterOrderStatus,
filterRefundDisabled: filterRefundDisabled
}
// components/GlCell/GlCell.js
Component({
options: {
styleIsolation: 'apply-shared'
// styleIsolation: 'shared'
},
/**
* 组件的属性列表
*/
properties: {
label: String,
border: Boolean,
haveArrow: Boolean,
value: String,
valueAlign: String,
required: Boolean,
placeholder: String,
iconSrc: String,
labelStyle: String,
cellStyle: String,
cellBoxStyle: String,
labelText: String,
headerSlot: String,
labelWidth: {
type: String,
value: 'var(--fontSize300)'
},
background: {
type: String,
value: '#FFFFFF'
},
cellHeight: {
type: Boolean,
value: true
},
requiredBefore: {
type: Boolean,
value: true
},
requiredAfter: {
type: Boolean,
value: false,
observer: function (n, o) {
if (n) {
this.setData({
requiredBefore: false
})
}
}
},
disabled: Boolean,
titleBtn: String
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
click(e) {
if (this.data.disabled) return
this.triggerEvent('click')
},
titleClick() {
this.triggerEvent('titleClick')
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<view class="cell-box" style="background:{{ background}};{{cellBoxStyle }}">
<view class="cell {{ cellHeight?'cellHeight': ''}} {{border?'border':'' }}" style="{{ cellStyle }}" bindtap="click">
<view class="cell-label title-style" style="width:{{ labelWidth}};{{labelStyle }}" bindtap="titleClick">
<view class="header">
<text wx:if="{{ required&&requiredBefore }}" class="required">*</text>
{{label||'标题'}}
<!-- <slot name='headerSlot'></slot> -->
<text class="headerSlot" wx:if="{{headerSlot}}">{{headerSlot}}</text>
<text wx:if="{{ required&&requiredAfter }}" class="required">*</text>
<image webp class="titleIcon" wx:if="{{ iconSrc }}" src="{{ iconSrc }}" />
<text class="titleBtn" wx:if="{{ titleBtn }}">{{titleBtn}}</text>
</view>
<view class="footer" wx:if="{{ labelText }}">{{labelText}}</view>
</view>
<view class="cell-value" style="width:calc(100% - {{ labelWidth }});">
<view class="value ">
<view class="slot">
<slot />
</view>
<block wx:if="{{ value }}">
<view class="details">{{value}}</view>
</block>
<block wx:if="{{ placeholder }}">
<view class="placeholder">{{placeholder}}</view>
</block>
</view>
<!-- <image wx:if="{{ haveArrow }}" class="arrow" src="../images/arrow-x.png" /> -->
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* components/GlCell/GlCell.wxss */
.cell-box {
background: #fff;
font-size: var(--fontSize28);
color: #333333;
box-sizing: border-box;
}
.cell {
width: 100%;
box-sizing: border-box;
display: flex;
padding-left: var(--fontSize40);
align-items: center;
}
.cellHeight {
height: var(--fontSize120);
}
.cell.border {
border-bottom: var(--fontSize1) solid #EFF0F2;
}
.cell-label {
width: 25%;
}
.titleIcon {
width: var(--fontSize32);
height: var(--fontSize32);
margin-left: var(--fontSize8);
}
.titleBtn {
display: inline-block;
background: #FFFFFF;
border: var(--fontSize1) solid #347BFF;
border-radius: 26px;
color: #347BFF;
height: var(--fontSize48);
line-height: var(--fontSize48);
padding: 0 var(--fontSize24);
font-size: var(--fontSize24);
margin-left: var(--fontSize8);
}
.cell-value {
width: 75%;
position: relative;
height: 100%;
}
.cell-value .false {
padding-right: var(--fontSize0) !important;
}
.value {
width: 100%;
height: 100%;
display: flex;
align-items: center;
/* padding-right: var(--fontSize70); */
box-sizing: border-box;
}
.header {
display: flex;
/* justify-content: space-between; */
align-items: center;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: var(--fontSize28);
color: #292D33;
}
.required {
color: #f00;
}
.footer {
font-size: var(--fontSize24);
color: #999999;
margin-left: var(--fontSize10);
}
.details,
.placeholder {
display: none;
}
.slot:empty+.details,
.slot:empty+.placeholder {
display: block;
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.placeholder {
color: #C3C3C3;
}
.cell-value .right {
justify-content: flex-end;
height: 100%;
box-sizing: border-box;
}
.cell-value .right .details,
.cell-value .right .placeholder {
text-align: right;
}
.slot {
width: 100%;
height: 100%;
}
.slot:empty {
display: none;
}
.arrow {
position: absolute;
right: var(--fontSize40);
top: 50%;
transform: translateY(-50%);
width: var(--fontSize28);
height: var(--fontSize26);
margin: 0 !important;
}
.headerSlot {
font-size: var(--fontSize28);
color: #347BFF;
max-width: var(--fontSize125);
/* max-width: 150rpx; */
/* margin-left: 3rpx; */
margin-left: var(--fontSize3);
/* max-width: 135rpx; */
white-space: nowrap;
/* 不换行 */
overflow: hidden;
/* 控制溢出部分的显示与否 */
text-overflow: ellipsis;
/* 添加省略号 */
}
\ No newline at end of file \ No newline at end of file
// tabWorkOrder/pages/staffDaily/components/selectItemPopup/selectItemPopup.js
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean
},
title: {
type: String
},
optionList: {
type: Array
},
index: {
type: Number
},
optionLabel: {
type: 'String',
default: 'confName'
}
},
/**
* 组件的初始数据
*/
data: {
},
lifetimes: {
attached() {
console.log(this.data.optionList)
},
},
/**
* 组件的方法列表
*/
methods: {
click(e) {
let { pidx, idx } = e.currentTarget.dataset
this.triggerEvent('click', {pidx, idx})
},
confirm() {
this.triggerEvent('confirm')
},
cancel() {
this.triggerEvent('cancel')
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* tabWorkOrder/pages/staffDaily/components/selectItemPopup/selectItemPopup.wxss */
.check-block {
display: flex;
flex-wrap: wrap;
padding: var(--fontSize24) 0;
.check-box {
position: relative;
box-sizing: border-box;
width: calc((100% - var(--fontSize40)) / 3);
height: var(--fontSize64);
line-height: var(--fontSize64);
text-align: center;
// background: #F7F7F7;
font-size: var(--fontSize24);
// color: #666666;
color: #292D33;
margin-right: var(--fontSize16);
background: #F7F8FA;
border-radius: var(--fontSize4);
}
.check-box.active {
background: #347BFF14;
border: var(--fontSize2) solid #347BFF;
color: #347BFF;
font-family: PingFangSC-Medium;
font-weight: 500;
line-height: var(--fontSize60);
.mult {
position: absolute;
bottom: 0;
right: 0;
width: var(--fontSize20);
height: var(--fontSize20);
}
}
.check-box:nth-child(3n+3) {
margin-right: 0;
}
.check-box:nth-child(n+4) {
margin-top: var(--fontSize10);
}
}
\ No newline at end of file \ No newline at end of file
<!--tabWorkOrder/pages/staffDaily/components/selectItemPopup/selectItemPopup.wxml-->
<popup class="date-background" popup-slot-class="popup-style" show="{{ show }}" bindcancel="cancel" bindconfirm="confirm" height="var(--fontSize500)" title="{{title}}">
<scroll-view style="height: 200rpx;" scroll-y>
<view class="check-block" >
<view
class="check-box {{ subItem.active ? 'active' : '' }}"
wx:for="{{ optionList }}"
wx:for-item="subItem"
wx:for-index="idx"
wx:key="idx"
bindtap="click"
data-pidx="{{ index }}"
data-idx="{{ idx }}"
>
{{subItem[optionLabel]}}
<image wx:if="{{ subItem.active }}" class="mult" src="../../../../images/check-active.png"></image>
</view>
</view>
</scroll-view>
</popup>
\ No newline at end of file \ No newline at end of file
// packageEquity/components/storePicker/storePicker.js
Component({
options: {
// 在组件定义时的选项中启用多slot支持
multipleSlots: true
},
/**
* 组件的属性列表
*/
properties: {
subIndex: {
type: Number,
observer: function (n) {
this.setData({
selectStoreIndex: [n]
})
}
},
pickList: {
type: Array,
value: [],
observer: function (n) {
this.setData({
selectStoreIndex: this.data.selectStoreIndex
})
// selectStoreIndex: [0]
// if (n.length == 1) {
// }
}
},
show: {
type: Boolean,
observer: function (n) {
this.setData({
searchValue: ''
})
this.triggerEvent('search', { value: '' })
}
},
pickerType: {
type: String,
observer: function (n) {
let thisPage = wx.$router.getPageInstance()
// 有搜索内容 将门店弹窗选中值置为0
if (this.data.searchValue) thisPage.setData({ subIndex: 0 })
// 清空搜索框内容
this.setData({
searchValue: ''
})
this.triggerEvent('search', { value: '' })
}
},
merchantRangeListTotal: {
type: Number,
}
},
/**
* 组件的初始数据
*/
data: {
searchValue: '',
selectStoreIndex: '',
edit: false
},
/**
* 组件的方法列表
*/
methods: {
open() {
if (this.data.disabled) return
this.setData({
edit: true,
inputFocus: true
})
},
setValue(value) {
if (this.properties.filterEmoji) {
if (wx.$util.haveEmoji(value)) value = wx.$util.replaceEmoji(value)
}
this.setData({
searchValue: value
})
},
input(e) {
let { value } = e.detail
this.setValue(value)
this.triggerEvent('input', {
value
})
// this.setData({
// selectStoreIndex: [0],
// // defaultSelectStoreIndex: [0]
// })
},
inputBlur(e) {
this.emit(e)
},
inputConfifm(e) {
this.emit(e)
},
emit(e) {
let {
detail: { value },
type
} = e
this.setData({
edit: false
})
if (type == 'confirm') {
this.setData({
selectStoreIndex: [0]
})
}
this.setValue(value)
this.triggerEvent(type == 'confirm' ? 'search' : 'blur', { value })
},
confirm() {
let { selectStoreIndex, pickList, subIndex, pickerType } = this.data
let value = selectStoreIndex[0]
console.log(value)
console.log(pickList)
if (!pickList[value]?.merchantName) {
let toastMessage = pickerType == 'merchant' ? '请选择门店' : '请选择员工'
return wx.$util.showToast(toastMessage)
}
// console.log(value)
this.triggerEvent('confirm', { value })
// this.triggerEvent('search', { value })
this.setData({
show: false
})
},
cancel() {
this.triggerEvent('cancel')
},
changeStore(e) {
// console.log(e.detail.value[0])
this.setData({
selectStoreIndex: [e.detail.value[0]]
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<!--packageEquity/components/storePicker/storePicker.wxml-->
<popup class="date-background" popup-slot-class="popup-style" show="{{ show }}" bindconfirm="confirm" bindcancel="cancel" height="var(--fontSize800)">
<view class="date-container">
<view class="date-confirm">
<view class="search-box">
<view class="search-input">
<block wx:if="{{ !edit }}">
<view class="input {{ searchValue?'':'placeholder' }}" bindtap="open">
<block wx:if="{{ searchValue }}">{{searchValue}}</block>
<block wx:else>
<image src="/images/search.png" class="icon"></image>
{{ pickerType == 'merchant'? '请输入门店' : '请输入员工姓名'}}
</block>
</view>
</block>
<block wx:else>
<input type="text" class="input" value="{{ searchValue }}" focus="{{ inputFocus }}" confirm-type="search" bindinput="input" bindblur="inputBlur" bindconfirm="inputConfifm" />
</block>
</view>
</view>
</view>
<!-- <view class="{{ pickerType == 'merchant'? 'picker-box-merchant':'picker-box'}}"> -->
<view class="{{ 'picker-box'}}">
<picker-view class="picker" value="{{ selectStoreIndex }}" immediate-change="true" indicator-class="indicator" bindchange="changeStore">
<picker-view-column>
<block wx:for="{{ pickList }}" wx:key="merchantId">
<view class="view pickViewColumn">{{pickerType == 'merchant'?item.merchantName:item.staffName}}</view>
</block>
</picker-view-column>
</picker-view>
</view>
<view class="totalCount" wx:if="{{ pickerType == 'merchant'}}">共计{{merchantRangeListTotal}}家门店</view>
</view>
</popup>
\ No newline at end of file \ No newline at end of file
/* packageEquity/components/storePicker/storePicker.wxss */
.date-container {
height: 100%;
}
.search-box {
height: var(--fontSize104);
display: flex;
align-items: center;
justify-content: center;
margin: 0 var(--fontSize32);
font-size: var(--fontSize28);
}
.search-box .search-input {
width: var(--fontSize686);
height: var(--fontSize72);
background: #F7F8FA;
border-radius: var(--fontSize38);
color: #333;
}
.search-input .input {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
width: 100%;
text-align: center;
}
.search-input .icon {
width: var(--fontSize28);
height: var(--fontSize28);
margin-right: var(--fontSize10);
}
.search-input .placeholder {
color: #C8C9CC;
}
.date-confirm {
display: flex;
justify-content: center;
align-items: center;
padding: 0 var(--fontSize20);
font-size: var(--fontSize34);
line-height: var(--fontSize70);
}
.picker-box {
height: var(--fontSize450);
display: flex;
}
.picker-box-merchant {
height: var(--fontSize400);
display: flex;
}
.picker-box .picker {
width: 100%;
}
.tbn_class {
font-size: var(--fontSize26);
color: #333;
}
.pickViewColumn {
text-align: center;
line-height: 34px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.popup-style {
height: calc(100% - var(--fontSize100)) !important;
}
.totalCount {
text-align: center;
margin-top: 100rpx;
color: #347BFF;
}
\ No newline at end of file \ No newline at end of file
// compoents/weekCalendar/weekCalendar.js
Component({
options: {
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
/** * 组件的属性列表 * 用于组件自定义设置 */
properties: {
timeBean: {
// 属性名 在wxml调用组件时利用该属性传递组件显示的数据
type: Object, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)
value: '' // 属性初始值(可选),如果未指定则会根据类型选择一个
},
index: {
type: Number
}
// weeklyList: {
// type: Array,
// value: []
// }
},
/**
* 组件的方法列表
*/
methods: {
lastWeek: function (e) {
//点击了上一周
this.triggerEvent('lastWeek')
},
nextWeek: function (e) {
//点击了下一周
this.triggerEvent('nextWeek')
},
itemClick: function (e) {
//点击了某一日,传递该日的下标
// 超过当前时间不可点击
if (e.currentTarget.dataset.disabled) {
return
}
var index = e.currentTarget.dataset.index
this.triggerEvent('dayClick', index)
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* tabWorkOrder/pages/staffDaily/weekCalendar/weekCalendar.wxss */
/* compoents/weekCalendar/weekCalendar.wxss */
.row {
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
background: #fff;
.week_box {
height: var(--fontSize60);
width: 100%;
display: flex;
justify-content: space-around;
align-items: center;
box-shadow: 0 var(--fontSize4) var(--fontSize8) 0 #cdcdd159;
}
.date_box {
height: var(--fontSize128);
width: 100%;
display: flex;
justify-content: space-around;
align-items: center;
}
}
.weekselect {
height: var(--fontSize80);
flex-direction: row;
justify-content: space-between;
// justify-content: center;
.week {
color: #000000;
font-size: 28rpx;
}
}
.column {
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
flex: 1;
}
.nextWeek {
font-family: PingFangSC-Regular;
font-weight: 400;
flex-direction: row;
color: #181A1F;
width: var(--fontSize180);
}
.dateType {
position: relative;
display: flex;
align-items: center;
justify-content: center;
font-size: var(--fontSize32);
color: #000000e6;
// border-radius: 50%;
// width: var(--fontSize64);
// height: var(--fontSize64);
width: 92rpx;
height: 92rpx;
border-radius: 12rpx;
.empty {
box-sizing: border-box;
position: absolute;
// width: var(--fontSize38);
// text-align: center;
// height: var(--fontSize32);
// background: #F24724;
border-radius: 50%;
bottom: 15rpx;
left: 50%;
transform: translateX(-50%);
// font-size: var(--fontSize22);
z-index: 2;
padding: 0 var(--fontSize4);
// color: #fff;
width: 8rpx;
height: 8rpx;
opacity: 1;
background: #f24724;
}
}
.dateType.dateType_disabled {
color: #BEC1C7;
}
.weekType {
font-size: var(--fontSize28);
color: #292D33;
}
.select-column {
.dateType {
background: #347BFF;
color: #fff;
}
.empty {
background: #fff;
}
}
.disabled {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-bottom: var(--fontSize5);
padding-top: var(--fontSize5);
margin-left: var(--fontSize5);
margin-right: var(--fontSize5);
margin-top: var(--fontSize10);
flex: 1;
border-top-left-radius: var(--fontSize20);
border-top-right-radius: var(--fontSize20);
background: #F6FCFE;
color: #292D33;
}
.timeType {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: var(--fontSize28);
color: #181A1F;
// font-size: var(--fontSize35);
// font-weight: bold;
// margin-right: auto;
}
.line {
height: var(--fontSize1);
width: 100%;
background-color: gainsboro;
}
.lastweek {
width: var(--fontSize180);
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: var(--fontSize28);
flex-direction: row;
color: #181A1F;
}
.line-shadow {
height: var(--fontSize3);
width: 100%;
background-color: gainsboro;
box-shadow: 5px 0px 5px 0px gainsboro;
}
@font-face {
font-family: "iconfont";
src: url('iconfont.eot?t=1533031583450');
/* IE9*/
src: url('iconfont.eot?t=1533031583450#iefix') format('embedded-opentype'),
/* IE6-IE8 */
url('data:application/x-font-woff;charset=utf-8;base64,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') format('woff'),
url('iconfont.ttf?t=1533031583450') format('truetype'),
/* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('iconfont.svg?t=1533031583450#iconfont') format('svg');
/* iOS 4.1- */
}
.icon {
width: 32rpx;
height: 32rpx;
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/**
*字体图标,左右箭头,书,米饭,可以修改界面对图标进行修改替换
*/
.icon-sanjiaoleft:before {
content: "\e6b6";
}
.icon-sanjiaoright:before {
content: "\e6b7";
}
.icon-book1:before {
content: "\e631";
}
.icon-mifan:before {
content: "\e606";
}
\ No newline at end of file \ No newline at end of file
<!--tabWorkOrder/pages/staffDaily/weekCalendar/weekCalendar.wxml-->
<!--compoents/weekCalendar/weekCalendar.wxml-->
<!-- <view class="line"></view> -->
<view class="row weekselect">
<view class="row lastweek" bindtap="lastWeek">
<glsx-image class="icon" src="{{ '/tools/left.png' }}" webp></glsx-image>
<view class="week">上一周</view>
<!-- <text class="iconfont icon-sanjiaoleft" style="padding:var(--fontSize15);color: #bec1c7;"></text> -->
</view>
<view class="timeType">{{timeBean.yearMonth}}</view>
<view class="row nextWeek" bindtap="nextWeek">
<block wx:if="{{ !timeBean.isInCurrentWeek }}">
<view class="week">下一周</view>
<glsx-image class="icon" src="{{ '/tools/right.png' }}" webp></glsx-image>
<!-- <text class="iconfont icon-sanjiaoright" style="padding:var(--fontSize15);color: #bec1c7;"></text> -->
</block>
</view>
</view>
<view class="row">
<view class="week_box">
<view wx:for="{{ [0,1,2,3,4,5,6] }}" data-index="{{ index }}" data-disabled="{{ timeBean.weekDayList[index].disabled }}" class="item column" bindtap="itemClick" wx:key="index">
<view class="weekType">{{timeBean.weekDayList[index].week}}</view>
</view>
</view>
<view class="date_box">
<view wx:for="{{ [0,1,2,3,4,5,6] }}" data-index="{{ index }}" data-disabled="{{ timeBean.weekDayList[index].disabled }}" class="item column {{ index==timeBean.selectDay?'select-column':'' }}" bindtap="itemClick" wx:key="index">
<view class="dateType {{timeBean.weekDayList[index].disabled ? 'dateType_disabled' : ''}}">
{{timeBean.weekDayList[index].day}}
<view class="empty" wx:if="{{ !timeBean.weekDayList[index].disabled && !timeBean.weekDayList[index].hasDailyValue }}"></view>
</view>
</view>
</view>
</view>
<!-- <view class="line-shadow"></view> -->
<view class="suspension" bindtap="addMenuClick">
<text class="iconfont icon-tianjia" style="font-size:var(--fontSize60); color:#fff;"></text>
</view>
\ No newline at end of file \ No newline at end of file
// packageTool/pages/salesDailyReport/salesDailyReport.js // packageTool/pages/salesDailyReport/salesDailyReport.js
var util = require('~/utils/timeFormat/time-utils.js')
import { getUserInfo } from '~/utils/cache/userInfo'
import api from '../../api.js'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
// isFullSucreen: wx.$util.isFullSucreen(),
timeBean: {}, //timeBean 传递给组件的数据,数据的格式在一开始的工具类中明确
selectWeek: 0, //0代表的本周 1代表下一周 -1代表上一周
role: 'staff'
},
handleConfirm() {
let { orderObj } = this.data
let params = {
todayWorkContent: orderObj.todayWorkContent,
tomorrowPlanContent: orderObj.tomorrowPlanContent
}
api.dailyReportSave(params).then((result) => {
wx.showModal({
title: '提示',
content: '您的日报填写完成!',
showCancel: false,
confirmText: '我知道了',
confirmColor: '#292D33',
success(res) {
}
})
}).catch((err) => {
});
},
getStaffDailyReportDetailWeeklyList() {
let { orderObj, timeBean } = this.data
// console.log({ ...orderObj, ...timeBean }, 'getStaffDailyReportDetailWeeklyList');
// if (this.data.noStaffData) return wx.$util.showToast('该门店没有员工')
// if (this.data.noStoreData) return wx.$util.showToast('该4s店查无数据')
let { merchantId, yqMerchantId, staffUuid } = orderObj
// orderObj?.merchantId &&
console.log('getStaffDailyReportDetailWeeklyList');
api
.dailyReportWeekly({
// merchantId,
// yqMerchantId,
staffUuid,
...timeBean,
// sceneType: 1,
// reportTypeList: [-1]
})
.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
})
this.setData({
weeklyList: data,
timeBean
})
} else {
wx.$util.showToast(message)
}
})
},
remarkInput(e) {
let { name } = e.currentTarget.dataset
console.log(e)
// 用name记录当前字数和内容
this.setData({
[name]: e.detail.cursor,
['orderObj.' + name]: e.detail.value
})
},
/**
* 选中了某一日,改变selectDay为选中日
*/
dayClick: function (e) {
// let userInfo = wx.$util.getUserInfo()
// let {
// orderObj: { yqMerchantId, merchantId, staffUuid }
// } = this.data
// // 在超管/区域督导未拿到门店或员工信息
// if (
// (userInfo?.isSuper ||
// userInfo?.loginRole == 3 ||
// userInfo?.loginRole == 5) &&
// (!yqMerchantId || !merchantId || !staffUuid)
// )
// return
this.setData({
['timeBean.selectDay']: e.detail
})
this.setReportDate()
// this.getStaffReport()
},
toDetail(e) {
let { item } = e.currentTarget.dataset
let { timeBean } = this.data
wx.$router.go('salesDailyReport', {
item,
reportDate: timeBean.reportStartDate
})
},
/**
* 点击了上一周,选择周数字减一,然后直接调用工具类中一个方法获取到数据
*/
lastWeek: function (e) {
// let userInfo = wx.$util.getUserInfo()
// let {
// orderObj: { yqMerchantId, merchantId, staffUuid }
// } = this.data
// // 在超管/区域督导未拿到门店或员工信息
// if (
// (userInfo?.isSuper ||
// userInfo?.loginRole == 3 ||
// userInfo?.loginRole == 5) &&
// (!yqMerchantId || !merchantId || !staffUuid)
// )
// return
var selectWeek = --this.data.selectWeek
var timeBean = this.data.timeBean
timeBean = util.getWeekDayList(selectWeek)
if (selectWeek != 0) {
timeBean.selectDay = 0
}
this.setData({
timeBean,
selectWeek
})
this.setReportDate()
// this.getStaffReport()
this.getStaffDailyReportDetailWeeklyList()
},
/**
* 点击了下一周,选择周数字加一,然后直接调用工具类中一个方法获取到数据
*/
nextWeek: function (e) {
// let userInfo = wx.$util.getUserInfo()
// let {
// orderObj: { yqMerchantId, merchantId, staffUuid }
// } = this.data
// // 在超管/区域督导未拿到门店或员工信息
// if (
// (userInfo?.isSuper ||
// userInfo?.loginRole == 3 ||
// userInfo?.loginRole == 5) &&
// (!yqMerchantId || !merchantId || !staffUuid)
// )
// return
var selectWeek = ++this.data.selectWeek
var timeBean = this.data.timeBean
// console.log(timeBean.weekDayList[6].date, 'timeBean.weekDayList[6].date');
// timeBean = util.getWeekDayList(selectWeek, timeBean.weekDayList[6].date)
console.log(selectWeek)
timeBean = util.getWeekDayList(selectWeek)
console.log(timeBean, 'nextWeek')
if (selectWeek != 0) {
timeBean.selectDay = 0
}
this.setData({
timeBean,
selectWeek
})
this.setReportDate()
// this.getStaffReport()
this.getStaffDailyReportDetailWeeklyList()
},
initData() {
let { orderObj, reportDate, role, approvedSource, userInfo } = this.data
if (reportDate) {
// reportDate = "2024-04-27";
var dateisSunday = new Date(reportDate)
// console.log(dateisSunday, "dateisSunday");
// this.setData({
// timeBean: util.getWeekDayList(this.data.selectWeek, reportDate),
// selectWeek: dateisSunday.getDay() === 0 ? -1 : 0,
// });
let countSundays = this.countSundays(
reportDate,
new Date().format('yyyy-MM-dd')
)
console.log(new Date().getDay(), 'dateisSunday.getDay()')
if (new Date().getDay() === 0) {
countSundays = countSundays - 1
}
console.log(countSundays, 'countSundays')
this.setData({
timeBean: util.getWeekDayList(0 - countSundays),
selectWeek: 0 - countSundays,
['timeBean.selectDay']:
dateisSunday.getDay() == 0 ? 6 : dateisSunday.getDay() - 1,
selectWeek: dateisSunday.getDay() === 0 ? -1 : 0
})
} else {
this.setData({
timeBean: util.getWeekDayList(this.data.selectWeek)
})
}
this.setReportDate()
let isStaff = true // 是否是员工
// if (isStaff && approvedSource != '3') {
// console.log(userInfo, 'userInfo');
const {
merchantId,
merchantName,
name,
uuid,
shopMerchantId,
shopMerchantName
} = userInfo
this.setData({
role: 'staff',
isStaff,
orderObj: {
...orderObj,
// yqMerchantId: merchantId,
// yqMerchantName: merchantName,
// staffName: name,
staffUuid: uuid,
// shopMerchantId: shopMerchantId,
// shopMerchantName: shopMerchantName
// merchantId: shopMerchantId,
// merchantName: shopMerchantName
},
// merchantRange: [{ merchantName: shopMerchantName }]
})
this.getStaffDailyReportDetailWeeklyList()
// this.getMerchantCarBandList()
// }
},
// 设置报告日期
setReportDate() {
let { timeBean } = this.data
let date = timeBean.weekDayList[timeBean.selectDay].date
var time = new Date(date)
var y = time.getFullYear()
var m = time.getMonth() + 1
console.log(date, 'date');
this.setData({
['timeBean.yearMonth']: y + '-' + m,
['orderObj.reportDate']: date,
isEditReport: false
})
console.log(this.data.orderObj);
}, },
onRoute(options) {
console.log(options, 'staffoptions')
// let { orderObj } = this.data
// console.log(options, 'onRouteoptions');
let { orderObj } = this.data
// console.log(this.data, 'onRouteoptions');
// console.log(userInfo, 'userInfo')
// 初始化日期
if (options.hasOwnProperty('reportDate')) {
this.setData({
reportDate: options.reportDate
})
}
this.setData({
flag: true
})
// wx.$util.getUserInfo()
this.initData()
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.setData({
userInfo: getUserInfo()
})
this.initData()
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { onReady() { },
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() { },
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { onHide() { },
},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() { },
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() { onPullDownRefresh() { },
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() { onReachBottom() { },
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() { }
}
}) })
{ {
"navigationBarTitleText": "销售日报", "navigationBarTitleText": "销售日报",
"usingComponents": {} "usingComponents": {
"weekCalendar": "./components/weekCalendar/weekCalendar"
}
} }
/* packageTool/pages/salesDailyReport/salesDailyReport.wxss */ /* packageTool/pages/salesDailyReport/salesDailyReport.wxss */
.textbox {
// width: 100%;
box-sizing: border-box;
margin: 24rpx 20rpx 40rpx;
}
.remark_box {
padding: var(--fontSize20);
background-color: #fff;
.label {
font-size: var(--fontSize28);
color: #292D33;
margin: 10rpx 20rpx;
}
.textArea_box {
font-size: var(--fontSize28);
background: #FFFFFF;
// border: var(--fontSize2) solid #EFF0F2;
border-radius: var(--fontSize16);
padding: var(--fontSize24);
.textarea {
height: var(--fontSize130);
}
.currentWordNumber {
text-align: right;
color: #bec1c7;
font-size: 28rpx;
}
}
.textArea_box.disabled {
background: #EFF0F2;
}
}
.remark_box+.remark_box {
border-top: 1rpx solid #EFF0F2;
}
.isFullSucreen {
padding-bottom: 102px !important;
}
.isFullSucreen-btn {
padding-bottom: 34px !important;
}
.btns {
box-sizing: border-box;
// position: fixed;
// left: 0;
// bottom: 0;
width: 100%;
min-height: var(--fontSize100);
padding: var(--fontSize20);
// background: #FFFFFF;
display: flex;
text-align: center;
font-size: var(--fontSize32);
font-weight: 500;
z-index: 99;
flex-direction: column;
}
.btns-con {
width: 100%;
box-sizing: border-box;
display: flex;
flex-flow: column;
padding: var(--fontSize10) 0;
}
.btns .btns-con view {
border: var(--fontSize2) solid #0075F9;
border-radius: var(--fontSize12);
height: var(--fontSize80);
box-sizing: border-box;
}
.confirm {
// border: var(--fontSize2) solid #0075F9;
border-radius: var(--fontSize12);
height: var(--fontSize88);
box-sizing: border-box;
// text-align: center;
margin: 0 auto;
width: 90%;
color: #fff;
background-color: #347BFF;
font-size: 32rpx;
}
.disabled {
background: #347bff33;
}
\ No newline at end of file \ No newline at end of file
<!--packageTool/pages/salesDailyReport/salesDailyReport.wxml--> <!--packageTool/pages/salesDailyReport/salesDailyReport.wxml-->
<text>packageTool/pages/salesDailyReport/salesDailyReport.wxml</text>
\ No newline at end of file \ No newline at end of file
<wxs src="../../index.wxs" module="filter" />
<weekCalendar timeBean="{{ timeBean }}" bind:lastWeek="lastWeek" bind:nextWeek="nextWeek" bind:dayClick="dayClick"></weekCalendar>
<view class="textbox">
<view class="remark_box">
<view class="label">今日工作</view>
<!-- {{ filter.filterDisabled(role, orderObj.reportDate) ?'disabled':'' }} -->
<view class="textArea_box ">
<textarea disabled="{{ filter.filterDisabled(role, orderObj.reportDate)}}" value="{{ orderObj.todayWorkContent }}" maxlength="200" placeholder="请输入" class="textarea" data-name="todayWorkContent" bindinput="remarkInput" />
<!-- -->
<view class="currentWordNumber">{{todayWorkContent || 0}} / 200</view>
</view>
</view>
<view class="remark_box">
<view class="label">明日计划</view>
<!-- {{ filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport) || role != 'staff' ?'disabled':'' }} -->
<!-- {{ filter.filterDisabled(role, orderObj.reportDate) ?'disabled':'' }} -->
<view class="textArea_box ">
<textarea disabled="{{ filter.filterDisabled(role, orderObj.reportDate)}}" value="{{ orderObj.tomorrowPlanContent }}" maxlength="200" placeholder="请输入" class="textarea" data-name="tomorrowPlanContent" bindinput="remarkInput" />
<!-- disabled="{{ filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport) || role != 'staff' }}" -->
<view class="currentWordNumber">{{tomorrowPlanContent || 0}} / 200</view>
</view>
</view>
</view>
<!-- wx:if="{{ !filter.filterDisabled(role, orderObj.reportDate)}}" -->
<view class="confirm text-center {{ filter.filterDisabled(role, orderObj.reportDate)?'disabled':''}}" bindtap="handleConfirm">提交</view>
\ No newline at end of file \ No newline at end of file
...@@ -9,6 +9,14 @@ Page({ ...@@ -9,6 +9,14 @@ Page({
timeBean: {}, //timeBean 传递给组件的数据,数据的格式在一开始的工具类中明确 timeBean: {}, //timeBean 传递给组件的数据,数据的格式在一开始的工具类中明确
selectWeek: 0 //0代表的本周 1代表下一周 -1代表上一周 selectWeek: 0 //0代表的本周 1代表下一周 -1代表上一周
}, },
toDetail(e) {
let { item } = e.currentTarget.dataset
let { timeBean } = this.data
wx.$router.go('salesDailyReport', {
item,
reportDate: timeBean.reportStartDate
})
},
/** /**
* 点击了上一周,选择周数字减一,然后直接调用工具类中一个方法获取到数据 * 点击了上一周,选择周数字减一,然后直接调用工具类中一个方法获取到数据
*/ */
......
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
<view class="num">未填日报</view> <view class="num">未填日报</view>
<view class="num">应填日报</view> <view class="num">应填日报</view>
</view> </view>
<view class="listItem"> <view class="listItem" wx:for="{{ 30 }}" bind:tap="toDetail" data-item="{{ item }}" wx:key="index">
<view class="name"> <view class="name">
<view class="text-hide">迪丽热巴·迪力木拉提</view> <view class="text-hide">迪丽热巴·迪力木拉提</view>
<view class="area">东北大区-经理</view> <view class="area">东北大区-经理</view>
</view> </view>
<view class="num">0</view> <view class="num">{{index}}</view>
<view class="num">0</view> <view class="num">0</view>
<view class="num">0</view> <view class="num">0</view>
</view> </view>
......
...@@ -117,6 +117,7 @@ class Request { ...@@ -117,6 +117,7 @@ class Request {
return sign(params, secret, noSignAttr) return sign(params, secret, noSignAttr)
} }
getRopProject(method) { getRopProject(method) {
console.log(method);
const projectName = method.split('.')[2] const projectName = method.split('.')[2]
return projectName return projectName
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!