webpackJsonp([46],{"/2D8":function(t,e){},tPY2:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("mvHQ"),l=a.n(i),n=a("woOf"),s=a.n(n),c=a("P9l9"),r=a("Ch4/"),o={name:"GuideSetting",data:function(){return{loading:!1,activeName:"first",settingData:{editClerkFlag:0,addClerkFlag:0,delClerkFlag:0,checked:[]},allApps:[]}},created:function(){this.getSetting()},methods:{getSetting:function(){var t=this;Object(c.a)("/haoban-manage3-web/application-open-close-list",{}).then(function(e){var a=e.data||{},i=a.errorCode,l=a.result;if(1!=i)return r.a.errorMsg(e.data);var n=l||{},c=n.allList,o=n.clerkEditInfo;c=Array.isArray(c)?c:[],t.allApps=c,t.settingData.checked=c.filter(function(t){return 1==t.openFlag}).map(function(t){return t.applicationId}),s()(t.settingData,o)})},onSave:function(){var t=this;this.loading=!0;var e=this.settingData,a=e.editClerkFlag,i=e.addClerkFlag,n=e.delClerkFlag,s=e.checked,o={};if("first"==this.activeName)o={editClerkFlag:a,addClerkFlag:i,delClerkFlag:n};else if("second"==this.activeName){var d=this.allApps.map(function(t){return{applicationId:t.applicationId,openFlag:s.includes(t.applicationId)?1:0}});o={dataJson:l()(d)}}({first:function(t){return Object(c.f)("/haoban-manage3-web/save-clerk-edit-flag",t)},second:function(t){return Object(c.f)("/haoban-manage3-web/open-or-close",t)}})[this.activeName](o).then(function(e){if(1!=(e.data||{}).errorCode)return r.a.errorMsg(e.data);t.$message.success("保存成功")}).finally(function(){setTimeout(function(){return t.loading=!1},100)})}}},d={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-tabs",{model:{value:t.activeName,callback:function(e){t.activeName=e},expression:"activeName"}},[a("el-tab-pane",{attrs:{label:"导购操作权限设置",name:"first"}},[a("div",{staticClass:"guide-setting"},[a("div",{staticClass:"guide-auth-list"},[a("div",{staticClass:"guide-auth-item"},[a("span",{staticClass:"auth-item-label"},[t._v("允许编辑导购信息")]),t._v(" "),a("el-switch",{attrs:{"active-value":1,"inactive-value":0},model:{value:t.settingData.editClerkFlag,callback:function(e){t.$set(t.settingData,"editClerkFlag",e)},expression:"settingData.editClerkFlag"}})],1),t._v(" "),a("div",{staticClass:"guide-auth-item"},[a("span",{staticClass:"auth-item-label"},[t._v("允许店长添加导购")]),t._v(" "),a("el-switch",{attrs:{"active-value":1,"inactive-value":0},model:{value:t.settingData.addClerkFlag,callback:function(e){t.$set(t.settingData,"addClerkFlag",e)},expression:"settingData.addClerkFlag"}})],1),t._v(" "),a("div",{staticClass:"guide-auth-item"},[a("span",{staticClass:"auth-item-label"},[t._v("允许店长删除导购")]),t._v(" "),a("el-switch",{attrs:{"active-value":1,"inactive-value":0},model:{value:t.settingData.delClerkFlag,callback:function(e){t.$set(t.settingData,"delClerkFlag",e)},expression:"settingData.delClerkFlag"}})],1)]),t._v(" "),t.$getButtonLimit(t.$buttonCode.saveGuideSetting)?a("el-button",{staticClass:"save-btn",attrs:{"limit-code":t.$buttonCode.saveGuideSetting,loading:t.loading,type:"primary"},on:{click:t.onSave}},[t._v("保存")]):t._e()],1)]),t._v(" "),a("el-tab-pane",{attrs:{label:"应用可见权限设置",name:"second"}},[a("div",{staticClass:"guide-setting"},[a("p",{staticClass:"app-auth-tip"},[t._v("设置导购可见应用")]),t._v(" "),a("el-row",[a("el-checkbox-group",{model:{value:t.settingData.checked,callback:function(e){t.$set(t.settingData,"checked",e)},expression:"settingData.checked"}},t._l(t.allApps,function(e){return a("el-col",{key:e.applicationId,staticStyle:{"margin-bottom":"12px"},attrs:{span:3}},[a("el-checkbox",{attrs:{label:e.applicationId}},[t._v(t._s(e.applicationName))])],1)}),1)],1),t._v(" "),t.$getButtonLimit(t.$buttonCode.saveAppsVisible)?a("el-button",{staticClass:"save-btn",attrs:{"limit-code":t.$buttonCode.saveAppsVisible,loading:t.loading,type:"primary"},on:{click:t.onSave}},[t._v("保存")]):t._e()],1)])],1)},staticRenderFns:[]};var u=a("VU/8")(o,d,!1,function(t){a("/2D8")},"data-v-d4fe1c92",null);e.default=u.exports}});