(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c1cf9"],{4843:function(t,e,o){"use strict";o.r(e);var n=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"app-container"},[o("xy-table",{ref:"tableRef",attrs:{table:t.table,columns:t.columns},scopedSlots:t._u([{key:"couponType",fn:function(e){var n=e.scope;return[o("dict-tag",{attrs:{options:t.dict.type.coupon_type2,value:n.row.couponType}})]}},{key:"expiryType",fn:function(e){var o=e.scope;return[t._v(" "+t._s("1"===o.row.expiryType?o.row.fixedEffectiveTime+" ~ "+o.row.fixedExpiryTime:"领取后"+o.row.expiryDayNum+"天内")+" ")]}},{key:"left",fn:function(e){var o=e.scope;return[t._v(" "+t._s(o.row.total-o.row.used)+" ")]}},{key:"state",fn:function(e){var o=e.scope;return[t._v(" "+t._s("A"===o.row.state?"启用":"P"===o.row.state?"禁用":"")+" ")]}}])}),o("el-dialog",{attrs:{title:t.title,visible:t.open,width:"500px","append-to-body":""},on:{"update:visible":function(e){t.open=e}}},[o("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,"label-width":"120px"}},[o("el-form-item",{attrs:{label:"分类名称",prop:"categoryName"}},[o("el-input",{attrs:{placeholder:"请输入分类名称"},model:{value:t.form.categoryName,callback:function(e){t.$set(t.form,"categoryName",e)},expression:"form.categoryName"}})],1),o("el-form-item",{attrs:{label:"是否前端展示",prop:"isShow"}},[o("el-radio-group",{model:{value:t.form.isShow,callback:function(e){t.$set(t.form,"isShow",e)},expression:"form.isShow"}},t._l(t.dict.type.classify_isshow,(function(e){return o("el-radio",{key:e.value,attrs:{label:e.value}},[t._v(t._s(e.label))])})),1)],1)],1),o("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("确 定")]),o("el-button",{on:{click:t.cancel}},[t._v("取 消")])],1)],1)],1)},a=[],i=o("1da1"),r=(o("96cf"),o("b775"));function s(t){return Object(r["a"])({url:"/xh/coupon/coupon/xhlist",method:"post",data:t})}function l(t){return Object(r["a"])({url:"/xh/coupon/coupon/editStatus",method:"post",data:t})}var c={name:"CouponList",dicts:["coupon_type2"],data:function(){var t=this;return{open:!1,title:void 0,form:{id:void 0,categoryName:void 0,isShow:"0"},rules:{categoryName:[{required:!0,message:"分类名称不能为空",trigger:"blur"}]},table:{rowKey:"couponInfoId",data:[],firstColumn:{type:"index"},operator:[{text:"编辑",icon:"el-icon-edit",fun:function(e){return t.handleEdit(e)}},{text:"启用",icon:"el-icon-check",show:{key:"state",val:["P"]},fun:function(e){return t.handleStatusChange(e)}},{text:"禁用",icon:"el-icon-close",show:{key:"state",val:["A"]},fun:function(e){return t.handleStatusChange(e)}},{text:"数据",icon:"el-icon-help",fun:function(e){return t.handleMoreData(e)}}],operatorConfig:{width:180},toolbar:[],page:{total:0,pageNum:1,pageSize:10},searchForm:{formLabelWidth:"90px",formData:{couponName:void 0,state:void 0,couponType:void 0},fieldList:[{prop:"couponName",label:"优惠券标题",type:"input"},{prop:"state",label:"状态",type:"select",options:"stateOptions"},{prop:"couponType",label:"优惠券类型",type:"select",options:"couponTypeOptions"}],listOptions:{stateOptions:[{value:"A",label:"启用"},{value:"P",label:"禁用"}],couponTypeOptions:[]}},request:s},columns:[{prop:"couponName",label:"优惠券标题"},{prop:"couponType",label:"优惠券类型",slotName:"couponType"},{prop:"categoryName",label:"优惠券分类"},{prop:"expiryType",label:"有效期",slotName:"expiryType",minWidth:200},{prop:"total",label:"总库存"},{label:"剩余库存",slotName:"left"},{prop:"used",label:"已发放"},{prop:"state",label:"状态",slotName:"state"}]}},mounted:function(){this.initOptions()},methods:{initOptions:function(){this.table.searchForm.listOptions.couponTypeOptions=this.dict.type.coupon_type2},getList:function(){this.$refs.tableRef.getData()},handleAdd:function(){},handleEdit:function(t){},handleDelete:function(t){return Object(i["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})))()},handleStatusChange:function(t){var e=this,o="P"===t.state?"启用":"禁用";this.$modal.confirm('确认要"'+o+'""'+t.couponName+'"优惠券吗？').then((function(){return l({id:t.couponInfoId,status:"P"===t.state?"A":"P"})})).then((function(){e.$modal.msgSuccess(o+"成功"),e.getList()})).catch((function(){}))},handleMoreData:function(){},submitForm:function(){var t=this;this.$refs["form"].validate((function(e){e&&(void 0!=t.form.id?updateClassify(t.form).then((function(e){t.$modal.msgSuccess("修改成功"),t.open=!1,t.getList()})):addClassify(t.form).then((function(e){t.$modal.msgSuccess("新增成功"),t.open=!1,t.getList()})))}))},reset:function(){this.form={id:void 0,categoryName:void 0,isShow:"0"},this.resetForm("form")},cancel:function(){this.open=!1,this.reset()}}},p=c,u=o("2877"),f=Object(u["a"])(p,n,a,!1,null,null,null);e["default"]=f.exports}}]);