|
@@ -0,0 +1,220 @@
|
|
|
|
+<template>
|
|
|
|
+ <ion-page class="list-page company-list-page">
|
|
|
|
+ <ion-header class="header-theme2">
|
|
|
|
+ <ion-toolbar>
|
|
|
|
+ <ion-buttons slot="start">
|
|
|
|
+ <ion-icon :icon="arrowBackOutline" @click="onBack"></ion-icon>
|
|
|
|
+ </ion-buttons>
|
|
|
|
+ <ion-title>岗位推荐</ion-title>
|
|
|
|
+ </ion-toolbar>
|
|
|
|
+ </ion-header>
|
|
|
|
+ <ion-content>
|
|
|
|
+ <ion-item class="search-item">
|
|
|
|
+ <ion-label>
|
|
|
|
+ <h2>{{ searchParams.jobUserName }}</h2>
|
|
|
|
+ <br/>
|
|
|
|
+ <h2>{{ searchParams.professionName }}</h2>
|
|
|
|
+ </ion-label>
|
|
|
|
+ </ion-item>
|
|
|
|
+ <ion-list class="list-content">
|
|
|
|
+ <ion-item v-for="(record,key) in dataList" detail :key="key">
|
|
|
|
+ <ion-label>
|
|
|
|
+ <h2>{{ record.professionName }}</h2>
|
|
|
|
+ <p>单位:{{ record.companyName }}</p>
|
|
|
|
+ <p>薪资待遇:{{ record.minSalary }}至{{ record.maxSalary }}元</p>
|
|
|
|
+ </ion-label>
|
|
|
|
+ <ion-avatar aria-hidden="true" class="container" slot="end">
|
|
|
|
+ <ion-text style="text-align:right;" @click="onRecommend(record)">推荐</ion-text>
|
|
|
|
+ </ion-avatar>
|
|
|
|
+ </ion-item>
|
|
|
|
+ </ion-list>
|
|
|
|
+ <b-empty v-if="dataList.length<=0" :loading="loading"/>
|
|
|
|
+ <ion-infinite-scroll threshold="100px" @ionInfinite="onScroll($event)">
|
|
|
|
+ <ion-infinite-scroll-content
|
|
|
|
+ :loadingText="pagination.total>pagination.pageIndex*pagination.pageSize?'正在加载...':'暂无更多'"
|
|
|
|
+ loadingSpinner="bubbles">
|
|
|
|
+ </ion-infinite-scroll-content>
|
|
|
|
+ </ion-infinite-scroll>
|
|
|
|
+ </ion-content>
|
|
|
|
+ <ion-footer>
|
|
|
|
+ <ion-button shape="round" expand="block" @click="onBatchRecommend">全部推荐</ion-button>
|
|
|
|
+ </ion-footer>
|
|
|
|
+ </ion-page>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script lang="ts">
|
|
|
|
+import {useRoute, useRouter} from "vue-router";
|
|
|
|
+import {computed, defineComponent, reactive, ref, watch} from 'vue';
|
|
|
|
+import {arrowBackOutline, addCircleOutline} from 'ionicons/icons';
|
|
|
|
+import {alertController, IonIcon, onIonViewDidEnter} from '@ionic/vue';
|
|
|
|
+import {getRecommendCompanyPostList, addRecommend} from "@/api/recommendmgt";
|
|
|
|
+
|
|
|
|
+export default defineComponent({
|
|
|
|
+ name: 'RecommendCompanyPost',
|
|
|
|
+ components: {IonIcon},
|
|
|
|
+ setup() {
|
|
|
|
+ const loading = ref(true);
|
|
|
|
+ const router = useRouter();
|
|
|
|
+ const route = useRoute();
|
|
|
|
+ const total = ref(10);
|
|
|
|
+ const pagination = computed(() => ({
|
|
|
|
+ total: total,
|
|
|
|
+ pageIndex: searchParams.pageIndex,
|
|
|
|
+ pageSize: searchParams.pageSize
|
|
|
|
+ }));
|
|
|
|
+ const searchParams = reactive({
|
|
|
|
+ pageIndex: 1,
|
|
|
|
+ pageSize: 5,
|
|
|
|
+ jobUserName: null,
|
|
|
|
+ jobHuntID: '',
|
|
|
|
+ professionID: '',
|
|
|
|
+ professionName: null,
|
|
|
|
+ type: 0
|
|
|
|
+ })
|
|
|
|
+ const dataList = ref<any>([]);
|
|
|
|
+ const addRecommendList = ref<any>([]);
|
|
|
|
+ const colors = ref(["secondary", "tertiary", "success", "warning"]);
|
|
|
|
+
|
|
|
|
+ const loadData = async function () {
|
|
|
|
+ loading.value = true;
|
|
|
|
+ searchParams.jobHuntID = route.query.jobHuntID as any;
|
|
|
|
+ searchParams.jobUserName = route.query.jobUserName as any;
|
|
|
|
+ searchParams.professionID = route.query.professionID as any;
|
|
|
|
+ searchParams.professionName = route.query.professionName as any;
|
|
|
|
+ searchParams.type = route.query.type as any;
|
|
|
|
+ getRecommendCompanyPostList(searchParams).then((data: any) => {
|
|
|
|
+ dataList.value = dataList.value.concat(data.list);
|
|
|
|
+ total.value = data.total;
|
|
|
|
+ });
|
|
|
|
+ loading.value = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const onScroll = (e: any) => {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ e.target.complete();
|
|
|
|
+ if (pagination.value.total.value > pagination.value.pageIndex * pagination.value.pageSize) {
|
|
|
|
+ searchParams.pageIndex += 1;
|
|
|
|
+ loadData();
|
|
|
|
+ }
|
|
|
|
+ }, 500);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const onRecommend = (item: any) => {
|
|
|
|
+ addRecommendList.value.push({
|
|
|
|
+ recommendMgtID: item.recommendMgtID,
|
|
|
|
+ jobHuntID: searchParams.jobHuntID,
|
|
|
|
+ postID: item.postID,
|
|
|
|
+ recommendType: 1
|
|
|
|
+ });
|
|
|
|
+ addRecommend(addRecommendList.value).then(() => {
|
|
|
|
+ const index = dataList.value.findIndex((x: any) => x.recommendMgtID == item.recommendMgtID);
|
|
|
|
+ dataList.value.splice(index, 1)
|
|
|
|
+ addRecommendList.value = [];
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const onBatchRecommend = () => {
|
|
|
|
+ if (dataList.value.length == 0) {
|
|
|
|
+ presentAlert("没有需要推荐的求职人员!")
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ dataList.value.forEach((item: any) => {
|
|
|
|
+ addRecommendList.value.push({
|
|
|
|
+ recommendMgtID: item.recommendMgtID,
|
|
|
|
+ jobHuntID: searchParams.jobHuntID,
|
|
|
|
+ postID: item.postID,
|
|
|
|
+ recommendType: 1
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ addRecommend(addRecommendList.value).then(() => {
|
|
|
|
+ loadData();
|
|
|
|
+ dataList.value = [];
|
|
|
|
+ addRecommendList.value = [];
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const presentAlert = async (message: string) => {
|
|
|
|
+ const alert = await alertController.create({
|
|
|
|
+ header: '错误!',
|
|
|
|
+ message: message,
|
|
|
|
+ buttons: [
|
|
|
|
+ '确定'
|
|
|
|
+ ],
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ await alert.present();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const onBack = () => {
|
|
|
|
+ router.go(-1);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const reload = () => {
|
|
|
|
+ dataList.value = [];
|
|
|
|
+ searchParams.pageIndex = 1;
|
|
|
|
+ loadData();
|
|
|
|
+ }
|
|
|
|
+ onIonViewDidEnter(() => {
|
|
|
|
+ reload();
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ return {
|
|
|
|
+ arrowBackOutline,
|
|
|
|
+ addCircleOutline,
|
|
|
|
+ router,
|
|
|
|
+ route,
|
|
|
|
+ colors,
|
|
|
|
+ loading,
|
|
|
|
+ pagination,
|
|
|
|
+ searchParams,
|
|
|
|
+ dataList,
|
|
|
|
+ onScroll,
|
|
|
|
+ loadData,
|
|
|
|
+ reload,
|
|
|
|
+ onBack,
|
|
|
|
+ onRecommend,
|
|
|
|
+ onBatchRecommend,
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+});
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="less">
|
|
|
|
+.custom {
|
|
|
|
+ --placeholder-color: gray;
|
|
|
|
+ --placeholder-font-style: italic;
|
|
|
|
+ --placeholder-opacity: 1;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.company-list-page {
|
|
|
|
+ .list-content {
|
|
|
|
+ margin: 0px 15px !important;
|
|
|
|
+ background-color: white !important;
|
|
|
|
+ border-radius: 0 !important;
|
|
|
|
+
|
|
|
|
+ ion-item {
|
|
|
|
+ margin-top: 10px;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ border: 1px solid rgb(242, 242, 245);
|
|
|
|
+
|
|
|
|
+ p {
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.container {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center; /* 水平居中 */
|
|
|
|
+ align-items: center; /* 垂直居中 */
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.footer-ios ion-toolbar:first-of-type{
|
|
|
|
+ --border-width:0 !important;
|
|
|
|
+ --background:#ffffff !important;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+</style>
|
|
|
|
+
|