diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/controller/SysOaFinanceController.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/controller/SysOaFinanceController.java index 74b6275..21d2bde 100644 --- a/ruoyi-oa/src/main/java/com/ruoyi/oa/controller/SysOaFinanceController.java +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/controller/SysOaFinanceController.java @@ -88,8 +88,6 @@ public class SysOaFinanceController extends BaseController { BigDecimal finance0 = iSysOaFinanceService.findFinanceByTime(bo, params0); - - Map ajax = new HashMap<>(); ajax.put("income", finance1); ajax.put("out", finance0); @@ -155,6 +153,7 @@ public class SysOaFinanceController extends BaseController { outMap.put("beginTime", firstDay); outMap.put("endTime", lastDay); outMap.put("payType",bo.getPayType()); + outMap.put("receiveAccountId",bo.getReceiveAccountId()); BigDecimal financeOutReduce = iSysOaFinanceService.findFinanceByTime(bo, outMap); //收入 @@ -163,6 +162,7 @@ public class SysOaFinanceController extends BaseController { comeMap.put("beginTime", firstDay); comeMap.put("endTime", lastDay); comeMap.put("payType",bo.getPayType()); + comeMap.put("receiveAccountId",bo.getReceiveAccountId()); BigDecimal financeComeReduce = iSysOaFinanceService.findFinanceByTime(bo, comeMap); //收入减支出 BigDecimal subtract = financeComeReduce.subtract(financeOutReduce); diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/mapper/SysOaFinanceMapper.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/mapper/SysOaFinanceMapper.java index 9dc1581..84bb8ea 100644 --- a/ruoyi-oa/src/main/java/com/ruoyi/oa/mapper/SysOaFinanceMapper.java +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/mapper/SysOaFinanceMapper.java @@ -62,6 +62,7 @@ public interface SysOaFinanceMapper extends BaseMapperPlus findFinanceByTime(Map params); /** diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SysOaAttendanceServiceImpl.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SysOaAttendanceServiceImpl.java index 6c9bd8e..23eafb0 100644 --- a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SysOaAttendanceServiceImpl.java +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SysOaAttendanceServiceImpl.java @@ -23,6 +23,7 @@ import com.ruoyi.oa.domain.SysOaAttendance; import com.ruoyi.oa.mapper.SysOaAttendanceMapper; import com.ruoyi.oa.service.ISysOaAttendanceService; +import javax.validation.constraints.NotNull; import java.util.*; import java.util.stream.Collectors; @@ -97,16 +98,14 @@ public class SysOaAttendanceServiceImpl implements ISysOaAttendanceService { sysOaAttendanceBo.setProjectId(null); // 如果这个时间为空,则默认查询当月记录 Date firstDay; - Date lastDay; - if (Objects.isNull(bo.getSelectTime())) { - firstDay = getFirstDay(new Date()); + Date lastDay = getLastDay(bo.getSelectTime()); + List sysOaAttendanceVos; - } else { - firstDay = getFirstDay(bo.getSelectTime()); - } - lastDay = getLastDay(firstDay); - List sysOaAttendanceVos = baseMapper.queryListByTime(sysOaAttendanceBo.getUserId(), sysOaAttendanceBo.getAttendanceDay(), firstDay, lastDay); + Date day = getFirstDay(bo.getSelectTime()); + firstDay = getFormatDay(bo.getSelectTime(), bo.getAttendanceDay()); + + sysOaAttendanceVos = baseMapper.queryListByTime(sysOaAttendanceBo.getUserId(), sysOaAttendanceBo.getAttendanceDay(), day, lastDay); if (sysOaAttendanceVos.isEmpty()) { bo.setCreateTime(firstDay); @@ -120,7 +119,11 @@ public class SysOaAttendanceServiceImpl implements ISysOaAttendanceService { } else { SysOaAttendanceVo sysOaAttendanceVo = sysOaAttendanceVos.get(0); sysOaAttendanceVo.setProjectId(bo.getProjectId()); + sysOaAttendanceVo.setCreateTime(firstDay); sysOaAttendanceVo.setDelFlag(0L); + sysOaAttendanceVo.setDayLength(bo.getDayLength()!=null?bo.getDayLength():0); + sysOaAttendanceVo.setHour(bo.getHour()!=null?bo.getHour():0); + return baseMapper.updateDelAttendance(BeanUtil.toBean(sysOaAttendanceVo, SysOaAttendance.class)) > 0; } @@ -260,6 +263,11 @@ public class SysOaAttendanceServiceImpl implements ISysOaAttendanceService { return DateUtils.parseDate(firstDay); } + private Date getFormatDay(Date time, Long attendanceDay) { + String firstDay = DateUtils.parseDateToStr("yyyy-MM-" + attendanceDay, time); + return DateUtils.parseDate(firstDay); + } + private Date getLastDay(Date time) { String format = "yyyy-MM-"; // 计算某月的天数 diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SysOaFinanceServiceImpl.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SysOaFinanceServiceImpl.java index 6e89baa..529c2ca 100644 --- a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SysOaFinanceServiceImpl.java +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SysOaFinanceServiceImpl.java @@ -92,6 +92,7 @@ public class SysOaFinanceServiceImpl implements ISysOaFinanceService { paramsMap.put("beginTime", params.get("beginTime")); paramsMap.put("endTime", params.get("endTime")); paramsMap.put("payType", params.get("payType")); + paramsMap.put("receiveAccountId",params.get("receiveAccountId")); List financeByTime = baseMapper.findFinanceByTime(paramsMap); //遍历子表,将价格遍历为数组并用map方法求和,该方法类型使用map比较妥当 ArrayList objects = new ArrayList<>(); diff --git a/ruoyi-oa/src/main/resources/mapper/oa/SysOaAttendanceMapper.xml b/ruoyi-oa/src/main/resources/mapper/oa/SysOaAttendanceMapper.xml index 657aca1..eecbeed 100644 --- a/ruoyi-oa/src/main/resources/mapper/oa/SysOaAttendanceMapper.xml +++ b/ruoyi-oa/src/main/resources/mapper/oa/SysOaAttendanceMapper.xml @@ -82,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update fad_oa.sys_oa_attendance - project_id=#{projectId}, + project_id=#{projectId}, user_id = #{userId}, attendance_day = #{attendanceDay}, update_time = #{updateTime}, @@ -90,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" del_flag = #{delFlag}, day_length = #{dayLength}, hour = #{hour}, + create_time = #{createTime}, where id = #{id} diff --git a/ruoyi-oa/src/main/resources/mapper/oa/SysOaFinanceMapper.xml b/ruoyi-oa/src/main/resources/mapper/oa/SysOaFinanceMapper.xml index a4b9d7a..6bccc2e 100644 --- a/ruoyi-oa/src/main/resources/mapper/oa/SysOaFinanceMapper.xml +++ b/ruoyi-oa/src/main/resources/mapper/oa/SysOaFinanceMapper.xml @@ -161,9 +161,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select sop.project_id, project_name,soow.warehouse_id,soow.id as soow_id,soow.amount,soow.create_time as out_create_time,sow.name + select sop.project_id, + project_name, + soow.warehouse_id, + soow.id as soow_id, + soow.amount, + soow.create_time as out_create_time, + sow.name from sys_oa_project sop left join sys_oa_out_warehouse soow on soow.project_id = sop.project_id left join sys_oa_warehouse sow on sow.id = soow.warehouse_id @@ -90,21 +96,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - diff --git a/ruoyi-ui/src/components/FinancialCharts/index.vue b/ruoyi-ui/src/components/FinancialCharts/index.vue index ab964b5..b8d8511 100644 --- a/ruoyi-ui/src/components/FinancialCharts/index.vue +++ b/ruoyi-ui/src/components/FinancialCharts/index.vue @@ -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 = { diff --git a/ruoyi-ui/src/views/oa/attendance/index.vue b/ruoyi-ui/src/views/oa/attendance/index.vue index d706b7c..bddfdec 100644 --- a/ruoyi-ui/src/views/oa/attendance/index.vue +++ b/ruoyi-ui/src/views/oa/attendance/index.vue @@ -231,7 +231,7 @@ -

{{ date.getMonth() }} 月度工作签到情况

+

{{ date.getMonth()+1 }} 月度工作签到情况

@@ -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 { diff --git a/ruoyi-ui/src/views/oa/finance/index.vue b/ruoyi-ui/src/views/oa/finance/index.vue index 1cba995..4cce8fb 100644 --- a/ruoyi-ui/src/views/oa/finance/index.vue +++ b/ruoyi-ui/src/views/oa/finance/index.vue @@ -433,7 +433,6 @@ v-for="dict in dict.type.sys_pay_type" :key="dict.value" :label="dict.label" - :value="parseInt(dict.value)" > @@ -547,6 +546,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -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; +}