(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3f3ff175"],{7853:function(e,i,t){},a232:function(e,i,t){"use strict";t("7853")},aa69:function(e,i,t){"use strict";t.r(i);var o=function(){var e=this,i=e.$createElement,t=e._self._c||i;return t("div",[t("pageGenerator",{ref:"pageGenerator",attrs:{apiConfig:e.apiConfig,columns:e.columns,pageConfig:e.pageConfig,filterConfig:e.filterConfig,actionConfig:e.actionConfig},scopedSlots:e._u([{key:"reward",fn:function(i){var o=i.row;return[t("div",[e._v(e._s(o.prize?o.prize.title:""))])]}},{key:"status",fn:function(i){var o=i.row;return[0==o.status?t("el-tag",{attrs:{type:"warning"}},[e._v("未抽奖")]):1==o.status?t("el-tag",{attrs:{type:"success"}},[e._v("已抽奖")]):e._e()]}}])}),t("apppintEdit",{attrs:{"dialog-form-visible":e.dialogFormVisible,rows:e.rows},on:{closeDialog:e.closeDialog}})],1)},r=[],l=function(){var e=this,i=e.$createElement,t=e._self._c||i;return t("el-dialog",{attrs:{title:"奖品编辑",width:"40%","before-close":e.closeDialog,visible:e.isDialog},on:{"update:visible":function(i){e.isDialog=i}}},[t("div",{staticStyle:{height:"auto","overflow-y":"auto"}},[t("el-form",{ref:"dataForm",staticStyle:{width:"100%",padding:"0 50px","box-sizing":"border-box"},attrs:{rules:e.rules,model:e.form,"label-position":"right","label-width":"100px"}},[[t("el-form-item",{attrs:{label:"指定用户",prop:"user_id"}},[t("selUser",{attrs:{appendToBody:!0},model:{value:e.form.user_id,callback:function(i){e.$set(e.form,"user_id",i)},expression:"form.user_id"}})],1),t("el-form-item",{attrs:{label:"奖品",prop:"prize_id"}},[t("el-select",{attrs:{placeholder:"请选择"},model:{value:e.form.prize_id,callback:function(i){e.$set(e.form,"prize_id",i)},expression:"form.prize_id"}},e._l(e.rewardList,(function(i){return t("el-option",{key:i.id,attrs:{label:i.title,value:i.id}},[t("div",{staticStyle:{display:"flex","align-items":"center"}},[t("div",[e._v(e._s(i.title))])])])})),1)],1)]],2)],1),t("div",{staticClass:"dialog-footer",staticStyle:{"padding-top":"0"},attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.closeDialog}},[e._v(" "+e._s(e.$t("table.cancel"))+" ")]),t("el-button",{attrs:{type:"primary"},on:{click:function(i){return e.submit()}}},[e._v(" "+e._s(e.$t("table.confirm"))+" ")])],1)])},s=[],a=t("7f70"),n=(t("34c2"),t("8327")),c=t("c7f0"),d=t("1fe5"),u=t("9226"),p={components:{uploadImage:c["a"],selgoods:d["a"],selUser:u["a"]},props:{dialogFormVisible:{type:Boolean,default:function(){return!1}},rows:{type:Number|String,default:function(){return""}}},data:function(){return{isDialog:!1,rules:{user_id:[{required:!0,message:"请选择指定用户",trigger:"change"}]},form:{user_id:"",prize_id:""},rewardList:[]}},computed:Object(a["a"])({},Object(n["b"])(["config"])),watch:{dialogFormVisible:function(e){this.isDialog=e},rows:function(e){e.user_id&&(this.form={user_id:e.user_id,prize_id:e.prize_id})}},created:function(){this.resetForm(),this.getRewardList()},methods:{getRewardList:function(){var e=this;this.api.get("luckywheel/prize/all").then((function(i){1==i.code?e.rewardList=i.data.list:e.$util.error(i.message)}))},closeDialog:function(){this.isDialog=!1,this.resetForm(),this.$emit("closeDialog",!0)},submit:function(){var e=this;this.$refs["dataForm"].validate((function(i){i&&e.api.post("luckywheel/zhiding/post",{prize_id:e.form.prize_id,user_id:e.form.user_id}).then((function(i){1==i.code?(e.$util.success(i.message),e.closeDialog()):e.$util.error(i.message)}))}))},resetForm:function(){this.form={user_id:"",prize_id:""}}}},f=p,g=(t("a232"),t("3d7a")),m=Object(g["a"])(f,l,s,!1,null,null,null),h=m.exports,b={name:"LuckyWheelAppoint",components:{apppintEdit:h},data:function(){return{pageConfig:{showAdd:!1,showRefresh:!0,showSelection:!1,showBatchDel:!1,showPagination:!0,showExport:!1,listQueryConfig:{page:1,limit:10},actionWidth:200,actionAlign:"center"},filterConfig:[],apiConfig:{getList:"luckywheel/zhiding/getList",del:"luckywheel/zhiding/delete"},columns:[{label:"ID",prop:"id",align:"center",width:80},{label:"指定用户",prop:"user",align:"center"},{label:"奖励",prop:"prize.title",align:"center",slot:"reward"},{label:"状态",prop:"status",align:"center",slot:"status"}],actionConfig:[{label:"添加",type:"primary",icon:"el-icon-circle-plus-outline",click:this.add,layout:"top"},{label:"删除",type:"danger",size:"mini",icon:"el-icon-delete",click:"del",layout:"table"},{label:"编辑",type:"primary",size:"mini",icon:"el-icon-edit",click:this.edit,layout:"table"}],dialogFormVisible:!1,rows:{}}},methods:{add:function(){this.rows={},this.dialogFormVisible=!0},edit:function(e,i){this.rows=e,this.dialogFormVisible=!0},closeDialog:function(){this.dialogFormVisible=!1,this.$refs.pageGenerator.getList()}}},w=b,_=Object(g["a"])(w,o,r,!1,null,null,null);i["default"]=_.exports}}]);