2024-02-05 09:05:12 +08:00
< template >
< view >
< cu -custom bgColor = "bg-gradual-blueness" :isBack ="true" :isRingt ="true" >
< block slot = "backText" > 返回 < / block >
< block slot = "content" > 待排查 < / block >
< / c u - c u s t o m >
< view class = "top-fixed" >
< scroll -view scroll -x class = "bg-white nav" scroll -with -animation :scroll-left ="scrollLeft" >
< view class = "flex text-center" >
< view class = "cu-item flex-sub" : class = "index==TabCur?'text-blue cur':''" v-for ="(item,index) in tabNav" :key="index" @tap="tabSelect" :data-id="index" >
{ { tabNav [ index ] } }
< / view >
< / view >
< / s c r o l l - v i e w >
< view class = "line" > < / view >
< view >
< view class = "cu-bar search bg-white" >
< view class = "search-form radius" @tap ="showDeptTree" > {{ this.DEPTNAME }} < / view >
< tki -tree v -show = " treeShow " ref = "tkiTree" : selectParent = true :range ="treeNode" rangeKey = "name"
@ confirm = "depttreeConfirm" @ cancel = "depttreeCancel" > < / t k i - t r e e >
< view class = "action" >
< button class = "cu-btn bg-green shadow-blur radius" @click ="search()" > 搜 索 < / button >
< button class = "cu-btn bg-blue shadow-blur radius" @click ="reset()" style = "margin-left: 10px" > 重置 < / button >
< / view >
< / view >
< view class = "line" > < / view >
< / view >
< / view >
< block v-if ="TabCur==0" >
< scroll -view class = "dy-scroll-nobg" scroll -y : style = "'top:'+sTop+'px;height:calc(100vh - '+totalHeight+'px)'" >
< view v -if = " list.length > 0 " >
< view class = "dy-card" v-for ="item in list" :key="item.LISTMANAGER_ID" @click="$noMultipleClicks(goToList,{listId:item.LISTMANAGER_ID,listName:item.NAME,userid:item.USER_ID,BAO_BAO_TYPE:item.BAO_BAO_TYPE,HIDDEN_RISKSTANDARD:'1'})" >
< view class = "dy-card-title" >
< text > < text v-if ="item.USER_ID == loginUserId" style="margin-right: 10upx;color: #07BB07;" > ★ < / text > {{ item.NAME }} < / text >
< text class = "cuIcon-right f30 text-gray" > < / text >
< / view >
< view class = "dy-card-content" >
< view class = "dy-sub-stitle" >
< text class = "text-grey" > 清单类型 : { { item . TYPENAME } } < / text >
< text class = "text-grey" > 排查周期 : { { item . PERIODNAME } } < / text >
< / view >
< view class = "dy-sub-stitle" >
< text class = "text-grey" > 包含检查项 : { { item . count } } < / text >
< text class = "text-grey" > 负责人 : { { item . USER _NAME } } < / text >
< / view >
< view class = "dy-stitle" >
< text class = "text-grey" > 起止时间 : { { item . START _DATE } } - { { item . END _DATE } } < / text >
< / view >
< view class = "mb12" >
< text class = "cu-tag bg-red radius" > 重大风险 : { { item . ACOUNT } } < / text >
< text class = "cu-tag bg-orange radius" > 较大 : { { item . BCOUNT } } < / text >
< text class = "cu-tag bg-yellow radius text-white" > 一般 : { { item . CCOUNT } } < / text >
< text class = "cu-tag bg-blue radius" > 低 : { { item . DCOUNT } } < / text >
< / view >
<!-- < view class = "cu-progress radius striped active" > -- >
<!-- < view class = "bg-olive" : style = "[{ width:loading?((item.checkedItem>0 && item.count>0)?(item.checkedItem/item.count*100):0)+'%':''}]" > { { ( item . checkedItem > 0 && item . count > 0 ) ? ( item . checkedItem / item . count * 100 ) : 0 } } % < / view > -- >
<!-- < / view > -- >
< / view >
< / view >
< / view >
< view v -else -if = " dataFlag = = ' noData ' " class = "dy-null" >
< view class = "dy-null-img" >
< image :src ="background[dataFlag].url" mode = "" > < / image >
< / view >
< view class = "dy-null-title" >
{ { background [ dataFlag ] . msg } }
< / view >
< / view >
<!-- < view class = "cu-tabbar-height" > < / view > -- >
< / s c r o l l - v i e w >
< / block >
< block v-if ="TabCur==1" >
< scroll -view class = "dy-scroll-nobg" scroll -y : style = "'top:'+sTop+'px;height:calc(100vh - '+totalHeight+'px)'" >
< view v -if = " list1.length > 0 " >
< view class = "dy-card" v-for ="item in list1" :key="item.CUSTOM_ID" @click="$noMultipleClicks(goToList,{listId:item.CUSTOM_ID,listName:item.NAME,userid:item.USER_ID,BAO_BAO_TYPE:item.BAO_BAO_TYPE,HIDDEN_RISKSTANDARD:'2'})" >
< view class = "dy-card-title" >
< text > < text v-if ="item.USER_ID == loginUserId" style="margin-right: 10upx;color: #07BB07;" > ★ < / text > {{ item.NAME }} < / text >
< text class = "cuIcon-right f30 text-gray" > < / text >
< / view >
< view class = "dy-card-content" >
< view class = "dy-sub-stitle" >
< text class = "text-grey" > 清单类型 : { { item . TYPENAME } } < / text >
< text class = "text-grey" > 排查周期 : { { item . PERIODNAME } } < / text >
< / view >
< view class = "dy-sub-stitle" >
< text class = "text-grey" > 包含检查项 : { { item . count } } < / text >
< text class = "text-grey" > 负责人 : { { item . USER _NAME } } < / text >
< / view >
< view class = "dy-stitle" >
< text class = "text-grey" > 起止时间 : { { item . START _DATE } } - { { item . END _DATE } } < / text >
< / view >
<!-- < view class = "mb12" >
< text class = "cu-tag bg-red radius" > 重大风险 : { { item . ACOUNT } } < / text >
< text class = "cu-tag bg-orange radius" > 较大 : { { item . BCOUNT } } < / text >
< text class = "cu-tag bg-yellow radius text-white" > 一般 : { { item . CCOUNT } } < / text >
< text class = "cu-tag bg-blue radius" > 低 : { { item . DCOUNT } } < / text >
< / view > -- >
< / view >
< / view >
< / view >
< view v -else -if = " dataFlag = = ' noData ' " class = "dy-null" >
< view class = "dy-null-img" >
< image :src ="background[dataFlag].url" mode = "" > < / image >
< / view >
< view class = "dy-null-title" >
{ { background [ dataFlag ] . msg } }
< / view >
< / view >
< view class = "cu-tabbar-height" > < / view >
< / s c r o l l - v i e w >
< / block >
< yk -authpup ref = "authpup" type = "top" @changeAuth ="$noMultipleClicks(scan)" :permissionID ="permissionID" > < / y k - a u t h p u p >
< / view >
< / template >
< script >
import {
basePath , loginUser , loginSession
} from '@/common/tool.js' ;
import tkiTree from "@/components/select-tree/select-tree.vue"
import ykAuthpup from "@/components/yk-authpup/yk-authpup"
export default {
components : {
tkiTree , ykAuthpup
} ,
data ( ) {
return {
permissionID : '' ,
treeShow : false ,
noClick : true ,
initflag : false ,
sTop : 0 ,
totalHeight : 0 ,
TabCur : 0 ,
scrollLeft : 0 ,
tabNav : [ '风险管控清单' , '隐患自查清单' ] ,
loading : false ,
list : [ ] ,
list1 : [ ] ,
totalList : [ ] ,
totalList1 : [ ] ,
treeNode : [ ] , //部门下拉数据
DEPT : '' ,
2024-02-19 09:51:26 +08:00
DEPTNAME : '' ,
2024-02-05 09:05:12 +08:00
page : 1 ,
rows : 1000 ,
totalCount : 0 ,
isEnd : false ,
total : 0 ,
dataFlag : 'noData' ,
isIndex : 0 ,
loginUserId : '' ,
noExamine : false , // 是否禁止检查非本人清单
FKEY : 'examine'
}
} ,
onLoad : async function ( ) {
let that = this ;
this . loginUserId = loginUser . USER _ID ;
this . background = require ( '@/common/background.json' ) ;
await this . getFunc ( ) ;
this . getData ( ) ;
// setTimeout(function() {
// that.loading = true
// }, 500)
loginSession ( ) ;
} ,
onReady ( ) {
let that = this ;
let CustomBar = this . CustomBar ;
uni . getSystemInfo ( { //调用uni-app接口获取屏幕高度
success ( res ) { //成功回调函数
let titleH = uni . createSelectorQuery ( ) . select ( ".top-fixed" ) ; //想要获取高度的元素名( class/id)
titleH . boundingClientRect ( data => {
that . _data . sTop = data . height //计算高度:元素高度=窗口高度-元素距离顶部的距离( data.top)
that . totalHeight = data . height + CustomBar
} ) . exec ( )
}
} )
} ,
async onShow ( ) {
var _this = this ;
if ( _this . initflag ) {
_this . initflag = false ;
_this . list = [ ] ;
_this . list1 = [ ] ;
await this . getFunc ( ) ;
this . getData ( )
}
} ,
methods : {
tabSelect ( e ) {
this . TabCur = e . currentTarget . dataset . id ;
this . scrollLeft = ( e . currentTarget . dataset . id - 1 ) * 60
} ,
search ( ) {
var _this = this ;
_this . list = [ ] ;
_this . list1 = [ ] ;
this . getData ( )
} ,
reset ( ) {
this . DEPT = '' ;
this . DEPTNAME = '' ;
this . list = [ ] ;
this . list1 = [ ] ;
this . getData ( )
} ,
getData ( ) {
this . getDataRisk ( )
this . getDataStandard ( )
} ,
getDataRisk ( ) {
var _this = this ;
console . info ( _this . isEnd ) ;
if ( _this . isEnd ) {
return
}
uni . showLoading ( {
title : '加载中'
} )
console . log ( this . DEPT )
uni . request ( {
url : basePath + '/app/listmanager/checkList' ,
method : 'POST' ,
dataType : 'json' ,
header : {
'Content-type' : 'application/x-www-form-urlencoded'
} ,
data : {
USER _NAME : loginUser . NAME ,
CHECK _DEPARTMENT _ID : loginUser . DEPARTMENT _ID ,
SUB _DEPARTMENT _IDS : this . DEPT , //选择的部门
IS _MAIN : loginUser . ISMAIN ,
CORPINFO _ID : loginUser . CORPINFO _ID ,
USER _ID : loginUser . USER _ID ,
ISSUPERVISE : loginUser . ISSUPERVISE ,
} ,
success : ( res ) => {
if ( "success" == res . data . result ) {
var content = res . data . varList ;
for ( var i = 0 ; i < content .length ; i + + ) {
2024-06-26 17:53:35 +08:00
/ * i f ( c o n t e n t [ i ] . c h e c k C o u n t = = 0 ) {
2024-02-05 09:05:12 +08:00
this . list . push ( content [ i ] ) ;
this . totalList . push ( content [ i ] ) ;
2024-06-26 17:53:35 +08:00
} * /
this . list . push ( content [ i ] ) ;
this . totalList . push ( content [ i ] ) ;
2024-02-05 09:05:12 +08:00
/ * e l s e {
this . list1 . push ( content [ i ] ) ;
this . totalList . push ( content [ i ] ) ;
} * /
}
uni . hideLoading ( ) ;
this . getDept ( )
} else {
uni . showToast ( {
icon : 'none' ,
title : '系统异常' ,
duration : 2000
} ) ;
}
}
} )
} ,
getDataStandard ( ) {
var _this = this ;
console . info ( _this . isEnd ) ;
if ( _this . isEnd ) {
return
}
uni . showLoading ( {
title : '加载中'
} )
console . log ( this . DEPT )
uni . request ( {
url : basePath + '/app/hiddenDangerCheckStandardCustom/checkList' , // /app/listmanager/checkList
method : 'POST' ,
dataType : 'json' ,
header : {
'Content-type' : 'application/x-www-form-urlencoded'
} ,
data : {
USER _NAME : loginUser . NAME ,
CHECK _DEPARTMENT _ID : loginUser . DEPARTMENT _ID ,
SUB _DEPARTMENT _IDS : this . DEPT , //选择的部门
IS _MAIN : loginUser . ISMAIN ,
CORPINFO _ID : loginUser . CORPINFO _ID ,
USER _ID : loginUser . USER _ID ,
ISSUPERVISE : loginUser . ISSUPERVISE ,
} ,
success : ( res ) => {
if ( "success" == res . data . result ) {
var content = res . data . varList ;
for ( var i = 0 ; i < content .length ; i + + ) {
if ( content [ i ] . checkCount == 0 ) {
this . list1 . push ( content [ i ] ) ;
this . totalList1 . push ( content [ i ] ) ;
}
/ * e l s e {
this . list1 . push ( content [ i ] ) ;
this . totalList1 . push ( content [ i ] ) ;
} * /
}
uni . hideLoading ( ) ;
this . getDept ( )
} else {
uni . showToast ( {
icon : 'none' ,
title : '系统异常' ,
duration : 2000
} ) ;
}
}
} )
} ,
openAuth ( permissionID ) {
this . permissionID = permissionID ;
setTimeout ( ( ) => {
this . $refs [ 'authpup' ] . open ( ) ;
} , 200 )
} ,
scan ( ) {
let _this = this ;
uni . scanCode ( {
success : function ( res ) {
let flag = false ;
let listId = res . result ;
for ( var i = 0 ; i < _this .totalList.length ; i + + ) {
if ( _this . totalList [ i ] . LISTMANAGER _ID == listId ) {
flag = true ;
_this . goToList ( { listId : _this . totalList [ i ] . LISTMANAGER _ID , listName : _this . totalList [ i ] . NAME , userid : _this . totalList [ i ] . USER _ID , BAO _BAO _TYPE : _this . totalList [ i ] . BAO _BAO _TYPE , HIDDEN _RISKSTANDARD : '1' } ) ;
break ;
}
}
for ( var i = 0 ; i < _this .totalList1.length ; i + + ) {
if ( _this . totalList1 [ i ] . CUSTOM _ID == listId ) {
flag = true ;
_this . goToList ( { listId : _this . totalList1 [ i ] . CUSTOM _ID , listName : _this . totalList1 [ i ] . NAME , userid : _this . totalList1 [ i ] . USER _ID , BAO _BAO _TYPE : _this . totalList1 [ i ] . BAO _BAO _TYPE , HIDDEN _RISKSTANDARD : '2' } ) ;
break ;
}
}
if ( ! flag ) {
uni . showToast ( {
title : "无法检查该清单" ,
duration : 2000
} ) ;
}
}
} ) ;
} ,
getDept ( ) {
var _this = this ;
uni . request ( {
url : basePath + '/app/sys/listTree' , //部门下拉接口
method : 'POST' ,
dataType : 'json' ,
header : {
'Content-type' : 'application/x-www-form-urlencoded'
} ,
data : {
DEPARTMENT _ID : loginUser . DEPARTMENT _ID ,
CORPINFO _ID : loginUser . CORPINFO _ID ,
USER _ID : loginUser . USER _ID ,
} ,
success : ( res ) => {
if ( "success" == res . data . result ) {
_this . treeNode = eval ( res . data . zTreeNodes ) ;
} else {
uni . showToast ( {
title : res . data . message ,
duration : 2000
} ) ;
}
}
} ) ;
} ,
// 确定回调事件
depttreeConfirm ( e ) {
this . DEPT = e [ 0 ] . id ;
this . DEPTNAME = e [ 0 ] . name ;
this . uindex = - 1 ;
this . treeShow = false
this . $forceUpdate ( ) ; //强制刷新
this . list = [ ] ;
this . list1 = [ ] ;
this . getData ( ) ;
} ,
showDeptTree ( ) {
this . treeShow = true
this . $refs . tkiTree . _show ( ) ;
} ,
// 取消回调事件
depttreeCancel ( e ) {
this . treeShow = false
} ,
// 滑动到底方法
scrolltolower ( ) {
var _this = this ;
_this . getData ( ) ;
} ,
getFunc ( ) {
return new Promise ( ( resolve , reject ) => {
var _this = this ;
uni . showLoading ( {
title : '加载中'
} )
uni . request ( {
url : basePath + '/app/corpfunc/findByKey' ,
method : 'POST' ,
dataType : 'json' ,
header : {
'Content-type' : 'application/x-www-form-urlencoded'
} ,
data : {
FKEY : _this . FKEY ,
CORPINFO _ID : loginUser . CORPINFO _ID ,
USER _ID : loginUser . USER _ID ,
} ,
success : ( res ) => {
if ( "success" == res . data . result ) {
uni . hideLoading ( ) ;
if ( res . data . pd != null && res . data . pd . CORPFUNC _ID ) {
_this . noExamine = true ;
}
resolve ( )
} else {
uni . showToast ( {
icon : 'none' ,
title : '系统异常' ,
duration : 2000
} ) ;
reject ( )
}
}
} )
} )
} ,
//跳转事件
goToList ( e ) {
var _this = this ;
console . info ( _this . noExamine ) ;
console . info ( e . userid != _this . loginUserId ) ;
if ( _this . noExamine && e . userid != _this . loginUserId ) {
uni . showToast ( {
icon : 'none' ,
title : '仅允许检查本人清单' ,
duration : 2000
} ) ;
} else {
if ( e . HIDDEN _RISKSTANDARD === '1' ) {
uni . navigateTo ( {
url : '/pages/application/hidden-trouble-investigation/hidden-trouble-app/hidden-trouble-spot?listId=' + e . listId + '&listName=' + e . listName + '&baoBaoType=' + e . BAO _BAO _TYPE
} ) ;
} else if ( e . HIDDEN _RISKSTANDARD === '2' ) {
uni . navigateTo ( {
url : '/pages/application/hidden-danger-check-standard/custom/list-item?listId=' + e . listId + '&listName=' + e . listName + '&baoBaoType=' + e . BAO _BAO _TYPE
} ) ;
}
}
}
}
}
< / script >
< style >
. dy - list {
background : # fff ;
margin - top : 2 upx ;
}
. dy - card {
background - color : # fff ;
border - radius : 10 upx ;
margin : 30 upx
}
. dy - stitle {
margin : 16 upx 0 ;
}
. dy - sub - stitle {
margin : 16 upx 0 ;
display : flex ;
justify - content : space - between ;
}
. dy - card - title {
display : flex ;
justify - content : space - between ;
border - bottom : 1 px solid # eee ;
min - height : 80 upx ;
line - height : 80 upx ;
padding : 0 30 upx ;
}
. dy - card - content {
padding : 0 upx 30 upx 30 upx ;
}
< / style >