webpackJsonp([30],{L4UB:function(t,e){},WvRy:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=a("CCn6"),s={name:"index",components:{page:a("kmJW").a},data:function(){return{nowPage:1,total:0,limit:10,useTypeList:[{id:0,value:"未使用"},{id:1,value:"已使用"},{id:2,value:"禁用"}],searchFrom:{user_id:"",out_trade_no:"",status:0},list:[],dialogObj:{show:!1},value1:"",rowId:""}},filters:{filterStatus:function(t){var e="";return 0===t?e="未使用":1===t?e="已使用":2===t&&(e="禁用"),e}},mounted:function(){this.getList()},methods:{editTime:function(t){this.dialogObj.show=!0,this.value1=new Date(t.deadline_at),this.rowId=t.id,console.log(t)},onConfirm:function(){var t=this;console.log(this.value1),Object(o._11)({deadline_at:this.value1},this.rowId).then(function(e){t.dialogObj.show=!1,t.getList()})},dayline:function(t){return"0000-00-00 00:00:00"==t.deadline_at?"永不过期":t.deadline_at},onPageChange:function(t){this.nowPage=t,this.getList()},onSizeChange:function(t){this.nowPage=1,this.limit=t,this.getList()},getList:function(){var t=this,e={limit:this.limit,page:this.nowPage};this.searchFrom.user_id&&(e.user_id=this.searchFrom.user_id),(this.searchFrom.status||0===this.searchFrom.status)&&(e.status=this.searchFrom.status),this.searchFrom.out_trade_no&&(e.out_trade_no=this.searchFrom.out_trade_no),Object(o._52)(e).then(function(e){t.total=e.total,t.list=e.list?e.list:[]})}}},l={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"refund"},[a("el-form",{ref:"searchFrom",attrs:{model:t.searchFrom,"label-width":"100px",inline:""}},[a("el-form-item",{attrs:{label:"用户ID"}},[a("el-input",{model:{value:t.searchFrom.user_id,callback:function(e){t.$set(t.searchFrom,"user_id",e)},expression:"searchFrom.user_id"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"订单号"}},[a("el-input",{model:{value:t.searchFrom.out_trade_no,callback:function(e){t.$set(t.searchFrom,"out_trade_no",e)},expression:"searchFrom.out_trade_no"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"使用状态"}},[a("el-select",{attrs:{placeholder:"请选择",clearable:""},on:{change:t.getList},model:{value:t.searchFrom.status,callback:function(e){t.$set(t.searchFrom,"status",e)},expression:"searchFrom.status"}},t._l(t.useTypeList,function(t){return a("el-option",{key:t.id,attrs:{label:t.value,value:t.id}})}))],1),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:t.getList}},[t._v("搜索")])],1)],1),t._v(" "),a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.list}},[a("el-table-column",{attrs:{prop:"coupon_no",label:"优惠券码"}}),t._v(" "),a("el-table-column",{attrs:{prop:"out_trade_no",label:"订单号"}}),t._v(" "),a("el-table-column",{attrs:{label:"用户信息","min-width":"140",className:"userInfo"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("img",{staticClass:"avatar",attrs:{src:e.row.user_avatar}}),t._v("\n        "+t._s(e.row.user_nickname)+"(ID:"+t._s(e.row.user_id)+")\n      ")]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"优惠券金额"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n        "+t._s(parseFloat(e.row.money/100))+"元\n      ")]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"使用状态"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n        "+t._s(t._f("filterStatus")(e.row.status))+"\n      ")]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"desc",label:"备注"}}),t._v(" "),a("el-table-column",{attrs:{prop:"deadline_at",label:"过期时间",formatter:t.dayline}}),t._v(" "),a("el-table-column",{attrs:{prop:"use_at",label:"使用时间",sortable:""}}),t._v(" "),t.$store.state.readonly?t._e():a("el-table-column",{attrs:{label:"操作","min-width":"150"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text",plain:"",size:"mini"},on:{click:function(a){t.editTime(e.row)}}},[t._v("\n          修改过期时间\n        ")])]}}])})],1),t._v(" "),a("el-dialog",{attrs:{title:"修改过期时间",visible:t.dialogObj.show},on:{"update:visible":function(e){t.$set(t.dialogObj,"show",e)}}},[a("el-date-picker",{attrs:{type:"datetime","value-format":"yyyy-MM-dd-HH-mm-ss",placeholder:"选择日期时间"},model:{value:t.value1,callback:function(e){t.value1=e},expression:"value1"}}),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.dialogObj.show=!1}}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:t.onConfirm}},[t._v("确 定")])],1)],1),t._v(" "),a("page",{attrs:{nowPage:t.nowPage,total:t.total},on:{pageChange:t.onPageChange,sizeChange:t.onSizeChange}})],1)},staticRenderFns:[]};var n=a("VU/8")(s,l,!1,function(t){a("YqS3"),a("L4UB")},"data-v-ad731cc8",null);e.default=n.exports},YqS3:function(t,e){}});