|
@@ -34,6 +34,13 @@
|
|
|
</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column prop="isClub" label="是否俱乐部默认卡" width="120" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag :type="Number(scope.row.isClub) === 1 ? 'success' : 'info'" size="small">
|
|
|
+ {{ Number(scope.row.isClub) === 1 ? '是' : '否' }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="coverUrl" label="联盟卡封面" width="180" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<el-image :src="scope.row.coverUrl" style="width: 50px"></el-image>
|
|
@@ -74,6 +81,13 @@
|
|
|
<template slot-scope="{ row }">
|
|
|
<el-button @click="$refs.checkDialogRef && $refs.checkDialogRef.handleOpen(row)" :disabled="row.state !== 1" type="warning" size="mini">审核</el-button>
|
|
|
<el-button type="primary" size="mini" @click="$refs.detailDialogRef && $refs.detailDialogRef.handleOpen(row)">详情</el-button>
|
|
|
+ <el-button
|
|
|
+ :type="Number(row.isClub) === 1 ? 'danger' : 'success'"
|
|
|
+ size="mini"
|
|
|
+ @click="handleSetDefaultCard(row)"
|
|
|
+ >
|
|
|
+ {{ Number(row.isClub) === 1 ? '取消俱乐部默认卡' : '设为俱乐部默认卡' }}
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -100,6 +114,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { getAllianceCardListApi } from '@/api/business'
|
|
|
+import { setOrCancelAllianceCardIsClubApi } from '@/api/rm-bank'
|
|
|
import DetailDialog from './components/DetailDialog'
|
|
|
import CheckDialog from './components/CheckDialog'
|
|
|
|
|
@@ -161,6 +176,31 @@ export default {
|
|
|
this.listQuery.search = ''
|
|
|
this.listQuery.state = ''
|
|
|
this.handleSearch()
|
|
|
+ },
|
|
|
+
|
|
|
+ handleSetDefaultCard(row) {
|
|
|
+ const isSet = Number(row.isClub) !== 1
|
|
|
+ const tipText = isSet ? '设置为俱乐部默认卡' : '取消俱乐部默认卡'
|
|
|
+
|
|
|
+ this.$confirm(`是否要${tipText}?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async () => {
|
|
|
+ try {
|
|
|
+ await setOrCancelAllianceCardIsClubApi({
|
|
|
+ allianceCardId: row.id,
|
|
|
+ state: isSet ? '1' : '0'
|
|
|
+ })
|
|
|
+ this.$message.success(`${tipText}成功`)
|
|
|
+ this.getList() // 刷新列表
|
|
|
+ } catch (error) {
|
|
|
+ console.error(error)
|
|
|
+ this.$message.error(`${tipText}失败`)
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message.info('已取消操作')
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|