Commit 3f0fdeea authored by xinzhedeai's avatar xinzhedeai

add:爱山东App商户首页应急演练模块添加,隐患逾期上报增加flag显隐处理

parent 4ebfb1e0
...@@ -301,8 +301,8 @@ ...@@ -301,8 +301,8 @@
<!-- 隐患详情底部栏 --> <!-- 隐患详情底部栏 -->
<div class="bottom_bar" v-if="flag=='3' && (userType == 'wgy' || userType=='safety')"> <div class="bottom_bar" v-if="flag=='3' && (userType == 'wgy' || userType=='safety')">
<div> <div>
<!-- 2025年7月21日11:10:58 新增延期两次后才需要预期上报功能。 -->
<van-button type="primary" size="small" @click="shangbao">逾期上报</van-button> <van-button type="primary" size="small" @click="shangbao" v-if="jujue.pushFlag">逾期上报</van-button>
<van-button type="info" size="small" @click="yuqi.show4yanqi=true">限期3天整改</van-button> <van-button type="info" size="small" @click="yuqi.show4yanqi=true">限期3天整改</van-button>
</div> </div>
</div> </div>
......
...@@ -197,8 +197,6 @@ window.addEventListener("load", function() { ...@@ -197,8 +197,6 @@ window.addEventListener("load", function() {
interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'], interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'],
reqParams: { reqParams: {
sign: 31, sign: 31,
pageNum: this.page++, // 每次请求增加下一页
pageSize: this.size,
exerciseId: this.id, exerciseId: this.id,
sort: 'lawId,desc', sort: 'lawId,desc',
}, },
......
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
<div class="msgTip"> <div class="msgTip">
该商家4/5/6月份未进行特种作业培训 5月份未进行培训演练 该商家4/5/6月份未进行特种作业培训 5月份未进行培训演练
</div> </div>
<van-cell v-for="item in 10" :key="item.id" @click="viewDetail(item,'YH_XQ')"> <van-cell v-for="item in ylList" :key="item.id" @click="viewYlDetail(item)">
<div style="width: 100%;"> <div style="width: 100%;">
<!-- 第一行:隐患描述 --> <!-- 第一行:隐患描述 -->
...@@ -154,25 +154,25 @@ ...@@ -154,25 +154,25 @@
font-size: 0.3rem; font-size: 0.3rem;
font-weight: bold; font-weight: bold;
font-family: PingFang SC; font-family: PingFang SC;
">{{ item.description || '消防安全培训演练' }}</div> ">{{ item.title }}</div>
<!-- 第二行:状态和时间 --> <!-- 第二行:状态和时间 -->
<div style="display: flex; justify-content: start; gap: .34rem; margin: 8px 0;"> <div style="display: flex; justify-content: start; gap: .34rem; margin: 8px 0;">
<van-tag type="primary"> <van-tag type="primary">
{{ '培训演练' }} {{ item.typeName || '-' }}
</van-tag> </van-tag>
<span <span
style="color: #737373; font-size: 0.28rem;">日期:{{ item.checkDate }}</span> style="color: #737373; font-size: 0.28rem;">日期:{{ item.exerciseDate }}</span>
<van-icon name="arrow" class="navToBtn" @click="viewDetail(item,'YH_XQ')" /> <van-icon name="arrow" class="navToBtn" />
</div> </div>
<!-- 第三行:商家和箭头 --> <!-- 第三行:商家和箭头 -->
<div style="display: flex; justify-content: space-between; align-items: center;"> <div style="display: flex; justify-content: space-between; align-items: center;">
<span style="color: #666; font-size: 0.28rem;">培训人数(人):{{ item.merName }}</span> <span style="color: #666; font-size: 0.28rem;">{{item.exerciseType == 1 ? '培训': '演练'}}人数(人):{{ item.merName }}</span>
</div> </div>
<div style="display: flex; justify-content: space-between; align-items: center;"> <div style="display: flex; justify-content: space-between; align-items: center;">
<span style="color: #666; font-size: 0.28rem;">培训人:{{ item.merName }}</span> <span style="color: #666; font-size: 0.28rem;">负责人:{{ item.responsiblePerson }}</span>
</div> </div>
</div> </div>
</van-cell> </van-cell>
......
...@@ -9,6 +9,11 @@ window.addEventListener("load", function () { ...@@ -9,6 +9,11 @@ window.addEventListener("load", function () {
el: '#app', el: '#app',
data() { data() {
return { return {
loading: false,
finished: false,
page: 1,
size: 9999,
total: 0,
// 新增子Tab数据 // 新增子Tab数据
subActiveTab: 0, subActiveTab: 0,
hazardList: [// 更多示例数据... hazardList: [// 更多示例数据...
...@@ -42,6 +47,7 @@ window.addEventListener("load", function () { ...@@ -42,6 +47,7 @@ window.addEventListener("load", function () {
}, },
jcLisk: [{ // 新增检查列表数据 jcLisk: [{ // 新增检查列表数据
}], }],
ylList:[],
UserPermission: false, // 用户是否具有安全检查权限 UserPermission: false, // 用户是否具有安全检查权限
} }
}, },
...@@ -66,6 +72,15 @@ window.addEventListener("load", function () { ...@@ -66,6 +72,15 @@ window.addEventListener("load", function () {
} }
}, },
methods: { methods: {
reset() {
this.page = 1
this.size = 9999
this.total = 0
this.hazardList = []
this.jcLisk = []
this.ylList = []
this.finished = false
},
navTo(url) { navTo(url) {
// gemhoUtil.nav2asd(url) // gemhoUtil.nav2asd(url)
let params = gemhoUtil.getUrlParams() let params = gemhoUtil.getUrlParams()
...@@ -80,8 +95,13 @@ window.addEventListener("load", function () { ...@@ -80,8 +95,13 @@ window.addEventListener("load", function () {
gemhoUtil.navigatePage(strurl, '跳转中...') gemhoUtil.navigatePage(strurl, '跳转中...')
}, },
clickTab() { clickTab() {
if (this.activeTab > 0) { this.reset()
if (this.activeTab == 0){
this.getYhList() // 获取隐患记录
}else if (this.activeTab > 0 && this.activeTab <3) {
this.getJcList() // 获取检查列表 this.getJcList() // 获取检查列表
}else{
this.getYlList() // 获取演练列表
} }
}, },
...@@ -107,15 +127,6 @@ window.addEventListener("load", function () { ...@@ -107,15 +127,6 @@ window.addEventListener("load", function () {
} }
return types[status] || '' return types[status] || ''
}, },
statusTagType4yl(status) {
const types = {
'培训演练': 'warning',
'特种作业培训演练': 'primary',
'已整改': 'success',
'整改逾期': 'danger',
};
return types[status] || '';
},
viewDetail(item, type) { viewDetail(item, type) {
let params = { let params = {
id: item.id, id: item.id,
...@@ -137,6 +148,20 @@ window.addEventListener("load", function () { ...@@ -137,6 +148,20 @@ window.addEventListener("load", function () {
let url = gemhoUtil.setParameter('_check_info.html', params) let url = gemhoUtil.setParameter('_check_info.html', params)
gemhoUtil.navigatePage(url, '跳转中...') gemhoUtil.navigatePage(url, '跳转中...')
}, },
viewYlDetail(item) {
let params = {
id: item.id ||'',
merId: this.merId,
pageName: '_shanghu_home'
}
// 这里添加跳转逻辑
var pageUrl = '_peixun_yanlian_detail-anquan.html' // 安全培训详情页面
if (item.exerciseType == 2) { // 跳转应急演练详情
pageUrl = '_peixun_yanlian_detail-yingji.html'
}
let url = gemhoUtil.setParameter(pageUrl, params)
gemhoUtil.navigatePage(url, '跳转中...')
},
//获取商户统计信息 //获取商户统计信息
getShopDate() { getShopDate() {
vant.Toast.loading({ vant.Toast.loading({
...@@ -152,8 +177,6 @@ window.addEventListener("load", function () { ...@@ -152,8 +177,6 @@ window.addEventListener("load", function () {
interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'], interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'],
reqParams: { reqParams: {
sign: 6, sign: 6,
pageNum: this.page++, // 每次请求增加下一页
pageSize: this.size,
merId: this.merId, merId: this.merId,
sort: 'lawId,desc', sort: 'lawId,desc',
}, },
...@@ -162,7 +185,6 @@ window.addEventListener("load", function () { ...@@ -162,7 +185,6 @@ window.addEventListener("load", function () {
if (!res) { if (!res) {
// 中台返回为undefined 重新请求 // 中台返回为undefined 重新请求
vant.Toast.clear() vant.Toast.clear()
this.page = this.page - 1 // 重新请求后,分页数恢复上一次请求的值
setTimeout(() => { setTimeout(() => {
// this.getList() // this.getList()
}, 0) }, 0)
...@@ -191,8 +213,6 @@ window.addEventListener("load", function () { ...@@ -191,8 +213,6 @@ window.addEventListener("load", function () {
interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'], interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'],
reqParams: { reqParams: {
sign: 11, sign: 11,
pageNum: this.page++, // 每次请求增加下一页
pageSize: this.size,
merId: this.merId, merId: this.merId,
sort: 'lawId,desc', sort: 'lawId,desc',
}, },
...@@ -215,6 +235,42 @@ window.addEventListener("load", function () { ...@@ -215,6 +235,42 @@ window.addEventListener("load", function () {
) )
}, 0) }, 0)
}, },
getYlList(){
vant.Toast.loading({
message: '正在加载...',
forbidClick: true,
loadingType: 'spinner',
})
setTimeout(() => {
http2.post(
{
serviceId: API_KEY_MAP['page']['id'],
interfacePublicKey: API_KEY_MAP['page']['publicKey'],
interfacePrivateKey: API_KEY_MAP['page']['privateKey'],
reqParams: {
sign: 30,
pageNum: this.page++, // 每次请求增加下一页
pageSize: this.size,
sort: 'lawId,desc',
merId: this.merId,
},
},
(res) => {
if (res) {
var result = JSON.parse(res)
this.ylList = result.rows || []
console.log(result)
}
this.loading = false
setTimeout(() => {
this.$nextTick(() => {
vant.Toast.clear()
})
}, 0)
}
)
}, 0)
},
//获取隐患记录 //获取隐患记录
getYhList() { getYhList() {
vant.Toast.loading({ vant.Toast.loading({
...@@ -238,20 +294,17 @@ window.addEventListener("load", function () { ...@@ -238,20 +294,17 @@ window.addEventListener("load", function () {
}, },
}, },
(res) => { (res) => {
if (!res) {
// 中台返回为undefined 重新请求
vant.Toast.clear()
this.page = this.page - 1 // 重新请求后,分页数恢复上一次请求的值
setTimeout(() => {
// this.getList()
}, 0)
return
}
if (res) { if (res) {
var result = JSON.parse(res) var result = JSON.parse(res)
this.hazardList = result.rows this.hazardList = result.rows || []
console.log(result) console.log(result)
} }
this.loading = false
setTimeout(() => {
this.$nextTick(() => {
vant.Toast.clear()
})
}, 0)
} }
) )
}, 0) }, 0)
...@@ -280,24 +333,9 @@ window.addEventListener("load", function () { ...@@ -280,24 +333,9 @@ window.addEventListener("load", function () {
}, },
}, },
(res) => { (res) => {
if (!res) {
// 中台返回为undefined 重新请求
vant.Toast.clear()
this.page = this.page - 1 // 重新请求后,分页数恢复上一次请求的值
setTimeout(() => {
// this.getList()
}, 0)
return
}
if (res) { if (res) {
var result = JSON.parse(res) var result = JSON.parse(res)
if (result.code !== 200 && result.data == null) {
return
}
this.jcLisk = result.rows this.jcLisk = result.rows
if (this.page * this.size >= this.total) {
this.finished = true // 下滑不在刷新数据
}
} }
this.loading = false this.loading = false
setTimeout(() => { setTimeout(() => {
...@@ -305,10 +343,6 @@ window.addEventListener("load", function () { ...@@ -305,10 +343,6 @@ window.addEventListener("load", function () {
vant.Toast.clear() vant.Toast.clear()
}) })
}, 0) }, 0)
this.$nextTick(() => {
// 滚动条跳转位置
window.scrollTo(0, gemhoUtil.getCookie('scrollPosition'))
})
} }
) )
}, 0) }, 0)
...@@ -324,21 +358,10 @@ window.addEventListener("load", function () { ...@@ -324,21 +358,10 @@ window.addEventListener("load", function () {
reqParams: { reqParams: {
sign: 13, sign: 13,
merId: this.merId, merId: this.merId,
pageNum: this.page++, // 每次请求增加下一页
pageSize: this.size,
sort: 'lawId,desc', sort: 'lawId,desc',
}, },
}, },
(res) => { (res) => {
if (!res) {
// 中台返回为undefined 重新请求
vant.Toast.clear()
this.page = this.page - 1 // 重新请求后,分页数恢复上一次请求的值
setTimeout(() => {
// this.getList()
}, 0)
return
}
if (res) { if (res) {
var result = JSON.parse(res) var result = JSON.parse(res)
if (result.code !== 200 && result.data == null) { if (result.code !== 200 && result.data == null) {
...@@ -346,9 +369,6 @@ window.addEventListener("load", function () { ...@@ -346,9 +369,6 @@ window.addEventListener("load", function () {
} }
console.log(result.data, result, '获取用户是否具有安全检查资格'); console.log(result.data, result, '获取用户是否具有安全检查资格');
this.UserPermission = result.data.length > 0 ? true : false this.UserPermission = result.data.length > 0 ? true : false
if (this.page * this.size >= this.total) {
this.finished = true // 下滑不在刷新数据
}
} }
this.loading = false this.loading = false
setTimeout(() => { setTimeout(() => {
...@@ -356,15 +376,10 @@ window.addEventListener("load", function () { ...@@ -356,15 +376,10 @@ window.addEventListener("load", function () {
vant.Toast.clear() vant.Toast.clear()
}) })
}, 0) }, 0)
this.$nextTick(() => {
// 滚动条跳转位置
window.scrollTo(0, gemhoUtil.getCookie('scrollPosition'))
})
} }
) )
}, 0) }, 0)
} }
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment