@ -104,7 +104,7 @@
: labelCol = "labelCol"
: wrapperCol = "wrapperCol"
label = "缩写" >
< a -input placeholder = "请输入缩写" v -decorator = " [ ' departNameAbbr ' , validatorRules.departNameAbbr ] " / >
< a -input disabled placeholder = "请输入缩写" v -decorator = " [ ' departNameAbbr ' , validatorRules.departNameAbbr ] " / >
< / a - f o r m - i t e m >
@ -126,7 +126,7 @@
: wrapperCol = "wrapperCol"
label = "部门类型" >
< a -radio -group v-decorator ="['orgCategory',validatorRules.orgCategory]" placeholder="请选择部门类型" >
< a -radio -group disabled v-decorator ="['orgCategory',validatorRules.orgCategory]" placeholder="请选择部门类型" >
< a -radio value = "1" >
管理机构
< / a - r a d i o >
@ -277,6 +277,7 @@
departTree : [ ] ,
rightClickSelectedKey : '' ,
rightClickSelectedOrgCode : '' ,
rightClickSelectedorgCategory : '' ,
hiding : true ,
model : { } ,
dropTrigger : '' ,
@ -309,7 +310,8 @@
orgCode : { rules : [ { required : true , message : '请输入部门编码!' } ] } ,
orgCategory : { rules : [ { required : true , message : '请输入部门类型!' } ] } ,
mobile : { rules : [ { validator : this . validateMobile } ] } ,
departNameAbbr : { rules : [ { required : true , validator : this . validatedepartNameAbbr } ] }
departNameAbbr : { rules : [ { required : true , message : '请输入部门编码!' } ] } ,
/ / d e p a r t N a m e A b b r : { r u l e s : [ { r e q u i r e d : t r u e , v a l i d a t o r : t h i s . v a l i d a t e d e p a r t N a m e A b b r } ] }
} ,
url : {
delete : '/sys/sysDepart/delete' ,
@ -367,12 +369,13 @@
/ / 右 键 操 作 方 法
rightHandle ( node ) {
this . dropTrigger = 'contextmenu'
console . log ( node . node . eventKey )
/ / c o n s o l e . l o g ( n o d e . n o d e . e v e n t K e y )
this . rightClickSelectedKey = node . node . eventKey
this . rightClickSelectedOrgCode = node . node . dataRef . orgCode
this . rightClickSelectedorgCategory = node . node . dataRef . orgCategory
} ,
onExpand ( expandedKeys ) {
console . log ( 'onExpand' , expandedKeys )
/ / c o n s o l e . l o g ( ' o n E x p a n d ' , e x p a n d e d K e y s )
/ / i f n o t s e t a u t o E x p a n d P a r e n t t o f a l s e , i f c h i l d r e n e x p a n d e d , p a r e n t c a n n o t c o l l a p s e .
/ / o r , y o u c a n r e m o v e a l l e x p a n d e d c h i l d r e n k e y s .
this . iExpandedKeys = expandedKeys
@ -395,7 +398,7 @@
this . $refs . nodeModal . add ( this . currFlowId , '' )
} ,
batchDel : function ( ) {
console . log ( this . checkedKeys )
/ / c o n s o l e . l o g ( t h i s . c h e c k e d K e y s )
if ( this . checkedKeys . length <= 0 ) {
this . $message . warning ( '请选择一条记录!' )
} else {
@ -449,11 +452,11 @@
nodeModalClose ( ) {
} ,
hide ( ) {
console . log ( 111 )
/ / c o n s o l e . l o g ( 1 1 1 )
this . visible = false
} ,
onCheck ( checkedKeys , info ) {
console . log ( 'onCheck' , checkedKeys , info )
/ / c o n s o l e . l o g ( ' o n C h e c k ' , c h e c k e d K e y s , i n f o )
this . hiding = false
/ / t h i s . c h e c k e d K e y s = c h e c k e d K e y s . c h e c k e d
/ / < ! - - - - a u t h o r : o s _ c h e n g t g e n - - d a t e : 2 0 1 9 0 8 2 7 - - f o r : 切 换 父 子 勾 选 模 式 = = = = = = = - - - - - - >
@ -465,10 +468,10 @@
/ / < ! - - - - a u t h o r : o s _ c h e n g t g e n - - d a t e : 2 0 1 9 0 8 2 7 - - f o r : 切 换 父 子 勾 选 模 式 = = = = = = = - - - - - - >
} ,
onSelect ( selectedKeys , e ) {
console . log ( 'selected' , selectedKeys , e )
/ / c o n s o l e . l o g ( ' s e l e c t e d ' , s e l e c t e d K e y s , e )
this . hiding = false
let record = e . node . dataRef
console . log ( 'onSelect-record-3' , record )
/ / c o n s o l e . l o g ( ' o n S e l e c t - r e c o r d - 3 ' , r e c o r d )
this . currSelected = Object . assign ( { } , record )
this . model = this . currSelected
this . selectedKeys = [ record . key ]
@ -491,7 +494,16 @@
}
this . $nextTick ( ( ) => {
/ / t h i s . f o r m . g e t F i e l d D e c o r a t o r ( ' d e p a r t N a m e A b b r ' , { i n i t i a l V a l u e : ' ' } )
this . form . getFieldDecorator ( 'departName' , { initialValue : '' } )
this . form . getFieldDecorator ( 'departNameEn' , { initialValue : '' } )
this . form . getFieldDecorator ( 'orgCode' , { initialValue : '' } )
this . form . getFieldDecorator ( 'departNameAbbr' , { initialValue : '' } )
this . form . getFieldDecorator ( 'orgCategory' , { initialValue : 1 } )
this . form . getFieldDecorator ( 'mobile' , { initialValue : '' } )
this . form . getFieldDecorator ( 'departOrder' , { initialValue : '' } )
this . form . getFieldDecorator ( 'address' , { initialValue : '' } )
this . form . getFieldDecorator ( 'memo' , { initialValue : '' } )
/ / t h i s . f o r m . g e t F i e l d D e c o r a t o r ( ' f a x ' , { i n i t i a l V a l u e : ' ' } )
/ / t h i s . f o r m . g e t F i e l d D e c o r a t o r ( ' f a x ' , { i n i t i a l V a l u e : ' ' } )
this . form . setFieldsValue ( pick ( record , 'departName' , 'departNameEn' , 'departNameAbbr' , 'orgCategory' , 'orgCode' , 'departOrder' , 'mobile' , 'address' , 'memo' ) )
@ -526,7 +538,7 @@
}
let formData = Object . assign ( this . currSelected , values )
console . log ( 'Received values of form: ' , formData )
/ / c o n s o l e . l o g ( ' R e c e i v e d v a l u e s o f f o r m : ' , f o r m D a t a )
httpAction ( this . url . edit , formData , 'put' ) . then ( ( res ) => {
if ( res . success ) {
this . $message . success ( '保存成功!' )
@ -544,7 +556,7 @@
nodeSettingFormSubmit ( ) {
this . form . validateFields ( ( err , values ) => {
if ( ! err ) {
console . log ( 'Received values of form: ' , values )
/ / c o n s o l e . l o g ( ' R e c e i v e d v a l u e s o f f o r m : ' , v a l u e s )
}
} )
} ,
@ -556,15 +568,25 @@
this . $refs . departModal . add ( )
this . $refs . departModal . title = '新增'
} else if ( num == 2 ) {
if ( this . currSelected . orgCategory == 3 || this . currSelected . orgCategory == 4 || this . currSelected . orgCategory == 5 || this . currSelected . orgCategory == 6 || this . currSelected . orgCategory == 7 )
{
this . $message . warning ( '该部门不允许添加子部门!' )
return false
}
let key = this . currSelected . key
if ( ! key ) {
this . $message . warning ( '请先点击选中上级部门!' )
return false
}
this . $refs . departModal . add ( this . selectedKeys )
this . $refs . departModal . add ( this . selectedKeys , this . currSelected . orgCategory )
this . $refs . departModal . title = '新增'
} else {
this . $refs . departModal . add ( this . rightClickSelectedKey )
if ( this . rightClickSelectedorgCategory == 3 || this . rightClickSelectedorgCategory == 4 || this . rightClickSelectedorgCategory == 5 || this . rightClickSelectedorgCategory == 6 || this . rightClickSelectedorgCategory == 7 )
{
this . $message . warning ( '该部门不允许添加子部门!' )
return false
}
this . $refs . departModal . add ( this . rightClickSelectedKey , this . rightClickSelectedorgCategory )
this . $refs . departModal . title = '新增'
}
} ,
@ -618,7 +640,7 @@
} ,
selectDirectiveOk ( record ) {
console . log ( '选中指令数据' , record )
/ / c o n s o l e . l o g ( ' 选 中 指 令 数 据 ' , r e c o r d )
this . nodeSettingForm . setFieldsValue ( { directiveCode : record . directiveCode } )
this . currSelected . sysCode = record . sysCode
} ,