| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d230c26"],{ee3c: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:"divBox"},[a("el-card",{staticClass:"box-card"},[e.FormData?a("form-create",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"fc",staticClass:"formBox",attrs:{option:e.option,rule:e.FormData.rule,"handle-icon":"false"},on:{"on-submit":e.onSubmit}}):e._e()],1)],1)},r=[],o=(a("96cf"),a("3b8d")),s=a("30ba"),i=a.n(s),c=a("b7be"),u=a("0c6d"),m=a("83d6"),l={name:"CreatCoupon",data:function(){return{option:{form:{labelWidth:"150px"},global:{upload:{props:{onSuccess:function(e,t){200===e.status&&(t.url=e.data.src)}}}}},FormData:null,loading:!1}},components:{formCreate:i.a.$form()},mounted:function(){this.getFrom(),sessionStorage.setItem("singleChoice",0)},methods:{getFrom:function(){var e=this;this.loading=!0,this.$route.params.id?Object(c["y"])(this.$route.params.id).then(function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(a){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.FormData=a.data,e.loading=!1;case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$message.error(t.message),e.loading=!1})):Object(c["C"])().then(function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(a){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.FormData=a.data,e.loading=!1;case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$message.error(t.message),e.loading=!1}))},onSubmit:function(e){var t=this;u["a"][this.FormData.method.toLowerCase()](this.FormData.action.slice(5),e).then((function(e){t.$message.success(e.message||"提交成功"),t.$router.push({path:"".concat(m["roterPre"],"/marketing/coupon/list")})})).catch((function(e){t.$message.error(e.message||"提交失败")}))}}},d=l,p=a("2877"),f=Object(p["a"])(d,n,r,!1,null,"368d0024",null);t["default"]=f.exports}}]);
|