fix: 自测功能优化完善。

This commit is contained in:
tianyongbao
2026-02-15 01:26:39 +08:00
parent 8f1c61926f
commit fb9781ff52
7 changed files with 112 additions and 45 deletions

View File

@@ -81,12 +81,25 @@ export default {
currentInfoList: [] // 当前
})
onMounted(() => {
initCalendar()
getCalendarList()
// 初始化当前日期标题
updateCurrentDateTitle(dayjs().format('YYYY-MM-DD'))
// 使用 nextTick 确保 DOM 完全渲染后再初始化日历
proxy.$nextTick(() => {
// 再延迟一小段时间确保容器尺寸计算完成
setTimeout(() => {
initCalendar()
getCalendarList()
// 初始化当前日期标题
updateCurrentDateTitle(dayjs().format('YYYY-MM-DD'))
}, 100)
})
})
const initCalendar = () => {
// 安全检查:确保 DOM 元素存在且有有效宽度
if (!state.fullcalendar || !state.fullcalendar.offsetWidth) {
console.warn('日历容器未准备好,延迟初始化')
setTimeout(() => initCalendar(), 100)
return
}
state.Tcalendar = new Calendar(state.fullcalendar, {
plugins: [dayGridPlugin, timeGridPlugin, listPlugin, interactionPlugin],
initialView: 'dayGridMonth',

View File

@@ -3,7 +3,7 @@
<u-sticky offsetTop="0rpx" customNavHeight="0rpx">
<view class="search-view">
<u--input v-model="queryParams.name" border="false" placeholder="请输入借贷账户名称" class="search-input"
<u--input v-model="queryParams.name" border="false" placeholder="请输入借贷账户" class="search-input"
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
</u--input>
<view class="filter-btn" @click="filterPanel = !filterPanel">

View File

@@ -160,6 +160,18 @@ onLoad((option) => {
}else{
title.value="POS机刷卡记账-新增"
}
// 如果从POS机列表页跳转过来自动填充POS机信息
if(option.posInfo){
try {
const posInfo = JSON.parse(decodeURIComponent(option.posInfo))
form.value.posId = posInfo.posId
form.value.posName = posInfo.posName
form.value.rate = posInfo.rate
form.value.ratePlus = posInfo.ratePlus || 0
} catch(e) {
console.error('解析POS机信息失败', e)
}
}
getData()
})
onReady(() => {
@@ -233,7 +245,7 @@ function handleCreditCard() {
updateAccountsTransferRecord(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '修改成功', complete() {
uni.navigateTo({ url: `/pages/work/accounts/posTransferRecord/list` })
uni.navigateBack()
}
})
})
@@ -241,7 +253,7 @@ function handleCreditCard() {
addAccountsTransferRecord(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '新增成功', complete() {
uni.navigateTo({ url: `/pages/work/accounts/posTransferRecord/list` })
uni.navigateBack()
}
})
})

View File

@@ -23,11 +23,13 @@
<view class="header-info">
<view class="card-name-row">
<text class="card-name">{{ item.name }}</text>
<text class="card-code">{{ item.code }}</text>
<view class="bill-info">
<text class="limit-label">账单日</text>
<text class="bill-date">{{ item.billDateName }}</text>
</view>
</view>
<view class="card-limit-row">
<text class="limit-label">账单日</text>
<text class="bill-date">{{ item.billDateName }}</text>
<view class="card-detail-row">
<text class="card-code">{{ item.code }}</text>
</view>
</view>
</view>
@@ -41,7 +43,7 @@
<view class="pos-section" v-if="item.advicePosNames">
<view class="section-header">
<uni-icons type="shop" size="16" color="#667eea"></uni-icons>
<text class="section-title">推荐POS刷卡</text>
<text class="section-title">推荐POS刷卡</text>
</view>
<view class="pos-tags">
<text class="pos-tag" v-for="(pos, idx) in item.advicePosNames.split('、')" :key="idx">{{ pos }}</text>
@@ -366,11 +368,15 @@ page {
}
.list-item {
margin: 0 24rpx 24rpx;
margin: 24rpx 24rpx;
background-color: #fff;
border-radius: 16rpx;
overflow: hidden;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
&:first-child {
margin-top: 24rpx;
}
.item-header {
display: flex;
@@ -403,46 +409,59 @@ page {
flex: 1;
display: flex;
flex-direction: column;
gap: 8rpx;
gap: 6rpx;
min-width: 0;
}
.card-name-row {
display: flex;
align-items: baseline;
gap: 10rpx;
align-items: center;
justify-content: space-between;
gap: 12rpx;
}
.card-name {
font-size: 28rpx;
font-weight: 600;
font-size: 30rpx;
font-weight: 700;
color: #ffffff;
line-height: 1.2;
line-height: 1.3;
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.card-detail-row {
display: flex;
align-items: center;
}
.card-code {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.75);
font-size: 21rpx;
color: rgba(255, 255, 255, 0.85);
font-weight: 400;
line-height: 1.2;
letter-spacing: 0.5rpx;
font-family: 'Courier New', monospace;
}
.card-limit-row {
.bill-info {
display: flex;
align-items: center;
gap: 8rpx;
gap: 6rpx;
flex-shrink: 0;
}
.limit-label {
font-size: 22rpx;
font-size: 20rpx;
color: rgba(255, 255, 255, 0.7);
font-weight: 400;
line-height: 1;
}
.bill-date {
font-size: 26rpx;
font-weight: 500;
font-size: 24rpx;
font-weight: 600;
color: #ffffff;
line-height: 1;
}

View File

@@ -75,6 +75,10 @@
</view>
<view class="operate" @click.stop>
<view class="btn-swipe" @click="handleSwipe(item)">
<uni-icons type="wallet" size="16" color="#fa8c16"></uni-icons>
<text>刷卡</text>
</view>
<view class="btn-edit" @click="handleEdit(item)">
<uni-icons type="compose" size="16" color="#667eea"></uni-icons>
<text>修改</text>
@@ -223,6 +227,16 @@ function dictStr(val, arr) {
uni.navigateTo({ url: `/pages/work/base/posmachine/addEdit` })
isShow.value = true
}
function handleSwipe(item) {
// 跳转到刷卡记账页面传递POS机信息
const posInfo = encodeURIComponent(JSON.stringify({
posId: item.id,
posName: item.nameMerchantName || item.name,
rate: item.rate,
ratePlus: item.ratePlus
}))
uni.navigateTo({ url: `/pages/work/accounts/posTransferRecord/addEdit?posInfo=${posInfo}` })
}
function handleDelete(item) {
uni.showModal({
title: '确认删除',
@@ -472,6 +486,7 @@ page {
gap: 16rpx;
padding: 16rpx 24rpx 24rpx;
.btn-swipe,
.btn-edit,
.btn-delete {
display: flex;
@@ -490,6 +505,12 @@ page {
}
}
.btn-swipe {
background: rgba(250, 140, 22, 0.1);
color: #fa8c16;
border-color: rgba(250, 140, 22, 0.3);
}
.btn-edit {
background: rgba(102, 126, 234, 0.1);
color: #667eea;

View File

@@ -56,16 +56,17 @@
<text class="info-label">还款日</text>
<text class="info-value">{{ item.repaymentDay }}</text>
</view>
<view class="info-item">
<text class="info-label">账单周期</text>
<text class="info-value">{{ item.billDatePeriod }}</text>
</view>
</view>
<view class="info-row">
<view class="info-item">
<view class="info-item">
<text class="info-label">最近交易时间</text>
<text class="info-value">{{ item.recentDealTime || '-' }}</text>
</view>
</view>
<view class="info-row">
<view class="info-item">
<text class="info-label">账单周期</text>
<text class="info-value">{{ item.billDatePeriod }}</text>
</view>
</view>
</view>
<view class="stats-body" v-if="auth.hasPermi('invest:posmachine:list')">

View File

@@ -3,22 +3,24 @@
<u-sticky offsetTop="0rpx" customNavHeight="0rpx">
<view class="search-view">
<u--input v-model="queryParams.queryInstitution" border="false" placeholder="请输入" class="search-input"
<u--input v-model="queryParams.queryInstitution" border="false" placeholder="请输入查询机构" class="search-input"
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
</u--input>
</view>
<view class="search-view search-view-btns">
<view class="filter-btn" @click="filterPanel = !filterPanel">
<uni-icons type="list" size="20" color="#667eea"></uni-icons>
<uni-icons type="list" size="18" color="#667eea"></uni-icons>
<text>筛选</text>
</view>
<view class="add-btn" @click="handleAdd()">
<uni-icons type="plusempty" size="20" color="#667eea"></uni-icons>
<uni-icons type="plusempty" size="18" color="#667eea"></uni-icons>
<text>新增</text>
</view>
<view class="stats-btn" @click="handleQueryAnalysis()">
<uni-icons type="bars" size="20" color="#667eea"></uni-icons>
<uni-icons type="bars" size="18" color="#667eea"></uni-icons>
<text>统计</text>
</view>
<u-transition :show="filterPanel" mode="fade">
<u-transition :show="filterPanel" mode="fade" :customStyle="{ position: 'absolute', left: 0, right: 0, top: '100%', zIndex: 99 }">
<view class="filter-panel" :style="{ height: `${windowHeight - 42}px` }">
<view class="filter-panel-content">
<view class="filter-title">查询原因</view>
@@ -287,17 +289,21 @@ page {
padding: 12rpx 32rpx;
background-color: #ffffff;
display: flex;
justify-content: space-between;
justify-content: flex-end;
align-items: center;
gap: 16rpx;
position: relative;
z-index: 100;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
&.search-view-btns {
justify-content: flex-end;
}
.search-input {
background: rgba(102, 126, 234, 0.08);
color: #333333;
flex: 1;
margin-right: 16rpx;
border-radius: 24rpx;
border: 2rpx solid rgba(102, 126, 234, 0.3);
height: 66rpx !important;
@@ -317,7 +323,6 @@ page {
border: 2rpx solid rgba(102, 126, 234, 0.3);
transition: all 0.3s ease;
flex-shrink: 0;
margin-left: 12rpx;
&:active {
transform: scale(0.95);
@@ -333,11 +338,7 @@ page {
.filter-panel {
width: 100%;
position: absolute;
left: 0;
top: 96rpx;
background-color: rgba(0, 0, 0, 0.5);
z-index: 99;
.filter-panel-content {
background-color: #ffff;