(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5e479ee5"],{"09f4":function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),Math.easeInOutQuad=function(e,t,n,a){return e/=a/2,e<1?n/2*e*e+t:(e--,-n/2*(e*(e-2)-1)+t)};var a=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function o(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function i(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function r(e,t,n){var r=i(),l=e-r,s=20,c=0;t="undefined"===typeof t?500:t;var u=function e(){c+=s;var i=Math.easeInOutQuad(c,r,l,t);o(i),c1&&!e.basdisabled?n("i",{staticClass:"el-icon-delete-solid marginLeft10 iconStyle",staticStyle:{"font-size":"20px",cursor:"pointer"},on:{click:function(t){return e.deleteLinkMan(a)}}}):e._e()]),e._v(" "),n("el-form-item",{attrs:{rules:[{required:!0,message:"请输入联系人",trigger:"blur"}],label:"联系人姓名",prop:"cooperationOrganLinkmanList."+a+".linkman","label-width":e.formLabelWidth}},[n("el-input",{attrs:{disabled:e.basdisabled,autocomplete:"off"},model:{value:t.linkman,callback:function(n){e.$set(t,"linkman","string"===typeof n?n.trim():n)},expression:"item.linkman"}})],1),e._v(" "),n("el-form-item",{attrs:{rules:[{required:!0,message:"请输入职位",trigger:"blur"}],label:"联系人职位",prop:"cooperationOrganLinkmanList."+a+".job","label-width":e.formLabelWidth}},[n("el-input",{attrs:{disabled:e.basdisabled,autocomplete:"off"},model:{value:t.job,callback:function(n){e.$set(t,"job","string"===typeof n?n.trim():n)},expression:"item.job"}})],1),e._v(" "),n("el-form-item",{attrs:{rules:[{required:!0,validator:e.validPhone,trigger:"blur"},,{pattern:/^1[3456789]\d{9}$/,message:"请输入正确的手机号",trigger:"blur"}],label:"联系人手机号",prop:"cooperationOrganLinkmanList."+a+".mobileNo","label-width":e.formLabelWidth}},[n("el-input",{attrs:{disabled:e.basdisabled,autocomplete:"off"},model:{value:t.mobileNo,callback:function(n){e.$set(t,"mobileNo","string"===typeof n?n.trim():n)},expression:"item.mobileNo"}})],1)],1)})),e._v(" "),e.basdisabled?e._e():n("el-button",{staticClass:"greyRow",staticStyle:{width:"100%"},attrs:{icon:"el-icon-plus"},on:{click:e.addLinkMan}},[e._v("添加联系人")])],2),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){e.teachingStatus=!1}}},[e._v("取 消")]),e._v(" "),e.basdisabled?e._e():n("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.onTeachingSubmit("ruleForm")}}},[e._v("确 定")])],1)],1)],1)},o=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("h2",[n("div",{staticClass:"squrt"}),e._v("\n 合作单位\n ")])}],i=(n("7f7f"),n("5530")),r=(n("386d"),n("96cf"),n("1da1")),l=n("333d"),s=n("99b4"),c=n("e3eb"),u=n.n(c),m=n("61f7"),d=n("adb21"),p=n("1cc7"),b=n("4328"),f=n.n(b),g=function(e,t,n){t?Object(m["b"])(t)?n():n(new Error("请输入正确的11位手机号码")):n(new Error("请输入电话号码"))},h={name:"branchManager",components:{pagination:l["a"]},data:function(){return{searchForm:{organId:null,isEnable:null,search:null},validPhone:g,searchLsit:[],tableList:[],educationList:[],pageInfo:{limit:10,page:1,total:0,page_size:[10,20,40,50]},teachingStatus:!1,formActionTitle:"create",formTitle:{create:"添加合作单位",update:"修改合作单位",look:"查看合作单位"},formLabelWidth:"120px",form:{id:null,name:null,linkman:null,job:null,mobileNo:null,fullJobResource:null,organId:null,educationUserId:null,cooperationOrganLinkmanList:[{cooperationOrganId:"",job:"",linkman:"",mobileNo:""}]},rules:{name:[{required:!0,message:"请输入教学点名称",trigger:"blur"}],organId:[{required:!0,message:"请选择所属分部",trigger:"change"}],educationUserId:[{required:!0,message:"请选择乐团主管",trigger:"change"}],fullJobResource:[{required:!0,message:"请选择是否全职资源",trigger:"change"}],isEnable:[{required:!0,message:"请选择状态",trigger:"change"}]},basdisabled:!1,actionRow:null}},mounted:function(){var e=Object(r["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.getList(),e.next=3,this.$store.dispatch("setBranchs");case 3:this.selects.branchs.length<=0&&this.$bus.$emit("showguide",["organ"]);case 4:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),methods:{onDelete:function(e){var t=this;this.$confirm("您确定删除合作单位?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(s["d"])(e.id).then((function(e){200==e.code?(t.$message.success("删除成功"),t.teachingStatus=!1,t.getList()):t.$message.error(e.msg)}))})).catch((function(){}))},search:function(){this.pageInfo.page=1,this.getList()},onReSet:function(){this.searchForm={organId:null,isEnable:null},this.search()},onExport:function(){Object(d["a"])(this,{url:"/api-web/export/cooperationOrgan",fileName:"合作单位.xls",method:"post",params:f.a.stringify(u()(this.searchForm))},"您确定导出合作单位?")},onTeachingSubmit:function(e){var t=this;this.$refs[e].validate((function(e){if(!e)return!1;"create"==t.formActionTitle?(t.form.id&&delete t.form.id,console.log(t.form),Object(s["c"])(t.form).then((function(e){200==e.code?(t.$message.success("创建成功"),t.teachingStatus=!1,t.getList()):t.$message.error(e.msg)}))):"update"==t.formActionTitle&&Object(s["e"])(t.form).then((function(e){200==e.code?(t.$message.success("修改成功"),t.teachingStatus=!1,t.getList()):t.$message.error(e.msg)}))}))},getList:function(){var e=this;Object(s["G"])(Object(i["a"])({rows:this.pageInfo.limit,page:this.pageInfo.page},this.searchForm)).then((function(t){200==t.code&&t.data&&(e.tableList=t.data.rows,e.pageInfo.total=t.data.total)}))},openTeaching:function(e,t){this.teachingStatus=!0,this.formActionTitle=e,"update"==e?(this.changeOrgan(t.organId),this.actionRow=t,this.form={id:t.id,name:t.name,linkman:t.linkman,job:t.job,mobileNo:t.mobileNo?t.mobileNo:null,ownershipType:t.ownershipType,organId:t.organId,fullJobResource:t.fullJobResource,isEnable:t.isEnable,educationUserId:t.educationUserId,cooperationOrganLinkmanList:t.cooperationOrganLinkmanList.length>0?t.cooperationOrganLinkmanList:[{cooperationOrganId:t.id,job:"",linkman:"",mobileNo:""}]},this.basdisabled=!1):"look"==e?(this.changeOrgan(t.organId),this.actionRow=t,this.form={id:t.id,name:t.name,linkman:t.linkman,job:t.job,mobileNo:t.mobileNo?t.mobileNo:null,ownershipType:t.ownershipType,organId:t.organId,fullJobResource:t.fullJobResource,isEnable:t.isEnable,educationUserId:t.educationUserId,cooperationOrganLinkmanList:t.cooperationOrganLinkmanList},this.basdisabled=!0):(this.basdisabled=!1,this.actionRow=null)},onFormClose:function(e){this.form={id:null,name:null,linkman:null,job:null,mobileNo:null,fullJobResource:null,organId:null,isEnable:null,educationUserId:null,cooperationOrganLinkmanList:[{cooperationOrganId:"",job:"",linkman:"",mobileNo:""}]},this.$refs[e].resetFields()},changeOrgan:function(){var e=Object(r["a"])(regeneratorRuntime.mark((function e(t){var n,a,o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this.form.educationUserId=null,!t){e.next=13;break}return e.prev=2,e.next=5,Object(p["R"])({id:t});case 5:o=e.sent,this.educationList=null===o||void 0===o||null===(n=o.data)||void 0===n?void 0:n.educationId,(!this.educationList||(null===(a=this.educationList)||void 0===a?void 0:a.length)<=0)&&this.$bus.$emit("showguide",["teamManager"]),e.next=13;break;case 10:e.prev=10,e.t0=e["catch"](2),console.log(e.t0);case 13:case"end":return e.stop()}}),e,this,[[2,10]])})));function t(t){return e.apply(this,arguments)}return t}(),deleteLinkMan:function(e){console.log(this.form.cooperationOrganLinkmanList),this.form.cooperationOrganLinkmanList.splice(e,1)},addLinkMan:function(){this.actionRow?(console.log(this.actionRow),this.form.cooperationOrganLinkmanList.push({cooperationOrganId:this.actionRow.id,job:"",linkman:"",mobileNo:""})):this.form.cooperationOrganLinkmanList.push({cooperationOrganId:"",job:"",linkman:"",mobileNo:""})}},watch:{teachingStatus:function(e){e||this.getList()}}},v=h,k=(n("3d4e"),n("2877")),_=Object(k["a"])(v,a,o,!1,null,"50e66557",null);t["default"]=_.exports}}]);