(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d208aa4"],{a681:function(t,e,i){"use strict";i.r(e);var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"app-container"},[i("div",{staticClass:"app-form"},[i("el-form",{ref:"dataForm",attrs:{rules:t.rules,model:t.form,"label-position":"right","label-width":"200px"}},[i("div",{staticClass:"app-form-group"},[i("div",{staticClass:"app-form-ti"}),i("div",{staticClass:"padding-top-lg"},[i("el-form-item",{attrs:{label:"名称",prop:"name"}},[i("el-input",{staticClass:"form-input",attrs:{type:"text"},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),i("el-form-item",{attrs:{label:"特价时间",prop:"sort"}},[i("el-date-picker",{attrs:{type:"datetimerange","start-placeholder":"开始日期","end-placeholder":"结束日期","default-time":["00:00:00"]},model:{value:t.datetime,callback:function(e){t.datetime=e},expression:"datetime"}})],1),i("el-form-item",{attrs:{label:"状态",prop:"status"}},[i("el-radio-group",{model:{value:t.form.status,callback:function(e){t.$set(t.form,"status",e)},expression:"form.status"}},[i("el-radio",{attrs:{label:1}},[t._v("正常")]),i("el-radio",{attrs:{label:0}},[t._v("禁用")])],1)],1),i("el-form-item",{attrs:{label:"特价商品",prop:"goods_ids"}},[i("selgoods",{attrs:{multiple:!0,tips:"选择商品",type:2,modal:!0},model:{value:t.form.seckill_goods_ids,callback:function(e){t.$set(t.form,"seckill_goods_ids",e)},expression:"form.seckill_goods_ids"}})],1)],1)]),i("div",{staticClass:"padding-xl flex justify-center"},[i("el-button",{on:{click:t.onBack}},[t._v("返回")]),i("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submit()}}},[t._v("提交")])],1)])],1),i("copyright")],1)},a=[],o=i("7f70"),r=i("8327"),l=i("1fe5"),n={name:"SeckillList",components:{selgoods:l["a"]},data:function(){return{rules:{},form:{},id:"",datetime:"",goods:{price:""}}},computed:Object(o["a"])({},Object(r["b"])(["config"])),created:function(){this.$route.query.id&&(this.id=this.$route.query.id),this.resetForm(),this.init()},methods:{init:function(){var t=this;this.api.get("seckill/index/detail",{id:this.id}).then((function(e){1==e.code&&(t.form=e.data,t.datetime=[t.form.starttime,t.form.endtime])}))},onBack:function(){this.$router.go(-1)},submit:function(){var t=this;if(!this.datetime)return this.$util.error("请选择活动时间");this.$refs["dataForm"].validate((function(e){e&&(t.form.starttime=t.datetime[0],t.form.endtime=t.datetime[1],t.api.post("seckill/index/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={name:"",starttime:"",endtime:"",status:1,goods_ids:""}}}},d=n,m=i("3d7a"),c=Object(m["a"])(d,s,a,!1,null,null,null);e["default"]=c.exports}}]);