移动端加入

This commit is contained in:
2025-02-15 10:45:23 +08:00
parent 324b01042f
commit 75acf69848
10 changed files with 216 additions and 85 deletions

View File

@@ -129,21 +129,30 @@ export default {
// 绘制项目活跃度堆叠条形图
drawActivityChart() {
const chart = echarts.init(document.getElementById('activity-chart'));
console.log(this.projects)
// 处理数据:转化为堆叠条形图所需的格式
const dates = [...new Set(this.projects.map(item => item.createTime.substring(0 ,10)))]; // 获取所有日期
const dates = [...new Set(this.projects.map(item => item.createTime.substring(0 ,10)))].sort(); // 获取所有日期
const projects = [...new Set(this.projects.map(item => item.projectName))]; // 获取所有项目
// 创建数据系列:每个项目一个系列
const series = projects.map(project => ({
name: project,
type: 'bar',
stack: 'total',
data: dates.map(date => {
const progress = this.projects.find(item => item.projectName === project && item.createTime.substring(0 ,10) === date.substring(0 ,10));
return progress ? progress.laborCost : 0;
})
}));
// 创建数据系列:每个项目一个系列,颜色使用项目的 color 属性
const series = projects.map(projectName => {
const projectColor = this.projects.find(item => item.projectName === projectName)?.color || '#000'; // 默认黑色
return {
name: projectName,
type: 'bar',
stack: 'total',
data: dates.map(date => {
const progress = this.projects.find(
item => item.projectName === projectName && item.createTime.substring(0, 10) === date
);
return progress ? progress.laborCost : 0;
}),
itemStyle: {
color: projectColor, // 使用项目的颜色
},
};
});
// 配置项
const option = {

View File

@@ -231,7 +231,7 @@
</div>
<!-- 月度工作情况表格 -->
<h2>{{ date.getMonth() }} 月度工作签到情况</h2>
<h2>{{ date.getMonth()+1 }} 月度工作签到情况</h2>
<el-descriptions class="margin-top" title="报告详情" :column="3" :size="size" border>
@@ -426,15 +426,6 @@ export default {
methods: {
// // tag切换方法
// handleClickTab(tag,event){
// if (tag.index===1){
// this.$nextTick(() => {
// console.log("1284u0")
// this.$refs.barChart && this.$refs.barChart.resize(); // 假设你的 BarChart 组件提供了 resize 方法
// });
// }
// },
// 获取单元格的样式
getCellStyle(user, dayIndex) {
@@ -484,7 +475,7 @@ export default {
addOaAttendance(this.form).then(res => {
this.getList()
this.selectUser = this.selectArrayIndex >= this.userList.length - 1 ? this.selectUser : this.userList[this.selectArrayIndex + 1]
this.selectArrayIndex++
})
} else {
this.form = {
@@ -510,7 +501,7 @@ export default {
addOaAttendance(this.form).then(res => {
this.getList()
this.selectUser = this.selectArrayIndex >= this.userList.length - 1 ? this.selectUser : this.userList[this.selectArrayIndex + 1]
this.selectArrayIndex++
})
} else {
this.form = {
@@ -623,7 +614,9 @@ export default {
}
addOaAttendance(this.form).then(res => {
this.selectUser = this.selectArrayIndex >= this.userList.length - 1 ? this.selectUser : this.userList[this.selectArrayIndex + 1]
this.selectArrayIndex++
this.getList()
})
} else {

View File

@@ -433,7 +433,6 @@
v-for="dict in dict.type.sys_pay_type"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
@@ -547,6 +546,52 @@
</el-tab-pane>
<!-- <el-tab-pane label="财务核算(综合)" name="fifth">-->
<!-- <div class="funding-page">-->
<!-- <header class="page-header">-->
<!-- <h1>资金出入账核算</h1>-->
<!-- </header>-->
<!-- <main class="content">-->
<!-- <el-row :gutter="20">-->
<!-- <el-col :span="8">-->
<!-- <el-card class="info-card">-->
<!-- <el-select v-model="selectedAccount" placeholder="选择账户">-->
<!-- <el-option v-for="item in accounts" :key="item.id" :label="item.name" :value="item.id" />-->
<!-- </el-select>-->
<!-- </el-card>-->
<!-- </el-col>-->
<!-- <el-col :span="8">-->
<!-- <el-card class="info-card">-->
<!-- <el-date-picker v-model="selectedDateRange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />-->
<!-- </el-card>-->
<!-- </el-col>-->
<!-- <el-col :span="8">-->
<!-- <el-card class="info-card">-->
<!-- <el-select v-model="selectedPaymentType" placeholder="选择付款类型">-->
<!-- <el-option v-for="item in paymentTypes" :key="item.value" :label="item.label" :value="item.value" />-->
<!-- </el-select>-->
<!-- </el-card>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <div class="calculate-btn">-->
<!-- <el-button type="primary" @click="calculateFunds">核算资金</el-button>-->
<!-- </div>-->
<!-- <div v-if="calculationResult" class="result">-->
<!-- <el-card class="result-card">-->
<!-- <p>收入: {{ calculationResult.income }}</p>-->
<!-- <p>支出: {{ calculationResult.expense }}</p>-->
<!-- <p>净收入: {{ calculationResult.netIncome }}</p>-->
<!-- </el-card>-->
<!-- </div>-->
<!-- </main>-->
<!-- </div>-->
<!-- </el-tab-pane>-->
</el-tabs>
</el-col>
</el-row>
@@ -788,6 +833,12 @@ export default {
dicts: ['sys_pay_type', 'oa_out_finance'],
data() {
return {
accounts: [{ id: 1, name: '账户A' }, { id: 2, name: '账户B' }],
paymentTypes: [{ label: '现金', value: 'cash' }, { label: '信用卡', value: 'credit' }],
selectedAccount: null,
selectedDateRange: null,
selectedPaymentType: null,
calculationResult: null,
// 支付类型
payType: 0,
// 按钮loading
@@ -829,6 +880,7 @@ export default {
projectId: undefined,
financeTitle: undefined,
financeType: undefined,
receiveAccountId:-1,
},
receiveAccountList: [],
// 表单参数
@@ -911,6 +963,15 @@ export default {
},
methods: {
calculateFunds() {
// 模拟核算资金逻辑
this.calculationResult = {
income: '10,000.00',
expense: '4,500.00',
netIncome: '5,500.00',
};
},
// 获取核算信息通过支付类型
getFinanceDateByPayType() {
this.getPayTypeBlur()
@@ -941,7 +1002,6 @@ export default {
newChild.receiveAccountName = newChild.label;
newChild.parentId = -1;
addOaReceiveAccount(newChild).then(res => {
console.log(res)
newChild.receiveAccountId = res.data.receiveAccountId
})
data.children.push(newChild);
@@ -967,11 +1027,10 @@ export default {
handleNodeClick(data) {
this.queryParams.receiveAccountId = data.receiveAccountId;
if (this.nowTab === "2") {
if (this.nowTab === "2" ||this.nowTab === "3" ) {
return;
}
let type = this.nowTab == "1" ? '0' : '1'
let type = this.nowTab === "1" ? '0' : '1'
this.handleQuery(type);
},
@@ -1006,7 +1065,6 @@ export default {
listFinance(this.queryParams).then(response => {
console.log(response)
//出账列表
if (type == '0') {
this.financeListPro(response.rows).then(res => {
@@ -1202,39 +1260,6 @@ export default {
}
}
// this.form.detailList = this.detailList;
/* if (this.detailList.length == 0) {
this.$modal.msgWarning("费用名称金额不能为空!");
} else {
// this.form.makeTime = this.getRealDate(this.form.makeTime)
if (this.form.financeId != null) {
updateFinance(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
// this.getListEnter();
// this.getListOut();
this.getListFinance('0');
this.getListFinance('1');
}).finally(() => {
this.buttonLoading = false;
});
} else {
addFinance(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
//定位到入账列表
/!*this.getListEnter();
this.getListOut();*!/
this.getListFinance('0');
this.getListFinance('1');
}).finally(() => {
this.buttonLoading = false;
});
}
}*/
}
});
},
@@ -1348,6 +1373,7 @@ export default {
beginTime: beginTime,
endTime: endTime,
payType: this.payType,
receiveAccountId:this.queryParams.receiveAccountId,
}
findFinance(dataCome).then(res => {
this.checkByTime = res.data;
@@ -1364,10 +1390,10 @@ export default {
beginTime: Vue.prototype.parseTime(nowMonth, '{y}-{m}-{d} {h}:{i}:{s}'),
endTime: Vue.prototype.parseTime(monthEnd, '{y}-{m}-{d} {h}:{i}:{s}'),
payType: this.payType,
receiveAccountId:this.queryParams.receiveAccountId,
}
findFinance(dataCome).then(res => {
this.checkByTime = res.data;
})
},
/**
@@ -1651,4 +1677,82 @@ export default {
overflow: hidden;
text-overflow: ellipsis;
}
.funding-page {
background: #ffffff;
color: #333333;
font-family: 'Roboto', '微软雅黑', sans-serif;
padding: 20px 40px;
min-height: 100vh;
}
.page-header h1 {
font-size: 24px;
color: #1e3a8a; /* 深蓝色标题 */
text-align: left;
border-bottom: 2px solid #e4e8f7;
padding-bottom: 10px;
margin-bottom: 20px;
}
.form-section {
background: #f9fbff; /* 浅灰蓝背景 */
border: 1px solid #e4e8f7; /* 边框 */
padding: 20px;
border-radius: 8px;
margin-bottom: 20px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.form-item {
display: flex;
flex-direction: column;
margin-bottom: 20px;
}
.form-item label {
font-size: 14px;
color: #555555;
margin-bottom: 8px;
}
.calculate-btn {
text-align: center;
margin: 20px 0;
}
.result-section {
background: #ffffff;
border: 1px solid #e4e8f7;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.result-section h2 {
font-size: 18px;
color: #1e3a8a;
margin-bottom: 10px;
}
.result-summary {
display: flex;
justify-content: space-around;
text-align: center;
}
.result-item {
font-size: 16px;
color: #333333;
}
.result-item label {
font-weight: bold;
color: #555555;
}
.result-item span {
color: #1e3a8a;
font-weight: bold;
}
</style>