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