瀏覽代碼

汇付账号添加

mo 3 年之前
父節點
當前提交
ba7dd6d0f5
共有 4 個文件被更改,包括 454 次插入115 次删除
  1. 69 72
      src/utils/request.js
  2. 22 1
      src/views/organManager/api.js
  3. 272 0
      src/views/organManager/components/hfPayCount.vue
  4. 91 42
      src/views/organManager/index.vue

+ 69 - 72
src/utils/request.js

@@ -1,45 +1,48 @@
-import ElementUI from 'element-ui'
-import axios from 'axios'
-import { Message } from 'element-ui'
-import store from '@/store'
-import { getToken } from '@/utils/auth'
-import cleanDeep from 'clean-deep'
-import qs from 'querystring'
+import ElementUI from "element-ui";
+import axios from "axios";
+import { Message } from "element-ui";
+import store from "@/store";
+import { getToken } from "@/utils/auth";
+import cleanDeep from "clean-deep";
+import qs from "querystring";
 // import { Loading } from 'element-ui'
 // import { Loading } from 'element-ui'
-import { showFullScreenLoading, tryHideFullScreenLoading } from './request-loading'
-import router from '@/router/index'
-import Vue from 'vue'
-const showMessage = Symbol('showMessage')
+import {
+  showFullScreenLoading,
+  tryHideFullScreenLoading
+} from "./request-loading";
+import router from "@/router/index";
+import Vue from "vue";
+const showMessage = Symbol("showMessage");
 class DonMessage {
 class DonMessage {
-  success (options, single = true) {
-    this[showMessage]('success', options, single)
+  success(options, single = true) {
+    this[showMessage]("success", options, single);
   }
   }
-  warning (options, single = true) {
-    this[showMessage]('warning', options, single)
+  warning(options, single = true) {
+    this[showMessage]("warning", options, single);
   }
   }
-  info (options, single = true) {
-    this[showMessage]('info', options, single)
+  info(options, single = true) {
+    this[showMessage]("info", options, single);
   }
   }
-  error (options, single = true) {
-    this[showMessage]('error', options, single)
+  error(options, single = true) {
+    this[showMessage]("error", options, single);
   }
   }
-  [showMessage] (type, options, single) {
+  [showMessage](type, options, single) {
     if (single) {
     if (single) {
       // 判断是否已存在Message
       // 判断是否已存在Message
-      if (document.getElementsByClassName('el-message').length === 0) {
-        Message[type](options)
+      if (document.getElementsByClassName("el-message").length === 0) {
+        Message[type](options);
       }
       }
     } else {
     } else {
-      Message[type](options)
+      Message[type](options);
     }
     }
   }
   }
 }
 }
 
 
-Vue.use(ElementUI)
+Vue.use(ElementUI);
 // 命名根据需要,DonMessage只是在文章中使用
 // 命名根据需要,DonMessage只是在文章中使用
-Vue.prototype.$message = new DonMessage()
+Vue.prototype.$message = new DonMessage();
 
 
-let vue = new Vue()
+let vue = new Vue();
 
 
 // let loading        //定义loading变量
 // let loading        //定义loading变量
 
 
@@ -60,52 +63,48 @@ let vue = new Vue()
 //调用tryHideFullScreenLoading()方法,needLoadingRequestCount - 1。needLoadingRequestCount为 0 时,结束 loading。
 //调用tryHideFullScreenLoading()方法,needLoadingRequestCount - 1。needLoadingRequestCount为 0 时,结束 loading。
 // axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
 // axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
 
 
-
 // create an axios instance
 // create an axios instance
 const service = axios.create({
 const service = axios.create({
-  baseURL: '', // url = base url + request url
+  baseURL: "", // url = base url + request url
   // withCredentials: true, // send cookies when cross-domain requests
   // withCredentials: true, // send cookies when cross-domain requests
-  timeout: 180000, // request timeout
-})
+  timeout: 180000 // request timeout
+});
 // { fullscreen: true, text: '努力加载中', spinner: 'el-icon-loading' }
 // { fullscreen: true, text: '努力加载中', spinner: 'el-icon-loading' }
 // request interceptor
 // request interceptor
 service.interceptors.request.use(
 service.interceptors.request.use(
- async config => {
+  async config => {
     // do something before request is sent
     // do something before request is sent
-  await  showFullScreenLoading(store)
+    await showFullScreenLoading(store);
     if (store.getters.token) {
     if (store.getters.token) {
       // let each request carry token
       // let each request carry token
       // ['X-Token'] is a custom headers key
       // ['X-Token'] is a custom headers key
       // please modify it according to the actual situation
       // please modify it according to the actual situation
-      config.headers['Authorization'] = getToken()
+      config.headers["Authorization"] = getToken();
       // config.headers['content-type'] = "application/x-www-form-urlencoded"
       // config.headers['content-type'] = "application/x-www-form-urlencoded"
     }
     }
-    let tenantConfig = sessionStorage.getItem('tenantConfig')
-    tenantConfig = tenantConfig ? JSON.parse(tenantConfig) : {}
-    if(tenantConfig.tenantId && tenantConfig.tenantId != 'undefined') {
-      config.headers['tenantId'] = tenantConfig.tenantId
+    let tenantConfig = sessionStorage.getItem("tenantConfig");
+    tenantConfig = tenantConfig ? JSON.parse(tenantConfig) : {};
+    if (tenantConfig.tenantId && tenantConfig.tenantId != "undefined") {
+      config.headers["tenantId"] = tenantConfig.tenantId;
     }
     }
-    config.params = cleanDeep(config.params)
+    config.params = cleanDeep(config.params);
     //  params: cleanDeep(options.params),
     //  params: cleanDeep(options.params),
     //  (config)
     //  (config)
-    return config
+    return config;
   },
   },
   error => {
   error => {
     // do something with request error
     // do something with request error
-    return Promise.reject(error)
-
+    return Promise.reject(error);
   }
   }
-)
+);
 
 
 // response interceptor
 // response interceptor
 service.interceptors.response.use(
 service.interceptors.response.use(
- async res => {
+  async res => {
     //res.code !== 200
     //res.code !== 200
-  await tryHideFullScreenLoading(store)
+    await tryHideFullScreenLoading(store);
     if (res.data) {
     if (res.data) {
-
-
-      let data = JSON.parse(JSON.stringify(res.data))
+      let data = JSON.parse(JSON.stringify(res.data));
       // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
       // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
       if (data.code == 401 || data.code == 403) {
       if (data.code == 401 || data.code == 403) {
         // Message({
         // Message({
@@ -113,48 +112,46 @@ service.interceptors.response.use(
         //   type: 'error',
         //   type: 'error',
         //   duration: 5 * 1000
         //   duration: 5 * 1000
         // })
         // })
-        vue.$message.error(`登录过期,请重新登录!`)
-        setTimeout(() => {
-
-          store.dispatch('user/resetToken').then(() => {
-            location.reload()
-          })
+        vue.$message.error(`登录过期,请重新登录!`);
+        setTimeout(async () => {
+          await store.dispatch("user/resetToken").then(() => {
+            location.reload();
+          });
         }, 1000);
         }, 1000);
         return;
         return;
       }
       }
       if (data.code == 404) {
       if (data.code == 404) {
-        router.push('/404')
+        router.push("/404");
       }
       }
-      if (data.code < 200&&data.code != 100||data.code >= 300&&data.code != 100) {
+      if (
+        (data.code < 200 && data.code != 100) ||
+        (data.code >= 300 && data.code != 100)
+      ) {
         // Message({
         // Message({
         //   message: data.msg || `请求失败code码为${ data.code }`,
         //   message: data.msg || `请求失败code码为${ data.code }`,
         //   type: 'error',
         //   type: 'error',
         //   duration: 5 * 1000
         //   duration: 5 * 1000
         // })
         // })
-        let str = data.msg || `请求失败code码为${data.code}`
+        let str = data.msg || `请求失败code码为${data.code}`;
 
 
-        vue.$message.error(str)
+        vue.$message.error(str);
 
 
-        return Promise.reject(new Error(data.msg || 'Error'))
+        return Promise.reject(new Error(data.msg || "Error"));
       } else {
       } else {
-
-        return data
-
+        return data;
       }
       }
     } else {
     } else {
-
-
-      return Promise.reject()
+      return Promise.reject();
     }
     }
   },
   },
- async error => {
-    if (error.message == 'Network Error') {
-      vue.$message.error('网络异常,请检查网络连接')
+  async error => {
+    if (error.message == "Network Error") {
+      vue.$message.error("网络异常,请检查网络连接");
     } else {
     } else {
-      vue.$message.error(error.message)
+      vue.$message.error(error.message);
     }
     }
-  await  tryHideFullScreenLoading(store)
-    return Promise.reject(error)
+    await tryHideFullScreenLoading(store);
+    return Promise.reject(error);
   }
   }
-)
-export default service
+);
+export default service;

+ 22 - 1
src/views/organManager/api.js

@@ -53,4 +53,25 @@ export const tenantContractRecordList = (data) => request2({
   url: '/api-web/tenantContractRecord/queryPage',
   url: '/api-web/tenantContractRecord/queryPage',
   method: 'post',
   method: 'post',
   data
   data
-})
+})
+
+// 获取汇付信息
+export const getHfMerchantConfig = (data) => request2({
+  url: `/api-web/hfMerchantConfig/queryByTenantId/${data}`,
+  method: 'get',
+})
+
+
+// 创建汇付商户配置
+export const addHfMerchantConfig = (data) => request2({
+  url: '/api-web/hfMerchantConfig/add',
+  method: 'post',
+  data
+})
+
+// 修改汇付神户配置
+export const resetHfMerchantConfig = (data) => request2({
+  url: '/api-web/hfMerchantConfig/update',
+  method: 'post',
+  data
+})

+ 272 - 0
src/views/organManager/components/hfPayCount.vue

@@ -0,0 +1,272 @@
+<template>
+  <div>
+    <el-dialog
+      title="汇付账号设置"
+      :visible.sync="nextVisible"
+      width="650px"
+      append-to-body
+    >
+      <el-form :model="form" ref="form" label-width="170px">
+        <el-form-item
+          label="汇付ApiKey"
+          prop="apiKey"
+          :rules="[
+            {
+              required: true,
+              message: '请输入汇付ApiKey',
+            },
+          ]"
+        >
+          <el-input
+            style="width: 400px"
+            v-model="form.apiKey"
+            placeholder="请输入汇付ApiKey"
+          >
+          </el-input>
+        </el-form-item>
+        <el-form-item
+          label="汇付AppId"
+          prop="appId"
+          :rules="[
+            {
+              required: true,
+              message: '请输入汇付AppId',
+            },
+          ]"
+        >
+          <el-input
+            style="width: 400px"
+            v-model="form.appId"
+            placeholder="请输入汇付AppId"
+          >
+          </el-input>
+        </el-form-item>
+        <el-form-item
+          label="商户Key"
+          prop="merKey"
+          :rules="[
+            {
+              required: true,
+              message: '请输入商户Key',
+            },
+          ]"
+        >
+          <el-input
+            style="width: 400px"
+            v-model="form.merKey"
+            placeholder="请输入商户Key"
+          >
+          </el-input>
+        </el-form-item>
+        <el-form-item
+          label="汇付MockApiKey"
+          prop="mockApiKey"
+          :rules="[
+            {
+              required: true,
+              message: '请输入汇付MockApiKey',
+            },
+          ]"
+        >
+          <el-input
+            style="width: 400px"
+            v-model="form.mockApiKey"
+            placeholder="请输入汇付MockApiKey"
+          >
+          </el-input>
+        </el-form-item>
+        <el-form-item
+          label="平台收款子账户号"
+          prop="platformPayeeMemberId"
+          :rules="[
+            {
+              required: true,
+              message: '请输入平台收款子账户号',
+            },
+          ]"
+        >
+          <el-input
+            style="width: 400px"
+            v-model="form.platformPayeeMemberId"
+            placeholder="请输入平台收款子账户号"
+          >
+          </el-input>
+        </el-form-item>
+        <el-form-item
+          label="商户私钥"
+          prop="rsaPrivateKey"
+          :rules="[
+            {
+              required: true,
+              message: '请输入商户私钥',
+            },
+          ]"
+        >
+          <el-input
+            style="width: 400px"
+            v-model="form.rsaPrivateKey"
+            placeholder="请输入商户私钥"
+          >
+          </el-input>
+        </el-form-item>
+        <el-form-item
+          label="汇付公钥"
+          prop="rsaPublicKey"
+          :rules="[
+            {
+              required: true,
+              message: '请输入汇付公钥',
+            },
+          ]"
+        >
+          <el-input
+            style="width: 400px"
+            v-model="form.rsaPublicKey"
+            placeholder="请输入汇付公钥"
+          >
+          </el-input>
+        </el-form-item>
+        <el-form-item
+          label="微信公众号开发者ID"
+          prop="wxAppId"
+          :rules="[
+            {
+              required: true,
+              message: '请输入微信公众号开发者ID',
+            },
+          ]"
+        >
+          <el-input
+            style="width: 400px"
+            v-model="form.wxAppId"
+            placeholder="请输入微信公众号开发者ID"
+          >
+          </el-input>
+        </el-form-item>
+        <el-form-item
+          label="微信公众号开发者密码"
+          prop="wxAppSecret"
+          :rules="[
+            {
+              required: true,
+              message: '请输入微信公众号开发者密码',
+            },
+          ]"
+        >
+          <el-input
+            style="width: 400px"
+            v-model="form.wxAppSecret"
+            placeholder="请输入微信公众号开发者密码"
+          >
+          </el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="nextVisible = false">取 消</el-button>
+        <el-button type="primary" @click="submitInfo">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import axios from "axios";
+import { getToken } from "@/utils/auth";
+import load from "@/utils/loading";
+import { getTimes } from "@/utils";
+import {
+  getHfMerchantConfig,
+  addHfMerchantConfig,
+  resetHfMerchantConfig,
+} from "../api";
+export default {
+  data() {
+    return {
+      form: {
+        apiKey: "",
+        appId: "",
+        createTime: "",
+        expendParams: "",
+        id: 0,
+        merKey: "",
+        mockApiKey: "",
+        platformPayeeMemberId: "",
+        rsaPrivateKey: "",
+        rsaPublicKey: "",
+        tenantId: 0,
+        updateTime: "",
+        wxAppId: "",
+        wxAppSecret: "",
+      },
+      nextVisible: false,
+      isNew: false,
+      activeId:''
+    };
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {},
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+    // 获取分部
+  },
+  methods: {
+    init(row) {
+      this.form.tenantId = row.id;
+      this.activeId = row.id
+      this.gethfInfo();
+      this.nextVisible = true;
+    },
+    async gethfInfo() {
+      try {
+        const res = await getHfMerchantConfig(this.form.tenantId);
+        if (res.data) {
+          this.form = { ...this.form, ...res.data };
+          this.isNew = false;
+        } else {
+          this.form = {
+            apiKey: "",
+            appId: "",
+            createTime: "",
+            expendParams: "",
+            id: 0,
+            merKey: "",
+            mockApiKey: "",
+            platformPayeeMemberId: "",
+            rsaPrivateKey: "",
+            rsaPublicKey: "",
+            tenantId: 0,
+            updateTime: "",
+            wxAppId: "",
+            wxAppSecret: "",
+          };
+          this.$refs.form.resetFields();
+          this.form.tenantId = this.activeId;
+          this.isNew = true;
+        }
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    submitInfo() {
+      this.$refs.form.validate(async (res) => {
+        if (res) {
+          // 提交
+          try {
+            if (this.isNew) {
+              const res = await addHfMerchantConfig({ ...this.form });
+              this.$message.success("新增成功");
+            } else {
+              const res = await resetHfMerchantConfig({ ...this.form });
+              this.$message.success("修改成功");
+            }
+            this.nextVisible = false;
+          } catch (e) {
+            console.log(e);
+          }
+        }
+      });
+    },
+  },
+};
+</script>
+<style lang='scss' scoped>
+</style>

+ 91 - 42
src/views/organManager/index.vue

@@ -15,7 +15,10 @@
         :model.sync="searchForm"
         :model.sync="searchForm"
       >
       >
         <el-form-item :rules="[]">
         <el-form-item :rules="[]">
-          <el-input v-model="searchForm.search" placeholder="机构编号/名称/电话"></el-input>
+          <el-input
+            v-model="searchForm.search"
+            placeholder="机构编号/名称/电话"
+          ></el-input>
         </el-form-item>
         </el-form-item>
         <el-form-item prop="createTimer">
         <el-form-item prop="createTimer">
           <el-date-picker
           <el-date-picker
@@ -29,7 +32,10 @@
           ></el-date-picker>
           ></el-date-picker>
         </el-form-item>
         </el-form-item>
         <el-form-item prop="createdName">
         <el-form-item prop="createdName">
-          <el-input v-model="searchForm.createdName" placeholder="请输入添加人"></el-input>
+          <el-input
+            v-model="searchForm.createdName"
+            placeholder="请输入添加人"
+          ></el-input>
         </el-form-item>
         </el-form-item>
         <el-form-item prop="payState">
         <el-form-item prop="payState">
           <el-select
           <el-select
@@ -59,7 +65,14 @@
           <el-button native-type="reset" type="primary">重置</el-button>
           <el-button native-type="reset" type="primary">重置</el-button>
         </el-form-item>
         </el-form-item>
       </save-form>
       </save-form>
-      <el-button  style="margin-bottom: 20px;" type="primary" v-permission="'tenantInfo/add'" @click="openService('create')" icon="el-icon-plus">新增机构</el-button>
+      <el-button
+        style="margin-bottom: 20px"
+        type="primary"
+        v-permission="'tenantInfo/add'"
+        @click="openService('create')"
+        icon="el-icon-plus"
+        >新增机构</el-button
+      >
       <!-- 列表 -->
       <!-- 列表 -->
       <div class="tableWrap">
       <div class="tableWrap">
         <el-table
         <el-table
@@ -81,7 +94,11 @@
               {{ scope.row.studentCount }}/{{ scope.row.studentUpLimit }}
               {{ scope.row.studentCount }}/{{ scope.row.studentUpLimit }}
             </template>
             </template>
           </el-table-column>
           </el-table-column>
-          <el-table-column align="center" label="有效期到期时间" prop="expireDate">
+          <el-table-column
+            align="center"
+            label="有效期到期时间"
+            prop="expireDate"
+          >
             <template slot-scope="scope">
             <template slot-scope="scope">
               {{ scope.row.expireDate | formatTimer }}
               {{ scope.row.expireDate | formatTimer }}
             </template>
             </template>
@@ -106,32 +123,47 @@
                 @click="openService('look', scope.row)"
                 @click="openService('look', scope.row)"
                 v-permission="'tenantInfo/info'"
                 v-permission="'tenantInfo/info'"
                 type="text"
                 type="text"
-                >查看</el-button>
+                >查看</el-button
+              >
               <el-button
               <el-button
                 @click="openService('update', scope.row)"
                 @click="openService('update', scope.row)"
                 v-permission="'tenantInfo/update'"
                 v-permission="'tenantInfo/update'"
                 type="text"
                 type="text"
-                >修改</el-button>
+                >修改</el-button
+              >
               <el-button
               <el-button
                 @click="changeOrgan(scope.row)"
                 @click="changeOrgan(scope.row)"
-                v-permission="scope.row.state == 1 ? 'tenantInfo/opsState/stop' : 'tenantInfo/opsState/open'"
+                v-permission="
+                  scope.row.state == 1
+                    ? 'tenantInfo/opsState/stop'
+                    : 'tenantInfo/opsState/open'
+                "
                 type="text"
                 type="text"
-                >{{ scope.row.state == 1 ? '停用' : '启用' }}</el-button>
+                >{{ scope.row.state == 1 ? "停用" : "启用" }}</el-button
+              >
               <el-button
               <el-button
                 v-if="scope.row.payState != 1"
                 v-if="scope.row.payState != 1"
                 @click="onQrCode(scope.row)"
                 @click="onQrCode(scope.row)"
                 type="text"
                 type="text"
-                >缴费二维码</el-button>
+                >缴费二维码</el-button
+              >
               <el-button
               <el-button
-                v-if="scope.row.payState === 1 && $helpers.permission('tenantContractRecord/queryPage')"
-                 @click="onDownloadProtocol(scope.row)"
+                v-if="
+                  scope.row.payState === 1 &&
+                  $helpers.permission('tenantContractRecord/queryPage')
+                "
+                @click="onDownloadProtocol(scope.row)"
                 type="text"
                 type="text"
-                >下载协议</el-button>
+                >下载协议</el-button
+              >
+              <el-button @click="setHfMerchant(scope.row)" type="text"
+                >汇付账号设置</el-button
+              >
             </template>
             </template>
           </el-table-column>
           </el-table-column>
         </el-table>
         </el-table>
         <pagination
         <pagination
-        :saveKey="'platformServiceManager'"
+          :saveKey="'platformServiceManager'"
           sync
           sync
           :total.sync="pageInfo.total"
           :total.sync="pageInfo.total"
           :page.sync="pageInfo.page"
           :page.sync="pageInfo.page"
@@ -144,15 +176,25 @@
     <qr-code v-model="qrcodeStatus" title="机构缴费二维码" :codeUrl="codeUrl" />
     <qr-code v-model="qrcodeStatus" title="机构缴费二维码" :codeUrl="codeUrl" />
 
 
     <el-dialog title="协议下载" :visible.sync="protocolVisible" width="650px">
     <el-dialog title="协议下载" :visible.sync="protocolVisible" width="650px">
-      <protocol-model v-if="protocolVisible" @close="protocolVisible = false" :protocolVersions="protocolVersions" />
+      <protocol-model
+        v-if="protocolVisible"
+        @close="protocolVisible = false"
+        :protocolVersions="protocolVersions"
+      />
     </el-dialog>
     </el-dialog>
+    <hfPayCount ref='hfPayCount'/>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
 import pagination from "@/components/Pagination/index";
 import pagination from "@/components/Pagination/index";
 import QrCode from "@/components/QrCode/index";
 import QrCode from "@/components/QrCode/index";
-import protocolModel from '@/views/studentManager/modals/protocolModel';
-import { tenantInfoQueryPage , tenantInfoOpsState, tenantContractRecordList } from "./api";
+import hfPayCount from "./components/hfPayCount"
+import protocolModel from "@/views/studentManager/modals/protocolModel";
+import {
+  tenantInfoQueryPage,
+  tenantInfoOpsState,
+  tenantContractRecordList,
+} from "./api";
 import { getTimes } from "@/utils";
 import { getTimes } from "@/utils";
 import { vaildTeachingUrl } from "@/utils/validate";
 import { vaildTeachingUrl } from "@/utils/validate";
 const initSearch = {
 const initSearch = {
@@ -163,7 +205,7 @@ const initSearch = {
   createdName: null,
   createdName: null,
 };
 };
 export default {
 export default {
-  components: { pagination, QrCode, protocolModel },
+  components: { pagination, QrCode, protocolModel,hfPayCount },
   data() {
   data() {
     return {
     return {
       tableList: [],
       tableList: [],
@@ -210,13 +252,13 @@ export default {
     },
     },
     async onDownloadProtocol(item) {
     async onDownloadProtocol(item) {
       try {
       try {
-        const res = await tenantContractRecordList({ tenantId: item.id })
-        console.log(res)
+        const res = await tenantContractRecordList({ tenantId: item.id });
+        console.log(res);
         this.protocolVersions = res.data?.rows || [];
         this.protocolVersions = res.data?.rows || [];
         this.protocolVisible = true;
         this.protocolVisible = true;
-      } catch(e) {
+      } catch (e) {
         //
         //
-        console.log(e)
+        console.log(e);
       }
       }
       // window.location.href = item.url;
       // window.location.href = item.url;
     },
     },
@@ -226,37 +268,40 @@ export default {
       this.codeUrl = vaildTeachingUrl() + "/#/tenantPay/" + row.id;
       this.codeUrl = vaildTeachingUrl() + "/#/tenantPay/" + row.id;
     },
     },
     changeOrgan(row) {
     changeOrgan(row) {
-      const stateStr = row.state == 1 ? '停用' : '启用'
-      const state = row.state == 1 ? 2 : 1
+      const stateStr = row.state == 1 ? "停用" : "启用";
+      const state = row.state == 1 ? 2 : 1;
       this.$confirm(`是否${stateStr}?`, "提示", {
       this.$confirm(`是否${stateStr}?`, "提示", {
         confirmButtonText: "确定",
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         cancelButtonText: "取消",
         type: "warning",
         type: "warning",
-      }).then( async() => {
-        try{
-         await tenantInfoOpsState({ id: row.id, state})
-         this.$message.success(stateStr + '成功')
-         this.getList()
-        }catch{}
+      }).then(async () => {
+        try {
+          await tenantInfoOpsState({ id: row.id, state });
+          this.$message.success(stateStr + "成功");
+          this.getList();
+        } catch {}
       });
       });
     },
     },
     openService(type, row) {
     openService(type, row) {
-      let tagTitle = '创建'
-      if(type == 'update') {
-        tagTitle ='修改'
-      } else if(type == 'look') {
-        tagTitle = '查看'
+      let tagTitle = "创建";
+      if (type == "update") {
+        tagTitle = "修改";
+      } else if (type == "look") {
+        tagTitle = "查看";
       }
       }
 
 
-      this.$router.push({
-        path: '/platformManager/organOperation',
-        query: {
-          type: type,
-          id: row?.id || null
+      this.$router.push(
+        {
+          path: "/platformManager/organOperation",
+          query: {
+            type: type,
+            id: row?.id || null,
+          },
+        },
+        (route) => {
+          route.meta.title = tagTitle + "机构";
         }
         }
-      }, (route) => {
-        route.meta.title = tagTitle + '机构'
-      })
+      );
     },
     },
     // async delService(row) {
     // async delService(row) {
     //   this.$confirm("是否删除?", "提示", {
     //   this.$confirm("是否删除?", "提示", {
@@ -271,6 +316,10 @@ export default {
     //     }catch{}
     //     }catch{}
     //   });
     //   });
     // },
     // },
+    setHfMerchant(row) {
+      console.log("setHfMerchant", row);
+      this.$refs.hfPayCount.init(row)
+    },
   },
   },
 };
 };
 </script>
 </script>