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
15 KiB
1 lines
15 KiB
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"].validate(function(e){e||(a=!1)}),!a){r.next=21;break}if(s=JSON.parse(i()(t[e+"Form"])),"pay"!==e){r.next=11;break}if(!((n=s.user.map(function(e){return e.id})).length>50)){r.next=9;break}return t.$message.error("所选充值用户超过50位,请重新选择!"),r.abrupt("return");case 9:l=s.id,s={card_id:l,user_id:n};case 11:return u="pay"===e?"payBalanceOrder":s.id?"cardUpdate":"cardAdd",r.next=14,t.$api.finance[u](s);case 14:if(c=r.sent,200===c.code){r.next=18;break}return r.abrupt("return");case 18:t.$message.success(t.$t("sub"===e&&s.id?"tips.successRev":"tips.successSub")),t.showDialog[e]=!1,t.getTableDataList("","list");case 21:case"end":return r.stop()}},r,t)}))()}},filters:{handleTime:function(e,t){return 1===t?c()(1e3*e).format("YYYY-MM-DD"):2===t?c()(1e3*e).format("HH:mm:ss"):c()(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},m={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"lb-appclass-classroom-list"},[r("top-nav"),e._v(" "),r("div",{staticClass:"page-main"},[r("el-row",{staticClass:"page-top-operate"},[r("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-add",expression:"`${$route.name}-add`"}],attrs:{size:"medium",type:"primary",icon:"el-icon-plus"},on:{click:function(t){return e.toShowDialog("sub")}}},[e._v(e._s(e.$t("menu.FinanceStoredAdd")))])],1),e._v(" "),r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading.list,expression:"loading.list"}],staticStyle:{width:"100%"},attrs:{data:e.tableData.list,"header-cell-style":{background:"#f5f7fa",color:"#606266"},"tooltip-effect":"dark"}},[r("el-table-column",{attrs:{prop:"id",label:"ID",fixed:""}}),e._v(" "),r("el-table-column",{attrs:{prop:"title",label:"套餐名称","min-width":"200"}}),e._v(" "),r("el-table-column",{attrs:{prop:"price",label:"购买价格","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" ¥"+e._s(t.row.price)+" ")]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"true_price",label:"实际充值","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" ¥"+e._s(t.row.true_price)+" ")]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"top",label:"排序值"}}),e._v(" "),r("el-table-column",{attrs:{prop:"create_time",label:"创建时间","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("p",[e._v(e._s(e._f("handleTime")(t.row.create_time,1)))]),e._v(" "),r("p",[e._v(e._s(e._f("handleTime")(t.row.create_time,2)))])]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"address",label:"是否上架"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-switch",{attrs:{disabled:!e.$route.meta.pagePermission[0].auth.includes("edit"),"active-value":1,"inactive-value":0},on:{change:function(r){return e.updateItem(t.row.id,t.row.status)}},model:{value:t.row.status,callback:function(r){e.$set(t.row,"status",r)},expression:"scope.row.status"}})]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"操作","min-width":"140"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("div",{staticClass:"table-operate"},[r("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-edit",expression:"`${$route.name}-edit`"}],attrs:{size:"mini",plain:"",type:"primary"},on:{click:function(r){return e.toShowDialog("sub",t.row)}}},[e._v(e._s(e.$t("action.edit")))]),e._v(" "),r("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-delete",expression:"`${$route.name}-delete`"}],attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(r){return e.confirmDel(t.row.id)}}},[e._v(e._s(e.$t("action.delete")))]),e._v(" "),r("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-payBalanceOrder",expression:"`${$route.name}-payBalanceOrder`"},{name:"show",rawName:"v-show",value:1==t.row.status,expression:"scope.row.status == 1"}],attrs:{size:"mini",plain:"",type:"success"},on:{click:function(r){return e.toShowDialog("pay",t.row)}}},[e._v(e._s(e.$t("action.payBalanceOrder")))])],1)]}}])})],1),e._v(" "),r("lb-page",{attrs:{batch:!1,page:e.searchForm.list.page,pageSize:e.searchForm.list.limit,total:e.total.list},on:{handleSizeChange:function(t){return e.handleSizeChange(t,"list")},handleCurrentChange:function(t){return e.handleCurrentChange(t,"list")}}}),e._v(" "),r("el-dialog",{attrs:{title:e.$t(e.subForm.id?"menu.FinanceStoredEdit":"menu.FinanceStoredAdd"),visible:e.showDialog.sub,width:"500px",center:""},on:{"update:visible":function(t){return e.$set(e.showDialog,"sub",t)}}},[r("el-form",{ref:"subForm",staticClass:"dialog-form",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"100px"}},[r("el-form-item",{attrs:{label:"套餐名称",prop:"title"}},[r("el-input",{attrs:{maxlength:"20","show-word-limit":"",placeholder:"请输入套餐名称"},model:{value:e.subForm.title,callback:function(t){e.$set(e.subForm,"title",t)},expression:"subForm.title"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"购买价格",prop:"price"}},[r("el-input-number",{staticClass:"lb-input-number",attrs:{min:.01,precision:2,controls:!1,placeholder:"请输入购买价格"},model:{value:e.subForm.price,callback:function(t){e.$set(e.subForm,"price",t)},expression:"subForm.price"}}),e._v(" "),r("lb-tool-tips",[e._v("用户所要支付的价格")])],1),e._v(" "),r("el-form-item",{attrs:{label:"实际充值",prop:"true_price"}},[r("el-input",{attrs:{placeholder:"请输入实际充值"},model:{value:e.subForm.true_price,callback:function(t){e.$set(e.subForm,"true_price",t)},expression:"subForm.true_price"}}),e._v(" "),r("lb-tool-tips",[e._v("实际充入会员卡的价格")])],1),e._v(" "),r("el-form-item",{attrs:{label:"排序值",prop:"top"}},[r("el-input-number",{staticClass:"lb-input-number",attrs:{min:0,controls:!1,placeholder:"请输入排序值"},model:{value:e.subForm.top,callback:function(t){e.$set(e.subForm,"top",t)},expression:"subForm.top"}}),e._v(" "),r("lb-tool-tips",[e._v("值越大, 排序越靠前")])],1)],1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.showDialog.sub=!1}}},[e._v("取 消")]),e._v(" "),r("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:function(t){return e.submitFormInfo("sub")}}},[e._v("确 定")])],1)],1),e._v(" "),r("el-dialog",{attrs:{title:e.$t("action.payBalanceOrder"),visible:e.showDialog.pay,width:"800px",center:""},on:{"update:visible":function(t){return e.$set(e.showDialog,"pay",t)}}},[r("el-form",{ref:"payForm",staticClass:"dialog-form",attrs:{model:e.payForm,rules:e.payFormRules,"label-width":"100px"}},[r("el-form-item",{attrs:{label:"储值套餐名称",prop:""}},[e._v("\n "+e._s(e.payForm.title)+"\n ")]),e._v(" "),r("el-form-item",{attrs:{label:"购买价格",prop:""}},[e._v("\n ¥"+e._s(e.payForm.price)+"\n ")]),e._v(" "),r("el-form-item",{attrs:{label:"实际充值",prop:""}},[e._v("\n ¥"+e._s(e.payForm.true_price)+"\n ")]),e._v(" "),r("el-form-item",{attrs:{label:"充值用户",prop:"user"}},[r("lb-button",{attrs:{type:"primary",icon:"el-icon-plus"},on:{click:function(t){return e.toShowDialog("user")}}},[e._v("选择充值用户")]),e._v(" "),r("el-table",{staticClass:"mt-lg",staticStyle:{width:"100%"},attrs:{data:e.payForm.user,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[r("el-table-column",{attrs:{prop:"id",label:"ID"}}),e._v(" "),r("el-table-column",{attrs:{prop:"nickName",label:"微信昵称"}}),e._v(" "),r("el-table-column",{attrs:{prop:"avatarUrl",label:"微信头像"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("lb-image",{attrs:{src:e.row.avatarUrl}})]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"phone",label:"手机号"}}),e._v(" "),r("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("div",{staticClass:"table-operate"},[r("lb-button",{attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(r){return e.toDel(t.row.id)}}},[e._v(e._s(e.$t("action.delete")))])],1)]}}])})],1)],1)],1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.showDialog.pay=!1}}},[e._v("取 消")]),e._v(" "),r("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:function(t){return e.submitFormInfo("pay")}}},[e._v("确 定")])],1)],1),e._v(" "),r("el-dialog",{attrs:{title:"选择充值用户",visible:e.showDialog.user,width:"800px",center:""},on:{"update:visible":function(t){return e.$set(e.showDialog,"user",t)}}},[r("el-form",{ref:"userForm",attrs:{inline:!0,model:e.searchForm.user,"label-width":"70px"}},[r("el-form-item",{attrs:{label:"输入查询",prop:"nickName"}},[r("el-input",{attrs:{placeholder:"请输入微信昵称/手机号"},model:{value:e.searchForm.user.nickName,callback:function(t){e.$set(e.searchForm.user,"nickName",t)},expression:"searchForm.user.nickName"}})],1),e._v(" "),r("el-form-item",[r("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.getTableDataList(1,"user")}}},[e._v(e._s(e.$t("action.search")))]),e._v(" "),r("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(t){return e.resetForm("user")}}},[e._v(e._s(e.$t("action.reset")))])],1)],1),e._v(" "),r("el-table",{ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:e.tableData.user,"header-cell-style":{background:"#f5f7fa",color:"#606266"},"tooltip-effect":"dark"},on:{"selection-change":e.handleSelectionChange}},[r("el-table-column",{attrs:{type:"selection",width:"55"}}),e._v(" "),r("el-table-column",{attrs:{prop:"id",label:"ID"}}),e._v(" "),r("el-table-column",{attrs:{prop:"nickName",label:"微信昵称"}}),e._v(" "),r("el-table-column",{attrs:{prop:"avatarUrl",label:"微信头像"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("lb-image",{attrs:{src:e.row.avatarUrl}})]}}])}),e._v(" "),r("el-table-column",{attrs:{prop:"phone",label:"手机号"}})],1),e._v(" "),r("lb-page",{attrs:{batch:!1,page:e.searchForm.user.page,pageSize:e.searchForm.user.limit,total:e.total.user},on:{handleSizeChange:function(t){return e.handleSizeChange(t,"user")},handleCurrentChange:function(t){return e.handleCurrentChange(t,"user")}}}),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.showDialog.user=!1}}},[e._v("取 消")]),e._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:e.handleDialogConfirm}},[e._v("确 定")])],1)],1)],1)],1)},staticRenderFns:[]};var d=r("VU/8")(p,m,!1,function(e){r("u+qI")},"data-v-8d54766e",null);t.default=d.exports},"u+qI":function(e,t){}}); |