|
@@ -1,56 +1,66 @@
|
|
<template>
|
|
<template>
|
|
- <a-card :bordered="false">
|
|
|
|
- <s-table
|
|
|
|
- ref="tableRef"
|
|
|
|
- :columns="columns"
|
|
|
|
- :data="loadData"
|
|
|
|
- :alert="options.alert.show"
|
|
|
|
- bordered
|
|
|
|
- :row-key="(record) => record.id"
|
|
|
|
- :tool-config="toolConfig"
|
|
|
|
- :row-selection="options.rowSelection"
|
|
|
|
- >
|
|
|
|
- <template #operator class="table-operator">
|
|
|
|
- <a-space>
|
|
|
|
- <a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('bizServiceCustomerAccountAdd')">
|
|
|
|
- <template #icon><plus-outlined /></template>
|
|
|
|
- 新增
|
|
|
|
- </a-button>
|
|
|
|
- <xn-batch-button
|
|
|
|
- v-if="hasPerm('bizServiceCustomerAccountBatchDelete')"
|
|
|
|
- buttonName="批量删除"
|
|
|
|
- icon="DeleteOutlined"
|
|
|
|
- :selectedRowKeys="selectedRowKeys"
|
|
|
|
- @batchCallBack="deleteBatchBizServiceCustomerAccount"
|
|
|
|
- />
|
|
|
|
- </a-space>
|
|
|
|
- </template>
|
|
|
|
- <template #bodyCell="{ column, record, index }">
|
|
|
|
- <template v-if="column.dataIndex === 'serial'">
|
|
|
|
- {{ index + 1 }}
|
|
|
|
- </template>
|
|
|
|
- <template v-if="column.dataIndex === 'action'">
|
|
|
|
|
|
+ <a-drawer :title="title" :width="1150" :open="visible" :destroy-on-close="true" @close="onClose">
|
|
|
|
+ <a-card :bordered="false" class="mb-2">
|
|
|
|
+ <s-table
|
|
|
|
+ ref="tableRef"
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :data="loadData"
|
|
|
|
+ bordered
|
|
|
|
+ :row-key="(record) => record.id"
|
|
|
|
+ >
|
|
|
|
+ <template #operator class="table-operator">
|
|
<a-space>
|
|
<a-space>
|
|
- <a @click="formRef.onOpen(record)" v-if="hasPerm('bizServiceCustomerAccountEdit')">编辑</a>
|
|
|
|
- <a-divider type="vertical" v-if="hasPerm(['bizServiceCustomerAccountEdit', 'bizServiceCustomerAccountDelete'], 'and')" />
|
|
|
|
- <a-popconfirm title="确定要删除吗?" @confirm="deleteBizServiceCustomerAccount(record)">
|
|
|
|
- <a-button type="link" danger size="small" v-if="hasPerm('bizServiceCustomerAccountDelete')">删除</a-button>
|
|
|
|
- </a-popconfirm>
|
|
|
|
|
|
+ <a-button type="primary" @click="formRef.onOpen(null, serviceCustomerId)" v-if="hasPerm('bizServiceCustomerAccountAdd')">
|
|
|
|
+ <template #icon><plus-outlined /></template>
|
|
|
|
+ 新增
|
|
|
|
+ </a-button>
|
|
</a-space>
|
|
</a-space>
|
|
</template>
|
|
</template>
|
|
- </template>
|
|
|
|
- </s-table>
|
|
|
|
- </a-card>
|
|
|
|
|
|
+ <template #bodyCell="{ column, record, index }">
|
|
|
|
+ <template v-if="column.dataIndex === 'serial'">
|
|
|
|
+ {{ index + 1 }}
|
|
|
|
+ </template>
|
|
|
|
+ <template v-if="column.dataIndex === 'action'">
|
|
|
|
+ <a-space>
|
|
|
|
+ <a @click="formRef.onOpen(record, serviceCustomerId)" v-if="hasPerm('bizServiceCustomerAccountEdit')">编辑</a>
|
|
|
|
+
|
|
|
|
+ <a-divider type="vertical" v-if="hasPerm(['bizServiceCustomerAccountEdit', 'bizServiceCustomerAccountDelete'], 'and')" />
|
|
|
|
+ <a-button type="link" danger size="small" v-if="hasPerm('bizServiceCustomerAccountDelete')" @click="deleteConfig(record)">删除</a-button>
|
|
|
|
+
|
|
|
|
+ <a-divider type="vertical" v-if="hasPerm(['bizServiceCustomerAccountEdit', 'bizServiceCustomerAccountDelete'], 'or') && hasPerm('bizServiceCustomerFlow')" />
|
|
|
|
+ <a @click="flowIndexRef.onOpen(record, serviceCustomerId)" v-if="hasPerm('bizServiceCustomerFlow')">流水管理</a>
|
|
|
|
+ </a-space>
|
|
|
|
+ </template>
|
|
|
|
+ </template>
|
|
|
|
+ </s-table>
|
|
|
|
+ </a-card>
|
|
|
|
+ </a-drawer>
|
|
|
|
+
|
|
<Form ref="formRef" @successful="tableRef.refresh()" />
|
|
<Form ref="formRef" @successful="tableRef.refresh()" />
|
|
|
|
+ <FlowIndex ref="flowIndexRef" @onclose="tableRef.refresh()" />
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup name="bizservicecustomeraccount">
|
|
<script setup name="bizservicecustomeraccount">
|
|
import { cloneDeep } from 'lodash-es'
|
|
import { cloneDeep } from 'lodash-es'
|
|
- import Form from './form.vue'
|
|
|
|
|
|
+ import Form from './accountForm.vue'
|
|
|
|
+ import FlowIndex from './flowIndex.vue'
|
|
import bizServiceCustomerAccountApi from '@/api/biz/bizServiceCustomerAccountApi'
|
|
import bizServiceCustomerAccountApi from '@/api/biz/bizServiceCustomerAccountApi'
|
|
|
|
+ import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
|
|
|
|
+ import {Modal} from 'ant-design-vue';
|
|
|
|
+ import {createVNode} from 'vue';
|
|
|
|
+
|
|
|
|
+ const submitLoading = ref(false)
|
|
|
|
+ const toolConfig = { refresh: true, height: false, columnSetting: false, striped: false }
|
|
|
|
+ // 默认是关闭状态
|
|
|
|
+ const visible = ref(false)
|
|
|
|
+ const searchFormState = ref({})
|
|
const tableRef = ref()
|
|
const tableRef = ref()
|
|
const formRef = ref()
|
|
const formRef = ref()
|
|
- const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
|
|
|
|
|
|
+ const flowIndexRef = ref()
|
|
|
|
+ const recordData = ref()
|
|
|
|
+ const title = ref()
|
|
|
|
+ const serviceCustomerId = ref()
|
|
|
|
+
|
|
const columns = [
|
|
const columns = [
|
|
{
|
|
{
|
|
title: '序号',
|
|
title: '序号',
|
|
@@ -60,79 +70,97 @@
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '账号',
|
|
title: '账号',
|
|
- dataIndex: 'loginAccount'
|
|
|
|
|
|
+ width: 150,
|
|
|
|
+ dataIndex: 'loginAccount',
|
|
|
|
+ align:'center'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '充值总余额',
|
|
title: '充值总余额',
|
|
- dataIndex: 'rechargeAmount'
|
|
|
|
|
|
+ width: 150,
|
|
|
|
+ dataIndex: 'rechargeAmount',
|
|
|
|
+ align:'center'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '消费总金额',
|
|
title: '消费总金额',
|
|
- dataIndex: 'consumptionAmount'
|
|
|
|
|
|
+ width: 150,
|
|
|
|
+ dataIndex: 'consumptionAmount',
|
|
|
|
+ align:'center'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '锁定金额(占用金额)',
|
|
|
|
- dataIndex: 'lockAmount'
|
|
|
|
|
|
+ title: '锁定金额',
|
|
|
|
+ width: 150,
|
|
|
|
+ dataIndex: 'lockAmount',
|
|
|
|
+ align:'center'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '可用余额(账户余额)',
|
|
|
|
- dataIndex: 'accountAmount'
|
|
|
|
|
|
+ title: '可用余额',
|
|
|
|
+ width: 150,
|
|
|
|
+ dataIndex: 'accountAmount',
|
|
|
|
+ align:'center'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '授信额度',
|
|
title: '授信额度',
|
|
- dataIndex: 'creditAmount'
|
|
|
|
|
|
+ width: 150,
|
|
|
|
+ dataIndex: 'creditAmount',
|
|
|
|
+ align:'center'
|
|
},
|
|
},
|
|
]
|
|
]
|
|
// 操作栏通过权限判断是否显示
|
|
// 操作栏通过权限判断是否显示
|
|
- if (hasPerm(['bizServiceCustomerAccountEdit', 'bizServiceCustomerAccountDelete'])) {
|
|
|
|
|
|
+ if (hasPerm(['bizServiceCustomerAccountEdit', 'bizServiceCustomerAccountDelete', 'bizServiceCustomerFlow'], 'or')) {
|
|
columns.push({
|
|
columns.push({
|
|
title: '操作',
|
|
title: '操作',
|
|
dataIndex: 'action',
|
|
dataIndex: 'action',
|
|
align: 'center',
|
|
align: 'center',
|
|
- width: 150
|
|
|
|
|
|
+ width: 260
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- const selectedRowKeys = ref([])
|
|
|
|
- // 列表选择配置
|
|
|
|
- const options = {
|
|
|
|
- // columns数字类型字段加入 needTotal: true 可以勾选自动算账
|
|
|
|
- alert: {
|
|
|
|
- show: true,
|
|
|
|
- clear: () => {
|
|
|
|
- selectedRowKeys.value = ref([])
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- rowSelection: {
|
|
|
|
- onChange: (selectedRowKey, selectedRows) => {
|
|
|
|
- selectedRowKeys.value = selectedRowKey
|
|
|
|
- }
|
|
|
|
|
|
+ // 打开抽屉
|
|
|
|
+ const onOpen = (record) => {
|
|
|
|
+ recordData.value = record
|
|
|
|
+ title.value = "【" + record.name + "】-账户管理"
|
|
|
|
+ searchFormState.value = {
|
|
|
|
+ serviceCustomerId: record.id
|
|
}
|
|
}
|
|
|
|
+ serviceCustomerId.value = record.id
|
|
|
|
+ visible.value = true
|
|
}
|
|
}
|
|
const loadData = (parameter) => {
|
|
const loadData = (parameter) => {
|
|
- return bizServiceCustomerAccountApi.bizServiceCustomerAccountPage(parameter).then((data) => {
|
|
|
|
|
|
+ return bizServiceCustomerAccountApi.bizServiceCustomerAccountPage(Object.assign(parameter, searchFormState.value)).then((data) => {
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- // 重置
|
|
|
|
- const reset = () => {
|
|
|
|
- searchFormRef.value.resetFields()
|
|
|
|
- tableRef.value.refresh(true)
|
|
|
|
|
|
+ // 关闭抽屉
|
|
|
|
+ const onClose = () => {
|
|
|
|
+ visible.value = false
|
|
}
|
|
}
|
|
// 删除
|
|
// 删除
|
|
- const deleteBizServiceCustomerAccount = (record) => {
|
|
|
|
- let params = [
|
|
|
|
- {
|
|
|
|
- id: record.id
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- bizServiceCustomerAccountApi.bizServiceCustomerAccountDelete(params).then(() => {
|
|
|
|
- tableRef.value.refresh(true)
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- // 批量删除
|
|
|
|
- const deleteBatchBizServiceCustomerAccount = (params) => {
|
|
|
|
- bizServiceCustomerAccountApi.bizServiceCustomerAccountDelete(params).then(() => {
|
|
|
|
- tableRef.value.clearRefreshSelected()
|
|
|
|
|
|
+ const deleteConfig = (record) => {
|
|
|
|
+ Modal.confirm({
|
|
|
|
+ title: '确定删除该数据吗?',
|
|
|
|
+ icon: createVNode(ExclamationCircleOutlined),
|
|
|
|
+ content: '',
|
|
|
|
+ onOk() {
|
|
|
|
+ submitLoading.value = true
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ id: record.id
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+
|
|
|
|
+ bizServiceCustomerAccountApi
|
|
|
|
+ .bizServiceCustomerAccountDelete(params)
|
|
|
|
+ .then(() => {
|
|
|
|
+ tableRef.value.refresh(true)
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ submitLoading.value = false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ onCancel() {}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ // 调用这个函数将子组件的一些数据和方法暴露出去
|
|
|
|
+ defineExpose({
|
|
|
|
+ onOpen
|
|
|
|
+ })
|
|
</script>
|
|
</script>
|