Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨炀
/
ztx_wx_gzt
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
d923ac96
authored
2026-04-15 16:13:37 +0800
by
lttnew
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加考官
1 parent
bebae732
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
293 additions
and
111 deletions
config.js
level/addApply.vue
level/chooseExaminer.vue
config.js
View file @
d923ac9
// dev
const
baseUrl_api
=
'http://192.168.1.137:8787'
//
const baseUrl_api = 'http://tk001.wxjylt.com/stage-api'
//
const baseUrl_api = 'http://192.168.1.137:8787'
const
baseUrl_api
=
'http://tk001.wxjylt.com/stage-api'
const
loginImage_api
=
'http://tk001.wxjylt.com/stage-api'
const
payUrl
=
'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do'
...
...
level/addApply.vue
View file @
d923ac9
...
...
@@ -354,14 +354,14 @@
if
(
dayjs
(
form
.
value
.
startTime
).
valueOf
()
<
dayjs
(
form
.
value
.
applyTime
).
valueOf
())
{
uni
.
showToast
({
title
:
`考试开始时间应大于申请日期`
,
icon
:
'
error
'
icon
:
'
none
'
})
return
}
if
(
dayjs
(
form
.
value
.
endTime
).
valueOf
()
<=
dayjs
(
form
.
value
.
startTime
).
valueOf
())
{
uni
.
showToast
({
title
:
`考试结束时间应大于考试开始时间`
,
icon
:
'
error
'
icon
:
'
none
'
})
return
}
...
...
level/chooseExaminer.vue
View file @
d923ac9
<
template
>
<view>
<view
class=
"nolineform"
>
<uni-form
@
submit=
"getList"
>
<uni-forms-item
label=
"考官姓名"
>
<uni-easyinput
:placeholderStyle=
"placeholderStyle"
:input-border=
"false"
v-model=
"query.name"
placeholder=
"考官姓名"
>
</uni-easyinput>
</uni-forms-item>
<uni-forms-item
label=
"考官编号"
>
<uni-easyinput
:placeholderStyle=
"placeholderStyle"
:input-border=
"false"
v-model=
"query.certCode"
placeholder=
"考官编号"
>
</uni-easyinput>
</uni-forms-item>
</uni-form>
<view
class=
"button-group"
>
<button
size=
"mini"
@
click=
"resetQuery"
>
重置
</button>
<button
type=
"primary"
size=
"mini"
@
click=
"getList"
>
查询
</button>
</view>
<!-- 顶部添加考官按钮 -->
<view
class=
"add-btn-box"
>
<button
class=
"btn-red-kx mini"
@
click=
"openAddExaminer"
>
<uni-icons
type=
"personadd"
size=
"14"
color=
"#AD181F"
></uni-icons>
添加考官
</button>
</view>
<view
class=
"indexboxre"
>
<view
class=
"userlist"
>
<view
class=
"item"
v-for=
"(n,index) in list"
:key=
"index"
>
<!--
<view
class=
"photobox"
>
<image
class=
"photo"
v-if=
"n.photo"
:src=
"n.photo"
mode=
'aspectFill'
></image>
<view
class=
"colorful"
v-else
>
{{
n
.
name
.
slice
(
1
,
2
)
}}
</view>
</view>
-->
<view>
<view
class=
"name"
>
{{
n
.
n
ame
}}
</view>
<view
class=
"name"
>
{{
n
.
perN
ame
}}
</view>
<view
class=
"date"
>
会员号:
{{
n
.
perCode
||
'-'
}}
</view>
<view
class=
"date"
>
证件号码:
{{
n
.
idcCode
||
'-'
}}
</view>
<view
class=
"date"
>
有效日期:
{{
n
.
roleInfo
&&
n
.
roleInfo
.
validTime
?
n
.
roleInfo
.
validTime
:
'-'
}}
</view>
<view
class=
"date"
>
注册地:
{{
n
.
memName
||
'-'
}}
</view>
<view
class=
"date"
:class=
"
{'text-danger': n.canChoose != 1}">
状态:
{{
n
.
canChoose
==
1
?
'正常'
:
'资质已过期'
}}
</view>
</view>
<view
class=
"status"
>
<text
v-if=
"
n.disabled
"
>
已选
</text>
<text
v-if=
"
isChosen(n)"
class=
"text-gray
"
>
已选
</text>
<text
v-else
class=
"text-primary"
@
click=
"handleChoose(n)"
>
选择
</text>
</view>
</view>
</view>
<view
class=
"nodata"
v-if=
"list.length==0"
>
<view
class=
"nodata"
v-if=
"list.length==0
&& !loading
"
>
<image
mode=
"aspectFit"
:src=
"config.baseUrl_api + '/fs/static/nodata.png'"
></image>
<text>
请输入考官姓名和编号精确查找
</text>
<text>
暂无考官数据
</text>
</view>
</view>
<!-- 添加考官弹窗 -->
<uni-popup
ref=
"addPopup"
type=
"bottom"
background-color=
"#fff"
animation
>
<view
class=
"popBody"
>
<view
class=
"h3 text-center"
>
添加考官
</view>
<view
class=
"form-item"
>
<text
class=
"label"
>
考官姓名
</text>
<uni-easyinput
v-model=
"addForm.name"
placeholder=
"请输入考官姓名"
/>
</view>
<view
class=
"form-item"
v-if=
"addForm.type == 1"
>
<text
class=
"label"
>
考官编号
</text>
<uni-easyinput
v-model=
"addForm.certCode"
placeholder=
"请输入考官编号"
/>
</view>
<view
class=
"btn-group"
>
<button
class=
"btn-cancel"
@
click=
"addPopup.close()"
>
取消
</button>
<button
class=
"btn-confirm"
@
click=
"searchAndAdd"
>
查询
</button>
</view>
<!-- 搜索结果 -->
<view
v-if=
"searchResult"
class=
"search-result"
>
<view
class=
"result-item"
>
<view
class=
"info"
>
<view
class=
"name"
>
{{
searchResult
.
perName
}}
</view>
<view
class=
"date"
>
会员号:
{{
searchResult
.
perCode
||
'-'
}}
</view>
<view
class=
"date"
>
证件号码:
{{
searchResult
.
idcCode
||
'-'
}}
</view>
<view
class=
"date"
>
注册地:
{{
searchResult
.
memName
||
'-'
}}
</view>
</view>
<view
class=
"action"
>
<text
v-if=
"searchResult.added"
class=
"text-gray"
>
已添加
</text>
<text
v-else
class=
"text-primary"
@
click=
"doAddExaminer(searchResult)"
>
添加
</text>
</view>
</view>
</view>
<view
v-if=
"searchNoData"
class=
"no-data"
>
<text>
未查询到考官信息
</text>
</view>
</view>
</uni-popup>
</view>
</
template
>
...
...
@@ -53,103 +76,144 @@
import
*
as
api
from
'@/common/api.js'
import
config
from
'@/config.js'
import
{
ref
,
getCurrentInstance
ref
}
from
'vue'
import
{
onLoad
}
from
'@dcloudio/uni-app'
import
_
from
'underscore'
const
{
proxy
}
=
getCurrentInstance
()
const
app
=
getApp
();
const
query
=
ref
({
})
const
placeholderStyle
=
ref
(
'text-align: right;font-size:30rpx'
)
const
list
=
ref
([])
const
total
=
ref
(
0
)
const
userType
=
ref
(
''
)
const
loading
=
ref
(
false
)
let
chosen
=
[]
let
ec
=
null
const
addPopup
=
ref
(
null
)
const
addForm
=
ref
({
type
:
1
,
name
:
''
,
certCode
:
''
})
const
searchResult
=
ref
(
null
)
const
searchNoData
=
ref
(
false
)
onLoad
((
option
)
=>
{
query
.
value
.
type
=
option
.
type
chosen
=
JSON
.
parse
(
decodeURIComponent
(
option
.
chosen
))
||
[]
chosen
=
JSON
.
parse
(
decodeURIComponent
(
option
.
chosen
||
'[]'
))
ec
=
option
.
ec
console
.
log
(
chosen
)
getList
(
)
})
function
resetQuery
()
{
query
.
value
=
{}
list
.
value
=
[]
}
function
getList
()
{
if
(
!
query
.
value
.
name
)
{
return
}
if
(
!
query
.
value
.
certCode
)
{
return
}
uni
.
showLoading
({
title
:
`查找中`
})
api
.
getCoachList
(
query
.
value
).
then
(
res
=>
{
if
(
res
.
rows
.
length
==
0
)
{
uni
.
showToast
({
title
:
'未查询到考官信息'
,
icon
:
"error"
})
list
.
value
=
[]
return
loading
.
value
=
true
uni
.
showLoading
({
title
:
'加载中'
})
api
.
listApi
({
memId
:
app
.
globalData
.
memberInfo
.
memId
}).
then
(
res
=>
{
list
.
value
=
res
.
rows
||
[]
for
(
let
l
of
list
.
value
)
{
if
(
l
.
roleInfo
)
{
try
{
l
.
roleInfo
=
typeof
l
.
roleInfo
===
'string'
?
JSON
.
parse
(
l
.
roleInfo
)
:
l
.
roleInfo
}
catch
(
e
)
{}
}
list
.
value
=
res
.
rows
for
(
var
l
of
list
.
value
){
// if(l.photo&&l.photo.indexOf('http')==-1){
// l.photo = config.baseUrl_api + l.photo
// }
for
(
var
t
of
chosen
){
if
(
t
.
perId
==
l
.
perId
){
// 检查是否已选
for
(
let
t
of
chosen
)
{
if
(
t
.
perId
==
l
.
perId
)
{
l
.
disabled
=
true
}
}
}
uni
.
hideLoading
()
loading
.
value
=
false
}).
catch
(()
=>
{
uni
.
hideLoading
()
loading
.
value
=
false
})
}
function
checkChosen
(
n
)
{
return
_
.
some
(
chosen
,
(
c
)
=>
{
return
c
.
perId
==
n
.
perId
})
function
isChosen
(
n
)
{
return
chosen
.
some
(
c
=>
c
.
perId
==
n
.
perId
)
}
function
handleChoose
(
row
)
{
if
(
row
.
canChoose
!=
1
)
{
if
(
row
.
canChoose
!=
1
)
{
uni
.
showToast
({
title
:
'该考官资质已过期!'
,
icon
:
"error"
icon
:
'error'
})
return
}
var
pages
=
getCurrentPages
()
var
prevPage
=
pages
[
pages
.
length
-
2
]
var
obj
=
{
perId
:
row
.
perId
,
name
:
row
.
n
ame
,
name
:
row
.
perN
ame
,
}
// prevPage.onShow(obj)
uni
.
$emit
(
'chosen'
,{
obj
:
obj
,
uni
.
$emit
(
'chosen'
,
{
obj
:
obj
,
ec
})
uni
.
navigateBack
({
delta
:
1
})
uni
.
navigateBack
({
delta
:
1
})
}
// 打开添加考官弹窗
function
openAddExaminer
()
{
addForm
.
value
.
name
=
''
addForm
.
value
.
certCode
=
''
searchResult
.
value
=
null
searchNoData
.
value
=
false
addPopup
.
value
.
open
()
}
// 搜索并添加考官
function
searchAndAdd
()
{
if
(
!
addForm
.
value
.
name
)
{
uni
.
showToast
({
title
:
'请输入考官姓名'
,
icon
:
'none'
})
return
}
if
(
addForm
.
value
.
type
==
1
&&
!
addForm
.
value
.
certCode
)
{
uni
.
showToast
({
title
:
'请输入考官编号'
,
icon
:
'none'
})
return
}
function
handleInfo
(
n
)
{
uni
.
navigateTo
({
url
:
`/personalVip/detail?perId=
${
n
.
perId
}
`
uni
.
showLoading
({
title
:
'查询中'
})
api
.
getCoachList
(
addForm
.
value
).
then
(
res
=>
{
uni
.
hideLoading
()
if
(
res
.
rows
&&
res
.
rows
.
length
>
0
)
{
searchResult
.
value
=
res
.
rows
[
0
]
// 检查是否已添加
const
isAdded
=
list
.
value
.
some
(
l
=>
l
.
perId
===
searchResult
.
value
.
perId
)
if
(
isAdded
)
{
searchResult
.
value
.
added
=
true
}
}
else
{
searchResult
.
value
=
null
searchNoData
.
value
=
true
}
}).
catch
(()
=>
{
uni
.
hideLoading
()
searchResult
.
value
=
null
searchNoData
.
value
=
true
})
}
// 执行添加考官
function
doAddExaminer
(
row
)
{
uni
.
showModal
({
title
:
'提示'
,
content
:
`确定添加 "
${
row
.
name
}
" 为考官吗?`
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
uni
.
showLoading
({
title
:
'添加中'
})
api
.
selfAdd
(
app
.
globalData
.
memberInfo
.
memId
,
row
.
perId
).
then
(()
=>
{
uni
.
hideLoading
()
uni
.
showToast
({
title
:
'添加成功'
,
icon
:
'success'
})
addPopup
.
value
.
close
()
// 刷新列表
getList
()
}).
catch
(()
=>
{
uni
.
hideLoading
()
uni
.
showToast
({
title
:
'添加失败'
,
icon
:
'error'
})
})
}
}
})
}
</
script
>
...
...
@@ -157,38 +221,156 @@
<
style
scoped
lang=
"scss"
>
.indexboxre
{
padding
:
0
30
rpx
;
.tt
{
font-size
:
30
rpx
;
margin
:
0
0
30
rpx
;
color
:
#4C5359
;
}
position
:
relative
;
height
:
calc
(
100vh
-
300rpx
);
.add-btn-box
{
padding
:
20
rpx
30
rpx
;
.btn-red-kx
{
width
:
100%
;
display
:
inline-flex
;
align-items
:
center
;
background
:
#fff
;
border
:
1px
solid
#AD181F
;
color
:
#AD181F
;
text-align
:
center
;
font-size
:
26
rpx
;
padding
:
10
rpx
20
rpx
;
height
:
60
rpx
;
line-height
:
60
rpx
;
justify-content
:
center
;
}
}
.searchbar
{
.userlist
{
.item
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
padding
:
25
rpx
;
box-sizing
:
border-box
;
padding
:
30
rpx
;
margin-bottom
:
20
rpx
;
background
:
#fff
;
border-radius
:
10
rpx
;
:deep(.uni-easyinput
.uni-easyinput__content)
{
border-radius
:
35
rpx
;
border
:
none
;
height
:
7
0
rpx
;
.name
{
font-size
:
32
rpx
;
font-weight
:
bold
;
margin-bottom
:
1
0
rpx
;
}
:deep
(
.uni-easyinput__content-input
)
{
.date
{
font-size
:
26
rpx
;
color
:
#666
;
margin-top
:
6
rpx
;
}
.status
{
text
{
padding
:
10
rpx
20
rpx
;
font-size
:
28
rpx
;
}
}
}
}
.text-primary
{
color
:
#007aff
;
}
.text-gray
{
color
:
#999
;
}
.text-danger
{
color
:
#dd524d
;
}
.popBody
{
padding
:
40
rpx
30
rpx
;
.h3
{
font-size
:
32
rpx
;
font-weight
:
bold
;
margin-bottom
:
30
rpx
;
}
.form-item
{
margin-bottom
:
20
rpx
;
.label
{
display
:
block
;
font-size
:
28
rpx
;
color
:
#333
;
margin-bottom
:
10
rpx
;
}
}
.button-group
{
text-align
:
right
;
button
{
margin-left
:
30
rpx
;
.btn-group
{
display
:
flex
;
justify-content
:
center
;
gap
:
40
rpx
;
margin-top
:
30
rpx
;
.btn-cancel,
.btn-confirm
{
width
:
200
rpx
;
height
:
70
rpx
;
line-height
:
70
rpx
;
font-size
:
28
rpx
;
border-radius
:
35
rpx
;
}
.btn-cancel
{
background
:
#fff
;
color
:
#AD181F
;
border
:
1px
solid
#AD181F
;
}
.btn-confirm
{
background
:
#AD181F
;
color
:
#fff
;
}
}
}
.search-result
{
margin-top
:
30
rpx
;
border-top
:
1px
solid
#eee
;
padding-top
:
20
rpx
;
.result-item
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
padding
:
20
rpx
;
background
:
#f9f9f9
;
border-radius
:
8
rpx
;
.name
{
font-size
:
30
rpx
;
font-weight
:
bold
;
margin-bottom
:
8
rpx
;
}
.date
{
font-size
:
24
rpx
;
color
:
#666
;
margin-top
:
4
rpx
;
}
.action
{
text
{
padding
:
10
rpx
20
rpx
;
font-size
:
28
rpx
;
}
}
}
}
.no-data
{
text-align
:
center
;
padding
:
40
rpx
;
color
:
#999
;
font-size
:
28
rpx
;
}
</
style
>
...
...
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