1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-882e18a8"],{"1c7d":function(t,e,a){"use strict";a("871a")},"788d":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container bgHeight"},[a("el-card",{staticClass:"box-card",attrs:{shadow:"never"}},[a("div",{staticClass:"planLst",attrs:{slot:"header"},slot:"header"},[a("span",{staticClass:"planTitle"},[t._v(" 支付配置 ")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:t.showPay}},[t._v("添加支付场景")])],1),t._v(" "),a("el-table",{attrs:{border:"",data:t.listTable,"header-cell-style":t.headClass,fit:"","highlight-current-row":""}},[a("el-table-column",{attrs:{label:"#",align:"center",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.$index+(t.query.pageNumber-1)*t.query.pageSize+1))])]}}])}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"支付场景"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t._f("getItemType")(e.row.payscene,t.paymentTargetList)))]}}])}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"结算渠道",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[2==e.row.channel?a("div",[a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:e.row.channelNo,placement:"top-start"}},[a("span",[t._v(t._s(t._f("getItemType")(e.row.channel,t.paymentChannelList)))])])],1):t._e(),t._v(" "),1==e.row.channel?a("div",[t._v("\n "+t._s(t._f("getItemType")(e.row.channel,t.paymentChannelList))+"\n ")]):t._e()]}}])}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"结算对象"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticStyle:{"text-align":"left"}},[t._v("\n "+t._s(t.getMerchantName(e.row.infoRespDTOS))+"\n ")])]}}])}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"小程序appid"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.appid||"-"))]}}])}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"公众号appid"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.gzAppid||"-"))]}}])}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"支付宝appid"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.alipayAppid||"-"))]}}])}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"绑定/变更时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.updateDate||"-"))]}}])}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"操作",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text"},on:{click:function(a){return t.showAccount(e.row)}}},[t._v("绑定")])]}}])})],1)],1),t._v(" "),t.settingVisible?a("el-dialog",{attrs:{title:t.title,visible:t.settingVisible,"close-on-click-modal":!1,"close-on-press-escape":!1,width:"40%",open:t.open,"before-close":t.setClose},on:{"update:visible":function(e){t.settingVisible=e}}},[a("el-form",{ref:"settingForm",staticClass:"setForm",attrs:{model:t.settingForm,"label-width":"160px"}},["pay"==t.setType?a("el-form-item",{attrs:{label:"支付场景",prop:"payscene",rules:{required:!0,message:"请选择支付场景",trigger:"change"}}},[a("el-select",{attrs:{placeholder:"支付场景"},model:{value:t.settingForm.payscene,callback:function(e){t.$set(t.settingForm,"payscene",e)},expression:"settingForm.payscene"}},t._l(t.paymentTargetList,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1):t._e(),t._v(" "),"account"==t.setType?a("el-form-item",{attrs:{label:"结算渠道"}},[a("el-select",{attrs:{placeholder:"结算渠道"},on:{change:t.channelChange},model:{value:t.selectChannel,callback:function(e){t.selectChannel=e},expression:"selectChannel"}},t._l(t.paymentChannelList,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1):t._e(),t._v(" "),"account"==t.setType&&1==t.selectChannel?a("el-form-item",{key:Math.random(),attrs:{label:"小程序appId",prop:"subAppId",maxlength:"60",rules:{required:!0,message:"请输入小程序appid",trigger:"blur"}}},[a("el-input",{attrs:{placeholder:"请输入小程序appid",disabled:2==t.selectChannel,autocomplete:"off"},model:{value:t.settingForm.subAppId,callback:function(e){t.$set(t.settingForm,"subAppId","string"===typeof e?e.trim():e)},expression:"settingForm.subAppId"}})],1):t._e(),t._v(" "),"account"==t.setType&&1==t.selectChannel?a("el-form-item",{key:Math.random(),attrs:{label:"公众号appId",prop:"gzAppId",maxlength:"60",rules:{required:!0,message:"请输入公众号appid",trigger:"blur"}}},[a("el-input",{attrs:{placeholder:"请输入公众号appid",disabled:2==t.selectChannel,autocomplete:"off"},model:{value:t.settingForm.gzAppId,callback:function(e){t.$set(t.settingForm,"gzAppId","string"===typeof e?e.trim():e)},expression:"settingForm.gzAppId"}})],1):t._e(),t._v(" "),"account"==t.setType&&1==t.selectChannel?a("el-form-item",{key:Math.random(),attrs:{label:"支付宝生活号appId",prop:"alipayAppid",maxlength:"60",rules:{required:!0,message:"请输入支付宝生活号appId",trigger:"blur"}}},[a("el-input",{attrs:{placeholder:"请输入公众号appid",disabled:2==t.selectChannel,autocomplete:"off"},model:{value:t.settingForm.alipayAppid,callback:function(e){t.$set(t.settingForm,"alipayAppid","string"===typeof e?e.trim():e)},expression:"settingForm.alipayAppid"}})],1):t._e(),t._v(" "),"account"==t.setType&&1==t.selectChannel?a("el-form-item",{key:Math.random(),attrs:{label:"结算对象",prop:"kftData",rules:{required:!0,message:"请选择结算对象",trigger:"change"}}},[a("el-select",{attrs:{placeholder:"结算对象",multiple:"","value-key":"kftMerchantId"},on:{"remove-tag":t.removeChange},model:{value:t.settingForm.kftData,callback:function(e){t.$set(t.settingForm,"kftData",e)},expression:"settingForm.kftData"}},t._l(t.list,(function(t){return a("el-option",{key:t.id,attrs:{label:t.secMerchantName,value:t}})})),1)],1):t._e(),t._v(" "),"account"==t.setType&&2==t.selectChannel?a("el-form-item",{key:Math.random(),attrs:{label:"结算对象",prop:"kftData2",rules:{required:!0,message:"请选择结算对象",trigger:"blur"}}},[a("el-select",{attrs:{placeholder:"结算对象","value-key":"kftMerchantId"},model:{value:t.settingForm.kftData2,callback:function(e){t.$set(t.settingForm,"kftData2",e)},expression:"settingForm.kftData2"}},t._l(t.list,(function(t){return a("el-option",{key:t.id,attrs:{label:t.secMerchantName,value:t}})})),1)],1):t._e(),t._v(" "),"account"==t.setType?a("el-form-item",{key:"1",attrs:{label:"登录密码",prop:"password",rules:{required:!0,message:"请输入当前用户登录密码",trigger:"blur"}}},[a("el-input",{attrs:{type:"password",placeholder:"请输入当前用户登录密码"},model:{value:t.settingForm.password,callback:function(e){t.$set(t.settingForm,"password","string"===typeof e?e.trim():e)},expression:"settingForm.password"}})],1):t._e(),t._v(" "),"account"==t.setType&&1==t.selectChannel?a("el-form-item",{attrs:{label:""}},t._l(t.settingForm.kftData,(function(e){return a("div",{key:e.id,staticClass:"setContent"},[a("div",{staticClass:"settingName"},[t._v(t._s(e.secMerchantName))]),t._v(" "),a("el-input-number",{attrs:{"controls-position":"right",precision:1,step:.1,min:0,max:100},model:{value:e.rate,callback:function(a){t.$set(e,"rate",a)},expression:"item.rate"}}),t._v(" "),a("div",{staticClass:"percent"},[t._v("%")]),t._v(" "),a("el-switch",{attrs:{"active-value":!0,"inactive-value":!1,"active-text":"设为主结算对象"},on:{change:function(a){return t.switchChange(e,a)}},model:{value:e.main,callback:function(a){t.$set(e,"main",a)},expression:"item.main"}})],1)})),0):t._e(),t._v(" "),"account"==t.setType&&2==t.selectChannel&&t.settingForm.kftData2?a("el-form-item",{attrs:{label:""}},[a("div",{staticClass:"setContent"},[a("div",{staticClass:"settingName"},[t._v("\n "+t._s(t.settingForm.kftData2.secMerchantName)+"\n ")]),t._v(" "),a("el-input-number",{attrs:{"controls-position":"right",precision:1,step:.1,min:0,max:100},model:{value:t.settingForm.kftData2.rate,callback:function(e){t.$set(t.settingForm.kftData2,"rate",e)},expression:"settingForm.kftData2.rate"}}),t._v(" "),a("div",{staticClass:"percent"},[t._v("%")]),t._v(" "),a("el-switch",{attrs:{"active-value":!0,"inactive-value":!1,"active-text":"设为主结算对象"},on:{change:function(e){return t.switchChange(t.settingForm.kftData2,e)}},model:{value:t.settingForm.kftData2.main,callback:function(e){t.$set(t.settingForm.kftData2,"main",e)},expression:"settingForm.kftData2.main"}})],1)]):t._e(),t._v(" "),a("el-form-item",{attrs:{label:""}},[a("el-button",{on:{click:t.setClose}},[t._v("取 消")]),t._v(" "),"pay"==t.setType?a("el-button",{attrs:{type:"primary"},on:{click:t.setPayPost}},[t._v("确 定")]):t._e(),t._v(" "),"account"==t.setType?a("el-button",{attrs:{type:"primary"},on:{click:t.setAccountPost}},[t._v("确 定")]):t._e()],1)],1)],1):t._e()],1)},s=[],i=(a("4360"),a("b775"));function r(t){return Object(i["a"])({url:"/appproject/KftBind/pageList",method:"post",data:t})}function o(t){return Object(i["a"])({url:"/appproject/KftBind/create",method:"post",data:t})}function l(t){return Object(i["a"])({url:"/appproject/KftBind/addKftBindInfo",method:"post",data:t})}function c(t){return Object(i["a"])({url:"/appproject/KftMerchant/pageList",method:"post",data:t})}function p(t){return Object(i["a"])({url:"/appproject/XyfMerchant/pageList",method:"post",data:t})}var u=a("dce5");function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function f(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)}return a}function d(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?f(Object(a),!0).forEach((function(e){h(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):f(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function h(t,e,a){return(e=g(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function g(t){var e=b(t,"string");return"symbol"==m(e)?e:e+""}function b(t,e){if("object"!=m(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var n=a.call(t,e||"default");if("object"!=m(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var y={data:function(){return{title:"",paymentTargetList:u["Pb"],businessFunctionsList:u["u"],paymentChannelList:u["Lb"],settingVisible:!1,setType:"pay",total:0,kftList:[],xyfList:[],list:[],listTable:[],selectChannel:1,settingForm:{payscene:"",subAppId:"",gzAppId:"",alipayAppid:"",kftData:[],kftData2:"",password:""},saveData:"",query:{pageNumber:1,pageSize:10}}},created:function(){this.getlistData(),this.getKFTList(),this.getXYFList()},methods:{getlistData:function(){var t=this;this.query.projectUuid=this.$store.state.community_uuid,r(this.query).then((function(e){t.listTable=[],e&&e.data&&(e.data.records.map((function(e){t.listTable.push(d(d({},e),{},{channel:e.infoRespDTOS&&e.infoRespDTOS.length?e.infoRespDTOS[0].merchantType:null}))})),console.log(t.listTable,"列表数据"),t.total=e.data.rowsCount)}))},showPay:function(){this.setType="pay",this.settingVisible=!0,this.title="新增支付场景",this.settingForm.payscene=""},setPayPost:function(){var t=this;this.$refs["settingForm"].validate((function(e){if(e){var a={projectUuid:t.$store.state.community_uuid,projectName:t.$store.state.community_name,payscene:t.settingForm.payscene};o(a).then((function(e){0==e.code&&(t.$message({message:"新增成功!",type:"success"}),t.setClose(),t.getlistData())}))}}))},getKFTList:function(){var t=this;c({pageNumber:-1,pageSize:-1,companyId:this.$store.state.companyId,status:3}).then((function(e){e&&e.data.records.length&&e.data.records.map((function(e){t.kftList.push(d(d({},e),{},{kftMerchantId:e.id,rate:0,main:!1,merchantType:1}))}))}))},getXYFList:function(){var t=this;p({pageNumber:-1,pageSize:-1,companyId:this.$store.state.companyId}).then((function(e){e&&e.data.records.length&&e.data.records.map((function(e){t.xyfList.push(d(d({},e),{},{secMerchantName:e.merchantName,secMerchantId:e.merchantNo,businessFunctions:"",kftMerchantId:e.id,rate:0,main:!1,merchantType:2}))}))}))},channelChange:function(t){1==t?(this.settingForm.kftData=[],this.list=this.kftList):2==t&&(this.settingForm.kftData2="",this.list=this.xyfList),this.list.forEach((function(t){t.main=!1,t.rate=0}))},showAccount:function(t){this.setType="account",this.settingVisible=!0,this.title="绑定商户配置",this.settingForm={subAppId:t.appid||"",gzAppId:t.gzAppid||"",alipayAppid:t.alipayAppid||"",kftData:[],kftData2:null,password:""},console.log(t),this.$nextTick((function(){this.selectChannel=t.channel?t.channel:1,this.settingForm.subAppId=t.appid||"",this.settingForm.gzAppId=t.gzAppid||"",this.settingForm.alipayAppid=t.alipayAppid||"",t.infoRespDTOS&&(t.infoRespDTOS.map((function(t){t.main=1==t.master,t.secMerchantName=t.kftMerchantName,t.id=t.kftMerchantId})),1==this.selectChannel?this.settingForm.kftData=t.infoRespDTOS:this.settingForm.kftData2=d({},t.infoRespDTOS[0])),1==this.selectChannel?this.list=this.kftList:this.list=this.xyfList,this.saveData=t,console.log(this.saveData),console.log(this.settingForm)}))},removeChange:function(t){t.rate=0,t.main=!1},switchChange:function(t,e){this.settingForm.kftData.map((function(e){e.id!=t.id&&(e.main=!1)})),this.$forceUpdate()},setAccountPost:function(){var t=this;this.$refs["settingForm"].validate((function(e){if(e){if(!t.checkInput())return;var a={memberName:t.$store.state.user.userInfo.memberName,memberId:t.$store.state.user.userInfo.id,memberPhone:t.$store.state.user.userInfo.accountName,operatorId:t.$store.state.user.userInfo.id,operatorName:t.$store.state.user.userInfo.memberName,operatorUuid:t.$store.state.user.userInfo.memberUuid,dtoList:t.checkInput(),bindId:t.saveData.id,pwdWord:t.settingForm.password};1==t.selectChannel?(a.subAppId=t.settingForm.subAppId,a.gzAppId=t.settingForm.gzAppId,a.alipayAppid=t.settingForm.alipayAppid):(a.subAppId=t.settingForm.kftData2.subAppId,a.gzAppId=t.settingForm.kftData2.gzAppId,a.alipayAppid=t.settingForm.kftData2.alipayAppid),l(a).then((function(e){0==e.code&&(t.$message({message:"配置成功!",type:"success"}),t.setClose(),t.getlistData())}))}}))},checkInput:function(){var t=0,e=[],a=[];return console.log(this.settingForm.kftData2),1==this.selectChannel?this.settingForm.kftData.map((function(n){t+=n.rate,n.main&&e.push(n),a.push({businessFunctions:n.businessFunctions,kftMerchantId:n.id,kftMerchantName:n.secMerchantName,secMerchantId:n.secMerchantId,master:n.main?1:0,rate:n.rate,merchantType:n.merchantType})})):a.push({businessFunctions:this.settingForm.kftData2.businessFunctions,kftMerchantId:this.settingForm.kftData2.id,kftMerchantName:this.settingForm.kftData2.secMerchantName,secMerchantId:this.settingForm.kftData2.secMerchantId,master:this.settingForm.kftData2.main?1:0,rate:this.settingForm.kftData2.rate,merchantType:this.settingForm.kftData2.merchantType}),1==this.selectChannel&&100!=t?(this.$message("结算对象的分配比例之和应为100%"),!1):1==this.selectChannel&&1!=e.length?(this.$message("需要设置一个主结算对象"),!1):2==this.selectChannel&&100!=this.settingForm.kftData2.rate?(this.$message("结算对象的分配比例之和应为100%"),!1):2!=this.selectChannel||this.settingForm.kftData2.main?a:(this.$message("需要设置一个主结算对象"),!1)},getMerchantName:function(t){if(t){var e=[];return t.forEach((function(t){e.push("".concat(t.kftMerchantName))})),e.toString()}return"-"},open:function(){var t=this;this.$nextTick((function(){t.$refs.settingForm&&t.$refs.settingForm.clearValidate()}))},setClose:function(){this.settingForm={payscene:"",subAppId:"",gzAppId:"",alipayAppid:"",kftData:[],kftData2:null,password:""},this.settingVisible=!1,this.selectChannel=1,this.list=[]},headClass:function(){return"text-align:center;background:#FAFAFA;"}}},v=y,k=(a("1c7d"),a("829d")),_=Object(k["a"])(v,n,s,!1,null,null,null);e["default"]=_.exports},"871a":function(t,e,a){}}]); |