(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4c5bcb76"],{"47e8":function(t,e,a){"use strict";a("90c2")},"90c2":function(t,e,a){},b963:function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"app-form margin-top"},[a("div",{staticClass:"app-form-group"},[a("div",{staticClass:"app-form-ti"},[t._v("基础配置")]),a("form-generator",{ref:"basicForm",attrs:{"form-config":t.formConfig,"show-footer":!0,showCancel:!0,cancelText:"返回"},on:{submit:t.handleBasicSubmit,cancel:t.handleCancel},scopedSlots:t._u([{key:"rule",fn:function(e){var r=e.form;return[a("el-form-item",{attrs:{label:"奖励规则",prop:"rule"}},[a("div",{staticClass:"rule-container"},[t._l(r.rule||[],(function(e,r){return a("div",{key:r,staticClass:"rule-item"},[a("div",{staticClass:"rule-card"},[a("div",{staticClass:"rule-header",attrs:{slot:"header"},slot:"header"},[a("span",[t._v("规则 "+t._s(r+1))]),a("el-button",{staticStyle:{color:"#f56c6c"},attrs:{type:"text",icon:"el-icon-delete"},on:{click:function(e){return t.removeRule(r)}}},[t._v("删除")])],1),a("div",{staticClass:"rule-content"},[a("el-form-item",{attrs:{label:"排队商品",prop:"rule."+r+".goods"}},[a("selgoods",{attrs:{multiple:!0},model:{value:e.goods,callback:function(a){t.$set(e,"goods",a)},expression:"item.goods"}})],1),a("el-form-item",{attrs:{label:"排队人数",prop:"rule."+r+".num"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{placeholder:"请输入排队人数"},model:{value:e.num,callback:function(a){t.$set(e,"num",t._n(a))},expression:"item.num"}},[a("div",{attrs:{slot:"append"},slot:"append"},[t._v("人")])])],1),a("el-form-item",{attrs:{label:"出局倍数",prop:"rule."+r+".strikeout_multiple"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{type:"number",placeholder:"请输入出局倍数"},model:{value:e.strikeout_multiple,callback:function(a){t.$set(e,"strikeout_multiple",a)},expression:"item.strikeout_multiple"}},[a("div",{attrs:{slot:"append"},slot:"append"},[t._v("倍")])])],1),a("el-form-item",{attrs:{label:"奖励比例",prop:"rule."+r+".reward_rate"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{type:"number",placeholder:"请输入奖励比例"},model:{value:e.reward_rate,callback:function(a){t.$set(e,"reward_rate",a)},expression:"item.reward_rate"}},[a("div",{attrs:{slot:"append"},slot:"append"},[t._v("%")])])],1)],1)])])})),a("el-button",{staticStyle:{"margin-top":"10px"},attrs:{type:"primary",icon:"el-icon-plus"},on:{click:t.addRule}},[t._v("添加规则")])],2)])]}}]),model:{value:t.formData,callback:function(e){t.formData=e},expression:"formData"}})],1)])])},i=[],o=a("7f70"),l=(a("e8d6"),a("baf6"),a("8327")),s=a("1fe5"),n={name:"QueueAwardSet",components:{selgoods:s["a"]},data:function(){return{formData:{status:1,is_multiple_queue:0,rule:[{goods:[],num:"",reward_rate:"",strikeout_multiple:""}]}}},computed:Object(o["a"])(Object(o["a"])({},Object(l["b"])(["config"])),{},{formConfig:function(){var t=[{type:"radio",label:"状态",prop:"status",required:!0,width:"400px",options:[{label:"启用",value:1},{label:"禁用",value:0}]}];return 1==this.formData.status&&t.push({type:"radio",label:"单人多排",prop:"is_multiple_queue",required:!0,width:"400px",options:[{label:"开启",value:1},{label:"关闭",value:0}]},{type:"rule",label:"奖励规则",prop:"rule",required:!1}),t}}),created:function(){this.init()},watch:{config:{handler:function(t){this.init()},deep:!0,immediate:!0}},methods:{init:function(){var t=this.$util.restJson(this.config.queue_award);t&&(this.formData=t,t.queue_goods||(this.formData.queue_goods=""))},addRule:function(){this.formData.rule||this.$set(this.formData,"rule",[]),this.formData.rule.push({goods:[],num:"",reward_rate:"",strikeout_multiple:""})},removeRule:function(t){var e=this;this.$confirm("确定要删除该规则吗？","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.formData.rule.splice(t,1)})).catch((function(){}))},handleBasicSubmit:function(t){var e=this;this.api.post("queue_award/config/set",t).then((function(t){1==t.code?(e.$util.success(t.message),e.$store.dispatch("settings/getSetting")):e.$util.error(t.message)}))},handleCancel:function(){this.$router.back()}}},u=n,c=(a("47e8"),a("3d7a")),p=Object(c["a"])(u,r,i,!1,null,"4c5f472e",null);e["default"]=p.exports}}]);