初始化项目
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.jeesite.modules.erp.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.jeesite.common.entity.DataEntity;
|
||||
@@ -44,8 +45,8 @@ public class ErpAccount extends DataEntity<ErpAccount> implements Serializable {
|
||||
private String accountName; // 账户名称
|
||||
private String accountType; // 账户类型
|
||||
private String accountCode; // 账户卡号
|
||||
private Double initialBalance; // 初始余额
|
||||
private Double currentBalance; // 当前余额
|
||||
private BigDecimal initialBalance; // 初始余额
|
||||
private BigDecimal currentBalance; // 当前余额
|
||||
private String isActive; // 是否激活
|
||||
private Date updateTime; // 更新时间
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jeesite.modules.erp.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable;
|
||||
@@ -52,7 +53,7 @@ public class ErpAccountTransfer extends DataEntity<ErpAccountTransfer> implement
|
||||
private String outAccountId; // 转出账号
|
||||
private String inAccountId; // 转入账号
|
||||
private String categoryId; // 转账分类
|
||||
private Double transferAmount; // 转账金额
|
||||
private BigDecimal transferAmount; // 转账金额
|
||||
private String transferStatus; // 转账状态
|
||||
private String remark; // 转账备注
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jeesite.modules.erp.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable;
|
||||
@@ -48,8 +49,8 @@ public class ErpBudgets extends DataEntity<ErpBudgets> implements Serializable {
|
||||
private String budgetId; // 唯一主键
|
||||
private String categoryId; // 分类标识
|
||||
private String budgetMonth; // 预算年月
|
||||
private Double budgetAmount; // 预算金额
|
||||
private Double usedAmount; // 使用金额
|
||||
private BigDecimal budgetAmount; // 预算金额
|
||||
private BigDecimal usedAmount; // 使用金额
|
||||
private Double usedRatio; // 预算占比
|
||||
private Double overAmount; // 超支金额
|
||||
private Date updateTime; // 更新时间
|
||||
|
||||
@@ -3,12 +3,6 @@ package com.jeesite.modules.erp.entity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable;
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -59,9 +53,9 @@ public class ErpCategory extends DataEntity<ErpCategory> implements Serializable
|
||||
@ExcelField(title = "分类标识", attrName = "categoryId", align = Align.CENTER, sort = 20),
|
||||
@ExcelField(title = "父级名称", attrName = "parentName", align = Align.CENTER, sort = 30),
|
||||
@ExcelField(title = "分类名称", attrName = "categoryName", align = Align.CENTER, sort = 40),
|
||||
@ExcelField(title = "分类类型", attrName = "categoryType", align = Align.CENTER, sort = 50),
|
||||
@ExcelField(title = "分类类型", attrName = "categoryType", dictType = "erp_type", align = Align.CENTER, sort = 50),
|
||||
@ExcelField(title = "排序序号", attrName = "sortOrder", align = Align.CENTER, sort = 60),
|
||||
@ExcelField(title = "是否启用", attrName = "isActive", align = Align.CENTER, sort = 70),
|
||||
@ExcelField(title = "是否启用", attrName = "isActive", dictType = "is_active", align = Align.CENTER, sort = 70),
|
||||
@ExcelField(title = "更新时间", attrName = "updateTime", align = Align.CENTER, sort = 80, dataFormat = "yyyy-MM-dd hh:mm"),
|
||||
})
|
||||
public ErpCategory() {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jeesite.modules.erp.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable;
|
||||
@@ -48,7 +49,7 @@ public class ErpDebtRecords extends DataEntity<ErpDebtRecords> implements Serial
|
||||
private String recordId; // 唯一标识
|
||||
private String debtId; // 负债标识
|
||||
private String accountId; // 账户标识
|
||||
private Double repayAmount; // 还款金额
|
||||
private BigDecimal repayAmount; // 还款金额
|
||||
private Date repayTime; // 还款时间
|
||||
private String remark; // 备注说明
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jeesite.modules.erp.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable;
|
||||
@@ -49,8 +50,8 @@ public class ErpDebts extends DataEntity<ErpDebts> implements Serializable {
|
||||
private String debtId; // 唯一标识
|
||||
private String debtType; // 负债类型
|
||||
private String debtName; // 对方名称
|
||||
private Double debtAmount; // 借贷金额
|
||||
private Double remaining; // 未还金额
|
||||
private BigDecimal debtAmount; // 借贷金额
|
||||
private BigDecimal remaining; // 未还金额
|
||||
private Date endTime; // 结清时间
|
||||
private String ustatus; // 状态
|
||||
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
package com.jeesite.modules.erp.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable;
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
@@ -37,6 +34,18 @@ import java.io.Serial;
|
||||
@Column(name = "category_id", attrName = "categoryId", label = "支出分类"),
|
||||
@Column(name = "amount", attrName = "amount", label = "交易金额", isQuery = false),
|
||||
@Column(name = "update_time", attrName = "updateTime", label = "更新时间", isQuery = false, isUpdateForce = true),
|
||||
}, joinTable = {
|
||||
@JoinTable(type = Type.LEFT_JOIN, entity = ErpAccount.class, alias = "b",
|
||||
on = "a.account_id = b.account_id", attrName = "this",
|
||||
columns = {
|
||||
@Column(name = "account_name", attrName = "accountName", label = "账户名称"),
|
||||
}),
|
||||
@JoinTable(type = Type.LEFT_JOIN, entity = ErpCategory.class, alias = "c",
|
||||
on = "a.category_id = c.category_id", attrName = "this",
|
||||
columns = {
|
||||
@Column(name = "parent_name", attrName = "parentName", label = "父级名称"),
|
||||
@Column(name = "category_name", attrName = "categoryName", label = "分类名称"),
|
||||
}),
|
||||
}, orderBy = "a.create_time DESC"
|
||||
)
|
||||
@Data
|
||||
@@ -49,15 +58,22 @@ public class ErpExpense extends DataEntity<ErpExpense> implements Serializable {
|
||||
private String expenseName; // 支出名称
|
||||
private String accountId; // 支出账户
|
||||
private String categoryId; // 支出分类
|
||||
private Double amount; // 交易金额
|
||||
private BigDecimal amount; // 交易金额
|
||||
private Date updateTime; // 更新时间
|
||||
|
||||
private String accountName;
|
||||
|
||||
private String parentName;
|
||||
|
||||
private String categoryName;
|
||||
|
||||
@ExcelFields({
|
||||
@ExcelField(title = "记录时间", attrName = "createTime", align = Align.CENTER, sort = 10, dataFormat = "yyyy-MM-dd hh:mm"),
|
||||
@ExcelField(title = "唯一标识", attrName = "expenseId", align = Align.CENTER, sort = 20),
|
||||
@ExcelField(title = "支出名称", attrName = "expenseName", align = Align.CENTER, sort = 30),
|
||||
@ExcelField(title = "支出账户", attrName = "accountId", align = Align.CENTER, sort = 40),
|
||||
@ExcelField(title = "支出分类", attrName = "categoryId", align = Align.CENTER, sort = 50),
|
||||
@ExcelField(title = "支出账户", attrName = "accountName", align = Align.CENTER, sort = 40),
|
||||
@ExcelField(title = "父级分类", attrName = "parentName", align = Align.CENTER, sort = 50),
|
||||
@ExcelField(title = "支出分类", attrName = "categoryName", align = Align.CENTER, sort = 50),
|
||||
@ExcelField(title = "交易金额", attrName = "amount", align = Align.CENTER, sort = 60),
|
||||
@ExcelField(title = "更新时间", attrName = "updateTime", align = Align.CENTER, sort = 70, dataFormat = "yyyy-MM-dd hh:mm"),
|
||||
})
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.jeesite.modules.erp.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable;
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jeesite.modules.biz.entity.MyProvince;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
@@ -37,6 +39,18 @@ import java.io.Serial;
|
||||
@Column(name = "category_id", attrName = "categoryId", label = "收入分类"),
|
||||
@Column(name = "amount", attrName = "amount", label = "交易金额", isQuery = false),
|
||||
@Column(name = "update_time", attrName = "updateTime", label = "更新时间", isQuery = false, isUpdateForce = true),
|
||||
}, joinTable = {
|
||||
@JoinTable(type = Type.LEFT_JOIN, entity = ErpAccount.class, alias = "b",
|
||||
on = "a.account_id = b.account_id", attrName = "this",
|
||||
columns = {
|
||||
@Column(name = "account_name", attrName = "accountName", label = "账户名称"),
|
||||
}),
|
||||
@JoinTable(type = Type.LEFT_JOIN, entity = ErpCategory.class, alias = "c",
|
||||
on = "a.category_id = c.category_id", attrName = "this",
|
||||
columns = {
|
||||
@Column(name = "parent_name", attrName = "parentName", label = "父级名称"),
|
||||
@Column(name = "category_name", attrName = "categoryName", label = "分类名称"),
|
||||
}),
|
||||
}, orderBy = "a.create_time DESC"
|
||||
)
|
||||
@Data
|
||||
@@ -49,15 +63,22 @@ public class ErpIncome extends DataEntity<ErpIncome> implements Serializable {
|
||||
private String incomeName; // 收入名称
|
||||
private String accountId; // 收入账户
|
||||
private String categoryId; // 收入分类
|
||||
private Double amount; // 交易金额
|
||||
private BigDecimal amount; // 交易金额
|
||||
private Date updateTime; // 更新时间
|
||||
|
||||
private String accountName;
|
||||
|
||||
private String parentName;
|
||||
|
||||
private String categoryName;
|
||||
|
||||
@ExcelFields({
|
||||
@ExcelField(title = "记录时间", attrName = "createTime", align = Align.CENTER, sort = 10, dataFormat = "yyyy-MM-dd hh:mm"),
|
||||
@ExcelField(title = "唯一标识", attrName = "incomeId", align = Align.CENTER, sort = 20),
|
||||
@ExcelField(title = "收入名称", attrName = "incomeName", align = Align.CENTER, sort = 30),
|
||||
@ExcelField(title = "收入账户", attrName = "accountId", align = Align.CENTER, sort = 40),
|
||||
@ExcelField(title = "收入分类", attrName = "categoryId", align = Align.CENTER, sort = 50),
|
||||
@ExcelField(title = "收入账户", attrName = "accountName", align = Align.CENTER, sort = 40),
|
||||
@ExcelField(title = "父级分类", attrName = "parentName", align = Align.CENTER, sort = 50),
|
||||
@ExcelField(title = "收入分类", attrName = "categoryName", align = Align.CENTER, sort = 50),
|
||||
@ExcelField(title = "交易金额", attrName = "amount", align = Align.CENTER, sort = 60),
|
||||
@ExcelField(title = "更新时间", attrName = "updateTime", align = Align.CENTER, sort = 70, dataFormat = "yyyy-MM-dd hh:mm"),
|
||||
})
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jeesite.modules.erp.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable;
|
||||
@@ -52,7 +53,7 @@ public class ErpTransactionFlow extends DataEntity<ErpTransactionFlow> implement
|
||||
private String flowId; // 流水
|
||||
private String flowName; // 交易名称
|
||||
private String flowType; // 交易类型
|
||||
private Double amount; // 交易金额
|
||||
private BigDecimal amount; // 交易金额
|
||||
private Date tradeTime; // 交易时间
|
||||
private String accountId; // 交易账户
|
||||
private String categoryId; // 交易分类
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jeesite.modules.erp.web;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
@@ -26,6 +27,7 @@ import com.jeesite.modules.erp.service.ErpCategoryService;
|
||||
|
||||
/**
|
||||
* 收支分类 Controller
|
||||
*
|
||||
* @author gaoxq
|
||||
* @version 2026-03-22
|
||||
*/
|
||||
@@ -33,114 +35,123 @@ import com.jeesite.modules.erp.service.ErpCategoryService;
|
||||
@RequestMapping(value = "${adminPath}/erp/category")
|
||||
public class ErpCategoryController extends BaseController {
|
||||
|
||||
private final ErpCategoryService erpCategoryService;
|
||||
private final ErpCategoryService erpCategoryService;
|
||||
|
||||
public ErpCategoryController(ErpCategoryService erpCategoryService) {
|
||||
this.erpCategoryService = erpCategoryService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
@ModelAttribute
|
||||
public ErpCategory get(String categoryId, boolean isNewRecord) {
|
||||
return erpCategoryService.get(categoryId, isNewRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
@RequiresPermissions("erp:category:view")
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(ErpCategory erpCategory, Model model) {
|
||||
model.addAttribute("erpCategory", erpCategory);
|
||||
return "modules/erp/erpCategoryList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
*/
|
||||
@RequiresPermissions("erp:category:view")
|
||||
@RequestMapping(value = "listData")
|
||||
@ResponseBody
|
||||
public Page<ErpCategory> listData(ErpCategory erpCategory, HttpServletRequest request, HttpServletResponse response) {
|
||||
erpCategory.setPage(new Page<>(request, response));
|
||||
Page<ErpCategory> page = erpCategoryService.findPage(erpCategory);
|
||||
return page;
|
||||
}
|
||||
public ErpCategoryController(ErpCategoryService erpCategoryService) {
|
||||
this.erpCategoryService = erpCategoryService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看编辑表单
|
||||
*/
|
||||
@RequiresPermissions("erp:category:view")
|
||||
@RequestMapping(value = "form")
|
||||
public String form(ErpCategory erpCategory, Model model) {
|
||||
model.addAttribute("erpCategory", erpCategory);
|
||||
return "modules/erp/erpCategoryForm";
|
||||
}
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
@ModelAttribute
|
||||
public ErpCategory get(String categoryId, boolean isNewRecord) {
|
||||
return erpCategoryService.get(categoryId, isNewRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据
|
||||
*/
|
||||
@RequiresPermissions("erp:category:edit")
|
||||
@PostMapping(value = "save")
|
||||
@ResponseBody
|
||||
public String save(@Validated ErpCategory erpCategory) {
|
||||
erpCategoryService.save(erpCategory);
|
||||
return renderResult(Global.TRUE, text("保存分类成功!"));
|
||||
}
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
@RequiresPermissions("erp:category:view")
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(ErpCategory erpCategory, Model model) {
|
||||
model.addAttribute("erpCategory", erpCategory);
|
||||
return "modules/erp/erpCategoryList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@RequiresPermissions("erp:category:view")
|
||||
@RequestMapping(value = "exportData")
|
||||
public void exportData(ErpCategory erpCategory, HttpServletResponse response) {
|
||||
List<ErpCategory> list = erpCategoryService.findList(erpCategory);
|
||||
String fileName = "分类" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
||||
try(ExcelExport ee = new ExcelExport("分类", ErpCategory.class)){
|
||||
ee.setDataList(list).write(response, fileName);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 查询列表数据
|
||||
*/
|
||||
@RequiresPermissions("erp:category:view")
|
||||
@RequestMapping(value = "listData")
|
||||
@ResponseBody
|
||||
public Page<ErpCategory> listData(ErpCategory erpCategory, HttpServletRequest request, HttpServletResponse response) {
|
||||
erpCategory.setPage(new Page<>(request, response));
|
||||
Page<ErpCategory> page = erpCategoryService.findPage(erpCategory);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载模板
|
||||
*/
|
||||
@RequiresPermissions("erp:category:view")
|
||||
@RequestMapping(value = "importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ErpCategory erpCategory = new ErpCategory();
|
||||
List<ErpCategory> list = ListUtils.newArrayList(erpCategory);
|
||||
String fileName = "分类模板.xlsx";
|
||||
try(ExcelExport ee = new ExcelExport("分类", ErpCategory.class, Type.IMPORT)){
|
||||
ee.setDataList(list).write(response, fileName);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 查看编辑表单
|
||||
*/
|
||||
@RequiresPermissions("erp:category:view")
|
||||
@RequestMapping(value = "form")
|
||||
public String form(ErpCategory erpCategory, Model model) {
|
||||
model.addAttribute("erpCategory", erpCategory);
|
||||
return "modules/erp/erpCategoryForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据
|
||||
*/
|
||||
@RequiresPermissions("erp:category:edit")
|
||||
@PostMapping(value = "save")
|
||||
@ResponseBody
|
||||
public String save(@Validated ErpCategory erpCategory) {
|
||||
erpCategoryService.save(erpCategory);
|
||||
return renderResult(Global.TRUE, text("保存分类成功!"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@RequiresPermissions("erp:category:view")
|
||||
@RequestMapping(value = "exportData")
|
||||
public void exportData(ErpCategory erpCategory, HttpServletResponse response) {
|
||||
List<ErpCategory> list = erpCategoryService.findList(erpCategory);
|
||||
String fileName = "分类" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
||||
try (ExcelExport ee = new ExcelExport("分类", ErpCategory.class)) {
|
||||
ee.setDataList(list).write(response, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载模板
|
||||
*/
|
||||
@RequiresPermissions("erp:category:view")
|
||||
@RequestMapping(value = "importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ErpCategory erpCategory = new ErpCategory();
|
||||
List<ErpCategory> list = ListUtils.newArrayList(erpCategory);
|
||||
String fileName = "分类模板.xlsx";
|
||||
try (ExcelExport ee = new ExcelExport("分类", ErpCategory.class, Type.IMPORT)) {
|
||||
ee.setDataList(list).write(response, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequiresPermissions("erp:category:edit")
|
||||
@PostMapping(value = "importData")
|
||||
public String importData(MultipartFile file) {
|
||||
try {
|
||||
String message = erpCategoryService.importData(file);
|
||||
return renderResult(Global.TRUE, "posfull:" + message);
|
||||
} catch (Exception ex) {
|
||||
return renderResult(Global.FALSE, "posfull:" + ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*/
|
||||
@RequiresPermissions("erp:category:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
@ResponseBody
|
||||
public String delete(ErpCategory erpCategory) {
|
||||
erpCategoryService.delete(erpCategory);
|
||||
return renderResult(Global.TRUE, text("删除分类成功!"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表数据
|
||||
*/
|
||||
@RequestMapping(value = "listAll")
|
||||
@ResponseBody
|
||||
public List<ErpCategory> listAll(ErpCategory erpCategory) {
|
||||
return erpCategoryService.findList(erpCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequiresPermissions("erp:category:edit")
|
||||
@PostMapping(value = "importData")
|
||||
public String importData(MultipartFile file) {
|
||||
try {
|
||||
String message = erpCategoryService.importData(file);
|
||||
return renderResult(Global.TRUE, "posfull:"+message);
|
||||
} catch (Exception ex) {
|
||||
return renderResult(Global.FALSE, "posfull:"+ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*/
|
||||
@RequiresPermissions("erp:category:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
@ResponseBody
|
||||
public String delete(ErpCategory erpCategory) {
|
||||
erpCategoryService.delete(erpCategory);
|
||||
return renderResult(Global.TRUE, text("删除分类成功!"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
|
||||
import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table';
|
||||
import { erpAccountListData } from '@jeesite/erp/api/erp/account';
|
||||
import { ErpAccount, erpAccountListData } from '@jeesite/erp/api/erp/account';
|
||||
|
||||
const { t } = useI18n('erp.account');
|
||||
|
||||
@@ -20,12 +20,20 @@ const searchForm: FormProps<ErpAccount> = {
|
||||
{
|
||||
label: t('账户类型'),
|
||||
field: 'accountType',
|
||||
component: 'Input',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'account_type',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('是否激活'),
|
||||
field: 'isActive',
|
||||
component: 'Input',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'is_active',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -36,16 +44,16 @@ const tableColumns: BasicColumn<ErpAccount>[] = [
|
||||
dataIndex: 'createTime',
|
||||
key: 'a.create_time',
|
||||
sorter: true,
|
||||
width: 230,
|
||||
align: 'left',
|
||||
slot: 'firstColumn',
|
||||
width: 150,
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
},
|
||||
{
|
||||
title: t('账户名称'),
|
||||
dataIndex: 'accountName',
|
||||
key: 'a.account_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
width: 200,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
@@ -55,6 +63,7 @@ const tableColumns: BasicColumn<ErpAccount>[] = [
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: 'account_type',
|
||||
},
|
||||
{
|
||||
title: t('账户卡号'),
|
||||
@@ -64,14 +73,6 @@ const tableColumns: BasicColumn<ErpAccount>[] = [
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('初始余额'),
|
||||
dataIndex: 'initialBalance',
|
||||
key: 'a.initial_balance',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'right',
|
||||
},
|
||||
{
|
||||
title: t('当前余额'),
|
||||
dataIndex: 'currentBalance',
|
||||
@@ -87,14 +88,7 @@ const tableColumns: BasicColumn<ErpAccount>[] = [
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('更新时间'),
|
||||
dataIndex: 'updateTime',
|
||||
key: 'a.update_time',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'center',
|
||||
dictType: 'is_active',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -113,6 +107,6 @@ export default {
|
||||
modalProps,
|
||||
tableProps,
|
||||
itemCode: 'accountId',
|
||||
itemName: 'accountId',
|
||||
isShowCode: false,
|
||||
itemName: 'accountName',
|
||||
isShowCode: true,
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
|
||||
import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table';
|
||||
import { erpCategoryListData } from '@jeesite/erp/api/erp/category';
|
||||
import { ErpCategory, erpCategoryListData } from '@jeesite/erp/api/erp/category';
|
||||
|
||||
const { t } = useI18n('erp.category');
|
||||
|
||||
@@ -20,12 +20,20 @@ const searchForm: FormProps<ErpCategory> = {
|
||||
{
|
||||
label: t('分类类型'),
|
||||
field: 'categoryType',
|
||||
component: 'Input',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'erp_type',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('是否启用'),
|
||||
field: 'isActive',
|
||||
component: 'Input',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'is_active',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -36,9 +44,9 @@ const tableColumns: BasicColumn<ErpCategory>[] = [
|
||||
dataIndex: 'createTime',
|
||||
key: 'a.create_time',
|
||||
sorter: true,
|
||||
width: 230,
|
||||
align: 'left',
|
||||
slot: 'firstColumn',
|
||||
width: 150,
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
},
|
||||
{
|
||||
title: t('父级名称'),
|
||||
@@ -63,6 +71,7 @@ const tableColumns: BasicColumn<ErpCategory>[] = [
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: 'erp_type',
|
||||
},
|
||||
{
|
||||
title: t('排序序号'),
|
||||
@@ -79,13 +88,14 @@ const tableColumns: BasicColumn<ErpCategory>[] = [
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: 'is_active',
|
||||
},
|
||||
{
|
||||
title: t('更新时间'),
|
||||
dataIndex: 'updateTime',
|
||||
key: 'a.update_time',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
width: 150,
|
||||
align: 'center',
|
||||
},
|
||||
];
|
||||
@@ -105,6 +115,6 @@ export default {
|
||||
modalProps,
|
||||
tableProps,
|
||||
itemCode: 'categoryId',
|
||||
itemName: 'categoryId',
|
||||
isShowCode: false,
|
||||
itemName: 'categoryName',
|
||||
isShowCode: true,
|
||||
};
|
||||
@@ -26,6 +26,9 @@ export interface ErpCategory extends BasicModel<ErpCategory> {
|
||||
export const erpCategoryList = (params?: ErpCategory | any) =>
|
||||
defHttp.get<ErpCategory>({ url: adminPath + '/erp/category/list', params });
|
||||
|
||||
export const erpCategoryListAll = (params?: ErpCategory | any) =>
|
||||
defHttp.get<ErpCategory[]>({ url: adminPath + '/erp/category/listAll', params });
|
||||
|
||||
export const erpCategoryListData = (params?: ErpCategory | any) =>
|
||||
defHttp.post<Page<ErpCategory>>({ url: adminPath + '/erp/category/listData', params });
|
||||
|
||||
|
||||
@@ -4,20 +4,20 @@
|
||||
* @author gaoxq
|
||||
-->
|
||||
<template>
|
||||
<BasicDrawer
|
||||
<BasicModal
|
||||
v-bind="$attrs"
|
||||
:showFooter="true"
|
||||
:okAuth="'erp:account:edit'"
|
||||
@register="registerDrawer"
|
||||
@register="registerModal"
|
||||
@ok="handleSubmit"
|
||||
width="70%"
|
||||
width="60%"
|
||||
>
|
||||
<template #title>
|
||||
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
|
||||
<span> {{ getTitle.value }} </span>
|
||||
</template>
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicDrawer>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup name="ViewsErpAccountForm">
|
||||
import { ref, unref, computed } from 'vue';
|
||||
@@ -26,7 +26,7 @@
|
||||
import { router } from '@jeesite/core/router';
|
||||
import { Icon } from '@jeesite/core/components/Icon';
|
||||
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
|
||||
import { BasicDrawer, useDrawerInner } from '@jeesite/core/components/Drawer';
|
||||
import { BasicModal, useModalInner } from '@jeesite/core/components/Modal';
|
||||
import { ErpAccount, erpAccountSave, erpAccountForm } from '@jeesite/erp/api/erp/account';
|
||||
import { formatToDateTime } from '@jeesite/core/utils/dateUtil';
|
||||
|
||||
@@ -61,10 +61,11 @@
|
||||
{
|
||||
label: t('账户类型'),
|
||||
field: 'accountType',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 12,
|
||||
},
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'account_type',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
@@ -79,7 +80,7 @@
|
||||
{
|
||||
label: t('初始余额'),
|
||||
field: 'initialBalance',
|
||||
component: 'Input',
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
maxlength: 10,
|
||||
},
|
||||
@@ -88,7 +89,7 @@
|
||||
{
|
||||
label: t('当前余额'),
|
||||
field: 'currentBalance',
|
||||
component: 'Input',
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
maxlength: 10,
|
||||
},
|
||||
@@ -97,10 +98,11 @@
|
||||
{
|
||||
label: t('是否激活'),
|
||||
field: 'isActive',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 12,
|
||||
},
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'is_active',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
];
|
||||
@@ -111,20 +113,20 @@
|
||||
baseColProps: { md: 24, lg: 12 },
|
||||
});
|
||||
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
setDrawerProps({ loading: true });
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
setModalProps({ loading: true });
|
||||
await resetFields();
|
||||
const res = await erpAccountForm(data);
|
||||
record.value = (res.erpAccount || {}) as ErpAccount;
|
||||
record.value.__t = new Date().getTime();
|
||||
await setFieldsValue(record.value);
|
||||
setDrawerProps({ loading: false });
|
||||
setModalProps({ loading: false });
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const data = await validate();
|
||||
setDrawerProps({ confirmLoading: true });
|
||||
setModalProps({ confirmLoading: true });
|
||||
const params: any = {
|
||||
isNewRecord: record.value.isNewRecord,
|
||||
accountId: record.value.accountId || data.accountId,
|
||||
@@ -135,7 +137,7 @@
|
||||
// console.log('submit', params, data, record);
|
||||
const res = await erpAccountSave(params, data);
|
||||
showMessage(res.message);
|
||||
setTimeout(closeDrawer);
|
||||
setTimeout(closeModal);
|
||||
emit('success', data);
|
||||
} catch (error: any) {
|
||||
if (error && error.errorFields) {
|
||||
@@ -143,7 +145,7 @@
|
||||
}
|
||||
console.log('error', error);
|
||||
} finally {
|
||||
setDrawerProps({ confirmLoading: false });
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
{{ desensitizeBankCard(text) }}
|
||||
</template>
|
||||
</BasicTable>
|
||||
<InputForm @register="registerDrawer" @success="handleSuccess" />
|
||||
<InputForm @register="registerModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup name="ViewsErpAccountList">
|
||||
@@ -41,7 +41,6 @@
|
||||
import { BasicTable, BasicColumn, useTable } from '@jeesite/core/components/Table';
|
||||
import { ErpAccount, erpAccountList } from '@jeesite/erp/api/erp/account';
|
||||
import { erpAccountDelete, erpAccountListData } from '@jeesite/erp/api/erp/account';
|
||||
import { useDrawer } from '@jeesite/core/components/Drawer';
|
||||
import { useModal } from '@jeesite/core/components/Modal';
|
||||
import { FormProps } from '@jeesite/core/components/Form';
|
||||
import InputForm from './form.vue';
|
||||
@@ -70,12 +69,20 @@
|
||||
{
|
||||
label: t('账户类型'),
|
||||
field: 'accountType',
|
||||
component: 'Input',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'account_type',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('是否激活'),
|
||||
field: 'isActive',
|
||||
component: 'Input',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'is_active',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -106,6 +113,7 @@
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: 'account_type',
|
||||
},
|
||||
{
|
||||
title: t('账户卡号'),
|
||||
@@ -139,6 +147,7 @@
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: 'is_active',
|
||||
},
|
||||
{
|
||||
title: t('更新时间'),
|
||||
@@ -192,10 +201,10 @@
|
||||
await getForm().setFieldsValue(record.value);
|
||||
});
|
||||
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
function handleForm(record: Recordable) {
|
||||
openDrawer(true, record);
|
||||
openModal(true, record);
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
|
||||
@@ -4,20 +4,20 @@
|
||||
* @author gaoxq
|
||||
-->
|
||||
<template>
|
||||
<BasicDrawer
|
||||
<BasicModal
|
||||
v-bind="$attrs"
|
||||
:showFooter="true"
|
||||
:okAuth="'erp:category:edit'"
|
||||
@register="registerDrawer"
|
||||
@register="registerModal"
|
||||
@ok="handleSubmit"
|
||||
width="70%"
|
||||
width="60%"
|
||||
>
|
||||
<template #title>
|
||||
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
|
||||
<span> {{ getTitle.value }} </span>
|
||||
</template>
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicDrawer>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup name="ViewsErpCategoryForm">
|
||||
import { ref, unref, computed } from 'vue';
|
||||
@@ -26,7 +26,7 @@
|
||||
import { router } from '@jeesite/core/router';
|
||||
import { Icon } from '@jeesite/core/components/Icon';
|
||||
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
|
||||
import { BasicDrawer, useDrawerInner } from '@jeesite/core/components/Drawer';
|
||||
import { BasicModal, useModalInner } from '@jeesite/core/components/Modal';
|
||||
import { ErpCategory, erpCategorySave, erpCategoryForm } from '@jeesite/erp/api/erp/category';
|
||||
import { formatToDateTime } from '@jeesite/core/utils/dateUtil';
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
maxlength: 32,
|
||||
},
|
||||
required: true,
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('分类名称'),
|
||||
@@ -70,16 +71,17 @@
|
||||
{
|
||||
label: t('分类类型'),
|
||||
field: 'categoryType',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 12,
|
||||
},
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'erp_type',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('排序序号'),
|
||||
field: 'sortOrder',
|
||||
component: 'Input',
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
maxlength: 18,
|
||||
},
|
||||
@@ -88,10 +90,11 @@
|
||||
{
|
||||
label: t('是否启用'),
|
||||
field: 'isActive',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 12,
|
||||
},
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'is_active',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
];
|
||||
@@ -102,20 +105,20 @@
|
||||
baseColProps: { md: 24, lg: 12 },
|
||||
});
|
||||
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
setDrawerProps({ loading: true });
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
setModalProps({ loading: true });
|
||||
await resetFields();
|
||||
const res = await erpCategoryForm(data);
|
||||
record.value = (res.erpCategory || {}) as ErpCategory;
|
||||
record.value.__t = new Date().getTime();
|
||||
await setFieldsValue(record.value);
|
||||
setDrawerProps({ loading: false });
|
||||
setModalProps({ loading: false });
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const data = await validate();
|
||||
setDrawerProps({ confirmLoading: true });
|
||||
setModalProps({ confirmLoading: true });
|
||||
const params: any = {
|
||||
isNewRecord: record.value.isNewRecord,
|
||||
categoryId: record.value.categoryId || data.categoryId,
|
||||
@@ -126,7 +129,7 @@
|
||||
// console.log('submit', params, data, record);
|
||||
const res = await erpCategorySave(params, data);
|
||||
showMessage(res.message);
|
||||
setTimeout(closeDrawer);
|
||||
setTimeout(closeModal);
|
||||
emit('success', data);
|
||||
} catch (error: any) {
|
||||
if (error && error.errorFields) {
|
||||
@@ -134,7 +137,7 @@
|
||||
}
|
||||
console.log('error', error);
|
||||
} finally {
|
||||
setDrawerProps({ confirmLoading: false });
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</a>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<InputForm @register="registerDrawer" @success="handleSuccess" />
|
||||
<InputForm @register="registerModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup name="ViewsErpCategoryList">
|
||||
@@ -38,7 +38,6 @@
|
||||
import { BasicTable, BasicColumn, useTable } from '@jeesite/core/components/Table';
|
||||
import { ErpCategory, erpCategoryList } from '@jeesite/erp/api/erp/category';
|
||||
import { erpCategoryDelete, erpCategoryListData } from '@jeesite/erp/api/erp/category';
|
||||
import { useDrawer } from '@jeesite/core/components/Drawer';
|
||||
import { useModal } from '@jeesite/core/components/Modal';
|
||||
import { FormProps } from '@jeesite/core/components/Form';
|
||||
import InputForm from './form.vue';
|
||||
@@ -66,12 +65,20 @@
|
||||
{
|
||||
label: t('分类类型'),
|
||||
field: 'categoryType',
|
||||
component: 'Input',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'erp_type',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('是否启用'),
|
||||
field: 'isActive',
|
||||
component: 'Input',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'is_active',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -110,6 +117,7 @@
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: 'erp_type',
|
||||
},
|
||||
{
|
||||
title: t('排序序号'),
|
||||
@@ -126,6 +134,7 @@
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: 'is_active',
|
||||
},
|
||||
{
|
||||
title: t('更新时间'),
|
||||
@@ -179,10 +188,10 @@
|
||||
await getForm().setFieldsValue(record.value);
|
||||
});
|
||||
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
function handleForm(record: Recordable) {
|
||||
openDrawer(true, record);
|
||||
openModal(true, record);
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
* @author gaoxq
|
||||
-->
|
||||
<template>
|
||||
<BasicDrawer
|
||||
<BasicModal
|
||||
v-bind="$attrs"
|
||||
:showFooter="true"
|
||||
:okAuth="'erp:income:edit'"
|
||||
@register="registerDrawer"
|
||||
@register="registerModal"
|
||||
@ok="handleSubmit"
|
||||
width="70%"
|
||||
>
|
||||
@@ -17,7 +17,7 @@
|
||||
<span> {{ getTitle.value }} </span>
|
||||
</template>
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicDrawer>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup name="ViewsErpIncomeForm">
|
||||
import { ref, unref, computed } from 'vue';
|
||||
@@ -26,7 +26,8 @@
|
||||
import { router } from '@jeesite/core/router';
|
||||
import { Icon } from '@jeesite/core/components/Icon';
|
||||
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
|
||||
import { BasicDrawer, useDrawerInner } from '@jeesite/core/components/Drawer';
|
||||
import { BasicModal, useModalInner } from '@jeesite/core/components/Modal';
|
||||
import { ErpCategory, erpCategoryListAll } from '@jeesite/erp/api/erp/category';
|
||||
import { ErpIncome, erpIncomeSave, erpIncomeForm } from '@jeesite/erp/api/erp/income';
|
||||
import { formatToDateTime } from '@jeesite/core/utils/dateUtil';
|
||||
|
||||
@@ -61,25 +62,30 @@
|
||||
{
|
||||
label: t('收入账户'),
|
||||
field: 'accountId',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 52,
|
||||
},
|
||||
fieldLabel: 'accountName',
|
||||
component: 'ListSelect',
|
||||
componentProps: {
|
||||
selectType: 'erpAccountSelect',
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('收入分类'),
|
||||
field: 'categoryId',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 52,
|
||||
},
|
||||
required: true,
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
api: erpCategoryListAll,
|
||||
params: {
|
||||
categoryType: '2'
|
||||
},
|
||||
fieldNames: { label: 'categoryName', value: 'categoryId' },
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('交易金额'),
|
||||
field: 'amount',
|
||||
component: 'Input',
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
maxlength: 10,
|
||||
},
|
||||
@@ -93,20 +99,20 @@
|
||||
baseColProps: { md: 24, lg: 12 },
|
||||
});
|
||||
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
setDrawerProps({ loading: true });
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
setModalProps({ loading: true });
|
||||
await resetFields();
|
||||
const res = await erpIncomeForm(data);
|
||||
record.value = (res.erpIncome || {}) as ErpIncome;
|
||||
record.value.__t = new Date().getTime();
|
||||
await setFieldsValue(record.value);
|
||||
setDrawerProps({ loading: false });
|
||||
setModalProps({ loading: false });
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const data = await validate();
|
||||
setDrawerProps({ confirmLoading: true });
|
||||
setModalProps({ confirmLoading: true });
|
||||
const params: any = {
|
||||
isNewRecord: record.value.isNewRecord,
|
||||
incomeId: record.value.incomeId || data.incomeId,
|
||||
@@ -117,7 +123,7 @@
|
||||
// console.log('submit', params, data, record);
|
||||
const res = await erpIncomeSave(params, data);
|
||||
showMessage(res.message);
|
||||
setTimeout(closeDrawer);
|
||||
setTimeout(closeModal);
|
||||
emit('success', data);
|
||||
} catch (error: any) {
|
||||
if (error && error.errorFields) {
|
||||
@@ -125,7 +131,7 @@
|
||||
}
|
||||
console.log('error', error);
|
||||
} finally {
|
||||
setDrawerProps({ confirmLoading: false });
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</a>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<InputForm @register="registerDrawer" @success="handleSuccess" />
|
||||
<InputForm @register="registerModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup name="ViewsErpIncomeList">
|
||||
@@ -37,8 +37,8 @@
|
||||
import { Icon } from '@jeesite/core/components/Icon';
|
||||
import { BasicTable, BasicColumn, useTable } from '@jeesite/core/components/Table';
|
||||
import { ErpIncome, erpIncomeList } from '@jeesite/erp/api/erp/income';
|
||||
import { ErpCategory, erpCategoryListAll } from '@jeesite/erp/api/erp/category';
|
||||
import { erpIncomeDelete, erpIncomeListData } from '@jeesite/erp/api/erp/income';
|
||||
import { useDrawer } from '@jeesite/core/components/Drawer';
|
||||
import { useModal } from '@jeesite/core/components/Modal';
|
||||
import { FormProps } from '@jeesite/core/components/Form';
|
||||
import InputForm from './form.vue';
|
||||
@@ -66,12 +66,23 @@
|
||||
{
|
||||
label: t('收入账户'),
|
||||
field: 'accountId',
|
||||
component: 'Input',
|
||||
fieldLabel: 'accountName',
|
||||
component: 'ListSelect',
|
||||
componentProps: {
|
||||
selectType: 'erpAccountSelect',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('收入分类'),
|
||||
field: 'categoryId',
|
||||
component: 'Input',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
api: erpCategoryListAll,
|
||||
params: {
|
||||
categoryType: '2'
|
||||
},
|
||||
fieldNames: { label: 'categoryName', value: 'categoryId' },
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -82,35 +93,43 @@
|
||||
dataIndex: 'createTime',
|
||||
key: 'a.create_time',
|
||||
sorter: true,
|
||||
width: 230,
|
||||
align: 'left',
|
||||
slot: 'firstColumn',
|
||||
width: 150,
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
},
|
||||
{
|
||||
title: t('收入名称'),
|
||||
dataIndex: 'incomeName',
|
||||
key: 'a.income_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
width: 200,
|
||||
align: 'left',
|
||||
slot: 'bizScopeKey',
|
||||
},
|
||||
{
|
||||
title: t('收入账户'),
|
||||
dataIndex: 'accountId',
|
||||
key: 'a.account_id',
|
||||
dataIndex: 'accountName',
|
||||
key: 'b.account_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
width: 200,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('收入分类'),
|
||||
dataIndex: 'categoryId',
|
||||
key: 'a.category_id',
|
||||
title: t('父级分类'),
|
||||
dataIndex: 'parentName',
|
||||
key: 'c.parent_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('收入分类'),
|
||||
dataIndex: 'categoryName',
|
||||
key: 'c.category_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('交易金额'),
|
||||
dataIndex: 'amount',
|
||||
@@ -124,26 +143,27 @@
|
||||
dataIndex: 'updateTime',
|
||||
key: 'a.update_time',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
width: 150,
|
||||
align: 'center',
|
||||
},
|
||||
];
|
||||
|
||||
const actionColumn: BasicColumn<ErpIncome> = {
|
||||
width: 160,
|
||||
align: 'center',
|
||||
actions: (record: ErpIncome) => [
|
||||
{
|
||||
icon: 'i-clarity:note-edit-line',
|
||||
title: t('编辑收入'),
|
||||
title: t('编辑'),
|
||||
onClick: handleForm.bind(this, { incomeId: record.incomeId }),
|
||||
auth: 'erp:income:edit',
|
||||
},
|
||||
{
|
||||
icon: 'i-ant-design:delete-outlined',
|
||||
color: 'error',
|
||||
title: t('删除收入'),
|
||||
title: t('删除'),
|
||||
popConfirm: {
|
||||
title: t('是否确认删除收入'),
|
||||
title: t('是否确认删除收入?'),
|
||||
confirm: handleDelete.bind(this, record),
|
||||
},
|
||||
auth: 'erp:income:edit',
|
||||
@@ -170,10 +190,10 @@
|
||||
await getForm().setFieldsValue(record.value);
|
||||
});
|
||||
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
function handleForm(record: Recordable) {
|
||||
openDrawer(true, record);
|
||||
openModal(true, record);
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
|
||||
Reference in New Issue
Block a user