@ -0,0 +1,361 @@
<!-- 检查内容设置 -- >
< template >
< view class = "page-wrap" >
< view class = "card" >
< uni -card margin = "0" :is-shadow ="true" >
< u - -form labelPosition = "left" labelWidth = "auto" labelAlign = "center" :model ="model" :rules ="rules"
ref = "wForm" errorType = "border-bottom" >
<!-- < u -form -item required label = "检查范围" prop = "CHECKOBJECT_DESCRIPTION" borderBottom
@ click = "handleShowSheet({title: '检查范围', name: 'CHECKOBJECT'})" >
< u - -input disabledColor = "#fff" v -model = " model.CHECKOBJECT_DESCRIPTION " border = "none"
inputAlign = "right" > < / u - - i n p u t >
< u -icon style = "margin-left: 4px;" slot = "right" name = "arrow-down" > < / u - i c o n >
< / u - f o r m - i t e m > - - >
< u -form -item required label = "检查内容" prop = "CHECKCONTENT" borderBottom >
< u - -textarea autoHeight v -model = " model.CHECKCONTENT " placeholder = "检查内容"
border = "surround" > < / u - - t e x t a r e a >
< / u - f o r m - i t e m >
< / u - - f o r m >
< / u n i - c a r d >
< / view >
< u -sticky offset -top = " 20 " >
< view class = "sub-form" >
< view class = "sub-form-wrap" >
< view class = "sub-form-btns" >
< view class = "sub-form-btn" @click ="handleAdd" >
< u -icon class = "icon" name = "plus-circle" color = "#3c9cff" size = "21" > < / u - i c o n >
< u - -text type = "primary" text = "新增" > < / u - - t e x t >
< / view >
< / view >
< u - -form labelPosition = "left" labelWidth = "auto" labelAlign = "center" errorType = "border-bottom"
ref = "sForm" >
< uni -collapse :border ="false" accordion >
< uni -card style = "margin-bottom: 16px;" margin = "0" spacing = "0" :is-shadow ="false"
v - for = "(item, index) in model.Nav_ListCheckQuestion" >
< uni -collapse -item : title = "item.NUM + '. ' + item.DESCREPTION" name = "1" >
< view slot = "value" class = "row-action" >
< text @click.stop ="DetailDel(item)" class = "enableTrue" >
< u - -text type = "primary" class = "btnCheck" text = "删除" > < / u - - t e x t >
< / text >
< / view >
< u -form -item class = "subRequired" required label = "检查问题描述" prop = "DESCREPTION"
borderBottom >
< u - -textarea autoHeight v -model = " item.DESCREPTION " placeholder = "检查问题描述"
border = "surround" > < / u - - t e x t a r e a >
< / u - f o r m - i t e m >
< u -form -item class = "subRequired" required label = "整改建议与措施" prop = "DEMAND"
borderBottom >
< u - -textarea autoHeight v -model = " item.DEMAND " placeholder = "整改建议与措施"
border = "surround" > < / u - - t e x t a r e a >
< / u - f o r m - i t e m >
< u -form -item class = "subRequired" required label = "问题等级" prop = "QUESTION_LEVEL_SHOW"
borderBottom
@ click = "handleShowSheet({title: '问题等级', name: 'QUESTION_LEVEL',itemData:item})" >
< u - -input disabledColor = "#ffffff" v -model = " item.QUESTION_LEVEL_SHOW "
border = "none" inputAlign = "right" > < / u - - i n p u t >
< u -icon style = "margin-left: 4px;" slot = "right" name = "arrow-down" > < / u - i c o n >
< / u - f o r m - i t e m >
< / u n i - c o l l a p s e - i t e m >
< / u n i - c a r d >
< / u n i - c o l l a p s e >
< / u - - f o r m >
< / view >
< / view >
< / u - s t i c k y >
< u -modal : show = "showDelModalIndex >= 0" @confirm ="confirmDel" title = "确认删除?" > < / u - m o d a l >
< query -selector :multiple ="selectorInfo.isMultiple" :show ="selectorInfo.showPopup"
: defaultChecked = "selectorInfo.defaultChecked" : title = "selectorInfo.title" : lists = "selectorInfo.dataLists"
@ search = "handleSearch" @ select = "handleSelected" @ close = "selectorInfo.showPopup=false" / >
< view class = "bottom-button" >
< button type = "primary" @click ="FullCheckUpdate" > 提交 < / button >
< / view >
< / view >
< / template >
< script >
import {
guid ,
initFilter
} from '../../../../utils/common'
import {
FullUpdateContents
} from '../../../../services/apply/subPages/BS/safeCheck'
import {
getEnum
} from '../../../../services/common'
import {
listBSQuestionLevelEnum ,
listBSQuestionLevelEnumVal
} from '../../../../utils/enums'
export default {
data ( ) {
return {
indexShow : 10 , / / 懒 加 载 信 息
total : 0 ,
tableKey : '0' ,
TaskID : '' ,
listPropUpload : [ 'SAFE_CHECK_ID' ] ,
listPropValUpload : [ ] ,
AUDIT _OPINION : '' ,
ORG _ID : '' ,
modelEdit : { } ,
model : {
ID : '' ,
ORG _ID : '' ,
CHECKOBJECT _DESCRIPTION : '' ,
CHECKOBJECT : '' ,
CHECKCONTENT : '' ,
/ / 操 作 需 要 同 时 操 作 N a v _ L i s t S a f e C h e c k D e t a i l S h o w
Nav _ListCheckQuestion : [ {
ORG _ID : '' ,
CHECK _CONTENTS _ID : '' ,
DESCREPTION : '' ,
DEMAND : '' ,
QUESTION _LEVEL : '' ,
QUESTION _LEVEL _SHOW : '' ,
NUM : '1' ,
} ] / / 子 表
} ,
isAudit : true ,
lists : [ ] ,
dateTimePickerInfo : {
showCheckDate : false ,
dataIndex : undefined ,
defaultDateTime : uni . $u . timeFormat ( new Date ( ) , 'yyyy-mm-dd hh:MM:ss' ) ,
value : ''
} ,
selectorInfo : {
isSubShow : false ,
isMultiple : false ,
showPopup : false ,
title : '检查人员' ,
itemData : { } ,
index : 0 ,
dataLists : [ ] ,
defaultText : '' ,
defaultValue : '' ,
name : '' ,
defaultChecked : [ ]
} ,
showDelModalIndex : undefined ,
rules : {
/ / ' C H E C K O B J E C T _ D E S C R I P T I O N ' : {
/ / t y p e : ' s t r i n g ' ,
/ / r e q u i r e d : t r u e ,
/ / t r i g g e r : [ ' b l u r ' , ' c h a n g e ' ]
/ / } ,
'CHECKCONTENT' : {
type : 'string' ,
required : true ,
trigger : [ 'blur' , 'change' ]
}
} ,
}
} ,
onLoad ( option ) {
this . model . ID = guid ( )
this . model . TaskID = option . taskID
this . TaskID = option . taskID
this . tableKey = option . tableKey
this . ORG _ID = uni . getStorageSync ( 'orgId' )
this . model . ORG _ID = uni . getStorageSync ( 'orgId' )
} ,
methods : {
handleAdd ( ) {
if ( this . model . Nav _ListCheckQuestion == null ) {
this . model . Nav _ListCheckQuestion = [ ]
}
var NUM = this . model . Nav _ListCheckQuestion . length
this . model . Nav _ListCheckQuestion . unshift ( {
ID : guid ( ) ,
ORG _ID : this . ORG _ID ,
NUM : NUM + 1 ,
CHECK _CONTENTS _ID : this . model . ID ,
DESCREPTION : '' ,
DEMAND : '' ,
QUESTION _LEVEL : '' ,
QUESTION _LEVEL _SHOW : '' ,
} )
} ,
/ / 手 动 删 除 信 息 编 号 修 改
DetailDel ( item ) {
/ / 不 要 直 接 删 除 比 如 已 经 保 存 过 , 直 接 删 除 提 交 的 时 候 不 操 作 数 据 库
item . IS _DELETED = true
let indexNotDel = 1
/ / t h i s . L i s t A p p l y D e t a i l = [ ]
this . model . Nav _ListCheckQuestion . forEach ( ( e , i ) => {
if ( ! e . IS _DELETED ) {
e . ROW _NO = indexNotDel
/ / t h i s . L i s t A p p l y D e t a i l . p u s h ( e )
indexNotDel ++
}
} )
} ,
confirmDel ( ) {
this . model . Nav _ListCheckQuestion . splice ( this . showDelModalIndex , 1 )
this . showDelModalIndex = undefined
} ,
handleTab ( t ) {
this . currentTab = t
} ,
FullCheckUpdate ( ) {
const ele = this . $refs
ele [ 'wForm' ] . validate ( ) . then ( res => {
if ( this . model . Nav _ListCheckQuestion == null || this . model . Nav _ListCheckQuestion . length < 1 ) {
uni . $showErrorInfo ( '检查问题不能为空' ) ;
} else {
let index = 0
var isOK = true
this . model . Nav _ListCheckQuestion . forEach ( item => {
if ( item . ORG _ID == null || item . ORG _ID == '' )
item . ORG _ID = this . ORG _ID
item . CHECK _CONTENTS _ID = this . model . ID
item . SERIOUS _RISK = ( item . QUESTION _LEVEL == 10 ? 1 : 0 )
index ++
if ( item . DESCREPTION == null || item . DESCREPTION == '' ) {
isOK = false
uni . $showErrorInfo ( '第【' + index + '】项检查问题描述不能为空' ) ;
}
if ( isOK && ( item . DEMAND == null || item . DEMAND == '' ) ) {
isOK = false
uni . $showErrorInfo ( '第【' + index + '】项整改建议与措施不能为空' ) ;
}
if ( isOK && ( item . QUESTION _LEVEL == null || item . QUESTION _LEVEL == '' ) ) {
isOK = false
uni . $showErrorInfo ( '请选择第【' + index + '】项的问题等级' ) ;
}
} )
if ( isOK ) {
FullUpdateContents ( this . model ) . then ( res => {
uni . $showMsgFunc ( '操作成功!' , ( ) => {
uni . navigateBack ( )
} , 'success' , 1000 )
} )
}
}
} ) . catch ( err => {
uni . $showErrorInfo ( '校验失败' ) ;
} )
} ,
/ / 下 拉 数 据 加 载
async handleShowSheet ( p ) {
const orgId = uni . getStorageSync ( 'orgId' )
const json = initFilter ( orgId , "" , "" , 0 )
let dataSelect = [ ]
var defaultChecked = [ ]
if ( p . name == 'CHECKOBJECT' ) {
this . selectorInfo . isMultiple = false
var dataParm = {
'name' : "BSMineTypeEnum"
}
dataSelect = await getEnum ( dataParm ) . then ( res => {
if ( res != undefined && res . length > 0 ) {
for ( let i = 0 ; i < res . length ; i ++ ) {
res [ i ] . name = res [ i ] . NAME
/ / r e s [ i ] . c o d e = r e s [ i ] . I D
}
}
return res
} )
} else if ( p . name == 'QUESTION_LEVEL' ) {
this . selectorInfo . isMultiple = false
dataSelect = [ ]
for ( let i = 0 ; i < listBSQuestionLevelEnum . length ; i ++ ) {
dataSelect . push ( {
name : listBSQuestionLevelEnum [ i ] ,
ID : listBSQuestionLevelEnumVal [ i ]
} )
}
}
if ( defaultChecked == null )
defaultChecked = [ ]
if ( dataSelect . length ) {
this . selectorInfo = {
itemData : p . itemData ,
isMultiple : this . selectorInfo . isMultiple ,
showPopup : true ,
title : p . title ,
name : p . name ,
dataLists : dataSelect ,
defaultChecked : defaultChecked
}
} else {
/ / 暂 无 数 据
}
} ,
handleSelected ( e ) {
this . selectorInfo . showPopup = false
if ( this . selectorInfo . name == "CHECKOBJECT" ) {
this . model . CHECKOBJECT _DESCRIPTION = e . NAME
this . model . CHECKOBJECT = e . ID
} else if ( this . selectorInfo . name == 'QUESTION_LEVEL' ) {
this . selectorInfo . itemData . QUESTION _LEVEL = e . ID
this . selectorInfo . itemData . QUESTION _LEVEL _SHOW = e . name
}
} ,
closePicker ( ) {
this . comPickerInfo = {
showSheet : false ,
columns : [ ] ,
title : '' ,
name : '' ,
formIndex : undefined
}
} ,
/ / 数 据 加 载
handleSearch ( val ) {
var p = {
name : this . selectorInfo . name ,
title : this . selectorInfo . title ,
val : val
}
this . handleShowSheet ( p )
} ,
} ,
computed : { } ,
onReachBottom ( ) {
if ( this . indexShow < this . total ) {
var end = this . indexShow + 10
if ( end >= this . total )
end = this . total
var tampAdd = this . model . Nav _ListCheckQuestion . slice ( this . indexShow , end )
this . Nav _ListSafeCheckDetailShow = this . Nav _ListSafeCheckDetailShow . concat ( tampAdd )
/ / t h i s . $ f o r c e U p d a t e ( )
this . indexShow = end
}
} ,
}
< / script >
< style scoped >
@ import url ( "../../../../style/css/editTemplate.css" ) ;
< / style >