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