mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-09-10 23:21:58 +08:00
Merge branch 'feature-contract-7.22-wyw' into feature-budge-7.23-zqc
# 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-ext/codegen-cms-ext-sql.sql
Normal file
55
sql/cms-ext/codegen-cms-ext-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,
|
||||||
|
'ext-contract', '', 'cms-ext/extcontract/index', 0, 'ExtContract'
|
||||||
|
);
|
||||||
|
|
||||||
|
-- 按钮父菜单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-ext:ext-contract:query', 3, 1, @parentId,
|
||||||
|
'', '', '', 0
|
||||||
|
);
|
||||||
|
INSERT INTO system_menu(
|
||||||
|
name, permission, type, sort, parent_id,
|
||||||
|
path, icon, component, status
|
||||||
|
)
|
||||||
|
VALUES (
|
||||||
|
'外部合同创建', 'cms-ext:ext-contract:create', 3, 2, @parentId,
|
||||||
|
'', '', '', 0
|
||||||
|
);
|
||||||
|
INSERT INTO system_menu(
|
||||||
|
name, permission, type, sort, parent_id,
|
||||||
|
path, icon, component, status
|
||||||
|
)
|
||||||
|
VALUES (
|
||||||
|
'外部合同更新', 'cms-ext:ext-contract:update', 3, 3, @parentId,
|
||||||
|
'', '', '', 0
|
||||||
|
);
|
||||||
|
INSERT INTO system_menu(
|
||||||
|
name, permission, type, sort, parent_id,
|
||||||
|
path, icon, component, status
|
||||||
|
)
|
||||||
|
VALUES (
|
||||||
|
'外部合同删除', 'cms-ext:ext-contract:delete', 3, 4, @parentId,
|
||||||
|
'', '', '', 0
|
||||||
|
);
|
||||||
|
INSERT INTO system_menu(
|
||||||
|
name, permission, type, sort, parent_id,
|
||||||
|
path, icon, component, status
|
||||||
|
)
|
||||||
|
VALUES (
|
||||||
|
'外部合同导出', 'cms-ext:ext-contract:export', 3, 5, @parentId,
|
||||||
|
'', '', '', 0
|
||||||
|
);
|
31
sql/cms/codegen-cms-sql.sql
Normal file
31
sql/cms/codegen-cms-sql.sql
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
-- 菜单 SQL
|
||||||
|
INSERT INTO system_menu(name, permission, type, sort, parent_id,
|
||||||
|
path, icon, component, status, component_name)
|
||||||
|
VALUES ('合同管理', '', 2, 0, 2758,
|
||||||
|
'contract', '', 'cms/contract/index', 0, 'Contract');
|
||||||
|
|
||||||
|
-- 按钮父菜单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:query', 3, 1, @parentId,
|
||||||
|
'', '', '', 0);
|
||||||
|
INSERT INTO system_menu(name, permission, type, sort, parent_id,
|
||||||
|
path, icon, component, status)
|
||||||
|
VALUES ('合同创建', 'cms:contract:create', 3, 2, @parentId,
|
||||||
|
'', '', '', 0);
|
||||||
|
INSERT INTO system_menu(name, permission, type, sort, parent_id,
|
||||||
|
path, icon, component, status)
|
||||||
|
VALUES ('合同更新', 'cms:contract:update', 3, 3, @parentId,
|
||||||
|
'', '', '', 0);
|
||||||
|
INSERT INTO system_menu(name, permission, type, sort, parent_id,
|
||||||
|
path, icon, component, status)
|
||||||
|
VALUES ('合同删除', 'cms:contract:delete', 3, 4, @parentId,
|
||||||
|
'', '', '', 0);
|
||||||
|
INSERT INTO system_menu(name, permission, type, sort, parent_id,
|
||||||
|
path, icon, component, status)
|
||||||
|
VALUES ('合同导出', 'cms:contract:export', 3, 5, @parentId,
|
||||||
|
'', '', '', 0);
|
@@ -8,13 +8,12 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
|||||||
* @date 2024/7/3
|
* @date 2024/7/3
|
||||||
*/
|
*/
|
||||||
public interface ErrorCodeConstants {
|
public interface ErrorCodeConstants {
|
||||||
ErrorCode CUSTOMER_COMPANY_NOT_EXISTS = new ErrorCode(1_020_000_000, "客户公司管理不存在");
|
|
||||||
|
|
||||||
// ========== 外包合同 2_021_000_000 ==========
|
ErrorCode CONTRACT_NOT_EXISTS = new ErrorCode(2_020_000_000, "合同不存在");
|
||||||
ErrorCode OUTS_CONTRACT_NOT_EXISTS = new ErrorCode(2_021_000_000, "外包合同不存在");
|
|
||||||
|
ErrorCode EXT_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, "外包合同关联不存在");
|
|
||||||
}
|
}
|
||||||
|
@@ -29,6 +29,12 @@
|
|||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.boot</groupId>
|
||||||
|
<artifactId>yudao-module-pms-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Web 相关 -->
|
<!-- Web 相关 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.iocoder.boot</groupId>
|
<groupId>cn.iocoder.boot</groupId>
|
||||||
|
@@ -0,0 +1,90 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.contract;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractRespVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.service.contract.ContractService;
|
||||||
|
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.*;
|
||||||
|
import jakarta.servlet.http.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
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.*;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 合同管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cms/contract")
|
||||||
|
@Validated
|
||||||
|
public class ContractController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ContractService contractService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建合同")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:contract:create')")
|
||||||
|
public CommonResult<Long> createContract(@Valid @RequestBody ContractSaveReqVO createReqVO) {
|
||||||
|
return success(contractService.createContract(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新合同")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:contract:update')")
|
||||||
|
public CommonResult<Boolean> updateContract(@Valid @RequestBody ContractSaveReqVO updateReqVO) {
|
||||||
|
contractService.updateContract(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除合同")
|
||||||
|
@Parameter(name = "id", description = "合同id", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:contract:delete')")
|
||||||
|
public CommonResult<Boolean> deleteContract(@RequestParam("id") Long id) {
|
||||||
|
contractService.deleteContract(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得合同")
|
||||||
|
@Parameter(name = "id", description = "合同id", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:contract:query')")
|
||||||
|
public CommonResult<ContractRespVO> getContract(@RequestParam("id") Long id) {
|
||||||
|
ContractRespVO contractRespVO = contractService.getContract(id);
|
||||||
|
return success(contractRespVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得合同分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:contract:query')")
|
||||||
|
public CommonResult<PageResult<ContractRespVO>> getContractPage(@Valid ContractPageReqVO pageReqVO) {
|
||||||
|
PageResult<ContractRespVO> pageResult = contractService.getContractPage(pageReqVO);
|
||||||
|
return success(pageResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出合同 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:contract:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportContractExcel(@Valid ContractPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ContractRespVO> list = contractService.getContractPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "合同.xls", "数据", ContractRespVO.class,
|
||||||
|
BeanUtils.toBean(list, ContractRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,106 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.contract.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 ContractPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", example = "芋艿")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "合同类型", example = "2")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "合同进展")
|
||||||
|
private String progress;
|
||||||
|
|
||||||
|
@Schema(description = "合同拟定时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] expectedTime;
|
||||||
|
|
||||||
|
@Schema(description = "合同用印时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] printingTime;
|
||||||
|
|
||||||
|
@Schema(description = "签订时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] signingTime;
|
||||||
|
|
||||||
|
@Schema(description = "归档时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] archiveTime;
|
||||||
|
|
||||||
|
@Schema(description = "合同状态", example = "1")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "计费方式", example = "1")
|
||||||
|
private String countType;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "随便")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "合同url", example = "https://www.iocoder.cn")
|
||||||
|
private String contractFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "建安费")
|
||||||
|
private BigDecimal constructionCost;
|
||||||
|
|
||||||
|
@Schema(description = "资金来源")
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
@Schema(description = "优惠", example = "17910")
|
||||||
|
private String discount;
|
||||||
|
|
||||||
|
@Schema(description = "是否联合体")
|
||||||
|
private Boolean consortium;
|
||||||
|
|
||||||
|
@Schema(description = "联合体单位")
|
||||||
|
private String consortiumCompany;
|
||||||
|
|
||||||
|
@Schema(description = "占主合同比例")
|
||||||
|
private String extProportion;
|
||||||
|
|
||||||
|
@Schema(description = "审定金额")
|
||||||
|
private BigDecimal approvedAmount;
|
||||||
|
|
||||||
|
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||||
|
private String reviewFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
@Schema(description = "签订合同总额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(description = "前期费")
|
||||||
|
private BigDecimal preAmount;
|
||||||
|
|
||||||
|
@Schema(description = "设计费")
|
||||||
|
private BigDecimal designAmount;
|
||||||
|
|
||||||
|
@Schema(description = "勘测费")
|
||||||
|
private BigDecimal surveyFees;
|
||||||
|
|
||||||
|
@Schema(description = "测量费")
|
||||||
|
private BigDecimal measurementFee;
|
||||||
|
|
||||||
|
@Schema(description = "其他费")
|
||||||
|
private BigDecimal otherFee;
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,150 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.contract.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 合同 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ContractRespVO {
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
|
||||||
|
@ExcelProperty("项目编号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||||
|
@ExcelProperty("主控部门")
|
||||||
|
private String trackingDep;
|
||||||
|
|
||||||
|
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("项目经理")
|
||||||
|
private String projectManager;
|
||||||
|
|
||||||
|
@Schema(description = "分包合同提示时间")
|
||||||
|
@ExcelProperty("分包合同提示时间")
|
||||||
|
private LocalDateTime subReminderTime;
|
||||||
|
|
||||||
|
@Schema(description = "暂定结算数")
|
||||||
|
@ExcelProperty("暂定结算数")
|
||||||
|
private BigDecimal provisionalSettlement;
|
||||||
|
|
||||||
|
@Schema(description = "出图公司", requiredMode = Schema.RequiredMode.REQUIRED,example = "***设计院")
|
||||||
|
@ExcelProperty("出图公司")
|
||||||
|
private String drawingCompany;
|
||||||
|
|
||||||
|
@Schema(description = "预计合同金额", requiredMode = Schema.RequiredMode.REQUIRED,example = "200.0000")
|
||||||
|
@ExcelProperty("预计合同金额")
|
||||||
|
private BigDecimal expectedContractAmount;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
|
@ExcelProperty("合同名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "合同类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
@ExcelProperty("合同类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "合同进展", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("合同进展")
|
||||||
|
private String progress;
|
||||||
|
|
||||||
|
@Schema(description = "合同拟定时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("合同拟定时间")
|
||||||
|
private LocalDateTime expectedTime;
|
||||||
|
|
||||||
|
@Schema(description = "合同用印时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("合同用印时间")
|
||||||
|
private LocalDateTime printingTime;
|
||||||
|
|
||||||
|
@Schema(description = "签订时间")
|
||||||
|
@ExcelProperty("签订时间")
|
||||||
|
private LocalDateTime signingTime;
|
||||||
|
|
||||||
|
@Schema(description = "归档时间")
|
||||||
|
@ExcelProperty("归档时间")
|
||||||
|
private LocalDateTime archiveTime;
|
||||||
|
|
||||||
|
@Schema(description = "合同状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
@ExcelProperty("合同状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "计费方式", example = "1")
|
||||||
|
@ExcelProperty("计费方式")
|
||||||
|
private String countType;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "随便")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "合同url", example = "https://www.iocoder.cn")
|
||||||
|
@ExcelProperty("合同url")
|
||||||
|
private String contractFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "建安费")
|
||||||
|
@ExcelProperty("建安费")
|
||||||
|
private BigDecimal constructionCost;
|
||||||
|
|
||||||
|
@Schema(description = "资金来源")
|
||||||
|
@ExcelProperty("资金来源")
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
@Schema(description = "优惠", example = "17910")
|
||||||
|
@ExcelProperty("优惠")
|
||||||
|
private String discount;
|
||||||
|
|
||||||
|
@Schema(description = "是否联合体")
|
||||||
|
@ExcelProperty("是否联合体")
|
||||||
|
private Boolean consortium;
|
||||||
|
|
||||||
|
@Schema(description = "联合体单位")
|
||||||
|
@ExcelProperty("联合体单位")
|
||||||
|
private String consortiumCompany;
|
||||||
|
|
||||||
|
@Schema(description = "占主合同比例")
|
||||||
|
@ExcelProperty("占主合同比例")
|
||||||
|
private String extProportion;
|
||||||
|
|
||||||
|
@Schema(description = "审定金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("审定金额")
|
||||||
|
private BigDecimal approvedAmount;
|
||||||
|
|
||||||
|
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||||
|
@ExcelProperty("审核文件url")
|
||||||
|
private String reviewFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "签订合同总额")
|
||||||
|
@ExcelProperty("签订合同总额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(description = "前期费")
|
||||||
|
@ExcelProperty("前期费")
|
||||||
|
private BigDecimal preAmount;
|
||||||
|
|
||||||
|
@Schema(description = "设计费")
|
||||||
|
@ExcelProperty("设计费")
|
||||||
|
private BigDecimal designAmount;
|
||||||
|
|
||||||
|
@Schema(description = "勘测费")
|
||||||
|
@ExcelProperty("勘测费")
|
||||||
|
private BigDecimal surveyFees;
|
||||||
|
|
||||||
|
@Schema(description = "测量费")
|
||||||
|
@ExcelProperty("测量费")
|
||||||
|
private BigDecimal measurementFee;
|
||||||
|
|
||||||
|
@Schema(description = "其他费")
|
||||||
|
@ExcelProperty("其他费")
|
||||||
|
private BigDecimal otherFee;
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,124 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.contract.vo;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 合同新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ContractSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
|
@NotEmpty(message = "合同名称不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "合同类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
@NotEmpty(message = "合同类型不能为空")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "合同进展", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "合同进展不能为空")
|
||||||
|
private String progress;
|
||||||
|
|
||||||
|
@Schema(description = "合同拟定时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "合同拟定时间不能为空")
|
||||||
|
private LocalDateTime expectedTime;
|
||||||
|
|
||||||
|
@Schema(description = "合同用印时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "合同用印时间不能为空")
|
||||||
|
private LocalDateTime printingTime;
|
||||||
|
|
||||||
|
@Schema(description = "签订时间")
|
||||||
|
private LocalDateTime signingTime;
|
||||||
|
|
||||||
|
@Schema(description = "归档时间")
|
||||||
|
private LocalDateTime archiveTime;
|
||||||
|
|
||||||
|
@Schema(description = "合同状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
@NotEmpty(message = "合同状态不能为空")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "计费方式", example = "1")
|
||||||
|
private String countType;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "随便")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "合同url", example = "https://www.iocoder.cn")
|
||||||
|
private String contractFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "建安费")
|
||||||
|
private BigDecimal constructionCost;
|
||||||
|
|
||||||
|
@Schema(description = "资金来源")
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
@Schema(description = "优惠", example = "17910")
|
||||||
|
private String discount;
|
||||||
|
|
||||||
|
@Schema(description = "是否联合体")
|
||||||
|
private Boolean consortium;
|
||||||
|
|
||||||
|
@Schema(description = "联合体单位")
|
||||||
|
private String consortiumCompany;
|
||||||
|
|
||||||
|
@Schema(description = "占主合同比例")
|
||||||
|
private String extProportion;
|
||||||
|
|
||||||
|
@Schema(description = "审定金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "审定金额不能为空")
|
||||||
|
private BigDecimal approvedAmount;
|
||||||
|
|
||||||
|
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||||
|
private String reviewFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "签订合同总额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(description = "前期费")
|
||||||
|
private BigDecimal preAmount;
|
||||||
|
|
||||||
|
@Schema(description = "设计费")
|
||||||
|
private BigDecimal designAmount;
|
||||||
|
|
||||||
|
@Schema(description = "勘测费")
|
||||||
|
private BigDecimal surveyFees;
|
||||||
|
|
||||||
|
@Schema(description = "测量费")
|
||||||
|
private BigDecimal measurementFee;
|
||||||
|
|
||||||
|
@Schema(description = "其他费")
|
||||||
|
private BigDecimal otherFee;
|
||||||
|
|
||||||
|
@Schema(description = "创建者")
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "创建时间不能为空")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新者")
|
||||||
|
private String updater;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "更新时间不能为空")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "是否删除不能为空")
|
||||||
|
private Boolean deleted;
|
||||||
|
|
||||||
|
@Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12587")
|
||||||
|
@NotNull(message = "租户编号不能为空")
|
||||||
|
private Long tenantId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@@ -1,103 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.cms.controller.admin.customerCompany;
|
|
||||||
|
|
||||||
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.customerCompany.vo.*;
|
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO;
|
|
||||||
import cn.iocoder.yudao.module.cms.service.customerCompany.CustomerCompanyService;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 客户公司")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/cms/customer-company")
|
|
||||||
@Validated
|
|
||||||
public class CustomerCompanyController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CustomerCompanyService customerCompanyService;
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
@Operation(summary = "创建客户公司")
|
|
||||||
@PreAuthorize("@ss.hasPermission('cms:customer-company:create')")
|
|
||||||
public CommonResult<Long> createCustomerCompany(@Valid @RequestBody CustomerCompanySaveReqVO createReqVO) {
|
|
||||||
return success(customerCompanyService.createCustomerCompany(createReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新客户公司")
|
|
||||||
@PreAuthorize("@ss.hasPermission('cms:customer-company:update')")
|
|
||||||
public CommonResult<Boolean> updateCustomerCompany(@Valid @RequestBody CustomerCompanySaveReqVO updateReqVO) {
|
|
||||||
customerCompanyService.updateCustomerCompany(updateReqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除客户公司")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
|
||||||
@PreAuthorize("@ss.hasPermission('cms:customer-company:delete')")
|
|
||||||
public CommonResult<Boolean> deleteCustomerCompany(@RequestParam("id") Long id) {
|
|
||||||
customerCompanyService.deleteCustomerCompany(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get")
|
|
||||||
@Operation(summary = "获得客户公司")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
||||||
@PreAuthorize("@ss.hasPermission('cms:customer-company:query')")
|
|
||||||
public CommonResult<CustomerCompanyRespVO> getCustomerCompany(@RequestParam("id") Long id) {
|
|
||||||
CustomerCompanyDO customerCompany = customerCompanyService.getCustomerCompany(id);
|
|
||||||
return success(BeanUtils.toBean(customerCompany, CustomerCompanyRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获得客户公司分页")
|
|
||||||
@PreAuthorize("@ss.hasPermission('cms:customer-company:query')")
|
|
||||||
public CommonResult<PageResult<CustomerCompanyRespVO>> getCustomerCompanyPage(@Valid CustomerCompanyPageReqVO pageReqVO) {
|
|
||||||
PageResult<CustomerCompanyDO> pageResult = customerCompanyService.getCustomerCompanyPage(pageReqVO);
|
|
||||||
return success(BeanUtils.toBean(pageResult, CustomerCompanyRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/list")
|
|
||||||
@Operation(summary = "获得客户公司列表")
|
|
||||||
@PreAuthorize("@ss.hasPermission('cms:customer-company:query')")
|
|
||||||
public CommonResult<List<CustomerCompanyRespVO>> getCustomerCompanyList(CustomerCompanyPageReqVO reqVO) {
|
|
||||||
List<CustomerCompanyDO> list = customerCompanyService.getCustomerCompanyList(reqVO);
|
|
||||||
return success(BeanUtils.toBean(list, CustomerCompanyRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
|
||||||
@Operation(summary = "导出客户公司 Excel")
|
|
||||||
@PreAuthorize("@ss.hasPermission('cms:customer-company:export')")
|
|
||||||
@ApiAccessLog(operateType = EXPORT)
|
|
||||||
public void exportCustomerCompanyExcel(@Valid CustomerCompanyPageReqVO pageReqVO,
|
|
||||||
HttpServletResponse response) throws IOException {
|
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
||||||
List<CustomerCompanyDO> list = customerCompanyService.getCustomerCompanyPage(pageReqVO).getList();
|
|
||||||
// 导出 Excel
|
|
||||||
ExcelUtils.write(response, "客户公司.xls", "数据", CustomerCompanyRespVO.class,
|
|
||||||
BeanUtils.toBean(list, CustomerCompanyRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -1,33 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.cms.controller.admin.customerCompany.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 CustomerCompanyPageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "联系人", example = "张三")
|
|
||||||
private String contacts;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
@Schema(description = "公司名称", example = "电力公司")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "地址")
|
|
||||||
private String address;
|
|
||||||
|
|
||||||
@Schema(description = "电话")
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
}
|
|
@@ -1,39 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.cms.controller.admin.customerCompany.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 CustomerCompanyRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14907")
|
|
||||||
@ExcelProperty("主键")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
|
||||||
@ExcelProperty("联系人")
|
|
||||||
private String contacts;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@ExcelProperty("创建时间")
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "电力公司")
|
|
||||||
@ExcelProperty("公司名称")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "地址")
|
|
||||||
@ExcelProperty("地址")
|
|
||||||
private String address;
|
|
||||||
|
|
||||||
@Schema(description = "电话")
|
|
||||||
@ExcelProperty("电话")
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
}
|
|
@@ -1,29 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.*;
|
|
||||||
import java.util.*;
|
|
||||||
import jakarta.validation.constraints.*;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 客户公司新增/修改 Request VO")
|
|
||||||
@Data
|
|
||||||
public class CustomerCompanySaveReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14907")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
|
||||||
@NotEmpty(message = "联系人不能为空")
|
|
||||||
private String contacts;
|
|
||||||
|
|
||||||
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "电力公司")
|
|
||||||
@NotEmpty(message = "公司名称不能为空")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "地址")
|
|
||||||
private String address;
|
|
||||||
|
|
||||||
@Schema(description = "电话")
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
}
|
|
@@ -0,0 +1,96 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.extcontract;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.extcontract.vo.ExtContractPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.extcontract.vo.ExtContractRespVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.extcontract.vo.ExtContractSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDO;
|
||||||
|
import cn.iocoder.yudao.module.cms.service.extcontract.ExtContractService;
|
||||||
|
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.*;
|
||||||
|
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.*;
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 外部合同")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cms-ext/ext-contract")
|
||||||
|
@Validated
|
||||||
|
public class ExtContractController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ExtContractService extContractService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建外部合同")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:create')")
|
||||||
|
public CommonResult<Long> createExtContract(@Valid @RequestBody ExtContractSaveReqVO createReqVO) {
|
||||||
|
return success(extContractService.createExtContract(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新外部合同")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:update')")
|
||||||
|
public CommonResult<Boolean> updateExtContract(@Valid @RequestBody ExtContractSaveReqVO updateReqVO) {
|
||||||
|
extContractService.updateExtContract(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除外部合同")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:delete')")
|
||||||
|
public CommonResult<Boolean> deleteExtContract(@RequestParam("id") Long id) {
|
||||||
|
extContractService.deleteExtContract(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得外部合同")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:query')")
|
||||||
|
public CommonResult<ExtContractRespVO> getExtContract(@RequestParam("id") Long id) {
|
||||||
|
ExtContractRespVO extContract = extContractService.getExtContract(id);
|
||||||
|
return success(extContract);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得外部合同分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:query')")
|
||||||
|
public CommonResult<PageResult<ExtContractRespVO>> getExtContractPage(@Valid ExtContractPageReqVO pageReqVO) {
|
||||||
|
PageResult<ExtContractDO> pageResult = extContractService.getExtContractPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, ExtContractRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出外部合同 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportExtContractExcel(@Valid ExtContractPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ExtContractDO> list = extContractService.getExtContractPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "外部合同.xls", "数据", ExtContractRespVO.class,
|
||||||
|
BeanUtils.toBean(list, ExtContractRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,110 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.extcontract.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
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 ExtContractPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "项目id", example = "30598")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", example = "芋艿")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "合同类型", example = "1")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "客户公司id", example = "25191")
|
||||||
|
private Long customerCompanyId;
|
||||||
|
|
||||||
|
@Schema(description = "合同进展")
|
||||||
|
private String progress;
|
||||||
|
|
||||||
|
@Schema(description = "预计签订时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] expectedTime;
|
||||||
|
|
||||||
|
@Schema(description = "签订时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] signingTime;
|
||||||
|
|
||||||
|
@Schema(description = "归档时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] archiveTime;
|
||||||
|
|
||||||
|
@Schema(description = "状态", example = "2")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "合同金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(description = "前期费用")
|
||||||
|
private BigDecimal preAmount;
|
||||||
|
|
||||||
|
@Schema(description = "设计费")
|
||||||
|
private BigDecimal designFee;
|
||||||
|
|
||||||
|
@Schema(description = "勘测费")
|
||||||
|
private BigDecimal surveyFees;
|
||||||
|
|
||||||
|
@Schema(description = "检测费")
|
||||||
|
private BigDecimal testingFee;
|
||||||
|
|
||||||
|
@Schema(description = "其他费")
|
||||||
|
private String otherFee;
|
||||||
|
|
||||||
|
@Schema(description = "计费方式", example = "1")
|
||||||
|
private String countType;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你猜")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "合同附件url", example = "https://www.iocoder.cn")
|
||||||
|
private String contractFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "建安费")
|
||||||
|
private BigDecimal constructionCost;
|
||||||
|
|
||||||
|
@Schema(description = "资金来源")
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
@Schema(description = "收费标准")
|
||||||
|
private String chargingStandard;
|
||||||
|
|
||||||
|
@Schema(description = "优惠", example = "15529")
|
||||||
|
private String discount;
|
||||||
|
|
||||||
|
@Schema(description = "是否联合体")
|
||||||
|
private Boolean consortium;
|
||||||
|
|
||||||
|
@Schema(description = "联合体单位")
|
||||||
|
private String consortiumCompany;
|
||||||
|
|
||||||
|
@Schema(description = "合同提示时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] reminderTime;
|
||||||
|
|
||||||
|
@Schema(description = "审定金额")
|
||||||
|
private BigDecimal approvedAmount;
|
||||||
|
|
||||||
|
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||||
|
private String reviewFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
@Schema(description = "合同id", example = "27460")
|
||||||
|
private Long contractId;
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,159 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.extcontract.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 外部合同 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ExtContractRespVO {
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
|
||||||
|
@ExcelProperty("项目编号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", example = "芋艿")
|
||||||
|
@ExcelProperty("合同名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "合同类型", example = "1")
|
||||||
|
@ExcelProperty("合同类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "客户名称")
|
||||||
|
@ExcelProperty("客户名称")
|
||||||
|
private String customerCompanyName;
|
||||||
|
|
||||||
|
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||||
|
@ExcelProperty("主控部门")
|
||||||
|
private String trackingDep;
|
||||||
|
|
||||||
|
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("项目经理")
|
||||||
|
private String projectManager;
|
||||||
|
|
||||||
|
@Schema(description = "合同提示时间")
|
||||||
|
@ExcelProperty("合同提示时间")
|
||||||
|
private LocalDateTime reminderTime;
|
||||||
|
|
||||||
|
@Schema(description = "合同进展")
|
||||||
|
@ExcelProperty("合同进展")
|
||||||
|
private String progress;
|
||||||
|
|
||||||
|
@Schema(description = "预计签订时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("预计签订时间")
|
||||||
|
private LocalDateTime expectedTime;
|
||||||
|
|
||||||
|
@Schema(description = "签订时间")
|
||||||
|
@ExcelProperty("签订时间")
|
||||||
|
private LocalDateTime signingTime;
|
||||||
|
|
||||||
|
@Schema(description = "归档时间")
|
||||||
|
@ExcelProperty("归档时间")
|
||||||
|
private LocalDateTime archiveTime;
|
||||||
|
|
||||||
|
@Schema(description = "状态", example = "2")
|
||||||
|
@ExcelProperty("状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "合同金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("合同金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(description = "前期费用")
|
||||||
|
@ExcelProperty("前期费用")
|
||||||
|
private BigDecimal preAmount;
|
||||||
|
|
||||||
|
@Schema(description = "设计费")
|
||||||
|
@ExcelProperty("设计费")
|
||||||
|
private BigDecimal designFee;
|
||||||
|
|
||||||
|
@Schema(description = "勘测费")
|
||||||
|
@ExcelProperty("勘测费")
|
||||||
|
private BigDecimal surveyFees;
|
||||||
|
|
||||||
|
@Schema(description = "检测费")
|
||||||
|
@ExcelProperty("检测费")
|
||||||
|
private BigDecimal testingFee;
|
||||||
|
|
||||||
|
@Schema(description = "其他费")
|
||||||
|
@ExcelProperty("其他费")
|
||||||
|
private String otherFee;
|
||||||
|
|
||||||
|
@Schema(description = "计费方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
@ExcelProperty("计费方式")
|
||||||
|
private String countType;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你猜")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "合同附件url", example = "https://www.iocoder.cn")
|
||||||
|
@ExcelProperty("合同附件url")
|
||||||
|
private String contractFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "建安费")
|
||||||
|
@ExcelProperty("建安费")
|
||||||
|
private BigDecimal constructionCost;
|
||||||
|
|
||||||
|
@Schema(description = "资金来源")
|
||||||
|
@ExcelProperty("资金来源")
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
@Schema(description = "分包合同提示时间")
|
||||||
|
@ExcelProperty("分包合同提示时间")
|
||||||
|
private LocalDateTime subReminderTime;
|
||||||
|
|
||||||
|
@Schema(description = "收费标准", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("收费标准")
|
||||||
|
private String chargingStandard;
|
||||||
|
|
||||||
|
@Schema(description = "优惠", example = "15529")
|
||||||
|
@ExcelProperty("优惠")
|
||||||
|
private String discount;
|
||||||
|
|
||||||
|
@Schema(description = "是否联合体", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("是否联合体")
|
||||||
|
private Boolean consortium;
|
||||||
|
|
||||||
|
@Schema(description = "联合体单位")
|
||||||
|
@ExcelProperty("联合体单位")
|
||||||
|
private String consortiumCompany;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "审定金额")
|
||||||
|
@ExcelProperty("审定金额")
|
||||||
|
private BigDecimal approvedAmount;
|
||||||
|
|
||||||
|
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||||
|
@ExcelProperty("审核文件url")
|
||||||
|
private String reviewFileUrl;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "合同id", example = "27460")
|
||||||
|
@ExcelProperty("合同id")
|
||||||
|
private Long contractId;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "创建者")
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "创建时间不能为空")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新者")
|
||||||
|
private String updater;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "更新时间不能为空")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,129 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.extcontract.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 外部合同新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ExtContractSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "外部合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "30598")
|
||||||
|
@NotNull(message = "项目id不能为空")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", example = "芋艿")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "合同类型", example = "1")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "客户公司id", example = "25191")
|
||||||
|
private Long customerCompanyId;
|
||||||
|
|
||||||
|
@Schema(description = "合同进展")
|
||||||
|
private String progress;
|
||||||
|
|
||||||
|
@Schema(description = "预计签订时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "预计签订时间不能为空")
|
||||||
|
private LocalDateTime expectedTime;
|
||||||
|
|
||||||
|
@Schema(description = "签订时间")
|
||||||
|
private LocalDateTime signingTime;
|
||||||
|
|
||||||
|
@Schema(description = "归档时间")
|
||||||
|
private LocalDateTime archiveTime;
|
||||||
|
|
||||||
|
@Schema(description = "状态", example = "2")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "合同金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "合同金额不能为空")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(description = "前期费用")
|
||||||
|
private BigDecimal preAmount;
|
||||||
|
|
||||||
|
@Schema(description = "设计费")
|
||||||
|
private BigDecimal designFee;
|
||||||
|
|
||||||
|
@Schema(description = "勘测费")
|
||||||
|
private BigDecimal surveyFees;
|
||||||
|
|
||||||
|
@Schema(description = "检测费")
|
||||||
|
private BigDecimal testingFee;
|
||||||
|
|
||||||
|
@Schema(description = "其他费")
|
||||||
|
private String otherFee;
|
||||||
|
|
||||||
|
@Schema(description = "计费方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
@NotEmpty(message = "计费方式不能为空")
|
||||||
|
private String countType;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你猜")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "合同附件url", example = "https://www.iocoder.cn")
|
||||||
|
private String contractFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "建安费")
|
||||||
|
private BigDecimal constructionCost;
|
||||||
|
|
||||||
|
@Schema(description = "资金来源")
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
@Schema(description = "收费标准", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "收费标准不能为空")
|
||||||
|
private String chargingStandard;
|
||||||
|
|
||||||
|
@Schema(description = "优惠", example = "15529")
|
||||||
|
private String discount;
|
||||||
|
|
||||||
|
@Schema(description = "是否联合体", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "是否联合体不能为空")
|
||||||
|
private Boolean consortium;
|
||||||
|
|
||||||
|
@Schema(description = "联合体单位")
|
||||||
|
private String consortiumCompany;
|
||||||
|
|
||||||
|
@Schema(description = "合同提示时间")
|
||||||
|
private LocalDateTime reminderTime;
|
||||||
|
|
||||||
|
@Schema(description = "审定金额")
|
||||||
|
private BigDecimal approvedAmount;
|
||||||
|
|
||||||
|
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||||
|
private String reviewFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "合同id", example = "27460")
|
||||||
|
private Long contractId;
|
||||||
|
|
||||||
|
@Schema(description = "创建者")
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "创建时间不能为空")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新者")
|
||||||
|
private String updater;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "更新时间不能为空")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "是否删除不能为空")
|
||||||
|
private Boolean deleted;
|
||||||
|
|
||||||
|
@Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12587")
|
||||||
|
@NotNull(message = "租户编号不能为空")
|
||||||
|
private Long tenantId;
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,136 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.dal.dataobject.contract;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同 DO
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@TableName("cms_contract")
|
||||||
|
@KeySequence("cms_contract_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ContractDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
/**
|
||||||
|
* 合同名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 合同类型
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
/**
|
||||||
|
* 合同进展
|
||||||
|
*/
|
||||||
|
private String progress;
|
||||||
|
/**
|
||||||
|
* 合同拟定时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime expectedTime;
|
||||||
|
/**
|
||||||
|
* 合同用印时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime printingTime;
|
||||||
|
/**
|
||||||
|
* 签订时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime signingTime;
|
||||||
|
/**
|
||||||
|
* 归档时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime archiveTime;
|
||||||
|
/**
|
||||||
|
* 合同状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 计费方式
|
||||||
|
*/
|
||||||
|
private String countType;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 合同url
|
||||||
|
*/
|
||||||
|
private String contractFileUrl;
|
||||||
|
/**
|
||||||
|
* 建安费
|
||||||
|
*/
|
||||||
|
private BigDecimal constructionCost;
|
||||||
|
/**
|
||||||
|
* 资金来源
|
||||||
|
*/
|
||||||
|
private String source;
|
||||||
|
/**
|
||||||
|
* 优惠
|
||||||
|
*/
|
||||||
|
private String discount;
|
||||||
|
/**
|
||||||
|
* 是否联合体
|
||||||
|
*/
|
||||||
|
private Boolean consortium;
|
||||||
|
/**
|
||||||
|
* 联合体单位
|
||||||
|
*/
|
||||||
|
private String consortiumCompany;
|
||||||
|
/**
|
||||||
|
* 占主合同比例
|
||||||
|
*/
|
||||||
|
private String extProportion;
|
||||||
|
/**
|
||||||
|
* 审定金额
|
||||||
|
*/
|
||||||
|
private BigDecimal approvedAmount;
|
||||||
|
/**
|
||||||
|
* 审核文件url
|
||||||
|
*/
|
||||||
|
private String reviewFileUrl;
|
||||||
|
/**
|
||||||
|
* 签订合同总额
|
||||||
|
*/
|
||||||
|
private BigDecimal amount;
|
||||||
|
/**
|
||||||
|
* 前期费
|
||||||
|
*/
|
||||||
|
private BigDecimal preAmount;
|
||||||
|
/**
|
||||||
|
* 设计费
|
||||||
|
*/
|
||||||
|
private BigDecimal designAmount;
|
||||||
|
/**
|
||||||
|
* 勘测费
|
||||||
|
*/
|
||||||
|
private BigDecimal surveyFees;
|
||||||
|
/**
|
||||||
|
* 测量费
|
||||||
|
*/
|
||||||
|
private BigDecimal measurementFee;
|
||||||
|
/**
|
||||||
|
* 其他费
|
||||||
|
*/
|
||||||
|
private BigDecimal otherFee;
|
||||||
|
|
||||||
|
}
|
@@ -1,47 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany;
|
|
||||||
|
|
||||||
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 hhyykk
|
|
||||||
*/
|
|
||||||
@TableName("cms_customer_company")
|
|
||||||
@KeySequence("cms_customer_company_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@ToString(callSuper = true)
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class CustomerCompanyDO extends BaseDO {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 主键
|
|
||||||
*/
|
|
||||||
@TableId
|
|
||||||
private Long id;
|
|
||||||
/**
|
|
||||||
* 联系人
|
|
||||||
*/
|
|
||||||
private String contacts;
|
|
||||||
/**
|
|
||||||
* 公司名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
/**
|
|
||||||
* 地址
|
|
||||||
*/
|
|
||||||
private String address;
|
|
||||||
/**
|
|
||||||
* 电话
|
|
||||||
*/
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
}
|
|
@@ -0,0 +1,152 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.dal.dataobject.extcontract;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部合同 DO
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@TableName("cms_ext_contract")
|
||||||
|
@KeySequence("cms_ext_contract_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ExtContractDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
/**
|
||||||
|
* 合同名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 合同类型
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
/**
|
||||||
|
* 客户公司id
|
||||||
|
*/
|
||||||
|
private Long customerCompanyId;
|
||||||
|
/**
|
||||||
|
* 合同进展
|
||||||
|
*/
|
||||||
|
private String progress;
|
||||||
|
/**
|
||||||
|
* 预计签订时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime expectedTime;
|
||||||
|
/**
|
||||||
|
* 签订时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime signingTime;
|
||||||
|
/**
|
||||||
|
* 归档时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime archiveTime;
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 合同金额
|
||||||
|
*/
|
||||||
|
private BigDecimal amount;
|
||||||
|
/**
|
||||||
|
* 前期费用
|
||||||
|
*/
|
||||||
|
private BigDecimal preAmount;
|
||||||
|
/**
|
||||||
|
* 设计费
|
||||||
|
*/
|
||||||
|
private BigDecimal designFee;
|
||||||
|
/**
|
||||||
|
* 勘测费
|
||||||
|
*/
|
||||||
|
private BigDecimal surveyFees;
|
||||||
|
/**
|
||||||
|
* 检测费
|
||||||
|
*/
|
||||||
|
private BigDecimal testingFee;
|
||||||
|
/**
|
||||||
|
* 其他费
|
||||||
|
*/
|
||||||
|
private String otherFee;
|
||||||
|
/**
|
||||||
|
* 计费方式
|
||||||
|
*/
|
||||||
|
private String countType;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 合同附件url
|
||||||
|
*/
|
||||||
|
private String contractFileUrl;
|
||||||
|
/**
|
||||||
|
* 建安费
|
||||||
|
*/
|
||||||
|
private BigDecimal constructionCost;
|
||||||
|
/**
|
||||||
|
* 资金来源
|
||||||
|
*/
|
||||||
|
private String source;
|
||||||
|
/**
|
||||||
|
* 收费标准
|
||||||
|
*/
|
||||||
|
private String chargingStandard;
|
||||||
|
/**
|
||||||
|
* 优惠
|
||||||
|
*/
|
||||||
|
private String discount;
|
||||||
|
/**
|
||||||
|
* 是否联合体
|
||||||
|
*/
|
||||||
|
private Boolean consortium;
|
||||||
|
/**
|
||||||
|
* 联合体单位
|
||||||
|
*/
|
||||||
|
private String consortiumCompany;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分包合同提示时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime subReminderTime;
|
||||||
|
/**
|
||||||
|
* 审定金额
|
||||||
|
*/
|
||||||
|
private BigDecimal approvedAmount;
|
||||||
|
/**
|
||||||
|
* 审核文件url
|
||||||
|
*/
|
||||||
|
private String reviewFileUrl;
|
||||||
|
/**
|
||||||
|
* 合同id
|
||||||
|
*/
|
||||||
|
private Long contractId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同提示时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime reminderTime;
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,51 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.dal.mysql.contract;
|
||||||
|
|
||||||
|
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.contract.ContractDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同 Mapper
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ContractMapper extends BaseMapperX<ContractDO> {
|
||||||
|
|
||||||
|
default PageResult<ContractDO> selectPage(ContractPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<ContractDO>()
|
||||||
|
.likeIfPresent(ContractDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(ContractDO::getType, reqVO.getType())
|
||||||
|
.eqIfPresent(ContractDO::getProgress, reqVO.getProgress())
|
||||||
|
.betweenIfPresent(ContractDO::getExpectedTime, reqVO.getExpectedTime())
|
||||||
|
.betweenIfPresent(ContractDO::getPrintingTime, reqVO.getPrintingTime())
|
||||||
|
.betweenIfPresent(ContractDO::getSigningTime, reqVO.getSigningTime())
|
||||||
|
.betweenIfPresent(ContractDO::getArchiveTime, reqVO.getArchiveTime())
|
||||||
|
.eqIfPresent(ContractDO::getStatus, reqVO.getStatus())
|
||||||
|
.eqIfPresent(ContractDO::getCountType, reqVO.getCountType())
|
||||||
|
.eqIfPresent(ContractDO::getRemark, reqVO.getRemark())
|
||||||
|
.eqIfPresent(ContractDO::getContractFileUrl, reqVO.getContractFileUrl())
|
||||||
|
.eqIfPresent(ContractDO::getConstructionCost, reqVO.getConstructionCost())
|
||||||
|
.eqIfPresent(ContractDO::getSource, reqVO.getSource())
|
||||||
|
.eqIfPresent(ContractDO::getDiscount, reqVO.getDiscount())
|
||||||
|
.eqIfPresent(ContractDO::getConsortium, reqVO.getConsortium())
|
||||||
|
.eqIfPresent(ContractDO::getConsortiumCompany, reqVO.getConsortiumCompany())
|
||||||
|
.eqIfPresent(ContractDO::getExtProportion, reqVO.getExtProportion())
|
||||||
|
.eqIfPresent(ContractDO::getApprovedAmount, reqVO.getApprovedAmount())
|
||||||
|
.eqIfPresent(ContractDO::getReviewFileUrl, reqVO.getReviewFileUrl())
|
||||||
|
.betweenIfPresent(ContractDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.eqIfPresent(ContractDO::getAmount, reqVO.getAmount())
|
||||||
|
.eqIfPresent(ContractDO::getPreAmount, reqVO.getPreAmount())
|
||||||
|
.eqIfPresent(ContractDO::getDesignAmount, reqVO.getDesignAmount())
|
||||||
|
.eqIfPresent(ContractDO::getSurveyFees, reqVO.getSurveyFees())
|
||||||
|
.eqIfPresent(ContractDO::getMeasurementFee, reqVO.getMeasurementFee())
|
||||||
|
.eqIfPresent(ContractDO::getOtherFee, reqVO.getOtherFee())
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@@ -1,34 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.cms.dal.mysql.customerCompany;
|
|
||||||
|
|
||||||
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.customerCompany.CustomerCompanyDO;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 客户公司 Mapper
|
|
||||||
*
|
|
||||||
* @author hhyykk
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface CustomerCompanyMapper extends BaseMapperX<CustomerCompanyDO> {
|
|
||||||
|
|
||||||
default PageResult<CustomerCompanyDO> selectPage(CustomerCompanyPageReqVO reqVO) {
|
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<CustomerCompanyDO>()
|
|
||||||
.likeIfPresent(CustomerCompanyDO::getContacts, reqVO.getContacts())
|
|
||||||
.eqIfPresent(CustomerCompanyDO::getCreateTime, reqVO.getCreateTime())
|
|
||||||
.likeIfPresent(CustomerCompanyDO::getName, reqVO.getName())
|
|
||||||
.eqIfPresent(CustomerCompanyDO::getAddress, reqVO.getAddress())
|
|
||||||
.eqIfPresent(CustomerCompanyDO::getPhone, reqVO.getPhone())
|
|
||||||
.orderByDesc(CustomerCompanyDO::getId));
|
|
||||||
}
|
|
||||||
|
|
||||||
default List<CustomerCompanyDO> selectList(CustomerCompanyPageReqVO reqVO) {
|
|
||||||
return selectList(new LambdaQueryWrapperX<CustomerCompanyDO>());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -0,0 +1,50 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.dal.mysql.extcontract;
|
||||||
|
|
||||||
|
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.controller.admin.extcontract.vo.ExtContractPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部合同 Mapper
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ExtContractMapper extends BaseMapperX<ExtContractDO> {
|
||||||
|
|
||||||
|
default PageResult<ExtContractDO> selectPage(ExtContractPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<ExtContractDO>()
|
||||||
|
.likeIfPresent(ExtContractDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(ExtContractDO::getType, reqVO.getType())
|
||||||
|
.eqIfPresent(ExtContractDO::getCustomerCompanyId, reqVO.getCustomerCompanyId())
|
||||||
|
.eqIfPresent(ExtContractDO::getProgress, reqVO.getProgress())
|
||||||
|
.betweenIfPresent(ExtContractDO::getExpectedTime, reqVO.getExpectedTime())
|
||||||
|
.betweenIfPresent(ExtContractDO::getSigningTime, reqVO.getSigningTime())
|
||||||
|
.betweenIfPresent(ExtContractDO::getArchiveTime, reqVO.getArchiveTime())
|
||||||
|
.eqIfPresent(ExtContractDO::getStatus, reqVO.getStatus())
|
||||||
|
.eqIfPresent(ExtContractDO::getAmount, reqVO.getAmount())
|
||||||
|
.eqIfPresent(ExtContractDO::getPreAmount, reqVO.getPreAmount())
|
||||||
|
.eqIfPresent(ExtContractDO::getDesignFee, reqVO.getDesignFee())
|
||||||
|
.eqIfPresent(ExtContractDO::getSurveyFees, reqVO.getSurveyFees())
|
||||||
|
.eqIfPresent(ExtContractDO::getTestingFee, reqVO.getTestingFee())
|
||||||
|
.eqIfPresent(ExtContractDO::getOtherFee, reqVO.getOtherFee())
|
||||||
|
.eqIfPresent(ExtContractDO::getCountType, reqVO.getCountType())
|
||||||
|
.eqIfPresent(ExtContractDO::getRemark, reqVO.getRemark())
|
||||||
|
.eqIfPresent(ExtContractDO::getContractFileUrl, reqVO.getContractFileUrl())
|
||||||
|
.eqIfPresent(ExtContractDO::getConstructionCost, reqVO.getConstructionCost())
|
||||||
|
.eqIfPresent(ExtContractDO::getSource, reqVO.getSource())
|
||||||
|
.eqIfPresent(ExtContractDO::getChargingStandard, reqVO.getChargingStandard())
|
||||||
|
.eqIfPresent(ExtContractDO::getDiscount, reqVO.getDiscount())
|
||||||
|
.eqIfPresent(ExtContractDO::getConsortium, reqVO.getConsortium())
|
||||||
|
.eqIfPresent(ExtContractDO::getConsortiumCompany, reqVO.getConsortiumCompany())
|
||||||
|
.eqIfPresent(ExtContractDO::getApprovedAmount, reqVO.getApprovedAmount())
|
||||||
|
.eqIfPresent(ExtContractDO::getReviewFileUrl, reqVO.getReviewFileUrl())
|
||||||
|
.betweenIfPresent(ExtContractDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.eqIfPresent(ExtContractDO::getContractId, reqVO.getContractId())
|
||||||
|
.orderByDesc(ExtContractDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,61 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.service.contract;
|
||||||
|
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同 Service 接口
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
public interface ContractService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建合同
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createContract(@Valid ContractSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新合同
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateContract(@Valid ContractSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除合同
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteContract(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得合同
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 合同
|
||||||
|
*/
|
||||||
|
ContractRespVO getContract(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得合同分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 合同分页
|
||||||
|
*/
|
||||||
|
PageResult<ContractRespVO> getContractPage(ContractPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得暂定结算金额
|
||||||
|
* @param id 合同编号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
BigDecimal getProvisionalSettlement(Long id);
|
||||||
|
}
|
@@ -0,0 +1,149 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.service.contract;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.mysql.extcontract.ExtContractMapper;
|
||||||
|
import cn.iocoder.yudao.module.pms.api.ProjectApi;
|
||||||
|
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectDetailRespDTO;
|
||||||
|
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class ContractServiceImpl implements ContractService {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(ContractServiceImpl.class);
|
||||||
|
@Resource
|
||||||
|
private ContractMapper contractMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProjectApi projectApi;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ExtContractMapper extContractMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createContract(ContractSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
ContractDO contract = BeanUtils.toBean(createReqVO, ContractDO.class);
|
||||||
|
contractMapper.insert(contract);
|
||||||
|
// 返回
|
||||||
|
return contract.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateContract(ContractSaveReqVO updateReqVO) {
|
||||||
|
// 更新
|
||||||
|
ContractDO updateObj = BeanUtils.toBean(updateReqVO, ContractDO.class);
|
||||||
|
contractMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteContract(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateContractExists(id);
|
||||||
|
// 删除
|
||||||
|
contractMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateContractExists(Long projectId) {
|
||||||
|
if (contractMapper.selectById(projectId) == null) {
|
||||||
|
throw exception(CONTRACT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ContractRespVO getContract(Long id) {
|
||||||
|
|
||||||
|
ContractDO contractDO = contractMapper.selectById(id);
|
||||||
|
Long projectId = contractDO.getProjectId();
|
||||||
|
ContractRespVO contractRespVO = BeanUtils.toBean(contractDO, ContractRespVO.class);
|
||||||
|
|
||||||
|
// 需要联表查询
|
||||||
|
// 1.项目编号 pms_project 直接 √
|
||||||
|
// 2.主控部门(跟踪部门) pms_project找到的是id 需要联表 √
|
||||||
|
// 3.项目经理 pms_project找到的是id 需要联表 √
|
||||||
|
// 4.出图公司 pms_project 直接 √
|
||||||
|
// 5.预计合同金额 pms_project 直接 √
|
||||||
|
// 6.分包合同商议提示 √
|
||||||
|
// 7.暂定结算数 √
|
||||||
|
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||||
|
contractRespVO.setCode(project.getCode());
|
||||||
|
contractRespVO.setDrawingCompany(project.getDrawingCompany());
|
||||||
|
contractRespVO.setExpectedContractAmount(project.getContractAmount());
|
||||||
|
|
||||||
|
ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
|
||||||
|
contractRespVO.setTrackingDep(projectDetail.getTrackingDepName());
|
||||||
|
contractRespVO.setProjectManager(projectDetail.getProjectManagerName());
|
||||||
|
|
||||||
|
//分包合同商议提示
|
||||||
|
ExtContractDO extContractDO = extContractMapper.selectOne("project_id",projectId);
|
||||||
|
LocalDateTime reminderTime = extContractDO.getSubReminderTime();
|
||||||
|
contractRespVO.setSubReminderTime(reminderTime);
|
||||||
|
|
||||||
|
//暂定结算数
|
||||||
|
BigDecimal provisionalSettlement = getProvisionalSettlement(id);
|
||||||
|
contractRespVO.setProvisionalSettlement(provisionalSettlement);
|
||||||
|
|
||||||
|
|
||||||
|
return contractRespVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ContractRespVO> getContractPage(ContractPageReqVO pageReqVO) {
|
||||||
|
PageResult<ContractDO> contractDOPageResult = contractMapper.selectPage(pageReqVO);
|
||||||
|
List<ContractDO> contractDOList = contractDOPageResult.getList();
|
||||||
|
List<ContractRespVO> contractRespVOList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
for (ContractDO contractDO : contractDOList) {
|
||||||
|
Long id = contractDO.getId();
|
||||||
|
ContractRespVO contract = getContract(id);
|
||||||
|
contractRespVOList.add(contract);
|
||||||
|
}
|
||||||
|
PageResult<ContractRespVO> pageResult = new PageResult<>();
|
||||||
|
pageResult.setList(contractRespVOList);
|
||||||
|
return pageResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BigDecimal getProvisionalSettlement(Long id) {
|
||||||
|
ContractDO contractDO = contractMapper.selectById(id);
|
||||||
|
String type = contractDO.getType();
|
||||||
|
BigDecimal amount = contractDO.getAmount();
|
||||||
|
BigDecimal bigDecimal = new BigDecimal(String.valueOf(amount));
|
||||||
|
BigDecimal mul = new BigDecimal("0.85");
|
||||||
|
BigDecimal res = null;
|
||||||
|
if ("费率合同".equals(type)) {
|
||||||
|
res = bigDecimal.multiply(mul);
|
||||||
|
} else if ("总价合同".equals(type)) {
|
||||||
|
res = amount;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@@ -1,61 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.cms.service.customerCompany;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import jakarta.validation.*;
|
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo.*;
|
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 客户公司 Service 接口
|
|
||||||
*
|
|
||||||
* @author hhyykk
|
|
||||||
*/
|
|
||||||
public interface CustomerCompanyService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建客户公司
|
|
||||||
*
|
|
||||||
* @param createReqVO 创建信息
|
|
||||||
* @return 编号
|
|
||||||
*/
|
|
||||||
Long createCustomerCompany(@Valid CustomerCompanySaveReqVO createReqVO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新客户公司
|
|
||||||
*
|
|
||||||
* @param updateReqVO 更新信息
|
|
||||||
*/
|
|
||||||
void updateCustomerCompany(@Valid CustomerCompanySaveReqVO updateReqVO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除客户公司
|
|
||||||
*
|
|
||||||
* @param id 编号
|
|
||||||
*/
|
|
||||||
void deleteCustomerCompany(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获得客户公司
|
|
||||||
*
|
|
||||||
* @param id 编号
|
|
||||||
* @return 客户公司
|
|
||||||
*/
|
|
||||||
CustomerCompanyDO getCustomerCompany(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获得客户公司分页
|
|
||||||
*
|
|
||||||
* @param pageReqVO 分页查询
|
|
||||||
* @return 客户公司分页
|
|
||||||
*/
|
|
||||||
PageResult<CustomerCompanyDO> getCustomerCompanyPage(CustomerCompanyPageReqVO pageReqVO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获得客户公司列表
|
|
||||||
* @param reqVO 查询参数
|
|
||||||
* @return 列表信息
|
|
||||||
*/
|
|
||||||
List<CustomerCompanyDO> getCustomerCompanyList(CustomerCompanyPageReqVO reqVO);
|
|
||||||
}
|
|
@@ -1,79 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.cms.service.customerCompany;
|
|
||||||
|
|
||||||
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.customerCompany.vo.*;
|
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO;
|
|
||||||
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.customerCompany.CustomerCompanyMapper;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
||||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 客户公司 Service 实现类
|
|
||||||
*
|
|
||||||
* @author hhyykk
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@Validated
|
|
||||||
public class CustomerCompanyServiceImpl implements CustomerCompanyService {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CustomerCompanyMapper customerCompanyMapper;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Long createCustomerCompany(CustomerCompanySaveReqVO createReqVO) {
|
|
||||||
// 插入
|
|
||||||
CustomerCompanyDO customerCompany = BeanUtils.toBean(createReqVO, CustomerCompanyDO.class);
|
|
||||||
customerCompanyMapper.insert(customerCompany);
|
|
||||||
// 返回
|
|
||||||
return customerCompany.getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateCustomerCompany(CustomerCompanySaveReqVO updateReqVO) {
|
|
||||||
// 校验存在
|
|
||||||
validateCustomerCompanyExists(updateReqVO.getId());
|
|
||||||
// 更新
|
|
||||||
CustomerCompanyDO updateObj = BeanUtils.toBean(updateReqVO, CustomerCompanyDO.class);
|
|
||||||
customerCompanyMapper.updateById(updateObj);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void deleteCustomerCompany(Long id) {
|
|
||||||
// 校验存在
|
|
||||||
validateCustomerCompanyExists(id);
|
|
||||||
// 删除
|
|
||||||
customerCompanyMapper.deleteById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void validateCustomerCompanyExists(Long id) {
|
|
||||||
if (customerCompanyMapper.selectById(id) == null) {
|
|
||||||
throw exception(CUSTOMER_COMPANY_NOT_EXISTS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CustomerCompanyDO getCustomerCompany(Long id) {
|
|
||||||
return customerCompanyMapper.selectById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CustomerCompanyDO> getCustomerCompanyPage(CustomerCompanyPageReqVO pageReqVO) {
|
|
||||||
return customerCompanyMapper.selectPage(pageReqVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CustomerCompanyDO> getCustomerCompanyList(CustomerCompanyPageReqVO reqVO) {
|
|
||||||
return customerCompanyMapper.selectList(reqVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -0,0 +1,56 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.service.extcontract;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.extcontract.vo.ExtContractPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.extcontract.vo.ExtContractRespVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.extcontract.vo.ExtContractSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDO;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部合同 Service 接口
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
public interface ExtContractService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建外部合同
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createExtContract(@Valid ExtContractSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新外部合同
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateExtContract(@Valid ExtContractSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除外部合同
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteExtContract(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得外部合同
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 外部合同
|
||||||
|
*/
|
||||||
|
ExtContractRespVO getExtContract(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得外部合同分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 外部合同分页
|
||||||
|
*/
|
||||||
|
PageResult<ExtContractDO> getExtContractPage(ExtContractPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,83 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.service.extcontract;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.extcontract.vo.ExtContractPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.extcontract.vo.ExtContractRespVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.extcontract.vo.ExtContractSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.mysql.extcontract.ExtContractMapper;
|
||||||
|
import cn.iocoder.yudao.module.pms.api.ProjectApi;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.EXT_CONTRACT_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部合同 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class ExtContractServiceImpl implements ExtContractService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ExtContractMapper extContractMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProjectApi projectApi;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createExtContract(ExtContractSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
ExtContractDO extContract = BeanUtils.toBean(createReqVO, ExtContractDO.class);
|
||||||
|
extContractMapper.insert(extContract);
|
||||||
|
// 返回
|
||||||
|
return extContract.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateExtContract(ExtContractSaveReqVO updateReqVO) {
|
||||||
|
// 更新
|
||||||
|
ExtContractDO updateObj = BeanUtils.toBean(updateReqVO, ExtContractDO.class);
|
||||||
|
extContractMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteExtContract(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateExtContractExists(id);
|
||||||
|
// 删除
|
||||||
|
extContractMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateExtContractExists(Long id) {
|
||||||
|
if (extContractMapper.selectById(id) == null) {
|
||||||
|
throw exception(EXT_CONTRACT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 需要联表查询
|
||||||
|
// 1.项目编号 pms_project 直接
|
||||||
|
// 2.主控部门(跟踪部门) pms_project找到的是id 需要联表
|
||||||
|
// 3.项目经理 pms_project找到的是id 需要联表
|
||||||
|
// 4.客户名称 pms_project 联表
|
||||||
|
// 5.合同总金额
|
||||||
|
// 6.合同商议提示(和分包提示不一样)
|
||||||
|
@Override
|
||||||
|
public ExtContractRespVO getExtContract(Long id) {
|
||||||
|
ExtContractDO extContractDO = extContractMapper.selectById(id);
|
||||||
|
Long projectId = extContractDO.getProjectId();
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ExtContractDO> getExtContractPage(ExtContractPageReqVO pageReqVO) {
|
||||||
|
return extContractMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!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.customerCompany.CustomerCompanyMapper">
|
<mapper namespace="cn.iocoder.yudao.module.cms.dal.mysql.extcontract.ExtContractMapper">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
@@ -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.contract.ContractMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
@@ -0,0 +1,26 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.service.contact;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper;
|
||||||
|
import cn.iocoder.yudao.module.cms.service.contract.ContractService;
|
||||||
|
import cn.iocoder.yudao.module.cms.service.contract.ContractServiceImpl;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.context.annotation.Import;
|
||||||
|
|
||||||
|
@Import(ContractServiceImpl.class)
|
||||||
|
@SpringBootTest(classes = ContractServiceImpl.class)
|
||||||
|
|
||||||
|
public class ContactServiceTest extends BaseDbUnitTest {
|
||||||
|
@Resource
|
||||||
|
private ContractService contractService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ContractMapper contractMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void createContact() {
|
||||||
|
}
|
||||||
|
}
|
@@ -1,146 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.cms.service.customerCompany;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Disabled;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
|
||||||
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo.*;
|
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO;
|
|
||||||
import cn.iocoder.yudao.module.cms.dal.mysql.customerCompany.CustomerCompanyMapper;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import org.springframework.context.annotation.Import;
|
|
||||||
import java.util.*;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
import static cn.hutool.core.util.RandomUtil.*;
|
|
||||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
|
||||||
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*;
|
|
||||||
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*;
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.*;
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*;
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*;
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
import static org.mockito.Mockito.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@link CustomerCompanyServiceImpl} 的单元测试类
|
|
||||||
*
|
|
||||||
* @author hhyykk
|
|
||||||
*/
|
|
||||||
@Import(CustomerCompanyServiceImpl.class)
|
|
||||||
public class CustomerCompanyServiceImplTest extends BaseDbUnitTest {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CustomerCompanyServiceImpl customerCompanyService;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CustomerCompanyMapper customerCompanyMapper;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testCreateCustomerCompany_success() {
|
|
||||||
// 准备参数
|
|
||||||
CustomerCompanySaveReqVO createReqVO = randomPojo(CustomerCompanySaveReqVO.class).setId(null);
|
|
||||||
|
|
||||||
// 调用
|
|
||||||
Long customerCompanyId = customerCompanyService.createCustomerCompany(createReqVO);
|
|
||||||
// 断言
|
|
||||||
assertNotNull(customerCompanyId);
|
|
||||||
// 校验记录的属性是否正确
|
|
||||||
CustomerCompanyDO customerCompany = customerCompanyMapper.selectById(customerCompanyId);
|
|
||||||
assertPojoEquals(createReqVO, customerCompany, "id");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testUpdateCustomerCompany_success() {
|
|
||||||
// mock 数据
|
|
||||||
CustomerCompanyDO dbCustomerCompany = randomPojo(CustomerCompanyDO.class);
|
|
||||||
customerCompanyMapper.insert(dbCustomerCompany);// @Sql: 先插入出一条存在的数据
|
|
||||||
// 准备参数
|
|
||||||
CustomerCompanySaveReqVO updateReqVO = randomPojo(CustomerCompanySaveReqVO.class, o -> {
|
|
||||||
o.setId(dbCustomerCompany.getId()); // 设置更新的 ID
|
|
||||||
});
|
|
||||||
|
|
||||||
// 调用
|
|
||||||
customerCompanyService.updateCustomerCompany(updateReqVO);
|
|
||||||
// 校验是否更新正确
|
|
||||||
CustomerCompanyDO customerCompany = customerCompanyMapper.selectById(updateReqVO.getId()); // 获取最新的
|
|
||||||
assertPojoEquals(updateReqVO, customerCompany);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testUpdateCustomerCompany_notExists() {
|
|
||||||
// 准备参数
|
|
||||||
CustomerCompanySaveReqVO updateReqVO = randomPojo(CustomerCompanySaveReqVO.class);
|
|
||||||
|
|
||||||
// 调用, 并断言异常
|
|
||||||
assertServiceException(() -> customerCompanyService.updateCustomerCompany(updateReqVO), CUSTOMER_COMPANY_NOT_EXISTS);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testDeleteCustomerCompany_success() {
|
|
||||||
// mock 数据
|
|
||||||
CustomerCompanyDO dbCustomerCompany = randomPojo(CustomerCompanyDO.class);
|
|
||||||
customerCompanyMapper.insert(dbCustomerCompany);// @Sql: 先插入出一条存在的数据
|
|
||||||
// 准备参数
|
|
||||||
Long id = dbCustomerCompany.getId();
|
|
||||||
|
|
||||||
// 调用
|
|
||||||
customerCompanyService.deleteCustomerCompany(id);
|
|
||||||
// 校验数据不存在了
|
|
||||||
assertNull(customerCompanyMapper.selectById(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testDeleteCustomerCompany_notExists() {
|
|
||||||
// 准备参数
|
|
||||||
Long id = randomLongId();
|
|
||||||
|
|
||||||
// 调用, 并断言异常
|
|
||||||
assertServiceException(() -> customerCompanyService.deleteCustomerCompany(id), CUSTOMER_COMPANY_NOT_EXISTS);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
|
|
||||||
public void testGetCustomerCompanyPage() {
|
|
||||||
// mock 数据
|
|
||||||
CustomerCompanyDO dbCustomerCompany = randomPojo(CustomerCompanyDO.class, o -> { // 等会查询到
|
|
||||||
o.setContacts(null);
|
|
||||||
o.setCreateTime(null);
|
|
||||||
o.setName(null);
|
|
||||||
o.setAddress(null);
|
|
||||||
o.setPhone(null);
|
|
||||||
});
|
|
||||||
customerCompanyMapper.insert(dbCustomerCompany);
|
|
||||||
// 测试 contacts 不匹配
|
|
||||||
customerCompanyMapper.insert(cloneIgnoreId(dbCustomerCompany, o -> o.setContacts(null)));
|
|
||||||
// 测试 createTime 不匹配
|
|
||||||
customerCompanyMapper.insert(cloneIgnoreId(dbCustomerCompany, o -> o.setCreateTime(null)));
|
|
||||||
// 测试 name 不匹配
|
|
||||||
customerCompanyMapper.insert(cloneIgnoreId(dbCustomerCompany, o -> o.setName(null)));
|
|
||||||
// 测试 address 不匹配
|
|
||||||
customerCompanyMapper.insert(cloneIgnoreId(dbCustomerCompany, o -> o.setAddress(null)));
|
|
||||||
// 测试 phone 不匹配
|
|
||||||
customerCompanyMapper.insert(cloneIgnoreId(dbCustomerCompany, o -> o.setPhone(null)));
|
|
||||||
// 准备参数
|
|
||||||
CustomerCompanyPageReqVO reqVO = new CustomerCompanyPageReqVO();
|
|
||||||
reqVO.setContacts(null);
|
|
||||||
reqVO.setCreateTime(null);
|
|
||||||
reqVO.setName(null);
|
|
||||||
reqVO.setAddress(null);
|
|
||||||
reqVO.setPhone(null);
|
|
||||||
|
|
||||||
// 调用
|
|
||||||
PageResult<CustomerCompanyDO> pageResult = customerCompanyService.getCustomerCompanyPage(reqVO);
|
|
||||||
// 断言
|
|
||||||
assertEquals(1, pageResult.getTotal());
|
|
||||||
assertEquals(1, pageResult.getList().size());
|
|
||||||
assertPojoEquals(dbCustomerCompany, pageResult.getList().get(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -0,0 +1,4 @@
|
|||||||
|
<configuration>
|
||||||
|
<!-- 引用 Spring Boot 的 logback 基础配置 -->
|
||||||
|
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
|
||||||
|
</configuration>
|
@@ -0,0 +1,3 @@
|
|||||||
|
-- 将该删表 SQL 语句,添加到 yudao-module-cms-biz 模块的 test/resources/sql/clean.sql 文件里
|
||||||
|
DELETE
|
||||||
|
FROM "cms_contract";
|
@@ -0,0 +1,39 @@
|
|||||||
|
-- 将该建表 SQL 语句,添加到 yudao-module-cms-biz 模块的 test/resources/sql/create_tables.sql 文件里
|
||||||
|
CREATE TABLE IF NOT EXISTS "cms_contract"
|
||||||
|
(
|
||||||
|
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
|
||||||
|
"project_id" bigint NOT NULL,
|
||||||
|
"name" varchar NOT NULL,
|
||||||
|
"type" varchar NOT NULL,
|
||||||
|
"progress" varchar NOT NULL,
|
||||||
|
"expected_time" varchar NOT NULL,
|
||||||
|
"printing_time" varchar NOT NULL,
|
||||||
|
"signing_time" varchar,
|
||||||
|
"archive_time" varchar,
|
||||||
|
"status" varchar NOT NULL,
|
||||||
|
"count_type" varchar,
|
||||||
|
"remark" varchar,
|
||||||
|
"contract_file_url" varchar,
|
||||||
|
"construction_cost" varchar,
|
||||||
|
"source" varchar,
|
||||||
|
"discount" varchar,
|
||||||
|
"consortium" bit,
|
||||||
|
"consortium_company" varchar,
|
||||||
|
"ext_proportion" varchar,
|
||||||
|
"approved_amount" varchar NOT NULL,
|
||||||
|
"review_file_url" varchar,
|
||||||
|
"creator" varchar DEFAULT '',
|
||||||
|
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updater" varchar DEFAULT '',
|
||||||
|
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
|
"deleted" bit NOT NULL DEFAULT FALSE,
|
||||||
|
"tenant_id" bigint NOT NULL,
|
||||||
|
"amount" varchar,
|
||||||
|
"pre_amount" varchar,
|
||||||
|
"design_amount" varchar,
|
||||||
|
"survey_fees" varchar,
|
||||||
|
"measurement_fee" varchar,
|
||||||
|
"other_fee" varchar,
|
||||||
|
PRIMARY KEY ("id")
|
||||||
|
) COMMENT '合同';
|
||||||
|
|
@@ -0,0 +1,17 @@
|
|||||||
|
package cn.iocoder.yudao.module.pms.api;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectDetailRespDTO;
|
||||||
|
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
||||||
|
|
||||||
|
public interface ProjectApi {
|
||||||
|
/**
|
||||||
|
* 获得项目部分信息
|
||||||
|
*/
|
||||||
|
ProjectRespDTO getProject(Long projectId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得项目detail信息
|
||||||
|
*/
|
||||||
|
ProjectDetailRespDTO getProjectDetailById(Long projectId);
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.yudao.module.pms.api.project.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ProjectDetailRespDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跟踪部门
|
||||||
|
*/
|
||||||
|
private String trackingDepName;
|
||||||
|
/**
|
||||||
|
* 项目经理
|
||||||
|
*/
|
||||||
|
private String projectManagerName;
|
||||||
|
/**
|
||||||
|
* 客户公司
|
||||||
|
*/
|
||||||
|
private String customerCompanyName;
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,46 @@
|
|||||||
|
package cn.iocoder.yudao.module.pms.api.project.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目基本信息 dto
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ProjectRespDTO {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目编号
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出图公司
|
||||||
|
*/
|
||||||
|
private String drawingCompany;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跟踪部门id
|
||||||
|
*/
|
||||||
|
private Long trackingDepId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户公司id
|
||||||
|
*/
|
||||||
|
private Long customerCompanyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目经理id
|
||||||
|
*/
|
||||||
|
private Long projectManagerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预计合同金额
|
||||||
|
*/
|
||||||
|
private BigDecimal contractAmount;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,35 @@
|
|||||||
|
package cn.iocoder.yudao.module.pms.api.project;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.pms.api.ProjectApi;
|
||||||
|
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectDetailRespDTO;
|
||||||
|
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
||||||
|
import cn.iocoder.yudao.module.pms.dal.dataobject.project.ProjectDO;
|
||||||
|
import cn.iocoder.yudao.module.pms.dal.dataobject.project.ProjectDetailDO;
|
||||||
|
import cn.iocoder.yudao.module.pms.dal.mysql.project.ProjectMapper;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class ProjectImpl implements ProjectApi {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProjectMapper projectMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProjectRespDTO getProject(Long projectId) {
|
||||||
|
ProjectDO projectDO = projectMapper.selectById(projectId);
|
||||||
|
ProjectRespDTO projectRespDTO = BeanUtils.toBean(projectDO, ProjectRespDTO.class);
|
||||||
|
return projectRespDTO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProjectDetailRespDTO getProjectDetailById(Long projectId) {
|
||||||
|
ProjectDetailDO projectMapperDetail = projectMapper.getDetailById(projectId);
|
||||||
|
ProjectDetailRespDTO detailRespDTO = BeanUtils.toBean(projectMapperDetail, ProjectDetailRespDTO.class);
|
||||||
|
return detailRespDTO;
|
||||||
|
}
|
||||||
|
}
|
@@ -4,11 +4,8 @@ import cn.iocoder.yudao.module.pms.enums.DictTypeConstants;
|
|||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
@@ -1,10 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.pms.dal.dataobject.project;
|
package cn.iocoder.yudao.module.pms.dal.dataobject.project;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.FileDTO;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hhyykk
|
* @author hhyykk
|
||||||
* @description
|
* @description
|
||||||
|
@@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.pms.dal.mysql.project;
|
|||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO;
|
|
||||||
import cn.iocoder.yudao.module.pms.controller.admin.project.vo.ProjectPageReqVO;
|
import cn.iocoder.yudao.module.pms.controller.admin.project.vo.ProjectPageReqVO;
|
||||||
import cn.iocoder.yudao.module.pms.dal.dataobject.project.ProjectDO;
|
import cn.iocoder.yudao.module.pms.dal.dataobject.project.ProjectDO;
|
||||||
import cn.iocoder.yudao.module.pms.dal.dataobject.project.ProjectDetailDO;
|
import cn.iocoder.yudao.module.pms.dal.dataobject.project.ProjectDetailDO;
|
||||||
@@ -33,7 +32,6 @@ public interface ProjectMapper extends BaseMapperX<ProjectDO> {
|
|||||||
.selectAll(ProjectDO.class)
|
.selectAll(ProjectDO.class)
|
||||||
.selectAs(DeptDO::getName, ProjectDetailDO::getTrackingDepName) // 映射到ProjectDetailDO的trackingDeptName
|
.selectAs(DeptDO::getName, ProjectDetailDO::getTrackingDepName) // 映射到ProjectDetailDO的trackingDeptName
|
||||||
.selectAs(AdminUserDO::getNickname, ProjectDetailDO::getProjectManagerName) // 映射到ProjectDetailDO的projectManagerName
|
.selectAs(AdminUserDO::getNickname, ProjectDetailDO::getProjectManagerName) // 映射到ProjectDetailDO的projectManagerName
|
||||||
.selectAs(CustomerCompanyDO::getName, ProjectDetailDO::getCustomerCompanyName)
|
|
||||||
.likeIfExists(ProjectDO::getName, reqVO.getName())
|
.likeIfExists(ProjectDO::getName, reqVO.getName())
|
||||||
.eqIfExists(ProjectDO::getTrackingCode, reqVO.getTrackingCode())
|
.eqIfExists(ProjectDO::getTrackingCode, reqVO.getTrackingCode())
|
||||||
.eqIfExists(ProjectDO::getType, reqVO.getType())
|
.eqIfExists(ProjectDO::getType, reqVO.getType())
|
||||||
@@ -41,8 +39,7 @@ public interface ProjectMapper extends BaseMapperX<ProjectDO> {
|
|||||||
.orderByDesc(ProjectDO::getId)
|
.orderByDesc(ProjectDO::getId)
|
||||||
.leftJoin(DeptDO.class, DeptDO::getId, ProjectDO::getTrackingDepId)
|
.leftJoin(DeptDO.class, DeptDO::getId, ProjectDO::getTrackingDepId)
|
||||||
.leftJoin(AdminUserDO.class, AdminUserDO::getId, ProjectDO::getProjectManagerId)
|
.leftJoin(AdminUserDO.class, AdminUserDO::getId, ProjectDO::getProjectManagerId)
|
||||||
.leftJoin(CustomerCompanyDO.class, CustomerCompanyDO::getId, ProjectDO::getCustomerCompanyId)
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
default ProjectDetailDO getDetailById(Long id) {
|
default ProjectDetailDO getDetailById(Long id) {
|
||||||
@@ -50,11 +47,9 @@ public interface ProjectMapper extends BaseMapperX<ProjectDO> {
|
|||||||
.selectAll(ProjectDO.class)
|
.selectAll(ProjectDO.class)
|
||||||
.selectAs(DeptDO::getName, ProjectDetailDO::getTrackingDepName) // 映射到ProjectDetailDO的trackingDeptName
|
.selectAs(DeptDO::getName, ProjectDetailDO::getTrackingDepName) // 映射到ProjectDetailDO的trackingDeptName
|
||||||
.selectAs(AdminUserDO::getNickname, ProjectDetailDO::getProjectManagerName) // 映射到ProjectDetailDO的projectManagerName
|
.selectAs(AdminUserDO::getNickname, ProjectDetailDO::getProjectManagerName) // 映射到ProjectDetailDO的projectManagerName
|
||||||
.selectAs(CustomerCompanyDO::getName, ProjectDetailDO::getCustomerCompanyName)
|
|
||||||
.eqIfExists(ProjectDO::getId, id)
|
.eqIfExists(ProjectDO::getId, id)
|
||||||
.leftJoin(DeptDO.class, DeptDO::getId, ProjectDO::getTrackingDepId)
|
.leftJoin(DeptDO.class, DeptDO::getId, ProjectDO::getTrackingDepId)
|
||||||
.leftJoin(AdminUserDO.class, AdminUserDO::getId, ProjectDO::getProjectManagerId)
|
.leftJoin(AdminUserDO.class, AdminUserDO::getId, ProjectDO::getProjectManagerId)
|
||||||
.leftJoin(CustomerCompanyDO.class, CustomerCompanyDO::getId, ProjectDO::getCustomerCompanyId)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -4,7 +4,6 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|||||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
||||||
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
@@ -133,6 +133,7 @@
|
|||||||
<artifactId>yudao-spring-boot-starter-protection</artifactId>
|
<artifactId>yudao-spring-boot-starter-protection</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.server;
|
package cn.iocoder.yudao.server;
|
||||||
|
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
@@ -12,6 +13,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||||||
*
|
*
|
||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package}
|
@SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package}
|
||||||
@SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}.server", "${yudao.info.base-package}.module"})
|
@SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}.server", "${yudao.info.base-package}.module"})
|
||||||
public class YudaoServerApplication {
|
public class YudaoServerApplication {
|
||||||
|
@@ -45,7 +45,7 @@ spring:
|
|||||||
primary: master
|
primary: master
|
||||||
datasource:
|
datasource:
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://127.0.0.1:3306/hhyykk?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
url: jdbc:mysql://127.0.0.1:3307/hhyykk?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
|
||||||
# url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # MySQL Connector/J 5.X 连接的示例
|
# url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # MySQL Connector/J 5.X 连接的示例
|
||||||
# url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例
|
# url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例
|
||||||
# url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
|
# url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
|
||||||
@@ -54,7 +54,7 @@ spring:
|
|||||||
# url: jdbc:kingbase8://127.0.0.1:54321/test # 人大金仓 KingbaseES 连接的示例
|
# url: jdbc:kingbase8://127.0.0.1:54321/test # 人大金仓 KingbaseES 连接的示例
|
||||||
# url: jdbc:postgresql://127.0.0.1:5432/postgres # OpenGauss 连接的示例
|
# url: jdbc:postgresql://127.0.0.1:5432/postgres # OpenGauss 连接的示例
|
||||||
username: root
|
username: root
|
||||||
password: we9085@z
|
password: root
|
||||||
# username: sa # SQL Server 连接的示例
|
# username: sa # SQL Server 连接的示例
|
||||||
# password: Yudao@2024 # SQL Server 连接的示例
|
# password: Yudao@2024 # SQL Server 连接的示例
|
||||||
# username: SYSDBA # DM 连接的示例
|
# username: SYSDBA # DM 连接的示例
|
||||||
@@ -63,9 +63,9 @@ spring:
|
|||||||
# password: Yudao@2024 # OpenGauss 连接的示例
|
# password: Yudao@2024 # OpenGauss 连接的示例
|
||||||
slave: # 模拟从库,可根据自己需要修改
|
slave: # 模拟从库,可根据自己需要修改
|
||||||
lazy: true # 开启懒加载,保证启动速度
|
lazy: true # 开启懒加载,保证启动速度
|
||||||
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://127.0.0.1:3307/db1?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||||
username: root
|
username: root
|
||||||
password: we9085@z
|
password: root
|
||||||
|
|
||||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||||
data:
|
data:
|
||||||
|
@@ -0,0 +1,67 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 外部合同 VO
|
||||||
|
export interface ExtContractVO {
|
||||||
|
id: number // 主键
|
||||||
|
projectId: number // 项目id
|
||||||
|
name: string // 合同名称
|
||||||
|
type: string // 合同类型
|
||||||
|
customerCompanyId: number // 客户公司id
|
||||||
|
progress: string // 合同进展
|
||||||
|
expectedTime: Date // 预计签订时间
|
||||||
|
signingTime: Date // 签订时间
|
||||||
|
archiveTime: Date // 归档时间
|
||||||
|
status: string // 状态
|
||||||
|
amount: number // 合同金额
|
||||||
|
preAmount: number // 前期费用
|
||||||
|
designFee: number // 设计费
|
||||||
|
surveyFees: number // 勘测费
|
||||||
|
testingFee: number // 检测费
|
||||||
|
otherFee: string // 其他费
|
||||||
|
countType: string // 计费方式
|
||||||
|
remark: string // 备注
|
||||||
|
contractFileUrl: string // 合同附件url
|
||||||
|
constructionCost: number // 建安费
|
||||||
|
source: string // 资金来源
|
||||||
|
chargingStandard: string // 收费标准
|
||||||
|
discount: string // 优惠
|
||||||
|
consortium: boolean // 是否联合体
|
||||||
|
consortiumCompany: string // 联合体单位
|
||||||
|
reminderTime: Date // 合同提示时间
|
||||||
|
approvedAmount: number // 审定金额
|
||||||
|
reviewFileUrl: string // 审核文件url
|
||||||
|
contractId: number // 合同id
|
||||||
|
}
|
||||||
|
|
||||||
|
// 外部合同 API
|
||||||
|
export const ExtContractApi = {
|
||||||
|
// 查询外部合同分页
|
||||||
|
getExtContractPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/cms-ext/ext-contract/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询外部合同详情
|
||||||
|
getExtContract: async (id: number) => {
|
||||||
|
return await request.get({ url: `/cms-ext/ext-contract/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增外部合同
|
||||||
|
createExtContract: async (data: ExtContractVO) => {
|
||||||
|
return await request.post({ url: `/cms-ext/ext-contract/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改外部合同
|
||||||
|
updateExtContract: async (data: ExtContractVO) => {
|
||||||
|
return await request.put({ url: `/cms-ext/ext-contract/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除外部合同
|
||||||
|
deleteExtContract: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/cms-ext/ext-contract/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出外部合同 Excel
|
||||||
|
exportExtContract: async (params) => {
|
||||||
|
return await request.download({ url: `/cms-ext/ext-contract/export-excel`, params })
|
||||||
|
},
|
||||||
|
}
|
@@ -0,0 +1,260 @@
|
|||||||
|
<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="合同类型" prop="type">
|
||||||
|
<el-select v-model="formData.type" placeholder="请选择合同类型">
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="客户公司id" prop="customerCompanyId">
|
||||||
|
<el-input v-model="formData.customerCompanyId" placeholder="请输入客户公司id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同进展" prop="progress">
|
||||||
|
<el-input v-model="formData.progress" placeholder="请输入合同进展" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预计签订时间" prop="expectedTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.expectedTime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择预计签订时间"
|
||||||
|
/>
|
||||||
|
</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="archiveTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.archiveTime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择归档时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-radio-group v-model="formData.status">
|
||||||
|
<el-radio label="1">请选择字典生成</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同金额" prop="amount">
|
||||||
|
<el-input v-model="formData.amount" placeholder="请输入合同金额" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="前期费用" prop="preAmount">
|
||||||
|
<el-input v-model="formData.preAmount" placeholder="请输入前期费用" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设计费" prop="designFee">
|
||||||
|
<el-input v-model="formData.designFee" placeholder="请输入设计费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="勘测费" prop="surveyFees">
|
||||||
|
<el-input v-model="formData.surveyFees" placeholder="请输入勘测费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="检测费" prop="testingFee">
|
||||||
|
<el-input v-model="formData.testingFee" placeholder="请输入检测费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="其他费" prop="otherFee">
|
||||||
|
<el-input v-model="formData.otherFee" placeholder="请输入其他费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="计费方式" prop="countType">
|
||||||
|
<el-select v-model="formData.countType" placeholder="请选择计费方式">
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="formData.remark" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同附件url" prop="contractFileUrl">
|
||||||
|
<el-input v-model="formData.contractFileUrl" placeholder="请输入合同附件url" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="建安费" prop="constructionCost">
|
||||||
|
<el-input v-model="formData.constructionCost" placeholder="请输入建安费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="资金来源" prop="source">
|
||||||
|
<el-input v-model="formData.source" placeholder="请输入资金来源" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="收费标准" prop="chargingStandard">
|
||||||
|
<el-input v-model="formData.chargingStandard" placeholder="请输入收费标准" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="优惠" prop="discount">
|
||||||
|
<el-input v-model="formData.discount" placeholder="请输入优惠" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否联合体" prop="consortium">
|
||||||
|
<el-radio-group v-model="formData.consortium">
|
||||||
|
<el-radio label="1">请选择字典生成</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联合体单位" prop="consortiumCompany">
|
||||||
|
<el-input v-model="formData.consortiumCompany" placeholder="请输入联合体单位" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同提示时间" prop="reminderTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.reminderTime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择合同提示时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审定金额" prop="approvedAmount">
|
||||||
|
<el-input v-model="formData.approvedAmount" placeholder="请输入审定金额" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审核文件url" prop="reviewFileUrl">
|
||||||
|
<el-input v-model="formData.reviewFileUrl" placeholder="请输入审核文件url" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同id" prop="contractId">
|
||||||
|
<el-input v-model="formData.contractId" 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 { ExtContractApi, ExtContractVO } from '@/api/cms-ext/extcontract'
|
||||||
|
|
||||||
|
/** 外部合同 表单 */
|
||||||
|
defineOptions({ name: 'ExtContractForm' })
|
||||||
|
|
||||||
|
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,
|
||||||
|
type: undefined,
|
||||||
|
customerCompanyId: undefined,
|
||||||
|
progress: undefined,
|
||||||
|
expectedTime: undefined,
|
||||||
|
signingTime: undefined,
|
||||||
|
archiveTime: undefined,
|
||||||
|
status: undefined,
|
||||||
|
amount: undefined,
|
||||||
|
preAmount: undefined,
|
||||||
|
designFee: undefined,
|
||||||
|
surveyFees: undefined,
|
||||||
|
testingFee: undefined,
|
||||||
|
otherFee: undefined,
|
||||||
|
countType: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
contractFileUrl: undefined,
|
||||||
|
constructionCost: undefined,
|
||||||
|
source: undefined,
|
||||||
|
chargingStandard: undefined,
|
||||||
|
discount: undefined,
|
||||||
|
consortium: undefined,
|
||||||
|
consortiumCompany: undefined,
|
||||||
|
reminderTime: undefined,
|
||||||
|
approvedAmount: undefined,
|
||||||
|
reviewFileUrl: undefined,
|
||||||
|
contractId: undefined,
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }],
|
||||||
|
expectedTime: [{ required: true, message: '预计签订时间不能为空', trigger: 'blur' }],
|
||||||
|
amount: [{ required: true, message: '合同金额不能为空', trigger: 'blur' }],
|
||||||
|
countType: [{ required: true, message: '计费方式不能为空', trigger: 'change' }],
|
||||||
|
chargingStandard: [{ required: true, message: '收费标准不能为空', trigger: 'blur' }],
|
||||||
|
consortium: [{ 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 ExtContractApi.getExtContract(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 ExtContractVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await ExtContractApi.createExtContract(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await ExtContractApi.updateExtContract(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,
|
||||||
|
type: undefined,
|
||||||
|
customerCompanyId: undefined,
|
||||||
|
progress: undefined,
|
||||||
|
expectedTime: undefined,
|
||||||
|
signingTime: undefined,
|
||||||
|
archiveTime: undefined,
|
||||||
|
status: undefined,
|
||||||
|
amount: undefined,
|
||||||
|
preAmount: undefined,
|
||||||
|
designFee: undefined,
|
||||||
|
surveyFees: undefined,
|
||||||
|
testingFee: undefined,
|
||||||
|
otherFee: undefined,
|
||||||
|
countType: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
contractFileUrl: undefined,
|
||||||
|
constructionCost: undefined,
|
||||||
|
source: undefined,
|
||||||
|
chargingStandard: undefined,
|
||||||
|
discount: undefined,
|
||||||
|
consortium: undefined,
|
||||||
|
consortiumCompany: undefined,
|
||||||
|
reminderTime: undefined,
|
||||||
|
approvedAmount: undefined,
|
||||||
|
reviewFileUrl: undefined,
|
||||||
|
contractId: undefined,
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
@@ -0,0 +1,520 @@
|
|||||||
|
<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="合同类型" prop="type">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.type"
|
||||||
|
placeholder="请选择合同类型"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="客户公司id" prop="customerCompanyId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.customerCompanyId"
|
||||||
|
placeholder="请输入客户公司id"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同进展" prop="progress">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.progress"
|
||||||
|
placeholder="请输入合同进展"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预计签订时间" prop="expectedTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.expectedTime"
|
||||||
|
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="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="archiveTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.archiveTime"
|
||||||
|
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="status">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.status"
|
||||||
|
placeholder="请选择状态"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" 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="preAmount">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.preAmount"
|
||||||
|
placeholder="请输入前期费用"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设计费" prop="designFee">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.designFee"
|
||||||
|
placeholder="请输入设计费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="勘测费" prop="surveyFees">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.surveyFees"
|
||||||
|
placeholder="请输入勘测费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="检测费" prop="testingFee">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.testingFee"
|
||||||
|
placeholder="请输入检测费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="其他费" prop="otherFee">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.otherFee"
|
||||||
|
placeholder="请输入其他费"
|
||||||
|
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 label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.remark"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同附件url" prop="contractFileUrl">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.contractFileUrl"
|
||||||
|
placeholder="请输入合同附件url"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="建安费" prop="constructionCost">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.constructionCost"
|
||||||
|
placeholder="请输入建安费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="资金来源" prop="source">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.source"
|
||||||
|
placeholder="请输入资金来源"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="收费标准" prop="chargingStandard">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.chargingStandard"
|
||||||
|
placeholder="请输入收费标准"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="优惠" prop="discount">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.discount"
|
||||||
|
placeholder="请输入优惠"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否联合体" prop="consortium">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.consortium"
|
||||||
|
placeholder="请选择是否联合体"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联合体单位" prop="consortiumCompany">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.consortiumCompany"
|
||||||
|
placeholder="请输入联合体单位"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同提示时间" prop="reminderTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.reminderTime"
|
||||||
|
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="approvedAmount">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.approvedAmount"
|
||||||
|
placeholder="请输入审定金额"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审核文件url" prop="reviewFileUrl">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.reviewFileUrl"
|
||||||
|
placeholder="请输入审核文件url"
|
||||||
|
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="contractId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.contractId"
|
||||||
|
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-ext:ext-contract:create']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['cms-ext:ext-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="合同类型" align="center" prop="type" />
|
||||||
|
<el-table-column label="客户公司id" align="center" prop="customerCompanyId" />
|
||||||
|
<el-table-column label="合同进展" align="center" prop="progress" />
|
||||||
|
<el-table-column
|
||||||
|
label="预计签订时间"
|
||||||
|
align="center"
|
||||||
|
prop="expectedTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="签订时间"
|
||||||
|
align="center"
|
||||||
|
prop="signingTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="归档时间"
|
||||||
|
align="center"
|
||||||
|
prop="archiveTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="状态" align="center" prop="status" />
|
||||||
|
<el-table-column label="合同金额" align="center" prop="amount" />
|
||||||
|
<el-table-column label="前期费用" align="center" prop="preAmount" />
|
||||||
|
<el-table-column label="设计费" align="center" prop="designFee" />
|
||||||
|
<el-table-column label="勘测费" align="center" prop="surveyFees" />
|
||||||
|
<el-table-column label="检测费" align="center" prop="testingFee" />
|
||||||
|
<el-table-column label="其他费" align="center" prop="otherFee" />
|
||||||
|
<el-table-column label="计费方式" align="center" prop="countType" />
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
|
<el-table-column label="合同附件url" align="center" prop="contractFileUrl" />
|
||||||
|
<el-table-column label="建安费" align="center" prop="constructionCost" />
|
||||||
|
<el-table-column label="资金来源" align="center" prop="source" />
|
||||||
|
<el-table-column label="收费标准" align="center" prop="chargingStandard" />
|
||||||
|
<el-table-column label="优惠" align="center" prop="discount" />
|
||||||
|
<el-table-column label="是否联合体" align="center" prop="consortium" />
|
||||||
|
<el-table-column label="联合体单位" align="center" prop="consortiumCompany" />
|
||||||
|
<el-table-column
|
||||||
|
label="合同提示时间"
|
||||||
|
align="center"
|
||||||
|
prop="reminderTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="审定金额" align="center" prop="approvedAmount" />
|
||||||
|
<el-table-column label="审核文件url" align="center" prop="reviewFileUrl" />
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="合同id" align="center" prop="contractId" />
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['cms-ext:ext-contract:update']"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['cms-ext:ext-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>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<ExtContractForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import { ExtContractApi, ExtContractVO } from '@/api/cms-ext/extcontract'
|
||||||
|
import ExtContractForm from './ExtContractForm.vue'
|
||||||
|
|
||||||
|
/** 外部合同 列表 */
|
||||||
|
defineOptions({ name: 'ExtContract' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref<ExtContractVO[]>([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
projectId: undefined,
|
||||||
|
name: undefined,
|
||||||
|
type: undefined,
|
||||||
|
customerCompanyId: undefined,
|
||||||
|
progress: undefined,
|
||||||
|
expectedTime: [],
|
||||||
|
signingTime: [],
|
||||||
|
archiveTime: [],
|
||||||
|
status: undefined,
|
||||||
|
amount: undefined,
|
||||||
|
preAmount: undefined,
|
||||||
|
designFee: undefined,
|
||||||
|
surveyFees: undefined,
|
||||||
|
testingFee: undefined,
|
||||||
|
otherFee: undefined,
|
||||||
|
countType: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
contractFileUrl: undefined,
|
||||||
|
constructionCost: undefined,
|
||||||
|
source: undefined,
|
||||||
|
chargingStandard: undefined,
|
||||||
|
discount: undefined,
|
||||||
|
consortium: undefined,
|
||||||
|
consortiumCompany: undefined,
|
||||||
|
reminderTime: [],
|
||||||
|
approvedAmount: undefined,
|
||||||
|
reviewFileUrl: undefined,
|
||||||
|
createTime: [],
|
||||||
|
contractId: undefined,
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await ExtContractApi.getExtContractPage(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 ExtContractApi.deleteExtContract(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await ExtContractApi.exportExtContract(queryParams)
|
||||||
|
download.excel(data, '外部合同.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
@@ -0,0 +1,69 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 合同 VO
|
||||||
|
export interface ContractVO {
|
||||||
|
name: string // 合同名称
|
||||||
|
type: string // 合同类型
|
||||||
|
progress: string // 合同进展
|
||||||
|
expectedTime: Date // 合同拟定时间
|
||||||
|
printingTime: Date // 合同用印时间
|
||||||
|
signingTime: Date // 签订时间
|
||||||
|
archiveTime: Date // 归档时间
|
||||||
|
status: string // 合同状态
|
||||||
|
countType: string // 计费方式
|
||||||
|
remark: string // 备注
|
||||||
|
contractFileUrl: string // 合同url
|
||||||
|
constructionCost: number // 建安费
|
||||||
|
source: string // 资金来源
|
||||||
|
discount: string // 优惠
|
||||||
|
consortium: boolean // 是否联合体
|
||||||
|
consortiumCompany: string // 联合体单位
|
||||||
|
extProportion: string // 占主合同比例
|
||||||
|
approvedAmount: number // 审定金额
|
||||||
|
reviewFileUrl: string // 审核文件url
|
||||||
|
creator: string // 创建者
|
||||||
|
createTime: Date // 创建时间
|
||||||
|
updater: string // 更新者
|
||||||
|
updateTime: Date // 更新时间
|
||||||
|
deleted: boolean // 是否删除
|
||||||
|
tenantId: number // 租户编号
|
||||||
|
amount: number // 签订合同总额
|
||||||
|
preAmount: number // 前期费
|
||||||
|
designAmount: number // 设计费
|
||||||
|
surveyFees: number // 勘测费
|
||||||
|
measurementFee: number // 测量费
|
||||||
|
otherFee: number // 其他费
|
||||||
|
}
|
||||||
|
|
||||||
|
// 合同 API
|
||||||
|
export const ContractApi = {
|
||||||
|
// 查询合同分页
|
||||||
|
getContractPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/cms/contract/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询合同详情
|
||||||
|
getContract: async (id: number) => {
|
||||||
|
return await request.get({ url: `/cms/contract/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增合同
|
||||||
|
createContract: async (data: ContractVO) => {
|
||||||
|
return await request.post({ url: `/cms/contract/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改合同
|
||||||
|
updateContract: async (data: ContractVO) => {
|
||||||
|
return await request.put({ url: `/cms/contract/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除合同
|
||||||
|
deleteContract: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/cms/contract/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出合同 Excel
|
||||||
|
exportContract: async (params) => {
|
||||||
|
return await request.download({ url: `/cms/contract/export-excel`, params })
|
||||||
|
},
|
||||||
|
}
|
@@ -0,0 +1,290 @@
|
|||||||
|
<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="合同名称" prop="name">
|
||||||
|
<el-input v-model="formData.name" placeholder="请输入合同名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同类型" prop="type">
|
||||||
|
<el-select v-model="formData.type" placeholder="请选择合同类型">
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同进展" prop="progress">
|
||||||
|
<el-input v-model="formData.progress" placeholder="请输入合同进展" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同拟定时间" prop="expectedTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.expectedTime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择合同拟定时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同用印时间" prop="printingTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.printingTime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择合同用印时间"
|
||||||
|
/>
|
||||||
|
</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="archiveTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.archiveTime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择归档时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同状态" prop="status">
|
||||||
|
<el-radio-group v-model="formData.status">
|
||||||
|
<el-radio label="1">请选择字典生成</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="计费方式" prop="countType">
|
||||||
|
<el-select v-model="formData.countType" placeholder="请选择计费方式">
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="formData.remark" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同url" prop="contractFileUrl">
|
||||||
|
<el-input v-model="formData.contractFileUrl" placeholder="请输入合同url" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="建安费" prop="constructionCost">
|
||||||
|
<el-input v-model="formData.constructionCost" placeholder="请输入建安费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="资金来源" prop="source">
|
||||||
|
<el-input v-model="formData.source" placeholder="请输入资金来源" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="优惠" prop="discount">
|
||||||
|
<el-input v-model="formData.discount" placeholder="请输入优惠" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否联合体" prop="consortium">
|
||||||
|
<el-radio-group v-model="formData.consortium">
|
||||||
|
<el-radio label="1">请选择字典生成</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联合体单位" prop="consortiumCompany">
|
||||||
|
<el-input v-model="formData.consortiumCompany" placeholder="请输入联合体单位" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="占主合同比例" prop="extProportion">
|
||||||
|
<el-input v-model="formData.extProportion" placeholder="请输入占主合同比例" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审定金额" prop="approvedAmount">
|
||||||
|
<el-input v-model="formData.approvedAmount" placeholder="请输入审定金额" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审核文件url" prop="reviewFileUrl">
|
||||||
|
<UploadFile v-model="formData.reviewFileUrl" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建者" prop="creator">
|
||||||
|
<el-input v-model="formData.creator" placeholder="请输入创建者" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" prop="createTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.createTime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择创建时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="更新者" prop="updater">
|
||||||
|
<el-input v-model="formData.updater" 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="deleted">
|
||||||
|
<el-radio-group v-model="formData.deleted">
|
||||||
|
<el-radio label="1">请选择字典生成</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="租户编号" prop="tenantId">
|
||||||
|
<el-input v-model="formData.tenantId" placeholder="请输入租户编号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="签订合同总额" prop="amount">
|
||||||
|
<el-input v-model="formData.amount" placeholder="请输入签订合同总额" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="前期费" prop="preAmount">
|
||||||
|
<el-input v-model="formData.preAmount" placeholder="请输入前期费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设计费" prop="designAmount">
|
||||||
|
<el-input v-model="formData.designAmount" placeholder="请输入设计费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="勘测费" prop="surveyFees">
|
||||||
|
<el-input v-model="formData.surveyFees" placeholder="请输入勘测费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="测量费" prop="measurementFee">
|
||||||
|
<el-input v-model="formData.measurementFee" placeholder="请输入测量费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="其他费" prop="otherFee">
|
||||||
|
<el-input v-model="formData.otherFee" 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 { ContractApi, ContractVO } from '@/api/cms/contract'
|
||||||
|
|
||||||
|
/** 合同 表单 */
|
||||||
|
defineOptions({ name: 'ContractForm' })
|
||||||
|
|
||||||
|
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({
|
||||||
|
name: undefined,
|
||||||
|
type: undefined,
|
||||||
|
progress: undefined,
|
||||||
|
expectedTime: undefined,
|
||||||
|
printingTime: undefined,
|
||||||
|
signingTime: undefined,
|
||||||
|
archiveTime: undefined,
|
||||||
|
status: undefined,
|
||||||
|
countType: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
contractFileUrl: undefined,
|
||||||
|
constructionCost: undefined,
|
||||||
|
source: undefined,
|
||||||
|
discount: undefined,
|
||||||
|
consortium: undefined,
|
||||||
|
consortiumCompany: undefined,
|
||||||
|
extProportion: undefined,
|
||||||
|
approvedAmount: undefined,
|
||||||
|
reviewFileUrl: undefined,
|
||||||
|
creator: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updater: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
amount: undefined,
|
||||||
|
preAmount: undefined,
|
||||||
|
designAmount: undefined,
|
||||||
|
surveyFees: undefined,
|
||||||
|
measurementFee: undefined,
|
||||||
|
otherFee: undefined,
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
name: [{ required: true, message: '合同名称不能为空', trigger: 'blur' }],
|
||||||
|
type: [{ required: true, message: '合同类型不能为空', trigger: 'change' }],
|
||||||
|
progress: [{ required: true, message: '合同进展不能为空', trigger: 'blur' }],
|
||||||
|
expectedTime: [{ required: true, message: '合同拟定时间不能为空', trigger: 'blur' }],
|
||||||
|
printingTime: [{ required: true, message: '合同用印时间不能为空', trigger: 'blur' }],
|
||||||
|
status: [{ required: true, message: '合同状态不能为空', trigger: 'blur' }],
|
||||||
|
approvedAmount: [{ required: true, message: '审定金额不能为空', trigger: 'blur' }],
|
||||||
|
createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
|
||||||
|
updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
|
||||||
|
deleted: [{ required: true, message: '是否删除不能为空', trigger: 'blur' }],
|
||||||
|
tenantId: [{ 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 ContractApi.getContract(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 ContractVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await ContractApi.createContract(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await ContractApi.updateContract(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
name: undefined,
|
||||||
|
type: undefined,
|
||||||
|
progress: undefined,
|
||||||
|
expectedTime: undefined,
|
||||||
|
printingTime: undefined,
|
||||||
|
signingTime: undefined,
|
||||||
|
archiveTime: undefined,
|
||||||
|
status: undefined,
|
||||||
|
countType: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
contractFileUrl: undefined,
|
||||||
|
constructionCost: undefined,
|
||||||
|
source: undefined,
|
||||||
|
discount: undefined,
|
||||||
|
consortium: undefined,
|
||||||
|
consortiumCompany: undefined,
|
||||||
|
extProportion: undefined,
|
||||||
|
approvedAmount: undefined,
|
||||||
|
reviewFileUrl: undefined,
|
||||||
|
creator: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updater: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
amount: undefined,
|
||||||
|
preAmount: undefined,
|
||||||
|
designAmount: undefined,
|
||||||
|
surveyFees: undefined,
|
||||||
|
measurementFee: undefined,
|
||||||
|
otherFee: undefined,
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
@@ -0,0 +1,541 @@
|
|||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
|
<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="合同类型" prop="type">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.type"
|
||||||
|
placeholder="请选择合同类型"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同进展" prop="progress">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.progress"
|
||||||
|
placeholder="请输入合同进展"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同拟定时间" prop="expectedTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.expectedTime"
|
||||||
|
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="printingTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.printingTime"
|
||||||
|
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="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="archiveTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.archiveTime"
|
||||||
|
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="status">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.status"
|
||||||
|
placeholder="请选择合同状态"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="计费方式" prop="countType">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.countType"
|
||||||
|
placeholder="请选择计费方式"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.remark"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同url" prop="contractFileUrl">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.contractFileUrl"
|
||||||
|
placeholder="请输入合同url"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="建安费" prop="constructionCost">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.constructionCost"
|
||||||
|
placeholder="请输入建安费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="资金来源" prop="source">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.source"
|
||||||
|
placeholder="请输入资金来源"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="优惠" prop="discount">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.discount"
|
||||||
|
placeholder="请输入优惠"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否联合体" prop="consortium">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.consortium"
|
||||||
|
placeholder="请选择是否联合体"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联合体单位" prop="consortiumCompany">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.consortiumCompany"
|
||||||
|
placeholder="请输入联合体单位"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="占主合同比例" prop="extProportion">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.extProportion"
|
||||||
|
placeholder="请输入占主合同比例"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审定金额" prop="approvedAmount">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.approvedAmount"
|
||||||
|
placeholder="请输入审定金额"
|
||||||
|
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="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="updater">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.updater"
|
||||||
|
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="deleted">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.deleted"
|
||||||
|
placeholder="请选择是否删除"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="租户编号" prop="tenantId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.tenantId"
|
||||||
|
placeholder="请输入租户编号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</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="preAmount">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.preAmount"
|
||||||
|
placeholder="请输入前期费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设计费" prop="designAmount">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.designAmount"
|
||||||
|
placeholder="请输入设计费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="勘测费" prop="surveyFees">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.surveyFees"
|
||||||
|
placeholder="请输入勘测费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="测量费" prop="measurementFee">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.measurementFee"
|
||||||
|
placeholder="请输入测量费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="其他费" prop="otherFee">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.otherFee"
|
||||||
|
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:contract:create']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['cms: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="name" />
|
||||||
|
<el-table-column label="合同类型" align="center" prop="type" />
|
||||||
|
<el-table-column label="合同进展" align="center" prop="progress" />
|
||||||
|
<el-table-column
|
||||||
|
label="合同拟定时间"
|
||||||
|
align="center"
|
||||||
|
prop="expectedTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="合同用印时间"
|
||||||
|
align="center"
|
||||||
|
prop="printingTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="签订时间"
|
||||||
|
align="center"
|
||||||
|
prop="signingTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="归档时间"
|
||||||
|
align="center"
|
||||||
|
prop="archiveTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="合同状态" align="center" prop="status" />
|
||||||
|
<el-table-column label="计费方式" align="center" prop="countType" />
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
|
<el-table-column label="合同url" align="center" prop="contractFileUrl" />
|
||||||
|
<el-table-column label="建安费" align="center" prop="constructionCost" />
|
||||||
|
<el-table-column label="资金来源" align="center" prop="source" />
|
||||||
|
<el-table-column label="优惠" align="center" prop="discount" />
|
||||||
|
<el-table-column label="是否联合体" align="center" prop="consortium" />
|
||||||
|
<el-table-column label="联合体单位" align="center" prop="consortiumCompany" />
|
||||||
|
<el-table-column label="占主合同比例" align="center" prop="extProportion" />
|
||||||
|
<el-table-column label="审定金额" align="center" prop="approvedAmount" />
|
||||||
|
<el-table-column label="审核文件url" align="center" prop="reviewFileUrl" />
|
||||||
|
<el-table-column label="创建者" align="center" prop="creator" />
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="更新者" align="center" prop="updater" />
|
||||||
|
<el-table-column
|
||||||
|
label="更新时间"
|
||||||
|
align="center"
|
||||||
|
prop="updateTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="是否删除" align="center" prop="deleted" />
|
||||||
|
<el-table-column label="租户编号" align="center" prop="tenantId" />
|
||||||
|
<el-table-column label="签订合同总额" align="center" prop="amount" />
|
||||||
|
<el-table-column label="前期费" align="center" prop="preAmount" />
|
||||||
|
<el-table-column label="设计费" align="center" prop="designAmount" />
|
||||||
|
<el-table-column label="勘测费" align="center" prop="surveyFees" />
|
||||||
|
<el-table-column label="测量费" align="center" prop="measurementFee" />
|
||||||
|
<el-table-column label="其他费" align="center" prop="otherFee" />
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['cms:contract:update']"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['cms: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>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<ContractForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import { ContractApi, ContractVO } from '@/api/cms/contract'
|
||||||
|
import ContractForm from './ContractForm.vue'
|
||||||
|
|
||||||
|
/** 合同 列表 */
|
||||||
|
defineOptions({ name: 'Contract' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref<ContractVO[]>([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: undefined,
|
||||||
|
type: undefined,
|
||||||
|
progress: undefined,
|
||||||
|
expectedTime: [],
|
||||||
|
printingTime: [],
|
||||||
|
signingTime: [],
|
||||||
|
archiveTime: [],
|
||||||
|
status: undefined,
|
||||||
|
countType: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
contractFileUrl: undefined,
|
||||||
|
constructionCost: undefined,
|
||||||
|
source: undefined,
|
||||||
|
discount: undefined,
|
||||||
|
consortium: undefined,
|
||||||
|
consortiumCompany: undefined,
|
||||||
|
extProportion: undefined,
|
||||||
|
approvedAmount: undefined,
|
||||||
|
reviewFileUrl: undefined,
|
||||||
|
creator: undefined,
|
||||||
|
createTime: [],
|
||||||
|
updater: undefined,
|
||||||
|
updateTime: [],
|
||||||
|
deleted: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
amount: undefined,
|
||||||
|
preAmount: undefined,
|
||||||
|
designAmount: undefined,
|
||||||
|
surveyFees: undefined,
|
||||||
|
measurementFee: undefined,
|
||||||
|
otherFee: undefined,
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await ContractApi.getContractPage(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 ContractApi.deleteContract(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await ContractApi.exportContract(queryParams)
|
||||||
|
download.excel(data, '合同.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
69
yudao-ui/yudao-ui-admin-vue3/src/api/cms/contract/index.ts
Normal file
69
yudao-ui/yudao-ui-admin-vue3/src/api/cms/contract/index.ts
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 合同 VO
|
||||||
|
export interface ContractVO {
|
||||||
|
name: string // 合同名称
|
||||||
|
type: string // 合同类型
|
||||||
|
progress: string // 合同进展
|
||||||
|
expectedTime: Date // 合同拟定时间
|
||||||
|
printingTime: Date // 合同用印时间
|
||||||
|
signingTime: Date // 签订时间
|
||||||
|
archiveTime: Date // 归档时间
|
||||||
|
status: string // 合同状态
|
||||||
|
countType: string // 计费方式
|
||||||
|
remark: string // 备注
|
||||||
|
contractFileUrl: string // 合同url
|
||||||
|
constructionCost: number // 建安费
|
||||||
|
source: string // 资金来源
|
||||||
|
discount: string // 优惠
|
||||||
|
consortium: boolean // 是否联合体
|
||||||
|
consortiumCompany: string // 联合体单位
|
||||||
|
extProportion: string // 占主合同比例
|
||||||
|
approvedAmount: number // 审定金额
|
||||||
|
reviewFileUrl: string // 审核文件url
|
||||||
|
creator: string // 创建者
|
||||||
|
createTime: Date // 创建时间
|
||||||
|
updater: string // 更新者
|
||||||
|
updateTime: Date // 更新时间
|
||||||
|
deleted: boolean // 是否删除
|
||||||
|
tenantId: number // 租户编号
|
||||||
|
amount: number // 签订合同总额
|
||||||
|
preAmount: number // 前期费
|
||||||
|
designAmount: number // 设计费
|
||||||
|
surveyFees: number // 勘测费
|
||||||
|
measurementFee: number // 测量费
|
||||||
|
otherFee: number // 其他费
|
||||||
|
}
|
||||||
|
|
||||||
|
// 合同 API
|
||||||
|
export const ContractApi = {
|
||||||
|
// 查询合同分页
|
||||||
|
getContractPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/cms/contract/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询合同详情
|
||||||
|
getContract: async (id: number) => {
|
||||||
|
return await request.get({ url: `/cms/contract/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增合同
|
||||||
|
createContract: async (data: ContractVO) => {
|
||||||
|
return await request.post({ url: `/cms/contract/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改合同
|
||||||
|
updateContract: async (data: ContractVO) => {
|
||||||
|
return await request.put({ url: `/cms/contract/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除合同
|
||||||
|
deleteContract: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/cms/contract/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出合同 Excel
|
||||||
|
exportContract: async (params) => {
|
||||||
|
return await request.download({ url: `/cms/contract/export-excel`, params })
|
||||||
|
},
|
||||||
|
}
|
@@ -0,0 +1,290 @@
|
|||||||
|
<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="合同名称" prop="name">
|
||||||
|
<el-input v-model="formData.name" placeholder="请输入合同名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同类型" prop="type">
|
||||||
|
<el-select v-model="formData.type" placeholder="请选择合同类型">
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同进展" prop="progress">
|
||||||
|
<el-input v-model="formData.progress" placeholder="请输入合同进展" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同拟定时间" prop="expectedTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.expectedTime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择合同拟定时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同用印时间" prop="printingTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.printingTime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择合同用印时间"
|
||||||
|
/>
|
||||||
|
</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="archiveTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.archiveTime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择归档时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同状态" prop="status">
|
||||||
|
<el-radio-group v-model="formData.status">
|
||||||
|
<el-radio label="1">请选择字典生成</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="计费方式" prop="countType">
|
||||||
|
<el-select v-model="formData.countType" placeholder="请选择计费方式">
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="formData.remark" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同url" prop="contractFileUrl">
|
||||||
|
<el-input v-model="formData.contractFileUrl" placeholder="请输入合同url" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="建安费" prop="constructionCost">
|
||||||
|
<el-input v-model="formData.constructionCost" placeholder="请输入建安费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="资金来源" prop="source">
|
||||||
|
<el-input v-model="formData.source" placeholder="请输入资金来源" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="优惠" prop="discount">
|
||||||
|
<el-input v-model="formData.discount" placeholder="请输入优惠" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否联合体" prop="consortium">
|
||||||
|
<el-radio-group v-model="formData.consortium">
|
||||||
|
<el-radio label="1">请选择字典生成</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联合体单位" prop="consortiumCompany">
|
||||||
|
<el-input v-model="formData.consortiumCompany" placeholder="请输入联合体单位" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="占主合同比例" prop="extProportion">
|
||||||
|
<el-input v-model="formData.extProportion" placeholder="请输入占主合同比例" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审定金额" prop="approvedAmount">
|
||||||
|
<el-input v-model="formData.approvedAmount" placeholder="请输入审定金额" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审核文件url" prop="reviewFileUrl">
|
||||||
|
<UploadFile v-model="formData.reviewFileUrl" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建者" prop="creator">
|
||||||
|
<el-input v-model="formData.creator" placeholder="请输入创建者" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" prop="createTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.createTime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择创建时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="更新者" prop="updater">
|
||||||
|
<el-input v-model="formData.updater" 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="deleted">
|
||||||
|
<el-radio-group v-model="formData.deleted">
|
||||||
|
<el-radio label="1">请选择字典生成</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="租户编号" prop="tenantId">
|
||||||
|
<el-input v-model="formData.tenantId" placeholder="请输入租户编号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="签订合同总额" prop="amount">
|
||||||
|
<el-input v-model="formData.amount" placeholder="请输入签订合同总额" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="前期费" prop="preAmount">
|
||||||
|
<el-input v-model="formData.preAmount" placeholder="请输入前期费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设计费" prop="designAmount">
|
||||||
|
<el-input v-model="formData.designAmount" placeholder="请输入设计费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="勘测费" prop="surveyFees">
|
||||||
|
<el-input v-model="formData.surveyFees" placeholder="请输入勘测费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="测量费" prop="measurementFee">
|
||||||
|
<el-input v-model="formData.measurementFee" placeholder="请输入测量费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="其他费" prop="otherFee">
|
||||||
|
<el-input v-model="formData.otherFee" 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 { ContractApi, ContractVO } from '@/api/cms/contract'
|
||||||
|
|
||||||
|
/** 合同 表单 */
|
||||||
|
defineOptions({ name: 'ContractForm' })
|
||||||
|
|
||||||
|
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({
|
||||||
|
name: undefined,
|
||||||
|
type: undefined,
|
||||||
|
progress: undefined,
|
||||||
|
expectedTime: undefined,
|
||||||
|
printingTime: undefined,
|
||||||
|
signingTime: undefined,
|
||||||
|
archiveTime: undefined,
|
||||||
|
status: undefined,
|
||||||
|
countType: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
contractFileUrl: undefined,
|
||||||
|
constructionCost: undefined,
|
||||||
|
source: undefined,
|
||||||
|
discount: undefined,
|
||||||
|
consortium: undefined,
|
||||||
|
consortiumCompany: undefined,
|
||||||
|
extProportion: undefined,
|
||||||
|
approvedAmount: undefined,
|
||||||
|
reviewFileUrl: undefined,
|
||||||
|
creator: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updater: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
amount: undefined,
|
||||||
|
preAmount: undefined,
|
||||||
|
designAmount: undefined,
|
||||||
|
surveyFees: undefined,
|
||||||
|
measurementFee: undefined,
|
||||||
|
otherFee: undefined,
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
name: [{ required: true, message: '合同名称不能为空', trigger: 'blur' }],
|
||||||
|
type: [{ required: true, message: '合同类型不能为空', trigger: 'change' }],
|
||||||
|
progress: [{ required: true, message: '合同进展不能为空', trigger: 'blur' }],
|
||||||
|
expectedTime: [{ required: true, message: '合同拟定时间不能为空', trigger: 'blur' }],
|
||||||
|
printingTime: [{ required: true, message: '合同用印时间不能为空', trigger: 'blur' }],
|
||||||
|
status: [{ required: true, message: '合同状态不能为空', trigger: 'blur' }],
|
||||||
|
approvedAmount: [{ required: true, message: '审定金额不能为空', trigger: 'blur' }],
|
||||||
|
createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
|
||||||
|
updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
|
||||||
|
deleted: [{ required: true, message: '是否删除不能为空', trigger: 'blur' }],
|
||||||
|
tenantId: [{ 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 ContractApi.getContract(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 ContractVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await ContractApi.createContract(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await ContractApi.updateContract(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
name: undefined,
|
||||||
|
type: undefined,
|
||||||
|
progress: undefined,
|
||||||
|
expectedTime: undefined,
|
||||||
|
printingTime: undefined,
|
||||||
|
signingTime: undefined,
|
||||||
|
archiveTime: undefined,
|
||||||
|
status: undefined,
|
||||||
|
countType: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
contractFileUrl: undefined,
|
||||||
|
constructionCost: undefined,
|
||||||
|
source: undefined,
|
||||||
|
discount: undefined,
|
||||||
|
consortium: undefined,
|
||||||
|
consortiumCompany: undefined,
|
||||||
|
extProportion: undefined,
|
||||||
|
approvedAmount: undefined,
|
||||||
|
reviewFileUrl: undefined,
|
||||||
|
creator: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updater: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
amount: undefined,
|
||||||
|
preAmount: undefined,
|
||||||
|
designAmount: undefined,
|
||||||
|
surveyFees: undefined,
|
||||||
|
measurementFee: undefined,
|
||||||
|
otherFee: undefined,
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
541
yudao-ui/yudao-ui-admin-vue3/src/views/cms/contract/index.vue
Normal file
541
yudao-ui/yudao-ui-admin-vue3/src/views/cms/contract/index.vue
Normal file
@@ -0,0 +1,541 @@
|
|||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
|
<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="合同类型" prop="type">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.type"
|
||||||
|
placeholder="请选择合同类型"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同进展" prop="progress">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.progress"
|
||||||
|
placeholder="请输入合同进展"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同拟定时间" prop="expectedTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.expectedTime"
|
||||||
|
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="printingTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.printingTime"
|
||||||
|
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="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="archiveTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.archiveTime"
|
||||||
|
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="status">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.status"
|
||||||
|
placeholder="请选择合同状态"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="计费方式" prop="countType">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.countType"
|
||||||
|
placeholder="请选择计费方式"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.remark"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同url" prop="contractFileUrl">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.contractFileUrl"
|
||||||
|
placeholder="请输入合同url"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="建安费" prop="constructionCost">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.constructionCost"
|
||||||
|
placeholder="请输入建安费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="资金来源" prop="source">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.source"
|
||||||
|
placeholder="请输入资金来源"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="优惠" prop="discount">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.discount"
|
||||||
|
placeholder="请输入优惠"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否联合体" prop="consortium">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.consortium"
|
||||||
|
placeholder="请选择是否联合体"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联合体单位" prop="consortiumCompany">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.consortiumCompany"
|
||||||
|
placeholder="请输入联合体单位"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="占主合同比例" prop="extProportion">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.extProportion"
|
||||||
|
placeholder="请输入占主合同比例"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审定金额" prop="approvedAmount">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.approvedAmount"
|
||||||
|
placeholder="请输入审定金额"
|
||||||
|
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="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="updater">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.updater"
|
||||||
|
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="deleted">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.deleted"
|
||||||
|
placeholder="请选择是否删除"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="租户编号" prop="tenantId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.tenantId"
|
||||||
|
placeholder="请输入租户编号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</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="preAmount">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.preAmount"
|
||||||
|
placeholder="请输入前期费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设计费" prop="designAmount">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.designAmount"
|
||||||
|
placeholder="请输入设计费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="勘测费" prop="surveyFees">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.surveyFees"
|
||||||
|
placeholder="请输入勘测费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="测量费" prop="measurementFee">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.measurementFee"
|
||||||
|
placeholder="请输入测量费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="其他费" prop="otherFee">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.otherFee"
|
||||||
|
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:contract:create']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['cms: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="name" />
|
||||||
|
<el-table-column label="合同类型" align="center" prop="type" />
|
||||||
|
<el-table-column label="合同进展" align="center" prop="progress" />
|
||||||
|
<el-table-column
|
||||||
|
label="合同拟定时间"
|
||||||
|
align="center"
|
||||||
|
prop="expectedTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="合同用印时间"
|
||||||
|
align="center"
|
||||||
|
prop="printingTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="签订时间"
|
||||||
|
align="center"
|
||||||
|
prop="signingTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="归档时间"
|
||||||
|
align="center"
|
||||||
|
prop="archiveTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="合同状态" align="center" prop="status" />
|
||||||
|
<el-table-column label="计费方式" align="center" prop="countType" />
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
|
<el-table-column label="合同url" align="center" prop="contractFileUrl" />
|
||||||
|
<el-table-column label="建安费" align="center" prop="constructionCost" />
|
||||||
|
<el-table-column label="资金来源" align="center" prop="source" />
|
||||||
|
<el-table-column label="优惠" align="center" prop="discount" />
|
||||||
|
<el-table-column label="是否联合体" align="center" prop="consortium" />
|
||||||
|
<el-table-column label="联合体单位" align="center" prop="consortiumCompany" />
|
||||||
|
<el-table-column label="占主合同比例" align="center" prop="extProportion" />
|
||||||
|
<el-table-column label="审定金额" align="center" prop="approvedAmount" />
|
||||||
|
<el-table-column label="审核文件url" align="center" prop="reviewFileUrl" />
|
||||||
|
<el-table-column label="创建者" align="center" prop="creator" />
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="更新者" align="center" prop="updater" />
|
||||||
|
<el-table-column
|
||||||
|
label="更新时间"
|
||||||
|
align="center"
|
||||||
|
prop="updateTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="是否删除" align="center" prop="deleted" />
|
||||||
|
<el-table-column label="租户编号" align="center" prop="tenantId" />
|
||||||
|
<el-table-column label="签订合同总额" align="center" prop="amount" />
|
||||||
|
<el-table-column label="前期费" align="center" prop="preAmount" />
|
||||||
|
<el-table-column label="设计费" align="center" prop="designAmount" />
|
||||||
|
<el-table-column label="勘测费" align="center" prop="surveyFees" />
|
||||||
|
<el-table-column label="测量费" align="center" prop="measurementFee" />
|
||||||
|
<el-table-column label="其他费" align="center" prop="otherFee" />
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['cms:contract:update']"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['cms: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>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<ContractForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import { ContractApi, ContractVO } from '@/api/cms/contract'
|
||||||
|
import ContractForm from './ContractForm.vue'
|
||||||
|
|
||||||
|
/** 合同 列表 */
|
||||||
|
defineOptions({ name: 'Contract' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref<ContractVO[]>([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: undefined,
|
||||||
|
type: undefined,
|
||||||
|
progress: undefined,
|
||||||
|
expectedTime: [],
|
||||||
|
printingTime: [],
|
||||||
|
signingTime: [],
|
||||||
|
archiveTime: [],
|
||||||
|
status: undefined,
|
||||||
|
countType: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
contractFileUrl: undefined,
|
||||||
|
constructionCost: undefined,
|
||||||
|
source: undefined,
|
||||||
|
discount: undefined,
|
||||||
|
consortium: undefined,
|
||||||
|
consortiumCompany: undefined,
|
||||||
|
extProportion: undefined,
|
||||||
|
approvedAmount: undefined,
|
||||||
|
reviewFileUrl: undefined,
|
||||||
|
creator: undefined,
|
||||||
|
createTime: [],
|
||||||
|
updater: undefined,
|
||||||
|
updateTime: [],
|
||||||
|
deleted: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
amount: undefined,
|
||||||
|
preAmount: undefined,
|
||||||
|
designAmount: undefined,
|
||||||
|
surveyFees: undefined,
|
||||||
|
measurementFee: undefined,
|
||||||
|
otherFee: undefined,
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await ContractApi.getContractPage(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 ContractApi.deleteContract(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await ContractApi.exportContract(queryParams)
|
||||||
|
download.excel(data, '合同.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
Reference in New Issue
Block a user