(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-014ea479"],{"51f3":function(t,e,r){"use strict";r.r(e);var i=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"app-content auto-price-wrap"},[r("el-form",{ref:"form",staticClass:"demo-form",attrs:{model:t.form,rules:t.rules,"label-width":"100px"}},[r("el-form-item",{attrs:{label:"开启自动涨价",prop:"riseSwitch"}},[r("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},model:{value:t.form.riseSwitch,callback:function(e){t.$set(t.form,"riseSwitch",e)},expression:"form.riseSwitch"}})],1),r("el-form-item",{attrs:{label:"要涨价节日",prop:"festIdList"}},t._l(t.festData,(function(e,i){return r("el-checkbox",{key:e.id,attrs:{label:e.id,border:"",size:"small"},model:{value:t.form.festIdList,callback:function(e){t.$set(t.form,"festIdList",e)},expression:"form.festIdList"}},[t._v(t._s(e.name))])})),1),r("el-form-item",{attrs:{label:"涨价方式",prop:"riseType"}},[r("el-radio-group",{model:{value:t.form.riseType,callback:function(e){t.$set(t.form,"riseType",e)},expression:"form.riseType"}},[r("el-radio",{attrs:{label:"0"}},[t._v("按百分比")]),r("el-radio",{attrs:{label:"1"}},[t._v("按金额")])],1)],1),0==t.form.riseType?[r("el-form-item",{attrs:{label:"比例",prop:"riseAmount"}},[r("el-input",{staticStyle:{width:"250px"},attrs:{placeholder:"涨价10%，请输入10"},model:{value:t.form.riseAmount,callback:function(e){t.$set(t.form,"riseAmount",e)},expression:"form.riseAmount"}})],1)]:[r("el-form-item",{attrs:{label:"金额",prop:"riseAmount"}},[r("el-input",{staticStyle:{width:"250px"},attrs:{placeholder:"涨价80元请输入80"},model:{value:t.form.riseAmount,callback:function(e){t.$set(t.form,"riseAmount",e)},expression:"form.riseAmount"}})],1)],r("el-form-item",[r("div",{staticClass:"app-color-3"},[t._v(" 提示：在节日的前一天和当天，商城设置自动涨价的商品将会全部统一涨价。过后自动恢复原价。 ")])]),r("el-form-item",[r("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitForm("form")}}},[t._v("保存")])],1)],2)],1)},o=[],s=(r("3546"),r("0e8d"),r("fdc1"),r("ea51"),r("a94a"),r("639b"),r("4f5b"),r("b287"),r("9d37")),a=r("5880");function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){Object(s["a"])(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l={name:"auto-price",data:function(){return{form:{riseSwitch:"0",riseType:"0",festIdList:[],riseAmount:""},rules:{}}},computed:c({},Object(a["mapGetters"])({festData:"festival"})),mounted:function(){this.init()},methods:{init:function(){this.$store.dispatch("getFestival"),this._getData()},_getData:function(){var t=this;this.$service.goods.getAutoPrice().then((function(e){t.$util.isEmpty(e.data)||(e.data.festIdList=e.data.festIdList.map((function(t){return t+""})),Object.keys(t.form).forEach((function(r,i){t.form[r]=e.data[r]})))}))},setPrice:function(){var t=this;this.$service.goods.setAutoPrice(this.form).then((function(e){t.$message.error("更新成功!")}))},submitForm:function(t){var e=this;this.$refs[t].validate((function(t){if(!t)return console.log("error submit!!"),!1;e.setPrice()}))},resetForm:function(t){this.$refs[t].resetFields()}}},f=l,u=(r("f1f5"),r("5511")),m=Object(u["a"])(f,i,o,!1,null,null,null);e["default"]=m.exports},"66f9":function(t,e,r){},f1f5:function(t,e,r){"use strict";var i=r("66f9"),o=r.n(i);o.a}}]);