forked from TALL/check-work
4 changed files with 328 additions and 1 deletions
@ -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> |
@ -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…
Reference in new issue