培训报名规则修改
Showing
4 changed files
with
218 additions
and
130 deletions
| ... | @@ -48,21 +48,21 @@ | ... | @@ -48,21 +48,21 @@ |
| 48 | </template> | 48 | </template> |
| 49 | 49 | ||
| 50 | <script setup> | 50 | <script setup> |
| 51 | import { | 51 | import { |
| 52 | onLoad | 52 | onLoad |
| 53 | } from '@dcloudio/uni-app' | 53 | } from '@dcloudio/uni-app' |
| 54 | import { | 54 | import { |
| 55 | ref, | 55 | ref, |
| 56 | reactive, | 56 | reactive, |
| 57 | toRefs, | 57 | toRefs, |
| 58 | computed, | 58 | computed, |
| 59 | watch | 59 | watch |
| 60 | } from 'vue' | 60 | } from 'vue' |
| 61 | import _ from 'lodash' | 61 | import _ from 'lodash' |
| 62 | import * as train from '@/training/train.js' | 62 | import * as train from '@/training/train.js' |
| 63 | 63 | ||
| 64 | const emit = defineEmits(['prev', 'next']) | 64 | const emit = defineEmits(['prev', 'next']) |
| 65 | const props = defineProps({ | 65 | const props = defineProps({ |
| 66 | activity: { | 66 | activity: { |
| 67 | type: Object, | 67 | type: Object, |
| 68 | default: () => {} | 68 | default: () => {} |
| ... | @@ -73,20 +73,20 @@ | ... | @@ -73,20 +73,20 @@ |
| 73 | }, | 73 | }, |
| 74 | active: { | 74 | active: { |
| 75 | type: Number, | 75 | type: Number, |
| 76 | default: () => {} | 76 | default: 0 |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | }) | 79 | }) |
| 80 | 80 | ||
| 81 | const customInfo = computed(() => { | 81 | const customInfo = computed(() => { |
| 82 | if (props.activity.customInfo) { | 82 | if (props.activity.customInfo) { |
| 83 | return JSON.parse(props.activity.customInfo).info | 83 | return JSON.parse(props.activity.customInfo).info |
| 84 | } else { | 84 | } else { |
| 85 | return [] | 85 | return [] |
| 86 | } | 86 | } |
| 87 | }) | 87 | }) |
| 88 | 88 | ||
| 89 | const data = reactive({ | 89 | const data = reactive({ |
| 90 | form: { | 90 | form: { |
| 91 | invoiceFlag: '1', | 91 | invoiceFlag: '1', |
| 92 | customInfoObj: {} | 92 | customInfoObj: {} |
| ... | @@ -108,29 +108,28 @@ | ... | @@ -108,29 +108,28 @@ |
| 108 | value: 2, | 108 | value: 2, |
| 109 | text: '纸质普票' | 109 | text: '纸质普票' |
| 110 | }] | 110 | }] |
| 111 | }) | 111 | }) |
| 112 | const { | 112 | const { |
| 113 | form, | 113 | form, |
| 114 | invoiceType, | 114 | invoiceType, |
| 115 | invoiceFlag | 115 | invoiceFlag |
| 116 | } = toRefs(data) | 116 | } = toRefs(data) |
| 117 | 117 | ||
| 118 | watch(() => props.activity.invoiceFlag, (val) => { | 118 | watch(() => props.activity.invoiceFlag, (val) => { |
| 119 | if (val == '1') { | 119 | if (val == '1') { |
| 120 | if (!form.value.invoiceType) { | 120 | if (!form.value.invoiceType) { |
| 121 | form.value.invoiceType = _.orderBy(props.activity.invoiceType.split(','))[0] | 121 | form.value.invoiceType = _.orderBy(props.activity.invoiceType.split(','))[0] |
| 122 | } | 122 | } |
| 123 | } | 123 | } |
| 124 | }, { | 124 | }, { |
| 125 | immediate: true | 125 | immediate: true |
| 126 | }) | 126 | }) |
| 127 | watch(() => props.active, (val) => { | 127 | watch(() => props.active, (val) => { |
| 128 | if (val == 2) { | 128 | if (val == 2) { |
| 129 | uni.showLoading({ | 129 | uni.showLoading({ |
| 130 | title:'加载中' | 130 | title:'加载中' |
| 131 | }) | 131 | }) |
| 132 | train.getTrainPersonalInfo(props.trainId).then(res => { | 132 | train.getTrainPersonalInfo(props.trainId).then(res => { |
| 133 | |||
| 134 | form.value = res.data || {} | 133 | form.value = res.data || {} |
| 135 | if (res.data?.customInfo) { | 134 | if (res.data?.customInfo) { |
| 136 | form.value.customInfoObj = JSON.parse(res.data.customInfo) | 135 | form.value.customInfoObj = JSON.parse(res.data.customInfo) |
| ... | @@ -138,16 +137,15 @@ | ... | @@ -138,16 +137,15 @@ |
| 138 | form.value.customInfoObj = {} | 137 | form.value.customInfoObj = {} |
| 139 | } | 138 | } |
| 140 | uni.hideLoading() | 139 | uni.hideLoading() |
| 141 | |||
| 142 | }) | 140 | }) |
| 143 | } | 141 | } |
| 144 | }) | 142 | }) |
| 145 | 143 | ||
| 146 | function prev() { | 144 | function prev() { |
| 147 | emit('prev') | 145 | emit('prev') |
| 148 | } | 146 | } |
| 149 | 147 | ||
| 150 | function next() { | 148 | function next() { |
| 151 | // 判断必填 | 149 | // 判断必填 |
| 152 | if(!form.value.unitName){ | 150 | if(!form.value.unitName){ |
| 153 | uni.showToast({ | 151 | uni.showToast({ |
| ... | @@ -173,7 +171,7 @@ | ... | @@ -173,7 +171,7 @@ |
| 173 | emit('next') | 171 | emit('next') |
| 174 | }) | 172 | }) |
| 175 | }) | 173 | }) |
| 176 | } | 174 | } |
| 177 | </script> | 175 | </script> |
| 178 | 176 | ||
| 179 | <style scoped lang="scss"> | 177 | <style scoped lang="scss"> | ... | ... |
| ... | @@ -46,12 +46,17 @@ | ... | @@ -46,12 +46,17 @@ |
| 46 | </view> | 46 | </view> |
| 47 | <view class="date"> | 47 | <view class="date"> |
| 48 | <text>报名限制条件:</text> | 48 | <text>报名限制条件:</text> |
| 49 | <text v-if="signRules[t.twoSubjectId]?.openFlag"> | 49 | <text v-if="openFlag && signRules[t.twoSubjectId]"> |
| 50 | <text v-if="t.subjectType=='0'"> | ||
| 50 | <text>等级</text><text>{{ signRules[t.twoSubjectId]?.name }}</text> | 51 | <text>等级</text><text>{{ signRules[t.twoSubjectId]?.name }}</text> |
| 51 | <text>段位</text><text>{{ signRules[t.twoSubjectId]?.duanStr }}</text> | 52 | <text>段位</text><text>{{ signRules[t.twoSubjectId]?.duanStr }}</text> |
| 52 | <text>年限</text><text>{{ signRules[t.twoSubjectId]?.limitStr }}</text> | 53 | <text>年限</text><text>{{ signRules[t.twoSubjectId]?.limitStr }}</text> |
| 53 | </text> | 54 | </text> |
| 54 | <text v-else> | 55 | <text v-else> |
| 56 | <text>等级</text><text>{{ signRules2[t.twoSubjectId]?.name }}</text> | ||
| 57 | </text> | ||
| 58 | </text> | ||
| 59 | <text v-else> | ||
| 55 | -- | 60 | -- |
| 56 | </text> | 61 | </text> |
| 57 | </view> | 62 | </view> |
| ... | @@ -76,12 +81,17 @@ | ... | @@ -76,12 +81,17 @@ |
| 76 | </view> | 81 | </view> |
| 77 | <view class="date"> | 82 | <view class="date"> |
| 78 | <text>报名限制条件:</text> | 83 | <text>报名限制条件:</text> |
| 79 | <text v-if="signRules[t.twoSubjectId]?.openFlag"> | 84 | <text v-if="openFlag && signRules[t.twoSubjectId]"> |
| 80 | <text>等级</text><text>{{ signRules[t.twoSubjectId]?.name }}</text> | 85 | <text v-if="t.subjectType=='0'"> |
| 81 | <text>段位</text><text>{{ signRules[t.twoSubjectId]?.duanStr }}</text> | 86 | <text>等级</text><text>{{ signRules[t.twoSubjectId]?.name }}、</text> |
| 87 | <text>段位</text><text>{{ signRules[t.twoSubjectId]?.duanStr }}、</text> | ||
| 82 | <text>年限</text><text>{{ signRules[t.twoSubjectId]?.limitStr }}</text> | 88 | <text>年限</text><text>{{ signRules[t.twoSubjectId]?.limitStr }}</text> |
| 83 | </text> | 89 | </text> |
| 84 | <text v-else> | 90 | <text v-else> |
| 91 | <text>等级</text><text>{{ signRules2[t.twoSubjectId]?.name }}</text> | ||
| 92 | </text> | ||
| 93 | </text> | ||
| 94 | <text v-else> | ||
| 85 | -- | 95 | -- |
| 86 | </text> | 96 | </text> |
| 87 | </view> | 97 | </view> |
| ... | @@ -124,36 +134,44 @@ | ... | @@ -124,36 +134,44 @@ |
| 124 | </template> | 134 | </template> |
| 125 | 135 | ||
| 126 | <script setup> | 136 | <script setup> |
| 127 | import { | 137 | import { |
| 128 | onLoad | 138 | onLoad |
| 129 | } from '@dcloudio/uni-app' | 139 | } from '@dcloudio/uni-app' |
| 130 | import _ from 'lodash' | 140 | import _ from 'lodash' |
| 131 | import { | 141 | import { |
| 132 | ref, | 142 | ref, |
| 133 | reactive, | 143 | reactive, |
| 134 | toRefs, | 144 | toRefs, |
| 135 | computed, | 145 | computed, |
| 136 | watch | 146 | watch, |
| 137 | } from 'vue' | 147 | onMounted |
| 138 | import * as train from '@/training/train.js' | 148 | } from 'vue' |
| 149 | import * as train from '@/training/train.js' | ||
| 139 | import trainListVue from '../trainList.vue'; | 150 | import trainListVue from '../trainList.vue'; |
| 140 | const data = reactive({ | 151 | |
| 152 | const data = reactive({ | ||
| 141 | form: { | 153 | form: { |
| 142 | trainIds: [], | 154 | trainIds: [], |
| 143 | examIds: [] | 155 | examIds: [] |
| 144 | }, | 156 | }, |
| 145 | signRules: {}, | 157 | signRules: {}, // 晋级 |
| 158 | signRules2: {}, // 复训 | ||
| 146 | bankShow: null, | 159 | bankShow: null, |
| 147 | totalAmount: null | 160 | totalAmount: null, |
| 148 | }) | 161 | openFlag:false |
| 149 | const { | 162 | }) |
| 163 | const { | ||
| 150 | form, | 164 | form, |
| 151 | signRules, | 165 | signRules, |
| 166 | signRules2, | ||
| 152 | bankShow, | 167 | bankShow, |
| 153 | totalAmount | 168 | totalAmount, |
| 154 | } = toRefs(data) | 169 | openFlag |
| 155 | const emit = defineEmits(['prev', 'publish']) | 170 | } = toRefs(data) |
| 156 | const props = defineProps({ | 171 | |
| 172 | |||
| 173 | const emit = defineEmits(['prev', 'publish']) | ||
| 174 | const props = defineProps({ | ||
| 157 | activity: { | 175 | activity: { |
| 158 | type: Object, | 176 | type: Object, |
| 159 | default: () => {} | 177 | default: () => {} |
| ... | @@ -173,32 +191,56 @@ import trainListVue from '../trainList.vue'; | ... | @@ -173,32 +191,56 @@ import trainListVue from '../trainList.vue'; |
| 173 | trainId: { | 191 | trainId: { |
| 174 | type: String, | 192 | type: String, |
| 175 | default: () => {} | 193 | default: () => {} |
| 194 | }, | ||
| 195 | active: { | ||
| 196 | type: Number, | ||
| 197 | default: 0 | ||
| 176 | } | 198 | } |
| 177 | }) | 199 | }) |
| 178 | const bankInfo = computed(() => { | 200 | const bankInfo = computed(() => { |
| 179 | if (props.activity.receivingInfo) { | 201 | if (props.activity.receivingInfo) { |
| 180 | return JSON.parse(props.activity.receivingInfo) | 202 | return JSON.parse(props.activity.receivingInfo) |
| 181 | } else { | 203 | } else { |
| 182 | return {} | 204 | return {} |
| 183 | } | 205 | } |
| 206 | }) | ||
| 207 | |||
| 208 | watch(() => props.active, (val) => { | ||
| 209 | if (val == 3) { | ||
| 210 | uni.showLoading({ | ||
| 211 | title:'加载中' | ||
| 184 | }) | 212 | }) |
| 185 | onLoad(options => { | 213 | getRules().then(()=>{ |
| 186 | getRules() | 214 | uni.hideLoading() |
| 187 | }) | 215 | }) |
| 216 | } | ||
| 217 | }) | ||
| 218 | |||
| 188 | 219 | ||
| 189 | function getRules() { | 220 | |
| 190 | Promise.all([ | 221 | function getRules() { |
| 191 | train.getCoachRules(), | 222 | return train.getAllRules(props.trainId).then((res) => { |
| 192 | train.getRefereeRules(), | 223 | openFlag.value = res.data.openFlag |
| 193 | train.getExaminerJiRules(), | 224 | _.each(res.data.rules, (r) => { |
| 194 | train.getExaminerDuanRules() | 225 | // 晋级 |
| 195 | ]).then((res) => { | 226 | if (r.subjectType == '0') { |
| 196 | _.each(res, (r) => _.each(r.data, (d) => { | 227 | _.each(r.list, (l) => { |
| 197 | signRules.value[d.id] = d | 228 | signRules.value[l.id] = l |
| 198 | })) | 229 | }) |
| 230 | } | ||
| 231 | // 复训 | ||
| 232 | else { | ||
| 233 | _.each(r.list, (l) => { | ||
| 234 | signRules2.value[l.id] = l | ||
| 199 | }) | 235 | }) |
| 200 | } | 236 | } |
| 201 | watch([() => Object.keys(signRules.value).length, () => props.trainList.length], (val) => { | 237 | }) |
| 238 | }) | ||
| 239 | } | ||
| 240 | |||
| 241 | watch([() => { | ||
| 242 | return Object.keys(signRules.value).length || Object.keys(signRules2.value).length | ||
| 243 | }, () => props.trainList.length], (val) => { | ||
| 202 | if (val[0] && val[1]) { | 244 | if (val[0] && val[1]) { |
| 203 | checkCanSign(props.trainList, 1) | 245 | checkCanSign(props.trainList, 1) |
| 204 | checkCanSign(props.examList, 2) | 246 | checkCanSign(props.examList, 2) |
| ... | @@ -207,63 +249,100 @@ import trainListVue from '../trainList.vue'; | ... | @@ -207,63 +249,100 @@ import trainListVue from '../trainList.vue'; |
| 207 | fillRelateTrain() | 249 | fillRelateTrain() |
| 208 | checkRelateTrain() | 250 | checkRelateTrain() |
| 209 | } | 251 | } |
| 210 | }) | 252 | }) |
| 253 | |||
| 211 | 254 | ||
| 212 | function checkCanSign(list, flag) { | 255 | function checkCanSign(list, flag) { |
| 213 | _.each(list, (l) => { | 256 | _.each(list, (l) => { |
| 257 | l.required = false | ||
| 214 | if (l.requiredFlag == '1') { | 258 | if (l.requiredFlag == '1') { |
| 215 | l.required = true | 259 | l.required = true |
| 216 | l.checked = true | ||
| 217 | switch (flag) { | 260 | switch (flag) { |
| 218 | case 1: // 培训 | 261 | case 1:// 培训 |
| 219 | form.value.trainIds.push(l.id) | 262 | form.value.trainIds.push(l.id) |
| 220 | break | 263 | break |
| 221 | case 2: // 考试 | 264 | case 2:// 考试 |
| 222 | form.value.examIds.push(l.id) | 265 | form.value.examIds.push(l.id) |
| 223 | break | 266 | break |
| 224 | } | 267 | } |
| 225 | } | 268 | } |
| 269 | |||
| 270 | if (openFlag.value) { | ||
| 271 | let rule, currLevel, currYear, currDuan | ||
| 272 | l.disabled = false | ||
| 273 | // 晋级 | ||
| 274 | if (l.subjectType == '0') { | ||
| 226 | if (l.twoSubjectId && signRules.value[l.twoSubjectId.toString()]) { | 275 | if (l.twoSubjectId && signRules.value[l.twoSubjectId.toString()]) { |
| 227 | const rule = signRules.value[l.twoSubjectId] | 276 | rule = signRules.value[l.twoSubjectId] |
| 228 | // 有报名条件 | 277 | currDuan = parseInt(props.personal.levelDuan || 0) |
| 229 | if (rule.openFlag) { | 278 | |
| 230 | let currLevel, currYear | ||
| 231 | const currDuan = parseInt(props.personal.levelDuan || 0) | ||
| 232 | switch (l.parentSubjectId) { | 279 | switch (l.parentSubjectId) { |
| 233 | case 100: // 教练 | 280 | case 100:// 教练 |
| 234 | currLevel = parseInt(props.personal.coachLabel?.type || 0) | 281 | currLevel = parseInt(props.personal.coachLabel?.type || 0) |
| 235 | currYear = parseInt(props.personal.coachLabel?.yearLimit || 0) | 282 | currYear = parseInt(props.personal.coachLabel?.yearLimit || 0) |
| 236 | if (!(currLevel >= parseInt(rule.type) && currDuan >= parseInt(rule.duan) && | 283 | if (!(currLevel >= parseInt(rule.type) && currDuan >= parseInt(rule.duan) && currYear >= parseInt(rule.limit))) { |
| 237 | currYear >= parseInt(rule.limit))) { | ||
| 238 | l.disabled = true | 284 | l.disabled = true |
| 239 | } | 285 | } |
| 240 | break | 286 | break |
| 241 | case 200: // 裁判 | 287 | case 200:// 裁判 |
| 242 | currLevel = parseInt(props.personal.refereeLabel?.type || 0) | 288 | currLevel = parseInt(props.personal.refereeLabel?.type || 0) |
| 243 | currYear = parseInt(props.personal.refereeLabel?.yearLimit || 0) | 289 | currYear = parseInt(props.personal.refereeLabel?.yearLimit || 0) |
| 244 | if (!(currLevel >= parseInt(rule.type) && currDuan >= parseInt(rule.duan) && | 290 | if (!(currLevel >= parseInt(rule.type) && currDuan >= parseInt(rule.duan) && currYear >= parseInt(rule.limit))) { |
| 245 | currYear >= parseInt(rule.limit))) { | ||
| 246 | l.disabled = true | 291 | l.disabled = true |
| 247 | } | 292 | } |
| 248 | break | 293 | break |
| 249 | case 300: // 晋级 | 294 | case 300:// 晋级 |
| 250 | if (!(currDuan >= parseInt(rule.duan))) { | 295 | if (!(currDuan >= parseInt(rule.duan))) { |
| 251 | l.disabled = true | 296 | l.disabled = true |
| 252 | } | 297 | } |
| 253 | break | 298 | break |
| 254 | case 400: // 晋段 | 299 | case 400:// 晋段 |
| 255 | currLevel = parseInt(props.personal.examinerDuanLabel?.type || 0) | 300 | currLevel = parseInt(props.personal.examinerDuanLabel?.type || 0) |
| 256 | if (!(currLevel >= parseInt(rule.type) && currDuan >= parseInt(rule.duan))) { | 301 | if (!(currLevel >= parseInt(rule.type) && currDuan >= parseInt(rule.duan))) { |
| 257 | l.disabled = true | 302 | l.disabled = true |
| 258 | } | 303 | } |
| 259 | break | 304 | break |
| 305 | case 500:// 培训讲师 | ||
| 306 | if (!(currDuan >= parseInt(rule.duan))) { | ||
| 307 | l.disabled = true | ||
| 308 | } | ||
| 309 | break | ||
| 260 | } | 310 | } |
| 261 | } | 311 | } |
| 262 | } | 312 | } |
| 263 | }) | 313 | // 复训 |
| 314 | else { | ||
| 315 | if (l.twoSubjectId && signRules2.value[l.twoSubjectId.toString()]) { | ||
| 316 | rule = signRules2.value[l.twoSubjectId] | ||
| 317 | |||
| 318 | switch (l.parentSubjectId) { | ||
| 319 | case 100:// 教练 | ||
| 320 | currLevel = parseInt(props.personal.coachLabel?.type || 0) | ||
| 321 | break | ||
| 322 | case 200:// 裁判 | ||
| 323 | currLevel = parseInt(props.personal.refereeLabel?.type || 0) | ||
| 324 | break | ||
| 325 | case 300:// 晋级 | ||
| 326 | currLevel = parseInt(props.personal.examinerJiLabel?.type || 0) | ||
| 327 | break | ||
| 328 | case 400:// 晋段 | ||
| 329 | currLevel = parseInt(props.personal.examinerDuanLabel?.type || 0) | ||
| 330 | break | ||
| 331 | case 500:// 培训讲师 | ||
| 332 | currLevel = parseInt(props.personal.lecturerLabel?.type || 0) | ||
| 333 | break | ||
| 334 | } | ||
| 335 | |||
| 336 | if (currLevel < parseInt(rule.type)) { | ||
| 337 | l.disabled = true | ||
| 264 | } | 338 | } |
| 339 | } | ||
| 340 | } | ||
| 341 | } | ||
| 342 | }) | ||
| 343 | } | ||
| 265 | 344 | ||
| 266 | function fillRelateTrain() { | 345 | function fillRelateTrain() { |
| 267 | _.each(props.examList, (e) => { | 346 | _.each(props.examList, (e) => { |
| 268 | if (e.relateTrainIds) { | 347 | if (e.relateTrainIds) { |
| 269 | const trainNames = [] | 348 | const trainNames = [] |
| ... | @@ -274,9 +353,9 @@ import trainListVue from '../trainList.vue'; | ... | @@ -274,9 +353,9 @@ import trainListVue from '../trainList.vue'; |
| 274 | e.relateTrainNames = trainNames.join(',') | 353 | e.relateTrainNames = trainNames.join(',') |
| 275 | } | 354 | } |
| 276 | }) | 355 | }) |
| 277 | } | 356 | } |
| 278 | 357 | ||
| 279 | function checkRelateTrain() { | 358 | function checkRelateTrain() { |
| 280 | _.each(props.examList, (e) => { | 359 | _.each(props.examList, (e) => { |
| 281 | e.passRelate = true | 360 | e.passRelate = true |
| 282 | if (e.relateTrainIds) { | 361 | if (e.relateTrainIds) { |
| ... | @@ -285,10 +364,9 @@ import trainListVue from '../trainList.vue'; | ... | @@ -285,10 +364,9 @@ import trainListVue from '../trainList.vue'; |
| 285 | } | 364 | } |
| 286 | } | 365 | } |
| 287 | }) | 366 | }) |
| 288 | } | 367 | } |
| 289 | 368 | ||
| 290 | function submitForm() { | 369 | function submitForm() { |
| 291 | console.log(form.value) | ||
| 292 | if (form.value.trainIds.length == 0) { | 370 | if (form.value.trainIds.length == 0) { |
| 293 | uni.showToast({ | 371 | uni.showToast({ |
| 294 | title: '请选择培训科目', | 372 | title: '请选择培训科目', |
| ... | @@ -335,29 +413,32 @@ import trainListVue from '../trainList.vue'; | ... | @@ -335,29 +413,32 @@ import trainListVue from '../trainList.vue'; |
| 335 | } else { | 413 | } else { |
| 336 | sure() | 414 | sure() |
| 337 | } | 415 | } |
| 338 | } | 416 | } |
| 339 | 417 | ||
| 340 | function sure() { | 418 | function sure() { |
| 341 | form.value.activityId = props.trainId | 419 | form.value.activityId = props.trainId |
| 342 | train.commitSign(form.value).then(() => { | 420 | train.commitSign(form.value).then(() => { |
| 343 | uni.showToast({ | 421 | uni.showToast({ |
| 344 | title: '提交成功,等待审核', | 422 | title: '提交成功,等待审核', |
| 345 | icon: 'none' | 423 | icon: 'none' |
| 346 | }) | 424 | }).then(()=>{ |
| 425 | setTimeout(()=>{ | ||
| 347 | emit('publish') | 426 | emit('publish') |
| 427 | },1000) | ||
| 348 | }) | 428 | }) |
| 349 | } | 429 | }) |
| 430 | } | ||
| 350 | 431 | ||
| 351 | function prev() { | 432 | function prev() { |
| 352 | emit('prev') | 433 | emit('prev') |
| 353 | } | 434 | } |
| 354 | 435 | ||
| 355 | function szToHz(num) { | 436 | function szToHz(num) { |
| 356 | const hzArr = ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十'] | 437 | const hzArr = ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十'] |
| 357 | return hzArr[parseInt(num)] | 438 | return hzArr[parseInt(num)] |
| 358 | } | 439 | } |
| 359 | 440 | ||
| 360 | function changeTrainIds(item) { | 441 | function changeTrainIds(item) { |
| 361 | if(item.disabled||item.required){ | 442 | if(item.disabled||item.required){ |
| 362 | return | 443 | return |
| 363 | } | 444 | } |
| ... | @@ -371,9 +452,9 @@ import trainListVue from '../trainList.vue'; | ... | @@ -371,9 +452,9 @@ import trainListVue from '../trainList.vue'; |
| 371 | form.value.trainIds.push(item.id) | 452 | form.value.trainIds.push(item.id) |
| 372 | console.log(form.value.trainIds) | 453 | console.log(form.value.trainIds) |
| 373 | } | 454 | } |
| 374 | } | 455 | } |
| 375 | 456 | ||
| 376 | function changeExamIds(item) { | 457 | function changeExamIds(item) { |
| 377 | if(item.disabled||item.required){ | 458 | if(item.disabled||item.required){ |
| 378 | return | 459 | return |
| 379 | } | 460 | } |
| ... | @@ -387,8 +468,8 @@ import trainListVue from '../trainList.vue'; | ... | @@ -387,8 +468,8 @@ import trainListVue from '../trainList.vue'; |
| 387 | form.value.examIds.push(item.id) | 468 | form.value.examIds.push(item.id) |
| 388 | console.log(form.value.examIds) | 469 | console.log(form.value.examIds) |
| 389 | } | 470 | } |
| 390 | } | 471 | } |
| 391 | function copyPlat(){ | 472 | function copyPlat(){ |
| 392 | let str = `单位名称:${bankInfo.value.name};开户行:${bankInfo.value.bank};账户:${bankInfo.value.account};打款金额:${totalAmount.value};`; | 473 | let str = `单位名称:${bankInfo.value.name};开户行:${bankInfo.value.bank};账户:${bankInfo.value.account};打款金额:${totalAmount.value};`; |
| 393 | uni.setClipboardData({ | 474 | uni.setClipboardData({ |
| 394 | data: str, | 475 | data: str, |
| ... | @@ -399,7 +480,7 @@ import trainListVue from '../trainList.vue'; | ... | @@ -399,7 +480,7 @@ import trainListVue from '../trainList.vue'; |
| 399 | }) | 480 | }) |
| 400 | } | 481 | } |
| 401 | }); | 482 | }); |
| 402 | } | 483 | } |
| 403 | 484 | ||
| 404 | </script> | 485 | </script> |
| 405 | 486 | ... | ... |
| ... | @@ -14,7 +14,7 @@ export function getTrainDetail(id) { | ... | @@ -14,7 +14,7 @@ export function getTrainDetail(id) { |
| 14 | return request({ | 14 | return request({ |
| 15 | url: `${config.trainUrl_api}/webPc/getTrainDetails`, | 15 | url: `${config.trainUrl_api}/webPc/getTrainDetails`, |
| 16 | method: 'get', | 16 | method: 'get', |
| 17 | params: {id} | 17 | params: { id } |
| 18 | }) | 18 | }) |
| 19 | } | 19 | } |
| 20 | export function getPersonalInfo() { | 20 | export function getPersonalInfo() { |
| ... | @@ -90,3 +90,12 @@ export function commitSign(data) { | ... | @@ -90,3 +90,12 @@ export function commitSign(data) { |
| 90 | params: data | 90 | params: data |
| 91 | }) | 91 | }) |
| 92 | } | 92 | } |
| 93 | |||
| 94 | |||
| 95 | export function getAllRules(id) { | ||
| 96 | return request({ | ||
| 97 | url: `${config.trainUrl_api}/train/activity/getAllRules`, | ||
| 98 | method: 'get', | ||
| 99 | params: { id } | ||
| 100 | }) | ||
| 101 | } | ... | ... |
| ... | @@ -9,53 +9,53 @@ | ... | @@ -9,53 +9,53 @@ |
| 9 | <step3 v-show="active==2" @prev="prev" @next="next" :activity="activity" :trainId="trainId" | 9 | <step3 v-show="active==2" @prev="prev" @next="next" :activity="activity" :trainId="trainId" |
| 10 | :active="active" /> | 10 | :active="active" /> |
| 11 | <step4 v-show="active==3" @prev="prev" @publish="publish" :personal="personal" :activity="activity" | 11 | <step4 v-show="active==3" @prev="prev" @publish="publish" :personal="personal" :activity="activity" |
| 12 | :exam-list="examList" :train-list="trainList" :trainId="trainId"/> | 12 | :exam-list="examList" :train-list="trainList" :trainId="trainId" :active="active"/> |
| 13 | </view> | 13 | </view> |
| 14 | </view> | 14 | </view> |
| 15 | 15 | ||
| 16 | </template> | 16 | </template> |
| 17 | 17 | ||
| 18 | <script setup> | 18 | <script setup> |
| 19 | import { | 19 | import { |
| 20 | onLoad | 20 | onLoad |
| 21 | } from '@dcloudio/uni-app' | 21 | } from '@dcloudio/uni-app' |
| 22 | import { | 22 | import { |
| 23 | ref, | 23 | ref, |
| 24 | reactive, | 24 | reactive, |
| 25 | toRefs | 25 | toRefs |
| 26 | } from 'vue' | 26 | } from 'vue' |
| 27 | import * as train from '@/training/train.js' | 27 | import * as train from '@/training/train.js' |
| 28 | import step1 from '@/training/components/step1' | 28 | import step1 from '@/training/components/step1' |
| 29 | import step2 from '@/training/components/step2' | 29 | import step2 from '@/training/components/step2' |
| 30 | import step3 from '@/training/components/step3' | 30 | import step3 from '@/training/components/step3' |
| 31 | import step4 from '@/training/components/step4' | 31 | import step4 from '@/training/components/step4' |
| 32 | const active = ref(0) | 32 | const active = ref(0) |
| 33 | 33 | ||
| 34 | const steps = ref([{ | 34 | const steps = ref([{ |
| 35 | title: '报名须知' | 35 | title: '报名须知' |
| 36 | }, { | 36 | }, { |
| 37 | title: '个人信息完善' | 37 | title: '个人信息完善' |
| 38 | }, { | 38 | }, { |
| 39 | title: '培训信息完善' | 39 | title: '培训信息完善' |
| 40 | }, { | 40 | }, { |
| 41 | title: '培训考试选择' | 41 | title: '培训考试选择' |
| 42 | }]) | 42 | }]) |
| 43 | 43 | ||
| 44 | const data = reactive({ | 44 | const data = reactive({ |
| 45 | activity: {}, | 45 | activity: {}, |
| 46 | examList: [], | 46 | examList: [], |
| 47 | trainList: [], | 47 | trainList: [], |
| 48 | personal: {}, | 48 | personal: {}, |
| 49 | trainId: '' | 49 | trainId: '' |
| 50 | }) | 50 | }) |
| 51 | const { | 51 | const { |
| 52 | activity, | 52 | activity, |
| 53 | examList, | 53 | examList, |
| 54 | trainList, | 54 | trainList, |
| 55 | personal, | 55 | personal, |
| 56 | trainId | 56 | trainId |
| 57 | } = toRefs(data) | 57 | } = toRefs(data) |
| 58 | onLoad(options => { | 58 | onLoad(options => { |
| 59 | active.value = options.step || 0 | 59 | active.value = options.step || 0 |
| 60 | trainId.value = options.id | 60 | trainId.value = options.id |
| 61 | train.getTrainDetail(trainId.value).then((res) => { | 61 | train.getTrainDetail(trainId.value).then((res) => { |
| ... | @@ -71,21 +71,21 @@ | ... | @@ -71,21 +71,21 @@ |
| 71 | train.getPersonalInfo().then((res) => { | 71 | train.getPersonalInfo().then((res) => { |
| 72 | personal.value = res.data || {} | 72 | personal.value = res.data || {} |
| 73 | }) | 73 | }) |
| 74 | }) | 74 | }) |
| 75 | 75 | ||
| 76 | function next() { | 76 | function next() { |
| 77 | active.value++ | 77 | active.value++ |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | function prev() { | 80 | function prev() { |
| 81 | active.value-- | 81 | active.value-- |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | function publish() { | 84 | function publish() { |
| 85 | uni.redirectTo({ | 85 | uni.redirectTo({ |
| 86 | url: `/training/trainList` | 86 | url: `/training/trainList` |
| 87 | }); | 87 | }); |
| 88 | } | 88 | } |
| 89 | </script> | 89 | </script> |
| 90 | 90 | ||
| 91 | <style scoped lang="scss"> | 91 | <style scoped lang="scss"> | ... | ... |
-
Please register or sign in to post a comment