80f4f6c2 by 张猛

考点审核

1 parent d923ac96
......@@ -1495,7 +1495,7 @@ export function otherAdd(memId, ids) {
}
// 添加考官
export function selfAdd(memId, ids) {
export function selfAdd(ids) {
return request({
url: `/member/examiner/selfAdd/${ids}`,
method: 'post'
......
......@@ -159,7 +159,7 @@ export function listInfo(query) {
*/
export function ztxAudit(params) {
return request({
url: `/member/examPointApply/audit/${params.ids}`,
url: `/member/examPointApply/audit/${params.ids}?flag=${params.flag}&selfSelect=${params.selfSelect}&reason=${params.reason}`,
method: 'post',
params
})
......@@ -172,7 +172,7 @@ export function ztxAudit(params) {
*/
export function shenAuditExamPointApply(params) {
return request({
url: `/member/examPointApply/shenAudit/${params.ids}`,
url: `/member/examPointApply/shenAudit/${params.ids}?flag=${params.flag}&selfSelect=${params.selfSelect}&reason=${params.reason}`,
method: 'post',
params
})
......
......@@ -80,14 +80,27 @@
<text v-else>提交中...</text>
</button>
</view>
<!-- 自定义删除确认弹窗 -->
<uni-popup ref="delPopup" background-color="rgba(0,0,0,0.5)" type="center">
<view class="custom-modal">
<view class="modal-title">提示</view>
<view class="modal-content">确定删除该考官吗?</view>
<view class="modal-btns">
<button class="btn-cancel" @click="closeDelPopup()">取消</button>
<button class="btn-confirm" @click="confirmDel()">确定</button>
</view>
</view>
</uni-popup>
</view>
</template>
<script setup>
import * as api from '@/common/api_exam.js'
import {ref} from 'vue'
import {onLoad} from '@dcloudio/uni-app'
import {listApi} from "@/common/api.js";
import {onLoad, onShow} from '@dcloudio/uni-app'
import {listApi, examinerDel} from "@/common/api.js";
const type = ref('single') // single 或 batch
......@@ -103,6 +116,14 @@ const form = ref({
reason: '',
selfSelect: "1"
})
const currentDelItem = ref({})
const delPopup = ref(null)
onShow(() => {
if (memId.value) {
getExaminer()
}
})
onLoad((options) => {
console.log(options)
......@@ -151,6 +172,14 @@ function doSubmit() {
return
}
if (list.value.length == 0 && form.value.flag == 1 && selfSelect.value == 0) {
uni.showToast({
title: '请选择考官',
icon: 'none'
})
return
}
if (submitting.value) return
submitting.value = true
......@@ -196,6 +225,25 @@ function doSubmit() {
})
}
}
// 删除考官:打开自定义弹窗
function handleDel(row) {
currentDelItem.value = row
delPopup.value.open()
}
function closeDelPopup() {
delPopup.value.close()
}
// 确认删除
async function confirmDel() {
await examinerDel(currentDelItem.value.id)
uni.showToast({title: '删除成功', icon: 'success'})
await getExaminer()
closeDelPopup()
}
</script>
<style lang="scss" scoped>
......@@ -370,7 +418,7 @@ function doSubmit() {
margin-bottom: 70px;
}
examiner-item {
.examiner-item {
display: flex;
justify-content: space-between;
align-items: flex-start;
......
......@@ -18,7 +18,7 @@
<view class="info-row">
<text class="label">审核状态</text>
<text :class="getStatusClass(form.auditStatus)" class="value">
{{ getStatusText(form.auditStatus) }}
{{ getStatusText(userType == 1 ? form.auditStatus : form.shenAuditStatus) }}
</text>
</view>
<view class="info-row">
......@@ -64,8 +64,8 @@
</view>
<view class="audit-row">
<text class="audit-label">审核状态</text>
<text :class="item.auditResult == 2 ? 'text-success' : 'text-danger'" class="audit-value">
{{ item.auditResult == 2 ? '通过' : '拒绝' }}
<text :class="item.auditResult == 1 ? 'text-success' : 'text-danger'" class="audit-value">
{{ item.auditResult == 1 ? '通过' : '拒绝' }}
</text>
</view>
<view v-if="item.auditMsg" class="audit-row">
......@@ -109,19 +109,21 @@ import * as api from '@/common/api_exam.js'
import {ref} from 'vue'
import {onLoad} from '@dcloudio/uni-app'
const app = getApp()
const form = ref({})
const auditList = ref([])
const examinerList = ref([])
const userType = ref('')
const auditStatusMap = {1: '审核中', 2: '审核通过', 3: '审核拒绝'}
onLoad((options) => {
userType.value = app.globalData.userType
if (options.item) {
try {
const itemData = JSON.parse(decodeURIComponent(options.item))
form.value = itemData
if (itemData.auditList) {
auditList.value = itemData.auditList
if (itemData.auditLogs) {
auditList.value = JSON.parse(itemData.auditLogs)
}
if (itemData.memId) {
getExaminerList(itemData.memId)
......
......@@ -83,8 +83,8 @@
<view class="item-top">
<text class="submit-time">{{ formatDate(item.commitTime) }} 提交</text>
<text :class="getStatusClass(item.auditStatus)" class="status-tag">
{{ getStatusText(item.auditStatus) }}
<text :class="getStatusClass(userType==1? item.auditStatus:item.shenAuditStatus)" class="status-tag">
{{ getStatusText(userType == 1 ? item.auditStatus : item.shenAuditStatus) }}
</text>
</view>
......@@ -124,7 +124,7 @@
<view class="func">
<!-- <button class="btn-info" >查看</button> -->
<button
v-if="item.auditStatus == 1"
v-if=" userType==1? item.auditStatus == 1:item.shenAuditStatus == 1 "
class="btn-info"
@click.stop="goAudit(item)"
>审核
......
......@@ -127,20 +127,20 @@ function resetQuery() {
total.value = 0
}
async function handleChoose(row) {
debugger
function handleChoose(row) {
if (checkChosen(row)) {
return uni.showToast({title: '已选择该考官', icon: 'none'})
}
// 资质过期逻辑
if (row.canChoose != 1) {
// 暂存当前考官数据
currentExpireItem.value = row
// 资质过期逻辑
if (row.canChoose != 1) {
// 打开自定义过期确认弹窗
expirePopup.value.open()
return
}
confirmAddExpireExaminer()
}
// 关闭过期确认弹窗
......@@ -151,24 +151,23 @@ function closeExpirePopup() {
// 确认添加过期考官
async function confirmAddExpireExaminer() {
if (!currentExpireItem.value) return
try {
if (selfSelect.value == 1) {
// 自己添
// 自己添
await api.selfAdd(currentExpireItem.value.perId)
} else {
// 省级添加
await api.otherAdd(memId.value, currentExpireItem.value.perId)
}
await api.otherAdd(memId.value, currentExpireItem.value.perId)
uni.showToast({title: '添加成功', icon: 'success'})
uni.navigateBack({delta: 1})
} catch (err) {
console.log(err)
uni.showToast({title: '添加失败', icon: 'none'})
} finally {
expirePopup.value.close()
currentExpireItem.value = null
await getList()
}
}
</script>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!