Commit 770f38d0 by zhangxw

专项带教和专项任务需求

1 parent 72c00d60
......@@ -92,5 +92,51 @@ module.exports = {
*/
getMentorRequireList(data) {
return api.post('dj.api.supervisor.mini.page.teachingRecords', data, [], '/rop-dj-supervisor-mini/router')
},
/**
* 获取任务中心的专项带教任务列表数据
*/
getTaskCenterPageData(data) {
return api.post('dj.api.supervisor.mini.taskCenter.page', data, [], '/rop-dj-supervisor-mini/router')
},
/**
* 获取任务中心专项带教任务详情
*/
getTaskCenterDetail(data) {
return api.post('dj.api.supervisor.mini.taskCenter.getDetail',data, [], '/rop-dj-supervisor-mini/router')
},
/**
* 执行任务中心专项带教任务
*/
executeTaskCenter(data) {
return api.post('dj.api.supervisor.mini.taskCenter.execute',data, [], '/rop-dj-supervisor-mini/router')
},
/**
* 获取我发起的专项任务列表
*/
getSpecialTaskList(data) {
return api.post('dj.api.supervisor.mini.specialTask.page', data, [], '/rop-dj-supervisor-mini/router')
},
/**
* 发起专项任务
*/
createSpecialTask(data) {
return api.post('dj.api.supervisor.mini.specialTask.create', data, [], '/rop-dj-supervisor-mini/router')
},
// 获取门店配置的区域运营(D+平台)
getAreaOperatorList(data) {
return api.post('dj.api.supervisor.mini.list.regionOperator', data, [], '/rop-dj-supervisor-mini/router')
},
/**
* 获取专项任务详情
*/
getSpecialTaskDetail(data) {
return api.post('dj.api.supervisor.mini.specialTask.getDetail', data, [], '/rop-dj-supervisor-mini/router')
},
/**
* 获取我发起的专项任务统计数据
*/
getSpecialTaskCount(data) {
return api.post('dj.api.supervisor.mini.specialTask.count', data, [], '/rop-dj-supervisor-mini/router')
}
}
......@@ -63,6 +63,8 @@
"pages/weeklyReview/weeklyReview",
"pages/monthlyPlan/monthlyPlan",
"pages/specialTask/specialTask",
"pages/mySpecialTaskList/mySpecialTaskList",
"pages/specialTaskApply/specialTaskApply",
"pages/mentorRequirements/mentorRequirements",
"pages/caseAudioList/caseAudioList"
]
......@@ -75,7 +77,8 @@
"pages/storeTransfer/storeTransfer",
"pages/receptionRecording/receptionRecording",
"pages/recordingDetail/recordingDetail",
"pages/mentoring/mentoring"
"pages/mentoring/mentoring",
"pages/specialMentoring/specialMentoring"
]
},
{
......@@ -118,4 +121,4 @@
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
}
}
\ No newline at end of file
}
// packageCrew/pages/specialMentoring/specialMentoring.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
import api from '~/api/crew/index'
import indexApi from '~/api/index/index'
import studyApi from '~/api/learningCenter/index'
import { uploadImg } from '~/api/api'
import dayjs from 'dayjs'
Page({
data: {
IMG_URL,
navBarHeight: 84,
isCompleted: false,
lockedFields: {},
orderObj: {
teachingSceneCode: 1,
teachingMethodCode: '',
teachingMethodName: '',
teachingTopicCode: '',
teachingTopicName: '',
teachingTime: '',
merchantList: [],
taskStaffList: [],
assigneeDetail: '',
assigneeImages: [],
bcCourseIdList: []
},
formItems: [{
label: '带教场景',
value: 'teachingSceneCode',
type: 'radio'
}, {
label: '带教时间',
value: 'teachingTime',
type: 'timePicker'
}, {
label: '带教方式',
value: 'teachingMethodCode',
valueText: 'teachingMethodName',
itemValue: 'itemValue',
itemName: 'itemName',
optionsName: 'teachingMethod',
type: 'select',
title: '方式选择',
selectHeight: '55%'
}, {
label: '推送课程',
value: 'bcCourseIdList',
itemValue: 'bcCourseId',
itemName: 'bcCourseName',
optionsName: 'course',
type: 'select',
hide: true,
selectMultiple: true,
title: '课程选择',
unit: '课'
}, {
label: '带教主题',
value: 'teachingTopicCode',
valueText: 'teachingTopicName',
itemValue: 'itemValue',
itemName: 'itemName',
optionsName: 'teachingTopic',
type: 'select',
title: '主题选择'
}, {
label: '带教门店',
value: 'merchantList',
itemValue: 'merchantId',
itemName: 'merchantName',
optionsName: 'merchant',
type: 'select',
selectMultiple: true,
title: '门店选择',
unit: '个'
}, {
label: '参与人员',
value: 'taskStaffList',
itemValue: 'participantPhone',
itemName: 'participantName',
optionsName: 'participant',
type: 'select',
selectMultiple: true,
title: '人员选择',
unit: '人'
}],
currentDate: dayjs().valueOf()
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
},
onLoad(options) {
console.log(options)
this.setData({
pageOptions: options || {},
isCompleted: options?.taskStatus == '2'
})
if (options?.taskId) {
this.getDetail(options.taskId)
}
this.getDictList('teaching_method_1')
this.getDictList('teaching_method_2')
this.getDictList('teaching_topic')
this.getDictList('teaching_scene')
this.getMerchantList()
this.getbcCourseIdList()
},
back() {
wx.navigateBack()
},
getDictList(typeCode) {
api.getMentorDictList({typeCode, businessCode: 'supervisor'}).then(res => {
this.setData({
[`${typeCode}_list`]: res.data || []
})
})
},
getStaffList() {
let { orderObj } = this.data
let params = {
pageNum: 1,
pageSize: 9999,
merchantIdList: orderObj?.merchantList?.map(val => {return val.merchantId})
}
api.getParticipantOptions(params).then(res => {
let { code, data, message } = res
if (code == 0) {
data?.list?.forEach(val => {
val.participantName = val.staffName,
val.participantPhone = val.staffPhone
})
this.setData({
taskStaffList: data?.list || []
})
} else {
wx.$util.showToast(message)
}
})
},
getMerchantList() {
indexApi.getSupervisorMerchantList({}).then(res => {
let { code, data, message } = res
if (code == 0) {
this.setData({
merchantList: data || []
})
} else {
wx.$util.showToast(message)
}
})
},
getbcCourseIdList() {
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) {
data?.list?.forEach(val => {
val.bcCourseId = val.courseId
val.bcCourseName = val.title
})
this.setData({allbcCourseIdList: data?.list || []})
} else {
wx.$util.showToast(message)
}
})
},
getDetail(taskId) {
let { formItems} = this.data
indexApi.getTaskCenterDetail({taskId}).then(res => {
let { code, data, message } = res
if (code == 0) {
data = {
...data,
...data.teachingDetail,
bcCourseIdList: data.taskbcCourseIdList || [],
merchantList: data?.taskMerchantId ? [{merchantName: data?.taskMerchantName, merchantId: data?.taskMerchantId}] : [],
taskStaffList: data?.taskStaffList?.map(val => { return {participantName: val} }),
assigneeImages: data.assigneeImages?.map(val => {return {imageUrl: val.imageUrl}}) || []
}
const lockedFields = this._calcLockedFields(data)
let assigneeDetailLength = data?.assigneeDetail?.length || 0
if (data?.teachingSceneCode == 1 && data?.teachingMethodCode == 3) {
let index = formItems?.findIndex(val => val.value == 'bcCourseIdList')
this.setData({
[`formItems[${index}].hide`]: false
})
}
this.setData({
assigneeDetailLength,
taskId,
lockedFields,
}, () => {
this.setData({
orderObj: data || {}
}, () => {
if (Array.isArray(this.data.orderObj?.merchantList) && this.data.orderObj.merchantList.length) {
this.getStaffList()
}
})
})
} else {
wx.$util.showToast(message)
}
})
},
_calcLockedFields(detail) {
const d = detail || {}
const hasText = (v) => String(v ?? '').trim() !== ''
const hasArr = (v) => Array.isArray(v) && v.length > 0
return {
teachingSceneCode: d.teachingSceneCode !== null && d.teachingSceneCode !== undefined && d.teachingSceneCode !== '',
teachingTime: hasText(d.teachingTime),
teachingMethodCode: d.teachingMethodCode !== null && d.teachingMethodCode !== undefined && d.teachingMethodCode !== '',
teachingTopicCode: d.teachingTopicCode !== null && d.teachingTopicCode !== undefined && d.teachingTopicCode !== '',
bcCourseIdList: hasArr(d.bcCourseIdList),
merchantList: hasArr(d.merchantList),
taskStaffList: hasArr(d.taskStaffList),
assigneeDetail: hasText(d.assigneeDetail),
assigneeImages: hasArr(d.assigneeImages)
}
},
changeScene(e) {
let { formItems, orderObj } = this.data
if (this.data.isCompleted) return
if (this.data.lockedFields?.teachingSceneCode) return
let { value } = e.currentTarget.dataset
this.setData({
['orderObj.teachingMethodCode']: '',
['orderObj.teachingMethodName']: '',
['orderObj.bcCourseIdList']: [],
'orderObj.teachingSceneCode': value
})
let index = formItems?.findIndex(val => val.value == 'bcCourseIdList')
this.setData({
[`formItems[${index}].hide`]: true
})
},
chooseSelect(e) {
let { item } = e.currentTarget.dataset
let { orderObj, merchantList, allbcCourseIdList, teaching_topic_list, teaching_method_1_list, teaching_method_2_list, taskStaffList } = this.data
if (this.data.isCompleted) return
if (this.data.lockedFields?.[item?.value]) return
if (item.optionsName == 'teachingMethod' && !orderObj.teachingSceneCode) return wx.$util.showToast('请先选择带教场景')
if (item.optionsName == 'participant' && !orderObj?.merchantList?.length) return wx.$util.showToast('请先选择带教门店')
const selectSources = {
'teachingMethod': orderObj.teachingSceneCode == 1 ? teaching_method_1_list : teaching_method_2_list,
'merchant': merchantList,
'course': allbcCourseIdList,
'teachingTopic': teaching_topic_list,
'participant': taskStaffList
}
this.setData({
selectType: item.optionsName,
showSelectPopup: true,
selectOptions: selectSources[item.optionsName],
selectTitle: item.title,
selectMultiple: item.selectMultiple || false,
labelKey: item.itemName,
valueKey: item.itemValue,
selectValue: item.selectMultiple ? orderObj[item.value]?.map(val => { return val[item.itemValue] }) : [orderObj[item.value]],
selectValues: item.selectMultiple ? orderObj[item.value]?.map(val => { return val[item.itemValue] }) : [orderObj[item.value]],
selectPopupHeight: item.selectHeight || '85%'
})
},
handlePopupConfirm(e) {
let { values, items } = e.detail
let { selectType, formItems, orderObj } = this.data
let obj = formItems?.find(val => val.optionsName == selectType)
if (obj.selectMultiple) {
this.setData({
[`orderObj.${obj.value}`]: items
})
} else {
this.setData({
[`orderObj.${obj.value}`]: values[0],
[`orderObj.${obj.valueText}`]: items[0] && items[0][obj.itemName]
})
}
if (selectType == 'teachingMethod' && values[0] != 3) this.setData({['orderObj.bcCourseIdList']: []})
let index = formItems?.findIndex(val => val.value == 'bcCourseIdList')
this.setData({
[`formItems[${index}].hide`]: !(orderObj.teachingSceneCode == 1 && orderObj.teachingMethodCode == 3)
})
if (selectType == 'merchant') {
this.setData({
['orderObj.taskStaffList']: []
}, () => {
orderObj.merchantList?.length && this.getStaffList()
})
}
this.hideSelectPopup()
},
removeMultiSelected(e) {
if (this.data.isCompleted) return
const field = e.currentTarget?.dataset?.field
const index = e.currentTarget?.dataset?.index
if (this.data.lockedFields?.[field]) return
if (!field && field !== 0) return
const list = Array.isArray(this.data.orderObj?.[field]) ? this.data.orderObj[field].slice() : []
if (index === null || index === undefined || index < 0 || index >= list.length) return
list.splice(index, 1)
const payload = {
[`orderObj.${field}`]: list
}
if (field === 'merchantList') {
payload['orderObj.taskStaffList'] = []
payload['taskStaffList'] = []
}
this.setData(payload, () => {
if (field === 'merchantList') {
const nextMerchants = this.data.orderObj?.merchantList || []
if (nextMerchants.length) this.getStaffList()
}
})
},
hideSelectPopup() {
this.setData({
showSelectPopup: false
})
},
chooseTime() {
let { orderObj } = this.data
if (this.data.isCompleted) return
if (this.data.lockedFields?.teachingTime) return
const ts = this._parseTimeToTimestamp(orderObj?.teachingTime) || this.data.currentDate || dayjs().valueOf()
this.setData({ dateShow: true, currentDate: ts, selectedDate: ts })
},
_parseTimeToTimestamp(timeStr) {
if (!timeStr) return null
const normalized = String(timeStr).trim().replace(/-/g, '/')
const d = dayjs(normalized)
return d.isValid() ? d.valueOf() : null
},
_normalizePickerTimestamp(raw) {
if (raw === null || raw === undefined || raw === '') return null
const v = raw?.value ?? raw?.detail?.value ?? raw
if (typeof v === 'number') return Number.isFinite(v) ? v : null
const s = String(v).trim()
if (!s) return null
const n = Number(s)
if (Number.isFinite(n)) return n
const normalized = s.replace(/-/g, '/')
const d = dayjs(normalized)
return d.isValid() ? d.valueOf() : null
},
cancel() {
this.setData({
dateShow: false
})
},
confirm() {
const selectedDate = this._normalizePickerTimestamp(this.data.selectedDate) || this._normalizePickerTimestamp(this.data.currentDate) || dayjs().valueOf()
this.setData({
dateShow: false,
currentDate: selectedDate,
['orderObj.teachingTime']: dayjs(selectedDate).format('YYYY-MM-DD HH:mm')
});
},
onChange(event) {
const ts = this._normalizePickerTimestamp(event?.detail?.value ?? event?.detail)
if (!ts) return
this.setData({ selectedDate: ts })
},
onInput(event) {
const ts = this._normalizePickerTimestamp(event?.detail?.value ?? event?.detail)
if (!ts) return
this.setData({ selectedDate: ts })
},
assigneeDetailInput(e) {
if (this.data.isCompleted) return
if (this.data.lockedFields?.assigneeDetail) return
let val = e.detail.value || ""
if (val.length > 1000) {
val = val.substring(0, 1000)
}
this.setData({
'orderObj.assigneeDetail': val,
assigneeDetailLength: val.length
})
},
handleImageUpload() {
if (this.data.isCompleted) return
if (this.data.lockedFields?.assigneeImages) return
let _this = this
let { orderObj } = _this.data
wx.chooseImage({
count: 1,
sourceType: ['album', 'camera'],
success(res) {
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 type = imgType == 'unknown' ? 'jpg' : imgType
wx.getFileSystemManager().readFile({
filePath: tempFiles,
encoding: 'base64',
success(_res) {
wx.$util.showLoading('上传中...')
uploadImg({
file: `${type}@${_res.data}`
}).then(img => {
wx.$util.hideLoading()
let { code, data, message } = img
if (code == 0) {
orderObj.assigneeImages.push({imageUrl: data})
_this.setData({
orderObj
})
} else {
wx.$util.showToast(message)
}
})
}
})
}
})
},
previewImage(e) {
let { url, index } = e.currentTarget.dataset
wx.previewImage({
urls: url?.map(val => {return val.imageUrl}),
current: url[index].imageUrl
})
},
delPhoto(e) {
if (this.data.isCompleted) return
if (this.data.lockedFields?.assigneeImages) return
let { index } = e.currentTarget.dataset
let { orderObj } = this.data
orderObj.assigneeImages.splice(index, 1)
this.setData({
'orderObj.assigneeImages': orderObj.assigneeImages
})
},
submit() {
let { orderObj, formItems } = this.data
let requiredList = [
...formItems?.filter(val => !val.hide),
{value: 'assigneeDetail'},
{value: 'assigneeImages'}
]
const hasInvalidItem = requiredList?.some((item) => {
const value = orderObj[item.value]
return !value || (Array.isArray(value) && value.length === 0);
});
if (hasInvalidItem) {
return wx.$util.showToast('请完成所有必填项')
}
let params = {
taskId: this.data.taskId,
teachingSceneCode: orderObj?.teachingSceneCode,
teachingSceneName: orderObj?.teachingSceneName,
teachingMethodCode: orderObj?.teachingMethodCode,
teachingMethodName: orderObj?.teachingMethodName,
teachingTopicCode: orderObj?.teachingTopicCode,
teachingTopicName: orderObj?.teachingTopicName,
teachingTime: orderObj?.teachingTime,
assigneeDetail: orderObj?.assigneeDetail,
taskMerchantId: orderObj?.taskMerchantId,
taskMerchantName: orderObj?.taskMerchantName,
taskStaffList: orderObj?.taskStaffList?.map(val => val.participantName),
taskStaffPhoneList: orderObj?.taskStaffPhoneList,
assigneeImages: orderObj?.assigneeImages?.map(val => val.imageUrl),
bcCourseIdList: orderObj?.bcCourseIdList
}
wx.$util.showLoading()
indexApi.executeTaskCenter(params).then(res => {
wx.$util.hideLoading()
let { code, message } = res
if (code == 0) {
wx.$util.showToast('操作成功')
this.back()
} else {
wx.$util.showToast(message)
}
}).catch(() => {
wx.$util.hideLoading()
})
},
})
{
"usingComponents": {
"van-icon": "@vant/weapp/icon/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"select-popup": "/components/selectPopup/selectPopup"
},
"navigationStyle": "custom"
}
/* packageCrew/pages/specialMentoring/specialMentoring.wxss */
page{
background: #F2F3F7;
}
.required {
color: #F24724;
margin-left: 8rpx;
}
.container {
height: 100vh;
box-sizing: border-box;
width: calc(100% - 48rpx);
margin: 0 24rpx;
.box {
border-radius: 32rpx;
background: #FFFFFF;
padding: 32rpx;
margin-bottom: 24rpx;
font-size: 28rpx;
&.padding-0 {
padding: 0;
}
.name {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16rpx;
.staff {
display: flex;
align-items: center;
font-size: 36rpx;
width: 100%;
color: #333333;
.staff-name {
max-width: calc(100% - 40rpx);
word-break: break-all;
}
.sex-icon {
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
margin-left: 12rpx;
}
}
}
.items {
display: flex;
flex-wrap: wrap;
column-gap: 24rpx;
row-gap: 18rpx;
.item {
width: 100%;
display: flex;
align-items: center;
font-size: 26rpx;
color: #79859E;
.label {
flex-shrink: 0;
}
}
.inline {
flex: 1;
min-width: 0;
.value {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
.item-box {
height: 96rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 32rpx;
border-bottom: 1rpx solid #eff0f2;
.label {
color: #292D33;
}
.value {
display: flex;
align-items: center;
justify-content: flex-end;
width: calc(100% - 158rpx);
.value-text {
text-align: right;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.placeholder {
color: #BEC1C7;
font-size: 28rpx;
}
.input {
text-align: right;
font-size: 28rpx;
padding: 16rpx 0;
width: 100%;
}
image {
flex-shrink: 0;
width: 32rpx;
height: 32rpx;
transform: rotate(-90deg);
}
}
.value_box {
display: flex;
align-items: center;
gap: 32rpx;
.radio-box {
display: flex;
align-items: center;
gap: 16rpx;
.radio-icon {
flex-shrink: 0;
width: 32rpx;
height: 32rpx;
}
.circle {
flex-shrink: 0;
width: 28rpx;
height: 28rpx;
border-radius: 50%;
border: 2rpx solid #d0d2d6;
}
.text {
color: #292D33;
font-size: 28rpx;
}
}
}
}
.multi-select {
padding: 0 32rpx;
border-bottom: 1rpx solid #eff0f2;
.multi-select__header {
height: 96rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.multi-select__label {
color: #292D33;
}
.multi-select__arrow {
flex-shrink: 0;
width: 32rpx;
height: 32rpx;
transform: rotate(-90deg);
}
.multi-select__body {
margin-bottom: 12rpx;
}
.multi-placeholder {
color: #BEC1C7;
font-size: 28rpx;
}
.multi-tags {
display: flex;
flex-wrap: wrap;
gap: 24rpx;
}
.multi-tag {
display: inline-flex;
align-items: center;
max-width: 100%;
padding: 0 20rpx;
height: 44rpx;
border-radius: 8rpx;
background: #F6F7F9;
border: 2rpx solid #E6E8EC;
box-sizing: border-box;
}
.multi-tag__text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 28rpx;
color: #292D33;
}
.multi-tag__close {
margin-left: 16rpx;
color: #999EA8;
font-size: 32rpx;
line-height: 1;
}
}
.remark_box {
height: 382rpx;
align-items: flex-start;
justify-content: flex-start;
flex-flow: column;
.label {
margin: 28rpx 0;
}
.textArea_box {
box-sizing: border-box;
width: 100%;
border-radius: 16rpx;
padding: 24rpx 24rpx 42rpx;
background: #FFFFFF;
border: 2rpx solid #eff0f2;
height: 262rpx;
position: relative;
font-size: 28rpx;
.textarea {
height: 100%;
width: 100%;
}
.currentWordNumber {
position: absolute;
right: 26rpx;
bottom: 8rpx;
color: #CCCCCC;
}
}
}
.image-box {
margin: 0 32rpx;
padding-bottom: 28rpx;
.label{
margin: 28rpx 0;
}
.upload_box{
display: flex;
flex-wrap: wrap;
gap: 28rpx;
.payVoucher_image{
flex-shrink: 0;
width: 192rpx;
height: 192rpx;
border-radius: 12rpx;
position: relative;
overflow: hidden;
image{
width: 100%;
height: 100%;
}
.del_icon{
width: 40rpx;
height: 40rpx;
position: absolute;
top: 16rpx;
right: 16rpx;
}
}
.upload-item {
width: 196rpx;
height: 196rpx;
border-radius: 12rpx;
background: #f5f5f7;
display: flex;
align-items: center;
justify-content: center;
flex-flow: column;
.icon-uploadAdd {
width: 40rpx;
height: 40rpx;
&.custom-icon-uploadAdd {
width: 100%;
height: 100%;
}
}
.upload-text {
margin-top: 16rpx;
color: #999EA8;
font-size: 24rpx;
}
}
}
}
}
}
.isFullSucreen-btn {
padding-bottom: 34px !important;
}
.footer-btn {
position: fixed;
left: 0;
width: 100%;
bottom: 0;
min-height: 100rpx;
background: #FFFFFF;
box-sizing: border-box;
display: flex;
align-items: center;
font-weight: 500;
z-index: 99;
.btn {
margin: 16rpx 32rpx;
width: calc(100% - 64rpx);
height: 88rpx;
text-align: center;
line-height: 88rpx;
background: #2C66F7;
border-radius: 24rpx;
font-size: 32rpx;
color: #FFFFFF;
font-weight: 500;
}
}
<!--packageCrew/pages/specialMentoring/specialMentoring.wxml-->
<glsx-privacy appletName="嘀加门店管理助手" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<navigation-bar bindnavbarReady="navbarReady"
class="navigation-header"
showBack="{{true}}"
bindback="back"
navStyle="background-color: transparent;box-shadow:none;">
<view class="page-title">
专项带教
</view>
</navigation-bar>
<scroll-view class="container" scroll-y show-scrollbar="{{false}}" enhanced style="padding-top: calc({{navBarHeight}}px + 8rpx);padding-bottom: {{!isCompleted ? (isFullSucreen ? 'calc(120rpx + 34px)' : '120rpx') : '0'}};">
<view style="width: 100%;height: 8rpx;"></view>
<view class="box padding-0">
<block wx:for="{{formItems}}" wx:key="index">
<block wx:if="{{!item.hide}}">
<view class="multi-select" wx:if="{{item.type == 'select' && item.selectMultiple}}" data-item="{{item}}">
<view class="multi-select__header">
<view class="multi-select__label">{{item.label}}<text class='required'>*</text></view>
<view bindtap="chooseSelect" data-item="{{item}}" style="display: flex;align-items: center;">
<text class="multi-placeholder" wx:if="{{!isCompleted && !lockedFields[item.value]}}">点击选择(可多选)</text>
<image wx:if="{{!isCompleted && !lockedFields[item.value]}}" class="multi-select__arrow" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/arrow.png" mode="aspectFit" />
</view>
</view>
<view class="multi-select__body" wx:if="{{orderObj[item.value] && orderObj[item.value].length}}">
<view class="multi-tags">
<block wx:for="{{orderObj[item.value]}}" wx:for-item="tag" wx:key="tagIndex" wx:for-index="tagIndex">
<view class="multi-tag">
<text class="multi-tag__text" style="max-width: {{(isCompleted || lockedFields[item.value]) ? '100%' : 'calc(100% - 36rpx)'}};">{{tag[item.itemName]}}</text>
<text class="multi-tag__close" wx:if="{{!isCompleted && !lockedFields[item.value]}}" catchtap="removeMultiSelected" data-field="{{item.value}}" data-index="{{tagIndex}}">×</text>
</view>
</block>
</view>
</view>
</view>
<view class="item-box" wx:else>
<view class="label">{{item.label}}<text class='required'>*</text></view>
<view wx:if="{{item.type == 'select'}}" class="value" bindtap="chooseSelect" data-item="{{item}}">
<block wx:if="{{orderObj[item.valueText]}}">
<text class="value-text">{{orderObj[item.valueText]}}</text>
</block>
<block wx:else>
<text wx:if="{{!isCompleted && !lockedFields[item.value]}}" class="placeholder">点击选择</text>
<text wx:else class="placeholder">-</text>
</block>
<image wx:if="{{!isCompleted && !lockedFields[item.value]}}" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/arrow.png" mode=""/>
</view>
<view class="value_box" wx:elif="{{item.type == 'radio'}}">
<view class="radio-box" wx:for="{{teaching_scene_list}}" wx:for-item="subItem" wx:for-index="subIndex" wx:key="subIndex" bindtap="changeScene" data-value="{{subItem.itemValue}}">
<image wx:if="{{orderObj.teachingSceneCode == subItem.itemValue}}" 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 class="text">{{subItem.itemName}}</view>
</view>
</view>
<view wx:else class="value" bindtap="chooseTime">
<text wx:if="{{orderObj[item.value]}}" class="value-text">{{orderObj[item.value]}}</text>
<block wx:else>
<text wx:if="{{!isCompleted && !lockedFields[item.value]}}" class="placeholder">点击选择</text>
<text wx:else class="placeholder">-</text>
</block>
<image wx:if="{{!isCompleted && !lockedFields[item.value]}}" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/arrow.png" mode=""/>
</view>
</view>
</block>
</block>
<view class="item-box remark_box">
<view class="label">带教内容摘要<text class='required'>*</text></view>
<view class="textArea_box">
<textarea placeholder-style="color: #999EA8;" disabled="{{isCompleted || lockedFields.assigneeDetail}}" value="{{ orderObj.assigneeDetail }}" maxlength="1000" placeholder="请输入" class="textarea" bindinput="assigneeDetailInput" />
<view class="currentWordNumber">{{assigneeDetailLength || 0}} / 1000</view>
</view>
</view>
<view class="image-box">
<view class="label">带教照片佐证<text class='required'>*</text></view>
<view class="upload_box">
<block wx:if="{{orderObj.assigneeImages.length > 0}}">
<view class="payVoucher_image" wx:for="{{orderObj.assigneeImages}}" wx:key="index">
<image bindtap="previewImage" data-index="{{index}}" data-url="{{orderObj.assigneeImages}}" src="{{item.imageUrl}}"/>
<image class="del_icon" wx:if="{{!isCompleted && !lockedFields.assigneeImages}}" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/zy_paf_del_icon.png" mode="" bindtap="delPhoto" data-index="{{index}}"/>
</view>
</block>
<block wx:if="{{orderObj.assigneeImages.length < 9 && !isCompleted && !lockedFields.assigneeImages}}">
<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>
<view class="upload-text">
{{orderObj.assigneeImages.length + '/' + 9}}
</view>
</view>
</block>
</view>
</view>
</view>
<view style="width: 100%;height: 20rpx;background: transparent;"></view>
</scroll-view>
<view class="footer-btn {{ isFullSucreen?'isFullSucreen-btn':'' }}" wx:if="{{!isCompleted}}">
<view class="btn" bindtap="submit">提交</view>
</view>
<select-popup show="{{ showSelectPopup }}" options="{{ selectOptions }}" multiple="{{selectMultiple}}" values="{{ selectValues }}" value="{{ selectValue }}" bindconfirm="handlePopupConfirm" labelKey="{{labelKey}}" valueKey="{{valueKey}}" height="{{selectPopupHeight}}" title="{{selectTitle}}" allowSearch="{{true}}" bindcancel="hideSelectPopup"></select-popup>
<popup bindcancel="cancel" bindconfirm="confirm" wx:if="{{dateShow}}" show="{{dateShow}}" title="时间选择" height="60vh">
<van-datetime-picker id="datePicker" show-toolbar="{{false}}" model:value="{{ currentDate }}" bind:change="onChange" bind:input="onInput" />
</popup>
import api from '~/api/index/index'
import dayjs from 'dayjs'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
Page({
data: {
IMG_URL,
navBarHeight: 84,
statusMap: {
0: { name: '待完成', color: '#2C66F7', background: '#2c66f71a' },
1: { name: '已完成', color: '#35C376', background: '#35c3761a' }
},
list: [],
total: 0,
pageNum: 1,
pageSize: 10,
nothing: false,
flag: false
},
navbarReady(e) {
const navBarHeight = e.detail?.height
if (!navBarHeight) return
this.setData({ navBarHeight })
},
onLoad() {
this.reload()
},
onShow() {},
reload() {
this.setData(
{
list: [],
total: 0,
pageNum: 1,
nothing: false,
flag: false
},
() => {
this.getList(true)
}
)
},
onBottom() {
this.getList()
},
getList(reload) {
const { pageNum, pageSize, nothing } = this.data
if (nothing) return
const params = {
pageNum,
pageSize
}
wx.$util.showLoading()
api
.getSpecialTaskList(params)
.then(res => {
wx.$util.hideLoading()
const { code, data, message } = res || {}
if (code != 0) {
wx.$util.showToast(message || '加载失败')
this.setData({ flag: true })
return
}
const pageList = Array.isArray(data?.list) ? data.list : []
pageList.forEach(val => {
val.completeTime = val.completeTime ? dayjs(val.completeTime).format('YYYY-MM-DD HH:mm:ss') : ''
})
const nextList = reload ? pageList : this.data.list.concat(pageList)
const total = data?.total || 0
const isNothing = pageNum == data?.pages
this.setData({
list: nextList,
total,
pageNum: pageNum + 1,
nothing: !!isNothing,
flag: true
})
})
.catch(() => {
wx.$util.hideLoading()
this.setData({ flag: true })
})
},
viewDetail(e) {
const item = e.currentTarget?.dataset?.item || {}
wx.navigateTo({
url: `/packageIndex/pages/specialTaskApply/specialTaskApply?id=${item.id}`
})
},
goCreate() {
wx.navigateTo({
url: '/packageIndex/pages/specialTaskApply/specialTaskApply'
})
},
back() {
wx.navigateBack()
}
})
{
"usingComponents": {},
"navigationStyle": "custom"
}
page {
background: #F2F3F7;
}
.page-title {
font-size: var(--fontSize34);
color: #222222;
font-weight: 600;
}
.container {
height: 100vh;
box-sizing: border-box;
}
.count {
padding: 16rpx 24rpx;
font-size: 24rpx;
color: #999999;
}
.list {
padding: 0 24rpx 24rpx;
box-sizing: border-box;
}
.item {
border-radius: 24rpx;
background: #FFFFFF;
padding: 24rpx;
margin-bottom: 24rpx;
box-sizing: border-box;
}
.item-top {
display: flex;
align-items: center;
}
.status {
font-size: 22rpx;
padding: 8rpx 12rpx;
border-radius: 8rpx;
flex-shrink: 0;
}
.name {
margin-left: 12rpx;
font-size: 28rpx;
font-weight: 500;
color: #222222;
flex: 1 1 auto;
min-width: 0;
}
.btn {
flex: 0 0 auto;
text-align: center;
padding: 12rpx 34rpx;
border-radius: 60rpx;
color: #2C66F7;
font-size: 26rpx;
font-weight: 500;
background: #2c66f71a;
box-sizing: border-box;
}
.item-actions {
margin-top: 24rpx;
display: flex;
justify-content: flex-end;
}
.row {
margin-top: 24rpx;
display: flex;
align-items: center;
font-size: 24rpx;
color: #999999;
}
.icon {
margin-right: 8rpx;
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
}
.label {
flex: 0 0 auto;
}
.value {
flex: 1 1 auto;
min-width: 0;
}
.list-nothing {
text-align: center;
color: #999999;
font-size: 24rpx;
padding: 24rpx 0;
}
<navigation-bar
bindnavbarReady="navbarReady"
class="navigation-header"
showBack
bindback="back"
navStyle="background-color: #FFFFFF;box-shadow:none;"
>
<view class="page-title">我发起的专项任务</view>
</navigation-bar>
<scroll-view
scroll-y
class="container"
enhanced="{{true}}"
show-scrollbar="{{false}}"
style="padding-top: {{navBarHeight}}px;padding-bottom: 40rpx;"
bindscrolltolower="onBottom"
>
<view class="count">共{{ total || 0 }}条任务</view>
<view class="list">
<block wx:for="{{ list }}" wx:key="id">
<view class="item">
<view class="item-top">
<view
class="status text-center"
style="color: {{statusMap[item.taskStatus].color}}; background-color: {{statusMap[item.taskStatus].background}};"
>
{{statusMap[item.taskStatus].name}}
</view>
<view class="name text-hide">{{ item.categoryName || '-' }}</view>
</view>
<view class="row" wx:if="{{ item.merchantName }}">
<image class="icon" src="{{IMG_URL}}special-task-merchant.png" mode="" />
<view class="label">归属门店:</view>
<view class="value text-hide">{{ item.merchantName }}</view>
</view>
<view class="row" wx:if="{{ item.regionOperatorName }}">
<image class="icon" src="{{IMG_URL}}special-task-staff.png" mode="" />
<view class="label">指定区域运营:</view>
<view class="value text-hide">{{ item.regionOperatorName || '-' }}</view>
</view>
<view class="row" wx:if="{{ item.taskStatus == 1 }}">
<image class="icon" src="{{IMG_URL}}time-icon.png" mode="" />
<view class="label">完成时间:</view>
<view class="value">{{ item.completeTime || '-' }}</view>
</view>
<view class="item-actions">
<view class="btn" bindtap="viewDetail" data-item="{{ item }}">查看</view>
</view>
</view>
</block>
<view class="list-nothing" wx:if="{{ nothing && list.length }}">到底了~</view>
<empty-data wx:if="{{ flag && !list.length }}" />
</view>
</scroll-view>
import indexApi from '~/api/index/index'
import crewApi from '~/api/crew/index'
import dayjs from 'dayjs'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
Page({
data: {
IMG_URL,
navBarHeight: 84,
pageTitle: '发起专项任务',
readonly: false,
isFullSucreen: false,
businessList: [
{ label: '延保', value: 1 },
{ label: '权益', value: 3 },
{ label: '轻改', value: 2 }
],
bizTypeOptions: [
{ itemName: '人员更换评估', itemValue: 'staff-replace-access' },
{ itemName: '商务政策更新', itemValue: 'policy-update-access' },
{ itemName: '流量问题改善', itemValue: 'traffic-optimize' }
],
merchantOptions: [],
staffOptions: [],
operatorOptions: [],
form: {
bizType: '',
categoryName: '',
merchantId: '',
merchantName: '',
businessType: '',
problemStaffList: [],
regionOperatorPhone: '',
regionOperatorName: '',
description: ''
},
descriptionLength: 0,
showSelectPopup: false,
selectOptions: [],
selectMultiple: false,
selectValues: [],
selectValue: null,
selectTitle: '',
selectPopupHeight: '55%',
labelKey: 'itemName',
valueKey: 'itemValue',
selectScene: '',
allowSearch: false
},
navbarReady(e) {
const navBarHeight = e.detail?.height
if (!navBarHeight) return
this.setData({ navBarHeight })
},
onLoad(options) {
this.setData({
pageQuery: options || {},
readonly: !!options?.id,
pageTitle: options?.id ? '查看专项任务' : '发起专项任务'
})
this.getMerchantList()
this.getAreaOperatorList()
if (options?.id) {
this.getDetail(options.id)
}
},
back() {
wx.navigateBack()
},
getMerchantList() {
indexApi.getSupervisorMerchantList({}).then(res => {
const { code, data, message } = res || {}
if (code == 0) {
const list = Array.isArray(data) ? data : []
list.forEach(val => {
val.itemName = val.merchantName
val.itemValue = val.merchantId
})
this.setData({ merchantOptions: list })
} else {
wx.$util.showToast(message || '门店列表获取失败')
}
})
},
getStaffListByMerchant(merchantId) {
if (!merchantId) {
this.setData({ staffOptions: [] })
return
}
let params = {
pageNum: 1,
pageSize: 9999,
merchantIdList: [merchantId]
}
crewApi.getParticipantOptions(params).then(res => {
const { code, data, message } = res || {}
if (code == 0) {
const list = Array.isArray(data) ? data : data?.list || []
list.forEach(val => {
val.itemName = val.staffName || val.name
val.itemValue = val.staffPhone || val.phone
})
this.setData({ staffOptions: list })
} else {
wx.$util.showToast(message || '人员列表获取失败')
}
})
},
getAreaOperatorList() {
indexApi.getAreaOperatorList({}).then(res => {
const { code, data, message } = res || {}
if (code == 0) {
const list = Array.isArray(data) ? data : data?.list || []
list.forEach(v => {
v.itemName = v.name
v.itemValue = v.phone
})
this.setData({ operatorOptions: list })
} else {
wx.$util.showToast(message || '区域运营获取失败')
}
})
},
getDetail(id) {
indexApi.getSpecialTaskDetail({ id }).then(res => {
const { code, data, message } = res || {}
if (code != 0) {
wx.$util.showToast(message || '详情获取失败')
return
}
const detail = data || {}
const bizType = detail.bizTypeAttr || detail.bizType || ''
const categoryName = detail.categoryName || ''
const merchantId = detail.merchantId || ''
const merchantName = detail.merchantName || ''
const businessType = Number(detail.businessType || detail.business || '') || ''
const regionOperatorName = detail.regionOperatorName || ''
const regionOperatorPhone = detail.regionOperatorPhone || ''
const description = detail.description || ''
this.setData({
descriptionLength: description?.length || 0,
form: {
...this.data.form,
bizType: String(bizType),
categoryName: categoryName || this.findcategoryName(String(bizType)),
merchantId,
merchantName,
businessType,
regionOperatorName,
regionOperatorPhone,
problemStaffList: detail?.problemStaffName?.split(',')?.map(val => {return {name: val}}),
description
}
})
this.getStaffListByMerchant(merchantId)
})
},
findcategoryName(bizType) {
const found = (this.data.bizTypeOptions || []).find(v => String(v.itemValue) === String(bizType))
return found?.itemName || ''
},
openbizType() {
if (this.data.readonly) return
this.openPopup({
scene: 'bizType',
title: '任务类型',
options: this.data.bizTypeOptions,
labelKey: 'itemName',
valueKey: 'itemValue',
multiple: false,
value: this.data.form.bizType || null,
allowSearch: false
})
},
openMerchant() {
if (this.data.readonly) return
this.openPopup({
scene: 'merchant',
title: '门店选择',
options: this.data.merchantOptions,
labelKey: 'itemName',
valueKey: 'itemValue',
multiple: false,
value: [this.data.form.merchantId] || null,
allowSearch: true
})
},
openProblemSales() {
if (this.data.readonly) return
if (this.data.form.bizType !== 'staff-replace-access') return
if (!this.data.form.merchantId) return wx.$util.showToast('请先选择归属门店')
if (!this.data.staffOptions.length) return wx.$util.showToast('当前门店暂无可选人员')
const selectedPhones = (this.data.form.problemStaffList || []).map(v => v.phone).filter(Boolean)
this.openPopup({
scene: 'problemSales',
title: '问题驻店销售',
options: this.data.staffOptions,
labelKey: 'itemName',
valueKey: 'itemValue',
multiple: true,
values: selectedPhones,
allowSearch: true
})
},
openOperator() {
if (this.data.readonly) return
if (!this.data.operatorOptions.length) return wx.$util.showToast('未配置区域运营,请联系总部处理')
this.openPopup({
scene: 'operator',
title: '指定区域运营',
options: this.data.operatorOptions,
labelKey: 'itemName',
valueKey: 'itemValue',
multiple: false,
value: [this.data.form.regionOperatorPhone] || null,
allowSearch: true
})
},
openPopup({ scene, title, options, multiple, value, values, labelKey, valueKey, allowSearch }) {
this.setData({
selectScene: scene,
selectTitle: title,
selectOptions: options || [],
selectMultiple: !!multiple,
selectValue: value !== undefined ? value : null,
selectValues: Array.isArray(values) ? values : [],
labelKey: labelKey || 'itemName',
valueKey: valueKey || 'itemValue',
allowSearch: !!allowSearch,
showSelectPopup: true
})
},
hideSelectPopup() {
this.setData({ showSelectPopup: false })
},
handlePopupConfirm(e) {
const { values, items } = e.detail || {}
const scene = this.data.selectScene
this.setData({ showSelectPopup: false })
if (scene === 'bizType') {
const val = values?.[0] || ''
const name = items?.[0]?.itemName || ''
this.setData({
'form.bizType': val,
'form.categoryName': name,
'form.problemStaffList': val === 'staff-replace-access' ? this.data.form.problemStaffList : []
})
return
}
if (scene === 'merchant') {
const val = values?.[0] || ''
const name = items?.[0]?.itemName || ''
this.setData({
'form.merchantId': val,
'form.merchantName': name,
'form.problemStaffList': []
})
this.getStaffListByMerchant(val)
return
}
if (scene === 'operator') {
const val = values?.[0] || ''
const name = items?.[0]?.itemName || ''
this.setData({
'form.regionOperatorPhone': val,
'form.regionOperatorName': name
})
return
}
if (scene === 'problemSales') {
const list = (items || []).map(v => ({
name: v.itemName,
phone: v.itemValue
}))
this.setData({
'form.problemStaffList': list
})
}
},
removeProblemSales(e) {
const idx = Number(e.currentTarget?.dataset?.index)
if (Number.isNaN(idx)) return
const next = (this.data.form.problemStaffList || []).slice()
next.splice(idx, 1)
this.setData({
'form.problemStaffList': next
})
},
changeBusiness(e) {
if (this.data.readonly) return
const val = e.currentTarget?.dataset?.value
this.setData({
'form.businessType': val
})
},
descriptionInput(e) {
if (this.data.readonly) return
let val = e.detail?.value || ''
if (val.length > 500) val = val.substring(0, 500)
this.setData({
'form.description': val,
descriptionLength: val.length
})
},
validate() {
const f = this.data.form || {}
if (!f.bizType) return '请选择任务类型'
if (!f.merchantId) return '请选择归属门店'
if (!f.businessType) return '请选择归属业务'
if (f.bizType === 'staff-replace-access') {
if (!Array.isArray(f.problemStaffList) || !f.problemStaffList.length) return '请选择问题驻店销售'
}
if (!f.regionOperatorPhone) return '请选择指定区域运营'
if (!String(f.description || '').trim()) return '请输入任务事项描述'
return ''
},
submit() {
const msg = this.validate()
if (msg) return wx.$util.showToast(msg)
const f = this.data.form || {}
const params = {
bizType: f.bizType,
categoryName: f.categoryName,
merchantId: f.merchantId,
merchantName: f.merchantName,
businessType: f.businessType,
problemStaffList: f.problemStaffList?.map(v => {return {name: v.name, phone: v.phone}}),
regionOperatorList: [{name: f.regionOperatorName, phone: f.regionOperatorPhone}],
description: f.description
}
wx.$util.showLoading()
indexApi
.createSpecialTask(params)
.then(res => {
wx.$util.hideLoading()
const { code, message } = res || {}
if (code == 0) {
wx.$util.showToast('操作成功')
this.back()
} else {
wx.$util.showToast(message || '提交失败')
}
})
.catch(() => {
wx.$util.hideLoading()
})
}
})
{
"usingComponents": {
"select-popup": "/components/selectPopup/selectPopup"
},
"navigationStyle": "custom"
}
page {
background: #F2F3F7;
}
.page-title {
font-size: var(--fontSize34);
color: #222222;
font-weight: 600;
}
.required {
color: #F24724;
margin-left: 8rpx;
}
.container {
height: 100vh;
box-sizing: border-box;
width: calc(100% - 48rpx);
margin: 0 24rpx;
}
.box {
border-radius: 32rpx;
background: #FFFFFF;
padding: 32rpx;
margin-bottom: 24rpx;
font-size: 28rpx;
&.padding-0 {
padding: 0;
}
}
.item-box {
height: 96rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 32rpx;
border-bottom: 1rpx solid #eff0f2;
box-sizing: border-box;
.label {
color: #292D33;
flex: 0 0 auto;
}
.value {
display: flex;
align-items: center;
justify-content: flex-end;
width: calc(100% - 158rpx);
min-width: 0;
image {
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
transform: rotate(-90deg)
}
}
.value-text {
text-align: right;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #292D33;
}
.placeholder {
color: #BEC1C7;
font-size: 28rpx;
}
}
.value_box {
flex: 1 1 auto;
min-width: 0;
display: flex;
justify-content: flex-end;
gap: 24rpx;
.radio-box {
display: flex;
align-items: center;
gap: 10rpx;
.radio-icon {
width: 32rpx;
height: 32rpx;
}
.circle {
width: 28rpx;
height: 28rpx;
border-radius: 50%;
border: 2rpx solid #D9DDE3;
box-sizing: border-box;
}
.text {
color: #292D33;
font-size: 28rpx;
}
}
}
.multi-select {
padding: 0 32rpx;
border-bottom: 1rpx solid #eff0f2;
.multi-select__header {
height: 96rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.multi-select__label {
color: #292D33;
}
.multi-select__arrow {
flex-shrink: 0;
width: 32rpx;
height: 32rpx;
transform: rotate(-90deg);
}
.multi-select__body {
margin-bottom: 12rpx;
}
.multi-placeholder {
color: #BEC1C7;
font-size: 28rpx;
}
}
.multi-tags {
display: flex;
flex-wrap: wrap;
gap: 24rpx;
}
.multi-tag {
display: inline-flex;
align-items: center;
max-width: 100%;
padding: 0 12rpx;
height: 44rpx;
border-radius: 8rpx;
background: #F6F7F9;
border: 2rpx solid #E6E8EC;
box-sizing: border-box;
}
.multi-tag__text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 28rpx;
color: #292D33;
}
.multi-tag__close {
margin-left: 16rpx;
color: #999EA8;
font-size: 32rpx;
line-height: 1;
}
.remark_box {
height: 382rpx;
align-items: flex-start;
justify-content: flex-start;
flex-flow: column;
border-bottom: none;
.label {
margin: 28rpx 0;
width: 100%;
}
.textArea_box {
box-sizing: border-box;
width: 100%;
border-radius: 16rpx;
padding: 24rpx 24rpx 42rpx;
background: #FFFFFF;
border: 2rpx solid #eff0f2;
height: 262rpx;
position: relative;
font-size: 28rpx;
.textarea {
height: 100%;
width: 100%;
}
.currentWordNumber {
position: absolute;
right: 26rpx;
bottom: 8rpx;
color: #CCCCCC;
}
}
}
.footer-btn {
position: fixed;
left: 0;
width: 100%;
bottom: 0;
min-height: 100rpx;
background: #FFFFFF;
box-sizing: border-box;
display: flex;
align-items: center;
font-weight: 500;
z-index: 99;
.btn {
margin: 16rpx 32rpx;
width: calc(100% - 64rpx);
height: 88rpx;
text-align: center;
line-height: 88rpx;
background: #2C66F7;
border-radius: 24rpx;
font-size: 32rpx;
color: #FFFFFF;
font-weight: 500;
}
}
.isFullSucreen-btn {
padding-bottom: 34px !important;
}
<glsx-privacy appletName="嘀加门店管理助手" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<navigation-bar
bindnavbarReady="navbarReady"
class="navigation-header"
showBack="{{true}}"
bindback="back"
navStyle="background-color: transparent;box-shadow:none;"
>
<view class="page-title">{{ pageTitle }}</view>
</navigation-bar>
<scroll-view
class="container"
scroll-y
show-scrollbar="{{false}}"
enhanced
style="padding-top: calc({{navBarHeight}}px + 8rpx);padding-bottom: {{ readonly ? '0' : (isFullSucreen ? 'calc(120rpx + 34px)' : '120rpx') }};"
>
<view style="width: 100%;height: 8rpx;"></view>
<view class="box padding-0">
<view class="item-box" bindtap="openbizType">
<view class="label">任务类型<text class="required">*</text></view>
<view class="value">
<text wx:if="{{ form.categoryName }}" class="value-text">{{ form.categoryName }}</text>
<text wx:else class="placeholder">点击选择</text>
<image src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/arrow.png" mode="" />
</view>
</view>
<view class="item-box" bindtap="openMerchant">
<view class="label">归属门店<text class="required">*</text></view>
<view class="value">
<text wx:if="{{ form.merchantName }}" class="value-text">{{ form.merchantName }}</text>
<text wx:else class="placeholder">点击选择</text>
<image src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/arrow.png" mode="" />
</view>
</view>
<view class="item-box">
<view class="label">归属业务<text class="required">*</text></view>
<view class="value_box">
<view class="radio-box" wx:for="{{ businessList }}" wx:key="value" bindtap="changeBusiness" data-value="{{ item.value }}">
<image wx:if="{{ form.businessType == item.value }}" class="radio-icon" src="{{IMG_URL}}radio-checked.png" mode="" />
<view wx:else class="circle" style="background: {{readonly ? '#EEE' : ''}};"></view>
<view class="text">{{ item.label }}</view>
</view>
</view>
</view>
<view class="multi-select" wx:if="{{ form.bizType == 'staff-replace-access' }}">
<view class="multi-select__header">
<view class="multi-select__label">问题驻店销售<text class="required">*</text></view>
<view bindtap="openProblemSales" style="display: flex;align-items: center;">
<text class="multi-placeholder" wx:if="{{ !readonly }}">点击选择(可多选)</text>
<image class="multi-select__arrow" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/arrow.png" mode="aspectFit" />
</view>
</view>
<view class="multi-select__body" wx:if="{{ form.problemStaffList && form.problemStaffList.length }}">
<view class="multi-tags">
<block wx:for="{{ form.problemStaffList }}" wx:key="phone">
<view class="multi-tag">
<text class="multi-tag__text" style="max-width: {{ readonly ? '100%' : 'calc(100% - 36rpx)'}};">{{ item.name || item.staffName || item.participantName || '-' }}</text>
<text class="multi-tag__close" wx:if="{{ !readonly }}" catchtap="removeProblemSales" data-index="{{ index }}">×</text>
</view>
</block>
</view>
</view>
</view>
<view class="item-box" bindtap="openOperator">
<view class="label">指定区域运营<text class="required">*</text></view>
<view class="value">
<text wx:if="{{ form.regionOperatorName }}" class="value-text">{{ form.regionOperatorName }}</text>
<text wx:else class="placeholder">点击选择</text>
<image src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/arrow.png" mode="" />
</view>
</view>
<view class="item-box remark_box">
<view class="label">任务事项描述<text class="required">*</text></view>
<view class="textArea_box">
<textarea
placeholder-style="color: #999EA8;"
disabled="{{ readonly }}"
value="{{ form.description }}"
maxlength="500"
placeholder="请输入"
class="textarea"
bindinput="descriptionInput"
/>
<view class="currentWordNumber">{{ descriptionLength || 0 }} / 500</view>
</view>
</view>
</view>
<view style="width: 100%;height: 20rpx;background: transparent;"></view>
</scroll-view>
<view class="footer-btn {{ isFullSucreen?'isFullSucreen-btn':'' }}" wx:if="{{ !readonly }}">
<view class="btn" bindtap="submit">提交</view>
</view>
<select-popup
show="{{ showSelectPopup }}"
options="{{ selectOptions }}"
multiple="{{ selectMultiple }}"
values="{{ selectValues }}"
value="{{ selectValue }}"
bindconfirm="handlePopupConfirm"
bindcancel="hideSelectPopup"
labelKey="{{ labelKey }}"
valueKey="{{ valueKey }}"
height="{{ selectPopupHeight }}"
title="{{ selectTitle }}"
allowSearch="{{ allowSearch }}"
/>
import api from '~/api/index/index'
import dayjs from 'dayjs'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
let timeoutId
import api from "~/api/index/index";
import dayjs from "dayjs";
const IMG_URL = "https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/";
let timeoutId;
Page({
/**
* 页面的初始数据
......@@ -12,38 +12,47 @@ Page({
navStyle: "background-color: rgba(0,0,0,0);",
navTitleStyle: "font-weight: 600; font- size: 32rpx; color: #000;",
userInfo: {},
staticList: [{
label: '驻店人员',
width: '208',
key: 'staffCount',
background: 'linear-gradient(90deg, #42CCCF 0%, #36D9A5 100%)'
}, {
label: '门店数量',
width: '192',
key: 'shopCount',
background: 'linear-gradient(90deg, #5E69FF 0%, #4079FF 100%)'
}, {
label: '总产值',
key: 'totalValue',
background: 'linear-gradient(90deg, #3D76FC 0%, #4DA6FF 100%)'
}],
tabList: [{
text: '每日任务',
count: 0,
key: 'dailyCount'
}, {
text: '本周任务',
count: 0,
key: 'weeklyCount'
}, {
text: '月度任务',
count: 0,
key: 'monthlyCount'
}, {
text: '专项任务',
count: 0,
key: 'specialCount'
}],
staticList: [
{
label: "驻店人员",
width: "208",
key: "staffCount",
background: "linear-gradient(90deg, #42CCCF 0%, #36D9A5 100%)",
},
{
label: "门店数量",
width: "192",
key: "shopCount",
background: "linear-gradient(90deg, #5E69FF 0%, #4079FF 100%)",
},
{
label: "总产值",
key: "totalValue",
background: "linear-gradient(90deg, #3D76FC 0%, #4DA6FF 100%)",
},
],
tabList: [
{
text: "每日任务",
count: 0,
key: "dailyCount",
},
{
text: "本周任务",
count: 0,
key: "weeklyCount",
},
{
text: "月度任务",
count: 0,
key: "monthlyCount",
},
{
text: "专项任务",
count: 0,
key: "specialCount",
},
],
tabIndex: 0,
statusMap: {
0: { name: "待完成", color: "#2C66F7", background: "#2c66f71a" },
......@@ -51,28 +60,29 @@ Page({
2: { name: "已完成", color: "#35C376", background: "#35c3761a" },
},
missionMap: {
3: {name: '录音复盘'},
5: {name: '人员带教'},
0: {name: '督导日报'},
1: {name: '本周复盘'},
2: {name: '督导月度计划'},
4: {name: '专项任务'},
6: {name: '提报优秀案例录音'},
7: {name: '带教要求'}
3: { name: "录音复盘" },
5: { name: "人员带教" },
0: { name: "督导日报" },
1: { name: "本周复盘" },
2: { name: "督导月度计划" },
4: { name: "专项任务" },
6: { name: "提报优秀案例录音" },
7: { name: "带教要求" },
},
list: [],
scrollTop: 0,
showIcon1: true
},
onTabItemTap(e) {
// 点击埋点
wx.$track.setTrackData(0, 'supervisor_index_page', {}, '')
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
showIcon1: true,
subTabIndex: 1,
},
onTabItemTap(e) {
// 点击埋点
wx.$track.setTrackData(0, "supervisor_index_page", {}, "");
},
navbarReady(e) {
let navBarHeight = e.detail.height;
this.setData({
navBarHeight,
});
},
onScroll(e) {
this.setData({
......@@ -83,89 +93,91 @@ Page({
query.select(".data-container").boundingClientRect();
query.exec((res) => {
this.setData({
isSticky: res[0].top <= navBarHeight
})
})
isSticky: res[0].top <= navBarHeight,
});
});
// 滚动时隐藏第一个图标,显示第二个图标
this.setData({
showIcon1: false
})
showIcon1: false,
});
// 清除之前的定时器
if (timeoutId) {
clearTimeout(timeoutId)
clearTimeout(timeoutId);
}
// 设置一个定时器,在滚动停止后一定时间后恢复两个图标的显示状态
timeoutId = setTimeout(() => {
this.setData({
showIcon1: true
})
}, 1000) // 在这里设置等待的时间,单位是毫秒
showIcon1: true,
});
}, 1000); // 在这里设置等待的时间,单位是毫秒
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let userInfo = wx.$util.getUserInfo()
this.setData({userInfo})
this.getTabData(true)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let userInfo = wx.$util.getUserInfo();
this.setData({ userInfo });
this.getTabData(true);
},
/**
* 生命周期函数--监听页面显示
*/
onShow () {
this.getTabData()
this.getStaticData()
this.setData({
list: [],
pageNum: 1,
flag: false,
nothing: false
}, () => {
this.getList(true)
})
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.getTabData();
this.getStaticData();
this.setData(
{
list: [],
pageNum: 1,
flag: false,
nothing: false,
},
() => {
this.getList(true);
},
);
},
getTabData(loadFlag) {
let { tabIndex, tabList, startStr, endStr } = this.data
let userInfo = wx.$util.getUserInfo()
let { tabIndex, tabList, startStr, endStr } = this.data;
let userInfo = wx.$util.getUserInfo();
let params = {
supervisorPhone: userInfo?.phone,
startDate: loadFlag ? undefined : startStr,
endDate: loadFlag ? undefined : endStr
}
api.getTaskTabData(params).then(res => {
let { code, data, message } = res
endDate: loadFlag ? undefined : endStr,
};
api.getTaskTabData(params).then((res) => {
let { code, data, message } = res;
if (code == 0) {
if (loadFlag) {
tabList?.forEach(val => {
val.count = data[val.key] > 99 ? '99+' : data[val.key]
})
tabList?.forEach((val) => {
val.count = data[val.key] > 99 ? "99+" : data[val.key];
});
this.setData({
tabList
})
tabList,
});
} else {
// 仅更新当前选中tab数量
let key = tabList[tabIndex].key
let key = tabList[tabIndex].key;
this.setData({
[`tabList[${tabIndex}].count`]: data[key] > 99 ? '99+' : data[key]
})
[`tabList[${tabIndex}].count`]: data[key] > 99 ? "99+" : data[key],
});
}
} else {
wx.$util.showToast(message)
wx.$util.showToast(message);
}
})
});
},
handleMentoring() {
wx.$track.setTrackData(0, `supervisor_start_mentoring_index`, {}, '')
wx.$track.setTrackData(0, `supervisor_start_mentoring_index`, {}, "");
wx.navigateTo({
url: `/packageCrew/pages/mentoring/mentoring`,
})
});
},
formatThousands(v) {
......@@ -179,6 +191,22 @@ Page({
return isNeg ? `-${res}` : res;
},
toDateTimeStart(dateStr) {
if (!dateStr) return undefined;
const s = String(dateStr).trim();
if (!s) return undefined;
if (s.includes(":")) return s;
return `${s} 00:00:00`;
},
toDateTimeEnd(dateStr) {
if (!dateStr) return undefined;
const s = String(dateStr).trim();
if (!s) return undefined;
if (s.includes(":")) return s;
return `${s} 23:59:59`;
},
getStaticData() {
api.getSupervisorStaticData({}).then((res) => {
let { code, data, message } = res;
......@@ -197,52 +225,99 @@ Page({
let eventCode = ["supervisor_dayTask_tab", "supervisor_weeklyTask_tab", "supervisor_monthlyTask_tab", "supervisor_specificTask_tab"];
// 点击埋点
wx.$track.setTrackData(0, eventCode[e.detail], {}, "");
this.setData({
tabIndex: e.detail,
});
const nextTabIndex = e.detail;
const nextSubTabIndex = nextTabIndex === 3 ? this.data.subTabIndex : 0;
this.setData(
{
tabIndex: nextTabIndex,
subTabIndex: nextSubTabIndex,
list: [],
pageNum: 1,
flag: false,
nothing: false,
total: 0,
},
() => {
this.getList(true);
this.getTabData();
},
);
},
switchSpecialCenter(e) {
const idx = Number(e.currentTarget?.dataset?.index);
if (Number.isNaN(idx)) return;
if (idx === this.data.subTabIndex) return;
this.setData(
{
subTabIndex: idx,
list: [],
pageNum: 1,
flag: false,
nothing: false,
total: 0,
},
() => {
this.getList(true);
},
);
},
jump(e) {
const { target } = e.currentTarget.dataset;
const pageUrl = {
3: '/packageIndex/pages/recordingReview/recordingReview',
5: '/packageCrew/pages/mentoring/mentoring',
0: '/packageIndex/pages/dailySupervisionReport/dailySupervisionReport',
1: '/packageIndex/pages/weeklyReview/weeklyReview',
2: '/packageIndex/pages/monthlyPlan/monthlyPlan',
4: '/packageIndex/pages/specialTask/specialTask',
6: '/packageIndex/pages/caseAudioList/caseAudioList',
7: '/packageIndex/pages/mentorRequirements/mentorRequirements'
}
3: "/packageIndex/pages/recordingReview/recordingReview",
5: "/packageCrew/pages/mentoring/mentoring",
0: "/packageIndex/pages/dailySupervisionReport/dailySupervisionReport",
1: "/packageIndex/pages/weeklyReview/weeklyReview",
2: "/packageIndex/pages/monthlyPlan/monthlyPlan",
4: "/packageIndex/pages/specialTask/specialTask",
6: "/packageIndex/pages/caseAudioList/caseAudioList",
7: "/packageIndex/pages/mentorRequirements/mentorRequirements",
};
const eventCode = {
3: {view: 'supervisor_recording_view', execute: 'supervisor_recording_execute'},
5: {view: 'supervisor_mentoring_view', execute: 'supervisor_mentoring_execute'},
0: {view: 'supervisor_report_view', execute: 'supervisor_report_execute'},
1: {view: 'supervisor_weeklyReview_view', execute: 'supervisor_weeklyReview_execute'},
2: {view: 'supervisor_monthlyPlan_view', execute: 'supervisor_monthlyPlan_execute'},
4: {view: 'supervisor_specificTask_view', execute: 'supervisor_specificTask_execute'},
6: {view: 'supervisor_caseAudioList_view', execute: 'supervisor_caseAudioList_view'},
7: {view: 'supervisor_mentorRequirements_view', execute: 'supervisor_mentorRequirements_view'}
}
let status = target.taskStatus != 2 ? 'execute' : 'view'
wx.$track.setTrackData(0, eventCode[target.taskType][status], {}, '')
3: { view: "supervisor_recording_view", execute: "supervisor_recording_execute" },
5: { view: "supervisor_mentoring_view", execute: "supervisor_mentoring_execute" },
0: { view: "supervisor_report_view", execute: "supervisor_report_execute" },
1: { view: "supervisor_weeklyReview_view", execute: "supervisor_weeklyReview_execute" },
2: { view: "supervisor_monthlyPlan_view", execute: "supervisor_monthlyPlan_execute" },
4: { view: "supervisor_specificTask_view", execute: "supervisor_specificTask_execute" },
6: { view: "supervisor_caseAudioList_view", execute: "supervisor_caseAudioList_view" },
7: { view: "supervisor_mentorRequirements_view", execute: "supervisor_mentorRequirements_view" },
};
let status = target.taskStatus != 2 ? "execute" : "view";
wx.$track.setTrackData(0, eventCode[target.taskType][status], {}, "");
wx.navigateTo({
url: `${pageUrl[target.taskType]}?taskStatus=${target.taskStatus}&id=${target.id}`,
});
},
// 专项带教
jumpTaskCenter(e) {
const { target } = e.currentTarget.dataset || {};
if (!target) return;
const taskStatus = target.taskStatus;
const qs = `taskId=${encodeURIComponent(target.taskId)}${taskStatus === null || taskStatus === undefined ? "" : `&taskStatus=${encodeURIComponent(taskStatus)}`}`;
wx.navigateTo({
url: `/packageCrew/pages/specialMentoring/specialMentoring?${qs}`,
});
},
search(e) {
this.setData({
list: [],
pageNum: 1,
flag: false,
nothing: false,
startStr: e.detail.startDay?.replace(/\//g, '-'),
endStr: e.detail.endDay?.replace(/\//g, '-')
}, () => {
this.getList(true)
this.getTabData()
})
this.setData(
{
list: [],
pageNum: 1,
flag: false,
nothing: false,
startStr: e.detail.startDay?.replace(/\//g, "-"),
endStr: e.detail.endDay?.replace(/\//g, "-"),
},
() => {
this.getList(true);
this.getTabData();
},
);
},
scrollonReachBottom() {
......@@ -250,41 +325,51 @@ Page({
},
// 获取列表数据
getList(repload) {
let { pageNum, nothing, startStr, endStr, tabIndex, topBoxHeight, scrollTop } = this.data
if (nothing) return
const taskList = [[0, 3, 5], [6, 7], [2], [4]]
wx.$util.showLoading()
let params = {
taskTypeList: taskList[tabIndex],
startDate: startStr,
endDate: endStr,
pageNum,
pageSize: 10
}
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({
[`list[${pageNum - 1}]`]: list
})
getList(repload) {
let { pageNum, nothing, startStr, endStr, tabIndex, topBoxHeight, scrollTop, subTabIndex } = this.data;
if (nothing) return;
const taskList = [[0, 3, 5], [6, 7], [2], [4]];
wx.$util.showLoading();
let params =
tabIndex == 3 && subTabIndex == 0
? {
pageNum,
pageSize: 10,
bizType: "spec-coach",
startDate: startStr,
endDate: endStr,
}
: {
taskTypeList: taskList[tabIndex],
startDate: startStr,
endDate: endStr,
pageNum,
pageSize: 10,
};
let requestEvent = tabIndex == 3 && subTabIndex == 0 ? "getTaskCenterPageData" : "getMissionList";
api[requestEvent](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 (tabIndex == 3 && subTabIndex == 0) {
val.taskStatus = val.status === 'UNFINISHED' ? 0 : 2
if (val.completeTime) val.completeTime = dayjs(val.completeTime).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,
});
}
// if (repload) {
// const query = wx.createSelectorQuery().in(this)
......
......@@ -73,12 +73,53 @@ page {
}
}
}
.count-row {
display: flex;
align-items: center;
justify-content: space-between;
background: #F2F3F7;
padding: 16rpx 24rpx;
}
.number {
height: 30rpx;
font-size: 24rpx;
color: #999999;
background: #F2F3F7;
padding: 16rpx 24rpx;
}
.sub-tab {
display: flex;
align-items: center;
gap: 24rpx;
padding: 8rpx;
border-radius: 16rpx;
background: #FFFFFF;
}
.center-switch {
display: flex;
align-items: center;
padding: 4rpx 8rpx;
border-radius: 8rpx;
&.active {
background: #E7EDFE;
}
}
.center-switch__text {
font-size: 26rpx;
color: #292D33;
&.active {
color: #2C66F7;
font-weight: 600;
}
}
.center-switch__icon {
font-size: 26rpx;
color: #BEC1C7;
line-height: 1;
margin: 0 6rpx;
}
.content-box {
padding: 0 24rpx;
......@@ -232,4 +273,4 @@ page {
width: 32rpx;
height: 32rpx;
}
}
\ No newline at end of file
}
......@@ -41,118 +41,180 @@
<view class="data-container">
<view class="sticky-box {{ isSticky ? 'is-sticky' : '' }}">
<view class="tab-box">
<tab-bar tabList="{{ tabList }}" badge="{{true}}" bindclick="tabClick" activeIndex="{{ tabIndex }}" />
<tab-bar tabList="{{ tabList }}"
badge="{{ true }}"
bindclick="tabClick"
activeIndex="{{ tabIndex }}" />
</view>
<view class="date">
<date-screen tabSelected="{{ tabIndex }}"
isSticky="{{ isSticky }}"
bind:search="search"></date-screen>
</view>
<view class="number">
共{{ total || 0 }}条任务
<view class="count-row">
<view class="number">
共{{ total || 0 }}条任务
</view>
<view class="sub-tab" wx:if="{{ tabIndex == 3 }}">
<view class="center-switch {{ subTabIndex == 0 ? 'active' : '' }}"
catchtap="switchSpecialCenter"
data-index="0">
<text class="center-switch__text {{ subTabIndex == 0 ? 'active' : '' }}">任务中心</text>
</view>
<text class="center-switch__icon">⇄</text>
<view class="center-switch {{ subTabIndex == 1 ? 'active' : '' }}"
catchtap="switchSpecialCenter"
data-index="1">
<text class="center-switch__text {{ subTabIndex == 1 ? 'active' : '' }}">策略中心</text>
</view>
</view>
</view>
</view>
<view class="content-box">
<view class="list">
<block wx:if="{{ list.length > 0 }}">
<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">
<block wx:if="{{ list.length > 0 }}">
<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">
<block wx:if="{{ tabIndex == 3 && subTabIndex == 0 }}">
<view class="item-top">
<view class="status text-center"
style="color: {{ statusMap[item.taskStatus].color }}; background-color: {{ statusMap[item.taskStatus].background }};">
{{ statusMap[item.taskStatus].name }}
</view>
<view class="name">
专项带教
</view>
</view>
<view class="list-item">
<image class="icon"
src="{{ IMG_URL }}time-icon.png"
mode="" />
<view class="label">
完成时间:
</view>
<view wx:if="{{ item.taskStatus == 2 }}">
{{ item.completeTime || '-' }}
</view>
<view wx:else>
-
</view>
</view>
<view class="btn-box">
<view bindtap="jumpTaskCenter"
data-target="{{ item }}"
class="btn {{ item.taskStatus == 2 ? '' : 'primary' }}">
{{ item.taskStatus == 2 ? '查看' : '去执行' }}
</view>
</view>
</block>
<block wx:else>
<!-- 顶部状态和标题 -->
<view class="item-top">
<view
class="status text-center"
style="color: {{statusMap[item.taskStatus].color}}; background-color: {{statusMap[item.taskStatus].background}};"
>
{{statusMap[item.taskStatus].name}}
</view>
<view class="name" wx:if="{{item.taskType != 4}}">
{{missionMap[item.taskType].name}}
<text wx:if="{{item.taskType == 5}}"></text>
</view>
<view class="name" wx:else>{{item.merchantName || '-'}}</view>
<view class="status text-center"
style="color: {{ statusMap[item.taskStatus].color }}; background-color: {{ statusMap[item.taskStatus].background }};">
{{ statusMap[item.taskStatus].name }}
</view>
<view class="name" wx:if="{{ item.taskType != 4 }}">
{{ missionMap[item.taskType].name }}<text wx:if="{{ item.taskType == 5 }}"></text>
</view>
<view class="name" wx:else>
{{ item.merchantName || '-' }}
</view>
</view>
<!-- <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="" />
<view class="label">{{['日报内容:', '复盘内容:', '月度计划:'][item.taskType]}}</view>
<view class="text-hide">{{item.taskContext || '-'}}</view>
</view> -->
<block wx:if="{{item.taskType == 4}}">
<block wx:if="{{ item.taskType == 4 }}">
<view class="list-item">
<image class="icon" src="{{IMG_URL}}matter-icon.png" mode="" />
<view class="label">事项描述:</view>
<view class="text-hide">{{item.taskDesc || '-'}}</view>
<image class="icon"
src="{{ IMG_URL }}matter-icon.png"
mode="" />
<view class="label">
事项描述:
</view>
<view class="text-hide">
{{ item.taskDesc || '-' }}
</view>
</view>
<view wx:if="{{item.taskStatus == 2}}" class="list-item">
<image class="icon" src="{{IMG_URL}}task-icon.png" mode="" />
<view class="label">专项任务:</view>
<view class="text-hide">{{item.taskContext || '-'}}</view>
<view wx:if="{{ item.taskStatus == 2 }}" class="list-item">
<image class="icon"
src="{{ IMG_URL }}task-icon.png"
mode="" />
<view class="label">
专项任务:
</view>
<view class="text-hide">
{{ item.taskContext || '-' }}
</view>
</view>
<view wx:else class="list-item">
<image class="icon" src="{{IMG_URL}}time-icon.png" mode="" />
<view class="label">创建时间:</view>
<view>{{item.createTime || '-'}}</view>
<image class="icon"
src="{{ IMG_URL }}time-icon.png"
mode="" />
<view class="label">
创建时间:
</view>
<view>
{{ item.createTime || '-' }}
</view>
</view>
</block>
<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="" />
<view class="label">完成时间:</view>
<view wx:if="{{item.taskStatus == 2}}">{{item.updatedDate || '-'}}</view>
<view wx:else>-</view>
<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="" />
<view class="label">
完成时间:
</view>
<view wx:if="{{ item.taskStatus == 2 }}">
{{ item.updatedDate || '-' }}
</view>
<view wx:else>
-
</view>
</view>
<!-- 录音复盘任务进度 -->
<view wx:if="{{item.taskType == 3}}" class="list-item">
<view wx:if="{{ item.taskType == 3 }}" class="list-item">
<view class="progress">
<view class="progress-line"></view>
<view
class="progress-item"
style="width: {{ (item.audioReviewCompletedCount / item.audioReviewTotalCount * 100) + '%' }}"
></view>
<view class="num">{{item.audioReviewCompletedCount + '/' + item.audioReviewTotalCount}}</view>
<view class="progress-item"
style="width: {{ (item.audioReviewCompletedCount / item.audioReviewTotalCount * 100) + '%' }}"></view>
<view class="num">
{{ item.audioReviewCompletedCount + '/' + item.audioReviewTotalCount }}
</view>
</view>
</view>
<!-- 提报优秀案例录音/带教要求任务进度 -->
<view wx:if="{{item.taskType == 6 || item.taskType == 7}}" class="list-item">
<view wx:if="{{ item.taskType == 6 || item.taskType == 7 }}" class="list-item">
<view class="progress">
<view class="progress-line"></view>
<view
class="progress-item"
style="width: {{ (item.weeklyTaskCompletedCount / item.weeklyTaskTotalCount * 100) + '%' }};"
></view>
<view class="num">{{item.weeklyTaskCompletedCount + '/' + item.weeklyTaskTotalCount}}</view>
<view class="progress-item"
style="width: {{ (item.weeklyTaskCompletedCount / item.weeklyTaskTotalCount * 100) + '%' }};"></view>
<view class="num">
{{ item.weeklyTaskCompletedCount + '/' + item.weeklyTaskTotalCount }}
</view>
</view>
</view>
<!-- 底部按钮 -->
<view class="btn-box">
<view
bindtap="jump"
data-target="{{item}}"
class="btn {{item.taskStatus == 2 ? '' : 'primary'}}"
>
{{item.taskStatus == 2 ? '查看' : '去执行'}}
<view bindtap="jump"
data-target="{{ item }}"
class="btn {{ item.taskStatus == 2 ? '' : 'primary' }}">
{{ item.taskStatus == 2 ? '查看' : '去执行' }}
</view>
</view>
</view>
<!-- 底部按钮 -->
<view class="btn-box">
<view bindtap="jump"
data-target="{{ item }}"
class="btn {{ item.taskStatus == 2 ? '' : 'primary' }}">
{{ item.taskStatus == 2 ? '查看' : '去执行' }}
</view>
</view>
</block>
</block>
</view>
</block>
</block>
<block wx:if="{{ nothing }}">
<view class="list-nothing">
到底了~
</view>
</block>
</block>
<block wx:if="{{ nothing }}">
<view class="list-nothing">
到底了~
</view>
</block>
<block wx:else>
<empty-data />
</block>
......@@ -160,18 +222,21 @@
</view>
</view>
</scroll-view>
<block wx:if="{{tabIndex == 0}}">
<block wx:if="{{showIcon1}}">
<block wx:if="{{ tabIndex == 0 }}">
<block wx:if="{{ showIcon1 }}">
<view class="add-btn-box" bindtap="handleMentoring">
<view class="addBtn">
<van-icon name="plus" />
<view class="btn-text">带教记录</view>
<view class="btn-text">
带教记录
</view>
</view>
</view>
</block>
<block wx:else>
<view class="arrowIcon">
<image class="image" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/usedCar/arrow-right.png" />
<image class="image"
src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/usedCar/arrow-right.png" />
</view>
</block>
</block>
......@@ -12,6 +12,11 @@ Page({
navStyle: 'background-color: rgba(0,0,0,0);box-shadow:none;',
isForbidden: false
},
goMySpecialTask() {
wx.navigateTo({
url: '/packageIndex/pages/mySpecialTaskList/mySpecialTaskList'
})
},
jump(e) {
let {
url
......@@ -109,4 +114,4 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () { },
})
\ No newline at end of file
})
......@@ -19,12 +19,20 @@
</view>
</view>
<view class="set_box">
<view class="set_item" bindtap="goMySpecialTask">
<image class="icon" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/special-task-icon.png" mode=""/>
<view class="right">
<view class="title">我发起的专项任务</view>
<view class="set_tips"></view>
<image class="icon_image" src="{{IMG_URL}}arrow-left.png" mode="" />
</view>
</view>
<view class="set_item " bindtap="jump" data-url="agreement">
<image class="icon" src="{{IMG_URL}}user-agreement.png" mode=""/>
<view class="right">
<view class="title">用户协议</view>
<view class="set_tips"></view>
<image class="icon_image" src="./images/right.png" mode="" />
<image class="icon_image" src="{{IMG_URL}}arrow-left.png" mode="" />
</view>
</view>
<view class="set_item " bindtap="jump" data-url="privacy">
......@@ -32,7 +40,7 @@
<view class="right">
<view class="title">隐私协议</view>
<view class="set_tips"></view>
<image class="icon_image" src="./images/right.png" mode="" />
<image class="icon_image" src="{{IMG_URL}}arrow-left.png" mode="" />
</view>
</view>
<!-- <view class="set_item " bindtap="goVersionPage">
......
......@@ -266,7 +266,8 @@ export const checkScene = options => {
'recruitDetail': 'packageEquity/pages/recruitManage/recruitDetail/recruitDetail',
'performanceRate': 'packageWorkspace/pages/performanceRating/rateList/retaList',
'validReferralCount': 'packageWorkspace/pages/validReferralCount/referralCountList/referralCountList',
'orderApprovalDetail': '/packageWorkspace/pages/orderApprovalManage/orderApprovalDetail/orderApprovalDetail'
'orderApprovalDetail': '/packageWorkspace/pages/orderApprovalManage/orderApprovalDetail/orderApprovalDetail',
'supervisorIndex': 'pages/tab/index/index'
}
options.path = pagePath[query.page]
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!