feature:代码初始化。
This commit is contained in:
406
src/views/invest/creditQueryRecord/index.vue
Normal file
406
src/views/invest/creditQueryRecord/index.vue
Normal file
@@ -0,0 +1,406 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="search-con">
|
||||
<div class="title">查询条件</div>
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="查询机构" style="width: 450px;" prop="queryInstitution">
|
||||
<el-select v-model="queryParams.queryInstitution" placeholder="请选择查询机构" clearable>
|
||||
<el-option v-for="institution in queryInstitutionList" :key="institution.queryInstitution" :label="institution.queryInstitution" :value="institution.queryInstitution" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="查询原因" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择查询原因" clearable>
|
||||
<el-option
|
||||
v-for="dict in credit_report_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="查询类型" prop="queryType">
|
||||
<el-select v-model="queryParams.queryType" placeholder="请选择查询类型" clearable>
|
||||
<el-option
|
||||
v-for="dict in credit_query_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="search-btn-con">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button type="info" icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-con">
|
||||
<div class="title-con">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="operate-btn-con">
|
||||
<el-button
|
||||
@click="handleAdd"
|
||||
icon="Plus"
|
||||
v-hasPermi="['invest:creditQueryRecord:add']"
|
||||
>新增</el-button>
|
||||
<el-button
|
||||
:disabled="multiple"
|
||||
icon="Delete"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['invest:creditQueryRecord:remove']"
|
||||
>删除</el-button>
|
||||
<el-button
|
||||
@click="handleExport"
|
||||
icon="Download"
|
||||
v-hasPermi="['invest:creditQueryRecord:export']"
|
||||
>导出</el-button>
|
||||
|
||||
<el-button
|
||||
@click="handleQueryAnalysis"
|
||||
icon="Histogram"
|
||||
v-hasPermi="['invest:creditQueryRecord:add']"
|
||||
>查询记录统计</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-con" v-loading="loading">
|
||||
<el-scrollbar>
|
||||
<el-table v-loading="loading" :data="CreditQueryRecordList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="查询日期" align="center" prop="queryDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.queryDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="查询机构" align="center" prop="queryInstitution" />
|
||||
<el-table-column label="查询原因" align="center" width='200' prop="type">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="credit_report_type" :value="scope.row.type"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="查询类型" align="center" width='200' prop="queryType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="credit_query_type" :value="scope.row.queryType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" width='200' prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<div class="ctrl-btn d-flex">
|
||||
<el-tooltip v-for="item in operateList" :key="item.id" class="item" effect="dark" :content="item.title" placement="top">
|
||||
<el-button :icon="item.icon" :v-hasPermi="item.hasPermi" circle @click="handleOperate(item.id,scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination small background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" />
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加或修改征信查询记录对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="CreditQueryRecordRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="查询日期" prop="queryDate">
|
||||
<el-date-picker clearable
|
||||
v-model="form.queryDate"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择查询日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="查询机构" prop="queryInstitution">
|
||||
<el-input v-model="form.queryInstitution" placeholder="请输入查询机构" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="查询原因" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择查询原因">
|
||||
<el-option
|
||||
v-for="dict in credit_report_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template v-if="title !== '查看征信查询记录'" #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 查询记录对话框 -->
|
||||
<el-dialog :title="titleAnalysis" v-model="openAnalysis" width="500px" append-to-body>
|
||||
<el-form ref="CreditQueryRecordAnalysisRef" :model="formAnalysis" label-width="120px">
|
||||
<el-form-item label="查询日期">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.queryDateStart"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择查询日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="近1个月查询次数" prop="lastOneMonths">
|
||||
<el-input v-model="formAnalysis.lastOneMonths" />
|
||||
</el-form-item>
|
||||
<el-form-item label="近2个月查询次数" prop="lastTwoMonths">
|
||||
<el-input v-model="formAnalysis.lastTwoMonths" />
|
||||
</el-form-item>
|
||||
<el-form-item label="近3个月查询次数" prop="lastThreeMonths">
|
||||
<el-input v-model="formAnalysis.lastThreeMonths" />
|
||||
</el-form-item>
|
||||
<el-form-item label="近6个月查询次数" prop="lastSixMonths">
|
||||
<el-input v-model="formAnalysis.lastSixMonths" />
|
||||
</el-form-item>
|
||||
<el-form-item label="近1年查询次数" prop="lastOneYears">
|
||||
<el-input v-model="formAnalysis.lastOneYears" />
|
||||
</el-form-item>
|
||||
<el-form-item label="近2年查询次数" prop="lastTwoYears">
|
||||
<el-input v-model="formAnalysis.lastTwoYears" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总查询次数" prop="lastAllYears">
|
||||
<el-input v-model="formAnalysis.lastAllYears" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" icon="Search" @click="handleAnalysisQuery">查询</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="CreditQueryRecord">
|
||||
import { listQueryInstitution, listCreditQueryRecord, getCreditQueryRecord, delCreditQueryRecord, addCreditQueryRecord, updateCreditQueryRecord, getCreditRecordAnalysis } from '@/api/invest/creditQueryRecord'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { require } from '@/utils/require'
|
||||
const { proxy } = getCurrentInstance()
|
||||
const { credit_report_type, credit_query_type } = proxy.useDict('credit_report_type', 'credit_query_type')
|
||||
|
||||
const CreditQueryRecordList = ref([])
|
||||
const open = ref(false)
|
||||
const openAnalysis = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const title = ref('')
|
||||
const titleAnalysis = ref('')
|
||||
const queryInstitutionList = ref([])
|
||||
const operateList = ref([
|
||||
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['invest:creditQueryRecord:query'] },
|
||||
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['invest:creditQueryRecord:edit'] },
|
||||
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['invest:creditQueryRecord:remove'] }
|
||||
])
|
||||
const data = reactive({
|
||||
form: {},
|
||||
formAnalysis: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
queryDateStart: null,
|
||||
queryInstitution: null,
|
||||
type: null,
|
||||
queryType: null
|
||||
},
|
||||
queryInstitutionParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 1000
|
||||
},
|
||||
rules: {
|
||||
queryInstitution: [
|
||||
{ required: true, message: '查询机构不能为空', trigger: 'blur' }
|
||||
],
|
||||
queryDate: [
|
||||
{ required: true, message: '查询日期不能为空', trigger: 'blur' }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '查询原因不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
const handleOperate = (operate, row) => {
|
||||
switch (operate) {
|
||||
case 'view':
|
||||
handleView(row)
|
||||
break
|
||||
case 'edit':
|
||||
handleUpdate(row)
|
||||
break
|
||||
case 'delete':
|
||||
handleDelete(row)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const { queryParams, queryInstitutionParams, form, formAnalysis, rules } = toRefs(data)
|
||||
|
||||
/** 查询查询机构管理列表 */
|
||||
function getInstitutionList() {
|
||||
listQueryInstitution(queryInstitutionParams.value).then((response) => {
|
||||
queryInstitutionList.value = response.rows
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询征信查询记录列表 */
|
||||
function getList () {
|
||||
loading.value = true
|
||||
listCreditQueryRecord(queryParams.value).then(response => {
|
||||
CreditQueryRecordList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset () {
|
||||
form.value = {
|
||||
id: null,
|
||||
queryInstitution: null,
|
||||
type: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
delFlag: null,
|
||||
remark: null,
|
||||
queryDate: null
|
||||
}
|
||||
proxy.resetForm('CreditQueryRecordRef')
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery () {
|
||||
queryParams.value.queryDateStart = null
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery () {
|
||||
queryParams.value.queryDateStart = null
|
||||
proxy.resetForm('queryRef')
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 分页
|
||||
const handleCurrentChange = (val) => {
|
||||
queryParams.value.pageNum = val
|
||||
getList()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange (selection) {
|
||||
ids.value = selection.map(item => item.id)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
// 查看
|
||||
const handleView = (row) => {
|
||||
title.value = '查看征信查询记录'
|
||||
form.value = row
|
||||
open.value = true
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd () {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = '添加征信查询记录'
|
||||
}
|
||||
|
||||
/** 查询记录统计按钮操作 */
|
||||
function handleQueryAnalysis () {
|
||||
queryParams.value.type = null
|
||||
queryParams.value.queryInstitution = null
|
||||
const today = new Date()
|
||||
queryParams.value.queryDateStart = today.getFullYear() + '-' + ('0' + (today.getMonth() + 1)).slice(-2) + '-' + ('0' + today.getDate()).slice(-2)
|
||||
getCreditRecordAnalysis(queryParams.value).then(response => {
|
||||
formAnalysis.value = response.data
|
||||
openAnalysis.value = true
|
||||
titleAnalysis.value = '查询记录统计'
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询记录统计按钮操作 */
|
||||
function handleAnalysisQuery () {
|
||||
queryParams.value.type = null
|
||||
queryParams.value.queryInstitution = null
|
||||
getCreditRecordAnalysis(queryParams.value).then(response => {
|
||||
formAnalysis.value = response.data
|
||||
openAnalysis.value = true
|
||||
titleAnalysis.value = '查询记录统计'
|
||||
})
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate (row) {
|
||||
reset()
|
||||
const _id = row.id || ids.value
|
||||
getCreditQueryRecord(_id).then(response => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = '修改征信查询记录'
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm () {
|
||||
proxy.$refs.CreditQueryRecordRef.validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateCreditQueryRecord(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addCreditQueryRecord(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete (row) {
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal.confirm('是否确认删除选中的数据项?').then(function() {
|
||||
return delCreditQueryRecord(_ids)
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport () {
|
||||
proxy.download('invest/creditQueryRecord/export', {
|
||||
...queryParams.value
|
||||
}, `creditQueryRecord_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
getInstitutionList()
|
||||
getList()
|
||||
</script>
|
||||
Reference in New Issue
Block a user