yxk_h5_master/pages/interviewManagement/interview.vue

504 lines
12 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="content">
<view class="mb">
<view class="filter_container">
<view class="search_container" @click="toSearch()">
<uni-icons
class="search_icon"
type="search"
size="20"
v-model="advertisePositionName"
color="#bdbdbd"
></uni-icons>
<input
style="text1"
class="input-"
size="20"
placeholder="招聘岗位(模糊查询)"
v-model="advertisePositionName"
/>
</view>
</view>
<view class="otherFixed">
<!-- <view class="text " @click="showSinglePicker">{{deptResult.name}}</view> -->
<view class="text" @click="filterDate">{{
timeData.begin == ""
? "日期范围"
: timeData.begin + "~" + timeData.end
}}</view>
</view>
</view>
<view class="mybox" v-if="listCards.length > 0">
<view
v-for="(item, index) in listCards"
:key="index"
class="example-box"
style="position: relative"
@click="clickDetail(item)"
>
<dev-block
:title="item.title"
:titleNumber="item.titleNumber"
:note="item.note"
:extra="item.extra"
:tagType="item.tagType"
:contentList="item.contentList"
></dev-block>
</view>
<uni-load-more :status="loading_status"></uni-load-more>
</view>
<view class="mybox" v-else>
<no-record></no-record>
</view>
<view class="goHome" @click="goMain('workInfo')">
<img src="../../static/img/gohome.png" />
</view>
<uni-calendar
ref="calendar"
:lunar="false"
:range="true"
@confirm="confirmDate"
@cancel="cancleData"
/>
<lb-picker
ref="picker"
mode="multiSelector"
:level="level"
:pickerValueDefault="[0, 0]"
@confirm="pickerConfirm"
:props="myProps"
:list="deptArray"
></lb-picker>
</view>
</template>
<script>
import LbPicker from "@/components/lb-picker";
import mpvuePicker from "@/components/mpvue-picker/mpvuePicker.vue";
import devBlock from "@/components/xinsoft-dev-block/xinsoft-dev-block.vue";
import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
import noRecord from "@/components/xinsoft-no-record/xinsoft-no-record";
import uniBadge from "@/components/uni-badge/uni-badge.vue";
import uniCalendar from "@/components/uni-calendar/uni-calendar.vue";
export default {
components: {
LbPicker,
devBlock,
uniLoadMore,
noRecord,
uniBadge,
uniCalendar,
mpvuePicker,
},
data() {
return {
current_num: 2,
deptArray: [],
level: 4,
advertisePositionName: "",
myProps: {
label: "text",
value: "id",
children: "children",
},
listCards: [],
//上拉刷新,下拉加载
loading_status: "more", //moreloading前、loadingloading中、noMore没有更多了
pageSize: 5,
page: 1,
filter: {},
//日历变量。
timeData: {
begin: "",
end: "",
},
deptResult: {
value: "",
name: "部门",
},
userInfo: {},
};
},
onLoad() {
var _this = this;
this.userInfo = uni.getStorageSync("userInfo");
this.filter = {
approveUserId: this.userInfo.userId,
};
// this.getDept('');
// this.getDept(this.userInfo.deptId);
//初始化当前列表。
this.dataList();
},
onReachBottom: function () {
//下拉刷新的时候请求一次数据
if (this.loading_status == "noMore") {
return false;
}
this.page++;
this.dataList();
},
onPullDownRefresh: function () {
this.listCards = [];
this.page = 1;
this.loading_status = "more";
//触底的时候请求数据,即为上拉加载更多
this.dataList();
},
methods: {
// 按招聘岗位查询
toSearch() {
this.dataList(1);
},
filterConfirm(f) {
//筛选成功。
var num = f.num;
if (num == 1 || num == "") {
this.filter = {
userId: this.userInfo.userId,
};
} else if (num == 2) {
this.filter = {
approveUserId: this.userInfo.userId,
};
} else if (num == 3) {
this.filter = {
deptId: this.userInfo.deptId,
};
}
this.current_num = num;
this.filter.userName = f.userName;
this.listCards = [];
this.page = 1;
this.loading_status = "more";
this.dataList();
},
dataList(n) {
if (n == 1) {
this.page = 1;
this.listCards = [];
}
this.loading_status = "loading";
var filterRes = this.filter;
filterRes.pageno = this.page;
filterRes.pagesize = this.pageSize;
filterRes.startTime = this.timeData.begin;
filterRes.endTime = this.timeData.end;
filterRes.advertisePositionName = this.advertisePositionName;
this.$http
.request({
url: "/apis/interviewRecord/myselfPlan",
method: "post",
paramsBody: filterRes,
})
.then((res) => {
uni.stopPullDownRefresh();
if (!res.data.data) {
this.loading_status = "noMore";
} else if (res.data.data.datas.length < this.pagesize) {
this.loading_status = "noMore";
} else {
this.loading_status = "more";
}
if (res.data.code == 0) {
if (res.data.data.datas.length > 0) {
this.listCards = this.listCards.concat(
this.formaterData(res.data.data.datas)
);
}
}
})
.catch((err) => {
this.loading_status = "noMore";
});
},
clickDetail(item) {
//点击详情
uni.navigateTo({
url: "interviewManagement_addRecord?interviewId=" + item.id,
});
},
showSinglePicker() {
//关闭之前filter。
// document.getElementById("popupRef").style.display="none";
this.$refs.picker.show();
},
pickerConfirm(e) {
var value = e.value;
console.log(value);
var name = "";
this.filter.deptId = "";
if (value[1] == "-") {
name = e.item[0].text;
this.deptResult.value = value[0];
} else {
this.deptResult.value = value[2] ? value[2] : value[1];
if (value[2]) {
// name = name.substring(0,name.length-2);
name = e.item[0].text + "/" + e.item[1].text + "/" + e.item[2].text;
} else {
name = e.item[0].text + "/" + e.item[1].text;
}
}
console.log(this.deptResult.value);
this.deptResult.name = name;
this.listCards = [];
this.page = 1;
this.loading_status = "more";
this.dataList();
},
// showSinglePicker() {
// //关闭之前filter。
// // document.getElementById("popupRef").style.display="none";
// this.$refs.mpvuePicker.show()
// },
// pickerConfirm(e){
// var value = e.value;
// this.deptResult.value = value[1]?value[1]:value[0];
// var name = e.label;
// if(!value[1]){
// name = name.substring(0,name.length-2);
// }
// this.deptResult.name = name;
// this.listCards=[];
// this.page=1;
// this.loading_status="more";
// this.dataList();
// },
formaterData(data) {
var resData = [];
data.forEach((vals, index) => {
var combineJSON = {
id: vals.recordId,
title: "招聘岗位" + ":" + vals.postName,
contentList: [
{
id: 1,
isDouble: false,
labelName: "应聘人",
labelContent: vals.candidateName,
},
{
id: 2,
isDouble: false,
labelName: "性别",
labelContent: vals.genderName,
},
{
id: 3,
isDouble: false,
labelName: "最高学历",
labelContent: vals.highestEducationName,
},
{
id: 4,
isDouble: false,
labelName: "所学专业",
labelContent: vals.major,
},
{
id: 5,
isDouble: false,
labelName: "毕业学校",
labelContent: vals.graduateSchool,
},
{
id: 6,
isDouble: false,
labelName: "面试时间",
labelContent: vals.interviewDate,
},
],
note: "查看详情",
// extra: vals.approveStateName,
// tagType:this.setTag(vals.approveStateName),
};
resData.push(combineJSON);
});
return resData;
},
filterDate() {
//关闭之前filter。
// document.getElementById("popupRef").style.display="none";
this.$refs.calendar.open();
},
confirmDate(e) {
if (e.range.begin && e.range.end) {
this.timeData = {
begin: e.range.begin + " 00:00:00",
end: e.range.end + " 00:00:00",
};
this.listCards = [];
this.page = 1;
this.loading_status = "more";
this.dataList();
}
},
},
onNavigationBarButtonTap(obj) {
//重置下
uni.removeStorageSync("workInfo");
uni.navigateTo({
url: "addWorkApply",
});
},
onBackPress(options) {
//取消默认的返回事件.
uni.switchTab({
url: "../main/main",
});
return true;
},
};
</script>
<style scoped>
uni-input {
position: relative;
top: 4px;
color: rgb(102, 102, 102);
display: block;
font-size: 13px;
line-height: 1.4em;
height: 1.4em;
min-height: 1.4em;
overflow: hidden;
}
.content {
position: relative;
}
.filter_container {
position: fixed;
width: 50%;
top: var(--window-top);
background-color: #fff;
height: 40px;
z-index: 2;
padding-top: 7px;
box-sizing: border-box;
}
>>> .doubleList:nth-of-type(1) {
width: 60%;
}
>>> .doubleList:nth-of-type(2) {
width: 40%;
}
>>> .doubleList:nth-of-type(3) {
width: 60%;
}
>>> .doubleList:nth-of-type(4) {
width: 40%;
}
>>> .dev-label {
white-space: nowrap;
}
>>> .select-tab-fixed-top {
right: 0;
width: 50%;
z-index: 2;
top: var(--window-top);
white-space: nowrap;
}
>>> .popup-layer {
position: fixed;
top: var(--window-top);
margin-top: 40px;
}
>>> .filter-content-detail {
/* position: relative;
height: 90px;
overflow: scroll; */
}
.search_container {
position: relative;
padding-left: 30px;
box-sizing: border-box;
color: #bdbdbd;
margin: auto;
width: 80%;
height: 26px;
background-color: #f6f6f6;
border-radius: 26px;
font-size: 14px;
line-height: 26px;
}
.search_icon {
position: absolute;
left: 5px;
top: 3px;
}
.fliter_content {
position: absolute;
right: 15px;
left: 85px;
height: 100%;
z-index: 2;
}
.arrowright {
position: absolute;
right: 30upx;
bottom: 30upx;
font-size: 40upx !important;
}
>>> .dev-block__content {
padding-right: 36upx;
}
>>> .dev-block__header-title-text {
overflow: auto;
white-space: pre-wrap !important;
}
/* >>>.select-tab >>>.select-tab-item[data-v-fe683d44],
>>>.select-tab-fixed-top >>>.select-tab-item[data-v-fe683d44] {
width: 100% !important;
} */
.arrowright {
position: absolute;
right: 30upx;
bottom: 30upx;
font-size: 40upx !important;
}
>>> .dev-block__content {
padding-right: 36upx;
}
>>> .popup-layer {
position: fixed;
top: var(--window-top);
margin-top: 40px;
}
.otherFixed {
background: #fff;
width: 50%;
text-align: center;
color: #666;
position: fixed;
top: 45px;
z-index: 2;
height: 40px;
right: 0px;
}
.mb {
margin-bottom: 50px;
}
.otherFixed .text {
margin: 5px 3%;
background: #f6f6f6;
border-radius: 40px;
float: left;
width: 90%;
line-height: 30px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 13px;
}
</style>