(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d21e568"],{d4ac:function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-container"},[e._m(0),n("div",{staticClass:"app-container--bd"},[n("SchemeForm",{attrs:{baseForm:e.form,loading:e.loading},on:{"update:baseForm":function(t){e.form=t},"update:base-form":function(t){e.form=t},submit:e.handleSubmit}})],1)])},i=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-container--hd"},[n("h3",{staticClass:"pb-20"},[e._v("新增协议方案")])])}],o=(n("2397"),n("96cf"),n("1da1")),a=(n("6b54"),n("d4ec")),s=n("bee2"),c=n("99de"),_=n("7e84"),d=n("262e"),p=n("9ab4"),l=n("60a3"),f=n("7dc8"),u=n("f76e");function y(e,t,n){return t=Object(_["a"])(t),Object(c["a"])(e,h()?Reflect.construct(t,n||[],Object(_["a"])(e).constructor):t.apply(e,n))}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var g=function(e){function t(){var e;return Object(a["a"])(this,t),e=y(this,t,arguments),e.loading=!1,e.form={scheme_name:"",scheme_des:"",use_stadium_id:"",use_sport_tag_id:"",order_type:"",status:1,ticket_info:{apply_scope_type:1,charge_type:1,list:[]},ground_info:{apply_scope_type:1,charge_type:1,list:[]},card_info:{apply_scope_type:1,charge_type:1,list:[]},course_info:{apply_scope_type:1,charge_type:1,list:[]},cos_info:{apply_scope_type:1,charge_type:1,list:[]},goods_info:{apply_scope_type:1,charge_type:1,list:[]},lease_info:{apply_scope_type:1,charge_type:1,list:[]}},e}return Object(d["a"])(t,e),Object(s["a"])(t,[{key:"dealArray",value:function(e,t){var n=e.list,r=e.charge_type,i=e.apply_scope_type;return JSON.stringify({charge_type:r,apply_scope_type:i,list:n.map((function(e){return e[t]=e[t].toString(),e}))})}},{key:"handleSubmit",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=JSON.parse(JSON.stringify(this.form)),t.ticket_info.list.length>0&&(t.ticket_info=this.dealArray(t.ticket_info,"ticket_ids")),t.ground_info.list.length>0&&(t.ground_info=this.dealArray(t.ground_info,"ground_ids")),t.card_info.list.length>0&&(t.card_info=this.dealArray(t.card_info,"product_ids")),t.course_info.list.length>0&&(t.course_info=this.dealArray(t.course_info,"course_ids")),t.cos_info.list.length>0&&(t.cos_info=this.dealArray(t.cos_info,"product_ids")),t.goods_info.list.length>0&&(t.goods_info=this.dealArray(t.goods_info,"skus")),t.lease_info.list.length>0&&(t.lease_info=this.dealArray(t.lease_info,"product_ids")),-1==t.order_type.indexOf("12")&&delete t.ticket_info,-1==t.order_type.indexOf("13")&&delete t.ground_info,-1==t.order_type.indexOf("11")&&delete t.card_info,-1==t.order_type.indexOf("17")&&delete t.course_info,-1==t.order_type.indexOf("15")&&delete t.cos_info,-1==t.order_type.indexOf("14")&&delete t.goods_info,-1==t.order_type.indexOf("18")&&delete t.lease_info,this.loading=!0,e.prev=16,e.next=19,Object(u["b"])(t);case 19:this.$message.success("新增成功"),this.$router.back();case 21:return e.prev=21,this.loading=!1,e.finish(21);case 24:case"end":return e.stop()}}),e,this,[[16,,21,24]])})));function t(){return e.apply(this,arguments)}return t}()}]),t}(l["i"]);g=Object(p["a"])([Object(l["a"])({components:{SchemeForm:f["default"]}})],g);var m=g,b=m,O=n("2877"),v=Object(O["a"])(b,r,i,!1,null,"4504dd36",null);t["default"]=v.exports}}]);