chunk-16e1254a.5cd9cbe3.js 16 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-16e1254a"],{"09f4":function(t,e,r){"use strict";r.d(e,"a",(function(){return i})),Math.easeInOutQuad=function(t,e,r,o){return t/=o/2,t<1?r/2*t*t+e:(t--,-r/2*(t*(t-2)-1)+e)};var o=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function n(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function a(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function i(t,e,r){var i=a(),s=t-i,l=20,c=0;e="undefined"===typeof e?500:e;var u=function t(){c+=l;var a=Math.easeInOutQuad(c,i,s,e);n(a),c<e?o(t):r&&"function"===typeof r&&r()};u()}},"3a73":function(t,e,r){"use strict";r.d(e,"c",(function(){return n})),r.d(e,"b",(function(){return a})),r.d(e,"a",(function(){return i})),r.d(e,"d",(function(){return s})),r.d(e,"g",(function(){return l})),r.d(e,"f",(function(){return c})),r.d(e,"h",(function(){return u})),r.d(e,"e",(function(){return m}));var o=r("b775");function n(t){return Object(o["a"])({url:"/api-web/luckDrawGroup/list",method:"get",headers:{"content-type":"application/x-www-form-urlencoded"},data:{},params:t})}function a(t){return Object(o["a"])({url:"/api-web/luckDrawGroup/findAll",method:"get",headers:{"content-type":"application/x-www-form-urlencoded"},data:{},params:t})}function i(t){return Object(o["a"])({url:"/api-web/luckDrawGroup/add",method:"post",data:t})}function s(t){return Object(o["a"])({url:"/api-web/luckDrawGroup/update",method:"post",data:t})}function l(t){return Object(o["a"])({url:"/api-web/luckDrawPrize/list",method:"get",headers:{"content-type":"application/x-www-form-urlencoded"},data:{},params:t})}function c(t){return Object(o["a"])({url:"/api-web/luckDrawPrize/add",method:"post",data:t})}function u(t){return Object(o["a"])({url:"/api-web/luckDrawPrize/update",method:"post",data:t})}function m(t){return Object(o["a"])({url:"/api-web/luckDrawLog/rewardlist",method:"get",headers:{"content-type":"application/x-www-form-urlencoded"},data:{},params:t})}},"59bc":function(t,e,r){},a5b0:function(t,e,r){"use strict";var o=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("el-tooltip",{attrs:{effect:"dark",placement:"top"}},[r("div",{staticStyle:{"max-width":"200px"},attrs:{slot:"content"},slot:"content"},[t._v(t._s(t.content))]),t._v(" "),r("span",{staticClass:"content-tooltip"},[t._v(t._s(t.content))])])},n=[],a={name:"scrollPane",props:{content:{required:!0,type:String}},data:function(){return{}},methods:{}},i=a,s=(r("c70f"),r("2877")),l=Object(s["a"])(i,o,n,!1,null,"64596b6c",null);e["a"]=l.exports},ab73:function(t,e,r){"use strict";var o=r("ae0b"),n=r.n(o);n.a},ae0b:function(t,e,r){},c70f:function(t,e,r){"use strict";var o=r("59bc"),n=r.n(o);n.a},da3b:function(t,e,r){"use strict";r.r(e);var o=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",{directives:[{name:"permission",rawName:"v-permission",value:"luckDrawPrize/add",expression:"'luckDrawPrize/add'"}],staticClass:"newBand",on:{click:function(e){return t.onOperationTrophy("create")}}},[t._v("添加")]),t._v(" "),r("el-form",{staticClass:"searchForm",attrs:{inline:!0},model:{value:t.searchForm,callback:function(e){t.searchForm="string"===typeof e?e.trim():e},expression:"searchForm"}},[r("el-form-item",[r("el-input",{attrs:{placeholder:"请输入奖品名称"},model:{value:t.searchForm.name,callback:function(e){t.$set(t.searchForm,"name","string"===typeof e?e.trim():e)},expression:"searchForm.name"}})],1),t._v(" "),r("el-form-item",[r("el-select",{staticStyle:{width:"100% !important"},attrs:{placeholder:"请选择所属活动"},model:{value:t.searchForm.groupId,callback:function(e){t.$set(t.searchForm,"groupId","string"===typeof e?e.trim():e)},expression:"searchForm.groupId"}},t._l(t.groupList,(function(t){return r("el-option",{key:t.id,attrs:{value:t.id,label:t.name}})})),1)],1),t._v(" "),r("el-form-item",[r("el-button",{attrs:{type:"danger"},on:{click:t.getList}},[t._v("搜索")])],1)],1),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:"chances",label:"中奖概率"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(100*e.row.chances)+"%\n ")]}}])}),t._v(" "),r("el-table-column",{attrs:{align:"center",prop:"stock",label:"库存"}}),t._v(" "),r("el-table-column",{attrs:{align:"center",prop:"enabled",label:"是否启用"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.enabled?"启用":"不启用")+"\n ")]}}])}),t._v(" "),r("el-table-column",{attrs:{align:"center",prop:"memo",label:"备注"},scopedSlots:t._u([{key:"default",fn:function(t){return[r("tooltip",{attrs:{content:t.row.memo}})]}}])}),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:"luckDrawPrize/update",expression:"'luckDrawPrize/update'"}],attrs:{type:"text"},on:{click:function(r){return t.onOperationTrophy("update",e.row)}}},[t._v("修改")])]}}])})],1),t._v(" "),r("pagination",{attrs:{total:t.pageInfo.total,page:t.pageInfo.page,limit:t.pageInfo.limit,"page-sizes":t.pageInfo.page_size},on:{"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),t._v(" "),r("el-dialog",{attrs:{title:t.formTitle[t.formActionTitle],visible:t.lotteryCreateStatus,width:"600px"},on:{"update:visible":function(e){t.lotteryCreateStatus=e}}},[r("trophy-create",{attrs:{groupList:t.groupList,getList:t.getList,close:t.onPopupClose}})],1),t._v(" "),r("el-dialog",{attrs:{title:t.formTitle[t.formActionTitle],visible:t.lotteryStatus,width:"500px"},on:{"update:visible":function(e){t.lotteryStatus=e},close:function(e){return t.onFormClose("trophyForm")}}},[r("el-form",{ref:"trophyForm",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:"groupId"}},[r("el-select",{staticStyle:{width:"100% !important"},attrs:{placeholder:"请选择所属活动"},model:{value:t.form.groupId,callback:function(e){t.$set(t.form,"groupId","string"===typeof e?e.trim():e)},expression:"form.groupId"}},t._l(t.groupList,(function(t){return r("el-option",{key:t.id,attrs:{value:t.id,label:t.name}})})),1)],1),t._v(" "),r("el-form-item",{attrs:{label:"中奖概率",prop:"chances"}},[r("el-input",{attrs:{type:"number",autocomplete:"off",placeholder:"请输入中奖概率"},model:{value:t.form.chances,callback:function(e){t.$set(t.form,"chances","string"===typeof e?e.trim():e)},expression:"form.chances"}},[r("i",{staticClass:"el-input__icon",staticStyle:{"padding-right":"5px"},attrs:{slot:"suffix"},slot:"suffix"},[t._v("%")])])],1),t._v(" "),r("el-form-item",{attrs:{label:"库存",prop:"stock"}},[r("el-input",{attrs:{type:"number",autocomplete:"off",placeholder:"请输入库存"},model:{value:t.form.stock,callback:function(e){t.$set(t.form,"stock","string"===typeof e?e.trim():e)},expression:"form.stock"}})],1),t._v(" "),r("el-form-item",{attrs:{label:"备注",prop:"memo"}},[r("el-input",{attrs:{type:"textarea",rows:2,autocomplete:"off",placeholder:"请输入备注"},model:{value:t.form.memo,callback:function(e){t.$set(t.form,"memo","string"===typeof e?e.trim():e)},expression:"form.memo"}})],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)},n=[function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("h2",[r("div",{staticClass:"squrt"}),t._v("奖品设置\n ")])}],a=(r("7f7f"),r("c5f6"),r("96cf"),r("3b8d")),i=r("a5b0"),s=r("333d"),l=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("el-form",{ref:"ruleForm",attrs:{model:t.form,rules:t.rules}},[r("el-form-item",{attrs:{label:"所属活动",prop:"groupId","label-width":"100PX"}},[r("el-select",{staticStyle:{width:"100% !important"},attrs:{placeholder:"请选择所属活动"},model:{value:t.form.groupId,callback:function(e){t.$set(t.form,"groupId","string"===typeof e?e.trim():e)},expression:"form.groupId"}},t._l(t.groupList,(function(t){return r("el-option",{key:t.id,attrs:{value:t.id,label:t.name}})})),1)],1),t._v(" "),t._l(t.form.rewordList,(function(e,o){return r("el-row",{key:o,attrs:{gutter:10}},[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"奖品"+(o+1),"label-width":"100PX",prop:"rewordList."+o+".name",rules:[{required:!0,message:"请输入活动名称",trigger:"blur"}]}},[r("el-input",{attrs:{autocomplete:"off",placeholder:"请输入奖品名称"},model:{value:e.name,callback:function(r){t.$set(e,"name","string"===typeof r?r.trim():r)},expression:"reword.name"}})],1)],1),t._v(" "),r("el-col",{attrs:{span:7}},[r("el-form-item",{attrs:{prop:"rewordList."+o+".chances",rules:[{required:!0,validator:t.validNumber,trigger:"blur"}]}},[r("el-input",{attrs:{type:"number",autocomplete:"off",placeholder:"请输入中奖概率"},model:{value:e.chances,callback:function(r){t.$set(e,"chances","string"===typeof r?r.trim():r)},expression:"reword.chances"}},[r("i",{staticClass:"el-input__icon",staticStyle:{"padding-right":"5px"},attrs:{slot:"suffix"},slot:"suffix"},[t._v("%")])])],1)],1),t._v(" "),r("el-col",{attrs:{span:5}},[r("el-form-item",{attrs:{prop:"rewordList."+o+".stock",rules:[{required:!0,validator:t.validNumber1,trigger:"blur"}]}},[r("el-input",{attrs:{type:"number",autocomplete:"off",placeholder:"请输入库存"},model:{value:e.stock,callback:function(r){t.$set(e,"stock","string"===typeof r?r.trim():r)},expression:"reword.stock"}})],1)],1)],1)})),t._v(" "),r("div",{staticStyle:{"text-align":"center"}},[r("el-button",{staticClass:"add-reword",attrs:{round:"",icon:"el-icon-plus"},on:{click:t.onAddReword}},[t._v("添加奖品")])],1),t._v(" "),r("el-form-item",{attrs:{label:"备注","label-width":"100PX",prop:"memo"}},[r("el-input",{attrs:{type:"textarea",rows:2,autocomplete:"off",placeholder:"请输入备注"},model:{value:t.form.memo,callback:function(e){t.$set(t.form,"memo","string"===typeof e?e.trim():e)},expression:"form.memo"}})],1)],2),t._v(" "),r("div",{staticClass:"dialog-footer"},[r("el-button",{on:{click:function(e){return t.onClose("ruleForm")}}},[t._v("取 消")]),t._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.onSubmit("ruleForm")}}},[t._v("确 定")])],1)],1)},c=[],u=(r("5a0c"),r("e3eb")),m=r.n(u),p=r("3a73"),d=function(t,e,r){""==e&&"string"==typeof e||null==e?r(new Error("请输入库存")):e<0?r(new Error("输入值不能小于0")):r()},f=function(t,e,r){""==e&&"string"==typeof e||null==e?r(new Error("请输入中奖概率")):e<0?r(new Error("输入值不能小于0")):r()},g={components:{pagination:s["a"],Tooltip:i["a"]},props:["groupList","close","getList"],data:function(){return{validNumber1:d,validNumber:f,form:{groupId:null,rewordList:[{name:null,chances:null,stock:null}],memo:null},rules:{groupId:[{required:!0,message:"请选择所属活动",trigger:"change"}]},pageInfo:{limit:10,page:1,total:1,page_size:[10,20,40,50]}}},mounted:function(){},methods:{onAddReword:function(){var t=this.form;t.rewordList.push({name:null,chances:null,stock:null})},onSubmit:function(t){var e=this;this.$refs[t].validate((function(t){if(t){console.log(e.form);var r=Object.assign({},e.form),o={name:r.name,groupId:r.groupId,chances:r.chances?r.chances/100:0,stock:r.stock,memo:r.memo,enabled:1};o.id=r.id,luckDrawPrizeUpdate(o).then((function(t){e.messageTips("修改",t)}))}}))},messageTips:function(t,e){200==e.code?(this.$message.success(t+"成功"),this.lotteryStatus=!1,this.getList()):this.$message.error(e.msg)},onClose:function(t){this.$refs[t].resetFields(),this.close()}}},h=g,b=(r("ab73"),r("2877")),v=Object(b["a"])(h,l,c,!1,null,"41b6eabd",null),w=v.exports,y={components:{pagination:s["a"],Tooltip:i["a"],trophyCreate:w},data:function(){return{searchForm:{name:null,groupId:null},formTitle:{create:"添加奖品",update:"修改奖品"},formActionTitle:"create",lotteryStatus:!1,lotteryCreateStatus:!1,tableList:[],groupList:[],form:{name:null,groupId:null,chances:null,stock:null,memo:null},rules:{name:[{required:!0,message:"请输入活动名称",trigger:"blur"}],groupId:[{required:!0,message:"请选择所属活动",trigger:"change"}],chances:[{required:!0,message:"请输入中奖概率",trigger:"blur"}],stock:[{required:!0,message:"请输入库存",trigger:"blur"}],enabled:[{required:!0,message:"请选择是否启用",trigger:"change"}]},pageInfo:{limit:10,page:1,total:1,page_size:[10,20,40,50]}}},created:function(){},mounted:function(){var t=Object(a["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.__init();case 2:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),activated:function(){var t=Object(a["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.__init();case 2:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),methods:{__init:function(){var t=Object(a["a"])(regeneratorRuntime.mark((function t(){var e,r=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=this.$route.query,t.next=3,Object(p["b"])({page:1,rows:9999}).then((function(t){var o,n=t.data;200==t.code&&(r.groupList=(null===n||void 0===n?void 0:n.length)>0?n:[],r.searchForm.groupId=e.groupId?Number(e.groupId):null===(o=r.groupList[0])||void 0===o?void 0:o.id)}));case 3:this.getList();case 4:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),onOperationTrophy:function(t,e){var r=this;this.formActionTitle=t,"update"==t?(this.$nextTick((function(){r.form={id:e.id,name:e.name,groupId:e.groupId,chances:100*e.chances,stock:e.stock,memo:e.memo}})),this.lotteryStatus=!0):"create"==t&&(this.lotteryCreateStatus=!0)},onSubmit:function(t){var e=this;this.$refs[t].validate((function(t){if(t){console.log(e.form);var r=Object.assign({},e.form),o={name:r.name,groupId:r.groupId,chances:r.chances?r.chances/100:0,stock:r.stock,memo:r.memo,enabled:1};"create"==e.formActionTitle?Object(p["f"])(o).then((function(t){e.messageTips("添加",t)})):"update"==e.formActionTitle&&(o.id=r.id,Object(p["h"])(o).then((function(t){e.messageTips("修改",t)})))}}))},onPopupClose:function(){this.lotteryCreateStatus=!1},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(p["g"])(m()(e)).then((function(e){200==e.code&&e.data&&(t.tableList=e.data.rows,t.pageInfo.total=e.data.total)}))}}},_=y,k=Object(b["a"])(_,o,n,!1,null,null,null);e["default"]=k.exports}}]);