Files
ks-app-employment-service/packageRc/pages/needs/personNeeds.vue

497 lines
12 KiB
Vue
Raw Normal View History

2025-11-04 15:16:22 +08:00
<template>
<view>
2025-11-05 17:07:17 +08:00
<view class="page" style="background-image: url('../../../packageRc/static/pageBg.png');">
2025-11-04 15:16:22 +08:00
<view class="input-outer-part"
2025-11-05 17:07:17 +08:00
style="padding-top: 32rpx;padding-bottom: 0;max-height: unset;">
2025-11-04 15:16:22 +08:00
<!-- <view class="inner"
style="width: calc(100% + 64rpx);margin-left: -32rpx;height: 122rpx;position: relative;z-index: 2;">
<PopupList :checkData="checkData" @searchCheck="search" ref="PopupList"
@popupSearch="popupSearch" />
</view> -->
<scroll-view :scroll-y="true" style="height: calc(100vh - 242rpx);position: relative;z-index: 1;"
@scrolltolower="getBottomList">
2025-11-05 17:07:17 +08:00
<uni-swipe-action>
<uni-swipe-action-item @click="clickDelete(item)" v-for="(item, index) in tableData" :key="index"
style="margin-bottom: 24rpx;border-radius: 16rpx;" :right-options="options1">
2025-11-04 15:16:22 +08:00
<view @click="goNeedsDetail(item)" class="job-item">
<view class="title-line" v-if="queryParams.needsType==1">
<view class="type-tag qz">求职需求</view>
<view class="title">{{getJobWorkTypeName(item.jobWorkType)}}</view>
</view>
<view class="title-line" v-if="queryParams.needsType==2">
<view class="type-tag yz">援助需求</view>
<view class="title">{{ item.demandTitle }}</view>
</view>
<view class="title-line" v-if="queryParams.needsType==3">
<view class="type-tag cy">创业需求</view>
<view class="title">{{ item.personName }}的创业需求</view>
</view>
<view class="title-line" v-if="queryParams.needsType==4">
<view class="type-tag px">培训需求</view>
<view class="title">{{ item.personName }}的培训需求</view>
</view>
<view class="title-line" v-if="queryParams.needsType==5">
<view class="type-tag qt">其他需求</view>
<view class="title">{{ item.personName }}的其他需求</view>
</view>
<view class="info"><text>需求状态</text><text
:class="item.currentStatus == 1 ? 'not' : item.currentStatus == 2 ? 'ing' : item.currentStatus == 3 ? 'finish' : '' ">
{{ getDictLabel(item.currentStatus, currentStatusList) }}
</text></view>
<view class="bottom-line">
<view class="info"><text>提交时间</text>{{ item.createTime }}</view>
<view style="font-size:12px;">左划删除需求</view>
</view>
</view>
2025-11-05 17:07:17 +08:00
</uni-swipe-action-item>
</uni-swipe-action>
2025-11-04 15:16:22 +08:00
<img v-if="!total&&!loading" src="https://rc.jinan.gov.cn/qcwjyH5/static/images/person/empty.png"
style="width: 100%;display: block;margin: 0 auto;" />
<view v-if="loading"><u-loading-icon></u-loading-icon>
<view style="text-align: center;color: #8E8E8E;font-size: 24rpx;">加载中~</view>
</view>
<view v-else-if="showMorePage" style="text-align: center;color: #1A62CE;font-size: 24rpx;">加载更多
</view>
<view class="addNeeds" @click="goAddNeeds()">
<img src="https://rc.jinan.gov.cn/qcwjyH5/static/images/person/addNeeds.png" />
</view>
</scroll-view>
</view>
</view>
</view>
</template>
<script>
import {
getPersonBase
2025-11-07 18:38:01 +08:00
} from "@/packageRc/apiRc/person";
2025-11-04 15:16:22 +08:00
import {
listJobService,
delJobService
2025-11-07 18:38:01 +08:00
} from '@/packageRc/apiRc/needs/jobService'
import { listPersonDemand, delPersonDemand } from "@/packageRc/apiRc/needs/personDemand";
2025-11-04 15:16:22 +08:00
import {
listAssistService,
delAssistService
2025-11-07 18:38:01 +08:00
} from '@/packageRc/apiRc/needs/assistService'
2025-11-04 15:16:22 +08:00
import {
listEntrepreneurshipService,
delEntrepreneurshipService
2025-11-07 18:38:01 +08:00
} from '@/packageRc/apiRc/needs/entrepreneurshipService'
2025-11-04 15:16:22 +08:00
import {
listTrainService,
delTrainService
2025-11-07 18:38:01 +08:00
} from '@/packageRc/apiRc/needs/trainService'
import { listJobType } from "@/packageRc/apiRc/jobType/index";
2025-11-04 15:16:22 +08:00
import {
listOtherService,
delOtherService
2025-11-07 18:38:01 +08:00
} from '@/packageRc/apiRc/needs/otherService'
2025-11-04 15:16:22 +08:00
export default {
components: {
},
onShow() {
2025-11-05 17:07:17 +08:00
console.log('search',34224234)
2025-11-04 15:16:22 +08:00
this.search();
},
data() {
return {
checkData: [],
options1: [{
text: '删除'
}],
queryParams: {
pageNum: 1,
pageSize: 10,
userId: '',
2025-11-05 17:07:17 +08:00
needsType: 1,
2025-11-04 15:16:22 +08:00
},
jobTypeList:[],
total: 0,
showMorePage: true,
tableData: [],
person: {},
loading: false,
currentStatusList: [],
}
},
mounted() {
},
onLoad({
dictValue,userId
}) {
2025-11-05 17:07:17 +08:00
dictValue ? this.queryParams.needsType = dictValue : ''
2025-11-04 15:16:22 +08:00
this.queryParams.userId = userId
2025-11-05 17:07:17 +08:00
this.$getDict('qcjy_xqlc').then(res => {
2025-11-04 15:16:22 +08:00
this.currentStatusList = res.data;
})
this.workTypeRemoteMethod()
2025-11-05 17:07:17 +08:00
this.$getDict('qcjy_zgzpgz').then(res => {
2025-11-04 15:16:22 +08:00
this.salaryList = res.data;
})
2025-11-05 17:07:17 +08:00
console.log(this.$store.state.user, 234234234)
2025-11-04 15:16:22 +08:00
getPersonBase(this.$store.state.user.userId).then(resp => {
2025-11-05 17:07:17 +08:00
this.person = resp.data || {}
// this.queryParams.personId = resp.data.id
2025-11-04 15:16:22 +08:00
})
},
methods: {
getJobWorkTypeName(data){
if (data) {
let arr = this.jobTypeList.filter((ele) => ele.id == data);
2025-11-05 17:07:17 +08:00
if(arr.length){
return arr[0].workTypeName;
}else{
return '--'
}
2025-11-04 15:16:22 +08:00
}
},
workTypeRemoteMethod(key) {
listJobType({
workTypeName: key,
pageNum: 1,
pageSize: 50,
}).then((res) => {
this.jobTypeList = res.rows;
});
},
goAddNeeds() {
2025-11-05 17:07:17 +08:00
uni.navigateTo({
url: `/packageRc/pages/needs/needDetail?userId=${this.$store.state.user.userId}&type=1&name=${this.$store.state.user.nick}`,
// url: `/packageRc/pages/needs/needDetail?activeType=${this.queryParams.needsType}&showTab=1`
})
2025-11-04 15:16:22 +08:00
},
goBack() {
uni.navigateBack()
},
clickDelete(item) {
this.loading = true;
if (this.queryParams.needsType == 1) {
delJobService(item.id).then((res) => {
this.deleteFinish(res)
});
} else if (this.queryParams.needsType == 2) {
delAssistService(item.id).then((res) => {
this.deleteFinish(res)
});
} else if (this.queryParams.needsType == 3) {
delEntrepreneurshipService(item.id).then((res) => {
this.deleteFinish(res)
});
} else if (this.queryParams.needsType == 4) {
delTrainService(item.id).then((res) => {
this.deleteFinish(res)
});
} else if (this.queryParams.needsType == 5) {
delOtherService(item.id).then((res) => {
this.deleteFinish(res)
});
}
},
deleteFinish() {
uni.showToast({
title: '删除成功'
})
this.search()
},
goNeedsDetail(item) {
uni.navigateTo({
2025-11-05 17:07:17 +08:00
url: `/packageRc/pages/needs/needDetail?id=${item.id}&type=${this.queryParams.needsType}`
2025-11-04 15:16:22 +08:00
})
},
getDictLabel(value, list) {
if (list) {
let arr = list.filter(ele => ele.dictValue == value)
if (arr.length) {
return arr[0].dictLabel
} else {
return '请选择'
}
}
},
popupSearch(queryParams) {
queryParams.forEach((item, index) => {
if (item.data[item.activeIndex].dictLabel == "全部") {
this.queryParams[item.type] = "";
} else {
this.queryParams[item.type] = item.data[item.activeIndex].dictValue;
}
});
this.search()
},
search() {
this.showMorePage = true;
this.queryParams.pageNum = 1;
this.queryParams.pageSize = 10;
this.tableData = [];
this.total = 0;
this.getList();
},
// 触底加载
getBottomList() {
if (
this.queryParams.pageNum * this.queryParams.pageSize >=
this.total
) {
this.showMorePage = false;
} else if (
this.queryParams.pageNum * this.queryParams.pageSize <
this.total
) {
this.queryParams.pageNum++;
this.getList();
if (
this.queryParams.pageNum * this.queryParams.pageSize >=
this.total
) {
this.showMorePage = false;
}
}
},
// 获取列表
async getList() {
2025-11-05 17:07:17 +08:00
console.log('getlist',this.queryParams.needsType, 234234234)
2025-11-04 15:16:22 +08:00
this.loading = true;
if (this.queryParams.needsType == 1) {
this.queryParams.demandType = 1
listPersonDemand(this.queryParams).then((res) => {
this.gettedData(res)
});
} else if (this.queryParams.needsType == 2) {
listAssistService(this.queryParams).then((res) => {
this.gettedData(res)
});
} else if (this.queryParams.needsType == 3) {
this.queryParams.demandType = 2
listPersonDemand(this.queryParams).then((res) => {
this.gettedData(res)
});
} else if (this.queryParams.needsType == 4) {
this.queryParams.demandType = 3
listPersonDemand(this.queryParams).then((res) => {
this.gettedData(res)
});
} else if (this.queryParams.needsType == 5) {
this.queryParams.demandType = 9
listPersonDemand(this.queryParams).then((res) => {
this.gettedData(res)
});
}
},
gettedData(res) {
2025-11-05 17:07:17 +08:00
console.log('this.gettedData')
2025-11-04 15:16:22 +08:00
if (res.code == 200) {
if (res.rows.length < 10) {
this.showMorePage = false;
}
this.loading = false;
this.tableData = this.tableData.concat(res.rows);
this.total = res.total;
} else {
this.loading = false;
uni.showToast({
title: res.msg,
icon: "none",
});
}
}
}
}
</script>
<style lang="scss" scoped>
.page {
2025-11-05 17:07:17 +08:00
background-color: #f4f4f4 !important;
2025-11-04 15:16:22 +08:00
height: 100vh;
2025-11-05 17:07:17 +08:00
// background-image: url('https://rc.jinan.gov.cn/qcwjyH5/static/images/top.png');
2025-11-04 15:16:22 +08:00
background-repeat: no-repeat;
background-size: 100% auto;
}
.search-line {
border-radius: 32px;
background: #FFFFFF;
box-sizing: border-box;
border: 1px solid #107AFD;
height: 64rpx;
border-radius: 32rpx;
padding: 0 32rpx;
display: flex;
align-items: center;
position: relative;
z-index: 1;
margin-top: 24rpx;
.search-icon {
width: 40rpx;
}
}
.job-item {
2025-11-05 17:07:17 +08:00
border-radius: 16rpx; /* 增大圆角,使界面更圆润 */
padding: 24rpx 32rpx;
margin: 0 30rpx 24rpx 30rpx; /* 添加左右30rpx边距 */
2025-11-04 15:16:22 +08:00
background-color: #FFFFFF; /* 设置白色背景,避免与底层背景重合 */
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); /* 添加轻微阴影增强层次感 */
.title-line {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 32rpx;
font-weight: bold;
margin-bottom: 16rpx;
.type-tag {
line-height: 40rpx;
width: 128rpx;
font-size: 24rpx;
color: #fff;
text-align: center;
&.qz {
background: #28CB5E;
}
&.yz {
background: #DD6728;
}
&.cy {
background: #23B5C5;
}
&.px {
background: #DDA728;
}
&.qt {
background: #2870DD;
}
}
.title {
color: #3D3D3D;
width: calc(100% - 137rpx);
overflow: hidden;
2025-11-05 17:07:17 +08:00
padding-left: 24rpx;
text-align: left;
2025-11-04 15:16:22 +08:00
text-overflow: ellipsis;
white-space: nowrap;
line-height: 40rpx;
}
.salary {
width: 33%;
color: #FA6553;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: right
}
}
.info {
color: #3D3D3D;
margin-bottom: 7rpx;
font-size: 28rpx;
text {
color: #8E8E8E;
}
.not {
color: #EC7737;
font-weight: bold;
}
.ing {
color: #ECB83D;
font-weight: bold;
}
.finish {
color: #21C88D;
font-weight: bold;
}
}
.bottom-line {
display: flex;
justify-content: space-between;
margin-top: 21rpx;
.info {
margin-bottom: 0;
}
.toudi-btn {
background: linear-gradient(90deg, #1A62CE 0%, #1D8ACE 100%);
color: #fff;
width: 140rpx;
line-height: 40rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
border-radius: 20rpx;
img {
width: 22rpx;
margin-right: 10rpx;
}
}
}
}
.addNeeds {
position: fixed;
right: 10px;
bottom: 150rpx;
width: 150rpx; /* 改小一点,比如 100rpx */
height: 10vh; /* 新增高度 */
overflow: hidden;
z-index: 10;
border-radius: 50rpx; /* 圆角要和宽高一半一致,才能正圆 */
img {
display: block;
width: 100%;
height: 100%; /* 让图片填满容器 */
object-fit: cover; /* 保证图片不变形,裁剪多余部分 */
}
}
.page-header {
display: flex;
align-items: center;
justify-content: space-between;
position: relative;
height: 80rpx; // 可根据实际调整
}
.back-icon {
flex-shrink: 0;
margin-left: 20rpx;
}
.title {
flex: 1;
text-align: center;
font-size: 32rpx;
color: #fff;
font-weight: bold;
}
</style>