(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-50a4"],{"+eU4":function(t,e,a){"use strict";var l=a("Fhi4");a.n(l).a},"2f65":function(t,e,a){},"7mY3":function(t,e,a){"use strict";var l=a("2f65");a.n(l).a},"9GgJ":function(t,e,a){"use strict";var l={name:"XrHeader",components:{},props:{iconClass:[String,Array],iconColor:String,label:String,showSearch:{type:Boolean,default:!1},searchIconType:{type:String,default:"text"},placeholder:{type:String,default:"请输入内容"},ftTop:{type:String,default:"15px"},content:[String,Number],inputAttr:{type:Object,default:function(){}}},data:function(){return{search:""}},computed:{},watch:{content:{handler:function(){this.search!=this.content&&(this.search=this.content)},immediate:!0}},mounted:function(){},beforeDestroy:function(){},methods:{inputChange:function(){this.$emit("update:content",this.search)},searchClick:function(){this.$emit("search",this.search)}}},i=(a("7mY3"),a("KHd+")),s=Object(i.a)(l,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("flexbox",{staticClass:"xr-header"},[t.iconClass?a("div",{staticClass:"xr-header__icon",style:{backgroundColor:t.iconColor}},[a("i",{class:t.iconClass})]):t._e(),t._v(" "),a("div",{staticClass:"xr-header__label"},[t.$slots.label?t._t("label"):[t._v(t._s(t.label))]],2),t._v(" "),t.showSearch?a("el-input",t._b({staticClass:"xr-header__search",class:{"is-text":"text"===t.searchIconType},style:{"margin-top":t.ftTop},attrs:{placeholder:t.placeholder},on:{input:t.inputChange},nativeOn:{keyup:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.searchClick(e):null}},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}},"el-input",t.inputAttr,!1),["text"===t.searchIconType?a("el-button",{attrs:{slot:"append",type:"primary"},nativeOn:{click:function(e){return t.searchClick(e)}},slot:"append"},[t._v("搜索")]):a("el-button",{attrs:{slot:"append",icon:"el-icon-search"},nativeOn:{click:function(e){return t.searchClick(e)}},slot:"append"})],1):t._e(),t._v(" "),a("div",{staticClass:"xr-header__ft",style:{top:t.ftTop}},[t._t("ft")],2)],1)},[],!1,null,"acb6d756",null);s.options.__file="index.vue";e.a=s.exports},AueS:function(t,e,a){},Fhi4:function(t,e,a){},Flnf:function(t,e,a){},"JT+4":function(t,e,a){"use strict";a.r(e);var l=a("KTTK"),i=a("6iAj"),s=a("wd/R"),n=a.n(s),r=a("UCfG"),c=a("HHBN"),o=a("7Qib"),u={name:"AddGoal",components:{XhStructureCell:r.a,XhUserCell:c.a},props:{visible:{type:Boolean,default:!1},type:String},data:function(){return{loading:!1,typeSelect:1,dateSelect:"",selectDepOrUser:[],totalGoal:"0",quarterList:[]}},computed:{rangeLabel:function(){return"user"===this.type?"考核人员":"考核部门"}},watch:{visible:function(t){t&&this.resetData()}},mounted:function(){},beforeDestroy:function(){},methods:{structureChange:function(t){this.selectDepOrUser=t.value||[]},userChange:function(t){this.selectDepOrUser=t.value||[]},sureClick:function(){var t=this;if(this.selectDepOrUser.length){for(var e={type:"user"==this.type?3:2,year:this.dateSelect,status:this.typeSelect,yeartarget:this.totalGoal},a=0;aDate.now()}},loading:!1,tableHeight:document.documentElement.clientHeight-290,tabType:"department",dateSelect:"",typeSelect:1,structuresProps:{children:"children",label:"label",value:"id"},deptList:[],structuresSelectValue:[],userOptions:[],userSelectValue:"",isEdit:!1,list:[],fieldList:[{field:"name",name:""},{field:"yeartarget",name:"全年"},{field:"first",name:"第一季度"},{field:"january",name:"1月"},{field:"february",name:"2月"},{field:"march",name:"3月"},{field:"second",name:"第二季度"},{field:"april",name:"4月"},{field:"may",name:"5月"},{field:"june",name:"6月"},{field:"third",name:"第三季度"},{field:"july",name:"7月"},{field:"august",name:"8月"},{field:"september",name:"9月"},{field:"fourth",name:"第四季度"},{field:"october",name:"10月"},{field:"november",name:"11月"},{field:"december",name:"12月"}],addViewShow:!1}},computed:{},mounted:function(){var t=this;window.onresize=function(){t.tableHeight=document.documentElement.clientHeight-290},this.dateSelect=n()().year().toString(),this.getDeptList()},methods:{tabTypeClick:function(){this.isEdit=!1,"department"===this.tabType?this.getAhievementList():"user"===this.tabType&&(this.getUserList(),this.getAhievementListForUser())},getAhievementList:function(){var t=this;this.loading=!0;var e=this.structuresSelectValue[this.structuresSelectValue.length-1];Object(i.i)({year:this.dateSelect,type:this.typeSelect,structure_id:e}).then(function(e){t.list=e.data.map(function(e){return e.name=e.name,t.getShowItem(e)}),t.list.length&&t.getSubTotalModel(),t.loading=!1}).catch(function(){t.loading=!1})},getShowItem:function(t){return t.first=this.calculateFirst(t),t.second=this.calculateSecond(t),t.third=this.calculateThird(t),t.fourth=this.calculateFourth(t),t.yeartarget=this.calculateAll(t),t},getSubTotalModel:function(){for(var t={name:"目标合计",january:"0.00",february:"0.00",march:"0.00",april:"0.00",may:"0.00",june:"0.00",july:"0.00",august:"0.00",september:"0.00",october:"0.00",november:"0.00",december:"0.00",yeartarget:"0.00",first:"0.00",second:"0.00",third:"0.00",fourth:"0.00",ignore:!0},e=0;e=2&&this.calculateSubTotal(e))},calculateSubTotal:function(t){for(var e=this.list[this.list.length-1],a="0",l=0;l0&&(t.structuresSelectValue=[e.data[0].id],t.tabTypeClick())})},structuresValueChange:function(t){"department"===this.tabType?this.userSelectValue&&(this.userSelectValue="",this.userOptions=[]):"user"===this.tabType&&(this.userSelectValue="",this.userOptions=[],this.getUserList())},getUserList:function(){var t=this,e={pageType:0};this.structuresSelectValue.length>0?(e.structure_id=this.structuresSelectValue[this.structuresSelectValue.length-1],Object(l.w)(e).then(function(e){t.userOptions=e.data}).catch(function(){})):(this.userSelectValue="",this.userOptions=[])},getAhievementListForUser:function(){var t=this;this.loading=!0;var e=this.structuresSelectValue[this.structuresSelectValue.length-1];Object(i.j)({year:this.dateSelect,type:this.typeSelect,structure_id:e,user_id:this.userSelectValue}).then(function(e){t.list=e.data.map(function(e){return e.name=e.name,t.getShowItem(e)}),t.list.length&&t.getSubTotalModel(),t.loading=!1}).catch(function(){t.loading=!1})},handleClick:function(t){var e=this;if("search"==t)this.updateAhievementList();else if("edit"==t)this.isEdit=!0;else if("export"==t){var a=this.dateSelect+" 年"+{department:"部门目标",user:"员工目标"}[this.tabType]+".xlsx";Object(o.f)(a,"task-set-table")}else if("save"==t){this.loading=!0;var l=this.list.filter(function(t,e,a){return!t.ignore});Object(i.k)(l).then(function(t){e.$message.success("操作成功"),e.loading=!1,e.isEdit=!1,e.updateAhievementList()}).catch(function(){e.loading=!1})}else"cancel"==t&&(this.updateAhievementList(),this.isEdit=!1)},updateAhievementList:function(){"department"===this.tabType?this.getAhievementList():"user"===this.tabType&&this.getAhievementListForUser()},cellStyle:function(t){t.row,t.column;var e=t.rowIndex,a=t.columnIndex;return e===this.list.length-1?{backgroundColor:"#FAF9F6"}:1==a||2==a||6==a||10==a||14==a?{backgroundColor:"#E5F4FE",textAlign:"center"}:{textAlign:"center"}},deleteAchievement:function(t,e){var a=this;this.$confirm("确定删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){a.loading=!0,Object(i.h)({achievement_id:t.achievement_id}).then(function(t){a.loading=!1,a.$message.success("操作成功"),a.list.splice(e,1),a.list.pop(),a.list.length&&a.getSubTotalModel()}).catch(function(){a.loading=!1})}).catch(function(){a.$message({type:"info",message:"已取消操作"})})}}},f=(a("cKNd"),Object(d.a)(h,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"main-container"},[a("div",{staticClass:"tabs-bar"},[a("el-tabs",{on:{"tab-click":t.tabTypeClick},model:{value:t.tabType,callback:function(e){t.tabType=e},expression:"tabType"}},[a("el-tab-pane",{attrs:{label:"部门目标设置",name:"department"}}),t._v(" "),a("el-tab-pane",{attrs:{label:"员工目标设置",name:"user"}})],1)],1),t._v(" "),a("div",{staticClass:"handle-bar"},[a("el-date-picker",{attrs:{clearable:!1,type:"year","value-format":"yyyy",placeholder:"选择年"},model:{value:t.dateSelect,callback:function(e){t.dateSelect=e},expression:"dateSelect"}}),t._v(" "),a("el-select",{model:{value:t.typeSelect,callback:function(e){t.typeSelect=e},expression:"typeSelect"}},t._l([{label:"合同金额",value:1},{label:"回款金额",value:2}],function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),t._v(" "),a("el-cascader",{attrs:{options:t.deptList,"show-all-levels":!1,props:t.structuresProps,placeholder:"选择部门","change-on-select":""},on:{change:t.structuresValueChange},model:{value:t.structuresSelectValue,callback:function(e){t.structuresSelectValue=e},expression:"structuresSelectValue"}}),t._v(" "),"user"===t.tabType?a("el-select",{attrs:{clearable:!0,placeholder:"选择员工"},model:{value:t.userSelectValue,callback:function(e){t.userSelectValue=e},expression:"userSelectValue"}},t._l(t.userOptions,function(t){return a("el-option",{key:t.id,attrs:{label:t.realname,value:t.id}})})):t._e(),t._v(" "),a("el-button",{attrs:{type:"primary"},nativeOn:{click:function(e){t.handleClick("search")}}},[t._v("搜索")]),t._v(" "),t.isEdit?t._e():a("div",{staticStyle:{float:"right"}},[a("el-button",{staticClass:"xr-btn--orange",attrs:{type:"primary"},nativeOn:{click:function(e){t.addViewShow=!0}}},[t._v("设置目标")]),t._v(" "),t.list.length?a("el-button",{attrs:{type:"primary"},nativeOn:{click:function(e){t.handleClick("edit")}}},[t._v("编辑")]):t._e(),t._v(" "),t.list.length?a("el-button",{attrs:{type:"primary"},nativeOn:{click:function(e){t.handleClick("export")}}},[t._v("导出")]):t._e()],1),t._v(" "),t.isEdit?a("div",{staticStyle:{float:"right"}},[t.list.length>0?a("el-button",{attrs:{type:"primary"},nativeOn:{click:function(e){t.handleClick("save")}}},[t._v("保存")]):t._e(),t._v(" "),a("el-button",{attrs:{type:"primary"},nativeOn:{click:function(e){t.handleClick("cancel")}}},[t._v("取消")])],1):t._e()],1),t._v(" "),a("div",{staticClass:"content"},[a("el-table",{attrs:{id:"task-set-table",data:t.list,height:t.tableHeight,"cell-style":t.cellStyle,border:"","header-align":"center",align:"center","highlight-current-row":""}},t._l(t.fieldList,function(e,l){return a("el-table-column",{key:l,attrs:{fixed:0==l,prop:e.field,label:e.name,"show-overflow-tooltip":"",width:"150"},scopedSlots:t._u([{key:"default",fn:function(l){return["name"===e.field&&l.$index!==t.list.length-1?a("div",{staticClass:"table-show-item"},[a("i",{staticClass:"wk wk-delete",class:{"is-show":t.isEdit},on:{click:function(e){t.deleteAchievement(l.row,l.$index)}}}),t._v("\n "+t._s(l.row[e.field])+"\n ")]):"name"!==e.field&&"yeartarget"!==e.field&&"first"!==e.field&&"second"!==e.field&&"third"!==e.field&&"fourth"!==e.field&&t.isEdit&&l.$index!==t.list.length-1?a("el-input",{attrs:{type:"number"},on:{input:function(e){t.handleInputEdit("change",l)},blur:function(e){t.handleInputEdit("blur",l)}},model:{value:l.row[e.field],callback:function(a){t.$set(l.row,e.field,a)},expression:"scope.row[item.field]"}}):a("div",{staticClass:"table-show-item"},[t._v("\n "+t._s(l.row[e.field])+"\n ")])]}}])})}))],1),t._v(" "),a("add-goal",{attrs:{visible:t.addViewShow,type:t.tabType},on:{"update:visible":function(e){t.addViewShow=e},success:t.tabTypeClick}})],1)},[],!1,null,"35520ca3",null));f.options.__file="TaskSetStatistics.vue";var m={name:"BizGoals",components:{TaskSetStatistics:f.exports,XrHeader:a("9GgJ").a},data:function(){return{}},created:function(){},methods:{}},v=(a("XGUj"),Object(d.a)(m,function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"system-customer"},[e("xr-header",{attrs:{"icon-class":"wk wk-customer","icon-color":"#2362FB",label:"业绩目标设置"}}),this._v(" "),e("div",{staticClass:"customer-content"},[e("div",{staticClass:"system-view-table"},[e("task-set-statistics")],1)])],1)},[],!1,null,"7ce21fd1",null));v.options.__file="index.vue";e.default=v.exports},XGUj:function(t,e,a){"use strict";var l=a("AueS");a.n(l).a},cKNd:function(t,e,a){"use strict";var l=a("Flnf");a.n(l).a}}]);