Commit ce89a6f8 by 李伟康

feat(earlyWarningManager): 添加招聘概况功能并优化策略列表组件

- 新增 getRecruitmentDemandOverview API 接口用于获取招聘概况数据
- 在 Recruitment 组件中实现招聘数据查询和展示功能
- 更新 StrategyDetail 常量文件中的安全链操作符处理
- 优化 StrategyList 组件的模板结构和样式布局
- 移除冗余的控制台日志输出
- 调整组件初始化逻辑以正确加载招聘数据
1 parent 22495a3a
...@@ -650,3 +650,12 @@ export function getStrategyMerchantAnalysisIndexHistory (data = {}) { ...@@ -650,3 +650,12 @@ export function getStrategyMerchantAnalysisIndexHistory (data = {}) {
data.method = "dj.api.strategy.merchant.analysis.index.history" data.method = "dj.api.strategy.merchant.analysis.index.history"
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
/**
* 招聘概况
*/
export function getRecruitmentDemandOverview (data = {}) {
data.method = "dj.staff.api.recruitment.demand.merchant.overview"
return request(data, RequestMethods.POST)
}
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import data from '@/views/stockManage/returnManage/constant/data'; import data from '@/views/stockManage/returnManage/constant/data';
import { import {
getStrategyBusinessAnalysisStoreSpecialBrand getRecruitmentDemandOverview
} from '@/api/earlyWarningManager' } from '@/api/earlyWarningManager'
export default { export default {
name: 'Recruitment', name: 'Recruitment',
...@@ -24,10 +24,10 @@ export default { ...@@ -24,10 +24,10 @@ export default {
return { return {
recruitmentData: {}, recruitmentData: {},
recruitmentOptions: [ recruitmentOptions: [
{ label: '需求总数', key: 'totalDemand' }, { label: '需求总数', key: 'allOfDemand' },
{ label: '在招数量', key: 'inRecruitment' }, { label: '在招数量', key: 'recruitingCount' },
{ label: '入职人数', key: 'employeesHired' }, { label: '入职人数', key: 'allOfOnboarding' },
{ label: '离职人数', key: 'employeesLeft' } { label: '离职人数', key: 'resignedCount' }
] ]
} }
}, },
...@@ -42,8 +42,14 @@ export default { ...@@ -42,8 +42,14 @@ export default {
init () { init () {
this.getRecruitmentData() this.getRecruitmentData()
}, },
getRecruitmentData () { async getRecruitmentData () {
console.log(this.paramsInfo, 'Recruitment/index.vue(查询门店招聘数据)') let { merchantIds, bizs } = this.paramsInfo
const data = await getRecruitmentDemandOverview({
biz: bizs,
merchantId: merchantIds[0]
})
console.log(data, 'Recruitment/index.vue(查询门店招聘数据)')
this.recruitmentData = data || {}
} }
} }
} }
......
...@@ -48,7 +48,7 @@ const STRATEGY_FORM_2456 = [ ...@@ -48,7 +48,7 @@ const STRATEGY_FORM_2456 = [
let { let {
executePersons executePersons
} = val } = val
return executePersons.map(item => item.username).join('/') return executePersons?.map(item => item.username).join('/')
}, },
hide: (val) => { hide: (val) => {
let { let {
...@@ -83,7 +83,7 @@ const STRATEGY_FORM_7 = [ ...@@ -83,7 +83,7 @@ const STRATEGY_FORM_7 = [
let { let {
executePersons executePersons
} = val } = val
return executePersons.map(item => item.username).join('/') || '-' return executePersons?.map(item => item.username).join('/') || '-'
}, },
}, },
] ]
......
...@@ -3,47 +3,21 @@ ...@@ -3,47 +3,21 @@
<div class="strategy-title flex"> <div class="strategy-title flex">
策略中心 策略中心
<div class="add"> <div class="add">
<el-button <el-button type="text" @click="addStrategyVisible = true"> <i class="el-icon-plus"></i>添加策略</el-button>
type="text"
@click="addStrategyVisible = true"
> <i class="el-icon-plus"></i>添加策略</el-button>
</div> </div>
</div> </div>
<el-scrollbar <el-scrollbar class="strategy-list" :key="viewKey" v-loading="loading" ref="scrollbar">
class="strategy-list" <template v-for="(i, index) in list">
:key="viewKey" <strategy-item :key="index" :index="index" :item="i" :isLast="index == list.length - 1"
v-loading="loading" :class="[{ first: index == 0 }, { last: index == list.length - 1 }]" @toDetail="toDetail"
ref="scrollbar" @refresh="init"></strategy-item>
>
<template v-for="(i,index) in list">
<strategy-item
:key="index"
:index="index"
:item="i"
:isLast="index == list.length - 1"
:class="[{first:index == 0},{last:index == list.length - 1}]"
@toDetail="toDetail"
@refresh="init"
></strategy-item>
</template> </template>
<div <div v-if="loading && list.length > 0" class="loading-more">加载中...</div>
v-if="loading && list.length > 0" <div v-if="noMoreData && list.length > 0" class="no-more-data">没有更多了</div>
class="loading-more"
>加载中...</div>
<div
v-if="noMoreData && list.length > 0"
class="no-more-data"
>没有更多了</div>
</el-scrollbar> </el-scrollbar>
<add-strategy <add-strategy :dialogVisible.sync="addStrategyVisible" @refresh="init"></add-strategy>
:dialogVisible.sync="addStrategyVisible" <strategy-detail :dialogVisible.sync="strategyDetailVisible" :item="currentItem"
@refresh="init" @openReceptionDialog="$emit('openReceptionDialog', $event)"></strategy-detail>
></add-strategy>
<strategy-detail
:dialogVisible.sync="strategyDetailVisible"
:item="currentItem"
@openReceptionDialog="$emit('openReceptionDialog',$event)"
></strategy-detail>
</div> </div>
</template> </template>
...@@ -150,16 +124,11 @@ export default { ...@@ -150,16 +124,11 @@ export default {
}, },
handleScroll (event) { handleScroll (event) {
console.log('handleScroll 被触发了!', event)
const wrap = event.target const wrap = event.target
const scrollTop = wrap.scrollTop const scrollTop = wrap.scrollTop
const scrollHeight = wrap.scrollHeight const scrollHeight = wrap.scrollHeight
const clientHeight = wrap.clientHeight const clientHeight = wrap.clientHeight
console.log('滚动信息:', { scrollTop, scrollHeight, clientHeight })
if (scrollTop + clientHeight >= scrollHeight - 10 && !this.loading && !this.noMoreData) { if (scrollTop + clientHeight >= scrollHeight - 10 && !this.loading && !this.noMoreData) {
console.log('触发加载下一页,当前页码:', this.pageNum)
this.pageNum++ this.pageNum++
this.getStrategyList() this.getStrategyList()
} }
...@@ -173,12 +142,15 @@ export default { ...@@ -173,12 +142,15 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.strategy { .strategy {
width: 100%; width: 100%;
height: 100%; height: 100%;
::v-deep .el-scrollbar__wrap { ::v-deep .el-scrollbar__wrap {
overflow: auto !important; overflow: auto !important;
} }
&-title { &-title {
height: 50px; height: 50px;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
...@@ -187,10 +159,12 @@ export default { ...@@ -187,10 +159,12 @@ export default {
color: #333333; color: #333333;
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
.add { .add {
font-weight: 400; font-weight: 400;
color: #2a58ad; color: #2a58ad;
font-size: 14px; font-size: 14px;
.el-icon-plus { .el-icon-plus {
font-size: 12px; font-size: 12px;
font-weight: 700; font-weight: 700;
...@@ -198,18 +172,22 @@ export default { ...@@ -198,18 +172,22 @@ export default {
} }
} }
} }
&-list { &-list {
width: 100%; width: 100%;
height: calc(100% - 51px); height: calc(100% - 51px);
box-sizing: border-box; box-sizing: border-box;
.first { .first {
margin-top: 16px; margin-top: 16px;
} }
.last { .last {
margin-bottom: 16px; margin-bottom: 16px;
} }
} }
} }
.loading-more, .loading-more,
.no-more-data { .no-more-data {
text-align: center; text-align: center;
...@@ -217,6 +195,7 @@ export default { ...@@ -217,6 +195,7 @@ export default {
color: #999; color: #999;
font-size: 12px; font-size: 12px;
} }
.no-more-data { .no-more-data {
color: #ccc; color: #ccc;
} }
......
...@@ -139,7 +139,7 @@ export default { ...@@ -139,7 +139,7 @@ export default {
this.storeSignboardInfoRef.init() this.storeSignboardInfoRef.init()
this.businessOverviewRef.init() this.businessOverviewRef.init()
this.strategyListRef.init() this.strategyListRef.init()
this.recruitmentRef.init()
}, },
preventBack () { preventBack () {
if (this.isQualityVisible || this.isNewQualityVisible) { if (this.isQualityVisible || this.isNewQualityVisible) {
...@@ -152,7 +152,6 @@ export default { ...@@ -152,7 +152,6 @@ export default {
async requireInterface () { async requireInterface () {
this.summaryOverviewRef.init() this.summaryOverviewRef.init()
this.staffOverviewRef.init() this.staffOverviewRef.init()
this.recruitmentRef.init()
}, },
openReceptionDialog ({ list, row, currentNum }) { openReceptionDialog ({ list, row, currentNum }) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!