text: (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-773b"],{HFLT:function(e,t,a){"use strict";var n=a("iU54");a.n(n).a},NFRA:function(e,t,a){"use strict";a.r(t);var n=a("14Xm"),i=a.n(n),s=a("D3Ub"),l=a.n(s),r=a("mav0"),o=a("7Qib"),c=new Date(new Date((new Date).toLocaleDateString()).setMonth((new Date).getMonth()-1)),u={data:function(){return{labelPosition:"right",q:{couponNo:"",status:"",startTime:"",endTime:""},activeNames:[],tableData:[],statusList:[{id:0,name:"待审核"},{id:.5,name:"已驳回"},{id:1,name:"已通过"}],page:{pageSize:10,total:0,currentPage:1},value:[Object(r.b)(c),Object(r.b)(new Date)],pickerOptions2:{disabledDate:function(e){return e.getTime()>Date.now()-864e4},shortcuts:[{text:"当日",onClick:function(e){var t=Object(r.d)("CURRENTDAY").endTime,a=Object(r.d)("CURRENTDAY").startTime;e.$emit("pick",[a,t])}},{text:"上日",onClick:function(e){var t=Object(r.d)("YESTERODAY").endTime,a=Object(r.d)("YESTERODAY").startTime;e.$emit("pick",[a,t])}},{text:"本周",onClick:function(e){var t=Object(r.d)("CURRENTWEEK").endTime,a=Object(r.d)("CURRENTWEEK").startTime;e.$emit("pick",[a,t])}},{text:"上周",onClick:function(e){var t=Object(r.d)("PREWEEK").endTime,a=Object(r.d)("PREWEEK").startTime;e.$emit("pick",[a,t])}},{text:"本月",onClick:function(e){var t=new Date,a=new Date,n=new Date(a.getFullYear(),a.getMonth(),1);a.setTime(a.getTime()-2592e6),e.$emit("pick",[Object(r.b)(n),Object(r.b)(t)])}},{text:"上月",onClick:function(e){var t=new Date,a=new Date(t.getFullYear(),t.getMonth(),1),n=new Date(t.getFullYear(),t.getMonth()-1,1),i=new Date(a.getTime()-864e5);e.$emit("pick",[Object(r.b)(n),Object(r.b)(i)])}},{text:"最近三个月",onClick:function(e){var t=new Date,a=new Date;a.setTime(a.getTime()-7776e6),e.$emit("pick",[Object(r.b)(a),Object(r.b)(t)])}}]},coupons:[{value:"0",name:"全额券"},{value:"1",name:"服务费券"},{value:"2",name:"预付款券"}],obtains:[{value:"1",name:"用户领取"},{value:"2",name:"系统发放"}],sends:[{value:"1",name:"注册发放"},{value:"2",name:"实名发放"},{value:"3",name:"升级商家等级发放"},{value:"4",name:"手动发券"}],c:{},d:{},switchForm:!1,panelTitle:"优惠券审核",flag:!1,auditTip:!1}},filters:{statusFilter:function(e){switch(e){case"0":return"info";case"1":return"success";case"0.5":return"danger";default:return"info"}},formatStatus:function(e){switch(e){case"0":return"待审核";case"1":return"已通过";case"0.5":return"已驳回";default:return"未知状态"}}},created:function(){this.query()},methods:{hasPermission:function(e){return Object(o.f)(e)},selectTime:function(e){return e.map(function(e){return"string"!=typeof e?Object(r.b)(e):e})},query:function(){var e=this;return l()(i.a.mark(function t(){var a,n;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e.value=e.selectTime(e.value),e.q.startTime=e.value[0]+" 00:00:00",e.q.endTime=e.value[1]+" 23:59:59",a="&couponNo="+e.q.couponNo+"&status="+e.q.status+"&startTime="+e.q.startTime+"&endTime="+e.q.endTime,t.next=6,e._fetch("/couponCheck/list?type=0&limit=10&page=1"+a,{method:"GET"});case 6:0===(n=t.sent).code?(e.tableData=n.page.list,e.page.total=n.page.totalCount,e.page.pageSize=n.page.pageSize):console.log(n.msg);case 8:case"end":return t.stop()}},t,e)}))()},reset:function(){this.value=[Object(r.b)(c),Object(r.b)(new Date)],this.q={couponNo:"",status:"",startTime:this.value[0]+" 00:00:00",endTime:this.value[1]+" 23:59:59"}},getInfo:function(e){var t=this;return l()(i.a.mark(function a(){var n;return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t._fetch("/couponCheck/info/"+e,{method:"GET"});case 2:0===(n=a.sent).code?(t.c=n.couponDetail,t.d.endDate=t.c.endDate):t.$message(n.msg);case 4:case"end":return a.stop()}},a,t)}))()},checkup:function(e,t){console.log(t),"0"!==t.status?this.flag=!1:this.flag=!0,this.getInfo(t.couponNo),this.d.id=t.id,this.d.couponNo=t.couponNo,this.switchForm=!0},onSubmit:function(){if("0"!=this.d.status){if(Object(o.g)(this.d.loginPwd))return void this.$message("登录密码不能为空");if(Object(o.g)(this.d.payPwd))return void this.$message("支付密码不能为空")}this.d.status?this.auditTip=!0:this.$message("请选择审核意见")},auditConfirm:function(){var e=this;return l()(i.a.mark(function t(){var a;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return console.log(e.d),t.next=3,e._fetch("/couponCheck/update",{method:"POST",body:e.d});case 3:0===(a=t.sent).code?(e.$message("操作成功"),e.query(),e.switchForm=!1):e.$message(a.msg),e.auditTip=!1;case 6:case"end":return t.stop()}},t,e)}))()},reback:function(){this.switchForm=!1},handleSizeChange:function(e){var t=this;return l()(i.a.mark(function a(){var n;return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t._fetch("/couponCheck/list?limit="+e+"&page="+t.page.currentPage,{method:"GET"});case 2:n=a.sent,t.tableData=n.page.list,t.page.pageSize=e;case 5:case"end":return a.stop()}},a,t)}))()},handleCurrentChange:function(e){var t=this;return l()(i.a.mark(function a(){var n;return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t._fetch("/couponCheck/list?limit="+t.page.pageSize+"&page="+e,{method:"GET"});case 2:n=a.sent,t.tableData=n.page.list,t.page.currentPage=e;case 5:case"end":return a.stop()}},a,t)}))()},rowClass:function(){return"text-align:center"}}},d=(a("HFLT"),a("KHd+")),p=Object(d.a)(u,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"page-container"},[a("div",{directives:[{name:"show",rawName:"v-show",value:!e.switchForm,expression:"!switchForm"}],staticClass:"show-box"},[a("div",{staticClass:"query-box"},[a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:e.q}},[a("el-form-item",{staticClass:"form-item",attrs:{label:""}},[a("el-input",{attrs:{placeholder:"请输入券批次号"},model:{value:e.q.couponNo,callback:function(t){e.$set(e.q,"couponNo","string"==typeof t?t.trim():t)},expression:"q.couponNo"}})],1),e._v(" "),a("el-form-item",{staticClass:"form-item"},[a("el-select",{attrs:{placeholder:"请选择审核状态"},model:{value:e.q.status,callback:function(t){e.$set(e.q,"status",t)},expression:"q.status"}},[a("el-option",{attrs:{value:""}},[e._v("请选择审核状态")]),e._v(" "),e._l(e.statusList,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})],2)],1),e._v(" "),a("el-form-item",{staticClass:"form-item"},[a("el-date-picker",{attrs:{type:"daterange",align:"right","unlink-panels":"","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","picker-options":e.pickerOptions2},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}})],1)],1)],1),e._v(" "),a("div",{staticClass:"btn-box"},[e.hasPermission("couponCheck:list")?a("el-button",{attrs:{type:"primary"},on:{click:e.query}},[e._v("查询")]):e._e(),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.reset}},[e._v("重置")])],1),e._v(" "),a("div",{staticClass:"tb-box"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":e.rowClass,border:"","max-height":"500"}},[a("el-table-column",{attrs:{type:"index",width:"40",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{type:"selection",width:"45",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{prop:"id",label:"id",align:"left",width:"60"}}),e._v(" "),a("el-table-column",{attrs:{prop:"couponNo",label:"券批次号",align:"left"}}),e._v(" "),a("el-table-column",{attrs:{prop:"status",label:"审核状态",align:"left",width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-tag",{attrs:{type:e._f("statusFilter")(t.row.status)}},[e._v(e._s(e._f("formatStatus")(t.row.status)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"createTime",label:"创建时间",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{prop:"updateTime",label:"审核时间",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{prop:"updateUser",label:"审核人",align:"left",width:"120"}}),e._v(" "),a("el-table-column",{attrs:{prop:"rmk",label:"审核意见",align:"left"}}),e._v(" "),a("el-table-column",{attrs:{prop:"",label:"操作",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e.hasPermission("couponCheck:update")?a("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(a){e.checkup(t.$index,t.row)}}},[e._v("审查")]):e._e()]}}])})],1)],1),e._v(" "),a("div",{staticClass:"block"},[a("el-pagination",{attrs:{"current-page":e.page.currentPage,"page-sizes":[10,30,50],"page-size":e.page.pageSize,total:e.page.total,layout:"total, sizes, prev, pager, next, jumper",background:""},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)]),e._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:e.switchForm,expression:"switchForm"}],staticClass:"form-section"},[a("div",{staticClass:"panel"},[a("span",[e._v(e._s(e.panelTitle))])]),e._v(" "),a("div",{staticClass:"form-container"},[a("el-form",{attrs:{"label-position":"right","label-width":"160px",model:e.c}},[a("el-form-item",{attrs:{label:"服务商名称"}},[a("el-input",{attrs:{disabled:""},model:{value:e.c.dealerName,callback:function(t){e.$set(e.c,"dealerName",t)},expression:"c.dealerName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"券名称"}},[a("el-input",{attrs:{disabled:""},model:{value:e.c.couponName,callback:function(t){e.$set(e.c,"couponName",t)},expression:"c.couponName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"券状态"}},[a("el-radio-group",{attrs:{disabled:""},model:{value:e.c.status,callback:function(t){e.$set(e.c,"status",t)},expression:"c.status"}},[a("el-radio",{attrs:{label:"0.5"}},[e._v("待审核")]),e._v(" "),a("el-radio",{attrs:{label:"1"}},[e._v("有效")]),e._v(" "),a("el-radio",{attrs:{label:"-0.5"}},[e._v("审核驳回")]),e._v(" "),a("el-radio",{attrs:{label:"-1"}},[e._v("过期失效")])],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"券类型"}},[a("el-select",{attrs:{placeholder:"选择券类型",disabled:""},model:{value:e.c.couponType,callback:function(t){e.$set(e.c,"couponType",t)},expression:"c.couponType"}},e._l(e.coupons,function(e){return a("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})}))],1),e._v(" "),a("el-form-item",{attrs:{label:"券面额"}},[a("el-input",{attrs:{disabled:""},model:{value:e.c.price,callback:function(t){e.$set(e.c,"price",t)},expression:"c.price"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"满多少可用"}},[a("el-input",{attrs:{disabled:""},model:{value:e.c.fullPrice,callback:function(t){e.$set(e.c,"fullPrice",t)},expression:"c.fullPrice"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"券生效起始时间"}},[a("el-input",{attrs:{disabled:""},model:{value:e.c.startDate,callback:function(t){e.$set(e.c,"startDate",t)},expression:"c.startDate"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"券有效截止时间"}},[a("el-input",{attrs:{disabled:""},model:{value:e.c.endDate,callback:function(t){e.$set(e.c,"endDate",t)},expression:"c.endDate"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"券领取后有多少天失效"}},[a("el-input",{attrs:{disabled:""},model:{value:e.c.couponGetInvalidDay,callback:function(t){e.$set(e.c,"couponGetInvalidDay",t)},expression:"c.couponGetInvalidDay"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"券初始化数量"}},[a("el-input",{attrs:{disabled:""},model:{value:e.c.couponNumber,callback:function(t){e.$set(e.c,"couponNumber",t)},expression:"c.couponNumber"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"每人获取次数上限"}},[a("el-input",{attrs:{disabled:""},model:{value:e.c.obtainLimit,callback:function(t){e.$set(e.c,"obtainLimit",t)},expression:"c.obtainLimit"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"券获取方式"}},[a("el-select",{attrs:{placeholder:"选择获取方式",disabled:""},model:{value:e.c.obtainType,callback:function(t){e.$set(e.c,"obtainType",t)},expression:"c.obtainType"}},e._l(e.obtains,function(e){return a("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})}))],1),e._v(" "),a("el-form-item",{attrs:{label:"发券场景"}},[a("el-select",{attrs:{placeholder:"选择发券场景",disabled:""},model:{value:e.c.sendType,callback:function(t){e.$set(e.c,"sendType",t)},expression:"c.sendType"}},e._l(e.sends,function(e){return a("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})}))],1),e._v(" "),a("el-form-item",{attrs:{label:"券限制条件"}},[a("el-input",{attrs:{disabled:""},model:{value:e.c.closeDate,callback:function(t){e.$set(e.c,"closeDate",t)},expression:"c.closeDate"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"券描述信息"}},[a("el-input",{attrs:{type:"textarea",disabled:""},model:{value:e.c.description,callback:function(t){e.$set(e.c,"description",t)},expression:"c.description"}})],1),e._v(" "),e._e(),e._v(" "),a("el-form-item",{attrs:{label:"备注信息"}},[a("el-input",{attrs:{type:"textarea",disabled:!e.flag,placeholder:"备注信息"},model:{value:e.d.rmk,callback:function(t){e.$set(e.d,"rmk",t)},expression:"d.rmk"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"登录密码"}},[a("el-input",{attrs:{disabled:!e.flag,placeholder:"登录密码",type:"password"},model:{value:e.d.loginPwd,callback:function(t){e.$set(e.d,"loginPwd",t)},expression:"d.loginPwd"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"支付密码"}},[a("el-input",{attrs:{disabled:!e.flag,placeholder:"支付密码",type:"password"},model:{value:e.d.payPwd,callback:function(t){e.$set(e.d,"payPwd",t)},expression:"d.payPwd"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"审核意见"}},[a("el-radio-group",{model:{value:e.d.status,callback:function(t){e.$set(e.d,"status",t)},expression:"d.status"}},[a("el-radio",{attrs:{label:"1"}},[e._v("同意")]),e._v(" "),a("el-radio",{attrs:{label:"0.5"}},[e._v("驳回")])],1)],1)],1),e._v(" "),a("div",{staticClass:"submit-btn"},[a("el-form",[a("el-form-item",{staticClass:"btn"},[a("el-button",{attrs:{type:"primary",disabled:!e.flag},on:{click:e.onSubmit}},[e._v("提交")]),e._v(" "),a("el-button",{attrs:{type:"warning"},on:{click:e.reback}},[e._v("返回")])],1)],1)],1)],1),e._v(" "),a("el-dialog",{attrs:{title:"提示",visible:e.auditTip,width:"20%",top:"30vh"},on:{"update:visible":function(t){e.auditTip=t}}},[a("span",[e._v("确定提交？")]),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.auditTip=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.auditConfirm}},[e._v("确 定")])],1)])],1)])},[],!1,null,"f5e402f6",null);p.options.__file="couponcheck.vue";t.default=p.exports},iU54:function(e,t,a){},mav0:function(e,t,a){"use strict";a.d(t,"b",function(){return d}),a.d(t,"d",function(){return k}),a.d(t,"a",function(){return T}),a.d(t,"c",function(){return D}),a.d(t,"e",function(){return x});var n=new Date,i=0===n.getDay()?6:n.getDay()-1,s=n.getDate(),l=n.getMonth(),r=n.getYear();r+=r<2e3?1900:0;var o=new Date;o.setDate(1),o.setMonth(o.getMonth()-1);var c=o.getYear();c+=c<2e3?1900:0;var u=o.getMonth();function d(e){var t=e.getFullYear(),a=e.getMonth()+1,n=e.getDate();return a<10&&(a="0"+a),n<10&&(n="0"+n),t+"-"+a+"-"+n}function p(e){var t=new Date(r,e,1);return(new Date(r,e+1,1)-t)/864e5}var m=d(m=new Date(r,l,s)),b=d(b=new Date(r,l,s-1)),v=d(v=new Date(r,l,s-i)),f=(d(new Date(r,l,s+(6-i))),d(f=new Date(r,l,s-i-7))),g=d(g=new Date(r,l,s+(6-i-7))),h=d(h=new Date(r,l,1)),w=(d(new Date(r,l,p(l))),d(w=new Date(c,u,1))),_=d(_=new Date(c,u,p(u)));function k(e){var t={startTime:"",endTime:""};switch(e){case"CURRENTDAY":return t.startTime=m,t.endTime=m,t;case"YESTERODAY":return t.startTime=b,t.endTime=b,t;case"CURRENTWEEK":return t.startTime=v,t.endTime=m,t;case"PREWEEK":return t.startTime=f,t.endTime=g,t;case"CURRENTMONTH":return t.startTime=h,t.endTime=m,t;case"PREMONTH":return t.startTime=w,t.endTime=_,t;default:return t}}function T(e){var t=new Date(e),a=t.getMonth()+1,n=t.getDate(),i=t.getHours(),s=t.getMinutes(),l=t.getSeconds();return a>=1&&a<=9&&(a="0"+a),n>=0&&n<=9&&(n="0"+n),i>=0&&i<=9&&(i="0"+i),s>=0&&s<=9&&(s="0"+s),l>=0&&l<=9&&(l="0"+l),t.getFullYear()+"-"+a+"-"+n+" "+i+":"+s+":"+l}function D(e){e.split("");return e.substring(0,4)+"-"+e.substring(4,6)+"-"+e.substring(6,8)+" "+e.substring(9,11)+":"+e.substring(11,13)+":"+e.substring(13,15)}function x(e,t){if(""!=e&&""!=t){e=new Date(e.replace(/-/g,"/"));var a=(t=new Date(t.replace(/-/g,"/"))).getTime()-e.getTime();return parseInt(a/864e5)>60||void 0}this.$message("时间不能为空")}}}]);