mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-30 09:48:43 +08:00 
			
		
		
		
	Merge branch 'feature-budge-7.23-zqc' of https://gitee.com/hhyykk/ipms-sjy into feature-contract-7.22-wyw
# Conflicts: # yudao-module-cms/yudao-module-cms-api/src/main/java/cn/iocoder/yudao/module/cms/enums/ErrorCodeConstants.java
This commit is contained in:
		
							
								
								
									
										55
									
								
								sql/cms/ContractOuts-sql.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								sql/cms/ContractOuts-sql.sql
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,55 @@ | ||||
| -- 菜单 SQL | ||||
| INSERT INTO system_menu( | ||||
|     name, permission, type, sort, parent_id, | ||||
|     path, icon, component, status, component_name | ||||
| ) | ||||
| VALUES ( | ||||
|     '外包合同关联管理', '', 2, 0, 2758, | ||||
|     'contract-outs', '', 'cms/contractouts/index', 0, 'ContractOuts' | ||||
| ); | ||||
|  | ||||
| -- 按钮父菜单ID | ||||
| -- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码 | ||||
| SELECT @parentId := LAST_INSERT_ID(); | ||||
|  | ||||
| -- 按钮 SQL | ||||
| INSERT INTO system_menu( | ||||
|     name, permission, type, sort, parent_id, | ||||
|     path, icon, component, status | ||||
| ) | ||||
| VALUES ( | ||||
|     '外包合同关联查询', 'cms:contract-outs:query', 3, 1, @parentId, | ||||
|     '', '', '', 0 | ||||
| ); | ||||
| INSERT INTO system_menu( | ||||
|     name, permission, type, sort, parent_id, | ||||
|     path, icon, component, status | ||||
| ) | ||||
| VALUES ( | ||||
|     '外包合同关联创建', 'cms:contract-outs:create', 3, 2, @parentId, | ||||
|     '', '', '', 0 | ||||
| ); | ||||
| INSERT INTO system_menu( | ||||
|     name, permission, type, sort, parent_id, | ||||
|     path, icon, component, status | ||||
| ) | ||||
| VALUES ( | ||||
|     '外包合同关联更新', 'cms:contract-outs:update', 3, 3, @parentId, | ||||
|     '', '', '', 0 | ||||
| ); | ||||
| INSERT INTO system_menu( | ||||
|     name, permission, type, sort, parent_id, | ||||
|     path, icon, component, status | ||||
| ) | ||||
| VALUES ( | ||||
|     '外包合同关联删除', 'cms:contract-outs:delete', 3, 4, @parentId, | ||||
|     '', '', '', 0 | ||||
| ); | ||||
| INSERT INTO system_menu( | ||||
|     name, permission, type, sort, parent_id, | ||||
|     path, icon, component, status | ||||
| ) | ||||
| VALUES ( | ||||
|     '外包合同关联导出', 'cms:contract-outs:export', 3, 5, @parentId, | ||||
|     '', '', '', 0 | ||||
| ); | ||||
							
								
								
									
										55
									
								
								sql/cms/codegen-OutsContract-sql.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								sql/cms/codegen-OutsContract-sql.sql
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,55 @@ | ||||
| -- 菜单 SQL | ||||
| INSERT INTO system_menu( | ||||
|     name, permission, type, sort, parent_id, | ||||
|     path, icon, component, status, component_name | ||||
| ) | ||||
| VALUES ( | ||||
|     '外包合同管理', '', 2, 0, 2759, | ||||
|     'outs-contract', '', 'cms/outscontract/index', 0, 'OutsContract' | ||||
| ); | ||||
|  | ||||
| -- 按钮父菜单ID | ||||
| -- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码 | ||||
| SELECT @parentId := LAST_INSERT_ID(); | ||||
|  | ||||
| -- 按钮 SQL | ||||
| INSERT INTO system_menu( | ||||
|     name, permission, type, sort, parent_id, | ||||
|     path, icon, component, status | ||||
| ) | ||||
| VALUES ( | ||||
|     '外包合同查询', 'cms:outs-contract:query', 3, 1, @parentId, | ||||
|     '', '', '', 0 | ||||
| ); | ||||
| INSERT INTO system_menu( | ||||
|     name, permission, type, sort, parent_id, | ||||
|     path, icon, component, status | ||||
| ) | ||||
| VALUES ( | ||||
|     '外包合同创建', 'cms:outs-contract:create', 3, 2, @parentId, | ||||
|     '', '', '', 0 | ||||
| ); | ||||
| INSERT INTO system_menu( | ||||
|     name, permission, type, sort, parent_id, | ||||
|     path, icon, component, status | ||||
| ) | ||||
| VALUES ( | ||||
|     '外包合同更新', 'cms:outs-contract:update', 3, 3, @parentId, | ||||
|     '', '', '', 0 | ||||
| ); | ||||
| INSERT INTO system_menu( | ||||
|     name, permission, type, sort, parent_id, | ||||
|     path, icon, component, status | ||||
| ) | ||||
| VALUES ( | ||||
|     '外包合同删除', 'cms:outs-contract:delete', 3, 4, @parentId, | ||||
|     '', '', '', 0 | ||||
| ); | ||||
| INSERT INTO system_menu( | ||||
|     name, permission, type, sort, parent_id, | ||||
|     path, icon, component, status | ||||
| ) | ||||
| VALUES ( | ||||
|     '外包合同导出', 'cms:outs-contract:export', 3, 5, @parentId, | ||||
|     '', '', '', 0 | ||||
| ); | ||||
							
								
								
									
										55
									
								
								sql/cms/codegen-OutsContractHistory-sql.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								sql/cms/codegen-OutsContractHistory-sql.sql
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,55 @@ | ||||
| -- 菜单 SQL | ||||
| INSERT INTO system_menu( | ||||
|     name, permission, type, sort, parent_id, | ||||
|     path, icon, component, status, component_name | ||||
| ) | ||||
| VALUES ( | ||||
|     '外包合同历史管理', '', 2, 0, 2758, | ||||
|     'outs-contract-history', '', 'cms/outscontracthistory/index', 0, 'OutsContractHistory' | ||||
| ); | ||||
|  | ||||
| -- 按钮父菜单ID | ||||
| -- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码 | ||||
| SELECT @parentId := LAST_INSERT_ID(); | ||||
|  | ||||
| -- 按钮 SQL | ||||
| INSERT INTO system_menu( | ||||
|     name, permission, type, sort, parent_id, | ||||
|     path, icon, component, status | ||||
| ) | ||||
| VALUES ( | ||||
|     '外包合同历史查询', 'cms:outs-contract-history:query', 3, 1, @parentId, | ||||
|     '', '', '', 0 | ||||
| ); | ||||
| INSERT INTO system_menu( | ||||
|     name, permission, type, sort, parent_id, | ||||
|     path, icon, component, status | ||||
| ) | ||||
| VALUES ( | ||||
|     '外包合同历史创建', 'cms:outs-contract-history:create', 3, 2, @parentId, | ||||
|     '', '', '', 0 | ||||
| ); | ||||
| INSERT INTO system_menu( | ||||
|     name, permission, type, sort, parent_id, | ||||
|     path, icon, component, status | ||||
| ) | ||||
| VALUES ( | ||||
|     '外包合同历史更新', 'cms:outs-contract-history:update', 3, 3, @parentId, | ||||
|     '', '', '', 0 | ||||
| ); | ||||
| INSERT INTO system_menu( | ||||
|     name, permission, type, sort, parent_id, | ||||
|     path, icon, component, status | ||||
| ) | ||||
| VALUES ( | ||||
|     '外包合同历史删除', 'cms:outs-contract-history:delete', 3, 4, @parentId, | ||||
|     '', '', '', 0 | ||||
| ); | ||||
| INSERT INTO system_menu( | ||||
|     name, permission, type, sort, parent_id, | ||||
|     path, icon, component, status | ||||
| ) | ||||
| VALUES ( | ||||
|     '外包合同历史导出', 'cms:outs-contract-history:export', 3, 5, @parentId, | ||||
|     '', '', '', 0 | ||||
| ); | ||||
| @@ -8,12 +8,13 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode; | ||||
|  * @date 2024/7/3 | ||||
|  */ | ||||
| public interface ErrorCodeConstants { | ||||
|     ErrorCode CUSTOMER_COMPANY_NOT_EXISTS = new ErrorCode(1_020_000_000, "客户公司管理不存在"); | ||||
|  | ||||
|     ErrorCode CONTRACT_NOT_EXISTS = new ErrorCode(2_020_000_000, "合同不存在"); | ||||
|  | ||||
|     ErrorCode EXT_CONTRACT_NOT_EXISTS = new ErrorCode(2_021_000_000, "外部合同不存在"); | ||||
|  | ||||
|  | ||||
|  | ||||
|     // ========== 外包合同 2_021_000_000 ========== | ||||
|     ErrorCode OUTS_CONTRACT_NOT_EXISTS = new ErrorCode(2_021_000_000, "外包合同不存在"); | ||||
|  | ||||
|     // ========== 外包合同历史 2_022_000_000 ========== | ||||
|     ErrorCode OUTS_CONTRACT_HISTORY_NOT_EXISTS = new ErrorCode(2_022_000_000, "外包合同历史不存在"); | ||||
|     // ========== 外包合同关联 2_023_000_000 ========== | ||||
|     ErrorCode CONTRACT_OUTS_NOT_EXISTS = new ErrorCode(2_023_000_000, "外包合同关联不存在"); | ||||
| } | ||||
|   | ||||
| @@ -0,0 +1,95 @@ | ||||
| package cn.iocoder.yudao.module.cms.controller.admin.contractouts; | ||||
|  | ||||
| import org.springframework.web.bind.annotation.*; | ||||
| import jakarta.annotation.Resource; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import io.swagger.v3.oas.annotations.Parameter; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
|  | ||||
| import jakarta.validation.constraints.*; | ||||
| import jakarta.validation.*; | ||||
| import jakarta.servlet.http.*; | ||||
| import java.util.*; | ||||
| import java.io.IOException; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; | ||||
| import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; | ||||
|  | ||||
| import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.*; | ||||
| import cn.iocoder.yudao.module.cms.dal.dataobject.contractouts.ContractOutsDO; | ||||
| import cn.iocoder.yudao.module.cms.service.contractouts.ContractOutsService; | ||||
|  | ||||
| @Tag(name = "管理后台 - 外包合同关联") | ||||
| @RestController | ||||
| @RequestMapping("/cms/contract-outs") | ||||
| @Validated | ||||
| public class ContractOutsController { | ||||
|  | ||||
|     @Resource | ||||
|     private ContractOutsService contractOutsService; | ||||
|  | ||||
|     @PostMapping("/create") | ||||
|     @Operation(summary = "创建外包合同关联") | ||||
|     @PreAuthorize("@ss.hasPermission('cms:contract-outs:create')") | ||||
|     public CommonResult<Long> createContractOuts(@Valid @RequestBody ContractOutsSaveReqVO createReqVO) { | ||||
|         return success(contractOutsService.createContractOuts(createReqVO)); | ||||
|     } | ||||
|  | ||||
|     @PutMapping("/update") | ||||
|     @Operation(summary = "更新外包合同关联") | ||||
|     @PreAuthorize("@ss.hasPermission('cms:contract-outs:update')") | ||||
|     public CommonResult<Boolean> updateContractOuts(@Valid @RequestBody ContractOutsSaveReqVO updateReqVO) { | ||||
|         contractOutsService.updateContractOuts(updateReqVO); | ||||
|         return success(true); | ||||
|     } | ||||
|  | ||||
|     @DeleteMapping("/delete") | ||||
|     @Operation(summary = "删除外包合同关联") | ||||
|     @Parameter(name = "id", description = "编号", required = true) | ||||
|     @PreAuthorize("@ss.hasPermission('cms:contract-outs:delete')") | ||||
|     public CommonResult<Boolean> deleteContractOuts(@RequestParam("id") Long id) { | ||||
|         contractOutsService.deleteContractOuts(id); | ||||
|         return success(true); | ||||
|     } | ||||
|  | ||||
|     @GetMapping("/get") | ||||
|     @Operation(summary = "获得外包合同关联") | ||||
|     @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||||
|     @PreAuthorize("@ss.hasPermission('cms:contract-outs:query')") | ||||
|     public CommonResult<ContractOutsRespVO> getContractOuts(@RequestParam("id") Long id) { | ||||
|         ContractOutsDO contractOuts = contractOutsService.getContractOuts(id); | ||||
|         return success(BeanUtils.toBean(contractOuts, ContractOutsRespVO.class)); | ||||
|     } | ||||
|  | ||||
|     @GetMapping("/page") | ||||
|     @Operation(summary = "获得外包合同关联分页") | ||||
|     @PreAuthorize("@ss.hasPermission('cms:contract-outs:query')") | ||||
|     public CommonResult<PageResult<ContractOutsRespVO>> getContractOutsPage(@Valid ContractOutsPageReqVO pageReqVO) { | ||||
|         PageResult<ContractOutsDO> pageResult = contractOutsService.getContractOutsPage(pageReqVO); | ||||
|         return success(BeanUtils.toBean(pageResult, ContractOutsRespVO.class)); | ||||
|     } | ||||
|  | ||||
|     @GetMapping("/export-excel") | ||||
|     @Operation(summary = "导出外包合同关联 Excel") | ||||
|     @PreAuthorize("@ss.hasPermission('cms:contract-outs:export')") | ||||
|     @ApiAccessLog(operateType = EXPORT) | ||||
|     public void exportContractOutsExcel(@Valid ContractOutsPageReqVO pageReqVO, | ||||
|               HttpServletResponse response) throws IOException { | ||||
|         pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); | ||||
|         List<ContractOutsDO> list = contractOutsService.getContractOutsPage(pageReqVO).getList(); | ||||
|         // 导出 Excel | ||||
|         ExcelUtils.write(response, "外包合同关联.xls", "数据", ContractOutsRespVO.class, | ||||
|                         BeanUtils.toBean(list, ContractOutsRespVO.class)); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,44 @@ | ||||
| package cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo; | ||||
|  | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import org.springframework.format.annotation.DateTimeFormat; | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
|  | ||||
| @Schema(description = "管理后台 - 外包合同关联分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class ContractOutsPageReqVO extends PageParam { | ||||
|  | ||||
|     @Schema(description = "合同id", example = "16187") | ||||
|     private Long contractId; | ||||
|  | ||||
|     @Schema(description = "外包合同id", example = "9277") | ||||
|     private Long outsContractId; | ||||
|  | ||||
|     @Schema(description = "创建人") | ||||
|     private String creator; | ||||
|  | ||||
|     @Schema(description = "创建时间") | ||||
|     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||
|     private LocalDateTime[] cteateTime; | ||||
|  | ||||
|     @Schema(description = "更新人") | ||||
|     private String updator; | ||||
|  | ||||
|     @Schema(description = "更新时间") | ||||
|     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||
|     private LocalDateTime[] updateTime; | ||||
|  | ||||
|     @Schema(description = "是否删除") | ||||
|     private Boolean delete; | ||||
|  | ||||
|     @Schema(description = "租户id", example = "15943") | ||||
|     private Long tenantId; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,51 @@ | ||||
| package cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo; | ||||
|  | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import org.springframework.format.annotation.DateTimeFormat; | ||||
| import java.time.LocalDateTime; | ||||
| import com.alibaba.excel.annotation.*; | ||||
|  | ||||
| @Schema(description = "管理后台 - 外包合同关联 Response VO") | ||||
| @Data | ||||
| @ExcelIgnoreUnannotated | ||||
| public class ContractOutsRespVO { | ||||
|  | ||||
|     @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "7688") | ||||
|     @ExcelProperty("主键") | ||||
|     private Long id; | ||||
|  | ||||
|     @Schema(description = "合同id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16187") | ||||
|     @ExcelProperty("合同id") | ||||
|     private Long contractId; | ||||
|  | ||||
|     @Schema(description = "外包合同id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9277") | ||||
|     @ExcelProperty("外包合同id") | ||||
|     private Long outsContractId; | ||||
|  | ||||
|     @Schema(description = "创建人", requiredMode = Schema.RequiredMode.REQUIRED) | ||||
|     @ExcelProperty("创建人") | ||||
|     private String creator; | ||||
|  | ||||
|     @Schema(description = "创建时间") | ||||
|     @ExcelProperty("创建时间") | ||||
|     private LocalDateTime cteateTime; | ||||
|  | ||||
|     @Schema(description = "更新人", requiredMode = Schema.RequiredMode.REQUIRED) | ||||
|     @ExcelProperty("更新人") | ||||
|     private String updator; | ||||
|  | ||||
|     @Schema(description = "更新时间") | ||||
|     @ExcelProperty("更新时间") | ||||
|     private LocalDateTime updateTime; | ||||
|  | ||||
|     @Schema(description = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED) | ||||
|     @ExcelProperty("是否删除") | ||||
|     private Boolean delete; | ||||
|  | ||||
|     @Schema(description = "租户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15943") | ||||
|     @ExcelProperty("租户id") | ||||
|     private Long tenantId; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,47 @@ | ||||
| package cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo; | ||||
|  | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import jakarta.validation.constraints.*; | ||||
| import org.springframework.format.annotation.DateTimeFormat; | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| @Schema(description = "管理后台 - 外包合同关联新增/修改 Request VO") | ||||
| @Data | ||||
| public class ContractOutsSaveReqVO { | ||||
|  | ||||
|     @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "7688") | ||||
|     private Long id; | ||||
|  | ||||
|     @Schema(description = "合同id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16187") | ||||
|     @NotNull(message = "合同id不能为空") | ||||
|     private Long contractId; | ||||
|  | ||||
|     @Schema(description = "外包合同id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9277") | ||||
|     @NotNull(message = "外包合同id不能为空") | ||||
|     private Long outsContractId; | ||||
|  | ||||
|     @Schema(description = "创建人", requiredMode = Schema.RequiredMode.REQUIRED) | ||||
|     @NotEmpty(message = "创建人不能为空") | ||||
|     private String creator; | ||||
|  | ||||
|     @Schema(description = "创建时间") | ||||
|     private LocalDateTime cteateTime; | ||||
|  | ||||
|     @Schema(description = "更新人", requiredMode = Schema.RequiredMode.REQUIRED) | ||||
|     @NotEmpty(message = "更新人不能为空") | ||||
|     private String updator; | ||||
|  | ||||
|     @Schema(description = "更新时间") | ||||
|     private LocalDateTime updateTime; | ||||
|  | ||||
|     @Schema(description = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED) | ||||
|     @NotNull(message = "是否删除不能为空") | ||||
|     private Boolean delete; | ||||
|  | ||||
|     @Schema(description = "租户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15943") | ||||
|     @NotNull(message = "租户id不能为空") | ||||
|     private Long tenantId; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,95 @@ | ||||
| package cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory; | ||||
|  | ||||
| import org.springframework.web.bind.annotation.*; | ||||
| import jakarta.annotation.Resource; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import io.swagger.v3.oas.annotations.Parameter; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
|  | ||||
| import jakarta.validation.constraints.*; | ||||
| import jakarta.validation.*; | ||||
| import jakarta.servlet.http.*; | ||||
| import java.util.*; | ||||
| import java.io.IOException; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; | ||||
| import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; | ||||
|  | ||||
| import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.*; | ||||
| import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO; | ||||
| import cn.iocoder.yudao.module.cms.service.outscontracthistory.OutsContractHistoryService; | ||||
|  | ||||
| @Tag(name = "管理后台 - 外包合同历史") | ||||
| @RestController | ||||
| @RequestMapping("/cms/outs-contract-history") | ||||
| @Validated | ||||
| public class OutsContractHistoryController { | ||||
|  | ||||
|     @Resource | ||||
|     private OutsContractHistoryService outsContractHistoryService; | ||||
|  | ||||
|     @PostMapping("/create") | ||||
|     @Operation(summary = "创建外包合同历史") | ||||
|     @PreAuthorize("@ss.hasPermission('cms:outs-contract-history:create')") | ||||
|     public CommonResult<Long> createOutsContractHistory(@Valid @RequestBody OutsContractHistorySaveReqVO createReqVO) { | ||||
|         return success(outsContractHistoryService.createOutsContractHistory(createReqVO)); | ||||
|     } | ||||
|  | ||||
|     @PutMapping("/update") | ||||
|     @Operation(summary = "更新外包合同历史") | ||||
|     @PreAuthorize("@ss.hasPermission('cms:outs-contract-history:update')") | ||||
|     public CommonResult<Boolean> updateOutsContractHistory(@Valid @RequestBody OutsContractHistorySaveReqVO updateReqVO) { | ||||
|         outsContractHistoryService.updateOutsContractHistory(updateReqVO); | ||||
|         return success(true); | ||||
|     } | ||||
|  | ||||
|     @DeleteMapping("/delete") | ||||
|     @Operation(summary = "删除外包合同历史") | ||||
|     @Parameter(name = "id", description = "编号", required = true) | ||||
|     @PreAuthorize("@ss.hasPermission('cms:outs-contract-history:delete')") | ||||
|     public CommonResult<Boolean> deleteOutsContractHistory(@RequestParam("id") Long id) { | ||||
|         outsContractHistoryService.deleteOutsContractHistory(id); | ||||
|         return success(true); | ||||
|     } | ||||
|  | ||||
|     @GetMapping("/get") | ||||
|     @Operation(summary = "获得外包合同历史") | ||||
|     @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||||
|     @PreAuthorize("@ss.hasPermission('cms:outs-contract-history:query')") | ||||
|     public CommonResult<OutsContractHistoryRespVO> getOutsContractHistory(@RequestParam("id") Long id) { | ||||
|         OutsContractHistoryDO outsContractHistory = outsContractHistoryService.getOutsContractHistory(id); | ||||
|         return success(BeanUtils.toBean(outsContractHistory, OutsContractHistoryRespVO.class)); | ||||
|     } | ||||
|  | ||||
|     @GetMapping("/page") | ||||
|     @Operation(summary = "获得外包合同历史分页") | ||||
|     @PreAuthorize("@ss.hasPermission('cms:outs-contract-history:query')") | ||||
|     public CommonResult<PageResult<OutsContractHistoryRespVO>> getOutsContractHistoryPage(@Valid OutsContractHistoryPageReqVO pageReqVO) { | ||||
|         PageResult<OutsContractHistoryDO> pageResult = outsContractHistoryService.getOutsContractHistoryPage(pageReqVO); | ||||
|         return success(BeanUtils.toBean(pageResult, OutsContractHistoryRespVO.class)); | ||||
|     } | ||||
|  | ||||
|     @GetMapping("/export-excel") | ||||
|     @Operation(summary = "导出外包合同历史 Excel") | ||||
|     @PreAuthorize("@ss.hasPermission('cms:outs-contract-history:export')") | ||||
|     @ApiAccessLog(operateType = EXPORT) | ||||
|     public void exportOutsContractHistoryExcel(@Valid OutsContractHistoryPageReqVO pageReqVO, | ||||
|               HttpServletResponse response) throws IOException { | ||||
|         pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); | ||||
|         List<OutsContractHistoryDO> list = outsContractHistoryService.getOutsContractHistoryPage(pageReqVO).getList(); | ||||
|         // 导出 Excel | ||||
|         ExcelUtils.write(response, "外包合同历史.xls", "数据", OutsContractHistoryRespVO.class, | ||||
|                         BeanUtils.toBean(list, OutsContractHistoryRespVO.class)); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,66 @@ | ||||
| package cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo; | ||||
|  | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import java.math.BigDecimal; | ||||
| import org.springframework.format.annotation.DateTimeFormat; | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
|  | ||||
| @Schema(description = "管理后台 - 外包合同历史分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class OutsContractHistoryPageReqVO extends PageParam { | ||||
|  | ||||
|     @Schema(description = "项目id", example = "31803") | ||||
|     private Long projectId; | ||||
|  | ||||
|     @Schema(description = "合同名称", example = "芋艿") | ||||
|     private String name; | ||||
|  | ||||
|     @Schema(description = "主合同id", example = "19949") | ||||
|     private Long contractId; | ||||
|  | ||||
|     @Schema(description = "类型", example = "1") | ||||
|     private String countType; | ||||
|  | ||||
|     @Schema(description = "合同金额") | ||||
|     private BigDecimal amount; | ||||
|  | ||||
|     @Schema(description = "编号") | ||||
|     private String code; | ||||
|  | ||||
|     @Schema(description = "专业") | ||||
|     private String major; | ||||
|  | ||||
|     @Schema(description = "流程实体id", example = "32397") | ||||
|     private String processInstanceId; | ||||
|  | ||||
|     @Schema(description = "签订时间") | ||||
|     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||
|     private LocalDateTime[] signingTime; | ||||
|  | ||||
|     @Schema(description = "结算数") | ||||
|     private BigDecimal settlementAmount; | ||||
|  | ||||
|     @Schema(description = "合同文件url", example = "https://www.iocoder.cn") | ||||
|     private String contractFileUrl; | ||||
|  | ||||
|     @Schema(description = "创建时间") | ||||
|     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||
|     private LocalDateTime[] createTime; | ||||
|  | ||||
|     @Schema(description = "流程状态", example = "2") | ||||
|     private String processStatus; | ||||
|  | ||||
|     @Schema(description = "外包合同id", example = "24736") | ||||
|     private Long outsContractId; | ||||
|  | ||||
|     @Schema(description = "版本") | ||||
|     private String version; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,84 @@ | ||||
| package cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo; | ||||
|  | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import java.math.BigDecimal; | ||||
| import org.springframework.format.annotation.DateTimeFormat; | ||||
| import java.time.LocalDateTime; | ||||
| import com.alibaba.excel.annotation.*; | ||||
| import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | ||||
| import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | ||||
|  | ||||
| @Schema(description = "管理后台 - 外包合同历史 Response VO") | ||||
| @Data | ||||
| @ExcelIgnoreUnannotated | ||||
| public class OutsContractHistoryRespVO { | ||||
|  | ||||
|     @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16040") | ||||
|     @ExcelProperty("主键") | ||||
|     private Long id; | ||||
|  | ||||
|     @Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "31803") | ||||
|     @ExcelProperty("项目id") | ||||
|     private Long projectId; | ||||
|  | ||||
|     @Schema(description = "合同名称", example = "芋艿") | ||||
|     @ExcelProperty("合同名称") | ||||
|     private String name; | ||||
|  | ||||
|     @Schema(description = "主合同id", example = "19949") | ||||
|     @ExcelProperty("主合同id") | ||||
|     private Long contractId; | ||||
|  | ||||
|     @Schema(description = "类型", example = "1") | ||||
|     @ExcelProperty(value = "类型", converter = DictConvert.class) | ||||
|     @DictFormat("contract_billing_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 | ||||
|     private String countType; | ||||
|  | ||||
|     @Schema(description = "合同金额") | ||||
|     @ExcelProperty("合同金额") | ||||
|     private BigDecimal amount; | ||||
|  | ||||
|     @Schema(description = "编号") | ||||
|     @ExcelProperty("编号") | ||||
|     private String code; | ||||
|  | ||||
|     @Schema(description = "专业") | ||||
|     @ExcelProperty(value = "专业", converter = DictConvert.class) | ||||
|     @DictFormat("major") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 | ||||
|     private String major; | ||||
|  | ||||
|     @Schema(description = "流程实体id", example = "32397") | ||||
|     @ExcelProperty("流程实体id") | ||||
|     private String processInstanceId; | ||||
|  | ||||
|     @Schema(description = "签订时间") | ||||
|     @ExcelProperty("签订时间") | ||||
|     private LocalDateTime signingTime; | ||||
|  | ||||
|     @Schema(description = "结算数") | ||||
|     @ExcelProperty("结算数") | ||||
|     private BigDecimal settlementAmount; | ||||
|  | ||||
|     @Schema(description = "合同文件url", example = "https://www.iocoder.cn") | ||||
|     @ExcelProperty("合同文件url") | ||||
|     private String contractFileUrl; | ||||
|  | ||||
|     @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | ||||
|     @ExcelProperty("创建时间") | ||||
|     private LocalDateTime createTime; | ||||
|  | ||||
|     @Schema(description = "流程状态", example = "2") | ||||
|     @ExcelProperty("流程状态") | ||||
|     private String processStatus; | ||||
|  | ||||
|     @Schema(description = "外包合同id", example = "24736") | ||||
|     @ExcelProperty("外包合同id") | ||||
|     private Long outsContractId; | ||||
|  | ||||
|     @Schema(description = "版本") | ||||
|     @ExcelProperty("版本") | ||||
|     private String version; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,61 @@ | ||||
| package cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo; | ||||
|  | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import jakarta.validation.constraints.*; | ||||
| import java.math.BigDecimal; | ||||
| import org.springframework.format.annotation.DateTimeFormat; | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| @Schema(description = "管理后台 - 外包合同历史新增/修改 Request VO") | ||||
| @Data | ||||
| public class OutsContractHistorySaveReqVO { | ||||
|  | ||||
|     @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16040") | ||||
|     private Long id; | ||||
|  | ||||
|     @Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "31803") | ||||
|     @NotNull(message = "项目id不能为空") | ||||
|     private Long projectId; | ||||
|  | ||||
|     @Schema(description = "合同名称", example = "芋艿") | ||||
|     private String name; | ||||
|  | ||||
|     @Schema(description = "主合同id", example = "19949") | ||||
|     private Long contractId; | ||||
|  | ||||
|     @Schema(description = "类型", example = "1") | ||||
|     private String countType; | ||||
|  | ||||
|     @Schema(description = "合同金额") | ||||
|     private BigDecimal amount; | ||||
|  | ||||
|     @Schema(description = "编号") | ||||
|     private String code; | ||||
|  | ||||
|     @Schema(description = "专业") | ||||
|     private String major; | ||||
|  | ||||
|     @Schema(description = "流程实体id", example = "32397") | ||||
|     private String processInstanceId; | ||||
|  | ||||
|     @Schema(description = "签订时间") | ||||
|     private LocalDateTime signingTime; | ||||
|  | ||||
|     @Schema(description = "结算数") | ||||
|     private BigDecimal settlementAmount; | ||||
|  | ||||
|     @Schema(description = "合同文件url", example = "https://www.iocoder.cn") | ||||
|     private String contractFileUrl; | ||||
|  | ||||
|     @Schema(description = "流程状态", example = "2") | ||||
|     private String processStatus; | ||||
|  | ||||
|     @Schema(description = "外包合同id", example = "24736") | ||||
|     private Long outsContractId; | ||||
|  | ||||
|     @Schema(description = "版本") | ||||
|     private String version; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,55 @@ | ||||
| package cn.iocoder.yudao.module.cms.dal.dataobject.contractouts; | ||||
|  | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import java.time.LocalDateTime; | ||||
| import java.time.LocalDateTime; | ||||
| import com.baomidou.mybatisplus.annotation.*; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
|  | ||||
| /** | ||||
|  * 外包合同关联 DO | ||||
|  * | ||||
|  * @author zqc | ||||
|  */ | ||||
| @TableName("cms_contract_outs") | ||||
| @KeySequence("cms_contract_outs_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class ContractOutsDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 主键 | ||||
|      */ | ||||
|     @TableId | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 合同id | ||||
|      */ | ||||
|     private Long contractId; | ||||
|     /** | ||||
|      * 外包合同id | ||||
|      */ | ||||
|     private Long outsContractId; | ||||
|     /** | ||||
|      * 创建时间 | ||||
|      */ | ||||
|     private LocalDateTime cteateTime; | ||||
|     /** | ||||
|      * 更新人 | ||||
|      */ | ||||
|     private String updator; | ||||
|     /** | ||||
|      * 是否删除 | ||||
|      */ | ||||
|     private Boolean delete; | ||||
|  | ||||
|     /** | ||||
|      * 租户id | ||||
|      */ | ||||
|     private String tenantId; | ||||
| } | ||||
| @@ -0,0 +1,78 @@ | ||||
| package cn.iocoder.yudao.module.cms.dal.dataobject.outscontract; | ||||
|  | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import java.math.BigDecimal; | ||||
| import java.time.LocalDateTime; | ||||
| import java.math.BigDecimal; | ||||
| import java.time.LocalDateTime; | ||||
| import java.time.LocalDateTime; | ||||
| import com.baomidou.mybatisplus.annotation.*; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
|  | ||||
| /** | ||||
|  * 外包合同 DO | ||||
|  * | ||||
|  * @author zqc | ||||
|  */ | ||||
| @TableName("cms_outs_contract") | ||||
| @KeySequence("cms_outs_contract_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class OutsContractDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 主键 | ||||
|      */ | ||||
|     @TableId | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 项目id | ||||
|      */ | ||||
|     private Long projectId; | ||||
|     /** | ||||
|      * 合同名称 | ||||
|      */ | ||||
|     private String name; | ||||
|     /** | ||||
|      * 主合同id | ||||
|      */ | ||||
|     private Long contractId; | ||||
|     /** | ||||
|      * 类型 | ||||
|      * | ||||
|      * 枚举 {@link TODO contract_billing_type 对应的类} | ||||
|      */ | ||||
|     private String countType; | ||||
|     /** | ||||
|      * 合同金额 | ||||
|      */ | ||||
|     private BigDecimal amount; | ||||
|     /** | ||||
|      * 编号 | ||||
|      */ | ||||
|     private String code; | ||||
|     /** | ||||
|      * 专业 | ||||
|      * | ||||
|      * 枚举 {@link TODO major 对应的类} | ||||
|      */ | ||||
|     private String major; | ||||
|     /** | ||||
|      * 签订时间 | ||||
|      */ | ||||
|     private LocalDateTime signingTime; | ||||
|     /** | ||||
|      * 结算数 | ||||
|      */ | ||||
|     private BigDecimal settlementAmount; | ||||
|     /** | ||||
|      * 合同文件url | ||||
|      */ | ||||
|     private String contractFileUrl; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,94 @@ | ||||
| package cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory; | ||||
|  | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import java.math.BigDecimal; | ||||
| import java.time.LocalDateTime; | ||||
| import java.math.BigDecimal; | ||||
| import java.time.LocalDateTime; | ||||
| import java.time.LocalDateTime; | ||||
| import com.baomidou.mybatisplus.annotation.*; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
|  | ||||
| /** | ||||
|  * 外包合同历史 DO | ||||
|  * | ||||
|  * @author zqc | ||||
|  */ | ||||
| @TableName("cms_outs_contract_history") | ||||
| @KeySequence("cms_outs_contract_history_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class OutsContractHistoryDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 主键 | ||||
|      */ | ||||
|     @TableId | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 项目id | ||||
|      */ | ||||
|     private Long projectId; | ||||
|     /** | ||||
|      * 合同名称 | ||||
|      */ | ||||
|     private String name; | ||||
|     /** | ||||
|      * 主合同id | ||||
|      */ | ||||
|     private Long contractId; | ||||
|     /** | ||||
|      * 类型 | ||||
|      * | ||||
|      * 枚举 {@link TODO contract_billing_type 对应的类} | ||||
|      */ | ||||
|     private String countType; | ||||
|     /** | ||||
|      * 合同金额 | ||||
|      */ | ||||
|     private BigDecimal amount; | ||||
|     /** | ||||
|      * 编号 | ||||
|      */ | ||||
|     private String code; | ||||
|     /** | ||||
|      * 专业 | ||||
|      * | ||||
|      * 枚举 {@link TODO major 对应的类} | ||||
|      */ | ||||
|     private String major; | ||||
|     /** | ||||
|      * 流程实体id | ||||
|      */ | ||||
|     private String processInstanceId; | ||||
|     /** | ||||
|      * 签订时间 | ||||
|      */ | ||||
|     private LocalDateTime signingTime; | ||||
|     /** | ||||
|      * 结算数 | ||||
|      */ | ||||
|     private BigDecimal settlementAmount; | ||||
|     /** | ||||
|      * 合同文件url | ||||
|      */ | ||||
|     private String contractFileUrl; | ||||
|     /** | ||||
|      * 流程状态 | ||||
|      */ | ||||
|     private String processStatus; | ||||
|     /** | ||||
|      * 外包合同id | ||||
|      */ | ||||
|     private Long outsContractId; | ||||
|     /** | ||||
|      * 版本 | ||||
|      */ | ||||
|     private String version; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,33 @@ | ||||
| package cn.iocoder.yudao.module.cms.dal.mysql.contractouts; | ||||
|  | ||||
| import java.util.*; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import cn.iocoder.yudao.module.cms.dal.dataobject.contractouts.ContractOutsDO; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.*; | ||||
|  | ||||
| /** | ||||
|  * 外包合同关联 Mapper | ||||
|  * | ||||
|  * @author zqc | ||||
|  */ | ||||
| @Mapper | ||||
| public interface ContractOutsMapper extends BaseMapperX<ContractOutsDO> { | ||||
|  | ||||
|     default PageResult<ContractOutsDO> selectPage(ContractOutsPageReqVO reqVO) { | ||||
|         return selectPage(reqVO, new LambdaQueryWrapperX<ContractOutsDO>() | ||||
|                 .eqIfPresent(ContractOutsDO::getContractId, reqVO.getContractId()) | ||||
|                 .eqIfPresent(ContractOutsDO::getOutsContractId, reqVO.getOutsContractId()) | ||||
|                 .eqIfPresent(ContractOutsDO::getCreator, reqVO.getCreator()) | ||||
|                 .betweenIfPresent(ContractOutsDO::getCteateTime, reqVO.getCteateTime()) | ||||
|                 .eqIfPresent(ContractOutsDO::getUpdator, reqVO.getUpdator()) | ||||
|                 .betweenIfPresent(ContractOutsDO::getUpdateTime, reqVO.getUpdateTime()) | ||||
|                 .eqIfPresent(ContractOutsDO::getDelete, reqVO.getDelete()) | ||||
|                 .eqIfPresent(ContractOutsDO::getTenantId, reqVO.getTenantId()) | ||||
|                 .orderByDesc(ContractOutsDO::getId)); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,36 @@ | ||||
| package cn.iocoder.yudao.module.cms.dal.mysql.outscontract; | ||||
|  | ||||
| import java.util.*; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import cn.iocoder.yudao.module.cms.dal.dataobject.outscontract.OutsContractDO; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.*; | ||||
|  | ||||
| /** | ||||
|  * 外包合同 Mapper | ||||
|  * | ||||
|  * @author zqc | ||||
|  */ | ||||
| @Mapper | ||||
| public interface OutsContractMapper extends BaseMapperX<OutsContractDO> { | ||||
|  | ||||
|     default PageResult<OutsContractDO> selectPage(OutsContractPageReqVO reqVO) { | ||||
|         return selectPage(reqVO, new LambdaQueryWrapperX<OutsContractDO>() | ||||
|                 .eqIfPresent(OutsContractDO::getProjectId, reqVO.getProjectId()) | ||||
|                 .likeIfPresent(OutsContractDO::getName, reqVO.getName()) | ||||
|                 .eqIfPresent(OutsContractDO::getContractId, reqVO.getContractId()) | ||||
|                 .eqIfPresent(OutsContractDO::getCountType, reqVO.getCountType()) | ||||
|                 .eqIfPresent(OutsContractDO::getAmount, reqVO.getAmount()) | ||||
|                 .eqIfPresent(OutsContractDO::getCode, reqVO.getCode()) | ||||
|                 .eqIfPresent(OutsContractDO::getMajor, reqVO.getMajor()) | ||||
|                 .betweenIfPresent(OutsContractDO::getSigningTime, reqVO.getSigningTime()) | ||||
|                 .eqIfPresent(OutsContractDO::getSettlementAmount, reqVO.getSettlementAmount()) | ||||
|                 .eqIfPresent(OutsContractDO::getContractFileUrl, reqVO.getContractFileUrl()) | ||||
|                 .betweenIfPresent(OutsContractDO::getCreateTime, reqVO.getCreateTime()) | ||||
|                 .orderByDesc(OutsContractDO::getId)); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,40 @@ | ||||
| package cn.iocoder.yudao.module.cms.dal.mysql.outscontracthistory; | ||||
|  | ||||
| import java.util.*; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.*; | ||||
|  | ||||
| /** | ||||
|  * 外包合同历史 Mapper | ||||
|  * | ||||
|  * @author zqc | ||||
|  */ | ||||
| @Mapper | ||||
| public interface OutsContractHistoryMapper extends BaseMapperX<OutsContractHistoryDO> { | ||||
|  | ||||
|     default PageResult<OutsContractHistoryDO> selectPage(OutsContractHistoryPageReqVO reqVO) { | ||||
|         return selectPage(reqVO, new LambdaQueryWrapperX<OutsContractHistoryDO>() | ||||
|                 .eqIfPresent(OutsContractHistoryDO::getProjectId, reqVO.getProjectId()) | ||||
|                 .likeIfPresent(OutsContractHistoryDO::getName, reqVO.getName()) | ||||
|                 .eqIfPresent(OutsContractHistoryDO::getContractId, reqVO.getContractId()) | ||||
|                 .eqIfPresent(OutsContractHistoryDO::getCountType, reqVO.getCountType()) | ||||
|                 .eqIfPresent(OutsContractHistoryDO::getAmount, reqVO.getAmount()) | ||||
|                 .eqIfPresent(OutsContractHistoryDO::getCode, reqVO.getCode()) | ||||
|                 .eqIfPresent(OutsContractHistoryDO::getMajor, reqVO.getMajor()) | ||||
|                 .eqIfPresent(OutsContractHistoryDO::getProcessInstanceId, reqVO.getProcessInstanceId()) | ||||
|                 .betweenIfPresent(OutsContractHistoryDO::getSigningTime, reqVO.getSigningTime()) | ||||
|                 .eqIfPresent(OutsContractHistoryDO::getSettlementAmount, reqVO.getSettlementAmount()) | ||||
|                 .eqIfPresent(OutsContractHistoryDO::getContractFileUrl, reqVO.getContractFileUrl()) | ||||
|                 .betweenIfPresent(OutsContractHistoryDO::getCreateTime, reqVO.getCreateTime()) | ||||
|                 .eqIfPresent(OutsContractHistoryDO::getProcessStatus, reqVO.getProcessStatus()) | ||||
|                 .eqIfPresent(OutsContractHistoryDO::getOutsContractId, reqVO.getOutsContractId()) | ||||
|                 .eqIfPresent(OutsContractHistoryDO::getVersion, reqVO.getVersion()) | ||||
|                 .orderByDesc(OutsContractHistoryDO::getId)); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,55 @@ | ||||
| package cn.iocoder.yudao.module.cms.service.contractouts; | ||||
|  | ||||
| import java.util.*; | ||||
| import jakarta.validation.*; | ||||
| import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.*; | ||||
| import cn.iocoder.yudao.module.cms.dal.dataobject.contractouts.ContractOutsDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
|  | ||||
| /** | ||||
|  * 外包合同关联 Service 接口 | ||||
|  * | ||||
|  * @author zqc | ||||
|  */ | ||||
| public interface ContractOutsService { | ||||
|  | ||||
|     /** | ||||
|      * 创建外包合同关联 | ||||
|      * | ||||
|      * @param createReqVO 创建信息 | ||||
|      * @return 编号 | ||||
|      */ | ||||
|     Long createContractOuts(@Valid ContractOutsSaveReqVO createReqVO); | ||||
|  | ||||
|     /** | ||||
|      * 更新外包合同关联 | ||||
|      * | ||||
|      * @param updateReqVO 更新信息 | ||||
|      */ | ||||
|     void updateContractOuts(@Valid ContractOutsSaveReqVO updateReqVO); | ||||
|  | ||||
|     /** | ||||
|      * 删除外包合同关联 | ||||
|      * | ||||
|      * @param id 编号 | ||||
|      */ | ||||
|     void deleteContractOuts(Long id); | ||||
|  | ||||
|     /** | ||||
|      * 获得外包合同关联 | ||||
|      * | ||||
|      * @param id 编号 | ||||
|      * @return 外包合同关联 | ||||
|      */ | ||||
|     ContractOutsDO getContractOuts(Long id); | ||||
|  | ||||
|     /** | ||||
|      * 获得外包合同关联分页 | ||||
|      * | ||||
|      * @param pageReqVO 分页查询 | ||||
|      * @return 外包合同关联分页 | ||||
|      */ | ||||
|     PageResult<ContractOutsDO> getContractOutsPage(ContractOutsPageReqVO pageReqVO); | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,74 @@ | ||||
| package cn.iocoder.yudao.module.cms.service.contractouts; | ||||
|  | ||||
| import org.springframework.stereotype.Service; | ||||
| import jakarta.annotation.Resource; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
|  | ||||
| import java.util.*; | ||||
| import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.*; | ||||
| import cn.iocoder.yudao.module.cms.dal.dataobject.contractouts.ContractOutsDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||||
|  | ||||
| import cn.iocoder.yudao.module.cms.dal.mysql.contractouts.ContractOutsMapper; | ||||
|  | ||||
| import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | ||||
| import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*; | ||||
|  | ||||
| /** | ||||
|  * 外包合同关联 Service 实现类 | ||||
|  * | ||||
|  * @author zqc | ||||
|  */ | ||||
| @Service | ||||
| @Validated | ||||
| public class ContractOutsServiceImpl implements ContractOutsService { | ||||
|  | ||||
|     @Resource | ||||
|     private ContractOutsMapper contractOutsMapper; | ||||
|  | ||||
|     @Override | ||||
|     public Long createContractOuts(ContractOutsSaveReqVO createReqVO) { | ||||
|         // 插入 | ||||
|         ContractOutsDO contractOuts = BeanUtils.toBean(createReqVO, ContractOutsDO.class); | ||||
|         contractOutsMapper.insert(contractOuts); | ||||
|         // 返回 | ||||
|         return contractOuts.getId(); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void updateContractOuts(ContractOutsSaveReqVO updateReqVO) { | ||||
|         // 校验存在 | ||||
|         validateContractOutsExists(updateReqVO.getId()); | ||||
|         // 更新 | ||||
|         ContractOutsDO updateObj = BeanUtils.toBean(updateReqVO, ContractOutsDO.class); | ||||
|         contractOutsMapper.updateById(updateObj); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void deleteContractOuts(Long id) { | ||||
|         // 校验存在 | ||||
|         validateContractOutsExists(id); | ||||
|         // 删除 | ||||
|         contractOutsMapper.deleteById(id); | ||||
|     } | ||||
|  | ||||
|     private void validateContractOutsExists(Long id) { | ||||
|         if (contractOutsMapper.selectById(id) == null) { | ||||
|             throw exception(CONTRACT_OUTS_NOT_EXISTS); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public ContractOutsDO getContractOuts(Long id) { | ||||
|         return contractOutsMapper.selectById(id); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public PageResult<ContractOutsDO> getContractOutsPage(ContractOutsPageReqVO pageReqVO) { | ||||
|         return contractOutsMapper.selectPage(pageReqVO); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,55 @@ | ||||
| package cn.iocoder.yudao.module.cms.service.outscontract; | ||||
|  | ||||
| import java.util.*; | ||||
| import jakarta.validation.*; | ||||
| import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.*; | ||||
| import cn.iocoder.yudao.module.cms.dal.dataobject.outscontract.OutsContractDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
|  | ||||
| /** | ||||
|  * 外包合同 Service 接口 | ||||
|  * | ||||
|  * @author zqc | ||||
|  */ | ||||
| public interface OutsContractService { | ||||
|  | ||||
|     /** | ||||
|      * 创建外包合同 | ||||
|      * | ||||
|      * @param createReqVO 创建信息 | ||||
|      * @return 编号 | ||||
|      */ | ||||
|     Long createOutsContract(@Valid OutsContractSaveReqVO createReqVO); | ||||
|  | ||||
|     /** | ||||
|      * 更新外包合同 | ||||
|      * | ||||
|      * @param updateReqVO 更新信息 | ||||
|      */ | ||||
|     void updateOutsContract(@Valid OutsContractSaveReqVO updateReqVO); | ||||
|  | ||||
|     /** | ||||
|      * 删除外包合同 | ||||
|      * | ||||
|      * @param id 编号 | ||||
|      */ | ||||
|     void deleteOutsContract(Long id); | ||||
|  | ||||
|     /** | ||||
|      * 获得外包合同 | ||||
|      * | ||||
|      * @param id 编号 | ||||
|      * @return 外包合同 | ||||
|      */ | ||||
|     OutsContractDO getOutsContract(Long id); | ||||
|  | ||||
|     /** | ||||
|      * 获得外包合同分页 | ||||
|      * | ||||
|      * @param pageReqVO 分页查询 | ||||
|      * @return 外包合同分页 | ||||
|      */ | ||||
|     PageResult<OutsContractDO> getOutsContractPage(OutsContractPageReqVO pageReqVO); | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,74 @@ | ||||
| package cn.iocoder.yudao.module.cms.service.outscontract; | ||||
|  | ||||
| import org.springframework.stereotype.Service; | ||||
| import jakarta.annotation.Resource; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
|  | ||||
| import java.util.*; | ||||
| import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.*; | ||||
| import cn.iocoder.yudao.module.cms.dal.dataobject.outscontract.OutsContractDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||||
|  | ||||
| import cn.iocoder.yudao.module.cms.dal.mysql.outscontract.OutsContractMapper; | ||||
|  | ||||
| import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | ||||
| import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*; | ||||
|  | ||||
| /** | ||||
|  * 外包合同 Service 实现类 | ||||
|  * | ||||
|  * @author zqc | ||||
|  */ | ||||
| @Service | ||||
| @Validated | ||||
| public class OutsContractServiceImpl implements OutsContractService { | ||||
|  | ||||
|     @Resource | ||||
|     private OutsContractMapper outsContractMapper; | ||||
|  | ||||
|     @Override | ||||
|     public Long createOutsContract(OutsContractSaveReqVO createReqVO) { | ||||
|         // 插入 | ||||
|         OutsContractDO outsContract = BeanUtils.toBean(createReqVO, OutsContractDO.class); | ||||
|         outsContractMapper.insert(outsContract); | ||||
|         // 返回 | ||||
|         return outsContract.getId(); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void updateOutsContract(OutsContractSaveReqVO updateReqVO) { | ||||
|         // 校验存在 | ||||
|         validateOutsContractExists(updateReqVO.getId()); | ||||
|         // 更新 | ||||
|         OutsContractDO updateObj = BeanUtils.toBean(updateReqVO, OutsContractDO.class); | ||||
|         outsContractMapper.updateById(updateObj); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void deleteOutsContract(Long id) { | ||||
|         // 校验存在 | ||||
|         validateOutsContractExists(id); | ||||
|         // 删除 | ||||
|         outsContractMapper.deleteById(id); | ||||
|     } | ||||
|  | ||||
|     private void validateOutsContractExists(Long id) { | ||||
|         if (outsContractMapper.selectById(id) == null) { | ||||
|             throw exception(OUTS_CONTRACT_NOT_EXISTS); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public OutsContractDO getOutsContract(Long id) { | ||||
|         return outsContractMapper.selectById(id); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public PageResult<OutsContractDO> getOutsContractPage(OutsContractPageReqVO pageReqVO) { | ||||
|         return outsContractMapper.selectPage(pageReqVO); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,55 @@ | ||||
| package cn.iocoder.yudao.module.cms.service.outscontracthistory; | ||||
|  | ||||
| import java.util.*; | ||||
| import jakarta.validation.*; | ||||
| import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.*; | ||||
| import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
|  | ||||
| /** | ||||
|  * 外包合同历史 Service 接口 | ||||
|  * | ||||
|  * @author zqc | ||||
|  */ | ||||
| public interface OutsContractHistoryService { | ||||
|  | ||||
|     /** | ||||
|      * 创建外包合同历史 | ||||
|      * | ||||
|      * @param createReqVO 创建信息 | ||||
|      * @return 编号 | ||||
|      */ | ||||
|     Long createOutsContractHistory(@Valid OutsContractHistorySaveReqVO createReqVO); | ||||
|  | ||||
|     /** | ||||
|      * 更新外包合同历史 | ||||
|      * | ||||
|      * @param updateReqVO 更新信息 | ||||
|      */ | ||||
|     void updateOutsContractHistory(@Valid OutsContractHistorySaveReqVO updateReqVO); | ||||
|  | ||||
|     /** | ||||
|      * 删除外包合同历史 | ||||
|      * | ||||
|      * @param id 编号 | ||||
|      */ | ||||
|     void deleteOutsContractHistory(Long id); | ||||
|  | ||||
|     /** | ||||
|      * 获得外包合同历史 | ||||
|      * | ||||
|      * @param id 编号 | ||||
|      * @return 外包合同历史 | ||||
|      */ | ||||
|     OutsContractHistoryDO getOutsContractHistory(Long id); | ||||
|  | ||||
|     /** | ||||
|      * 获得外包合同历史分页 | ||||
|      * | ||||
|      * @param pageReqVO 分页查询 | ||||
|      * @return 外包合同历史分页 | ||||
|      */ | ||||
|     PageResult<OutsContractHistoryDO> getOutsContractHistoryPage(OutsContractHistoryPageReqVO pageReqVO); | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,74 @@ | ||||
| package cn.iocoder.yudao.module.cms.service.outscontracthistory; | ||||
|  | ||||
| import org.springframework.stereotype.Service; | ||||
| import jakarta.annotation.Resource; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
|  | ||||
| import java.util.*; | ||||
| import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.*; | ||||
| import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||||
|  | ||||
| import cn.iocoder.yudao.module.cms.dal.mysql.outscontracthistory.OutsContractHistoryMapper; | ||||
|  | ||||
| import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | ||||
| import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*; | ||||
|  | ||||
| /** | ||||
|  * 外包合同历史 Service 实现类 | ||||
|  * | ||||
|  * @author zqc | ||||
|  */ | ||||
| @Service | ||||
| @Validated | ||||
| public class OutsContractHistoryServiceImpl implements OutsContractHistoryService { | ||||
|  | ||||
|     @Resource | ||||
|     private OutsContractHistoryMapper outsContractHistoryMapper; | ||||
|  | ||||
|     @Override | ||||
|     public Long createOutsContractHistory(OutsContractHistorySaveReqVO createReqVO) { | ||||
|         // 插入 | ||||
|         OutsContractHistoryDO outsContractHistory = BeanUtils.toBean(createReqVO, OutsContractHistoryDO.class); | ||||
|         outsContractHistoryMapper.insert(outsContractHistory); | ||||
|         // 返回 | ||||
|         return outsContractHistory.getId(); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void updateOutsContractHistory(OutsContractHistorySaveReqVO updateReqVO) { | ||||
|         // 校验存在 | ||||
|         validateOutsContractHistoryExists(updateReqVO.getId()); | ||||
|         // 更新 | ||||
|         OutsContractHistoryDO updateObj = BeanUtils.toBean(updateReqVO, OutsContractHistoryDO.class); | ||||
|         outsContractHistoryMapper.updateById(updateObj); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void deleteOutsContractHistory(Long id) { | ||||
|         // 校验存在 | ||||
|         validateOutsContractHistoryExists(id); | ||||
|         // 删除 | ||||
|         outsContractHistoryMapper.deleteById(id); | ||||
|     } | ||||
|  | ||||
|     private void validateOutsContractHistoryExists(Long id) { | ||||
|         if (outsContractHistoryMapper.selectById(id) == null) { | ||||
|             throw exception(OUTS_CONTRACT_HISTORY_NOT_EXISTS); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public OutsContractHistoryDO getOutsContractHistory(Long id) { | ||||
|         return outsContractHistoryMapper.selectById(id); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public PageResult<OutsContractHistoryDO> getOutsContractHistoryPage(OutsContractHistoryPageReqVO pageReqVO) { | ||||
|         return outsContractHistoryMapper.selectPage(pageReqVO); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,12 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="cn.iocoder.yudao.module.cms.dal.mysql.contractouts.ContractOutsMapper"> | ||||
|  | ||||
|     <!-- | ||||
|         一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | ||||
|         无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | ||||
|         代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | ||||
|         文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | ||||
|      --> | ||||
|  | ||||
| </mapper> | ||||
| @@ -0,0 +1,12 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="cn.iocoder.yudao.module.cms.dal.mysql.outscontract.OutsContractMapper"> | ||||
|  | ||||
|     <!-- | ||||
|         一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | ||||
|         无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | ||||
|         代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | ||||
|         文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | ||||
|      --> | ||||
|  | ||||
| </mapper> | ||||
| @@ -0,0 +1,12 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="cn.iocoder.yudao.module.cms.dal.mysql.outscontracthistory.OutsContractHistoryMapper"> | ||||
|  | ||||
|     <!-- | ||||
|         一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | ||||
|         无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | ||||
|         代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | ||||
|         文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | ||||
|      --> | ||||
|  | ||||
| </mapper> | ||||
| @@ -0,0 +1,12 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="cn.iocoder.yudao.module.pms.dal.mysql.receivables.ReceivablesMapper"> | ||||
|  | ||||
|     <!-- | ||||
|         一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | ||||
|         无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | ||||
|         代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | ||||
|         文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | ||||
|      --> | ||||
|  | ||||
| </mapper> | ||||
| @@ -0,0 +1,12 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="cn.iocoder.yudao.module.pms.dal.mysql.receivableshistory.ReceivablesHistoryMapper"> | ||||
|  | ||||
|     <!-- | ||||
|         一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | ||||
|         无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | ||||
|         代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | ||||
|         文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | ||||
|      --> | ||||
|  | ||||
| </mapper> | ||||
| @@ -0,0 +1,47 @@ | ||||
| import request from '@/config/axios' | ||||
|  | ||||
| // 外包合同关联 VO | ||||
| export interface ContractOutsVO { | ||||
|   id: number // 主键 | ||||
|   contractId: number // 合同id | ||||
|   outsContractId: number // 外包合同id | ||||
|   creator: string // 创建人 | ||||
|   cteateTime: Date // 创建时间 | ||||
|   updator: string // 更新人 | ||||
|   updateTime: Date // 更新时间 | ||||
|   delete: boolean // 是否删除 | ||||
|   tenantId: number // 租户id | ||||
| } | ||||
|  | ||||
| // 外包合同关联 API | ||||
| export const ContractOutsApi = { | ||||
|   // 查询外包合同关联分页 | ||||
|   getContractOutsPage: async (params: any) => { | ||||
|     return await request.get({ url: `/cms/contract-outs/page`, params }) | ||||
|   }, | ||||
|  | ||||
|   // 查询外包合同关联详情 | ||||
|   getContractOuts: async (id: number) => { | ||||
|     return await request.get({ url: `/cms/contract-outs/get?id=` + id }) | ||||
|   }, | ||||
|  | ||||
|   // 新增外包合同关联 | ||||
|   createContractOuts: async (data: ContractOutsVO) => { | ||||
|     return await request.post({ url: `/cms/contract-outs/create`, data }) | ||||
|   }, | ||||
|  | ||||
|   // 修改外包合同关联 | ||||
|   updateContractOuts: async (data: ContractOutsVO) => { | ||||
|     return await request.put({ url: `/cms/contract-outs/update`, data }) | ||||
|   }, | ||||
|  | ||||
|   // 删除外包合同关联 | ||||
|   deleteContractOuts: async (id: number) => { | ||||
|     return await request.delete({ url: `/cms/contract-outs/delete?id=` + id }) | ||||
|   }, | ||||
|  | ||||
|   // 导出外包合同关联 Excel | ||||
|   exportContractOuts: async (params) => { | ||||
|     return await request.download({ url: `/cms/contract-outs/export-excel`, params }) | ||||
|   }, | ||||
| } | ||||
| @@ -0,0 +1,144 @@ | ||||
| <template> | ||||
|   <Dialog :title="dialogTitle" v-model="dialogVisible"> | ||||
|     <el-form | ||||
|       ref="formRef" | ||||
|       :model="formData" | ||||
|       :rules="formRules" | ||||
|       label-width="100px" | ||||
|       v-loading="formLoading" | ||||
|     > | ||||
|       <el-form-item label="合同id" prop="contractId"> | ||||
|         <el-input v-model="formData.contractId" placeholder="请输入合同id" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="外包合同id" prop="outsContractId"> | ||||
|         <el-input v-model="formData.outsContractId" placeholder="请输入外包合同id" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="创建人" prop="creator"> | ||||
|         <el-input v-model="formData.creator" placeholder="请输入创建人" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="创建时间" prop="cteateTime"> | ||||
|         <el-date-picker | ||||
|           v-model="formData.cteateTime" | ||||
|           type="date" | ||||
|           value-format="x" | ||||
|           placeholder="选择创建时间" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="更新人" prop="updator"> | ||||
|         <el-input v-model="formData.updator" placeholder="请输入更新人" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="更新时间" prop="updateTime"> | ||||
|         <el-date-picker | ||||
|           v-model="formData.updateTime" | ||||
|           type="date" | ||||
|           value-format="x" | ||||
|           placeholder="选择更新时间" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="是否删除" prop="delete"> | ||||
|         <el-radio-group v-model="formData.delete"> | ||||
|           <el-radio label="1">请选择字典生成</el-radio> | ||||
|         </el-radio-group> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="租户id" prop="tenantId"> | ||||
|         <el-input v-model="formData.tenantId" placeholder="请输入租户id" /> | ||||
|       </el-form-item> | ||||
|     </el-form> | ||||
|     <template #footer> | ||||
|       <el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button> | ||||
|       <el-button @click="dialogVisible = false">取 消</el-button> | ||||
|     </template> | ||||
|   </Dialog> | ||||
| </template> | ||||
| <script setup lang="ts"> | ||||
| import { ContractOutsApi, ContractOutsVO } from '@/api/cms/contractouts' | ||||
|  | ||||
| /** 外包合同关联 表单 */ | ||||
| defineOptions({ name: 'ContractOutsForm' }) | ||||
|  | ||||
| const { t } = useI18n() // 国际化 | ||||
| const message = useMessage() // 消息弹窗 | ||||
|  | ||||
| const dialogVisible = ref(false) // 弹窗的是否展示 | ||||
| const dialogTitle = ref('') // 弹窗的标题 | ||||
| const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 | ||||
| const formType = ref('') // 表单的类型:create - 新增;update - 修改 | ||||
| const formData = ref({ | ||||
|   id: undefined, | ||||
|   contractId: undefined, | ||||
|   outsContractId: undefined, | ||||
|   creator: undefined, | ||||
|   cteateTime: undefined, | ||||
|   updator: undefined, | ||||
|   updateTime: undefined, | ||||
|   delete: undefined, | ||||
|   tenantId: undefined, | ||||
| }) | ||||
| const formRules = reactive({ | ||||
|   contractId: [{ required: true, message: '合同id不能为空', trigger: 'blur' }], | ||||
|   outsContractId: [{ required: true, message: '外包合同id不能为空', trigger: 'blur' }], | ||||
|   creator: [{ required: true, message: '创建人不能为空', trigger: 'blur' }], | ||||
|   updator: [{ required: true, message: '更新人不能为空', trigger: 'blur' }], | ||||
|   delete: [{ required: true, message: '是否删除不能为空', trigger: 'blur' }], | ||||
|   tenantId: [{ required: true, message: '租户id不能为空', trigger: 'blur' }], | ||||
| }) | ||||
| const formRef = ref() // 表单 Ref | ||||
|  | ||||
| /** 打开弹窗 */ | ||||
| const open = async (type: string, id?: number) => { | ||||
|   dialogVisible.value = true | ||||
|   dialogTitle.value = t('action.' + type) | ||||
|   formType.value = type | ||||
|   resetForm() | ||||
|   // 修改时,设置数据 | ||||
|   if (id) { | ||||
|     formLoading.value = true | ||||
|     try { | ||||
|       formData.value = await ContractOutsApi.getContractOuts(id) | ||||
|     } finally { | ||||
|       formLoading.value = false | ||||
|     } | ||||
|   } | ||||
| } | ||||
| defineExpose({ open }) // 提供 open 方法,用于打开弹窗 | ||||
|  | ||||
| /** 提交表单 */ | ||||
| const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 | ||||
| const submitForm = async () => { | ||||
|   // 校验表单 | ||||
|   await formRef.value.validate() | ||||
|   // 提交请求 | ||||
|   formLoading.value = true | ||||
|   try { | ||||
|     const data = formData.value as unknown as ContractOutsVO | ||||
|     if (formType.value === 'create') { | ||||
|       await ContractOutsApi.createContractOuts(data) | ||||
|       message.success(t('common.createSuccess')) | ||||
|     } else { | ||||
|       await ContractOutsApi.updateContractOuts(data) | ||||
|       message.success(t('common.updateSuccess')) | ||||
|     } | ||||
|     dialogVisible.value = false | ||||
|     // 发送操作成功的事件 | ||||
|     emit('success') | ||||
|   } finally { | ||||
|     formLoading.value = false | ||||
|   } | ||||
| } | ||||
|  | ||||
| /** 重置表单 */ | ||||
| const resetForm = () => { | ||||
|   formData.value = { | ||||
|     id: undefined, | ||||
|     contractId: undefined, | ||||
|     outsContractId: undefined, | ||||
|     creator: undefined, | ||||
|     cteateTime: undefined, | ||||
|     updator: undefined, | ||||
|     updateTime: undefined, | ||||
|     delete: undefined, | ||||
|     tenantId: undefined, | ||||
|   } | ||||
|   formRef.value?.resetFields() | ||||
| } | ||||
| </script> | ||||
| @@ -0,0 +1,262 @@ | ||||
| <template> | ||||
|   <ContentWrap> | ||||
|     <!-- 搜索工作栏 --> | ||||
|     <el-form | ||||
|       class="-mb-15px" | ||||
|       :model="queryParams" | ||||
|       ref="queryFormRef" | ||||
|       :inline="true" | ||||
|       label-width="68px" | ||||
|     > | ||||
|       <el-form-item label="合同id" prop="contractId"> | ||||
|         <el-input | ||||
|           v-model="queryParams.contractId" | ||||
|           placeholder="请输入合同id" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="外包合同id" prop="outsContractId"> | ||||
|         <el-input | ||||
|           v-model="queryParams.outsContractId" | ||||
|           placeholder="请输入外包合同id" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="创建人" prop="creator"> | ||||
|         <el-input | ||||
|           v-model="queryParams.creator" | ||||
|           placeholder="请输入创建人" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="创建时间" prop="cteateTime"> | ||||
|         <el-date-picker | ||||
|           v-model="queryParams.cteateTime" | ||||
|           value-format="YYYY-MM-DD HH:mm:ss" | ||||
|           type="daterange" | ||||
|           start-placeholder="开始日期" | ||||
|           end-placeholder="结束日期" | ||||
|           :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="更新人" prop="updator"> | ||||
|         <el-input | ||||
|           v-model="queryParams.updator" | ||||
|           placeholder="请输入更新人" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="更新时间" prop="updateTime"> | ||||
|         <el-date-picker | ||||
|           v-model="queryParams.updateTime" | ||||
|           value-format="YYYY-MM-DD HH:mm:ss" | ||||
|           type="daterange" | ||||
|           start-placeholder="开始日期" | ||||
|           end-placeholder="结束日期" | ||||
|           :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="是否删除" prop="delete"> | ||||
|         <el-select | ||||
|           v-model="queryParams.delete" | ||||
|           placeholder="请选择是否删除" | ||||
|           clearable | ||||
|           class="!w-240px" | ||||
|         > | ||||
|           <el-option label="请选择字典生成" value="" /> | ||||
|         </el-select> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="租户id" prop="tenantId"> | ||||
|         <el-input | ||||
|           v-model="queryParams.tenantId" | ||||
|           placeholder="请输入租户id" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item> | ||||
|         <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> | ||||
|         <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> | ||||
|         <el-button | ||||
|           type="primary" | ||||
|           plain | ||||
|           @click="openForm('create')" | ||||
|           v-hasPermi="['cms:contract-outs:create']" | ||||
|         > | ||||
|           <Icon icon="ep:plus" class="mr-5px" /> 新增 | ||||
|         </el-button> | ||||
|         <el-button | ||||
|           type="success" | ||||
|           plain | ||||
|           @click="handleExport" | ||||
|           :loading="exportLoading" | ||||
|           v-hasPermi="['cms:contract-outs:export']" | ||||
|         > | ||||
|           <Icon icon="ep:download" class="mr-5px" /> 导出 | ||||
|         </el-button> | ||||
|       </el-form-item> | ||||
|     </el-form> | ||||
|   </ContentWrap> | ||||
|  | ||||
|   <!-- 列表 --> | ||||
|   <ContentWrap> | ||||
|     <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> | ||||
|       <el-table-column label="主键" align="center" prop="id" /> | ||||
|       <el-table-column label="合同id" align="center" prop="contractId" /> | ||||
|       <el-table-column label="外包合同id" align="center" prop="outsContractId" /> | ||||
|       <el-table-column label="创建人" align="center" prop="creator" /> | ||||
|       <el-table-column | ||||
|         label="创建时间" | ||||
|         align="center" | ||||
|         prop="cteateTime" | ||||
|         :formatter="dateFormatter" | ||||
|         width="180px" | ||||
|       /> | ||||
|       <el-table-column label="更新人" align="center" prop="updator" /> | ||||
|       <el-table-column | ||||
|         label="更新时间" | ||||
|         align="center" | ||||
|         prop="updateTime" | ||||
|         :formatter="dateFormatter" | ||||
|         width="180px" | ||||
|       /> | ||||
|       <el-table-column label="是否删除" align="center" prop="delete" /> | ||||
|       <el-table-column label="租户id" align="center" prop="tenantId" /> | ||||
|       <el-table-column label="操作" align="center"> | ||||
|         <template #default="scope"> | ||||
|           <el-button | ||||
|             link | ||||
|             type="primary" | ||||
|             @click="openForm('update', scope.row.id)" | ||||
|             v-hasPermi="['cms:contract-outs:update']" | ||||
|           > | ||||
|             编辑 | ||||
|           </el-button> | ||||
|           <el-button | ||||
|             link | ||||
|             type="danger" | ||||
|             @click="handleDelete(scope.row.id)" | ||||
|             v-hasPermi="['cms:contract-outs:delete']" | ||||
|           > | ||||
|             删除 | ||||
|           </el-button> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|     </el-table> | ||||
|     <!-- 分页 --> | ||||
|     <Pagination | ||||
|       :total="total" | ||||
|       v-model:page="queryParams.pageNo" | ||||
|       v-model:limit="queryParams.pageSize" | ||||
|       @pagination="getList" | ||||
|     /> | ||||
|   </ContentWrap> | ||||
|  | ||||
|   <!-- 表单弹窗:添加/修改 --> | ||||
|   <ContractOutsForm ref="formRef" @success="getList" /> | ||||
| </template> | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { dateFormatter } from '@/utils/formatTime' | ||||
| import download from '@/utils/download' | ||||
| import { ContractOutsApi, ContractOutsVO } from '@/api/cms/contractouts' | ||||
| import ContractOutsForm from './ContractOutsForm.vue' | ||||
|  | ||||
| /** 外包合同关联 列表 */ | ||||
| defineOptions({ name: 'ContractOuts' }) | ||||
|  | ||||
| const message = useMessage() // 消息弹窗 | ||||
| const { t } = useI18n() // 国际化 | ||||
|  | ||||
| const loading = ref(true) // 列表的加载中 | ||||
| const list = ref<ContractOutsVO[]>([]) // 列表的数据 | ||||
| const total = ref(0) // 列表的总页数 | ||||
| const queryParams = reactive({ | ||||
|   pageNo: 1, | ||||
|   pageSize: 10, | ||||
|   contractId: undefined, | ||||
|   outsContractId: undefined, | ||||
|   creator: undefined, | ||||
|   cteateTime: [], | ||||
|   updator: undefined, | ||||
|   updateTime: [], | ||||
|   delete: undefined, | ||||
|   tenantId: undefined, | ||||
| }) | ||||
| const queryFormRef = ref() // 搜索的表单 | ||||
| const exportLoading = ref(false) // 导出的加载中 | ||||
|  | ||||
| /** 查询列表 */ | ||||
| const getList = async () => { | ||||
|   loading.value = true | ||||
|   try { | ||||
|     const data = await ContractOutsApi.getContractOutsPage(queryParams) | ||||
|     list.value = data.list | ||||
|     total.value = data.total | ||||
|   } finally { | ||||
|     loading.value = false | ||||
|   } | ||||
| } | ||||
|  | ||||
| /** 搜索按钮操作 */ | ||||
| const handleQuery = () => { | ||||
|   queryParams.pageNo = 1 | ||||
|   getList() | ||||
| } | ||||
|  | ||||
| /** 重置按钮操作 */ | ||||
| const resetQuery = () => { | ||||
|   queryFormRef.value.resetFields() | ||||
|   handleQuery() | ||||
| } | ||||
|  | ||||
| /** 添加/修改操作 */ | ||||
| const formRef = ref() | ||||
| const openForm = (type: string, id?: number) => { | ||||
|   formRef.value.open(type, id) | ||||
| } | ||||
|  | ||||
| /** 删除按钮操作 */ | ||||
| const handleDelete = async (id: number) => { | ||||
|   try { | ||||
|     // 删除的二次确认 | ||||
|     await message.delConfirm() | ||||
|     // 发起删除 | ||||
|     await ContractOutsApi.deleteContractOuts(id) | ||||
|     message.success(t('common.delSuccess')) | ||||
|     // 刷新列表 | ||||
|     await getList() | ||||
|   } catch {} | ||||
| } | ||||
|  | ||||
| /** 导出按钮操作 */ | ||||
| const handleExport = async () => { | ||||
|   try { | ||||
|     // 导出的二次确认 | ||||
|     await message.exportConfirm() | ||||
|     // 发起导出 | ||||
|     exportLoading.value = true | ||||
|     const data = await ContractOutsApi.exportContractOuts(queryParams) | ||||
|     download.excel(data, '外包合同关联.xls') | ||||
|   } catch { | ||||
|   } finally { | ||||
|     exportLoading.value = false | ||||
|   } | ||||
| } | ||||
|  | ||||
| /** 初始化 **/ | ||||
| onMounted(() => { | ||||
|   getList() | ||||
| }) | ||||
| </script> | ||||
| @@ -0,0 +1,49 @@ | ||||
| import request from '@/config/axios' | ||||
|  | ||||
| // 外包合同 VO | ||||
| export interface OutsContractVO { | ||||
|   id: number // 主键 | ||||
|   projectId: number // 项目id | ||||
|   name: string // 合同名称 | ||||
|   contractId: number // 主合同id | ||||
|   countType: string // 类型 | ||||
|   amount: number // 合同金额 | ||||
|   code: string // 编号 | ||||
|   major: string // 专业 | ||||
|   signingTime: Date // 签订时间 | ||||
|   settlementAmount: number // 结算数 | ||||
|   contractFileUrl: string // 合同文件url | ||||
| } | ||||
|  | ||||
| // 外包合同 API | ||||
| export const OutsContractApi = { | ||||
|   // 查询外包合同分页 | ||||
|   getOutsContractPage: async (params: any) => { | ||||
|     return await request.get({ url: `/cms/outs-contract/page`, params }) | ||||
|   }, | ||||
|  | ||||
|   // 查询外包合同详情 | ||||
|   getOutsContract: async (id: number) => { | ||||
|     return await request.get({ url: `/cms/outs-contract/get?id=` + id }) | ||||
|   }, | ||||
|  | ||||
|   // 新增外包合同 | ||||
|   createOutsContract: async (data: OutsContractVO) => { | ||||
|     return await request.post({ url: `/cms/outs-contract/create`, data }) | ||||
|   }, | ||||
|  | ||||
|   // 修改外包合同 | ||||
|   updateOutsContract: async (data: OutsContractVO) => { | ||||
|     return await request.put({ url: `/cms/outs-contract/update`, data }) | ||||
|   }, | ||||
|  | ||||
|   // 删除外包合同 | ||||
|   deleteOutsContract: async (id: number) => { | ||||
|     return await request.delete({ url: `/cms/outs-contract/delete?id=` + id }) | ||||
|   }, | ||||
|  | ||||
|   // 导出外包合同 Excel | ||||
|   exportOutsContract: async (params) => { | ||||
|     return await request.download({ url: `/cms/outs-contract/export-excel`, params }) | ||||
|   }, | ||||
| } | ||||
| @@ -0,0 +1,157 @@ | ||||
| <template> | ||||
|   <Dialog :title="dialogTitle" v-model="dialogVisible"> | ||||
|     <el-form | ||||
|       ref="formRef" | ||||
|       :model="formData" | ||||
|       :rules="formRules" | ||||
|       label-width="100px" | ||||
|       v-loading="formLoading" | ||||
|     > | ||||
|       <el-form-item label="项目id" prop="projectId"> | ||||
|         <el-input v-model="formData.projectId" placeholder="请输入项目id" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="合同名称" prop="name"> | ||||
|         <el-input v-model="formData.name" placeholder="请输入合同名称" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="主合同id" prop="contractId"> | ||||
|         <el-input v-model="formData.contractId" placeholder="请输入主合同id" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="类型" prop="countType"> | ||||
|         <el-select v-model="formData.countType" placeholder="请选择类型"> | ||||
|           <el-option | ||||
|             v-for="dict in getStrDictOptions(DICT_TYPE.CONTRACT_BILLING_TYPE)" | ||||
|             :key="dict.value" | ||||
|             :label="dict.label" | ||||
|             :value="dict.value" | ||||
|           /> | ||||
|         </el-select> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="合同金额" prop="amount"> | ||||
|         <el-input v-model="formData.amount" placeholder="请输入合同金额" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="编号" prop="code"> | ||||
|         <el-input v-model="formData.code" placeholder="请输入编号" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="专业" prop="major"> | ||||
|         <el-select v-model="formData.major" placeholder="请选择专业"> | ||||
|           <el-option | ||||
|             v-for="dict in getStrDictOptions(DICT_TYPE.MAJOR)" | ||||
|             :key="dict.value" | ||||
|             :label="dict.label" | ||||
|             :value="dict.value" | ||||
|           /> | ||||
|         </el-select> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="签订时间" prop="signingTime"> | ||||
|         <el-date-picker | ||||
|           v-model="formData.signingTime" | ||||
|           type="date" | ||||
|           value-format="x" | ||||
|           placeholder="选择签订时间" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="结算数" prop="settlementAmount"> | ||||
|         <el-input v-model="formData.settlementAmount" placeholder="请输入结算数" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="合同文件url" prop="contractFileUrl"> | ||||
|         <UploadFile v-model="formData.contractFileUrl" /> | ||||
|       </el-form-item> | ||||
|     </el-form> | ||||
|     <template #footer> | ||||
|       <el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button> | ||||
|       <el-button @click="dialogVisible = false">取 消</el-button> | ||||
|     </template> | ||||
|   </Dialog> | ||||
| </template> | ||||
| <script setup lang="ts"> | ||||
| import { getStrDictOptions, DICT_TYPE } from '@/utils/dict' | ||||
| import { OutsContractApi, OutsContractVO } from '@/api/cms/outscontract' | ||||
|  | ||||
| /** 外包合同 表单 */ | ||||
| defineOptions({ name: 'OutsContractForm' }) | ||||
|  | ||||
| const { t } = useI18n() // 国际化 | ||||
| const message = useMessage() // 消息弹窗 | ||||
|  | ||||
| const dialogVisible = ref(false) // 弹窗的是否展示 | ||||
| const dialogTitle = ref('') // 弹窗的标题 | ||||
| const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 | ||||
| const formType = ref('') // 表单的类型:create - 新增;update - 修改 | ||||
| const formData = ref({ | ||||
|   id: undefined, | ||||
|   projectId: undefined, | ||||
|   name: undefined, | ||||
|   contractId: undefined, | ||||
|   countType: undefined, | ||||
|   amount: undefined, | ||||
|   code: undefined, | ||||
|   major: undefined, | ||||
|   signingTime: undefined, | ||||
|   settlementAmount: undefined, | ||||
|   contractFileUrl: undefined, | ||||
| }) | ||||
| const formRules = reactive({ | ||||
|   projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }], | ||||
| }) | ||||
| const formRef = ref() // 表单 Ref | ||||
|  | ||||
| /** 打开弹窗 */ | ||||
| const open = async (type: string, id?: number) => { | ||||
|   dialogVisible.value = true | ||||
|   dialogTitle.value = t('action.' + type) | ||||
|   formType.value = type | ||||
|   resetForm() | ||||
|   // 修改时,设置数据 | ||||
|   if (id) { | ||||
|     formLoading.value = true | ||||
|     try { | ||||
|       formData.value = await OutsContractApi.getOutsContract(id) | ||||
|     } finally { | ||||
|       formLoading.value = false | ||||
|     } | ||||
|   } | ||||
| } | ||||
| defineExpose({ open }) // 提供 open 方法,用于打开弹窗 | ||||
|  | ||||
| /** 提交表单 */ | ||||
| const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 | ||||
| const submitForm = async () => { | ||||
|   // 校验表单 | ||||
|   await formRef.value.validate() | ||||
|   // 提交请求 | ||||
|   formLoading.value = true | ||||
|   try { | ||||
|     const data = formData.value as unknown as OutsContractVO | ||||
|     if (formType.value === 'create') { | ||||
|       await OutsContractApi.createOutsContract(data) | ||||
|       message.success(t('common.createSuccess')) | ||||
|     } else { | ||||
|       await OutsContractApi.updateOutsContract(data) | ||||
|       message.success(t('common.updateSuccess')) | ||||
|     } | ||||
|     dialogVisible.value = false | ||||
|     // 发送操作成功的事件 | ||||
|     emit('success') | ||||
|   } finally { | ||||
|     formLoading.value = false | ||||
|   } | ||||
| } | ||||
|  | ||||
| /** 重置表单 */ | ||||
| const resetForm = () => { | ||||
|   formData.value = { | ||||
|     id: undefined, | ||||
|     projectId: undefined, | ||||
|     name: undefined, | ||||
|     contractId: undefined, | ||||
|     countType: undefined, | ||||
|     amount: undefined, | ||||
|     code: undefined, | ||||
|     major: undefined, | ||||
|     signingTime: undefined, | ||||
|     settlementAmount: undefined, | ||||
|     contractFileUrl: undefined, | ||||
|   } | ||||
|   formRef.value?.resetFields() | ||||
| } | ||||
| </script> | ||||
| @@ -0,0 +1,306 @@ | ||||
| <template> | ||||
|   <ContentWrap> | ||||
|     <!-- 搜索工作栏 --> | ||||
|     <el-form | ||||
|       class="-mb-15px" | ||||
|       :model="queryParams" | ||||
|       ref="queryFormRef" | ||||
|       :inline="true" | ||||
|       label-width="68px" | ||||
|     > | ||||
|       <el-form-item label="项目id" prop="projectId"> | ||||
|         <el-input | ||||
|           v-model="queryParams.projectId" | ||||
|           placeholder="请输入项目id" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="合同名称" prop="name"> | ||||
|         <el-input | ||||
|           v-model="queryParams.name" | ||||
|           placeholder="请输入合同名称" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="主合同id" prop="contractId"> | ||||
|         <el-input | ||||
|           v-model="queryParams.contractId" | ||||
|           placeholder="请输入主合同id" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="类型" prop="countType"> | ||||
|         <el-select | ||||
|           v-model="queryParams.countType" | ||||
|           placeholder="请选择类型" | ||||
|           clearable | ||||
|           class="!w-240px" | ||||
|         > | ||||
|           <el-option | ||||
|             v-for="dict in getStrDictOptions(DICT_TYPE.CONTRACT_BILLING_TYPE)" | ||||
|             :key="dict.value" | ||||
|             :label="dict.label" | ||||
|             :value="dict.value" | ||||
|           /> | ||||
|         </el-select> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="合同金额" prop="amount"> | ||||
|         <el-input | ||||
|           v-model="queryParams.amount" | ||||
|           placeholder="请输入合同金额" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="编号" prop="code"> | ||||
|         <el-input | ||||
|           v-model="queryParams.code" | ||||
|           placeholder="请输入编号" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="专业" prop="major"> | ||||
|         <el-select | ||||
|           v-model="queryParams.major" | ||||
|           placeholder="请选择专业" | ||||
|           clearable | ||||
|           class="!w-240px" | ||||
|         > | ||||
|           <el-option | ||||
|             v-for="dict in getStrDictOptions(DICT_TYPE.MAJOR)" | ||||
|             :key="dict.value" | ||||
|             :label="dict.label" | ||||
|             :value="dict.value" | ||||
|           /> | ||||
|         </el-select> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="签订时间" prop="signingTime"> | ||||
|         <el-date-picker | ||||
|           v-model="queryParams.signingTime" | ||||
|           value-format="YYYY-MM-DD HH:mm:ss" | ||||
|           type="daterange" | ||||
|           start-placeholder="开始日期" | ||||
|           end-placeholder="结束日期" | ||||
|           :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="结算数" prop="settlementAmount"> | ||||
|         <el-input | ||||
|           v-model="queryParams.settlementAmount" | ||||
|           placeholder="请输入结算数" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="创建时间" prop="createTime"> | ||||
|         <el-date-picker | ||||
|           v-model="queryParams.createTime" | ||||
|           value-format="YYYY-MM-DD HH:mm:ss" | ||||
|           type="daterange" | ||||
|           start-placeholder="开始日期" | ||||
|           end-placeholder="结束日期" | ||||
|           :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item> | ||||
|         <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> | ||||
|         <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> | ||||
|         <el-button | ||||
|           type="primary" | ||||
|           plain | ||||
|           @click="openForm('create')" | ||||
|           v-hasPermi="['cms:outs-contract:create']" | ||||
|         > | ||||
|           <Icon icon="ep:plus" class="mr-5px" /> 新增 | ||||
|         </el-button> | ||||
|         <el-button | ||||
|           type="success" | ||||
|           plain | ||||
|           @click="handleExport" | ||||
|           :loading="exportLoading" | ||||
|           v-hasPermi="['cms:outs-contract:export']" | ||||
|         > | ||||
|           <Icon icon="ep:download" class="mr-5px" /> 导出 | ||||
|         </el-button> | ||||
|       </el-form-item> | ||||
|     </el-form> | ||||
|   </ContentWrap> | ||||
|  | ||||
|   <!-- 列表 --> | ||||
|   <ContentWrap> | ||||
|     <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> | ||||
|       <el-table-column label="主键" align="center" prop="id" /> | ||||
|       <el-table-column label="项目id" align="center" prop="projectId" /> | ||||
|       <el-table-column label="合同名称" align="center" prop="name" /> | ||||
|       <el-table-column label="主合同id" align="center" prop="contractId" /> | ||||
|       <el-table-column label="类型" align="center" prop="countType"> | ||||
|         <template #default="scope"> | ||||
|           <dict-tag :type="DICT_TYPE.CONTRACT_BILLING_TYPE" :value="scope.row.countType" /> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|       <el-table-column label="合同金额" align="center" prop="amount" /> | ||||
|       <el-table-column label="编号" align="center" prop="code" /> | ||||
|       <el-table-column label="专业" align="center" prop="major"> | ||||
|         <template #default="scope"> | ||||
|           <dict-tag :type="DICT_TYPE.MAJOR" :value="scope.row.major" /> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|       <el-table-column | ||||
|         label="签订时间" | ||||
|         align="center" | ||||
|         prop="signingTime" | ||||
|         :formatter="dateFormatter" | ||||
|         width="180px" | ||||
|       /> | ||||
|       <el-table-column label="结算数" align="center" prop="settlementAmount" /> | ||||
|       <el-table-column label="合同文件url" align="center" prop="contractFileUrl" /> | ||||
|       <el-table-column | ||||
|         label="创建时间" | ||||
|         align="center" | ||||
|         prop="createTime" | ||||
|         :formatter="dateFormatter" | ||||
|         width="180px" | ||||
|       /> | ||||
|       <el-table-column label="操作" align="center"> | ||||
|         <template #default="scope"> | ||||
|           <el-button | ||||
|             link | ||||
|             type="primary" | ||||
|             @click="openForm('update', scope.row.id)" | ||||
|             v-hasPermi="['cms:outs-contract:update']" | ||||
|           > | ||||
|             编辑 | ||||
|           </el-button> | ||||
|           <el-button | ||||
|             link | ||||
|             type="danger" | ||||
|             @click="handleDelete(scope.row.id)" | ||||
|             v-hasPermi="['cms:outs-contract:delete']" | ||||
|           > | ||||
|             删除 | ||||
|           </el-button> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|     </el-table> | ||||
|     <!-- 分页 --> | ||||
|     <Pagination | ||||
|       :total="total" | ||||
|       v-model:page="queryParams.pageNo" | ||||
|       v-model:limit="queryParams.pageSize" | ||||
|       @pagination="getList" | ||||
|     /> | ||||
|   </ContentWrap> | ||||
|  | ||||
|   <!-- 表单弹窗:添加/修改 --> | ||||
|   <OutsContractForm ref="formRef" @success="getList" /> | ||||
| </template> | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { getStrDictOptions, DICT_TYPE } from '@/utils/dict' | ||||
| import { dateFormatter } from '@/utils/formatTime' | ||||
| import download from '@/utils/download' | ||||
| import { OutsContractApi, OutsContractVO } from '@/api/cms/outscontract' | ||||
| import OutsContractForm from './OutsContractForm.vue' | ||||
|  | ||||
| /** 外包合同 列表 */ | ||||
| defineOptions({ name: 'OutsContract' }) | ||||
|  | ||||
| const message = useMessage() // 消息弹窗 | ||||
| const { t } = useI18n() // 国际化 | ||||
|  | ||||
| const loading = ref(true) // 列表的加载中 | ||||
| const list = ref<OutsContractVO[]>([]) // 列表的数据 | ||||
| const total = ref(0) // 列表的总页数 | ||||
| const queryParams = reactive({ | ||||
|   pageNo: 1, | ||||
|   pageSize: 10, | ||||
|   projectId: undefined, | ||||
|   name: undefined, | ||||
|   contractId: undefined, | ||||
|   countType: undefined, | ||||
|   amount: undefined, | ||||
|   code: undefined, | ||||
|   major: undefined, | ||||
|   signingTime: [], | ||||
|   settlementAmount: undefined, | ||||
|   contractFileUrl: undefined, | ||||
|   createTime: [], | ||||
| }) | ||||
| const queryFormRef = ref() // 搜索的表单 | ||||
| const exportLoading = ref(false) // 导出的加载中 | ||||
|  | ||||
| /** 查询列表 */ | ||||
| const getList = async () => { | ||||
|   loading.value = true | ||||
|   try { | ||||
|     const data = await OutsContractApi.getOutsContractPage(queryParams) | ||||
|     list.value = data.list | ||||
|     total.value = data.total | ||||
|   } finally { | ||||
|     loading.value = false | ||||
|   } | ||||
| } | ||||
|  | ||||
| /** 搜索按钮操作 */ | ||||
| const handleQuery = () => { | ||||
|   queryParams.pageNo = 1 | ||||
|   getList() | ||||
| } | ||||
|  | ||||
| /** 重置按钮操作 */ | ||||
| const resetQuery = () => { | ||||
|   queryFormRef.value.resetFields() | ||||
|   handleQuery() | ||||
| } | ||||
|  | ||||
| /** 添加/修改操作 */ | ||||
| const formRef = ref() | ||||
| const openForm = (type: string, id?: number) => { | ||||
|   formRef.value.open(type, id) | ||||
| } | ||||
|  | ||||
| /** 删除按钮操作 */ | ||||
| const handleDelete = async (id: number) => { | ||||
|   try { | ||||
|     // 删除的二次确认 | ||||
|     await message.delConfirm() | ||||
|     // 发起删除 | ||||
|     await OutsContractApi.deleteOutsContract(id) | ||||
|     message.success(t('common.delSuccess')) | ||||
|     // 刷新列表 | ||||
|     await getList() | ||||
|   } catch {} | ||||
| } | ||||
|  | ||||
| /** 导出按钮操作 */ | ||||
| const handleExport = async () => { | ||||
|   try { | ||||
|     // 导出的二次确认 | ||||
|     await message.exportConfirm() | ||||
|     // 发起导出 | ||||
|     exportLoading.value = true | ||||
|     const data = await OutsContractApi.exportOutsContract(queryParams) | ||||
|     download.excel(data, '外包合同.xls') | ||||
|   } catch { | ||||
|   } finally { | ||||
|     exportLoading.value = false | ||||
|   } | ||||
| } | ||||
|  | ||||
| /** 初始化 **/ | ||||
| onMounted(() => { | ||||
|   getList() | ||||
| }) | ||||
| </script> | ||||
| @@ -0,0 +1,53 @@ | ||||
| import request from '@/config/axios' | ||||
|  | ||||
| // 外包合同历史 VO | ||||
| export interface OutsContractHistoryVO { | ||||
|   id: number // 主键 | ||||
|   projectId: number // 项目id | ||||
|   name: string // 合同名称 | ||||
|   contractId: number // 主合同id | ||||
|   countType: string // 类型 | ||||
|   amount: number // 合同金额 | ||||
|   code: string // 编号 | ||||
|   major: string // 专业 | ||||
|   processInstanceId: string // 流程实体id | ||||
|   signingTime: Date // 签订时间 | ||||
|   settlementAmount: number // 结算数 | ||||
|   contractFileUrl: string // 合同文件url | ||||
|   processStatus: string // 流程状态 | ||||
|   outsContractId: number // 外包合同id | ||||
|   version: string // 版本 | ||||
| } | ||||
|  | ||||
| // 外包合同历史 API | ||||
| export const OutsContractHistoryApi = { | ||||
|   // 查询外包合同历史分页 | ||||
|   getOutsContractHistoryPage: async (params: any) => { | ||||
|     return await request.get({ url: `/cms/outs-contract-history/page`, params }) | ||||
|   }, | ||||
|  | ||||
|   // 查询外包合同历史详情 | ||||
|   getOutsContractHistory: async (id: number) => { | ||||
|     return await request.get({ url: `/cms/outs-contract-history/get?id=` + id }) | ||||
|   }, | ||||
|  | ||||
|   // 新增外包合同历史 | ||||
|   createOutsContractHistory: async (data: OutsContractHistoryVO) => { | ||||
|     return await request.post({ url: `/cms/outs-contract-history/create`, data }) | ||||
|   }, | ||||
|  | ||||
|   // 修改外包合同历史 | ||||
|   updateOutsContractHistory: async (data: OutsContractHistoryVO) => { | ||||
|     return await request.put({ url: `/cms/outs-contract-history/update`, data }) | ||||
|   }, | ||||
|  | ||||
|   // 删除外包合同历史 | ||||
|   deleteOutsContractHistory: async (id: number) => { | ||||
|     return await request.delete({ url: `/cms/outs-contract-history/delete?id=` + id }) | ||||
|   }, | ||||
|  | ||||
|   // 导出外包合同历史 Excel | ||||
|   exportOutsContractHistory: async (params) => { | ||||
|     return await request.download({ url: `/cms/outs-contract-history/export-excel`, params }) | ||||
|   }, | ||||
| } | ||||
| @@ -0,0 +1,172 @@ | ||||
| <template> | ||||
|   <Dialog :title="dialogTitle" v-model="dialogVisible"> | ||||
|     <el-form | ||||
|       ref="formRef" | ||||
|       :model="formData" | ||||
|       :rules="formRules" | ||||
|       label-width="100px" | ||||
|       v-loading="formLoading" | ||||
|     > | ||||
|       <el-form-item label="项目id" prop="projectId"> | ||||
|         <el-input v-model="formData.projectId" placeholder="请输入项目id" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="合同名称" prop="name"> | ||||
|         <el-input v-model="formData.name" placeholder="请输入合同名称" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="主合同id" prop="contractId"> | ||||
|         <el-input v-model="formData.contractId" placeholder="请输入主合同id" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="类型" prop="countType"> | ||||
|         <el-select v-model="formData.countType" placeholder="请选择类型"> | ||||
|           <el-option | ||||
|             v-for="dict in getStrDictOptions(DICT_TYPE.CONTRACT_BILLING_TYPE)" | ||||
|             :key="dict.value" | ||||
|             :label="dict.label" | ||||
|             :value="dict.value" | ||||
|           /> | ||||
|         </el-select> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="合同金额" prop="amount"> | ||||
|         <el-input v-model="formData.amount" placeholder="请输入合同金额" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="编号" prop="code"> | ||||
|         <el-input v-model="formData.code" placeholder="请输入编号" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="专业" prop="major"> | ||||
|         <el-input v-model="formData.major" placeholder="请输入专业" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="流程实体id" prop="processInstanceId"> | ||||
|         <el-input v-model="formData.processInstanceId" placeholder="请输入流程实体id" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="签订时间" prop="signingTime"> | ||||
|         <el-date-picker | ||||
|           v-model="formData.signingTime" | ||||
|           type="date" | ||||
|           value-format="x" | ||||
|           placeholder="选择签订时间" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="结算数" prop="settlementAmount"> | ||||
|         <el-input v-model="formData.settlementAmount" placeholder="请输入结算数" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="合同文件url" prop="contractFileUrl"> | ||||
|         <UploadFile v-model="formData.contractFileUrl" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="流程状态" prop="processStatus"> | ||||
|         <el-radio-group v-model="formData.processStatus"> | ||||
|           <el-radio label="1">请选择字典生成</el-radio> | ||||
|         </el-radio-group> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="外包合同id" prop="outsContractId"> | ||||
|         <el-input v-model="formData.outsContractId" placeholder="请输入外包合同id" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="版本" prop="version"> | ||||
|         <el-input v-model="formData.version" placeholder="请输入版本" /> | ||||
|       </el-form-item> | ||||
|     </el-form> | ||||
|     <template #footer> | ||||
|       <el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button> | ||||
|       <el-button @click="dialogVisible = false">取 消</el-button> | ||||
|     </template> | ||||
|   </Dialog> | ||||
| </template> | ||||
| <script setup lang="ts"> | ||||
| import { getStrDictOptions, DICT_TYPE } from '@/utils/dict' | ||||
| import { OutsContractHistoryApi, OutsContractHistoryVO } from '@/api/cms/outscontracthistory' | ||||
|  | ||||
| /** 外包合同历史 表单 */ | ||||
| defineOptions({ name: 'OutsContractHistoryForm' }) | ||||
|  | ||||
| const { t } = useI18n() // 国际化 | ||||
| const message = useMessage() // 消息弹窗 | ||||
|  | ||||
| const dialogVisible = ref(false) // 弹窗的是否展示 | ||||
| const dialogTitle = ref('') // 弹窗的标题 | ||||
| const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 | ||||
| const formType = ref('') // 表单的类型:create - 新增;update - 修改 | ||||
| const formData = ref({ | ||||
|   id: undefined, | ||||
|   projectId: undefined, | ||||
|   name: undefined, | ||||
|   contractId: undefined, | ||||
|   countType: undefined, | ||||
|   amount: undefined, | ||||
|   code: undefined, | ||||
|   major: undefined, | ||||
|   processInstanceId: undefined, | ||||
|   signingTime: undefined, | ||||
|   settlementAmount: undefined, | ||||
|   contractFileUrl: undefined, | ||||
|   processStatus: undefined, | ||||
|   outsContractId: undefined, | ||||
|   version: undefined, | ||||
| }) | ||||
| const formRules = reactive({ | ||||
|   projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }], | ||||
| }) | ||||
| const formRef = ref() // 表单 Ref | ||||
|  | ||||
| /** 打开弹窗 */ | ||||
| const open = async (type: string, id?: number) => { | ||||
|   dialogVisible.value = true | ||||
|   dialogTitle.value = t('action.' + type) | ||||
|   formType.value = type | ||||
|   resetForm() | ||||
|   // 修改时,设置数据 | ||||
|   if (id) { | ||||
|     formLoading.value = true | ||||
|     try { | ||||
|       formData.value = await OutsContractHistoryApi.getOutsContractHistory(id) | ||||
|     } finally { | ||||
|       formLoading.value = false | ||||
|     } | ||||
|   } | ||||
| } | ||||
| defineExpose({ open }) // 提供 open 方法,用于打开弹窗 | ||||
|  | ||||
| /** 提交表单 */ | ||||
| const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 | ||||
| const submitForm = async () => { | ||||
|   // 校验表单 | ||||
|   await formRef.value.validate() | ||||
|   // 提交请求 | ||||
|   formLoading.value = true | ||||
|   try { | ||||
|     const data = formData.value as unknown as OutsContractHistoryVO | ||||
|     if (formType.value === 'create') { | ||||
|       await OutsContractHistoryApi.createOutsContractHistory(data) | ||||
|       message.success(t('common.createSuccess')) | ||||
|     } else { | ||||
|       await OutsContractHistoryApi.updateOutsContractHistory(data) | ||||
|       message.success(t('common.updateSuccess')) | ||||
|     } | ||||
|     dialogVisible.value = false | ||||
|     // 发送操作成功的事件 | ||||
|     emit('success') | ||||
|   } finally { | ||||
|     formLoading.value = false | ||||
|   } | ||||
| } | ||||
|  | ||||
| /** 重置表单 */ | ||||
| const resetForm = () => { | ||||
|   formData.value = { | ||||
|     id: undefined, | ||||
|     projectId: undefined, | ||||
|     name: undefined, | ||||
|     contractId: undefined, | ||||
|     countType: undefined, | ||||
|     amount: undefined, | ||||
|     code: undefined, | ||||
|     major: undefined, | ||||
|     processInstanceId: undefined, | ||||
|     signingTime: undefined, | ||||
|     settlementAmount: undefined, | ||||
|     contractFileUrl: undefined, | ||||
|     processStatus: undefined, | ||||
|     outsContractId: undefined, | ||||
|     version: undefined, | ||||
|   } | ||||
|   formRef.value?.resetFields() | ||||
| } | ||||
| </script> | ||||
| @@ -0,0 +1,345 @@ | ||||
| <template> | ||||
|   <ContentWrap> | ||||
|     <!-- 搜索工作栏 --> | ||||
|     <el-form | ||||
|       class="-mb-15px" | ||||
|       :model="queryParams" | ||||
|       ref="queryFormRef" | ||||
|       :inline="true" | ||||
|       label-width="68px" | ||||
|     > | ||||
|       <el-form-item label="项目id" prop="projectId"> | ||||
|         <el-input | ||||
|           v-model="queryParams.projectId" | ||||
|           placeholder="请输入项目id" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="合同名称" prop="name"> | ||||
|         <el-input | ||||
|           v-model="queryParams.name" | ||||
|           placeholder="请输入合同名称" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="主合同id" prop="contractId"> | ||||
|         <el-input | ||||
|           v-model="queryParams.contractId" | ||||
|           placeholder="请输入主合同id" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="类型" prop="countType"> | ||||
|         <el-select | ||||
|           v-model="queryParams.countType" | ||||
|           placeholder="请选择类型" | ||||
|           clearable | ||||
|           class="!w-240px" | ||||
|         > | ||||
|           <el-option | ||||
|             v-for="dict in getStrDictOptions(DICT_TYPE.CONTRACT_BILLING_TYPE)" | ||||
|             :key="dict.value" | ||||
|             :label="dict.label" | ||||
|             :value="dict.value" | ||||
|           /> | ||||
|         </el-select> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="合同金额" prop="amount"> | ||||
|         <el-input | ||||
|           v-model="queryParams.amount" | ||||
|           placeholder="请输入合同金额" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="编号" prop="code"> | ||||
|         <el-input | ||||
|           v-model="queryParams.code" | ||||
|           placeholder="请输入编号" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="专业" prop="major"> | ||||
|         <el-input | ||||
|           v-model="queryParams.major" | ||||
|           placeholder="请输入专业" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="流程实体id" prop="processInstanceId"> | ||||
|         <el-input | ||||
|           v-model="queryParams.processInstanceId" | ||||
|           placeholder="请输入流程实体id" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="签订时间" prop="signingTime"> | ||||
|         <el-date-picker | ||||
|           v-model="queryParams.signingTime" | ||||
|           value-format="YYYY-MM-DD HH:mm:ss" | ||||
|           type="daterange" | ||||
|           start-placeholder="开始日期" | ||||
|           end-placeholder="结束日期" | ||||
|           :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="结算数" prop="settlementAmount"> | ||||
|         <el-input | ||||
|           v-model="queryParams.settlementAmount" | ||||
|           placeholder="请输入结算数" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="创建时间" prop="createTime"> | ||||
|         <el-date-picker | ||||
|           v-model="queryParams.createTime" | ||||
|           value-format="YYYY-MM-DD HH:mm:ss" | ||||
|           type="daterange" | ||||
|           start-placeholder="开始日期" | ||||
|           end-placeholder="结束日期" | ||||
|           :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="流程状态" prop="processStatus"> | ||||
|         <el-select | ||||
|           v-model="queryParams.processStatus" | ||||
|           placeholder="请选择流程状态" | ||||
|           clearable | ||||
|           class="!w-240px" | ||||
|         > | ||||
|           <el-option label="请选择字典生成" value="" /> | ||||
|         </el-select> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="外包合同id" prop="outsContractId"> | ||||
|         <el-input | ||||
|           v-model="queryParams.outsContractId" | ||||
|           placeholder="请输入外包合同id" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="版本" prop="version"> | ||||
|         <el-input | ||||
|           v-model="queryParams.version" | ||||
|           placeholder="请输入版本" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item> | ||||
|         <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> | ||||
|         <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> | ||||
|         <el-button | ||||
|           type="primary" | ||||
|           plain | ||||
|           @click="openForm('create')" | ||||
|           v-hasPermi="['cms:outs-contract-history:create']" | ||||
|         > | ||||
|           <Icon icon="ep:plus" class="mr-5px" /> 新增 | ||||
|         </el-button> | ||||
|         <el-button | ||||
|           type="success" | ||||
|           plain | ||||
|           @click="handleExport" | ||||
|           :loading="exportLoading" | ||||
|           v-hasPermi="['cms:outs-contract-history:export']" | ||||
|         > | ||||
|           <Icon icon="ep:download" class="mr-5px" /> 导出 | ||||
|         </el-button> | ||||
|       </el-form-item> | ||||
|     </el-form> | ||||
|   </ContentWrap> | ||||
|  | ||||
|   <!-- 列表 --> | ||||
|   <ContentWrap> | ||||
|     <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> | ||||
|       <el-table-column label="主键" align="center" prop="id" /> | ||||
|       <el-table-column label="项目id" align="center" prop="projectId" /> | ||||
|       <el-table-column label="合同名称" align="center" prop="name" /> | ||||
|       <el-table-column label="主合同id" align="center" prop="contractId" /> | ||||
|       <el-table-column label="类型" align="center" prop="countType"> | ||||
|         <template #default="scope"> | ||||
|           <dict-tag :type="DICT_TYPE.CONTRACT_BILLING_TYPE" :value="scope.row.countType" /> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|       <el-table-column label="合同金额" align="center" prop="amount" /> | ||||
|       <el-table-column label="编号" align="center" prop="code" /> | ||||
|       <el-table-column label="专业" align="center" prop="major"> | ||||
|         <template #default="scope"> | ||||
|           <dict-tag :type="DICT_TYPE.MAJOR" :value="scope.row.major" /> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|       <el-table-column label="流程实体id" align="center" prop="processInstanceId" /> | ||||
|       <el-table-column | ||||
|         label="签订时间" | ||||
|         align="center" | ||||
|         prop="signingTime" | ||||
|         :formatter="dateFormatter" | ||||
|         width="180px" | ||||
|       /> | ||||
|       <el-table-column label="结算数" align="center" prop="settlementAmount" /> | ||||
|       <el-table-column label="合同文件url" align="center" prop="contractFileUrl" /> | ||||
|       <el-table-column | ||||
|         label="创建时间" | ||||
|         align="center" | ||||
|         prop="createTime" | ||||
|         :formatter="dateFormatter" | ||||
|         width="180px" | ||||
|       /> | ||||
|       <el-table-column label="流程状态" align="center" prop="processStatus" /> | ||||
|       <el-table-column label="外包合同id" align="center" prop="outsContractId" /> | ||||
|       <el-table-column label="版本" align="center" prop="version" /> | ||||
|       <el-table-column label="操作" align="center"> | ||||
|         <template #default="scope"> | ||||
|           <el-button | ||||
|             link | ||||
|             type="primary" | ||||
|             @click="openForm('update', scope.row.id)" | ||||
|             v-hasPermi="['cms:outs-contract-history:update']" | ||||
|           > | ||||
|             编辑 | ||||
|           </el-button> | ||||
|           <el-button | ||||
|             link | ||||
|             type="danger" | ||||
|             @click="handleDelete(scope.row.id)" | ||||
|             v-hasPermi="['cms:outs-contract-history:delete']" | ||||
|           > | ||||
|             删除 | ||||
|           </el-button> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|     </el-table> | ||||
|     <!-- 分页 --> | ||||
|     <Pagination | ||||
|       :total="total" | ||||
|       v-model:page="queryParams.pageNo" | ||||
|       v-model:limit="queryParams.pageSize" | ||||
|       @pagination="getList" | ||||
|     /> | ||||
|   </ContentWrap> | ||||
|  | ||||
|   <!-- 表单弹窗:添加/修改 --> | ||||
|   <OutsContractHistoryForm ref="formRef" @success="getList" /> | ||||
| </template> | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { getStrDictOptions, DICT_TYPE } from '@/utils/dict' | ||||
| import { dateFormatter } from '@/utils/formatTime' | ||||
| import download from '@/utils/download' | ||||
| import { OutsContractHistoryApi, OutsContractHistoryVO } from '@/api/cms/outscontracthistory' | ||||
| import OutsContractHistoryForm from './OutsContractHistoryForm.vue' | ||||
|  | ||||
| /** 外包合同历史 列表 */ | ||||
| defineOptions({ name: 'OutsContractHistory' }) | ||||
|  | ||||
| const message = useMessage() // 消息弹窗 | ||||
| const { t } = useI18n() // 国际化 | ||||
|  | ||||
| const loading = ref(true) // 列表的加载中 | ||||
| const list = ref<OutsContractHistoryVO[]>([]) // 列表的数据 | ||||
| const total = ref(0) // 列表的总页数 | ||||
| const queryParams = reactive({ | ||||
|   pageNo: 1, | ||||
|   pageSize: 10, | ||||
|   projectId: undefined, | ||||
|   name: undefined, | ||||
|   contractId: undefined, | ||||
|   countType: undefined, | ||||
|   amount: undefined, | ||||
|   code: undefined, | ||||
|   major: undefined, | ||||
|   processInstanceId: undefined, | ||||
|   signingTime: [], | ||||
|   settlementAmount: undefined, | ||||
|   contractFileUrl: undefined, | ||||
|   createTime: [], | ||||
|   processStatus: undefined, | ||||
|   outsContractId: undefined, | ||||
|   version: undefined, | ||||
| }) | ||||
| const queryFormRef = ref() // 搜索的表单 | ||||
| const exportLoading = ref(false) // 导出的加载中 | ||||
|  | ||||
| /** 查询列表 */ | ||||
| const getList = async () => { | ||||
|   loading.value = true | ||||
|   try { | ||||
|     const data = await OutsContractHistoryApi.getOutsContractHistoryPage(queryParams) | ||||
|     list.value = data.list | ||||
|     total.value = data.total | ||||
|   } finally { | ||||
|     loading.value = false | ||||
|   } | ||||
| } | ||||
|  | ||||
| /** 搜索按钮操作 */ | ||||
| const handleQuery = () => { | ||||
|   queryParams.pageNo = 1 | ||||
|   getList() | ||||
| } | ||||
|  | ||||
| /** 重置按钮操作 */ | ||||
| const resetQuery = () => { | ||||
|   queryFormRef.value.resetFields() | ||||
|   handleQuery() | ||||
| } | ||||
|  | ||||
| /** 添加/修改操作 */ | ||||
| const formRef = ref() | ||||
| const openForm = (type: string, id?: number) => { | ||||
|   formRef.value.open(type, id) | ||||
| } | ||||
|  | ||||
| /** 删除按钮操作 */ | ||||
| const handleDelete = async (id: number) => { | ||||
|   try { | ||||
|     // 删除的二次确认 | ||||
|     await message.delConfirm() | ||||
|     // 发起删除 | ||||
|     await OutsContractHistoryApi.deleteOutsContractHistory(id) | ||||
|     message.success(t('common.delSuccess')) | ||||
|     // 刷新列表 | ||||
|     await getList() | ||||
|   } catch {} | ||||
| } | ||||
|  | ||||
| /** 导出按钮操作 */ | ||||
| const handleExport = async () => { | ||||
|   try { | ||||
|     // 导出的二次确认 | ||||
|     await message.exportConfirm() | ||||
|     // 发起导出 | ||||
|     exportLoading.value = true | ||||
|     const data = await OutsContractHistoryApi.exportOutsContractHistory(queryParams) | ||||
|     download.excel(data, '外包合同历史.xls') | ||||
|   } catch { | ||||
|   } finally { | ||||
|     exportLoading.value = false | ||||
|   } | ||||
| } | ||||
|  | ||||
| /** 初始化 **/ | ||||
| onMounted(() => { | ||||
|   getList() | ||||
| }) | ||||
| </script> | ||||
| @@ -0,0 +1,50 @@ | ||||
| import request from '@/config/axios' | ||||
|  | ||||
| // 预算管理 VO | ||||
| export interface BudgetVO { | ||||
|   id: number // 主键 | ||||
|   projectId: number // 项目id | ||||
|   contractId: number // 合同管理 | ||||
|   budgetFileUrl: string // 预算文件url | ||||
|   outsourcingCosts: number // 预算外包成本 | ||||
|   laborCosts: number // 人力成本 | ||||
|   accumulatedLaborCosts: number // 累计人力成本 | ||||
|   productCosts: number // 生产成本 | ||||
|   accumulatedProductCosts: number // 累计生产成本 | ||||
|   financialCosts: number // 财务成本 | ||||
|   accumulatedFinancialCosts: number // 累计财务成本 | ||||
|   collectionSituation: string // 回款情况 | ||||
| } | ||||
|  | ||||
| // 预算管理 API | ||||
| export const BudgetApi = { | ||||
|   // 查询预算管理分页 | ||||
|   getBudgetPage: async (params: any) => { | ||||
|     return await request.get({ url: `/pms/budget/page`, params }) | ||||
|   }, | ||||
|  | ||||
|   // 查询预算管理详情 | ||||
|   getBudget: async (id: number) => { | ||||
|     return await request.get({ url: `/pms/budget/get?id=` + id }) | ||||
|   }, | ||||
|  | ||||
|   // 新增预算管理 | ||||
|   createBudget: async (data: BudgetVO) => { | ||||
|     return await request.post({ url: `/pms/budget/create`, data }) | ||||
|   }, | ||||
|  | ||||
|   // 修改预算管理 | ||||
|   updateBudget: async (data: BudgetVO) => { | ||||
|     return await request.put({ url: `/pms/budget/update`, data }) | ||||
|   }, | ||||
|  | ||||
|   // 删除预算管理 | ||||
|   deleteBudget: async (id: number) => { | ||||
|     return await request.delete({ url: `/pms/budget/delete?id=` + id }) | ||||
|   }, | ||||
|  | ||||
|   // 导出预算管理 Excel | ||||
|   exportBudget: async (params) => { | ||||
|     return await request.download({ url: `/pms/budget/export-excel`, params }) | ||||
|   }, | ||||
| } | ||||
| @@ -0,0 +1,143 @@ | ||||
| <template> | ||||
|   <Dialog :title="dialogTitle" v-model="dialogVisible"> | ||||
|     <el-form | ||||
|       ref="formRef" | ||||
|       :model="formData" | ||||
|       :rules="formRules" | ||||
|       label-width="100px" | ||||
|       v-loading="formLoading" | ||||
|     > | ||||
|       <el-form-item label="项目id" prop="projectId"> | ||||
|         <el-input v-model="formData.projectId" placeholder="请输入项目id" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="合同管理" prop="contractId"> | ||||
|         <el-input v-model="formData.contractId" placeholder="请输入合同管理" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="预算文件url" prop="budgetFileUrl"> | ||||
|         <UploadFile v-model="formData.budgetFileUrl" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="预算外包成本" prop="outsourcingCosts"> | ||||
|         <el-input v-model="formData.outsourcingCosts" placeholder="请输入预算外包成本" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="人力成本" prop="laborCosts"> | ||||
|         <el-input v-model="formData.laborCosts" placeholder="请输入人力成本" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="累计人力成本" prop="accumulatedLaborCosts"> | ||||
|         <el-input v-model="formData.accumulatedLaborCosts" placeholder="请输入累计人力成本" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="生产成本" prop="productCosts"> | ||||
|         <el-input v-model="formData.productCosts" placeholder="请输入生产成本" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="累计生产成本" prop="accumulatedProductCosts"> | ||||
|         <el-input v-model="formData.accumulatedProductCosts" placeholder="请输入累计生产成本" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="财务成本" prop="financialCosts"> | ||||
|         <el-input v-model="formData.financialCosts" placeholder="请输入财务成本" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="累计财务成本" prop="accumulatedFinancialCosts"> | ||||
|         <el-input v-model="formData.accumulatedFinancialCosts" placeholder="请输入累计财务成本" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="回款情况" prop="collectionSituation"> | ||||
|         <el-input v-model="formData.collectionSituation" placeholder="请输入回款情况" /> | ||||
|       </el-form-item> | ||||
|     </el-form> | ||||
|     <template #footer> | ||||
|       <el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button> | ||||
|       <el-button @click="dialogVisible = false">取 消</el-button> | ||||
|     </template> | ||||
|   </Dialog> | ||||
| </template> | ||||
| <script setup lang="ts"> | ||||
| import { BudgetApi, BudgetVO } from '@/api/pms/budget' | ||||
|  | ||||
| /** 预算管理 表单 */ | ||||
| defineOptions({ name: 'BudgetForm' }) | ||||
|  | ||||
| const { t } = useI18n() // 国际化 | ||||
| const message = useMessage() // 消息弹窗 | ||||
|  | ||||
| const dialogVisible = ref(false) // 弹窗的是否展示 | ||||
| const dialogTitle = ref('') // 弹窗的标题 | ||||
| const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 | ||||
| const formType = ref('') // 表单的类型:create - 新增;update - 修改 | ||||
| const formData = ref({ | ||||
|   id: undefined, | ||||
|   projectId: undefined, | ||||
|   contractId: undefined, | ||||
|   budgetFileUrl: undefined, | ||||
|   outsourcingCosts: undefined, | ||||
|   laborCosts: undefined, | ||||
|   accumulatedLaborCosts: undefined, | ||||
|   productCosts: undefined, | ||||
|   accumulatedProductCosts: undefined, | ||||
|   financialCosts: undefined, | ||||
|   accumulatedFinancialCosts: undefined, | ||||
|   collectionSituation: undefined, | ||||
| }) | ||||
| const formRules = reactive({ | ||||
|   projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }], | ||||
|   contractId: [{ required: true, message: '合同管理不能为空', trigger: 'blur' }], | ||||
| }) | ||||
| const formRef = ref() // 表单 Ref | ||||
|  | ||||
| /** 打开弹窗 */ | ||||
| const open = async (type: string, id?: number) => { | ||||
|   dialogVisible.value = true | ||||
|   dialogTitle.value = t('action.' + type) | ||||
|   formType.value = type | ||||
|   resetForm() | ||||
|   // 修改时,设置数据 | ||||
|   if (id) { | ||||
|     formLoading.value = true | ||||
|     try { | ||||
|       formData.value = await BudgetApi.getBudget(id) | ||||
|     } finally { | ||||
|       formLoading.value = false | ||||
|     } | ||||
|   } | ||||
| } | ||||
| defineExpose({ open }) // 提供 open 方法,用于打开弹窗 | ||||
|  | ||||
| /** 提交表单 */ | ||||
| const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 | ||||
| const submitForm = async () => { | ||||
|   // 校验表单 | ||||
|   await formRef.value.validate() | ||||
|   // 提交请求 | ||||
|   formLoading.value = true | ||||
|   try { | ||||
|     const data = formData.value as unknown as BudgetVO | ||||
|     if (formType.value === 'create') { | ||||
|       await BudgetApi.createBudget(data) | ||||
|       message.success(t('common.createSuccess')) | ||||
|     } else { | ||||
|       await BudgetApi.updateBudget(data) | ||||
|       message.success(t('common.updateSuccess')) | ||||
|     } | ||||
|     dialogVisible.value = false | ||||
|     // 发送操作成功的事件 | ||||
|     emit('success') | ||||
|   } finally { | ||||
|     formLoading.value = false | ||||
|   } | ||||
| } | ||||
|  | ||||
| /** 重置表单 */ | ||||
| const resetForm = () => { | ||||
|   formData.value = { | ||||
|     id: undefined, | ||||
|     projectId: undefined, | ||||
|     contractId: undefined, | ||||
|     budgetFileUrl: undefined, | ||||
|     outsourcingCosts: undefined, | ||||
|     laborCosts: undefined, | ||||
|     accumulatedLaborCosts: undefined, | ||||
|     productCosts: undefined, | ||||
|     accumulatedProductCosts: undefined, | ||||
|     financialCosts: undefined, | ||||
|     accumulatedFinancialCosts: undefined, | ||||
|     collectionSituation: undefined, | ||||
|   } | ||||
|   formRef.value?.resetFields() | ||||
| } | ||||
| </script> | ||||
							
								
								
									
										288
									
								
								yudao-ui/yudao-ui-admin-PmsBudget/src/views/pms/budget/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										288
									
								
								yudao-ui/yudao-ui-admin-PmsBudget/src/views/pms/budget/index.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,288 @@ | ||||
| <template> | ||||
|   <ContentWrap> | ||||
|     <!-- 搜索工作栏 --> | ||||
|     <el-form | ||||
|       class="-mb-15px" | ||||
|       :model="queryParams" | ||||
|       ref="queryFormRef" | ||||
|       :inline="true" | ||||
|       label-width="68px" | ||||
|     > | ||||
|       <el-form-item label="项目id" prop="projectId"> | ||||
|         <el-input | ||||
|           v-model="queryParams.projectId" | ||||
|           placeholder="请输入项目id" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="合同管理" prop="contractId"> | ||||
|         <el-input | ||||
|           v-model="queryParams.contractId" | ||||
|           placeholder="请输入合同管理" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="预算外包成本" prop="outsourcingCosts"> | ||||
|         <el-input | ||||
|           v-model="queryParams.outsourcingCosts" | ||||
|           placeholder="请输入预算外包成本" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="人力成本" prop="laborCosts"> | ||||
|         <el-input | ||||
|           v-model="queryParams.laborCosts" | ||||
|           placeholder="请输入人力成本" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="累计人力成本" prop="accumulatedLaborCosts"> | ||||
|         <el-input | ||||
|           v-model="queryParams.accumulatedLaborCosts" | ||||
|           placeholder="请输入累计人力成本" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="生产成本" prop="productCosts"> | ||||
|         <el-input | ||||
|           v-model="queryParams.productCosts" | ||||
|           placeholder="请输入生产成本" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="累计生产成本" prop="accumulatedProductCosts"> | ||||
|         <el-input | ||||
|           v-model="queryParams.accumulatedProductCosts" | ||||
|           placeholder="请输入累计生产成本" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="财务成本" prop="financialCosts"> | ||||
|         <el-input | ||||
|           v-model="queryParams.financialCosts" | ||||
|           placeholder="请输入财务成本" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="累计财务成本" prop="accumulatedFinancialCosts"> | ||||
|         <el-input | ||||
|           v-model="queryParams.accumulatedFinancialCosts" | ||||
|           placeholder="请输入累计财务成本" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="回款情况" prop="collectionSituation"> | ||||
|         <el-input | ||||
|           v-model="queryParams.collectionSituation" | ||||
|           placeholder="请输入回款情况" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="创建时间" prop="createTime"> | ||||
|         <el-date-picker | ||||
|           v-model="queryParams.createTime" | ||||
|           value-format="YYYY-MM-DD HH:mm:ss" | ||||
|           type="daterange" | ||||
|           start-placeholder="开始日期" | ||||
|           end-placeholder="结束日期" | ||||
|           :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item> | ||||
|         <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> | ||||
|         <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> | ||||
|         <el-button | ||||
|           type="primary" | ||||
|           plain | ||||
|           @click="openForm('create')" | ||||
|           v-hasPermi="['pms:budget:create']" | ||||
|         > | ||||
|           <Icon icon="ep:plus" class="mr-5px" /> 新增 | ||||
|         </el-button> | ||||
|         <el-button | ||||
|           type="success" | ||||
|           plain | ||||
|           @click="handleExport" | ||||
|           :loading="exportLoading" | ||||
|           v-hasPermi="['pms:budget:export']" | ||||
|         > | ||||
|           <Icon icon="ep:download" class="mr-5px" /> 导出 | ||||
|         </el-button> | ||||
|       </el-form-item> | ||||
|     </el-form> | ||||
|   </ContentWrap> | ||||
|  | ||||
|   <!-- 列表 --> | ||||
|   <ContentWrap> | ||||
|     <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> | ||||
|       <el-table-column label="主键" align="center" prop="id" /> | ||||
|       <el-table-column label="项目id" align="center" prop="projectId" /> | ||||
|       <el-table-column label="合同管理" align="center" prop="contractId" /> | ||||
|       <el-table-column label="预算文件url" align="center" prop="budgetFileUrl" /> | ||||
|       <el-table-column label="预算外包成本" align="center" prop="outsourcingCosts" /> | ||||
|       <el-table-column label="人力成本" align="center" prop="laborCosts" /> | ||||
|       <el-table-column label="累计人力成本" align="center" prop="accumulatedLaborCosts" /> | ||||
|       <el-table-column label="生产成本" align="center" prop="productCosts" /> | ||||
|       <el-table-column label="累计生产成本" align="center" prop="accumulatedProductCosts" /> | ||||
|       <el-table-column label="财务成本" align="center" prop="financialCosts" /> | ||||
|       <el-table-column label="累计财务成本" align="center" prop="accumulatedFinancialCosts" /> | ||||
|       <el-table-column label="回款情况" align="center" prop="collectionSituation" /> | ||||
|       <el-table-column | ||||
|         label="创建时间" | ||||
|         align="center" | ||||
|         prop="createTime" | ||||
|         :formatter="dateFormatter" | ||||
|         width="180px" | ||||
|       /> | ||||
|       <el-table-column label="操作" align="center"> | ||||
|         <template #default="scope"> | ||||
|           <el-button | ||||
|             link | ||||
|             type="primary" | ||||
|             @click="openForm('update', scope.row.id)" | ||||
|             v-hasPermi="['pms:budget:update']" | ||||
|           > | ||||
|             编辑 | ||||
|           </el-button> | ||||
|           <el-button | ||||
|             link | ||||
|             type="danger" | ||||
|             @click="handleDelete(scope.row.id)" | ||||
|             v-hasPermi="['pms:budget:delete']" | ||||
|           > | ||||
|             删除 | ||||
|           </el-button> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|     </el-table> | ||||
|     <!-- 分页 --> | ||||
|     <Pagination | ||||
|       :total="total" | ||||
|       v-model:page="queryParams.pageNo" | ||||
|       v-model:limit="queryParams.pageSize" | ||||
|       @pagination="getList" | ||||
|     /> | ||||
|   </ContentWrap> | ||||
|  | ||||
|   <!-- 表单弹窗:添加/修改 --> | ||||
|   <BudgetForm ref="formRef" @success="getList" /> | ||||
| </template> | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { dateFormatter } from '@/utils/formatTime' | ||||
| import download from '@/utils/download' | ||||
| import { BudgetApi, BudgetVO } from '@/api/pms/budget' | ||||
| import BudgetForm from './BudgetForm.vue' | ||||
|  | ||||
| /** 预算管理 列表 */ | ||||
| defineOptions({ name: 'Budget' }) | ||||
|  | ||||
| const message = useMessage() // 消息弹窗 | ||||
| const { t } = useI18n() // 国际化 | ||||
|  | ||||
| const loading = ref(true) // 列表的加载中 | ||||
| const list = ref<BudgetVO[]>([]) // 列表的数据 | ||||
| const total = ref(0) // 列表的总页数 | ||||
| const queryParams = reactive({ | ||||
|   pageNo: 1, | ||||
|   pageSize: 10, | ||||
|   projectId: undefined, | ||||
|   contractId: undefined, | ||||
|   budgetFileUrl: undefined, | ||||
|   outsourcingCosts: undefined, | ||||
|   laborCosts: undefined, | ||||
|   accumulatedLaborCosts: undefined, | ||||
|   productCosts: undefined, | ||||
|   accumulatedProductCosts: undefined, | ||||
|   financialCosts: undefined, | ||||
|   accumulatedFinancialCosts: undefined, | ||||
|   collectionSituation: undefined, | ||||
|   createTime: [], | ||||
| }) | ||||
| const queryFormRef = ref() // 搜索的表单 | ||||
| const exportLoading = ref(false) // 导出的加载中 | ||||
|  | ||||
| /** 查询列表 */ | ||||
| const getList = async () => { | ||||
|   loading.value = true | ||||
|   try { | ||||
|     const data = await BudgetApi.getBudgetPage(queryParams) | ||||
|     list.value = data.list | ||||
|     total.value = data.total | ||||
|   } finally { | ||||
|     loading.value = false | ||||
|   } | ||||
| } | ||||
|  | ||||
| /** 搜索按钮操作 */ | ||||
| const handleQuery = () => { | ||||
|   queryParams.pageNo = 1 | ||||
|   getList() | ||||
| } | ||||
|  | ||||
| /** 重置按钮操作 */ | ||||
| const resetQuery = () => { | ||||
|   queryFormRef.value.resetFields() | ||||
|   handleQuery() | ||||
| } | ||||
|  | ||||
| /** 添加/修改操作 */ | ||||
| const formRef = ref() | ||||
| const openForm = (type: string, id?: number) => { | ||||
|   formRef.value.open(type, id) | ||||
| } | ||||
|  | ||||
| /** 删除按钮操作 */ | ||||
| const handleDelete = async (id: number) => { | ||||
|   try { | ||||
|     // 删除的二次确认 | ||||
|     await message.delConfirm() | ||||
|     // 发起删除 | ||||
|     await BudgetApi.deleteBudget(id) | ||||
|     message.success(t('common.delSuccess')) | ||||
|     // 刷新列表 | ||||
|     await getList() | ||||
|   } catch {} | ||||
| } | ||||
|  | ||||
| /** 导出按钮操作 */ | ||||
| const handleExport = async () => { | ||||
|   try { | ||||
|     // 导出的二次确认 | ||||
|     await message.exportConfirm() | ||||
|     // 发起导出 | ||||
|     exportLoading.value = true | ||||
|     const data = await BudgetApi.exportBudget(queryParams) | ||||
|     download.excel(data, '预算管理.xls') | ||||
|   } catch { | ||||
|   } finally { | ||||
|     exportLoading.value = false | ||||
|   } | ||||
| } | ||||
|  | ||||
| /** 初始化 **/ | ||||
| onMounted(() => { | ||||
|   getList() | ||||
| }) | ||||
| </script> | ||||
| @@ -0,0 +1,54 @@ | ||||
| import request from '@/config/axios' | ||||
|  | ||||
| // 预算管理 VO | ||||
| export interface BudgetHistoryVO { | ||||
|   id: number // 主键 | ||||
|   projectId: number // 项目id | ||||
|   contractId: number // 合同管理 | ||||
|   budgetFileUrl: string // 预算文件url | ||||
|   outsourcingCosts: number // 预算外包成本 | ||||
|   laborCosts: number // 人力成本 | ||||
|   accumulatedLaborCosts: number // 累计人力成本 | ||||
|   productCosts: number // 生产成本 | ||||
|   accumulatedProductCosts: number // 累计生产成本 | ||||
|   financialCosts: number // 财务成本 | ||||
|   accumulatedFinancialCosts: number // 累计财务成本 | ||||
|   collectionSituation: string // 回款情况 | ||||
|   processInstanceId: string // 流程实体id | ||||
|   processStatus: string // 流程状态 | ||||
|   budgetId: number // 预算id | ||||
|   version: string // 版本 | ||||
| } | ||||
|  | ||||
| // 预算管理 API | ||||
| export const BudgetHistoryApi = { | ||||
|   // 查询预算管理分页 | ||||
|   getBudgetHistoryPage: async (params: any) => { | ||||
|     return await request.get({ url: `/pms/budget-history/page`, params }) | ||||
|   }, | ||||
|  | ||||
|   // 查询预算管理详情 | ||||
|   getBudgetHistory: async (id: number) => { | ||||
|     return await request.get({ url: `/pms/budget-history/get?id=` + id }) | ||||
|   }, | ||||
|  | ||||
|   // 新增预算管理 | ||||
|   createBudgetHistory: async (data: BudgetHistoryVO) => { | ||||
|     return await request.post({ url: `/pms/budget-history/create`, data }) | ||||
|   }, | ||||
|  | ||||
|   // 修改预算管理 | ||||
|   updateBudgetHistory: async (data: BudgetHistoryVO) => { | ||||
|     return await request.put({ url: `/pms/budget-history/update`, data }) | ||||
|   }, | ||||
|  | ||||
|   // 删除预算管理 | ||||
|   deleteBudgetHistory: async (id: number) => { | ||||
|     return await request.delete({ url: `/pms/budget-history/delete?id=` + id }) | ||||
|   }, | ||||
|  | ||||
|   // 导出预算管理 Excel | ||||
|   exportBudgetHistory: async (params) => { | ||||
|     return await request.download({ url: `/pms/budget-history/export-excel`, params }) | ||||
|   }, | ||||
| } | ||||
| @@ -0,0 +1,165 @@ | ||||
| <template> | ||||
|   <Dialog :title="dialogTitle" v-model="dialogVisible"> | ||||
|     <el-form | ||||
|       ref="formRef" | ||||
|       :model="formData" | ||||
|       :rules="formRules" | ||||
|       label-width="100px" | ||||
|       v-loading="formLoading" | ||||
|     > | ||||
|       <el-form-item label="项目id" prop="projectId"> | ||||
|         <el-input v-model="formData.projectId" placeholder="请输入项目id" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="合同管理" prop="contractId"> | ||||
|         <el-input v-model="formData.contractId" placeholder="请输入合同管理" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="预算文件url" prop="budgetFileUrl"> | ||||
|         <UploadFile v-model="formData.budgetFileUrl" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="预算外包成本" prop="outsourcingCosts"> | ||||
|         <el-input v-model="formData.outsourcingCosts" placeholder="请输入预算外包成本" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="人力成本" prop="laborCosts"> | ||||
|         <el-input v-model="formData.laborCosts" placeholder="请输入人力成本" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="累计人力成本" prop="accumulatedLaborCosts"> | ||||
|         <el-input v-model="formData.accumulatedLaborCosts" placeholder="请输入累计人力成本" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="生产成本" prop="productCosts"> | ||||
|         <el-input v-model="formData.productCosts" placeholder="请输入生产成本" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="累计生产成本" prop="accumulatedProductCosts"> | ||||
|         <el-input v-model="formData.accumulatedProductCosts" placeholder="请输入累计生产成本" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="财务成本" prop="financialCosts"> | ||||
|         <el-input v-model="formData.financialCosts" placeholder="请输入财务成本" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="累计财务成本" prop="accumulatedFinancialCosts"> | ||||
|         <el-input v-model="formData.accumulatedFinancialCosts" placeholder="请输入累计财务成本" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="回款情况" prop="collectionSituation"> | ||||
|         <el-input v-model="formData.collectionSituation" placeholder="请输入回款情况" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="流程实体id" prop="processInstanceId"> | ||||
|         <el-input v-model="formData.processInstanceId" placeholder="请输入流程实体id" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="流程状态" prop="processStatus"> | ||||
|         <el-radio-group v-model="formData.processStatus"> | ||||
|           <el-radio label="1">请选择字典生成</el-radio> | ||||
|         </el-radio-group> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="预算id" prop="budgetId"> | ||||
|         <el-input v-model="formData.budgetId" placeholder="请输入预算id" /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="版本" prop="version"> | ||||
|         <el-input v-model="formData.version" placeholder="请输入版本" /> | ||||
|       </el-form-item> | ||||
|     </el-form> | ||||
|     <template #footer> | ||||
|       <el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button> | ||||
|       <el-button @click="dialogVisible = false">取 消</el-button> | ||||
|     </template> | ||||
|   </Dialog> | ||||
| </template> | ||||
| <script setup lang="ts"> | ||||
| import { BudgetHistoryApi, BudgetHistoryVO } from '@/api/pms/budgethistory' | ||||
|  | ||||
| /** 预算管理 表单 */ | ||||
| defineOptions({ name: 'BudgetHistoryForm' }) | ||||
|  | ||||
| const { t } = useI18n() // 国际化 | ||||
| const message = useMessage() // 消息弹窗 | ||||
|  | ||||
| const dialogVisible = ref(false) // 弹窗的是否展示 | ||||
| const dialogTitle = ref('') // 弹窗的标题 | ||||
| const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 | ||||
| const formType = ref('') // 表单的类型:create - 新增;update - 修改 | ||||
| const formData = ref({ | ||||
|   id: undefined, | ||||
|   projectId: undefined, | ||||
|   contractId: undefined, | ||||
|   budgetFileUrl: undefined, | ||||
|   outsourcingCosts: undefined, | ||||
|   laborCosts: undefined, | ||||
|   accumulatedLaborCosts: undefined, | ||||
|   productCosts: undefined, | ||||
|   accumulatedProductCosts: undefined, | ||||
|   financialCosts: undefined, | ||||
|   accumulatedFinancialCosts: undefined, | ||||
|   collectionSituation: undefined, | ||||
|   processInstanceId: undefined, | ||||
|   processStatus: undefined, | ||||
|   budgetId: undefined, | ||||
|   version: undefined, | ||||
| }) | ||||
| const formRules = reactive({ | ||||
|   projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }], | ||||
|   contractId: [{ required: true, message: '合同管理不能为空', trigger: 'blur' }], | ||||
| }) | ||||
| const formRef = ref() // 表单 Ref | ||||
|  | ||||
| /** 打开弹窗 */ | ||||
| const open = async (type: string, id?: number) => { | ||||
|   dialogVisible.value = true | ||||
|   dialogTitle.value = t('action.' + type) | ||||
|   formType.value = type | ||||
|   resetForm() | ||||
|   // 修改时,设置数据 | ||||
|   if (id) { | ||||
|     formLoading.value = true | ||||
|     try { | ||||
|       formData.value = await BudgetHistoryApi.getBudgetHistory(id) | ||||
|     } finally { | ||||
|       formLoading.value = false | ||||
|     } | ||||
|   } | ||||
| } | ||||
| defineExpose({ open }) // 提供 open 方法,用于打开弹窗 | ||||
|  | ||||
| /** 提交表单 */ | ||||
| const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 | ||||
| const submitForm = async () => { | ||||
|   // 校验表单 | ||||
|   await formRef.value.validate() | ||||
|   // 提交请求 | ||||
|   formLoading.value = true | ||||
|   try { | ||||
|     const data = formData.value as unknown as BudgetHistoryVO | ||||
|     if (formType.value === 'create') { | ||||
|       await BudgetHistoryApi.createBudgetHistory(data) | ||||
|       message.success(t('common.createSuccess')) | ||||
|     } else { | ||||
|       await BudgetHistoryApi.updateBudgetHistory(data) | ||||
|       message.success(t('common.updateSuccess')) | ||||
|     } | ||||
|     dialogVisible.value = false | ||||
|     // 发送操作成功的事件 | ||||
|     emit('success') | ||||
|   } finally { | ||||
|     formLoading.value = false | ||||
|   } | ||||
| } | ||||
|  | ||||
| /** 重置表单 */ | ||||
| const resetForm = () => { | ||||
|   formData.value = { | ||||
|     id: undefined, | ||||
|     projectId: undefined, | ||||
|     contractId: undefined, | ||||
|     budgetFileUrl: undefined, | ||||
|     outsourcingCosts: undefined, | ||||
|     laborCosts: undefined, | ||||
|     accumulatedLaborCosts: undefined, | ||||
|     productCosts: undefined, | ||||
|     accumulatedProductCosts: undefined, | ||||
|     financialCosts: undefined, | ||||
|     accumulatedFinancialCosts: undefined, | ||||
|     collectionSituation: undefined, | ||||
|     processInstanceId: undefined, | ||||
|     processStatus: undefined, | ||||
|     budgetId: undefined, | ||||
|     version: undefined, | ||||
|   } | ||||
|   formRef.value?.resetFields() | ||||
| } | ||||
| </script> | ||||
| @@ -0,0 +1,333 @@ | ||||
| <template> | ||||
|   <ContentWrap> | ||||
|     <!-- 搜索工作栏 --> | ||||
|     <el-form | ||||
|       class="-mb-15px" | ||||
|       :model="queryParams" | ||||
|       ref="queryFormRef" | ||||
|       :inline="true" | ||||
|       label-width="68px" | ||||
|     > | ||||
|       <el-form-item label="项目id" prop="projectId"> | ||||
|         <el-input | ||||
|           v-model="queryParams.projectId" | ||||
|           placeholder="请输入项目id" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="合同管理" prop="contractId"> | ||||
|         <el-input | ||||
|           v-model="queryParams.contractId" | ||||
|           placeholder="请输入合同管理" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="预算外包成本" prop="outsourcingCosts"> | ||||
|         <el-input | ||||
|           v-model="queryParams.outsourcingCosts" | ||||
|           placeholder="请输入预算外包成本" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="人力成本" prop="laborCosts"> | ||||
|         <el-input | ||||
|           v-model="queryParams.laborCosts" | ||||
|           placeholder="请输入人力成本" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="累计人力成本" prop="accumulatedLaborCosts"> | ||||
|         <el-input | ||||
|           v-model="queryParams.accumulatedLaborCosts" | ||||
|           placeholder="请输入累计人力成本" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="生产成本" prop="productCosts"> | ||||
|         <el-input | ||||
|           v-model="queryParams.productCosts" | ||||
|           placeholder="请输入生产成本" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="累计生产成本" prop="accumulatedProductCosts"> | ||||
|         <el-input | ||||
|           v-model="queryParams.accumulatedProductCosts" | ||||
|           placeholder="请输入累计生产成本" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="财务成本" prop="financialCosts"> | ||||
|         <el-input | ||||
|           v-model="queryParams.financialCosts" | ||||
|           placeholder="请输入财务成本" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="累计财务成本" prop="accumulatedFinancialCosts"> | ||||
|         <el-input | ||||
|           v-model="queryParams.accumulatedFinancialCosts" | ||||
|           placeholder="请输入累计财务成本" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="回款情况" prop="collectionSituation"> | ||||
|         <el-input | ||||
|           v-model="queryParams.collectionSituation" | ||||
|           placeholder="请输入回款情况" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="创建时间" prop="createTime"> | ||||
|         <el-date-picker | ||||
|           v-model="queryParams.createTime" | ||||
|           value-format="YYYY-MM-DD HH:mm:ss" | ||||
|           type="daterange" | ||||
|           start-placeholder="开始日期" | ||||
|           end-placeholder="结束日期" | ||||
|           :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="流程实体id" prop="processInstanceId"> | ||||
|         <el-input | ||||
|           v-model="queryParams.processInstanceId" | ||||
|           placeholder="请输入流程实体id" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="流程状态" prop="processStatus"> | ||||
|         <el-select | ||||
|           v-model="queryParams.processStatus" | ||||
|           placeholder="请选择流程状态" | ||||
|           clearable | ||||
|           class="!w-240px" | ||||
|         > | ||||
|           <el-option label="请选择字典生成" value="" /> | ||||
|         </el-select> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="预算id" prop="budgetId"> | ||||
|         <el-input | ||||
|           v-model="queryParams.budgetId" | ||||
|           placeholder="请输入预算id" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="版本" prop="version"> | ||||
|         <el-input | ||||
|           v-model="queryParams.version" | ||||
|           placeholder="请输入版本" | ||||
|           clearable | ||||
|           @keyup.enter="handleQuery" | ||||
|           class="!w-240px" | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item> | ||||
|         <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> | ||||
|         <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> | ||||
|         <el-button | ||||
|           type="primary" | ||||
|           plain | ||||
|           @click="openForm('create')" | ||||
|           v-hasPermi="['pms:budget-history:create']" | ||||
|         > | ||||
|           <Icon icon="ep:plus" class="mr-5px" /> 新增 | ||||
|         </el-button> | ||||
|         <el-button | ||||
|           type="success" | ||||
|           plain | ||||
|           @click="handleExport" | ||||
|           :loading="exportLoading" | ||||
|           v-hasPermi="['pms:budget-history:export']" | ||||
|         > | ||||
|           <Icon icon="ep:download" class="mr-5px" /> 导出 | ||||
|         </el-button> | ||||
|       </el-form-item> | ||||
|     </el-form> | ||||
|   </ContentWrap> | ||||
|  | ||||
|   <!-- 列表 --> | ||||
|   <ContentWrap> | ||||
|     <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> | ||||
|       <el-table-column label="主键" align="center" prop="id" /> | ||||
|       <el-table-column label="项目id" align="center" prop="projectId" /> | ||||
|       <el-table-column label="合同管理" align="center" prop="contractId" /> | ||||
|       <el-table-column label="预算文件url" align="center" prop="budgetFileUrl" /> | ||||
|       <el-table-column label="预算外包成本" align="center" prop="outsourcingCosts" /> | ||||
|       <el-table-column label="人力成本" align="center" prop="laborCosts" /> | ||||
|       <el-table-column label="累计人力成本" align="center" prop="accumulatedLaborCosts" /> | ||||
|       <el-table-column label="生产成本" align="center" prop="productCosts" /> | ||||
|       <el-table-column label="累计生产成本" align="center" prop="accumulatedProductCosts" /> | ||||
|       <el-table-column label="财务成本" align="center" prop="financialCosts" /> | ||||
|       <el-table-column label="累计财务成本" align="center" prop="accumulatedFinancialCosts" /> | ||||
|       <el-table-column label="回款情况" align="center" prop="collectionSituation" /> | ||||
|       <el-table-column | ||||
|         label="创建时间" | ||||
|         align="center" | ||||
|         prop="createTime" | ||||
|         :formatter="dateFormatter" | ||||
|         width="180px" | ||||
|       /> | ||||
|       <el-table-column label="流程实体id" align="center" prop="processInstanceId" /> | ||||
|       <el-table-column label="流程状态" align="center" prop="processStatus" /> | ||||
|       <el-table-column label="预算id" align="center" prop="budgetId" /> | ||||
|       <el-table-column label="版本" align="center" prop="version" /> | ||||
|       <el-table-column label="操作" align="center"> | ||||
|         <template #default="scope"> | ||||
|           <el-button | ||||
|             link | ||||
|             type="primary" | ||||
|             @click="openForm('update', scope.row.id)" | ||||
|             v-hasPermi="['pms:budget-history:update']" | ||||
|           > | ||||
|             编辑 | ||||
|           </el-button> | ||||
|           <el-button | ||||
|             link | ||||
|             type="danger" | ||||
|             @click="handleDelete(scope.row.id)" | ||||
|             v-hasPermi="['pms:budget-history:delete']" | ||||
|           > | ||||
|             删除 | ||||
|           </el-button> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|     </el-table> | ||||
|     <!-- 分页 --> | ||||
|     <Pagination | ||||
|       :total="total" | ||||
|       v-model:page="queryParams.pageNo" | ||||
|       v-model:limit="queryParams.pageSize" | ||||
|       @pagination="getList" | ||||
|     /> | ||||
|   </ContentWrap> | ||||
|  | ||||
|   <!-- 表单弹窗:添加/修改 --> | ||||
|   <BudgetHistoryForm ref="formRef" @success="getList" /> | ||||
| </template> | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { dateFormatter } from '@/utils/formatTime' | ||||
| import download from '@/utils/download' | ||||
| import { BudgetHistoryApi, BudgetHistoryVO } from '@/api/pms/budgethistory' | ||||
| import BudgetHistoryForm from './BudgetHistoryForm.vue' | ||||
|  | ||||
| /** 预算管理 列表 */ | ||||
| defineOptions({ name: 'BudgetHistory' }) | ||||
|  | ||||
| const message = useMessage() // 消息弹窗 | ||||
| const { t } = useI18n() // 国际化 | ||||
|  | ||||
| const loading = ref(true) // 列表的加载中 | ||||
| const list = ref<BudgetHistoryVO[]>([]) // 列表的数据 | ||||
| const total = ref(0) // 列表的总页数 | ||||
| const queryParams = reactive({ | ||||
|   pageNo: 1, | ||||
|   pageSize: 10, | ||||
|   projectId: undefined, | ||||
|   contractId: undefined, | ||||
|   budgetFileUrl: undefined, | ||||
|   outsourcingCosts: undefined, | ||||
|   laborCosts: undefined, | ||||
|   accumulatedLaborCosts: undefined, | ||||
|   productCosts: undefined, | ||||
|   accumulatedProductCosts: undefined, | ||||
|   financialCosts: undefined, | ||||
|   accumulatedFinancialCosts: undefined, | ||||
|   collectionSituation: undefined, | ||||
|   createTime: [], | ||||
|   processInstanceId: undefined, | ||||
|   processStatus: undefined, | ||||
|   budgetId: undefined, | ||||
|   version: undefined, | ||||
| }) | ||||
| const queryFormRef = ref() // 搜索的表单 | ||||
| const exportLoading = ref(false) // 导出的加载中 | ||||
|  | ||||
| /** 查询列表 */ | ||||
| const getList = async () => { | ||||
|   loading.value = true | ||||
|   try { | ||||
|     const data = await BudgetHistoryApi.getBudgetHistoryPage(queryParams) | ||||
|     list.value = data.list | ||||
|     total.value = data.total | ||||
|   } finally { | ||||
|     loading.value = false | ||||
|   } | ||||
| } | ||||
|  | ||||
| /** 搜索按钮操作 */ | ||||
| const handleQuery = () => { | ||||
|   queryParams.pageNo = 1 | ||||
|   getList() | ||||
| } | ||||
|  | ||||
| /** 重置按钮操作 */ | ||||
| const resetQuery = () => { | ||||
|   queryFormRef.value.resetFields() | ||||
|   handleQuery() | ||||
| } | ||||
|  | ||||
| /** 添加/修改操作 */ | ||||
| const formRef = ref() | ||||
| const openForm = (type: string, id?: number) => { | ||||
|   formRef.value.open(type, id) | ||||
| } | ||||
|  | ||||
| /** 删除按钮操作 */ | ||||
| const handleDelete = async (id: number) => { | ||||
|   try { | ||||
|     // 删除的二次确认 | ||||
|     await message.delConfirm() | ||||
|     // 发起删除 | ||||
|     await BudgetHistoryApi.deleteBudgetHistory(id) | ||||
|     message.success(t('common.delSuccess')) | ||||
|     // 刷新列表 | ||||
|     await getList() | ||||
|   } catch {} | ||||
| } | ||||
|  | ||||
| /** 导出按钮操作 */ | ||||
| const handleExport = async () => { | ||||
|   try { | ||||
|     // 导出的二次确认 | ||||
|     await message.exportConfirm() | ||||
|     // 发起导出 | ||||
|     exportLoading.value = true | ||||
|     const data = await BudgetHistoryApi.exportBudgetHistory(queryParams) | ||||
|     download.excel(data, '预算管理.xls') | ||||
|   } catch { | ||||
|   } finally { | ||||
|     exportLoading.value = false | ||||
|   } | ||||
| } | ||||
|  | ||||
| /** 初始化 **/ | ||||
| onMounted(() => { | ||||
|   getList() | ||||
| }) | ||||
| </script> | ||||
| @@ -0,0 +1,43 @@ | ||||
| import request from '@/config/axios' | ||||
|  | ||||
| export interface ReceivablesVO { | ||||
|                     id: number | ||||
|                     projectId: number | ||||
|                     contractId: number | ||||
|                     planStage: string | ||||
|                     initialDesignStage: string | ||||
|                     constructionDrawingStage: string | ||||
|                     constructionStage: string | ||||
|                     approveStage: string | ||||
|                     collectionSituation: string | ||||
| } | ||||
|  | ||||
| // 查询应收款管理列表 | ||||
| export const getReceivablesPage = async (params) => { | ||||
|   return await request.get({ url: '/pms/receivables/page', params }) | ||||
| } | ||||
|  | ||||
| // 查询应收款管理详情 | ||||
| export const getReceivables = async (id: number) => { | ||||
|   return await request.get({ url: '/pms/receivables/get?id=' + id }) | ||||
| } | ||||
|  | ||||
| // 新增应收款管理 | ||||
| export const createReceivables = async (data: ReceivablesVO) => { | ||||
|   return await request.post({ url: '/pms/receivables/create', data }) | ||||
| } | ||||
|  | ||||
| // 修改应收款管理 | ||||
| export const updateReceivables = async (data: ReceivablesVO) => { | ||||
|   return await request.put({ url: '/pms/receivables/update', data }) | ||||
| } | ||||
|  | ||||
| // 删除应收款管理 | ||||
| export const deleteReceivables = async (id: number) => { | ||||
|   return await request.delete({ url: '/pms/receivables/delete?id=' + id }) | ||||
| } | ||||
|  | ||||
| // 导出应收款管理 Excel | ||||
| export const exportReceivablesApi = async (params) => { | ||||
|   return await request.download({ url: '/pms/receivables/export-excel', params }) | ||||
| } | ||||
| @@ -0,0 +1,65 @@ | ||||
| <template> | ||||
|   <Dialog :title="dialogTitle" v-model="dialogVisible"> | ||||
|     <Form ref="formRef" :schema="allSchemas.formSchema" :rules="rules" v-loading="formLoading" /> | ||||
|     <template #footer> | ||||
|       <el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button> | ||||
|       <el-button @click="dialogVisible = false">取 消</el-button> | ||||
|     </template> | ||||
|   </Dialog> | ||||
| </template> | ||||
| <script setup lang="ts"> | ||||
| import * as ReceivablesApi from '@/api/pms/receivables' | ||||
| import { rules, allSchemas } from './receivables.data' | ||||
| const { t } = useI18n() // 国际化 | ||||
| const message = useMessage() // 消息弹窗 | ||||
|  | ||||
| const dialogVisible = ref(false) // 弹窗的是否展示 | ||||
| const dialogTitle = ref('') // 弹窗的标题 | ||||
| const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 | ||||
| const formType = ref('') // 表单的类型:create - 新增;update - 修改 | ||||
| const formRef = ref() // 表单 Ref | ||||
|  | ||||
| /** 打开弹窗 */ | ||||
| const open = async (type: string, id?: number) => { | ||||
|   dialogVisible.value = true | ||||
|   dialogTitle.value = t('action.' + type) | ||||
|   formType.value = type | ||||
|   // 修改时,设置数据 | ||||
|   if (id) { | ||||
|     formLoading.value = true | ||||
|     try { | ||||
|       const data = await ReceivablesApi.getReceivables(id) | ||||
|       formRef.value.setValues(data) | ||||
|     } finally { | ||||
|       formLoading.value = false | ||||
|     } | ||||
|   } | ||||
| } | ||||
| defineExpose({ open }) // 提供 open 方法,用于打开弹窗 | ||||
|  | ||||
| /** 提交表单 */ | ||||
| const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 | ||||
| const submitForm = async () => { | ||||
|   // 校验表单 | ||||
|   if (!formRef) return | ||||
|   const valid = await formRef.value.getElFormRef().validate() | ||||
|   if (!valid) return | ||||
|   // 提交请求 | ||||
|   formLoading.value = true | ||||
|   try { | ||||
|     const data = formRef.value.formModel as ReceivablesApi.ReceivablesVO | ||||
|     if (formType.value === 'create') { | ||||
|       await ReceivablesApi.createReceivables(data) | ||||
|       message.success(t('common.createSuccess')) | ||||
|     } else { | ||||
|       await ReceivablesApi.updateReceivables(data) | ||||
|       message.success(t('common.updateSuccess')) | ||||
|     } | ||||
|     dialogVisible.value = false | ||||
|     // 发送操作成功的事件 | ||||
|     emit('success') | ||||
|   } finally { | ||||
|     formLoading.value = false | ||||
|   } | ||||
| } | ||||
| </script> | ||||
| @@ -0,0 +1,85 @@ | ||||
| <template> | ||||
|   <!-- 搜索工作栏 --> | ||||
|   <ContentWrap> | ||||
|     <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams"> | ||||
|       <!-- 新增等操作按钮 --> | ||||
|       <template #actionMore> | ||||
|         <el-button | ||||
|           type="primary" | ||||
|           plain | ||||
|           @click="openForm('create')" | ||||
|           v-hasPermi="['pms:receivables:create']" | ||||
|         > | ||||
|           <Icon icon="ep:plus" class="mr-5px" /> 新增 | ||||
|         </el-button> | ||||
|       </template> | ||||
|     </Search> | ||||
|   </ContentWrap> | ||||
|  | ||||
|   <!-- 列表 --> | ||||
|   <ContentWrap> | ||||
|     <Table | ||||
|       :columns="allSchemas.tableColumns" | ||||
|       :data="tableObject.tableList" | ||||
|       :loading="tableObject.loading" | ||||
|       :pagination="{ | ||||
|         total: tableObject.total | ||||
|       }" | ||||
|       v-model:pageSize="tableObject.pageSize" | ||||
|       v-model:currentPage="tableObject.currentPage" | ||||
|     > | ||||
|       <template #action="{ row }"> | ||||
|         <el-button | ||||
|           link | ||||
|           type="primary" | ||||
|           @click="openForm('update', row.id)" | ||||
|           v-hasPermi="['pms:receivables:update']" | ||||
|         > | ||||
|           编辑 | ||||
|         </el-button> | ||||
|         <el-button | ||||
|           link | ||||
|           type="danger" | ||||
|           v-hasPermi="['pms:receivables:delete']" | ||||
|           @click="handleDelete(row.id)" | ||||
|         > | ||||
|           删除 | ||||
|         </el-button> | ||||
|       </template> | ||||
|     </Table> | ||||
|   </ContentWrap> | ||||
|  | ||||
|   <!-- 表单弹窗:添加/修改 --> | ||||
|   <ReceivablesForm ref="formRef" @success="getList" /> | ||||
| </template> | ||||
| <script setup lang="ts" name="Receivables"> | ||||
| import { allSchemas } from './receivables.data' | ||||
| import * as ReceivablesApi from '@/api/pms/receivables' | ||||
| import ReceivablesForm from './ReceivablesForm.vue' | ||||
|  | ||||
| // tableObject:表格的属性对象,可获得分页大小、条数等属性 | ||||
| // tableMethods:表格的操作对象,可进行获得分页、删除记录等操作 | ||||
| // 详细可见:https://doc.iocoder.cn/vue3/crud-schema/ | ||||
| const { tableObject, tableMethods } = useTable({ | ||||
|   getListApi: ReceivablesApi.getReceivablesPage, // 分页接口 | ||||
|   delListApi: ReceivablesApi.deleteReceivables // 删除接口 | ||||
| }) | ||||
| // 获得表格的各种操作 | ||||
| const { getList, setSearchParams } = tableMethods | ||||
|  | ||||
| /** 添加/修改操作 */ | ||||
| const formRef = ref() | ||||
| const openForm = (type: string, id?: number) => { | ||||
|   formRef.value.open(type, id) | ||||
| } | ||||
|  | ||||
| /** 删除按钮操作 */ | ||||
| const handleDelete = (id: number) => { | ||||
|   tableMethods.delList(id, false) | ||||
| } | ||||
|  | ||||
| /** 初始化 **/ | ||||
| onMounted(() => { | ||||
|   getList() | ||||
| }) | ||||
| </script> | ||||
| @@ -0,0 +1,85 @@ | ||||
| import type { CrudSchema } from '@/hooks/web/useCrudSchemas' | ||||
| import { dateFormatter } from '@/utils/formatTime' | ||||
|  | ||||
| // 表单校验 | ||||
| export const rules = reactive({ | ||||
|   projectId: [required], | ||||
| }) | ||||
|  | ||||
| // CrudSchema https://doc.iocoder.cn/vue3/crud-schema/ | ||||
| const crudSchemas = reactive<CrudSchema[]>([ | ||||
|   { | ||||
|     label: '主键', | ||||
|     field: 'id', | ||||
|     isForm: false, | ||||
|   }, | ||||
|   { | ||||
|     label: '项目id', | ||||
|     field: 'projectId', | ||||
|     isSearch: true, | ||||
|     form: { | ||||
|       component: 'InputNumber', | ||||
|       value: 0 | ||||
|     }, | ||||
|   }, | ||||
|   { | ||||
|     label: '主合同id	', | ||||
|     field: 'contractId', | ||||
|     isSearch: true, | ||||
|     form: { | ||||
|       component: 'InputNumber', | ||||
|       value: 0 | ||||
|     }, | ||||
|   }, | ||||
|   { | ||||
|     label: '方案阶段比例', | ||||
|     field: 'planStage', | ||||
|     isSearch: true, | ||||
|   }, | ||||
|   { | ||||
|     label: '初设阶段比例', | ||||
|     field: 'initialDesignStage', | ||||
|     isSearch: true, | ||||
|   }, | ||||
|   { | ||||
|     label: '施工图阶段比例', | ||||
|     field: 'constructionDrawingStage', | ||||
|     isSearch: true, | ||||
|   }, | ||||
|   { | ||||
|     label: '施工配合阶段', | ||||
|     field: 'constructionStage', | ||||
|     isSearch: true, | ||||
|   }, | ||||
|   { | ||||
|     label: '审定阶段', | ||||
|     field: 'approveStage', | ||||
|     isSearch: true, | ||||
|   }, | ||||
|   { | ||||
|     label: '回款情况', | ||||
|     field: 'collectionSituation', | ||||
|     isSearch: true, | ||||
|   }, | ||||
|   { | ||||
|     label: '创建时间', | ||||
|     field: 'createTime', | ||||
|     formatter: dateFormatter, | ||||
|     isSearch: true, | ||||
|     search: { | ||||
|       component: 'DatePicker', | ||||
|       componentProps: { | ||||
|         valueFormat: 'YYYY-MM-DD HH:mm:ss', | ||||
|         type: 'daterange', | ||||
|         defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] | ||||
|       } | ||||
|     }, | ||||
|     isForm: false, | ||||
|   }, | ||||
|   { | ||||
|     label: '操作', | ||||
|     field: 'action', | ||||
|     isForm: false | ||||
|   } | ||||
| ]) | ||||
| export const { allSchemas } = useCrudSchemas(crudSchemas) | ||||
| @@ -0,0 +1,47 @@ | ||||
| import request from '@/config/axios' | ||||
|  | ||||
| export interface ReceivablesHistoryVO { | ||||
|                     id: number | ||||
|                     projectId: number | ||||
|                     contractId: number | ||||
|                     planStage: string | ||||
|                     initialDesignStage: string | ||||
|                     constructionDrawingStage: string | ||||
|                     constructionStage: string | ||||
|                     approveStage: string | ||||
|                     collectionSituation: string | ||||
|                     processInstanceId: string | ||||
|                     processStatus: string | ||||
|                     receivableId: number | ||||
|                     version: string | ||||
| } | ||||
|  | ||||
| // 查询应收款管理历史记录列表 | ||||
| export const getReceivablesHistoryPage = async (params) => { | ||||
|   return await request.get({ url: '/pms/receivables-history/page', params }) | ||||
| } | ||||
|  | ||||
| // 查询应收款管理历史记录详情 | ||||
| export const getReceivablesHistory = async (id: number) => { | ||||
|   return await request.get({ url: '/pms/receivables-history/get?id=' + id }) | ||||
| } | ||||
|  | ||||
| // 新增应收款管理历史记录 | ||||
| export const createReceivablesHistory = async (data: ReceivablesHistoryVO) => { | ||||
|   return await request.post({ url: '/pms/receivables-history/create', data }) | ||||
| } | ||||
|  | ||||
| // 修改应收款管理历史记录 | ||||
| export const updateReceivablesHistory = async (data: ReceivablesHistoryVO) => { | ||||
|   return await request.put({ url: '/pms/receivables-history/update', data }) | ||||
| } | ||||
|  | ||||
| // 删除应收款管理历史记录 | ||||
| export const deleteReceivablesHistory = async (id: number) => { | ||||
|   return await request.delete({ url: '/pms/receivables-history/delete?id=' + id }) | ||||
| } | ||||
|  | ||||
| // 导出应收款管理历史记录 Excel | ||||
| export const exportReceivablesHistoryApi = async (params) => { | ||||
|   return await request.download({ url: '/pms/receivables-history/export-excel', params }) | ||||
| } | ||||
| @@ -0,0 +1,65 @@ | ||||
| <template> | ||||
|   <Dialog :title="dialogTitle" v-model="dialogVisible"> | ||||
|     <Form ref="formRef" :schema="allSchemas.formSchema" :rules="rules" v-loading="formLoading" /> | ||||
|     <template #footer> | ||||
|       <el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button> | ||||
|       <el-button @click="dialogVisible = false">取 消</el-button> | ||||
|     </template> | ||||
|   </Dialog> | ||||
| </template> | ||||
| <script setup lang="ts"> | ||||
| import * as ReceivablesHistoryApi from '@/api/pms/receivableshistory' | ||||
| import { rules, allSchemas } from './receivablesHistory.data' | ||||
| const { t } = useI18n() // 国际化 | ||||
| const message = useMessage() // 消息弹窗 | ||||
|  | ||||
| const dialogVisible = ref(false) // 弹窗的是否展示 | ||||
| const dialogTitle = ref('') // 弹窗的标题 | ||||
| const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 | ||||
| const formType = ref('') // 表单的类型:create - 新增;update - 修改 | ||||
| const formRef = ref() // 表单 Ref | ||||
|  | ||||
| /** 打开弹窗 */ | ||||
| const open = async (type: string, id?: number) => { | ||||
|   dialogVisible.value = true | ||||
|   dialogTitle.value = t('action.' + type) | ||||
|   formType.value = type | ||||
|   // 修改时,设置数据 | ||||
|   if (id) { | ||||
|     formLoading.value = true | ||||
|     try { | ||||
|       const data = await ReceivablesHistoryApi.getReceivablesHistory(id) | ||||
|       formRef.value.setValues(data) | ||||
|     } finally { | ||||
|       formLoading.value = false | ||||
|     } | ||||
|   } | ||||
| } | ||||
| defineExpose({ open }) // 提供 open 方法,用于打开弹窗 | ||||
|  | ||||
| /** 提交表单 */ | ||||
| const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 | ||||
| const submitForm = async () => { | ||||
|   // 校验表单 | ||||
|   if (!formRef) return | ||||
|   const valid = await formRef.value.getElFormRef().validate() | ||||
|   if (!valid) return | ||||
|   // 提交请求 | ||||
|   formLoading.value = true | ||||
|   try { | ||||
|     const data = formRef.value.formModel as ReceivablesHistoryApi.ReceivablesHistoryVO | ||||
|     if (formType.value === 'create') { | ||||
|       await ReceivablesHistoryApi.createReceivablesHistory(data) | ||||
|       message.success(t('common.createSuccess')) | ||||
|     } else { | ||||
|       await ReceivablesHistoryApi.updateReceivablesHistory(data) | ||||
|       message.success(t('common.updateSuccess')) | ||||
|     } | ||||
|     dialogVisible.value = false | ||||
|     // 发送操作成功的事件 | ||||
|     emit('success') | ||||
|   } finally { | ||||
|     formLoading.value = false | ||||
|   } | ||||
| } | ||||
| </script> | ||||
| @@ -0,0 +1,85 @@ | ||||
| <template> | ||||
|   <!-- 搜索工作栏 --> | ||||
|   <ContentWrap> | ||||
|     <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams"> | ||||
|       <!-- 新增等操作按钮 --> | ||||
|       <template #actionMore> | ||||
|         <el-button | ||||
|           type="primary" | ||||
|           plain | ||||
|           @click="openForm('create')" | ||||
|           v-hasPermi="['pms:receivables-history:create']" | ||||
|         > | ||||
|           <Icon icon="ep:plus" class="mr-5px" /> 新增 | ||||
|         </el-button> | ||||
|       </template> | ||||
|     </Search> | ||||
|   </ContentWrap> | ||||
|  | ||||
|   <!-- 列表 --> | ||||
|   <ContentWrap> | ||||
|     <Table | ||||
|       :columns="allSchemas.tableColumns" | ||||
|       :data="tableObject.tableList" | ||||
|       :loading="tableObject.loading" | ||||
|       :pagination="{ | ||||
|         total: tableObject.total | ||||
|       }" | ||||
|       v-model:pageSize="tableObject.pageSize" | ||||
|       v-model:currentPage="tableObject.currentPage" | ||||
|     > | ||||
|       <template #action="{ row }"> | ||||
|         <el-button | ||||
|           link | ||||
|           type="primary" | ||||
|           @click="openForm('update', row.id)" | ||||
|           v-hasPermi="['pms:receivables-history:update']" | ||||
|         > | ||||
|           编辑 | ||||
|         </el-button> | ||||
|         <el-button | ||||
|           link | ||||
|           type="danger" | ||||
|           v-hasPermi="['pms:receivables-history:delete']" | ||||
|           @click="handleDelete(row.id)" | ||||
|         > | ||||
|           删除 | ||||
|         </el-button> | ||||
|       </template> | ||||
|     </Table> | ||||
|   </ContentWrap> | ||||
|  | ||||
|   <!-- 表单弹窗:添加/修改 --> | ||||
|   <ReceivablesHistoryForm ref="formRef" @success="getList" /> | ||||
| </template> | ||||
| <script setup lang="ts" name="ReceivablesHistory"> | ||||
| import { allSchemas } from './receivablesHistory.data' | ||||
| import * as ReceivablesHistoryApi from '@/api/pms/receivableshistory' | ||||
| import ReceivablesHistoryForm from './ReceivablesHistoryForm.vue' | ||||
|  | ||||
| // tableObject:表格的属性对象,可获得分页大小、条数等属性 | ||||
| // tableMethods:表格的操作对象,可进行获得分页、删除记录等操作 | ||||
| // 详细可见:https://doc.iocoder.cn/vue3/crud-schema/ | ||||
| const { tableObject, tableMethods } = useTable({ | ||||
|   getListApi: ReceivablesHistoryApi.getReceivablesHistoryPage, // 分页接口 | ||||
|   delListApi: ReceivablesHistoryApi.deleteReceivablesHistory // 删除接口 | ||||
| }) | ||||
| // 获得表格的各种操作 | ||||
| const { getList, setSearchParams } = tableMethods | ||||
|  | ||||
| /** 添加/修改操作 */ | ||||
| const formRef = ref() | ||||
| const openForm = (type: string, id?: number) => { | ||||
|   formRef.value.open(type, id) | ||||
| } | ||||
|  | ||||
| /** 删除按钮操作 */ | ||||
| const handleDelete = (id: number) => { | ||||
|   tableMethods.delList(id, false) | ||||
| } | ||||
|  | ||||
| /** 初始化 **/ | ||||
| onMounted(() => { | ||||
|   getList() | ||||
| }) | ||||
| </script> | ||||
| @@ -0,0 +1,112 @@ | ||||
| import type { CrudSchema } from '@/hooks/web/useCrudSchemas' | ||||
| import { dateFormatter } from '@/utils/formatTime' | ||||
|  | ||||
| // 表单校验 | ||||
| export const rules = reactive({ | ||||
|   projectId: [required], | ||||
| }) | ||||
|  | ||||
| // CrudSchema https://doc.iocoder.cn/vue3/crud-schema/ | ||||
| const crudSchemas = reactive<CrudSchema[]>([ | ||||
|   { | ||||
|     label: '主键', | ||||
|     field: 'id', | ||||
|     isForm: false, | ||||
|   }, | ||||
|   { | ||||
|     label: '项目id', | ||||
|     field: 'projectId', | ||||
|     isSearch: true, | ||||
|     form: { | ||||
|       component: 'InputNumber', | ||||
|       value: 0 | ||||
|     }, | ||||
|   }, | ||||
|   { | ||||
|     label: '主合同id	', | ||||
|     field: 'contractId', | ||||
|     isSearch: true, | ||||
|     form: { | ||||
|       component: 'InputNumber', | ||||
|       value: 0 | ||||
|     }, | ||||
|   }, | ||||
|   { | ||||
|     label: '方案阶段比例', | ||||
|     field: 'planStage', | ||||
|     isSearch: true, | ||||
|   }, | ||||
|   { | ||||
|     label: '初设阶段比例', | ||||
|     field: 'initialDesignStage', | ||||
|     isSearch: true, | ||||
|   }, | ||||
|   { | ||||
|     label: '施工图阶段比例', | ||||
|     field: 'constructionDrawingStage', | ||||
|     isSearch: true, | ||||
|   }, | ||||
|   { | ||||
|     label: '施工配合阶段', | ||||
|     field: 'constructionStage', | ||||
|     isSearch: true, | ||||
|   }, | ||||
|   { | ||||
|     label: '审定阶段', | ||||
|     field: 'approveStage', | ||||
|     isSearch: true, | ||||
|   }, | ||||
|   { | ||||
|     label: '回款情况', | ||||
|     field: 'collectionSituation', | ||||
|     isSearch: true, | ||||
|   }, | ||||
|   { | ||||
|     label: '创建时间', | ||||
|     field: 'createTime', | ||||
|     formatter: dateFormatter, | ||||
|     isSearch: true, | ||||
|     search: { | ||||
|       component: 'DatePicker', | ||||
|       componentProps: { | ||||
|         valueFormat: 'YYYY-MM-DD HH:mm:ss', | ||||
|         type: 'daterange', | ||||
|         defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] | ||||
|       } | ||||
|     }, | ||||
|     isForm: false, | ||||
|   }, | ||||
|   { | ||||
|     label: '流程实体id', | ||||
|     field: 'processInstanceId', | ||||
|     isSearch: true, | ||||
|   }, | ||||
|   { | ||||
|     label: '流程状态', | ||||
|     field: 'processStatus', | ||||
|     isSearch: true, | ||||
|     form: { | ||||
|       component: 'Radio' | ||||
|     }, | ||||
|   }, | ||||
|   { | ||||
|     label: '应收款id', | ||||
|     field: 'receivableId', | ||||
|     isSearch: true, | ||||
|     form: { | ||||
|       component: 'InputNumber', | ||||
|       value: 0 | ||||
|     }, | ||||
|   }, | ||||
|   { | ||||
|     label: '版本', | ||||
|     field: 'version', | ||||
|     isSearch: true, | ||||
|   }, | ||||
|   { | ||||
|     label: '操作', | ||||
|     field: 'action', | ||||
|     isForm: false | ||||
|   } | ||||
| ]) | ||||
| export const { allSchemas } = useCrudSchemas(crudSchemas) | ||||
		Reference in New Issue
	
	Block a user
	 wyw
					wyw