(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5fb80d4c"],{"17e8":function(t,e,a){},"34fd":function(t,e,a){"use strict";var n=function(){var t=this,e=t._self._c;return t.company&&t.company.companyName?e("div",{staticClass:"align-items-center company-wrap"},[e("div",{staticClass:"first-char subtitle-4 d-flex align-items-center justify-content-center mg-r-8"},[t._v(t._s(t.firstChar))]),e("span",{staticClass:"body-1",attrs:{title:t.company.companyName}},[t._v(t._s(t.company.companyName))])]):t._e()},s=[],i=a("2f62"),r={data(){return{}},computed:{...Object(i["c"])({company:t=>t.CONF.company}),...Object(i["b"])({firstChar:"CONF/companyFirstChar"})}},l=r,o=(a("8b29"),a("2877")),c=Object(o["a"])(l,n,s,!1,null,"2ae73d8d",null);e["a"]=c.exports},"35f2":function(t,e,a){},3738:function(t,e,a){"use strict";a("17e8")},"3de9":function(t,e,a){"use strict";a("701d")},"5d0b":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"page-content"},[e("div",{staticClass:"page-flex-content"},[e("sub-menu"),e("div",{staticClass:"setting-page"},[e("div",{staticClass:"page-header"},[e("div",{staticClass:"action-wrap d-flex align-items-center justify-content-between"},[e("page-title",{attrs:{border:"","background-color":"#ffffff",title:t.$t("settings.template_payment_message.page_title"),"mobile-hide-title":""}},[e("sub-menu",{attrs:{mobile:""}})],1)],1)]),e("div",{ref:"pageBody",staticClass:"page-body"},[e("div",{staticClass:"form-container"},[e("a-form-model",{ref:"form",attrs:{layout:"vertical",model:t.form,rules:t.formRules,"hide-required-mark":""}},[e("div",{staticClass:"temlpate-content"},[e("div",{staticClass:"template-variable-container"},[e("div",{staticClass:"template-variable-header"},[e("div",{staticClass:"subtitle-3 grey-04"},[t._v(t._s(t.$t("settings.template_payment_message.template_variable")))]),e("div",{staticClass:"body-4 grey-04 mg-t-8"},[t._v(t._s(t.$t("settings.template_payment_message.click_to_insert_variants")))])]),e("div",{staticClass:"template-variable-body mg-t-16"},[e("div",{staticClass:"template-variable-list"},t._l(t.templateVariableOptions,(function(a,n){return e("div",{key:n,staticClass:"template-variable-item pointer",on:{click:function(e){return t.pushTempVariable(a)}}},[e("div",{staticClass:"body-4 grey-03"},[t._v(t._s(a.fieldTitle))]),e("div",{staticClass:"body-3 black-color mg-t-3"},[t._v(t._s(a.fieldName))])])})),0)])]),e("div",{ref:"textContainer",staticClass:"text-container"},[e("a-dropdown",{staticClass:"mg-b-5",attrs:{trigger:["click"],"get-popup-container":()=>t.$refs.textContainer}},[e("a-button",{staticClass:"temp-variable-dropdown-btn"},[t._v(t._s(t.$t("settings.template_payment_message.template_variable")))]),e("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},t._l(t.templateVariableOptions,(function(a,n){return e("a-menu-item",{key:n,on:{click:function(e){return t.pushTempVariable(a)}}},[t._v(" "+t._s(a.fieldTitle)+" "+t._s(a.fieldName)+" ")])})),1)],1),e("div",[e("div",{staticClass:"subtitle-3 grey-04"},[t._v(t._s(t.$t("settings.template_payment_message.template_content")))]),e("div",{staticClass:"body-4 grey-04 mg-t-8"},[t._v(t._s(t.$t("settings.template_payment_message.helps_you_to_find_it")))]),e("a-form-model-item",{staticClass:"mg-t-16",attrs:{prop:"content"}},[e("a-textarea",{ref:"tempContent",attrs:{"auto-size":{minRows:8},placeholder:t.$t("settings.template_payment_message.enter_template_content")},model:{value:t.form.content,callback:function(e){t.$set(t.form,"content",e)},expression:"form.content"}})],1)],1)],1)])]),e("div",{staticClass:"text-center mg-t-48"},[e("a-button",{attrs:{type:"primary"},on:{click:t.handleSubmit}},[t._v(t._s(t.$t("settings.template_payment_message.save_btn")))])],1)],1),e("a-spin",{directives:[{name:"show",rawName:"v-show",value:t.loading,expression:"loading"}]})],1)])],1)])},s=[],i=a("89dd"),r=a("9c24"),l=a("34fd"),o=a("2f62"),c=a("c621");const u="PaymentConfig_Tag";var m={components:{PageTitle:i["a"],SubMenu:r["a"],CompanyName:l["a"]},data(){return{form:{},templateVariableOptions:[],formRules:{content:[{required:!0,message:this.$t("settings.template_payment_message.pls_enter_template_content")}]},loading:!1,scrollBar:null}},computed:{...Object(o["c"])({lang:t=>t.LANG.lang})},methods:{initScrollBar(){this.scrollBar=new PerfectScrollbar(this.$refs.pageBody,{suppressScrollX:!0})},getTemplate(){this.loading=!0,Object(c["e"])(u,this.lang).then(({code:t,data:e,message:a})=>{100===t?this.form=e||{}:this.$message.error(a)}).finally(()=>{this.loading=!1})},getTemplateVariable(){Object(c["j"])(u,this.lang).then(({code:t,data:e,message:a})=>{100===t?this.templateVariableOptions=e||[]:this.$message.error(a)}).finally(()=>{this.loading=!1})},pushTempVariable(t){const e=this.$refs.tempContent.$el,a=t.fieldName;let n=this;return("selectionStart"in e&&function(){return n.form.content=n.form.content.substr(0,e.selectionStart)+a+n.form.content.substr(e.selectionEnd,e.value.length),this}||document.selection&&function(){return e.focus(),document.selection.createRange().text=a,this}||function(){return n.form.content+=a,this})()},handleSubmit(){return!this.loading&&(!!this.validateForm()&&(this.loading=!0,void Object(c["m"])({...this.form,tag:u}).then(({code:t,message:e})=>{100===t?this.$message.success(this.$t("settings.template_payment_message.save_success")):this.$message.error(e)}).finally(()=>{this.loading=!1})))},validateForm(){let t=!1;return this.$refs.form.validate(e=>{t=e}),t}},created(){this.getTemplate(),this.getTemplateVariable()},mounted(){this.initScrollBar()}},d=m,p=(a("3738"),a("2877")),f=Object(p["a"])(d,n,s,!1,null,"2f8dc414",null);e["default"]=f.exports},"701d":function(t,e,a){},"89dd":function(t,e,a){"use strict";var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"page-title-wrap align-items-center"},[t.icon?[e("icon-font",{staticClass:"page-title-icon mg-r-8",attrs:{type:t.icon}})]:t._e(),t.title?e("h3",{staticClass:"mg-b-0 title-5 grey-04 title-5",class:{"mobile-hide":t.mobileHideTitle}},[t._v(t._s(t.title))]):t._e(),t._t("default")],2)},s=[],i={data(){return{}},props:{title:{type:String,default:""},icon:{type:String|Boolean,default:!1},mobileHideTitle:{type:Boolean,default:!1}},computed:{hasSlot(){return!!this.$slots.default}}},r=i,l=(a("d130"),a("2877")),o=Object(l["a"])(r,n,s,!1,null,"d4171356",null);e["a"]=o.exports},"8b29":function(t,e,a){"use strict";a("8cd6")},"8cd6":function(t,e,a){},"9c24":function(t,e,a){"use strict";var n=function(){var t=this,e=t._self._c;return e("div",[e("div",{ref:"container",staticClass:"sub-menu-container ps",class:{hide:t.mobile}},[e("div",{staticClass:"menu-list"},[t._l(t.subMenu,(function(a){return[t.visibleMenu(a)?e("router-link",{key:a.title,staticClass:"menu-item",class:{active:t.menuIsActive(a)},attrs:{to:a.to}},[a.antdIcon?e("a-icon",{attrs:{type:a.icon}}):e("icon-font",{attrs:{type:a.icon}}),e("span",{staticClass:"mg-l-10 subtitle-3"},[t._v(t._s(t.$t(a.title)))])],1):t._e()]}))],2),t._t("default")],2),t.mobile?e("div",{staticClass:"mobile-sub-menu-container"},[e("a-select",{staticClass:"mg-r-5",attrs:{dropdownMatchSelectWidth:!1},on:{change:t.handleSubMenuSelectChange},model:{value:t.currentSubMenu,callback:function(e){t.currentSubMenu=e},expression:"currentSubMenu"}},[t._l(t.subMenu,(function(a){return[t.visibleMenu(a)?e("a-select-option",{key:a.to},[t._v(t._s(t.$t(a.title)))]):t._e()]}))],2)],1):t._e()])},s=[],i=(a("14d9"),a("2f62")),r={data(){return{scrollBar:null,currentSubMenu:""}},props:{mobile:{type:Boolean,default:!1}},computed:{...Object(i["c"])({companyConfig:t=>t.CONF.company,rights:t=>t.USER.rights,companyCode:t=>t.USER.companyCode}),subMenu(){return this.$route.meta.subMenu||[]},visibleMenu(){return t=>{let e=!0;if(t.enable)if("string"===typeof t.enable)e=companyConfig[t.enable];else{let a=t.enable.length;t.enable.forEach(t=>{!1===this.companyConfig[t]&&a--}),0===a&&(e=!1)}return t.right&&-1===this.rights.indexOf(t.right)&&(e=!1),e}},menuIsActive(){return t=>t.name===this.$route.name||t.name===this.$route.meta.subMenuKey||t.name===this.$route.params.type}},watch:{},methods:{initScrollBar(){try{this.scrollBar=new PerfectScrollbar(this.$refs.container)}catch{}},initCurrentSubMenu(){let t=this.subMenu.find(t=>this.menuIsActive(t));this.currentSubMenu=t.to||""},handleSubMenuSelectChange(t){this.$router.push(t)}},created(){this.initCurrentSubMenu()},mounted(){this.initScrollBar()}},l=r,o=(a("3de9"),a("2877")),c=Object(o["a"])(l,n,s,!1,null,"4856a862",null);e["a"]=c.exports},c621:function(t,e,a){"use strict";a.d(e,"j",(function(){return s})),a.d(e,"m",(function(){return i})),a.d(e,"e",(function(){return r})),a.d(e,"k",(function(){return l})),a.d(e,"g",(function(){return o})),a.d(e,"a",(function(){return c})),a.d(e,"n",(function(){return u})),a.d(e,"f",(function(){return m})),a.d(e,"b",(function(){return d})),a.d(e,"l",(function(){return p})),a.d(e,"d",(function(){return f})),a.d(e,"i",(function(){return b})),a.d(e,"o",(function(){return h})),a.d(e,"h",(function(){return g})),a.d(e,"c",(function(){return _}));var n=a("8daa");function s(t,e){return Object(n["b"])({url:`/api/sys/getTemplateVariable/${t}/${e}`,method:"GET"})}function i(t){return Object(n["b"])({url:"/api/sys/InsertOrUpdateSysTemplate",method:"POST",data:t})}function r(t,e){return Object(n["b"])({url:`/api/sys/getTemplate/${t}/${e}`,method:"GET"})}function l(t){return Object(n["b"])({url:"/api/ChatContact/GetMessageTemplateContetAnalysis",method:"GET",params:t})}function o(t,e){return Object(n["b"])({url:"/api/Broadcast/GetWhatsappTemplateList",method:"GET",params:t,cancelToken:e})}function c(t){return Object(n["b"])({url:"/api/Broadcast/CreateWhatsappTemplate",method:"POST",data:t})}function u(t){return Object(n["b"])({url:"/api/Broadcast/UpdateWhatsappTemplate",method:"POST",data:t})}function m(t,e){return Object(n["b"])({url:"/api/Broadcast/GetWhatsappTemplateByTemplateId",method:"GET",params:t,cancelToken:e})}function d(t){return Object(n["b"])({url:"/api/Broadcast/DeleteWhatsappTemplate",method:"GET",params:t})}function p(t){return Object(n["b"])({url:"/api/saleReport/AddReportBroadcastTemplate",method:"POST",data:t})}function f(t){return Object(n["b"])({url:"/api/saleReport/GetReportTemplateByGroupId",method:"GET",params:t})}function b(t,e){return Object(n["b"])({url:"/api/Broadcast/GetListMessageTemplate",method:"POST",params:t,cancelToken:e})}function h(t){return Object(n["b"])({url:"/api/Broadcast/InsertOrUpdateListMessage",method:"POST",data:t})}function g(t,e){return Object(n["b"])({url:"/api/Broadcast/GetListMessageTemplateById",method:"GET",params:t,cancelToken:e})}function _(t){return Object(n["b"])({url:"/api/Broadcast/DeleteListMessageById",method:"GET",params:t})}},d130:function(t,e,a){"use strict";a("35f2")}}]);