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.4 KiB
1 lines
6.4 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0190575a"],{3615:function(t,e,a){"use strict";a("5ebb")},"5ebb":function(t,e,a){},d29c:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"divBox"},[a("el-card",{directives:[{name:"loading",rawName:"v-loading",value:t.fullscreenLoading,expression:"fullscreenLoading"}],staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("div",{staticClass:"filter-container"},[a("div",{staticClass:"demo-input-suffix acea-row"},[a("span",{staticClass:"seachTiele"},[t._v("模板类型:")]),t._v(" "),a("el-select",{staticClass:"filter-item selWidth mr20",attrs:{placeholder:"请选择",clearable:""},on:{change:t.userSearchs},model:{value:t.tableFrom.type,callback:function(e){t.$set(t.tableFrom,"type",e)},expression:"tableFrom.type"}},[a("el-option",{attrs:{label:"验证码",value:1}}),t._v(" "),a("el-option",{attrs:{label:"通知",value:2}}),t._v(" "),a("el-option",{attrs:{label:"推广",value:3}})],1)],1)]),t._v(" "),a("el-button",{attrs:{size:"small",type:"primary"},on:{click:t.apply}},[t._v("申请短信模板")])],1),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:t.tableData.data,size:"mini","highlight-current-row":""}},[a("el-table-column",{attrs:{prop:"id",label:"ID","min-width":"50"}}),t._v(" "),a("el-table-column",{attrs:{prop:"templateid",label:"模板ID","min-width":"80"}}),t._v(" "),a("el-table-column",{attrs:{prop:"title",label:"模板名称","min-width":"120"}}),t._v(" "),a("el-table-column",{attrs:{prop:"content",label:"模板内容","min-width":"500"}}),t._v(" "),a("el-table-column",{attrs:{prop:"type",label:"模板类型","min-width":"100"}}),t._v(" "),a("el-table-column",{attrs:{label:"模板状态"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[a("span",[t._v(t._s(i.status?"可用":"不可用"))])]}}])})],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),t._v(" "),t.dialogVisible?a("el-dialog",{attrs:{title:"申请短信模板",visible:t.dialogVisible,width:"700px"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("el-form",{attrs:{size:"small","label-width":"100px"},nativeOn:{submit:function(t){t.preventDefault()}}},[a("el-form-item",{staticClass:"width100",attrs:{label:"模板名称:",prop:"title"}},[a("el-input",{staticClass:"selwidths",attrs:{type:"text",placeholder:t.placeholder.title,size:"small"},model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}})],1),t._v(" "),a("el-form-item",{staticClass:"width100",attrs:{label:"模板内容:",prop:"content"}},[a("el-input",{staticClass:"selwidths",attrs:{type:"textarea",placeholder:t.placeholder.content,size:"small"},model:{value:t.form.content,callback:function(e){t.$set(t.form,"content",e)},expression:"form.content"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"模板类型:"}},[a("el-radio-group",{on:{change:t.changeRadioText},model:{value:t.form.type,callback:function(e){t.$set(t.form,"type",e)},expression:"form.type"}},[a("el-radio",{attrs:{label:1}},[t._v("验证码")]),t._v(" "),a("el-radio",{attrs:{label:2}},[t._v("通知")]),t._v(" "),a("el-radio",{attrs:{label:3}},[t._v("推广")])],1)],1)],1),t._v(" "),a("div",{staticClass:"use-template-dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:t.add}},[t._v("确定")])],1)],1):t._e()],1)},l=[],s=a("c80c"),o=(a("96cf"),a("3b8d")),n=a("db72"),r=a("b61d"),c=a("83d6"),d=a("2f62"),p={name:"SmsTemplate",data:function(){return{fullscreenLoading:!1,listLoading:!1,dialogVisible:!1,tableData:{data:[],total:0},form:{title:"",content:"",type:1},placeholder:{},placeholderObj:[{title:"例如:注册验证码",content:"例如:您的验证码是:{$code},有效期为{$time}分钟。如非本人操作,可不予理会."},{title:"例如:订单支付成功通知",content:"例如:您购买的商品已支付成功,支付金额{$pay_price}元,订单号{$order_id},感谢您的光临!"},{title:"例如:国庆优惠活动",content:"10月1日-8日期间 全场商品满1000减200,国庆欢乐购,立即查看http://mer.crmeb.net/admin."}],tableFrom:{page:1,limit:20,type:""}}},computed:Object(n["a"])({},Object(d["b"])(["isLogin"])),mounted:function(){console.log(this.isLogin),this.getList(""),this.changeRadioText()},methods:{changeRadioText:function(){this.placeholder=this.placeholderObj[this.form.type-1]},onIsLogin:function(){var t=this;this.fullscreenLoading=!0,this.$store.dispatch("user/isLogin").then(function(){var e=Object(o["a"])(Object(s["a"])().mark((function e(a){var i;return Object(s["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:i=a.data,i.status?t.getList(""):(t.$message.warning("请先登录"),t.$router.push(c["roterPre"]+"/sms/config?url="+t.$route.path)),t.fullscreenLoading=!1;case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.$message.error(e.message),t.$router.push(c["roterPre"]+"/sms/config?url="+t.$route.path),t.fullscreenLoading=!1}))},getList:function(t){var e=this;this.listLoading=!0,this.tableFrom.page=t||this.tableFrom.page,Object(r["l"])(this.tableFrom).then((function(t){e.tableData.data=t.data.data,e.tableData.total=t.data.count,e.listLoading=!1})).catch((function(t){e.listLoading=!1,e.$message.error(t.message),e.$router.push(c["roterPre"]+"/setting/sms/sms_config/index")}))},pageChange:function(t){this.tableFrom.page=t,this.getList("")},handleSizeChange:function(t){this.tableFrom.limit=t,this.getList("")},userSearchs:function(){this.getList(1)},apply:function(){this.form={title:"",content:"",type:1},this.dialogVisible=!0,this.changeRadioText()},add:function(){var t=this;this.form.title&&this.form.content?Object(r["m"])(this.form).then((function(e){e.message;t.$message.success("申请成功!"),t.dialogVisible=!1,t.$router.push(c["roterPre"]+"/sms/applyList")})).catch((function(e){var a=e.message;t.$message.error(a)})):this.$message.error("请提前写完信息!")}}},u=p,m=(a("3615"),a("2877")),h=Object(m["a"])(u,i,l,!1,null,"c82ba2a4",null);e["default"]=h.exports}}]); |