chunk-41ad5734.e2d8bb57.js 12 KB

12
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-41ad5734"],{"0091":function(e,t,r){},"034e":function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-card",{scopedSlots:e._u([{key:"header",fn:function(){return[r("content-header")]},proxy:!0}])},[r("el-row",{attrs:{type:"flex",justify:"center"}},[r("lz-form",{ref:"form",attrs:{"get-data":e.getData,submit:e.onSubmit,errors:e.errors,form:e.form,"edit-mode":e.editMode,rules:e.rules},on:{"update:errors":function(t){e.errors=t},"update:form":function(t){e.form=t}}},[r("el-form-item",{attrs:{label:"押金卡名:",required:"",prop:"name"}},[r("el-input",{model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),r("el-form-item",{attrs:{label:"有效天数:",required:"",prop:"effective_days"}},[r("el-input-number",{attrs:{min:1,max:365,precision:0,step:1,label:"有效天数"},model:{value:e.form.effective_days,callback:function(t){e.$set(e.form,"effective_days",t)},expression:"form.effective_days"}})],1),r("el-form-item",{attrs:{label:"价格:",required:"",prop:"price"}},[r("el-input-number",{attrs:{precision:2,step:.1,max:1e3},model:{value:e.form.price,callback:function(t){e.$set(e.form,"price",t)},expression:"form.price"}})],1),r("el-form-item",{attrs:{label:"是否折扣:",required:"",prop:"is_discount"}},[r("el-radio",{attrs:{label:e.is_discount0,border:""},model:{value:e.form.is_discount,callback:function(t){e.$set(e.form,"is_discount",t)},expression:"form.is_discount"}},[e._v("无折扣")]),r("el-radio",{attrs:{label:e.is_discount1,border:""},model:{value:e.form.is_discount,callback:function(t){e.$set(e.form,"is_discount",t)},expression:"form.is_discount"}},[e._v("有折扣")])],1),r("el-form-item",{directives:[{name:"show",rawName:"v-show",value:1==e.form.is_discount,expression:"form.is_discount == 1"}],attrs:{label:"折扣:",required:"",prop:"discount"}},[r("el-input-number",{attrs:{precision:0,step:1,max:100,min:10},model:{value:e.form.discount,callback:function(t){e.$set(e.form,"discount",t)},expression:"form.discount"}})],1),r("el-form-item",{attrs:{label:"区域",prop:"area_id"}},[r("el-select",{attrs:{filterable:"",clearable:"",placeholder:"请选择"},model:{value:e.form.area_id,callback:function(t){e.$set(e.form,"area_id",t)},expression:"form.area_id"}},e._l(e.areas,function(e){return r("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),r("el-form-item",{attrs:{label:"是否可赠送:",required:"",prop:"is_give"}},[r("el-radio",{attrs:{label:e.is_give0,border:""},model:{value:e.form.is_give,callback:function(t){e.$set(e.form,"is_give",t)},expression:"form.is_give"}},[e._v("不可赠送")]),r("el-radio",{attrs:{label:e.is_give1,border:""},model:{value:e.form.is_give,callback:function(t){e.$set(e.form,"is_give",t)},expression:"form.is_give"}},[e._v("可赠送")])],1),r("el-form-item",{attrs:{label:"是否启用:",required:"",prop:"status"}},[r("el-radio",{attrs:{label:e.status1,border:""},model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[e._v("启用")]),r("el-radio",{attrs:{label:e.status0,border:""},model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[e._v("停用")])],1)],1)],1)],1)},i=[],a=(r("ac6a"),r("5df3"),r("768b")),o=(r("96cf"),r("3b8d")),s=r("ada3"),c=r("32ad"),u=r("b64d"),l=r("fe06"),f={name:"Form",components:{LzForm:s["a"]},mixins:[l["a"]],data:function(){return{form:{name:"",effective_days:"",price:0,discount:1,is_discount:0,status:0,area_id:"",is_give:0},rules:{},errors:{},areas:[],status1:1,status0:0,is_give0:0,is_give1:1,is_discount0:0,is_discount1:1,effective_days:[{value:1,label:"一天"},{value:3,label:"三天"},{value:7,label:"七天"},{value:15,label:"十五天"},{value:30,label:"三十天"},{value:90,label:"九十天"},{value:180,label:"一百八十天"}],permissions:[]}},methods:{onSubmit:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(!this.editMode){e.next=5;break}return e.next=3,Object(c["f"])(this.resourceId,this.form);case 3:e.next=7;break;case 5:return e.next=7,Object(c["e"])(this.form);case 7:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),getData:function(){var e=Object(o["a"])(regeneratorRuntime.mark(function e(){var t,r,n,i,o;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([Object(u["b"])({all:1})]);case 2:if(t=e.sent,r=Object(a["a"])(t,1),n=r[0].data,this.areas=n,!this.editMode){e.next=12;break}return e.next=9,Object(c["a"])(this.resourceId);case 9:i=e.sent,o=i.data,this.fillForm(o);case 12:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}()}},d=f,p=r("2877"),m=Object(p["a"])(d,n,i,!1,null,null,null);t["default"]=m.exports},"0cd2":function(e,t,r){},"32ad":function(e,t,r){"use strict";r.d(t,"b",function(){return i}),r.d(t,"e",function(){return a}),r.d(t,"f",function(){return o}),r.d(t,"a",function(){return s}),r.d(t,"d",function(){return c}),r.d(t,"c",function(){return u});var n=r("bf9a");function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].get("deposit_cards",{params:e})}function a(e){return n["b"].post("deposit_cards",e)}function o(e,t){return n["b"].put("deposit_cards/".concat(e),t)}function s(e){return n["b"].get("deposit_cards/".concat(e,"/edit"))}function c(e){return n["b"].post("deposit_cards/giveDepositCardToUser",e)}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].get("deposit_card_orders",{params:e})}},"469f":function(e,t,r){r("6c1c"),r("1654"),e.exports=r("7d7b")},"5d73":function(e,t,r){e.exports=r("469f")},"6cbc":function(e,t,r){"use strict";var n=r("0cd2"),i=r.n(n);i.a},"768b":function(e,t,r){"use strict";var n=r("a745"),i=r.n(n);function a(e){if(i()(e))return e}var o=r("5d73"),s=r.n(o);function c(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o,c=s()(e);!(n=(o=c.next()).done);n=!0)if(r.push(o.value),t&&r.length===t)break}catch(u){i=!0,a=u}finally{try{n||null==c["return"]||c["return"]()}finally{if(i)throw a}}return r}function u(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function l(e,t){return a(e)||c(e,t)||u()}r.d(t,"a",function(){return l})},"7d7b":function(e,t,r){var n=r("e4ae"),i=r("7cd6");e.exports=r("584a").getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return n(t.call(e))}},"8a92":function(e,t,r){"use strict";var n=r("0091"),i=r.n(n);i.a},ada3:function(e,t,r){"use strict";r("8e6e"),r("456d");var n=r("bd86"),i=r("75fc"),a=(r("a481"),r("96cf"),r("3b8d")),o=(r("ac6a"),r("28a5"),r("9948")),s=r.n(o),c=r("9b02"),u=r.n(c),l=r("1a38"),f=r("873a"),d=r("a22f");function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(r,!0).forEach(function(t){Object(n["a"])(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var b,h,v={name:"LzForm",components:{FlexSpacer:d["a"]},inject:{view:{from:"view",default:null}},data:function(){return{loading:!1,stay:!1}},props:{getData:Function,submit:Function,errors:Object,form:Object,submitText:{type:String,default:"保存"},labelPosition:String,inDialog:Boolean,createdRedirect:{type:[String,Function],default:function(){var e=this.$route.path.split("/");return"/"+(e[e.length-2]||"")}},updatedRedirect:{type:[String,Function],default:function(){return this.$router.back.bind(this.$router)}},disableRedirect:Boolean,disableStay:Boolean,editMode:Boolean},computed:{realLabelPosition:function(){return this.labelPosition||(this.$store.state.miniWidth?"top":"right")},miniWidth:function(){return this.$store.state.miniWidth}},created:function(){this.copyMethods()},methods:{copyMethods:function(){var e=this;[l["default"].extends.methods,l["default"].methods].forEach(function(t){s()(t,function(t,r){e[r]=function(){t.apply(this.$refs.form,arguments)}})})},_getData:function(){var e=Object(a["a"])(regeneratorRuntime.mark(function e(){var t=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.loading=!0,this.view&&this.$emit("update:form",this.view.formBak),e.prev=2,e.t0=this.getData,!e.t0){e.next=7;break}return e.next=7,this.getData();case 7:this.$nextTick(function(){t.setInitialValues()}),e.next=13;break;case 10:e.prev=10,e.t1=e["catch"](2),Promise.reject(e.t1);case 13:this.loading=!1;case 14:case"end":return e.stop()}},e,this,[[2,10]])}));function t(){return e.apply(this,arguments)}return t}(),onSubmit:function(){var e=Object(a["a"])(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(this.$emit("update:errors",{}),e.prev=1,e.t0=this.submit,!e.t0){e.next=6;break}return e.next=6,this.submit();case 6:if(this.$message.success(Object(f["h"])(this.editMode?"updated":"created")),!this.stay&&!this.disableRedirect){e.next=9;break}return e.abrupt("return");case 9:t=this.editMode?this.updatedRedirect:this.createdRedirect,"string"===typeof t?this.$router.push(t):"function"===typeof t&&t(),e.next=17;break;case 13:e.prev=13,e.t1=e["catch"](1),this.$emit("update:errors",Object(f["j"])(e.t1.response)),422!==u()(e.t1,"response.status")&&Promise.reject(e.t1);case 17:case"end":return e.stop()}},e,this,[[1,13]])}));function t(){return e.apply(this,arguments)}return t}(),onReset:function(){this.$refs.form.resetFields()}},watch:{$route:{handler:function(){this.$active&&this._getData()},immediate:!0}},render:function(e){var t=this,r=this.$slots.default;Array.isArray(r)&&(r=r.map(function(r){var n=r.componentOptions,a=n.propsData,o=a.helper,s=a.label;if(o){o=o.replace(/\n/g,"<br>");var c=e("template",{slot:"label"},[e("span",[s]),e("el-tooltip",{attrs:{effect:"dark",placement:"top-start","popper-class":"form-helper-popper ".concat(t.miniWidth?"mini-width":"")}},[e("div",{slot:"content",domProps:{innerHTML:o}}),e("i",{class:"ml-1 el-icon-question helper"})])]);return e("el-form-item",{props:n.propsData},[c].concat(Object(i["a"])(n.children)))}return r}));!this.disableStay&&e("el-checkbox",{attrs:{title:"表单提交后,留在此页"},model:{value:t.stay,callback:function(e){t.stay=e}}},["留在此页"]);var n=this.$slots.footer||e("el-form-item",{class:"footer"},[e("loading-action",{attrs:{type:"primary",action:this.onSubmit}},[this.submitText]),e("el-button",{on:{click:this.onReset}},["重置"]),this.$slots.footerAppend,e("flex-spacer")]);return e("el-form",{props:m({model:this.form,errors:this.errors,labelPosition:this.realLabelPosition},this.$attrs),on:m({},this.$listeners),class:{"in-dialog":this.inDialog},style:{width:this.inDialog?"auto":"800px"},directives:[{name:"loading",value:this.loading}],ref:"form"},[r,n])}},g=v,_=(r("6cbc"),r("8a92"),r("2877")),y=Object(_["a"])(g,b,h,!1,null,"3084f0c4",null);t["a"]=y.exports},b64d:function(e,t,r){"use strict";r.d(t,"b",function(){return i}),r.d(t,"c",function(){return a}),r.d(t,"d",function(){return o}),r.d(t,"e",function(){return s}),r.d(t,"a",function(){return c});var n=r("bf9a");function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].get("area",{params:e})}function a(e){return n["b"].get("area/".concat(e))}function o(e){return n["b"].post("area",e)}function s(e,t){return n["b"].put("area/".concat(e),t)}function c(e){return n["b"].get("area/".concat(e,"/edit"))}},fe06:function(e,t,r){"use strict";var n=r("873a");t["a"]={provide:function(){return{view:this}},data:function(){return{formField:"form",idField:"id"}},computed:{editMode:function(){return!!this.resourceId},resourceId:function(){return this.$route.params[this.idField]}},created:function(){this.backupForm()},methods:{getResourceId:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";return this.$route.params[e]},backupForm:function(){this.formBak=JSON.parse(JSON.stringify(this.$data[this.formField]))},fillForm:function(e){this.$data[this.formField]=Object(n["b"])(this.$data[this.formField],e)}}}}}]);
  2. //# sourceMappingURL=chunk-41ad5734.e2d8bb57.js.map