(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-76f79c70"],{"09f4":function(e,t,a){"use strict";a.d(t,"a",(function(){return s})),Math.easeInOutQuad=function(e,t,a,r){return e/=r/2,e<1?a/2*e*e+t:(e--,-a/2*(e*(e-2)-1)+t)};var r=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 n(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function s(e,t,a){var s=n(),i=e-s,l=20,c=0;t="undefined"===typeof t?500:t;var u=function e(){c+=l;var n=Math.easeInOutQuad(c,s,i,t);o(n),c0||e.pageInfo.page>1||e.searchForm.search||e.searchForm.organId||e.searchForm.publicFlag)&&e.contextFlag?a("div",{staticClass:"m-core"},[a("save-form",{staticClass:"searchForm",attrs:{inline:!0,model:e.searchForm},on:{submit:e.search,reset:e.onReset}},[a("el-form-item",[a("el-input",{attrs:{type:"text",clearable:"",placeholder:"教学点名称"},model:{value:e.searchForm.search,callback:function(t){e.$set(e.searchForm,"search","string"===typeof t?t.trim():t)},expression:"searchForm.search"}})],1),e._v(" "),a("el-form-item",[a("el-select",{attrs:{clearable:"",filterable:"",placeholder:"请选择分部"},model:{value:e.searchForm.organId,callback:function(t){e.$set(e.searchForm,"organId","string"===typeof t?t.trim():t)},expression:"searchForm.organId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),e._v(" "),a("el-form-item",[a("el-select",{attrs:{clearable:"",filterable:"",placeholder:"可用状态"},model:{value:e.searchForm.publicFlag,callback:function(t){e.$set(e.searchForm,"publicFlag","string"===typeof t?t.trim():t)},expression:"searchForm.publicFlag"}},[a("el-option",{attrs:{label:"个人",value:"0"}}),e._v(" "),a("el-option",{attrs:{label:"公共",value:"1"}})],1)],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{"native-type":"submit",type:"danger"}},[e._v("搜索")]),e._v(" "),a("el-button",{attrs:{"native-type":"reset",type:"primary"}},[e._v("重置")]),e._v(" "),a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"export/exportSchoolList",expression:"'export/exportSchoolList'"}],attrs:{type:"primary"},on:{click:e.onExport}},[e._v("导出")])],1)],1),e._v(" "),a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"school/add",expression:"'school/add'"}],staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary"},on:{click:function(t){return e.openTeaching("create")}}},[e._v("\n 新建\n ")]),e._v(" "),a("div",{staticClass:"tableWrap"},[a("el-table",{attrs:{data:e.tableList,"header-cell-style":{background:"#EDEEF0",color:"#444"}}},[a("el-table-column",{attrs:{align:"center",width:"55",prop:"id",label:"编号"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"name",label:"教学点名称"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"organName",label:"所属分部"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"教学点来源",formatter:e.filterOrgan,width:"120px"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"可用状态",width:"120px"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.userId?t.row.realName:"公共")+"\n ")]}}],null,!1,935371908)}),e._v(" "),a("el-table-column",{attrs:{align:"center",width:"120px",label:"租赁费用"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.cooperationOrganId?"免费":t.row.remark)+"\n ")]}}],null,!1,3176408943)}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"上课地点详情"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.address.split(",").join(""))+"\n ")]}}],null,!1,2837164343)}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"delFlag",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(2==t.row.delFlag?"停用":"启用")+"\n ")]}}],null,!1,1005927672)}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[e.$helpers.permission("school/update")?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.openTeaching("update",t.row)}}},[e._v("修改")]):e._e(),e._v(" "),0==t.row.delFlag&&e.$helpers.permission("school/update/stop")?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.onUpdateSubmit(t.row,2)}}},[e._v("停用")]):e._e(),e._v(" "),2==t.row.delFlag&&e.$helpers.permission("school/update/open")?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.onUpdateSubmit(t.row,0)}}},[e._v("启用")]):e._e(),e._v(" "),e.$helpers.permission("school/update/del")?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.onUpdateSubmit(t.row,1)}}},[e._v("删除")]):e._e()]}}],null,!1,1797497365)})],1),e._v(" "),a("pagination",{attrs:{sync:"",total:e.pageInfo.total,page:e.pageInfo.page,limit:e.pageInfo.limit,"page-sizes":e.pageInfo.page_size},on:{"update:total":function(t){return e.$set(e.pageInfo,"total",t)},"update:page":function(t){return e.$set(e.pageInfo,"page",t)},"update:limit":function(t){return e.$set(e.pageInfo,"limit",t)},pagination:e.getList}})],1)],1):e._e(),e._v(" "),e.tableList.length>0||e.pageInfo.page>1||e.searchForm.search||e.searchForm.organId||e.searchForm.publicFlag||!e.contextFlag?e._e():a("emptyPage",{attrs:{title:"教学点管理",btnTitle:"新建教学点",context:e.context},on:{submit:function(t){return e.openTeaching("create")}}}),e._v(" "),a("el-dialog",{attrs:{title:e.formTitle[e.formActionTitle],visible:e.teachingStatus,width:"500px"},on:{"update:visible":function(t){e.teachingStatus=t},close:function(t){return e.onFormClose("ruleForm")}}},[a("el-form",{ref:"ruleForm",attrs:{model:e.form,rules:e.rules}},[a("el-form-item",{attrs:{label:"教学点名称",prop:"name","label-width":e.formLabelWidth}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name","string"===typeof t?t.trim():t)},expression:"form.name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"教学点来源",prop:"source","label-width":e.formLabelWidth}},["update"==e.formActionTitle?[a("el-select",{staticStyle:{width:"100% !important"},attrs:{filterable:"",clearable:"",disabled:""},model:{value:e.form.source,callback:function(t){e.$set(e.form,"source","string"===typeof t?t.trim():t)},expression:"form.source"}},[a("el-option",{attrs:{label:"合作单位",value:"1"}}),e._v(" "),a("el-option",{attrs:{label:"租赁",value:"2"}})],1)]:[a("el-select",{staticStyle:{width:"100% !important"},attrs:{filterable:"",clearable:""},model:{value:e.form.source,callback:function(t){e.$set(e.form,"source","string"===typeof t?t.trim():t)},expression:"form.source"}},[a("el-option",{attrs:{label:"合作单位",value:"1"}}),e._v(" "),a("el-option",{attrs:{label:"租赁",value:"2"}})],1)]],2),e._v(" "),1==e.form.source?a("el-form-item",{attrs:{prop:"cooperationOrganId",label:"合作单位","label-width":e.formLabelWidth}},[a("el-select",{staticStyle:{width:"100% !important"},attrs:{filterable:"",clearable:""},on:{change:e.onCooperationChange},model:{value:e.form.cooperationOrganId,callback:function(t){e.$set(e.form,"cooperationOrganId","string"===typeof t?t.trim():t)},expression:"form.cooperationOrganId"}},e._l(e.cooperationList,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1):e._e(),e._v(" "),"update"==e.formActionTitle?a("el-form-item",{attrs:{prop:"user",label:"可用状态","label-width":e.formLabelWidth}},[a("el-input",{attrs:{disabled:""},model:{value:e.form.user,callback:function(t){e.$set(e.form,"user",t)},expression:"form.user"}})],1):e._e(),e._v(" "),2==e.form.source?a("el-form-item",{attrs:{prop:"remark",label:"租赁费用","label-width":e.formLabelWidth}},[a("el-input",{attrs:{type:"number",autocomplete:"off"},model:{value:e.form.remark,callback:function(t){e.$set(e.form,"remark","string"===typeof t?t.trim():t)},expression:"form.remark"}})],1):e._e(),e._v(" "),a("el-form-item",{attrs:{prop:"organId",label:"所属分部","label-width":e.formLabelWidth}},[a("el-select",{staticStyle:{width:"100% !important"},attrs:{disabled:2!=e.form.source,clearable:"",filterable:""},model:{value:e.form.organId,callback:function(t){e.$set(e.form,"organId","string"===typeof t?t.trim():t)},expression:"form.organId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{prop:"address",label:"上课地点","label-width":e.formLabelWidth}},[a("el-input",{staticClass:"text-address",attrs:{disabled:!0},model:{value:e.form.address,callback:function(t){e.$set(e.form,"address","string"===typeof t?t.trim():t)},expression:"form.address"}},[a("template",{slot:"append"},[a("el-button",{staticClass:"addMapBtn",attrs:{type:"primary",icon:"el-icon-plus"},on:{click:e.addMap}},[e._v("选择")])],1)],2)],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){return e.onTeachingCancel("ruleForm")}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.onTeachingSubmit("ruleForm")}}},[e._v("确 定")])],1)],1),e._v(" "),a("el-dialog",{attrs:{"close-on-click-modal":!1,title:"选择地图","custom-class":"map-container",visible:e.mapStatus,width:"800px"},on:{"update:visible":function(t){e.mapStatus=t}}},[a("div",{staticStyle:{padding:"0 20px"}},[a("el-alert",{staticStyle:{margin:"10px 0"},attrs:{title:"选中地点:",closable:!1,type:"info",description:e.addressDetail.address}}),e._v(" "),a("el-amap-search-box",{staticClass:"search-box",attrs:{value:"searchValue","search-option":e.searchOption,"on-search-result":e.onSearchResult}}),e._v(" "),a("el-amap",{attrs:{zoom:e.zoom,plugin:e.plugin,center:e.center,events:e.events}},e._l(e.markers,(function(t,r){return a("el-amap-marker",{key:r,attrs:{events:e.markerEvents(),position:t}})})),1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.mapStatus=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.setAddrss}},[e._v("确 定")])],1)])],1)},o=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("h2",[a("div",{staticClass:"squrt"}),e._v("\n 教学点管理\n ")])}],n=a("c7eb"),s=(a("7f7f"),a("96cf"),a("1da1")),i=(a("ac6a"),a("386d"),a("28a5"),a("333d")),l=a("adb21"),c=a("4328"),u=a.n(c),d=a("e3eb"),p=a.n(d),m=a("99b4"),f=(a("1cc7"),a("4360"),a("8f9b")),g=a.n(f),h=a("1062");(function(){var e=EventTarget.prototype.addEventListener,t=!1;try{var a=Object.defineProperty({},"passive",{get:function(){t=!0}});document.addEventListener("testPassive",null,a),document.removeEventListener("testPassive",null,a)}catch(r){}EventTarget.prototype.addEventListener=function(a,r,o){this.func=e,o=o instanceof Object?o:{},o.passive=t,this.func(a,r,o)}})(),g.a.initAMapApiLoader({key:"ac943ac1522de0d63eb8a99b71fe2601",plugin:["AMap.Geolocation","AMap.PlaceSearch","AMap.Geocoder","Geocoder"],v:"1.4.4"});var b={name:"addressManager",components:{pagination:i["a"],emptyPage:h["a"]},data:function(){var e=this;return{searchForm:{search:null,organId:null,publicFlag:null},searchLsit:[],tableList:[],pageInfo:{limit:10,page:1,total:0,page_size:[10,20,40,50]},formActionTitle:"create",formTitle:{create:"添加教学点",update:"修改教学点"},teachingStatus:!1,formLabelWidth:"100px",addressDetail:{},form:{name:null,source:null,cooperationOrganId:null,remark:null,address:null,subsidy:null,organId:null},selectOrganId:null,rules:{name:[{required:!0,message:"请输入教学点名称",trigger:"blur"}],source:[{required:!0,message:"请选择教学点来源",trigger:"change"}],remark:[{required:!0,message:"请输入租赁费用",trigger:"blur"}],address:[{required:!0,message:"请选择上课地点",trigger:"blur"}],cooperationOrganId:[{required:!0,message:"请选择合作单位",trigger:"change"}],organId:[{required:!0,message:"请选择所属分部",trigger:"change"}],subsidy:[{type:"number",message:"课酬补贴只能为数字",trigger:"blur"}]},events:{init:function(e){},zoomchange:function(e){},zoomend:function(e){},click:function(t){e.getpoient(t)}},addressMessage:!0,mapStatus:!1,zoom:16,center:[114.34371,30.55939],markers:[],plugin:[],searchOption:{city:"",citylimit:!0,pageSize:1,pageIndex:1,autoFitView:!0},cooperationList:[],searchValue:"测试",activeAddress:{},context:"教学点是乐团、VIP课线下课的教学位置,不同分部可创建不同的教学点,线下课排课时需选择教学点,老师需在课程教学点的定位范围内完成考勤。教学点可设置合作单位提供、租赁两种方式。",contextFlag:!1}},mounted:function(){this.getList(),this.getBreachList()},methods:{onTeachingSubmit:function(e){var t=this;this.$refs[e].validate((function(e){if(!e)return!1;"create"==t.formActionTitle?Object(m["N"])(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(m["P"])(t.form).then((function(e){200==e.code?(t.$message.success("修改成功"),t.teachingStatus=!1,t.getList()):t.$message.error(e.msg)}))}))},onTeachingCancel:function(e){this.teachingStatus=!1,this.$refs[e].clearValidate()},addMap:function(){this.mapStatus=!0,this.addressDetail.address=this.form.address,this.addressDetail.poi=this.form.longitudeLatitude;var e=this.form.longitudeLatitude,t=this.form.address;if(e)this.markers=[],this.center=[e.split(",")[0],e.split(",")[1]],this.markers.push([e.split(",")[0],e.split(",")[1]]);else if(t&&""==e){var a=this,r=new AMap.PlaceSearch({pageSize:1,pageIndex:1});r.search(t,(function(t,r){if("complete"===t){var o=r.poiList.pois[0];e=o.location.lng+","+o.location.lat,a.center=[o.location.lng,o.location.lat],a.markers.push([o.location.lng,o.location.lat])}}))}},onCooperationChange:function(e){var t=this;this.form.organId=null,this.cooperationList.forEach((function(a){a.value==e&&(t.form.organId=a.organId)}))},onSearchResult:function(e){var t=this;this.markers=[];var a=0,r=0;if(e.length>0){e.forEach((function(e){var o=e.location,n=o.lng,s=o.lat;r+=n,a+=s,t.markers.push([e.location.lng,e.location.lat])}));var o={lng:r/e.length,lat:a/e.length};this.center=[o.lng,o.lat]}var n=null;AMap.plugin(["AMap.Geocoder"],(function(){n=new AMap.Geocoder}));var s=this;n.getAddress(e[0].location,(function(t,a){if("complete"===t&&a.regeocode){a.regeocode.lnglat=e[0].location;var r=a.regeocode.addressComponent;s.addressDetail={address:r.province+","+r.city+","+r.district+","+r.township+r.street+r.streetNumber,poi:e[0].location.lng+","+e[0].location.lat}}else s.$message.error("请重新选择地址")}))},getpoient:function(e){this.onSearchResult([{location:e.lnglat}])},markerEvents:function(){var e=this;return{click:function(t){e.getpoient(t)}}},setAddrss:function(){this.form.address=this.addressDetail.address,this.form.longitudeLatitude=this.addressDetail.poi,this.mapStatus=!1,this.addressMessage=!1},getList:function(){var e=this,t=this.searchForm,a={search:t.search?t.search:null,organId:t.organId?t.organId:null,publicFlag:t.publicFlag?t.publicFlag:null,rows:this.pageInfo.limit,page:this.pageInfo.page};Object(m["O"])(a).then((function(t){200==t.code&&t.data&&(e.contextFlag=!0,e.tableList=t.data.rows,e.pageInfo.total=t.data.total)}))},getBreachList:function(){var e=Object(s["a"])(Object(n["a"])().mark((function e(){var t,a=this;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.$store.dispatch("setBranchs");case 2:return t=[],this.selects.branchs.forEach((function(e){t.push(e.id)})),e.next=6,Object(m["E"])({organId:t.join(",")}).then((function(e){if(200==e.code){if(!e.data&&e.data.length<=0)return;e.data.forEach((function(e){a.cooperationList.push({value:e.id,organId:e.organId,label:e.name})}))}}));case 6:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),openTeaching:function(e,t){this.teachingStatus=!0,this.formActionTitle=e,"update"==e&&(this.form={id:t.id,name:t.name,source:t.cooperationOrganId?"1":"2",cooperationOrganId:t.cooperationOrganId,remark:t.remark,address:t.address.split(",").join(""),subsidy:t.subsidy,organId:t.organId,longitudeLatitude:t.longitudeLatitude,user:t.realName?t.realName:"公共"})},onFormClose:function(e){this.form={name:null,source:null,cooperationOrganId:null,remark:null,address:null,subsidy:null},this.$refs[e].resetFields()},filterOrgan:function(e){var t="";return e.cooperationOrganId?this.cooperationList.forEach((function(a){a.value==e.cooperationOrganId&&(t=a.label)})):t="租赁",t},onUpdateSubmit:function(e,t){var a,r=this;a=2==t?"停用":0==t?"启用":"删除",this.$confirm("您确定".concat(a,"吗?"),"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(m["P"])({id:e.id,delFlag:t}).then((function(a){200==a.code?(r.$message.success("修改成功"),r.teachingStatus=!1,2==t||0==t?e.delFlag=t:r.getList()):r.$message.error(a.msg)}))}))},search:function(){this.pageInfo.page=1,this.getList()},onReset:function(){this.searchForm={search:null,organId:null,publicFlag:null},this.search()},onExport:function(){Object.assign({},this.searchForm);var e=this.searchForm;Object(l["a"])(this,{url:"/api-web/export/exportSchoolList",fileName:"教学点.xls",method:"post",params:u.a.stringify(p()({search:e.search?e.search:null,organId:e.organId?e.organId:null,publicFlag:e.publicFlag?e.publicFlag:null,rows:this.pageInfo.limit,page:this.pageInfo.page}))},"您确定导出教学点?")}}},v=b,_=(a("8caa"),a("2877")),y=Object(_["a"])(v,r,o,!1,null,null,null);t["default"]=y.exports},"8caa":function(e,t,a){"use strict";a("42df")},adb21:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var r=a("bc3a"),o=a.n(r),n=(a("4328"),a("5f87")),s=a("3908"),i=a("e3eb"),l=a.n(i),c=function(e,t,a,r){var i=t.url,c={method:t.method?t.method:"get",headers:{Authorization:Object(n["b"])(),tenantId:Object(n["a"])()},url:i,responseType:"blob"};"post"==c.method?c.data=t.params:c.params=t.params,e.$confirm(a||"您确定下载模板","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){s["a"].startLoading(),o()(l()(c)).then((function(a){var o=new Blob([a.data],{type:"application/vnd.ms-excel;charset=utf-8"}),n=new Response(o).text();n.then((function(a){if(-1!=a.indexOf("code")){var n=JSON.parse(a);if(403==n.code)return e.$message.error("登录过期,请重新登录!"),void setTimeout((function(){e.$store.dispatch("user/resetToken").then((function(){location.reload()}))}),1e3);200==n.code?e.$message.success(n.msg):e.$message.error(n.msg),r&&r()}else{var s=URL.createObjectURL(o),i=document.createElement("a"),l=t.fileName||"导出文件.xls";i.href=s,i.setAttribute("download",l),document.body.appendChild(i),i.click(),r&&r()}})),s["a"].endLoading()})).catch((function(t){console.log(t),e.$message.error("下载失败,请联系管理员"),s["a"].endLoading()}))})).catch((function(){}))}}}]);