(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2c18072a","chunk-2d22271a"],{"183b":function(t,i,s){"use strict";s.r(i);var n=function(){var t=this,i=t.$createElement,s=t._self._c||i;return s("div",{staticClass:"app-content"},[s("div",{staticClass:"list-wrap"},[s("div",{staticClass:"list-tit"},[s("div",[t._v("客户等级")]),s("div",{class:[t.isModify?"list-tit-inp":""]},[t._v("成长值")]),s("div",{class:[t.isModify?"list-tit-inp":""]},[t._v("折扣")]),t.isModify?s("div",[t._v("操作")]):t._e()]),t._l(t.list,(function(i,n){return s("div",{key:n,staticClass:"list"},[s("div",{staticClass:"list-vip"},[s("span",[t._v(t._s(n+1))])]),s("div",{staticClass:"list-growth"},[t.isModify?s("input",{directives:[{name:"model",rawName:"v-model",value:i.growth,expression:"item.growth"}],staticClass:"setting-inp",attrs:{type:"text"},domProps:{value:i.growth},on:{input:function(s){s.target.composing||t.$set(i,"growth",s.target.value)}}}):s("span",{staticClass:"setting-span"},[t._v(t._s(i.growth))])]),s("div",{staticClass:"list-discount"},[t.isModify?s("input",{directives:[{name:"model",rawName:"v-model",value:i.discount,expression:"item.discount"}],staticClass:"setting-inp",attrs:{type:"text"},domProps:{value:i.discount},on:{input:function(s){s.target.composing||t.$set(i,"discount",s.target.value)}}}):s("span",{staticClass:"setting-span"},[t._v(t._s(i.discount))])]),t.isModify?s("div",{staticClass:"list-option",on:{click:function(i){return t.delFn(n)}}},[s("i",{staticClass:"iconfont iconshanchu1"})]):t._e()])}))],2),t.isModify?s("div",{staticClass:"prompt-text"},[t._v(" 提交后不能再修改，请确认后提交。 ")]):t._e(),t.isModify?s("div",{staticClass:"btn-wrap"},[s("el-button",{on:{click:t.addFn}},[t._v("添加")]),s("el-button",{staticClass:"primary-btn",attrs:{type:"primary"},on:{click:t.showPromptFn}},[t._v("提交")])],1):t._e()])},e=[],a=(s("bf2f"),s("cf45")),o={name:"level-setting",data:function(){return{isModify:!1,list:[],addList:{level:0,growth:0,discount:0}}},created:function(){this.init()},methods:{init:function(){this._list()},_list:function(){var t=this;this.$service.level.list().then((function(i){if(t.$util.isEmpty(i))return!1;t.isModify=0!=i.gradeSwitch,t.list=Object(a["bubbleSort"])(i.list)}))},delFn:function(t){this.list.splice(t,1),this.$message.success("删除成功!")},addFn:function(){var t=JSON.parse(JSON.stringify(this.addList));t.level=this.list.length+1,this.list.push(t)},confirmFn:function(){var t=this;for(var i in this.list)this.list[i].level=parseInt(i)+1;var s=[];for(var n in this.list){var e=this.list[n],a=e.level,o=e.growth,l=e.discount;s.push([a,o,l])}this.$service.level.updateLevel({list:s}).then((function(i){t.isModify=!1,t.$message.success("设置成功!"),t.showPrompt=!1}))},showPromptFn:function(){var t=this;this.$confirm("提交后不能再修改，请谨慎操作。 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.confirmFn()}))}}},l=o,c=(s("3b72"),s("5d22")),r=Object(c["a"])(l,n,e,!1,null,"04a29ef9",null);i["default"]=r.exports},"3b72":function(t,i,s){"use strict";s("a0ca")},a0ca:function(t,i,s){},cf45:function(t,i,s){"use strict";s.r(i),s.d(i,"bubbleSort",(function(){return n}));s("5d08"),s("27ae");function n(t){if("Array"===Object.prototype.toString.call(t).slice(8,-1)){for(var i,s=t.length,n=0;n<s-1;n++)for(var e=s-1;e>=n;e--)t[e-1]&&t[e].level<t[e-1].level&&(i=t[e],t[e]=t[e-1],t[e-1]=i);return t}return"array is not an Array!"}i["default"]={bubbleSort:n}}}]);