Commit 45e57f53 by linjinhong

Merge remote-tracking branch 'origin/dev'

parents fdb057fe f916b74e
......@@ -78,3 +78,8 @@ export function sendEmailCodeApi(email, operateType) {
`/sysSecuritySettings/sendEmailCode?email=${email}&operateType=${operateType}`
)
}
// 收款账户管理 获取授权链接
export function getAuthLinkApi(id) {
return axios.get(`/baseProceedsAccount/authData?id=${id}`)
}
......@@ -145,6 +145,7 @@ export default {
}
placeholder={item.placeholder || `请选择${item.name}`}
value-key={item.valueKey || 'value'}
filterable={item.filterable || false}
clearable>
{item.options?.map((el, idx) => (
<el-option
......
......@@ -41,7 +41,8 @@ import {
Upload,
Descriptions,
DescriptionsItem,
InputNumber
InputNumber,
Link
} from 'element-ui'
const components = [
......@@ -82,7 +83,8 @@ const components = [
Upload,
Descriptions,
DescriptionsItem,
InputNumber
InputNumber,
Link
]
export default {
......
......@@ -255,8 +255,8 @@ export default {
mailbox: { countdown: 0, loading: false, timer: null }
},
methodMap: {
phone: { name: '手机号', method: '手机' },
mailbox: { name: '邮箱', method: '邮箱' },
phone: { name: '安全手机号', method: '手机' },
mailbox: { name: '安全邮箱', method: '邮箱' },
superPassword: { name: '超级密码', method: '超级密码' }
},
dialogRules: {}
......@@ -273,10 +273,12 @@ export default {
const targetName = this.methodMap[this.currentTarget]?.name || '超级密码'
const actionMap = {
bind: this.securityData[this.currentTarget]
? `绑定新安全${targetName}`
: `绑定安全${targetName}`,
unbind: `解绑安全${targetName}`,
change: `验证原安全${targetName}`,
? `修改${targetName}`
: this.currentTarget === 'superPassword'
? '设置超级密码'
: `绑定${targetName}`,
unbind: `解绑${targetName}`,
change: `验证${targetName}`,
password: '修改超级密码',
addPassword: '新增超级密码'
}
......
......@@ -52,6 +52,7 @@
<el-select
v-model="addFormData.accountType"
placeholder="请选择账户类型"
@change="accountTypeChange"
style="width: 100%">
<el-option
v-for="item in accountTypeList"
......@@ -147,16 +148,17 @@
:min="1"
type="number" />
</el-form-item>
<el-form-item label="启用状态" prop="isEnable">
<!-- <el-form-item label="启用状态" prop="isEnable">
<el-switch
class="switchStyle"
:width="100"
v-model="addFormData.isEnable"
active-color="#67C23A"
inactive-color="#F56C6C"
@change="dialogEnableChange"
active-text="启用"
inactive-text="禁用"></el-switch>
</el-form-item>
</el-form-item> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="default" @click="addDialog = false" size="small">
......@@ -172,7 +174,7 @@
<el-descriptions
class="margin-top"
:column="3"
:labelStyle="{ width: '120px' }"
:labelStyle="{ width: '130px' }"
:contentStyle="{ width: '200px', textAlign: 'center' }"
border>
<el-descriptions-item
......@@ -234,7 +236,17 @@
<el-descriptions-item label="排序">
{{ detailFormData.sort }}
</el-descriptions-item>
<el-descriptions-item />
<el-descriptions-item label="支付宝授权状态">
<span v-if="detailFormData.accountType === 'alipay'">
<el-tag
type="success"
size="small"
v-if="detailFormData.appAuthToken">
已授权
</el-tag>
<el-tag type="danger" size="small" v-else>未授权</el-tag>
</span>
</el-descriptions-item>
<el-descriptions-item label="创建时间">
{{ detailFormData.createTime }}
</el-descriptions-item>
......@@ -408,7 +420,8 @@ import {
deleteBaseProceedsAccountApi,
sendPhoneCodeApi,
sendEmailCodeApi,
getBusinessTypeListApi
getBusinessTypeListApi,
getAuthLinkApi
} from '@/common/api/user/user.js'
export default {
......@@ -448,8 +461,8 @@ export default {
accountNumber: [
{ required: true, message: '请输入账号', trigger: 'change' },
{
pattern: /^[a-zA-Z0-9]+$/,
message: '请输入正确的账号',
pattern: /^[^\u4e00-\u9fa5]+$/,
message: '账号不能包含中文字符',
trigger: 'change'
}
],
......@@ -568,9 +581,7 @@ export default {
return '编辑收款账户'
case 'changeStatus':
return this.currentRow
? `${this.currentRow.isEnable ? '禁用' : '启用'}${
this.currentRow.name
}账户`
? `${this.currentRow.isEnable ? '禁用' : '启用'}付款账户`
: ''
case 'delete':
return `删除${this.currentRow.name}账户`
......@@ -607,6 +618,38 @@ export default {
}
},
{
label: '支付宝授权状态',
key: 'appAuthToken',
width: '150',
render: (item) => {
if (
item.accountType !== 'alipay' ||
item.receiverType === 'belowLine'
) {
return null
}
if (item.appAuthToken) {
return (
<el-link
type="primary"
onClick={() => this.handleAuth(item.id)}
target="_blank">
已授权,重新授权
</el-link>
)
} else {
return (
<el-link
type="danger"
onClick={() => this.handleAuth(item.id)}
target="_blank">
未授权,点击授权
</el-link>
)
}
}
},
{
label: '银行卡开户行',
key: 'openBank',
width: '200'
......@@ -732,8 +775,9 @@ export default {
prop: 'currencyType',
type: 'select',
name: '币种',
filterable: true,
options: this.currencyTypeList.map((item) => ({
label: item.currencyName,
label: item.currencyName + '(' + item.currencyCode + ')',
value: item.currencyCode
}))
},
......@@ -889,6 +933,16 @@ export default {
this.type = 'changeStatus'
this.currentRow = row
if (this.setVerificationMethod()) {
// 未授权支付宝不可启用账户
if (
row.isEnable === false &&
row.accountType === 'alipay' &&
row.receiverType === 'onLine' &&
!row.appAuthToken
) {
this.$message.warning('请先授权支付宝')
return
}
this.securityVisible = true
}
},
......@@ -923,6 +977,23 @@ export default {
})
}
},
// 新增/编辑 账户类型变化
accountTypeChange(value) {
if (this.addFormData.isEnable === true) {
this.addFormData.accountType = this.currentRow.accountType
this.$message.warning('请先将账户设置为禁用状态,再修改账户类型')
}
},
// 新增/编辑 启用状态变化
dialogEnableChange() {
if (
this.addFormData.accountType === 'alipay' &&
(!this.currentRow || !this.currentRow.appAuthToken)
) {
this.addFormData.isEnable = false
this.$message.warning(`请在${this.operateType}后授权支付宝,再启用账户`)
}
},
// 新增 校验
addVarify() {
this.$refs.addForm.validate((valid) => {
......@@ -1060,6 +1131,13 @@ export default {
}
}
)
},
// 获取授权链接
async handleAuth(id) {
const res = await getAuthLinkApi(id)
if (res.code === 200) {
window.open(res.message, '_blank')
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment