1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-f11cb01a"],{"0a08":function(t,e,a){},"250f":function(t,e,a){"use strict";var n=a("0a08"),r=a.n(n);r.a},a597:function(t,e,a){"use strict";a.d(e,"m",(function(){return r})),a.d(e,"k",(function(){return i})),a.d(e,"d",(function(){return s})),a.d(e,"b",(function(){return o})),a.d(e,"l",(function(){return l})),a.d(e,"r",(function(){return u})),a.d(e,"n",(function(){return m})),a.d(e,"e",(function(){return c})),a.d(e,"i",(function(){return d})),a.d(e,"h",(function(){return p})),a.d(e,"p",(function(){return _})),a.d(e,"a",(function(){return g})),a.d(e,"c",(function(){return f})),a.d(e,"f",(function(){return h})),a.d(e,"g",(function(){return v})),a.d(e,"o",(function(){return k})),a.d(e,"j",(function(){return $})),a.d(e,"q",(function(){return b}));var n=a("66df"),r=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.Mall_Product.GetProductList",data:t})},i=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.Mall_Product.GetPayProductListForMore",data:t})},s=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.Mall_Product.DeleteProduct",data:t})},o=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.Mall_Product.CreateProduct",data:t})},l=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.Mall_Product.GetProduct",data:t})},u=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.Mall_Product.UpdateProduct",data:t})},m=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.Rights.ListAllRightsService",data:t})},c=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.Mall_Product.GetExpireTimeList",data:t})},d=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.Mall_Order.GetOrderList",data:t})},p=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.Mall_Order.GetOrder",data:t})},_=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.Mall_Order.UpdateOrder",data:t})},g=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.Mall_Flow.AddNewFlow",data:t})},f=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.Mall_Flow.DeleteFlow",data:t})},h=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.Mall_Flow.GetFlow",data:t})},v=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.Mall_Flow.GetFlowList",data:t})},k=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.Mall_Flow.UpdateFlow",data:t})},$=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.Mall_Config.GetPayConfig",data:t})},b=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.Mall_Config.UpdatePayConfig",data:t})}},b397: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:"setmeal"},[a("div",{staticClass:"setmeal__h"},[a("p",{staticClass:"setmeal__h--p"},[t._v(" "+t._s(t.$t("setmealmanage_1"))+" ")]),a("Button",{attrs:{type:"primary"},on:{click:function(e){return t.openMealModalGrant()}}},[t._v(t._s(t.$t("setmealmanage_2")))])],1),a("Table",{staticClass:"ListTab",attrs:{border:"",loading:t.disabledTab,columns:t.columnsList,data:t.dataList},scopedSlots:t._u([{key:"used_amount",fn:function(e){var n=e.row;return[a("p",{staticStyle:{color:"red"}},[t._v(t._s(n.used_amount))])]}},{key:"used_percent",fn:function(e){var n=e.row;return[a("p",[t._v(t._s(n.used_percent+"%"))])]}},{key:"operation",fn:function(e){var n=e.row;e.index;return[a("Button",{staticClass:"operation__btn",attrs:{type:"primary",size:"small"},on:{click:function(e){return t.openMealModalDjust(n.id)}}},[t._v(t._s(t.$t("setmealmanage_8")))]),a("Button",{staticClass:"ivu-btn ivu-btn-error ivu-btn-small operation__btn",attrs:{type:"text",size:"small"},on:{click:function(e){return t.remove(n.id)}}},[t._v(t._s(t.$t("delete")))])]}}])}),a("div",{staticClass:"pagination"},[a("Page",{attrs:{total:t.total,"show-elevator":"","show-sizer":""},on:{"on-page-size-change":t.changeSize,"on-change":t.changePage}})],1),a("Modal",{attrs:{title:t.$t("setmealmanage_2")},model:{value:t.mealgrantmodal,callback:function(e){t.mealgrantmodal=e},expression:"mealgrantmodal"}},[a("Form",{ref:"mealData_grant",attrs:{model:t.mealData_grant,rules:t.ruleValidate_grant,"label-position":"left","label-width":100}},[a("FormItem",{attrs:{label:t.$t("setmealadd_1"),prop:"product_name"}},[a("Input",{model:{value:t.mealData_grant.product_name,callback:function(e){t.$set(t.mealData_grant,"product_name",e)},expression:"mealData_grant.product_name"}})],1),a("FormItem",{attrs:{label:t.$t("api_service"),prop:"product_key"}},[a("Select",{model:{value:t.mealData_grant.product_key,callback:function(e){t.$set(t.mealData_grant,"product_key",e)},expression:"mealData_grant.product_key"}},t._l(t.allService,(function(e){return a("Option",{key:e.service,attrs:{value:e.service}},[t._v(t._s(e.service)+"-"+t._s(e.title))])})),1)],1),a("FormItem",{attrs:{label:t.$t("account"),prop:"username"}},[a("Input",{model:{value:t.mealData_grant.username,callback:function(e){t.$set(t.mealData_grant,"username",e)},expression:"mealData_grant.username"}})],1),a("FormItem",{attrs:{label:t.$t("setmealmanage_4"),prop:"total_amount"}},[a("Input",{model:{value:t.mealData_grant.total_amount,callback:function(e){t.$set(t.mealData_grant,"total_amount",e)},expression:"mealData_grant.total_amount"}})],1),a("FormItem",{attrs:{label:t.$t("setmealmanage_7"),prop:"expire_time"}},[a("DatePicker",{staticStyle:{width:"100%"},attrs:{type:"datetime"},on:{"on-change":t.grantTime},model:{value:t.mealData_grant.expire_time,callback:function(e){t.$set(t.mealData_grant,"expire_time",e)},expression:"mealData_grant.expire_time"}})],1)],1),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("Button",{on:{click:function(e){return t.cancelGrant()}}},[t._v(t._s(t.$t("cancel")))]),a("Button",{attrs:{type:"primary"},on:{click:function(e){return t.createMeal()}}},[t._v(t._s(t.$t("save")))])],1)],1),a("Modal",{attrs:{title:t.$t("setmealmanage_8")},model:{value:t.mealadjustmodal,callback:function(e){t.mealadjustmodal=e},expression:"mealadjustmodal"}},[a("Form",{ref:"mealData_djust",attrs:{model:t.mealData_djust,rules:t.ruleValidate_djust,"label-position":"left","label-width":100}},[a("FormItem",{attrs:{label:t.$t("setmealmanage_4"),prop:"total_amount"}},[a("Input",{model:{value:t.mealData_djust.total_amount,callback:function(e){t.$set(t.mealData_djust,"total_amount",e)},expression:"mealData_djust.total_amount"}})],1),a("FormItem",{attrs:{label:t.$t("setmealmanage_7"),prop:"expire_time"}},[a("DatePicker",{staticStyle:{width:"100%"},attrs:{value:t.mealData_djust.expire_time,type:"datetime",format:"yyyy-MM-dd HH:mm:ss"},on:{"on-change":t.djustTime}})],1)],1),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("Button",{on:{click:function(e){return t.cancelDjust()}}},[t._v(t._s(t.$t("cancel")))]),a("Button",{attrs:{type:"primary"},on:{click:function(e){return t.changeMeal()}}},[t._v(t._s(t.$t("save")))])],1)],1)],1)},r=[],i=a("a597"),s=a("c276"),o=a("90de"),l={data:function(){return{disabledTab:!1,mealgrantmodal:!1,mealadjustmodal:!1,setmealmanageId:0,access_token:Object(s["h"])(),allService:[],mealData_grant:{product_name:"",product_key:"",username:"",total_amount:"0",expire_time:""},ruleValidate_grant:{product_name:[{required:!0,message:this.$t("setmealadd_12"),trigger:"blur"}],product_key:[{required:!0,message:this.$t(""),trigger:"blur"}],username:[{required:!0,message:this.$t("setmealmanage_10"),trigger:"blur"}],total_amount:[{required:!0,message:this.$t("setmealmanage_11"),trigger:"blur"}],expire_time:[]},mealData_djust:{total_amount:"0",expire_time:""},ruleValidate_djust:{total_amount:[{required:!0,message:this.$t("setmealmanage_11"),trigger:"blur"}],expire_time:[]},columnsList:[{title:this.$t("account"),key:"username",align:"center"},{title:this.$t("setmealadd_1"),key:"product_name",align:"center",width:"120"},{title:this.$t("api_name"),key:"product_key",align:"center"},{title:this.$t("setmealmanage_4"),key:"total_amount",align:"center"},{title:this.$t("setmealmanage_5"),key:"used_amount",slot:"used_amount",align:"center"},{title:this.$t("setmealmanage_6"),key:"used_percent",align:"center",slot:"used_percent"},{title:this.$t("setmealmanage_7"),key:"expire_time_str",align:"center"},{title:this.$t("status"),key:"flow_status_name",align:"center"},{title:this.$t("operation"),slot:"operation",width:200,align:"center"}],dataList:[],total:0,page:1,perpage:10}},created:function(){this.queryList(),this.getAllService()},methods:{djustTime:function(t){this.mealData_djust.expire_time=t},grantTime:function(t){this.mealData_grant.expire_time=t},queryList:function(){var t=this;this.disabledTab=!0;var e=new FormData;e.append("access_token",this.access_token),e.append("page",this.page),e.append("perpage",this.perpage),Object(i["g"])(e).then((function(e){t.disabledTab=!1,t.total=e.data.total,t.dataList=e.data.items}))},removeApi:function(t){var e=this,a=this.access_token;Object(i["c"])({access_token:a,id:t}).then((function(t){e.$Message.success(e.$t("successfully_delete")),e.queryList()}))},remove:function(t){var e=this;this.$Modal.confirm({title:this.$t("operation_confirm"),content:"<p>".concat(this.$t("setmealmanage_9"),"</p>"),onOk:function(){e.removeApi(t)},onCancel:function(){e.$Message.info(e.$t("cancel"))}})},getAllService:function(){var t=this,e=this.access_token;Object(i["n"])({access_token:e}).then((function(e){t.allService=e.data.items,t.mealData_grant.product_key=t.allService[0].service}))},changeSize:function(t){this.perpage=t,this.queryList()},changePage:function(t){this.page=t,this.queryList()},openMealModalGrant:function(){this.mealgrantmodal=!0},cancelGrant:function(){this.mealgrantmodal=!1},openMealModalDjust:function(t){this.mealadjustmodal=!0,this.setmealmanageId=t,this.getMealInfo(t)},cancelDjust:function(){this.mealadjustmodal=!1},getMealInfo:function(t){var e=this,a=t,n=e.access_token;Object(i["f"])({id:a,access_token:n}).then((function(t){e.mealData_djust.total_amount=t.data.flow.total_amount+"",e.mealData_djust.expire_time=Object(o["b"])(t.data.flow.expire_time,"year")}))},changeMeal:function(){var t=this;this.$refs["mealData_djust"].validate((function(e){if(e){var a=t,n=new FormData;n.append("id",a.setmealmanageId),n.append("access_token",a.access_token),n.append("total_amount",a.mealData_djust.total_amount),a.mealData_djust.expire_time&&n.append("expire_time",a.mealData_djust.expire_time),Object(i["o"])(n).then((function(t){t.data.isUpdate?(a.queryList(),a.$Message.success(a.$t("update_successfully")),a.mealadjustmodal=!1):a.$Message.error(t.msg||a.$t("nothing_changed"))}))}else t.$Message.error(t.$t("input_error_please_check_again"))}))},createMeal:function(){var t=this;this.$refs["mealData_grant"].validate((function(e){if(e){var a=t,n=new FormData;n.append("access_token",a.access_token),n.append("product_name",a.mealData_grant.product_name),n.append("product_key",a.mealData_grant.product_key),n.append("username",a.mealData_grant.username),n.append("total_amount",a.mealData_grant.total_amount),a.mealData_grant.expire_time&&n.append("expire_time",a.mealData_grant.expire_time),Object(i["a"])(n).then((function(t){t.data.id?(a.queryList(),a.$Message.success(a.$t("add_successfully")),a.mealgrantmodal=!1):a.$Message.error(t.msg)}))}else t.$Message.error(t.$t("input_error_please_check_again"))}))}}},u=l,m=(a("250f"),a("2877")),c=Object(m["a"])(u,n,r,!1,null,null,null);e["default"]=c.exports}}]); |