oa二期内容更新

This commit is contained in:
2024-12-16 11:27:43 +08:00
parent de37820973
commit 5cbeeee3a1
19 changed files with 490 additions and 188 deletions

View File

@@ -13,7 +13,7 @@ ruoyi:
# 缓存懒加载
cacheLazy: false
# 文件路径
profile: D:/code/java_work/fad_ad/uploadPath
profile: /home/wy/oa/uploadPath
captcha:
# 页面 <参数设置> 可开启关闭 验证码校验

View File

@@ -146,6 +146,7 @@ public class SysOaFinanceController extends BaseController {
outMap.put("financeType", '0');
outMap.put("beginTime", firstDay);
outMap.put("endTime", lastDay);
outMap.put("payType",bo.getPayType());
BigDecimal financeOutReduce = iSysOaFinanceService.findFinanceByTime(bo, outMap);
//收入
@@ -153,6 +154,7 @@ public class SysOaFinanceController extends BaseController {
comeMap.put("financeType", '1');
comeMap.put("beginTime", firstDay);
comeMap.put("endTime", lastDay);
comeMap.put("payType",bo.getPayType());
BigDecimal financeComeReduce = iSysOaFinanceService.findFinanceByTime(bo, comeMap);
//收入减支出
BigDecimal subtract = financeComeReduce.subtract(financeOutReduce);

View File

@@ -77,6 +77,17 @@ public class SysOaProjectController extends BaseController {
return R.ok(iSysOaProjectService.queryById(projectId));
}
/**
* 获取项目管理详细信息
*
* @param projectId 主键
*/
@GetMapping("/projectDataByMonth")
public R<List<SysOaProjectVo>> getProjectDataByMonth() {
return R.ok(iSysOaProjectService.getProjectDataByMonth());
}
/**
* 新增项目管理
*/

View File

@@ -1,5 +1,6 @@
package com.ruoyi.oa.domain.bo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import lombok.Data;
@@ -9,6 +10,7 @@ import javax.validation.constraints.*;
import java.util.Date;
import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;
/**
* 文件存储业务对象 sys_oa_file
@@ -46,4 +48,11 @@ public class SysOaFileBo extends BaseEntity {
private String remark;
/**
* 查询月份
*/
private String queryCreateTime;
}

View File

@@ -4,6 +4,7 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.ruoyi.common.annotation.ExcelDictFormat;
import com.ruoyi.common.convert.ExcelDictConvert;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
@@ -17,7 +18,7 @@ import java.util.Date;
*/
@Data
@ExcelIgnoreUnannotated
public class SysOaFileVo {
public class SysOaFileVo extends BaseEntity {
private static final long serialVersionUID = 1L;
@@ -36,7 +37,7 @@ public class SysOaFileVo {
/**
* 文件类型0打卡1出入库
*/
@ExcelProperty(value = "文件类型0打卡1出入库", converter = ExcelDictConvert.class)
@ExcelProperty(value = "文件类型", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "file_status")
private Long status;

View File

@@ -191,4 +191,9 @@ public class SysOaProjectVo {
* 此项目数量 用户报工功能
*/
private Long count;
/**
* 人力资源成本
*/
private Double laborCost;
}

View File

@@ -12,6 +12,9 @@ import com.ruoyi.oa.domain.vo.SysOaProjectVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* 项目管理Mapper接口
*
@@ -23,4 +26,7 @@ public interface SysOaProjectMapper extends BaseMapperPlus<SysOaProjectMapper, S
Page<SysOaOutWarehouseListVo> selectPageOutList(@Param("page") Page<SysOaOutWarehouseListVo> page,@Param(Constants.WRAPPER) Wrapper<SysOaProject> queryWrapper);
List<SysOaProjectVo> getProjectDataByMonth(@Param("firstDay") Date firstDay, @Param("lastDay") Date lastDay);
}

View File

@@ -51,4 +51,11 @@ public interface ISysOaProjectService {
TableDataInfo<SysOaOutWarehouseListVo> queryOutWarePageList(SysOaOutWarehouseBo bo, PageQuery pageQuery);
/**
* 获取每个项目当月的人力资源成本(人天)
* @return
*/
List<SysOaProjectVo> getProjectDataByMonth();
}

View File

@@ -63,6 +63,7 @@ public class SysOaFileServiceImpl implements ISysOaFileService {
LambdaQueryWrapper<SysOaFile> lqw = Wrappers.lambdaQuery();
lqw.eq(StringUtils.isNotBlank(bo.getFileUrl()), SysOaFile::getFileUrl, bo.getFileUrl());
lqw.eq(bo.getStatus() != null, SysOaFile::getStatus, bo.getStatus());
lqw.like(bo.getQueryCreateTime() != null, SysOaFile::getCreateTime, bo.getQueryCreateTime());
return lqw;
}

View File

@@ -91,6 +91,7 @@ public class SysOaFinanceServiceImpl implements ISysOaFinanceService {
paramsMap.put("financeType", params.get("financeType"));
paramsMap.put("beginTime", params.get("beginTime"));
paramsMap.put("endTime", params.get("endTime"));
paramsMap.put("payType", params.get("payType"));
List<SysOaFinance> financeByTime = baseMapper.findFinanceByTime(paramsMap);
//遍历子表将价格遍历为数组并用map方法求和该方法类型使用map比较妥当
ArrayList<BigDecimal> objects = new ArrayList<>();

View File

@@ -2,6 +2,7 @@ package com.ruoyi.oa.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.domain.PageQuery;
@@ -127,6 +128,18 @@ public class SysOaProjectServiceImpl implements ISysOaProjectService {
return TableDataInfo.build(page);
}
/**
* 获取当月每个项目的人力资源成本
* @return
*/
@Override
public List<SysOaProjectVo> getProjectDataByMonth() {
Date date = new Date();
List<SysOaProjectVo> projectVos = baseMapper.getProjectDataByMonth(getFirstDay(date),getLastDay(date));
return projectVos;
}
private QueryWrapper<SysOaProject> buildOutWareQueryWrapper(SysOaOutWarehouseBo bo) {
QueryWrapper<SysOaProject> lqw = Wrappers.query();
lqw.like(StringUtils.isNotBlank(bo.getProjectName()), "sop.projec_name", bo.getProjectName());
@@ -134,4 +147,23 @@ public class SysOaProjectServiceImpl implements ISysOaProjectService {
lqw.orderByDesc("sop.create_time");
return lqw;
}
private Date getFirstDay(Date time){
String firstDay = DateUtils.parseDateToStr("yyyy-MM-01", time);
return DateUtils.parseDate(firstDay);
}
private Date getLastDay(Date time){
String format = "yyyy-MM-";
// 计算某月的天数
Calendar calendar = Calendar.getInstance();
calendar.setTime(time);
String dateLength = String.valueOf(calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
// 将字符串拼接
format +=dateLength;
return DateUtils.parseDate(DateUtils.parseDateToStr(format, time));
}
}

View File

@@ -105,6 +105,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="findFinanceByTime" resultMap="SysOaFinanceResult">
<include refid="selectFinanceVo" />
where a.finance_type = #{financeType}
<if test=" payType!=NULL and payType!=null and payType !='0' ">
and a.pay_type = #{payType}
</if>
and a.project_id = 0
and date_format(a.finance_time,'%Y-%m-%d %H:%i:%s') >= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
and date_format(a.finance_time,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')

View File

@@ -59,6 +59,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="count" column="count"/>
<result property="laborCost" column="labor_cost"/>
</resultMap>
@@ -87,7 +89,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
${ew.getCustomSqlSegment}
</select>
<select id="getProjectDataByMonth" resultType="com.ruoyi.oa.domain.vo.SysOaProjectVo">
select sum(soa.day_length+soa.hour/8) as labor_cost ,color,sop.project_name from sys_oa_project sop
left join sys_oa_attendance soa on sop.project_id = soa.project_id
where soa.create_time between #{firstDay} and #{lastDay}
and soa.del_flag = '0'
group by sop.project_id
</select>
</mapper>

View File

@@ -16,6 +16,13 @@ export function getProject(projectId) {
method: 'get'
})
}
// 查询项目管理详细
export function projectData() {
return request({
url: '/oa/project/projectDataByMonth',
method: 'get'
})
}
// 新增项目管理
export function addProject(data) {

View File

@@ -1,102 +1,134 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
<div :class="className" :style="{ height: height, width: width }" />
</template>
<script>
import * as echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
const animationDuration = 6000
import * as echarts from 'echarts';
require('echarts/theme/macarons'); // echarts theme
import resize from './mixins/resize';
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
default: 'chart',
},
width: {
type: String,
default: '100%'
default: '100%',
},
height: {
type: String,
default: '300px'
}
default: '800px',
},
projectList: {
type: Array,
required: true,
default: [
{ projectName: 'Project A', laborCost: 1500, color: '#7cb5ec' },
{ projectName: 'Project B', laborCost: 800, color: '#434348' },
{ projectName: 'Project C', laborCost: 1200, color: '#90ed7d' },
{ projectName: 'Project D', laborCost: 1800, color: '#f7a35c' },
{ projectName: 'Project E', laborCost: 600, color: '#8085e9' },
]
}, // 新增prop
},
data() {
return {
chart: null
}
chart: null,
colors: [], // 用于存储柱子颜色
laborCosts: [], // 用于存储人工成本数据
projectNames: [], // 用于存储项目名称
};
},
watch: {
projectList: {
handler(newVal) {
this.updateData(newVal);
this.setOption(); // 当projectList变化时更新图表选项
},
deep: true,
immediate: true, // 立即执行一次handler确保组件创建时也更新图表
},
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
this.initChart();
});
},
beforeDestroy() {
if (!this.chart) {
return
return;
}
this.chart.dispose()
this.chart = null
this.chart.dispose();
this.chart = null;
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.chart = echarts.init(this.$el, 'macarons');
this.updateData(this.projectList); // 初始化时更新数据
this.setOption(); // 设置图表选项
},
updateData(projectList) {
this.colors = projectList.map((item) => item.color);
this.laborCosts = projectList.map((item) => item.laborCost);
this.projectNames = projectList.map((item) => item.projectName.replace(/(.{5})/g, '$1\n'));
},
setOption() {
this.chart.setOption({
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
axisPointer: {type: 'shadow'},
},
grid: {
top: 10,
left: '2%',
right: '2%',
right: '8%', // 增加右边距以适应标签
bottom: '3%',
containLabel: true
containLabel: true,
},
xAxis: [{
xAxis: {
max: 'dataMax',
name: '人天', // 设置横坐标名称
nameLocation: 'middle', // 横坐标名称的位置
nameGap: 25, // 横坐标名称与轴线的距离
},
yAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisTick: {
alignWithLabel: true
data: this.projectNames,
inverse: true,
animationDuration: 300,
animationDurationUpdate: 300,
axisLabel: {
rotate: 45, // 设置标签旋转角度,正值表示顺时针旋转
interval: 0, // 强制显示所有标签
}
}],
yAxis: [{
type: 'value',
axisTick: {
show: false
}
}],
series: [{
name: 'pageA',
type: 'bar',
stack: 'vistors',
barWidth: '60%',
data: [79, 52, 200, 334, 390, 330, 220],
animationDuration
}, {
name: 'pageB',
type: 'bar',
stack: 'vistors',
barWidth: '60%',
data: [80, 52, 200, 334, 390, 330, 220],
animationDuration
}, {
name: 'pageC',
type: 'bar',
stack: 'vistors',
barWidth: '60%',
data: [30, 52, 200, 334, 390, 330, 220],
animationDuration
}]
})
}
}
}
},
series: [
{
realtimeSort: true,
type: 'bar',
data: this.laborCosts,
label: {
show: true,
position: 'right',
valueAnimation: true,
},
itemStyle: {
color: (params) => this.colors[params.dataIndex], // 应用颜色
},
},
],
legend: {
show: true,
},
animationDuration: 6000,
animationDurationUpdate: 3000,
animationEasing: 'linear',
animationEasingUpdate: 'linear',
});
},
},
};
</script>

View File

@@ -141,8 +141,6 @@ export default {
this.getListNotice()
},
methods: {
/** 查缓存询信息 */
getList() {
getCache().then((response) => {

View File

@@ -30,11 +30,14 @@
<tbody>
<tr v-for="(item,index) in userList">
<td :class="(item.userId===selectUser.userId || selectAll)?'selectBox':''">{{ item.nickName }}</td>
<td style="font-size: small" v-for="(item2,index2) in dateLength" @click="selectAttendDay(item,index,index2+1)"
<td style="font-size: small" v-for="(item2,index2) in dateLength"
@click="selectAttendDay(item,index,index2+1)"
:style="{backgroundColor:(item.attendances.length>0 && item.attendances.findIndex(i=>i.attendanceDay === index2+1) >-1) ?
(item.attendances[item.attendances.findIndex(i=>i.attendanceDay === index2+1)].projectId!==0?item.attendances[item.attendances.findIndex(i=>i.attendanceDay === index2+1)].color:'#fdf6e4'):
(index2+1===selectIndex&&(item.userId===selectUser.userId || selectAll)?'#f3ff52':'')}"
>{{item.attendances.length>0 && item.attendances.findIndex(i=>i.attendanceDay === index2+1) >-1 && item.attendances[item.attendances.findIndex(i=>i.attendanceDay === index2+1)].projectId===0?'出差':''}}</td>
>
{{ item.attendances.length > 0 && item.attendances.findIndex(i => i.attendanceDay === index2 + 1) > -1 && item.attendances[item.attendances.findIndex(i => i.attendanceDay === index2 + 1)].projectId === 0 ? '出差' : '' }}
</td>
</tr>
</tbody>
</table>
@@ -48,19 +51,19 @@
<el-button @click="removeAttendance" type="danger" plain>取消操作</el-button>
<el-button @click="toTravel" type="warning" plain>出差</el-button>
</el-card>
<el-card class="box-card" >
<el-card class="box-card">
<div slot="" class="">
<span><i class="el-icon-s-order"></i> 项目列表</span>
<!-- <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>-->
</div>
<div style="height: 250px;overflow: auto">
<div v-for="(item,index) in sortedProjects" style="display: flex;justify-content: space-between;">
<el-button class="text" :style="{backgroundColor:item.color===''?'':item.color}" @click="signIn(item)">
{{ item.projectName }}
</el-button>
<el-color-picker class="color-picker" v-model="item.color"
@change="changeItemColor(item)"></el-color-picker>
</div>
<div v-for="(item,index) in sortedProjects" style="display: flex;justify-content: space-between;">
<el-button class="text" :style="{backgroundColor:item.color===''?'':item.color}" @click="signIn(item)">
{{ item.projectName }}
</el-button>
<el-color-picker class="color-picker" v-model="item.color"
@change="changeItemColor(item)"></el-color-picker>
</div>
</div>
</el-card>
<el-card class="box-card">
@@ -99,8 +102,6 @@
<el-row :gutter="20" class="mb8">
<el-col :span="2">
<span class="demonstration">计算月份:</span>
</el-col>
<el-col :span="6">
@@ -119,47 +120,52 @@
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-table
:data="userList"
stripe
style="width: 100%">
<el-table
:data="userList"
stripe
style="width: 60%">
<el-table-column
type="index"
label="序号"
width="180">
</el-table-column>
<el-table-column
prop="nickName"
label="员工姓名"
width="180">
</el-table-column>
<el-table-column
type="index"
label="序号"
width="180">
</el-table-column>
<el-table-column
prop="nickName"
label="员工姓名"
width="180">
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
v-if="calcFlag"
@click="handleCalc(scope.row)"
v-hasPermi="['oa:oaWarehouse:edit']"
>查看考勤结果
</el-button>
<el-button
size="mini"
type="text"
v-else
disabled
icon="el-icon-edit"
@click="handleCalc(scope.row)"
v-hasPermi="['oa:oaWarehouse:edit']"
>请选择日期计算
</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="12">
<bar-chart :projectList="projects"></bar-chart>
</el-col>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
v-if="calcFlag"
@click="handleCalc(scope.row)"
v-hasPermi="['oa:oaWarehouse:edit']"
>查看考勤结果
</el-button>
<el-button
size="mini"
type="text"
v-else
disabled
icon="el-icon-edit"
@click="handleCalc(scope.row)"
v-hasPermi="['oa:oaWarehouse:edit']"
>请选择日期计算
</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
@@ -219,7 +225,7 @@
label="项目名"
width="180">
<template slot-scope="scope">
<div>{{scope.row.projectId===0?'出差':scope.row.projectName}}</div>
<div>{{ scope.row.projectId === 0 ? '出差' : scope.row.projectName }}</div>
</template>
</el-table-column>
<el-table-column
@@ -267,9 +273,12 @@ import {
delOaAttendanceAll
} from "../../../api/oa/oaAttendance";
import item from "../../../layout/components/Sidebar/Item.vue";
import BarChart from "../../dashboard/BarChart.vue";
import {projectData} from "../../../api/oa/project";
export default {
name: "Project",
components: {BarChart},
dicts: ['work_time_length', 'work_time_length_hour'],
data() {
return {
@@ -326,6 +335,7 @@ export default {
calcResultUser: {},
calcResultAttendances: [],
calcResultProject: {},
projects:[]
}
},
@@ -333,10 +343,12 @@ export default {
},
created() {
this.getDate();
this.getProjectData();
this.getList();
},
computed:{
computed: {
sortedProjects() {
let projectList = [...this.projectList];
projectList.sort((a, b) => {
@@ -350,8 +362,14 @@ export default {
methods: {
// 获取条形图数据
getProjectData(){
projectData().then(res => {
this.projects = res.data;
})
},
// 出差标记
toTravel(){
toTravel() {
if (!this.selectAll) {
this.form = {
projectId: 0,

View File

@@ -296,26 +296,156 @@
</el-col>
</el-row>
</el-tab-pane>
<el-tab-pane label="财务核算" name="third">
<el-tab-pane label="财务核算(日期)" name="third">
<el-row :gutter="20">
<el-col :span="24">
<div class="tip-top">
<div style="display: flex;justify-content: space-between">
<div style="display: flex;justify-content: center;align-items: center;white-space: nowrap">
<span> 日期检索</span>
<el-date-picker
v-model="value1"
type="daterange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@blur="getTimeBlur">
</el-date-picker>
</div>
<span class="sp1">收入</span>
<span class="sp2 cl2">¥ {{ checkByTime.income }} </span>
<span class="sp1">支出</span>
<span class="sp2 cl1"> ¥ {{ checkByTime.out }} </span>
<span class="sp1">核算</span>
<span class="sp2 cl3">¥{{ checkByTime.check }}</span>
</div>
</div>
</el-col>
<el-col :span="12">
<div class="tip">
本月核算情况
</div>
<div class="demo-shadow">
<el-row :gutter="5">
<el-col :span="8">
<div class="shadow-col">
<h4>本月收入</h4>
<p class="cl2">¥ {{ monthCheck.income }} </p>
</div>
</el-col>
<el-col :span="8">
<div class="shadow-col">
<h4>本月支出</h4>
<p class="cl1">¥ {{ monthCheck.out }} </p>
</div>
</el-col>
<el-col :span="8">
<div class="shadow-col">
<h4>本月核算</h4>
<p class="cl3">¥ {{ monthCheck.check }} </p>
</div>
</el-col>
</el-row>
</div>
</el-col>
<el-col :span="12">
<div class="tip">
本年核算情况
</div>
<div class="demo-shadow">
<el-row :gutter="5">
<el-col :span="8">
<div class="shadow-col">
<h4>本月收入</h4>
<p class="cl2">¥ {{ yearCheck.income }} </p>
</div>
</el-col>
<el-col :span="8">
<div class="shadow-col">
<h4>本月支出</h4>
<p class="cl1">¥ {{ yearCheck.out }} </p>
</div>
</el-col>
<el-col :span="8">
<div class="shadow-col">
<h4>本月核算</h4>
<p class="cl3">¥ {{ yearCheck.check }} </p>
</div>
</el-col>
</el-row>
</div>
</el-col>
<el-col :span="24">
<div class="date-col">
<el-table
:data="currentList"
style="width: 100%"
:header-cell-style="{background:'#50bfff',color:'#ffffff',fontSize:'18px', borderTopRightRadius: '5px', borderTopLeftRadius: '5px'}"
:row-class-name="tableRowClassName">
<el-table-column
prop="onMonth"
label="月份(近6个月)"
>
</el-table-column>
<el-table-column
prop="financeCome"
label="收入">
</el-table-column>
<el-table-column
prop="financeOut"
label="支出"
>
</el-table-column>
<el-table-column
prop="count"
label="核算">
</el-table-column>
</el-table>
</div>
</el-col>
</el-row>
</el-tab-pane>
<el-tab-pane label="财务核算(付款类型)" name="fourth">
<el-row :gutter="20">
<el-col :span="24">
<div class="tip-top">
<div style="display: flex;justify-content: space-between">
<div style="display: flex;justify-content: center;align-items: center;white-space: nowrap">
<span> 支付类型</span>
<el-select v-model="payType" placeholder="请选择付款类型" @change = "getFinanceDateByPayType">
<el-option
v-for="dict in dict.type.sys_pay_type"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</div>
<span class="sp1">收入</span>
<span class="sp2 cl2">¥ {{ checkByTime.income }} </span>
<span class="sp1">支出</span>
<span class="sp2 cl1"> ¥ {{ checkByTime.out }} </span>
<span class="sp1">核算</span>
<span class="sp2 cl3">¥{{ checkByTime.check }}</span>
</div>
按日期检索
<el-date-picker
v-model="value1"
type="daterange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@blur="getTimeBlur">
</el-date-picker>
<span class="sp1">收入</span>
<span class="sp2 cl2">¥ {{ checkByTime.income }} </span>
<span class="sp1">支出</span>
<span class="sp2 cl1"> ¥ {{ checkByTime.out }} </span>
<span class="sp1">核算</span>
<span class="sp2 cl3">¥{{ checkByTime.check }}</span>
</div>
</el-col>
@@ -629,6 +759,8 @@ export default {
dicts: ['sys_pay_type'],
data() {
return {
// 支付类型
payType:0,
// 按钮loading
buttonLoading: false,
// 遮罩层
@@ -745,6 +877,12 @@ export default {
},
methods: {
// 获取核算信息通过支付类型
getFinanceDateByPayType(){
this.getPayTypeBlur()
this.currentBlur()
this.currentBlurList()
},
updateBigPrice(index, row) {
@@ -809,7 +947,6 @@ export default {
getListFinance(type) {
this.loading = true;
/*let data = {
financeType: type,
@@ -860,6 +997,7 @@ export default {
//tabs选项卡
handleClick(tab, event) {
this.nowTab = tab.index
this.payType=0
if (tab.index == '0') {
this.getListFinance('1');
}
@@ -870,6 +1008,10 @@ export default {
this.currentBlur()
this.currentBlurList()
}
if (tab.index == '3') {
this.currentBlur()
this.currentBlurList()
}
},
// 表单重置
reset() {
@@ -1168,13 +1310,30 @@ export default {
let endTime = e.displayValue[1] + ' 23:59:59'
let dataCome = {
beginTime: beginTime,
endTime: endTime
endTime: endTime,
payType: this.payType,
}
findFinance(dataCome).then(res => {
this.checkByTime = res.data;
})
},
getPayTypeBlur(){
let now = new Date()
var nowMonth = new Date(now.getFullYear(), now.getMonth(), 1); // 获取本月第一天的日期时间时间为0:0:0
var monthEnd = new Date(now.getFullYear(), now.getMonth() + 1, 0, 23, 59, 59); // 获取本月最后一天的日期时间时间为23:59:59
//本月收入参数
let dataCome = {
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,
}
findFinance(dataCome).then(res => {
this.checkByTime = res.data;
})
},
/**
* 本年本月核算情况
*/
@@ -1187,6 +1346,7 @@ export default {
let dataCome = {
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,
}
//本月核算
findFinance(dataCome).then(res => {
@@ -1206,13 +1366,12 @@ export default {
let yearDataCome = {
beginTime: Vue.prototype.parseTime(startDate, '{y}-{m}-{d} {h}:{i}:{s}'),
endTime: Vue.prototype.parseTime(endDate, '{y}-{m}-{d} {h}:{i}:{s}'),
payType: this.payType,
}
//本年核算
findFinance(yearDataCome).then(res => {
this.yearCheck = res.data;
})
},
/**
* 最近六个月核算情况如果显示更多月份请修改控制器int[] integers = {0,1, 2, 3, 4, 5};
@@ -1410,14 +1569,18 @@ export default {
}
.tip-top .sp1 {
margin-left: 100px;
white-space: nowrap;
font-size: 18px;
overflow: hidden;
color: #999999;
text-overflow: ellipsis;
}
.tip-top .sp2 {
margin-right: 100px;
font-size: 32px;
font-size: 16px;
}
.date-col {

View File

@@ -1,15 +1,13 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="文件类型" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择文件类型" clearable>
<el-option
v-for="dict in dict.type.file_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-form-item label="文件类型" prop="queryCreateTime">
<el-date-picker
v-model="queryParams.queryCreateTime"
type="month"
value-format="yyyy-MM"
placeholder="选择时间">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -26,18 +24,8 @@
size="mini"
@click="handleAdd"
v-hasPermi="['system:oaFile:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:oaFile:edit']"
>修改</el-button>
>上传
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
@@ -48,46 +36,49 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:oaFile:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:oaFile:export']"
>导出</el-button>
>删除
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="oaFileList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="文件名称" align="center" prop="fileUrl" />
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="文件描述" align="center" prop="remark"/>
<el-table-column label="文件来源" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.file_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="上传时间" align="center" prop="createTime"/>
<el-table-column label="上传用户" align="center" prop="createBy"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-download"
@click="handleDownload(scope.row)"
>下载
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:oaFile:edit']"
>修改</el-button>
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:oaFile:remove']"
>删除</el-button>
>删除
</el-button>
</template>
</el-table-column>
</el-table>
@@ -107,7 +98,7 @@
<file-upload v-model="form.fileUrl"/>
</el-form-item>
<el-form-item label="文件类型" prop="status">
<el-select v-model="form.status" placeholder="请选择文件类型" disabled>
<el-select v-model="form.status" placeholder="请选择文件类型" disabled>
<el-option
v-for="dict in dict.type.file_status"
:key="dict.value"
@@ -117,8 +108,8 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
<el-form-item label="文件描述" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入文件描述如12月打卡表"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -130,7 +121,7 @@
</template>
<script>
import { listOaFile, getOaFile, delOaFile, addOaFile, updateOaFile } from "@/api/oa/oaFile";
import {listOaFile, getOaFile, delOaFile, addOaFile, updateOaFile} from "@/api/oa/oaFile";
export default {
name: "OaFile",
@@ -168,6 +159,9 @@ export default {
form: {},
// 表单校验
rules: {
remark: [
{ required: true, message: "文件描述不能为空", trigger: "blur" }
]
}
};
},
@@ -176,10 +170,10 @@ export default {
},
methods: {
// 截断最后一个斜杠的数字
lastStr(str){
lastStr(str) {
let index = str.lastIndexOf("\/");
str = parseInt(str.substring(index + 1, str .length));
this.queryParams.status= str
str = parseInt(str.substring(index + 1, str.length));
this.queryParams.status = str
this.form.status = str
},
@@ -227,7 +221,7 @@ export default {
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.fileId)
this.single = selection.length!==1
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
@@ -293,6 +287,10 @@ export default {
this.download('system/oaFile/export', {
...this.queryParams
}, `oaFile_${new Date().getTime()}.xlsx`)
},
handleDownload(row) {
this.$download.resource(row.fileUrl);
this.$modal.msgSuccess("操作成功");
}
}
};