Commit 10f47bc7 by zhangxw

督导需求开发

1 parent a908d46d
Showing 51 changed files with 1283 additions and 593 deletions
...@@ -79,4 +79,8 @@ module.exports = { ...@@ -79,4 +79,8 @@ module.exports = {
return api.post('dj.api.smartcarlife.common.uploadPdf', data, ['file']) return api.post('dj.api.smartcarlife.common.uploadPdf', data, ['file'])
}, },
// 获取周数据
getWeekSelectData(data) {
return api.post('dj.api.supervisor.mini.get.generateWeeklyRanges', data, [], '/rop-dj-supervisor-mini/router')
}
} }
...@@ -6,19 +6,43 @@ module.exports = { ...@@ -6,19 +6,43 @@ module.exports = {
}, },
// 获取AI分析内容 // 获取AI分析内容
getAIAnslyseData(data) { getAIAnslyseData(data) {
return api,post('', data) return api.post('dj.api.supervisor.mini.team.aiAnalysisRecord.get', data, [], '/rop-dj-supervisor-mini/router')
}, },
// 获取员工排行数据 // 获取业绩维度排行数据
getStaffRankList(data) { getDashboardData(data) {
return api.post('', data) return api.post('dj.api.supervisor.dashboard.data', data, [], '/rop-dj-supervisor-mini/router')
},
// 获取行为维度排行数据
getDashboardBehavior(data) {
return api.post('dj.api.supervisor.dashboard.behavior', data, [], '/rop-dj-supervisor-mini/router')
},
// 获取培训维度排行数据
getTrainingStaffList(data) {
return api.post('dj.api.supervisor.mini.team.all.employee.training.info', data, [], '/rop-dj-supervisor-mini/router')
},
// 获取员工个人基础信息
getEmployeeBaseData(data) {
return api.post('dj.api.supervisor.dashboard.employee', data, [], '/rop-dj-supervisor-mini/router')
},
// 获取员工个人业绩数据
getEmployeePerformanceData(data) {
return api.post('dj.api.supervisor.dashboard.employee.performance', data, [], '/rop-dj-supervisor-mini/router')
},
// 获取员工个人行为数据
getEmployeebehaviorData(data) {
return api.post('dj.api.supervisor.dashboard.employee.behavior', data, [], '/rop-dj-supervisor-mini/router')
},
// 获取驻店员工培训经历数据
getTrainingExperienceList(data) {
return api.post('dj.api.supervisor.mini.team.training.list', data, [], '/rop-dj-supervisor-mini/router')
}, },
// 查询门店日期范围内接待记录统计数据 // 查询门店日期范围内接待记录统计数据
getReceptionRecordList(data) { getReceptionRecordList(data) {
return api.post("dj.api.smartcarlife.recepiton.receptionStaticList", data) return api.post("dj.api.smartcarlife.recepiton.receptionStaticList", data)
}, },
// 分页查询接待列表 // 分页查询接待录音列表
getRecordDetailList(data) { getRecordDetailList(data) {
return api.post("dj.api.smartcarlife.reception.findReceptionByConditionPage", data) return api.post("dj.api.supervisor.dashboard.recording.list", data, [], '/rop-dj-supervisor-mini/router')
}, },
// 获取短链地址 // 获取短链地址
getShortUrl(data) { getShortUrl(data) {
...@@ -27,8 +51,16 @@ module.exports = { ...@@ -27,8 +51,16 @@ module.exports = {
findCheckResultByBatchId(data) { findCheckResultByBatchId(data) {
return api.post('dj.api.car.boutique.inspection.findCheckResultByBatchId', data) return api.post('dj.api.car.boutique.inspection.findCheckResultByBatchId', data)
}, },
// 获取调店记录列表
getStoreTransferApi(data) {
return api.post('dj.api.supervisor.dashboard.employee.store.transfer', data, [], '/rop-dj-supervisor-mini/router')
},
// 提报优秀案例
submitOutstandingCases(data) {
return api.post('dj.api.supervisor.excellent.case.submit', data, [], '/rop-dj-supervisor-mini/router')
},
// 人员带教 // 人员带教
submitMentorData(datd) { submitMentorData(data) {
return api.post('', data) return api.post('dj.api.supervisor.mini.team.coaching.submit', data)
} }
} }
import api from '~/utils/request/request.js' import api from '~/utils/request/request.js'
module.exports = { module.exports = {
// 获取督导团队概况数据
getSupervisorStaticData(data) {
return api.post('dj.api.supervisor.mini.get.teamOverview', data, [], '/rop-dj-supervisor-mini/router')
},
// 获取任务列表数据 // 获取任务列表数据
getMissionList(data) { getMissionList(data) {
return api.post('dj.pad.api.recommended.course.page', data) return api.post('dj.api.supervisor.mini.page.task', data, [], '/rop-dj-supervisor-mini/router')
},
// 查询督导管理门店数据
getSupervisorMerchantList(data) {
return api.post('dj.api.supervisor.mini.list.flightSupervisionMerchant', data, [], '/rop-dj-supervisor-mini/router')
},
// 获取督导管理的员工数据
getSupervisorStaffList(data) {
return api.post('dj.api.supervisor.mini.list.flightSupervisionStaff', data, [], '/rop-dj-supervisor-mini/router')
}, },
// 提交督导日报 // 提交督导日报
submitSupervisorReport(data) { submitSupervisorReport(data) {
return api.post('dj.api.supervisor.mini.submitDayTask', data, [], 'rop-dj-supervisor-mini') return api.post('dj.api.supervisor.mini.submitDayTask', data, [], '/rop-dj-supervisor-mini/router')
}, },
// 提交本周复盘 // 提交本周复盘
submitWeeklyReview(data) { submitWeeklyReview(data) {
return api.post('dj.api.supervisor.mini.submitWeekTask', data, [], 'rop-dj-supervisor-mini') return api.post('dj.api.supervisor.mini.submitWeekTask', data, [], '/rop-dj-supervisor-mini/router')
}, },
// 提交督导月度计划 // 提交督导月度计划
submitMonthPlan(data) { submitMonthPlan(data) {
return api.post('dj.api.supervisor.mini.submitMonthTask', data, [], 'rop-dj-supervisor-mini') return api.post('dj.api.supervisor.mini.submitMonthTask', data, [], '/rop-dj-supervisor-mini/router')
}, },
// 获取督导任务详情 // 获取督导任务详情
getSpecialTaskDetail(data) { getTaskDetail(data) {
return api.post('dj.api.supervisor.mini.getTaskDetailById', data, [], 'rop-dj-supervisor-mini') return api.post('dj.api.supervisor.mini.getTaskDetailById', data, [], '/rop-dj-supervisor-mini/router')
} }
} }
...@@ -2,7 +2,7 @@ import api from '~/utils/request/request.js' ...@@ -2,7 +2,7 @@ import api from '~/utils/request/request.js'
module.exports = { module.exports = {
// 获取全部课程列表数据 // 获取全部课程列表数据
getRecommendedCourseList(data) { getRecommendedCourseList(data) {
return api.post('dj.pad.api.recommended.course.page', data, [], '/rop-dj-pad/router') return api.post('dj.supervisor.mini.api.all.course.page', data, [], '/rop-dj-supervisor-mini/router')
}, },
// 查询课程分类 // 查询课程分类
getCourseCategoryData(data) { getCourseCategoryData(data) {
...@@ -19,6 +19,6 @@ module.exports = { ...@@ -19,6 +19,6 @@ module.exports = {
}, },
// 提交课程推送 // 提交课程推送
submitCoursePush(data) { submitCoursePush(data) {
return api.post('', data) return api.post('dj.supervisor.mini.api.course.push.batch', data, [], '/rop-dj-supervisor-mini/router')
} }
} }
// components/dateScreen/dateScreen.js // components/dateScreen/dateScreen.js
import api from '~/api/api'
import dayjs from 'dayjs' import dayjs from 'dayjs'
let currentObj let currentObj
Component({ Component({
...@@ -41,7 +42,7 @@ Component({ ...@@ -41,7 +42,7 @@ Component({
attached: function () { attached: function () {
this.initDate() this.initDate()
// 周数据 // 周数据
// this.getWeeklyData() this.getWeeklyData()
} }
}, },
...@@ -88,6 +89,18 @@ Component({ ...@@ -88,6 +89,18 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
async getWeeklyData() {
const result = await api.getWeekSelectData()
const weekColumns = result.data?.map((item, index) => ({
label: `${item.startDate}-${item.endDate}`,
startDate: dayjs(item.startDate).format('YYYY/MM/DD'),
endDate: dayjs(item.endDate).format('YYYY/MM/DD'),
index
}))
this.setData({
weekColumns
})
},
// 切换日期类型 // 切换日期类型
selectDate(event) { selectDate(event) {
const { index } = event.currentTarget.dataset const { index } = event.currentTarget.dataset
...@@ -122,8 +135,15 @@ Component({ ...@@ -122,8 +135,15 @@ Component({
default: default:
console.warn('[getUsedCarBusinessData] 未知 timeType:', timeType) console.warn('[getUsedCarBusinessData] 未知 timeType:', timeType)
} }
obj.timeDimension = dateCurrent
return obj return obj
}, },
initLoad() {
this.initDate('date')
this.setData({
dateCurrent: 0
})
},
initDate(type = 'date') { initDate(type = 'date') {
const now = dayjs(); const now = dayjs();
const setData = (payload) => { const setData = (payload) => {
...@@ -154,7 +174,7 @@ Component({ ...@@ -154,7 +174,7 @@ Component({
if (firstWeek) { if (firstWeek) {
setData({ setData({
currentWeek: firstWeek, currentWeek: firstWeek,
date: `${firstWeek.startDate}至${firstWeek.endDate}`, date: `${firstWeek.startDate}-${firstWeek.endDate}`,
}); });
} }
break; break;
...@@ -172,7 +192,7 @@ Component({ ...@@ -172,7 +192,7 @@ Component({
const calendar = this.selectComponent("#calendar") const calendar = this.selectComponent("#calendar")
if (calendar && calendar.__data__ && calendar.__data__.currentDate) { if (calendar && calendar.__data__ && calendar.__data__.currentDate) {
const _calendar = calendar.__data__.currentDate.map(item => dayjs(item).format('YYYY/MM/DD')) const _calendar = calendar.__data__.currentDate.map(item => dayjs(item).format('YYYY/MM/DD'))
const _value = date.split('至') const _value = date.split('-')
if (_value[0] != _calendar[0] || _value[1] != _calendar[1]) { if (_value[0] != _calendar[0] || _value[1] != _calendar[1]) {
calendar.reset() calendar.reset()
} }
...@@ -230,7 +250,7 @@ Component({ ...@@ -230,7 +250,7 @@ Component({
const formatMap = { const formatMap = {
date: () => dayjs(selectedDate).format('YYYY/MM/DD'), date: () => dayjs(selectedDate).format('YYYY/MM/DD'),
'year-month': () => dayjs(selectedDate).format('YYYY/MM'), 'year-month': () => dayjs(selectedDate).format('YYYY/MM'),
week: () => `${currentWeek.startDate}至${currentWeek.endDate}` week: () => `${currentWeek.startDate}-${currentWeek.endDate}`
}; };
// 边界状态统一计算 // 边界状态统一计算
const calcBoundary = () => { const calcBoundary = () => {
...@@ -322,7 +342,7 @@ Component({ ...@@ -322,7 +342,7 @@ Component({
const prevWeek = weekColumns[currentWeek.index + 1]; const prevWeek = weekColumns[currentWeek.index + 1];
const prevDate = dayjs(prevWeek.startDate, 'YYYY/MM/DD'); const prevDate = dayjs(prevWeek.startDate, 'YYYY/MM/DD');
this.setData({ this.setData({
date: `${prevWeek.startDate}至${prevWeek.endDate}`, date: `${prevWeek.startDate}-${prevWeek.endDate}`,
currentDate: prevDate.valueOf(), currentDate: prevDate.valueOf(),
defaultIndex: currentWeek.index + 1, defaultIndex: currentWeek.index + 1,
currentWeek: prevWeek, currentWeek: prevWeek,
...@@ -369,7 +389,7 @@ Component({ ...@@ -369,7 +389,7 @@ Component({
const nextWeek = weekColumns[currentWeek.index - 1] const nextWeek = weekColumns[currentWeek.index - 1]
const nextDate = dayjs(nextWeek.startDate, 'YYYY/MM/DD'); const nextDate = dayjs(nextWeek.startDate, 'YYYY/MM/DD');
this.setData({ this.setData({
date: `${nextWeek.startDate}至${nextWeek.endDate}`, date: `${nextWeek.startDate}-${nextWeek.endDate}`,
currentDate: nextDate.valueOf(), currentDate: nextDate.valueOf(),
defaultIndex: currentWeek.index - 1, defaultIndex: currentWeek.index - 1,
currentWeek: nextWeek, currentWeek: nextWeek,
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
align-items: center; align-items: center;
justify-content: space-around; justify-content: space-around;
.date-text { .date-text {
font-size: 26rpx;
text-align: center; text-align: center;
width: 320rpx; width: 320rpx;
flex-shrink: 0; flex-shrink: 0;
......
...@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd"; ...@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd";
* 4预发布 * 4预发布
* 5cdptest * 5cdptest
*/ */
let index = 2; let index = 1;
const accountInfo = wx.getAccountInfoSync(); const accountInfo = wx.getAccountInfoSync();
const systemInfo = wx.getSystemInfoSync(); const systemInfo = wx.getSystemInfoSync();
const envName = accountInfo.miniProgram.envVersion; const envName = accountInfo.miniProgram.envVersion;
......
// packageCrew/pages/mentoring/mentoring.js // packageCrew/pages/mentoring/mentoring.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/' const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
import api from '~/api/crew/index' import api from '~/api/crew/index'
import indexApi from '~/api/index/index'
import studyApi from '~/api/learningCenter/index'
Page({ Page({
/** /**
...@@ -28,10 +30,10 @@ Page({ ...@@ -28,10 +30,10 @@ Page({
inline: true inline: true
}], }],
orderObj: { orderObj: {
content: '', taskContext: '',
merchantPhoto: [], imageList: [],
merchantName: '', merchantName: '',
course: [] courseList: []
}, },
}, },
...@@ -46,7 +48,14 @@ Page({ ...@@ -46,7 +48,14 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
// 任务列表进入
if (options.id) {
this.getDetail(options.id)
}
// 获取门店列表
this.getMerchantList()
// 获取课程列表
this.getCourseList()
}, },
/** /**
...@@ -66,17 +75,63 @@ Page({ ...@@ -66,17 +75,63 @@ Page({
back() { back() {
wx.navigateBack() wx.navigateBack()
}, },
getMerchantList() {
indexApi.getSupervisorMerchantList({}).then(res => {
let { code, data, message } = res
if (code == 0) {
this.setData({
merchantList: data || []
})
} else {
wx.$util.showToast(message)
}
})
},
getCourseList() {
let userInfo = wx.$util.getUserInfo()
let params = {
pageNum: 1,
pageSize: 9999,
staffPhone: userInfo?.phone,
sortType: 0,
sortOrder: 'desc'
}
studyApi.getRecommendedCourseList(params).then(res => {
let { code, data, message } = res
if (code == 0) {
this.setData({allCourseList: data?.list || []})
} else {
wx.$util.showToast(message)
}
})
},
// 获取带教任务详情
getDetail(id) {
indexApi.getTaskDetail({id}).then(res => {
let { code, data, message } = res
if (code == 0) {
data.courseList = data.taskCourseList || [],
data.imageList = data.taskImageList || []
this.setData({
merchantList: data || []
})
} else {
wx.$util.showToast(message)
}
})
},
chooseSelect(e) { chooseSelect(e) {
let { type } = e.currentTarget.dataset let { type } = e.currentTarget.dataset
let { orderObj } = this.data let { orderObj, merchantList, allCourseList } = this.data
if (orderObj.taskStatus == 2) return
this.setData({ this.setData({
selectType: type, selectType: type,
showSelectPopup: true, showSelectPopup: true,
selectOptions: type == 'merchant' ? [{merchantId: 123, merchantName: '明明4s店1'}, {merchantId: 1234, merchantName: '明明4s店2'}] : [{courseId: 1, name: '智界R7谈客案例'}, {courseId: 2, name: '智界R7谈客案例11'}], selectOptions: type == 'merchant' ? merchantList : allCourseList,
selectTitle: type == 'merchant' ? '门店选择' : '课程选择', selectTitle: type == 'merchant' ? '门店选择' : '课程选择',
selectMultiple: type != 'merchant', selectMultiple: type != 'merchant',
labelKey: type == 'merchant' ? 'merchantName' : 'name', labelKey: type == 'merchant' ? 'merchantName' : 'title',
valueKey: type == 'merchant'? 'merchantId' : 'courseId', valueKey: type == 'merchant'? 'merchantId' : 'courseId',
selectValue: type == 'merchant' ? [orderObj.merchantId] : orderObj.course selectValue: type == 'merchant' ? [orderObj.merchantId] : orderObj.course
}) })
...@@ -92,7 +147,7 @@ Page({ ...@@ -92,7 +147,7 @@ Page({
}) })
} else { } else {
this.setData({ this.setData({
['orderObj.course']: values ['orderObj.courseList']: items
}) })
} }
this.hideSelectPopup() this.hideSelectPopup()
...@@ -104,58 +159,98 @@ Page({ ...@@ -104,58 +159,98 @@ Page({
}) })
}, },
contentInput(e) { taskContextInput(e) {
let val = e.detail.value || "" let val = e.detail.value || ""
if (val.length > 500) { if (val.length > 500) {
val = val.substring(0, 500) val = val.substring(0, 500)
} }
this.setData({ this.setData({
'orderObj.content': val, 'orderObj.taskContext': val,
contentLength: val.length taskContextLength: val.length
}) })
}, },
handleImageUpload() { handleImageUpload() {
let _this = this
let { orderObj } = this.data let { orderObj } = this.data
wx.chooseImage({ wx.chooseImage({
count: 1, count: 9 - orderObj.imageList?.length,
sourceType: ['camera'], mediaType: ['image'],
success(res) { success(res) {
let [tempFiles] = res.tempFilePaths console.log(res)
let imgType = tempFiles.split('.')[1] for (const file of res.tempFiles) {
let type = imgType == 'unknown' ? 'jpg' : imgType if (file.size > 10 * 1024 * 1024) {
return wx.showToast({
title: '图片上传最大10MB',
icon: 'none'
})
}
}
wx.$util.showLoading()
const uploadImages = async (tempFiles) => {
try {
for (const item of tempFiles) {
const val = item.path
const imgType = val.split('.')[1]
const type = imgType === 'unknown' ? 'jpg' : imgType
const _res = await new Promise((resolve, reject) => {
wx.getFileSystemManager().readFile({ wx.getFileSystemManager().readFile({
filePath: tempFiles, //选择图片返回的相对路径 filePath: val, // 选择图片返回的相对路径
encoding: 'base64', //编码格式 encoding: 'base64', // 编码格式
success(_res) { success: resolve,
wx.$util.showLoading('上传中...') fail: reject
uploadImg({ })
})
const img = await uploadImg({
file: `${type}@${_res.data}` file: `${type}@${_res.data}`
}).then(img => { })
wx.$util.hideLoading() const { code, data, message } = img
let { code, data, message } = img
if (code == 0) { if (code == 0) {
orderObj.merchantPhoto.push(data) orderObj.imageList.push({ imageUrl: data })
_this.setData({ _this.setData({
orderObj orderObj
}) })
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message)
} }
})
} }
}) } catch (error) {
wx.$util.showToast("上传失败,请重试")
} finally {
wx.$util.hideLoading()
}
}
uploadImages(res?.tempFiles)
} }
}) })
}, },
previewImage(e) {
let { url, index } = e.currentTarget.dataset
wx.previewImage({
urls: url?.map(val => {return val.imageUrl}),
current: url[index].imageUrl
})
},
delPhoto(e) {
let { index } = e.currentTarget.dataset
let { orderObj } = this.data
orderObj.imageList.splice(index, 1)
this.setData({
'orderObj.imageList': orderObj.imageList
})
},
submit() { submit() {
if (!orderObj.merchantId || !orderObj.course.length || !orderObj.content || !orderObj.merchantPhoto.length) return wx.$util.showToast('请完成所有必填项') if (!orderObj.merchantId || !orderObj.courseList.length || !orderObj.taskContext || !orderObj.imageList.length) return wx.$util.showToast('请完成所有必填项')
let params = { let params = {
merchantId: orderObj.merchantId, merchantId: orderObj.merchantId,
course: orderObj.course, merchantName: orderObj.merchantName,
content: orderObj.content, storeManagerPhone: orderObj.phone,
merchantPhoto: orderObj.merchantPhoto taskContext: orderObj.taskContext,
courseList: orderObj.courseList?.map(val => {return {id: val.id}}),
imageList: orderObj.imageList
} }
api.submitMentorData(params).then(res => { api.submitMentorData(params).then(res => {
......
...@@ -168,7 +168,25 @@ page{ ...@@ -168,7 +168,25 @@ page{
.upload_box{ .upload_box{
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: var(--fontSize20); gap: 20rpx;
.payVoucher_image{
flex-shrink: 0;
width: 192rpx;
height: 192rpx;
border-radius: 10rpx;
position: relative;
image{
width: 100%;
height: 100%;
}
.del_icon{
width: 40rpx;
height: 40rpx;
position: absolute;
top: 16rpx;
right: 16rpx;
}
}
.upload-item { .upload-item {
width: 196rpx; width: 196rpx;
height: 196rpx; height: 196rpx;
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<view class="item-box"> <view class="item-box">
<view class="label">推送课程<text class='required'>*</text></view> <view class="label">推送课程<text class='required'>*</text></view>
<view class="value" bindtap="chooseSelect" data-type="course"> <view class="value" bindtap="chooseSelect" data-type="course">
<text wx:if="{{orderObj.course.length}}" class="value-text">已选{{orderObj.course.length}}课</text> <text wx:if="{{orderObj.courseList.length}}" class="value-text">已选{{orderObj.courseList.length}}课</text>
<block wx:else> <block wx:else>
<text class="placeholder">点击选择</text> <text class="placeholder">点击选择</text>
</block> </block>
...@@ -49,31 +49,31 @@ ...@@ -49,31 +49,31 @@
<view class="item-box remark_box"> <view class="item-box remark_box">
<view class="label">带教记录<text class='required'>*</text></view> <view class="label">带教记录<text class='required'>*</text></view>
<view class="textArea_box"> <view class="textArea_box">
<textarea placeholder-style="color: #999EA8;" value="{{ orderObj.content }}" maxlength="1000" placeholder="请输入" class="textarea" bindinput="contentInput" /> <textarea placeholder-style="color: #999EA8;" disabled="{{orderObj.taskStatus == 2}}" value="{{ orderObj.taskContext }}" maxlength="1000" placeholder="请输入" class="textarea" bindinput="taskContextInput" />
<view class="currentWordNumber">{{contentLength || 0}} / 1000</view> <view class="currentWordNumber">{{taskContextLength || 0}} / 1000</view>
</view> </view>
</view> </view>
<view class="image-box"> <view class="image-box">
<view class="label">门店拍照<text class='required'>*</text></view> <view class="label">门店拍照<text class='required'>*</text></view>
<view class="upload_box"> <view class="upload_box">
<block wx:if="{{orderObj.merchantPhoto.length > 0}}"> <block wx:if="{{orderObj.imageList.length > 0}}">
<view class="payVoucher_image" wx:for="{{payVoucher}}" wx:key="index"> <view class="payVoucher_image" wx:for="{{orderObj.imageList}}" wx:key="index">
<image bindtap="previewImage" data-index="{{index}}" data-url="{{payVoucher}}" src="{{item}}"/> <image bindtap="previewImage" data-index="{{index}}" data-url="{{orderObj.imageList}}" src="{{item.imageUrl}}"/>
<image class="del_icon" src="/packageCrowdFunding/images/del_icon.png" mode="" bindtap="delCustomPayVoucher" data-index="{{index}}"/> <image class="del_icon" wx:if="{{orderObj.taskStatus != 2}}" src="/packageCrowdFunding/images/del_icon.png" mode="" bindtap="delCustomPayVoucher" data-index="{{index}}"/>
</view> </view>
</block> </block>
<block wx:if="{{orderObj.merchantPhoto.length < 9}}"> <block wx:if="{{orderObj.imageList.length < 9 && orderObj.taskStatus != 2}}">
<view class="upload-item" bindtap="handleImageUpload"> <view class="upload-item" bindtap="handleImageUpload">
<image src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/{{item.uploadIcon || 'zy-upload_icon.png'}}" class="icon-uploadAdd {{item.uploadIcon ? 'custom-icon-uploadAdd' : ''}}"></image> <image src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/{{item.uploadIcon || 'zy-upload_icon.png'}}" class="icon-uploadAdd {{item.uploadIcon ? 'custom-icon-uploadAdd' : ''}}"></image>
<view class="upload-text"> <view class="upload-text">
{{orderObj.merchantPhoto.length + '/' + 9}} {{orderObj.imageList.length + '/' + 9}}
</view> </view>
</view> </view>
</block> </block>
</view> </view>
</view> </view>
</view> </view>
<view class="footer-btn"> <view class="footer-btn" wx:if="{{orderObj.taskStatus != 2}}">
<view class="btn {{orderObj.onBreak == 'Y' ? 'fixed-btn' : ''}}" bindtap="submit">提交</view> <view class="btn {{orderObj.onBreak == 'Y' ? 'fixed-btn' : ''}}" bindtap="submit">提交</view>
</view> </view>
</scroll-view> </scroll-view>
......
Component({ Component({
properties: { properties: {
detailInfo: { baseInfo: {
type: Object, type: Object,
value: {}, value: {}
}, },
}, },
data: { data: {
...@@ -11,30 +11,32 @@ Component({ ...@@ -11,30 +11,32 @@ Component({
key: 'age' key: 'age'
}, { }, {
label: '出生日期', label: '出生日期',
key: 'age' key: 'birthday'
}, { }, {
label: '民族', label: '民族',
key: 'age' key: 'ethnicity'
}, { }, {
label: '政治面貌', label: '政治面貌',
key: 'age' key: ''
}, { }, {
label: '籍贯', label: '籍贯',
key: '' key: 'origin'
}], }],
workOptions: [{ workOptions: [{
label: '入职部门', label: '入职部门',
key: 'age' key: 'department'
}, { }, {
label: '职务', label: '职务',
key: 'age' key: 'position'
}, { }, {
label: '入职时间', label: '入职时间',
key: 'age' key: 'entryDate'
}, { }, {
label: '直属经理', label: '直属经理',
key: 'age' key: 'manager'
}] }]
}, },
methods: {},
methods: {
}
}) })
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
<view class="block-title">基础信息</view> <view class="block-title">基础信息</view>
<view class="row" wx:for="{{baseOptions}}" wx:key="index"> <view class="row" wx:for="{{baseOptions}}" wx:key="index">
<view class="label">{{item.label}}</view> <view class="label">{{item.label}}</view>
<view class="value">{{detailInfo[item.key] || '-'}}</view> <view class="value">{{baseInfo[item.key] || '-'}}</view>
</view> </view>
<view class="block-title">工作信息</view> <view class="block-title">工作信息</view>
<view class="row" wx:for="{{workOptions}}" wx:key="index"> <view class="row" wx:for="{{workOptions}}" wx:key="index">
<view class="label">{{item.label}}</view> <view class="label">{{item.label}}</view>
<view class="value">{{detailInfo[item.key] || '-'}}</view> <view class="value">{{baseInfo[item.key] || '-'}}</view>
</view> </view>
</view> </view>
import api from '~/api/crew/index'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/' const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
Component({ Component({
properties: { properties: {
detailInfo: { detailInfo: {
type: Object, type: Object,
value: {}, value: {},
observer: function(n) {
this.getData()
}
}, },
}, },
data: { data: {
IMG_URL, IMG_URL,
merchantName: '深圳南山问界4S店深圳南山问界4S店深圳南山问界4S店', merchantName: '深圳南山问界4S店深圳南山问界4S店深圳南山问界4S店',
attendanceItems: [ attendanceItems: [
{ label: '打卡天数', value: 28 }, { label: '打卡天数', key: 'checkInDays' },
{ label: '迟到', value: 1, valueClass: 'danger' }, { label: '迟到', key: 'late', valueClass: 'danger' },
{ label: '早退', value: 1, valueClass: 'danger' }, { label: '早退', key: 'earlyLeave', valueClass: 'danger' },
{ label: '旷工', value: 1, valueClass: 'danger' } { label: '旷工', key: 'absenteeism', valueClass: 'danger' }
], ],
dailyReportItems: [ dailyReportItems: [
{ label: '已提交', value: 28, subLabel: '日报完成率0%', subClass: 'success' }, { label: '已提交', key: 'submitted', subLabel: '日报完成率', subKey:'completionRate', subClass: 'success' },
{ label: '未提交', value: 0 }, { label: '未提交', key: 'notSubmitted' },
{ label: '在岗', value: 26 }, { label: '在岗', key: 'onDuty' },
{ label: '调休', value: 2 } { label: '调休', key: 'rest' }
], ],
receptionItems: [ receptionItems: [
{ label: '实际交车数', value: 20 }, { label: '实际交车数', key: 'actualDelivery' },
{ label: '接待数量', value: 22 }, { label: '接待数量', key: 'receptionCount' },
{ label: '未触客数', value: 2 } { label: '未触客数', key: 'notTouched' }
], ],
weakTags: [ weakTags: [
{ label: '身份介绍:差', type: 'danger' }, { label: '身份介绍:差', type: 'danger' },
...@@ -40,22 +44,75 @@ Component({ ...@@ -40,22 +44,75 @@ Component({
], ],
recordStatsRows: [ recordStatsRows: [
[ [
{ label: '录音', value: 4 }, { label: '录音', key: 'recordingCount' },
{ label: '成交数', value: 2 }, { label: '成交数', key: 'dealCount' },
{ label: '战败数', value: 2 }, { label: '战败数', key: 'defeatCount' },
{ label: '成交率', value: 2 } { label: '成交率', key: 'dealRate' }
], ],
[ [
{ label: '质检平均分', value: 4 }, { label: '质检平均分', key: 'qualityScore' },
{ label: '攻防平均分', value: 2 }, { label: '攻防平均分', key: 'attackDefenseScore' },
{ label: '录音缺失率', value: 2 } { label: '录音缺失率', key: 'recordingMissingRate' }
] ]
], ],
dressWarningItems: [{ label: '预警次数', value: 4 }] dressWarningItems: [{ label: '预警次数', key: 'warningCount' }],
behaviorInfo: {}
}, },
methods: { methods: {
search(e) { search(e) {
this.triggerEvent('search', e?.detail || {}) this.setData({
startStr: e.detail.startDay?.replace(/\//g, '-'),
endStr: e.detail.endDay?.replace(/\//g, '-')
}, () => {
this.getData()
})
},
getData() {
let { detailInfo } = this.data
// 假数据
let data = {
attendance: {
checkInDays: 20,
late: 1,
earlyLeave: 5,
absenteeism: 5
},
dailyReport: {
submitted: 5,
notSubmitted: 8,
onDuty: 6,
rest: 8,
completionRate: 95
},
customerReception: {
actualDelivery: 10,
receptionCount: 2,
notTouched: 8
},
recordingAnalysis: {
behaviorTags: [],
quantitativeIndicators: {
recordingCount: 20,
dealCount: 5,
defeatCount: 3,
dealRate: 15,
qualityScore: 8,
attackDefenseScore: 11,
recordingMissingRate: 20
}
},
dressCodeWarning: {
warningCount: 8
}
}
this.setData({
behaviorInfo: data
})
let params = {
employeeId: detailInfo.employeeId,
scene: detailInfo.scene
}
api.getEmployeebehaviorData(params)
}, },
handleChangeMerchant() { handleChangeMerchant() {
this.triggerEvent('changeMerchant') this.triggerEvent('changeMerchant')
......
<view class="behavior-analysis"> <view class="behavior-analysis">
<view class="date"> <view class="date">
<date-screen bind:search="search"></date-screen> <date-screen bind:search="search" customBackground="#F7F8FA"></date-screen>
</view> </view>
<view class="merchant-change" bind:tap="handleChangeMerchant"> <view class="merchant-change" bind:tap="handleChangeMerchant">
<image src="{{IMG_URL}}analyse-merchant-icon.png" mode=""/> <image src="{{IMG_URL}}analyse-merchant-icon.png" mode=""/>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<view class="grid grid-4"> <view class="grid grid-4">
<view class="grid-item" wx:for="{{attendanceItems}}" wx:key="label"> <view class="grid-item" wx:for="{{attendanceItems}}" wx:key="label">
<view class="label">{{item.label}}</view> <view class="label">{{item.label}}</view>
<view class="value {{item.valueClass || ''}}">{{item.value}}</view> <view class="value {{item.valueClass || ''}}">{{behaviorInfo.attendance[item.key]}}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
<view class="grid grid-4"> <view class="grid grid-4">
<view class="grid-item" wx:for="{{dailyReportItems}}" wx:key="label"> <view class="grid-item" wx:for="{{dailyReportItems}}" wx:key="label">
<view class="label">{{item.label}}</view> <view class="label">{{item.label}}</view>
<view class="value">{{item.value}}</view> <view class="value">{{behaviorInfo.dailyReport[item.key]}}</view>
<view class="sub {{item.subClass || ''}}" wx:if="{{item.subLabel}}">{{item.subLabel}}</view> <view class="sub {{item.subClass || ''}}" wx:if="{{item.subLabel}}">{{item.subLabel}}{{behaviorInfo.dailyReport[item.subKey]}}%</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<view class="grid grid-3"> <view class="grid grid-3">
<view class="grid-item" wx:for="{{receptionItems}}" wx:key="label"> <view class="grid-item" wx:for="{{receptionItems}}" wx:key="label">
<view class="label">{{item.label}}</view> <view class="label">{{item.label}}</view>
<view class="value">{{item.value}}</view> <view class="value">{{behaviorInfo.customerReception[item.key]}}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<view class="grid grid-{{row.length}} stats-grid" wx:for="{{recordStatsRows}}" wx:for-item="row" wx:key="index"> <view class="grid grid-{{row.length}} stats-grid" wx:for="{{recordStatsRows}}" wx:for-item="row" wx:key="index">
<view class="grid-item" wx:for="{{row}}" wx:key="label"> <view class="grid-item" wx:for="{{row}}" wx:key="label">
<view class="label">{{item.label}}</view> <view class="label">{{item.label}}</view>
<view class="value">{{item.value}}</view> <view class="value">{{behaviorInfo.recordingAnalysis.quantitativeIndicators[item.key]}}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<view class="grid grid-1"> <view class="grid grid-1">
<view class="grid-item" wx:for="{{dressWarningItems}}" wx:key="label"> <view class="grid-item" wx:for="{{dressWarningItems}}" wx:key="label">
<view class="label">{{item.label}}</view> <view class="label">{{item.label}}</view>
<view class="value">{{item.value}}</view> <view class="value">{{behaviorInfo.dressCodeWarning[item.key]}}</view>
</view> </view>
</view> </view>
</view> </view>
......
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/' const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
import api from '~/api/crew/index'
const MERCHANT_DATA_LIST = [{ const MERCHANT_DATA_LIST = [{
text: '总产值', text: '总产值',
width: 240, width: 240,
...@@ -235,42 +236,10 @@ Component({ ...@@ -235,42 +236,10 @@ Component({
detailInfo: { detailInfo: {
type: Object, type: Object,
value: {}, value: {},
},
staffData: {
type: Object,
value: {},
observer: function () {
this.refreshViewModel()
},
},
goodsCategorySummary: {
type: Object,
value: {},
observer: function () {
this.refreshViewModel()
},
},
businessType: {
type: String,
value: 'yanbao',
observer: function () { observer: function () {
this.refreshViewModel() this.refreshViewModel()
}, },
}, }
isBrand: {
type: Boolean,
value: true,
observer: function () {
this.refreshViewModel()
},
},
trendData: {
type: Array,
value: [],
observer: function () {
this.refreshViewModel()
},
},
}, },
data: { data: {
IMG_URL, IMG_URL,
...@@ -350,11 +319,11 @@ Component({ ...@@ -350,11 +319,11 @@ Component({
"ratio" : 0 "ratio" : 0
} ] } ]
}, },
lifetimes: { // lifetimes: {
attached: function () { // attached: function () {
this.refreshViewModel() // this.refreshViewModel()
}, // },
}, // },
methods: { methods: {
onDateSearch(e) { onDateSearch(e) {
const queryType = getQueryTypeFromDateScreen(this) const queryType = getQueryTypeFromDateScreen(this)
...@@ -363,8 +332,8 @@ Component({ ...@@ -363,8 +332,8 @@ Component({
{ {
queryType, queryType,
dateRange: { dateRange: {
startDay: payload.startDay || '', startDay: payload.startDay?.replace(/\//g, '-') || '',
endDay: payload.endDay || '', endDay: payload.endDay?.replace(/\//g, '-') || '',
}, },
}, },
() => { () => {
...@@ -396,7 +365,13 @@ Component({ ...@@ -396,7 +365,13 @@ Component({
}) })
}, 350) }, 350)
}, },
refreshViewModel() { async refreshViewModel() {
// await Promise.all([
// getMerchantBiGoodsSummaryData(),
// getMerchantBiEmployeeSummaryData(),
// getMerchantBiOutputTrendSceneData(),
// getAnalysisStoreEmployeeRankData(),
// ]);
const staffData = this.data.staffData || this.properties.staffData || {} const staffData = this.data.staffData || this.properties.staffData || {}
const goodsCategorySummary = this.data.goodsCategorySummary || this.properties.goodsCategorySummary || {} const goodsCategorySummary = this.data.goodsCategorySummary || this.properties.goodsCategorySummary || {}
const businessType = this.data.businessType || this.properties.businessType || 'yanbao' const businessType = this.data.businessType || this.properties.businessType || 'yanbao'
......
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/' const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
import dayjs from 'dayjs'
import api from '~/api/crew/index'
Component({ Component({
properties: { properties: {
detailInfo: { detailInfo: {
...@@ -18,40 +19,40 @@ Component({ ...@@ -18,40 +19,40 @@ Component({
{ key: 'course', label: '课程学习' }, { key: 'course', label: '课程学习' },
{ key: 'coach', label: '督导带教' } { key: 'coach', label: '督导带教' }
], ],
activeTab: 'course', activeTab: 0,
courseList: [ list: []
{
id: 1,
title: '客情维护客户画像的重要性',
completedAt: '2026-03-01 12:56:37'
},
{
id: 2,
title: '客情维护客户画像的重要性',
completedAt: '2026-03-01 12:56:37'
}
],
coachList: [
{
id: 1,
title: '督导带教',
coachedAt: '2026-03-01 12:56:37'
},
{
id: 2,
title: '督导带教',
coachedAt: '2026-03-01 12:56:37'
}
]
}, },
methods: { methods: {
search(e) { search(e) {
this.triggerEvent('search', e?.detail || {}) let { activeTab, detailInfo } = this.data
let params = {
storeManagerPhone: detailInfo.storeManagerPhone,
startDate: e.detail.startDay?.replace(/\//g, '-'),
endDate: e.detail.endDay?.replace(/\//g, '-'),
trainingType: activeTab + 1
}
// 假数据
let data = [{
taskId: 1,
name: '客情维护客户画像的重要性',
completedTime: 1773739327171
}, {
taskId: 2,
name: '督导带教',
completedTime: 1773739321171
}]
data?.forEach(val => {
val.completedTime = dayjs(val.completedTime).format('YYYY-MM-DD HH:mm:ss')
})
this.setData({list: data})
// api.getTrainingExperienceList(params).then(res => {
// })
}, },
onTabTap(e) { onTabTap(e) {
const { key } = e.currentTarget.dataset || {} const { index } = e.currentTarget.dataset || {}
if (!key || key === this.data.activeTab) return if (index == this.data.activeTab) return
this.setData({ activeTab: key }) this.setData({ activeTab: index })
}, },
onViewItem(e) { onViewItem(e) {
const { type, item } = e.currentTarget.dataset || {} const { type, item } = e.currentTarget.dataset || {}
......
...@@ -81,6 +81,11 @@ ...@@ -81,6 +81,11 @@
background: #f7f8fa; background: #f7f8fa;
} }
.coach {
flex-flow: column;
align-items: flex-start;
}
.icon { .icon {
width: 48rpx; width: 48rpx;
height: 48rpx; height: 48rpx;
...@@ -109,8 +114,15 @@ ...@@ -109,8 +114,15 @@
line-height: 34rpx; line-height: 34rpx;
} }
.btn-box {
width: 100%;
}
.btn { .btn {
padding: 0 24rpx; float: right;
width: 144rpx;
box-sizing: border-box;
text-align: center;
height: 56rpx; height: 56rpx;
line-height: 56rpx; line-height: 56rpx;
border-radius: 28rpx; border-radius: 28rpx;
......
...@@ -12,35 +12,49 @@ ...@@ -12,35 +12,49 @@
<view class="segmented"> <view class="segmented">
<view <view
class="seg-item {{activeTab === tab.key ? 'active' : ''}}" class="seg-item {{activeTab === index ? 'active' : ''}}"
wx:for="{{tabs}}" wx:for="{{tabs}}"
wx:key="key" wx:key="index"
wx:for-item="tab" wx:for-item="tab"
data-key="{{tab.key}}" data-index="{{index}}"
bind:tap="onTabTap" bind:tap="onTabTap"
> >
{{tab.label}} {{tab.label}}
</view> </view>
</view> </view>
<view class="list" wx:if="{{activeTab === 'course'}}"> <view class="list" wx:if="{{activeTab == 0}}">
<view class="list-item" wx:for="{{courseList}}" wx:key="id"> <block wx:if="{{list.length}}">
<image class="icon" src="{{IMG_URL}}training-course-icon.png" mode=""/> <view class="list-item" wx:for="{{list}}" wx:key="id">
<image class="icon" src="{{IMG_URL}}learning-icon.png" mode=""/>
<view class="content"> <view class="content">
<view class="title">{{item.title}}</view> <view class="title">{{item.name}}</view>
<view class="sub">课程完成时间:{{item.completedAt}}</view> <view class="sub">课程完成时间:{{item.completedTime}}</view>
</view> </view>
</view> </view>
</block>
<block wx:else>
<empty-data />
</block>
</view> </view>
<view class="list" wx:elif="{{activeTab === 'coach'}}"> <view class="list" wx:elif="{{activeTab == 1}}">
<view class="list-item coach" wx:for="{{coachList}}" wx:key="id"> <block wx:if="{{list.length}}">
<image class="icon" src="{{IMG_URL}}training-coach-icon.png" mode=""/> <view class="list-item coach" wx:for="{{list}}" wx:key="id">
<view style="display: flex;gap: 12rpx;">
<image class="icon" src="{{IMG_URL}}coaching-icon.png" mode=""/>
<view class="content"> <view class="content">
<view class="title">{{item.title}}</view> <view class="title">{{item.name}}</view>
<view class="sub">带教时间:{{item.coachedAt}}</view> <view class="sub">带教时间:{{item.completedTime}}</view>
</view> </view>
</view>
<view class="btn-box">
<view class="btn" data-type="coach" data-item="{{item}}" bind:tap="onViewItem">查看</view> <view class="btn" data-type="coach" data-item="{{item}}" bind:tap="onViewItem">查看</view>
</view> </view>
</view> </view>
</block>
<block wx:else>
<empty-data />
</block>
</view>
</view> </view>
// packageCrew/pages/peopleOverview/peopleOverview.js // packageCrew/pages/peopleOverview/peopleOverview.js
import api from '~/api/crew/index'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/' const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
Page({ Page({
...@@ -8,23 +9,17 @@ Page({ ...@@ -8,23 +9,17 @@ Page({
data: { data: {
IMG_URL, IMG_URL,
AIContent: '团队培训数据显示表面学习投入尚可,但知识体系构建严重不均,部分老顾问仅完成基础课程,在新产品与金融方案上存在明显知识断层,且带教记录空白,表明技能固化缺乏更新。与此同时,新人虽接受带教较多,但与其高战败率关联看,带教内容可能未精准击中其销售流程中的薄弱环节(如需求挖掘)。当前培训陷入“学用脱节”与“辅导泛化”的困境。建议立即进行针对性调整:第一,实施“短板课程强推计划”,根据上月战败主因(如竞品对比失利),强制相关顾问在3日内完成对应专题课程学习并通关测试;第二,改革带教模式,推行“数据驱动的精准带教”,督导需提前查阅带教对象的近期战败录音或低分项,带着具体问题(如“如何应对XX竞品的空间质疑”)进行陪访或演练,确保每次带教解决一个实际问题。通过“缺什么补什么”和“练什么考什么”,快速将培训转化为实战能力。团队培训数据显示表面学习投入尚可,但知识体系构建严重不均,部分老顾问仅完成基础课程,在新产品与金融方案上存在明显知识断层,且带教记录空白,表明技能固化缺乏更新。将“现状分析”与“建议”两部分自然融合为一段连贯文字,避免使用标题。整段文字需严格控制在500字以内,语言简洁、务实、指向明确。', AIContent: '团队培训数据显示表面学习投入尚可,但知识体系构建严重不均,部分老顾问仅完成基础课程,在新产品与金融方案上存在明显知识断层,且带教记录空白,表明技能固化缺乏更新。与此同时,新人虽接受带教较多,但与其高战败率关联看,带教内容可能未精准击中其销售流程中的薄弱环节(如需求挖掘)。当前培训陷入“学用脱节”与“辅导泛化”的困境。建议立即进行针对性调整:第一,实施“短板课程强推计划”,根据上月战败主因(如竞品对比失利),强制相关顾问在3日内完成对应专题课程学习并通关测试;第二,改革带教模式,推行“数据驱动的精准带教”,督导需提前查阅带教对象的近期战败录音或低分项,带着具体问题(如“如何应对XX竞品的空间质疑”)进行陪访或演练,确保每次带教解决一个实际问题。通过“缺什么补什么”和“练什么考什么”,快速将培训转化为实战能力。团队培训数据显示表面学习投入尚可,但知识体系构建严重不均,部分老顾问仅完成基础课程,在新产品与金融方案上存在明显知识断层,且带教记录空白,表明技能固化缺乏更新。将“现状分析”与“建议”两部分自然融合为一段连贯文字,避免使用标题。整段文字需严格控制在500字以内,语言简洁、务实、指向明确。',
detailInfo: { detailInfo: {},
staffName: '赵惠惠',
sex: 1,
staffPhone: '18902640418',
entryDate: '2025-12-12',
scene: '延保,轻改,权益'
},
detailItems: [{ detailItems: [{
label: '手机号码', label: '手机号码',
key: 'staffPhone' key: 'phone'
}, { }, {
label: '入职时间', label: '入职时间',
key: 'entryDate', key: 'entryDate',
width: '290rpx' width: '290rpx'
}, { }, {
label: '归属业务', label: '归属业务',
key: 'scene', key: 'business',
inline: true inline: true
}], }],
tabList: [{ tabList: [{
...@@ -57,7 +52,11 @@ Page({ ...@@ -57,7 +52,11 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.setData({
detailInfo: options
})
// 获取个人基础数据信息
this.getBaseData(options)
}, },
/** /**
...@@ -74,6 +73,37 @@ Page({ ...@@ -74,6 +73,37 @@ Page({
// wx.$track.setTrackData(0, `supervisor_personal_dashboard_detail`, {}, '') // wx.$track.setTrackData(0, `supervisor_personal_dashboard_detail`, {}, '')
}, },
getBaseData(options) {
// 假数据
let data = {
entryDate: '2026-01-01',
business: '延保,轻改',
gender: '女',
origin: '陕西省/延安市',
name: '周芳',
age: 33,
ethnicity: '汉',
manager: '李四',
department: '运营零售部门',
position: '延保门店销售',
phone: 13812345678,
birthday: '1993-03-26'
}
this.setData({baseInfo: data})
api.getEmployeeBaseData({
employeeId: options?.employeeId
}).then(res => {
let { code, data, message } = res
if (code == 0) {
this.setData({
baseInfo: data
})
} else {
wx.$util.showToast(message)
}
})
},
// 接待录音 // 接待录音
handleRecording() { handleRecording() {
// wx.$track.setTrackData(0, `supervisor_reception_recording`, {}, '') // wx.$track.setTrackData(0, `supervisor_reception_recording`, {}, '')
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
<view class="top-box"> <view class="top-box">
<view class="name"> <view class="name">
<view class="staff"> <view class="staff">
{{detailInfo.staffName}} {{baseInfo.name}}
<image class="sex-icon" src="{{IMG_URL}}{{detailInfo.sex == 1 ? 'female-icon' : 'male-iconx'}}.png" mode="aspectFit" /> <image class="sex-icon" src="{{IMG_URL}}{{detailInfo.gender == '女' ? 'female-icon' : 'male-iconx'}}.png" mode="aspectFit" />
</view> </view>
<view class="btn" bindtap="handleStoreTransfer"> <view class="btn" bindtap="handleStoreTransfer">
<text>调店记录</text> <text>调店记录</text>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<view class="items"> <view class="items">
<view class="item {{item.inline ? 'inline' : ''}}" style="{{item.width ? ('width:' + item.width + ';') : ''}}" wx:for="{{detailItems}}" wx:key="index"> <view class="item {{item.inline ? 'inline' : ''}}" style="{{item.width ? ('width:' + item.width + ';') : ''}}" wx:for="{{detailItems}}" wx:key="index">
<view class="label">{{item.label}}:</view> <view class="label">{{item.label}}:</view>
<view class="value">{{detailInfo[item.key] || '-'}}</view> <view class="value">{{baseInfo[item.key] || '-'}}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<tab-bar tabList="{{ tabList }}" bindclick="tabClick" activeIndex="{{ tabIndex }}" /> <tab-bar tabList="{{ tabList }}" bindclick="tabClick" activeIndex="{{ tabIndex }}" />
</view> </view>
<view class="tab-content"> <view class="tab-content">
<basic-info wx:if="{{tabIndex === 0}}" detailInfo="{{detailInfo}}" /> <basic-info wx:if="{{tabIndex === 0}}" baseInfo="{{baseInfo}}" />
<personal-performance wx:if="{{tabIndex === 1}}" detailInfo="{{detailInfo}}" /> <personal-performance wx:if="{{tabIndex === 1}}" detailInfo="{{detailInfo}}" />
<behavior-analysis wx:if="{{tabIndex === 2}}" detailInfo="{{detailInfo}}" /> <behavior-analysis wx:if="{{tabIndex === 2}}" detailInfo="{{detailInfo}}" />
<training-experience wx:if="{{tabIndex === 3}}" detailInfo="{{detailInfo}}" /> <training-experience wx:if="{{tabIndex === 3}}" detailInfo="{{detailInfo}}" />
......
// packageCrew/pages/recordingDetail/recordingDetail.js // packageCrew/pages/recordingDetail/recordingDetail.js
import {getRecordDetailList, getShortUrl, findCheckResultByBatchId } from "~/api/crew/index" import {getRecordDetailList, getShortUrl, findCheckResultByBatchId, submitOutstandingCases } from "~/api/crew/index"
import dayjs from 'dayjs' import dayjs from 'dayjs'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/' const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/'
...@@ -300,6 +300,25 @@ Page({ ...@@ -300,6 +300,25 @@ Page({
keepScreenOn keepScreenOn
}) })
}, },
// 提报优秀案例
handleSubmit() {
let params = {
staffName: record.staffName,
staffPhone: record.staffPhone,
merchantId: record.merchantId,
merchantName: record.merchantName,
customerCategory: record.customerCategory,
recordingUrl: record.fileUrl
}
submitOutstandingCases(params).then(res => {
let { code, data, message } = res
if (code == 0) {
wx.navigateBack()
} else {
wx.$util.showToast(message)
}
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
......
// packageCrew/pages/storeTransfer/storeTransfer.js // packageCrew/pages/storeTransfer/storeTransfer.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/' const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
import api from '~/api/index/index'
Page({ Page({
/** /**
...@@ -7,10 +8,7 @@ Page({ ...@@ -7,10 +8,7 @@ Page({
*/ */
data: { data: {
IMG_URL, IMG_URL,
list: [{ list: []
merchantName: '广州鸿粤宏鑫汽车销售服务有限公司询服务中心',
date: '2025-01-01'
}]
}, },
navbarReady(e) { navbarReady(e) {
...@@ -28,7 +26,7 @@ Page({ ...@@ -28,7 +26,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.getList(options)
}, },
/** /**
...@@ -45,6 +43,13 @@ Page({ ...@@ -45,6 +43,13 @@ Page({
}, },
getList(options) {
let params = {
employeeId
}
api.getStoreTransferApi({})
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
......
...@@ -10,9 +10,9 @@ Page({ ...@@ -10,9 +10,9 @@ Page({
data: { data: {
IMG_URL, IMG_URL,
orderObj: { orderObj: {
onBreak: 'N', onDutyFlag: 0,
content: '', taskContext: '',
merchantPhoto: [], taskImageList: [],
merchantName: '' merchantName: ''
}, },
showSelectPopup: false showSelectPopup: false
...@@ -22,7 +22,11 @@ Page({ ...@@ -22,7 +22,11 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.getMerchantData()
this.setData({pageQuery: options})
if (options.taskStatus == 2) {
this.getDetail(options)
}
}, },
/** /**
...@@ -46,23 +50,50 @@ Page({ ...@@ -46,23 +50,50 @@ Page({
}) })
}, },
getDetail(data) {
api.getTaskDetail({id: data.id}).then(res => {
let { code, data, message } = res
if (code == 0) {
let taskContextLength = data.taskContext?.length
this.setData({orderObj: data || {}, taskContextLength})
} else {
wx.$util.showToast(message)
}
})
},
getMerchantData() {
api.getSupervisorMerchantList({}).then(res => {
let { code, data, message } = res
if (code == 0) {
this.setData({
merchantList: data || []
})
} else {
wx.$util.showToast(message)
}
})
},
changeStatus(e) { changeStatus(e) {
if (this.data.orderObj.taskStatus == 2) return
let { value } = e.currentTarget.dataset let { value } = e.currentTarget.dataset
this.setData({ this.setData({
'orderObj.onBreak': value, 'orderObj.onDutyFlag': value,
'orderObj.content': '', 'orderObj.taskContext': '',
contentLength: 0, taskContextLength: 0,
'orderObj.merchantId': '', 'orderObj.merchantId': '',
'orderObj.merchantName': '', 'orderObj.merchantName': '',
'orderObj.merchantPhoto': [] 'orderObj.taskImageList': []
}) })
}, },
chooseMerchant() { chooseMerchant() {
let { orderObj } = this.data let { orderObj, merchantList } = this.data
if (orderObj.taskStatus == 2) return
this.setData({ this.setData({
showSelectPopup: true, showSelectPopup: true,
selectOptions: [{merchantId: 123, merchantName: '明明4s店1'}], selectOptions: merchantList,
selectValue: [orderObj.merchantId] selectValue: [orderObj.merchantId]
}) })
}, },
...@@ -83,24 +114,34 @@ Page({ ...@@ -83,24 +114,34 @@ Page({
}) })
}, },
contentInput(e) { taskContextInput(e) {
if (this.data.orderObj.taskStatus == 2) return
let val = e.detail.value || "" let val = e.detail.value || ""
if (val.length > 500) { if (val.length > 500) {
val = val.substring(0, 500) val = val.substring(0, 500)
} }
this.setData({ this.setData({
'orderObj.content': val, 'orderObj.taskContext': val,
contentLength: val.length taskContextLength: val.length
}) })
}, },
handleImageUpload() { handleImageUpload() {
let { orderObj } = this.data let _this = this
let { orderObj } = _this.data
wx.chooseImage({ wx.chooseImage({
count: 1, count: 1,
sourceType: ['camera'], sourceType: ['camera'],
success(res) { success(res) {
let [tempFiles] = res.tempFilePaths let [tempFiles] = res.tempFilePaths
for (const file of res.tempFiles) {
if (file.size > 10 * 1024 * 1024) {
return wx.showToast({
title: '图片上传最大10MB',
icon: 'none'
})
}
}
let imgType = tempFiles.split('.')[1] let imgType = tempFiles.split('.')[1]
let type = imgType == 'unknown' ? 'jpg' : imgType let type = imgType == 'unknown' ? 'jpg' : imgType
wx.getFileSystemManager().readFile({ wx.getFileSystemManager().readFile({
...@@ -114,7 +155,7 @@ Page({ ...@@ -114,7 +155,7 @@ Page({
wx.$util.hideLoading() wx.$util.hideLoading()
let { code, data, message } = img let { code, data, message } = img
if (code == 0) { if (code == 0) {
orderObj.merchantPhoto.push(data) orderObj.taskImageList.push({imageUrl: data})
_this.setData({ _this.setData({
orderObj orderObj
}) })
...@@ -128,21 +169,48 @@ Page({ ...@@ -128,21 +169,48 @@ Page({
}) })
}, },
submit() { previewImage(e) {
let { url, index } = e.currentTarget.dataset
wx.previewImage({
urls: url?.map(val => {return val.imageUrl}),
current: url[index].imageUrl
})
},
delPhoto(e) {
let { index } = e.currentTarget.dataset
let { orderObj } = this.data let { orderObj } = this.data
if (orderObj.onBreak == 'N') { orderObj.taskImageList.splice(index, 1)
if (!orderObj.merchantId || !orderObj.content || !orderObj.merchantPhoto.length) return wx.$util.showToast('请完成所有必填项') this.setData({
'orderObj.taskImageList': orderObj.taskImageList
})
},
submit() {
let { orderObj, pageQuery } = this.data
if (orderObj.onDutyFlag == 0) {
if (!orderObj.merchantId || !orderObj.taskContext || !orderObj.taskImageList.length) return wx.$util.showToast('请完成所有必填项')
} }
let params = { let params = {
onBreak: orderObj.onBreak, id: pageQuery?.id,
merchantId: orderObj.onBreak == 'N' ? orderObj.merchantId : '', taskType: 0,
content: orderObj.onBreak == 'N' ? orderObj.content : '', onDutyFlag: orderObj.onDutyFlag,
merchantPhoto: orderObj.onBreak == 'N' ? orderObj.merchantPhoto : '', merchantId: orderObj.onDutyFlag == 0 ? orderObj.merchantId : '',
taskContext: orderObj.onDutyFlag == 0 ? orderObj.taskContext : '',
taskImageList: orderObj.onDutyFlag == 0 ? orderObj.taskImageList : [],
} }
wx.$util.showLoading()
api.submitSupervisorReport(params).then(res => { api.submitSupervisorReport(params).then(res => {
wx.$util.hideLoading()
let { code, message } = res
if (code == 0) {
this.back() this.back()
} else {
wx.$util.showToast(message)
}
}).catch(() => {
wx.$util.hideLoading()
}) })
console.log(orderObj)
}, },
back() { back() {
......
...@@ -120,7 +120,25 @@ page { ...@@ -120,7 +120,25 @@ page {
.upload_box{ .upload_box{
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: var(--fontSize20); gap: 20rpx;
.payVoucher_image{
flex-shrink: 0;
width: 192rpx;
height: 192rpx;
border-radius: 10rpx;
position: relative;
image{
width: 100%;
height: 100%;
}
.del_icon{
width: 40rpx;
height: 40rpx;
position: absolute;
top: 16rpx;
right: 16rpx;
}
}
.upload-item { .upload-item {
width: 196rpx; width: 196rpx;
height: 196rpx; height: 196rpx;
......
...@@ -14,19 +14,19 @@ ...@@ -14,19 +14,19 @@
<view class="item-box"> <view class="item-box">
<view class="lebel">当日状态<text class='required'>*</text></view> <view class="lebel">当日状态<text class='required'>*</text></view>
<view class="value_box"> <view class="value_box">
<view class="radio-box" bindtap="changeStatus" data-value='N'> <view class="radio-box" bindtap="changeStatus" data-value='0'>
<image wx:if="{{orderObj.onBreak == 'N'}}" class="radio-icon" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/radio-checked.png" mode=""/> <image wx:if="{{orderObj.onDutyFlag == 0}}" class="radio-icon" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/radio-checked.png" mode=""/>
<view wx:else class="circle"></view> <view wx:else class="circle"></view>
<view class="text">在岗</view> <view class="text">在岗</view>
</view> </view>
<view class="radio-box" bindtap="changeStatus" data-value='Y'> <view class="radio-box" bindtap="changeStatus" data-value='1'>
<image wx:if="{{orderObj.onBreak == 'Y'}}" class="radio-icon" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/radio-checked.png" mode=""/> <image wx:if="{{orderObj.onDutyFlag == 1}}" class="radio-icon" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/radio-checked.png" mode=""/>
<view wx:else class="circle"></view> <view wx:else class="circle"></view>
<view class="text">调休</view> <view class="text">调休</view>
</view> </view>
</view> </view>
</view> </view>
<block wx:if="{{orderObj.onBreak == 'N'}}"> <block wx:if="{{orderObj.onDutyFlag == 0}}">
<view class="item-box"> <view class="item-box">
<view class="label">选择门店<text class='required'>*</text></view> <view class="label">选择门店<text class='required'>*</text></view>
<view class="value" bindtap="chooseMerchant"> <view class="value" bindtap="chooseMerchant">
...@@ -40,24 +40,24 @@ ...@@ -40,24 +40,24 @@
<view class="item-box remark_box"> <view class="item-box remark_box">
<view class="label">日报填写<text class='required'>*</text></view> <view class="label">日报填写<text class='required'>*</text></view>
<view class="textArea_box"> <view class="textArea_box">
<textarea placeholder-style="color: #999EA8;" value="{{ orderObj.content }}" maxlength="500" placeholder="请输入" class="textarea" bindinput="contentInput" /> <textarea placeholder-style="color: #999EA8;" disabled="{{orderObj.taskStatus == 2}}" value="{{ orderObj.taskContext }}" maxlength="500" placeholder="请输入" class="textarea" bindinput="taskContextInput" />
<view class="currentWordNumber">{{contentLength || 0}} / 500</view> <view class="currentWordNumber">{{taskContextLength || 0}} / 500</view>
</view> </view>
</view> </view>
<view class="image-box"> <view class="image-box">
<view class="label">门店拍照<text class='required'>*</text></view> <view class="label">门店拍照<text class='required'>*</text></view>
<view class="upload_box"> <view class="upload_box">
<block wx:if="{{orderObj.merchantPhoto.length > 0}}"> <block wx:if="{{orderObj.taskImageList.length > 0}}">
<view class="payVoucher_image" wx:for="{{payVoucher}}" wx:key="index"> <view class="payVoucher_image" wx:for="{{orderObj.taskImageList}}" wx:key="index">
<image bindtap="previewImage" data-index="{{index}}" data-url="{{payVoucher}}" src="{{item}}"/> <image bindtap="previewImage" data-index="{{index}}" data-url="{{orderObj.taskImageList}}" src="{{item.imageUrl}}"/>
<image class="del_icon" src="/packageCrowdFunding/images/del_icon.png" mode="" bindtap="delCustomPayVoucher" data-index="{{index}}"/> <image class="del_icon" wx:if="{{orderObj.taskStatus != 2}}" src="{{IMG_URL}}zy_paf_del_icon.png" mode="" bindtap="delPhoto" data-index="{{index}}"/>
</view> </view>
</block> </block>
<block wx:if="{{orderObj.merchantPhoto.length < 9}}"> <block wx:if="{{orderObj.taskImageList.length < 9 && orderObj.taskStatus != 2}}">
<view class="upload-item" bindtap="handleImageUpload"> <view class="upload-item" bindtap="handleImageUpload">
<image src="{{IMG_URL}}{{item.uploadIcon || 'zy-upload_icon.png'}}" class="icon-uploadAdd {{item.uploadIcon ? 'custom-icon-uploadAdd' : ''}}"></image> <image src="{{IMG_URL}}{{item.uploadIcon || 'zy-upload_icon.png'}}" class="icon-uploadAdd {{item.uploadIcon ? 'custom-icon-uploadAdd' : ''}}"></image>
<view class="upload-text"> <view class="upload-text">
{{orderObj.merchantPhoto.length + '/' + 9}} {{orderObj.taskImageList.length + '/' + 9}}
</view> </view>
</view> </view>
</block> </block>
...@@ -65,8 +65,8 @@ ...@@ -65,8 +65,8 @@
</view> </view>
</block> </block>
</view> </view>
<view class="footer-btn"> <view class="footer-btn" wx:if="{{orderObj.taskStatus != 2}}">
<view class="btn {{orderObj.onBreak == 'Y' ? 'fixed-btn' : ''}}" bindtap="submit">提交</view> <view class="btn {{orderObj.onDutyFlag == 1 ? 'fixed-btn' : ''}}" bindtap="submit">提交</view>
</view> </view>
</scroll-view> </scroll-view>
......
...@@ -7,7 +7,7 @@ Page({ ...@@ -7,7 +7,7 @@ Page({
*/ */
data: { data: {
orderObj: { orderObj: {
content: '' taskContext: ''
} }
}, },
...@@ -22,7 +22,12 @@ Page({ ...@@ -22,7 +22,12 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.setData({
pageQuery: options
})
if (options.taskStatus == 2) {
this.getDetail(options.id)
}
}, },
/** /**
...@@ -39,28 +44,49 @@ Page({ ...@@ -39,28 +44,49 @@ Page({
}, },
contentInput(e) { getDetail(id) {
api.getTaskDetail({id}).then(res => {
let { code, data, message } = res
if (code == 0) {
let taskContextLength = data.taskContext?.length
this.setData({orderObj: data || {}, taskContextLength})
} else {
wx.$util.showToast(message)
}
})
},
taskContextInput(e) {
let val = e.detail.value || "" let val = e.detail.value || ""
if (val.length > 1000) { if (val.length > 1000) {
val = val.substring(0, 1000) val = val.substring(0, 1000)
} }
this.setData({ this.setData({
'orderObj.content': val, 'orderObj.taskContext': val,
contentLength: val.length taskContextLength: val.length
}) })
}, },
submit() { submit() {
let { orderObj } = this.data let { orderObj, pageQuery } = this.data
if (!orderObj.content) return wx.$util.showToast('请完成所有必填项') if (!orderObj.taskContext) return wx.$util.showToast('请完成所有必填项')
let params = { let params = {
content: orderObj.content id: pageQuery?.id,
taskType: 2,
taskContext: orderObj.taskContext
} }
api.submitWeeklyReview(params).then(res => { wx.$util.showLoading()
api.submitMonthPlan(params).then(res => {
wx.$util.hideLoading()
let { code, message } = res
if (code == 0) {
this.back() this.back()
} else {
wx.$util.showToast(message)
}
}).catch(() => {
wx.$util.hideLoading()
}) })
console.log(orderObj)
}, },
back() { back() {
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
<view class="item-box remark_box"> <view class="item-box remark_box">
<view class="label">月度计划<text class='required'>*</text></view> <view class="label">月度计划<text class='required'>*</text></view>
<view class="textArea_box"> <view class="textArea_box">
<textarea placeholder-style="color: #999EA8;" value="{{ orderObj.reportContent }}" maxlength="1000" placeholder="请输入" class="textarea" bindinput="contentInput" /> <textarea placeholder-style="color: #999EA8;" disabled="{{orderObj.taskStatus == 2}}" value="{{ orderObj.taskContext }}" maxlength="1000" placeholder="请输入" class="textarea" bindinput="taskContextInput" />
<view class="currentWordNumber">{{contentLength || 0}} / 1000</view> <view class="currentWordNumber">{{taskContextLength || 0}} / 1000</view>
</view> </view>
</view> </view>
</view> </view>
<view class="footer-btn"> <view class="footer-btn" wx:if="{{orderObj.taskStatus != 2}}">
<view class="btn {{orderObj.onBreak == 'Y' ? 'fixed-btn' : ''}}">提交</view> <view class="btn {{orderObj.onBreak == 'Y' ? 'fixed-btn' : ''}}" bindtap="submit">提交</view>
</view> </view>
</scroll-view> </scroll-view>
\ No newline at end of file \ No newline at end of file
// packageIndex/pages/specialTask/specialTask.js // packageIndex/pages/specialTask/specialTask.js
import dayjs from 'dayjs'
import api from '~/api/index/index' import api from '~/api/index/index'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/' const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
Page({ Page({
...@@ -15,7 +16,7 @@ Page({ ...@@ -15,7 +16,7 @@ Page({
}, },
detailInfo: {handleStatus: 1}, detailInfo: {handleStatus: 1},
orderObj: { orderObj: {
content: '' taskContext: ''
} }
}, },
...@@ -30,7 +31,10 @@ Page({ ...@@ -30,7 +31,10 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.setData({
pageQuery: options
})
this.getDetail(options)
}, },
/** /**
...@@ -47,29 +51,51 @@ Page({ ...@@ -47,29 +51,51 @@ Page({
}, },
contentInput(e) { getDetail(options) {
api.getTaskDetail({id: options.id}).then(res => {
let { code, data, message } = res
if (code == 0) {
let taskContextLength = data.taskContext?.length
data.createTime = dayjs(data.createTime).format('YYYY-MM-DD HH:mm:ss')
this.setData({orderObj: data || {}, taskContextLength})
} else {
wx.$util.showToast(message)
}
})
},
taskContextInput(e) {
let val = e.detail.value || "" let val = e.detail.value || ""
if (val.length > 1000) { if (val.length > 1000) {
val = val.substring(0, 1000) val = val.substring(0, 1000)
} }
console.log(val) console.log(val)
this.setData({ this.setData({
'orderObj.content': val, 'orderObj.taskContext': val,
contentLength: val.length taskContextLength: val.length
}) })
}, },
submit() { submit() {
let { orderObj } = this.data let { orderObj, pageQuery } = this.data
if (!orderObj.content) return wx.$util.showToast('请完成所有必填项') if (!orderObj.taskContext) return wx.$util.showToast('请完成所有必填项')
let params = { let params = {
content: orderObj.content id: pageQuery?.id,
taskType: 4,
taskContext: orderObj.taskContext
} }
api.submitSpecialTask(params).then(res => { wx.$util.showLoading()
api.submitMonthPlan(params).then(res => {
wx.$util.hideLoading()
let { code, message } = res
if (code == 0) {
this.back() this.back()
} else {
wx.$util.showToast(message)
}
}).catch(() => {
wx.$util.hideLoading()
}) })
console.log(orderObj)
}, },
back() { back() {
......
...@@ -18,23 +18,23 @@ ...@@ -18,23 +18,23 @@
</view> </view>
<view class="row"> <view class="row">
<image class="icon" src="{{IMG_URL}}matter-icon.png" mode=""/> <image class="icon" src="{{IMG_URL}}matter-icon.png" mode=""/>
<text>事项描述:{{'“事项”在英文中通常根据其具体含义(指代“事情”、“任务”、“条款”还是“注意事项”)而有不同的翻译'}}</text> <text>事项描述:{{orderObj.taskDesc}}</text>
</view> </view>
<view class="row"> <view class="row">
<image class="icon" src="{{IMG_URL}}time-icon.png" mode=""/> <image class="icon" src="{{IMG_URL}}time-icon.png" mode=""/>
<text>创建时间:{{'2026-03-01 15:00:05'}}</text> <text>创建时间:{{orderObj.createTime}}</text>
</view> </view>
</view> </view>
<view class="specialTask-page"> <view class="specialTask-page">
<view class="item-box remark_box"> <view class="item-box remark_box">
<view class="label">专项任务<text class='required'>*</text></view> <view class="label">专项任务<text class='required'>*</text></view>
<view class="textArea_box"> <view class="textArea_box">
<textarea placeholder-style="color: #999EA8;" value="{{ orderObj.reportContent }}" maxlength="1000" placeholder="请输入" class="textarea" bindinput="contentInput" /> <textarea placeholder-style="color: #999EA8;" disabled="{{orderObj.taskStatus == 2}}" value="{{ orderObj.taskContext }}" maxlength="1000" placeholder="请输入" class="textarea" bindinput="taskContextInput" />
<view class="currentWordNumber">{{contentLength || 0}} / 1000</view> <view class="currentWordNumber">{{taskContextLength || 0}} / 1000</view>
</view> </view>
</view> </view>
</view> </view>
<view class="footer-btn"> <view class="footer-btn" wx:if="{{orderObj.taskStatus != 2}}">
<view class="btn {{orderObj.onBreak == 'Y' ? 'fixed-btn' : ''}}" bindtap="submit">提交</view> <view class="btn {{orderObj.onBreak == 'Y' ? 'fixed-btn' : ''}}" bindtap="submit">提交</view>
</view> </view>
</scroll-view> </scroll-view>
\ No newline at end of file \ No newline at end of file
...@@ -10,9 +10,9 @@ Page({ ...@@ -10,9 +10,9 @@ Page({
data: { data: {
IMG_URL, IMG_URL,
orderObj: { orderObj: {
content: '', taskContext: '',
merchantPhoto: [], taskImageList: [],
staffuuid: [] weekTaskStaffList: []
}, },
showSelectPopup: false showSelectPopup: false
}, },
...@@ -28,7 +28,11 @@ Page({ ...@@ -28,7 +28,11 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.getStaffList()
this.setData({pageQuery: options})
if (options.taskStatus == 2) {
this.getDetail(options.id)
}
}, },
/** /**
...@@ -45,19 +49,43 @@ Page({ ...@@ -45,19 +49,43 @@ Page({
}, },
getStaffList() {
api.getSupervisorStaffList({}).then(res => {
let { code, data, message } = res
if (code == 0) {
this.setData({staffList: data})
} else {
wx.$util.showToast(message)
}
})
},
getDetail(id) {
api.getTaskDetail({id}).then(res => {
let { code, data, message } = res
if (code == 0) {
let taskContextLength = data.taskContext?.length
this.setData({orderObj: data || {}, taskContextLength})
} else {
wx.$util.showToast(message)
}
})
},
chooseStaff() { chooseStaff() {
let { orderObj } = this.data let { orderObj, staffList } = this.data
if (orderObj.taskStatus == 2) return
this.setData({ this.setData({
showSelectPopup: true, showSelectPopup: true,
selectOptions: [{staffuuid: 123, staffName: '明明4s店1'}, {staffuuid: 1234, staffName: '员工1'}], selectOptions: staffList,
selectValues: orderObj.staffuuid selectValues: orderObj.weekTaskStaffList?.map(val => { return val.staffPhone })
}) })
}, },
handlePopupConfirm(e) { handlePopupConfirm(e) {
let { values } = e.detail let { items } = e.detail
this.setData({ this.setData({
[`orderObj.staffuuid`]: values [`orderObj.weekTaskStaffList`]: items
}, () => { }, () => {
this.hideSelectPopup() this.hideSelectPopup()
}) })
...@@ -69,63 +97,111 @@ Page({ ...@@ -69,63 +97,111 @@ Page({
}) })
}, },
contentInput(e) { taskContextInput(e) {
let val = e.detail.value || "" let val = e.detail.value || ""
if (val.length > 1000) { if (val.length > 1000) {
val = val.substring(0, 1000) val = val.substring(0, 1000)
} }
this.setData({ this.setData({
'orderObj.content': val, 'orderObj.taskContext': val,
contentLength: val.length taskContextLength: val.length
}) })
}, },
handleImageUpload() { handleImageUpload() {
let _this = this
let { orderObj } = this.data let { orderObj } = this.data
wx.chooseImage({ wx.chooseImage({
count: 1, count: 9 - orderObj.taskImageList?.length,
mediaType: ['image'],
success(res) { success(res) {
let [tempFiles] = res.tempFilePaths console.log(res)
let imgType = tempFiles.split('.')[1] for (const file of res.tempFiles) {
let type = imgType == 'unknown' ? 'jpg' : imgType if (file.size > 10 * 1024 * 1024) {
return wx.showToast({
title: '图片上传最大10MB',
icon: 'none'
})
}
}
wx.$util.showLoading()
const uploadImages = async (tempFiles) => {
try {
for (const item of tempFiles) {
const val = item.path
const imgType = val.split('.')[1]
const type = imgType === 'unknown' ? 'jpg' : imgType
const _res = await new Promise((resolve, reject) => {
wx.getFileSystemManager().readFile({ wx.getFileSystemManager().readFile({
filePath: tempFiles, //选择图片返回的相对路径 filePath: val, // 选择图片返回的相对路径
encoding: 'base64', //编码格式 encoding: 'base64', // 编码格式
success(_res) { success: resolve,
wx.$util.showLoading('上传中...') fail: reject
uploadImg({ })
})
const img = await uploadImg({
file: `${type}@${_res.data}` file: `${type}@${_res.data}`
}).then(img => { })
wx.$util.hideLoading() const { code, data, message } = img
let { code, data, message } = img
if (code == 0) { if (code == 0) {
orderObj.merchantPhoto.push(data) orderObj.taskImageList.push({ imageUrl: data })
_this.setData({ _this.setData({
orderObj orderObj
}) })
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message)
} }
})
} }
}) } catch (error) {
wx.$util.showToast("上传失败,请重试")
} finally {
wx.$util.hideLoading()
}
}
uploadImages(res?.tempFiles)
} }
}) })
}, },
submit() { previewImage(e) {
let { url, index } = e.currentTarget.dataset
wx.previewImage({
urls: url?.map(val => {return val.imageUrl}),
current: url[index].imageUrl
})
},
delPhoto(e) {
let { index } = e.currentTarget.dataset
let { orderObj } = this.data let { orderObj } = this.data
if (!orderObj.staffuuid || !orderObj.content || !orderObj.merchantPhoto.length) return wx.$util.showToast('请完成所有必填项') orderObj.taskImageList.splice(index, 1)
this.setData({
'orderObj.taskImageList': orderObj.taskImageList
})
},
submit() {
let { orderObj, pageQuery } = this.data
if (!orderObj.weekTaskStaffList.length || !orderObj.taskContext || !orderObj.taskImageList.length) return wx.$util.showToast('请完成所有必填项')
let params = { let params = {
staffuuid: orderObj.staffuuid, id: pageQuery?.id,
content: orderObj.onBreak == 'N' ? orderObj.content : '', taskType: 1,
merchantPhoto: orderObj.onBreak == 'N' ? orderObj.merchantPhoto : '', weekTaskStaffList: orderObj.weekTaskStaffList?.map(val => { return {staffPhone: val.staffPhone, staffName: val.staffName} }),
taskContext: orderObj.taskContext,
taskImageList: orderObj.taskImageList,
} }
wx.$util.showLoading()
api.submitWeeklyReview(params).then(res => { api.submitWeeklyReview(params).then(res => {
wx.$util.hideLoading()
let { code, message } = res
if (code == 0) {
this.back() this.back()
} else {
wx.$util.showToast(message)
}
}).catch(() => {
wx.$util.hideLoading()
}) })
console.log(orderObj)
}, },
back() { back() {
......
...@@ -87,7 +87,25 @@ page { ...@@ -87,7 +87,25 @@ page {
.upload_box{ .upload_box{
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: var(--fontSize20); gap: 20rpx;
.payVoucher_image{
flex-shrink: 0;
width: 192rpx;
height: 192rpx;
border-radius: 10rpx;
position: relative;
image{
width: 100%;
height: 100%;
}
.del_icon{
width: 40rpx;
height: 40rpx;
position: absolute;
top: 16rpx;
right: 16rpx;
}
}
.upload-item { .upload-item {
width: 196rpx; width: 196rpx;
height: 196rpx; height: 196rpx;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<view class="item-box"> <view class="item-box">
<view class="label">参与人员<text class='required'>*</text></view> <view class="label">参与人员<text class='required'>*</text></view>
<view class="value" bindtap="chooseStaff"> <view class="value" bindtap="chooseStaff">
<text wx:if="{{orderObj.staffuuid.length}}" class="value-text">已选{{orderObj.staffuuid.length}}人</text> <text wx:if="{{orderObj.weekTaskStaffList.length}}" class="value-text">已选{{orderObj.weekTaskStaffList.length}}人</text>
<block wx:else> <block wx:else>
<text class="placeholder">点击选择</text> <text class="placeholder">点击选择</text>
</block> </block>
...@@ -24,32 +24,32 @@ ...@@ -24,32 +24,32 @@
<view class="item-box remark_box"> <view class="item-box remark_box">
<view class="label">复盘填写<text class='required'>*</text></view> <view class="label">复盘填写<text class='required'>*</text></view>
<view class="textArea_box"> <view class="textArea_box">
<textarea placeholder-style="color: #999EA8;" value="{{ orderObj.reportContent }}" maxlength="1000" placeholder="请输入" class="textarea" bindinput="contentInput" /> <textarea placeholder-style="color: #999EA8;" disabled="{{orderObj.taskStatus == 2}}" value="{{ orderObj.taskContext }}" maxlength="1000" placeholder="请输入" class="textarea" bindinput="taskContextInput" />
<view class="currentWordNumber">{{contentLength || 0}} / 1000</view> <view class="currentWordNumber">{{taskContextLength || 0}} / 1000</view>
</view> </view>
</view> </view>
<view class="image-box"> <view class="image-box">
<view class="label">复盘会议截图<text class='required'>*</text></view> <view class="label">复盘会议截图<text class='required'>*</text></view>
<view class="upload_box"> <view class="upload_box">
<block wx:if="{{orderObj.merchantPhoto.length > 0}}"> <block wx:if="{{orderObj.taskImageList.length > 0}}">
<view class="payVoucher_image" wx:for="{{payVoucher}}" wx:key="index"> <view class="payVoucher_image" wx:for="{{orderObj.taskImageList}}" wx:key="index">
<image bindtap="previewImage" data-index="{{index}}" data-url="{{payVoucher}}" src="{{item}}"/> <image bindtap="previewImage" data-index="{{index}}" data-url="{{orderObj.taskImageList}}" src="{{item.imageUrl}}"/>
<image class="del_icon" src="/packageCrowdFunding/images/del_icon.png" mode="" bindtap="delCustomPayVoucher" data-index="{{index}}"/> <image class="del_icon" wx:if="{{orderObj.taskStatus != 2}}" src="{{IMG_URL}}zy_paf_del_icon.png" mode="" bindtap="delPhoto" data-index="{{index}}"/>
</view> </view>
</block> </block>
<block wx:if="{{orderObj.merchantPhoto.length < 9}}"> <block wx:if="{{orderObj.taskImageList.length < 9 && orderObj.taskStatus != 2}}">
<view class="upload-item" bindtap="handleImageUpload"> <view class="upload-item" bindtap="handleImageUpload">
<image src="{{IMG_URL}}{{item.uploadIcon || 'zy-upload_icon.png'}}" class="icon-uploadAdd {{item.uploadIcon ? 'custom-icon-uploadAdd' : ''}}"></image> <image src="{{IMG_URL}}{{item.uploadIcon || 'zy-upload_icon.png'}}" class="icon-uploadAdd {{item.uploadIcon ? 'custom-icon-uploadAdd' : ''}}"></image>
<view class="upload-text"> <view class="upload-text">
{{orderObj.merchantPhoto.length + '/' + 9}} {{orderObj.taskImageList.length + '/' + 9}}
</view> </view>
</view> </view>
</block> </block>
</view> </view>
</view> </view>
</view> </view>
<view class="footer-btn"> <view class="footer-btn" wx:if="{{orderObj.taskStatus != 2}}">
<view class="btn" bindtap="submit">提交</view> <view class="btn" bindtap="submit">提交</view>
</view> </view>
</scroll-view> </scroll-view>
<select-popup show="{{ showSelectPopup }}" options="{{ selectOptions }}" multiple="{{true}}" values="{{ selectValues }}" value="{{ selectValue }}" bindconfirm="handlePopupConfirm" labelKey="staffName" valueKey="staffuuid" height="80%" title="员工选择" allowSearch="{{true}}" bindcancel="hideSelectPopup"></select-popup>
\ No newline at end of file \ No newline at end of file
<select-popup show="{{ showSelectPopup }}" options="{{ selectOptions }}" multiple="{{true}}" values="{{ selectValues }}" value="{{ selectValue }}" bindconfirm="handlePopupConfirm" labelKey="staffName" valueKey="staffPhone" height="80%" title="员工选择" allowSearch="{{true}}" bindcancel="hideSelectPopup"></select-popup>
\ No newline at end of file \ No newline at end of file
// packageLearningCenter/pages/coursePush/coursePush.js // packageLearningCenter/pages/coursePush/coursePush.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/'
import api from '~/api/learningCenter/index' import api from '~/api/learningCenter/index'
import indexApi from '~/api/index/index'
Page({ Page({
/** /**
...@@ -19,6 +20,8 @@ Page({ ...@@ -19,6 +20,8 @@ Page({
this.setData({ this.setData({
courseInfo: options courseInfo: options
}) })
// 获取督导员工数据
this.getStaffList()
}, },
/** /**
...@@ -35,19 +38,32 @@ Page({ ...@@ -35,19 +38,32 @@ Page({
}, },
getStaffList() {
indexApi.getSupervisorStaffList({}).then(res => {
let { code, data, message } = res
if (code == 0) {
this.setData({
staffList: data
})
} else {
wx.$util.showToast(message)
}
})
},
chooseSelect() { chooseSelect() {
let { orderObj } = this.data let { orderObj, staffList } = this.data
this.setData({ this.setData({
showSelectPopup: true, showSelectPopup: true,
selectOptions: [{staffuuid: 123, staffName: '明明4s店1'}, {staffuuid: 1234, staffName: '员工1'}], selectOptions: staffList,
selectValues: orderObj.staffuuid selectValues: orderObj.coursePushList?.map(val => { return val.staffPhone })
}) })
}, },
handlePopupConfirm(e) { handlePopupConfirm(e) {
let { values } = e.detail let { items } = e.detail
this.setData({ this.setData({
[`orderObj.staffuuid`]: values [`orderObj.coursePushList`]: items
}, () => { }, () => {
this.hideSelectPopup() this.hideSelectPopup()
}) })
...@@ -60,10 +76,29 @@ Page({ ...@@ -60,10 +76,29 @@ Page({
}, },
submit() { submit() {
let { orderObj } = this.data let { orderObj, courseInfo } = this.data
if (!orderObj.staffuuid.length) return wx.$util.showToast('请选择推送人员') if (!orderObj.coursePushList?.length) return wx.$util.showToast('请选择推送人员')
api.submitCoursePush({staffuuid: orderObj.staffuuid}).then(res => { let params = {
coursePushList: orderObj.coursePushList?.map(val => {
return {
storeManagerPhone: val.staffPhone,
storeManagerName: val.staffName,
bcCourseId: courseInfo?.courseId,
bcCourseName: courseInfo?.title
}
})
}
wx.$util.showLoading()
api.submitCoursePush(params).then(res => {
wx.$util.hideLoading()
let { code, message } = res
if (code == 0) {
wx.navigateBack() wx.navigateBack()
} else {
wx.$util.showToast(message)
}
}).catch(() => {
wx.$util.hideLoading()
}) })
}, },
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<view class="item-box"> <view class="item-box">
<view class="label">推送人员<text class='required'>*</text></view> <view class="label">推送人员<text class='required'>*</text></view>
<view class="value" bindtap="chooseSelect"> <view class="value" bindtap="chooseSelect">
<text wx:if="{{orderObj.staffuuid.length}}" class="value-text">已选{{orderObj.staffuuid.length}}人</text> <text wx:if="{{orderObj.coursePushList.length}}" class="value-text">已选{{orderObj.coursePushList.length}}人</text>
<block wx:else> <block wx:else>
<text class="placeholder">点击选择</text> <text class="placeholder">点击选择</text>
</block> </block>
...@@ -40,4 +40,4 @@ ...@@ -40,4 +40,4 @@
<view class="btn fixed-btn" bindtap="submit">提交</view> <view class="btn fixed-btn" bindtap="submit">提交</view>
</view> </view>
</view> </view>
<select-popup show="{{ showSelectPopup }}" multiple="{{true}}" options="{{ selectOptions }}" values="{{ selectValues }}" value="{{ selectValue }}" bindconfirm="handlePopupConfirm" labelKey="staffName" valueKey="staffuuid" height="80%" title="员工选择" allowSearch="{{true}}" bindcancel="hideSelectPopup"></select-popup> <select-popup show="{{ showSelectPopup }}" multiple="{{true}}" options="{{ selectOptions }}" values="{{ selectValues }}" value="{{ selectValue }}" bindconfirm="handlePopupConfirm" labelKey="staffName" valueKey="staffPhone" height="80%" title="员工选择" allowSearch="{{true}}" bindcancel="hideSelectPopup"></select-popup>
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
</view> </view>
我已阅读并同意 我已阅读并同意
<!-- <text catchtap="jump" data-url="agree">《服务协议》</text> --> <!-- <text catchtap="jump" data-url="agree">《服务协议》</text> -->
<text catchtap="jump" data-url="privacy">《隐私协议》</text>和 <text catchtap="jump" data-url="privacy">《隐私协议》</text>
<text catchtap="jump" data-url="agreement">《用户协议》</text> <text catchtap="jump" data-url="agreement">《用户协议》</text>
</view> </view>
...@@ -40,12 +40,12 @@ Page({ ...@@ -40,12 +40,12 @@ Page({
app.gobalCheckYqdSuper(userInfo) app.gobalCheckYqdSuper(userInfo)
/**scene有链接时跳转 */ /**scene有链接时跳转 */
let now = new Date() let now = new Date()
api.loginRecordSave({ // api.loginRecordSave({
staffUuid: userInfo.uuid, // staffUuid: userInfo.uuid,
loginTime: now.format('yyyy-MM-dd hh:mm:ss'), // loginTime: now.format('yyyy-MM-dd hh:mm:ss'),
merchantId: userInfo?.shopMerchantId, // merchantId: userInfo?.shopMerchantId,
merchantName: userInfo?.shopMerchantName, // merchantName: userInfo?.shopMerchantName,
}, 'loading') // }, 'loading')
wx.reLaunch({url: '/pages/tab/index/index'}) wx.reLaunch({url: '/pages/tab/index/index'})
}) })
} catch (error) { } catch (error) {
......
...@@ -2,39 +2,39 @@ ...@@ -2,39 +2,39 @@
const DEFAULT_CONFIG = { const DEFAULT_CONFIG = {
performance: { performance: {
sortOptions: [ sortOptions: [
{ label: '产值', key: 'personalOutputValue', type: 'number' }, { label: '产值', key: '1', type: 'number' },
{ label: '客单价', key: 'personalCustomerPrice', type: 'number' }, { label: '客单价', key: '2', type: 'number' },
{ label: '转化率', key: 'personalConversionRate', type: 'percent' } { label: '转化率', key: '3', type: 'percent' }
], ],
metrics: [ metrics: [
{ label: '个人产值', key: 'chanzhi', type: 'number', width: 'auto' }, { label: '个人产值', key: 'personalOutput', type: 'number', width: 'auto' },
{ label: '个人客单价', key: 'kedan', type: 'number', width: '216rpx'}, { label: '个人客单价', key: 'personalUnitPrice', type: 'number', width: '216rpx'},
{ label: '转化率', key: 'zhuanhua', type: 'percent', width: '162rpx' } { label: '转化率', key: 'personalConversion', type: 'percent', width: '162rpx' }
] ]
}, },
behavior: { behavior: {
sortOptions: [ sortOptions: [
{ label: '成交数', key: 'dealCount', type: 'number' }, { label: '成交数', key: '1', type: 'number' },
{ label: '战败数', key: 'defeatCount', type: 'number' }, { label: '战败数', key: '2', type: 'number' },
{ label: '录音数', key: 'recordCount', type: 'number' } { label: '录音数', key: '3', type: 'number' }
], ],
metrics: [ metrics: [
{ label: '成交数', key: 'chengjiao', type: 'number' }, { label: '成交数', key: 'dealCount', type: 'number' },
{ label: '战败数', key: 'zhanbai', type: 'number' }, { label: '战败数', key: 'defeatCount', type: 'number' },
{ label: '录音数', key: 'luyin', type: 'number' }, { label: '录音数', key: 'recordingCount', type: 'number' },
{ label: '录音缺失率', key: 'queshilv', type: 'percent' } { label: '录音缺失率', key: 'missingRate', type: 'percent' }
] ]
}, },
training: { training: {
sortOptions: [ sortOptions: [
{ label: '学习时长', key: 'studyDurationMinutes', type: 'duration' }, { label: '学习时长', key: '1', type: 'duration' },
{ label: '完成课程数', key: 'finishCourseCount', type: 'number' }, { label: '完成课程数', key: '2', type: 'number' },
{ label: '带教次数', key: 'coachTimes', type: 'number' } { label: '带教次数', key: '3', type: 'number' }
], ],
metrics: [ metrics: [
{ label: '学习时长', key: 'xuexi', type: 'duration' }, { label: '学习时长', key: 'studyHours', type: 'duration' },
{ label: '完成课程数', key: 'wancheng', type: 'number' }, { label: '完成课程数', key: 'completedCourses', type: 'number' },
{ label: '带教次数', key: 'daijiao', type: 'number' } { label: '带教次数', key: 'coachingTimes', type: 'number' }
] ]
} }
} }
...@@ -73,17 +73,6 @@ const formatPercent = (v) => { ...@@ -73,17 +73,6 @@ const formatPercent = (v) => {
return `${formatThousands(str)}%` return `${formatThousands(str)}%`
} }
const formatDuration = (minutes) => {
const n = toNumber(minutes)
if (n === null) return '-'
const m = Math.max(0, Math.floor(n))
const h = Math.floor(m / 60)
const mm = m % 60
if (h > 0 && mm > 0) return `${h}小时${mm}分钟`
if (h > 0) return `${h}小时`
return `${mm}分钟`
}
Component({ Component({
properties: { properties: {
title: { type: String, value: '员工排行' }, title: { type: String, value: '员工排行' },
...@@ -122,7 +111,7 @@ Component({ ...@@ -122,7 +111,7 @@ Component({
sync() { sync() {
const cfg = this.getConfig() const cfg = this.getConfig()
const sortKey = cfg.sortOptions[0].key const sortKey = this.data.sortKey || cfg.sortOptions[0].key
const sortOrder = this.data.sortOrder || this.data.initialSortOrder || 'desc' const sortOrder = this.data.sortOrder || this.data.initialSortOrder || 'desc'
const metrics = cfg.metrics || [] const metrics = cfg.metrics || []
const metricWidth = `${(100 / Math.max(1, metrics.length)).toFixed(2)}%` const metricWidth = `${(100 / Math.max(1, metrics.length)).toFixed(2)}%`
...@@ -150,9 +139,8 @@ Component({ ...@@ -150,9 +139,8 @@ Component({
onTapSort(e) { onTapSort(e) {
const key = e.currentTarget?.dataset?.key const key = e.currentTarget?.dataset?.key
if (!key) return if (!key) return
let nextOrder = 'desc' let nextOrder = 'desc'
if (this.data.sortKey === key) { if (this.data.sortKey == key) {
nextOrder = this.data.sortOrder === 'desc' ? 'asc' : 'desc' nextOrder = this.data.sortOrder === 'desc' ? 'asc' : 'desc'
} }
...@@ -176,7 +164,6 @@ Component({ ...@@ -176,7 +164,6 @@ Component({
formatMetricValue(metric, employee) { formatMetricValue(metric, employee) {
const v = employee?.[metric.key] const v = employee?.[metric.key]
if (metric.type === 'percent') return formatPercent(v) if (metric.type === 'percent') return formatPercent(v)
if (metric.type === 'duration') return formatDuration(v)
return formatNumber(v) return formatNumber(v)
}, },
......
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
<view class="sort-row-inner"> <view class="sort-row-inner">
<block wx:for="{{sortOptions}}" wx:key="key"> <block wx:for="{{sortOptions}}" wx:key="key">
<view <view
class="sort-item {{sortKey === item.key ? 'active' : ''}}" class="sort-item {{sortKey == item.key ? 'active' : ''}}"
bindtap="onTapSort" bindtap="onTapSort"
data-key="{{item.key}}" data-key="{{item.key}}"
> >
<text class="sort-text">{{item.label}}</text> <text class="sort-text">{{item.label}}</text>
<view class="sort-icons"> <view class="sort-icons">
<text class="sort-icon up {{sortKey===item.key && sortOrder==='asc' ? 'on' : ''}}">▲</text> <text class="sort-icon up {{sortKey == item.key && sortOrder==='asc' ? 'on' : ''}}">▲</text>
<text class="sort-icon down {{sortKey===item.key && sortOrder==='desc' ? 'on' : ''}}">▼</text> <text class="sort-icon down {{sortKey == item.key && sortOrder==='desc' ? 'on' : ''}}">▼</text>
</view> </view>
</view> </view>
</block> </block>
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
<view class="card" bindtap="onTapEmployee" data-index="{{index}}"> <view class="card" bindtap="onTapEmployee" data-index="{{index}}">
<view class="card-head"> <view class="card-head">
<view class="head-left"> <view class="head-left">
<text class="name">{{item.staffName || '-'}}</text> <text class="name">{{item.employeeName || '-'}}</text>
<text class="sep">|</text> <text class="sep">|</text>
<text class="phone">{{item.staffPhone || '-'}}</text> <text class="phone">{{item.phone || item.employeePhone || '-'}}</text>
</view> </view>
<van-icon name="arrow" class="arrow" /> <van-icon name="arrow" class="arrow" />
</view> </view>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<view class="line" wx:if="{{subIndex > 0}}"></view> <view class="line" wx:if="{{subIndex > 0}}"></view>
<view class="metric-item"> <view class="metric-item">
<view class="metric-title">{{subItem.label}} <text class="dot {{}}"></text> </view> <view class="metric-title">{{subItem.label}} <text class="dot {{}}"></text> </view>
<view class="metric-value {{sortKey === subItem.key ? 'primary' : ''}}"> <view class="metric-value {{sortKey == subItem.key ? 'primary' : ''}}">
{{item.metricDisplay[subItem.key]}} {{item.metricDisplay[subItem.key]}}
</view> </view>
</view> </view>
......
// pages/tab/crew/crew.js // pages/tab/crew/crew.js
import dayjs from 'dayjs' import dayjs from 'dayjs'
import api from '~/api/crew/index'
import indexApi from '~/api/index/index'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/' const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
Page({ Page({
...@@ -40,19 +42,20 @@ Page({ ...@@ -40,19 +42,20 @@ Page({
staticList: [{ staticList: [{
label: '驻店人员', label: '驻店人员',
width: '208', width: '208',
key: '', key: 'staffCount',
background: 'linear-gradient(90deg, #42CCCF 0%, #36D9A5 100%)' background: 'linear-gradient(90deg, #42CCCF 0%, #36D9A5 100%)'
}, { }, {
label: '门店数量', label: '门店数量',
width: '192', width: '192',
key: '', key: 'shopCount',
background: 'linear-gradient(90deg, #5E69FF 0%, #4079FF 100%)' background: 'linear-gradient(90deg, #5E69FF 0%, #4079FF 100%)'
}, { }, {
label: '总产值', label: '总产值',
key: '', key: 'totalValue',
background: 'linear-gradient(90deg, #3D76FC 0%, #4DA6FF 100%)' background: 'linear-gradient(90deg, #3D76FC 0%, #4DA6FF 100%)'
}], }],
AIContent: '团队培训数据显示表面学习投入尚可,但知识体系构建严重不均,部分老顾问仅完成基础课程,在新产品与金融方案上存在明显知识断层,且带教记录空白,表明技能固化缺乏更新。与此同时,新人虽接受带教较多,但与其高战败率关联看,带教内容可能未精准击中其销售流程中的薄弱环节(如需求挖掘)。当前培训陷入“学用脱节”与“辅导泛化”的困境。建议立即进行针对性调整:第一,实施“短板课程强推计划”,根据上月战败主因(如竞品对比失利),强制相关顾问在3日内完成对应专题课程学习并通关测试;第二,改革带教模式,推行“数据驱动的精准带教”,督导需提前查阅带教对象的近期战败录音或低分项,带着具体问题(如“如何应对XX竞品的空间质疑”)进行陪访或演练,确保每次带教解决一个实际问题。通过“缺什么补什么”和“练什么考什么”,快速将培训转化为实战能力。团队培训数据显示表面学习投入尚可,但知识体系构建严重不均,部分老顾问仅完成基础课程,在新产品与金融方案上存在明显知识断层,且带教记录空白,表明技能固化缺乏更新。将“现状分析”与“建议”两部分自然融合为一段连贯文字,避免使用标题。整段文字需严格控制在500字以内,语言简洁、务实、指向明确。', AIContent: '',
staticData: {},
employeeList: [{ employeeList: [{
staffName: '邹家平', staffName: '邹家平',
staffPhone: '18971083546', staffPhone: '18971083546',
...@@ -124,7 +127,7 @@ Page({ ...@@ -124,7 +127,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
// this.initDate() this.getStaticsData()
}, },
/** /**
...@@ -145,6 +148,38 @@ Page({ ...@@ -145,6 +148,38 @@ Page({
}, },
formatThousands (v) {
const s = String(v)
if (!s) return s
const isNeg = s[0] === '-'
const raw = isNeg ? s.slice(1) : s
const [intPart, decPart] = raw.split('.')
const intFmt = String(intPart || '0').replace(/\B(?=(\d{3})+(?!\d))/g, ',')
const res = decPart ? `${intFmt}.${decPart}` : intFmt
return isNeg ? `-${res}` : res
},
getStaticsData() {
// 假数据
let data = {
staffCount: 56,
shopCount: 12,
totalValue: 68954782.23
}
data.staffCount = this.formatThousands(data.staffCount)
data.shopCount = this.formatThousands(data.shopCount)
data.totalValue = this.formatThousands(data.totalValue)
this.setData({staticData: data})
// indexApi.getSupervisorStaticData({}).then(res => {
// let { code, data, message } = res
// if (code == 0) {
// this.setData({staticData: data})
// } else {
// wx.$util.showToast(message)
// }
// })
},
// 切换类型 // 切换类型
changeTab(e) { changeTab(e) {
let { target } = e.currentTarget.dataset let { target } = e.currentTarget.dataset
...@@ -155,9 +190,12 @@ Page({ ...@@ -155,9 +190,12 @@ Page({
this.setData({ this.setData({
tabIndex: index, tabIndex: index,
mode: target.value, mode: target.value,
sceneTabIndex: 0 sceneTabIndex: 0,
sortField: 1,
sortOrder: 1
}, () => { }, () => {
const comp = this.selectComponent('#date')
if (comp) comp.initLoad('date')
}) })
}, },
...@@ -170,24 +208,143 @@ Page({ ...@@ -170,24 +208,143 @@ Page({
// wx.$track.setTrackData(0, eventCode[index], {}, '') // wx.$track.setTrackData(0, eventCode[index], {}, '')
this.setData({ this.setData({
sceneTabIndex: index sceneTabIndex: index
}, () => {
const comp = this.selectComponent('#date')
if (comp) comp.initLoad('date')
}) })
}, },
// 排序变化 // 排序变化
onEmployeeSortChange(e) { onEmployeeSortChange(e) {
const { rankfield, rankType } = e.detail const { rankfield, rankType } = e.detail
// wx.$track.setTrackData(0, `supervisor_${rankfield}_${rankType}`, {}, '') // wx.$track.setTrackData(0, `supervisor_${rankfield}_${rankType}`, {}, '')
this.getEmployeeRank({ orderBy: rankfield, orderType: rankType === 'desc' ? '1' : '2' }) this.setData({
sortField: rankfield,
sortOrder: rankType == 'desc' ? 1 : 0
})
this.getEmployeeRank()
},
search(e) {
this.setData({
startStr: e.detail.startDay?.replace(/\//g, '-'),
endStr: e.detail.endDay?.replace(/\//g, '-'),
timeDimension: e.detail.timeDimension + 1
})
this.getAIAnalyse()
this.getEmployeeRank()
},
getAIAnalyse() {
let { startStr, endStr, timeDimension, tabIndex } = this.data
// 假数据
let data = {
aiGenerateResult: '团队培训数据显示表面学习投入尚可,但知识体系构建严重不均,部分老顾问仅完成基础课程,在新产品与金融方案上存在明显知识断层,且带教记录空白,表明技能固化缺乏更新。与此同时,新人虽接受带教较多,但与其高战败率关联看,带教内容可能未精准击中其销售流程中的薄弱环节(如需求挖掘)。当前培训陷入“学用脱节”与“辅导泛化”的困境。建议立即进行针对性调整:第一,实施“短板课程强推计划”,根据上月战败主因(如竞品对比失利),强制相关顾问在3日内完成对应专题课程学习并通关测试;第二,改革带教模式,推行“数据驱动的精准带教”,督导需提前查阅带教对象的近期战败录音或低分项,带着具体问题(如“如何应对XX竞品的空间质疑”)进行陪访或演练,确保每次带教解决一个实际问题。通过“缺什么补什么”和“练什么考什么”,快速将培训转化为实战能力。团队培训数据显示表面学习投入尚可,但知识体系构建严重不均,部分老顾问仅完成基础课程,在新产品与金融方案上存在明显知识断层,且带教记录空白,表明技能固化缺乏更新。将“现状分析”与“建议”两部分自然融合为一段连贯文字,避免使用标题。整段文字需严格控制在500字以内,语言简洁、务实、指向明确。'
}
this.setData({
AIContent: data?.aiGenerateResult
})
// api.getAIAnslyseData({
// type: tabIndex + 1,
// timeDimension: timeDimension,
// startDate: startStr,
// endDate: endStr
// }).then(res => {
// let { code, data, message } = res
// if (code == 0) {
// this.setData({
// AIContent: data?.aiGenerateResult || ''
// })
// } else {
// wx.$util.showToast(message)
// }
// })
}, },
// 获取员工排名数据 // 获取员工排名数据
getEmployeeRank() { getEmployeeRank() {
let { tabIndex, sceneTabIndex, startStr, endStr, sortField, sortOrder, timeDimension } = this.data
const event = ['getDashboardData', 'getDashboardBehavior', 'getTrainingStaffList']
let params = tabIndex == 2 ? {
businessType: sceneTabIndex > 0 ? sceneTabIndex : '',
startDate: startStr,
endDate: endStr,
sortField,
sortOrder
} : {
bizs: sceneTabIndex > 0 ? sceneTabIndex : '',
dateType: timeDimension,
startDate: startStr,
endDate: endStr
}
wx.$util.showLoading()
setTimeout(() => {
wx.$util.hideLoading()
// 假数据
let data
if (tabIndex == 0 || tabIndex == 1) {
data = {
employeeList: [{
employeePhone: 15626599738,
personalOutput: 43545600.53,
personalUnitPrice: 15623.23,
personalConversion: 56.23,
employeeName: '张三',
dealCount: 56,
defeatCount: 80,
recordingCount: 156,
missingRate: 59,
employeeId: 123
}, {
employeePhone: 15626599738,
personalOutput: 43545600.53,
personalUnitPrice: 15623.23,
personalConversion: 56.23,
employeeName: '张三',
dealCount: 56,
defeatCount: 80,
recordingCount: 156,
missingRate: 59,
employeeId: 123
}]
}
} else {
data = [{
employeeName: '张胜男',
phone: 15623568956,
studyHours: 15,
completedCourses: 5,
coachingTimes: 20
}, {
employeeName: '张胜男',
phone: 15623568956,
studyHours: 15,
completedCourses: 5,
coachingTimes: 20
}, {
employeeName: '张胜男',
phone: 15623568956,
studyHours: 15,
completedCourses: 5,
coachingTimes: 20
}, {
employeeName: '张胜男',
phone: 15623568956,
studyHours: 15,
completedCourses: 5,
coachingTimes: 20
}]
}
this.setData({employeeList: data.employeeList || data})
}, 300)
console.log(params)
api[event[tabIndex]](params).then(res => {
})
}, },
// 跳转员工个人看板 // 跳转员工个人看板
onEmployeeTap(e) { onEmployeeTap(e) {
const employee = e.detail.employee const employee = e.detail.employee
// wx.$track.setTrackData(0, 'supervisor_staffDetail', {}, '') // wx.$track.setTrackData(0, 'supervisor_staffDetail', {}, '')
wx.navigateTo({ wx.navigateTo({
url: '/packageCrew/pages/peopleOverview/peopleOverview', url: `/packageCrew/pages/peopleOverview/peopleOverview?emloyeeId=${employee.employeeId}&scene=${this.data.sceneTabIndex}`,
}) })
}, },
......
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
</view> </view>
</view> </view>
<view class="date"> <view class="date">
<date-screen bind:search="search" setTrackData="{{true}}"></date-screen> <date-screen id="date" bind:search="search" setTrackData="{{true}}"></date-screen>
</view> </view>
<view class="static-info"> <view class="static-info">
<view class="static-item" style="flex: {{item.width}}rpx 0 0;background: {{item.background}};" wx:for="{{staticList}}" wx:key="index"> <view class="static-item" style="flex: {{item.width}}rpx 0 0;background: {{item.background}};" wx:for="{{staticList}}" wx:key="index">
<view class="label">{{item.label}}</view> <view class="label">{{item.label}}</view>
<view class="value">{{15}}</view> <view class="value">{{staticData[item.key]}}</view>
</view> </view>
</view> </view>
<AI-analyse AIContent="{{AIContent}}" /> <AI-analyse AIContent="{{AIContent}}" />
......
import api from '~/api/index/index' import api from '~/api/index/index'
import dayjs from 'dayjs'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/' const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
Page({ Page({
/** /**
...@@ -13,16 +14,16 @@ Page({ ...@@ -13,16 +14,16 @@ Page({
staticList: [{ staticList: [{
label: '驻店人员', label: '驻店人员',
width: '208', width: '208',
key: '', key: 'staffCount',
background: 'linear-gradient(90deg, #42CCCF 0%, #36D9A5 100%)' background: 'linear-gradient(90deg, #42CCCF 0%, #36D9A5 100%)'
}, { }, {
label: '门店数量', label: '门店数量',
width: '192', width: '192',
key: '', key: 'shopCount',
background: 'linear-gradient(90deg, #5E69FF 0%, #4079FF 100%)' background: 'linear-gradient(90deg, #5E69FF 0%, #4079FF 100%)'
}, { }, {
label: '总产值', label: '总产值',
key: '', key: 'totalValue',
background: 'linear-gradient(90deg, #3D76FC 0%, #4DA6FF 100%)' background: 'linear-gradient(90deg, #3D76FC 0%, #4DA6FF 100%)'
}], }],
tabList: [{ tabList: [{
...@@ -34,70 +35,22 @@ Page({ ...@@ -34,70 +35,22 @@ Page({
}, { }, {
text: '专项任务' text: '专项任务'
}], }],
tabIndex: 0,
statusMap: { statusMap: {
1: {name: '待完成', color: '#2C66F7', background: '#2c66f71a'}, 0: {name: '待完成', color: '#2C66F7', background: '#2c66f71a'},
2: {name: '进行中', color: '#FF9D0A', background: '#ff9d0a1a'}, 1: {name: '进行中', color: '#FF9D0A', background: '#ff9d0a1a'},
3: {name: '已完成', color: '#35C376', background: '#35c3761a'}, 2: {name: '已完成', color: '#35C376', background: '#35c3761a'},
}, },
missionMap: { missionMap: {
1: {name: '录音复盘'}, 3: {name: '录音复盘'},
2: {name: '人员带教'}, 5: {name: '人员带教'},
3: {name: '督导日报'}, 0: {name: '督导日报'},
4: {name: '本周复盘'}, 1: {name: '本周复盘'},
5: {name: '督导月度计划'}, 2: {name: '督导月度计划'},
6: {name: '专项任务'}, 4: {name: '专项任务'},
}, },
list: [], list: [],
scrollTop: 0, scrollTop: 0
mockData: [{
handleStatus: 1,
missionType: 1,
userName: '赵慧慧'
}, {
handleStatus: 3,
missionType: 1,
userName: '赵慧慧'
}, {
handleStatus: 1,
missionType: 2,
userName: '赵慧慧'
}, {
handleStatus: 3,
missionType: 2,
userName: '赵慧慧'
}, {
handleStatus: 1,
missionType: 3,
userName: '赵慧慧'
}, {
handleStatus: 3,
missionType: 3,
userName: '赵慧慧'
}, {
handleStatus: 1,
missionType: 4,
userName: '赵慧慧'
}, {
handleStatus: 3,
missionType: 4,
userName: '赵慧慧'
}, {
handleStatus: 1,
missionType: 5,
userName: '赵慧慧'
}, {
handleStatus: 3,
missionType: 5,
userName: '赵慧慧'
}, {
handleStatus: 1,
missionType: 6,
userName: '赵慧慧'
}, {
handleStatus: 3,
missionType: 6,
userName: '赵慧慧'
}]
}, },
onTabItemTap(e) { onTabItemTap(e) {
// 点击埋点 // 点击埋点
...@@ -145,7 +98,40 @@ Page({ ...@@ -145,7 +98,40 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow () { onShow () {
this.getStaticData()
this.setData({
list: [],
pageNum: 1,
flag: false,
nothing: false
}, () => {
this.getList(true) this.getList(true)
})
},
formatThousands (v) {
const s = String(v)
if (!s) return s
const isNeg = s[0] === '-'
const raw = isNeg ? s.slice(1) : s
const [intPart, decPart] = raw.split('.')
const intFmt = String(intPart || '0').replace(/\B(?=(\d{3})+(?!\d))/g, ',')
const res = decPart ? `${intFmt}.${decPart}` : intFmt
return isNeg ? `-${res}` : res
},
getStaticData() {
api.getSupervisorStaticData({}).then(res => {
let { code, data, message } = res
if (code == 0) {
data.staffCount = data.staffCount ?? '' === '' ? '-' : this.formatThousands(data.staffCount)
data.shopCount = data.shopCount ?? '' === '' ? '-' : this.formatThousands(data.shopCount)
data.totalValue = data.totalValue ?? '' === '' ? '-' : this.formatThousands(data.totalValue)
this.setData({staticData: data})
} else {
wx.$util.showToast(message)
}
})
}, },
tabClick(e) { tabClick(e) {
...@@ -159,27 +145,28 @@ Page({ ...@@ -159,27 +145,28 @@ Page({
jump(e) { jump(e) {
const { target } = e.currentTarget.dataset const { target } = e.currentTarget.dataset
let { startStr, endStr } = this.data
const pageUrl = { const pageUrl = {
1: '/packageIndex/pages/recordingReview/recordingReview', 3: '/packageIndex/pages/recordingReview/recordingReview',
2: '/packageCrew/pages/mentoring/mentoring', 5: '/packageCrew/pages/mentoring/mentoring',
3: '/packageIndex/pages/dailySupervisionReport/dailySupervisionReport', 0: '/packageIndex/pages/dailySupervisionReport/dailySupervisionReport',
4: '/packageIndex/pages/weeklyReview/weeklyReview', 1: '/packageIndex/pages/weeklyReview/weeklyReview',
5: '/packageIndex/pages/monthlyPlan/monthlyPlan', 2: '/packageIndex/pages/monthlyPlan/monthlyPlan',
6: '/packageIndex/pages/specialTask/specialTask' 4: '/packageIndex/pages/specialTask/specialTask'
} }
const eventCode = { const eventCode = {
1: {view: 'supervisor_recording_view', execute: 'supervisor_recording_execute'}, 3: {view: 'supervisor_recording_view', execute: 'supervisor_recording_execute'},
2: {view: 'supervisor_mentoring_view', execute: 'supervisor_mentoring_execute'}, 5: {view: 'supervisor_mentoring_view', execute: 'supervisor_mentoring_execute'},
3: {view: 'supervisor_report_view', execute: 'supervisor_report_execute'}, 0: {view: 'supervisor_report_view', execute: 'supervisor_report_execute'},
4: {view: 'supervisor_weeklyReview_view', execute: 'supervisor_weeklyReview_execute'}, 1: {view: 'supervisor_weeklyReview_view', execute: 'supervisor_weeklyReview_execute'},
5: {view: 'supervisor_monthlyPlan_view', execute: 'supervisor_monthlyPlan_execute'}, 2: {view: 'supervisor_monthlyPlan_view', execute: 'supervisor_monthlyPlan_execute'},
6: {view: 'supervisor_specificTask_view', execute: 'supervisor_specificTask_execute'}, 4: {view: 'supervisor_specificTask_view', execute: 'supervisor_specificTask_execute'},
} }
let status = target.handleStatus != 3 ? 'execute' : 'view' let status = target.taskStatus != 2 ? 'execute' : 'view'
console.log(eventCode[target.missionType][status]) console.log(eventCode[target.taskType][status])
// wx.$track.setTrackData(0, eventCode[target.missionType][status], {}, '') // wx.$track.setTrackData(0, eventCode[target.taskType][status], {}, '')
wx.navigateTo({ wx.navigateTo({
url: pageUrl[target.missionType], url: `${pageUrl[target.taskType]}?taskStatus=${target.taskStatus}&id=${target.id}`,
}) })
}, },
...@@ -189,8 +176,8 @@ Page({ ...@@ -189,8 +176,8 @@ Page({
pageNum: 1, pageNum: 1,
flag: false, flag: false,
nothing: false, nothing: false,
startStr: e.detail.startDay, startStr: e.detail.startDay?.replace(/\//g, '-'),
endStr: e.detail.endDay endStr: e.detail.endDay?.replace(/\//g, '-')
}, () => { }, () => {
this.getList(true) this.getList(true)
}) })
...@@ -204,18 +191,39 @@ Page({ ...@@ -204,18 +191,39 @@ Page({
getList(repload) { getList(repload) {
let { pageNum, nothing, startStr, endStr, tabIndex, topBoxHeight, scrollTop } = this.data let { pageNum, nothing, startStr, endStr, tabIndex, topBoxHeight, scrollTop } = this.data
if (nothing) return if (nothing) return
// wx.$util.showLoading() const taskList = [[0, 3, 5], [1], [2], [4]]
wx.$util.showLoading()
let params = { let params = {
tabIndex, taskTypeList: taskList[tabIndex],
startStr, startDate: startStr,
endStr, endDate: endStr,
pageNum, pageNum,
pageSize: 10 pageSize: 10
} }
setTimeout(() => { api.getMissionList(params).then(res => {
wx.$util.hideLoading()
let total = 0
let list = []
let {
code,
data,
message
} = res
data?.list?.forEach(val => {
val.updatedDate = val.updatedDate ? dayjs(val.updatedDate).format('YYYY-MM-DD HH:mm:ss') : ''
val.createTime = val.createTime ? dayjs(val.createTime).format('YYYY-MM-DD HH:mm:ss') : ''
})
if (code == 0) {
list = data.list
total = data.total
} else {
wx.$util.showToast(message)
}
if (total != 0) {
this.setData({ this.setData({
list: this.data.mockData [`list[${pageNum - 1}]`]: list
}) })
}
if (scrollTop >= topBoxHeight && repload) { if (scrollTop >= topBoxHeight && repload) {
setTimeout(() => { setTimeout(() => {
this.setData({ this.setData({
...@@ -223,38 +231,14 @@ Page({ ...@@ -223,38 +231,14 @@ Page({
}) })
}, 200) }, 200)
} }
}, 500) this.setData({
// api.getMissionList(params).then(res => { total,
// wx.$util.hideLoading() flag: true,
// let total = 0 triggered: false,
// let list = [] pageNum: pageNum + 1,
// let { nothing: pageNum == data?.pages
// code, })
// data, })
// message
// } = res
// data?.list?.forEach(val => {
// val.applyDate = dayjs(val.applyDate).format('YYYY-MM-DD HH:mm:ss')
// })
// if (code == 0) {
// list = data.list
// total = data.total
// } else {
// wx.$util.showToast(message)
// }
// if (total != 0) {
// this.setData({
// [`list[${pageNum - 1}]`]: list
// })
// }
// this.setData({
// total,
// flag: true,
// triggered: false,
// pageNum: pageNum + 1,
// nothing: pageNum == data?.pages
// })
// })
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
......
...@@ -60,7 +60,6 @@ page { ...@@ -60,7 +60,6 @@ page {
padding: 16rpx 24rpx; padding: 16rpx 24rpx;
} }
.data-container { .data-container {
min-height: 100vh;
.sticky-box { .sticky-box {
position: sticky; position: sticky;
top: 0; top: 0;
...@@ -123,13 +122,19 @@ page { ...@@ -123,13 +122,19 @@ page {
height: 32rpx; height: 32rpx;
flex-shrink: 0; flex-shrink: 0;
} }
.break-all {
width: calc(100% - 170rpx);
display: inline-block;
word-break: break-all;
}
.progress { .progress {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
position: relative; position: relative;
width: 100%;
.progress-line { .progress-line {
width: 572rpx; width: calc(100% - 82rpx);
height: 12rpx; height: 12rpx;
border-radius: 12rpx; border-radius: 12rpx;
opacity: 1; opacity: 1;
...@@ -142,6 +147,7 @@ page { ...@@ -142,6 +147,7 @@ page {
height: 12rpx; height: 12rpx;
border-radius: 12rpx; border-radius: 12rpx;
background: linear-gradient(270deg, #3d76fc 0%, #4da6ff 100%); background: linear-gradient(270deg, #3d76fc 0%, #4da6ff 100%);
max-width: calc(100% - 82rpx);
} }
.num { .num {
font-size: 24rpx; font-size: 24rpx;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<view class="static-info"> <view class="static-info">
<view class="static-item" style="flex: {{item.width}}rpx 0 0;background: {{item.background}};" wx:for="{{staticList}}" wx:key="index"> <view class="static-item" style="flex: {{item.width}}rpx 0 0;background: {{item.background}};" wx:for="{{staticList}}" wx:key="index">
<view class="label">{{item.label}}</view> <view class="label">{{item.label}}</view>
<view class="value">{{15}}</view> <view class="value">{{staticData[item.key]}}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -35,77 +35,85 @@ ...@@ -35,77 +35,85 @@
<view class="date"> <view class="date">
<date-screen tabSelected="{{tabIndex}}" isSticky="{{isSticky}}" bind:search="search"></date-screen> <date-screen tabSelected="{{tabIndex}}" isSticky="{{isSticky}}" bind:search="search"></date-screen>
</view> </view>
<view class="number">{{tabList[tabIndex].text}}</view> <view class="number">共{{total || 0}}条任务</view>
</view> </view>
<view class="content-box"> <view class="content-box">
<view class="list"> <view class="list">
<block wx:if="{{ list.length > 0 }}"> <block wx:if="{{ list.length > 0 }}">
<block wx:for="{{ list }}" wx:key="index"> <block wx:for="{{ list }}" wx:for-item="val" wx:for-index="sIndex" wx:key="sIndex">
<block wx:for="{{val}}" wx:key="index">
<view class="item content"> <view class="item content">
<!-- 顶部状态和标题 -->
<view class="item-top"> <view class="item-top">
<view class="status text-center" style="color:{{ statusMap[item.handleStatus].color }};background-color:{{statusMap[item.handleStatus].background }};"> <view
{{statusMap[item.handleStatus].name }} class="status text-center"
style="color: {{statusMap[item.taskStatus].color}}; background-color: {{statusMap[item.taskStatus].background}};"
>
{{statusMap[item.taskStatus].name}}
</view> </view>
<view class="name" wx:if="{{item.missionType != 6}}">
{{missionMap[item.missionType].name}} <view class="name" wx:if="{{item.taskType != 4}}">
<text wx:if="{{item.missionType == 2}}">-{{item.userName}}</text> {{missionMap[item.taskType].name}}
</view> <text wx:if="{{item.taskType == 5}}">-{{item.storeManagerName}}</text>
<view class="name" wx:else>{{merchantName}}</view>
</view>
<view class="list-item" wx:if="{{item.missionType == 3 && item.handleStatus == 3}}">
<image class="icon" src="{{IMG_URL}}task-icon.png" mode=""/>
<text class="label">日报内容:</text>
<text class="text-hide">{{'“事项”在英文中通常根据其具体含义(指代“事情”、“任务”、“条款”还是“注意事项”)而有不同的翻译'}}</text>
</view> </view>
<view class="list-item" wx:if="{{item.missionType == 4 && item.handleStatus == 3}}"> <view class="name" wx:else>{{item.merchantName || '-'}}</view>
<image class="icon" src="{{IMG_URL}}task-icon.png" mode=""/>
<text class="label">复盘内容:</text>
<text class="text-hide">{{'“事项”在英文中通常根据其具体含义(指代“事情”、“任务”、“条款”还是“注意事项”)而有不同的翻译'}}</text>
</view> </view>
<view class="list-item" wx:if="{{item.missionType == 5 && item.handleStatus == 3}}"> <view wx:if="{{(item.taskType == 0 || item.taskType == 1 || item.taskType == 2) && item.taskStatus == 2}}" class="list-item">
<image class="icon" src="{{IMG_URL}}task-icon.png" mode=""/> <image class="icon" src="{{IMG_URL}}task-icon.png" mode="" />
<text class="label">月度计划:</text> <view class="label">{{['日报内容:', '复盘内容:', '月度计划:'][item.taskType]}}</view>
<text class="text-hide">{{'“事项”在英文中通常根据其具体含义(指代“事情”、“任务”、“条款”还是“注意事项”)而有不同的翻译'}}</text> <view class="text-hide">{{item.taskContext || '-'}}</view>
</view> </view>
<block wx:if="{{item.missionType == 6}}"> <block wx:if="{{item.taskType == 4}}">
<view class="list-item"> <view class="list-item">
<image class="icon" src="{{IMG_URL}}matter-icon.png" mode=""/> <image class="icon" src="{{IMG_URL}}matter-icon.png" mode="" />
<text class="label">事项描述:</text> <view class="label">事项描述:</view>
<text class="text-hide">{{'“事项”在英文中通常根据其具体含义(指代“事情”、“任务”、“条款”还是“注意事项”)而有不同的翻译'}}</text> <view class="text-hide">{{item.taskDesc || '-'}}</view>
</view> </view>
<view class="list-item" wx:if="{{item.handleStatus == 3}}">
<image class="icon" src="{{IMG_URL}}task-icon.png" mode=""/> <view wx:if="{{item.taskStatus == 2}}" class="list-item">
<text class="label">专项任务:</text> <image class="icon" src="{{IMG_URL}}task-icon.png" mode="" />
<text class="text-hide">{{'“事项”在英文中通常根据其具体含义(指代“事情”、“任务”、“条款”还是“注意事项”)而有不同的翻译'}}</text> <view class="label">专项任务:</view>
<view class="text-hide">{{item.taskContext || '-'}}</view>
</view> </view>
<view class="list-item" wx:if="{{item.handleStatus != 3}}">
<image class="icon" src="{{IMG_URL}}time-icon.png" mode=""/> <view wx:else class="list-item">
<text class="label">创建时间:</text> <image class="icon" src="{{IMG_URL}}time-icon.png" mode="" />
<text>{{item.complateTime || '-'}}</text> <view class="label">创建时间:</view>
<view>{{item.createTime || '-'}}</view>
</view> </view>
</block> </block>
<view class="list-item" wx:if="{{item.missionType != 6 || (item.missionType == 6 && item.handleStatus == 3)}}"> <view wx:if="{{item.taskType != 4 || (item.taskType == 4 && item.taskStatus == 2)}}" class="list-item">
<image class="icon" src="{{IMG_URL}}time-icon.png" mode=""/> <image class="icon" src="{{IMG_URL}}time-icon.png" mode="" />
<text class="label">完成时间:</text> <view class="label">完成时间:</view>
<text>{{item.complateTime || '-'}}</text> <view>{{item.updatedDate || '-'}}</view>
</view> </view>
<view class="list-item" wx:if="{{item.missionType == 1}}"> <view wx:if="{{item.taskType == 3}}" class="list-item">
<view class="progress"> <view class="progress">
<view class="progress-line"></view> <view class="progress-line"></view>
<view class="progress-item" style="width: {{572 * 0.5}}rpx;"></view> <view
<view class="num">{{'10/20'}}</view> class="progress-item"
style="width: {{ (item.audioReviewCompletedCount / item.audioReviewTotalCount * 100) + '%' }}"
></view>
<view class="num">{{item.audioReviewCompletedCount + '/' + item.audioReviewTotalCount}}</view>
</view> </view>
</view> </view>
<!-- 底部按钮 -->
<view class="btn-box"> <view class="btn-box">
<view bindtap="jump" data-target="{{item}}" wx:if="{{item.handleStatus == 3}}" class="btn">查看</view> <view
<view bindtap="jump" data-target="{{item}}" wx:else class="btn primary">去执行</view> bindtap="jump"
data-target="{{item}}"
class="btn {{item.taskStatus == 2 ? '' : 'primary'}}"
>
{{item.taskStatus == 2 ? '查看' : '去执行'}}
</view> </view>
</view> </view>
</view>
</block>
</block> </block>
<block wx:if="{{ nothing }}"> <block wx:if="{{ nothing }}">
<view class="list-nothing">到底了~</view> <view class="list-nothing">到底了~</view>
</block> </block>
<view class="empty-box" style="height: 80rpx;"></view>
</block> </block>
<block wx:else> <block wx:else>
<empty-data /> <empty-data />
......
...@@ -12,7 +12,7 @@ Component({ ...@@ -12,7 +12,7 @@ Component({
observer: function(val) { observer: function(val) {
if (val) { if (val) {
this.setViewData() this.setViewData()
// this.getCategoryList() this.getCategoryList()
} }
} }
}, },
......
...@@ -107,8 +107,8 @@ ...@@ -107,8 +107,8 @@
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
.icon { .icon {
width: 128rpx; width: 160rpx;
height: 80rpx; height: 160rpx;
margin-bottom: 8rpx; margin-bottom: 8rpx;
} }
} }
......
...@@ -138,8 +138,8 @@ page { ...@@ -138,8 +138,8 @@ page {
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
.icon { .icon {
width: 128rpx; width: 160rpx;
height: 128rpx; height: 160rpx;
margin-bottom: 8rpx; margin-bottom: 8rpx;
} }
} }
......
...@@ -19,7 +19,7 @@ Component({ ...@@ -19,7 +19,7 @@ Component({
name: '手机号', name: '手机号',
index: 1 index: 1
}, { }, {
name: '微信登录', name: '授权登录',
index: 0 index: 0
}], }],
}, },
......
// pages/wxLogin/wxLogin.js // pages/wxLogin/wxLogin.js
import api from '../../api/api.js' import api from '../../api/api.js'
import md5 from '~/utils/lib/md5.js'
import { import {
setNoSignInUuid, setNoSignInUuid,
getNoSignInUuid, getNoSignInUuid,
rmNoSignInUuid rmNoSignInUuid
} from '~/utils/cache/storageApi.js' } from '~/utils/cache/storageApi.js'
import {
get4SStoreList,
getYQList,
loginLogAdd
} from '~/store/index'
const app = getApp() const app = getApp()
Page({ Page({
/** /**
...@@ -165,14 +159,13 @@ Page({ ...@@ -165,14 +159,13 @@ Page({
this.setData({ this.setData({
jumpPageFlag: true jumpPageFlag: true
}) })
getYQList()
if (loginType == 1) { if (loginType == 1) {
// 手机号登录 // 手机号登录
api api
.smsLogin({ .smsLogin({
code, code,
mobile, mobile,
// loginSource: 2, loginSource: 3,
noSignIn: noLoginAgreeChoose noSignIn: noLoginAgreeChoose
}) })
.then(result => { .then(result => {
...@@ -194,10 +187,6 @@ Page({ ...@@ -194,10 +187,6 @@ Page({
if (loginUserInfoList.length) { if (loginUserInfoList.length) {
const loginUserObj = loginUserInfoList.filter(val => val.subLoginUser && Object.keys(val.subLoginUser)?.length)[0] || {} const loginUserObj = loginUserInfoList.filter(val => val.subLoginUser && Object.keys(val.subLoginUser)?.length)[0] || {}
wx.$util.setSessionId(sessionId) wx.$util.setSessionId(sessionId)
loginLogAdd({
loginType: 3
}) //"登录方式(1账号密码登录,2.手机号授权,3验证码)"
getYQList()
noSignInUuid ? setNoSignInUuid(noSignInUuid) : rmNoSignInUuid() noSignInUuid ? setNoSignInUuid(noSignInUuid) : rmNoSignInUuid()
this.checkLoginMessage(needSelectAccount, loginUserObj) this.checkLoginMessage(needSelectAccount, loginUserObj)
} else { } else {
...@@ -309,7 +298,7 @@ Page({ ...@@ -309,7 +298,7 @@ Page({
loginToken, loginToken,
iv, iv,
noSignIn: noLoginAgreeChoose, noSignIn: noLoginAgreeChoose,
loginSource: 2 loginSource: 3
}) })
.then(({ .then(({
code, code,
...@@ -328,10 +317,6 @@ Page({ ...@@ -328,10 +317,6 @@ Page({
if (loginUserInfoList.length) { if (loginUserInfoList.length) {
const loginUserObj = loginUserInfoList.filter(val => val.subLoginUser && Object.keys(val.subLoginUser)?.length)[0] || {} const loginUserObj = loginUserInfoList.filter(val => val.subLoginUser && Object.keys(val.subLoginUser)?.length)[0] || {}
wx.$util.setSessionId(sessionId) wx.$util.setSessionId(sessionId)
getYQList()
loginLogAdd({
loginType: 2
}) //"登录方式(1账号密码登录,2.手机号授权,3验证码)"
noSignInUuid ? setNoSignInUuid(noSignInUuid) : rmNoSignInUuid() noSignInUuid ? setNoSignInUuid(noSignInUuid) : rmNoSignInUuid()
this.checkLoginMessage(needSelectAccount, loginUserObj) this.checkLoginMessage(needSelectAccount, loginUserObj)
} else { } else {
...@@ -366,12 +351,12 @@ Page({ ...@@ -366,12 +351,12 @@ Page({
jumpPageFlag: false jumpPageFlag: false
}) })
let now = new Date() let now = new Date()
num != 0 && api.loginRecordSave({ // num != 0 && api.loginRecordSave({
staffUuid: loginUserObj.uuid, // staffUuid: loginUserObj.uuid,
loginTime: now.format('yyyy-MM-dd hh:mm:ss'), // loginTime: now.format('yyyy-MM-dd hh:mm:ss'),
merchantId: shopMerchantId, // merchantId: shopMerchantId,
merchantName: shopMerchantName // merchantName: shopMerchantName
}) // })
}, },
/** /**
......
...@@ -39,14 +39,14 @@ page { ...@@ -39,14 +39,14 @@ page {
} }
.wx .title { .wx .title {
font-weight: 600; font-weight: 500;
font-size: var(--fontSize52); font-size: var(--fontSize60);
color: #181A1F; color: #181A1F;
padding-top: 4vh; padding-top: 4vh;
} }
.wx .subtitle { .wx .subtitle {
font-size: var(--fontSize40); font-size: var(--fontSize48);
color: #181A1F; color: #181A1F;
margin-bottom: 4.5vh; margin-bottom: 4.5vh;
} }
......
...@@ -128,7 +128,7 @@ class TRACK { ...@@ -128,7 +128,7 @@ class TRACK {
* businessParam:业务参数 * businessParam:业务参数
* batchId 浏览批次id,当浏览-进入事件发生时,必填 * batchId 浏览批次id,当浏览-进入事件发生时,必填
*/ */
setTrackData(eventType, eventCode = '', businessParam = '', batchId, scene) { setTrackData(eventType, eventCode = '', businessParam = '', batchId) {
// console.log(eventCode, 'eventCode'); // console.log(eventCode, 'eventCode');
let recordList = $Storage.get('recordList'), let recordList = $Storage.get('recordList'),
{ route } = this.getPageInstance(), { route } = this.getPageInstance(),
...@@ -142,8 +142,7 @@ class TRACK { ...@@ -142,8 +142,7 @@ class TRACK {
eventTime: new Date().format('yyyy-MM-dd hh:mm:ss'), eventTime: new Date().format('yyyy-MM-dd hh:mm:ss'),
eventType, eventType,
prePagePath: prePagePath ? prePagePath.route : '/', prePagePath: prePagePath ? prePagePath.route : '/',
pagePath: route, pagePath: route
scene
} }
// console.log(new Date().format('yyyy-MM-dd hh:mm:ss'),'当前页:',route,'=========') // console.log(new Date().format('yyyy-MM-dd hh:mm:ss'),'当前页:',route,'=========')
if (batchId) item.batchId = batchId if (batchId) item.batchId = batchId
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!