应收管理界面
This commit is contained in:
parent
a41df38db2
commit
14a2416c28
@ -133,6 +133,7 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode MASTER_NOT_EXISTS = new ErrorCode(1_011_001, "借用主不存在");
|
ErrorCode MASTER_NOT_EXISTS = new ErrorCode(1_011_001, "借用主不存在");
|
||||||
|
|
||||||
ErrorCode ORDER_YF_NOT_EXISTS = new ErrorCode(1_011_001, "应付记录不存在");
|
ErrorCode ORDER_YF_NOT_EXISTS = new ErrorCode(1_011_001, "应付记录不存在");
|
||||||
|
ErrorCode ORDER_YS_NOT_EXISTS = new ErrorCode(1_011_001, "应收记录不存在");
|
||||||
|
|
||||||
ErrorCode SALE_ORDER_COST_DETAIL_NOT_EXISTS = new ErrorCode(1_011_001, "项目订单成本汇算明细不存在");
|
ErrorCode SALE_ORDER_COST_DETAIL_NOT_EXISTS = new ErrorCode(1_011_001, "项目订单成本汇算明细不存在");
|
||||||
/************责任人管理***********/
|
/************责任人管理***********/
|
||||||
|
@ -0,0 +1,95 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.controller.admin.orderys;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import javax.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 javax.validation.constraints.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.module.heli.controller.admin.orderys.vo.*;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.orderys.OrderYsDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.service.orderys.OrderYsService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 应收记录")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/heli/order-ys")
|
||||||
|
@Validated
|
||||||
|
public class OrderYsController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OrderYsService orderYsService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建应收记录")
|
||||||
|
@PreAuthorize("@ss.hasPermission('heli:order-ys:create')")
|
||||||
|
public CommonResult<Integer> createOrderYs(@Valid @RequestBody OrderYsSaveReqVO createReqVO) {
|
||||||
|
return success(orderYsService.createOrderYs(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新应收记录")
|
||||||
|
@PreAuthorize("@ss.hasPermission('heli:order-ys:update')")
|
||||||
|
public CommonResult<Boolean> updateOrderYs(@Valid @RequestBody OrderYsSaveReqVO updateReqVO) {
|
||||||
|
orderYsService.updateOrderYs(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除应收记录")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('heli:order-ys:delete')")
|
||||||
|
public CommonResult<Boolean> deleteOrderYs(@RequestParam("id") Integer id) {
|
||||||
|
orderYsService.deleteOrderYs(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得应收记录")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('heli:order-ys:query')")
|
||||||
|
public CommonResult<OrderYsRespVO> getOrderYs(@RequestParam("id") Integer id) {
|
||||||
|
OrderYsDO orderYs = orderYsService.getOrderYs(id);
|
||||||
|
return success(BeanUtils.toBean(orderYs, OrderYsRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得应收记录分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('heli:order-ys:query')")
|
||||||
|
public CommonResult<PageResult<OrderYsRespVO>> getOrderYsPage(@Valid OrderYsPageReqVO pageReqVO) {
|
||||||
|
PageResult<OrderYsDO> pageResult = orderYsService.getOrderYsPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, OrderYsRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出应收记录 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('heli:order-ys:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportOrderYsExcel(@Valid OrderYsPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<OrderYsDO> list = orderYsService.getOrderYsPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "应收记录.xls", "数据", OrderYsExportVO.class,
|
||||||
|
BeanUtils.toBean(list, OrderYsExportVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.controller.admin.orderys.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.chanko.yunxi.mes.framework.excel.core.annotations.DictFormat;
|
||||||
|
import com.chanko.yunxi.mes.framework.excel.core.convert.DictConvert;
|
||||||
|
import com.chanko.yunxi.mes.framework.excel.core.convert.TimestampToDateConvert;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 应收管理 Export VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class OrderYsExportVO {
|
||||||
|
|
||||||
|
@Schema(description = "项目编号,唯一", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("项目编号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||||
|
@ExcelProperty("项目名称")
|
||||||
|
private String projectName;
|
||||||
|
@ExcelProperty(value = "生成日期", converter = TimestampToDateConvert.class)
|
||||||
|
private LocalDateTime cgTime;
|
||||||
|
@Schema(description = "客户名称", example = "王五")
|
||||||
|
@ExcelProperty("客户名称")
|
||||||
|
private String cgKhname;
|
||||||
|
@Schema(description = "预计回款日期")
|
||||||
|
@ExcelProperty(value = "预计回款日期", converter = TimestampToDateConvert.class)
|
||||||
|
private LocalDateTime paymentDate;
|
||||||
|
@Schema(description = "应收金额")
|
||||||
|
@ExcelProperty("应收金额")
|
||||||
|
private BigDecimal cgYs;
|
||||||
|
|
||||||
|
@Schema(description = "已收金额")
|
||||||
|
@ExcelProperty("已收金额")
|
||||||
|
private BigDecimal cgYishou;
|
||||||
|
@Schema(description = "是否回款完成")
|
||||||
|
@ExcelProperty(value = "是否回款完成", converter = DictConvert.class)
|
||||||
|
@DictFormat("heli_yingfu_money")
|
||||||
|
private Integer cgTypee;
|
||||||
|
@Schema(description = "备注")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String rem;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.controller.admin.orderys.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.chanko.yunxi.mes.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 OrderYsPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
@Schema(description = "项目编号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "项目名称", example = "赵六")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@Schema(description = "生成日期")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] cgTime;
|
||||||
|
@Schema(description = "预计回款日期")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] paymentDate;
|
||||||
|
@Schema(description = "客户名称", example = "王五")
|
||||||
|
private String cgKhname;
|
||||||
|
|
||||||
|
@Schema(description = "应收金额")
|
||||||
|
private BigDecimal cgYs;
|
||||||
|
|
||||||
|
@Schema(description = "已收金额")
|
||||||
|
private BigDecimal cgYishou;
|
||||||
|
|
||||||
|
@Schema(description = "是否回款完成")
|
||||||
|
private Integer cgTypee;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String rem;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.controller.admin.orderys.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 应收记录 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class OrderYsRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "20436")
|
||||||
|
@ExcelProperty("自增字段,唯一")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "项目编号")
|
||||||
|
@ExcelProperty("项目编号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "项目名称", example = "赵六")
|
||||||
|
@ExcelProperty("项目名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@Schema(description = "生成日期")
|
||||||
|
@ExcelProperty("生成日期")
|
||||||
|
private LocalDateTime cgTime;
|
||||||
|
@Schema(description = "预计回款日期")
|
||||||
|
@ExcelProperty("预计回款日期")
|
||||||
|
private LocalDateTime paymentDate;
|
||||||
|
|
||||||
|
@Schema(description = "客户名称", example = "王五")
|
||||||
|
@ExcelProperty("客户名称")
|
||||||
|
private String cgKhname;
|
||||||
|
|
||||||
|
@Schema(description = "应收金额")
|
||||||
|
@ExcelProperty("应收金额")
|
||||||
|
private BigDecimal cgYs;
|
||||||
|
|
||||||
|
@Schema(description = "已收金额")
|
||||||
|
@ExcelProperty("已收金额")
|
||||||
|
private BigDecimal cgYishou;
|
||||||
|
|
||||||
|
@Schema(description = "是否回款完成")
|
||||||
|
@ExcelProperty("是否回款完成")
|
||||||
|
private Integer cgTypee;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String rem;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.controller.admin.orderys.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 应收记录新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class OrderYsSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "20436")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "项目编号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "项目名称", example = "赵六")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@Schema(description = "生成日期")
|
||||||
|
private LocalDateTime cgTime;
|
||||||
|
@Schema(description = "生成日期")
|
||||||
|
private LocalDateTime paymentDate;
|
||||||
|
@Schema(description = "客户名称", example = "王五")
|
||||||
|
private String cgKhname;
|
||||||
|
|
||||||
|
@Schema(description = "应收金额")
|
||||||
|
private BigDecimal cgYs;
|
||||||
|
|
||||||
|
@Schema(description = "已收金额")
|
||||||
|
private BigDecimal cgYishou;
|
||||||
|
|
||||||
|
@Schema(description = "是否回款完成")
|
||||||
|
private Integer cgTypee;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String rem;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.dal.dataobject.orderys;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应收记录 DO
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@TableName("cg_order_ys")
|
||||||
|
@KeySequence("cg_order_ys_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class OrderYsDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自增字段,唯一
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Integer id;
|
||||||
|
/**
|
||||||
|
* 项目编号
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
/**
|
||||||
|
* 项目名称
|
||||||
|
*/
|
||||||
|
private String projectName;
|
||||||
|
/**
|
||||||
|
* 生成日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime cgTime;
|
||||||
|
/**
|
||||||
|
* 预计回款日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime paymentDate;
|
||||||
|
/**
|
||||||
|
* 客户名称
|
||||||
|
*/
|
||||||
|
private String cgKhname;
|
||||||
|
/**
|
||||||
|
* 应收金额
|
||||||
|
*/
|
||||||
|
private BigDecimal cgYs;
|
||||||
|
/**
|
||||||
|
* 已收金额
|
||||||
|
*/
|
||||||
|
private BigDecimal cgYishou;
|
||||||
|
/**
|
||||||
|
* 是否回款完成
|
||||||
|
*/
|
||||||
|
private Integer cgTypee;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String rem;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.dal.mysql.orderys;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.orderys.OrderYsDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.controller.admin.orderys.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应收记录 Mapper
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface OrderYsMapper extends BaseMapperX<OrderYsDO> {
|
||||||
|
|
||||||
|
default PageResult<OrderYsDO> selectPage(OrderYsPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<OrderYsDO>()
|
||||||
|
.betweenIfPresent(OrderYsDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.eqIfPresent(OrderYsDO::getCode, reqVO.getCode())
|
||||||
|
.likeIfPresent(OrderYsDO::getProjectName, reqVO.getProjectName())
|
||||||
|
.betweenIfPresent(OrderYsDO::getCgTime, reqVO.getCgTime())
|
||||||
|
.likeIfPresent(OrderYsDO::getCgKhname, reqVO.getCgKhname())
|
||||||
|
.eqIfPresent(OrderYsDO::getCgYs, reqVO.getCgYs())
|
||||||
|
.eqIfPresent(OrderYsDO::getCgYishou, reqVO.getCgYishou())
|
||||||
|
.eqIfPresent(OrderYsDO::getCgTypee, reqVO.getCgTypee())
|
||||||
|
.eqIfPresent(OrderYsDO::getRem, reqVO.getRem())
|
||||||
|
.orderByDesc(OrderYsDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.service.orderys;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.controller.admin.orderys.vo.*;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.orderys.OrderYsDO;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应收记录 Service 接口
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
public interface OrderYsService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建应收记录
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Integer createOrderYs(@Valid OrderYsSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新应收记录
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateOrderYs(@Valid OrderYsSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除应收记录
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteOrderYs(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得应收记录
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 应收记录
|
||||||
|
*/
|
||||||
|
OrderYsDO getOrderYs(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得应收记录分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 应收记录分页
|
||||||
|
*/
|
||||||
|
PageResult<OrderYsDO> getOrderYsPage(OrderYsPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,77 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.service.orderys;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.controller.admin.orderys.vo.*;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.orderys.OrderYsDO;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.orderys.OrderYsMapper;
|
||||||
|
|
||||||
|
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应收记录 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class OrderYsServiceImpl implements OrderYsService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OrderYsMapper orderYsMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer createOrderYs(OrderYsSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
OrderYsDO orderYs = BeanUtils.toBean(createReqVO, OrderYsDO.class);
|
||||||
|
orderYsMapper.insert(orderYs);
|
||||||
|
// 返回
|
||||||
|
return orderYs.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateOrderYs(OrderYsSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateOrderYsExists(updateReqVO.getId());
|
||||||
|
if (updateReqVO.getCgYishou().compareTo(updateReqVO.getCgYs())>=0){
|
||||||
|
updateReqVO.setCgTypee(2);
|
||||||
|
}
|
||||||
|
// 更新
|
||||||
|
OrderYsDO updateObj = BeanUtils.toBean(updateReqVO, OrderYsDO.class);
|
||||||
|
orderYsMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteOrderYs(Integer id) {
|
||||||
|
// 校验存在
|
||||||
|
validateOrderYsExists(id);
|
||||||
|
// 删除
|
||||||
|
orderYsMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateOrderYsExists(Integer id) {
|
||||||
|
if (orderYsMapper.selectById(id) == null) {
|
||||||
|
throw exception(ORDER_YS_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OrderYsDO getOrderYs(Integer id) {
|
||||||
|
return orderYsMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<OrderYsDO> getOrderYsPage(OrderYsPageReqVO pageReqVO) {
|
||||||
|
return orderYsMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,9 +1,11 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.service.projectorder;
|
package com.chanko.yunxi.mes.module.heli.service.projectorder;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.util.object.ObjectUtils;
|
||||||
import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum;
|
import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum;
|
||||||
import com.chanko.yunxi.mes.framework.security.core.LoginUser;
|
import com.chanko.yunxi.mes.framework.security.core.LoginUser;
|
||||||
import com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils;
|
import com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
@ -17,10 +19,12 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthing
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.deliverorder.DeliverOrderDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.deliverorder.DeliverOrderDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.deliverorder.DeliverOrderSubDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.deliverorder.DeliverOrderSubDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.orderys.OrderYsDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.deliverorder.DeliverOrderSubMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.deliverorder.DeliverOrderSubMapper;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.orderys.OrderYsMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder.ProjectOrderMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder.ProjectOrderMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder.ProjectOrderSubMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder.ProjectOrderSubMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum;
|
import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum;
|
||||||
@ -48,6 +52,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -91,6 +96,8 @@ public class ProjectOrderServiceImpl implements ProjectOrderService {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private DeliverOrderSubMapper deliverOrderSubMapper;
|
private DeliverOrderSubMapper deliverOrderSubMapper;
|
||||||
|
@Resource
|
||||||
|
private OrderYsMapper orderYsMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private StorageLogService storageLogService;
|
private StorageLogService storageLogService;
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -381,11 +388,16 @@ public class ProjectOrderServiceImpl implements ProjectOrderService {
|
|||||||
public void operateProjectOrder(ProjectOrderSaveReqVO operateReqVO) {
|
public void operateProjectOrder(ProjectOrderSaveReqVO operateReqVO) {
|
||||||
if(operateReqVO.getId() == null){
|
if(operateReqVO.getId() == null){
|
||||||
createProjectOrder(operateReqVO);
|
createProjectOrder(operateReqVO);
|
||||||
|
OrderYsDO orderYsDO = new OrderYsDO();
|
||||||
|
orderYsDO.setCode(operateReqVO.getCode());
|
||||||
|
orderYsDO.setProjectName(operateReqVO.getProjectName());
|
||||||
|
orderYsDO.setCgTime(LocalDateTime.now());
|
||||||
|
orderYsDO.setCgKhname(customerService.getCustomer(operateReqVO.getCustomerId()).getName());
|
||||||
if(operateReqVO.getHasPrice().equals(1)&&(operateReqVO.getPrice()==null)){
|
if(operateReqVO.getHasPrice().equals(1)&&(operateReqVO.getPrice()==null)){
|
||||||
//订单有价格但是没录价格
|
//订单有价格但是没录价格
|
||||||
String nickname = userApi.getUser( SecurityFrameworkUtils.getLoginUser().getId()).getNickname();
|
String nickname = userApi.getUser( SecurityFrameworkUtils.getLoginUser().getId()).getNickname();
|
||||||
|
|
||||||
|
orderYsDO.setCgYs(new BigDecimal(0));
|
||||||
|
|
||||||
List<AttentiontodoDO> attentiontodook = attentiontodoService.getAttentiontodolist(1);//查找该类型的待办和关注人 改
|
List<AttentiontodoDO> attentiontodook = attentiontodoService.getAttentiontodolist(1);//查找该类型的待办和关注人 改
|
||||||
AttentiontodoDO attentiontodoDO = attentiontodook.get(0);
|
AttentiontodoDO attentiontodoDO = attentiontodook.get(0);
|
||||||
@ -461,7 +473,24 @@ public class ProjectOrderServiceImpl implements ProjectOrderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}else {
|
||||||
|
orderYsDO.setCgYs(operateReqVO.getPrice());
|
||||||
|
LocalDateTime[] paymentTimes = {
|
||||||
|
operateReqVO.getSixFuKuanTime(),
|
||||||
|
operateReqVO.getFiveFuKuanTime(),
|
||||||
|
operateReqVO.getFourFuKuanTime(),
|
||||||
|
operateReqVO.getThreeFuKuanTime(),
|
||||||
|
operateReqVO.getTwoFuKuanTime(),
|
||||||
|
operateReqVO.getShouFuKuanTime()
|
||||||
|
};
|
||||||
|
for (LocalDateTime paymentTime : paymentTimes) {
|
||||||
|
if (!ObjectUtil.isEmpty(paymentTime)) {
|
||||||
|
orderYsDO.setPaymentDate(paymentTime);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
orderYsMapper.insert(orderYsDO);
|
||||||
}else{
|
}else{
|
||||||
if ("PRICE".equals(operateReqVO.getActive())){
|
if ("PRICE".equals(operateReqVO.getActive())){
|
||||||
updateProjectOrderPrice(operateReqVO);
|
updateProjectOrderPrice(operateReqVO);
|
||||||
@ -469,13 +498,78 @@ public class ProjectOrderServiceImpl implements ProjectOrderService {
|
|||||||
updateProjectOrder(operateReqVO);
|
updateProjectOrder(operateReqVO);
|
||||||
}
|
}
|
||||||
if(operateReqVO.getHasPrice().equals(1)&&(operateReqVO.getPrice()==null)){
|
if(operateReqVO.getHasPrice().equals(1)&&(operateReqVO.getPrice()==null)){
|
||||||
|
LambdaQueryWrapper<OrderYsDO> eq = new LambdaQueryWrapper<OrderYsDO>().eq(OrderYsDO::getCode, operateReqVO.getCode());
|
||||||
|
OrderYsDO orderYsDO = orderYsMapper.selectOne(eq);
|
||||||
|
if (ObjectUtil.isEmpty(orderYsDO)) {
|
||||||
|
orderYsDO = new OrderYsDO();
|
||||||
|
orderYsDO.setCode(operateReqVO.getCode());
|
||||||
|
orderYsDO.setProjectName(operateReqVO.getProjectName());
|
||||||
|
orderYsDO.setCgTime(LocalDateTime.now());
|
||||||
|
orderYsDO.setCgYs(new BigDecimal(0));
|
||||||
|
LocalDateTime[] paymentTimes = {
|
||||||
|
operateReqVO.getSixFuKuanTime(),
|
||||||
|
operateReqVO.getFiveFuKuanTime(),
|
||||||
|
operateReqVO.getFourFuKuanTime(),
|
||||||
|
operateReqVO.getThreeFuKuanTime(),
|
||||||
|
operateReqVO.getTwoFuKuanTime(),
|
||||||
|
operateReqVO.getShouFuKuanTime()
|
||||||
|
};
|
||||||
|
for (LocalDateTime paymentTime : paymentTimes) {
|
||||||
|
if (!ObjectUtil.isEmpty(paymentTime)) {
|
||||||
|
orderYsDO.setPaymentDate(paymentTime);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
orderYsMapper.insert(orderYsDO);
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
bdgzsomthingDO abc= new bdgzsomthingDO();
|
bdgzsomthingDO abc= new bdgzsomthingDO();
|
||||||
abc.setThingname("订单有价格");
|
abc.setThingname("订单有价格");
|
||||||
abc.setAttr12("0");
|
abc.setAttr12("0");
|
||||||
abc.setAttr3(operateReqVO.getId().toString());
|
abc.setAttr3(operateReqVO.getId().toString());
|
||||||
bdgzsomthingMapper.updateok(abc);
|
bdgzsomthingMapper.updateok(abc);
|
||||||
|
LambdaQueryWrapper<OrderYsDO> eq = new LambdaQueryWrapper<OrderYsDO>().eq(OrderYsDO::getCode, operateReqVO.getCode());
|
||||||
|
OrderYsDO orderYsDO = orderYsMapper.selectOne(eq);
|
||||||
|
if (ObjectUtil.isEmpty(orderYsDO)){
|
||||||
|
orderYsDO = new OrderYsDO();
|
||||||
|
orderYsDO.setCode(operateReqVO.getCode());
|
||||||
|
orderYsDO.setProjectName(operateReqVO.getProjectName());
|
||||||
|
orderYsDO.setCgTime(LocalDateTime.now());
|
||||||
|
orderYsDO.setCgYs(operateReqVO.getPrice());
|
||||||
|
LocalDateTime[] paymentTimes = {
|
||||||
|
operateReqVO.getSixFuKuanTime(),
|
||||||
|
operateReqVO.getFiveFuKuanTime(),
|
||||||
|
operateReqVO.getFourFuKuanTime(),
|
||||||
|
operateReqVO.getThreeFuKuanTime(),
|
||||||
|
operateReqVO.getTwoFuKuanTime(),
|
||||||
|
operateReqVO.getShouFuKuanTime()
|
||||||
|
};
|
||||||
|
for (LocalDateTime paymentTime : paymentTimes) {
|
||||||
|
if (!ObjectUtil.isEmpty(paymentTime)) {
|
||||||
|
orderYsDO.setPaymentDate(paymentTime);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
orderYsMapper.insert(orderYsDO);
|
||||||
|
}else {
|
||||||
|
orderYsDO.setCgYs(operateReqVO.getPrice());
|
||||||
|
LocalDateTime[] paymentTimes = {
|
||||||
|
operateReqVO.getSixFuKuanTime(),
|
||||||
|
operateReqVO.getFiveFuKuanTime(),
|
||||||
|
operateReqVO.getFourFuKuanTime(),
|
||||||
|
operateReqVO.getThreeFuKuanTime(),
|
||||||
|
operateReqVO.getTwoFuKuanTime(),
|
||||||
|
operateReqVO.getShouFuKuanTime()
|
||||||
|
};
|
||||||
|
for (LocalDateTime paymentTime : paymentTimes) {
|
||||||
|
if (!ObjectUtil.isEmpty(paymentTime)) {
|
||||||
|
orderYsDO.setPaymentDate(paymentTime);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
orderYsMapper.updateById(orderYsDO);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
43
mes-ui/mes-ui-admin-vue3/src/api/heli/orderys/index.ts
Normal file
43
mes-ui/mes-ui-admin-vue3/src/api/heli/orderys/index.ts
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
export interface OrderYsVO {
|
||||||
|
id: number
|
||||||
|
code: string
|
||||||
|
projectName: string
|
||||||
|
cgTime: Date
|
||||||
|
cgKhname: string
|
||||||
|
cgYs: number
|
||||||
|
cgYishou: number
|
||||||
|
cgTypee: number
|
||||||
|
rem: string
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询应收记录分页
|
||||||
|
export const getOrderYsPage = async (params) => {
|
||||||
|
return await request.get({ url: `/heli/order-ys/page`, params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询应收记录详情
|
||||||
|
export const getOrderYs = async (id: number) => {
|
||||||
|
return await request.get({ url: `/heli/order-ys/get?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增应收记录
|
||||||
|
export const createOrderYs = async (data: OrderYsVO) => {
|
||||||
|
return await request.post({ url: `/heli/order-ys/create`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改应收记录
|
||||||
|
export const updateOrderYs = async (data: OrderYsVO) => {
|
||||||
|
return await request.put({ url: `/heli/order-ys/update`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除应收记录
|
||||||
|
export const deleteOrderYs = async (id: number) => {
|
||||||
|
return await request.delete({ url: `/heli/order-ys/delete?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出应收记录 Excel
|
||||||
|
export const exportOrderYs = async (params) => {
|
||||||
|
return await request.download({ url: `/heli/order-ys/export-excel`, params })
|
||||||
|
}
|
128
mes-ui/mes-ui-admin-vue3/src/views/heli/orderys/OrderYsForm.vue
Normal file
128
mes-ui/mes-ui-admin-vue3/src/views/heli/orderys/OrderYsForm.vue
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
<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="code">
|
||||||
|
<el-input v-model="formData.code" placeholder="请输入项目编号" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="项目名称" prop="projectName">
|
||||||
|
<el-input v-model="formData.projectName" placeholder="请输入项目名称" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="生成日期" prop="cgTime" >
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.cgTime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择生成日期" disabled
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="客户名称" prop="cgKhname" >
|
||||||
|
<el-input v-model="formData.cgKhname" placeholder="请输入客户名称" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="应收金额" prop="cgYs" >
|
||||||
|
<el-input v-model="formData.cgYs" placeholder="请输入应收金额" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="已收金额" prop="cgYishou">
|
||||||
|
<el-input v-model="formData.cgYishou" placeholder="请输入已收金额" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否回款完成" prop="cgTypee" >
|
||||||
|
<el-input v-model="formData.cgTypee" placeholder="请输入是否回款完成" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="rem">
|
||||||
|
<el-input v-model="formData.rem" 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 * as OrderYsApi from '@/api/heli/orderys'
|
||||||
|
|
||||||
|
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,
|
||||||
|
code: undefined,
|
||||||
|
projectName: undefined,
|
||||||
|
cgTime: undefined,
|
||||||
|
cgKhname: undefined,
|
||||||
|
cgYs: undefined,
|
||||||
|
cgYishou: undefined,
|
||||||
|
cgTypee: undefined,
|
||||||
|
rem: undefined,
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
})
|
||||||
|
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 OrderYsApi.getOrderYs(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 OrderYsApi.OrderYsVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await OrderYsApi.createOrderYs(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await OrderYsApi.updateOrderYs(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
code: undefined,
|
||||||
|
projectName: undefined,
|
||||||
|
cgTime: undefined,
|
||||||
|
cgKhname: undefined,
|
||||||
|
cgYs: undefined,
|
||||||
|
cgYishou: undefined,
|
||||||
|
cgTypee: undefined,
|
||||||
|
rem: undefined,
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
241
mes-ui/mes-ui-admin-vue3/src/views/heli/orderys/index.vue
Normal file
241
mes-ui/mes-ui-admin-vue3/src/views/heli/orderys/index.vue
Normal file
@ -0,0 +1,241 @@
|
|||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="160px"
|
||||||
|
>
|
||||||
|
<el-form-item label="项目编号" prop="code">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.code"
|
||||||
|
placeholder="请输入项目编号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="项目名称" prop="projectName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.projectName"
|
||||||
|
placeholder="请输入项目名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="客户名称" prop="cgKhname">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.cgKhname"
|
||||||
|
placeholder="请输入客户名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否回款完成" prop="cgTypee">
|
||||||
|
<!-- <el-input-->
|
||||||
|
<!-- v-model="queryParams.cgTypee"-->
|
||||||
|
<!-- placeholder="请输入是否回款完成"-->
|
||||||
|
<!-- clearable-->
|
||||||
|
<!-- @keyup.enter="handleQuery"-->
|
||||||
|
<!-- class="!w-240px"-->
|
||||||
|
<!-- />-->
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.cgTypee"
|
||||||
|
placeholder="请选择"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.HELI_YINGFU_MONEY)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</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="['heli:order-ys:create']"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <Icon icon="ep:plus" class="mr-5px" /> 新增-->
|
||||||
|
<!-- </el-button>-->
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['heli:order-ys: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="code" />
|
||||||
|
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||||
|
<el-table-column
|
||||||
|
label="生成日期"
|
||||||
|
align="center"
|
||||||
|
prop="cgTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="客户名称" align="center" prop="cgKhname" />
|
||||||
|
<el-table-column
|
||||||
|
label="预计回款日期"
|
||||||
|
align="center"
|
||||||
|
prop="cgTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="应收金额" align="center" prop="cgYs" />
|
||||||
|
<el-table-column label="已收金额" align="center" prop="cgYishou" />
|
||||||
|
<el-table-column label="是否回款完成" align="center" prop="cgTypee" width="150" >
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.HELI_YINGFU_MONEY" :value="scope.row.cgTypee" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="备注" align="center" prop="rem" />
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['heli:order-ys:update']"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['heli:order-ys: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>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<OrderYsForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import * as OrderYsApi from '@/api/heli/orderys'
|
||||||
|
import OrderYsForm from './OrderYsForm.vue'
|
||||||
|
import {DICT_TYPE, getIntDictOptions} from "@/utils/dict";
|
||||||
|
|
||||||
|
defineOptions({ name: 'OrderYs' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
createTime: [],
|
||||||
|
code: undefined,
|
||||||
|
projectName: undefined,
|
||||||
|
cgTime: [],
|
||||||
|
cgKhname: undefined,
|
||||||
|
cgYs: undefined,
|
||||||
|
cgYishou: undefined,
|
||||||
|
cgTypee: undefined,
|
||||||
|
rem: undefined,
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await OrderYsApi.getOrderYsPage(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 OrderYsApi.deleteOrderYs(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await OrderYsApi.exportOrderYs(queryParams)
|
||||||
|
download.excel(data, '应收记录.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
@ -1124,11 +1124,14 @@ onMounted(async () => {
|
|||||||
const purchaseOrderDo = await PurchaseOrderApi.getPurchaseOrder(formData.value.purchaseId)
|
const purchaseOrderDo = await PurchaseOrderApi.getPurchaseOrder(formData.value.purchaseId)
|
||||||
formData.value.purchaseNo = purchaseOrderDo.purchaseNo
|
formData.value.purchaseNo = purchaseOrderDo.purchaseNo
|
||||||
// 获取物料需求计划信息
|
// 获取物料需求计划信息
|
||||||
|
if (purchaseOrderDo.projectMaterialPlanId!=null){
|
||||||
const materialPlan = await MaterialPlanApi.getMaterialPlan(purchaseOrderDo.projectMaterialPlanId)
|
const materialPlan = await MaterialPlanApi.getMaterialPlan(purchaseOrderDo.projectMaterialPlanId)
|
||||||
//获取物料需求计划中的生产计划id,去查询对应子项目
|
//获取物料需求计划中的生产计划id,去查询对应子项目
|
||||||
// 获取生产计划单中子项目编号
|
// 获取生产计划单中子项目编号
|
||||||
await handleInitPlanSub(materialPlan.projectPlanId)
|
await handleInitPlanSub(materialPlan.projectPlanId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
formData.value.supplierId != undefined &&
|
formData.value.supplierId != undefined &&
|
||||||
formData.value.supplierId != ''
|
formData.value.supplierId != ''
|
||||||
|
@ -478,7 +478,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template> -->
|
</template> -->
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="boomAmount" label="需求数量" min-width="180" align="center" />
|
<el-table-column prop="boomAmount" label="需求数量" min-width="100" align="center" />
|
||||||
<el-table-column prop="purchaseAmount" min-width="180" align="center">
|
<el-table-column prop="purchaseAmount" min-width="180" align="center">
|
||||||
<template #header><span class="hl-table_header">*</span>采购数量</template>
|
<template #header><span class="hl-table_header">*</span>采购数量</template>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
@ -675,6 +675,7 @@ import materials from '@/views/heli/storage/materials.vue'
|
|||||||
import MaterialDialog from '@/views/heli/purchaseorder/materialDialog.vue'
|
import MaterialDialog from '@/views/heli/purchaseorder/materialDialog.vue'
|
||||||
import BoomDialog from '@/views/heli/purchaseorder/boomDialog.vue'
|
import BoomDialog from '@/views/heli/purchaseorder/boomDialog.vue'
|
||||||
import SupplierSelect from '@/views/heli/hlvuestyle/supplierSelect.vue'
|
import SupplierSelect from '@/views/heli/hlvuestyle/supplierSelect.vue'
|
||||||
|
import {setFlagsFromString} from "node:v8";
|
||||||
|
|
||||||
const reload: any = inject('reload')
|
const reload: any = inject('reload')
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
@ -1124,6 +1125,28 @@ const saveForm = async () => {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
let flag=false
|
||||||
|
if (formData.value.purchaseType==1&&formData.value.goodsType==1){
|
||||||
|
for (var i=0;i<formData.value.matItemDOList.length;i++){
|
||||||
|
const requireAmount = formData.value.matItemDOList[i].requireAmount;
|
||||||
|
const purchaseAmount = formData.value.matItemDOList[i].purchaseAmount;
|
||||||
|
if (requireAmount!=purchaseAmount){
|
||||||
|
flag=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (formData.value.purchaseType==1&&formData.value.goodsType==2){
|
||||||
|
for (var i=0;i<formData.value.boomItemDOList.length;i++){
|
||||||
|
const requireAmount = formData.value.boomItemDOList[i].boomAmount;
|
||||||
|
const purchaseAmount = formData.value.boomItemDOList[i].purchaseAmount;
|
||||||
|
if (requireAmount!=purchaseAmount){
|
||||||
|
flag=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (flag){
|
||||||
|
await message.confirm('需求数量和采购数量不一致,是否继续?')
|
||||||
|
}
|
||||||
// 提交请求
|
// 提交请求
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user