(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d226cbb"],{e9d5:function(t,e,o){"use strict";o.r(e);var s=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"app-container"},[o("div",{staticClass:"app-form"},[o("el-form",{ref:"dataForm",attrs:{rules:t.rules,model:t.form,"label-position":"right","label-width":"200px"}},[o("div",{staticClass:"app-form-group"},[o("div",{staticClass:"app-form-ti"},[t._v("基本设置")]),o("div",{staticClass:"padding-top-lg"},[o("el-form-item",{attrs:{label:"活动商品",prop:"title"}},[o("selgoods",{attrs:{multiple:!1,tips:"选择商品",modal:!0},on:{change:t.selgoods},model:{value:t.form.goods_id,callback:function(e){t.$set(t.form,"goods_id",e)},expression:"form.goods_id"}})],1),o("el-form-item",{attrs:{label:"折扣类型",prop:"type"}},[o("el-radio-group",{model:{value:t.form.type,callback:function(e){t.$set(t.form,"type",e)},expression:"form.type"}},[o("el-radio",{attrs:{label:1}},[t._v("固定金额")]),o("el-radio",{attrs:{label:2}},[t._v("指定折扣")])],1)],1),1==t.form.type?o("el-form-item",{attrs:{label:"活动价格",prop:"price"}},[o("el-input",{staticClass:"form-input",attrs:{type:"number"},model:{value:t.form.price,callback:function(e){t.$set(t.form,"price",e)},expression:"form.price"}},[o("template",{slot:"append"},[t._v("元")])],2)],1):t._e(),2==t.form.type?o("el-form-item",{attrs:{label:"活动折扣",prop:"discount"}},[o("el-input",{staticClass:"form-input",attrs:{type:"number",min:.01,max:10},model:{value:t.form.discount,callback:function(e){t.$set(t.form,"discount",e)},expression:"form.discount"}},[o("template",{slot:"append"},[t._v("折")])],2)],1):t._e(),o("el-form-item",{attrs:{label:"商品原价",prop:"price"}},[o("el-input",{staticClass:"form-input",attrs:{type:"number",disabled:!0},model:{value:t.goods.price,callback:function(e){t.$set(t.goods,"price",e)},expression:"goods.price"}},[o("template",{slot:"append"},[t._v("元")])],2)],1),o("el-form-item",{attrs:{label:"状态",prop:"status"}},[o("el-radio-group",{model:{value:t.form.status,callback:function(e){t.$set(t.form,"status",e)},expression:"form.status"}},[o("el-radio",{attrs:{label:1}},[t._v("正常")]),o("el-radio",{attrs:{label:0}},[t._v("禁用")])],1)],1)],1)]),o("div",{staticClass:"padding-xl flex justify-center"},[o("el-button",{on:{click:t.onBack}},[t._v("返回")]),o("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submit()}}},[t._v("提交")])],1)])],1),o("copyright")],1)},i=[],a=o("7f70"),r=o("8327"),l=o("1fe5"),n={name:"SeckillGoodsPost",components:{selgoods:l["a"]},data:function(){return{rules:{},form:{},id:"",activity_list:[],goods:{price:""}}},computed:Object(a["a"])({},Object(r["b"])(["config"])),created:function(){this.$route.query.id&&(this.id=this.$route.query.id),this.resetForm(),this.init()},methods:{selgoods:function(t){t.list.length>0&&(this.goods=t.list[0])},init:function(){var t=this;this.api.get("seckill/goods/detail",{id:this.id}).then((function(e){1==e.code&&(t.form=e.data)})),this.api.get("seckill/index/getActivity").then((function(e){1==e.code&&(t.activity_list=e.data.list)}))},onBack:function(){this.$router.go(-1)},submit:function(){var t=this;this.$refs["dataForm"].validate((function(e){e&&t.api.post("seckill/goods/post",t.form).then((function(e){1==e.code?(t.$util.success(e.message),t.resetForm(),t.onBack()):t.$util.error(e.message)}))}))},resetForm:function(){this.form={goods_id:"",price:"",discount:"",status:1,type:1,is_fenxiao:1}}}},c=n,p=o("3d7a"),d=Object(p["a"])(c,s,i,!1,null,null,null);e["default"]=d.exports}}]);