(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-660f69ea"],{"02bc":function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"editDeptDialog"},[a("el-dialog",{attrs:{center:"",width:"636px",title:"新增部门",visible:e.addTopDeptData.dialogVisible},on:{close:function(t){return e.cancel()},"update:visible":function(t){return e.$set(e.addTopDeptData,"dialogVisible",t)}}},[a("div",{staticStyle:{"text-align":"center","margin-bottom":"20px",width:"300px","margin-left":"80px"}},[a("el-radio-group",{on:{input:e.changeDept},model:{value:e.radio,callback:function(t){e.radio=t},expression:"radio"}},[a("el-radio",{attrs:{label:"1"}},[e._v("新增一级部门")]),a("el-radio",{attrs:{label:"2"}},[e._v("新增下属部门")])],1)],1),a("el-form",{ref:"ruleForm",attrs:{"label-width":"80px",rules:e.rules,model:e.addDeptForm}},[1!=e.radio?a("el-form-item",{attrs:{label:"上级部门",prop:"parentName"}},[a("el-select",{ref:"selectTree",staticStyle:{width:"253px"},attrs:{clearable:"",placeholder:"上级部门名称"},model:{value:e.addDeptForm.parentName,callback:function(t){e.$set(e.addDeptForm,"parentName",t)},expression:"addDeptForm.parentName"}},[a("el-option",{attrs:{value:e.treeData.id,label:e.treeData.label,hidden:""}}),a("el-tree",{attrs:{data:e.treeData,props:e.defaultProps,"node-key":e.treeData.id,accordion:"","highlight-current":""},on:{"node-click":e.handleNodeClick}})],1)],1):e._e(),a("el-form-item",{attrs:{label:"部门名称",prop:"deptName"}},[a("el-input",{attrs:{maxLength:30,placeholder:"请输入部门名称"},model:{value:e.addDeptForm.deptName,callback:function(t){e.$set(e.addDeptForm,"deptName",t)},expression:"addDeptForm.deptName"}})],1),a("el-form-item",{attrs:{label:"部门编码",prop:"deptCode"}},[a("el-input",{attrs:{maxLength:30,placeholder:"请输入部门编码"},model:{value:e.addDeptForm.deptCode,callback:function(t){e.$set(e.addDeptForm,"deptCode",t)},expression:"addDeptForm.deptCode"}})],1),a("el-form-item",{attrs:{label:"显示排序",prop:"orderNum"}},[a("el-input",{attrs:{maxLength:10,placeholder:"请输入部门排序",onkeyup:"this.value=this.value.replace(/\\D/g,'')",onafterpaste:"this.value=this.value.replace(/\\D/g,'')"},model:{value:e.addDeptForm.orderNum,callback:function(t){e.$set(e.addDeptForm,"orderNum",t)},expression:"addDeptForm.orderNum"}})],1),a("el-form-item",{attrs:{label:"联系电话",prop:"phone"}},[a("el-input",{attrs:{placeholder:"请输入联系电话",maxLength:11},model:{value:e.addDeptForm.phone,callback:function(t){e.$set(e.addDeptForm,"phone",t)},expression:"addDeptForm.phone"}})],1),a("el-form-item",{attrs:{label:"联系邮箱"}},[a("el-input",{attrs:{maxLength:30,placeholder:"请输入联系邮箱"},model:{value:e.addDeptForm.email,callback:function(t){e.$set(e.addDeptForm,"email",t)},expression:"addDeptForm.email"}})],1),a("el-form-item",{attrs:{label:"状态",prop:"status"}},[a("el-switch",{staticClass:"switchStyle",attrs:{"active-text":"启用","inactive-text":"停用","active-color":"#13ce66","inactive-color":"#ff4949"},model:{value:e.addDeptForm.status,callback:function(t){e.$set(e.addDeptForm,"status",t)},expression:"addDeptForm.status"}})],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("div",{staticClass:"search",on:{click:function(t){return e.addDept()}}},[e._v("保 存")]),a("div",{staticClass:"reset",on:{click:function(t){return e.cancel()}}},[e._v("取 消")])])],1)],1)},o=[],d=(a("d9e2"),a("e9c4"),a("b64b"),a("ac1f"),a("00b4"),a("f9ac")),l={name:"addDeptDialog",props:{addTopDeptData:{type:Object,default:{}}},data:function(){var e=function(e,t,a){if(t){var r=/^((0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/,o=/^(?:(?:\+|00)86)?1[3-9]\d{9}$/;o.test(t)||r.test(t)||!t?a():a(new Error("请输入正确的手机号"))}else a()};return{radio:"1",addDeptForm:{parentId:0,parentName:"",deptName:"",deptCode:"",orderNum:"",phone:"",email:"",status:!0},treeData:[],rules:{parentName:[{required:!0,message:"请选择上级部门",trigger:"blur"}],deptName:[{required:!0,message:"请输入部门名称",trigger:"blur"}],deptCode:[{required:!0,message:"请输入部门编码",trigger:"blur"}],orderNum:[{required:!0,message:"请输入部门排序",trigger:"blur"}],phone:[{validator:e}],email:[{required:!0,message:"请输入邮箱",trigger:"blur"}],status:[{required:!0,message:"请选择状态",trigger:"blur"}]}}},created:function(){this.getDeptTree()},methods:{changeDept:function(e){1==e&&(this.addDeptForm.parentId=0)},getDeptTree:function(){var e=this;Object(d["t"])().then((function(t){e.treeData=t.data}))},handleNodeClick:function(e){var t=JSON.parse(JSON.stringify(e));this.addDeptForm.parentId=t.id,this.addDeptForm.parentName=t.label},cancel:function(){this.addTopDeptData.dialogVisible=!1},addDept:function(){var e=this;this.$refs.ruleForm.validate((function(t){t&&e.$emit("addTopDeptBtn",e.addDeptForm)}))}}},i=l,s=(a("41eff"),a("2877")),n=Object(s["a"])(i,r,o,!1,null,"34c7e881",null);t["default"]=n.exports},"41eff":function(e,t,a){"use strict";a("70e2")},"70e2":function(e,t,a){}}]);