fix: 智聪记账管理,部分功能新增复制功能,时间默认当前日期。

This commit is contained in:
tianyongbao
2025-04-28 12:23:51 +08:00
parent dae356e907
commit cc4d6befe8
18 changed files with 176 additions and 16 deletions

View File

@@ -124,6 +124,7 @@
<script setup name="Activity">
import { listActivity, getActivity, delActivity, addActivity, updateActivity } from '@/api/health/activity'
// eslint-disable-next-line no-unused-vars
import dayjs from 'dayjs'
import { require } from '@/utils/require'
const { proxy } = getCurrentInstance()
const { activity_type, activity_exercise } = proxy.useDict('activity_type', 'activity_exercise')
@@ -260,6 +261,8 @@ const handleView = (row) => {
/** 新增按钮操作 */
function handleAdd() {
reset()
form.value.startTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
form.value.endTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
open.value = true
title.value = '添加活动记录'
}

View File

@@ -815,6 +815,7 @@ const handleView = (row) => {
/** 新增按钮操作 */
function handleAdd() {
reset()
form.value.visitingTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
if (personList.value.length > 0) {
form.value.personId = personList.value[0].id
queryHealthRecordParams.personId = personList.value[0].id

View File

@@ -235,6 +235,7 @@ const handleView = (row) => {
/** 新增按钮操作 */
function handleAdd() {
reset()
form.value.measureTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
open.value = true
title.value = '添加身高体重记录'
}

View File

@@ -398,6 +398,7 @@ const handleView = (row) => {
/** 新增按钮操作 */
function handleAdd() {
reset()
form.value.dosingTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
if (personList.value.length > 0) {
form.value.personId = personList.value[0].id
queryHealthRecordParams.personId = personList.value[0].id
@@ -440,6 +441,7 @@ function handleCopy(row) {
getMarRecord(_id).then((response) => {
form.value = response.data
form.value.id = null
form.value.dosingTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
open.value = true
title.value = '复制用药记录'
})

View File

@@ -201,6 +201,7 @@ function handleCopy(row) {
getProcessRecord(_id).then((response) => {
form.value = response.data
form.value.id = null
form.value.recordingTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
open.value = true
title.value = '复制档案过程记录'
})
@@ -288,6 +289,7 @@ const handleView = (row) => {
/** 新增按钮操作 */
function handleAdd() {
reset()
form.value.recordingTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
if (personList.value.length > 0) {
form.value.personId = personList.value[0].id
queryHealthRecordParams.personId = personList.value[0].id

View File

@@ -216,6 +216,7 @@ function handleCopy(row) {
getTemperatureRecord(_id).then((response) => {
form.value = response.data
form.value.id = null
form.value.measureTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
open.value = true
title.value = '复制体温记录'
})
@@ -303,6 +304,7 @@ const handleView = (row) => {
/** 新增按钮操作 */
function handleAdd() {
reset()
form.value.measureTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
if (personList.value.length > 0) {
form.value.personId = personList.value[0].id
queryHealthRecordParams.personId = personList.value[0].id

View File

@@ -44,7 +44,7 @@
<div class="content-con" v-loading="loading" height="calc(100% - 0.65rem)">
<el-table v-loading="loading" :data="accountDealRecordList" @selection-change="handleSelectionChange" height="calc(100% - 0.65rem)">
<el-table-column label="账户名称" align="center" width="200" prop="accountName" />
<el-table-column label="记账类型" align="center" prop="type">
<el-table-column label="记账类型" align="center" width="180" prop="type">
<template #default="scope">
<dict-tag :options="account_type" :value="scope.row.type" />
</template>
@@ -57,14 +57,14 @@
<dict-tag :options="deal_type" :value="scope.row.dealType" />
</template>
</el-table-column>
<el-table-column label="交易类别" align="center" prop="dealCategory">
<el-table-column label="交易类别" align="center" width="180" prop="dealCategory">
<template #default="scope">
<dict-tag :options="deal_category" :value="scope.row.dealCategory" />
</template>
</el-table-column>
<el-table-column label="交易子类别" align="center" prop="childCategoryName" />
<el-table-column label="备注" align="center" width="350" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="交易子类别" align="center" width="150" prop="childCategoryName" />
<el-table-column label="备注" align="center" width="180" prop="remark" />
<el-table-column label="操作" width="180" 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">
@@ -159,6 +159,7 @@ const currentBalanceShow = ref(false)
const operateList = ref([
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['invest:accountDealRecord:query'] },
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['invest:accountDealRecord:edit'] },
{ id: 'copy', icon: 'Link', title: '复制', hasPermi: ['invest:accountDealRecord:edit'] },
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['invest:accountDealRecord:remove'] }
])
const data = reactive({
@@ -217,6 +218,9 @@ const handleOperate = (operate, row) => {
case 'delete':
handleDelete(row)
break
case 'copy':
handleCopy(row)
break
default:
break
}
@@ -340,6 +344,7 @@ function handleAdd() {
currentBalanceShow.value = false
queryAddAccountParams.value.type = ''
getAddAccountList()
form.value.createTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
open.value = true
title.value = '添加账户交易记录'
}
@@ -359,7 +364,26 @@ function handleUpdate(row) {
} else {
childCategoryShow.value = false
}
title.value = '修改账户交易记录'
title.value = '复制账户交易记录'
})
}
/** 复制按钮操作 */
function handleCopy(row) {
reset()
currentBalanceShow.value = true
queryAddAccountParams.value.type = ''
getAddAccountList()
const _id = row.id || ids.value
getAccountDealRecord(_id).then((response) => {
form.value = response.data
open.value = true
form.value.createTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
if (form.value.dealCategory == '1') {
childCategoryShow.value = true
} else {
childCategoryShow.value = false
}
title.value = '复制账户交易记录'
})
}

View File

@@ -182,7 +182,7 @@
<div class="title-con">
<div class="title">基本信息</div>
<div class="operate-btn-con">
<!-- <el-button @click="handleAddDetail" icon="Plus" v-hasPermi="['invest:installmentHistory:add']">新增</el-button> -->
<el-button @click="handleAddDetail" icon="Plus" v-hasPermi="['invest:installmentHistory:add']">新增</el-button>
<el-button icon="Delete" @click="handleDeleteDetail" v-hasPermi="['invest:installmentHistory:remove']">删除明细</el-button>
<el-button @click="handleUpdateInterest" icon="Expand" v-hasPermi="['invest:installmentHistory:add']">总利息汇总</el-button>
</div>
@@ -242,6 +242,7 @@ import {
import { listBankcardLend } from '@/api/invest/bankcardlend'
// eslint-disable-next-line no-unused-vars
import { require } from '@/utils/require'
import dayjs from 'dayjs'
const { proxy } = getCurrentInstance()
const { settle_state, bank_card_type, posting_state } = proxy.useDict('settle_state', 'bank_card_type', 'posting_state')
@@ -399,7 +400,7 @@ function reset() {
}
// 表单重置
function resetDetail() {
form.value = {
formDetail.value = {
id: null,
installmentHistoryId: null,
bankCardLendId: null,
@@ -456,6 +457,7 @@ const handleView = (row) => {
/** 新增按钮操作 */
function handleAdd() {
reset()
form.value.installmentDate = dayjs(new Date().getTime()).format('YYYY-MM-DD')
open.value = true
title.value = '添加信用卡分期'
}
@@ -463,6 +465,7 @@ function handleAdd() {
/** 新增按钮操作 */
function handleAddDetail() {
resetDetail()
formDetail.value.repaymentDate = dayjs(new Date().getTime()).format('YYYY-MM-DD')
titleDetail.value = '添加分期历史明细'
openDetail.value = true
}

View File

@@ -150,6 +150,7 @@ import {
} from '@/api/invest/creditQueryRecord'
// eslint-disable-next-line no-unused-vars
import { require } from '@/utils/require'
import dayjs from 'dayjs'
const { proxy } = getCurrentInstance()
const { credit_report_type, credit_query_type } = proxy.useDict('credit_report_type', 'credit_query_type')
@@ -168,6 +169,7 @@ 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: 'copy', icon: 'Link', title: '复制', hasPermi: ['invest:creditQueryRecord:edit'] },
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['invest:creditQueryRecord:remove'] }
])
const data = reactive({
@@ -203,6 +205,9 @@ const handleOperate = (operate, row) => {
case 'delete':
handleDelete(row)
break
case 'copy':
handleCopy(row)
break
default:
break
}
@@ -287,6 +292,7 @@ const handleView = (row) => {
/** 新增按钮操作 */
function handleAdd() {
reset()
form.value.queryDate = dayjs(new Date().getTime()).format('YYYY-MM-DD')
open.value = true
title.value = '添加征信查询记录'
}
@@ -325,6 +331,18 @@ function handleUpdate(row) {
title.value = '修改征信查询记录'
})
}
/** 复制按钮操作 */
function handleCopy(row) {
reset()
const _id = row.id || ids.value
getCreditQueryRecord(_id).then((response) => {
form.value = response.data
form.value.id = null
form.value.queryDate = dayjs(new Date().getTime()).format('YYYY-MM-DD')
open.value = true
title.value = '复制征信查询记录'
})
}
/** 提交按钮 */
function submitForm() {

View File

@@ -292,6 +292,7 @@ const handleView = (row) => {
/** 新增按钮操作 */
function handleAdd() {
reset()
form.value.createTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
open.value = true
title.value = '添加信用卡还款'
}

View File

@@ -255,6 +255,7 @@ const handleView = (row) => {
/** 新增按钮操作 */
function handleAdd() {
reset()
form.value.createTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
open.value = true
title.value = '添加储蓄账户转账'
}

View File

@@ -82,6 +82,7 @@
import { listHeartJourney, getHeartJourney, delHeartJourney, addHeartJourney, updateHeartJourney } from '@/api/invest/heartJourney'
// eslint-disable-next-line no-unused-vars
import { require } from '@/utils/require'
import dayjs from 'dayjs'
const { proxy } = getCurrentInstance()
const { journey_type } = proxy.useDict('journey_type')
@@ -200,6 +201,7 @@ const handleView = (row) => {
/** 新增按钮操作 */
function handleAdd() {
reset()
form.value.createTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
open.value = true
title.value = '添加心路历程'
}

View File

@@ -60,22 +60,29 @@
<el-dialog :title="title" v-model="open" width="600px" append-to-body>
<el-form ref="accountDealRecordRef" :model="form" :rules="rules" label-width="120px">
<el-form-item label="投资账户" prop="accountId">
<el-select v-model="form.accountId" placeholder="请选择投资账户" clearable>
<el-select v-model="form.accountId" placeholder="请选择投资账户" @change="handleAccountChange" clearable>
<el-option v-for="account in accountList" :key="account.id" :label="account.nameCodeAvailableLimit" :value="account.id" />
</el-select>
</el-form-item>
<!--
<el-form-item label="交易类型" prop="dealType">
<el-select v-model="form.dealType" placeholder="请选择交易类型">
<el-option v-for="dict in profit_loss" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item label="交易时间" prop="createTime">
<el-date-picker clearable v-model="form.createTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择交易时间"> </el-date-picker>
</el-form-item>
<el-form-item label="交易金额" prop="amount">
<el-form-item label="交易金额" v-show="!futuresShow" prop="amount">
<el-input v-model="form.amount" type="number" placeholder="请输入交易金额" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-form-item v-show="futuresShow" label="平仓盈亏" prop="closedPosition">
<el-input v-model="form.closedPosition" type="number" placeholder="请输入平仓盈亏" />
</el-form-item>
<el-form-item v-show="futuresShow" label="手续费" prop="commission">
<el-input v-model="form.commission" type="number" placeholder="请输入手续费" />
</el-form-item>
<el-form-item label="备注" v-show="!futuresShow" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
</el-form-item>
</el-form>
@@ -99,6 +106,7 @@ import {
} from '@/api/invest/accountDealRecord'
// eslint-disable-next-line no-unused-vars
import { listAccounts } from '@/api/invest/accounts'
import { getFutureStocks } from '@/api/invest/futureStocks'
import dayjs from 'dayjs'
import { require } from '@/utils/require'
const { proxy } = getCurrentInstance()
@@ -113,10 +121,14 @@ const single = ref(true)
const multiple = ref(true)
const total = ref(0)
const title = ref('')
const futuresShow = ref(false)
//账户类型
const accountType = ref(0)
const accountList = ref([])
const operateList = ref([
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['invest:accountDealRecord:query'] },
//{ id: 'view', icon: 'View', title: '查看', hasPermi: ['invest:accountDealRecord:query'] },
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['invest:accountDealRecord:edit'] },
{ id: 'copy', icon: 'Link', title: '复制', hasPermi: ['invest:accountDealRecord:edit'] },
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['invest:accountDealRecord:remove'] }
])
const data = reactive({
@@ -141,6 +153,8 @@ const data = reactive({
accountId: [{ required: true, message: '投资账户不能为空', trigger: 'blur' }],
amount: [{ required: true, message: '交易金额不能为空', trigger: 'blur' }],
dealType: [{ required: true, message: '交易类型不能为空', trigger: 'change' }],
closedPosition: [{ required: true, message: '平仓盈亏不能为空', trigger: 'blur' }],
commission: [{ required: true, message: '手续费不能为空', trigger: 'blur' }],
createTime: [{ required: true, message: '交易时间不能为空', trigger: 'blur' }]
}
})
@@ -156,6 +170,9 @@ const handleOperate = (operate, row) => {
case 'delete':
handleDelete(row)
break
case 'copy':
handleCopy(row)
break
default:
break
}
@@ -163,6 +180,26 @@ const handleOperate = (operate, row) => {
const { queryParams, queryAccountParams, queryAddAccountParams, form, rules } = toRefs(data)
const handleAccountChange = (accountId) => {
if (accountId != null && accountId != '') {
getFutureStocks(accountId).then((response) => {
const account = response.data
accountType.value = account.type
if (account.type == '1') {
futuresShow.value = true
form.value.amount = 0
form.value.closedPosition = null
form.value.commission = null
} else {
futuresShow.value = false
form.value.amount = null
form.value.closedPosition = 0
form.value.commission = 0
}
})
}
}
/** 查询账户管理列表 */
function getAccountList() {
listAccounts(queryAccountParams.value).then((response) => {
@@ -202,7 +239,7 @@ function reset() {
type: '5',
accountId: null,
amount: null,
dealType: null,
dealType: '1',
createBy: null,
createTime: null,
updateBy: null,
@@ -250,6 +287,8 @@ const handleView = (row) => {
/** 新增按钮操作 */
function handleAdd() {
reset()
form.value.createTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
futuresShow.value = false
open.value = true
title.value = '添加投资交易记录'
}
@@ -260,15 +299,68 @@ function handleUpdate(row) {
const _id = row.id || ids.value
getAccountDealRecord(_id).then((response) => {
form.value = response.data
if (form.value.accountId != null && form.value.accountId != '') {
getFutureStocks(form.value.accountId).then((response) => {
const account = response.data
accountType.value = account.type
if (account.type == '1') {
futuresShow.value = true
form.value.closedPosition = null
form.value.commission = null
} else {
futuresShow.value = false
form.value.closedPosition = 0
form.value.commission = 0
}
})
}
open.value = true
title.value = '修改投资交易记录'
})
}
/** 复制按钮操作 */
function handleCopy(row) {
reset()
const _id = row.id || ids.value
getAccountDealRecord(_id).then((response) => {
form.value = response.data
if (form.value.accountId != null && form.value.accountId != '') {
getFutureStocks(form.value.accountId).then((response) => {
const account = response.data
form.value.createTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
accountType.value = account.type
if (account.type == '1') {
futuresShow.value = true
form.value.closedPosition = null
form.value.commission = null
} else {
futuresShow.value = false
form.value.closedPosition = 0
form.value.commission = 0
}
})
}
open.value = true
title.value = '复制投资交易记录'
})
}
/** 提交按钮 */
function submitForm() {
proxy.$refs.accountDealRecordRef.validate((valid) => {
if (valid) {
//如果是期货,给备注
if (accountType.value == '1') {
form.value.remark = '平仓盈亏' + form.value.closedPosition + ',手续费' + form.value.commission
form.value.amount = form.value.closedPosition - form.value.commission
}
//如果是亏损,金额乘以-1
if (form.value.amount >= 0) {
form.value.dealType = '1'
} else {
form.value.dealType = '2'
form.value.amount = form.value.amount * -1
}
if (form.value.id != null) {
updateAccountDealRecord(form.value).then((response) => {
proxy.$modal.msgSuccess('修改成功')

View File

@@ -257,6 +257,7 @@ const handleView = (row) => {
/** 新增按钮操作 */
function handleAdd() {
reset()
form.value.createTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
open.value = true
title.value = '添加投资账户记账'
}

View File

@@ -313,6 +313,7 @@ const handleView = (row) => {
/** 新增按钮操作 */
function handleAdd() {
reset()
form.value.createTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
open.value = true
title.value = '添加借贷记账'
}

View File

@@ -171,7 +171,7 @@
<div class="title-con">
<div class="title">基本信息</div>
<div class="operate-btn-con">
<!-- <el-button @click="handleAddDetail" icon="Plus" v-hasPermi="['invest:installmentHistory:add']">新增</el-button> -->
<el-button @click="handleAddDetail" icon="Plus" v-hasPermi="['invest:installmentHistory:add']">新增</el-button>
<el-button @click="handleUpdateInterest" icon="Expand" v-hasPermi="['invest:installmentHistory:add']">总利息汇总</el-button>
</div>
</div>
@@ -229,6 +229,7 @@ import {
import { listBankcardLend } from '@/api/invest/bankcardlend'
// eslint-disable-next-line no-unused-vars
import { require } from '@/utils/require'
import dayjs from 'dayjs'
const { proxy } = getCurrentInstance()
const { settle_state, bank_card_type, posting_state } = proxy.useDict('settle_state', 'bank_card_type', 'posting_state')
@@ -389,7 +390,7 @@ function reset() {
// 表单重置
function resetDetail() {
form.value = {
formDetail.value = {
id: null,
installmentHistoryId: null,
bankCardLendId: null,
@@ -446,6 +447,7 @@ const handleView = (row) => {
/** 新增按钮操作 */
function handleAdd() {
reset()
form.value.installmentDate = dayjs(new Date().getTime()).format('YYYY-MM-DD')
open.value = true
title.value = '添加贷款账单'
}
@@ -453,6 +455,7 @@ function handleAdd() {
/** 新增按钮操作 */
function handleAddDetail() {
resetDetail()
formDetail.value.repaymentDate = dayjs(new Date().getTime()).format('YYYY-MM-DD')
titleDetail.value = '添加贷款明细'
openDetail.value = true
}

View File

@@ -110,6 +110,7 @@ import {
import { listBankcardLend } from '@/api/invest/bankcardlend'
// eslint-disable-next-line no-unused-vars
import { require } from '@/utils/require'
import dayjs from 'dayjs'
const { proxy } = getCurrentInstance()
const { settle_state, bank_card_type } = proxy.useDict('settle_state', 'bank_card_type')
@@ -256,6 +257,7 @@ const handleView = (row) => {
/** 新增按钮操作 */
function handleAdd() {
reset()
form.value.installmentDate = dayjs(new Date().getTime()).format('YYYY-MM-DD')
open.value = true
title.value = '添加人情账单'
}

View File

@@ -294,6 +294,7 @@ const handleView = (row) => {
/** 新增按钮操作 */
function handleAdd() {
reset()
form.value.createTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
open.value = true
title.value = '添加POS机刷卡'
}