1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-382f72c1"],{"0ecc":function(t,e,a){"use strict";a.r(e);var s=a("c7eb"),i=a("1da1"),o=a("5530"),r=(a("14d9"),a("99af"),a("fb6a"),a("2f62")),n=a("90e7");o={name:"smsTemplateApply",components:{editFrom:a("31b4").a},data:function(){return{grid:{xl:7,lg:7,md:12,sm:24,xs:24},loading:!1,columns1:[],levelFrom:{type:"",status:"",title:"",page:1,limit:20},levelFrom2:{is_have:"",page:1,limit:20},total:0,FromData:null,delfromData:{},levelLists:[]}},watch:{$route:function(t,e){this.getList()}},created:function(){this.onIsLogin()},mounted:function(){var t=this;Object(n.lb)().then((function(e){1!=e.data.sms.open&&t.$router.push(t.$routeProStr+"/setting/sms/sms_config/index?url="+t.$route.path)}))},computed:Object(o.a)(Object(o.a)({},Object(r.d)("media",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:"80px"},labelPosition:function(){return this.isMobile?"top":"right"}}),methods:{onIsLogin:function(){var t=this;this.spinShow=!0,Object(n.w)().then(function(){var e=Object(i.a)(Object(s.a)().mark((function e(a){return Object(s.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.data.status?t.getList():(t.$message.warning("请先登录"),t.$router.push(t.$routeProStr+"/setting/sms/sms_config/index?url="+t.$route.path));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.$message.error(e.msg)}))},getList:function(){var t=this,e=(this.loading=!0,this.levelFrom.status=this.levelFrom.status||"",this.levelFrom.is_have=this.levelFrom.is_have||"",{data:this.$route.path===this.$routeProStr+"/setting/sms/sms_template_apply/index"?this.levelFrom:this.levelFrom2,url:this.$route.path===this.$routeProStr+"/setting/sms/sms_template_apply/index"?"serve/sms/temps":"notify/sms/public_temp"}),a=[{title:"ID",key:"id",sortable:!0,minWidth:80},{title:"模板ID",key:"templateid",minWidth:110},{title:"模板名称",key:"title",minWidth:150},{title:"模板内容",key:"content",minWidth:550},{title:"模板类型",key:"type",minWidth:100},{title:"模板状态",slot:"status",minWidth:100}];this.$route.path===this.$routeProStr+"/setting/sms/sms_template_apply/commons"?this.columns1=Object.assign([],a).slice(0,6).concat([{title:"是否拥有",slot:"is_have",minWidth:110}]):this.columns1=a,Object(n.Qb)(e).then(function(){var e=Object(i.a)(Object(s.a)().mark((function e(a){var i;return Object(s.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=a.data,t.levelLists=i.data,t.total=i.count,t.loading=!1;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$message.error(e.msg)}))},add:function(){var t=this;Object(n.Pb)().then(function(){var e=Object(i.a)(Object(s.a)().mark((function e(a){return Object(s.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.FromData=a.data,t.$refs.edits.modals=!0;case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.$message.error(e.msg)}))},userSearchs:function(){this.levelFrom.page=1,this.getList()},submitFail:function(){this.getList()}}},a("ec3f"),r=a("2877"),a=Object(r.a)(o,(function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"i-layout-page-header header_top"},[e("div",{staticClass:"i-layout-page-header fl_header"},[e("router-link",{attrs:{to:{path:t.$routeProStr+"/setting/sms/sms_config/index"}}},[e("el-button",{attrs:{size:"small",type:"text"}},[t._v("返回")])],1),e("el-divider",{attrs:{direction:"vertical"}}),e("span",{staticClass:"ivu-page-header-title mr20",staticStyle:{padding:"0"}},[t._v(t._s(t.$route.meta.title))])],1)]),e("el-card",{staticClass:"ivu-mt",attrs:{bordered:!1,shadow:"never"}},[e("el-form",{ref:"levelFrom",attrs:{model:t.levelFrom,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[t.$route.path===t.$routeProStr+"/setting/sms/sms_template_apply/index"?e("el-row",{attrs:{gutter:24}},[e("el-col",{attrs:{span:24}},[e("el-button",{directives:[{name:"db-click",rawName:"v-db-click"}],attrs:{type:"primary"},on:{click:t.add}},[t._v("申请模板")])],1)],1):e("el-row",{attrs:{gutter:24}},[e("el-col",t._b({},"el-col",t.grid,!1),[e("el-form-item",{attrs:{label:"是否拥有:"}},[e("el-select",{attrs:{placeholder:"请选择",clearable:""},on:{change:t.userSearchs},model:{value:t.levelFrom.is_have,callback:function(e){t.$set(t.levelFrom,"is_have",e)},expression:"levelFrom.is_have"}},[e("el-option",{attrs:{value:"1",label:"有"}}),e("el-option",{attrs:{value:"0",label:"没有"}})],1)],1)],1)],1)],1),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"table",staticClass:"mt14",attrs:{data:t.levelLists,"no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"}},t._l(t.columns,(function(a,s){return e("el-table-column",{key:s,attrs:{label:a.title,"min-width":a.minWidth},scopedSlots:t._u([{key:"default",fn:function(s){return[a.key?[e("div",[e("span",[t._v(t._s(s.row[a.key]))])])]:"status"===a.slot?[e("span",{directives:[{name:"show",rawName:"v-show",value:1===s.row.status,expression:"scope.row.status === 1"}]},[t._v("可用")]),e("span",{directives:[{name:"show",rawName:"v-show",value:0===s.row.status,expression:"scope.row.status === 0"}]},[t._v("不可用")])]:"is_have"===a.slot&&t.$route.path===t.$routeProStr+"/setting/sms/sms_template_apply/commons"?[e("span",{directives:[{name:"show",rawName:"v-show",value:1===s.row.status,expression:"scope.row.status === 1"}]},[t._v("有")]),e("span",{directives:[{name:"show",rawName:"v-show",value:0===s.row.status,expression:"scope.row.status === 0"}]},[t._v("没有")])]:t._e()]}}],null,!0)})})),1),e("div",{staticClass:"acea-row row-right page"},[t.total?e("pagination",{attrs:{total:t.total,page:t.levelFrom.page,limit:t.levelFrom.limit},on:{"update:page":function(e){return t.$set(t.levelFrom,"page",e)},"update:limit":function(e){return t.$set(t.levelFrom,"limit",e)},pagination:t.getList}}):t._e()],1)],1),e("edit-from",{ref:"edits",attrs:{FromData:t.FromData},on:{submitFail:t.submitFail}})],1)}),[],!1,null,"781431f4",null);e.default=a.exports},"30ec":function(t,e,a){},"31b4":function(t,e,a){"use strict";a("a630"),a("3ca3");var s=a("5530"),i=(a("d3b7"),a("159b"),a("30ba")),o=(i=a.n(i),a("6b6c")),r=a("2f62");i={name:"edit",components:{formCreate:i.a.$form()},computed:Object(s.a)({},Object(r.d)("userLevel",["taskId","levelId"])),props:{FromData:{type:Object,default:null},update:{type:Boolean,default:!0}},watch:{FromData:function(){this.FromData.rules.forEach((function(t){t.title+=":"}))}},data:function(){return{modals:!1,type:0,loading:!1,fapi:null,config:{form:{labelWidth:"100px"},resetBtn:!1,submitBtn:!1,global:{upload:{props:{onSuccess:function(t,e){200===t.status?e.url=t.data.src:this.$message.error(t.msg)}}}}}}},methods:{couponsType:function(){this.$parent.addType(this.type)},formSubmit:function(){this.fapi.submit()},onSubmit:function(t){var e=this;this.loading||(this.loading=!0,Object(o.a)({url:this.FromData.action,method:this.FromData.method,data:t}).then((function(t){e.update&&e.$parent.getList(),e.$message.success(t.msg),e.modals=!1,setTimeout((function(){e.$emit("submitFail"),e.loading=!1}),1e3)})).catch((function(t){e.loading=!1,e.$message.error(t.msg)})))},cancel:function(){this.type=0}}},a("c97f"),s=a("2877"),r=Object(s.a)(i,(function(){var t=this,e=t._self._c;return t.FromData?e("div",[e("el-dialog",{attrs:{visible:t.modals,title:t.FromData.title,"z-index":1,width:"720px"},on:{"update:visible":function(e){t.modals=e},closed:t.cancel}},[["/marketing/coupon/save.html"===t.FromData.action?e("div",{staticClass:"radio acea-row row-middle"},[e("div",{staticClass:"name ivu-form-item-content"},[t._v("优惠券类型")]),e("el-radio-group",{on:{input:t.couponsType},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}},[e("el-radio",{attrs:{label:0}},[t._v("通用券")]),e("el-radio",{attrs:{label:1}},[t._v("品类券")]),e("el-radio",{attrs:{label:2}},[t._v("商品券")])],1)],1):t._e()],e("form-create",{ref:"fc",staticClass:"formBox",attrs:{option:t.config,rule:Array.from(this.FromData.rules),handleIcon:"false"},on:{submit:t.onSubmit},model:{value:t.fapi,callback:function(e){t.fapi=e},expression:"fapi"}}),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{directives:[{name:"db-click",rawName:"v-db-click"}],on:{click:function(e){t.modals=!1}}},[t._v("取 消")]),e("el-button",{directives:[{name:"db-click",rawName:"v-db-click"}],attrs:{type:"primary"},on:{click:t.formSubmit}},[t._v("确 定")])],1)],2)],1):t._e()}),[],!1,null,"35556d70",null);e.a=r.exports},8381:function(t,e,a){},c97f:function(t,e,a){"use strict";a("8381")},ec3f:function(t,e,a){"use strict";a("30ec")}}]);
|