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 line
15 KiB
1 line
15 KiB
2 months ago
|
webpackJsonp([41],{cuC9:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r("mvHQ"),i=r.n(a),s=r("Xxa5"),o=r.n(s),n=r("exGp"),l=r.n(n),u=r("PJh5"),c=r.n(u),p={components:{},data:function(){var e=function(e,t,r){/^(([0-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/.test(t)?r():r(new Error("请输入正确的金额,最多保留两位小数"))};return{loading:{list:!1,user:!1},searchForm:{list:{page:1,limit:10},user:{page:1,limit:10,nickName:""}},tableData:{list:[],user:[]},total:{list:0,user:0},showDialog:{sub:!1,pay:!1,user:!1},multipleSelection:[],subForm:{id:"",title:"",price:"",true_price:"",top:0},subFormRules:{title:{required:!0,validator:this.$reg.isNotNull,text:"套餐名称",reg_type:2,trigger:"blur"},price:{required:!0,validator:e,trigger:"blur"},true_price:{required:!0,validator:e,trigger:"blur"},top:{required:!0,type:"number",message:"请输入排序值",trigger:"blur"}},payForm:{id:"",title:"",price:"",true_price:"",user:[]},payFormRules:{user:{required:!0,type:"array",message:"请选择充值用户",trigger:"blur"}}}},created:function(){var e=this;return l()(o.a.mark(function t(){return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e.getTableDataList(1,"list");case 1:case"end":return t.stop()}},t,e)}))()},methods:{resetForm:function(e){var t=e+"Form";this.$refs[t].resetFields(),this.getTableDataList(1,e)},handleSizeChange:function(e,t){this.searchForm[t].limit=e,this.handleCurrentChange(1,t)},handleCurrentChange:function(e,t){this.searchForm[t].page=e,this.getTableDataList("",t)},getTableDataList:function(e,t){var r=this;return l()(o.a.mark(function a(){var s,n,l,u,c,p,m;return o.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e&&(r.searchForm[t].page=1),r.loading[t]=!0,s=JSON.parse(i()(r.searchForm[t])),n={list:{methodKey:"finance",methodModel:"cardList"},user:{methodKey:"custom",methodModel:"userList"}}[t],l=n.methodKey,u=n.methodModel,a.next=7,r.$api[l][u](s);case 7:if(c=a.sent,p=c.code,m=c.data,r.loading[t]=!1,200===p){a.next=13;break}return a.abrupt("return");case 13:r.tableData[t]=m.data,r.total[t]=m.total;case 15:case"end":return a.stop()}},a,r)}))()},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)})},updateItem:function(e,t){var r=this;return l()(o.a.mark(function a(){return o.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:r.$api.finance.cardUpdate({id:e,status:t}).then(function(e){if(200===e.code){if(r.$message.success(r.$t(-1===t?"tips.successDel":"tips.successOper")),-1!==t)return;r.searchForm.list.page=r.searchForm.list.page<Math.ceil((r.total.list-1)/r.searchForm.list.limit)?r.searchForm.list.page:Math.ceil((r.total.list-1)/r.searchForm.list.limit),r.getTableDataList("","list")}else{if(-1===t)return;r.getTableDataList("","list")}});case 1:case"end":return a.stop()}},a,r)}))()},toShowDialog:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l()(o.a.mark(function a(){var s;return o.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(r=JSON.parse(i()(r)),"user"===e){a.next=6;break}for(s in"pay"===e&&(r.user=[]),t[e+"Form"])t[e+"Form"][s]=r[s];a.next=9;break;case 6:return t.searchForm.user.nickName="",a.next=9,t.getTableDataList(1,e);case 9:t.showDialog[e]=!t.showDialog[e];case 10:case"end":return a.stop()}},a,t)}))()},handleSelectionChange:function(e){this.multipleSelection=e},handleDialogConfirm:function(){var e=JSON.parse(i()(this.payForm.user)),t=e.length>0?e.map(function(e){return e.id}):[];this.multipleSelection.map(function(r){t.includes(r.id)||e.push(r)}),this.payForm.user=e,this.showDialog.user=!1},toDel:function(e){var t=this.payForm.user.findIndex(function(t){return t.id===e});this.payForm.user.splice(t,1)},submitFormInfo:function(e){var t=this;return l()(o.a.mark(function r(){var a,s,n,l,u,c;return o.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(a=!0,t.$refs[e+"Form"].v
|