chunk-0af06729.8662fe9b.js 8.0 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0af06729"],{"09f4":function(t,e,r){"use strict";r.d(e,"a",(function(){return i})),Math.easeInOutQuad=function(t,e,r,n){return t/=n/2,t<1?r/2*t*t+e:(t--,-r/2*(t*(t-2)-1)+e)};var n=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function a(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function o(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function i(t,e,r){var i=o(),s=t-i,u=20,l=0;e="undefined"===typeof e?500:e;var c=function t(){l+=u;var o=Math.easeInOutQuad(l,i,s,e);a(o),l<e?n(t):r&&"function"===typeof r&&r()};c()}},"3a73":function(t,e,r){"use strict";r.d(e,"c",(function(){return a})),r.d(e,"b",(function(){return o})),r.d(e,"a",(function(){return i})),r.d(e,"d",(function(){return s})),r.d(e,"g",(function(){return u})),r.d(e,"f",(function(){return l})),r.d(e,"h",(function(){return c})),r.d(e,"e",(function(){return m}));var n=r("b775");r("4328");function a(t){return Object(n["a"])({url:"/api-web/luckDrawGroup/list",method:"get",headers:{"content-type":"application/x-www-form-urlencoded"},data:{},params:t})}function o(t){return Object(n["a"])({url:"/api-web/luckDrawGroup/findAll",method:"get",headers:{"content-type":"application/x-www-form-urlencoded"},data:{},params:t})}function i(t){return Object(n["a"])({url:"/api-web/luckDrawGroup/add",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/api-web/luckDrawGroup/update",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/api-web/luckDrawPrize/list",method:"get",headers:{"content-type":"application/x-www-form-urlencoded"},data:{},params:t})}function l(t){return Object(n["a"])({url:"/api-web/luckDrawPrize/batchAdd",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/api-web/luckDrawPrize/update",method:"post",data:t})}function m(t){return Object(n["a"])({url:"/api-web/luckDrawLog/rewardlist",method:"get",headers:{"content-type":"application/x-www-form-urlencoded"},data:{},params:t})}},9647:function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"m-container"},[t._m(0),t._v(" "),r("div",{staticClass:"m-core"},[r("save-form",{staticClass:"searchForm",attrs:{inline:!0,model:t.searchForm},on:{submit:t.getList}},[r("el-form-item",[r("el-input",{attrs:{clearable:"",placeholder:"请输入活动名称"},model:{value:t.searchForm.search,callback:function(e){t.$set(t.searchForm,"search","string"===typeof e?e.trim():e)},expression:"searchForm.search"}})],1),t._v(" "),r("el-form-item",[r("el-button",{attrs:{"native-type":"submit",type:"danger"}},[t._v("搜索")])],1)],1),t._v(" "),r("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"luckDrawGroup/add",expression:"'luckDrawGroup/add'"}],staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary"},on:{click:function(e){return t.onOperationLottery("create")}}},[t._v("\n 添加\n ")]),t._v(" "),r("div",{staticClass:"tableWrap"},[r("el-table",{attrs:{data:t.tableList,"header-cell-style":{background:"#EDEEF0",color:"#444"}}},[r("el-table-column",{attrs:{align:"center",prop:"name",label:"活动名称"}}),t._v(" "),r("el-table-column",{attrs:{align:"center",prop:"startTime",label:"活动开始时间"}}),t._v(" "),r("el-table-column",{attrs:{align:"center",prop:"endTime",label:"活动结束时间"}}),t._v(" "),r("el-table-column",{attrs:{align:"center",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"luckDrawGroup/update",expression:"'luckDrawGroup/update'"}],attrs:{type:"text"},on:{click:function(r){return t.onOperationLottery("update",e.row)}}},[t._v("修改")]),t._v(" "),r("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"/trophyManager",expression:"'/trophyManager'"}],attrs:{type:"text"},on:{click:function(r){return t.onLook(e.row)}}},[t._v("奖品设置")]),t._v(" "),r("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"/lotteryRecord",expression:"'/lotteryRecord'"}],attrs:{type:"text"},on:{click:function(r){return t.onLottery(e.row)}}},[t._v("抽奖记录")])]}}])})],1),t._v(" "),r("pagination",{attrs:{sync:"",total:t.pageInfo.total,page:t.pageInfo.page,limit:t.pageInfo.limit,"page-sizes":t.pageInfo.page_size},on:{"update:total":function(e){return t.$set(t.pageInfo,"total",e)},"update:page":function(e){return t.$set(t.pageInfo,"page",e)},"update:limit":function(e){return t.$set(t.pageInfo,"limit",e)},pagination:t.getList}})],1)],1),t._v(" "),r("el-dialog",{attrs:{title:t.formTitle[t.formActionTitle],visible:t.lotteryStatus,width:"550px"},on:{"update:visible":function(e){t.lotteryStatus=e},close:function(e){return t.onFormClose("ruleForm")}}},[r("el-form",{ref:"ruleForm",attrs:{model:t.form,rules:t.rules,"label-width":"100PX"}},[r("el-form-item",{attrs:{label:"活动名称",prop:"name"}},[r("el-input",{attrs:{autocomplete:"off",placeholder:"请输入活动名称"},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name","string"===typeof e?e.trim():e)},expression:"form.name"}})],1),t._v(" "),r("el-form-item",{attrs:{label:"活动时间",prop:"time"}},[r("el-date-picker",{staticStyle:{width:"100%"},attrs:{"picker-options":{firstDayOfWeek:1},type:"datetimerange","default-time":["00:00:00","23:59:59"],"range-separator":"至","start-placeholder":"活动开始日期","end-placeholder":"活动结束日期"},model:{value:t.form.time,callback:function(e){t.$set(t.form,"time",e)},expression:"form.time"}})],1)],1),t._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(e){t.lotteryStatus=!1}}},[t._v("取 消")]),t._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.onSubmit("ruleForm")}}},[t._v("确 定")])],1)],1)],1)},a=[function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("h2",[r("div",{staticClass:"squrt"}),t._v("抽奖活动管理\n ")])}],o=(r("7f7f"),r("333d")),i=r("5a0c"),s=r.n(i),u=r("e3eb"),l=r.n(u),c=r("3a73"),m={components:{pagination:o["a"]},data:function(){return{searchForm:{search:null},formTitle:{create:"添加活动",update:"修改活动"},formActionTitle:"create",lotteryStatus:!1,tableList:[],form:{name:null,time:null},rules:{name:[{required:!0,message:"请输入活动名称",trigger:"blur"}],time:[{required:!0,message:"请选择活动时间",trigger:"change"}]},pageInfo:{limit:10,page:1,total:1,page_size:[10,20,40,50]}}},created:function(){},mounted:function(){this.getList()},methods:{onOperationLottery:function(t,e){var r=this;this.formActionTitle=t,"update"==t&&this.$nextTick((function(){r.form={id:e.id,name:e.name,time:[e.startTime,e.endTime]}})),this.lotteryStatus=!0},onSubmit:function(t){var e=this;this.$refs[t].validate((function(t){if(t){var r=Object.assign({},e.form),n={name:r.name,consumeType:"TIMES",consumeValue:1,startTime:s()(r.time[0]).format("YYYY-MM-DD HH:mm:ss"),endTime:s()(r.time[1]).format("YYYY-MM-DD HH:mm:ss")};"create"==e.formActionTitle?Object(c["a"])(n).then((function(t){e.messageTips("添加",t)})):"update"==e.formActionTitle&&(n.id=r.id,Object(c["d"])(n).then((function(t){e.messageTips("修改",t)})))}}))},onFormClose:function(t){this.$refs[t].resetFields()},messageTips:function(t,e){200==e.code?(this.$message.success(t+"成功"),this.lotteryStatus=!1,this.getList()):this.$message.error(e.msg)},getList:function(){var t=this,e=Object.assign({},this.searchForm);e.rows=this.pageInfo.limit,e.page=this.pageInfo.page,Object(c["c"])(l()(e)).then((function(e){200==e.code&&e.data&&(t.tableList=e.data.rows,t.pageInfo.total=e.data.total)}))},onLook:function(t){this.$router.push({path:"/trophyManager",query:{groupId:t.id}})},onLottery:function(t){this.$router.push({path:"/luckyDraw/lotteryRecord",query:{groupId:t.id}})}}},p=m,d=r("2877"),f=Object(d["a"])(p,n,a,!1,null,null,null);e["default"]=f.exports}}]);