@ -0,0 +1,776 @@
< template >
< view class = "todo-page" >
< view class = "background" > < / view >
< view class = "allview" >
< view class = "card" v-if ="stepsPageList === 0" >
< u - -form labelWidth = "auto" :model ="model" ref = "wForm" class = "demo-ruleForm" >
< view style = "position: relative;" >
< view style = "position: absolute;left: -10px;color: #3d4b70;top: -3px;" > * < / view >
< / view >
< view style = "font-size: 15px; font-weight: bold;color: #3d4b70;margin-bottom: 10px;" > 基本信息填写 < / view >
< u -form -item required label = "发起人:" prop = "Nav_User.NAME" @click ="handleChangeMonitor('Nav_ApplyUser')" borderBottom >
< u - -input disabledColor = "#fff" v -model = " ( model.Nav_ApplyUser | | {} ) .NAME " disabled placeholder = "请选择发起人" suffixIcon = "arrow-down" suffixIconStyle = "font-size:12px" fontSize = "14px"
customStyle = "margin:0px;display:flex;padding:3px 0px" border = "none" inputAlign = "right" >
< / u - - i n p u t >
< / u - f o r m - i t e m >
< u -form -item required label = "发起部门:" prop = "Nav_User.NAME" @click ="handleChangeMonitor('Nav_ApplyDepartment')" borderBottom >
< u - -input disabledColor = "#fff" v -model = " ( model.Nav_ApplyDepartment | | {} ) .NAME " disabled placeholder = "请选择发起部门" suffixIcon = "arrow-down" suffixIconStyle = "font-size:12px" fontSize = "14px"
customStyle = "margin:0px;display:flex;padding:3px 0px" border = "none" inputAlign = "right" >
< / u - - i n p u t >
< / u - f o r m - i t e m >
< u -form -item label = "生产单元:" prop = "Product_Unit" @click ="handleChangeMonitor('Nav_ProductionUnit')" borderBottom >
< u - -input v-model ="(model.Nav_ProductionUnit||{}).NAME" placeholder="请选择生产单元" disabled disabledColor="#ffffff" border="none" inputAlign="right" fontSize="14px" >
< / u - - i n p u t >
< u -icon style = "margin-left: 4px;" slot = "right" name = "arrow-down" size = "12" >
< / u - i c o n >
< / u - f o r m - i t e m >
< u -form -item label = "值班开始时间" prop = "CHECKDATETIME" borderBottom @click ="showCheckDate(1)" >
< u - -input disabled disabledColor = "#fff" v-model ="model.JOB_START_DATE" placeholder="请选择值班开始时间" border="none" inputAlign="right" fontSize="14px" > < / u - -input >
< u -icon style = "margin-left: 4px;" name = "arrow-down" size = "12" > < / u - i c o n >
< / u - f o r m - i t e m >
< u -form -item label = "值班结束时间" prop = "ENDTIME" borderBottom @click ="showCheckDate(2)" >
< u - -input disabled disabledColor = "#fff" v-model ="model.JOB_END_DATE" placeholder="请选择值班结束时间" border="none" inputAlign="right" fontSize="14px" > < / u - -input >
< u -icon style = "margin-left: 4px;" name = "arrow-down" size = "12" > < / u - i c o n >
< / u - f o r m - i t e m >
< u -form -item required label = "班次:" prop = "Nav_Class.NAME" @click ="handleChangeMonitor('Nav_Class')" borderBottom >
< u - -input disabledColor = "#fff" v -model = " ( model.Nav_Class | | {} ) .NAME " disabled placeholder = "请选择班次" suffixIcon = "arrow-down" suffixIconStyle = "font-size:12px" fontSize = "14px"
customStyle = "margin:0px;display:flex;padding:3px 0px" border = "none" inputAlign = "right" >
< / u - - i n p u t >
< / u - f o r m - i t e m >
< u -form -item required label = "值班领导" @ click = "handleShowSheet({title: '值班领导', name: 'Nav_Users'})" >
< u -icon name = "man-add" size = "24" color = "#3d9cff" slot = "right" > < / u - i c o n >
< / u - f o r m - i t e m >
< view class = "tag-view" v-if ="model.Nav_Users" >
< uni -tag class = "tag" v -for = " ( i , k ) in model.Nav_Users.filter ( i = > ! i . IS _DELETED ) " :key=" k " :inverted=" true " :text=" i . Nav _User . NAME " type=" primary " / >
< / view >
< view class = "upload-title" > 附件 : < / view >
< full -upload v-model ="model.Nav_Files" > < / full -upload >
< u -form -item label = "交接班地点" prop = "LOCATION" borderBottom >
< u - -input disabledColor = "#ffffff" v-model ="model.PLACE" border="none" inputAlign="right" fontSize="14px" placeholder="请输入地点" > < / u - -input >
< / u - f o r m - i t e m >
< u -form -item required label = "接班人" @ click = "handleShowSheet({title: '接班人', name: 'Nav_AfterUsers'})" >
< u -icon name = "man-add" size = "24" color = "#3d9cff" slot = "right" > < / u - i c o n >
< / u - f o r m - i t e m >
< view class = "tag-view" v-if ="model.Nav_AfterUsers" >
< uni -tag class = "tag" v -for = " ( i , k ) in model.Nav_AfterUsers.filter ( i = > ! i . IS _DELETED ) " :key=" k " :inverted=" true " :text=" i . Nav _AfterUser . NAME " type=" primary " / >
< / view >
< / u - - f o r m >
< / view >
< view style = "padding: 10px 16px;" v-if ="stepsPageList === 0" class="bottom-button" >
< u -button type = "primary" @click ="stepAdd" color = "#3d4b70" :loading ="stepLoad" > 下一步 < / u - b u t t o n >
< / view >
< view class = "card" v-if ="stepsPageList === 1" >
< u - -form labelWidth = "auto" :model ="model" ref = "wForm" class = "sub-form" >
< view style = "position: relative;" >
< view style = "position: absolute;left: -10px;color: #3d4b70;top: -3px;" > * < / view >
< / view >
< view style = "font-size: 15px; font-weight: bold;color: #3d4b70;margin-bottom: 10px;margin-top: 20px;" > 检查内容 < / view >
< uni -collapse :border ="false" accordion >
< view v-for ="(item, index) in model.Nav_Details.filter(i => !i.IS_DELETED)" :key ="index" >
< uni -collapse -item title -border = " none " :border ="false" >
< template v -slot : title >
< view class = "uni-collapse-item__title-box" >
< view class = "uni-collapse-item__title-text" >
{ { index + 1 + '.' } }
< / view >
< view @ click.stop >
< u -icon @click ="handleDelRowBefore(item)" name = "trash" color = "#ff4d4f" size = "21" style = "margin-right: 10px;" > < / u - i c o n >
< / view >
< / view >
< / template >
< view class = "content" style = "padding: 0px 0px 0px 10px;" >
< u -form -item label = "开始时间" prop = "CHECKDATETIME" borderBottom @click ="showCheckDate(3,item)" >
< u - -input disabled disabledColor = "#fff" v-model ="item.START_DATE" placeholder="请选择开始时间" border="none" inputAlign="right" fontSize="14px" > < / u - -input >
< u -icon style = "margin-left: 4px;" name = "arrow-down" size = "12" > < / u - i c o n >
< / u - f o r m - i t e m >
< u -form -item label = "结束时间" prop = "ENDTIME" borderBottom @click ="showCheckDate(4,item)" >
< u - -input disabled disabledColor = "#fff" v-model ="item.END_DATE" placeholder="请选择结束时间" border="none" inputAlign="right" fontSize="14px" > < / u - -input >
< u -icon style = "margin-left: 4px;" name = "arrow-down" size = "12" > < / u - i c o n >
< / u - f o r m - i t e m >
< u -form -item required label = "巡视区域" @ click = "handleShowSheet({title: '巡视区域', name: 'Nav_DetailAreas',itemData:item})" >
< u -icon name = "man-add" size = "24" color = "#3d9cff" slot = "right" > < / u - i c o n >
< / u - f o r m - i t e m >
< view class = "tag-view" v-if ="item.Nav_DetailAreas" >
< uni -tag class = "tag" v -for = " ( i , k ) in item.Nav_DetailAreas.filter ( i = > ! i . IS _DELETED ) " :key=" k " :inverted=" true " :text=" i . Nav _Area . NAME " type=" primary " / >
< / view >
< u -form -item label = "现场情况描述:" >
< / u - f o r m - i t e m >
< u - -textarea autoHeight v-model ="item.DESCRIPTION" placeholder="请输入现场情况描述" border="surround" > < / u - -textarea >
< u -form -item label = "发现问题:" >
< / u - f o r m - i t e m >
< u - -textarea autoHeight v-model ="item.QUESTION" placeholder="请输入发现问题" border="surround" > < / u - -textarea >
< u -form -item label = "处置措施:" >
< / u - f o r m - i t e m >
< u - -textarea autoHeight v-model ="item.MEASURE" placeholder="请输入处置措施" border="surround" > < / u - -textarea >
< u -form -item required label = "现场责任人:" prop = "Nav_User.NAME" @ click = "handleShowSheet({title: '现场责任人', name: 'Nav_User',itemData:item})" borderBottom >
< u - -input disabledColor = "#fff" v -model = " item.Nav_User.NAME " disabled placeholder = "请选择现场责任人" suffixIcon = "arrow-down" suffixIconStyle = "font-size:12px" fontSize = "14px"
customStyle = "margin:0px;display:flex;padding:3px 0px" border = "none" inputAlign = "right" >
< / u - - i n p u t >
< / u - f o r m - i t e m >
< u -form -item label = "交接事项:" >
< / u - f o r m - i t e m >
< u - -textarea autoHeight v-model ="item.ITEM" placeholder="请输入交接事项" border="surround" > < / u - -textarea >
< u -form -item label = "附件" prop = "CHECKSTANDARD" >
< / u - f o r m - i t e m >
< full -upload v -model = " item.Nav_DetailFiles " : isShowBtn = 'true' : listProp = 'listPropUpload' : listPropVal = 'listPropValUpload' > < / f u l l - u p l o a d >
< / view >
< / u n i - c o l l a p s e - i t e m >
< / view >
< / u n i - c o l l a p s e >
< view style = "padding: 10px 16px;display: flex;flex-direction: row;" >
< u -button type = "primary" @click ="handleNewCheckArea" color = "#3d4b70" > 新增 < / u - b u t t o n >
<!-- < u -button type = "primary" @click ="handleNewCheckList" color = "#3d4b70" style = "margin-left: 5px;" > 检查清单 < / u - b u t t o n > - - >
< / view >
< / u - - f o r m >
< / view >
< view style = "padding: 10px 16px;display: flex;flex-direction: row;" v-if ="stepsPageList === 1" class="bottom-button" >
< u -button type = "primary" @click ="stepReduce" color = "#3d4b70" :plain ="true" style = "margin-right: 5px;" > 上一步 < / u - b u t t o n >
< u -button type = "primary" @click ="submit" color = "#3d4b70" style = "margin-left: 5px;" > 提交 < / u - b u t t o n >
< / view >
< query -selector :multiple ="selectorInfo.isMultiple" :show ="selectorInfo.showPopup" :title ="selectorInfo.title" :lists ="selectorInfo.dataLists" :defaultChecked ="selectorInfo.defaultChecked"
@ search = "handleSearch" @ select = "handleSelected" @ close = "selectorInfo.showPopup=false" : total = "selectorInfo.totalCount" / >
< u -picker :show ="comPickerInfo.showSheet" :columns ="comPickerInfo.columns" @confirm ="onConfirmPicker" @close ="comPickerInfo.showSheet=false" @cancel ="comPickerInfo.showSheet=false" keyName = "NAME" > < / u - p i c k e r >
< u -modal : show = "showDelModalIndex >= 0" @confirm ="confirmDel" @cancel ="cacelDel" :showCancelButton ="true" title = "确认删除?" > < / u - m o d a l >
< people -selector :defaultChecked ="peopleSelectOption.defaultChecked" :show ="peopleSelectOption.showSelector" @select ="handleSelectorPeople" @ close = "peopleSelectOption.showSelector = false" >
< / p e o p l e - s e l e c t o r >
< u -datetime -picker :show ="dateTimePickerInfo.showCheckDate" v -model = ' dateTimePickerInfo.defaultDateTime ' @confirm ="handleCheckDate" @ close = "dateTimePickerInfo.showCheckDate = false"
@ cancel = "dateTimePickerInfo.showCheckDate = false" : mode = "dateTimePickerInfo.mode" > < / u - d a t e t i m e - p i c k e r >
< query -selector :show ="showPopupMonitor" :total ="curTotalMonitor" :lists ="monitorLists" :defaultValue ="currentOperateMonitor.NAME" @close ="handleClosePopupMonitor" @search ="handleSearchMonitor"
@ select = "handleSelectedMonitor" / >
< / view >
< / view >
< / template >
< script >
import {
extendFilterGroup ,
extendGroupRule ,
extendInclude ,
extendOrder ,
extendRule ,
extendIgnoreDataRule ,
guid ,
initFilter ,
initFilterGroup
} from '../../../../utils/common'
import {
FMProductionUnit ,
CheckPeriods ,
CheckLevels ,
MineTypeIndex ,
MineTypeName
} from '../../../../utils/enums.js'
import {
getUserLists ,
getDepartmentLists ,
getProductionUnitLists ,
getClassLists ,
} from '../../../../services/safe' ;
import {
getUser ,
getLeaderWellRecord ,
fullFOLeaderWellRecord ,
getRiskArea
} from '../../../../services/apply/FOServices/FOServices.js'
import stepTitle from '@/components/custom/step-title.vue'
import swipeActionItem from '../../../../uni_modules/uview-ui/libs/config/props/swipeActionItem' ;
import {
getEnum
} from '../../../../services/common' ;
export default {
components : {
stepTitle ,
} ,
data ( ) {
return {
showDelModalIndex : undefined ,
showDelModalIndex1 : undefined ,
subsectionList : [ '无隐患' , '有隐患' , '不涉及' ] ,
isMultiple : false ,
defaultChecked : [ ] ,
RiskLevel : [ '一般' , '重大' ] ,
showPopupUnit : false ,
UnitDefaultIndex : [ 0 ] ,
RiskLevelDefaultIndex : [ 0 ] ,
UnitLists : [ ] ,
showPopupRiskLevel : false ,
TypeLists : [ ] ,
showPopupType : false ,
TypeDefaultIndex : [ 0 ] ,
PeriodLists : [ ] ,
showPopupPeriod : false ,
PeriodDefaultIndex : [ 0 ] ,
LevelLists : [ ] ,
showPopupStep : false ,
showPopupLevel : false ,
curTotalStep : 0 ,
stepLists : [ ] ,
LevelDefaultIndex : [ 0 ] ,
showPopupDate : false ,
listPropUpload : [ 'NOTIFY_ID' ] ,
listPropValUpload : [ ] ,
ORG _ID : uni . getStorageSync ( 'orgId' ) ,
checkListData : { } ,
monitorLists : [ ] ,
currentOperateMonitor : { } ,
showPopupMonitor : false ,
curTotalMonitor : 0 ,
model : {
Nav _ApplyUser : {
NAME : ''
} ,
Nav _ApplyDepartment : {
NAME : ''
} ,
Nav _ProductionUnit : {
NAME : ''
} ,
Nav _Class : {
NAME : ''
} ,
Nav _Details : [ ] ,
} ,
peopleSelectOption : {
showSelector : false ,
value : null ,
index : 0 ,
defaultChecked : [ ]
} ,
dateTimePickerInfo : {
showCheckDate : false ,
dataIndex : undefined ,
defaultDateTime : uni . $u . timeFormat ( new Date ( ) , 'yyyy-mm-dd hh:MM:ss' ) ,
value : '' ,
name : '' ,
mode : ''
} ,
selectorInfo : {
name : 'user' ,
isMultiple : false ,
showPopup : false ,
totalCount : 0 ,
title : '考核结果选择' ,
itemData : { } ,
dataItem : { } ,
index : 0 ,
columns : [ ] ,
dataLists : [ ] ,
defaultText : '' ,
defaultChecked : [ ]
} ,
comPickerInfo : {
showSheet : false ,
dataItem : { } ,
columns : [ ] ,
title : '' ,
dataIndex : undefined ,
formIndex : undefined ,
name : ''
} ,
dateTime : uni . $u . timeFormat ( new Date ( ) , 'yyyy-mm-dd hh:MM' ) ,
stepsText : [ '发起' , '归档' ] ,
stepsPage : 0 ,
stepsPageList : 0 ,
Pu : '' ,
Check _Type _ID : '' ,
TypeListres : { } ,
TaskID : '' ,
poparr : '' ,
currentOperateStep : { } ,
chooseCheckContent : '' ,
chooseCheckArea : '' ,
currentOperateArea : { } ,
areaLists : [ ] ,
curTotalArea : 0 ,
showPopupArea : false ,
nowIndex : { } ,
nowName : '' ,
newCheckList : false ,
stepLoad : true ,
enumsData : { } , / / 存 储 所 有 枚 举 数 据 ( 键 : 枚 举 名 称 , 值 : 处 理 后 的 枚 举 列 表 )
enumsText : { } / / 存 储 枚 举 文 本 列 表 ( 用 于 下 拉 选 择 等 场 景 )
}
} ,
onLoad ( option ) {
this . TaskID = option . taskID ? option . taskID : '' ;
this . model . ID = option . ID ? option . ID : '' ;
this . ID = option . ID ? option . ID : '' ;
this . loadData ( ) ;
} ,
methods : {
loadData ( ) {
if ( this . ID == undefined || this . ID == '' ) {
this . stepLoad = false
this . model . Nav _Details = [ ]
if ( this . ID == undefined || this . ID == '' )
this . ID = guid ( )
this . model . ID = this . ID
const orgId = uni . getStorageSync ( 'orgId' )
const json = initFilter ( orgId , "" , "" )
let userid = uni . getStorageSync ( 'appInfo' ) . User . ID
extendRule ( json , 'ID' , 1 , userid ) ;
extendInclude ( json , 'Nav_Department.Nav_Unit' ) ;
extendIgnoreDataRule ( json )
/ / e x t e n d I n c l u d e ( j s o n , ' N a v _ D e t a i l s . N a v _ D e t a i l C o n t e n t s . N a v _ Q u e s t i o n ' ) ;
getUser ( json ) . then ( res => {
this . stepLoad = false
this . model . Nav _ApplyUser . NAME = res . NAME
this . model . APPLY _USER _ID = res . ID
this . model . Nav _ApplyDepartment . NAME = res . Nav _Department . NAME
this . model . APPLY _DEPARTMENT _ID = res . DEPARTMENT _ID
this . model . Nav _ProductionUnit . NAME = res . Nav _Department . Nav _Unit . NAME
this . model . PRODUCTION _UNIT _ID = res . Nav _Department . PRODUCTION _UNIT _ID
} )
} else {
const orgId = uni . getStorageSync ( 'orgId' )
const json = initFilter ( orgId , "" , "" )
extendRule ( json , 'ID' , 1 , this . ID ) ;
extendInclude ( json , 'Nav_CheckType' ) ;
extendInclude ( json , 'Nav_Type' ) ;
extendInclude ( json , 'Nav_CheckRecordFiles.Nav_ImgFile' ) ;
extendInclude ( json , 'Nav_Details' ) ;
extendInclude ( json , 'Nav_Details.Nav_RiskArea' ) ;
extendInclude ( json , 'Nav_Details.Nav_CheckRecordDetailBasics.Nav_Law' ) ;
extendInclude ( json , 'Nav_Details.Nav_Contents' ) ;
extendInclude ( json , 'Nav_Details.Nav_Question' ) ;
extendInclude ( json , 'Nav_Details.Nav_CheckRecordDetailFiles.Nav_ImgFile' ) ;
extendInclude ( json , 'Nav_Details.Nav_CheckRecordDetailUsers.Nav_User' ) ;
extendIgnoreDataRule ( json )
/ / e x t e n d I n c l u d e ( j s o n , ' N a v _ D e t a i l s . N a v _ D e t a i l C o n t e n t s . N a v _ Q u e s t i o n ' ) ;
getLeaderWellRecord ( json ) . then ( res => {
this . stepLoad = false
this . model = res ;
this . model . ID = this . ID
} )
}
} ,
stepAdd ( ) {
this . stepsPageList = this . stepsPageList + 1
} ,
stepReduce ( ) {
this . stepsPageList = this . stepsPageList - 1
} ,
handleClosePopupMonitor ( ) {
this . showPopupMonitor = false
} ,
handleChangeMonitor ( name ) {
this . currentOperateMonitor = name
this . showPopupMonitor = true
this . handleSearchMonitor ( 'init' )
} ,
handleSearchMonitor ( val , pageIndex ) {
const orgId = uni . getStorageSync ( 'orgId' )
const json = initFilter ( orgId , "" , "NAME" , '' , pageIndex )
if ( val !== 'init' ) {
const tempGroup = initFilterGroup ( false ) ;
extendGroupRule ( tempGroup , 'NAME' , 9 , val )
extendFilterGroup ( json , tempGroup ) ;
}
json . Limit = 20
if ( pageIndex ) {
json . Start = ( pageIndex - 1 ) * 20 ;
}
if ( this . currentOperateMonitor == 'Nav_ApplyUser' ) {
extendRule ( json , 'ENABLE_STATUS' , 1 , '0' )
getUserLists ( json ) . then ( res => {
if ( res . IsSuccessful ) {
this . monitorLists = res . Data . map ( i => {
return {
... i ,
name : i . NAME ,
code : i . CODE
}
} )
this . curTotalMonitor = res . TotalCount
}
} )
} else if ( this . currentOperateMonitor == 'Nav_ApplyDepartment' ) {
extendRule ( json , 'ENABLE_STATUS' , 1 , '0' )
getDepartmentLists ( json ) . then ( res => {
if ( res . IsSuccessful ) {
this . monitorLists = res . Data . map ( i => {
return {
... i ,
name : i . NAME ,
code : i . CODE
}
} )
this . curTotalMonitor = res . TotalCount
}
} )
} else if ( this . currentOperateMonitor == 'Nav_Class' ) {
extendInclude ( json , 'Nav_ClassDetail' ) ;
getClassLists ( json ) . then ( res => {
if ( res . IsSuccessful ) {
this . monitorLists = res . Data . map ( i => {
return {
... i ,
name : i . NAME ,
code : i . CODE
}
} )
this . curTotalMonitor = res . TotalCount
}
} )
} else if ( this . currentOperateMonitor == 'Nav_ProductionUnit' ) {
getProductionUnitLists ( json ) . then ( res => {
if ( res . IsSuccessful ) {
this . monitorLists = res . Data . map ( i => {
return {
... i ,
name : i . NAME ,
code : i . CODE
}
} )
this . curTotalMonitor = res . TotalCount
}
} )
}
} ,
handleSelectedMonitor ( val ) {
this . showPopupMonitor = false
if ( this . currentOperateMonitor == 'Nav_ApplyUser' ) {
this . model . Nav _ApplyUser = val
this . model . APPLY _USER _ID = val . ID
} else if ( this . currentOperateMonitor == 'Nav_ApplyDepartment' ) {
this . model . Nav _ApplyDepartment = val
this . model . APPLY _DEPARTMENT _ID = val . ID
} else if ( this . currentOperateMonitor == 'Nav_Class' ) {
this . model . Nav _Class = val
this . model . CLASS _ID = val . ID
} else if ( this . currentOperateMonitor == 'Nav_ProductionUnit' ) {
this . model . Nav _ProductionUnit = val
this . model . PRODUCTION _UNIT _ID = val . ID
}
this . currentOperateMonitor = val
} ,
handleNewCheckArea ( ) {
this . model . Nav _Details . push ( {
ID : guid ( ) ,
LEADER _WELL _RECORD _ID : this . model . ID ,
ORG _ID : uni . getStorageSync ( 'orgId' ) ,
START _DATE : '' ,
END _DATE : '' ,
Nav _DetailAreas : [ ] ,
DESCRIPTION : '' ,
QUESTION : '' ,
MEASURE : '' ,
Nav _User : {
NAME : ''
} ,
ITEM : '' ,
Nav _DetailFiles : [ ]
} )
} ,
handleDelRowBefore ( item ) {
this . nowIndex = item
this . showDelModalIndex = 1
} ,
confirmDel ( ) {
this . nowIndex . IS _DELETED = true
this . showDelModalIndex = undefined
} ,
cacelDel ( ) {
this . showDelModalIndex = undefined
} ,
async handleShowSheet ( p ) {
const orgId = uni . getStorageSync ( 'orgId' )
const json = initFilter ( orgId , "" , "" , 0 , p . pageIndex ? ? 1 )
/ / c o n s t j s o n = i n i t F i l t e r ( t h i s . O R G _ I D , " " , " " , 0 , p . p a g e I n d e x ? ? 1 )
let dataSelect = [ ]
var defaultChecked = [ ]
this . selectorInfo . isMultiple = false
if ( p . val ) {
extendRule ( json , 'NAME' , 9 , p . val ) ;
}
json . Limit = 20
if ( p . pageIndex ) {
json . Start = ( p . pageIndex - 1 ) * json . Limit ;
}
json . Sort = 'NAME'
/ / j s o n . S e l e c t F i e l d = [ " I D " , " N A M E " , " N A M E " , " C O D E " ]
/ / j s o n . S o r t = " N A M E "
/ / j s o n . O r d e r = 1
if ( p . name == 'Nav_Users' ) {
this . selectorInfo . isMultiple = true
/ / e x t e n d R u l e ( j s o n , ' D E V I C E _ S T A T U S ' , 1 , ' 1 ' ) ;
dataSelect = await getUserLists ( json ) . then ( res => {
this . selectorInfo . totalCount = res . TotalCount
if ( res != undefined && res . Data . length > 0 ) {
for ( let i = 0 ; i < res . Data . length ; i ++ ) {
res . Data [ i ] . name = res . Data [ i ] . NAME
}
}
return res . Data
} )
if ( this . model . Nav _Users && this . model . Nav _Users . length > 0 && this . model . Nav _Users [ 0 ]
. Nav _User != null ) {
/ / t h i s . s e l e c t o r I n f o . d e f a u l t C h e c k e d = [ ]
this . model . Nav _Users . forEach ( e => {
defaultChecked . push ( e . Nav _User )
} )
} else {
defaultChecked = null
}
} else if ( p . name == 'Nav_AfterUsers' ) {
this . selectorInfo . isMultiple = true
/ / e x t e n d R u l e ( j s o n , ' D E V I C E _ S T A T U S ' , 1 , ' 1 ' ) ;
dataSelect = await getUserLists ( json ) . then ( res => {
this . selectorInfo . totalCount = res . TotalCount
if ( res != undefined && res . Data . length > 0 ) {
for ( let i = 0 ; i < res . Data . length ; i ++ ) {
res . Data [ i ] . name = res . Data [ i ] . NAME
}
}
return res . Data
} )
if ( this . model . Nav _AfterUsers && this . model . Nav _AfterUsers . length > 0 && this . model . Nav _AfterUsers [ 0 ]
. Nav _AfterUser != null ) {
/ / t h i s . s e l e c t o r I n f o . d e f a u l t C h e c k e d = [ ]
this . model . Nav _AfterUsers . forEach ( e => {
defaultChecked . push ( e . Nav _AfterUser )
} )
} else {
defaultChecked = null
}
} else if ( p . name == 'Nav_DetailAreas' ) {
this . selectorInfo . isMultiple = true
json . Sort = 'NAME'
/ / e x t e n d R u l e ( j s o n , ' C H E C K O B J E C T ' , 1 , t h i s . m o d e l . C H E C K O B J E C T ) ;
dataSelect = await getRiskArea ( json ) . then ( res => {
this . selectorInfo . totalCount = res . TotalCount
if ( res != undefined && res . Data . length > 0 ) {
for ( let i = 0 ; i < res . Data . length ; i ++ ) {
res . Data [ i ] . name = res . Data [ i ] . NAME
/ / r e s [ i ] . c o d e = r e s [ i ] . C O D E
}
}
return res . Data
} )
/ / N a v _ L a w = > N a v _ S t a n d a r d
if ( p . itemData . Nav _DetailAreas && p . itemData . Nav _DetailAreas
. length > 0 && p . itemData . Nav _DetailAreas [ 0 ]
. Nav _Area != null ) {
p . itemData . Nav _DetailAreas . forEach ( e => {
if ( e . Nav _Area != null && e . Nav _Area . NAME != null && e . Nav _Area . NAME
. length > 0 )
defaultChecked . push ( e . Nav _Area )
} )
} else {
defaultChecked = null
}
} else if ( p . name == 'Nav_User' ) {
json . Sort = 'NAME'
extendRule ( json , 'ENABLE_STATUS' , 1 , '0' )
/ / e x t e n d R u l e ( j s o n , ' C H E C K O B J E C T ' , 1 , t h i s . m o d e l . C H E C K O B J E C T ) ;
dataSelect = await getUserLists ( json ) . then ( res => {
this . selectorInfo . totalCount = res . TotalCount
if ( res != undefined && res . Data . length > 0 ) {
for ( let i = 0 ; i < res . Data . length ; i ++ ) {
res . Data [ i ] . name = res . Data [ i ] . NAME
/ / r e s [ i ] . c o d e = r e s [ i ] . C O D E
}
}
return res . Data
} )
}
if ( defaultChecked == null )
defaultChecked = [ ]
if ( dataSelect . length ) {
this . selectorInfo = {
itemData : p . itemData != undefined ? p . itemData : this . selectorInfo
. itemData , / / i t e m D a t a : p . i t e m D a t a , 搜 索 的 时 候 p . i t e m D a t a 为 空 赋 值 修 改 为 她 自 己 本 身 t h i s . s e l e c t o r I n f o . i t e m D a t a
isMultiple : this . selectorInfo . isMultiple ,
totalCount : this . selectorInfo . totalCount ,
showPopup : true ,
title : p . title ,
name : p . name ,
dataLists : dataSelect ,
defaultChecked : defaultChecked ,
index : p . index
}
} else {
/ / 暂 无 数 据
}
} ,
/ / 数 据 加 载
handleSearch ( val , pageIndex ) {
var p = {
name : this . selectorInfo . name ,
title : this . selectorInfo . title ,
val : val ,
pageIndex : pageIndex ,
itemData : this . selectorInfo . itemData
}
this . handleShowSheet ( p )
} ,
handleSelected ( e ) {
this . selectorInfo . showPopup = false
const validDetails = this . model . Nav _Details . filter ( i => ! i . IS _DELETED ) ;
const index = this . selectorInfo . index ;
const realIndex = this . model . Nav _Details . findIndex ( item => item === validDetails [ index ] ) ;
if ( this . selectorInfo . name == 'Nav_Users' ) {
let listArea = [ ]
if ( e . length > 0 ) {
e . forEach ( ( item , i ) => {
if ( item . name != null || item . NAME != null ) {
listArea . push ( {
ID : guid ( ) ,
LEADER _WELL _RECORD _ID : this . model . ID ,
USER _ID : item . ID ,
ORG _ID : item . ORG _ID ,
Nav _User : item
} )
}
} )
}
this . model . Nav _Users = listArea
/ / t h i s . m o d e l . R i s k A r e a N A M E = a r e a S h o w
} else if ( this . selectorInfo . name == 'Nav_AfterUsers' ) {
let listArea = [ ]
if ( e . length > 0 ) {
e . forEach ( ( item , i ) => {
if ( item . name != null || item . NAME != null ) {
listArea . push ( {
ID : guid ( ) ,
LEADER _WELL _RECORD _ID : this . model . ID ,
AFTER _USER _ID : item . ID ,
ORG _ID : item . ORG _ID ,
Nav _AfterUser : item
} )
}
} )
}
this . model . Nav _AfterUsers = listArea
} else if ( this . selectorInfo . name == 'Nav_DetailAreas' ) {
let listCheckProofs = [ ]
if ( e . length > 0 ) {
e . forEach ( ( item , i ) => {
if ( item . name != null ) {
listCheckProofs . push ( {
ID : guid ( ) ,
LEADER _WELL _RECORD _DETAIL _ID : this . selectorInfo . itemData . ID ,
AREA _ID : item . ID , / / L A W _ I D
ORG _ID : item . ORG _ID ,
Nav _Area : item
} )
}
} )
}
this . selectorInfo . itemData . Nav _DetailAreas = listCheckProofs
} else if ( this . selectorInfo . name == 'Nav_User' ) {
this . selectorInfo . itemData . Nav _User = e
this . selectorInfo . itemData . USER _ID = e . ID
}
} ,
showCheckDate ( dataIndex , item ) {
this . dateTimePickerInfo = {
showCheckDate : true ,
defaultDateTime : dataIndex == 3 || dataIndex == 4 ? uni . $u . timeFormat ( new Date ( ) , 'hh:MM' ) : uni . $u . timeFormat ( new Date ( ) , 'yyyy-mm-dd hh:MM:ss' ) ,
dataIndex : dataIndex ,
item : item ,
mode : dataIndex == 3 || dataIndex == 4 ? 'time' : 'datetime'
}
} ,
/ / 隐 藏 控 件 显 示 时 间
handleCheckDate ( e ) {
if ( this . dateTimePickerInfo . dataIndex == 1 ) {
this . model . JOB _START _DATE = uni . $u . timeFormat ( e . value ,
'yyyy-mm-dd hh:MM:ss' )
} else if ( this . dateTimePickerInfo . dataIndex == 2 ) {
this . model . JOB _END _DATE = uni . $u . timeFormat ( e . value ,
'yyyy-mm-dd hh:MM:ss' )
} else if ( this . dateTimePickerInfo . dataIndex == 3 ) {
this . dateTimePickerInfo . item . START _DATE = e . value
} else if ( this . dateTimePickerInfo . dataIndex == 4 ) {
this . dateTimePickerInfo . item . END _DATE = e . value
}
this . dateTimePickerInfo . showCheckDate = false
} ,
submit ( ) {
this . modelEdit = JSON . parse ( JSON . stringify ( this . model ) )
delete this . modelEdit . Nav _ApplyDepartment
delete this . modelEdit . Nav _ApplyUser
delete this . modelEdit . Nav _Class
delete this . modelEdit . Nav _ProductionUnit
if ( this . modelEdit . Nav _Details && this . modelEdit . Nav _Details . length > 0 ) {
this . modelEdit . Nav _Details . map ( item => {
item . PUBLISH = 'SaveAndNotify'
delete item . Nav _User
if ( item . Nav _DetailAreas && item . Nav _DetailAreas . length > 0 ) {
item . Nav _DetailAreas . map ( item1 => {
delete item1 . Nav _Area
} )
}
} )
}
if ( this . TaskID == null || this . TaskID == '' ) {
this . modelEdit . TaskID = '00000000-0000-0000-0000-000000000000'
} else {
this . modelEdit . TaskID = this . TaskID
}
if ( this . modelEdit . ORG _ID == null || this . modelEdit . ORG _ID == '' )
this . modelEdit . ORG _ID = this . ORG _ID
this . modelEdit . PUBLISH = 'SaveAndNotify'
fullFOLeaderWellRecord ( this . modelEdit ) . then ( res => {
if ( res ) {
uni . $showMsgFunc ( '操作成功!' , ( ) => {
uni . navigateBack ( )
} , 'success' , 1000 )
}
} )
}
}
}
< / script >
< style scoped >
@ import url ( "../../../../style/css/newTemplate.css" ) ;
< / style >