零件采购订单管理
This commit is contained in:
parent
913318d152
commit
1595733b09
@ -147,4 +147,5 @@ public interface ErrorCodeConstants {
|
|||||||
/************责任人管理***********/
|
/************责任人管理***********/
|
||||||
ErrorCode OWNER_NOT_EXISTS = new ErrorCode(1_013_001, "人员配置主数据维护错误,请确认!");
|
ErrorCode OWNER_NOT_EXISTS = new ErrorCode(1_013_001, "人员配置主数据维护错误,请确认!");
|
||||||
ErrorCode TRACK_NOT_EXISTS = new ErrorCode(1_013_002, "生产进度跟踪不存在");
|
ErrorCode TRACK_NOT_EXISTS = new ErrorCode(1_013_002, "生产进度跟踪不存在");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderno;
|
package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderno;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorder.vo.PurchaseOrderPageReqVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorder.vo.PurchaseOrderPageReqVO;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorder.vo.PurchaseOrderRespVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorder.vo.PurchaseOrderRespVO;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorder.vo.PurchaseOrderSaveReqVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorder.vo.PurchaseOrderSaveReqVO;
|
||||||
@ -7,11 +8,15 @@ import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermake.vo.Pa
|
|||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderno.vo.PurchaseOrderNoPageReqVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderno.vo.PurchaseOrderNoPageReqVO;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderno.vo.PurchaseOrderNoRespVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderno.vo.PurchaseOrderNoRespVO;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderno.vo.PurchaseOrderNoSaveReqVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderno.vo.PurchaseOrderNoSaveReqVO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.controller.admin.supplier.vo.SupplierSaveReqVO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordermakedetail.PurchaseOrderMakeDetailDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordermakedetail.PurchaseOrderMakeDetailDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.partpurchaseorder.PartPurchaseOrderService;
|
import com.chanko.yunxi.mes.module.heli.service.partpurchaseorder.PartPurchaseOrderService;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.supplier.SupplierDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.supplier.SupplierMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.purchaseorderno.PurchaseOrderNoService;
|
import com.chanko.yunxi.mes.module.heli.service.purchaseorderno.PurchaseOrderNoService;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.service.supplier.SupplierService;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -46,6 +51,8 @@ public class PurchaseOrderNoController {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private PurchaseOrderNoService purchaseOrderNoService;
|
private PurchaseOrderNoService purchaseOrderNoService;
|
||||||
|
@Resource
|
||||||
|
private SupplierService supplierService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private PartPurchaseOrderService partPurchaseOrderService;
|
private PartPurchaseOrderService partPurchaseOrderService;
|
||||||
@ -80,6 +87,10 @@ public class PurchaseOrderNoController {
|
|||||||
@PreAuthorize("@ss.hasPermission('project:purchase-order-no:query')")
|
@PreAuthorize("@ss.hasPermission('project:purchase-order-no:query')")
|
||||||
public CommonResult<PurchaseOrderNoRespVO> getPurchaseOrderNo(@RequestParam("id") Long id) {
|
public CommonResult<PurchaseOrderNoRespVO> getPurchaseOrderNo(@RequestParam("id") Long id) {
|
||||||
PurchaseOrderNoDO purchaseOrderNo = purchaseOrderNoService.getPurchaseOrderNo(id);
|
PurchaseOrderNoDO purchaseOrderNo = purchaseOrderNoService.getPurchaseOrderNo(id);
|
||||||
|
SupplierDO supplier = supplierService.getSupplier(purchaseOrderNo.getSupplierId());
|
||||||
|
if (ObjectUtil.isNotEmpty(supplier)){
|
||||||
|
purchaseOrderNo.setSupplierName(supplier.getName());
|
||||||
|
}
|
||||||
return success(BeanUtils.toBean(purchaseOrderNo, PurchaseOrderNoRespVO.class));
|
return success(BeanUtils.toBean(purchaseOrderNo, PurchaseOrderNoRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,4 +145,17 @@ public class PurchaseOrderNoController {
|
|||||||
return success(partPurchaseOrderService.submit(list));
|
return success(partPurchaseOrderService.submit(list));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/isPrint")
|
||||||
|
@Operation(summary = "打印")
|
||||||
|
@PreAuthorize("@ss.hasPermission('heli:process-bom:create')")
|
||||||
|
public CommonResult<PurchaseOrderNoDO> isPrint(@RequestParam("id") Long id) {
|
||||||
|
return purchaseOrderNoService.isPrint(id);
|
||||||
|
}
|
||||||
|
@DeleteMapping("/deleteForm")
|
||||||
|
@Operation(summary = "删除采购订单主")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('project:purchase-order-no:delete')")
|
||||||
|
public CommonResult<Boolean> deleteForm(@RequestParam("id") Long id) {
|
||||||
|
return purchaseOrderNoService.deleteForm(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,4 +88,10 @@ public class PurchaseOrderNoPageReqVO extends PageParam {
|
|||||||
@Schema(description = "物料需求计划单号")
|
@Schema(description = "物料需求计划单号")
|
||||||
private String materialPlanNo;
|
private String materialPlanNo;
|
||||||
|
|
||||||
|
@Schema(description = "项目名称")
|
||||||
|
private String projectName;
|
||||||
|
@Schema(description = "子项目名称")
|
||||||
|
private String projectSubName;
|
||||||
|
@Schema(description = "责任人")
|
||||||
|
private String username;
|
||||||
}
|
}
|
@ -105,4 +105,6 @@ public class PurchaseOrderNoRespVO {
|
|||||||
|
|
||||||
@Schema(description = "创建者")
|
@Schema(description = "创建者")
|
||||||
private String creator;
|
private String creator;
|
||||||
|
@Schema(description = "是否打印")
|
||||||
|
private String isPrint;
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordernodetail;
|
package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordernodetail;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -8,7 +9,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
|
||||||
import javax.validation.*;
|
import javax.validation.*;
|
||||||
import javax.servlet.http.*;
|
import javax.servlet.http.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -91,5 +91,25 @@ public class PurchaseOrderNoDetailController {
|
|||||||
ExcelUtils.write(response, "采购订单明细.xls", "数据", PurchaseOrderNoDetailRespVO.class,
|
ExcelUtils.write(response, "采购订单明细.xls", "数据", PurchaseOrderNoDetailRespVO.class,
|
||||||
BeanUtils.toBean(list, PurchaseOrderNoDetailRespVO.class));
|
BeanUtils.toBean(list, PurchaseOrderNoDetailRespVO.class));
|
||||||
}
|
}
|
||||||
|
@GetMapping("/getPurchaseOrderNoDetailById")
|
||||||
|
@Operation(summary = "根据采购订单获取采购订单明细")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('project:purchase-order-no-detail:query')")
|
||||||
|
public CommonResult<List<PurchaseOrderNoDetailDO>> getPurchaseOrderNoDetailById(@RequestParam("id") Long id) {
|
||||||
|
List<PurchaseOrderNoDetailDO> purchaseOrderNoDetail = purchaseOrderNoDetailService.getPurchaseOrderNoDetailById(id);
|
||||||
|
return success(purchaseOrderNoDetail);
|
||||||
|
}
|
||||||
|
@PostMapping("/verification")
|
||||||
|
@Operation(summary = "收货校验")
|
||||||
|
@PreAuthorize("@ss.hasPermission('heli:process-bom:create')")
|
||||||
|
public CommonResult<Boolean> verification(@Valid @RequestBody List<PurchaseOrderNoDetailDO> list) {
|
||||||
|
return purchaseOrderNoDetailService.verification(list);
|
||||||
|
}
|
||||||
|
@PostMapping("/receiveGoods")
|
||||||
|
@Operation(summary = "收货")
|
||||||
|
@PreAuthorize("@ss.hasPermission('heli:process-bom:create')")
|
||||||
|
public CommonResult<Boolean> receiveGoods(@Valid @RequestBody List<PurchaseOrderNoDetailDO> list) {
|
||||||
|
return purchaseOrderNoDetailService.receiveGoods(list);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,7 @@ public class PurchaseOrderNoDetailRespVO {
|
|||||||
|
|
||||||
@Schema(description = "收货状态 未收货/收货中/收货完成 1/2/3", example = "2")
|
@Schema(description = "收货状态 未收货/收货中/收货完成 1/2/3", example = "2")
|
||||||
@ExcelProperty("收货状态 未收货/收货中/收货完成 1/2/3")
|
@ExcelProperty("收货状态 未收货/收货中/收货完成 1/2/3")
|
||||||
private Boolean receivingStatus;
|
private Integer receivingStatus;
|
||||||
|
|
||||||
@Schema(description = "入库单id", example = "28663")
|
@Schema(description = "入库单id", example = "28663")
|
||||||
@ExcelProperty("入库单id")
|
@ExcelProperty("入库单id")
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderno;
|
package com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderno;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordernodetail.PurchaseOrderNoDetailDO;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import java.time.*;
|
import java.time.*;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO;
|
import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO;
|
||||||
@ -130,6 +132,16 @@ public class PurchaseOrderNoDO extends BaseDO {
|
|||||||
private String amount;
|
private String amount;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String type;
|
private String type;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String username;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String userMobile;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String contactName;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String contactMobile;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<PurchaseOrderNoDetailDO> PurchaseOrderNoDetailList;
|
||||||
/**
|
/**
|
||||||
* 是否打印
|
* 是否打印
|
||||||
*/
|
*/
|
||||||
|
@ -123,6 +123,10 @@ public class PurchaseOrderNoDetailDO extends BaseDO {
|
|||||||
* 客户简称
|
* 客户简称
|
||||||
*/
|
*/
|
||||||
private String brief;
|
private String brief;
|
||||||
|
/**
|
||||||
|
* 子项目编码
|
||||||
|
*/
|
||||||
|
private String projectSubCode;
|
||||||
/**
|
/**
|
||||||
* 项目名称
|
* 项目名称
|
||||||
*/
|
*/
|
||||||
@ -138,7 +142,7 @@ public class PurchaseOrderNoDetailDO extends BaseDO {
|
|||||||
/**
|
/**
|
||||||
* 收货状态 未收货/收货中/收货完成 1/2/3
|
* 收货状态 未收货/收货中/收货完成 1/2/3
|
||||||
*/
|
*/
|
||||||
private Boolean receivingStatus;
|
private Integer receivingStatus;
|
||||||
/**
|
/**
|
||||||
* 入库单id
|
* 入库单id
|
||||||
*/
|
*/
|
||||||
@ -177,4 +181,11 @@ public class PurchaseOrderNoDetailDO extends BaseDO {
|
|||||||
private BigDecimal requireAmount;
|
private BigDecimal requireAmount;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private LocalDateTime requireArriveTime;
|
private LocalDateTime requireArriveTime;
|
||||||
|
/**
|
||||||
|
* 入库数量
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private BigDecimal purchaseRemAmounts;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String compositionName;
|
||||||
}
|
}
|
@ -10,8 +10,10 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.equip.EquipDO;
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplan.MaterialPlanDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplan.MaterialPlanDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderno.PurchaseOrderNoDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderno.PurchaseOrderNoDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordernodetail.PurchaseOrderNoDetailDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.supplier.SupplierDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.supplier.SupplierDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.enums.PurchaseStatusEnum;
|
import com.chanko.yunxi.mes.module.heli.enums.PurchaseStatusEnum;
|
||||||
|
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import io.netty.util.internal.ObjectUtil;
|
import io.netty.util.internal.ObjectUtil;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
@ -32,8 +34,11 @@ public interface PurchaseOrderNoMapper extends BaseMapperX<PurchaseOrderNoDO> {
|
|||||||
query.selectAll(PurchaseOrderNoDO.class)
|
query.selectAll(PurchaseOrderNoDO.class)
|
||||||
.select("s.name as supplierName","m.project_material_plan_no as materialPlanNo")
|
.select("s.name as supplierName","m.project_material_plan_no as materialPlanNo")
|
||||||
.leftJoin(SupplierDO.class, "s", SupplierDO::getId, PurchaseOrderNoDO::getSupplierId)
|
.leftJoin(SupplierDO.class, "s", SupplierDO::getId, PurchaseOrderNoDO::getSupplierId)
|
||||||
|
.leftJoin(PurchaseOrderNoDetailDO.class,"d", PurchaseOrderNoDetailDO::getPurchaseOrderId, PurchaseOrderNoDO::getId)
|
||||||
.leftJoin(MaterialPlanDO.class, "m", MaterialPlanDO::getId, PurchaseOrderNoDO::getProjectMaterialPlanId)
|
.leftJoin(MaterialPlanDO.class, "m", MaterialPlanDO::getId, PurchaseOrderNoDO::getProjectMaterialPlanId)
|
||||||
|
.leftJoin(AdminUserDO.class,"u", AdminUserDO::getId, PurchaseOrderNoDetailDO::getDuEmpId)
|
||||||
.disableSubLogicDel()
|
.disableSubLogicDel()
|
||||||
|
.groupBy(PurchaseOrderNoDO::getId)
|
||||||
.orderByDesc(PurchaseOrderNoDO::getCreateTime);
|
.orderByDesc(PurchaseOrderNoDO::getCreateTime);
|
||||||
query.like(!StringUtils.isEmpty(reqVO.getPurchaseNo()), PurchaseOrderDO::getPurchaseNo, reqVO.getPurchaseNo())
|
query.like(!StringUtils.isEmpty(reqVO.getPurchaseNo()), PurchaseOrderDO::getPurchaseNo, reqVO.getPurchaseNo())
|
||||||
.like(!StringUtils.isEmpty(reqVO.getSupplierName()), "s.name", reqVO.getSupplierName())
|
.like(!StringUtils.isEmpty(reqVO.getSupplierName()), "s.name", reqVO.getSupplierName())
|
||||||
@ -43,6 +48,10 @@ public interface PurchaseOrderNoMapper extends BaseMapperX<PurchaseOrderNoDO> {
|
|||||||
.eq(reqVO.getReceivingStatus() != null, PurchaseOrderNoDO::getReceivingStatus, reqVO.getReceivingStatus())
|
.eq(reqVO.getReceivingStatus() != null, PurchaseOrderNoDO::getReceivingStatus, reqVO.getReceivingStatus())
|
||||||
.eq(reqVO.getPurchaseType() != null, PurchaseOrderNoDO::getPurchaseType, reqVO.getPurchaseType())
|
.eq(reqVO.getPurchaseType() != null, PurchaseOrderNoDO::getPurchaseType, reqVO.getPurchaseType())
|
||||||
.eq(reqVO.getGoodsType() != null, PurchaseOrderNoDO::getGoodsType, reqVO.getGoodsType())
|
.eq(reqVO.getGoodsType() != null, PurchaseOrderNoDO::getGoodsType, reqVO.getGoodsType())
|
||||||
|
.like(!StringUtils.isEmpty(reqVO.getProjectName()), PurchaseOrderNoDetailDO::getProjectName, reqVO.getProjectName())
|
||||||
|
.like(!StringUtils.isEmpty(reqVO.getProjectSubName()), PurchaseOrderNoDetailDO::getName, reqVO.getProjectSubName())
|
||||||
|
.like(!StringUtils.isEmpty(reqVO.getUsername()), AdminUserDO::getNickname, reqVO.getUsername())
|
||||||
|
|
||||||
.in(reqVO.getIds() != null && !reqVO.getIds().isEmpty(),PurchaseOrderNoDO::getId,reqVO.getIds());
|
.in(reqVO.getIds() != null && !reqVO.getIds().isEmpty(),PurchaseOrderNoDO::getId,reqVO.getIds());
|
||||||
|
|
||||||
return selectPage(reqVO, query);
|
return selectPage(reqVO, query);
|
||||||
|
@ -6,11 +6,14 @@ 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.query.LambdaQueryWrapperX;
|
||||||
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial.vo.PurchaseOrderMaterialPageReqVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial.vo.PurchaseOrderMaterialPageReqVO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderboom.PurchaseOrderBoomDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderboom.PurchaseOrderBoomDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordermaterial.PurchaseOrderMaterialDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordermaterial.PurchaseOrderMaterialDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderno.PurchaseOrderNoDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordernodetail.PurchaseOrderNoDetailDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordernodetail.PurchaseOrderNoDetailDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageMaterialDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageMaterialDO;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
@ -33,16 +36,32 @@ public interface PurchaseOrderNoDetailMapper extends BaseMapperX<PurchaseOrderNo
|
|||||||
.select(" sum(ifnull(sm.storage_ok_qty,0)) as matRest")
|
.select(" sum(ifnull(sm.storage_ok_qty,0)) as matRest")
|
||||||
.select(" mp.require_amount") // sum(ifnull(mp.require_amount,0)) as requireAmount
|
.select(" mp.require_amount") // sum(ifnull(mp.require_amount,0)) as requireAmount
|
||||||
.select("min(mp.require_arrive_time) as requireArriveTime")
|
.select("min(mp.require_arrive_time) as requireArriveTime")
|
||||||
.leftJoin(PurchaseOrderDO.class, "pb", PurchaseOrderDO::getId, PurchaseOrderBoomDO::getPurchaseOrderId)
|
.leftJoin(PurchaseOrderNoDO.class, "pb", PurchaseOrderNoDO::getId, PurchaseOrderNoDetailDO::getPurchaseOrderId)
|
||||||
.leftJoin("project_material_plan_detail mp on mp.project_material_plan_id = pb.project_material_plan_id AND mp.material_id = t.material_id")
|
.leftJoin("project_material_plan_detail mp on mp.project_material_plan_id = pb.project_material_plan_id AND mp.material_id = t.material_id")
|
||||||
.leftJoin(MaterialDO.class, "mat", MaterialDO::getId, PurchaseOrderNoDetailDO::getMaterialId)
|
.leftJoin(MaterialDO.class, "mat", MaterialDO::getId, PurchaseOrderNoDetailDO::getMaterialId)
|
||||||
.leftJoin(StorageMaterialDO.class,"sm",StorageMaterialDO::getId,PurchaseOrderNoDetailDO::getMaterialId)
|
.leftJoin(StorageMaterialDO.class,"sm",StorageMaterialDO::getId,PurchaseOrderNoDetailDO::getMaterialId)
|
||||||
.disableSubLogicDel()
|
.disableSubLogicDel()
|
||||||
.groupBy(MaterialPlanDetailDO::getMaterialId)
|
.groupBy(MaterialPlanDetailDO::getMaterialId)
|
||||||
.orderByAsc(PurchaseOrderMaterialDO::getId);
|
.orderByAsc(PurchaseOrderNoDetailDO::getId);
|
||||||
query.eq(pageReqVO.getPurchaseOrderId()!=null,PurchaseOrderMaterialDO::getPurchaseOrderId, pageReqVO.getPurchaseOrderId())
|
query.eq(pageReqVO.getPurchaseOrderId()!=null,PurchaseOrderNoDetailDO::getPurchaseOrderId, pageReqVO.getPurchaseOrderId())
|
||||||
.orderByAsc(PurchaseOrderMaterialDO::getCreateTime);
|
.orderByAsc(PurchaseOrderNoDetailDO::getCreateTime);
|
||||||
|
|
||||||
return selectPage(pageReqVO, query);
|
return selectPage(pageReqVO, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<PurchaseOrderNoDetailDO> getPurchaseOrderNoDetailById(Long id){
|
||||||
|
MPJLambdaWrapper<PurchaseOrderNoDetailDO> query = new MPJLambdaWrapper<>();
|
||||||
|
|
||||||
|
query.selectAll(PurchaseOrderNoDetailDO.class)
|
||||||
|
.select("com.name as compositionName","t.purchase_rem_amount as purchaseRemAmounts","mat.code as matCode")
|
||||||
|
.leftJoin(PurchaseOrderNoDO.class, "pb", PurchaseOrderNoDO::getId, PurchaseOrderBoomDO::getPurchaseOrderId)
|
||||||
|
.leftJoin(CompositionDO.class, "com", CompositionDO::getId, PurchaseOrderNoDetailDO::getComposition)
|
||||||
|
.leftJoin(ProjectOrderSubDO.class,"sub",ProjectOrderSubDO::getId, PurchaseOrderNoDetailDO::getProjectPlanSubId)
|
||||||
|
.leftJoin(MaterialDO.class,"mat",MaterialDO::getId,PurchaseOrderNoDetailDO::getMaterialId)
|
||||||
|
.disableSubLogicDel()
|
||||||
|
.groupBy(MaterialPlanDetailDO::getId);
|
||||||
|
query.eq(PurchaseOrderMaterialDO::getPurchaseOrderId, id)
|
||||||
|
.orderByDesc(PurchaseOrderMaterialDO::getCreateTime);
|
||||||
|
return selectList(query);
|
||||||
|
}
|
||||||
}
|
}
|
@ -2,6 +2,8 @@ package com.chanko.yunxi.mes.module.heli.service.purchaseorderno;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.validation.*;
|
import javax.validation.*;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderno.vo.*;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderno.vo.*;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderno.PurchaseOrderNoDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderno.PurchaseOrderNoDO;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
@ -55,4 +57,8 @@ public interface PurchaseOrderNoService {
|
|||||||
PageResult<PurchaseOrderNoDO> getPurchaseOrderPage(PurchaseOrderNoPageReqVO pageReqVO);
|
PageResult<PurchaseOrderNoDO> getPurchaseOrderPage(PurchaseOrderNoPageReqVO pageReqVO);
|
||||||
|
|
||||||
PageResult<PurchaseOrderNoDO> getPurchaseOrderPageByStatus(PurchaseOrderNoPageReqVO pageReqVO);
|
PageResult<PurchaseOrderNoDO> getPurchaseOrderPageByStatus(PurchaseOrderNoPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
CommonResult<PurchaseOrderNoDO> isPrint(Long id);
|
||||||
|
|
||||||
|
CommonResult<Boolean> deleteForm(Long id);
|
||||||
}
|
}
|
||||||
|
@ -1,25 +1,38 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.service.purchaseorderno;
|
package com.chanko.yunxi.mes.module.heli.service.purchaseorderno;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||||
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;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.orderyf.vo.OrderYfSaveReqVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.orderyf.vo.OrderYfSaveReqVO;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorder.vo.PurchaseOrderPageReqVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorder.vo.PurchaseOrderPageReqVO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.attentiontodo.AttentiontodoDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.attentiontodo.AttentiontodoDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplan.MaterialPlanDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordermakedetail.PurchaseOrderMakeDetailDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordernodetail.PurchaseOrderNoDetailDO;
|
||||||
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.dataobject.shenhe.ShenheDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.shenhe.ShenheDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.supplier.SupplierDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.supplier.SupplierDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.attentiontodo.AttentiontodoMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.attentiontodo.AttentiontodoMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.bdgzsomthing.bdgzsomthingMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.bdgzsomthing.bdgzsomthingMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseorder.PurchaseOrderMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseorder.PurchaseOrderMapper;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseordermakedetail.PurchaseOrderMakeDetailMapper;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseordernodetail.PurchaseOrderNoDetailMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.shenhe.ShenheMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.shenhe.ShenheMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.supplier.SupplierMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.supplier.SupplierMapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.attentiontodo.AttentiontodoService;
|
import com.chanko.yunxi.mes.module.heli.service.attentiontodo.AttentiontodoService;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.orderyf.OrderYfService;
|
import com.chanko.yunxi.mes.module.heli.service.orderyf.OrderYfService;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.service.purchaseordermakedetail.PurchaseOrderMakeDetailService;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.serialnumber.SerialNumberService;
|
import com.chanko.yunxi.mes.module.heli.service.serialnumber.SerialNumberService;
|
||||||
import com.chanko.yunxi.mes.module.system.api.user.AdminUserApi;
|
import com.chanko.yunxi.mes.module.system.api.user.AdminUserApi;
|
||||||
|
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
|
import com.chanko.yunxi.mes.module.system.service.user.AdminUserService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@ -67,8 +80,14 @@ public class PurchaseOrderNoServiceImpl implements PurchaseOrderNoService {
|
|||||||
private AttentiontodoMapper attentiontodoMapper;
|
private AttentiontodoMapper attentiontodoMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private AttentiontodoService attentiontodoService;
|
private AttentiontodoService attentiontodoService;
|
||||||
|
@Autowired
|
||||||
|
private PurchaseOrderMakeDetailMapper purchaseOrderMakeDetailMapper;
|
||||||
|
@Autowired
|
||||||
|
private PurchaseOrderNoDetailMapper purchaseOrderNoDetailMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private com.chanko.yunxi.mes.module.heli.dal.mysql.bdgzsomthing.bdgzsomthingMapper bdgzsomthingMapper;
|
private com.chanko.yunxi.mes.module.heli.dal.mysql.bdgzsomthing.bdgzsomthingMapper bdgzsomthingMapper;
|
||||||
|
@Resource
|
||||||
|
private AdminUserService adminUserService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createPurchaseOrderNo(PurchaseOrderNoSaveReqVO createReqVO) {
|
public Long createPurchaseOrderNo(PurchaseOrderNoSaveReqVO createReqVO) {
|
||||||
@ -242,4 +261,40 @@ public class PurchaseOrderNoServiceImpl implements PurchaseOrderNoService {
|
|||||||
return purchaseOrderNoMapper.getPurchaseOrderPageByStatus(pageReqVO);
|
return purchaseOrderNoMapper.getPurchaseOrderPageByStatus(pageReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<PurchaseOrderNoDO> isPrint(Long id) {
|
||||||
|
PurchaseOrderNoDO purchaseOrderNoDO = purchaseOrderNoMapper.selectById(id);
|
||||||
|
if (ObjectUtil.isNotEmpty(purchaseOrderNoDO)){
|
||||||
|
AdminUserDO user = adminUserService.getUser(getLoginUser().getId());
|
||||||
|
purchaseOrderNoDO.setUsername(user.getNickname());
|
||||||
|
purchaseOrderNoDO.setUserMobile(user.getMobile());
|
||||||
|
SupplierDO supplierDO = supplierMapper.selectById(purchaseOrderNoDO.getSupplierId());
|
||||||
|
purchaseOrderNoDO.setSupplierName(supplierDO.getName());
|
||||||
|
purchaseOrderNoDO.setContactName(supplierDO.getContact1Name());
|
||||||
|
purchaseOrderNoDO.setContactMobile(supplierDO.getContact1Method());
|
||||||
|
List<PurchaseOrderNoDetailDO> detailList = purchaseOrderNoDetailMapper.getPurchaseOrderNoDetailById(id);
|
||||||
|
purchaseOrderNoDO.setPurchaseOrderNoDetailList(detailList);
|
||||||
|
}
|
||||||
|
return CommonResult.success(purchaseOrderNoDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<Boolean> deleteForm(Long id) {
|
||||||
|
PurchaseOrderNoDO purchaseOrderNoDO = purchaseOrderNoMapper.selectById(id);
|
||||||
|
if (purchaseOrderNoDO.getReceivingStatus()!=1) {
|
||||||
|
return CommonResult.error(400,"该订单已收货,请确认!");
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<PurchaseOrderNoDetailDO> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper1.eq(PurchaseOrderNoDetailDO::getPurchaseOrderId, id);
|
||||||
|
purchaseOrderNoDetailMapper.delete(queryWrapper1);
|
||||||
|
purchaseOrderNoMapper.deleteById(id);
|
||||||
|
LambdaUpdateWrapper<PurchaseOrderMakeDetailDO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
lambdaUpdateWrapper.eq(PurchaseOrderMakeDetailDO::getPurchaseOrderNoId, id);
|
||||||
|
lambdaUpdateWrapper.set(PurchaseOrderMakeDetailDO::getPurchaseOrderNoId, null);
|
||||||
|
lambdaUpdateWrapper.set(PurchaseOrderMakeDetailDO::getPurchaseOrderNoDetailId,null);
|
||||||
|
lambdaUpdateWrapper.set(PurchaseOrderMakeDetailDO::getOrderStatus,1);
|
||||||
|
purchaseOrderMakeDetailMapper.update(lambdaUpdateWrapper);
|
||||||
|
return CommonResult.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,8 @@ package com.chanko.yunxi.mes.module.heli.service.purchaseordernodetail;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.validation.*;
|
import javax.validation.*;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordernodetail.vo.*;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordernodetail.vo.*;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordernodetail.PurchaseOrderNoDetailDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordernodetail.PurchaseOrderNoDetailDO;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
@ -52,4 +54,9 @@ public interface PurchaseOrderNoDetailService {
|
|||||||
*/
|
*/
|
||||||
PageResult<PurchaseOrderNoDetailDO> getPurchaseOrderNoDetailPage(PurchaseOrderNoDetailPageReqVO pageReqVO);
|
PageResult<PurchaseOrderNoDetailDO> getPurchaseOrderNoDetailPage(PurchaseOrderNoDetailPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
List<PurchaseOrderNoDetailDO> getPurchaseOrderNoDetailById(Long id);
|
||||||
|
|
||||||
|
CommonResult<Boolean> verification(List<PurchaseOrderNoDetailDO> list);
|
||||||
|
|
||||||
|
CommonResult<Boolean> receiveGoods(List<PurchaseOrderNoDetailDO> list);
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,27 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.service.purchaseordernodetail;
|
package com.chanko.yunxi.mes.module.heli.service.purchaseordernodetail;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.exception.ErrorCode;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.procedure.ProcedureDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.material.MaterialMapper;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.materialplan.MaterialPlanMapper;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.materialplanboom.MaterialPlanBoomMapper;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.materialplandetail.MaterialPlanDetailMapper;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomDetailMapper;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomMapper;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.service.procedure.ProcedureService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordernodetail.vo.*;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordernodetail.vo.*;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordernodetail.PurchaseOrderNoDetailDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordernodetail.PurchaseOrderNoDetailDO;
|
||||||
@ -15,6 +32,7 @@ import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseordernodetail.PurchaseOrderNoDetailMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseordernodetail.PurchaseOrderNoDetailMapper;
|
||||||
|
|
||||||
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
||||||
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -28,6 +46,16 @@ public class PurchaseOrderNoDetailServiceImpl implements PurchaseOrderNoDetailSe
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private PurchaseOrderNoDetailMapper purchaseOrderNoDetailMapper;
|
private PurchaseOrderNoDetailMapper purchaseOrderNoDetailMapper;
|
||||||
|
@Resource
|
||||||
|
private ProcessBomDetailMapper processBomDetailMapper;
|
||||||
|
@Resource
|
||||||
|
private MaterialPlanBoomMapper materialPlanBoomMapper;
|
||||||
|
@Resource
|
||||||
|
private ProcedureService procedureService;
|
||||||
|
@Resource
|
||||||
|
private MaterialMapper materialMapper;
|
||||||
|
@Resource
|
||||||
|
private ProcessBomMapper pocessBomMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createPurchaseOrderNoDetail(PurchaseOrderNoDetailSaveReqVO createReqVO) {
|
public Long createPurchaseOrderNoDetail(PurchaseOrderNoDetailSaveReqVO createReqVO) {
|
||||||
@ -71,4 +99,71 @@ public class PurchaseOrderNoDetailServiceImpl implements PurchaseOrderNoDetailSe
|
|||||||
return purchaseOrderNoDetailMapper.selectPage(pageReqVO);
|
return purchaseOrderNoDetailMapper.selectPage(pageReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PurchaseOrderNoDetailDO> getPurchaseOrderNoDetailById(Long id) {
|
||||||
|
return purchaseOrderNoDetailMapper.getPurchaseOrderNoDetailById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<Boolean> verification(List<PurchaseOrderNoDetailDO> list) {
|
||||||
|
for (PurchaseOrderNoDetailDO purchaseOrderNoDetailDO : list) {
|
||||||
|
PurchaseOrderNoDetailDO byId = purchaseOrderNoDetailMapper.selectById(purchaseOrderNoDetailDO.getId());
|
||||||
|
if (ObjectUtil.isNotEmpty(byId)){
|
||||||
|
if (BigDecimal.ZERO.compareTo(byId.getPurchaseRemAmount())>=0) throw exception(new ErrorCode(1_006_9999,"该订单零件名称"+byId.getBoomName()+"剩余数量等于0,请确认!"));
|
||||||
|
if (byId.getReceivingStatus()!=1) throw exception(new ErrorCode(1_006_9999,"该订单零件名称"+byId.getBoomName()+"已收货,请确认!"));
|
||||||
|
if (byId.getPurchaseRemAmount().compareTo(purchaseOrderNoDetailDO.getPurchaseRemAmounts())<0) {
|
||||||
|
throw exception(new ErrorCode(1_006_9999,"该订单零件名称"+byId.getBoomName()+"入库数量"+purchaseOrderNoDetailDO.getPurchaseRemAmounts()+"大于剩余数量"+byId.getPurchaseRemAmount()+"请确认!"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<Boolean> receiveGoods(List<PurchaseOrderNoDetailDO> list) {
|
||||||
|
List<MaterialDO> materialDOList=new ArrayList<MaterialDO>();
|
||||||
|
for (PurchaseOrderNoDetailDO detailDO : list) {
|
||||||
|
PurchaseOrderNoDetailDO byId = purchaseOrderNoDetailMapper.selectById(detailDO.getId());
|
||||||
|
if (ObjectUtil.isNotEmpty(byId)){
|
||||||
|
if (byId.getPurchaseRemAmount().compareTo(detailDO.getPurchaseRemAmounts())==0){
|
||||||
|
byId.setReceivingStatus(3);
|
||||||
|
}else {
|
||||||
|
byId.setReceivingStatus(2);
|
||||||
|
}
|
||||||
|
byId.setPurchaseRemAmount(byId.getPurchaseRemAmount().subtract(detailDO.getPurchaseRemAmounts()));
|
||||||
|
purchaseOrderNoDetailMapper.updateById(byId);
|
||||||
|
ProcessBomDetailDO bomDetailDO = processBomDetailMapper.selectById(detailDO.getBoomDetailId());
|
||||||
|
if (ObjectUtil.isNotEmpty(bomDetailDO)){
|
||||||
|
String bomCode="";
|
||||||
|
String blueprintNo="";
|
||||||
|
String ProcedureName="";
|
||||||
|
MaterialDO materialDO = new MaterialDO();
|
||||||
|
materialDO.setUnit(bomDetailDO.getUnit());
|
||||||
|
materialDO.setSpec(bomDetailDO.getSpec());
|
||||||
|
materialDO.setName(bomDetailDO.getMaterialName());
|
||||||
|
ProcessBomDO processBomDO = pocessBomMapper.selectById(bomDetailDO.getBomId());
|
||||||
|
if (ObjectUtil.isNotEmpty(processBomDO)){
|
||||||
|
bomCode=processBomDO.getCode();
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(bomDetailDO.getBlueprintNo())){
|
||||||
|
blueprintNo=bomDetailDO.getBlueprintNo();
|
||||||
|
}
|
||||||
|
MaterialPlanBoomDO boomDO = materialPlanBoomMapper.selectById(detailDO.getProjectMaterialPlanBoomId());
|
||||||
|
if (ObjectUtil.isNotEmpty(boomDO)){
|
||||||
|
ProcedureDO procedure = procedureService.getProcedure(boomDO.getProcedureId());
|
||||||
|
if (ObjectUtil.isNotEmpty(procedure)){
|
||||||
|
ProcedureName=procedure.getName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
materialDO.setCode(bomCode+blueprintNo+ProcedureName);
|
||||||
|
materialDO.setCompositionId(bomDetailDO.getCompositionId());
|
||||||
|
materialDO.setMaterialType("1");
|
||||||
|
materialDOList.add(materialDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
materialMapper.insertBatch(materialDOList);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -63,3 +63,12 @@ export const getPurchaseOrderNoPageByStatus = async (params) => {
|
|||||||
export const updateReceivingStatus = async (id: number) => {
|
export const updateReceivingStatus = async (id: number) => {
|
||||||
return await request.put({ url: `/heli/purchase-order/updateRSById?id=` + id })
|
return await request.put({ url: `/heli/purchase-order/updateRSById?id=` + id })
|
||||||
}
|
}
|
||||||
|
// 删除
|
||||||
|
export const deleteForm = async (id: number) => {
|
||||||
|
return await request.delete({ url: `/heli/purchase-order-no/deleteForm?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打印接口
|
||||||
|
export const isPrint = async (id: number) => {
|
||||||
|
return await request.get({ url: `/heli/purchase-order-no/isPrint?id=` + id })
|
||||||
|
}
|
||||||
|
@ -64,3 +64,12 @@ export const deletePurchaseOrderNoDetail = async (id: number) => {
|
|||||||
export const exportPurchaseOrderNoDetail = async (params) => {
|
export const exportPurchaseOrderNoDetail = async (params) => {
|
||||||
return await request.download({ url: `/heli/purchase-order-no-detail/export-excel`, params })
|
return await request.download({ url: `/heli/purchase-order-no-detail/export-excel`, params })
|
||||||
}
|
}
|
||||||
|
export const getPurchaseOrderNoDetailById = async (id: number) => {
|
||||||
|
return await request.get({ url: `/heli/purchase-order-no-detail/getPurchaseOrderNoDetailById?id=` + id })
|
||||||
|
}
|
||||||
|
export const verification = async (data) => {
|
||||||
|
return await request.post({ url: `/heli/purchase-order-no-detail/verification`, data })
|
||||||
|
}
|
||||||
|
export const receiveGoods= async (data) => {
|
||||||
|
return await request.post({ url: `/heli/purchase-order-no-detail/receiveGoods`, data })
|
||||||
|
}
|
||||||
|
@ -283,7 +283,6 @@ export enum DICT_TYPE {
|
|||||||
HELI_MATERIAL_PLAN_BOOM_STATUS = 'heli_material_plan_boom_status',//物料需求计划标准件状态
|
HELI_MATERIAL_PLAN_BOOM_STATUS = 'heli_material_plan_boom_status',//物料需求计划标准件状态
|
||||||
HELI_MAT_TYPE = 'heli_mat_type',//物料需求计划类型
|
HELI_MAT_TYPE = 'heli_mat_type',//物料需求计划类型
|
||||||
HELI_PROJECT_MATERIAL_PLAN_BOOM_STATUS='heli_project_material_plan_boom_status',//物料需求计划Boon状态
|
HELI_PROJECT_MATERIAL_PLAN_BOOM_STATUS='heli_project_material_plan_boom_status',//物料需求计划Boon状态
|
||||||
PART_PURCHASE_STATUS='part_purchase_status'
|
PART_PURCHASE_STATUS='part_purchase_status',
|
||||||
|
HELI_IS_PRINT='heli_is_print'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -267,7 +267,7 @@ const submitForm = async () => {
|
|||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("提交失败:", error);
|
console.error("提交失败:", error);
|
||||||
message.error(`操作失败: ${error.message || "未知错误"}`);
|
// message.error(`操作失败: ${error.message || "未知错误"}`);
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false;
|
formLoading.value = false;
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,7 @@ const submitForm = async () => {
|
|||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("提交失败:", error);
|
console.error("提交失败:", error);
|
||||||
message.error(`操作失败: ${error.message || "未知错误"}`);
|
// message.error(`操作失败: ${error.message || "未知错误"}`);
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false;
|
formLoading.value = false;
|
||||||
}
|
}
|
||||||
|
@ -147,6 +147,7 @@ const submitForm = () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
|
multipleSelection.value.forEach(item =>item.projectMaterialPlanBoomId=item.id)
|
||||||
multipleSelection.value.forEach(item => item.id = undefined)
|
multipleSelection.value.forEach(item => item.id = undefined)
|
||||||
// 发送操作成功的事件
|
// 发送操作成功的事件
|
||||||
emit('success', multipleSelection.value)
|
emit('success', multipleSelection.value)
|
||||||
|
@ -0,0 +1,220 @@
|
|||||||
|
<template>
|
||||||
|
<el-card class="hl-card" style="position: relative">
|
||||||
|
<template #header>
|
||||||
|
<span>详情页</span>
|
||||||
|
</template>
|
||||||
|
<el-form ref="formRef" :model="formData" label-width="160px" v-loading="formLoading">
|
||||||
|
<!-- 基础信息 -->
|
||||||
|
<el-card class="hl-card-info">
|
||||||
|
<template #header>
|
||||||
|
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">基础信息</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-row>
|
||||||
|
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="采购单号" prop="purchaseNo">
|
||||||
|
<el-input class="!w-300px" placeholder="系统自动生成" v-model="formData.purchaseNo" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="供应商" prop="supplierName">
|
||||||
|
<el-input class="!w-300px" placeholder="供应商" v-model="formData.supplierName" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 采购单信息 -->
|
||||||
|
<el-card class="hl-card-info">
|
||||||
|
<template #header>
|
||||||
|
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">采购单信息</span>
|
||||||
|
</template>
|
||||||
|
<el-row>
|
||||||
|
<el-col>
|
||||||
|
<el-card class="hl-incard">
|
||||||
|
<el-form ref="multipleTable" :model="formData.list" :rules="subMatPlanFormRules" v-loading="loading" label-width="0">
|
||||||
|
<el-table :data="formData.list" class="hl-table" @selection-change="handleSelectionChange" >
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column prop="projectSubCode" min-width="150" label="子项目编码" align="center"/>
|
||||||
|
<el-table-column prop="boomName" min-width="120" label="零件名称" align="center"/>
|
||||||
|
<el-table-column prop="compositionName" min-width="100" label="材质" align="center"/>
|
||||||
|
<el-table-column prop="purchaseAmount" min-width="100" label="采购数量" align="center" />
|
||||||
|
<el-table-column prop="purchaseRemAmount" min-width="100" label="剩余数量" align="center"/>
|
||||||
|
<el-table-column prop="purchaseAmount" min-width="180" align="center">
|
||||||
|
<template #header><span class="hl-table_header">*</span>入库数量</template>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-form-item :prop="`${scope.$index}.purchaseRemAmounts`" :rules="subMatPlanFormRules.purchaseRemAmounts" class="mb-0px!">
|
||||||
|
<el-input-number style="width: 100%" v-model="scope.row.purchaseRemAmounts" placeholder="入库数量" :min="0" :precision="2" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="requireTime" min-width="150" label="需要完成日期" align="center" :formatter="dateFormatter1"/>
|
||||||
|
<el-table-column prop="arriveTime" min-width="150" label="预计到货日期" align="center" :formatter="dateFormatter1" />
|
||||||
|
<el-table-column prop="description" min-width="150" label="技术要求" align="center"/>
|
||||||
|
<el-table-column prop="theWeight" min-width="100" label="理论重量" align="center"/>
|
||||||
|
<el-table-column prop="estimatedPrice" min-width="150" label="预估总价(元)" align="center"/>
|
||||||
|
</el-table>
|
||||||
|
</el-form>
|
||||||
|
<!-- <Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"-->
|
||||||
|
<!-- @pagination="getList" />-->
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
</el-form>
|
||||||
|
<div class="hl-footer text-center">
|
||||||
|
<el-button @click="receiveGoods()" type="primary" size="large" >收货</el-button>
|
||||||
|
<el-button @click="isPrint()" type="primary" size="large" >打印</el-button>
|
||||||
|
<el-button @click="deleteForm()" type="danger" size="large" >删除</el-button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:物料列表 -->
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import * as MaterialPlanApi from '@/api/heli/materialplan'
|
||||||
|
import * as MaterialPlanDetailApi from '@/api/heli/materialplandetail'
|
||||||
|
import * as MaterialPlanBoomApi from '@/api/heli/materialplanboom'
|
||||||
|
import {ElTable, UploadUserFile} from 'element-plus'
|
||||||
|
import * as PlanApi from '@/api/heli/plan'
|
||||||
|
import * as PlanSubApi from '@/api/heli/plansub'
|
||||||
|
import * as ProjectOrderApi from '@/api/heli/projectorder'
|
||||||
|
import * as UserApi from '@/api/system/user'
|
||||||
|
import * as MaterialApi from '@/api/heli/material'
|
||||||
|
import { deleteFile, downloadFile, getFilePage } from '@/api/infra/file'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import { getAccessToken, getTenantId } from '@/utils/auth'
|
||||||
|
import {dateFormatter, dateFormatter1, formatDate} from '@/utils/formatTime'
|
||||||
|
import { useUserStore } from '@/store/modules/user'
|
||||||
|
import { useTagsViewStore } from '@/store/modules/tagsView'
|
||||||
|
import MaterialSelect from '@/views/heli/hlvuestyle/materialSelect.vue'
|
||||||
|
import booms from './boom.vue'
|
||||||
|
|
||||||
|
const reload: any = inject('reload')
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { query } = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
|
const tagsViewStore = useTagsViewStore()
|
||||||
|
import * as PurchaseOrderNoApi from '@/api/heli/purchaseorderno'
|
||||||
|
import * as PurchaseOrderNoDetailApi from '@/api/heli/purchaseordernodetail'
|
||||||
|
import {PurchaseOrderNoDetailVO} from "@/api/heli/purchaseordernodetail";
|
||||||
|
import {ref} from "vue";
|
||||||
|
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formData = ref({
|
||||||
|
id: undefined,
|
||||||
|
purchaseNo: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
projectPlanId: undefined,
|
||||||
|
projectPlanNo: undefined,
|
||||||
|
projectCode: undefined,
|
||||||
|
auditor: undefined,
|
||||||
|
createTime: new Date(),
|
||||||
|
status: undefined,
|
||||||
|
description: undefined,
|
||||||
|
boomItemDOList: [],
|
||||||
|
boomItemRemoveList: [],
|
||||||
|
matBoomDOList: [],
|
||||||
|
matItemRemoveList: [],
|
||||||
|
attachments: [],
|
||||||
|
supplierName:undefined,
|
||||||
|
list:[]
|
||||||
|
})
|
||||||
|
const subMatPlanFormRules = reactive({
|
||||||
|
purchaseRemAmounts: [{ required: true, message: '入库数量不能为空', trigger: 'blur' }]})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
const subFormRef = ref() // 表单 Ref
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const subBoomFormLoading = ref(false)
|
||||||
|
const subBoomFormRef = ref()
|
||||||
|
|
||||||
|
|
||||||
|
const multipleTable = ref<InstanceType<typeof ElTable>>()
|
||||||
|
|
||||||
|
const handleSelectionChange = (val) => {
|
||||||
|
// multipleTable.value.clearSelection()
|
||||||
|
multipleTable.value=val
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const closeForm = async () => {
|
||||||
|
router.push({ path: '/purchase/purchaseorderno' })
|
||||||
|
tagsViewStore.delVisitedView(router.currentRoute.value)
|
||||||
|
}
|
||||||
|
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||||
|
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
projectMaterialPlanId: query.id
|
||||||
|
})
|
||||||
|
// 页面数据加载初始化
|
||||||
|
onMounted(async () => {
|
||||||
|
// 获取物料需求计划信息
|
||||||
|
formData.value = await PurchaseOrderNoApi.getPurchaseOrderNo(query.id)
|
||||||
|
getList();
|
||||||
|
})
|
||||||
|
const isPrint = async () => {
|
||||||
|
var newVar = await PurchaseOrderNoApi.isPrint(query.id);
|
||||||
|
console.log(newVar)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
const deleteForm = async () => {
|
||||||
|
await PurchaseOrderNoApi.deleteForm(query.id)
|
||||||
|
router.push({ path: '/purchase/purchaseorderno' })
|
||||||
|
tagsViewStore.delVisitedView(router.currentRoute.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
const receiveGoods = async () => {
|
||||||
|
try {
|
||||||
|
|
||||||
|
const list = multipleTable.value|| []; // 安全获取数据
|
||||||
|
// 1. 检查空数据
|
||||||
|
if (!list || list.length==null||list.length==0) {
|
||||||
|
message.error("采购单信息未选择,请确认");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await PurchaseOrderNoDetailApi.verification(list)
|
||||||
|
loading.value = true;
|
||||||
|
const res = await Promise.race([
|
||||||
|
PurchaseOrderNoDetailApi.receiveGoods(list),
|
||||||
|
new Promise((_, reject) =>
|
||||||
|
setTimeout(() => reject(new Error("请求超时")), 30000)
|
||||||
|
)
|
||||||
|
]);
|
||||||
|
|
||||||
|
message.success("收货成功");
|
||||||
|
getList(); // 确保刷新完成
|
||||||
|
emit('success');
|
||||||
|
} catch (error) {
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await PurchaseOrderNoDetailApi.getPurchaseOrderNoDetailById(query.id)
|
||||||
|
formData.value.list = data
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
@ -0,0 +1,290 @@
|
|||||||
|
<template>
|
||||||
|
<el-card class="hl-card">
|
||||||
|
<template #header>
|
||||||
|
<span>零件采购订单管理</span>
|
||||||
|
</template>
|
||||||
|
<ContentWrap class="borderxx">
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="120px">
|
||||||
|
<el-form-item label="采购单号" prop="purchaseNo">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.purchaseNo" 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="projectSubName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.projectSubName" placeholder="子项目名称" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="供应商" prop="supplierName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.supplierName" placeholder="供应商" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="责任人" prop="username">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.username" placeholder="责任人" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="收货状态" prop="receivingStatus">
|
||||||
|
<el-select v-model="queryParams.receivingStatus" placeholder="下拉选择" clearable class="!w-240px">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PURCHASE_RECEIVING_STATUS)" :key="dict.value"
|
||||||
|
:label="dict.label" :value="dict.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item style="margin-left:50px">
|
||||||
|
<el-button @click="handleQuery" type="primary">
|
||||||
|
<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="success" plain @click="handleExportWithTax()" v-hasPermi="['heli:purchase-order:create']">
|
||||||
|
<Icon icon="ep:upload" class="mr-5px" /> 乘税率导出
|
||||||
|
</el-button>
|
||||||
|
<el-button type="success" plain @click="handleExport()" v-hasPermi="['heli:purchase-order:create']">
|
||||||
|
<Icon icon="ep:upload" 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" class="hl-table"
|
||||||
|
@selection-change="handleSelectionChange" @row-click="clickRow" selection>
|
||||||
|
<el-table-column fixed label="序号" type="index" align="center" width="60" />
|
||||||
|
<el-table-column label="采购单号" align="center" prop="purchaseNo" fixed min-width="190">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link type="primary" @click="openForm('detail', scope.row.id)">
|
||||||
|
{{ scope.row.purchaseNo }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="采购订单类型" align="center" prop="goodsType" min-width="180">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.HELI_PROJECT_PURCHASE_GOODS_TYPE" :value="scope.row.goodsType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="供应商" align="center" min-width="180" prop="supplierName" />
|
||||||
|
<el-table-column label="是否打印" align="center" min-width="180" prop="isPrint" >
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.HELI_IS_PRINT" :value="scope.row.isPrint" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="收货状态" align="center" prop="receivingStatus" fixed="right" min-width="180">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.HELI_PURCHASE_RECEIVING_STATUS" :value="scope.row.receivingStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" fixed="right" min-width="200">
|
||||||
|
<template #header>
|
||||||
|
<span style="margin-right: 30%">操作</span>
|
||||||
|
</template>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link type="primary" @click="openForm('detail', scope.row.id)">
|
||||||
|
查看详情
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination
|
||||||
|
:total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import * as PurchaseOrderApi from '@/api/heli/purchaseorder'
|
||||||
|
import * as PurchaseOrderNoApi from '@/api/heli/purchaseorderno'
|
||||||
|
import { ElTable } from 'element-plus'
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import {useUserStore} from "@/store/modules/user";
|
||||||
|
|
||||||
|
defineOptions({ name: 'PurchaseOrder' })
|
||||||
|
const userStore = useUserStore()
|
||||||
|
const username = userStore.getUser.nickname
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const router = useRouter()
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
id: undefined,
|
||||||
|
ids: undefined,
|
||||||
|
purchaseNo: undefined,
|
||||||
|
supplierId: undefined,
|
||||||
|
contractNo: undefined,
|
||||||
|
purchaseType: undefined,
|
||||||
|
projectMaterialPlanId: undefined,
|
||||||
|
goodsType: 2,
|
||||||
|
currencyType: undefined,
|
||||||
|
taxRatio: undefined,
|
||||||
|
estimatedPrice: undefined,
|
||||||
|
actualPrice: undefined,
|
||||||
|
status: undefined,
|
||||||
|
submitUserId: undefined,
|
||||||
|
submitTime: [],
|
||||||
|
auditor: undefined,
|
||||||
|
auditTime: [],
|
||||||
|
description: undefined,
|
||||||
|
creator: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
receivingStatus:1,
|
||||||
|
projectName:undefined,
|
||||||
|
projectSubName:undefined,
|
||||||
|
username:username,
|
||||||
|
supplierName:undefined
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
queryParams.ids = undefined
|
||||||
|
const data = await PurchaseOrderNoApi.getPurchaseOrderNoPage(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 multipleTable: any = ref<InstanceType<typeof ElTable>>()
|
||||||
|
const multipleSelection: any = ref([])
|
||||||
|
|
||||||
|
const handleSelectionChange = (val: PurchaseOrderApi.PurchaseOrderVO[]) => {
|
||||||
|
multipleSelection.value = val
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const clickRow = (row: any) => {
|
||||||
|
if (multipleTable.value) { // 检查 multipleTable 是否已初始化
|
||||||
|
if (row) {
|
||||||
|
multipleTable.value.toggleRowSelection(row, undefined);
|
||||||
|
} else {
|
||||||
|
multipleTable.value.clearSelection();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.error("multipleTable is not initialized."); // 添加错误日志
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// const clickRow = (row: any) => {
|
||||||
|
// if (row) {
|
||||||
|
// multipleTable.value!.toggleRowSelection(row, undefined)
|
||||||
|
// } else {
|
||||||
|
// multipleTable.value!.clearSelection()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
/** 添加/修改操作 */
|
||||||
|
const openForm = (type: string, id?: number) => {
|
||||||
|
switch (type) {
|
||||||
|
case 'create':
|
||||||
|
router.push({ path: '/purchase/purchaseorderadd', query: { id: id } })
|
||||||
|
break
|
||||||
|
case 'edit':
|
||||||
|
router.push({ path: '/purchase/purchaseorderedit', query: { id: id } })
|
||||||
|
break
|
||||||
|
case 'detail':
|
||||||
|
router.push({ path: '/purchase/purchaseordernodetail', query: { id: id } })
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改收货状态按钮操作 */
|
||||||
|
const editReceivingStatus = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 提示用户是否保存入库信息
|
||||||
|
await message.confirm('确认完成收货?')
|
||||||
|
// 发起修改
|
||||||
|
await PurchaseOrderApi.updateReceivingStatus(id)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await PurchaseOrderApi.deletePurchaseOrder(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
const getIds = async () => {
|
||||||
|
queryParams.ids = []
|
||||||
|
multipleSelection.value.forEach(item => {
|
||||||
|
queryParams.ids.push(item.id)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
await getIds()
|
||||||
|
const data = await PurchaseOrderApi.exportPurchaseOrder(queryParams)
|
||||||
|
download.excel(data, '采购订单(直接导出).xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const handleExportWithTax = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
await getIds()
|
||||||
|
const data = await PurchaseOrderApi.exportPurchaseOrderWithTax(queryParams)
|
||||||
|
download.excel(data, '采购订单(乘税率导出).xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted( () => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
@ -0,0 +1,268 @@
|
|||||||
|
<template>
|
||||||
|
<el-card class="hl-card">
|
||||||
|
<template #header>
|
||||||
|
<span>采购订单管理</span>
|
||||||
|
</template>
|
||||||
|
<ContentWrap class="borderxx">
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="120px">
|
||||||
|
<el-form-item label="采购单号" prop="purchaseNo">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.purchaseNo" 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="projectSubName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.projectSubName" placeholder="子项目名称" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="供应商" prop="supplierName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.supplierName" placeholder="供应商" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item style="margin-left:50px">
|
||||||
|
<el-button @click="handleQuery" type="primary">
|
||||||
|
<Icon icon="ep:search" class="mr-5px" /> 搜索
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="resetQuery">
|
||||||
|
<Icon icon="ep:refresh" 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" class="hl-table"
|
||||||
|
@selection-change="handleSelectionChange" @row-click="clickRow" selection>
|
||||||
|
<el-table-column fixed label="序号" type="index" align="center" width="60" />
|
||||||
|
<el-table-column label="采购单号" align="center" prop="purchaseNo" fixed min-width="190">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link type="primary" @click="openForm('detail', scope.row.id)">
|
||||||
|
{{ scope.row.purchaseNo }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="采购订单类型" align="center" prop="goodsType" min-width="180">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.HELI_PROJECT_PURCHASE_GOODS_TYPE" :value="scope.row.goodsType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="供应商" align="center" min-width="180" prop="supplierName" />
|
||||||
|
<el-table-column label="是否打印" align="center" min-width="180" prop="isPrint" >
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.HELI_IS_PRINT" :value="scope.row.isPrint" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="收货状态" align="center" prop="receivingStatus" fixed="right" min-width="180">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.HELI_PURCHASE_RECEIVING_STATUS" :value="scope.row.receivingStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" fixed="right" min-width="200">
|
||||||
|
<template #header>
|
||||||
|
<span style="margin-right: 30%">操作</span>
|
||||||
|
</template>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link type="primary" @click="openForm('detail', scope.row.id)">
|
||||||
|
查看详情
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination
|
||||||
|
:total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import * as PurchaseOrderApi from '@/api/heli/purchaseorder'
|
||||||
|
import * as PurchaseOrderNoApi from '@/api/heli/purchaseorderno'
|
||||||
|
import { ElTable } from 'element-plus'
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import {useUserStore} from "@/store/modules/user";
|
||||||
|
|
||||||
|
defineOptions({ name: 'PurchaseOrder' })
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const router = useRouter()
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
id: undefined,
|
||||||
|
ids: undefined,
|
||||||
|
purchaseNo: undefined,
|
||||||
|
supplierId: undefined,
|
||||||
|
contractNo: undefined,
|
||||||
|
purchaseType: undefined,
|
||||||
|
projectMaterialPlanId: undefined,
|
||||||
|
goodsType: 1,
|
||||||
|
currencyType: undefined,
|
||||||
|
taxRatio: undefined,
|
||||||
|
estimatedPrice: undefined,
|
||||||
|
actualPrice: undefined,
|
||||||
|
status: undefined,
|
||||||
|
submitUserId: undefined,
|
||||||
|
submitTime: [],
|
||||||
|
auditor: undefined,
|
||||||
|
auditTime: [],
|
||||||
|
description: undefined,
|
||||||
|
creator: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
projectName:undefined,
|
||||||
|
projectSubName:undefined,
|
||||||
|
supplierName:undefined
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
queryParams.ids = undefined
|
||||||
|
const data = await PurchaseOrderNoApi.getPurchaseOrderNoPage(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 multipleTable: any = ref<InstanceType<typeof ElTable>>()
|
||||||
|
const multipleSelection: any = ref([])
|
||||||
|
|
||||||
|
const handleSelectionChange = (val: PurchaseOrderApi.PurchaseOrderVO[]) => {
|
||||||
|
multipleSelection.value = val
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const clickRow = (row: any) => {
|
||||||
|
if (multipleTable.value) { // 检查 multipleTable 是否已初始化
|
||||||
|
if (row) {
|
||||||
|
multipleTable.value.toggleRowSelection(row, undefined);
|
||||||
|
} else {
|
||||||
|
multipleTable.value.clearSelection();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.error("multipleTable is not initialized."); // 添加错误日志
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// const clickRow = (row: any) => {
|
||||||
|
// if (row) {
|
||||||
|
// multipleTable.value!.toggleRowSelection(row, undefined)
|
||||||
|
// } else {
|
||||||
|
// multipleTable.value!.clearSelection()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
/** 添加/修改操作 */
|
||||||
|
const openForm = (type: string, id?: number) => {
|
||||||
|
switch (type) {
|
||||||
|
case 'create':
|
||||||
|
router.push({ path: '/purchase/purchaseorderadd', query: { id: id } })
|
||||||
|
break
|
||||||
|
case 'edit':
|
||||||
|
router.push({ path: '/purchase/purchaseorderedit', query: { id: id } })
|
||||||
|
break
|
||||||
|
case 'detail':
|
||||||
|
router.push({ path: '/purchase/purchaseordernomanagementdetail', query: { id: id } })
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改收货状态按钮操作 */
|
||||||
|
const editReceivingStatus = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 提示用户是否保存入库信息
|
||||||
|
await message.confirm('确认完成收货?')
|
||||||
|
// 发起修改
|
||||||
|
await PurchaseOrderApi.updateReceivingStatus(id)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await PurchaseOrderApi.deletePurchaseOrder(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
const getIds = async () => {
|
||||||
|
queryParams.ids = []
|
||||||
|
multipleSelection.value.forEach(item => {
|
||||||
|
queryParams.ids.push(item.id)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
await getIds()
|
||||||
|
const data = await PurchaseOrderApi.exportPurchaseOrder(queryParams)
|
||||||
|
download.excel(data, '采购订单(直接导出).xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const handleExportWithTax = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
await getIds()
|
||||||
|
const data = await PurchaseOrderApi.exportPurchaseOrderWithTax(queryParams)
|
||||||
|
download.excel(data, '采购订单(乘税率导出).xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted( () => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
@ -0,0 +1,183 @@
|
|||||||
|
<template>
|
||||||
|
<el-card class="hl-card" style="position: relative">
|
||||||
|
<template #header>
|
||||||
|
<span>详情页</span>
|
||||||
|
</template>
|
||||||
|
<el-form ref="formRef" :model="formData" label-width="160px" v-loading="formLoading">
|
||||||
|
<!-- 基础信息 -->
|
||||||
|
<el-card class="hl-card-info">
|
||||||
|
<template #header>
|
||||||
|
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">基础信息</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-row>
|
||||||
|
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="采购单号" prop="purchaseNo">
|
||||||
|
<el-input class="!w-300px" placeholder="系统自动生成" v-model="formData.purchaseNo" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="供应商" prop="supplierName">
|
||||||
|
<el-input class="!w-300px" placeholder="供应商" v-model="formData.supplierName" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 采购单信息 -->
|
||||||
|
<el-card class="hl-card-info">
|
||||||
|
<template #header>
|
||||||
|
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">采购单信息</span>
|
||||||
|
</template>
|
||||||
|
<el-row>
|
||||||
|
<el-col>
|
||||||
|
<el-card class="hl-incard">
|
||||||
|
<el-form ref="multipleTable" :model="formData.list" :rules="subMatPlanFormRules" v-loading="loading" label-width="0">
|
||||||
|
<el-table :data="formData.list" class="hl-table" >
|
||||||
|
<el-table-column prop="projectSubCode" min-width="150" label="子项目编码" align="center"/>
|
||||||
|
<el-table-column prop="boomName" min-width="120" label="标准件名称" align="center"/>
|
||||||
|
<el-table-column prop="matCode" min-width="100" label="物料编码" align="center"/>
|
||||||
|
<el-table-column prop="boomSpec" min-width="100" label="规格型号" align="center"/>
|
||||||
|
<el-table-column prop="purchaseAmount" min-width="100" label="采购数量" align="center" />
|
||||||
|
<el-table-column prop="requireTime" min-width="150" label="需要完成日期" align="center" :formatter="dateFormatter1"/>
|
||||||
|
<el-table-column prop="arriveTime" min-width="150" label="预计到货日期" align="center" :formatter="dateFormatter1" />
|
||||||
|
<el-table-column prop="estimatedPrice" min-width="150" label="预估总价" align="center"/>
|
||||||
|
<el-table-column prop="description" min-width="150" label="备注" align="center"/>
|
||||||
|
</el-table>
|
||||||
|
</el-form>
|
||||||
|
<!-- <Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"-->
|
||||||
|
<!-- @pagination="getList" />-->
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
</el-form>
|
||||||
|
<div class="hl-footer text-center">
|
||||||
|
<el-button @click="isPrint()" type="primary" size="large" >打印</el-button>
|
||||||
|
<el-button @click="deleteForm()" type="danger" size="large" >删除</el-button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:物料列表 -->
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import * as MaterialPlanApi from '@/api/heli/materialplan'
|
||||||
|
import * as MaterialPlanDetailApi from '@/api/heli/materialplandetail'
|
||||||
|
import * as MaterialPlanBoomApi from '@/api/heli/materialplanboom'
|
||||||
|
import {ElTable, UploadUserFile} from 'element-plus'
|
||||||
|
import * as PlanApi from '@/api/heli/plan'
|
||||||
|
import * as PlanSubApi from '@/api/heli/plansub'
|
||||||
|
import * as ProjectOrderApi from '@/api/heli/projectorder'
|
||||||
|
import * as UserApi from '@/api/system/user'
|
||||||
|
import * as MaterialApi from '@/api/heli/material'
|
||||||
|
import { deleteFile, downloadFile, getFilePage } from '@/api/infra/file'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import { getAccessToken, getTenantId } from '@/utils/auth'
|
||||||
|
import {dateFormatter, dateFormatter1, formatDate} from '@/utils/formatTime'
|
||||||
|
import { useUserStore } from '@/store/modules/user'
|
||||||
|
import { useTagsViewStore } from '@/store/modules/tagsView'
|
||||||
|
import MaterialSelect from '@/views/heli/hlvuestyle/materialSelect.vue'
|
||||||
|
import booms from './boom.vue'
|
||||||
|
|
||||||
|
const reload: any = inject('reload')
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { query } = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
|
const tagsViewStore = useTagsViewStore()
|
||||||
|
import * as PurchaseOrderNoApi from '@/api/heli/purchaseorderno'
|
||||||
|
import * as PurchaseOrderNoDetailApi from '@/api/heli/purchaseordernodetail'
|
||||||
|
import {PurchaseOrderNoDetailVO} from "@/api/heli/purchaseordernodetail";
|
||||||
|
import {ref} from "vue";
|
||||||
|
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formData = ref({
|
||||||
|
id: undefined,
|
||||||
|
purchaseNo: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
projectPlanId: undefined,
|
||||||
|
projectPlanNo: undefined,
|
||||||
|
projectCode: undefined,
|
||||||
|
auditor: undefined,
|
||||||
|
createTime: new Date(),
|
||||||
|
status: undefined,
|
||||||
|
description: undefined,
|
||||||
|
boomItemDOList: [],
|
||||||
|
boomItemRemoveList: [],
|
||||||
|
matBoomDOList: [],
|
||||||
|
matItemRemoveList: [],
|
||||||
|
attachments: [],
|
||||||
|
supplierName:undefined,
|
||||||
|
list:[]
|
||||||
|
})
|
||||||
|
const subMatPlanFormRules = reactive({
|
||||||
|
purchaseRemAmounts: [{ required: true, message: '入库数量不能为空', trigger: 'blur' }]})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
const subFormRef = ref() // 表单 Ref
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const subBoomFormLoading = ref(false)
|
||||||
|
const subBoomFormRef = ref()
|
||||||
|
|
||||||
|
|
||||||
|
const multipleTable = ref<InstanceType<typeof ElTable>>()
|
||||||
|
|
||||||
|
const handleSelectionChange = (val) => {
|
||||||
|
// multipleTable.value.clearSelection()
|
||||||
|
multipleTable.value=val
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const closeForm = async () => {
|
||||||
|
router.push({ path: '/purchase/purchaseorderno' })
|
||||||
|
tagsViewStore.delVisitedView(router.currentRoute.value)
|
||||||
|
}
|
||||||
|
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||||
|
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
projectMaterialPlanId: query.id
|
||||||
|
})
|
||||||
|
// 页面数据加载初始化
|
||||||
|
onMounted(async () => {
|
||||||
|
// 获取物料需求计划信息
|
||||||
|
formData.value = await PurchaseOrderNoApi.getPurchaseOrderNo(query.id)
|
||||||
|
getList();
|
||||||
|
})
|
||||||
|
const isPrint = async () => {
|
||||||
|
var newVar = await PurchaseOrderNoApi.isPrint(query.id);
|
||||||
|
console.log(newVar)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
const deleteForm = async () => {
|
||||||
|
await PurchaseOrderNoApi.deleteForm(query.id)
|
||||||
|
router.push({ path: '/purchase/purchaseordernomanagement' })
|
||||||
|
tagsViewStore.delVisitedView(router.currentRoute.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await PurchaseOrderNoDetailApi.getPurchaseOrderNoDetailById(query.id)
|
||||||
|
formData.value.list = data
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
Loading…
Reference in New Issue
Block a user