diff --git a/web-api/src/main/java/com/jeesite/modules/erp/dao/ErpCategoryFlowDao.java b/web-api/src/main/java/com/jeesite/modules/erp/dao/ErpCategoryFlowDao.java new file mode 100644 index 00000000..7c328a11 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/erp/dao/ErpCategoryFlowDao.java @@ -0,0 +1,15 @@ +package com.jeesite.modules.erp.dao; + +import com.jeesite.common.dao.CrudDao; +import com.jeesite.common.mybatis.annotation.MyBatisDao; +import com.jeesite.modules.erp.entity.ErpCategoryFlow; + +/** + * erp_category_flowDAO接口 + * @author gaoxq + * @version 2025-12-13 + */ +@MyBatisDao(dataSourceName="work") +public interface ErpCategoryFlowDao extends CrudDao { + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/erp/dao/ErpIncExpRatioDao.java b/web-api/src/main/java/com/jeesite/modules/erp/dao/ErpIncExpRatioDao.java new file mode 100644 index 00000000..49c7f6bb --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/erp/dao/ErpIncExpRatioDao.java @@ -0,0 +1,15 @@ +package com.jeesite.modules.erp.dao; + +import com.jeesite.common.dao.CrudDao; +import com.jeesite.common.mybatis.annotation.MyBatisDao; +import com.jeesite.modules.erp.entity.ErpIncExpRatio; + +/** + * 支出占比DAO接口 + * @author gaoxq + * @version 2025-12-13 + */ +@MyBatisDao(dataSourceName="work") +public interface ErpIncExpRatioDao extends CrudDao { + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/erp/entity/ErpCategoryFlow.java b/web-api/src/main/java/com/jeesite/modules/erp/entity/ErpCategoryFlow.java new file mode 100644 index 00000000..4096e34f --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/erp/entity/ErpCategoryFlow.java @@ -0,0 +1,72 @@ +package com.jeesite.modules.erp.entity; + + +import com.jeesite.common.entity.DataEntity; +import com.jeesite.common.mybatis.annotation.Column; +import com.jeesite.common.mybatis.annotation.Table; +import com.jeesite.common.mybatis.mapper.query.QueryType; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; +import java.io.Serializable; + +/** + * erp_category_flowEntity + * + * @author gaoxq + * @version 2025-12-13 + */ +@EqualsAndHashCode(callSuper = true) +@Table(name = "erp_category_flow_view", alias = "a", label = "用途信息", columns = { + @Column(name = "cycle_type", attrName = "cycleType", label = "cycle_type"), + @Column(name = "category_name", attrName = "categoryName", label = "分类名称", queryType = QueryType.LIKE), + @Column(name = "stat_date", attrName = "statDate", label = "stat_date"), + @Column(name = "this_income", attrName = "thisIncome", label = "this_income"), + @Column(name = "prev_income", attrName = "prevIncome", label = "prev_income"), + @Column(name = "income_mom", attrName = "incomeMom", label = "income_mom", isUpdateForce = true), + @Column(name = "this_expense", attrName = "thisExpense", label = "this_expense"), + @Column(name = "prev_expense", attrName = "prevExpense", label = "prev_expense"), + @Column(name = "expense_mom", attrName = "expenseMom", label = "expense_mom", isUpdateForce = true), +}, orderBy = "a.stat_date" +) +@Data +public class ErpCategoryFlow extends DataEntity implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + private String cycleType; // cycle_type + private String categoryName; // 分类名称 + private String statDate; // 交易日期 + private Double thisIncome; // 本期收入 + private Double prevIncome; // 上期收入 + private Double incomeMom; // 收入环比 + private Double thisExpense; // 本期支出 + private Double prevExpense; // 上期支出 + private Double expenseMom; // 支出环比 + + public ErpCategoryFlow() { + this(null); + } + + public ErpCategoryFlow(String id) { + super(id); + } + + + public String getStatDate_gte() { + return sqlMap.getWhere().getValue("stat_date", QueryType.GTE); + } + + public void setStatDate_gte(String statDate) { + sqlMap.getWhere().and("stat_date", QueryType.GTE, statDate); + } + + public String getStatDate_lte() { + return sqlMap.getWhere().getValue("stat_date", QueryType.LTE); + } + + public void setStatDate_lte(String statDate) { + sqlMap.getWhere().and("stat_date", QueryType.LTE, statDate); + } +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/erp/entity/ErpIncExpRatio.java b/web-api/src/main/java/com/jeesite/modules/erp/entity/ErpIncExpRatio.java new file mode 100644 index 00000000..e036cc9f --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/erp/entity/ErpIncExpRatio.java @@ -0,0 +1,68 @@ +package com.jeesite.modules.erp.entity; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; +import jakarta.validation.constraints.NotNull; + +import com.jeesite.common.entity.DataEntity; +import com.jeesite.common.mybatis.annotation.Column; +import com.jeesite.common.mybatis.annotation.Table; +import com.jeesite.common.mybatis.mapper.query.QueryType; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; +import java.io.Serializable; + +/** + * 支出占比Entity + * + * @author gaoxq + * @version 2025-12-13 + */ +@EqualsAndHashCode(callSuper = true) +@Table(name = "erp_inc_exp_ratio_view", alias = "a", label = "支出占比信息", columns = { + @Column(name = "cycle_type", attrName = "cycleType", label = "cycle_type"), + @Column(name = "stat_date", attrName = "statDate", label = "stat_date"), + @Column(name = "income_amount", attrName = "incomeAmount", label = "income_amount", isUpdateForce = true), + @Column(name = "expense_amount", attrName = "expenseAmount", label = "expense_amount", isUpdateForce = true), + @Column(name = "expense_ratio", attrName = "expenseRatio", label = "expense_ratio"), +}, orderBy = "a.stat_date" +) +@Data +public class ErpIncExpRatio extends DataEntity implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + private String cycleType; // cycle_type + private String statDate; // 日期 + private Double incomeAmount; // 收入 + private Double expenseAmount; // 支出 + private Double expenseRatio; // 占比 + + public ErpIncExpRatio() { + this(null); + } + + public ErpIncExpRatio(String id) { + super(id); + } + + public String getStatDate_gte() { + return sqlMap.getWhere().getValue("stat_date", QueryType.GTE); + } + + public void setStatDate_gte(String statDate) { + sqlMap.getWhere().and("stat_date", QueryType.GTE, statDate); + } + + public String getStatDate_lte() { + return sqlMap.getWhere().getValue("stat_date", QueryType.LTE); + } + + public void setStatDate_lte(String statDate) { + sqlMap.getWhere().and("stat_date", QueryType.LTE, statDate); + } +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/erp/entity/ErpSummaryAll.java b/web-api/src/main/java/com/jeesite/modules/erp/entity/ErpSummaryAll.java index ff5e9c58..fac29257 100644 --- a/web-api/src/main/java/com/jeesite/modules/erp/entity/ErpSummaryAll.java +++ b/web-api/src/main/java/com/jeesite/modules/erp/entity/ErpSummaryAll.java @@ -28,7 +28,7 @@ import java.io.Serial; @Column(name = "this_value", attrName = "thisValue", label = "当期金额", isQuery = false, isUpdateForce = true), @Column(name = "prev_value", attrName = "prevValue", label = "上期金额", isQuery = false, isUpdateForce = true), @Column(name = "mom_rate", attrName = "momRate", label = "环比", isQuery = false, isUpdateForce = true), - @Column(name = "f_cycle", attrName = "fcycle", label = "周期类型"), + @Column(name = "cycle_type", attrName = "cycleType", label = "周期类型"), }, orderBy = "a.c_date" ) @Data @@ -42,7 +42,7 @@ public class ErpSummaryAll extends DataEntity implements Serializ private Double thisValue; // 当期金额 private Double prevValue; // 上期金额 private Double momRate; // 环比 - private String fcycle; // 周期类型 + private String cycleType; // 周期类型 @ExcelFields({ @ExcelField(title = "记录时间", attrName = "createTime", align = Align.CENTER, sort = 10, dataFormat = "yyyy-MM-dd hh:mm"), @@ -52,7 +52,7 @@ public class ErpSummaryAll extends DataEntity implements Serializ @ExcelField(title = "当期金额", attrName = "thisValue", align = Align.CENTER, sort = 50), @ExcelField(title = "上期金额", attrName = "prevValue", align = Align.CENTER, sort = 60), @ExcelField(title = "环比", attrName = "momRate", align = Align.CENTER, sort = 70), - @ExcelField(title = "周期类型", attrName = "fcycle", dictType = "report_cycle", align = Align.CENTER, sort = 80), + @ExcelField(title = "周期类型", attrName = "cycleType", dictType = "report_cycle", align = Align.CENTER, sort = 80), }) public ErpSummaryAll() { this(null); diff --git a/web-api/src/main/java/com/jeesite/modules/erp/service/ErpCategoryFlowService.java b/web-api/src/main/java/com/jeesite/modules/erp/service/ErpCategoryFlowService.java new file mode 100644 index 00000000..cb31fec6 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/erp/service/ErpCategoryFlowService.java @@ -0,0 +1,79 @@ +package com.jeesite.modules.erp.service; + +import java.util.List; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.jeesite.common.entity.Page; +import com.jeesite.common.service.CrudService; +import com.jeesite.modules.erp.entity.ErpCategoryFlow; +import com.jeesite.modules.erp.dao.ErpCategoryFlowDao; + +/** + * erp_category_flowService + * @author gaoxq + * @version 2025-12-13 + */ +@Service +public class ErpCategoryFlowService extends CrudService { + + /** + * 获取单条数据 + * @param erpCategoryFlow 主键 + */ + @Override + public ErpCategoryFlow get(ErpCategoryFlow erpCategoryFlow) { + return super.get(erpCategoryFlow); + } + + /** + * 查询分页数据 + * @param erpCategoryFlow 查询条件 + * @param erpCategoryFlow page 分页对象 + */ + @Override + public Page findPage(ErpCategoryFlow erpCategoryFlow) { + return super.findPage(erpCategoryFlow); + } + + /** + * 查询列表数据 + * @param erpCategoryFlow 查询条件 + */ + @Override + public List findList(ErpCategoryFlow erpCategoryFlow) { + return super.findList(erpCategoryFlow); + } + + /** + * 保存数据(插入或更新) + * @param erpCategoryFlow 数据对象 + */ + @Override + @Transactional + public void save(ErpCategoryFlow erpCategoryFlow) { + super.save(erpCategoryFlow); + } + + /** + * 更新状态 + * @param erpCategoryFlow 数据对象 + */ + @Override + @Transactional + public void updateStatus(ErpCategoryFlow erpCategoryFlow) { + super.updateStatus(erpCategoryFlow); + } + + /** + * 删除数据 + * @param erpCategoryFlow 数据对象 + */ + @Override + @Transactional + public void delete(ErpCategoryFlow erpCategoryFlow) { + erpCategoryFlow.sqlMap().markIdDelete(); // 逻辑删除时标记ID值 + super.delete(erpCategoryFlow); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/erp/service/ErpIncExpRatioService.java b/web-api/src/main/java/com/jeesite/modules/erp/service/ErpIncExpRatioService.java new file mode 100644 index 00000000..3e09327c --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/erp/service/ErpIncExpRatioService.java @@ -0,0 +1,79 @@ +package com.jeesite.modules.erp.service; + +import java.util.List; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.jeesite.common.entity.Page; +import com.jeesite.common.service.CrudService; +import com.jeesite.modules.erp.entity.ErpIncExpRatio; +import com.jeesite.modules.erp.dao.ErpIncExpRatioDao; + +/** + * 支出占比Service + * @author gaoxq + * @version 2025-12-13 + */ +@Service +public class ErpIncExpRatioService extends CrudService { + + /** + * 获取单条数据 + * @param erpIncExpRatio 主键 + */ + @Override + public ErpIncExpRatio get(ErpIncExpRatio erpIncExpRatio) { + return super.get(erpIncExpRatio); + } + + /** + * 查询分页数据 + * @param erpIncExpRatio 查询条件 + * @param erpIncExpRatio page 分页对象 + */ + @Override + public Page findPage(ErpIncExpRatio erpIncExpRatio) { + return super.findPage(erpIncExpRatio); + } + + /** + * 查询列表数据 + * @param erpIncExpRatio 查询条件 + */ + @Override + public List findList(ErpIncExpRatio erpIncExpRatio) { + return super.findList(erpIncExpRatio); + } + + /** + * 保存数据(插入或更新) + * @param erpIncExpRatio 数据对象 + */ + @Override + @Transactional + public void save(ErpIncExpRatio erpIncExpRatio) { + super.save(erpIncExpRatio); + } + + /** + * 更新状态 + * @param erpIncExpRatio 数据对象 + */ + @Override + @Transactional + public void updateStatus(ErpIncExpRatio erpIncExpRatio) { + super.updateStatus(erpIncExpRatio); + } + + /** + * 删除数据 + * @param erpIncExpRatio 数据对象 + */ + @Override + @Transactional + public void delete(ErpIncExpRatio erpIncExpRatio) { + erpIncExpRatio.sqlMap().markIdDelete(); // 逻辑删除时标记ID值 + super.delete(erpIncExpRatio); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/erp/web/ErpCategoryFlowController.java b/web-api/src/main/java/com/jeesite/modules/erp/web/ErpCategoryFlowController.java new file mode 100644 index 00000000..ce58435b --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/erp/web/ErpCategoryFlowController.java @@ -0,0 +1,110 @@ +package com.jeesite.modules.erp.web; + +import com.jeesite.modules.app.utils.vDate; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.jeesite.common.config.Global; +import com.jeesite.common.entity.Page; +import com.jeesite.common.web.BaseController; +import com.jeesite.modules.erp.entity.ErpCategoryFlow; +import com.jeesite.modules.erp.service.ErpCategoryFlowService; + +import java.util.List; + +/** + * erp_category_flowController + * + * @author gaoxq + * @version 2025-12-13 + */ +@Controller +@RequestMapping(value = "${adminPath}/erp/categoryFlow") +public class ErpCategoryFlowController extends BaseController { + + private final ErpCategoryFlowService erpCategoryFlowService; + + public ErpCategoryFlowController(ErpCategoryFlowService erpCategoryFlowService) { + this.erpCategoryFlowService = erpCategoryFlowService; + } + + /** + * 获取数据 + */ + @ModelAttribute + public ErpCategoryFlow get(Long id, boolean isNewRecord) { + return erpCategoryFlowService.get(id, isNewRecord); + } + + /** + * 查询列表 + */ + @RequiresPermissions("erp:categoryFlow:view") + @RequestMapping(value = {"list", ""}) + public String list(ErpCategoryFlow erpCategoryFlow, Model model) { + model.addAttribute("erpCategoryFlow", erpCategoryFlow); + return "modules/erp/erpCategoryFlowList"; + } + + /** + * 查询列表数据 + */ + @RequiresPermissions("erp:categoryFlow:view") + @RequestMapping(value = "listData") + @ResponseBody + public Page listData(ErpCategoryFlow erpCategoryFlow, HttpServletRequest request, HttpServletResponse response) { + erpCategoryFlow.setPage(new Page<>(request, response)); + Page page = erpCategoryFlowService.findPage(erpCategoryFlow); + return page; + } + + /** + * 查看编辑表单 + */ + @RequiresPermissions("erp:categoryFlow:view") + @RequestMapping(value = "form") + public String form(ErpCategoryFlow erpCategoryFlow, Model model) { + model.addAttribute("erpCategoryFlow", erpCategoryFlow); + return "modules/erp/erpCategoryFlowForm"; + } + + /** + * 保存数据 + */ + @RequiresPermissions("erp:categoryFlow:edit") + @PostMapping(value = "save") + @ResponseBody + public String save(@Validated ErpCategoryFlow erpCategoryFlow) { + erpCategoryFlowService.save(erpCategoryFlow); + return renderResult(Global.TRUE, text("保存用途信息成功!")); + } + + /** + * 删除数据 + */ + @RequiresPermissions("erp:categoryFlow:edit") + @RequestMapping(value = "delete") + @ResponseBody + public String delete(ErpCategoryFlow erpCategoryFlow) { + erpCategoryFlowService.delete(erpCategoryFlow); + return renderResult(Global.TRUE, text("删除用途信息成功!")); + } + + + @RequestMapping(value = "listAll") + @ResponseBody + public List listAll(ErpCategoryFlow erpCategoryFlow) { + erpCategoryFlow.setStatDate_gte(vDate.calculateStartCycleCode(erpCategoryFlow.getCycleType())); + return erpCategoryFlowService.findList(erpCategoryFlow); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/erp/web/ErpIncExpRatioController.java b/web-api/src/main/java/com/jeesite/modules/erp/web/ErpIncExpRatioController.java new file mode 100644 index 00000000..e9630204 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/erp/web/ErpIncExpRatioController.java @@ -0,0 +1,108 @@ +package com.jeesite.modules.erp.web; + +import com.jeesite.modules.app.utils.vDate; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.jeesite.common.config.Global; +import com.jeesite.common.entity.Page; +import com.jeesite.common.web.BaseController; +import com.jeesite.modules.erp.entity.ErpIncExpRatio; +import com.jeesite.modules.erp.service.ErpIncExpRatioService; + +import java.util.List; + +/** + * 支出占比Controller + * + * @author gaoxq + * @version 2025-12-13 + */ +@Controller +@RequestMapping(value = "${adminPath}/erp/incExpRatio") +public class ErpIncExpRatioController extends BaseController { + + private final ErpIncExpRatioService erpIncExpRatioService; + + public ErpIncExpRatioController(ErpIncExpRatioService erpIncExpRatioService) { + this.erpIncExpRatioService = erpIncExpRatioService; + } + + /** + * 获取数据 + */ + @ModelAttribute + public ErpIncExpRatio get(Long id, boolean isNewRecord) { + return erpIncExpRatioService.get(id, isNewRecord); + } + + /** + * 查询列表 + */ + @RequiresPermissions("erp:incExpRatio:view") + @RequestMapping(value = {"list", ""}) + public String list(ErpIncExpRatio erpIncExpRatio, Model model) { + model.addAttribute("erpIncExpRatio", erpIncExpRatio); + return "modules/erp/erpIncExpRatioList"; + } + + /** + * 查询列表数据 + */ + @RequiresPermissions("erp:incExpRatio:view") + @RequestMapping(value = "listData") + @ResponseBody + public Page listData(ErpIncExpRatio erpIncExpRatio, HttpServletRequest request, HttpServletResponse response) { + erpIncExpRatio.setPage(new Page<>(request, response)); + Page page = erpIncExpRatioService.findPage(erpIncExpRatio); + return page; + } + + /** + * 查看编辑表单 + */ + @RequiresPermissions("erp:incExpRatio:view") + @RequestMapping(value = "form") + public String form(ErpIncExpRatio erpIncExpRatio, Model model) { + model.addAttribute("erpIncExpRatio", erpIncExpRatio); + return "modules/erp/erpIncExpRatioForm"; + } + + /** + * 保存数据 + */ + @RequiresPermissions("erp:incExpRatio:edit") + @PostMapping(value = "save") + @ResponseBody + public String save(@Validated ErpIncExpRatio erpIncExpRatio) { + erpIncExpRatioService.save(erpIncExpRatio); + return renderResult(Global.TRUE, text("保存支出占比成功!")); + } + + /** + * 删除数据 + */ + @RequiresPermissions("erp:incExpRatio:edit") + @RequestMapping(value = "delete") + @ResponseBody + public String delete(ErpIncExpRatio erpIncExpRatio) { + erpIncExpRatioService.delete(erpIncExpRatio); + return renderResult(Global.TRUE, text("删除支出占比成功!")); + } + + @RequestMapping(value = "listAll") + @ResponseBody + public List listAll(ErpIncExpRatio erpIncExpRatio) { + erpIncExpRatio.setStatDate_gte(vDate.calculateStartCycleCode(erpIncExpRatio.getCycleType())); + return erpIncExpRatioService.findList(erpIncExpRatio); + } +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/erp/web/ErpSummaryAllController.java b/web-api/src/main/java/com/jeesite/modules/erp/web/ErpSummaryAllController.java index 92c1b1a3..b31ad59f 100644 --- a/web-api/src/main/java/com/jeesite/modules/erp/web/ErpSummaryAllController.java +++ b/web-api/src/main/java/com/jeesite/modules/erp/web/ErpSummaryAllController.java @@ -150,7 +150,7 @@ public class ErpSummaryAllController extends BaseController { @RequestMapping(value = "listAll") @ResponseBody public List listAll(ErpSummaryAll erpSummaryAll) { - erpSummaryAll.setCdate_gte(vDate.calculateStartCycleCode(erpSummaryAll.getFcycle())); + erpSummaryAll.setCdate_gte(vDate.calculateStartCycleCode(erpSummaryAll.getCycleType())); return erpSummaryAllService.findList(erpSummaryAll); } diff --git a/web-api/src/main/resources/mappings/modules/erp/ErpCategoryFlowDao.xml b/web-api/src/main/resources/mappings/modules/erp/ErpCategoryFlowDao.xml new file mode 100644 index 00000000..7cef239c --- /dev/null +++ b/web-api/src/main/resources/mappings/modules/erp/ErpCategoryFlowDao.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/web-api/src/main/resources/mappings/modules/erp/ErpIncExpRatioDao.xml b/web-api/src/main/resources/mappings/modules/erp/ErpIncExpRatioDao.xml new file mode 100644 index 00000000..9902d617 --- /dev/null +++ b/web-api/src/main/resources/mappings/modules/erp/ErpIncExpRatioDao.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/web-vue/package.json b/web-vue/package.json index b8c261de..8235dc9e 100644 --- a/web-vue/package.json +++ b/web-vue/package.json @@ -38,6 +38,7 @@ "@jeesite/types": "workspace:*", "@jeesite/vite": "workspace:*", "@jeesite/web": "workspace:*", + "@jiaminghi/data-view": "^2.10.0", "ant-design-vue": "4.2.6", "axios": "1.12.2", "dayjs": "1.11.18", diff --git a/web-vue/packages/biz/api/biz/dbConfig.ts b/web-vue/packages/biz/api/biz/dbConfig.ts index 24cc0b54..d6956411 100644 --- a/web-vue/packages/biz/api/biz/dbConfig.ts +++ b/web-vue/packages/biz/api/biz/dbConfig.ts @@ -21,7 +21,7 @@ export interface BizDbConfig extends BasicModel { dbUsername: string; // 数据库账号 dbPassword: string; // 数据库密码 description?: string; // 数据库描述 - isEnabled: number; // 是否启用 + isEnabled: string; // 是否启用 dbSchemaName?: string; // schema名称 updateTime?: string; // 更新时间 ftenantId?: string; // 租户id diff --git a/web-vue/packages/biz/views/biz/dataReport/erp/components/ChartBarAccount.vue b/web-vue/packages/biz/views/biz/dataReport/erp/components/ChartBarAccount.vue index f7ec9377..8b3cee2e 100644 --- a/web-vue/packages/biz/views/biz/dataReport/erp/components/ChartBarAccount.vue +++ b/web-vue/packages/biz/views/biz/dataReport/erp/components/ChartBarAccount.vue @@ -1,14 +1,5 @@ @@ -26,29 +17,10 @@ import type { BarSeriesOption } from 'echarts'; -// 表单默认值 -const defaultFormValues = ref({ - cycleType: 'M' -}); +const props = defineProps<{ + formParams: Record; // 接收周期等参数 +}>(); -// 表单配置 -const schemas: FormSchema[] = [ - { - label: '周期', - field: 'cycleType', - defaultValue: defaultFormValues.value.cycleType, - component: 'Select', - componentProps: { - dictType: 'report_cycle', - allowClear: true, - onChange: (value: string) => { - defaultFormValues.value.cycleType = value; - fetchList({ cycleType: value }); - } - }, - colProps: { md: 24, lg: 24 }, - }, -]; // 图表DOM引用 const chartDom = ref(null); @@ -104,13 +76,10 @@ const sortDates = (dates: string[]): string[] => { /** * 获取数据列表 - 增加类型约束和加载状态 */ -const fetchList = async (params: { cycleType?: string }) => { +const fetchList = async (params: Record) => { if (loading.value) return; - try { - loading.value = true; - const cycleType = params.cycleType || defaultFormValues.value.cycleType; - const result = await erpExpIncListAll({ cycleType }); + const result = await erpExpIncListAll(params); tableData.value = result || []; initChart(); } catch (error) { @@ -450,15 +419,6 @@ const initChart = () => { } }; -/** - * 处理表单提交 - */ -const handleFormSubmit = (values: { cycleType?: string }) => { - if (values.cycleType) { - fetchList({ cycleType: values.cycleType }); - } -}; - /** * 窗口缩放自适应 */ @@ -480,7 +440,7 @@ watch(tableData, () => { // 生命周期 onMounted(() => { - fetchList({}); + fetchList(props.formParams); window.addEventListener('resize', resizeChart); }); @@ -492,6 +452,14 @@ onUnmounted(() => { } clearTimeout((window as any).chartResizeTimer); }); + +watch( + () => props.formParams, + async (newParams) => { + await fetchList(newParams); // 参数变化时重新调用fetchList + }, + { deep: true, immediate: false } // deep: true 监听对象内部变化 +); \ No newline at end of file diff --git a/web-vue/packages/biz/views/biz/dataReport/erp/components/ChartLineRatio.vue b/web-vue/packages/biz/views/biz/dataReport/erp/components/ChartLineRatio.vue new file mode 100644 index 00000000..5f7ca823 --- /dev/null +++ b/web-vue/packages/biz/views/biz/dataReport/erp/components/ChartLineRatio.vue @@ -0,0 +1,550 @@ + + + + + \ No newline at end of file diff --git a/web-vue/packages/biz/views/biz/dataReport/erp/components/ChartLineType.vue b/web-vue/packages/biz/views/biz/dataReport/erp/components/ChartLineType.vue new file mode 100644 index 00000000..7901054c --- /dev/null +++ b/web-vue/packages/biz/views/biz/dataReport/erp/components/ChartLineType.vue @@ -0,0 +1,859 @@ + + + + + \ No newline at end of file diff --git a/web-vue/packages/biz/views/biz/dataReport/erp/index.vue b/web-vue/packages/biz/views/biz/dataReport/erp/index.vue index bcf0b299..ecb1cec2 100644 --- a/web-vue/packages/biz/views/biz/dataReport/erp/index.vue +++ b/web-vue/packages/biz/views/biz/dataReport/erp/index.vue @@ -1,23 +1,67 @@