Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
GaoQuYingJiH5-ASD
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xinzhedeai
GaoQuYingJiH5-ASD
Commits
aafa8258
Commit
aafa8258
authored
Apr 15, 2025
by
xinzhedeai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 检查单处理
parent
129f3d64
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
257 additions
and
26 deletions
+257
-26
index.html
index.html
+1
-0
axios_http.js
sdk/axios_http.js
+8
-1
axios_http3.js
sdk/axios_http3.js
+213
-0
includeHead.js
sdk/includeHead.js
+1
-0
_check_info.html
src/_check_info.html
+5
-3
_check_info.js
src/_check_info.js
+29
-22
No files found.
index.html
View file @
aafa8258
...
...
@@ -173,3 +173,4 @@
</div>
</body>
</html>
sdk/axios_http.js
View file @
aafa8258
...
...
@@ -8,8 +8,15 @@ axios.defaults.timeout = 50000
// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
axios
.
defaults
.
headers
.
post
[
'
Content-Type
'
]
=
'
application/json
'
// axios.defaults.headers.common['Authorization'] = gemhoUtil.getCookie('token')
// 商户token
// axios.defaults.headers.common['Authorization'] =
// 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiLlvKDlrZ3lvakiLCJsb2dpbl91c2VyX2tleSI6IjNjMmRiMWFiLWIyZGMtNDBjYi04YjM5LWRiNTJmM2VmYzNkYyJ9.sfZyPP-COShNCjwxKR26zGDsPHXss97gu7JEpaMapIZyMQEsxzMigVickcqdhaqDwTRcfr0IxAj64vnrriS9Cw'
// admin账号token
axios
.
defaults
.
headers
.
common
[
'
Authorization
'
]
=
'
Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxNTcyMTAzMTg4NiIsImxvZ2luX3VzZXJfa2V5IjoiMGFmNjhkZjItZjc3Ni00OTlkLTkzYjQtOGNkMmNlMDg2ZTVjIn0.NynQrQAUSqbWRGtjc00PHedLPvKdo0oHmHocwwdJmZyXQJjs0_B9_CeCeTs2PUkbEkRuYupzzPN3MvqtWC-GLw
'
'
Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImxvZ2luX3VzZXJfa2V5IjoiYjA1MWRmZmEtYWE4Yy00NTNiLThlNGUtMTdjOTEzYmMwOWFkIn0.nj2miSFFPQRDabzhq_05z_wW0w13quXBooQbbtnyRZQxOhxenEQQZM3OgKjgd8AxjY7W2uKlpdyqGuTmMb1PRQ
'
// 请求拦截器
axios
.
interceptors
.
request
.
use
((
config
)
=>
{
...
...
sdk/axios_http3.js
0 → 100644
View file @
aafa8258
/** axios封装
* 请求拦截、相应拦截、错误统一处理
*/
// 环境的切换
axios
.
defaults
.
baseURL
=
'
http://192.168.2.37:8080
'
axios
.
defaults
.
timeout
=
50000
// post请求头
// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
axios
.
defaults
.
headers
.
post
[
'
Content-Type
'
]
=
'
application/json
'
// axios.defaults.headers.common['Authorization'] = gemhoUtil.getCookie('token')
// 商户token
// axios.defaults.headers.common['Authorization'] =
// 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiLlvKDlrZ3lvakiLCJsb2dpbl91c2VyX2tleSI6IjNjMmRiMWFiLWIyZGMtNDBjYi04YjM5LWRiNTJmM2VmYzNkYyJ9.sfZyPP-COShNCjwxKR26zGDsPHXss97gu7JEpaMapIZyMQEsxzMigVickcqdhaqDwTRcfr0IxAj64vnrriS9Cw'
// admin账号token
axios
.
defaults
.
headers
.
common
[
'
Authorization
'
]
=
'
Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImxvZ2luX3VzZXJfa2V5IjoiYjA1MWRmZmEtYWE4Yy00NTNiLThlNGUtMTdjOTEzYmMwOWFkIn0.nj2miSFFPQRDabzhq_05z_wW0w13quXBooQbbtnyRZQxOhxenEQQZM3OgKjgd8AxjY7W2uKlpdyqGuTmMb1PRQ
'
// 请求拦截器
axios
.
interceptors
.
request
.
use
((
config
)
=>
{
vant
.
Toast
.
loading
({
message
:
'
加载中...
'
,
forbidClick
:
true
,
loadingType
:
'
spinner
'
,
})
return
config
})
// 响应拦截器
axios
.
interceptors
.
response
.
use
(
(
res
)
=>
{
// 成功的响应数据 服务器的相关的数据返回来之后,响应拦截器能够检测到,可以做一些事
vant
.
Toast
.
clear
()
return
res
},
(
error
)
=>
{
// 响应失败的时候的回调函数
return
Promise
.
reject
(
new
Error
(
error
))
}
)
var
http3
=
{
get
:
function
(
url
,
params
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
axios
.
get
(
url
,
{
params
:
params
})
.
then
(
res
=>
{
resolve
(
res
.
data
)
})
.
catch
(
err
=>
{
reject
(
err
.
data
)
})
})
},
post
:
function
(
url
,
params
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
axios
.
post
(
url
,
params
)
.
then
(
res
=>
{
let
response
=
res
.
data
console
.
log
(
'
res.statusCode
'
,
response
)
if
(
response
.
statusCode
>=
300
||
response
.
status
>=
300
)
{
// alert('系统发生错误')
vant
.
Dialog
.
alert
({
title
:
'
信息提示
'
,
message
:
response
.
message
,
})
return
}
resolve
(
res
.
data
)
})
.
catch
(
err
=>
{
reject
(
err
.
data
)
})
})
},
delete
:
function
(
url
,
params
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
axios
({
url
,
method
:
'
post
'
,
data
:
params
,
headers
:
{
// 'Content-Type': 'application/json', // 'multipart/form-data;',
'
Authorization
'
:
localStorage
.
getItem
(
'
Authorization
'
),
'
requestType
'
:
'
delete
'
},
})
.
then
(
res
=>
{
let
response
=
res
.
data
console
.
log
(
'
res.statusCode
'
,
response
)
if
(
response
.
statusCode
>=
300
||
response
.
status
>=
300
)
{
// alert('系统发生错误')
vant
.
Dialog
.
alert
({
title
:
'
信息提示
'
,
message
:
response
.
message
,
})
return
}
resolve
(
res
.
data
)
})
.
catch
(
err
=>
{
reject
(
err
.
data
)
})
})
},
put
:
function
(
url
,
params
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
axios
({
url
,
method
:
'
post
'
,
data
:
params
,
headers
:
{
// 'Content-Type': 'application/json', // 'multipart/form-data;',
'
Authorization
'
:
localStorage
.
getItem
(
'
Authorization
'
),
'
requestType
'
:
'
put
'
},
})
.
then
(
res
=>
{
let
response
=
res
.
data
console
.
log
(
'
res.statusCode
'
,
response
)
if
(
response
.
statusCode
>=
300
||
response
.
status
>=
300
)
{
// alert('系统发生错误')
vant
.
Dialog
.
alert
({
title
:
'
信息提示
'
,
message
:
response
.
message
,
})
return
}
resolve
(
res
.
data
)
})
.
catch
(
err
=>
{
reject
(
err
.
data
)
})
})
},
postFile
:
function
(
url
,
params
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
axios
({
url
,
method
:
'
post
'
,
data
:
params
,
headers
:
{
'
Content-Type
'
:
'
application/json
'
,
// 'multipart/form-data;',
'
Authorization
'
:
localStorage
.
getItem
(
'
Authorization
'
)
},
}).
then
(
res
=>
{
let
response
=
res
.
data
console
.
log
(
'
res.statusCode
'
,
response
)
if
(
response
.
statusCode
>=
300
||
response
.
status
>=
300
)
{
// alert('系统发生错误')
vant
.
Dialog
.
alert
({
title
:
'
信息提示
'
,
message
:
response
.
message
,
})
return
}
resolve
(
res
.
data
)
})
.
catch
(
err
=>
{
reject
(
err
.
data
)
})
})
},
downloadFile
:
function
(
url
,
params
)
{
console
.
log
(
'
downloadfILE
'
,
params
)
return
new
Promise
((
resolve
,
reject
)
=>
{
axios
({
url
,
method
:
'
get
'
,
// data: params,
params
:
params
,
headers
:
{
// 'Content-Type': 'application/json', // 'multipart/form-data;',
'
Authorization
'
:
localStorage
.
getItem
(
'
Authorization
'
)
},
responseType
:
'
blob
'
//在请求中加上这一行,特别重要
}).
then
(
res
=>
{
// 返回格式是文件流格式
// 在请求拿到文件流res以后,使用a标签下载
let
fileData
=
res
.
data
let
blob
=
new
Blob
([
fileData
],
{
type
:
'
application/msword;charset=UTF-8
'
}
/* , {
type: `application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=utf-8;`
} */
)
var
a
=
document
.
createElement
(
'
a
'
);
document
.
body
.
appendChild
(
a
);
a
.
style
=
'
display: none
'
;
var
url
=
window
.
URL
.
createObjectURL
(
blob
);
a
.
href
=
url
;
a
.
setAttribute
(
'
download
'
,
'
YH-
'
+
gemhoUtil
.
getTargetDateYMD
().
replaceAll
(
'
-
'
,
''
)
+
'
.docx
'
)
a
.
click
();
a
.
remove
();
window
.
URL
.
revokeObjectURL
(
url
);
})
.
catch
(
err
=>
{
reject
(
err
.
data
)
})
})
},
}
\ No newline at end of file
sdk/includeHead.js
View file @
aafa8258
...
...
@@ -69,3 +69,4 @@ function getPageN() {
pageN
=
pageN
.
substring
(
pageN
.
lastIndexOf
(
'
/
'
)
+
1
,
pageN
.
indexOf
(
'
.
'
))
return
pageN
}
src/_check_info.html
View file @
aafa8258
...
...
@@ -8,7 +8,9 @@
content=
"width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, viewprot-fit:cover"
>
<title>
消防安全检查清单
</title>
<script
type=
"text/javascript"
src=
"../sdk/includeHead.js"
></script>
<script
type=
"text/javascript"
src=
"../sdk/axios_http3.js"
></script>
<script
type=
"text/javascript"
src=
"_check_info_data.js"
></script>
<!-- <script type="text/javascript" src="_check_info_data_detail.js"></script>
<script type="text/javascript" src="_check_info_data_detail_yh.js"></script> -->
</head>
...
...
@@ -27,7 +29,7 @@
<div
class=
"item_title"
>
{{ checkData?.[checkPageIndex]?.name }}
</div>
<div
v-for=
"(item, index) in checkData?.[checkPageIndex]?.['gqCheckItem
Vo
List']"
:key=
"item.id"
class=
"check-item"
>
<div
v-for=
"(item, index) in checkData?.[checkPageIndex]?.['gqCheckItemList']"
:key=
"item.id"
class=
"check-item"
>
<div
class=
"item-header"
>
<!-- <div class="item-number">{{ index + 1 }}</div> -->
<div
class=
"item-title"
>
{{ item.id }}.{{ item.name }}
</div>
...
...
@@ -47,7 +49,7 @@
<!-- 子检查项 -->
<div
class=
"sub-checkbox-group"
>
<van-cell
v-if=
"item.itemType==1"
>
<van-checkbox
v-for=
"(subItem, subIndex) in item.gqCheckQuestion
Dto
List"
:key=
"subIndex"
<van-checkbox
v-for=
"(subItem, subIndex) in item.gqCheckQuestionList"
:key=
"subIndex"
v-model=
"subItem.check"
shape=
"square"
:disabled=
"flag!=='ADD'"
>
{{ subItem.name}}
</van-checkbox>
...
...
@@ -55,7 +57,7 @@
<van-cell
v-if=
"item.itemType==2"
>
<div
class=
"limit_date_wrapper"
>
<span>
住宿人数:
</span>
<input
type=
"text"
v-model=
"item.gqCheckQuestion
Dto
List[0].content"
:disabled=
"flag!=='ADD'"
<input
type=
"text"
v-model=
"item.gqCheckQuestionList[0].content"
:disabled=
"flag!=='ADD'"
style=
"width:.8rem;height:.4rem;text-align:center;"
/>
</div>
</van-cell>
...
...
src/_check_info.js
View file @
aafa8258
...
...
@@ -12,13 +12,14 @@
*/
var
VUE
=
null
window
.
onload
=
function
()
{
function
countSelectedNo
(
result
)
{
// 获取 checkList 中 selected 为 'no' 的对象个数
return
VUE
.
originCheckData
.
reduce
((
total
,
category
)
=>
{
return
result
.
reduce
((
total
,
category
)
=>
{
return
(
total
+
category
.
gqCheckItem
Vo
List
.
filter
((
item
)
=>
item
.
itemAnswer
===
2
)
category
.
gqCheckItemList
.
filter
((
item
)
=>
item
.
itemAnswer
===
2
)
.
length
)
},
0
)
...
...
@@ -26,10 +27,10 @@ window.onload = function() {
function
countSelectedNotNull
(
result
)
{
// 获取 checkList 中 selected 不为 null 的个数
return
VUE
.
originCheckData
.
reduce
((
total
,
category
)
=>
{
return
result
.
reduce
((
total
,
category
)
=>
{
return
(
total
+
category
.
gqCheckItem
Vo
List
.
filter
((
item
)
=>
item
.
itemAnswer
!==
0
)
category
.
gqCheckItemList
.
filter
((
item
)
=>
item
.
itemAnswer
!==
0
)
.
length
)
},
0
)
...
...
@@ -39,6 +40,7 @@ window.onload = function() {
el
:
'
#app
'
,
data
:
{
id
:
''
,
// 记录id || 隐患id
merId
:
''
,
// 商户id
pageName
:
''
,
// 页面名称(用于记录页面来源,用于操作后返回上一页)
flag
:
'
ZG_XQ
'
,
// 值为ADD新增、JC_XQ检查详情、ZG_XQ整改详情、YH_XQ隐患详情
flag
:
'
ADD
'
,
...
...
@@ -61,7 +63,7 @@ window.onload = function() {
mounted
()
{
/**
* 调转该_check_info.html页面时需要传递参数
*
type
: ADD新增、JC_XQ检查详情、ZG_XQ整改详情、YH_XQ隐患详情
*
flag
: ADD新增、JC_XQ检查详情、ZG_XQ整改详情、YH_XQ隐患详情
* id: 记录id || 隐患id
* pageName: 页面名称(用于记录页面来源,用于操作后返回上一页)
*
...
...
@@ -69,6 +71,7 @@ window.onload = function() {
console
.
log
(
gemhoUtil
.
getParameter
,
'
gemhoUtil.getParameter
'
)
this
.
pageName
=
gemhoUtil
.
getParameter
(
'
pageName
'
)
this
.
id
=
gemhoUtil
.
getParameter
(
'
id
'
)
this
.
merId
=
gemhoUtil
.
getParameter
(
'
merId
'
)
this
.
flag
=
gemhoUtil
.
getParameter
(
'
flag
'
)
// this.flag = 'JC_XQ'
...
...
@@ -89,16 +92,16 @@ window.onload = function() {
handler
(
newVal
)
{
const
snapshot
=
JSON
.
parse
(
JSON
.
stringify
(
newVal
));
console
.
log
(
'
全量变化:
'
,
snapshot
);
this
.
noCount
=
countSelectedNo
(
newVal
);
// selected=no 的个数
this
.
noCount
=
countSelectedNo
(
snapshot
);
// selected=no 的个数
// this.totalItems = getTotalCheckListItems(newVal); // checkList 子元素总数
this
.
notNullCount
=
countSelectedNotNull
(
newVal
);
// selected 不为 null 的个数
this
.
notNullCount
=
countSelectedNotNull
(
snapshot
);
// selected 不为 null 的个数
},
deep
:
true
}
},
methods
:
{
getOriginMatchedItemById
(
id
)
{
const
result
=
this
.
originCheckData
[
this
.
checkPageIndex
][
'
gqCheckItem
Vo
List
'
].
find
(
item
=>
const
result
=
this
.
originCheckData
[
this
.
checkPageIndex
][
'
gqCheckItemList
'
].
find
(
item
=>
item
.
id
===
id
)
||
[]
return
JSON
.
parse
(
JSON
.
stringify
(
result
))
},
...
...
@@ -108,10 +111,10 @@ window.onload = function() {
const
newItem
=
this
.
getOriginMatchedItemById
(
item
.
id
)
console
.
log
(
val
,
newItem
,
'
数据改变了。。。。newItem
'
)
newItem
.
itemAnswer
=
val
// console.log(this.checkData[this.checkPageIndex]['gqCheckItem
Vo
List'])
this
.
$set
(
this
.
checkData
[
this
.
checkPageIndex
][
'
gqCheckItem
Vo
List
'
],
index
,
JSON
.
parse
(
JSON
// console.log(this.checkData[this.checkPageIndex]['gqCheckItemList'])
this
.
$set
(
this
.
checkData
[
this
.
checkPageIndex
][
'
gqCheckItemList
'
],
index
,
JSON
.
parse
(
JSON
.
stringify
()));
console
.
log
(
val
,
this
.
checkData
[
this
.
checkPageIndex
][
'
gqCheckItem
Vo
List
'
][
index
],
'
数据改变了后
'
,
console
.
log
(
val
,
this
.
checkData
[
this
.
checkPageIndex
][
'
gqCheckItemList
'
][
index
],
'
数据改变了后
'
,
index
)
},
// 文件上传处理
...
...
@@ -168,17 +171,19 @@ window.onload = function() {
vant
.
Toast
.
clear
()
})
},
0
);
// var result = JSON.parse(res)
var
result
=
res
var
result
=
JSON
.
parse
(
res
)
this
.
checkDate
=
result
.
data
.
checkDate
// 检查日期
this
.
checkPeopleName
=
result
.
data
.
checkPeopleName
// 检查人员
this
.
rectificationDeadline
=
result
.
data
.
rectificationDeadline
// 整改截止日期
this
.
reviewDate
=
result
.
data
.
reviewDate
// 隐患审核日期
this
.
reviewRecord
=
result
.
data
.
reviewRecord
this
.
totalItems
=
result
.
data
.
itemAllCount
,
this
.
totalItems
=
result
.
itemAllCount
// 表单数据
this
.
checkData
=
JSON
.
parse
(
JSON
.
stringify
(
result
.
data
.
gqCheckTypeDtoList
))
this
.
originCheckData
=
JSON
.
parse
(
JSON
.
stringify
(
result
.
data
.
gqCheckTypeDtoList
))
this
.
checkData
=
JSON
.
parse
(
JSON
.
stringify
(
result
.
data
.
gqCheckTypeList
))
this
.
originCheckData
=
JSON
.
parse
(
JSON
.
stringify
(
result
.
data
.
gqCheckTypeList
))
countSelectedNo
(
this
.
originCheckData
);
countSelectedNotNull
(
this
.
originCheckData
)
}
}
)
...
...
@@ -261,13 +266,15 @@ window.onload = function() {
var
result
=
JSON
.
parse
(
res
)
this
.
checkDate
=
result
.
data
.
checkTime
// 检查日期
this
.
checkPeopleName
=
result
.
data
.
checkPeopleName
// 检查人员
this
.
checkData
=
result
.
data
.
gqCheckType
Dto
List
this
.
checkData
=
result
.
data
.
gqCheckTypeList
this
.
noCount
=
result
.
data
.
hiddenCount
this
.
notNullCount
=
result
.
data
.
notRectifiedCount
this
.
totalItems
=
result
.
itemAllCount
// 表单数据
this
.
originCheckData
=
JSON
.
parse
(
JSON
.
stringify
(
result
.
data
.
gqCheckTypeDtoList
))
this
.
originCheckData
=
JSON
.
parse
(
JSON
.
stringify
(
result
.
data
.
gqCheckTypeList
))
countSelectedNo
(
this
.
originCheckData
);
countSelectedNotNull
(
this
.
originCheckData
)
}
}
...
...
@@ -348,17 +355,17 @@ window.onload = function() {
},
add4JC_XQ
()
{
var
reqParam
=
{
"
merId
"
:
"
1
"
,
"
gqCheckType
Vo
List
"
:
this
.
checkData
,
"
merId
"
:
this
.
merId
,
"
gqCheckTypeList
"
:
this
.
checkData
,
}
// var url = "/gq/checkRecord/safeCheckRecord"
http
2
.
post
(
'
/gq/checkRecord/safeCheckRecord
'
,
reqParam
).
then
((
res
)
=>
{
http
3
.
post
(
'
/gq/checkRecord/safeCheckRecord
'
,
reqParam
).
then
((
res
)
=>
{
console
.
log
(
'
添加结果
'
,
res
)
vant
.
Toast
({
message
:
'
操作成功
'
,
})
gemhoUtil
.
navigatePage
(
this
.
pageName
+
'
.html
'
,
'
操作完成,跳转中...
'
)
//
gemhoUtil.navigatePage(this.pageName + '.html', '操作完成,跳转中...')
})
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment