You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
6.3 KiB
1 lines
6.3 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0493956f"],{"66ac":function(t,e,a){},9761:function(t,e,a){"use strict";a("66ac")},a4a1:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"divBox"},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("div",{staticClass:"container"},[a("el-form",{attrs:{size:"small",inline:"","label-width":"100px"}},[a("el-form-item",{attrs:{label:"套餐类型:",clearable:""}},[a("el-select",{attrs:{placeholder:"请选择套餐类型",clearable:""},on:{change:function(e){return t.getList("")}},model:{value:t.tableFrom.type,callback:function(e){t.$set(t.tableFrom,"type",e)},expression:"tableFrom.type"}},[a("el-option",{attrs:{value:"0",label:"固定套餐"}},[t._v("固定套餐")]),t._v(" "),a("el-option",{attrs:{value:"1",label:"搭配套餐"}},[t._v("搭配套餐")])],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"套餐状态:"}},[a("el-select",{attrs:{placeholder:"请选择",clearable:""},on:{change:function(e){return t.getList("")}},model:{value:t.tableFrom.status,callback:function(e){t.$set(t.tableFrom,"status",e)},expression:"tableFrom.status"}},[a("el-option",{attrs:{value:"",label:"全部"}},[t._v("全部")]),t._v(" "),a("el-option",{attrs:{value:"1",label:"上架"}},[t._v("上架")]),t._v(" "),a("el-option",{attrs:{value:"0",label:"下架"}},[t._v("下架")])],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"套餐搜索:"}},[a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"请输入套餐名称"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.getList("")}},model:{value:t.tableFrom.title,callback:function(e){t.$set(t.tableFrom,"title",e)},expression:"tableFrom.title"}})],1),t._v(" "),a("el-form-item",{staticStyle:{display:"block"}},[a("el-button",{staticClass:"mr10",attrs:{type:"primary"},on:{click:t.add}},[t._v("添加套餐")])],1)],1)],1)]),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:t.tableData.data}},[a("el-table-column",{attrs:{label:"ID",prop:"discount_id","min-width":"80"}}),t._v(" "),a("el-table-column",{attrs:{label:"套餐名称",prop:"title","min-width":"120"}}),t._v(" "),a("el-table-column",{attrs:{label:"套餐类型","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(0==e.row.type?"固定套餐":"搭配套餐")+"\n ")]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"上架状态","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-text":"上架","inactive-text":"下架"},on:{change:function(a){return t.onchangeIsShow(e.row)}},model:{value:e.row.is_show,callback:function(a){t.$set(e.row,"is_show",a)},expression:"scope.row.is_show"}})]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"限时","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[0==e.row.is_time?a("div",[t._v("不限时")]):a("div",[a("div",[t._v("起:"+t._s(e.row.start_time||"--"))]),t._v(" "),a("div",[t._v("止:"+t._s(e.row.stop_time||"--"))])])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"创建时间",prop:"create_time","min-width":"120"}}),t._v(" "),a("el-table-column",{attrs:{label:"剩余数量","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.is_limit?e.row.limit_num:"不限量")+"\n ")]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("router-link",{attrs:{to:{path:t.roterPre+"/marketing/discounts/create/"+e.row.discount_id}}},[a("el-button",{staticClass:"mr10",attrs:{type:"text",size:"small"}},[t._v("编辑")])],1),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.handleDelete(e.row.discount_id,e.$index)}}},[t._v("删除")])]}}])})],1),t._v(" "),a("div",{staticClass:"block"},[a("el-pagination",{attrs:{"page-sizes":[20,40,60,80],"page-size":t.tableFrom.limit,"current-page":t.tableFrom.page,layout:"total, sizes, prev, pager, next, jumper",total:t.tableData.total},on:{"size-change":t.handleSizeChange,"current-change":t.pageChange}})],1)],1)],1)},l=[],i=a("c80c"),s=(a("96cf"),a("3b8d")),r=(a("2f62"),a("b7be")),o=a("61f7"),c=a("83d6"),u={name:"Discounts",filters:{formatDate:function(t){if(0!==t){var e=new Date(1e3*t);return Object(o["formatDate"])(e,"yyyy-MM-dd hh:mm")}}},data:function(){return{loading:!1,roterPre:c["roterPre"],tableData:{data:[],total:0},tableFrom:{status:"",title:"",page:1,type:"",limit:15}}},computed:{},created:function(){this.getList("")},methods:{add:function(){this.$router.push({path:"".concat(c["roterPre"],"/marketing/discounts/create")})},copy:function(t){this.$router.push({name:"create",query:{id:t.id,copy:1}})},handleDelete:function(t,e){var a=this;this.$modalSure("删除该套餐").then((function(){Object(r["M"])(t).then((function(t){var n=t.message;a.$message.success(n),a.tableData.data.splice(e,1)})).catch((function(t){var e=t.message;a.$message.error(e)}))}))},getList:function(t){var e=this;this.loading=!0,this.tableFrom.page=t||this.tableFrom.page,Object(r["O"])(this.tableFrom).then(function(){var t=Object(s["a"])(Object(i["a"])().mark((function t(a){return Object(i["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.tableData.data=a.data.list,e.tableData.total=a.data.count,e.loading=!1;case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.loading=!1,e.$message.error(t.message)}))},pageChange:function(t){this.tableFrom.page=t,this.getList("")},handleSizeChange:function(t){this.tableFrom.limit=t,this.getList("")},onchangeIsShow:function(t){var e=this;Object(r["L"])(t.discount_id,t.is_show).then(function(){var t=Object(s["a"])(Object(i["a"])().mark((function t(a){return Object(i["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.$message.success(a.message),e.getList("");case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$message.error(t.message),e.getList("")}))}}},d=u,m=(a("9761"),a("2877")),p=Object(m["a"])(d,n,l,!1,null,"985eefcc",null);e["default"]=p.exports}}]); |