55b06f5f by lttnew

考点申请

1 parent 51313627
1 // dev 1 // dev
2 // const baseUrl_api = 'http://192.168.1.137:8787' 2 // const baseUrl_api = 'http://192.168.1.125:8787'
3 const baseUrl_api = 'https://tk001.wxjylt.com/stage-api/' 3 const baseUrl_api = 'https://tk001.wxjylt.com/stage-api/'
4 const loginImage_api = 'http://tk001.wxjylt.com/stage-api' 4 const loginImage_api = 'http://tk001.wxjylt.com/stage-api'
5 const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do' 5 const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do'
......
1 <template> 1 <template>
2 <view class="container"> 2 <view class="container">
3 <!-- 搜索区域:固定在顶部 --> 3 <view class="loading-tip" v-if="loading">加载中...</view>
4 <view class="search-area"> 4 <view class="empty-tip" v-else-if="infoList.length === 0">暂无可添加的考官</view>
5 <view class="search-item">
6 <text>考官姓名:</text>
7 <input v-model="queryParams.name" class="search-input" placeholder="请输入考官姓名"/>
8 </view>
9 <view class="search-item">
10 <text>考官编号:</text>
11 <input v-model="queryParams.certCode" class="search-input" placeholder="请输入考官编号"/>
12 </view>
13 <view class="search-buttons">
14 <button class="search-btn" @click="handleQuery">查询</button>
15 <button class="reset-btn" @click="resetQuery">重置</button>
16 </view>
17 </view>
18 5
19 <view v-for="(item, index) in infoList" :key="item.perId" class="list-item"> 6 <checkbox-group class="examiner-list" @change="onCheckboxChange">
20 <view class="info"> 7 <label v-for="item in infoList" :key="item.perId" class="examiner-item">
21 <view class="name">{{ item.name }} {{ item.perCode }}</view> 8 <view class="item-left">
22 <view class="idc">证件号码:{{ item.idcCode }}</view> 9 <checkbox :value="item.perId.toString()" :checked="selectedIds.includes(item.perId.toString())" :disabled="checkChosen(item)" color="#C4121B" />
23 <view class="reg">注册地:{{ item.memName }}</view>
24 </view> 10 </view>
25 <button 11 <view class="item-info">
26 :class="{ disabled: checkChosen(item) }" 12 <view class="name">{{ item.perName }} </view>
27 :disabled="checkChosen(item)" 13 <view class="idc">会员号:{{ item.perCode }}</view>
28 class="choose-btn" 14 <view class="idc">证件号码:{{ item.perIdcCode }}</view>
29 @click="handleChoose(item)" 15 <view class="reg">注册地:{{ item.memName }}</view>
30 >
31 {{ checkChosen(item) ? '已选择' : '选择' }}
32 </button>
33 </view> 16 </view>
17 <view v-if="checkChosen(item)" class="chosen-tag">已添加</view>
18 </label>
19 </checkbox-group>
20
21 <view class="bottom-area">
22 <view class="selected-tip" v-if="selectedIds.length > 0">已选择 {{ selectedIds.length }} 位考官</view>
23 <view> <button class="add-btn" :disabled="selectedIds.length === 0" @click="handleAdd">添加</button></view>
34 24
35 <uni-popup ref="expirePopup" background-color="rgba(0,0,0,0.5)" type="center">
36 <view class="custom-modal">
37 <view class="modal-title">提示</view>
38 <view class="modal-content">该考官资质已过期,是否继续添加?</view>
39 <view class="modal-btns">
40 <button class="btn-cancel" @click="closeExpirePopup()">取消</button>
41 <button class="btn-confirm" @click="confirmAddExpireExaminer()">确定</button>
42 </view>
43 </view> 25 </view>
44 </uni-popup>
45 </view> 26 </view>
46 </template> 27 </template>
47 28
48 <script setup> 29 <script setup>
49 import {ref, reactive, toRefs} from 'vue' 30 import {ref} from 'vue'
50 import {onLoad} from '@dcloudio/uni-app'; 31 import { onLoad } from '@dcloudio/uni-app'
51 import * as api from '@/common/api.js' 32 import * as api from '@/common/api.js'
52 import _ from 'lodash'
53
54 const props = defineProps({
55 isValidity: {
56 type: String,
57 default: '0'
58 }
59 })
60 33
61 const isValidity = ref('0') 34 const loading = ref(true)
62 const memId = ref('')
63 const chosen = ref([])
64 const expirePopup = ref(null)
65 const currentExpireItem = ref(null)
66 const infoList = ref([]) 35 const infoList = ref([])
67 const loading = ref(false) 36 const chosen = ref([])
68 const total = ref(0) 37 const selectedIds = ref([])
69 const selfSelect = ref('0') 38 const memId = ref('')
70 const data = reactive({
71 queryParams: {
72 pageNum: 1,
73 pageSize: 10,
74 name: null,
75 certCode: null,
76 type: 1,
77 shenMemId: ''
78 }
79 })
80 const {queryParams} = toRefs(data)
81 39
82 onLoad((option) => { 40 onLoad((option) => {
83 console.log(option) 41 memId.value = option.memId || ''
84 isValidity.value = option.isValidity 42 chosen.value = option.chosen ? JSON.parse(option.chosen) : []
85 memId.value = option.memId 43 getList()
86 chosen.value = JSON.parse(option.chosen)
87 selfSelect.value = option.selfSelect ?? '1'
88 }) 44 })
89 45
90
91 // 获取考官列表
92 async function getList() { 46 async function getList() {
93 if (!queryParams.value.name)
94 return uni.showToast({title: '请输入考官姓名', icon: 'none'})
95 if (queryParams.value.type == 1 && !queryParams.value.certCode)
96 return uni.showToast({title: '请输入考官编号', icon: 'none'})
97
98 loading.value = true 47 loading.value = true
99 try { 48 try {
100 const res = await api.getCoachList(queryParams.value) 49 const res = await api.listApi({chooseFlag: 1})
101 infoList.value = res.rows || [] 50 infoList.value = res.rows || []
102 total.value = res.total || 0
103 } catch (err) { 51 } catch (err) {
104 console.error('获取考官列表失败:', err) 52 console.error('获取考官列表失败:', err)
105 infoList.value = [] 53 infoList.value = []
106 total.value = 0
107 } finally { 54 } finally {
108 loading.value = false 55 loading.value = false
109 } 56 }
110
111 // 空数组提示
112 if (infoList.value.length === 0) {
113 uni.showToast({title: '请核实考官编号、有效期及归属地', icon: 'none', duration: 2000})
114 }
115 }
116
117 // 检查是否已选择
118 function checkChosen(row) {
119 return _.some(chosen.value, (c) => {
120 return c.perId == row.perId
121 })
122 } 57 }
123 58
124 // 查询 59 function checkChosen(item) {
125 function handleQuery() { 60 return chosen.value.some(c => c.perId == item.perId)
126 queryParams.value.pageNum = 1
127 getList()
128 } 61 }
129 62
130 // 重置 63 function onCheckboxChange(e) {
131 function resetQuery() { 64 selectedIds.value = e.detail.value
132 queryParams.value.name = null
133 queryParams.value.certCode = null
134 infoList.value = []
135 total.value = 0
136 } 65 }
137 66
138 function handleChoose(row) { 67 function handleAdd() {
139 if (checkChosen(row)) { 68 if (selectedIds.value.length === 0) {
140 return uni.showToast({title: '已选择该考官', icon: 'none'}) 69 uni.showToast({title: '请先选择考官', icon: 'none'})
141 }
142 // 暂存当前考官数据
143 currentExpireItem.value = row
144 // 资质过期逻辑
145 if (row.canChoose != 1) {
146 // 打开自定义过期确认弹窗
147 expirePopup.value.open()
148 return 70 return
149 } 71 }
150 confirmAddExpireExaminer()
151 72
152 } 73 const ids = selectedIds.value.join(',')
153 74
154 // 关闭过期确认弹窗 75 uni.showLoading({title: '添加中...'})
155 function closeExpirePopup() { 76 api.selfAdd(ids).then(() => {
156 expirePopup.value.close() 77 uni.hideLoading()
157 }
158
159 // 确认添加过期考官
160 async function confirmAddExpireExaminer() {
161 if (!currentExpireItem.value) return
162 try {
163 if (selfSelect.value == 1) {
164 // 自己添
165 await api.selfAdd(currentExpireItem.value.perId)
166 } else {
167 // 省级添加
168 await api.otherAdd(memId.value, currentExpireItem.value.perId)
169 }
170 uni.showToast({title: '添加成功', icon: 'success'}) 78 uni.showToast({title: '添加成功', icon: 'success'})
171 uni.navigateBack({delta: 1}) 79 uni.navigateBack()
172 } catch (err) { 80 }).catch(err => {
173 console.log(err) 81 uni.hideLoading()
174 const errMsg = err?.data?.msg || err?.msg || '添加失败' 82 uni.showToast({title: err?.data?.msg || '添加失败', icon: 'none'})
175 uni.showToast({title: errMsg, icon: 'none', duration: 3000}) 83 })
176 } finally {
177 expirePopup.value.close()
178 currentExpireItem.value = null
179 await getList()
180 }
181 } 84 }
182 </script> 85 </script>
183 86
184 <style scoped> 87 <style scoped>
185 .container {
186 display: flex;
187 flex-direction: column;
188 background: #f7f7f7;
189 min-height: 100vh;
190 padding: 0;
191 }
192 88
193 .search-area {
194 background: #ffffff;
195 border-radius: 16rpx;
196 padding: 30rpx;
197 margin: 30rpx;
198 flex-shrink: 0;
199 }
200
201 .search-item {
202 display: flex;
203 align-items: center;
204 margin-bottom: 20rpx;
205 }
206
207 .search-input {
208 flex: 1;
209 border: 1rpx solid #ddd;
210 border-radius: 8rpx;
211 padding: 20rpx;
212 font-size: 28rpx;
213 }
214 89
215 .search-buttons { 90 .container {
216 display: flex; 91 min-height: 100vh;
217 justify-content: space-between; 92 background: #f7f7f7;
218 margin-top: 30rpx; 93 padding-bottom: 140rpx;
219 margin-left: 80px;
220 } 94 }
221 95
222 .search-btn, .reset-btn { 96 .loading-tip,
223 width: 220rpx; 97 .empty-tip {
224 height: 70rpx;
225 line-height: 70rpx;
226 border-radius: 8rpx;
227 text-align: center; 98 text-align: center;
99 padding: 100rpx 0;
228 font-size: 28rpx; 100 font-size: 28rpx;
101 color: #666;
229 } 102 }
230 103
231 .search-btn { 104 .examiner-list {
232 background: #C4121B; 105 background: #fff;
233 color: #fff;
234 }
235
236 .reset-btn {
237 background: #f7f7f7;
238 color: #333;
239 }
240
241 /* 列表区域:滚动 */
242 .list-area {
243 flex: 1;
244 background: #ffffff;
245 border-radius: 16rpx;
246 margin: 0 30rpx 30rpx;
247 padding: 0 30rpx;
248 } 106 }
249 107
250 .list-item { 108 .examiner-item {
109 display: flex;
110 align-items: center;
251 padding: 30rpx; 111 padding: 30rpx;
252 margin: 0 30rpx;
253 border-bottom: 1rpx solid #eee; 112 border-bottom: 1rpx solid #eee;
254 background-color: #fff;
255 } 113 }
256 114
257 .info { 115 .item-left {
116 margin-right: 20rpx;
117 }
118
119 .item-info {
258 flex: 1; 120 flex: 1;
259 } 121 }
260 122
...@@ -262,83 +124,60 @@ async function confirmAddExpireExaminer() { ...@@ -262,83 +124,60 @@ async function confirmAddExpireExaminer() {
262 font-size: 30rpx; 124 font-size: 30rpx;
263 font-weight: bold; 125 font-weight: bold;
264 color: #333; 126 color: #333;
127 margin-bottom: 10rpx;
265 } 128 }
266 129
267 .idc, .reg { 130 .idc, .reg {
268 font-size: 26rpx; 131 font-size: 24rpx;
269 color: #666; 132 color: #666;
270 margin: 20rpx 0; 133 margin-bottom: 6rpx;
271 }
272
273 .choose-btn {
274 color: #C4121B;
275 font-size: 26rpx;
276 border: 1rpx solid #C4121B;
277 border-radius: 8rpx;
278 padding: 10rpx 20rpx;
279 background-color: #fff;
280 margin: 10rpx auto;
281 } 134 }
282 135
283 .choose-btn.disabled { 136 .chosen-tag {
284 color: #ccc; 137 font-size: 24rpx;
285 border-color: #ccc; 138 color: #999;
139 background: #f5f5f5;
140 padding: 6rpx 16rpx;
141 border-radius: 4rpx;
286 } 142 }
287 143
288 /* 自定义弹窗样式(和之前保持统一) */ 144 .bottom-area {
289 .custom-modal { 145 position: fixed;
290 width: 600rpx; 146 bottom: 0;
147 left: 0;
148 right: 0;
291 background: #fff; 149 background: #fff;
292 border-radius: 20rpx; 150 padding: 20rpx 30rpx;
293 padding: 40rpx 30rpx; 151 padding-bottom: calc(20rpx + constant(safe-area-inset-bottom));
294 box-sizing: border-box; 152 padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
295 text-align: center; 153 border-top: 1rpx solid #eee;
296 }
297
298 .modal-title {
299 font-size: 36rpx;
300 font-weight: 600;
301 color: #333;
302 margin-bottom: 30rpx;
303 }
304
305 .modal-content {
306 font-size: 30rpx;
307 color: #666;
308 line-height: 1.6;
309 margin-bottom: 30rpx;
310 }
311
312 .modal-btns {
313 display: flex; 154 display: flex;
155 align-items: center;
314 justify-content: space-between; 156 justify-content: space-between;
315 gap: 20rpx;
316 } 157 }
317 158
318 .btn-cancel { 159 .selected-tip {
319 flex: 1; 160 font-size: 26rpx;
320 height: 80rpx; 161 color: #666;
321 line-height: 80rpx;
322 background: #f5f5f5;
323 color: #999;
324 border-radius: 40rpx;
325 font-size: 32rpx;
326 border: none;
327 } 162 }
328 163
329 .btn-confirm { 164 .add-btn {
330 flex: 1; 165 width: 200rpx;
331 height: 80rpx; 166 height: 70rpx;
332 line-height: 80rpx; 167 line-height: 70rpx;
333 background: #C4121B; 168 background: #C4121B;
334 color: #fff; 169 color: #fff;
335 border-radius: 40rpx; 170 font-size: 28rpx;
336 font-size: 32rpx; 171 border-radius: 35rpx;
337 border: none; 172 border: none;
338 } 173 }
339 174
340 /* 去除button默认边框 */ 175 .add-btn[disabled] {
341 .btn-cancel::after, .btn-confirm::after { 176 background: #ccc;
177 color: #fff;
178 }
179
180 .add-btn::after {
342 border: none; 181 border: none;
343 } 182 }
344 </style> 183 </style>
......
...@@ -135,7 +135,7 @@ function onSelfSelectChange(e) { ...@@ -135,7 +135,7 @@ function onSelfSelectChange(e) {
135 function handelAddExamine() { 135 function handelAddExamine() {
136 const chosenStr = JSON.stringify(list.value) 136 const chosenStr = JSON.stringify(list.value)
137 uni.navigateTo({ 137 uni.navigateTo({
138 url: `/myCenter/chooseExaminer?memId=${memId.value}&isValidity=0&chosen=${chosenStr}` 138 url: `/myCenter/chooseExaminer?memId=${memId.value}&chosen=${chosenStr}`
139 }) 139 })
140 } 140 }
141 141
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 <view class="exam-point-list"> 2 <view class="exam-point-list">
3 <!-- 顶部申请按钮 --> 3 <!-- 顶部申请按钮 -->
4 <view class="apply-btn-box"> 4 <view class="apply-btn-box">
5 <button class="apply-btn" :disabled="memberInfo.isPoints==0&&memberInfo.auditStatus==2" @click="goApply">申请考点</button> 5 <button class="apply-btn" :disabled="memberInfo.isPoints==0&&formInfo.auditStatus==2" @click="goApply">申请考点</button>
6 </view> 6 </view>
7 7
8 <!-- 列表 --> 8 <!-- 列表 -->
...@@ -59,6 +59,7 @@ const noMore = ref(false) ...@@ -59,6 +59,7 @@ const noMore = ref(false)
59 const pageNum = ref(1) 59 const pageNum = ref(1)
60 const pageSize = ref(10) 60 const pageSize = ref(10)
61 const memberInfo = app.globalData.memberInfo 61 const memberInfo = app.globalData.memberInfo
62 const formInfo = ref({})
62 onLoad(() => { 63 onLoad(() => {
63 loadData() 64 loadData()
64 }) 65 })
...@@ -68,6 +69,7 @@ function loadData() { ...@@ -68,6 +69,7 @@ function loadData() {
68 loading.value = true 69 loading.value = true
69 70
70 getMyRecent().then(res => { 71 getMyRecent().then(res => {
72 formInfo.value = res.data
71 if (res.data && res.data.auditLogs) { 73 if (res.data && res.data.auditLogs) {
72 try { 74 try {
73 list.value = JSON.parse(res.data.auditLogs) 75 list.value = JSON.parse(res.data.auditLogs)
......
...@@ -126,10 +126,10 @@ ...@@ -126,10 +126,10 @@
126 <image :src="config.baseUrl_api+'/fs/static/icon/25.png'"/> 126 <image :src="config.baseUrl_api+'/fs/static/icon/25.png'"/>
127 证书邮寄 127 证书邮寄
128 </view> 128 </view>
129 <view @click="goPath('/level/ztx/costSettlement')"> 129 <!-- <view @click="goPath('/level/ztx/costSettlement')">
130 <image :src="config.baseUrl_api+'/fs/static/icon/10.png'"/> 130 <image :src="config.baseUrl_api+'/fs/static/icon/10.png'"/>
131 证书下载 131 证书下载
132 </view> 132 </view> -->
133 <view @click="goPath('/personalVip/changeLevel')"> 133 <view @click="goPath('/personalVip/changeLevel')">
134 <image :src="config.baseUrl_api+'/fs/static/icon/26.png'"/> 134 <image :src="config.baseUrl_api+'/fs/static/icon/26.png'"/>
135 级位变更 135 级位变更
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!