61adfba3 by lttnew

成绩审核

1 parent a327b92b
......@@ -952,6 +952,21 @@ export function auditDuanExam(data) {
params: data
})
}
export function auditDuanScore(data) {
// 基础 URL
let url = `/exam/info/auditDuanScore/${data.ids}?flag=${data.flag}&ids=${data.ids}`;
// reason 有值才拼接
if (data.reason && data.reason.trim() !== '') {
url += `&reason=${data.reason}`;
}
return request({
url: url,
method: 'post',
params: data
})
}
export function doMergeFlows(params) {
return request({
......
......@@ -85,7 +85,7 @@
}, {
"path": "pages/rank/scoreAudit",
"style": {
"navigationBarTitleText": "成绩审核",
"navigationBarTitleText": "审核",
"enablePullDownRefresh": false
}
......
......@@ -122,7 +122,7 @@
function goApproval(item) {
uni.navigateTo({
url: `/pages/rank/scoreAudit?ids=${item.examId}`
url: `/pages/rank/scoreAudit?ids=${item.examId}&pageType=2`
})
}
</script>
......
......@@ -13,7 +13,7 @@
<view @click="goDetail(item)">
<view class="status">
<text :class="{
'text-primary-bg': item.scoreStatus=='0',
'text-primary-bg': item.scoreStatus=='1',
'text-success-bg': item.scoreStatus=='2',
'text-danger-bg': item.scoreStatus=='3',
'text-warning-bg': item.scoreStatus=='4'
......@@ -122,7 +122,7 @@
function goApproval(item) {
uni.navigateTo({
url: `/pages/rank/scoreAudit?ids=${item.examId}`
url: `/pages/rank/scoreAudit?ids=${item.examId}&pageType=2`
})
}
......
......@@ -50,6 +50,7 @@
const ids = ref('')
const submitting = ref(false)
const pageType = ref('')
const form = ref({
flag: '1',
......@@ -57,6 +58,7 @@
})
onLoad((options) => {
pageType.value = options.pageType || ''
if (options.ids) ids.value = options.ids
})
......@@ -68,7 +70,8 @@
form.value.flag = e.detail.value
}
function doSubmit() {
async function doSubmit() {
// 拒绝时必须填理由
if (form.value.flag == '0' && !form.value.reason) {
uni.showToast({ title: '请输入拒绝理由', icon: 'none' })
return
......@@ -76,21 +79,33 @@
if (submitting.value) return
submitting.value = true
const params = {
ids: ids.value,
flag: form.value.flag,
reason: form.value.reason || ''
}
if(!form.value.reason ){
delete params.reason
}
api.auditDuanExam(params).then(res => {
ids: ids.value,
flag: form.value.flag,
reason: form.value.reason || ''
}
if(!params.reason){
delete params.reason
}
try {
// 根据 pageType 自动切换接口
if (pageType.value == '1') {
await api.auditDuanExam(params);
} else if (pageType.value == '2') {
await api.auditDuanScore(params);
} else {
uni.showToast({ title: '页面类型错误', icon: 'none' });
submitting.value = false;
return;
}
uni.showToast({ title: '操作成功', icon: 'success' })
setTimeout(() => { uni.navigateBack() }, 1500)
}).catch(err => {
} catch (err) {
console.error('审核失败', err)
uni.showToast({ title: '操作失败', icon: 'none' })
submitting.value = false
})
}
}
</script>
......@@ -219,4 +234,4 @@
}
}
}
</style>
</style>
\ No newline at end of file
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!