(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-079b3ce4"],{"51f3":function(e,t,r){"use strict";r.r(t);var s=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"app-content auto-price-wrap"},[r("el-form",{ref:"form",staticClass:"demo-form",attrs:{model:e.form,rules:e.rules,"label-width":"100px"}},[r("el-form-item",{attrs:{label:"涨价开关",prop:"riseSwitch"}},[r("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},model:{value:e.form.riseSwitch,callback:function(t){e.$set(e.form,"riseSwitch",t)},expression:"form.riseSwitch"}})],1),1==e.form.riseSwitch?[r("el-form-item",{attrs:{label:"涨价节日",prop:"festIdList"}},e._l(e.festData,(function(t,s){return r("el-checkbox",{key:t.id,attrs:{label:t.id,border:"",size:"small"},model:{value:e.form.festIdList,callback:function(t){e.$set(e.form,"festIdList",t)},expression:"form.festIdList"}},[e._v(e._s(t.name))])})),1),r("el-form-item",{attrs:{label:"涨价方式",prop:"riseType"}},[r("el-radio-group",{model:{value:e.form.riseType,callback:function(t){e.$set(e.form,"riseType",t)},expression:"form.riseType"}},[r("el-radio",{attrs:{label:"0"}},[e._v("按百分比")]),r("el-radio",{attrs:{label:"1"}},[e._v("按金额")])],1)],1),0==e.form.riseType?[r("el-form-item",{attrs:{label:"比例",prop:"riseAmount"}},[r("el-input",{staticStyle:{width:"250px"},attrs:{placeholder:"涨价10%，请输入10"},model:{value:e.form.riseAmount,callback:function(t){e.$set(e.form,"riseAmount",t)},expression:"form.riseAmount"}})],1)]:[r("el-form-item",{attrs:{label:"涨价金额",prop:"riseAmount"}},[r("el-input",{staticStyle:{width:"250px"},attrs:{placeholder:"涨价80元请输入80"},model:{value:e.form.riseAmount,callback:function(t){e.$set(e.form,"riseAmount",t)},expression:"form.riseAmount"}})],1)]]:e._e(),r("el-form-item",[r("div",{staticClass:"app-color-3"},[e._v(" 节日当天和前一天，勾选自动涨价的商品将统一按上面规则涨价。 ")])]),r("el-form-item",[r("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.submitForm("form")}}},[e._v("保存")])],1)],2)],1)},i=[],o=r("6abc"),a=(r("3337"),r("3bae"),r("62f9"),r("5880")),n={name:"auto-price",data:function(){return{form:{riseSwitch:"0",riseType:"0",festIdList:[],riseAmount:""},rules:{riseType:{required:!0,message:"涨价方式不能为空"},riseAmount:{required:!0,message:"涨价金额不能为空"}}}},computed:Object(o["a"])({},Object(a["mapGetters"])({festData:"festival"})),mounted:function(){this.init()},methods:{init:function(){this.$store.dispatch("getFestival"),this._getData()},_getData:function(){var e=this;this.$service.goods.getAutoPrice().then((function(t){e.$util.isEmpty(t)||(t.festIdList=t.festIdList.map((function(e){return e+""})),Object.keys(e.form).forEach((function(r,s){e.form[r]=t[r]})))}))},setPrice:function(){var e=this;this.$service.goods.setAutoPrice(this.form).then((function(t){e.$message.success("更新成功!")}))},submitForm:function(e){var t=this;this.$refs[e].validate((function(e){if(!e)return console.log("error submit!!"),!1;t.setPrice()}))},resetForm:function(e){this.$refs[e].resetFields()}}},l=n,c=(r("f1f5"),r("5d22")),f=Object(c["a"])(l,s,i,!1,null,null,null);t["default"]=f.exports},ed98:function(e,t,r){},f1f5:function(e,t,r){"use strict";r("ed98")}}]);