成绩审核
Showing
5 changed files
with
46 additions
and
16 deletions
| ... | @@ -952,6 +952,21 @@ export function auditDuanExam(data) { | ... | @@ -952,6 +952,21 @@ export function auditDuanExam(data) { |
| 952 | params: data | 952 | params: data |
| 953 | }) | 953 | }) |
| 954 | } | 954 | } |
| 955 | export function auditDuanScore(data) { | ||
| 956 | // 基础 URL | ||
| 957 | let url = `/exam/info/auditDuanScore/${data.ids}?flag=${data.flag}&ids=${data.ids}`; | ||
| 958 | |||
| 959 | // reason 有值才拼接 | ||
| 960 | if (data.reason && data.reason.trim() !== '') { | ||
| 961 | url += `&reason=${data.reason}`; | ||
| 962 | } | ||
| 963 | |||
| 964 | return request({ | ||
| 965 | url: url, | ||
| 966 | method: 'post', | ||
| 967 | params: data | ||
| 968 | }) | ||
| 969 | } | ||
| 955 | 970 | ||
| 956 | export function doMergeFlows(params) { | 971 | export function doMergeFlows(params) { |
| 957 | return request({ | 972 | return request({ | ... | ... |
| ... | @@ -85,7 +85,7 @@ | ... | @@ -85,7 +85,7 @@ |
| 85 | }, { | 85 | }, { |
| 86 | "path": "pages/rank/scoreAudit", | 86 | "path": "pages/rank/scoreAudit", |
| 87 | "style": { | 87 | "style": { |
| 88 | "navigationBarTitleText": "成绩审核", | 88 | "navigationBarTitleText": "审核", |
| 89 | "enablePullDownRefresh": false | 89 | "enablePullDownRefresh": false |
| 90 | } | 90 | } |
| 91 | 91 | ... | ... |
| ... | @@ -122,7 +122,7 @@ | ... | @@ -122,7 +122,7 @@ |
| 122 | 122 | ||
| 123 | function goApproval(item) { | 123 | function goApproval(item) { |
| 124 | uni.navigateTo({ | 124 | uni.navigateTo({ |
| 125 | url: `/pages/rank/scoreAudit?ids=${item.examId}` | 125 | url: `/pages/rank/scoreAudit?ids=${item.examId}&pageType=2` |
| 126 | }) | 126 | }) |
| 127 | } | 127 | } |
| 128 | </script> | 128 | </script> | ... | ... |
| ... | @@ -13,7 +13,7 @@ | ... | @@ -13,7 +13,7 @@ |
| 13 | <view @click="goDetail(item)"> | 13 | <view @click="goDetail(item)"> |
| 14 | <view class="status"> | 14 | <view class="status"> |
| 15 | <text :class="{ | 15 | <text :class="{ |
| 16 | 'text-primary-bg': item.scoreStatus=='0', | 16 | 'text-primary-bg': item.scoreStatus=='1', |
| 17 | 'text-success-bg': item.scoreStatus=='2', | 17 | 'text-success-bg': item.scoreStatus=='2', |
| 18 | 'text-danger-bg': item.scoreStatus=='3', | 18 | 'text-danger-bg': item.scoreStatus=='3', |
| 19 | 'text-warning-bg': item.scoreStatus=='4' | 19 | 'text-warning-bg': item.scoreStatus=='4' |
| ... | @@ -122,7 +122,7 @@ | ... | @@ -122,7 +122,7 @@ |
| 122 | 122 | ||
| 123 | function goApproval(item) { | 123 | function goApproval(item) { |
| 124 | uni.navigateTo({ | 124 | uni.navigateTo({ |
| 125 | url: `/pages/rank/scoreAudit?ids=${item.examId}` | 125 | url: `/pages/rank/scoreAudit?ids=${item.examId}&pageType=2` |
| 126 | }) | 126 | }) |
| 127 | } | 127 | } |
| 128 | 128 | ... | ... |
| ... | @@ -50,6 +50,7 @@ | ... | @@ -50,6 +50,7 @@ |
| 50 | 50 | ||
| 51 | const ids = ref('') | 51 | const ids = ref('') |
| 52 | const submitting = ref(false) | 52 | const submitting = ref(false) |
| 53 | const pageType = ref('') | ||
| 53 | 54 | ||
| 54 | const form = ref({ | 55 | const form = ref({ |
| 55 | flag: '1', | 56 | flag: '1', |
| ... | @@ -57,6 +58,7 @@ | ... | @@ -57,6 +58,7 @@ |
| 57 | }) | 58 | }) |
| 58 | 59 | ||
| 59 | onLoad((options) => { | 60 | onLoad((options) => { |
| 61 | pageType.value = options.pageType || '' | ||
| 60 | if (options.ids) ids.value = options.ids | 62 | if (options.ids) ids.value = options.ids |
| 61 | }) | 63 | }) |
| 62 | 64 | ||
| ... | @@ -68,7 +70,8 @@ | ... | @@ -68,7 +70,8 @@ |
| 68 | form.value.flag = e.detail.value | 70 | form.value.flag = e.detail.value |
| 69 | } | 71 | } |
| 70 | 72 | ||
| 71 | function doSubmit() { | 73 | async function doSubmit() { |
| 74 | // 拒绝时必须填理由 | ||
| 72 | if (form.value.flag == '0' && !form.value.reason) { | 75 | if (form.value.flag == '0' && !form.value.reason) { |
| 73 | uni.showToast({ title: '请输入拒绝理由', icon: 'none' }) | 76 | uni.showToast({ title: '请输入拒绝理由', icon: 'none' }) |
| 74 | return | 77 | return |
| ... | @@ -76,21 +79,33 @@ | ... | @@ -76,21 +79,33 @@ |
| 76 | if (submitting.value) return | 79 | if (submitting.value) return |
| 77 | submitting.value = true | 80 | submitting.value = true |
| 78 | const params = { | 81 | const params = { |
| 79 | ids: ids.value, | 82 | ids: ids.value, |
| 80 | flag: form.value.flag, | 83 | flag: form.value.flag, |
| 81 | reason: form.value.reason || '' | 84 | reason: form.value.reason || '' |
| 82 | } | 85 | } |
| 83 | if(!form.value.reason ){ | 86 | if(!params.reason){ |
| 84 | delete params.reason | 87 | delete params.reason |
| 85 | } | 88 | } |
| 86 | api.auditDuanExam(params).then(res => { | 89 | |
| 90 | try { | ||
| 91 | // 根据 pageType 自动切换接口 | ||
| 92 | if (pageType.value == '1') { | ||
| 93 | await api.auditDuanExam(params); | ||
| 94 | } else if (pageType.value == '2') { | ||
| 95 | await api.auditDuanScore(params); | ||
| 96 | } else { | ||
| 97 | uni.showToast({ title: '页面类型错误', icon: 'none' }); | ||
| 98 | submitting.value = false; | ||
| 99 | return; | ||
| 100 | } | ||
| 101 | |||
| 87 | uni.showToast({ title: '操作成功', icon: 'success' }) | 102 | uni.showToast({ title: '操作成功', icon: 'success' }) |
| 88 | setTimeout(() => { uni.navigateBack() }, 1500) | 103 | setTimeout(() => { uni.navigateBack() }, 1500) |
| 89 | }).catch(err => { | 104 | } catch (err) { |
| 90 | console.error('审核失败', err) | 105 | console.error('审核失败', err) |
| 91 | uni.showToast({ title: '操作失败', icon: 'none' }) | 106 | uni.showToast({ title: '操作失败', icon: 'none' }) |
| 92 | submitting.value = false | 107 | submitting.value = false |
| 93 | }) | 108 | } |
| 94 | } | 109 | } |
| 95 | </script> | 110 | </script> |
| 96 | 111 | ||
| ... | @@ -219,4 +234,4 @@ | ... | @@ -219,4 +234,4 @@ |
| 219 | } | 234 | } |
| 220 | } | 235 | } |
| 221 | } | 236 | } |
| 222 | </style> | 237 | </style> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment