feat: 新增客户管理、项目进度和财务中心功能模块

新增客户管理、项目进度和财务中心相关页面及API接口
添加项目明细页面和启动图资源
重构请求基础URL和更新逻辑
引入uni-badge和uni-list组件
优化工作台首页功能入口布局
更新版本号至5.0.0并修改启动图配置
This commit is contained in:
砂糖
2025-11-06 16:56:35 +08:00
parent de492664c3
commit 307b46b213
39 changed files with 4664 additions and 9 deletions

View File

@@ -0,0 +1,22 @@
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,736 @@
<template>
<view class="report-schedule">
<!-- header始终显示 -->
<view class="search-bar">
<view class="search-container">
<view class="task-type-button-container">
<view class="task-type-button" @click="openDrawer">
<uni-icons type="settings" color="#2979ff" size="22"></uni-icons>
</view>
</view>
<view class="search-input custom-search-input">
<input v-model="queryParams.name" class="input" type="text" placeholder="搜索客户名称" @confirm="onSearch"
@keyup.enter="onSearch" />
<view class="search-icon" @click="onSearch">
<uni-icons type="search" color="#bbb" size="20"></uni-icons>
</view>
<view v-if="searchName" class="clear-icon" @click="onClearSearch">
<uni-icons type="closeempty" color="#bbb" size="18"></uni-icons>
</view>
</view>
<view class="add-button" @click="handleAdd">
<uni-icons type="plusempty" color="#2979ff" size="22"></uni-icons>
</view>
</view>
</view>
<!-- 筛选抽屉 -->
<uni-drawer ref="drawerRef" mode="left" :width="320">
<view class="drawer-content">
<view class="drawer-title">筛选</view>
<view class="drawer-form">
<view class="drawer-form-item">
<text class="drawer-label">客户等级</text>
<oa-dict-select v-model="queryParams.level" placeholder="客户等级" dictType='customer_level' />
</view>
<view class="drawer-form-item">
<text class="drawer-label">所属行业</text>
<oa-dict-select v-model="queryParams.industryId" placeholder="所属行业" dictType='industry_type' />
</view>
<view class="drawer-form-item">
<text class="drawer-label">客户来源</text>
<oa-dict-select v-model="queryParams.source" placeholder="客户来源" dictType='customer_source' />
</view>
</view>
<view class="drawer-btns">
<button class="drawer-btn-primary" @click="applyFilterAndClose">确定</button>
<button class="drawer-btn" @click="resetFilterAndClose">重置</button>
<button class="drawer-btn" @click="closeDrawer">关闭</button>
</view>
</view>
</uni-drawer>
<view>
<!-- 自定义列表右滑菜单uni-ui实现 -->
<scroll-view scroll-y style="height: 100vh;" @scrolltolower="loadMore">
<view v-if="customerList.length">
<uni-swipe-action>
<block v-for="(item, index) in customerList" :key="item.customerId">
<uni-swipe-action-item :right-options="getSwipeOptions(item)" @click="swipeActionClick($event, item)"
style="margin-bottom: 16rpx;">
<view class="card">
<view class="card-title">
<text class="project">{{ item.name }}</text>
</view>
<view class="card-content">
<view>负责人{{ item.nickName }}</view>
<view>手机{{ item.mobile }}</view>
<view>详细地址{{ item.detailAddress }}</view>
</view>
</view>
</uni-swipe-action-item>
</block>
</uni-swipe-action>
</view>
<view v-else class="empty">暂无数据</view>
<view class="load-more-tips">
<u-loading-icon v-if="loadingMore" text="加载中..." size="20" textSize="14" />
<text v-else-if="!hasMore && customerList.length">没有更多了</text>
</view>
</scroll-view>
<!-- 新增/编辑弹窗 -->
<uni-popup ref="popupRef" type="bottom">
<view class="popup-content">
<view class="uni-form">
<view class="uni-form-item">
<text class="uni-form-label">客户名称</text>
<u-input v-model="form.name" placeholder="请输入客户名称" />
</view>
<view class="uni-form-item">
<text class="uni-form-label">最后跟进时间</text>
<uni-datetime-picker v-model="form.contactLastTime" type="datetime" placeholder="请选择最后跟进时间"
style="width:100%" />
</view>
<view class="uni-form-item">
<text class="uni-form-label">最后跟进内容</text>
<u-input v-model="form.contactLastContent" placeholder="请输入最后跟进内容" />
</view>
<view class="uni-form-item">
<text class="uni-form-label">下次联系时间</text>
<uni-datetime-picker v-model="form.contactNextTime" type="datetime" placeholder="请选择下次联系时间"
style="width:100%" />
</view>
<view class="uni-form-item">
<text class="uni-form-label">负责人</text>
<oa-user-select v-model="form.ownerUserId" />
</view>
<view class="uni-form-item">
<text class="uni-form-label">微信</text>
<u-input v-model="form.wechat" placeholder="微信" />
</view>
<view class="uni-form-item">
<text class="uni-form-label">邮箱</text>
<u-input v-model="form.email" placeholder="邮箱" />
</view>
<view class="uni-form-item">
<text class="uni-form-label">详细地址</text>
<u-input v-model="form.detailAddress" placeholder="详细地址" />
</view>
<view class="uni-form-item">
<text class="uni-form-label">手机</text>
<u-input v-model="form.mobile" placeholder="手机" />
</view>
<view class="uni-form-item">
<text class="uni-form-label">电话</text>
<u-input v-model="form.telephone" placeholder="电话" />
</view>
<view class="uni-form-item">
<text class="uni-form-label">QQ</text>
<u-input v-model="form.qq" placeholder="QQ" />
</view>
<view class="uni-form-item">
<text class="uni-form-label">备注</text>
<u-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
</view>
<view class="uni-form-item">
<text class="uni-form-label">所属行业</text>
<oa-dict-select v-model="form.industryId" dictType="industry_type" placeholder="请选择所属行业" />
</view>
<view class="uni-form-item">
<text class="uni-form-label">客户等级</text>
<oa-dict-select v-model="form.level" dictType="customer_level" placeholder="请选择客户等级" />
</view>
<view class="uni-form-item">
<text class="uni-form-label">客户来源</text>
<oa-dict-select v-model="form.source" dictType="customer_source" placeholder="请选择客户来源" />
</view>
</view>
<view class="popup-btns">
<u-button type="primary" @click="submitForm">确定</u-button>
<u-button @click="closePopup">取消</u-button>
</view>
</view>
</uni-popup>
</view>
</view>
</template>
<script>
import {
addCustomer,
delCustomer,
getCustomer,
listCustomer,
updateCustomer
} from '@/api/oa/customer.js'
export default {
data() {
return {
queryParams: {
pageNum: 1,
pageSize: 10,
name: undefined,
followUpStatus: undefined,
contactLastTime: undefined,
contactLastContent: undefined,
contactNextTime: undefined,
ownerUserId: undefined,
ownerTime: undefined,
dealStatus: undefined,
mobile: undefined,
telephone: undefined,
qq: undefined,
wechat: undefined,
email: undefined,
areaId: undefined,
detailAddress: undefined,
industryId: undefined,
level: undefined,
source: undefined,
},
projectOptions: [],
headerOptions: [],
customerList: [],
total: 0,
single: true,
multiple: true,
form: {},
showStartDate: false,
showEndDate: false,
swipeOptions: [{
text: '编辑',
style: {
backgroundColor: '#2979ff',
color: '#fff'
}
},
{
text: '删除',
style: {
backgroundColor: '#fa3534',
color: '#fff'
}
}
],
// 新增:筛选相关
searchName: '',
filterProject: '',
filterHeader: '',
filterDateRange: [],
pageNum: 1,
pageSize: 10,
loadingMore: false,
hasMore: true,
startForm: {
reportTitle: '',
reportDate: '',
reporter: '',
projectId: '',
remark: '',
type: 1
},
startLoading: false,
startPopupOpen: false,
_startScheduleId: null,
showGanttView: false,
ganttChartData: {
categories: [],
series: []
}
}
},
onLoad() {
this.pageNum = 1
this.hasMore = true
this.handleQuery()
},
methods: {
openDrawer() {
this.$refs.drawerRef.open();
},
closeDrawer() {
this.$refs.drawerRef.close();
},
applyFilterAndClose() {
this.applyFilter();
this.closeDrawer();
},
resetFilterAndClose() {
this.resetFilter();
this.closeDrawer();
},
// 搜索框检索
onSearch() {
this.searchName = this.searchName
this.handleQuery()
},
onClearSearch() {
this.searchName = ''
this.queryParams.scheduleName = ''
this.handleQuery()
},
// 筛选抽屉应用
applyFilter() {
this.queryParams.projectId = this.filterProject
this.queryParams.header = this.filterHeader
if (this.filterDateRange && this.filterDateRange.length === 2) {
this.queryParams.dateRange = this.filterDateRange
} else {
this.queryParams.dateRange = []
}
this.handleQuery()
},
// 筛选抽屉重置
resetFilter() {
this.queryParams = {
...this.queryParams,
level: undefined,
source: undefined,
industryId: undefined,
}
},
handleQuery() {
this.pageNum = 1
this.hasMore = true
this.queryParams.pageNum = 1
if (this.queryParams.dateRange && this.queryParams.dateRange.length === 2) {
this.queryParams.startDate = this.queryParams.dateRange[0]
this.queryParams.endDate = this.queryParams.dateRange[1]
} else {
this.queryParams.startDate = ''
this.queryParams.endDate = ''
}
this.getList()
},
getList() {
this.loadingMore = true
this.queryParams.pageNum = this.pageNum
this.queryParams.pageSize = this.pageSize
listCustomer(this.queryParams).then(res => {
const rows = res.rows || []
if (this.pageNum === 1) {
this.customerList = rows
} else {
this.customerList = this.customerList.concat(rows)
}
// 判断是否还有更多
this.hasMore = rows.length === this.pageSize
this.total = res.total || 0
}).finally(() => {
this.loadingMore = false
})
},
loadMore() {
if (!this.hasMore || this.loadingMore) return
this.pageNum++
this.getList()
},
handleAdd() {
this.form = {}
this.$refs.popupRef.open('bottom')
},
handleUpdate(row) {
getCustomer(row.customerId).then(res => {
this.form = res.data || {}
this.$refs.popupRef.open('bottom')
})
},
handleDelete(item) {
uni.showModal({
title: '确认删除',
content: `确定要删除排产“${item.scheduleName}”吗?`,
success: (res) => {
if (res.confirm) {
const ids = item ? [item.customerId] : this.selectedIds
delCustomer(ids).then(() => {
uni.showToast({
title: '删除成功',
icon: 'success'
})
this.getList()
})
}
}
})
},
handleExport() {
// 导出逻辑可根据实际API实现
uni.showToast({
title: '导出功能开发中',
icon: 'none'
})
},
submitForm() {
if (this.form.customerId) {
updateCustomer(this.form).then(() => {
uni.showToast({
title: '修改成功',
icon: 'success'
})
this.closePopup()
this.getList()
})
} else {
addCustomer(this.form).then(() => {
uni.showToast({
title: '新增成功',
icon: 'success'
})
this.closePopup()
this.getList()
})
}
},
closePopup() {
this.$refs.popupRef.close()
},
getSwipeOptions(item) {
const options = [{
text: '编辑',
style: {
backgroundColor: '#2979ff',
color: '#fff'
}
},
{
text: '删除',
style: {
backgroundColor: '#fa3534',
color: '#fff'
}
}
];
return options;
},
swipeActionClick(e, item) {
const text = e.content.text;
if (text === '编辑') {
this.handleUpdate(item);
} else if (text === '删除') {
this.handleDelete(item);
} else if (text === '开始') {
this.handleStart(item);
}
},
handleStart(row) {
const now = new Date();
const pad = n => n < 10 ? '0' + n : n;
const formatDate = d =>
`${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;
this.startForm = {
reportTitle: row.scheduleName,
reportDate: formatDate(now),
reporter: row.header,
projectId: row.projectId,
remark: row.remark,
type: 1
}
this._startScheduleId = row.customerId
this.openStartPopup()
},
openStartPopup() {
this.$refs.startPopupRef.open('bottom')
this.startPopupOpen = true
},
closeStartPopup() {
this.$refs.startPopupRef.close()
this.startPopupOpen = false
},
async submitStartForm() {
if (!this.startForm.reportTitle || !this.startForm.reportDate || !this.startForm.reporter || !this.startForm
.projectId) {
uni.showToast({
title: '请填写完整',
icon: 'none'
})
return
}
this.startLoading = true
try {
await updateCustomer({
customerId: this._startScheduleId,
status: 1
})
uni.showToast({
title: '开始成功',
icon: 'success'
})
this.closeStartPopup()
this.getList()
} catch (e) {
uni.showToast({
title: '操作失败',
icon: 'none'
})
} finally {
this.startLoading = false
}
},
getProjectName(id) {
const p = this.projectOptions.find(i => i.value == id)
return p ? p.text : id
},
getHeaderName(id) {
const h = this.headerOptions.find(i => i.value == id)
return h ? h.text : id
},
getStatusText(status) {
if (status === 1) return '已开始'
if (status === 0 || status === undefined) return '未开始'
return '其他'
},
getGanttChartData(list) {
if (!list || !list.length) {
return {
categories: [],
series: []
}
}
// 只保留唯一 projectId
const uniqueProjectIds = Array.from(new Set(list.map(item => item.projectId)))
const categories = uniqueProjectIds.map(id => this.getProjectName(id))
const data = list.map(item => ({
...item,
projectName: this.getProjectName(item.projectId),
headerName: this.getHeaderName(item.header),
}))
return {
categories,
series: [{
name: '进度',
data
}]
}
},
toggleGanttView() {
this.showGanttView = !this.showGanttView;
if (this.showGanttView) {
this.ganttChartData = this.getGanttChartData(this.customerList);
}
}
}
}
</script>
<style scoped>
.report-schedule {
min-height: 100vh;
background-color: #f5f5f5;
padding-bottom: 120rpx;
}
.search-bar {
padding: 20rpx;
position: sticky;
top: 0;
z-index: 100;
background: #fff;
}
.search-container {
display: flex;
align-items: center;
gap: 20rpx;
}
.task-type-button-container {
display: flex;
gap: 12rpx;
}
.task-type-button {
width: 60rpx;
height: 60rpx;
background-color: transparent;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.search-input {
flex: 1;
position: relative;
display: flex;
align-items: center;
background: #f5f5f5;
border-radius: 100rpx;
padding: 0 24rpx;
height: 60rpx;
}
.input {
flex: 1;
border: none;
background: transparent;
font-size: 30rpx;
outline: none;
height: 60rpx;
line-height: 60rpx;
}
.search-icon {
margin-left: 8rpx;
display: flex;
align-items: center;
}
.clear-icon {
margin-left: 8rpx;
display: flex;
align-items: center;
}
.drawer-content {
padding: 32rpx 24rpx 24rpx 24rpx;
}
.drawer-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 24rpx;
}
.drawer-form {
margin-bottom: 32rpx;
}
.drawer-form-item {
margin-bottom: 24rpx;
}
.drawer-label {
display: block;
font-size: 28rpx;
color: #333;
margin-bottom: 8rpx;
}
.drawer-btns {
display: flex;
gap: 16rpx;
margin-top: 24rpx;
}
.drawer-btn-primary {
flex: 1;
background: #2979ff;
color: #fff;
border: none;
border-radius: 8rpx;
padding: 16rpx 0;
font-size: 28rpx;
}
.drawer-btn {
flex: 1;
background: #f5f5f5;
color: #333;
border: none;
border-radius: 8rpx;
padding: 16rpx 0;
font-size: 28rpx;
}
.card {
background: #fff;
border-radius: 16rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
padding: 24rpx;
}
.card-title {
display: flex;
justify-content: space-between;
align-items: center;
font-weight: bold;
margin-bottom: 12rpx;
}
.project {
color: #2979ff;
}
.status {
font-size: 24rpx;
padding: 0 12rpx;
border-radius: 8rpx;
}
.status-1 {
background: #e0f7fa;
color: #009688;
}
.status-0,
.status-undefined {
background: #fffbe6;
color: #faad14;
}
.status-other {
background: #fbeff2;
color: #e91e63;
}
.card-content view {
margin-bottom: 8rpx;
color: #666;
font-size: 26rpx;
}
.empty {
text-align: center;
color: #bbb;
margin: 40rpx 0;
}
.popup-content {
padding: 24rpx;
background: #fff;
border-radius: 16rpx 16rpx 0 0;
}
.uni-form {
margin-bottom: 32rpx;
max-height: 50vh;
overflow-y: scroll;
}
.uni-form-item {
margin-bottom: 32rpx;
}
.uni-form-label {
display: block;
font-size: 28rpx;
color: #333;
margin-bottom: 8rpx;
}
.load-more-tips {
text-align: center;
color: #bbb;
padding: 24rpx 0 32rpx 0;
font-size: 28rpx;
}
.card-ops {
margin-top: 16rpx;
display: flex;
gap: 16rpx;
}
.gantt-toggle-bar {
display: flex;
gap: 16rpx;
padding: 16rpx 0 8rpx 0;
background: #fff;
justify-content: flex-end;
}
</style>

View File

@@ -85,17 +85,30 @@ export default {
category: '车间管理'
},
{
text: '项目中心',
text: '项目管理',
icon: '/static/images/project.png',
url: '/pages/workbench/project/project',
category: "信息中心"
access: ['vice, admin', 'doctor', 'ceo', '13'],
category: "项目中心"
},
{
text: '项目进度',
icon: '/static/images/progress.png',
url: '/pages/workbench/project/schedule',
category: '项目中心'
},
{
text: '问题反馈',
icon: '/static/images/wenti.png',
url: '/pages/workbench/feedback/feedback',
category: "信息中心"
},
{
text: '客户管理',
icon: '/static/images/customer.png',
url: '/pages/workbench/customer/customer',
category: '信息中心'
},
{
text: '库存盘点',
icon: '/static/images/stock.png',
@@ -109,6 +122,13 @@ export default {
category: '财务中心',
access: ['vice', 'baomi', 'ceo'] // 需要特定权限才能访问
},
{
text: '项目明细',
icon: '/static/images/profitpro.png',
url: '/pages/workbench/profit/project',
category: '财务中心',
// access: ['vice', 'baomi', 'ceo'] // 需要特定权限才能访问
},
{
text: '项目成本',
icon: '/static/images/cost.png',

View File

@@ -0,0 +1,22 @@
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,849 @@
<template>
<view class="container">
<!-- 项目基本信息展示 -->
<view class="project-header" v-if="this.projectId != 0">
<view class="project-info-item">
<text class="info-label">项目名称</text>
<text class="info-value">{{ currentProject.projectName || '未知项目' }}</text>
</view>
<view class="project-info-item">
<text class="info-label">项目编号</text>
<text class="info-value">{{ currentProject.projectNo || '无编号' }}</text>
</view>
<view class="project-info-item">
<text class="info-label">项目总金额</text>
<text class="info-value">¥ {{ formatCurrency(currentProject.funds || 0) }}</text>
</view>
</view>
<view class="project-header" v-if="this.projectId == 0">
<view class="project-info-item">
<text class="info-value">其他收支</text>
</view>
</view>
<!-- 新增按钮 -->
<view class="btn-add-container">
<uni-button type="primary" @click="openAddPopup">
<uni-icons type="plus" size="18" class="btn-icon"></uni-icons>
新增财务记录
</uni-button>
</view>
<!-- 财务明细列表 -->
<view class="finance-list-container">
<view class="list-title">财务明细记录</view>
<uni-list v-if="finances.length > 0" border>
<uni-list-item
v-for="(item, index) in finances"
:key="item.financeId"
:title="item.financeTitle"
:note="`${item.financeType === '1' ? '出账' : '入账'} · ${formatDate(item.financeTime)} · 共${item.detailList.length || 0}条明细`"
showArrow
:clickable="true"
@click="openDetailPopup(item)"
>
<template v-slot:extra>
<view class="amount-tag" :class="item.financeType === '1' ? 'expense' : 'income'">
{{ item.financeType === '1' ? '-' : '+' }}¥{{ calculateFinanceTotal(item.detailList) }}
</view>
</template>
</uni-list-item>
</uni-list>
<view v-else class="empty-list">
<uni-icons type="empty" size="60" color="#ccc"></uni-icons>
<text class="empty-text">暂无财务记录</text>
</view>
</view>
<!-- 新增财务记录弹窗 -->
<uni-popup ref="addPopup" type="bottom" :style="{ width: '100%' }">
<view class="popup-content">
<view class="popup-title">{{ form.financeId ? '编辑财务记录' : '新增财务记录' }}</view>
<uni-forms ref="financeForm" :model="form" :rules="rules" label-width="150rpx">
<uni-forms-item label="财务类型" name="financeType">
<uni-data-checkbox mode="tag" v-model="form.financeType" :localdata="[
{ value: "1", text: '出账' },
{ value: '2', text: '入账' }
]"></uni-data-checkbox>
</uni-forms-item>
<uni-forms-item label="记录名称" name="financeTitle">
<uni-easyinput
v-model="form.financeTitle"
placeholder="请输入记录名称"
clearable
></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="交易时间" name="financeTime">
<uni-datetime-picker
v-model="form.financeTime"
type="datetime"
placeholder="请选择交易时间"
:start="minDate"
></uni-datetime-picker>
</uni-forms-item>
<uni-forms-item label="交易方" name="financeParties">
<uni-easyinput
v-model="form.financeParties"
placeholder="请输入交易方"
clearable
></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="支付类型" name="payType">
<oa-dict-select v-model="form.payType" dict-type='sys_pay_type'></oa-dict-select>
</uni-forms-item>
<!-- 明细列表区域替换uni-table -->
<view class="detail-section">
<view class="detail-header">
<text class="detail-title">明细列表</text>
<uni-button type="primary" size="mini" @click="addDetail">
<uni-icons type="plus" size="16"></uni-icons>添加明细
</uni-button>
</view>
<!-- 明细标题行 -->
<view class="detail-row header-row">
<view class="detail-col index-col">序号</view>
<view class="detail-col name-col">明细名称</view>
<view class="detail-col price-col">金额()</view>
<view class="detail-col action-col">操作</view>
</view>
<!-- 明细内容行 -->
<view
class="detail-row content-row"
v-for="(item, index) in form.detailList"
:key="item.detailId"
>
<view class="detail-col index-col">{{ index + 1 }}</view>
<view class="detail-col name-col">
<uni-easyinput
v-model="item.detailTitle"
placeholder="请输入明细名称"
class="detail-input"
></uni-easyinput>
</view>
<view class="detail-col price-col">
<uni-easyinput
v-model="item.price"
placeholder="0.00"
type="number"
class="detail-input"
@input="calculateTotal"
></uni-easyinput>
</view>
<view class="detail-col action-col">
<uni-button
type="warn"
size="mini"
plain
@click="removeDetail(index)"
v-if="form.detailList.length > 1"
>
<uni-icons type="trash" size="16"></uni-icons>
</uni-button>
</view>
</view>
<!-- 合计金额 -->
<view class="total-amount" v-if="form.detailList.length > 0">
<text class="total-label">合计金额</text>
<text class="total-value" :class="form.financeType === '1' ? 'text-expense' : 'text-income'">
¥{{ formatCurrency(totalAmount) }}
</text>
</view>
</view>
<uni-forms-item label="备注" name="remark">
<uni-easyinput
v-model="form.remark"
placeholder="请输入备注信息"
type="textarea"
rows="3"
></uni-easyinput>
</uni-forms-item>
</uni-forms>
<view class="popup-btn-group">
<uni-button type="default" @click="closeAddPopup">取消</uni-button>
<uni-button type="primary" @click="submitFinanceForm">确认提交</uni-button>
</view>
</view>
</uni-popup>
<uni-popup ref="detailPopup" type="bottom" :style="{ width: '100%' }">
<view class="popup-content">
<view class="popup-title">财务记录详情</view>
<view class="detail-info">
<view class="detail-item">
<text class="detail-label">记录名称</text>
<text class="detail-value">{{ currentFinance.financeTitle || '-' }}</text>
</view>
<view class="detail-item">
<text class="detail-label">记录类型</text>
<text class="detail-value">{{ currentFinance.financeType === '1' ? '出账' : '入账' }}</text>
</view>
<view class="detail-item">
<text class="detail-label">交易时间</text>
<text class="detail-value">{{ formatDate(currentFinance.financeTime) || '-' }}</text>
</view>
<view class="detail-item">
<text class="detail-label">交易方</text>
<text class="detail-value">{{ currentFinance.financeParties || '-' }}</text>
</view>
<view class="detail-item">
<text class="detail-label">支付类型</text>
<text class="detail-value">{{ getPayTypeName(currentFinance.payType) || '-' }}</text>
</view>
<view class="detail-item">
<text class="detail-label">总金额</text>
<text class="detail-value" :class="currentFinance.financeType === '1' ? 'text-expense' : 'text-income'">
{{ currentFinance.financeType === '1' ? '-' : '+' }}¥{{ calculateFinanceTotal(currentFinance.detailList) }}
</text>
</view>
<!-- 明细列表展示替换uni-table -->
<view class="detail-section-view">
<view class="detail-header-view">
<text class="detail-title-view">明细列表 ({{ currentFinance.detailList.length || 0 }})</text>
</view>
<!-- 明细标题行 -->
<view class="detail-row header-row">
<view class="detail-col index-col">序号</view>
<view class="detail-col name-col">明细名称</view>
<view class="detail-col price-col">金额()</view>
</view>
<!-- 明细内容行 -->
<view
class="detail-row content-row"
v-for="(item, index) in currentFinance.detailList"
:key="index"
>
<view class="detail-col index-col">{{ index + 1 }}</view>
<view class="detail-col name-col">{{ item.detailTitle || '-' }}</view>
<view class="detail-col price-col">¥{{ formatCurrency(item.price || 0) }}</view>
</view>
<view v-if="!currentFinance.detailList || currentFinance.detailList.length === 0" class="empty-detail">
<text>无明细记录</text>
</view>
</view>
<view class="detail-item">
<text class="detail-label">备注</text>
<text class="detail-value">{{ currentFinance.remark || '无' }}</text>
</view>
<view class="detail-item">
<text class="detail-label">创建人</text>
<text class="detail-value">{{ currentFinance.createBy || '-' }}</text>
</view>
<view class="detail-item">
<text class="detail-label">创建时间</text>
<text class="detail-value">{{ formatDate(currentFinance.createTime) || '-' }}</text>
</view>
</view>
<view class="popup-btn-group">
<uni-button type="default" @click="closeDetailPopup">关闭</uni-button>
<uni-button type="primary" @click="handleEdit">编辑</uni-button>
<uni-button type="warn" @click="handleDelete">删除</uni-button>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import { getProject } from '@/api/oa/project';
import {
addFinance,
delFinance,
listFinance,
getFinance,
updateFinance
} from "@/api/oa/finance/finance.js";
export default {
data() {
return {
projectId: '',
currentProject: {},
finances: [],
currentFinance: {
detailList: []
},
loading: false,
// 表单数据 - 默认包含一条空明细
form: {
financeId: '',
projectId: '',
financeType: '1', // 1-出账 2-入账
financeTitle: '',
financeTime: '',
financeParties: '',
payType: '',
remark: '',
detailList: [] // 明细列表将在打开弹窗时初始化
},
// 合计金额(前端计算)
totalAmount: 0,
// 表单验证规则
rules: {
financeType: [{ required: true, message: '请选择记录类型', trigger: 'change' }],
financeTitle: [{ required: true, message: '请输入记录名称', trigger: 'blur' }],
financeTime: [{ required: true, message: '请选择交易时间', trigger: 'change' }],
financeParties: [{ required: true, message: '请输入交易方', trigger: 'blur' }],
payType: [{ required: true, message: '请选择支付类型', trigger: 'change' }]
},
// 支付类型选项
payTypes: [
{ value: '1', label: '微信支付' },
{ value: '2', label: '支付宝' },
{ value: '3', label: '银行转账' },
{ value: '4', label: '现金' },
{ value: '5', label: '其他' }
],
// 最小日期限制
minDate: ''
};
},
onLoad(options) {
// 获取项目ID
this.projectId = options.id;
if (!this.projectId && this.projectId !== '0') {
uni.showToast({ title: '项目ID不存在', icon: 'none' });
return;
}
// 初始化最小日期3年前
const now = new Date();
this.minDate = new Date(now.getFullYear() - 3, now.getMonth(), now.getDate()).getTime();
// 加载项目信息和财务记录
this.loadProjectInfo();
this.loadFinanceList();
},
methods: {
// 加载项目信息
loadProjectInfo() {
this.loading = true;
getProject(this.projectId).then(res => {
if (res.code === 200) {
this.currentProject = res.data;
} else {
uni.showToast({ title: res.msg || '获取项目信息失败', icon: 'none' });
}
}).catch(err => {
console.error('获取项目信息错误:', err);
uni.showToast({ title: '获取项目信息失败', icon: 'none' });
}).finally(() => {
this.loading = false;
});
},
// 加载财务记录列表
loadFinanceList() {
this.loading = true;
listFinance({
projectId: this.projectId,
pageNum: 1,
pageSize: 100
}).then(res => {
if (res.code === 200) {
this.finances = res.rows || [];
} else {
uni.showToast({ title: res.msg || '获取财务记录失败', icon: 'none' });
}
}).catch(err => {
console.error('获取财务记录错误:', err);
uni.showToast({ title: '获取财务记录失败', icon: 'none' });
}).finally(() => {
this.loading = false;
});
},
// 添加明细
addDetail() {
this.form.detailList.push({
detailId: Date.now(), // 临时ID
detailTitle: '',
price: ''
});
},
// 移除明细
removeDetail(index) {
// 确保至少保留一条明细
if (this.form.detailList.length <= 1) {
uni.showToast({ title: '至少保留一条明细', icon: 'none' });
return;
}
uni.showModal({
title: '确认删除',
content: '确定要删除这条明细吗?',
success: (res) => {
if (res.confirm) {
this.form.detailList.splice(index, 1);
this.calculateTotal();
}
}
});
},
// 计算表单总金额
calculateTotal() {
this.totalAmount = this.form.detailList.reduce((sum, item) => {
const price = Number(item.price) || 0;
return sum + price;
}, 0);
},
// 计算财务记录总金额(通用方法)
calculateFinanceTotal(detailList) {
if (!detailList || !detailList.length) return '0.00';
const total = detailList.reduce((sum, item) => {
const price = Number(item.price) || 0;
return sum + price;
}, 0);
return this.formatCurrency(total);
},
// 打开新增弹窗 - 默认添加一条空明细
openAddPopup() {
// 重置表单并默认添加一条空明细
this.form = {
financeId: '',
projectId: this.projectId,
financeType: '1',
financeTitle: '',
financeTime: new Date().toISOString().slice(0, 16),
financeParties: '',
payType: '',
remark: '',
detailList: [
{
detailId: Date.now(),
detailTitle: '',
price: ''
}
]
};
this.totalAmount = 0;
this.$refs.addPopup.open();
},
// 关闭新增弹窗
closeAddPopup() {
this.$refs.addPopup.close();
},
// 打开详情弹窗
openDetailPopup(item) {
this.currentFinance = { ...item };
this.$refs.detailPopup.open();
},
// 关闭详情弹窗
closeDetailPopup() {
this.$refs.detailPopup.close();
},
// 提交表单
submitFinanceForm() {
// 验证每条明细
const validDetail = this.form.detailList.every(item => {
return item.detailTitle && item.price && !isNaN(Number(item.price));
});
if (!validDetail) {
uni.showToast({ title: '请完善所有明细的名称和金额', icon: 'none' });
return;
}
this.$refs.financeForm.validate().then(() => {
this.loading = true;
const params = { ...this.form };
const submitApi = params.financeId ? updateFinance : addFinance;
submitApi(params).then(res => {
if (res.code === 200) {
uni.showToast({ title: params.financeId ? '修改成功' : '新增成功', icon: 'success' });
this.closeAddPopup();
this.loadFinanceList();
} else {
uni.showToast({ title: res.msg || '操作失败', icon: 'none' });
}
}).catch(err => {
console.error('提交财务记录错误:', err);
uni.showToast({ title: '操作失败', icon: 'none' });
}).finally(() => {
this.loading = false;
});
}).catch(err => {
console.log('表单验证失败:', err);
});
},
// 编辑记录
handleEdit() {
this.closeDetailPopup();
// 确保编辑时有至少一条明细
const detailList = this.currentFinance.detailList && this.currentFinance.detailList.length
? [...this.currentFinance.detailList]
: [{ detailId: Date.now(), detailTitle: '', price: '' }];
this.form = {
financeId: this.currentFinance.financeId,
projectId: this.projectId,
financeType: this.currentFinance.financeType,
financeTitle: this.currentFinance.financeTitle,
financeTime: this.currentFinance.financeTime ? this.formatDateTimeForInput(this.currentFinance.financeTime) : '',
financeParties: this.currentFinance.financeParties,
payType: this.currentFinance.payType,
remark: this.currentFinance.remark,
detailList: detailList
};
this.calculateTotal();
this.$refs.addPopup.open();
},
// 删除记录
handleDelete() {
uni.showModal({
title: '确认删除',
content: '确定要删除这条财务记录吗?',
success: (res) => {
if (res.confirm) {
this.loading = true;
delFinance(this.currentFinance.financeId).then(res => {
if (res.code === 200) {
uni.showToast({ title: '删除成功', icon: 'success' });
this.closeDetailPopup();
this.loadFinanceList();
} else {
uni.showToast({ title: res.msg || '删除失败', icon: 'none' });
}
}).catch(err => {
console.error('删除财务记录错误:', err);
uni.showToast({ title: '删除失败', icon: 'none' });
}).finally(() => {
this.loading = false;
});
}
}
});
},
// 格式化金额
formatCurrency(value) {
return parseFloat(value || 0).toFixed(2);
},
// 格式化日期
formatDate(dateStr) {
if (!dateStr) return '';
const date = new Date(dateStr);
return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
},
// 格式化日期时间(用于输入框)
formatDateTimeForInput(dateStr) {
if (!dateStr) return '';
const date = new Date(dateStr);
return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')} ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;
},
// 获取支付类型名称
getPayTypeName(value) {
const type = this.payTypes.find(item => item.value === value);
return type ? type.label : '';
}
}
};
</script>
<style scoped>
.container {
padding: 16rpx;
background-color: #f5f5f5;
min-height: 100vh;
}
.project-header {
background-color: #fff;
border-radius: 8rpx;
padding: 20rpx;
margin-bottom: 20rpx;
}
.project-info-item {
display: flex;
padding: 12rpx 0;
border-bottom: 1px solid #f5f5f5;
}
.project-info-item:last-child {
border-bottom: none;
}
.info-label {
color: #666;
width: 200rpx;
}
.info-value {
color: #333;
flex: 1;
}
.btn-add-container {
margin-bottom: 20rpx;
}
.btn-icon {
margin-right: 8rpx;
}
.finance-list-container {
background-color: #fff;
border-radius: 8rpx;
padding: 20rpx;
}
.list-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-bottom: 20rpx;
padding-bottom: 10rpx;
border-bottom: 1px solid #f5f5f5;
}
.empty-list {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 80rpx 0;
}
.empty-text {
color: #999;
font-size: 28rpx;
margin-top: 20rpx;
}
.amount-tag {
padding: 4rpx 12rpx;
border-radius: 16rpx;
font-size: 24rpx;
}
.amount-tag.income {
background-color: #e8f4e9;
color: #2e7d32;
}
.amount-tag.expense {
background-color: #ffebee;
color: #c62828;
}
.popup-content {
background-color: #fff;
border-radius: 16rpx 16rpx 0 0;
padding: 30rpx 20rpx;
max-height: 90vh;
overflow-y: auto;
}
.popup-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
margin-bottom: 30rpx;
padding-bottom: 20rpx;
border-bottom: 1px solid #f5f5f5;
}
.popup-btn-group {
display: flex;
justify-content: flex-end;
gap: 16rpx;
margin-top: 30rpx;
padding-top: 20rpx;
border-top: 1px solid #f5f5f5;
}
.detail-info {
margin-top: 10rpx;
}
.detail-item {
display: flex;
padding: 16rpx 0;
border-bottom: 1px solid #f5f5f5;
}
.detail-item:last-child {
border-bottom: none;
}
.detail-label {
color: #666;
width: 180rpx;
}
.detail-value {
color: #333;
flex: 1;
word-break: break-all;
}
.text-income {
color: #2e7d32;
}
.text-expense {
color: #c62828;
}
/* 明细区域样式替换table */
.detail-section {
margin: 30rpx 0;
padding: 20rpx;
background-color: #f9f9f9;
border-radius: 8rpx;
}
.detail-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
}
.detail-title {
font-size: 28rpx;
font-weight: bold;
color: #333;
}
/* 明细行样式 */
.detail-row {
display: flex;
width: 100%;
padding: 12rpx 0;
}
.header-row {
background-color: #f0f0f0;
font-weight: bold;
border-radius: 4rpx 4rpx 0 0;
}
.content-row {
border-bottom: 1px solid #f0f0f0;
align-items: center;
}
.content-row:last-child {
border-bottom: none;
}
/* 明细列样式 */
.detail-col {
display: flex;
justify-content: center;
align-items: center;
}
.index-col {
width: 10%;
font-size: 26rpx;
}
.name-col {
width: 40%;
padding: 0 10rpx;
}
.price-col {
width: 30%;
padding: 0 10rpx;
}
.action-col {
width: 20%;
}
/* 明细输入框样式 */
.detail-input {
width: 100%;
}
.empty-detail {
text-align: center;
color: #999;
padding: 40rpx 0;
font-size: 26rpx;
}
.total-amount {
display: flex;
justify-content: flex-end;
align-items: center;
margin-top: 20rpx;
padding-top: 10rpx;
border-top: 1px dashed #ddd;
}
.total-label {
font-size: 28rpx;
color: #666;
margin-right: 10rpx;
}
.total-value {
font-size: 28rpx;
font-weight: bold;
}
/* 详情弹窗中的明细样式 */
.detail-section-view {
margin: 20rpx 0;
padding: 10rpx;
background-color: #f9f9f9;
border-radius: 8rpx;
}
.detail-header-view {
margin-bottom: 15rpx;
}
.detail-title-view {
font-size: 26rpx;
font-weight: bold;
color: #333;
}
</style>

View File

@@ -0,0 +1,446 @@
<template>
<view class="project-page">
<!-- 新增按钮 -->
<view class="add-btn-row">
<u-search placeholder="根据项目名称搜索" v-model="queryParams.projectName" class="search-input" :show-action="false"
@search="handleSearch" />
<view class="button-group">
</input>
<uni-icons type="gift" size="30" @click="toggleQualityFilter" :color="qualityFilter ? '#ffcc00' : '#333'" />
<uni-icons type="search" size="30" @click="openSettingsPopup" color="#333"></uni-icons>
<uni-icons
type="plus"
size="30"
@click="handleAdd"
color="#333"
/>
<uni-drawer ref="filterDrawer" mode="right" :width="300">
<view class="popup-content">
<view class="filter-title">更多筛选条件</view>
<view class="filter-item">
<text class="filter-label">项目类型</text>
<oa-dict-select v-model="queryParams.projectType" dict-type="sys_project_type" placeholder="请选择项目类型"
@change="handleQuery" clearable />
</view>
<view class="filter-item">
<text class="filter-label">贸易类型</text>
<oa-dict-select v-model="queryParams.tradeType" dict-type="sys_trade_type" placeholder="请选择贸易类型"
@change="handleQuery" clearable />
</view>
<view class="filter-item">
<text class="filter-label">项目代号</text>
<oa-dict-select v-model="queryParams.projectCode" dict-type="sys_project_code" placeholder="请选择代号类型"
@change="handleQuery" clearable filterable />
</view>
<view class="filter-item">
<text class="filter-label">日期范围</text>
<uni-datetime-picker v-model="searchTime" type="daterange" rangeSeparator="至" start-placeholder="开始日期"
end-placeholder="结束日期" @change="handleQuery" />
</view>
<view class="filter-actions">
<button class="primary" @click="handleQuery">查询</button>
<button @click="resetQuery">重置</button>
</view>
</view>
</uni-drawer>
<!-- <uni-icons type="plus" size="30" @click="handleAdd" color="#333" /> -->
</view>
</view>
<!-- 项目列表 -->
<scroll-view scroll-y @scrolltolower="loadMore" :style="{ height: scrollHeight + 'px' }">
<view class="project-grid">
<view class="project-card" v-for="item in projectList" @click="handleDetail(item)">
<view class="project-title">
{{ item.projectName }}
<uni-tag v-if="item.projectStatus == 1" size="mini" type="success" text="进度完成"></uni-tag>
<uni-tag v-else-if="item.projectStatus == 0" size="mini" type="warning" text="进行中"></uni-tag>
</view>
<view class="project-info">
<text>{{ item.functionary }}</text>
<!-- <text :style="getRemainTimeStyle(item.remainTime)" v-if="item.projectStatus == 0">
剩余时间{{ item.remainTime }}
</text> -->
<text>{{ item.projectNum }}</text>
<text>项目总金额{{ item.funds }}</text>
<text v-if="item.prePay > 0" style="color: #ffcc00;">预付款{{ item.prePay }}</text>
<view
style="display: flex; justify-content: flex-start; gap: 10rpx; position: absolute; bottom: 20rpx; margin-top: 10rpx;">
</view>
</view>
</view>
</view>
<!-- 加载更多组件 -->
<uni-load-more :status="loadMoreStatus"></uni-load-more>
</scroll-view>
</view>
</template>
<script>
import {
listProject,
addProject,
updateProject,
delProject,
getProject
} from '@/api/oa/project.js'
export default {
data() {
return {
projectList: [],
form: {},
editType: '', // add/edit
page: 1, // 当前页码
pageSize: 10, // 每页项目数量
selectedProject: {}, // 选中的项目
loadMoreStatus: 'more', // 加载更多状态
scrollHeight: 0, // 滚动区域高度
qualityFilter: false, // 优质筛选开关
searchTime: [], // 日期范围
queryParams: {
projectName: '',
projectType: '',
tradeType: '',
projectCode: '',
projectStatus: ''
},
dict: {
type: {
sys_project_type: [],
sys_trade_type: [],
sys_project_code: [],
sys_project_status: []
}
}
}
},
onShow() {
this.getList();
this.calculateScrollHeight();
// TODO: 这里应请求字典数据填充dict.type
},
methods: {
getStatusLabel(val) {
const arr = this.dict.type.sys_project_status;
const found = arr.find(i => i.value === val);
return found ? found.label : '';
},
openSettingsPopup() {
this.$nextTick(() => {
if (this.$refs.filterDrawer) this.$refs.filterDrawer.open();
});
},
handleSearch() {
this.page = 1;
this.projectList = [];
this.getList();
},
handleQuery() {
this.page = 1;
this.projectList = [];
if (this.$refs.filterDrawer) this.$refs.filterDrawer.close();
// 日期范围处理
if (this.searchTime && this.searchTime.length === 2) {
this.queryParams.beginDate = this.searchTime[0];
this.queryParams.endDate = this.searchTime[1];
} else {
this.queryParams.beginDate = '';
this.queryParams.endDate = '';
}
this.getList();
},
resetQuery() {
this.queryParams = {
projectName: '',
projectType: '',
tradeType: '',
projectCode: '',
projectStatus: ''
};
this.searchTime = [];
this.handleQuery();
},
filterCode(val) {
// 可根据需要自定义筛选逻辑
return true;
},
calculateScrollHeight() {
const systemInfo = uni.getSystemInfoSync();
const tabHeight = 75; // tab高度
const containerPadding = 40; // 容器padding
this.scrollHeight = systemInfo.windowHeight - tabHeight - containerPadding + 80;
},
getList() {
const params = {
pageNum: this.page,
pageSize: this.pageSize,
...this.queryParams
};
if (this.qualityFilter) {
params.prePay = 0.1; // 添加优质筛选参数
}
listProject(params).then(res => {
const newProjects = (res.rows || []).map(row => ({
...row,
projectTypeLabel: row.projectType,
projectStatusLabel: row.projectStatus,
}));
this.projectList = [...this.projectList, ...newProjects];
if (newProjects.length < this.pageSize) {
this.loadMoreStatus = 'noMore'; // 没有更多数据
} else {
this.loadMoreStatus = 'more'; // 还有更多数据
}
});
},
loadMore() {
if (this.loadMoreStatus === 'more') {
console.log('加载更多');
this.page++;
this.getList();
}
},
handleAdd() {
uni.navigateTo({
url: '/pages/workbench/profit/cost?id=' + '0'
})
},
handleDetail(item) {
uni.navigateTo({
url: '/pages/workbench/profit/cost?id=' + item.projectId
})
},
toggleQualityFilter() {
this.qualityFilter = !this.qualityFilter; // 切换优质筛选状态
this.page = 1; // 重置页码
this.projectList = []; // 清空当前项目列表
this.getList(); // 重新获取项目列表
},
openEditPopup(item) {
this.editType = 'edit';
getProject(item.projectId).then(res => {
this.form = {
...res.data
};
this.$refs.editPopup.open();
});
},
closePopup() {
this.$refs.editPopup.close();
},
submitForm() {
if (this.editType === 'add') {
addProject(this.form).then(() => {
this.getList();
this.closePopup();
});
} else {
updateProject(this.form).then(() => {
this.getList();
this.closePopup();
});
}
},
handleClosure(item) {
const update = {
...item,
projectStatus: '1'
};
updateProject(update).then(() => {
this.getList();
});
},
handleDelete(item) {
delProject(item.projectId).then(() => {
this.getList();
});
},
openDetailPopup(item) {
this.selectedProject = item;
this.$refs.detailPopup.open();
},
closeDetailPopup() {
this.$refs.detailPopup.close();
},
getRemainTimeStyle(remainTime) {
if (remainTime > 10) {
return {
color: '#3c763d'
}; // 绿色
} else if (remainTime > 5) {
return {
color: '#8a6d3b'
}; // 黄色
} else {
return {
color: '#a94442'
}; // 红色
}
}
}
}
</script>
<style scoped>
.add-btn-row {
display: flex;
justify-content: flex-end;
/* 右对齐 */
align-items: center;
margin: 20rpx;
gap: 10rpx;
/* 按钮之间的间距 */
}
.button-group {
display: flex;
gap: 10px;
/* 按钮之间的间距 */
}
.popup-content {
background-color: #fff;
/* 设置纯白背景 */
padding: 24px 18px 18px 18px;
/* 上右下左内边距 */
border-radius: 14px;
/* 圆角 */
min-height: 100vh;
box-sizing: border-box;
}
.filter-title {
font-size: 20px;
font-weight: bold;
color: #333;
margin-bottom: 18px;
text-align: left;
}
.filter-item {
display: flex;
align-items: center;
margin-bottom: 18px;
}
.filter-label {
min-width: 80px;
font-size: 16px;
color: #666;
margin-right: 10px;
}
.filter-item oa-dict-select,
.filter-item picker,
.filter-item uni-datetime-picker {
flex: 1;
}
.filter-item .uni-input {
background: #f7f7f7;
border-radius: 6px;
padding: 8px 12px;
font-size: 15px;
color: #333;
}
.filter-actions {
display: flex;
justify-content: center;
gap: 18px;
margin-top: 10px;
}
.filter-actions button {
min-width: 90px;
padding: 8px 0;
border-radius: 6px;
font-size: 16px;
background: #2979ff;
color: #fff;
border: none;
}
.filter-actions button:not(.primary) {
background: #f5f5f5;
color: #333;
border: 1px solid #e0e0e0;
}
.close-button {
display: flex;
justify-content: flex-end;
/* 右对齐 */
margin-bottom: 10px;
/* 底部间距 */
}
.project-grid {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.project-card {
border: 1px solid #ccc;
/* 边框 */
border-radius: 10px;
/* 圆角 */
background-color: #fff;
/* 背景色 */
margin: 10px;
box-sizing: border-box;
width: calc(50% - 20px);
/* 每行两个卡片 */
padding: 20px 15px;
/* 添加内边距 */
position: relative;
}
.project-title {
font-size: 20px;
/* 项目名称字号 */
font-weight: bold;
/* 加粗 */
color: #333;
/* 主字体颜色 */
margin-bottom: 5px;
/* 下边距 */
}
.project-info text {
display: block;
/* 每个信息占一行 */
margin-top: 5px;
/* 上边距 */
color: #666;
/* 较淡的字体颜色 */
font-size: 16px;
/* 信息字号 */
line-height: 1.5;
/* 行间距 */
}
.project-info {
margin-top: 10px;
/* 项目信息与标题之间的间距 */
}
/* 新增的样式 */
.horizontal-actions {
display: flex;
justify-content: space-between;
/* 在一行内均匀分布 */
margin-top: 10px;
/* 添加顶部间距 */
}
.horizontal-actions button {
flex: 1;
/* 按钮均分宽度 */
margin: 0 5px;
/* 按钮之间的间距 */
}
</style>

View File

@@ -0,0 +1,22 @@
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,22 @@
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>