(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-cde426da"],{"6f4f":function(e,a,t){},"948c":function(e,a,t){"use strict";t.r(a);var l=function(){var e=this,a=e._self._c;return a("div",[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[a("span",[e._v("支付配置")]),0===e.smallWeChatManageInfo.smallWeChats.length?a("el-button",{staticStyle:{float:"right",padding:"3px 0"},attrs:{type:"primary",size:"small"},on:{click:function(a){return e._openAddSmallWeChatModal(1100)}}},[a("i",{staticClass:"el-icon-plus"}),e._v("添加 ")]):e._e()],1),a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.smallWeChatManageInfo.smallWeChats,border:"",stripe:""}},[a("el-table-column",{attrs:{prop:"name",label:"名称",align:"center"}}),a("el-table-column",{attrs:{prop:"payPassword",label:"支付密码",align:"center"}},[[e._v(" ********** ")]],2),a("el-table-column",{attrs:{prop:"mchId",label:"商户ID",align:"center"}}),a("el-table-column",{attrs:{prop:"mchName",label:"商户名称",align:"center"}}),a("el-table-column",{attrs:{prop:"remarks",label:"描述",align:"center"}}),a("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{size:"mini"},on:{click:function(a){return e._openEditSmallWeChatModel(t.row)}}},[e._v("修改")])]}}])})],1)],1),a("add-small-we-chat",{ref:"addSmallWeChat"}),a("edit-small-we-chat",{ref:"editSmallWeChat"})],1)},o=[],s=t("b775"),i=t("7323");function n(e){return new Promise((a,t)=>{Object(s["a"])({url:"/smallWeChat/listSmallWeChats",method:"get",params:{...e,shopId:Object(i["f"])()}}).then(e=>{const t=e.data;a(t)}).catch(e=>{t(e)})})}function d(e){return new Promise((a,t)=>{Object(s["a"])({url:"/smallWeChat/saveSmallWeChat",method:"post",data:{...e,objId:Object(i["f"])()}}).then(e=>{const t=e.data;a(t)}).catch(e=>{t(e)})})}function r(e){return new Promise((a,t)=>{Object(s["a"])({url:"/smallWeChat/updateSmallWeChat",method:"post",data:{...e,objId:Object(i["f"])()}}).then(e=>{const t=e.data;a(t)}).catch(e=>{t(e)})})}var h=function(){var e=this,a=e._self._c;return a("el-dialog",{attrs:{title:"添加",visible:e.dialogVisible,width:"70%"},on:{"update:visible":function(a){e.dialogVisible=a},close:e.clearAddSmallWeChatInfo}},[a("el-form",{attrs:{"label-width":"120px"}},[a("el-form-item",{attrs:{label:"名称",required:""}},[a("el-input",{attrs:{placeholder:"必填,请填写名称"},model:{value:e.addSmallWeChatInfo.name,callback:function(a){e.$set(e.addSmallWeChatInfo,"name",a)},expression:"addSmallWeChatInfo.name"}})],1),a("el-form-item",{attrs:{label:"支付密码",required:""}},[a("el-input",{attrs:{placeholder:"必填,请填写支付密码","show-password":""},model:{value:e.addSmallWeChatInfo.payPassword,callback:function(a){e.$set(e.addSmallWeChatInfo,"payPassword",a)},expression:"addSmallWeChatInfo.payPassword"}})],1),a("el-form-item",{attrs:{label:"商户ID",required:""}},[a("el-input",{attrs:{placeholder:"必填,请填写商户ID"},model:{value:e.addSmallWeChatInfo.mchId,callback:function(a){e.$set(e.addSmallWeChatInfo,"mchId",a)},expression:"addSmallWeChatInfo.mchId"}})],1),a("el-form-item",{attrs:{label:"商户名称",required:""}},[a("el-input",{attrs:{placeholder:"必填,请填写商户名称"},model:{value:e.addSmallWeChatInfo.mchName,callback:function(a){e.$set(e.addSmallWeChatInfo,"mchName",a)},expression:"addSmallWeChatInfo.mchName"}})],1),a("el-form-item",{attrs:{label:"商户证书"}},[a("upload-file",{ref:"uploadFile",attrs:{namespace:"addSmallWeChat"},on:{notifyCert:e.handleCertUpload}})],1),a("el-form-item",{attrs:{label:"描述"}},[a("el-input",{attrs:{type:"textarea",placeholder:"选填,请填写描述信息"},model:{value:e.addSmallWeChatInfo.remarks,callback:function(a){e.$set(e.addSmallWeChatInfo,"remarks",a)},expression:"addSmallWeChatInfo.remarks"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(a){e.dialogVisible=!1}}},[e._v("取消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.saveSmallWeChatInfo}},[e._v("保存")])],1)],1)},m=[],c=t("f24c"),p={name:"AddSmallWeChat",components:{UploadFile:c["a"]},data(){return{dialogVisible:!1,addSmallWeChatInfo:{weChatId:"",name:"",appId:"-1",appSecret:"-1",payPassword:"",objType:"1000",objId:"",mchId:"",mchName:"",remarks:"",objTypes:[],types:[],weChatType:"",certPath:""}}},methods:{open(e){this.addSmallWeChatInfo.weChatType=e,this.getDictData(),this.dialogVisible=!0},async getDictData(){try{const{data:e}=await Object(i["e"])("small_wechat","obj_type"),{data:a}=await Object(i["e"])("small_wechat","wechat_type");this.addSmallWeChatInfo.objTypes=e,this.addSmallWeChatInfo.types=a,this.addSmallWeChatInfo.objId=Object(i["f"])()}catch(e){console.error("获取字典数据失败:",e)}},handleCertUpload(e){this.addSmallWeChatInfo.certPath=e.realFileName},addSmallWeChatValidate(){},saveSmallWeChatInfo(){this.addSmallWeChatValidate()?(this.addSmallWeChatInfo.objId=Object(i["f"])(),d(this.addSmallWeChatInfo).then(e=>{this.$message.success("添加成功"),this.dialogVisible=!1,this.$emit("listSmallWeChat")}).catch(e=>{this.$message.error(e.message||"添加失败")})):this.$message.error(this.validateErrInfo)},clearAddSmallWeChatInfo(){this.addSmallWeChatInfo={weChatId:"",name:"",appId:"",appSecret:"",payPassword:"",objType:"",objId:"",mchId:"",mchName:"",weChatType:"",types:this.addSmallWeChatInfo.types,remarks:"",objTypes:this.addSmallWeChatInfo.objTypes,certPath:""},this.$refs.uploadFile.clearVedio()}}},f=p,u=t("2877"),C=Object(u["a"])(f,h,m,!1,null,null,null),I=C.exports,W=function(){var e=this,a=e._self._c;return a("el-dialog",{attrs:{title:"修改",visible:e.dialogVisible,width:"70%"},on:{"update:visible":function(a){e.dialogVisible=a},close:e.refreshEditSmallWeChatInfo}},[a("el-form",{attrs:{"label-width":"120px"}},[a("el-form-item",{attrs:{label:"名称",required:""}},[a("el-input",{attrs:{placeholder:"必填,请填写名称"},model:{value:e.editSmallWeChatInfo.name,callback:function(a){e.$set(e.editSmallWeChatInfo,"name",a)},expression:"editSmallWeChatInfo.name"}})],1),a("el-form-item",{attrs:{label:"支付密码",required:""}},[a("el-input",{attrs:{placeholder:"必填,请填写支付密码","show-password":""},model:{value:e.editSmallWeChatInfo.payPassword,callback:function(a){e.$set(e.editSmallWeChatInfo,"payPassword",a)},expression:"editSmallWeChatInfo.payPassword"}})],1),a("el-form-item",{attrs:{label:"商户ID",required:""}},[a("el-input",{attrs:{placeholder:"必填,请填写商户ID"},model:{value:e.editSmallWeChatInfo.mchId,callback:function(a){e.$set(e.editSmallWeChatInfo,"mchId",a)},expression:"editSmallWeChatInfo.mchId"}})],1),a("el-form-item",{attrs:{label:"商户名称",required:""}},[a("el-input",{attrs:{placeholder:"必填,请填写商户名称"},model:{value:e.editSmallWeChatInfo.mchName,callback:function(a){e.$set(e.editSmallWeChatInfo,"mchName",a)},expression:"editSmallWeChatInfo.mchName"}})],1),a("el-form-item",{attrs:{label:"商户证书"}},[a("upload-file",{ref:"uploadFile",attrs:{namespace:"editSmallWeChat"},on:{notifyCert:e.handleCertUpload}})],1),a("el-form-item",{attrs:{label:"描述"}},[a("el-input",{attrs:{type:"textarea",placeholder:"选填,请填写描述信息"},model:{value:e.editSmallWeChatInfo.remarks,callback:function(a){e.$set(e.editSmallWeChatInfo,"remarks",a)},expression:"editSmallWeChatInfo.remarks"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(a){e.dialogVisible=!1}}},[e._v("取消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.editSmallWeChat}},[e._v("保存")])],1)],1)},b=[],S={name:"EditSmallWeChat",components:{UploadFile:c["a"]},data(){return{dialogVisible:!1,editSmallWeChatInfo:{weChatId:"",wechatId:"",name:"",appId:"-1",appSecret:"-1",payPassword:"",createTime:"",objType:"",objId:"",mchId:"",mchName:"",remarks:"",objTypes:[],certPath:""}}},methods:{open(e){this.refreshEditSmallWeChatInfo(),this.getDictData(),Object.assign(this.editSmallWeChatInfo,e),this.editSmallWeChatInfo.appId="-1",this.editSmallWeChatInfo.appSecret="-1",this.dialogVisible=!0},async getDictData(){try{const{data:e}=await Object(i["e"])("small_wechat","obj_type");this.editSmallWeChatInfo.objTypes=e}catch(e){console.error("获取字典数据失败:",e)}},handleCertUpload(e){this.editSmallWeChatInfo.certPath=e.realFileName},editSmallWeChatValidate(){},editSmallWeChat(){this.editSmallWeChatValidate()?(this.editSmallWeChatInfo.objId=Object(i["f"])(),r(this.editSmallWeChatInfo).then(e=>{console.log(e),this.$message.success("修改成功"),this.dialogVisible=!1,this.$emit("listSmallWeChat")}).catch(e=>{this.$message.error(e.message||"修改失败")})):this.$message.error(this.validateErrInfo)},refreshEditSmallWeChatInfo(){this.editSmallWeChatInfo={weChatId:"",wechatId:"",name:"",appId:"",appSecret:"",payPassword:"",createTime:"",objType:"",objId:"",mchId:"",mchName:"",remarks:"",objTypes:[],certPath:""},this.$refs.uploadFile.clearVedio()}}},g=S,w=Object(u["a"])(g,W,b,!1,null,null,null),y=w.exports,_={name:"PublicWeChatManage",components:{AddSmallWeChat:I,EditSmallWeChat:y},data(){return{smallWeChatManageInfo:{smallWeChats:[],total:0,records:1,moreCondition:!1,name:"",wetConfig:!1,conditions:{name:"",appId:"",weChatType:"1100",shopId:""}}}},created(){this.smallWeChatManageInfo.conditions.shopId=Object(i["f"])(),this._listSmallWeChats(1,15)},methods:{_listSmallWeChats(e,a){this.smallWeChatManageInfo.conditions.page=e,this.smallWeChatManageInfo.conditions.row=a,this.smallWeChatManageInfo.conditions.shopId=Object(i["f"])(),n(this.smallWeChatManageInfo.conditions).then(e=>{this.smallWeChatManageInfo.smallWeChats=e.data,this.smallWeChatManageInfo.smallWeChats.length>0&&this.$emit("wechatAttrInfo","getWechatAttrInfo",{wechatId:this.smallWeChatManageInfo.smallWeChats[0].weChatId,wId:this.smallWeChatManageInfo.smallWeChats[0].wId})}).catch(e=>{console.log("请求失败处理",e)})},_openAddSmallWeChatModal(e){this.$refs.addSmallWeChat.open(e)},_openEditSmallWeChatModel(e){this.$refs.editSmallWeChat.open(e)},_querySmallWeChatMethod(){this._listSmallWeChats(1,15)},_switchWeChatType(e){this.smallWeChatManageInfo.conditions.weChatType=e,this._listSmallWeChats(1,15)},_openWeChatMenu(e){console.log(e),this.$router.push("/pages/property/wechatMenuManage")},_openWeChatSmsTemplate(e){console.log(e),this.$router.push("/pages/property/wechatSmsTemplateManage?wechatId="+e.wechatId)}}},v=_,j=(t("a308"),Object(u["a"])(v,l,o,!1,null,"24b48955",null));a["default"]=j.exports},a308:function(e,a,t){"use strict";t("6f4f")},f24c:function(e,a,t){"use strict";var l=function(){var e=this,a=e._self._c;return a("div",[e.uploadFileInfo.progress>0?a("div",{staticClass:"progress",staticStyle:{height:"1px"}},[a("el-progress",{attrs:{percentage:e.uploadFileInfo.progress,"stroke-width":1,"show-text":!1}})],1):e._e(),e.uploadFileInfo.progress>0?a("div",{staticStyle:{"margin-bottom":"5px"}},[a("span",[e._v(e._s(e.uploadFileInfo.fileName))])]):e._e(),a("div",[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e._uploadFile}},[a("span",[e._v(e._s(e.$t("common.upload")))])]),a("input",{staticClass:"file",attrs:{type:"file",accept:"*",id:"uploadFile",hidden:""},on:{change:function(a){return e._chooseFile(a)}}})],1)])},o=[],s=t("b775");function i(e){return new Promise((a,t)=>{Object(s["a"])({url:"/upload/uploadFile",method:"post",headers:{"Content-Type":"multipart/form-data"},data:e}).then(e=>{const t=e.data;a(t)}).catch(e=>{t(e)})})}var n={name:"UploadFile",props:{namespace:{type:String,default:""}},data(){return{uploadFileInfo:{vedio:{},fileName:"",realFileName:"",progress:0}}},methods:{_uploadFile(){document.getElementById("uploadFile").click()},_chooseFile(e){const a=e.target.files;if(a&&a.length>0){const e=a[0];if(e.size>20971520)return this.$message.error("文件大小不能超过 20MB!"),!1;this.uploadFileInfo.fileName=e.name,this._doUploadFile(e)}},_doUploadFile(e){const a=new FormData;a.append("uploadFile",e),i(a,{onUploadProgress:e=>{const a=e.loaded/e.total;a<.9&&(this.uploadFileInfo.progress=(100*a).toFixed(2))}}).then(e=>{this.uploadFileInfo.progress=100,this.$message.success("文件上传成功"),this.uploadFileInfo.fileName=e.url,this.uploadFileInfo.realFileName=e.fileId,this.$emit("notifyCert",this.uploadFileInfo)}).catch(e=>{console.error("上传文件失败:",e),this.$message.error("上传文件失败")})},clearVedio(){this.uploadFileInfo={vedio:{},fileName:"",realFileName:"",progress:0}},notifyVedio(e){this.uploadFileInfo.fileName=e,this.uploadFileInfo.realFileName=e,this.uploadFileInfo.progress=100}}},d=n,r=t("2877"),h=Object(r["a"])(d,l,o,!1,null,null,null);a["a"]=h.exports}}]); //# sourceMappingURL=chunk-cde426da.cfb59cd2.js.map