diff --git a/src/components/mdp-ui/mixin/MdpFormMixin.js b/src/components/mdp-ui/mixin/MdpFormMixin.js index adc1383..094dc43 100644 --- a/src/components/mdp-ui/mixin/MdpFormMixin.js +++ b/src/components/mdp-ui/mixin/MdpFormMixin.js @@ -311,6 +311,13 @@ export const MdpFormMixin = { } return isMatch; }, + editSomeFieldQxCheck(){ + if(this.currOpType=='add' || this.currOpType=='subAdd' || this.currOpType=='detail'){ + return false; + }else{ + return true; + } + }, /** * 对修改的字段进行判断,返回false ,将取消更新数据库,由组件扩展 * @param {*} row 当前选中的行 @@ -320,14 +327,11 @@ export const MdpFormMixin = { * @returns true/false 返回false ,将取消更新数据库 */ editSomeFieldsCheck(row,fieldName,$event,params){ - if(this.currOpType=='add'){ - return false; - } params[fieldName]=$event return true; }, editSomeFields(row,fieldName,$event){ - if(this.currOpType=='add' || this.currOpType=='detail'){ + if(!this.editSomeFieldQxCheck()){ return; } var params={}; diff --git a/src/views/mdp/sys/dept/Form.vue b/src/views/mdp/sys/dept/Form.vue index 6f25bad..268fb94 100644 --- a/src/views/mdp/sys/dept/Form.vue +++ b/src/views/mdp/sys/dept/Form.vue @@ -3,63 +3,64 @@ + + + + + + + - + - - - - - - - - - - - + + + + - +     - + 启用 停用 - - + + - + - - + + 关闭 - 提交 + 提交 @@ -80,6 +81,7 @@ export default { computed: { }, props:{ + parentDept:null, }, watch: { }, @@ -88,11 +90,22 @@ export default { menuDefId:'',//menu_def.id 菜单表菜单编号,用于按钮权限判断 pkNames:["deptid"],//表格主键的java属性名称,驼峰命名,默认为id,支持多主键 currOpType:'mng',//表单 add、edit,所有按钮可动、detail-只看不能操作 - editFormRules: { - deptid:[ - //{ required: true, message: '此项必填', trigger: 'change' }, - //{ min: 1,max: 200, message: '长度在1到200之间', trigger: 'change'} - ] + editFormRules: { + deptName:[ + { required: true, message: '此项必填', trigger: 'change' }, + { min: 1,max: 50, message: '长度在1到50之间', trigger: 'change'} + ], + shortName:[ + { min: 1,max: 50, message: '长度在1到50之间', trigger: 'change'} + ], + + displayDeptid:[ + { min: 1,max: 50, message: '长度在1到50之间', trigger: 'change'} + ], + + deptid:[ + { min: 1,max: 50, message: '长度在1到50之间', trigger: 'change'} + ], }, editForm: { deptid:'',deptName:'',pdeptid:'',deptType:'',state:'',manager:'',leader:'',shortName:'',displayDeptid:'',orgType:'',managerName:'',leaderName:'',branchId:'',levelType:'',idPath:'',bizProcInstId:'',bizFlowState:'',ltime:'',isCbCenter:'',cpaType:'',cpaBranchId:'' @@ -109,20 +122,33 @@ export default { methods: { //由组件扩展添加其它的初始页面的逻辑 initCurrData(){ - this.disabledRulesInit(this.disabledRules) - + debugger + this.disabledRulesInit(this.disabledRules) if(this.currOpType=='subAdd'){ var data=this.parentDept; this.editForm.pdeptid=data.deptid; this.editForm.branchId=data.branchId; this.editForm.levelType =data.levelType; + this.editForm.cpaType='0' + this.editForm.state="A" + this.editForm.deptType="2" + this.editForm.cpaBranchId=data.branchId + this.editForm.deptType="2" + this.editForm.manager=this.userInfo.userid + this.editForm.managerName=this.userInfo.username var a=this.editForm.levelType.split("L").join("");//字符串转数字 var leve = Number(a); this.editForm.levelType = "L"+(leve+1);//字母数字组合 }else if(this.currOpType=='add'){ this.editForm.pdeptid='A0' this.editForm.levelType="L1" - this.editForm.branchId=this.userInfo.branchId + this.editForm.branchId=this.userInfo.branchId + this.editForm.cpaType='0' + this.editForm.state="A" + this.editForm.deptType="2" + this.editForm.cpaBranchId=this.editForm.branchId + this.editForm.manager=this.userInfo.userid + this.editForm.managerName=this.userInfo.username } }, /** @@ -149,6 +175,9 @@ export default { * @returns true/false 返回false ,将取消更新数据库 */ editSomeFieldsCheck(row,fieldName,$event,params){ + if(this.currOpType=='add'||this.currOpType=='subAdd'){ + return false; + } if(fieldName=='manager'){ row.managerName=$event.username params.managerName=$event.username diff --git a/src/views/mdp/sys/dept/Index.vue b/src/views/mdp/sys/dept/Index.vue index f026617..7a9a9ae 100644 --- a/src/views/mdp/sys/dept/Index.vue +++ b/src/views/mdp/sys/dept/Index.vue @@ -123,7 +123,7 @@ diff --git a/src/views/mdp/sys/role/Form.vue b/src/views/mdp/sys/role/Form.vue index d710d57..7bf66f6 100644 --- a/src/views/mdp/sys/role/Form.vue +++ b/src/views/mdp/sys/role/Form.vue @@ -2,13 +2,13 @@ - - - - + + + + @@ -32,13 +32,13 @@ - + - + @@ -76,7 +76,7 @@ export default { editFormRules: { roleid:[ //{ required: true, message: '此项必填', trigger: 'change' }, - //{ min: 1,max: 200, message: '长度在1到200之间', trigger: 'change'} + { min: 1,max: 50, message: '长度在1到50之间', trigger: 'change'} ], rolename: [ { required: true, message: '角色名必输', trigger: 'blur' } @@ -86,7 +86,10 @@ export default { ], enabled: [ { required: true, message: '是否启用必输', trigger: 'blur' } - ] + ], + sortOrder: [ + { max:5, message: '最大不能超过99999', trigger: 'blur' } + ], }, editForm: { roleid:'',rolename:'',remark:'',roletype:'',rolebeg:'',roleend:'',crdate:'',enabled:'',deptid:'',sortOrder:'',branchId:'',dataLvl:'' @@ -105,6 +108,13 @@ export default { initCurrData(){ this.disabledRulesInit(this.disabledRules) Object.assign(this.editForm,this.formData) + if(this.currOpType=='add'){ + this.editForm.branchId=this.userInfo.branchId + this.editForm.dataLvl='2' + this.editForm.enabled='1' + this.editForm.roletype="0" + this.editForm.sortOrder=999 + } }, /** * 检查参数是否满足调用后台接口的条件