Commit 45e57f53 by linjinhong

Merge remote-tracking branch 'origin/dev'

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