123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <template>
- <view>
- <view class="position">
- <view class="audits">
- <view class="audit" :class="{ active: current == index }" v-for="(item, index) in audit" :key="index" @click="click(index)">{{ item.name }}</view>
- </view>
- <view class="item" v-for="(item, index) in list" :key="index" @click="go('/pages/job/position/manage/full_time_push?id=' + item.id)">
- <view class="top">
- <view class="title omit">
- <text class="icon" :style="{ color: item.state == 0 ? '#4CAF50' : '#545555' }"></text>
- <text>{{ item.title }}</text>
- </view>
- <view class="audit" v-if="item.audit == 0">
- <text class="icon"></text>
- <text>审核中</text>
- </view>
- <view class="audit" style="color: #4caf50" v-if="item.audit == 1">
- <text class="icon"></text>
- <text>审核通过</text>
- </view>
- <view class="audit" v-if="item.audit == 2">
- <text class="icon"></text>
- <text>审核不通过</text>
- </view>
- </view>
- <view class="desc">
- <text class="tag">{{ item.experience }}</text>
- <text class="tag">{{ item.salary }}</text>
- <text class="tag">{{ item.regionName }}</text>
- <text class="date">{{ item.createTime }}</text>
- </view>
- <view class="flex">
- <view class="f br" @click.stop="manageState(item)">{{ item.state == 0 ? '关闭' : '启用' }}</view>
- <view class="f danger" @click.stop="manageRemove(item)">删除</view>
- </view>
- </view>
- <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
- <u-empty v-if="!loadMore && list.length == 0"></u-empty>
- </view>
- <view class="mfooter">
- <button class="btn" @click="go('/pages/job/position/manage/full_time_push')">
- <text class="icon"></text>
- <text>发布职位</text>
- </button>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- audit: [
- { name: '全部', value: '' },
- { name: '待审核', value: 0 },
- { name: '审核通过', value: 1 },
- { name: '未通过', value: 2 }
- ],
- current: 0,
- list: [],
- param: { pageNum: 1, pageSize: 10, type: 0 },
- loadMore: true
- };
- },
- onLoad(e) {
- this.getData();
- uni.$on('position', (res) => {
- this.refresh();
- });
- },
- methods: {
- getData() {
- this.http.request({
- url: '/app/position/manage/list',
- data: this.param,
- loading: 'false',
- success: (res) => {
- this.loadMore = res.data.pages > this.param.pageNum ? true : false;
- res.data.rows.forEach((item) => {
- item.createTime = uni.$u.timeFrom(Date.parse(item.createTime));
- this.list.push(item);
- });
- }
- });
- },
- click(index) {
- this.param.audit = this.audit[index].value;
- this.current = index;
- this.refresh();
- },
- go(url) {
- uni.navigateTo({ url: url });
- },
- manageState(item) {
- uni.showModal({
- title: '提示',
- content: item.state == 0 ? '确定关闭该职位' : '确定启用该职位',
- success: (res) => {
- if (res.confirm) {
- this.http.request({
- url: '/app/position/manage/state',
- data: { id: item.id, state: item.state == 0 ? 1 : 0, type: 0 },
- method: 'POST',
- success: (res) => {
- uni.showToast({ title: '操作成功' });
- item.state = item.state == 0 ? 1 : 0;
- }
- });
- }
- }
- });
- },
- manageRemove(item) {
- uni.showModal({
- title: '提示',
- content: '确定删除该职位?删除后包括已投递简历也全部清除',
- success: (res) => {
- if (res.confirm) {
- this.http.request({
- url: '/app/position/manage/remove/' + item.id,
- success: (res) => {
- uni.showToast({ title: '删除成功' });
- this.list.splice(this.list.indexOf(item), 1);
- }
- });
- }
- }
- });
- },
- //刷新数据
- refresh() {
- this.loadMore = true;
- this.param.pageNum = 1;
- this.list = [];
- this.getData();
- }
- },
- //下拉刷新
- onPullDownRefresh() {
- setTimeout(() => {
- this.refresh();
- uni.stopPullDownRefresh();
- }, 1000);
- },
- //上拉加载
- onReachBottom() {
- if (this.loadMore) {
- this.param.pageNum++;
- this.getData();
- }
- }
- };
- </script>
- <style lang="scss"></style>
|