(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-2796f9e0","chunk-6a47c3b9","chunk-2d2176a6"],{1661:function(e,t,n){"use strict";n.r(t);var i=(n("c740"),n("fb6a"),n("d3b7"),n("5530")),c=(n("f1dc"),n("6e47")),a=n("2b0e");a.a.use(c.a);var s=a.a.extend({name:"DepSelector",components:{"main-page":function(){return n.e("chunk-2d0cbf31").then(n.bind(null,"4c9e"))},"app-icon":function(){return Promise.all([n.e("chunk-0a381f90"),n.e("chunk-7c0e491e")]).then(n.bind(null,"73f7"))},"c-button":function(){return n.e("chunk-2d0df078").then(n.bind(null,"87be"))},"team-tree":function(){return n.e("chunk-42f4ba39").then(n.bind(null,"1659"))}},props:{show:Boolean,selected:String,entId:String},data:function(){return{checked:"",loading:!1,depId:"-1",currentDep:{},teams:[{name:"首页",id:"-1"}],depList:[]}},created:function(){this.getSub()},methods:{clickItem:function(e){this.depId=e.id,this.getSub()},goPre:function(e){this.depId=e.id,this.getSub()},showChecked:function(e){return this.checked===e.id},goBack:function(){this.$emit("update:show",!1)},getSub:function(){var e=this;this.loading=!0;var t;return t="-1"===this.depId?JSON.parse(localStorage.getItem("ENT_INFO")).rootDepId:this.depId,this.$service.department.getSub({entId:this.entId,parentId:t}).then((function(t){var n=t.data;if(e.loading=!1,n.code===e.$global.success){if(e.currentDep=n.data.dep,"-1"===e.depId){var c=Object(i.a)(Object(i.a)({},n.data.dep),{},{hasSubDep:!0});e.depList=[c],e.teams=e.teams.slice(0,1)}else{var a=e.teams.findIndex((function(t){return t.id===e.depId}));e.depList=n.data.subDepList||[],a<0?e.teams.push(n.data.dep):e.teams=e.teams.slice(0,a+1)}e.$emit("update:dep",e.currentDep)}})).catch((function(){e.loading=!1}))},goNext:function(e){this.depId=e.id,this.checked="",this.getSub()},selectTeam:function(e){this.checked===e.id||(this.checked=e.id)},confirm:function(){""!==this.checked?(this.$emit("update:selected",this.checked),this.$emit("update:show",!1)):this.$toast("请选择部门")}},watch:{show:function(e){this.checked=e?this.selected:""}}}),d=n("2877"),o=Object(d.a)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("van-overlay",{attrs:{show:e.show,"z-index":"3000","lock-scroll":!1}},[n("div",{staticClass:"select-team w-screen h-screen overflow-auto"},[n("main-page",{attrs:{title:"所属团队","left-arrow":"",loading:e.loading},on:{"click-left":e.goBack}},[n("div",{staticClass:"px-4 pt-14 pb-16"},[n("team-tree",{attrs:{teams:e.teams},on:{"click-child":e.clickItem,"click-bread":e.goPre}}),n("div",{staticClass:"list mt-1.5"},e._l(e.depList,(function(t){return n("div",{key:t.id,staticClass:"flex items-center"},[n("div",{staticClass:"content flex-1 flex items-center mr-4",on:{click:function(n){return e.selectTeam(t)}}},[n("div",{staticClass:"radio-wrapper flex-shrink-0"},[e.showChecked(t)?n("app-icon",{attrs:{"icon-name":"radio-checked","class-name":"w-4 h-4"}}):n("app-icon",{attrs:{"icon-name":"radio","class-name":"w-4 h-4"}})],1),n("div",{staticClass:"title flex-1 truncate py-3 ml-6"},[e._v("\n                "+e._s(t.name)+e._s(t.staffNum?" ("+t.staffNum+") ":"")+"\n              ")])]),t.hasSubDep?n("div",{staticClass:"flex-shrink-0 flex items-center text-color-primary py-3",on:{click:function(n){return e.goNext(t)}}},[n("app-icon",{attrs:{"icon-name":"tree","class-name":"h-5 w-5 mr-2.5"}}),e._v("\n              下一级\n            ")],1):e._e()])})),0),n("div",{staticClass:"action fixed bottom-0 left-0 w-full px-4 py-2 z-10 bg-common-bg",on:{click:e.confirm}},[n("c-button",{attrs:{round:""}},[e._v("确定")])],1)],1)])],1)])}),[],!1,null,null,null);t.default=o.exports},c740:function(e,t,n){"use strict";var i=n("23e7"),c=n("b727").findIndex,a=n("44d2"),s="findIndex",d=!0;s in[]&&Array(1)[s]((function(){d=!1})),i({target:"Array",proto:!0,forced:d},{findIndex:function(e){return c(this,e,arguments.length>1?arguments[1]:void 0)}}),a(s)},f1dc:function(e,t,n){"use strict";n("68ef"),n("a71a")}}]);
//# sourceMappingURL=chunk-2796f9e0.c897156c.js.map