Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨炀
/
ztx_wx_minapp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
c0aee960
authored
2023-12-22 16:57:46 +0800
by
华明祺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
培训报名规则修改
1 parent
4b268e3f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
218 additions
and
130 deletions
training/components/step3.vue
training/components/step4.vue
training/train.js
training/trainSignUp.vue
training/components/step3.vue
View file @
c0aee96
...
...
@@ -48,21 +48,21 @@
</
template
>
<
script
setup
>
import
{
import
{
onLoad
}
from
'@dcloudio/uni-app'
import
{
}
from
'@dcloudio/uni-app'
import
{
ref
,
reactive
,
toRefs
,
computed
,
watch
}
from
'vue'
import
_
from
'lodash'
import
*
as
train
from
'@/training/train.js'
}
from
'vue'
import
_
from
'lodash'
import
*
as
train
from
'@/training/train.js'
const
emit
=
defineEmits
([
'prev'
,
'next'
])
const
props
=
defineProps
({
const
emit
=
defineEmits
([
'prev'
,
'next'
])
const
props
=
defineProps
({
activity
:
{
type
:
Object
,
default
:
()
=>
{}
...
...
@@ -73,20 +73,20 @@
},
active
:
{
type
:
Number
,
default
:
()
=>
{}
default
:
0
}
})
})
const
customInfo
=
computed
(()
=>
{
const
customInfo
=
computed
(()
=>
{
if
(
props
.
activity
.
customInfo
)
{
return
JSON
.
parse
(
props
.
activity
.
customInfo
).
info
}
else
{
return
[]
}
})
})
const
data
=
reactive
({
const
data
=
reactive
({
form
:
{
invoiceFlag
:
'1'
,
customInfoObj
:
{}
...
...
@@ -108,29 +108,28 @@
value
:
2
,
text
:
'纸质普票'
}]
})
const
{
})
const
{
form
,
invoiceType
,
invoiceFlag
}
=
toRefs
(
data
)
}
=
toRefs
(
data
)
watch
(()
=>
props
.
activity
.
invoiceFlag
,
(
val
)
=>
{
watch
(()
=>
props
.
activity
.
invoiceFlag
,
(
val
)
=>
{
if
(
val
==
'1'
)
{
if
(
!
form
.
value
.
invoiceType
)
{
form
.
value
.
invoiceType
=
_
.
orderBy
(
props
.
activity
.
invoiceType
.
split
(
','
))[
0
]
}
}
},
{
},
{
immediate
:
true
})
watch
(()
=>
props
.
active
,
(
val
)
=>
{
})
watch
(()
=>
props
.
active
,
(
val
)
=>
{
if
(
val
==
2
)
{
uni
.
showLoading
({
title
:
'加载中'
})
train
.
getTrainPersonalInfo
(
props
.
trainId
).
then
(
res
=>
{
form
.
value
=
res
.
data
||
{}
if
(
res
.
data
?.
customInfo
)
{
form
.
value
.
customInfoObj
=
JSON
.
parse
(
res
.
data
.
customInfo
)
...
...
@@ -138,16 +137,15 @@
form
.
value
.
customInfoObj
=
{}
}
uni
.
hideLoading
()
})
}
})
})
function
prev
()
{
function
prev
()
{
emit
(
'prev'
)
}
}
function
next
()
{
function
next
()
{
// 判断必填
if
(
!
form
.
value
.
unitName
){
uni
.
showToast
({
...
...
@@ -173,7 +171,7 @@
emit
(
'next'
)
})
})
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
...
...
training/components/step4.vue
View file @
c0aee96
...
...
@@ -46,12 +46,17 @@
</view>
<view
class=
"date"
>
<text>
报名限制条件:
</text>
<text
v-if=
"signRules[t.twoSubjectId]?.openFlag"
>
<text
v-if=
"openFlag && signRules[t.twoSubjectId]"
>
<text
v-if=
"t.subjectType=='0'"
>
<text>
等级
</text><text>
{{
signRules
[
t
.
twoSubjectId
]?.
name
}}
</text>
<text>
段位
</text><text>
{{
signRules
[
t
.
twoSubjectId
]?.
duanStr
}}
</text>
<text>
年限
</text><text>
{{
signRules
[
t
.
twoSubjectId
]?.
limitStr
}}
</text>
</text>
<text
v-else
>
<text>
等级
</text><text>
{{
signRules2
[
t
.
twoSubjectId
]?.
name
}}
</text>
</text>
</text>
<text
v-else
>
--
</text>
</view>
...
...
@@ -76,12 +81,17 @@
</view>
<view
class=
"date"
>
<text>
报名限制条件:
</text>
<text
v-if=
"signRules[t.twoSubjectId]?.openFlag"
>
<text>
等级
</text><text>
{{
signRules
[
t
.
twoSubjectId
]?.
name
}}
</text>
<text>
段位
</text><text>
{{
signRules
[
t
.
twoSubjectId
]?.
duanStr
}}
</text>
<text
v-if=
"openFlag && signRules[t.twoSubjectId]"
>
<text
v-if=
"t.subjectType=='0'"
>
<text>
等级
</text><text>
{{
signRules
[
t
.
twoSubjectId
]?.
name
}}
、
</text>
<text>
段位
</text><text>
{{
signRules
[
t
.
twoSubjectId
]?.
duanStr
}}
、
</text>
<text>
年限
</text><text>
{{
signRules
[
t
.
twoSubjectId
]?.
limitStr
}}
</text>
</text>
<text
v-else
>
<text>
等级
</text><text>
{{
signRules2
[
t
.
twoSubjectId
]?.
name
}}
</text>
</text>
</text>
<text
v-else
>
--
</text>
</view>
...
...
@@ -124,36 +134,44 @@
</
template
>
<
script
setup
>
import
{
import
{
onLoad
}
from
'@dcloudio/uni-app'
import
_
from
'lodash'
import
{
}
from
'@dcloudio/uni-app'
import
_
from
'lodash'
import
{
ref
,
reactive
,
toRefs
,
computed
,
watch
}
from
'vue'
import
*
as
train
from
'@/training/train.js'
watch
,
onMounted
}
from
'vue'
import
*
as
train
from
'@/training/train.js'
import
trainListVue
from
'../trainList.vue'
;
const
data
=
reactive
({
const
data
=
reactive
({
form
:
{
trainIds
:
[],
examIds
:
[]
},
signRules
:
{},
signRules
:
{},
// 晋级
signRules2
:
{},
// 复训
bankShow
:
null
,
totalAmount
:
null
})
const
{
totalAmount
:
null
,
openFlag
:
false
})
const
{
form
,
signRules
,
signRules2
,
bankShow
,
totalAmount
}
=
toRefs
(
data
)
const
emit
=
defineEmits
([
'prev'
,
'publish'
])
const
props
=
defineProps
({
totalAmount
,
openFlag
}
=
toRefs
(
data
)
const
emit
=
defineEmits
([
'prev'
,
'publish'
])
const
props
=
defineProps
({
activity
:
{
type
:
Object
,
default
:
()
=>
{}
...
...
@@ -173,32 +191,56 @@ import trainListVue from '../trainList.vue';
trainId
:
{
type
:
String
,
default
:
()
=>
{}
},
active
:
{
type
:
Number
,
default
:
0
}
})
const
bankInfo
=
computed
(()
=>
{
})
const
bankInfo
=
computed
(()
=>
{
if
(
props
.
activity
.
receivingInfo
)
{
return
JSON
.
parse
(
props
.
activity
.
receivingInfo
)
}
else
{
return
{}
}
})
watch
(()
=>
props
.
active
,
(
val
)
=>
{
if
(
val
==
3
)
{
uni
.
showLoading
({
title
:
'加载中'
})
onLoad
(
options
=>
{
getRules
()
getRules
().
then
(()
=>
{
uni
.
hideLoading
()
})
}
})
function
getRules
()
{
Promise
.
all
([
train
.
getCoachRules
(),
train
.
getRefereeRules
(),
train
.
getExaminerJiRules
(),
train
.
getExaminerDuanRules
()
]).
then
((
res
)
=>
{
_
.
each
(
res
,
(
r
)
=>
_
.
each
(
r
.
data
,
(
d
)
=>
{
signRules
.
value
[
d
.
id
]
=
d
}))
function
getRules
()
{
return
train
.
getAllRules
(
props
.
trainId
).
then
((
res
)
=>
{
openFlag
.
value
=
res
.
data
.
openFlag
_
.
each
(
res
.
data
.
rules
,
(
r
)
=>
{
// 晋级
if
(
r
.
subjectType
==
'0'
)
{
_
.
each
(
r
.
list
,
(
l
)
=>
{
signRules
.
value
[
l
.
id
]
=
l
})
}
// 复训
else
{
_
.
each
(
r
.
list
,
(
l
)
=>
{
signRules2
.
value
[
l
.
id
]
=
l
})
}
watch
([()
=>
Object
.
keys
(
signRules
.
value
).
length
,
()
=>
props
.
trainList
.
length
],
(
val
)
=>
{
})
})
}
watch
([()
=>
{
return
Object
.
keys
(
signRules
.
value
).
length
||
Object
.
keys
(
signRules2
.
value
).
length
},
()
=>
props
.
trainList
.
length
],
(
val
)
=>
{
if
(
val
[
0
]
&&
val
[
1
])
{
checkCanSign
(
props
.
trainList
,
1
)
checkCanSign
(
props
.
examList
,
2
)
...
...
@@ -207,63 +249,100 @@ import trainListVue from '../trainList.vue';
fillRelateTrain
()
checkRelateTrain
()
}
})
})
function
checkCanSign
(
list
,
flag
)
{
function
checkCanSign
(
list
,
flag
)
{
_
.
each
(
list
,
(
l
)
=>
{
l
.
required
=
false
if
(
l
.
requiredFlag
==
'1'
)
{
l
.
required
=
true
l
.
checked
=
true
switch
(
flag
)
{
case
1
:
// 培训
case
1
:
// 培训
form
.
value
.
trainIds
.
push
(
l
.
id
)
break
case
2
:
// 考试
case
2
:
// 考试
form
.
value
.
examIds
.
push
(
l
.
id
)
break
}
}
if
(
openFlag
.
value
)
{
let
rule
,
currLevel
,
currYear
,
currDuan
l
.
disabled
=
false
// 晋级
if
(
l
.
subjectType
==
'0'
)
{
if
(
l
.
twoSubjectId
&&
signRules
.
value
[
l
.
twoSubjectId
.
toString
()])
{
const
rule
=
signRules
.
value
[
l
.
twoSubjectId
]
// 有报名条件
if
(
rule
.
openFlag
)
{
let
currLevel
,
currYear
const
currDuan
=
parseInt
(
props
.
personal
.
levelDuan
||
0
)
rule
=
signRules
.
value
[
l
.
twoSubjectId
]
currDuan
=
parseInt
(
props
.
personal
.
levelDuan
||
0
)
switch
(
l
.
parentSubjectId
)
{
case
100
:
// 教练
case
100
:
// 教练
currLevel
=
parseInt
(
props
.
personal
.
coachLabel
?.
type
||
0
)
currYear
=
parseInt
(
props
.
personal
.
coachLabel
?.
yearLimit
||
0
)
if
(
!
(
currLevel
>=
parseInt
(
rule
.
type
)
&&
currDuan
>=
parseInt
(
rule
.
duan
)
&&
currYear
>=
parseInt
(
rule
.
limit
)))
{
if
(
!
(
currLevel
>=
parseInt
(
rule
.
type
)
&&
currDuan
>=
parseInt
(
rule
.
duan
)
&&
currYear
>=
parseInt
(
rule
.
limit
)))
{
l
.
disabled
=
true
}
break
case
200
:
// 裁判
case
200
:
// 裁判
currLevel
=
parseInt
(
props
.
personal
.
refereeLabel
?.
type
||
0
)
currYear
=
parseInt
(
props
.
personal
.
refereeLabel
?.
yearLimit
||
0
)
if
(
!
(
currLevel
>=
parseInt
(
rule
.
type
)
&&
currDuan
>=
parseInt
(
rule
.
duan
)
&&
currYear
>=
parseInt
(
rule
.
limit
)))
{
if
(
!
(
currLevel
>=
parseInt
(
rule
.
type
)
&&
currDuan
>=
parseInt
(
rule
.
duan
)
&&
currYear
>=
parseInt
(
rule
.
limit
)))
{
l
.
disabled
=
true
}
break
case
300
:
// 晋级
case
300
:
// 晋级
if
(
!
(
currDuan
>=
parseInt
(
rule
.
duan
)))
{
l
.
disabled
=
true
}
break
case
400
:
// 晋段
case
400
:
// 晋段
currLevel
=
parseInt
(
props
.
personal
.
examinerDuanLabel
?.
type
||
0
)
if
(
!
(
currLevel
>=
parseInt
(
rule
.
type
)
&&
currDuan
>=
parseInt
(
rule
.
duan
)))
{
l
.
disabled
=
true
}
break
case
500
:
// 培训讲师
if
(
!
(
currDuan
>=
parseInt
(
rule
.
duan
)))
{
l
.
disabled
=
true
}
break
}
}
}
})
// 复训
else
{
if
(
l
.
twoSubjectId
&&
signRules2
.
value
[
l
.
twoSubjectId
.
toString
()])
{
rule
=
signRules2
.
value
[
l
.
twoSubjectId
]
switch
(
l
.
parentSubjectId
)
{
case
100
:
// 教练
currLevel
=
parseInt
(
props
.
personal
.
coachLabel
?.
type
||
0
)
break
case
200
:
// 裁判
currLevel
=
parseInt
(
props
.
personal
.
refereeLabel
?.
type
||
0
)
break
case
300
:
// 晋级
currLevel
=
parseInt
(
props
.
personal
.
examinerJiLabel
?.
type
||
0
)
break
case
400
:
// 晋段
currLevel
=
parseInt
(
props
.
personal
.
examinerDuanLabel
?.
type
||
0
)
break
case
500
:
// 培训讲师
currLevel
=
parseInt
(
props
.
personal
.
lecturerLabel
?.
type
||
0
)
break
}
if
(
currLevel
<
parseInt
(
rule
.
type
))
{
l
.
disabled
=
true
}
}
}
}
})
}
function
fillRelateTrain
()
{
function
fillRelateTrain
()
{
_
.
each
(
props
.
examList
,
(
e
)
=>
{
if
(
e
.
relateTrainIds
)
{
const
trainNames
=
[]
...
...
@@ -274,9 +353,9 @@ import trainListVue from '../trainList.vue';
e
.
relateTrainNames
=
trainNames
.
join
(
','
)
}
})
}
}
function
checkRelateTrain
()
{
function
checkRelateTrain
()
{
_
.
each
(
props
.
examList
,
(
e
)
=>
{
e
.
passRelate
=
true
if
(
e
.
relateTrainIds
)
{
...
...
@@ -285,10 +364,9 @@ import trainListVue from '../trainList.vue';
}
}
})
}
}
function
submitForm
()
{
console
.
log
(
form
.
value
)
function
submitForm
()
{
if
(
form
.
value
.
trainIds
.
length
==
0
)
{
uni
.
showToast
({
title
:
'请选择培训科目'
,
...
...
@@ -335,29 +413,32 @@ import trainListVue from '../trainList.vue';
}
else
{
sure
()
}
}
}
function
sure
()
{
function
sure
()
{
form
.
value
.
activityId
=
props
.
trainId
train
.
commitSign
(
form
.
value
).
then
(()
=>
{
uni
.
showToast
({
title
:
'提交成功,等待审核'
,
icon
:
'none'
})
}).
then
(()
=>
{
setTimeout
(()
=>
{
emit
(
'publish'
)
},
1000
)
})
}
})
}
function
prev
()
{
function
prev
()
{
emit
(
'prev'
)
}
}
function
szToHz
(
num
)
{
function
szToHz
(
num
)
{
const
hzArr
=
[
'〇'
,
'一'
,
'二'
,
'三'
,
'四'
,
'五'
,
'六'
,
'七'
,
'八'
,
'九'
,
'十'
]
return
hzArr
[
parseInt
(
num
)]
}
}
function
changeTrainIds
(
item
)
{
function
changeTrainIds
(
item
)
{
if
(
item
.
disabled
||
item
.
required
){
return
}
...
...
@@ -371,9 +452,9 @@ import trainListVue from '../trainList.vue';
form
.
value
.
trainIds
.
push
(
item
.
id
)
console
.
log
(
form
.
value
.
trainIds
)
}
}
}
function
changeExamIds
(
item
)
{
function
changeExamIds
(
item
)
{
if
(
item
.
disabled
||
item
.
required
){
return
}
...
...
@@ -387,8 +468,8 @@ import trainListVue from '../trainList.vue';
form
.
value
.
examIds
.
push
(
item
.
id
)
console
.
log
(
form
.
value
.
examIds
)
}
}
function
copyPlat
(){
}
function
copyPlat
(){
let
str
=
`单位名称:
${
bankInfo
.
value
.
name
}
;开户行:
${
bankInfo
.
value
.
bank
}
;账户:
${
bankInfo
.
value
.
account
}
;打款金额:
${
totalAmount
.
value
}
;`
;
uni
.
setClipboardData
({
data
:
str
,
...
...
@@ -399,7 +480,7 @@ import trainListVue from '../trainList.vue';
})
}
});
}
}
</
script
>
...
...
training/train.js
View file @
c0aee96
...
...
@@ -14,7 +14,7 @@ export function getTrainDetail(id) {
return
request
({
url
:
`
${
config
.
trainUrl_api
}
/webPc/getTrainDetails`
,
method
:
'get'
,
params
:
{
id
}
params
:
{
id
}
})
}
export
function
getPersonalInfo
()
{
...
...
@@ -90,3 +90,12 @@ export function commitSign(data) {
params
:
data
})
}
export
function
getAllRules
(
id
)
{
return
request
({
url
:
`
${
config
.
trainUrl_api
}
/train/activity/getAllRules`
,
method
:
'get'
,
params
:
{
id
}
})
}
...
...
training/trainSignUp.vue
View file @
c0aee96
...
...
@@ -9,53 +9,53 @@
<step3
v-show=
"active==2"
@
prev=
"prev"
@
next=
"next"
:activity=
"activity"
:trainId=
"trainId"
:active=
"active"
/>
<step4
v-show=
"active==3"
@
prev=
"prev"
@
publish=
"publish"
:personal=
"personal"
:activity=
"activity"
:exam-list=
"examList"
:train-list=
"trainList"
:trainId=
"trainId
"
/>
:exam-list=
"examList"
:train-list=
"trainList"
:trainId=
"trainId"
:active=
"active
"
/>
</view>
</view>
</
template
>
<
script
setup
>
import
{
import
{
onLoad
}
from
'@dcloudio/uni-app'
import
{
}
from
'@dcloudio/uni-app'
import
{
ref
,
reactive
,
toRefs
}
from
'vue'
import
*
as
train
from
'@/training/train.js'
import
step1
from
'@/training/components/step1'
import
step2
from
'@/training/components/step2'
import
step3
from
'@/training/components/step3'
import
step4
from
'@/training/components/step4'
const
active
=
ref
(
0
)
}
from
'vue'
import
*
as
train
from
'@/training/train.js'
import
step1
from
'@/training/components/step1'
import
step2
from
'@/training/components/step2'
import
step3
from
'@/training/components/step3'
import
step4
from
'@/training/components/step4'
const
active
=
ref
(
0
)
const
steps
=
ref
([{
const
steps
=
ref
([{
title
:
'报名须知'
},
{
},
{
title
:
'个人信息完善'
},
{
},
{
title
:
'培训信息完善'
},
{
},
{
title
:
'培训考试选择'
}])
}])
const
data
=
reactive
({
const
data
=
reactive
({
activity
:
{},
examList
:
[],
trainList
:
[],
personal
:
{},
trainId
:
''
})
const
{
})
const
{
activity
,
examList
,
trainList
,
personal
,
trainId
}
=
toRefs
(
data
)
onLoad
(
options
=>
{
}
=
toRefs
(
data
)
onLoad
(
options
=>
{
active
.
value
=
options
.
step
||
0
trainId
.
value
=
options
.
id
train
.
getTrainDetail
(
trainId
.
value
).
then
((
res
)
=>
{
...
...
@@ -71,21 +71,21 @@
train
.
getPersonalInfo
().
then
((
res
)
=>
{
personal
.
value
=
res
.
data
||
{}
})
})
})
function
next
()
{
function
next
()
{
active
.
value
++
}
}
function
prev
()
{
function
prev
()
{
active
.
value
--
}
}
function
publish
()
{
function
publish
()
{
uni
.
redirectTo
({
url
:
`/training/trainList`
});
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment