Commit ff5944f2 by 张立顺

feat 签约功能开发

1 parent b18409e3
......@@ -119,3 +119,8 @@ export function accountPage(data) {
data.method = `${djPath2}merchant.paymentChannel.account.page`
return request(data, "post")
}
// 获取签约链接
export function getSignUrl(data) {
data.method = `dj.api.yseMerchant.getSignUrl`
return request(data, "post")
}
......@@ -335,7 +335,17 @@ export const withdrawStatusList = [
confLabel: "提现失败"
}
]
// (1:未签约,2:已签约))
export const withdrawSignStatusList = [
{
confId: 1,
confLabel: "未签约"
},
{
confId: 2,
confLabel: "已签约"
}
]
// 提现渠道
export const withdrawChannelList = [
{
......
......@@ -447,6 +447,12 @@ export const routerName = {
parentId: "90610",
label: "修改到账模式",
handle: "handleEditAccountMode"
},
{
authId: "9061009",
parentId: "90610",
label: "获取签约链接",
handle: "handleCopyLink"
}
],
component: _import("systemConfig/accountNew/accountList_newIndex")
......
<!-- 虚拟账户成本 -->
<template>
<div>
<div class="d2-container-content"
style="padding: 10px 20px;">
<div class=" header"
slot="header">
<d2-search ref="showSearch"
:search-form="searchForm"
:form-data="showFormData">
<div class="d2-container-content" style="padding: 10px 20px;">
<div class=" header" slot="header">
<d2-search ref="showSearch" :search-form="searchForm" :form-data="showFormData">
<!-- :slot-scope="item" -->
<template slot="channelType">
<el-cascader style="width: 50%;"
:options="merchantLevelOptions[nameToOption[searchForm.channelType]]"
:props="{ checkStrictly: true, value: 'id', label: 'merchantName' }"
:show-all-levels="false"
v-model="merchantLevelVal"
clearable
filterable />
<el-cascader style="width: 50%;" :options="merchantLevelOptions[nameToOption[searchForm.channelType]]"
:props="{ checkStrictly: true, value: 'id', label: 'merchantName' }" :show-all-levels="false"
v-model="merchantLevelVal" clearable filterable />
</template>
</d2-search>
<div class="up-btns">
<el-button @click="searchList"
size="small"
type="primary">
<el-button @click="searchList" size="small" type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
......@@ -34,56 +23,37 @@
</div>
<div class="d2-container-content">
<span slot="left">
<auth-button category="Button"
:show-btn-ids="['9061003']" />
<auth-button category="Button" :show-btn-ids="['9061003']" />
</span>
<!-- :get-list-api="getListApi" -->
<d2-table ref="merchantTable"
:table-data="restructureList"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
:has-num="false"
:table-total="total"
:array-span-method="arraySpanMethod"
@refreshTable="jumpPage">
<d2-table ref="merchantTable" :table-data="restructureList" :search-form="searchFormSearch"
:table-params="tableParams" :before-search-fn="beforeSearchFn" :has-num="false" :table-total="total"
:array-span-method="arraySpanMethod" @refreshTable="jumpPage">
<!-- <auth-button slot="auth-button" slot-scope="scope" :data="scope.scope" /> -->
<div slot="auth-button"
slot-scope="scope"
class="btnClass">
<div slot="auth-button" slot-scope="scope" class="btnClass">
<template v-if="scope.scope.yseRefFlag == 'Y'">
<auth-button slot="auth-button"
:show-btn-ids="['9061007']"
:data="scope.scope" />
<auth-button slot="auth-button" :show-btn-ids="['9061007']" :data="scope.scope" />
<auth-button v-if="!scope.scope.ineffectiveReceiptMode && scope.scope.payPlatform == 'ysepay'"
slot="auth-button"
:show-btn-ids="['9061008']"
:data="scope.scope" />
slot="auth-button" :show-btn-ids="['9061008']" :data="scope.scope" />
<!-- 未签约 -->
<auth-button v-if="scope.scope.withdrawSignStatus == 1" slot="auth-button" :show-btn-ids="['9061009']"
:data="scope.scope" />
</template>
<template v-else>
<auth-button slot="auth-button" :show-btn-ids="['9061001']" :data="scope.scope" />
</template>
<auth-button v-else
slot="auth-button"
:show-btn-ids="['9061001']"
:data="scope.scope" />
</div>
</d2-table>
</div>
<baseDialog :is-show.sync="accountDetailVisible"
class="dialog"
:config="dialogConfig.setting"
:dialog-config="dialogConfig.config"
@closeDialog="handleDetailClose">
<account-detail v-if="accountDetailVisible"
:account-detail-visible="accountDetailVisible"
:merchant-row="merchantRow" />
<baseDialog :is-show.sync="accountDetailVisible" class="dialog" :config="dialogConfig.setting"
:dialog-config="dialogConfig.config" @closeDialog="handleDetailClose">
<account-detail v-if="accountDetailVisible" :account-detail-visible="accountDetailVisible"
:merchant-row="merchantRow" />
</baseDialog>
<baseDialog :is-show.sync="receiptModeVisible"
:dialog-config="modeDialogConfig.config"
@closeDialog="handleModeClose"
@handleClick="handleModeConfirm">
<edit-account-mode ref="editAccountModeForm"
v-if="receiptModeVisible"
@handleModeClose="handleModeClose"
:merchant-row="merchantRow" />
<baseDialog :is-show.sync="receiptModeVisible" :dialog-config="modeDialogConfig.config"
@closeDialog="handleModeClose" @handleClick="handleModeConfirm">
<edit-account-mode ref="editAccountModeForm" v-if="receiptModeVisible" @handleModeClose="handleModeClose"
:merchant-row="merchantRow" />
</baseDialog>
<!-- <settingDetail :show="settingDetailVisible"></settingDetail> -->
</div>
......@@ -91,11 +61,11 @@
<script>
import { Util, deepClone } from '@/common/util'
import { getListApi, getMerchantLevelApi, synchronizeBusinessInformation, accountPage } from '@api/publicAccount'
import { getListApi, getMerchantLevelApi, synchronizeBusinessInformation, accountPage, getSignUrl } from '@api/publicAccount'
import { mapActions } from 'vuex'
import accountDetail from './accountDetail'
import editAccountMode from './components/editAccountMode.vue'
import { BaseData, merchantStoreServiceList, receiptModeList } from '@/common/constants.js'
import { BaseData, merchantStoreServiceList, receiptModeList, withdrawSignStatusList } from '@/common/constants.js'
import { paymentChannelList } from '@api/index'
// import baseDialog from '@/components/baseDialog/baseDialog'
// import settingDetail from './settingDetail.vue'
......@@ -216,7 +186,17 @@ export default {
optionId: 'paymentChannelId',
optionLabel: 'paymentChannelName',
optionsName: 'payChannelList'
}],
},
{
label: '提现状态',
name: 'withdrawSignStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'withdrawSignStatusList'
}
],
// 表格
getListApi: getListApi,
restructureList: [],
......@@ -284,6 +264,13 @@ export default {
}
},
{
label: '提现状态',
prop: 'withdrawSignStatus',
formatter: (cellValue) => {
return cellValue.withdrawSignStatus == '1' ? '未签约' : cellValue.withdrawSignStatus == '2' ? '已签约' : '-'
}
},
{
label: '虚账编码',
prop: 'yseUserCode',
width: '200px'
......@@ -327,7 +314,8 @@ export default {
}],
merchantStoreServiceList: merchantStoreServiceList,
receiptModeList: JSON.parse(JSON.stringify(receiptModeList)),
payChannelList: []
payChannelList: [],
withdrawSignStatusList: withdrawSignStatusList
},
dialogConfig: {
setting: {
......@@ -389,6 +377,56 @@ export default {
// associationSettings() {
// this.settingDetailVisible = true
// },
async handleCopyLink(item) {
// const ok = await this.copyText('测试')
// if (ok) {
// this.$message.success('复制成功')
// } else {
// this.$message.error('复制失败,请手动复制')
// }
const res = await getSignUrl({
platformYseMerchantId: '4',
paymentChannelId: '65339644694B4D56ADE2999692864E44'
// platformYseMerchantId: item.yseMerchantId,
// paymentChannelId: item.paymentChannelId
})
console.log(res)
if (res && res.signUrl) {
const ok = await this.copyText(res.signUrl)
if (ok) {
this.$message.success('复制成功')
} else {
this.$message.error('复制失败,请手动复制')
}
} else {
this.$message.error(res && res.msg ? res.msg : '获取签约链接失败')
}
},
async copyText(text) {
try {
if (navigator && navigator.clipboard && navigator.clipboard.writeText) {
await navigator.clipboard.writeText(text)
return true
}
} catch (e) { }
const input = document.createElement('textarea')
input.value = text || ''
input.setAttribute('readonly', '')
input.style.position = 'fixed'
input.style.top = '-1000px'
input.style.opacity = '0'
document.body.appendChild(input)
input.focus()
input.select()
let ok = false
try {
ok = document.execCommand('copy')
} catch (e) {
ok = false
}
document.body.removeChild(input)
return ok
},
async getBaseData() {
this.baseData.channelTypeList = await this.get(BaseData.channelType)
this.getOptionsList()
......@@ -633,7 +671,7 @@ export default {
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
const len = this.restructureList.length
// const t = this.columns.length
const t = 12
const t = 13
if (columnIndex === 0) {
// 第一列 序号
const _row_1 = this.spanArr1[rowIndex]
......@@ -707,6 +745,7 @@ export default {
.el-cascader-panel .el-cascader-menu {
width: 260px;
}
.btnClass span {
margin-right: 5px;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!