Commit ce89a6f8 by 李伟康

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

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