(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3feb20bc"],{1125:function(t,e,r){"use strict";var i=r("c31d"),n=r("d282"),a=r("1b10"),s=r("f253"),o=Object(n["a"])("area"),c=o[0],u=o[1],l="000000";function d(t){return"9"===t[0]}function h(t,e){var r=t.$slots,i=t.$scopedSlots,n={};return e.forEach((function(t){i[t]?n[t]=i[t]:r[t]&&(n[t]=function(){return r[t]})})),n}e["a"]=c({props:Object(i["a"])({},a["b"],{value:String,areaList:{type:Object,default:function(){return{}}},columnsNum:{type:[Number,String],default:3},isOverseaCode:{type:Function,default:d},columnsPlaceholder:{type:Array,default:function(){return[]}}}),data:function(){return{code:this.value,columns:[{values:[]},{values:[]},{values:[]}]}},computed:{province:function(){return this.areaList.province_list||{}},city:function(){return this.areaList.city_list||{}},county:function(){return this.areaList.county_list||{}},displayColumns:function(){return this.columns.slice(0,+this.columnsNum)},placeholderMap:function(){return{province:this.columnsPlaceholder[0]||"",city:this.columnsPlaceholder[1]||"",county:this.columnsPlaceholder[2]||""}}},watch:{value:function(t){this.code=t,this.setValues()},areaList:{deep:!0,handler:"setValues"},columnsNum:function(){var t=this;this.$nextTick((function(){t.setValues()}))}},mounted:function(){this.setValues()},methods:{getList:function(t,e){var r=[];if("province"!==t&&!e)return r;var i=this[t];if(r=Object.keys(i).map((function(t){return{code:t,name:i[t]}})),e&&(this.isOverseaCode(e)&&"city"===t&&(e="9"),r=r.filter((function(t){return 0===t.code.indexOf(e)}))),this.placeholderMap[t]&&r.length){var n="";"city"===t?n=l.slice(2,4):"county"===t&&(n=l.slice(4,6)),r.unshift({code:""+e+n,name:this.placeholderMap[t]})}return r},getIndex:function(t,e){var r="province"===t?2:"city"===t?4:6,i=this.getList(t,e.slice(0,r-2));this.isOverseaCode(e)&&"province"===t&&(r=1),e=e.slice(0,r);for(var n=0;n1&&!t.assignType,expression:"(assignArr.length > 1) && !assignType"}],staticClass:"assignType",class:{requiredBorder:!t.activeType&&t.checkRequired},on:{click:function(t){t.stopPropagation()}}},t._l(t.assignArr,(function(e){return i("div",{key:e.type,class:{activeAssign:t.activeType==e.type},on:{click:function(r){return t.chooseAssign(e)}}},[t._v(t._s(e.text))])})),0)])],1)},a=[],s=r("ade3"),o=(r("e17f"),r("2241")),c=(r("5852"),r("d961")),u=(r("3c32"),r("417e")),l=(r("a909"),r("3acc")),d=(r("4056"),r("44bf")),h=(r("4ddd"),r("9f14")),p=(r("a44c"),r("e27c")),m=(r("a9e3"),r("b0c0"),r("d81d"),r("ac1f"),r("1276"),r("d3b7"),r("159b"),r("b64b"),r("a15b"),r("a434"),r("4de4"),r("11fe")),f={props:{value:{type:Boolean,default:!1},designerlist:{type:String},title:{type:String,default:"指派人员"},select:{type:Number,default:0},isdepart:{type:Number|String,default:1},showval:{type:String,default:""},customerid:{type:String|Number,default:""},assignType:{type:String,default:""}},components:(i={},Object(s["a"])(i,p["a"].name,p["a"]),Object(s["a"])(i,h["a"].name,h["a"]),Object(s["a"])(i,d["a"].name,d["a"]),Object(s["a"])(i,l["a"].name,l["a"]),Object(s["a"])(i,u["a"].name,u["a"]),Object(s["a"])(i,c["a"].name,c["a"]),Object(s["a"])(i,o["a"].Component.name,o["a"].Component),i),data:function(){return{img:[r("ee87")],val:"",newval:"",activeType:"",designarr:[],nowclickid:"",falg:!1,result:[],keyword:"",showDialog:!1,datashow:!0,checkRequired:!1,valArr:[],designerarr:[],allDesignerArr:[],assignArr:[]}},watch:{value:{handler:function(t){t?(this.assignArr.length||(this.showDialog=!1,this.activeType=""),1==this.assignArr.length&&(this.showDialog=!1,1!=this.assignArr.length||this.assignType||(this.activeType=this.assignArr[0]["type"])),this.assignArr.length>1&&!this.assignType&&"指派人员"==this.title&&(this.showDialog=!0)):(this.activeType="",this.showDialog=!1)},immediate:!0,deep:!0},designerlist:function(t,e){if(this.datashow=!0,0==this.select||4==this.select){if(this.keyword){var r=JSON.parse(t);this.designarr.designer=r,this.designarr.child_org=[]}else this.designarr=JSON.parse(t);if(4==this.select){var i=JSON.parse(t);this.getAllDesigner(i)}}else this.designarr=JSON.parse(t)},keyword:function(t){t||(this.datashow=!1,this.$emit("onSearch",{val:"",type:this.isdepart}))},showval:{handler:function(t){this.valArr=t?t.split(",").map((function(t){return parseInt(t)})):[]},immediate:!0}},methods:{cancelAssign:function(){this.activeType="",this.showDialog=!1},chooseAssign:function(t){this.activeType=t.type,this.showDialog=!1},getAssignTypeApi:function(){var t=this;Object(m["P"])({}).then((function(e){if(0==e.data.code){var r=e.data.data;if(!Array.isArray(r)&&r instanceof Object){var i=[];Object.keys(r).forEach((function(t){i.push({text:r[t],type:t})})),t.assignArr=i}}}))},ischeckedObj:function(){return this.designarr.child_org&&this.designarr.child_org instanceof Array?!this.designarr.child_org.length:this.designarr.child_org&&this.designarr.child_org instanceof Object?!Object.keys(this.designarr.child_org).length:void 0},getChecked:function(t){var e=t,r=e[e.length-1];this.setDesignerVal(r,e),t.length&&t.join(",")!=this.showval&&this.checkRepeatApi(t[t.length-1])},setDesignerVal:function(t,e){for(var r=this,i=[],n=function(t){var n=r.allDesignerArr.filter((function(r){return r.id==e[t]}));n.length&&i.push({index:t,id:e[t]})},a=0;a1&&this.valArr.splice(i[0].index,1)},getAllDesigner:function(t){var e=this;t.child_org&&Array.isArray(t.child_org)&&t.child_org.forEach((function(t){t.designer&&t.designer.length&&t.designer.forEach((function(t){2==t.org_type&&e.allDesignerArr.push(t)})),t.child_org&&Array.isArray(t.child_org)&&t.child_org.forEach((function(t){e.getAllDesigner(t)})),t.child_org&&!Array.isArray(t.child_org)&&Object.keys(t.child_org).forEach((function(r){e.getAllDesigner(t.child_org[r])}))})),t.child_org&&!Array.isArray(t.child_org)&&Object.keys(t.child_org).forEach((function(r){t.child_org[r].designer&&t.child_org[r].designer.length&&t.child_org[r].designer.forEach((function(t){2==t.org_type&&e.allDesignerArr.push(t)})),t.child_org[r].child_org&&Array.isArray(t.child_org[r].child_org)&&t.child_org[r].child_org.forEach((function(t){e.getAllDesigner(t)})),t.child_org[r].child_org&&!Array.isArray(t.child_org[r].child_org)&&Object.keys(t.child_org[r].child_org).forEach((function(i){e.getAllDesigner(t.child_org[r].child_org[i])}))})),t.designer.forEach((function(t){2==t.org_type&&e.allDesignerArr.push(t)}))},onSearch:function(){this.datashow=!1,this.$emit("onSearch",{val:this.keyword,type:this.isdepart})},checkRepeatApi:function(t){var e=this;this.customerid&&t&&Object(m["i"])({customer_id:this.customerid,employee_id:t}).then((function(t){0==t.data.code&&0==t.data.data&&(e.valArr.splice(e.valArr.length-1,1),e.$toast("该员工名下已有该客户"))}))},dothis:function(){},submit:function(){if(1==this.isdepart){if("指派人员"==this.title){if(this.assignArr.length&&!this.assignType&&!this.activeType)return this.$toast("请选择指派类型"),!1;this.$parent.showPopup=!1,this.$parent.loadFlag=!0,this.$emit("submit",this.valArr,this.activeType,this.assignType)}else if("选择直播人员"==this.title)if(1==this.select){if(!this.result.length)return this.$toast("直播人员不能为空!"),!1;this.$parent.showlive=!1,this.$parent.loadFlag=!0;for(var t=[],e=0;e