80f4f6c2 by 张猛

考点审核

1 parent d923ac96
...@@ -1495,7 +1495,7 @@ export function otherAdd(memId, ids) { ...@@ -1495,7 +1495,7 @@ export function otherAdd(memId, ids) {
1495 } 1495 }
1496 1496
1497 // 添加考官 1497 // 添加考官
1498 export function selfAdd(memId, ids) { 1498 export function selfAdd(ids) {
1499 return request({ 1499 return request({
1500 url: `/member/examiner/selfAdd/${ids}`, 1500 url: `/member/examiner/selfAdd/${ids}`,
1501 method: 'post' 1501 method: 'post'
......
...@@ -159,7 +159,7 @@ export function listInfo(query) { ...@@ -159,7 +159,7 @@ export function listInfo(query) {
159 */ 159 */
160 export function ztxAudit(params) { 160 export function ztxAudit(params) {
161 return request({ 161 return request({
162 url: `/member/examPointApply/audit/${params.ids}`, 162 url: `/member/examPointApply/audit/${params.ids}?flag=${params.flag}&selfSelect=${params.selfSelect}&reason=${params.reason}`,
163 method: 'post', 163 method: 'post',
164 params 164 params
165 }) 165 })
...@@ -172,7 +172,7 @@ export function ztxAudit(params) { ...@@ -172,7 +172,7 @@ export function ztxAudit(params) {
172 */ 172 */
173 export function shenAuditExamPointApply(params) { 173 export function shenAuditExamPointApply(params) {
174 return request({ 174 return request({
175 url: `/member/examPointApply/shenAudit/${params.ids}`, 175 url: `/member/examPointApply/shenAudit/${params.ids}?flag=${params.flag}&selfSelect=${params.selfSelect}&reason=${params.reason}`,
176 method: 'post', 176 method: 'post',
177 params 177 params
178 }) 178 })
......
...@@ -80,14 +80,27 @@ ...@@ -80,14 +80,27 @@
80 <text v-else>提交中...</text> 80 <text v-else>提交中...</text>
81 </button> 81 </button>
82 </view> 82 </view>
83
84
85 <!-- 自定义删除确认弹窗 -->
86 <uni-popup ref="delPopup" background-color="rgba(0,0,0,0.5)" type="center">
87 <view class="custom-modal">
88 <view class="modal-title">提示</view>
89 <view class="modal-content">确定删除该考官吗?</view>
90 <view class="modal-btns">
91 <button class="btn-cancel" @click="closeDelPopup()">取消</button>
92 <button class="btn-confirm" @click="confirmDel()">确定</button>
93 </view>
94 </view>
95 </uni-popup>
83 </view> 96 </view>
84 </template> 97 </template>
85 98
86 <script setup> 99 <script setup>
87 import * as api from '@/common/api_exam.js' 100 import * as api from '@/common/api_exam.js'
88 import {ref} from 'vue' 101 import {ref} from 'vue'
89 import {onLoad} from '@dcloudio/uni-app' 102 import {onLoad, onShow} from '@dcloudio/uni-app'
90 import {listApi} from "@/common/api.js"; 103 import {listApi, examinerDel} from "@/common/api.js";
91 104
92 105
93 const type = ref('single') // single 或 batch 106 const type = ref('single') // single 或 batch
...@@ -103,6 +116,14 @@ const form = ref({ ...@@ -103,6 +116,14 @@ const form = ref({
103 reason: '', 116 reason: '',
104 selfSelect: "1" 117 selfSelect: "1"
105 }) 118 })
119 const currentDelItem = ref({})
120 const delPopup = ref(null)
121
122 onShow(() => {
123 if (memId.value) {
124 getExaminer()
125 }
126 })
106 127
107 onLoad((options) => { 128 onLoad((options) => {
108 console.log(options) 129 console.log(options)
...@@ -151,6 +172,14 @@ function doSubmit() { ...@@ -151,6 +172,14 @@ function doSubmit() {
151 return 172 return
152 } 173 }
153 174
175 if (list.value.length == 0 && form.value.flag == 1 && selfSelect.value == 0) {
176 uni.showToast({
177 title: '请选择考官',
178 icon: 'none'
179 })
180 return
181 }
182
154 if (submitting.value) return 183 if (submitting.value) return
155 submitting.value = true 184 submitting.value = true
156 185
...@@ -196,6 +225,25 @@ function doSubmit() { ...@@ -196,6 +225,25 @@ function doSubmit() {
196 }) 225 })
197 } 226 }
198 } 227 }
228
229 // 删除考官:打开自定义弹窗
230 function handleDel(row) {
231 currentDelItem.value = row
232 delPopup.value.open()
233 }
234
235 function closeDelPopup() {
236 delPopup.value.close()
237 }
238
239 // 确认删除
240 async function confirmDel() {
241 await examinerDel(currentDelItem.value.id)
242 uni.showToast({title: '删除成功', icon: 'success'})
243 await getExaminer()
244 closeDelPopup()
245 }
246
199 </script> 247 </script>
200 248
201 <style lang="scss" scoped> 249 <style lang="scss" scoped>
...@@ -370,7 +418,7 @@ function doSubmit() { ...@@ -370,7 +418,7 @@ function doSubmit() {
370 margin-bottom: 70px; 418 margin-bottom: 70px;
371 } 419 }
372 420
373 examiner-item { 421 .examiner-item {
374 display: flex; 422 display: flex;
375 justify-content: space-between; 423 justify-content: space-between;
376 align-items: flex-start; 424 align-items: flex-start;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
18 <view class="info-row"> 18 <view class="info-row">
19 <text class="label">审核状态</text> 19 <text class="label">审核状态</text>
20 <text :class="getStatusClass(form.auditStatus)" class="value"> 20 <text :class="getStatusClass(form.auditStatus)" class="value">
21 {{ getStatusText(form.auditStatus) }} 21 {{ getStatusText(userType == 1 ? form.auditStatus : form.shenAuditStatus) }}
22 </text> 22 </text>
23 </view> 23 </view>
24 <view class="info-row"> 24 <view class="info-row">
...@@ -64,8 +64,8 @@ ...@@ -64,8 +64,8 @@
64 </view> 64 </view>
65 <view class="audit-row"> 65 <view class="audit-row">
66 <text class="audit-label">审核状态</text> 66 <text class="audit-label">审核状态</text>
67 <text :class="item.auditResult == 2 ? 'text-success' : 'text-danger'" class="audit-value"> 67 <text :class="item.auditResult == 1 ? 'text-success' : 'text-danger'" class="audit-value">
68 {{ item.auditResult == 2 ? '通过' : '拒绝' }} 68 {{ item.auditResult == 1 ? '通过' : '拒绝' }}
69 </text> 69 </text>
70 </view> 70 </view>
71 <view v-if="item.auditMsg" class="audit-row"> 71 <view v-if="item.auditMsg" class="audit-row">
...@@ -109,19 +109,21 @@ import * as api from '@/common/api_exam.js' ...@@ -109,19 +109,21 @@ import * as api from '@/common/api_exam.js'
109 import {ref} from 'vue' 109 import {ref} from 'vue'
110 import {onLoad} from '@dcloudio/uni-app' 110 import {onLoad} from '@dcloudio/uni-app'
111 111
112 const app = getApp()
112 const form = ref({}) 113 const form = ref({})
113 const auditList = ref([]) 114 const auditList = ref([])
114 const examinerList = ref([]) 115 const examinerList = ref([])
115 116 const userType = ref('')
116 const auditStatusMap = {1: '审核中', 2: '审核通过', 3: '审核拒绝'} 117 const auditStatusMap = {1: '审核中', 2: '审核通过', 3: '审核拒绝'}
117 118
118 onLoad((options) => { 119 onLoad((options) => {
120 userType.value = app.globalData.userType
119 if (options.item) { 121 if (options.item) {
120 try { 122 try {
121 const itemData = JSON.parse(decodeURIComponent(options.item)) 123 const itemData = JSON.parse(decodeURIComponent(options.item))
122 form.value = itemData 124 form.value = itemData
123 if (itemData.auditList) { 125 if (itemData.auditLogs) {
124 auditList.value = itemData.auditList 126 auditList.value = JSON.parse(itemData.auditLogs)
125 } 127 }
126 if (itemData.memId) { 128 if (itemData.memId) {
127 getExaminerList(itemData.memId) 129 getExaminerList(itemData.memId)
......
...@@ -83,8 +83,8 @@ ...@@ -83,8 +83,8 @@
83 <view class="item-top"> 83 <view class="item-top">
84 84
85 <text class="submit-time">{{ formatDate(item.commitTime) }} 提交</text> 85 <text class="submit-time">{{ formatDate(item.commitTime) }} 提交</text>
86 <text :class="getStatusClass(item.auditStatus)" class="status-tag"> 86 <text :class="getStatusClass(userType==1? item.auditStatus:item.shenAuditStatus)" class="status-tag">
87 {{ getStatusText(item.auditStatus) }} 87 {{ getStatusText(userType == 1 ? item.auditStatus : item.shenAuditStatus) }}
88 </text> 88 </text>
89 </view> 89 </view>
90 90
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
124 <view class="func"> 124 <view class="func">
125 <!-- <button class="btn-info" >查看</button> --> 125 <!-- <button class="btn-info" >查看</button> -->
126 <button 126 <button
127 v-if="item.auditStatus == 1" 127 v-if=" userType==1? item.auditStatus == 1:item.shenAuditStatus == 1 "
128 class="btn-info" 128 class="btn-info"
129 @click.stop="goAudit(item)" 129 @click.stop="goAudit(item)"
130 >审核 130 >审核
......
...@@ -127,20 +127,20 @@ function resetQuery() { ...@@ -127,20 +127,20 @@ function resetQuery() {
127 total.value = 0 127 total.value = 0
128 } 128 }
129 129
130 async function handleChoose(row) { 130 function handleChoose(row) {
131 debugger
132 if (checkChosen(row)) { 131 if (checkChosen(row)) {
133 return uni.showToast({title: '已选择该考官', icon: 'none'}) 132 return uni.showToast({title: '已选择该考官', icon: 'none'})
134 } 133 }
135 134 // 暂存当前考官数据
135 currentExpireItem.value = row
136 // 资质过期逻辑 136 // 资质过期逻辑
137 if (row.canChoose != 1) { 137 if (row.canChoose != 1) {
138 // 暂存当前考官数据
139 currentExpireItem.value = row
140 // 打开自定义过期确认弹窗 138 // 打开自定义过期确认弹窗
141 expirePopup.value.open() 139 expirePopup.value.open()
142 return 140 return
143 } 141 }
142 confirmAddExpireExaminer()
143
144 } 144 }
145 145
146 // 关闭过期确认弹窗 146 // 关闭过期确认弹窗
...@@ -151,24 +151,23 @@ function closeExpirePopup() { ...@@ -151,24 +151,23 @@ function closeExpirePopup() {
151 // 确认添加过期考官 151 // 确认添加过期考官
152 async function confirmAddExpireExaminer() { 152 async function confirmAddExpireExaminer() {
153 if (!currentExpireItem.value) return 153 if (!currentExpireItem.value) return
154
155 try { 154 try {
156 if (selfSelect.value == 1) { 155 if (selfSelect.value == 1) {
157 // 自己添 156 // 自己添
158 await api.selfAdd(currentExpireItem.value.perId) 157 await api.selfAdd(currentExpireItem.value.perId)
159 } else { 158 } else {
160 // 省级添加 159 // 省级添加
161 await api.otherAdd(memId.value, currentExpireItem.value.perId) 160 await api.otherAdd(memId.value, currentExpireItem.value.perId)
162 } 161 }
163
164 await api.otherAdd(memId.value, currentExpireItem.value.perId)
165 uni.showToast({title: '添加成功', icon: 'success'}) 162 uni.showToast({title: '添加成功', icon: 'success'})
166 uni.navigateBack({delta: 1}) 163 uni.navigateBack({delta: 1})
167 } catch (err) { 164 } catch (err) {
165 console.log(err)
168 uni.showToast({title: '添加失败', icon: 'none'}) 166 uni.showToast({title: '添加失败', icon: 'none'})
169 } finally { 167 } finally {
170 expirePopup.value.close() 168 expirePopup.value.close()
171 currentExpireItem.value = null 169 currentExpireItem.value = null
170 await getList()
172 } 171 }
173 } 172 }
174 </script> 173 </script>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!