fix: 表格样式统一修改。
This commit is contained in:
@@ -4,18 +4,13 @@
|
||||
<div class="title">查询条件</div>
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="股票账户" prop="futureStocksId">
|
||||
<el-select v-model="queryParams.futureStocksId" placeholder="请选择股票账户" clearable>
|
||||
<el-option v-for="futureStocks in futureStocksList" :key="futureStocks.id" :label="futureStocks.nameCode" :value="futureStocks.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="账单名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入账单名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-select v-model="queryParams.futureStocksId" placeholder="请选择股票账户" clearable>
|
||||
<el-option v-for="futureStocks in futureStocksList" :key="futureStocks.id" :label="futureStocks.nameCode" :value="futureStocks.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="账单名称" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入账单名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="search-btn-con">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
@@ -26,36 +21,23 @@
|
||||
<div class="title-con">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="operate-btn-con">
|
||||
<el-button
|
||||
@click="handleAdd"
|
||||
icon="Plus"
|
||||
v-hasPermi="['invest:futureStocksBill:add']"
|
||||
>新增</el-button>
|
||||
<el-button
|
||||
:disabled="multiple"
|
||||
icon="Delete"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['invest:futureStocksBill:remove']"
|
||||
>删除</el-button>
|
||||
<el-button
|
||||
@click="handleExport"
|
||||
icon="Download"
|
||||
v-hasPermi="['invest:futureStocksBill:export']"
|
||||
>导出</el-button>
|
||||
<el-button @click="handleAdd" icon="Plus" v-hasPermi="['invest:futureStocksBill:add']">新增</el-button>
|
||||
<el-button :disabled="multiple" icon="Delete" @click="handleDelete" v-hasPermi="['invest:futureStocksBill:remove']">删除</el-button>
|
||||
<el-button @click="handleExport" icon="Download" v-hasPermi="['invest:futureStocksBill:export']">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-con" v-loading="loading">
|
||||
<el-table v-loading="loading" :data="futureStocksBillList" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" :data="futureStocksBillList" @selection-change="handleSelectionChange" height="calc(100% - 0.62rem)">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="股票账户" align="center" prop="futureStocksNameCode" />
|
||||
<el-table-column label="账单名称" align="center" prop="name" />
|
||||
<el-table-column label="账单周期" align="center" prop="billDatePeriod" />
|
||||
<el-table-column label="股票收益" align="center" prop="billAmount" />
|
||||
<el-table-column label="股票账户" align="center" prop="futureStocksNameCode" />
|
||||
<el-table-column label="账单名称" align="center" prop="name" />
|
||||
<el-table-column label="账单周期" align="center" prop="billDatePeriod" />
|
||||
<el-table-column label="股票收益" align="center" prop="billAmount" />
|
||||
<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-button :icon="item.icon" :v-hasPermi="item.hasPermi" circle @click="handleOperate(item.id, scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
@@ -68,21 +50,16 @@
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="futureStocksBillRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="股票账户" prop="futureStocksId">
|
||||
<el-select v-model="form.futureStocksId" placeholder="请选择股票账户" clearable>
|
||||
<el-option v-for="futureStocks in futureStocksList" :key="futureStocks.id" :label="futureStocks.nameCode" :value="futureStocks.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="账单日" prop="billDate">
|
||||
<el-date-picker clearable
|
||||
v-model="form.billDate"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择账单日">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="股票收益" prop="billAmount">
|
||||
<el-input v-model="form.billAmount" placeholder="请输入股票收益" />
|
||||
</el-form-item>
|
||||
<el-select v-model="form.futureStocksId" placeholder="请选择股票账户" clearable>
|
||||
<el-option v-for="futureStocks in futureStocksList" :key="futureStocks.id" :label="futureStocks.nameCode" :value="futureStocks.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="账单日" prop="billDate">
|
||||
<el-date-picker clearable v-model="form.billDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择账单日"> </el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="股票收益" prop="billAmount">
|
||||
<el-input v-model="form.billAmount" placeholder="请输入股票收益" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template v-if="title !== '查看股票账单'" #footer>
|
||||
<div class="dialog-footer">
|
||||
@@ -135,15 +112,9 @@ const data = reactive({
|
||||
pageSize: 1000
|
||||
},
|
||||
rules: {
|
||||
billDate: [
|
||||
{ required: true, message: '账单日不能为空', trigger: 'blur' }
|
||||
],
|
||||
futureStocksId: [
|
||||
{ required: true, message: '股票账户不能为空', trigger: 'blur' }
|
||||
],
|
||||
billAmount: [
|
||||
{ required: true, message: '股票收益不能为空', trigger: 'blur' }
|
||||
]
|
||||
billDate: [{ required: true, message: '账单日不能为空', trigger: 'blur' }],
|
||||
futureStocksId: [{ required: true, message: '股票账户不能为空', trigger: 'blur' }],
|
||||
billAmount: [{ required: true, message: '股票收益不能为空', trigger: 'blur' }]
|
||||
}
|
||||
})
|
||||
|
||||
@@ -173,9 +144,9 @@ function getFutureStocksList() {
|
||||
}
|
||||
|
||||
/** 查询股票账单列表 */
|
||||
function getList () {
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listFutureStocksBill(queryParams.value).then(response => {
|
||||
listFutureStocksBill(queryParams.value).then((response) => {
|
||||
futureStocksBillList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
@@ -189,7 +160,7 @@ function cancel() {
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset () {
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
name: null,
|
||||
@@ -210,13 +181,13 @@ function reset () {
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery () {
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery () {
|
||||
function resetQuery() {
|
||||
proxy.resetForm('queryRef')
|
||||
handleQuery()
|
||||
}
|
||||
@@ -228,8 +199,8 @@ const handleCurrentChange = (val) => {
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange (selection) {
|
||||
ids.value = selection.map(item => item.id)
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
@@ -242,17 +213,17 @@ const handleView = (row) => {
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd () {
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = '添加股票账单'
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate (row) {
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const _id = row.id || ids.value
|
||||
getFutureStocksBill(_id).then(response => {
|
||||
getFutureStocksBill(_id).then((response) => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = '修改股票账单'
|
||||
@@ -260,17 +231,17 @@ function handleUpdate (row) {
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm () {
|
||||
proxy.$refs.futureStocksBillRef.validate(valid => {
|
||||
function submitForm() {
|
||||
proxy.$refs.futureStocksBillRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateFutureStocksBill(form.value).then(response => {
|
||||
updateFutureStocksBill(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addFutureStocksBill(form.value).then(response => {
|
||||
addFutureStocksBill(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
@@ -281,21 +252,29 @@ function submitForm () {
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete (row) {
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal.confirm('是否确认删除选中的数据项?').then(function() {
|
||||
return delFutureStocksBill(_ids)
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
}).catch(() => {})
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除选中的数据项?')
|
||||
.then(function () {
|
||||
return delFutureStocksBill(_ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport () {
|
||||
proxy.download('invest/futureStocksBill/export', {
|
||||
...queryParams.value
|
||||
}, `futureStocksBill_${new Date().getTime()}.xlsx`)
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
'invest/futureStocksBill/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`futureStocksBill_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
}
|
||||
getFutureStocksList()
|
||||
getList()
|
||||
|
||||
Reference in New Issue
Block a user