|
@@ -1,90 +1,67 @@
|
|
|
<template>
|
|
|
+ <a-card :bordered="false" class="xn-mb10">
|
|
|
+ <a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item label="推荐人" name="searchKey">
|
|
|
+ <a-input v-model:value="searchFormState.searchKey" placeholder="请输入推荐人姓名或手机号" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-button type="primary" @click="tableRef.refresh()">查询</a-button>
|
|
|
+ <a-button style="margin: 0 8px" @click="reset">重置</a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </a-card>
|
|
|
<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('bizRecommendRecordAdd')">
|
|
|
- <template #icon><plus-outlined /></template>
|
|
|
- 新增
|
|
|
- </a-button>
|
|
|
- <xn-batch-button
|
|
|
- v-if="hasPerm('bizRecommendRecordBatchDelete')"
|
|
|
- buttonName="批量删除"
|
|
|
- icon="DeleteOutlined"
|
|
|
- :selectedRowKeys="selectedRowKeys"
|
|
|
- @batchCallBack="deleteBatchBizRecommendRecord"
|
|
|
- />
|
|
|
- </a-space>
|
|
|
- </template>
|
|
|
- <template #bodyCell="{ column, record }">
|
|
|
- <template v-if="column.dataIndex === 'action'">
|
|
|
- <a-space>
|
|
|
- <a @click="formRef.onOpen(record)" v-if="hasPerm('bizRecommendRecordEdit')">编辑</a>
|
|
|
- <a-divider type="vertical" v-if="hasPerm(['bizRecommendRecordEdit', 'bizRecommendRecordDelete'], 'and')" />
|
|
|
- <a-popconfirm title="确定要删除吗?" @confirm="deleteBizRecommendRecord(record)">
|
|
|
- <a-button type="link" danger size="small" v-if="hasPerm('bizRecommendRecordDelete')">删除</a-button>
|
|
|
- </a-popconfirm>
|
|
|
- </a-space>
|
|
|
+ <s-table ref="tableRef" :columns="columns" :data="loadData" bordered :row-key="(record) => record.id">
|
|
|
+ <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)" v-if="hasPerm('bizRecommendRecordEdit')">编辑</a>-->
|
|
|
+ <!-- <a-divider type="vertical" v-if="hasPerm(['bizRecommendRecordEdit', 'bizRecommendRecordDelete'], 'and')" />-->
|
|
|
+ <!-- <a-popconfirm title="确定要删除吗?" @confirm="deleteBizRecommendRecord(record)">-->
|
|
|
+ <!-- <a-button type="link" danger size="small" v-if="hasPerm('bizRecommendRecordDelete')">删除</a-button>-->
|
|
|
+ <!-- </a-popconfirm>-->
|
|
|
+ <!-- </a-space>-->
|
|
|
+ <!-- </template>-->
|
|
|
</template>
|
|
|
</s-table>
|
|
|
</a-card>
|
|
|
- <Form ref="formRef" @successful="tableRef.refresh()" />
|
|
|
</template>
|
|
|
|
|
|
<script setup name="recommendrecord">
|
|
|
- import { cloneDeep } from 'lodash-es'
|
|
|
- import Form from './form.vue'
|
|
|
import bizRecommendRecordApi from '@/api/biz/bizRecommendRecordApi'
|
|
|
+ import { cloneDeep } from 'lodash-es'
|
|
|
const tableRef = ref()
|
|
|
- const formRef = ref()
|
|
|
- const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
|
|
|
+ const searchFormState = ref({})
|
|
|
+ const searchFormRef = ref()
|
|
|
const columns = [
|
|
|
{
|
|
|
- title: '推荐人用户id',
|
|
|
- dataIndex: 'recommendUserId'
|
|
|
+ title: '序号',
|
|
|
+ dataIndex: 'serial',
|
|
|
+ width: 80
|
|
|
},
|
|
|
{
|
|
|
- title: '被推荐人用户id',
|
|
|
- dataIndex: 'acceptUserId'
|
|
|
+ title: '推荐人',
|
|
|
+ dataIndex: 'recommendUserName'
|
|
|
},
|
|
|
- ]
|
|
|
- // 操作栏通过权限判断是否显示
|
|
|
- if (hasPerm(['bizRecommendRecordEdit', 'bizRecommendRecordDelete'])) {
|
|
|
- columns.push({
|
|
|
- title: '操作',
|
|
|
- dataIndex: 'action',
|
|
|
- align: 'center',
|
|
|
- width: 150
|
|
|
- })
|
|
|
- }
|
|
|
- const selectedRowKeys = ref([])
|
|
|
- // 列表选择配置
|
|
|
- const options = {
|
|
|
- // columns数字类型字段加入 needTotal: true 可以勾选自动算账
|
|
|
- alert: {
|
|
|
- show: true,
|
|
|
- clear: () => {
|
|
|
- selectedRowKeys.value = ref([])
|
|
|
- }
|
|
|
+ {
|
|
|
+ title: '被推荐人',
|
|
|
+ dataIndex: 'acceptUserName'
|
|
|
},
|
|
|
- rowSelection: {
|
|
|
- onChange: (selectedRowKey, selectedRows) => {
|
|
|
- selectedRowKeys.value = selectedRowKey
|
|
|
- }
|
|
|
+ {
|
|
|
+ title: '推荐时间',
|
|
|
+ dataIndex: 'createTime'
|
|
|
}
|
|
|
- }
|
|
|
+ ]
|
|
|
const loadData = (parameter) => {
|
|
|
- return bizRecommendRecordApi.bizRecommendRecordPage(parameter).then((data) => {
|
|
|
+ const searchFormParam = cloneDeep(searchFormState.value)
|
|
|
+ return bizRecommendRecordApi.bizRecommendRecordPage(Object.assign(parameter, searchFormParam)).then((data) => {
|
|
|
return data
|
|
|
})
|
|
|
}
|
|
@@ -93,21 +70,4 @@
|
|
|
searchFormRef.value.resetFields()
|
|
|
tableRef.value.refresh(true)
|
|
|
}
|
|
|
- // 删除
|
|
|
- const deleteBizRecommendRecord = (record) => {
|
|
|
- let params = [
|
|
|
- {
|
|
|
- id: record.id
|
|
|
- }
|
|
|
- ]
|
|
|
- bizRecommendRecordApi.bizRecommendRecordDelete(params).then(() => {
|
|
|
- tableRef.value.refresh(true)
|
|
|
- })
|
|
|
- }
|
|
|
- // 批量删除
|
|
|
- const deleteBatchBizRecommendRecord = (params) => {
|
|
|
- bizRecommendRecordApi.bizRecommendRecordDelete(params).then(() => {
|
|
|
- tableRef.value.clearRefreshSelected()
|
|
|
- })
|
|
|
- }
|
|
|
</script>
|