chunk-ec93b9b0.undefined.1677810488137.js 16 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ec93b9b0"],{"048c":function(e,t){e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},"10dd":function(e,t,o){var r=o("3b43"),a=o("5e68").EXISTS,n=o("ce5b"),i=o("98fb").f,l=Function.prototype,s=n(l.toString),f=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,c=n(f.exec),u="name";r&&!a&&i(l,u,{configurable:!0,get:function(){try{return c(f,s(this))[1]}catch(e){return""}}})},"151e":function(e,t,o){"use strict";o("f117")},"1a91":function(e,t,o){var r=o("8735"),a=o("059b"),n=o("4683"),i=o("5d45"),l=o("ee7c"),s=function(e){if(e&&e.forEach!==i)try{l(e,"forEach",i)}catch(t){e.forEach=i}};for(var f in a)a[f]&&s(r[f]&&r[f].prototype);s(n)},"51b3":function(e,t,o){"use strict";var r=o("3b43"),a=o("8735"),n=o("ce5b"),i=o("4a63"),l=o("ef11"),s=o("6c75"),f=o("55f9"),c=o("a7b6"),u=o("f7b9"),m=o("9b88"),p=o("9ad2"),d=o("a9c5").f,b=o("f182").f,g=o("98fb").f,h=o("e14f"),y=o("53d0").trim,v="Number",T=a[v],S=T.prototype,_=a.TypeError,w=n("".slice),I=n("".charCodeAt),k=function(e){var t=m(e,"number");return"bigint"==typeof t?t:E(t)},E=function(e){var t,o,r,a,n,i,l,s,f=m(e,"number");if(u(f))throw _("Cannot convert a Symbol value to a number");if("string"==typeof f&&f.length>2)if(f=y(f),t=I(f,0),43===t||45===t){if(o=I(f,2),88===o||120===o)return NaN}else if(48===t){switch(I(f,1)){case 66:case 98:r=2,a=49;break;case 79:case 111:r=8,a=55;break;default:return+f}for(n=w(f,2),i=n.length,l=0;l<i;l++)if(s=I(n,l),s<48||s>a)return NaN;return parseInt(n,r)}return+f};if(i(v,!T(" 0o1")||!T("0b1")||T("+0x1"))){for(var M,x=function(e){var t=arguments.length<1?0:T(k(e)),o=this;return c(S,o)&&p((function(){h(o)}))?f(Object(t),o,x):t},N=r?d(T):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),$=0;N.length>$;$++)s(T,M=N[$])&&!s(x,M)&&g(x,M,b(T,M));x.prototype=S,S.constructor=x,l(a,v,x)}},"53d0":function(e,t,o){var r=o("ce5b"),a=o("8e74"),n=o("3ffc"),i=o("048c"),l=r("".replace),s="["+i+"]",f=RegExp("^"+s+s+"*"),c=RegExp(s+s+"*$"),u=function(e){return function(t){var o=n(a(t));return 1&e&&(o=l(o,f,"")),2&e&&(o=l(o,c,"")),o}};e.exports={start:u(1),end:u(2),trim:u(3)}},"55f9":function(e,t,o){var r=o("97dc"),a=o("bf1f"),n=o("17b3");e.exports=function(e,t,o){var i,l;return n&&r(i=t.constructor)&&i!==o&&a(l=i.prototype)&&l!==o.prototype&&n(e,l),e}},"5a05":function(e,t,o){"use strict";var r=o("88d4"),a=o("34cd").filter,n=o("3a6d"),i=n("filter");r({target:"Array",proto:!0,forced:!i},{filter:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}})},"5d45":function(e,t,o){"use strict";var r=o("34cd").forEach,a=o("fbe3"),n=a("forEach");e.exports=n?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},acc0:function(e,t,o){"use strict";var r=o("88d4"),a=o("8735"),n=o("b595"),i=o("0859"),l=o("bf1f"),s=o("1c34"),f=o("126a"),c=o("63ef"),u=o("c40a"),m=o("d0ff"),p=o("3a6d"),d=o("4b57"),b=p("slice"),g=m("species"),h=a.Array,y=Math.max;r({target:"Array",proto:!0,forced:!b},{slice:function(e,t){var o,r,a,m=c(this),p=f(m),b=s(e,p),v=s(void 0===t?p:t,p);if(n(m)&&(o=m.constructor,i(o)&&(o===h||n(o.prototype))?o=void 0:l(o)&&(o=o[g],null===o&&(o=void 0)),o===h||void 0===o))return d(m,b,v);for(r=new(void 0===o?h:o)(y(v-b,0)),a=0;b<v;b++,a++)b in m&&u(r,a,m[b]);return r.length=a,r}})},c40a:function(e,t,o){"use strict";var r=o("d6be"),a=o("98fb"),n=o("d9c5");e.exports=function(e,t,o){var i=r(t);i in e?a.f(e,i,n(0,o)):e[i]=o}},e14f:function(e,t,o){var r=o("ce5b");e.exports=r(1..valueOf)},f117:function(e,t,o){},fbe3:function(e,t,o){"use strict";var r=o("9ad2");e.exports=function(e,t){var o=[][e];return!!o&&r((function(){o.call(null,t||function(){return 1},1)}))}},fe55:function(e,t,o){"use strict";o.r(t);var r=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"context"},[o("div",{staticClass:"panel"},[o("el-page-header",{attrs:{content:"活动详情"},on:{back:e.goBack}}),o("div",{staticClass:"panel-body"},[o("div",{staticClass:"panel_control"},[o("el-row",{attrs:{gutter:1}},[o("el-col",{attrs:{span:6}},[o("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(t){return e.addNew()}}},[e._v("新增")]),o("el-button",{attrs:{type:"",size:"mini"},on:{click:function(t){return e.deleteItem()}}},[e._v("删除")]),o("el-button",{attrs:{type:"",size:"mini"},on:{click:function(t){return e.editItem()}}},[e._v("编辑")])],1)],1)],1)])],1),o("div",{staticClass:"table"},[o("el-table",{attrs:{data:e.tableData,border:"","is-horizontal-resize":"","default-sort":{prop:"date",order:"descending"},"element-loading-background":"rgba(0, 0, 0, 0.8)","summary-method":e.getSummaries},on:{"current-change":e.clickChange}},[o("el-table-column",{attrs:{label:"选择",width:"55"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-radio",{attrs:{label:t.row},model:{value:e.tableRadio,callback:function(t){e.tableRadio=t},expression:"tableRadio"}},[o("i")])]}}])}),o("el-table-column",{attrs:{label:"序号",type:"index",width:"50",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("span",[e._v(e._s(e.start+t.$index+1))])]}}])}),o("el-table-column",{attrs:{prop:"PdName",label:"名称",sortable:""}}),o("el-table-column",{attrs:{prop:"DType",label:"类型",sortable:""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e._f("getDType")(t.row.DType))+" ")]}}])}),o("el-table-column",{attrs:{prop:"Price",label:"价格",sortable:""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(t.row.Price/100)+" ")]}}])}),o("el-table-column",{attrs:{prop:"EffectiveMonths",label:"月租","min-width":"30dp",sortable:"",align:"center"}},[o("el-table-column",{attrs:{prop:"EffectiveMonths",label:"购买",sortable:""}}),o("el-table-column",{attrs:{prop:"GiftMonths",label:"赠送",sortable:""}})],1),o("el-table-column",{attrs:{prop:"EffectiveMonths",label:"课时","min-width":"30dp",sortable:"",align:"center"}},[o("el-table-column",{attrs:{prop:"NormalHour",label:"购买",sortable:""}}),o("el-table-column",{attrs:{prop:"GiftHour",label:"赠送",sortable:""}})],1),o("el-table-column",{attrs:{prop:"ShowBt",label:"课时时限",sortable:""},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.beginTimeStr?o("div",[e._v(" "+e._s(e._f("filterTime")(t.row.beginTimeStr))+" 至 "+e._s(e._f("filterTime")(t.row.endTimeStr))+" ")]):o("div",[e._v(" 无 ")])]}}])}),o("el-table-column",{attrs:{prop:"ShowBt",label:"显示时限",sortable:""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e._f("filterTime")(t.row.ShowBt))+" 至 "+e._s(e._f("filterTime")(t.row.ShowEt))+" ")]}}])})],1),o("br"),o("el-pagination",{attrs:{background:"",total:e.pageination.total,"page-size":e.pageination.pageItem},on:{"current-change":e.pageChange}})],1),o("el-dialog",{attrs:{title:e.dialogTitle,visible:e.dialogVisible,width:"840px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[o("div",{staticClass:"dialogContent"},[o("el-form",{ref:"form",attrs:{model:e.form,"label-width":"115px"}},[o("el-form-item",{attrs:{label:"详情名称"}},[o("el-input",{model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),o("el-form-item",{attrs:{label:"价格"}},[o("el-input",{model:{value:e.form.price,callback:function(t){e.$set(e.form,"price",t)},expression:"form.price"}})],1),o("el-form-item",{attrs:{label:"活动类型",required:!0}},[o("el-radio-group",{staticStyle:{"margin-left":"-180px"},model:{value:e.form.dType,callback:function(t){e.$set(e.form,"dType",t)},expression:"form.dType"}},[1==e.pType||2==e.pType?o("el-radio",{attrs:{label:"1"}},[e._v("月租包")]):e._e(),1==e.pType?o("el-radio",{attrs:{label:"2"}},[e._v("课时包")]):e._e(),1==e.pType?o("el-radio",{attrs:{label:"4"}},[e._v("限时课时包")]):e._e(),2==e.pType?o("el-radio",{attrs:{label:"5"}},[e._v("特殊活动包")]):e._e()],1)],1),2==e.form.dType||4==e.form.dType?o("el-form-item",{attrs:{label:"有效类型",required:!0}},[o("el-radio-group",{staticStyle:{"margin-left":"-180px"},model:{value:e.form.validityType,callback:function(t){e.$set(e.form,"validityType",t)},expression:"form.validityType"}},[o("el-radio",{attrs:{label:"1"}},[e._v("长期")]),o("el-radio",{attrs:{label:"2"}},[e._v("短期")])],1)],1):e._e(),2!=e.form.dType&&4!=e.form.dType||2!=e.form.validityType?e._e():o("el-form-item",{attrs:{label:"课时时限"}},[o("el-date-picker",{attrs:{type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},model:{value:e.form.timeScope,callback:function(t){e.$set(e.form,"timeScope",t)},expression:"form.timeScope"}})],1),1==e.form.dType?o("el-form-item",{attrs:{label:"购买月租"}},[o("el-input",{model:{value:e.form.effectiveMonths,callback:function(t){e.$set(e.form,"effectiveMonths",t)},expression:"form.effectiveMonths"}})],1):e._e(),1==e.form.dType?o("el-form-item",{attrs:{label:"赠送月租"}},[o("el-input",{model:{value:e.form.giftMonths,callback:function(t){e.$set(e.form,"giftMonths",t)},expression:"form.giftMonths"}})],1):e._e(),2==e.form.dType||4==e.form.dType?o("el-form-item",{attrs:{label:"购买课时"}},[o("el-input",{model:{value:e.form.normalHour,callback:function(t){e.$set(e.form,"normalHour",t)},expression:"form.normalHour"}})],1):e._e(),2==e.form.dType||4==e.form.dType?o("el-form-item",{attrs:{label:"赠送课时"}},[o("el-input",{model:{value:e.form.giftHour,callback:function(t){e.$set(e.form,"giftHour",t)},expression:"form.giftHour"}})],1):e._e(),o("el-form-item",{attrs:{label:"显示时限"}},[o("el-date-picker",{attrs:{type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},model:{value:e.form.showTimeScope,callback:function(t){e.$set(e.form,"showTimeScope",t)},expression:"form.showTimeScope"}})],1)],1)],1),o("div",{staticClass:"dialogFooter"},[1==e.form.dialogType?o("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.confirmAdd()}}},[e._v("确定")]):e._e(),2==e.form.dialogType?o("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.confirmEdit()}}},[e._v("确定")]):e._e(),o("el-button",{attrs:{type:"info",size:"small"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("关闭")])],1)])],1)},a=[],n=(o("10dd"),o("acc0"),o("89a8"),o("d5ee"),o("5a05"),o("1a91"),o("8ea3"),o("51b3"),o("379d"),o("b8a1")),i=o("daf0"),l={data:function(){return{dialogVisible:!1,dialogTitle:"添加优惠活动",start:0,draw:1,recordsTotal:0,panel:{},tableRadio:[],pageination:{pageItem:10,total:100,pageIndex:1},pId:"",pType:"",form:{pdId:"",dialogType:1,name:"",price:"",dType:"1",validityType:"1",effectiveMonthseffectiveMonths:"",giftMonths:"",normalHour:"",giftHour:"",timeScope:globalBt2(7),showTimeScope:globalBt2(7)},tableData:[],allTableData:[],loading:!1,searchBtnStatus:!1}},mounted:function(){this.pId=this.$route.query.PId,this.pType=this.$route.query.PType,this.getTableQuery()},watch:{$route:function(e){"PromotionDetail"==e.name&&(this.pId=this.$route.query.PId,this.pType=this.$route.query.PType,this.getTableQuery())}},filters:{filterTime:function(e){return e?nonTfmtDate(e).slice(0,10):0},getDType:function(e){switch(e){case 1:return"月租包";case 2:return"课时包";case 4:return"限时课时包";case 5:return"特殊课时包"}return""}},methods:{clickChange:function(e){this.tableRadio=e},filterFmtDate:function(e,t,o){return nonTfmtDatetoLength(o,9)},goBack:function(){this.$router.push({path:"/PromotionList",query:{}})},addNew:function(){var e=this;e.dialogVisible=!0,e.dialogTitle="活动详情添加",e.dialogType=1,e.form.name="",e.form.price="",e.form.dType="1",e.form.validityType="1",e.form.validityType="",e.form.giftMonths="",e.form.normalHour="",e.form.giftHour="",e.form.timeScope=globalBt2(7),e.form.showTimeScope=globalBt2(7)},confirmAdd:function(){var e=this,t=this,o={token:localStorage.token,pId:t.pId,pdName:t.form.name,price:100*t.form.price,dType:t.form.dType,validityType:t.form.validityType,effectiveMonths:t.form.effectiveMonths,giftMonths:t.form.giftMonths,normalHour:t.form.normalHour,giftHour:t.form.giftHour,bt:nonTfmtDatetoLength(t.form.timeScope[0],10)+" 00:00:00",et:nonTfmtDatetoLength(t.form.timeScope[1],10)+" 23:59:59",showBt:nonTfmtDatetoLength(t.form.showTimeScope[0],10)+" 00:00:00",showEt:nonTfmtDatetoLength(t.form.showTimeScope[1],10)+" 23:59:59"},r=i.stringify(o);Object(n["Sd"])(r).then((function(o){var r=o;0==r.Code?(t.dialogVisible=!1,t.getTableQuery(),e.$message.success("添加成功")):t.$message.error(r.Memo+" 错误码:"+r.Code)}))},deleteItem:function(){var e=this,t=this;if(0==this.tableRadio.length)return this.$message.error("请先选中一条记录"),!1;var o=t.tableRadio,r={token:localStorage.token,pdId:o.PdId,status:9},a=i.stringify(r);this.$confirm("此操作将永久删除该项, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(n["Vd"])(a).then((function(e){var o=e;0==o.Code?(t.getTableQuery(),t.$message({showClose:!0,message:"删除成功",type:"success"})):t.$message.error(o.Memo)}))})).catch((function(){e.$message({type:"info",message:"已取消删除"})}))},editItem:function(){var e=this;if(0==this.tableRadio.length)return this.$message.error("请先选中一条记录"),!1;e.form.dialogTitle="活动详情编辑",e.form.dialogType=2,e.dialogVisible=!0;var t=e.tableRadio;e.form.pdId=t.PdId,e.form.name=t.PdName,e.form.price=t.Price/100,e.form.dType=t.DType.toString(),e.form.validityType=t.ValidityType.toString(),e.form.timeScope=[t.BeginTime,t.EndTime],e.form.effectiveMonths=t.EffectiveMonths,e.form.giftMonths=t.GiftMonths,e.form.normalHour=t.NormalHour,e.form.giftHour=t.GiftHour,e.form.showTimeScope=[t.ShowBt,t.ShowEt]},confirmEdit:function(){var e=this,t=this,o={token:localStorage.token,pdId:t.form.pdId,pdName:t.form.name,price:100*t.form.price,dType:t.form.dType,validityType:t.form.validityType,effectiveMonths:t.form.effectiveMonths,giftMonths:t.form.giftMonths,normalHour:t.form.normalHour,giftHour:t.form.giftHour,bt:nonTfmtDatetoLength(t.form.timeScope[0],10)+" 00:00:00",et:nonTfmtDatetoLength(t.form.timeScope[1],10)+" 23:59:59",showBt:nonTfmtDatetoLength(t.form.showTimeScope[0],10)+" 00:00:00",showEt:nonTfmtDatetoLength(t.form.showTimeScope[1],10)+" 23:59:59"},r=i.stringify(o);Object(n["Td"])(r).then((function(o){var r=o;0==r.Code?(t.dialogVisible=!1,t.getTableQuery(),e.$message.success("编辑成功")):t.$message.error(r.Memo+" 错误码:"+r.Code)}))},query:function(){var e=this;e.searchBtnStatus=!0;var t=2;window.setInterval((function(){t--,t<0&&(t=2,e.searchBtnStatus=!1)}),1e3);this.getTableQuery(),this.$message.success("查询完毕")},getTableQuery:function(){var e=this;e.loading=!0;var t={token:localStorage.token,pId:e.$route.query.PId},o=i.stringify(t);Object(n["Ud"])(o).then((function(t){var o=t;0==o.Code?(e.loading=!1,o.Rs?(e.allTableData=o.Rs,e.recordsTotal=o.Rs.length):(e.allTableData=[],e.recordsTotal=0),e.setPaginations()):e.$message.error(o.Memo+" 错误码:"+o.Code)}))},setPaginations:function(){var e=this;e.pageination.total=e.recordsTotal,e.tableData=e.allTableData.filter((function(t,o){return o<e.pageination.pageItem}))},handleSizeChange:function(){var e=this;e.tableData=e.allTableData.filter((function(t,o){return o<e.pageination.pageItem})),e.draw=e.pageination.pageItem,e.getTableQuery()},pageChange:function(e){for(var t=this,o=t.pageination.pageItem*(e-1),r=t.pageination.pageItem*e,a=[],n=o;n<r;n++)t.allTableData[n]&&a.push(t.allTableData[n]),this.tableData=a;t.start=o*t.draw,t.getTableQuery()},sortChange:function(e){console.log(e)},getSummaries:function(e){var t=e.columns,o=e.data,r=[];return t.forEach((function(e,t){if(0!==t){var a=o.map((function(t){return Number(t[e.property])}));a.every((function(e){return isNaN(e)}))||3!=t?r[t]="":(r[t]=a.reduce((function(e,t){var o=Number(t);return isNaN(o)?e:e+t}),0),r[t]+="",r[t]=parseInt(r[t]),3==t&&(r[t]/=100))}else r[t]="合计"})),r}}},s=l,f=(o("151e"),o("cba8")),c=Object(f["a"])(s,r,a,!1,null,"3a6fa0ad",null);t["default"]=c.exports}}]);