1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5c6c01fa"],{"0a7d":function(e,t,l){"use strict";l.d(t,"a",(function(){return r})),l.d(t,"i",(function(){return n})),l.d(t,"g",(function(){return o})),l.d(t,"c",(function(){return u})),l.d(t,"h",(function(){return i})),l.d(t,"d",(function(){return s})),l.d(t,"e",(function(){return c})),l.d(t,"f",(function(){return f})),l.d(t,"b",(function(){return v})),l.d(t,"j",(function(){return b}));var a=l("829b"),r=(l("4328"),function(e){return Object(a["a"])({url:"/api-web/sysCoupon/add",data:e,method:"post",requestType:"form"})}),n=function(e){return Object(a["a"])({url:"/api-web/sysCoupon/updateCoupon",data:e,method:"post",requestType:"form"})},o=function(e){return Object(a["a"])({url:"/api-web/sysCoupon/queryPage",data:e,params:e,method:"get"})},u=function(e){return Object(a["a"])({url:"/api-web/sysCoupon/delete",data:e,method:"post",requestType:"form"})},i=function(e){return Object(a["a"])({url:"/api-web/sysCouponCode/queryPage",data:e,params:e,method:"get"})},s=function(e){return Object(a["a"])({url:"/api-web/sysCouponIssue/issueCoupon",data:e,method:"post"})},c=function(e){return Object(a["a"])({url:"/api-web/sysCouponIssue/queryIssueRecord",data:e,method:"post"})},f=function(e){return Object(a["a"])({url:"/api-web/sysCouponIssue/queryIssueDetail",data:e,method:"post"})},v=function(e){return Object(a["a"])({url:"/api-web/sysCouponIssue/checkRevoke",data:e,method:"post"})},b=function(e){return Object(a["a"])({url:"/api-web/sysCouponIssue/revokeCoupon",data:e,method:"post"})}},"52fa":function(e,t,l){"use strict";l("94a9")},"92e3":function(e,t,l){"use strict";l.d(t,"v",(function(){return i})),l.d(t,"I",(function(){return s})),l.d(t,"t",(function(){return c})),l.d(t,"c",(function(){return f})),l.d(t,"E",(function(){return v})),l.d(t,"bb",(function(){return b})),l.d(t,"Z",(function(){return p})),l.d(t,"d",(function(){return d})),l.d(t,"M",(function(){return m})),l.d(t,"x",(function(){return h})),l.d(t,"db",(function(){return T})),l.d(t,"u",(function(){return E})),l.d(t,"o",(function(){return y})),l.d(t,"cb",(function(){return O})),l.d(t,"Q",(function(){return C})),l.d(t,"fb",(function(){return S})),l.d(t,"gb",(function(){return I})),l.d(t,"P",(function(){return _})),l.d(t,"U",(function(){return N})),l.d(t,"C",(function(){return R})),l.d(t,"l",(function(){return g})),l.d(t,"Y",(function(){return w})),l.d(t,"eb",(function(){return A})),l.d(t,"J",(function(){return L})),l.d(t,"m",(function(){return D})),l.d(t,"w",(function(){return x})),l.d(t,"N",(function(){return M})),l.d(t,"f",(function(){return k})),l.d(t,"e",(function(){return j})),l.d(t,"L",(function(){return U})),l.d(t,"K",(function(){return G})),l.d(t,"T",(function(){return P})),l.d(t,"H",(function(){return H})),l.d(t,"a",(function(){return $})),l.d(t,"y",(function(){return Y})),l.d(t,"p",(function(){return V})),l.d(t,"n",(function(){return q})),l.d(t,"q",(function(){return B})),l.d(t,"g",(function(){return F})),l.d(t,"G",(function(){return J})),l.d(t,"r",(function(){return X})),l.d(t,"D",(function(){return K})),l.d(t,"B",(function(){return W})),l.d(t,"A",(function(){return z})),l.d(t,"h",(function(){return Q})),l.d(t,"k",(function(){return Z})),l.d(t,"i",(function(){return ee})),l.d(t,"j",(function(){return te})),l.d(t,"S",(function(){return le})),l.d(t,"O",(function(){return ae})),l.d(t,"F",(function(){return re})),l.d(t,"z",(function(){return ne})),l.d(t,"R",(function(){return oe})),l.d(t,"V",(function(){return ue})),l.d(t,"X",(function(){return ie})),l.d(t,"s",(function(){return se})),l.d(t,"ab",(function(){return ce})),l.d(t,"W",(function(){return fe})),l.d(t,"b",(function(){return be}));var a=l("b85c"),r=l("3835"),n=l("267e"),o=sessionStorage.getItem("tenantConfig");o=o?JSON.parse(o):{};var u=o.tenantId,i=null,s=null;1==u?(s=[{label:"声部课",value:"SINGLE"},{label:"合奏课",value:"MIX"},{label:"基础技能课",value:"HIGH"},{label:"线上基础技能课",value:"HIGH_ONLINE"},{label:"乐团网管课",value:"MUSIC_NETWORK"},{label:"集训声部课",value:"TRAINING_SINGLE"},{label:"集训合奏课",value:"TRAINING_MIX"},{label:"课堂课",value:"CLASSROOM"},{label:"综合课",value:"COMPREHENSIVE"}],i=[{label:"声部课",value:"SINGLE"},{label:"合奏课",value:"MIX"},{label:"基础技能课",value:"HIGH"},{label:"线上基础技能课",value:"HIGH_ONLINE"},{label:"vip课",value:"VIP"},{label:"试听课",value:"DEMO"},{label:"综合课",value:"COMPREHENSIVE"},{label:"网管课",value:"PRACTICE"},{label:"乐团网管课",value:"MUSIC_NETWORK"},{label:"启蒙课",value:"ENLIGHTENMENT"},{label:"集训声部课",value:"TRAINING_SINGLE"},{label:"集训合奏课",value:"TRAINING_MIX"},{label:"课堂课",value:"CLASSROOM"},{label:"对外课",value:"COMM"},{label:"直播课",value:"LIVE"}]):(s=[{label:"声部课",value:"SINGLE"},{label:"合奏课",value:"MIX"},{label:"基础技能课",value:"HIGH"},{label:"集训声部课",value:"TRAINING_SINGLE"},{label:"集训合奏课",value:"TRAINING_MIX"},{label:"课堂课",value:"CLASSROOM"},{label:"综合课",value:"COMPREHENSIVE"}],i=[{label:"声部课",value:"SINGLE"},{label:"合奏课",value:"MIX"},{label:"vip课",value:"VIP"},{label:"试听课",value:"DEMO"},{label:"综合课",value:"COMPREHENSIVE"},{label:"网管课",value:"PRACTICE"},{label:"启蒙课",value:"ENLIGHTENMENT"},{label:"集训声部课",value:"TRAINING_SINGLE"},{label:"集训合奏课",value:"TRAINING_MIX"},{label:"课堂课",value:"CLASSROOM"},{label:"对外课",value:"COMM"},{label:"直播课",value:"LIVE"}]);var c=[{label:"乐团课",value:"MUSIC"},{label:"VIP课",value:"VIP"},{label:"网管课",value:"PRACTICE"},{label:"直播课",value:"LIVE"}],f=[{label:"正常签到",value:1},{label:"异常签到",value:0}],v=[{label:"兼职",value:"PART_TIME"},{label:"全职",value:"FULL_TIME"},{label:"劳务",value:"LABOUR"}],b=[{label:"正常",value:"0"},{label:"冻结",value:"1"},{label:"锁定",value:"9"}],p=[{value:"NORMAL",label:"正常"},{value:"TRUANT",label:"旷课"},{value:"LEAVE",label:"请假"}],d=[].concat(p,[{value:"QUIT_SCHOOL",label:"休学"},{value:"DROP_OUT",label:"退学"},{value:"LATE",label:"迟到"}]),m=[{value:"APPLY",label:"报名"},{value:"RENEW",label:"续费"},{value:"MEMBER",label:"学练宝购买"},{value:"SMALL_CLASS_TO_BUY",label:"VIP购买"},{value:"SPORADIC",label:"零星收费"},{value:"LUCK",label:"福袋活动"},{value:"DEGREE_REGISTRATION",label:"考级报名"},{value:"DOUBLE_ELEVEN2020",label:"2020双十一活动"},{value:"DOUBLE_ELEVEN2021",label:"2021双十一活动"},{value:"DEGREE",label:"儿童节活动"},{value:"PRACTICE_GROUP_BUY",label:"网管课"},{value:"PRACTICE_GROUP_RENEW",label:"网管课续费"},{value:"REPAIR",label:"乐器维修"},{value:"OUTORDER",label:"外部收入"},{value:"GOODS_SELL",label:"商品销售"},{value:"MALL_BUY",label:"商城销售"},{value:"SUBJECT_CHANGE",label:"声部更换"},{value:"MAINTENANCE",label:"乐器保养"},{value:"ADD_STUDENT",label:"乐团报名"},{value:"REPLACEMENT",label:"乐器置换"},{value:"SCHOOL",label:"学校订单"},{value:"PERSONAL",label:"个人订单"},{value:"OTHER",label:"其他"},{value:"ACTIVITY",label:"活动购买"},{value:"LIVE_BUY",label:"直播购物"},{value:"LIVE_GROUP_BUY",label:"直播课购买"},{value:"SCHOOL_GOODS_PURCHASE",label:"商品采购"},{value:"DIRECTOR_TRAINING_CAMP",label:"乐队指导培训"}],h=[{value:"ING",label:"交易中"},{value:"SUCCESS",label:"成功交易"},{value:"FAILED",label:"交易失败"},{value:"CLOSE",label:"交易关闭"}],T=[{value:"0",text:"未开始"},{value:"1",text:"报名中"},{value:"2",text:"进行中"},{value:"4",text:"已结束"},{value:"3",text:"取消"}],E=[{value:"NOT_START",label:"未开始"},{value:"UNDERWAY",label:"进行中"},{value:"OVER",label:"已结束"}],y=[{value:"NORMAL",label:"进行中"},{value:"FINISH",label:"结束"},{value:"CANCEL",label:"关闭"},{value:"LOCK",label:"锁定"}],O=[{value:"RECHARGE",label:"充值"},{value:"CONSUME",label:"建课"},{value:"RETURN",label:"退课"},{value:"MANUAL_ADD",label:"系统充值"},{value:"MANUAL_SUB",label:"系统扣除"}],C=[{value:"FREE",label:"免费"},{value:"CHARGE",label:"收费"},{value:"TRIAL",label:"试听课"},{value:"CARE_PACKAGE",label:"关心包"},{value:"COME_ON_PACKAGE",label:"加油包"}],S=[{value:"课程推荐",label:"课程推荐",children:[{value:"新课推荐",label:"新课推荐"},{value:"续费提醒",label:"续费提醒"}]},{value:"常规回访",label:"常规回访",children:[{value:"课后及练习回访",label:"课后及练习回访"},{value:"练习及乐团表现",label:"练习及乐团表现"}]},{value:"其它",label:"其它",children:[{value:"其它",label:"其它"}]}],I=[{value:"课程推荐",label:"课程推荐",children:[{value:"新课推荐",label:"新课推荐"},{value:"续费提醒",label:"续费提醒"}]},{value:"常规回访",label:"常规回访",children:[{value:"课后及练习回访",label:"课后及练习回访"},{value:"练习及乐团表现",label:"练习及乐团表现"},{label:"考勤申诉",value:"考勤申诉"},{value:"异常请假回访",label:"异常请假回访"}]},{value:"小课回访",label:"小课回访",children:[{value:"续费类回访",label:"续费类回访"},{value:"服务回访",label:"服务回访"},{value:"其他",label:"其他"}]},{value:"学练宝",label:"学练宝",children:[{value:"体验回访",label:"体验回访"}]},{value:"其它",label:"其它",children:[{value:"其它",label:"其它"},{value:"会员续费",label:"会员续费"}]}],_=[{value:"YQPAY",label:"双乾"},{value:"BALANCE",label:"余额"},{value:"ADAPAY",label:"汇付"},{value:"YEEPAY",label:"易宝"}],N=[{value:"INSTRUMENT",label:"乐器销售"},{value:"ACCESSORIES",label:"配件销售"},{value:"SCHOOL_BUY",label:"学校采购"},{value:"OTHER",label:"其它"}],R=[{value:"INSTRUMENT",label:"乐器"},{value:"ACCESSORIES",label:"辅件"},{value:"TEACHING",label:"教材"},{value:"STAFF",label:"教谱"},{value:"OTHER",label:"其它"}],g=[{value:"1",label:"一年级"},{value:"2",label:"二年级"},{value:"3",label:"三年级"},{value:"4",label:"四年级"},{value:"5",label:"五年级"},{value:"6",label:"六年级"},{value:"7",label:"初一"},{value:"8",label:"初二"},{value:"9",label:"初三"},{value:"10",label:"高一"},{value:"11",label:"高二"},{value:"12",label:"高三"}],w=[{value:"INTERNAL",label:"内部"},{value:"EXTERNAL",label:"外部"},{value:"ALL",label:"全部"}],A=[{label:"不限制",value:"1"},{label:"线上不可调为线下",value:"0"},{label:"线下不可调为线上",value:"2"},{label:"线上线下不可互调",value:"3"}],L=ve(n["musicGroupType"]),D=ve(n["classTime"]),x=[{label:"课程收费",value:0},{label:"会员收费",value:2},{label:"免费",value:3}],M=ve(n["payOrderType"]),k=ve(n["auditType"]),j=ve(n["auditPaymentType"]),U=ve(n["orderServerType"]),G=ve(n["orderAuditType"]),P=ve(n["rewardModeType"]),H=ve(n["musicClassType"]),$=ve(n["ProbationPeriodStatus"]),Y=ve(n["downListType"]),V=ve(n["conclusion"]),q=ve(n["clientType"]),B=ve(n["couponType"]),F=ve(n["backType"]),J=ve(n["memberEnum"]),X=ve(n["coupontypeDetail"]),K=ve(n["issue"]),W=ve(n["feedbackType"]),z=ve(n["feedbackTypeDesc"]),Q=ve(n["campState"]),Z=ve(n["catgGoupType"]),ee=ve(n["catRole"]),te=ve(n["catType"]),le=ve(n["quiteReason"]),ae=ve(n["payUserType"]),re=ve(n["levelStatus"]),ne=ve(n["evaluateStatus"]),oe=ve(n["problemType"]),ue=ve(n["schoolUserType"]),ie=ve(n["shareLiveType"]),se=ve(n["courseEmnu"]),ce=ve(n["suggestionType"]),fe=ve(n["scoreType"]);function ve(e){var t=[];for(var l in e)t.push({label:e[l],value:l});return t}var be=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["value","label"],l=Object(r["a"])(t,2),n=l[0],o=l[1],u={};if(e&&e.length){var i,s=Object(a["a"])(e);try{for(s.s();!(i=s.n()).done;){var c=i.value;u[c[n]]=c[o]}}catch(f){s.e(f)}finally{s.f()}}return u}},"94a9":function(e,t,l){},eaf4:function(e,t,l){"use strict";l.r(t);var a=function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("div",{staticClass:"m-container"},[l("h2",[l("el-page-header",{attrs:{content:e.title},on:{back:e.onCancel}})],1),e._v(" "),l("div",{staticClass:"m-core"},[l("el-form",{ref:"form",staticClass:"form",attrs:{model:e.form}},[l("el-row",[l("el-col",{staticStyle:{width:"395px"}},[l("el-form-item",{attrs:{label:"系统类型",prop:"useSystem",rules:[{required:!0,message:"系统类型"}]}},[l("el-select",{staticStyle:{width:"375px !important"},attrs:{disabled:e.isDisabled,placeholder:"系统类型",filterable:"",clearable:""},on:{change:e.onUseSystemChange},model:{value:e.form.useSystem,callback:function(t){e.$set(e.form,"useSystem","string"===typeof t?t.trim():t)},expression:"form.useSystem"}},[l("el-option",{attrs:{value:"MALL",label:"商城"}}),e._v(" "),l("el-option",{attrs:{value:"MEC",label:"管乐迷"}})],1)],1)],1),e._v(" "),l("el-col",{staticStyle:{width:"395px"}},[l("el-form-item",{attrs:{label:"优惠券名称",prop:"name",rules:[{required:!0,message:"请输入优惠券名称"}]}},[l("el-input",{attrs:{disabled:e.isDisabled,placeholder:"请输入优惠券名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1)],1)],1),e._v(" "),l("el-row",[l("el-col",{staticStyle:{width:"395px"}},[l("el-form-item",{attrs:{label:"可用分部",prop:"organId",rules:[{required:!0,message:"请选择可用分部"}]}},[l("br"),e._v(" "),l("select-all",{staticClass:"multiple",staticStyle:{width:"375px !important"},attrs:{filterable:"",multiple:"",clearable:"",placeholder:"请选择分部"},model:{value:e.form.organId,callback:function(t){e.$set(e.form,"organId","string"===typeof t?t.trim():t)},expression:"form.organId"}},e._l(e.selects.branchs,(function(e,t){return l("el-option",{key:t,attrs:{label:e.name,value:e.id}})})),1)],1)],1),e._v(" "),l("el-col",{staticStyle:{width:"395px"}},[l("el-form-item",{attrs:{label:"描述",prop:"description",rules:[{required:!0,message:"请输入优惠券描述"}]}},[l("el-input",{attrs:{disabled:e.isDisabled,maxlength:"20",type:"textarea",rows:3,"show-word-limit":"",placeholder:"请输入优惠券描述,该描述会在优惠券上展示"},model:{value:e.form.description,callback:function(t){e.$set(e.form,"description",t)},expression:"form.description"}})],1)],1)],1),e._v(" "),l("el-row",{attrs:{gutter:20}},[l("el-col",{staticStyle:{width:"395px"}},[l("el-form-item",{attrs:{label:"领券方式",prop:"issuanceType",rules:[{required:!0,message:"领券方式"}]}},[l("el-select",{staticStyle:{width:"375px !important"},attrs:{disabled:e.isDisabled,placeholder:"领券方式",filterable:"",clearable:""},model:{value:e.form.issuanceType,callback:function(t){e.$set(e.form,"issuanceType","string"===typeof t?t.trim():t)},expression:"form.issuanceType"}},[l("el-option",{attrs:{value:0,label:"学员主动领取"}}),e._v(" "),l("el-option",{attrs:{value:1,label:"后台手动发放"}})],1)],1)],1),e._v(" "),l("el-col",{staticStyle:{width:"395px"}},[l("el-form-item",{attrs:{label:"优惠券类型",prop:"typeDetail",rules:[{required:!0,message:"请选择优惠券类型"}]}},[l("el-select",{staticStyle:{width:"375px !important"},attrs:{disabled:e.isDisabled,placeholder:"请选择优惠券类型",filterable:"",clearable:""},model:{value:e.form.typeDetail,callback:function(t){e.$set(e.form,"typeDetail","string"===typeof t?t.trim():t)},expression:"form.typeDetail"}},e._l(e.coupontypeDetail,(function(e){return l("el-option",{key:e.value,attrs:{value:e.value,label:e.label,disabled:e.disabled}})})),1)],1)],1)],1),e._v(" "),l("el-row",{attrs:{gutter:20}},["FULL_REDUCTION"==e.form.type?l("el-col",{staticStyle:{width:"395px"}},[l("el-form-item",{attrs:{label:"满减金额",prop:"fullAmount",rules:[{required:!0,message:"请输入满减金额"}]}},[l("el-input",{attrs:{placeholder:"请输入满减金额",disabled:e.isDisabled},model:{value:e.form.fullAmount,callback:function(t){e.$set(e.form,"fullAmount",t)},expression:"form.fullAmount"}},[l("template",{slot:"append"},[e._v("元")])],2)],1)],1):e._e(),e._v(" "),"FULL_REDUCTION"==e.form.type?l("el-col",{staticStyle:{width:"395px"}},[l("el-form-item",{attrs:{label:"面值",prop:"faceValue",rules:[{required:!0,message:"请输入面值"}]}},[l("el-input",{attrs:{placeholder:"请输入面值",disabled:e.isDisabled},model:{value:e.form.faceValue,callback:function(t){e.$set(e.form,"faceValue",t)},expression:"form.faceValue"}},[l("template",{slot:"append"},[e._v("元")])],2)],1)],1):e._e(),e._v(" "),"DISCOUNT"==e.form.type?l("el-col",{staticStyle:{width:"395px"}},[l("el-form-item",{attrs:{label:"折扣",prop:"faceValue",rules:[{required:!0,message:"请输入折扣"}]}},[l("el-input",{attrs:{placeholder:"请输入折扣",disabled:e.isDisabled},model:{value:e.form.faceValue,callback:function(t){e.$set(e.form,"faceValue",t)},expression:"form.faceValue"}},[l("template",{slot:"append"},[e._v("%")])],2)],1)],1):e._e()],1),e._v(" "),l("el-row",{attrs:{gutter:20}},[l("el-col",{staticStyle:{width:"395px"}},[l("el-form-item",{attrs:{label:"有效期类型",prop:"effectiveType",rules:[{required:!0,message:"请选择有效期类型"}]}},[l("el-select",{staticStyle:{width:"375px !important"},attrs:{placeholder:"优惠券类型",filterable:"",clearable:"",disabled:e.isDisabled},on:{change:e.changeEffectiveType},model:{value:e.form.effectiveType,callback:function(t){e.$set(e.form,"effectiveType","string"===typeof t?t.trim():t)},expression:"form.effectiveType"}},[l("el-option",{attrs:{label:"固定有效期天数",value:"DAYS"}}),e._v(" "),l("el-option",{attrs:{label:"固定时间段",value:"TIME_BUCKET"}})],1)],1)],1),e._v(" "),"DAYS"==e.form.effectiveType?l("el-col",{staticStyle:{width:"395px"}},[l("el-form-item",{attrs:{prop:"deadline",rules:[{required:!0,message:"请输入有效期天数"}]}},[l("span",{staticStyle:{color:"#606266"}},[l("span",{staticStyle:{color:"#f56c6c"}},[e._v("*")]),e._v("有效期天数\n "),l("el-tooltip",{attrs:{placement:"top","popper-class":"mTooltip"}},[l("div",{attrs:{slot:"content"},slot:"content"},[e._v("自领取之日起多少天有效")]),e._v(" "),l("i",{staticClass:"el-icon-question",staticStyle:{"font-size":"18px",color:"#f56c6c"}})])],1),e._v(" "),l("el-input",{attrs:{placeholder:"请输入有效期天数",disabled:e.isDisabled},model:{value:e.form.deadline,callback:function(t){e.$set(e.form,"deadline",t)},expression:"form.deadline"}},[l("template",{slot:"append"},[e._v("天")])],2)],1)],1):e._e(),e._v(" "),"TIME_BUCKET"==e.form.effectiveType?l("el-col",{staticStyle:{width:"395px"}},[l("el-form-item",{attrs:{prop:"effectiveTime",rules:[{required:!0,message:"请选择有效期"}]}},[l("span",{staticStyle:{color:"#606266"}},[l("span",{staticStyle:{color:"#f56c6c"}},[e._v("*")]),e._v("有效期\n "),l("el-tooltip",{attrs:{placement:"top","popper-class":"mTooltip"}},[l("div",{attrs:{slot:"content"},slot:"content"},[e._v("优惠券可使用时间段")]),e._v(" "),l("i",{staticClass:"el-icon-question",staticStyle:{"font-size":"18px",color:"#f56c6c"}})])],1),e._v(" "),l("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":"活动结束日期",disabled:e.isDisabled},model:{value:e.form.effectiveTime,callback:function(t){e.$set(e.form,"effectiveTime",t)},expression:"form.effectiveTime"}})],1)],1):e._e()],1),e._v(" "),l("el-row",{attrs:{gutter:20}},[l("el-col",{staticStyle:{width:"395px"}},[l("el-form-item",{attrs:{label:"库存总量",prop:"stockCount",rules:[{required:!0,message:"请输入库存总量"}]}},[l("el-input",{attrs:{disabled:-1==e.form.stockCount,placeholder:"请输入库存总量"},model:{value:e.form.stockCount,callback:function(t){e.$set(e.form,"stockCount",t)},expression:"form.stockCount"}},[l("template",{slot:"append"},[e._v("张")])],2),e._v(" "),l("el-checkbox",{attrs:{"true-label":-1,"false-label":""},on:{change:function(t){e.checkNo(t,"stockCount")}},model:{value:e.form.stockCount,callback:function(t){e.$set(e.form,"stockCount",t)},expression:"form.stockCount"}},[e._v("不限制")])],1)],1),e._v(" "),l("el-col",{staticStyle:{width:"395px"}},[l("el-form-item",{attrs:{prop:"limitExchangeNum",rules:[{required:!0,message:"请输入领取上限"},{pattern:/^[1-9][0-9]?$/,message:"请输入1-99的正整数",trigger:"blur"}]}},[l("span",{staticStyle:{color:"#606266"}},[l("span",{staticStyle:{color:"#f56c6c"}},[e._v("*")]),e._v(" 领取上限\n "),l("el-tooltip",{attrs:{placement:"top","popper-class":"mTooltip"}},[l("div",{attrs:{slot:"content"},slot:"content"},[e._v("用户可领取最大张数")]),e._v(" "),l("i",{staticClass:"el-icon-question",staticStyle:{"font-size":"18px",color:"#f56c6c"}})])],1),e._v(" "),l("el-input",{attrs:{disabled:e.isDisabled,placeholder:"请输入领取上限"},model:{value:e.form.limitExchangeNum,callback:function(t){e.$set(e.form,"limitExchangeNum",t)},expression:"form.limitExchangeNum"}},[l("template",{slot:"append"},[e._v("张")])],2)],1)],1)],1),e._v(" "),l("el-row",{attrs:{gutter:20}},[l("el-col",{staticStyle:{width:"395px"}},[l("el-form-item",{attrs:{label:"领取时间",prop:"getTime",rules:[{required:!0,message:"请输入领取时间"}]}},[l("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:e.form.getTime,callback:function(t){e.$set(e.form,"getTime",t)},expression:"form.getTime"}})],1)],1)],1),e._v(" "),l("el-form-item",[e.activeRow?l("el-button",{attrs:{type:"primary"},on:{click:e.resetCoupon}},[e._v("保存")]):l("el-button",{attrs:{type:"primary"},on:{click:e.addCoupon}},[e._v("提交")]),e._v(" "),l("el-button",{attrs:{type:"danger"},on:{click:e.resetForm}},[e._v("重置")])],1)],1)],1)])},r=[],n=l("c7eb"),o=l("15fd"),u=(l("96cf"),l("1da1")),i=(l("ac6a"),l("7f7f"),l("5530")),s=(l("c5f6"),l("28a5"),l("0a7d")),c=l("92e3"),f=l("ed08"),v=["effectiveTime","getTime"],b=["effectiveTime","getTime"],p={data:function(){return{couponTypeList:c["q"],coupontypeDetail:c["r"],form:{useSystem:"",typeDetail:null,name:"",description:"",type:"FULL_REDUCTION",faceValue:"",fullAmount:"",effectiveType:"",effectiveTime:[],stockCount:"",warningStockNum:"",limitExchangeNum:"",getTime:[],organId:[]},activeRow:null,isDisabled:!1,title:"新增优惠券",warningStockNum:""}},mounted:function(){if(this.$store.dispatch("setBranchs"),this.$route.query.row){var e;this.activeRow=JSON.parse(this.$route.query.row);var t="";this.activeRow.useCondition&&JSON.parse(this.activeRow.useCondition)&&JSON.parse(this.activeRow.useCondition).organId&&(t=JSON.parse(this.activeRow.useCondition).organId);var l=[];t&&(l=t.split(",").map((function(e){return Number(e)}))||[]),this.form=Object(i["a"])(Object(i["a"])({},this.activeRow),{},{organId:l}),this.form.type="FULL_REDUCTION";var a=this.activeRow.effectiveStartTime,r=this.activeRow.effectiveExpireTime,n=this.activeRow.startDate,o=this.activeRow.endDate;this.$set(this.form,"effectiveTime",[a,r]),this.$set(this.form,"getTime",[n,o]),this.title=this.activeRow.name,(null===(e=this.activeRow)||void 0===e?void 0:e.consumeNum)>0&&(this.isDisabled=!0)}},methods:{onUseSystemChange:function(e){var t=this;"MALL"===e?this.coupontypeDetail.forEach((function(e){"MALLCOUPON"===e.value?e.disabled=!1:e.disabled=!0})):"MEC"===e&&this.coupontypeDetail.forEach((function(e){"MALLCOUPON"===e.value?e.disabled=!0:e.disabled=!1})),this.form.typeDetail=null,setTimeout((function(){t.$refs.form.clearValidate("typeDetail")}),0)},changeType:function(e){this.form.faceValue="",this.form.fullAmount=""},changeEffectiveType:function(){this.$set(this.form,"effectiveTime",[]),this.$set(this.form,"deadline",null)},onCancel:function(){this.$router.push("/couponManager")},resetForm:function(){if(this.$refs.form.resetFields(),this.activeRow){var e=JSON.parse(this.activeRow.useCondition),t=[];e&&(t=e.split(",")||[]),this.form=Object(i["a"])(Object(i["a"])({},this.activeRow),{},{organId:t});var l=this.activeRow.effectiveStartTime,a=this.activeRow.effectiveExpireTime,r=this.activeRow.startDate,n=this.activeRow.endDate;this.$set(this.form,"effectiveTime",[l,a]),this.$set(this.form,"getTime",[r,n])}},addCoupon:function(){var e=Object(u["a"])(Object(n["a"])().mark((function e(){var t=this;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.$refs.form.validate(function(){var e=Object(u["a"])(Object(n["a"])().mark((function e(l){return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:l&&t.$confirm("您确定新增优惠券?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(u["a"])(Object(n["a"])().mark((function e(){var l,a,r,u,c,b;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,l=t.form,a=l.effectiveTime,r=l.getTime,u=Object(o["a"])(l,v),c=JSON.stringify({organId:t.form.organId.join(",")}),b=Object(i["a"])(Object(i["a"])(Object(i["a"])(Object(i["a"])({},u),Object(f["d"])(a,["effectiveStartTime","effectiveExpireTime"],"YYYY-MM-DD HH:mm:ss")),Object(f["d"])(r,["startDate","endDate"],"YYYY-MM-DD HH:mm:ss")),{},{useCondition:c}),e.next=6,Object(s["a"])(b);case 6:e.sent,t.$message.success("新增成功"),t.onCancel(),e.next=14;break;case 11:e.prev=11,e.t0=e["catch"](0),console.log(e.t0);case 14:case"end":return e.stop()}}),e,null,[[0,11]])})))).catch((function(){}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),resetCoupon:function(){var e=this;this.$refs.form.validate(function(){var t=Object(u["a"])(Object(n["a"])().mark((function t(l){return Object(n["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:l&&e.$confirm("您确定修改优惠券?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(u["a"])(Object(n["a"])().mark((function t(){var l,a,r,u,c,v;return Object(n["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,l=e.form,a=l.effectiveTime,r=l.getTime,u=Object(o["a"])(l,b),c=JSON.stringify({organId:e.form.organId.join(",")}),v=Object(i["a"])(Object(i["a"])(Object(i["a"])(Object(i["a"])({},u),Object(f["d"])(a,["effectiveStartTime","effectiveExpireTime"],"YYYY-MM-DD HH:mm:ss")),Object(f["d"])(r,["startDate","endDate"],"YYYY-MM-DD HH:mm:ss")),{},{useCondition:c}),t.next=6,Object(s["i"])(v);case 6:t.sent,e.$message.success("修改成功"),e.onCancel(),t.next=14;break;case 11:t.prev=11,t.t0=t["catch"](0),console.log(t.t0);case 14:case"end":return t.stop()}}),t,null,[[0,11]])})))).catch((function(){}));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},checkNo:function(e,t){this.form[t]=e||null}}},d=p,m=(l("52fa"),l("2877")),h=Object(m["a"])(d,a,r,!1,null,"df24b8b8",null);t["default"]=h.exports}}]);
|