Commit 79505a8a by chenwq

feat(teamWork, recruitManage): 新增专项任务详情页,移除废弃招聘模块

- 新增专项任务详情页面,打通团队任务列表到详情页的跳转流程
- 移除整个recruitManage招聘管理模块,包括所有页面、静态资源、API及路由配置
- 优化团队工作台列表页的缓存清理逻辑,避免页面数据污染
- 统一优化多处代码的变量声明,使用const替代无需修改的let,修复格式问题
1 parent d4917b1b
Showing 44 changed files with 282 additions and 1297 deletions
const ssoUrl = '/rop-scrm-sso/router', const ssoUrl = '/rop-scrm-sso/router'
biUrl = 'rop-dj-pe-analysis/router' const biUrl = 'rop-dj-pe-analysis/router'
export default { export default {
login(data = {}) { login(data = {}) {
......
...@@ -21,6 +21,13 @@ export const mobilePages = { ...@@ -21,6 +21,13 @@ export const mobilePages = {
meta: { meta: {
title: '专项任务列表' title: '专项任务列表'
} }
},
{
name: 'teamWork/specialTaskDetail',
path: '/teamWork/specialTaskDetail',
meta: {
title: '专项任务详情'
}
} }
], ],
performance: [ performance: [
...@@ -44,39 +51,3 @@ export const mobilePages = { ...@@ -44,39 +51,3 @@ export const mobilePages = {
} }
] ]
} }
// {
// name: 'recruitManage/recruitManage',
// path: '/recruitManage/recruitManage',
// meta: {
// title: '团队工作台'
// }
// },
// {
// name: 'recruitInsert/recruitInsert',
// path: '/recruitManage/recruitInsert',
// meta: {
// title: '添加招聘需求'
// }
// },
// {
// name: 'recruitDetail/recruitDetail',
// path: '/recruitManage/recruitDetail',
// meta: {
// title: '招聘详情'
// }
// },
// {
// name: 'recruitResult/recruitResult',
// path: '/recruitManage/recruitResult',
// meta: {
// title: '提交成功'
// }
// },
// {
// name: 'recruitmentReview/recruitmentReview',
// path: '/recruitManage/recruitmentReview',
// meta: {
// title: '招聘审核'
// }
// }
// ]
...@@ -24,7 +24,7 @@ function createRouter() { ...@@ -24,7 +24,7 @@ function createRouter() {
return new Router({ return new Router({
// mode: 'history', // 如果是 history模式 需要配置vue.config.js publicPath // mode: 'history', // 如果是 history模式 需要配置vue.config.js publicPath
base: process.env.BASE_URL, base: process.env.BASE_URL,
scrollBehavior: function (to, from, savedPosition) { scrollBehavior: function(to, from, savedPosition) {
return savedPosition || { x: 0, y: 0 } return savedPosition || { x: 0, y: 0 }
}, },
routes routes
......
...@@ -5,7 +5,7 @@ const keepAlives = [] ...@@ -5,7 +5,7 @@ const keepAlives = []
// 合并所有页面配置 // 合并所有页面配置
const pages = { ...mobilePages } const pages = { ...mobilePages }
let routes = [ const routes = [
{ {
path: '/', path: '/',
redirect: '/teamWork/teamList' // 默认重定向到 mobile,或者根据需求改为其他 redirect: '/teamWork/teamList' // 默认重定向到 mobile,或者根据需求改为其他
...@@ -14,13 +14,13 @@ let routes = [ ...@@ -14,13 +14,13 @@ let routes = [
Object.keys(pages).map(parent => { Object.keys(pages).map(parent => {
pages[parent].map(val => { pages[parent].map(val => {
let childrenPath = `${parent}/${val.name}` const childrenPath = `${parent}/${val.name}`
console.log(childrenPath) console.log(childrenPath)
let { meta } = val const { meta } = val
const path = val.path || `/${val.name == 'index' ? parent : childrenPath}` const path = val.path || `/${val.name == 'index' ? parent : childrenPath}`
const name = val.name == 'index' ? parent : val.name const name = val.name == 'index' ? parent : val.name
if (meta && meta.keepAlive) keepAlives.push(name) if (meta && meta.keepAlive) keepAlives.push(name)
let route = { const route = {
component: resolve => require([`views/${childrenPath}.vue`], resolve), component: resolve => require([`views/${childrenPath}.vue`], resolve),
path, path,
name, name,
......
...@@ -24,18 +24,18 @@ const actions = { ...@@ -24,18 +24,18 @@ const actions = {
commit('SET_PAGE_META', meta) commit('SET_PAGE_META', meta)
}, },
registerHttp({}, sessionId = '') { registerHttp({}, sessionId = '') {
let { scrmRequest, djRequest } = window.$fetchConfig const { scrmRequest, djRequest } = window.$fetchConfig
window.$SCRM_HTTP = new Http({ ...scrmRequest, alert: Notify }) window.$SCRM_HTTP = new Http({ ...scrmRequest, alert: Notify })
window.$DJ_HTTP = new Http({ ...djRequest, alert: Notify, headers: { token: sessionId } }) window.$DJ_HTTP = new Http({ ...djRequest, alert: Notify, headers: { token: sessionId }})
}, },
async login({ dispatch }) { async login({ dispatch }) {
console.log('login') console.log('login')
// return // return
try { try {
const wwCode = getParams('code'), const wwCode = getParams('code')
{ corpId, agentId } = util.getLocalStorage('ww_storage_info') || {}, const { corpId, agentId } = util.getLocalStorage('ww_storage_info') || {}
paramsPhone = util.getLocalStorage('ww_params_phone'), const paramsPhone = util.getLocalStorage('ww_params_phone')
{ loginUrl } = window.$fetchConfig const { loginUrl } = window.$fetchConfig
if (wwCode) { if (wwCode) {
const { code, data, message } = await ssoApi.login({ const { code, data, message } = await ssoApi.login({
code: wwCode, code: wwCode,
...@@ -44,17 +44,17 @@ const actions = { ...@@ -44,17 +44,17 @@ const actions = {
}) })
if (code == 0) { if (code == 0) {
if (data.loginList && data.loginList.length) { if (data.loginList && data.loginList.length) {
let [item] = data.loginList const [item] = data.loginList
if (item.loginList && item.loginList.length) { if (item.loginList && item.loginList.length) {
let [userInfo] = item.loginList, const [userInfo] = item.loginList
{ phone } = userInfo const { phone } = userInfo
if (paramsPhone == phone) { if (paramsPhone == phone) {
// const res = await ssoApi.loginByPhone({ // const res = await ssoApi.loginByPhone({
// phone, // phone,
// }) // })
// if (res) { // if (res) {
let route = state.lastPath || '', let route = state.lastPath || ''
[jumpUrl] = window.location.href.split('/#/') const [jumpUrl] = window.location.href.split('/#/')
route = route.replace('.', '/') route = route.replace('.', '/')
util.setLocalStorage('ww_userInfo', userInfo) util.setLocalStorage('ww_userInfo', userInfo)
// util.setSessionId(res.sessionId) // util.setSessionId(res.sessionId)
...@@ -74,8 +74,8 @@ const actions = { ...@@ -74,8 +74,8 @@ const actions = {
} }
}, },
navigation({ dispatch }, to) { navigation({ dispatch }, to) {
let { corpId, agentId, phone, name } = getParams(), const { corpId, agentId, phone, name } = getParams()
userInfo = util.getLocalStorage('ww_userInfo') const userInfo = util.getLocalStorage('ww_userInfo')
if (phone) util.setLocalStorage('ww_params_phone', phone) if (phone) util.setLocalStorage('ww_params_phone', phone)
if (name) util.setLocalStorage('ww_params_name', name) if (name) util.setLocalStorage('ww_params_name', name)
dispatch('registerHttp') dispatch('registerHttp')
...@@ -87,7 +87,7 @@ const actions = { ...@@ -87,7 +87,7 @@ const actions = {
return return
} }
if (corpId) { if (corpId) {
let ww_storage_info = {} const ww_storage_info = {}
ww_storage_info.corpId = corpId ww_storage_info.corpId = corpId
if (agentId && agentId != 'undefined') ww_storage_info.agentId = agentId if (agentId && agentId != 'undefined') ww_storage_info.agentId = agentId
util.setLocalStorage('ww_storage_info', ww_storage_info) util.setLocalStorage('ww_storage_info', ww_storage_info)
...@@ -101,12 +101,12 @@ const actions = { ...@@ -101,12 +101,12 @@ const actions = {
} }
} }
const getParams = name => { const getParams = name => {
let [url, paramsList] = window.location.href.split('?') const [url, paramsList] = window.location.href.split('?')
if (!paramsList) return name ? null : {} if (!paramsList) return name ? null : {}
let param = paramsList.split('&') const param = paramsList.split('&')
let obj = {} const obj = {}
param.map(e => { param.map(e => {
let [key, value] = e.split('=') const [key, value] = e.split('=')
obj[key] = value ? decodeURIComponent(value) : value obj[key] = value ? decodeURIComponent(value) : value
}) })
return name ? obj[name] : obj return name ? obj[name] : obj
......
...@@ -12,4 +12,4 @@ import * as tool from './tools' ...@@ -12,4 +12,4 @@ import * as tool from './tools'
const { debounce, throttle, ...tools } = tool const { debounce, throttle, ...tools } = tool
import * as constants from './constants' import * as constants from './constants'
import store from './store' import store from './store'
export { bus, tools, debounce, throttle, constants, store, util }
\ No newline at end of file \ No newline at end of file
export { bus, tools, debounce, throttle, constants, store, util }
...@@ -27,6 +27,6 @@ export default { ...@@ -27,6 +27,6 @@ export default {
} }
}, },
consts: { consts: {
USER_KEY: 'USER_KEY', USER_KEY: 'USER_KEY'
} }
}
\ No newline at end of file \ No newline at end of file
}
...@@ -133,7 +133,7 @@ export function deepClone(target) { ...@@ -133,7 +133,7 @@ export function deepClone(target) {
// 如果是一个数组的话 // 如果是一个数组的话
if (Array.isArray(target)) { if (Array.isArray(target)) {
result = [] // 将result赋值为一个数组,并且执行遍历 result = [] // 将result赋值为一个数组,并且执行遍历
for (let i in target) { for (const i in target) {
// 递归克隆数组中的每一项 // 递归克隆数组中的每一项
result.push(this.deepClone(target[i])) result.push(this.deepClone(target[i]))
} }
...@@ -146,7 +146,7 @@ export function deepClone(target) { ...@@ -146,7 +146,7 @@ export function deepClone(target) {
} else { } else {
// 否则是普通对象,直接for in循环,递归赋值对象的所有值 // 否则是普通对象,直接for in循环,递归赋值对象的所有值
result = {} result = {}
for (let i in target) { for (const i in target) {
result[i] = this.deepClone(target[i]) result[i] = this.deepClone(target[i])
} }
} }
...@@ -159,7 +159,7 @@ export function deepClone(target) { ...@@ -159,7 +159,7 @@ export function deepClone(target) {
} }
export function fixed(num, decimal) { export function fixed(num, decimal) {
num = num.toString() num = num.toString()
let index = num.indexOf('.') const index = num.indexOf('.')
if (index !== -1) { if (index !== -1) {
num = num.substring(0, decimal + index + 1) num = num.substring(0, decimal + index + 1)
} else { } else {
...@@ -180,11 +180,11 @@ export function transformDecimal(number, i) { ...@@ -180,11 +180,11 @@ export function transformDecimal(number, i) {
// 判断是否为数值型 // 判断是否为数值型
if (!isNaN(num)) { if (!isNaN(num)) {
// 切分整数与小数 // 切分整数与小数
let arr = num.toString().split('.') const arr = num.toString().split('.')
// 是小数且小数位大于保留个数 // 是小数且小数位大于保留个数
if (arr.length > 1 && arr[1].length > i) { if (arr.length > 1 && arr[1].length > i) {
// 小数部分字符串 // 小数部分字符串
let decimal = arr[1].slice(i, i + 1) const decimal = arr[1].slice(i, i + 1)
// toFixed 有 bug,四舍六入五随机 // toFixed 有 bug,四舍六入五随机
// 当四舍五入的数为 5,给其 + 1 // 当四舍五入的数为 5,给其 + 1
if (decimal === '5') { if (decimal === '5') {
...@@ -198,4 +198,4 @@ export function transformDecimal(number, i) { ...@@ -198,4 +198,4 @@ export function transformDecimal(number, i) {
decimalNum = Number(decimalNum).toFixed(i) decimalNum = Number(decimalNum).toFixed(i)
} }
return decimalNum return decimalNum
}
\ No newline at end of file \ No newline at end of file
}
...@@ -9,20 +9,20 @@ import { ...@@ -9,20 +9,20 @@ import {
* let time = new Date().format('yyyy-MM-dd hh:mm:ss') * let time = new Date().format('yyyy-MM-dd hh:mm:ss')
*/ */
Date.prototype.format = function(fmt) { Date.prototype.format = function(fmt) {
let o = { const o = {
'M+': this.getMonth() + 1, //月份 'M+': this.getMonth() + 1, // 月份
'd+': this.getDate(), //日 'd+': this.getDate(), // 日
'h+': this.getHours(), //小时 'h+': this.getHours(), // 小时
'm+': this.getMinutes(), //分 'm+': this.getMinutes(), // 分
's+': this.getSeconds(), //秒 's+': this.getSeconds(), // 秒
//季度 // 季度
'q+': Math.floor((this.getMonth() + 3) / 3), 'q+': Math.floor((this.getMonth() + 3) / 3),
'S': this.getMilliseconds() //毫秒 'S': this.getMilliseconds() // 毫秒
}; }
if (/(y+)/.test(fmt)) { if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
} }
for (let k in o) { for (const k in o) {
if (new RegExp(`(${k})`).test(fmt)) { if (new RegExp(`(${k})`).test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
} }
...@@ -35,14 +35,14 @@ const throttle = (fn, gapTime) => { ...@@ -35,14 +35,14 @@ const throttle = (fn, gapTime) => {
} }
let _lastTime = null let _lastTime = null
return function() { return function() {
let _nowTime = +new Date() const _nowTime = +new Date()
if (_nowTime - _lastTime > gapTime || !_lastTime) { if (_nowTime - _lastTime > gapTime || !_lastTime) {
fn.apply(this, arguments) fn.apply(this, arguments)
_lastTime = _nowTime _lastTime = _nowTime
} }
} }
} }
/**防止重复点击 */ /** 防止重复点击 */
const showLoading = (title = '加载中...', callBack, custom) => { const showLoading = (title = '加载中...', callBack, custom) => {
Toast({ Toast({
type: 'loading', type: 'loading',
...@@ -50,7 +50,7 @@ const showLoading = (title = '加载中...', callBack, custom) => { ...@@ -50,7 +50,7 @@ const showLoading = (title = '加载中...', callBack, custom) => {
forbidClick: true, forbidClick: true,
duration: 0 duration: 0
}) })
if (callBack && typeof callBack == 'function') { if (callBack && typeof callBack === 'function') {
if (!custom) Toast.clear() if (!custom) Toast.clear()
callBack() callBack()
} }
...@@ -58,25 +58,25 @@ const showLoading = (title = '加载中...', callBack, custom) => { ...@@ -58,25 +58,25 @@ const showLoading = (title = '加载中...', callBack, custom) => {
const hideLoading = () => { const hideLoading = () => {
Toast.clear() Toast.clear()
} }
/**num:要转换的数值,fixed:精确几位小数 */ /** num:要转换的数值,fixed:精确几位小数 */
const decimal = (num, fixed) => { const decimal = (num, fixed) => {
let pow = Math.pow(10, fixed) const pow = Math.pow(10, fixed)
return Math.round(num * pow) / pow return Math.round(num * pow) / pow
} }
const showToast = (message = '', callBack) => { const showToast = (message = '', callBack) => {
let params = { const params = {
message, message,
forbidClick: true, forbidClick: true,
duration: 1500 duration: 1500
} }
Toast(params) Toast(params)
if (callBack && typeof callBack == 'function') { if (callBack && typeof callBack === 'function') {
setTimeout(() => { setTimeout(() => {
callBack() callBack()
}, 1500) }, 1500)
} }
} }
/**触摸样式 */ /** 触摸样式 */
const touchstart = e => { const touchstart = e => {
e.target.classList.add('btn-on-leave') e.target.classList.add('btn-on-leave')
} }
...@@ -90,7 +90,6 @@ const setLocalStorage = (key, item) => { ...@@ -90,7 +90,6 @@ const setLocalStorage = (key, item) => {
const getLocalStorage = key => { const getLocalStorage = key => {
return JSON.parse(window.localStorage.getItem(key)) return JSON.parse(window.localStorage.getItem(key))
// return JSON.parse(sessionStorage.getItem(key)) // return JSON.parse(sessionStorage.getItem(key))
} }
const removeLocalStorage = key => { const removeLocalStorage = key => {
window.localStorage.removeItem(key) window.localStorage.removeItem(key)
...@@ -100,28 +99,28 @@ const dialog = (params = {}) => { ...@@ -100,28 +99,28 @@ const dialog = (params = {}) => {
if (!params.confirmButtonColor) params.confirmButtonColor = '#FF7336' if (!params.confirmButtonColor) params.confirmButtonColor = '#FF7336'
return Dialog.confirm(params) return Dialog.confirm(params)
} }
/**拨打电话 */ /** 拨打电话 */
const makePhoneCall = phoneNumber => { const makePhoneCall = phoneNumber => {
window.location.href = `tel://${phoneNumber}` window.location.href = `tel://${phoneNumber}`
} }
/**是否全面屏 */ /** 是否全面屏 */
const isFullSucreen = () => { const isFullSucreen = () => {
let result = false; let result = false
const rate = window.screen.height / window.screen.width const rate = window.screen.height / window.screen.width
let limit = window.screen.height == window.screen.availHeight ? 1.8 : 1.65 // 临界判断值 const limit = window.screen.height == window.screen.availHeight ? 1.8 : 1.65 // 临界判断值
result = rate > limit result = rate > limit
return result return result
} }
const jumpChildrenPage = (to, params) => { const jumpChildrenPage = (to, params) => {
let { name } = window.vm._route const { name } = window.vm._route
window.vm.$router.push({ name: `${name}.${to}`, params }) window.vm.$router.push({ name: `${name}.${to}`, params })
} }
/**拷贝 */ /** 拷贝 */
const setClipboardData = data => { const setClipboardData = data => {
let transfer = document.createElement('input') const transfer = document.createElement('input')
document.body.appendChild(transfer) document.body.appendChild(transfer)
transfer.value = data transfer.value = data
transfer.focus() transfer.focus()
...@@ -132,7 +131,7 @@ const setClipboardData = data => { ...@@ -132,7 +131,7 @@ const setClipboardData = data => {
document.body.removeChild(transfer) document.body.removeChild(transfer)
} }
/**接口请求时失败让用户刷新 */ /** 接口请求时失败让用户刷新 */
const refreshPage = (message = '系统异常') => { const refreshPage = (message = '系统异常') => {
return Dialog.alert({ return Dialog.alert({
message, message,
...@@ -142,12 +141,12 @@ const refreshPage = (message = '系统异常') => { ...@@ -142,12 +141,12 @@ const refreshPage = (message = '系统异常') => {
}) })
} }
const toTop = () => { const toTop = () => {
let bodySrcollTop = document.body.scrollTop const bodySrcollTop = document.body.scrollTop
if (bodySrcollTop !== 0) { if (bodySrcollTop !== 0) {
document.body.scrollTop = 0 document.body.scrollTop = 0
return return
} }
let docSrcollTop = document.documentElement.scrollTop const docSrcollTop = document.documentElement.scrollTop
if (docSrcollTop !== 0) { if (docSrcollTop !== 0) {
document.documentElement.scrollTop = 0 document.documentElement.scrollTop = 0
} }
...@@ -156,12 +155,12 @@ const getParams = () => { ...@@ -156,12 +155,12 @@ const getParams = () => {
return window.vm.$route.params return window.vm.$route.params
} }
const getQuery = (name) => { const getQuery = (name) => {
let [url, paramsList] = window.location.href.split('?') const [url, paramsList] = window.location.href.split('?')
if (!paramsList) return name ? null : {} if (!paramsList) return name ? null : {}
let param = paramsList.split('&') const param = paramsList.split('&')
let obj = {} const obj = {}
param.map(e => { param.map(e => {
let [key, value] = e.split('=') const [key, value] = e.split('=')
obj[key] = value obj[key] = value
}) })
return name ? obj[name] : obj return name ? obj[name] : obj
...@@ -203,4 +202,4 @@ const utils = { ...@@ -203,4 +202,4 @@ const utils = {
Object.keys(utils).map(key => { Object.keys(utils).map(key => {
Vue.prototype[key] = utils[key] Vue.prototype[key] = utils[key]
}) })
export default utils
\ No newline at end of file \ No newline at end of file
export default utils
const djStaffUrl = '/rop-dj-staff-miniprogram/router'
const djBusinessUrl = '/rop-dj-business-school-miniprogram/router'
const djSmartCarlifeUrl = '/dj.api.smartcarlife' // Just a guess, checking previous api.js usage
import { util } from 'utils'
// Helper function to simulate api.post from the original file using window.$DJ_HTTP
// Original: api.post(method, data, [], url)
function post(method, data = {}, url, options = {}) {
// Merge method into data as per ssoApi.js pattern for $DJ_HTTP
const payload = {
method,
technicalSupervisorName: util.getLocalStorage('ww_params_name') || '', // 技术督导姓名
technicalSupervisorPhone: util.getLocalStorage('ww_params_phone') || '', // 技术督导手机号
// sessionId: '8bcad25d-8bfa-41a8-a5e8-ef06ace89ee8',
...data
}
return window.$DJ_HTTP({
url,
data: payload,
...options
})
}
export default {
// 获取招聘管理列表数据
getRecruitList(data) {
// return post('dj.api.staff.h5.recruitment.page', data, djStaffUrl)
return post('dj.api.staff.h5.recruitment.demand.technicalSupervisor.page', data, djStaffUrl)
},
// 获取招聘管理详情
getRecruitDetailAPI(data) {
// http://192.168.1.86:8594/rop-dj-staff-miniprogram/router/dj.api.staff.h5.recruitment.demand.technicalSupervisor.demand.detail/1.0.0
return post('dj.api.staff.h5.recruitment.demand.technicalSupervisor.demand.detail', data, djStaffUrl, { hideloading: true })
},
// 处理简历
processResumeAPI(data) {
return post('dj.api.staff.h5.recruitment.resume.technicalSupervisor.process', data, djStaffUrl)
// return post('dj.api.staff.h5.recruitment.resume.process', data, djStaffUrl)
},
// 招聘需求-确认/驳回
// http://192.168.1.86:8594/rop-dj-staff-miniprogram/router/dj.api.staff.h5.recruitment.demand.technicalSupervisor.status.update/1.0.0
updateDemandStatusAPI(data) {
return post('dj.api.staff.h5.recruitment.demand.technicalSupervisor.status.update', data, djStaffUrl)
},
// 招聘需求-统计
// http://192.168.1.86:8594/rop-dj-staff-miniprogram/router/dj.api.staff.h5.recruitment.demand.technicalSupervisor.stat/1.0.0
getDemandStatAPI(data) {
return post('dj.api.staff.h5.recruitment.demand.technicalSupervisor.stat', data, djStaffUrl)
},
// 获取招聘需求-审核详情
getDemandCheckDetailAPI(data) {
return post('dj.api.staff.h5.recruitment.demand.technicalSupervisor.demand.checkDetail', data, djStaffUrl)
},
// 招聘管理门店列表
// getDemandStoreListAPI(data) {
// return post('dj.api.staff.h5.recruitment.demand.store.list', data, djStaffUrl)
// },
// // 招聘管理字典查询
// getStaffDictListAPI(data) {
// return post('dj.api.staff.h5.dict.list', data, djStaffUrl)
// },
// /** 待处理招聘统计 */
// waitstaffstateAPI(data) {
// return post('dj.api.staff.h5.recruitment.demand.stat', data, djStaffUrl)
// },
// /** 添加招聘需求 */
// addStaffDictListAPI(data) {
// return post('dj.api.staff.h5.recruitment.demand.add', data, djStaffUrl)
// },
// /** 确认招聘需求 flag? */
// confiremStaffFlagAPI(data) {
// return post('dj.api.staff.h5.recruitment.confirm', data, djStaffUrl)
// },
// // 获取带教任务数量
// getMentorShipTaskNum(data) {
// return post('dj.api.businessSchool.miniProgram.teachTask.count', data, djBusinessUrl)
// },
// 根据商户号获取可选商品列表
getSelectOrderGoodsList(data) {
// Assuming default gateway if no URL specified
return post('dj.api.smartcarlife.selectOrderGoods.list', data, '')
},
// 更新施图
updateCustomerphotos(data) {
return post('dj.api.smartcarlife.updateCustomerphotos', data, '')
},
// 技师施工图片审批
technicianApprove(data) {
return post('dj.api.smartcarlife.technician.approve', data, '')
},
// 退款审批列表查询
getRefundReviewListAPI(data) {
return post('dj.api.smartcarlife.refundApplyRecord.waitForAudit.list', data, '')
},
// 日报填报前参数校验
dailyReportCheck(data) {
return post('dj.api.smartcarlife.staff.daily.report.data.check', data, '')
}
}
{
"navigationBarTitleText": "招聘详情",
"disableScroll": false,
"usingComponents": {
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-popup": "@vant/weapp/popup/index",
"empty-card": "../components/emptyCard/emptyCard"
}
}
\ No newline at end of file \ No newline at end of file
export const supportTypeList = [
{
confId: 0,
confName: '新店启动'
},
{
confId: 1,
confName: '老店业绩提升-渗透率过低'
},
{
confId: 2,
confName: '老店业绩提升-客单价过低'
}
]
export const statusList = [
{
confId: 0,
confName: '待人事确认'
},
{
confId: 1,
confName: '招聘中'
},
{
confId: 2,
confName: '已完成'
},
{
confId: 3,
confName: '已驳回'
},
{
confId: 4,
confName: '待督导确认'
}
]
export const mentorshipFormData = [
{
label: '招聘数量',
name: 'recruitmentQuantity',
labelName: 'recruitmentQuantity',
disabled: true
},
{
label: '业务类型',
name: 'businessTypeName',
labelName: 'businessTypeName',
disabled: true
},
{
label: '招聘类型',
name: 'recruitmentTypeName',
labelName: 'recruitmentTypeName',
disabled: true
}
]
export const formRule = {
supportWay: [{ required: true, message: '支援方式不能为空' }],
storeType: [{ required: true, message: '门店类型不能为空' }],
businessType: [{ required: true, message: '业务类型1不能为空' }],
saleType: [{ required: true, message: '业务类型2不能为空' }],
teachStartTime: [{ required: true, message: '开始带教时间不能为空' }],
problemDescription: [{ required: true, message: '门店现存问题不能为空' }],
solutionDescription: [{ required: true, message: '预估解决方案不能为空' }]
}
export const checkRequired = function (obj, formRule) {
let target = Object.keys(formRule)
console.log(target)
for (let i = 0; i < target.length; i++) {
let attr = target[i]
let item = formRule[attr]
let requirObj = item.find(k => k.required == true)
let validFn = item.find(k => k.validator)
if (requirObj && (obj[attr] ?? '') === '') {
return {
...requirObj,
attr
}
}
if (validFn) {
let validObj = validFn.validator({}, obj[attr])
if (validObj) {
return {
...validObj,
attr
}
}
}
}
return false
}
// export const getConfName = function (dataList, confId) {
// const confIdStr = `${confId}`?.split(',')
// let result = confIdStr?.map(v => {
// const found = dataList?.find(item => item.confId == v)
// return found?.confName
// })
// return result?.length ? result.join(',') : '-'
// }
export const getStatusName = function (status) {
const found = statusList?.find(item => item.confId == status)
return found?.confName || '-'
}
// 获取状态提示文本
export const getStatusTipText = function (item) {
const { status, waitProcessResumeCount, confirmFlag, trialWaitConfirmCount, onboardingWaitConfirmCount } = item
// 待处理提示文案显示逻辑
if (status == 1 && waitProcessResumeCount > 0) {
return `您有${waitProcessResumeCount}份简历待处理,请及时跟进`
} else if (status == 1 && trialWaitConfirmCount > 0) {
return '您有新的试岗记录,请及时查看'
} else if (status == 1 && onboardingWaitConfirmCount > 0) {
return '您有新的入职记录,请及时查看'
} else if (status == 2 && confirmFlag == 'N') {
return '您的招聘需求已完成,请及时查看'
} else if (status == 3 && confirmFlag == 'N') {
return '您的招聘需求已拒绝,请及时查看'
}
return null
}
import {
mentorshipFormData,
getStatusName,
getStatusTipText
} from './constantData'
import { getRecruitList, waitstaffstateAPI, confiremStaffFlagAPI } from '../api'
const IMG_URL =
'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
list: [],
tabList: [],
pageSize: 10,
currentPage: 1,
mentorshipFormData,
triggered: false,
nothing: false,
userInfo: {},
tabIndex: 0,
btnVisible: true, // 按钮是否显示
lastScrollTop: 0, // 上次滚动位置
scrollThreshold: 50, // 滚动阈值(px)
scrollTimer: null // 滚动停止定时器
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let { mentorshipFormData } = this.data
let userInfo = wx.$util.getUserInfo()
this.getWaitstaffstate()
this.search()
// 非区域运营登录,打回到首页
//ll if (userInfo?.loginRole != 3) wx.reLaunch({ url: "/pages/loading/loading" })
if (userInfo?.isSuper) {
let index = mentorshipFormData?.findIndex(
v => v.name == 'flightSupervisorName'
)
this.setData({
mentorshipFormData
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.getWaitstaffstate()
this.search()
},
onBottomRefresh() {
this.getList()
},
// 获取招聘任务统计数据
getWaitstaffstate() {
waitstaffstateAPI({}).then(res => {
let { code, data, message } = res
if (code == 0) {
this.setData({
tabList: [
`待我处理(${data.waitProcessCount})`,
`全部(${data.totalCount})`
]
})
} else {
// wx.$util.showToast(message)
}
})
},
// 标签切换
tabClick(e) {
this.setData(
{
tabIndex: e.detail,
list: []
},
() => {
this.search()
this.getWaitstaffstate()
}
)
},
// 搜索
search() {
this.setData({
nothing: false,
currentPage: 1
})
this.getList()
},
// 获取列表数据
getList() {
let { tabIndex, pageSize, currentPage, nothing } = this.data
if (nothing) return
wx.showLoading({
title: '加载中'
})
getRecruitList({
pageSize,
pageNum: currentPage,
onlyWaiting: !!!tabIndex // boolean类型转换
}).then(res => {
wx.hideLoading()
if (res.code == '0') {
let { list, pages } = res.data
// 为列表数据添加状态名称和提示文本
list = list.map(item => {
const tipText = getStatusTipText(item)
return {
...item,
statusName: getStatusName(item.status),
showTip: !!tipText, // 是否显示提示
tipText: tipText || '' // 提示文本
}
})
this.setData({
[`list[${currentPage - 1}]`]: list,
currentPage: currentPage + 1,
nothing: currentPage == pages,
triggered: false
})
} else {
this.setData({
list: [],
nothing: false
})
wx.$util.showToast(res.message || '接口异常')
}
})
},
// 跳转详情
handleDetail(e) {
// 节流控制:2秒内只能触发一次
const now = Date.now()
const throttleTime = 2000 // 节流时间:2秒
if (this.lastDetailTime && now - this.lastDetailTime < throttleTime) {
return
}
this.lastDetailTime = now
const { item } = e.currentTarget.dataset
wx.$router.go(
'/packageEquity/pages/recruitManage/recruitDetail/recruitDetail',
{
id: item.id
}
)
//仅已完成/以驳回可以调用flag接口
if (item.status == 0 || item.status == 1) return
confiremStaffFlagAPI({ id: item.id }).then(res => {
let { code } = res
if (code == 0) {
this.getWaitstaffstate()
this.search()
}
})
},
// 跳转添加招聘页面
handleInsertRecruit() {
wx.$router.go(
'/packageEquity/pages/recruitManage/recruitInsert/recruitInsert'
)
},
/**
* 处理滚动事件
* 监听向上滚动时隐藏按钮,滚动停止1秒后重新显示按钮
*/
handleScroll(e) {
const { scrollTop } = e.detail
const { lastScrollTop, scrollThreshold, btnVisible, scrollTimer } =
this.data
// 清除之前的定时器
if (scrollTimer) {
clearTimeout(scrollTimer)
}
// 计算滚动方向和距离
const scrollDistance = Math.abs(scrollTop - lastScrollTop)
// 只有滚动距离超过阈值才触发显隐逻辑,避免频繁切换
if (scrollDistance > scrollThreshold) {
// 向上滑动(scrollTop 增大)- 隐藏按钮
if (scrollTop > lastScrollTop && btnVisible) {
this.setData({
btnVisible: false
})
}
// 向下滑动(scrollTop 减小)- 隐藏按钮
else if (scrollTop < lastScrollTop && btnVisible) {
this.setData({
btnVisible: false
})
}
// 更新上次滚动位置
this.setData({
lastScrollTop: scrollTop
})
}
// 在顶部时始终显示按钮
if (scrollTop <= 0) {
if (!btnVisible) {
this.setData({
btnVisible: true,
lastScrollTop: 0
})
}
return
}
// 设置定时器:滚动停止2秒后显示按钮
const timer = setTimeout(() => {
this.setData({
btnVisible: true
})
}, 1000)
this.setData({
scrollTimer: timer
})
},
// 生命周期函数--监听页面隐藏
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
// 清理定时器
if (this.data.scrollTimer) {
clearTimeout(this.data.scrollTimer)
}
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
})
{
"navigationBarTitleText": "招聘管理",
"enablePullDownRefresh": false,
"onReachBottomDistance": 50,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* tabWorkOrder/pages/mentorshipManage/mentorshipManage.wxss */
page {
background: #F7F8FA;
height: 100%;
overflow: hidden;
}
.container_page {
height: 100%;
overflow: hidden;
// 顶部Tab模块
.top_content {
background: #FFFFFF;
padding-top: var(--fontSize24);
box-sizing: border-box;
.user_box {
display: flex;
align-items: center;
margin-bottom: var(--fontSize28);
padding: 0 var(--fontSize32);
.user_avatar {
width: var(--fontSize48);
height: var(--fontSize48);
border-radius: 50%;
overflow: hidden;
}
.user_name {
margin-left: var(--fontSize12);
font-weight: 600;
font-size: var(--fontSize32);
color: #292D33;
}
.user_tips {
margin-left: var(--fontSize4);
padding: 0 var(--fontSize8);
height: var(--fontSize36);
font-size: var(--fontSize20);
color: #347BFF;
background: #EAF1FF;
border-radius: var(--fontSize4);
text-align: center;
line-height: var(--fontSize36);
}
}
.tips_box {
height: var(--fontSize56);
background: #FFF5E6;
border-radius: var(--fontSize8);
display: flex;
align-items: center;
padding: 0 var(--fontSize28);
margin: 0 var(--fontSize32) var(--fontSize20) var(--fontSize32);
.tipsIcon {
width: var(--fontSize28);
height: var(--fontSize28);
margin-right: var(--fontSize8);
}
.contentText {
font-size: var(--fontSize24);
color: #FF9D0A;
}
}
.tab_box {
margin: 0 var(--fontSize-32);
position: relative;
}
}
// 列表模块
.content {
padding-top: var(--fontSize24);
height: calc(100vh - var(--fontSize120));
box-sizing: border-box;
.list {
height: 100%;
.item {
margin: 0 var(--fontSize20) var(--fontSize24) var(--fontSize20);
border-radius: var(--fontSize16);
background: #ffffff;
box-shadow: 0 var(--fontSize4) var(--fontSize16) 0 #cdcdd180;
padding: var(--fontSize24);
.item_header {
display: flex;
align-items: center;
margin-bottom: var(--fontSize4);
justify-content: space-between;
.ji {
display: inline-block;
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
}
.merchant-name {
flex: 1;
min-width: 0;
font-size: var(--fontSize30);
color: #292D33;
font-weight: 600;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-right: var(--fontSize16);
}
.status-tag {
font-size: var(--fontSize24);
border-radius: var(--fontSize4);
padding: var(--fontSize4) var(--fontSize8);
font-weight: 400;
// 待人事确认 status = 0
&.status-0 {
color: #347bff;
background: #eaf1ff;
}
// 招聘中 status = 1
&.status-1 {
color: #ff9d0a;
background: #fff5e6;
}
// 已完成 status = 2
&.status-2 {
color: #35c376;
background: #eaf9f1;
}
// 已驳回 status = 3
&.status-3 {
color: #f24724;
background: #fdece9;
}
}
.icon {
width: var(--fontSize32);
height: var(--fontSize32);
margin-right: var(--fontSize12);
}
}
.item_content {
box-sizing: border-box;
display: flex;
color: #292D33;
padding-top: var(--fontSize17);
.label {
flex-shrink: 0;
width: var(--fontSize144);
margin-right: var(--fontSize16);
font-size: var(--fontSize28);
color: #999EA8;
}
.value {
word-break: break-all;
font-size: var(--fontSize28);
}
}
.item_footer {
display: flex;
justify-content: flex-end;
align-items: center;
font-size: var(--fontSize24);
color: #9B9B9E;
padding-top: var(--fontSize20);
.msg_tips {
width: var(--fontSize662);
height: var(--fontSize72);
border-radius: var(--fontSize16);
background: #f7f7f7;
color: #292d33;
font-size: var(--fontSize28);
text-align: left;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 var(--fontSize32);
.arrow_right {
width: var(--fontSize12);
height: var(--fontSize21);
}
}
}
}
.super_item {
padding-bottom: var(--fontSize32);
}
}
// 空数据占位
.no_data {
height: 100%;
}
}
// 新增需求按钮
.insert_btn {
display: grid;
place-items: center;
color: #347bff;
width: var(--fontSize136);
height: var(--fontSize136);
font-size: var(--fontSize24);
border-radius: var(--fontSize15);
position: fixed;
-webkit-tap-highlight-color: transparent; //元素默认高亮背景设置
right: var(--fontSize40);
bottom: var(--fontSize468);
background: #ffffffcc;
text-align: center;
box-shadow: 0 var(--fontSize4) var(--fontSize18) 0 #0000001a;
transition: all 0.3s ease-in-out;
.label {
width: var(--fontSize114);
margin-top: -8px;
line-height: var(--fontSize34);
}
.insert_icon {
width: var(--fontSize54);
height: var(--fontSize54);
}
// 显示状态
&.btn-visible {
transform: translateX(0);
opacity: 1;
}
// 隐藏状态 - 向右滑出并淡出
&.btn-hidden {
transform: translateX(calc(100% + var(--fontSize40)));
opacity: 0;
}
}
// 触底提示
.list-nothing {
color: #999ea8;
font-size: var(--fontSize20);
text-align: center;
padding: 0 0 var(--fontSize60) 0;
}
}
.arrowIcon {
position: fixed;
right: 0;
bottom: var(--fontSize468);
width: var(--fontSize36);
height: var(--fontSize136);
background: #FFFFFF;
border: var(--fontSize2) solid #EFF0F2;
box-shadow: 0 var(--fontSize4) var(--fontSize20) 0 #0000001a;
border-radius: var(--fontSize16) 0 0 var(--fontSize16);
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease-in-out;
// 显示状态 - 从右侧滑入
&.arrow-visible {
transform: translateX(0);
opacity: 1;
}
// 隐藏状态 - 向右滑出
&.arrow-hidden {
transform: translateX(100%);
opacity: 0;
pointer-events: none; // 隐藏时禁止点击
}
.image {
width: var(--fontSize32);
height: var(--fontSize32);
}
}
<!-- 招聘管理 -->
<glsx-privacy appletName="招聘管理" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<view class="container_page">
<!-- 顶部Tab模块 -->
<view class="top_content" wx:if="{{ tabList.length }}">
<view class="tab_box">
<tab-bar tabList="{{ tabList }}" bindclick="tabClick" activeIndex="{{ tabIndex }}" />
</view>
</view>
<!-- 列表模块 -->
<view class="content">
<scroll-view
scroll-y
enable-back-to-top
refresher-enabled="{{ true }}"
bindrefresherrefresh="search"
bindscrolltolower="onBottomRefresh"
bindscroll="handleScroll"
class="list"
scroll-top="{{ scrollTop }}"
lower-threshold="400"
refresher-threshold="104"
refresher-triggered="{{ triggered }}"
>
<!-- 需求列表 -->
<block wx:if="{{ list.length && list[0].length }}">
<block wx:for="{{ list }}" wx:key="ind" wx:for-item="i" wx:for-index="ind">
<view
wx:for="{{ i }}"
wx:key="index"
class="item {{ userInfo.isSuper ? 'super_item' : '' }}"
bind:tap="handleDetail"
data-item="{{ item }}"
>
<view class="item_header">
<image wx:if="{{ item.urgent == 1 }}" class="ji" src="{{ IMG_URL }}miniProgram/ji.png" mode="aspectFill"></image>
<text class="merchant-name">{{item.merchantName}}</text>
<text class="status-tag status-{{ item.status }}">{{item.statusName}}</text>
</view>
<view class="item_content" wx:for="{{ mentorshipFormData }}" wx:for-item="it" wx:for-index="subInd" wx:key="subInd">
<block>
<view class="label">{{it.label}}</view>
<view class="value">
{{item[it.labelName] || '-'}}
<text wx:if="{{ it.label == '招聘数量' }}">人</text>
</view>
</block>
</view>
<!-- 提示消息 -->
<view class="item_footer" wx:if="{{ tabIndex == 0 && item.showTip && item.confirmFlag == 'N' && item.status !== 0 }}">
<view class="msg_tips">
<text>{{item.tipText}}</text>
<image class="arrow_right" src="/packageEquity/pages/image/arrow-right.png" mode="aspectFill" />
</view>
</view>
</view>
</block>
<block wx:if="{{ nothing }}">
<view class="list-nothing">没有更多了</view>
</block>
</block>
<!-- 空数据占位 -->
<view class="no_data" wx:else>
<empty-data />
</view>
</scroll-view>
</view>
<!-- 添加招聘按钮 -->
<view class="insert_btn {{ btnVisible ? 'btn-visible' : 'btn-hidden' }}" bindtap="handleInsertRecruit">
<image class="insert_icon" src="/packageEquity/pages/image/recruit-insert.png" mode="widthFix" />
<view class="label">
<text>添加招聘</text>
<text>需求</text>
</view>
</view>
<!-- 箭头图标 - 与按钮互斥显示 -->
<view class="arrowIcon {{ btnVisible ? 'arrow-hidden' : 'arrow-visible' }}">
<image class="image" src="{{ IMG_URL }}upgrade/arrow-left.png" />
</view>
</view>
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/recruitManage/recruitResult/recruitResult.js
import constantData from '~/pages/constant/data'
Page({
/**
* 页面的初始数据
*/
data: {
sceneType: null, // 当前场景类型
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// 获取当前用户的场景类型
const userInfo = wx.$util.getUserInfo()
this.setData({
sceneType: userInfo?.sceneType
})
},
// 继续添加需求
continueAdd() {
wx.$router.reLaunch(`recruitInsert`);
},
// 返回招聘列表
backToList() {
wx.$router.reLaunch(`recruitManage`);
},
// 返回首页
backToHome() {
const { sceneType } = this.data
// 根据场景类型跳转到对应的首页
// 场景类型:0-会员权益/升级,1-精品升级,2-次新车转化,3-售后众筹
const scenePageMap = constantData.pageUrl
const targetPage = scenePageMap[sceneType] || 'tabIndex.index'
wx.$router.reLaunch(targetPage, {});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "提交成功",
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* pages/statePage/state.wxss */
.container {
display: flex;
justify-content: center;
height: 100vh;
width: 100%;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
width: 80%;
}
.icon {
width: 200px;
height: 200px;
opacity: 1;
background: #ffffff;
margin-bottom: 30px;
margin-top: var(--fontSize64);
}
.text {
width: 80px;
height: 28px;
opacity: 1;
color: #292d33;
font-size: 20px;
font-weight: 600;
font-family: "PingFang SC", sans-serif;
text-align: center;
margin-bottom: 15px;
}
.sub_text {
font-size: var(--fontSize28);
text-align: center;
margin-bottom: 40px;
width: 90%;
line-height: 1.5;
color: #7a8299;
}
.btn,
.btn-secondary {
width: 261px;
height: 40px;
border-radius: 6px;
opacity: 1;
font-size: 16px;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 15px;
}
.btn {
border: 1px solid #347bff;
background: #347bff;
color: #ffffff;
}
.btn-secondary {
border: 1px solid #f4f5f7;
background: #f4f5f7;
color: #292d33;
}
.back_btn {
color: #347BFF;
font-size: 14px;
padding: 10px;
margin-top: 10px;
}
\ No newline at end of file \ No newline at end of file
<template>
<div class="recruit-result">
<div class="content">
<van-icon name="checked" color="#07c160" size="100" class="icon" />
<div class="text">提交成功</div>
<div class="sub_text">人事同事正在加急处理您的用人需求,请耐心等待,进度可及时关注企微提醒。</div>
<div class="btn" @click="continueAdd">继续添加需求</div>
<div class="btn btn-secondary" @click="backToList">返回招聘列表</div>
<div class="back_btn" @click="backToHome">返回首页</div>
</div>
</div>
</template>
<script>
export default {
name: 'RecruitResult',
data() {
return {
sceneType: null
}
},
created() {
// Mock user info or get from store
// const userInfo = this.$store.getters.userInfo
// this.sceneType = userInfo?.sceneType
},
methods: {
continueAdd() {
this.$router.replace({ name: 'recruitInsert/recruitInsert' })
},
backToList() {
this.$router.replace({ name: 'recruitManage/recruitManage' })
},
backToHome() {
// Logic from original file:
// const scenePageMap = constantData.pageUrl
// const targetPage = scenePageMap[this.sceneType] || 'tabIndex.index'
// For now, just go to root or a default home
this.$router.push('/')
}
}
}
</script>
<style lang="scss" scoped>
.recruit-result {
display: flex;
justify-content: center;
height: 100vh;
width: 100%;
background: #ffffff;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
width: 80%;
padding-top: 64px;
}
.icon {
margin-bottom: 30px;
}
.text {
height: 28px;
color: #292d33;
font-size: 20px;
font-weight: 600;
text-align: center;
margin-bottom: 15px;
}
.sub_text {
font-size: 14px;
text-align: center;
margin-bottom: 40px;
width: 90%;
line-height: 1.5;
color: #7a8299;
}
.btn,
.btn-secondary {
width: 261px;
height: 40px;
border-radius: 6px;
font-size: 16px;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 15px;
cursor: pointer;
}
.btn {
border: 1px solid #347bff;
background: #347bff;
color: #ffffff;
}
.btn-secondary {
border: 1px solid #f4f5f7;
background: #f4f5f7;
color: #292d33;
}
.back_btn {
color: #347bff;
font-size: 14px;
padding: 10px;
margin-top: 10px;
cursor: pointer;
}
</style>
<!--index.wxml-->
<view class="container">
<view class="content">
<image class="icon" src="/packageEquity/pages/image/success-icon.png" mode="aspectFill"/>
<view class="text">提交成功</view>
<view class="sub_text">人事同事正在加急处理您的用人需求,请耐心等待,进度可及时关注企微提醒。</view>
<view class="btn" bind:tap="continueAdd">继续添加需求</view>
<view class="btn btn-secondary" bind:tap="backToList">返回招聘列表</view>
<view class="back_btn" bind:tap="backToHome">返回首页</view>
</view>
</view>
<template>
<div class="special-task-detail-page">
<van-nav-bar title="专项任务详情" left-arrow @click-left="onClickLeft" fixed placeholder class="navigation-header" />
<div class="detail-container">
<div class="card basic-info-card">
<div class="card-header">
<span class="merchant-name">{{ task.merchantName }}</span>
<span class="status-tag" :style="{ color: getStatus(task.taskStatus).color, background: getStatus(task.taskStatus).background }">
{{ getStatus(task.taskStatus).name }}
</span>
</div>
<div class="card-body">
<div class="info-row" v-if="task.taskDesc">
<van-icon name="orders-o" class="icon" />
<div class="content-wrapper">
<span class="label">事项描述:</span>
<span class="value">{{ task.taskDesc }}</span>
</div>
</div>
<div class="info-row" v-if="task.taskStatus === 2 ? task.updatedDate : task.createTime">
<van-icon name="clock-o" class="icon" />
<div class="content-wrapper">
<span class="label">{{ task.taskStatus === 2 ? '完成时间:' : '创建时间:' }}</span>
<span class="value">{{ task.taskStatus === 2 ? task.updatedDate : task.createTime }}</span>
</div>
</div>
</div>
</div>
<div class="card task-context-card">
<div class="card-title">
专项任务 <span class="required">*</span>
</div>
<div class="card-content">{{ task.taskContext || '暂无内容' }}</div>
</div>
</div>
</div>
</template>
<script>
import constantData from './constantData.js'
export default {
name: 'SpecialTaskDetail',
data() {
return {
task: {}
}
},
created() {
try {
const storedItem = sessionStorage.getItem('specialTaskDetailItem')
if (storedItem) {
this.task = JSON.parse(storedItem)
}
} catch (e) {
console.error('Failed to parse special task detail item', e)
}
},
methods: {
onClickLeft() {
this.$router.go(-1)
},
getStatus(status) {
return constantData.STATUS_MAP[status] || { name: '未知', color: '#999999', background: '#f5f5f5' }
}
}
}
</script>
<style lang="scss" scoped>
.special-task-detail-page {
background: #f2f3f7;
min-height: 100vh;
box-sizing: border-box;
padding-bottom: env(safe-area-inset-bottom);
.navigation-header {
:deep(.van-nav-bar__title) {
font-size: var(--fontSize34, 17px);
color: #000000E5;
font-weight: 600;
}
:deep(.van-icon) {
color: #000000E5;
}
}
.detail-container {
padding: 12px;
.card {
background: #ffffff;
border-radius: 8px;
padding: 16px;
margin-bottom: 12px;
}
.basic-info-card {
.card-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 16px;
.merchant-name {
font-size: 16px;
font-weight: 500;
color: #000000E5;
flex: 1;
margin-right: 12px;
line-height: 22px;
}
.status-tag {
font-size: 10px;
padding: 2px 6px;
border-radius: 4px;
flex-shrink: 0;
margin-top: 2px;
}
}
.card-body {
.info-row {
display: flex;
align-items: flex-start;
margin-bottom: 12px;
font-size: 12px;
color: #00000066;
line-height: 18px;
&:last-child {
margin-bottom: 0;
}
.icon {
margin-top: 2px;
margin-right: 6px;
font-size: 14px;
color: #00000042;
}
.content-wrapper {
flex: 1;
word-break: break-all;
white-space: pre-wrap;
.label {
display: inline;
}
.value {
display: inline;
}
}
}
}
}
.task-context-card {
.card-title {
font-size: 14px;
font-weight: 500;
color: #000000E5;
margin-bottom: 12px;
.required {
color: #F24724;
}
}
.card-content {
font-size: 14px;
color: #00000066;
line-height: 22px;
word-break: break-all;
white-space: pre-wrap;
}
}
}
}
</style>
...@@ -15,8 +15,10 @@ ...@@ -15,8 +15,10 @@
<template v-for="(item, i) in cardConfig"> <template v-for="(item, i) in cardConfig">
<div class="info-row" v-if="item.isShow(task)" :key="i"> <div class="info-row" v-if="item.isShow(task)" :key="i">
<van-icon :name="item.icon" class="icon" /> <van-icon :name="item.icon" class="icon" />
<span class="label">{{ item.getLabel(task) }}</span> <div class="content-wrapper">
<span class="value">{{ item.getValue(task) }}</span> <span class="label">{{ item.getLabel(task) }}</span>
<span class="value">{{ item.getValue(task) }}</span>
</div>
</div> </div>
</template> </template>
</div> </div>
...@@ -55,6 +57,9 @@ export default { ...@@ -55,6 +57,9 @@ export default {
} catch (e) { } catch (e) {
console.error('Failed to parse item data', e) console.error('Failed to parse item data', e)
} }
// 每次进入列表页时,清理掉详情页的临时缓存数据
sessionStorage.removeItem('specialTaskDetailItem')
}, },
methods: { methods: {
onClickLeft() { onClickLeft() {
...@@ -64,8 +69,8 @@ export default { ...@@ -64,8 +69,8 @@ export default {
return constantData.STATUS_MAP[status] || { name: '未知', color: '#999999', background: '#f5f5f5' } return constantData.STATUS_MAP[status] || { name: '未知', color: '#999999', background: '#f5f5f5' }
}, },
viewDetail(task) { viewDetail(task) {
console.log('查看详情', task) sessionStorage.setItem('specialTaskDetailItem', JSON.stringify(task))
// TODO: 跳转到具体的专项任务详情 this.$router.push({ path: '/teamWork/specialTaskDetail' })
} }
} }
} }
...@@ -125,7 +130,7 @@ export default { ...@@ -125,7 +130,7 @@ export default {
.card-body { .card-body {
.info-row { .info-row {
display: flex; display: flex;
align-items: center; align-items: flex-start;
margin-bottom: 10px; margin-bottom: 10px;
font-size: 12px; font-size: 12px;
color: #00000066; color: #00000066;
...@@ -135,21 +140,25 @@ export default { ...@@ -135,21 +140,25 @@ export default {
} }
.icon { .icon {
margin-top: 2px;
margin-right: 6px; margin-right: 6px;
font-size: 14px; font-size: 14px;
color: #00000042; color: #00000042;
} }
.label { .content-wrapper {
flex-shrink: 0;
}
.value {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
.label {
display: inline;
}
.value {
display: inline;
}
} }
} }
} }
......
...@@ -125,13 +125,16 @@ export default { ...@@ -125,13 +125,16 @@ export default {
computedStaticList() { computedStaticList() {
const { completed, partial, unfinished } = constantData.STATIC_CARD_MAP const { completed, partial, unfinished } = constantData.STATIC_CARD_MAP
// 专项督办(tabIndex === 3)仅展示已完成和未完成 // 专项督办(tabIndex === 3)仅展示已完成和未完成
return this.tabIndex == 3 ? [completed, unfinished] : [completed, partial, unfinished] return this.tabIndex === 3 ? [completed, unfinished] : [completed, partial, unfinished]
} }
}, },
mounted() { mounted() {
this.userInfo = (this.$util && this.$util.getUserInfo()) || { name: '' } this.userInfo = (this.$util && this.$util.getUserInfo()) || { name: '' }
// this.getStaticData() // this.getStaticData()
// this.onRefresh() // this.onRefresh()
// 每次进入列表页时,清理掉详情页的临时缓存数据,防止数据污染
sessionStorage.removeItem('reportDetailItem')
sessionStorage.removeItem('specialTaskDetailItem')
}, },
methods: { methods: {
// 获取当前 Tab 的 key // 获取当前 Tab 的 key
...@@ -205,7 +208,7 @@ export default { ...@@ -205,7 +208,7 @@ export default {
if (!msg || (key && !item[key])) return if (!msg || (key && !item[key])) return
if (path) { if (path) {
// 使用 sessionStorage 传递当前项数据和 tabIndex // 使用 sessionStorage 传递当前项数据
sessionStorage.setItem('reportDetailItem', JSON.stringify(item)) sessionStorage.setItem('reportDetailItem', JSON.stringify(item))
const query = { detailType } const query = { detailType }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!