Browse Source

结业发证

master
xuesinan 4 years ago
parent
commit
b6bfe30f5f
  1. 6
      src/config/api.js
  2. 12
      src/router/index.js
  3. 155
      src/views/Checked/Checked.vue
  4. 156
      src/views/Checking/Checking.vue

6
src/config/api.js

@ -19,3 +19,9 @@ export const uploadImg = `${defaultwbs}/file/upload`;
// 学员列表
export const studentList = params => axios.post(`${defaultwbs}/player/query`, params);
// 待审核结业申请
export const auditList = params => axios.post(`${defaultwbs}/teacher/getCompletePlayer`, params);
// 审核结业申请
export const auditApply = params => axios.post(`${defaultwbs}/teacher/auditComplete`, params);

12
src/router/index.js

@ -1,6 +1,6 @@
import Home from 'views/FirstPage/FirstPage.vue';
import Vue from 'vue';
import VueRouter from 'vue-router';
import Home from 'views/FirstPage/FirstPage.vue';
Vue.use(VueRouter);
@ -31,6 +31,16 @@ const routes = [
name: 'peopleList',
component: () => import('views/PeopleList/PeopleList.vue'),
},
{
path: '/checking',
name: 'checking',
component: () => import('views/Checking/Checking.vue'),
},
{
path: '/checked',
name: 'checked',
component: () => import('views/Checked/Checked.vue'),
},
];
const router = new VueRouter({

155
src/views/Checked/Checked.vue

@ -0,0 +1,155 @@
<template>
<div class="list-flex">
<div class="px-4 pb-2 bg-white">
<div class="title flex items-center justify-between border-b">
<div class="text-gray-400 text-center" style="width: 30%">ID</div>
<div class="text-gray-400 text-center" style="width: 25%">姓名</div>
<div class="text-gray-400 text-center" style="width: 40%">操作</div>
</div>
<div>
<div class="item title flex items-center justify-around border-b">
<div class="text-center" style="width: 30%">123456789</div>
<div class="text-center" style="width: 25%">薛思男</div>
<div class="text-center flex justify-center items-center" style="width: 40%">
<button class="btn mr-2 px-2 border border-blue-500 text-blue-500 rounded-sm" @click="rejectModal">发证</button>
</div>
</div>
<div class="item title flex items-center justify-around border-b">
<div class="text-center" style="width: 30%">123456789</div>
<div class="text-center" style="width: 25%">薛思男</div>
<div class="text-center flex justify-center items-center" style="width: 40%">
<button class="btn mr-2 px-2 border border-blue-500 text-blue-500 rounded-sm">驳回</button>
<button class="btn px-2 border border-blue-500 bg-blue-500 text-white rounded-sm">通过</button>
</div>
</div>
<div class="item title flex items-center justify-around border-b">
<div class="text-center" style="width: 30%">123456789</div>
<div class="text-center" style="width: 25%">薛思男</div>
<div class="text-center flex justify-center items-center" style="width: 40%">
<button class="btn mr-2 px-2 border border-blue-500 text-blue-500 rounded-sm">驳回</button>
<button class="btn px-2 border border-blue-500 bg-blue-500 text-white rounded-sm">通过</button>
</div>
</div>
</div>
</div>
<a-modal title="驳回原因" :visible="visible" @ok="handleOk" @cancel="handleCancel">
<textarea class="reject-con border border-gray-200 w-full rounded-sm p-2" v-model="modalText" placeholder="请输入驳回原因" />
</a-modal>
</div>
</template>
<script>
import { mapState } from 'vuex';
import { auditList, auditApply } from '@/config/api';
export default {
data() {
return {
timer: null,
lists: [],
playerId: '',
remark: '',
visible: false,
modalText: '',
showModal: false,
};
},
computed: mapState('home', ['projectId', 'userId', 'roleId']),
mounted() {
this.timer = setInterval(async () => {
if (this.projectId) {
clearInterval(this.timer);
await this.getAuditList();
}
}, 300);
},
methods: {
//
rejectModal() {
this.visible = true;
},
handleOk(e) {
this.remark = this.modalText;
this.visible = false;
this.auditApply(3);
},
handleCancel(e) {
this.visible = false;
},
/**
* 获取待审核结业申请列表
*/
async getAuditList() {
try {
const params = { param: { projectId: this.projectId } };
const res = await auditList();
const { code, msg, data } = res.data;
if (code === 200) {
this.lists = data;
} else {
this.$message.error(msg || '获取失败');
throw msg;
}
} catch (error) {
throw error || '获取失败';
}
},
/**
* 审核结业申请
*/
async auditApply(type) {
try {
const params = {
param: {
projectId: this.projectId,
playerId: this.playerId,
type: type,
remark: this.remark,
},
};
const res = await auditList();
const { code, msg, data } = res.data;
if (code === 200) {
this.getAuditList();
} else {
this.$message.error(msg || '获取失败');
throw msg;
}
} catch (error) {
throw error || '获取失败';
}
},
},
};
</script>
<style lang="scss" scoped>
.list-flex {
width: 100%;
min-height: 100vh;
background: #f3f3f3;
.title {
height: 48px;
line-height: 48px;
}
.item {
.btn {
height: 26px;
line-height: 24px;
}
}
}
</style>

156
src/views/Checking/Checking.vue

@ -0,0 +1,156 @@
<template>
<div class="list-flex">
<div class="px-4 pb-2 bg-white">
<div class="title flex items-center justify-between border-b">
<div class="text-gray-400 text-center" style="width: 30%">ID</div>
<div class="text-gray-400 text-center" style="width: 25%">姓名</div>
<div class="text-gray-400 text-center" style="width: 40%">操作</div>
</div>
<div>
<div class="item title flex items-center justify-around border-b">
<div class="text-center" style="width: 30%">123456789</div>
<div class="text-center" style="width: 25%">薛思男</div>
<div class="text-center flex justify-center items-center" style="width: 40%">
<button class="btn mr-2 px-2 border border-blue-500 text-blue-500 rounded-sm" @click="rejectModal">驳回</button>
<button class="btn px-2 border border-blue-500 bg-blue-500 text-white rounded-sm" @click="auditApply(2)">通过</button>
</div>
</div>
<div class="item title flex items-center justify-around border-b">
<div class="text-center" style="width: 30%">123456789</div>
<div class="text-center" style="width: 25%">薛思男</div>
<div class="text-center flex justify-center items-center" style="width: 40%">
<button class="btn mr-2 px-2 border border-blue-500 text-blue-500 rounded-sm">驳回</button>
<button class="btn px-2 border border-blue-500 bg-blue-500 text-white rounded-sm">通过</button>
</div>
</div>
<div class="item title flex items-center justify-around border-b">
<div class="text-center" style="width: 30%">123456789</div>
<div class="text-center" style="width: 25%">薛思男</div>
<div class="text-center flex justify-center items-center" style="width: 40%">
<button class="btn mr-2 px-2 border border-blue-500 text-blue-500 rounded-sm">驳回</button>
<button class="btn px-2 border border-blue-500 bg-blue-500 text-white rounded-sm">通过</button>
</div>
</div>
</div>
</div>
<a-modal title="驳回原因" :visible="visible" @ok="handleOk" @cancel="handleCancel">
<textarea class="reject-con border border-gray-200 w-full rounded-sm p-2" v-model="modalText" placeholder="请输入驳回原因" />
</a-modal>
</div>
</template>
<script>
import { mapState } from 'vuex';
import { auditList, auditApply } from '@/config/api';
export default {
data() {
return {
timer: null,
lists: [],
playerId: '',
remark: '',
visible: false,
modalText: '',
showModal: false,
};
},
computed: mapState('home', ['projectId', 'userId', 'roleId']),
mounted() {
this.timer = setInterval(async () => {
if (this.projectId) {
clearInterval(this.timer);
await this.getAuditList();
}
}, 300);
},
methods: {
//
rejectModal() {
this.visible = true;
},
handleOk(e) {
this.remark = this.modalText;
this.visible = false;
this.auditApply(3);
},
handleCancel(e) {
this.visible = false;
},
/**
* 获取待审核结业申请列表
*/
async getAuditList() {
try {
const params = { param: { projectId: this.projectId } };
const res = await auditList();
const { code, msg, data } = res.data;
if (code === 200) {
this.lists = data;
} else {
this.$message.error(msg || '获取失败');
throw msg;
}
} catch (error) {
throw error || '获取失败';
}
},
/**
* 审核结业申请
*/
async auditApply(type) {
try {
const params = {
param: {
projectId: this.projectId,
playerId: this.playerId,
type: type,
remark: this.remark,
},
};
const res = await auditList();
const { code, msg, data } = res.data;
if (code === 200) {
this.getAuditList();
} else {
this.$message.error(msg || '获取失败');
throw msg;
}
} catch (error) {
throw error || '获取失败';
}
},
},
};
</script>
<style lang="scss" scoped>
.list-flex {
width: 100%;
min-height: 100vh;
background: #f3f3f3;
.title {
height: 48px;
line-height: 48px;
}
.item {
.btn {
height: 26px;
line-height: 24px;
}
}
}
</style>
Loading…
Cancel
Save