(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0b1fe3"],{"21e3":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[e._m(0),a("div",{staticClass:"app-container--bd"},[a("BaseForm",{attrs:{baseForm:e.baseForm,loading:e.loading},on:{"update:baseForm":function(t){e.baseForm=t},"update:base-form":function(t){e.baseForm=t},submit:e.submit}})],1)])},r=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container--hd pb-20"},[a("h3",[e._v("新增课包")])])}],c=(a("2397"),a("456d"),a("ac6a"),a("96cf"),a("1da1")),i=a("d4ec"),s=a("bee2"),o=a("99de"),u=a("7e84"),p=a("262e"),b=a("9ab4"),l=a("60a3"),d=a("7aab"),m=a("5bd4");function h(e,t,a){return t=Object(u["a"])(t),Object(o["a"])(e,f()?Reflect.construct(t,a||[],Object(u["a"])(e).constructor):t.apply(e,a))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}var _=function(e){function t(){var e;return Object(i["a"])(this,t),e=h(this,t,arguments),e.loading=!1,e.baseForm={sport_tag_id:"",training_id:"",use_stadium:"",start_time:"",end_time:"",coach_ids:"",unit_price:"",package_name:"",buy_limit:1,status:1,min_class_hours:"",max_class_hours:""},e}return Object(p["a"])(t,e),Object(s["a"])(t,[{key:"package_id",get:function(){return this.$route.query.package_id}},{key:"getDetail",value:function(){var e=Object(c["a"])(regeneratorRuntime.mark((function e(){var t,a,n=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(m["c"])({package_id:this.package_id});case 3:t=e.sent,a=t.data,Object.keys(a).forEach((function(e){0!=a[e]&&null!=a[e]||"unit_price"===e?n.baseForm[e]="coach_ids"===e?a[e].join(","):a[e]:n.baseForm[e]=""})),this.baseForm.package_name="".concat(a.package_name,"-复制"),e.next=11;break;case 9:e.prev=9,e.t0=e["catch"](0);case 11:case"end":return e.stop()}}),e,this,[[0,9]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"submit",value:function(){var e=Object(c["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,this.loading=!0,e.next=4,Object(m["a"])(this.baseForm);case 4:this.$message.success("新增成功"),this.$router.back(),e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](0),this.loading=!1;case 11:case"end":return e.stop()}}),e,this,[[0,8]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"mounted",value:function(){this.package_id&&this.getDetail()}}]),t}(l["i"]);_=Object(b["a"])([Object(l["a"])({components:{BaseForm:d["default"]}})],_);var v=_,g=v,k=a("2877"),j=Object(k["a"])(g,n,r,!1,null,"1bc8cbb9",null);t["default"]=j.exports}}]);