优化销售订单价格
This commit is contained in:
parent
1c17d7edae
commit
fe54bd79b6
|
|
@ -11,11 +11,13 @@ public interface ErrorCodeConstants extends cn.hangtag.module.system.enums.Erro
|
|||
ErrorCode DRAFT_DESIGN_DATA_NOT_EXISTS = new ErrorCode(3500, "稿件模板数据 不存在");
|
||||
ErrorCode SALE_ORDER_NOT_EXISTS = new ErrorCode(3600, "OMS销售订单主表不存在");
|
||||
ErrorCode SALE_ORDER_ENTRY_NOT_EXISTS = new ErrorCode(3700, "OMS销售订单明细不存在");
|
||||
ErrorCode SALE_ORDER_ENTRY_PRICE_NOT_NULL= new ErrorCode(3701, "单价不允许为空");
|
||||
ErrorCode CUSTOMER_BRAND_NOT_EXISTS = new ErrorCode(3800, "客户和品牌关联不存在");
|
||||
ErrorCode PRODUCT_CARE_ITEM_NOT_EXISTS = new ErrorCode(3900, "产品保养项 不存在");
|
||||
ErrorCode PRODUCE_ORDER_NOT_EXISTS = new ErrorCode(4000, "生产制单不存在");
|
||||
ErrorCode PRODUCE_ORDER_EXISTS = new ErrorCode(4002, "生产制单已经存在");
|
||||
ErrorCode PRODUCE_ORDER_IMPORT_LIST_IS_EMPTY = new ErrorCode(4003, "导入生产制单数据不能为空");
|
||||
ErrorCode SALE_CONTRACT_NOT_EXISTS = new ErrorCode(5000, "OMS销售合约不存在");
|
||||
ErrorCode PRODUCT_PRICE_NOT_EXISTS = new ErrorCode(600, "产品单价记录不存在");
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,6 +80,6 @@ public class ProduceOrderImportExcelVO {
|
|||
|
||||
@Schema(description = "交货数量")
|
||||
@ExcelProperty("交货数量")
|
||||
private Integer deliveryQty;
|
||||
private Long deliveryQty;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,10 @@ public class ProduceOrderRespVO {
|
|||
@ExcelProperty("客户编号")
|
||||
private String customerCode;
|
||||
|
||||
@Schema(description = "产品编号", example = "11111")
|
||||
@ExcelProperty("产品编号")
|
||||
private String productCode;
|
||||
|
||||
@Schema(description = "产品名称", example = "王五")
|
||||
@ExcelProperty("产品名称")
|
||||
private String productName;
|
||||
|
|
@ -86,6 +90,6 @@ public class ProduceOrderRespVO {
|
|||
|
||||
@Schema(description = "交货数量")
|
||||
@ExcelProperty("交货数量")
|
||||
private Integer deliveryQty;
|
||||
private Long deliveryQty;
|
||||
|
||||
}
|
||||
|
|
@ -72,6 +72,6 @@ public class ProduceOrderSaveReqVO {
|
|||
private LocalDateTime deliverydate;
|
||||
|
||||
@Schema(description = "交货数量")
|
||||
private Integer deliveryQty;
|
||||
private Long deliveryQty;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
package cn.hangtag.module.oms.controller.admin.product;
|
||||
|
||||
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 cn.hangtag.framework.common.pojo.PageParam;
|
||||
import cn.hangtag.framework.common.pojo.PageResult;
|
||||
import cn.hangtag.framework.common.pojo.CommonResult;
|
||||
import cn.hangtag.framework.common.util.object.BeanUtils;
|
||||
import static cn.hangtag.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.hangtag.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.hangtag.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.hangtag.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.hangtag.module.oms.controller.admin.product.vo.*;
|
||||
import cn.hangtag.module.oms.dal.dataobject.product.ProductPriceDO;
|
||||
import cn.hangtag.module.oms.service.product.ProductPriceService;
|
||||
|
||||
@Tag(name = "管理后台 - 产品单价记录")
|
||||
@RestController
|
||||
@RequestMapping("/oms/product-price")
|
||||
@Validated
|
||||
public class ProductPriceController {
|
||||
|
||||
@Resource
|
||||
private ProductPriceService productPriceService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建产品单价记录")
|
||||
@PreAuthorize("@ss.hasPermission('oms:product-price:create')")
|
||||
public CommonResult<Long> createProductPrice(@Valid @RequestBody ProductPriceSaveReqVO createReqVO) {
|
||||
return success(productPriceService.createProductPrice(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新产品单价记录")
|
||||
@PreAuthorize("@ss.hasPermission('oms:product-price:update')")
|
||||
public CommonResult<Boolean> updateProductPrice(@Valid @RequestBody ProductPriceSaveReqVO updateReqVO) {
|
||||
productPriceService.updateProductPrice(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除产品单价记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('oms:product-price:delete')")
|
||||
public CommonResult<Boolean> deleteProductPrice(@RequestParam("id") Long id) {
|
||||
productPriceService.deleteProductPrice(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得产品单价记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('oms:product-price:query')")
|
||||
public CommonResult<ProductPriceRespVO> getProductPrice(@RequestParam("id") Long id) {
|
||||
ProductPriceDO productPrice = productPriceService.getProductPrice(id);
|
||||
return success(BeanUtils.toBean(productPrice, ProductPriceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得产品单价记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('oms:product-price:query')")
|
||||
public CommonResult<PageResult<ProductPriceRespVO>> getProductPricePage(@Valid ProductPricePageReqVO pageReqVO) {
|
||||
PageResult<ProductPriceDO> pageResult = productPriceService.getProductPricePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ProductPriceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出产品单价记录 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('oms:product-price:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportProductPriceExcel(@Valid ProductPricePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ProductPriceDO> list = productPriceService.getProductPricePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "产品单价记录.xls", "数据", ProductPriceRespVO.class,
|
||||
BeanUtils.toBean(list, ProductPriceRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package cn.hangtag.module.oms.controller.admin.product.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.hangtag.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.hangtag.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 ProductPricePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "产品id", example = "25258")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "单价", example = "6732")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package cn.hangtag.module.oms.controller.admin.product.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 产品单价记录 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProductPriceRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9841")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "产品id", example = "25258")
|
||||
@ExcelProperty("产品id")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "单价", example = "6732")
|
||||
@ExcelProperty("单价")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package cn.hangtag.module.oms.controller.admin.product.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 产品单价记录新增/修改 Request VO")
|
||||
@Data
|
||||
public class ProductPriceSaveReqVO {
|
||||
@Schema(description = "ID", example = "25258")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "产品id", example = "25258")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "单价", example = "6732")
|
||||
private BigDecimal price;
|
||||
|
||||
}
|
||||
|
|
@ -115,6 +115,6 @@ public class ProduceOrderDO extends BaseDO {
|
|||
/**
|
||||
* 交货数量
|
||||
*/
|
||||
private Integer deliveryQty;
|
||||
private Long deliveryQty;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package cn.hangtag.module.oms.dal.dataobject.product;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.hangtag.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 产品单价记录 DO
|
||||
*
|
||||
* @author wwb
|
||||
*/
|
||||
@TableName("oms_product_price")
|
||||
@KeySequence("oms_product_price_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProductPriceDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 产品id
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package cn.hangtag.module.oms.dal.mysql.product;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.hangtag.framework.common.pojo.PageResult;
|
||||
import cn.hangtag.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.hangtag.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.hangtag.module.oms.dal.dataobject.product.ProductPriceDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.hangtag.module.oms.controller.admin.product.vo.*;
|
||||
|
||||
/**
|
||||
* 产品单价记录 Mapper
|
||||
*
|
||||
* @author wwb
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProductPriceMapper extends BaseMapperX<ProductPriceDO> {
|
||||
|
||||
default PageResult<ProductPriceDO> selectPage(ProductPricePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ProductPriceDO>()
|
||||
.eqIfPresent(ProductPriceDO::getProductId, reqVO.getProductId())
|
||||
.eqIfPresent(ProductPriceDO::getPrice, reqVO.getPrice())
|
||||
.betweenIfPresent(ProductPriceDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ProductPriceDO::getId));
|
||||
}
|
||||
|
||||
default ProductPriceDO getProductPriceByProductId(Long productId){
|
||||
return selectOne(new LambdaQueryWrapperX<ProductPriceDO>()
|
||||
.eqIfPresent(ProductPriceDO::getProductId, productId)
|
||||
.orderByDesc(ProductPriceDO::getCreateTime));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package cn.hangtag.module.oms.service.product;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.hangtag.module.oms.controller.admin.product.vo.*;
|
||||
import cn.hangtag.module.oms.dal.dataobject.product.ProductPriceDO;
|
||||
import cn.hangtag.framework.common.pojo.PageResult;
|
||||
import cn.hangtag.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 产品单价记录 Service 接口
|
||||
*
|
||||
* @author wwb
|
||||
*/
|
||||
public interface ProductPriceService {
|
||||
|
||||
/**
|
||||
* 创建产品单价记录
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createProductPrice(@Valid ProductPriceSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新产品单价记录
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProductPrice(@Valid ProductPriceSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除产品单价记录
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProductPrice(Long id);
|
||||
|
||||
/**
|
||||
* 获得产品单价记录
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 产品单价记录
|
||||
*/
|
||||
ProductPriceDO getProductPrice(Long id);
|
||||
|
||||
ProductPriceDO getProductPriceByProductId(Long productId);
|
||||
|
||||
/**
|
||||
* 获得产品单价记录分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 产品单价记录分页
|
||||
*/
|
||||
PageResult<ProductPriceDO> getProductPricePage(ProductPricePageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
package cn.hangtag.module.oms.service.product;
|
||||
|
||||
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 cn.hangtag.module.oms.controller.admin.product.vo.*;
|
||||
import cn.hangtag.module.oms.dal.dataobject.product.ProductPriceDO;
|
||||
import cn.hangtag.framework.common.pojo.PageResult;
|
||||
import cn.hangtag.framework.common.pojo.PageParam;
|
||||
import cn.hangtag.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.hangtag.module.oms.dal.mysql.product.ProductPriceMapper;
|
||||
|
||||
import static cn.hangtag.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.hangtag.module.oms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 产品单价记录 Service 实现类
|
||||
*
|
||||
* @author wwb
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ProductPriceServiceImpl implements ProductPriceService {
|
||||
|
||||
@Resource
|
||||
private ProductPriceMapper productPriceMapper;
|
||||
|
||||
@Override
|
||||
public Long createProductPrice(ProductPriceSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProductPriceDO productPrice = BeanUtils.toBean(createReqVO, ProductPriceDO.class);
|
||||
productPriceMapper.insert(productPrice);
|
||||
// 返回
|
||||
return productPrice.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProductPrice(ProductPriceSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProductPriceExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ProductPriceDO updateObj = BeanUtils.toBean(updateReqVO, ProductPriceDO.class);
|
||||
productPriceMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProductPrice(Long id) {
|
||||
// 校验存在
|
||||
validateProductPriceExists(id);
|
||||
// 删除
|
||||
productPriceMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateProductPriceExists(Long id) {
|
||||
if (productPriceMapper.selectById(id) == null) {
|
||||
throw exception(PRODUCT_PRICE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductPriceDO getProductPrice(Long id) {
|
||||
return productPriceMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductPriceDO getProductPriceByProductId(Long productId) {
|
||||
return productPriceMapper.getProductPriceByProductId(productId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProductPriceDO> getProductPricePage(ProductPricePageReqVO pageReqVO) {
|
||||
return productPriceMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,16 +1,20 @@
|
|||
package cn.hangtag.module.oms.service.saleorder;
|
||||
|
||||
import cn.hangtag.framework.common.exception.ServiceException;
|
||||
import cn.hangtag.framework.common.exception.enums.GlobalErrorCodeConstants;
|
||||
import cn.hangtag.framework.common.pojo.PageResult;
|
||||
import cn.hangtag.framework.common.util.object.BeanUtils;
|
||||
import cn.hangtag.module.oms.common.utils.NumberChineseFormatterUtils;
|
||||
import cn.hangtag.module.oms.common.utils.WKHtmlToPdfUtil;
|
||||
import cn.hangtag.module.oms.controller.admin.common.vo.DataComparisonRespVO;
|
||||
import cn.hangtag.module.oms.controller.admin.produceorder.vo.ProduceOrderSaveReqVO;
|
||||
import cn.hangtag.module.oms.controller.admin.product.vo.ProductPriceSaveReqVO;
|
||||
import cn.hangtag.module.oms.controller.admin.salecontract.vo.SaleContractSaveReqVO;
|
||||
import cn.hangtag.module.oms.controller.admin.saleorder.vo.SaleOrderPageReqVO;
|
||||
import cn.hangtag.module.oms.controller.admin.saleorder.vo.SaleOrderSaveReqVO;
|
||||
import cn.hangtag.module.oms.controller.admin.trade.vo.TradeOrderSummaryRespVO;
|
||||
import cn.hangtag.module.oms.dal.dataobject.customer.CustomerDO;
|
||||
import cn.hangtag.module.oms.dal.dataobject.product.ProductPriceDO;
|
||||
import cn.hangtag.module.oms.dal.dataobject.productinfo.ProductInfoDO;
|
||||
import cn.hangtag.module.oms.dal.dataobject.salecontract.SaleContractDO;
|
||||
import cn.hangtag.module.oms.dal.dataobject.salecontractentry.SaleContractEntryDO;
|
||||
|
|
@ -18,10 +22,12 @@ import cn.hangtag.module.oms.dal.dataobject.saleorder.SaleOrderDO;
|
|||
import cn.hangtag.module.oms.dal.dataobject.saleorderentry.SaleOrderEntryDO;
|
||||
import cn.hangtag.module.oms.dal.mysql.saleorder.SaleOrderMapper;
|
||||
import cn.hangtag.module.oms.dal.mysql.saleorderentry.SaleOrderEntryMapper;
|
||||
import cn.hangtag.module.oms.enums.ErrorCodeConstants;
|
||||
import cn.hangtag.module.oms.enums.common.BillStatusEnum;
|
||||
import cn.hangtag.module.oms.enums.saleorder.SaleOrderStatusEnum;
|
||||
import cn.hangtag.module.oms.service.customer.CustomerService;
|
||||
import cn.hangtag.module.oms.service.produceorder.ProduceOrderService;
|
||||
import cn.hangtag.module.oms.service.product.ProductPriceService;
|
||||
import cn.hangtag.module.oms.service.productinfo.ProductInfoService;
|
||||
import cn.hangtag.module.oms.service.salecontract.SaleContractService;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
|
|
@ -75,7 +81,8 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
private SaleContractService saleContractService;
|
||||
@Resource
|
||||
private CustomerService customerService;
|
||||
|
||||
@Resource
|
||||
private ProductPriceService productPriceService;
|
||||
@Resource
|
||||
private TemplateEngine templateEngine;
|
||||
|
||||
|
|
@ -84,8 +91,8 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
public Long createSaleOrder(SaleOrderSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
SaleOrderDO saleOrder = BeanUtils.toBean(createReqVO, SaleOrderDO.class);
|
||||
saleOrder.setOrderStatus(SaleOrderStatusEnum.YXD.getValue());
|
||||
saleOrderMapper.insert(saleOrder);
|
||||
|
||||
// 插入子表
|
||||
createSaleOrderEntryList(saleOrder.getId(), createReqVO.getSaleOrderEntrys());
|
||||
// 返回
|
||||
|
|
@ -137,6 +144,17 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
|
||||
@Override
|
||||
public List<SaleOrderEntryDO> getSaleOrderEntryListByParentId(Long parentId) {
|
||||
//加载历史产品价格记录
|
||||
List<SaleOrderEntryDO> entrys = saleOrderEntryMapper.selectListByParentId(parentId);
|
||||
for (cn.hangtag.module.oms.dal.dataobject.saleorderentry.SaleOrderEntryDO entry : entrys) {
|
||||
BigDecimal price = entry.getPrice();
|
||||
if(price==null){
|
||||
ProductPriceDO productPrice = productPriceService.getProductPriceByProductId(entry.getParentId());
|
||||
if(productPrice!=null){
|
||||
entry.setPrice(productPrice.getPrice());
|
||||
}
|
||||
}
|
||||
}
|
||||
return saleOrderEntryMapper.selectListByParentId(parentId);
|
||||
}
|
||||
|
||||
|
|
@ -163,6 +181,7 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
for (SaleOrderDO saleOrder : saleOrders) {
|
||||
if(!BillStatusEnum.AUDIT.getValue().equals(saleOrder.getBillStatus())){
|
||||
saleOrder.setBillStatus(BillStatusEnum.INVALID.getValue());
|
||||
saleOrder.setOrderStatus(SaleOrderStatusEnum.YXD.getValue());
|
||||
saleOrderMapper.updateById(saleOrder);
|
||||
}
|
||||
}
|
||||
|
|
@ -171,6 +190,7 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
for (SaleOrderDO saleOrder : saleOrders) {
|
||||
if(!BillStatusEnum.AUDIT.getValue().equals(saleOrder.getBillStatus()) && (params!=null && params.size()>0)){
|
||||
saleOrder.setBillStatus(BillStatusEnum.REJECT.getValue());
|
||||
saleOrder.setOrderStatus(SaleOrderStatusEnum.YXD.getValue());
|
||||
saleOrder.setRejectReason((String)params.get("rejectReason"));
|
||||
saleOrderMapper.updateById(saleOrder);
|
||||
}
|
||||
|
|
@ -180,6 +200,7 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
for (SaleOrderDO saleOrder : saleOrders) {
|
||||
if(BillStatusEnum.SAVE.getValue().equals(saleOrder.getBillStatus())){
|
||||
saleOrder.setBillStatus(BillStatusEnum.SUBMIT.getValue());
|
||||
saleOrder.setOrderStatus(SaleOrderStatusEnum.SCZ.getValue());
|
||||
saleOrderMapper.updateById(saleOrder);
|
||||
}
|
||||
}
|
||||
|
|
@ -188,13 +209,39 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
for (SaleOrderDO saleOrder : saleOrders) {
|
||||
if(BillStatusEnum.SUBMIT.getValue().equals(saleOrder.getBillStatus())){
|
||||
saleOrder.setBillStatus(BillStatusEnum.AUDIT.getValue());
|
||||
saleOrder.setOrderStatus(SaleOrderStatusEnum.YWC.getValue());
|
||||
saleOrderMapper.updateById(saleOrder);
|
||||
List<SaleOrderEntryDO> entrys = getSaleOrderEntryListByParentId(saleOrder.getId());
|
||||
for (cn.hangtag.module.oms.dal.dataobject.saleorderentry.SaleOrderEntryDO entry : entrys) {
|
||||
BigDecimal price = entry.getPrice();
|
||||
if(price==null){
|
||||
throw new ServiceException(ErrorCodeConstants.SALE_ORDER_ENTRY_PRICE_NOT_NULL);
|
||||
}
|
||||
}
|
||||
|
||||
//生成产品单价记录
|
||||
for (cn.hangtag.module.oms.dal.dataobject.saleorderentry.SaleOrderEntryDO entry : entrys) {
|
||||
Long parentId = entry.getParentId();
|
||||
BigDecimal price = entry.getPrice();
|
||||
generateProductPrice(parentId,price);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成产品单价记录
|
||||
*/
|
||||
private void generateProductPrice(Long productId,BigDecimal price){
|
||||
ProductPriceSaveReqVO saveReqVO = new ProductPriceSaveReqVO();
|
||||
saveReqVO.setProductId(productId);
|
||||
saveReqVO.setPrice(price);
|
||||
productPriceService.createProductPrice(saveReqVO);
|
||||
|
||||
}
|
||||
@Override
|
||||
public void generateProduceOrder(List<Long> ids) {
|
||||
List<SaleOrderDO> saleOrders = saleOrderMapper.selectList(SaleOrderDO::getId, ids);
|
||||
|
|
@ -205,7 +252,7 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
saveReqVO.setProductId(0L);
|
||||
saveReqVO.setProduceLine("测试线");
|
||||
saveReqVO.setDeliveryMethod("交货方式");
|
||||
saveReqVO.setDeliveryQty(1111111);
|
||||
saveReqVO.setDeliveryQty(1111111L);
|
||||
saveReqVO.setDays(5L);
|
||||
saveReqVO.setClerk("职员");
|
||||
saveReqVO.setContractDate(LocalDateTime.now() );
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.hangtag.module.oms.dal.mysql.product.ProductPriceMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
package cn.hangtag.module.oms.service.product;
|
||||
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import cn.hangtag.framework.test.core.ut.BaseDbUnitTest;
|
||||
|
||||
import cn.hangtag.module.oms.controller.admin.product.vo.*;
|
||||
import cn.hangtag.module.oms.dal.dataobject.product.ProductPriceDO;
|
||||
import cn.hangtag.module.oms.dal.mysql.product.ProductPriceMapper;
|
||||
import cn.hangtag.framework.common.pojo.PageResult;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.hutool.core.util.RandomUtil.*;
|
||||
import static cn.hangtag.module.oms.enums.ErrorCodeConstants.*;
|
||||
import static cn.hangtag.framework.test.core.util.AssertUtils.*;
|
||||
import static cn.hangtag.framework.test.core.util.RandomUtils.*;
|
||||
import static cn.hangtag.framework.common.util.date.LocalDateTimeUtils.*;
|
||||
import static cn.hangtag.framework.common.util.object.ObjectUtils.*;
|
||||
import static cn.hangtag.framework.common.util.date.DateUtils.*;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
/**
|
||||
* {@link ProductPriceServiceImpl} 的单元测试类
|
||||
*
|
||||
* @author wwb
|
||||
*/
|
||||
@Import(ProductPriceServiceImpl.class)
|
||||
public class ProductPriceServiceImplTest extends BaseDbUnitTest {
|
||||
|
||||
@Resource
|
||||
private ProductPriceServiceImpl productPriceService;
|
||||
|
||||
@Resource
|
||||
private ProductPriceMapper productPriceMapper;
|
||||
|
||||
@Test
|
||||
public void testCreateProductPrice_success() {
|
||||
// 准备参数
|
||||
ProductPriceSaveReqVO createReqVO = randomPojo(ProductPriceSaveReqVO.class).setId(null);
|
||||
|
||||
// 调用
|
||||
Integer productPriceId = productPriceService.createProductPrice(createReqVO);
|
||||
// 断言
|
||||
assertNotNull(productPriceId);
|
||||
// 校验记录的属性是否正确
|
||||
ProductPriceDO productPrice = productPriceMapper.selectById(productPriceId);
|
||||
assertPojoEquals(createReqVO, productPrice, "id");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateProductPrice_success() {
|
||||
// mock 数据
|
||||
ProductPriceDO dbProductPrice = randomPojo(ProductPriceDO.class);
|
||||
productPriceMapper.insert(dbProductPrice);// @Sql: 先插入出一条存在的数据
|
||||
// 准备参数
|
||||
ProductPriceSaveReqVO updateReqVO = randomPojo(ProductPriceSaveReqVO.class, o -> {
|
||||
o.setId(dbProductPrice.getId()); // 设置更新的 ID
|
||||
});
|
||||
|
||||
// 调用
|
||||
productPriceService.updateProductPrice(updateReqVO);
|
||||
// 校验是否更新正确
|
||||
ProductPriceDO productPrice = productPriceMapper.selectById(updateReqVO.getId()); // 获取最新的
|
||||
assertPojoEquals(updateReqVO, productPrice);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateProductPrice_notExists() {
|
||||
// 准备参数
|
||||
ProductPriceSaveReqVO updateReqVO = randomPojo(ProductPriceSaveReqVO.class);
|
||||
|
||||
// 调用, 并断言异常
|
||||
assertServiceException(() -> productPriceService.updateProductPrice(updateReqVO), PRODUCT_PRICE_NOT_EXISTS);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeleteProductPrice_success() {
|
||||
// mock 数据
|
||||
ProductPriceDO dbProductPrice = randomPojo(ProductPriceDO.class);
|
||||
productPriceMapper.insert(dbProductPrice);// @Sql: 先插入出一条存在的数据
|
||||
// 准备参数
|
||||
Integer id = dbProductPrice.getId();
|
||||
|
||||
// 调用
|
||||
productPriceService.deleteProductPrice(id);
|
||||
// 校验数据不存在了
|
||||
assertNull(productPriceMapper.selectById(id));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeleteProductPrice_notExists() {
|
||||
// 准备参数
|
||||
Integer id = randomIntegerId();
|
||||
|
||||
// 调用, 并断言异常
|
||||
assertServiceException(() -> productPriceService.deleteProductPrice(id), PRODUCT_PRICE_NOT_EXISTS);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
|
||||
public void testGetProductPricePage() {
|
||||
// mock 数据
|
||||
ProductPriceDO dbProductPrice = randomPojo(ProductPriceDO.class, o -> { // 等会查询到
|
||||
o.setProductId(null);
|
||||
o.setPrice(null);
|
||||
o.setCreateTime(null);
|
||||
});
|
||||
productPriceMapper.insert(dbProductPrice);
|
||||
// 测试 productId 不匹配
|
||||
productPriceMapper.insert(cloneIgnoreId(dbProductPrice, o -> o.setProductId(null)));
|
||||
// 测试 price 不匹配
|
||||
productPriceMapper.insert(cloneIgnoreId(dbProductPrice, o -> o.setPrice(null)));
|
||||
// 测试 createTime 不匹配
|
||||
productPriceMapper.insert(cloneIgnoreId(dbProductPrice, o -> o.setCreateTime(null)));
|
||||
// 准备参数
|
||||
ProductPricePageReqVO reqVO = new ProductPricePageReqVO();
|
||||
reqVO.setProductId(null);
|
||||
reqVO.setPrice(null);
|
||||
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
|
||||
|
||||
// 调用
|
||||
PageResult<ProductPriceDO> pageResult = productPriceService.getProductPricePage(reqVO);
|
||||
// 断言
|
||||
assertEquals(1, pageResult.getTotal());
|
||||
assertEquals(1, pageResult.getList().size());
|
||||
assertPojoEquals(dbProductPrice, pageResult.getList().get(0));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<template>
|
||||
<Dialog :title="dialogTitle" append-to-body v-model="dialogVisible">
|
||||
<Form :disabled="disabled" ref="formRef" :schema="allSchemas.formSchema" :rules="rules" v-loading="formLoading" />
|
||||
|
||||
<template #footer>
|
||||
<el-button v-if="!disabled" @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ProductInfoApi, ProductInfoVO } from '@/api/oms/productinfo'
|
||||
import { rules, allSchemas } from './config.data'
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
const disabled = computed(() => {
|
||||
return formType.value !== 'create' && formType.value !== 'update'
|
||||
})
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = await ProductInfoApi.getProductInfo(id)
|
||||
formRef.value.setValues(data)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
if (!formRef) return
|
||||
const valid = await formRef.value.getElFormRef().validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formRef.value.formModel as BrandVO
|
||||
if (formType.value === 'create') {
|
||||
await BrandApi.createBrand(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await BrandApi.updateBrand(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
// 表单校验
|
||||
export const rules = reactive({
|
||||
code: [required],
|
||||
name: [required],
|
||||
})
|
||||
|
||||
// CrudSchema https://doc.iocoder.cn/vue3/crud-schema/
|
||||
const crudSchemas = reactive<CrudSchema[]>([
|
||||
{
|
||||
label: 'id',
|
||||
field: 'id',
|
||||
isForm: false,
|
||||
},
|
||||
{
|
||||
label: '编码',
|
||||
field: 'code',
|
||||
isSearch: true,
|
||||
},
|
||||
{
|
||||
label: '名称',
|
||||
field: 'name',
|
||||
isSearch: true,
|
||||
},
|
||||
{
|
||||
label: '创建时间',
|
||||
field: 'createTime',
|
||||
formatter: dateFormatter,
|
||||
isSearch: true,
|
||||
search: {
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
type: 'daterange',
|
||||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
|
||||
}
|
||||
},
|
||||
isForm: false,
|
||||
}
|
||||
])
|
||||
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
||||
|
|
@ -0,0 +1,308 @@
|
|||
<template>
|
||||
<slot>
|
||||
<div>
|
||||
<el-input
|
||||
v-model="that.showValue"
|
||||
clearable
|
||||
:placeholder="props.placeholder"
|
||||
@clear="clearData"
|
||||
@click="viewDetails"
|
||||
>
|
||||
<template #append>
|
||||
<el-button @click.stop="openDialog">
|
||||
<Icon icon="ep:search"/>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</slot>
|
||||
{{tmp}}
|
||||
<Dialog
|
||||
:title="dialogTitle"
|
||||
width="80%"
|
||||
append-to-body
|
||||
v-model="that.visible"
|
||||
@close="updateVisible(false)">
|
||||
<div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<ContentWrap>
|
||||
<Search
|
||||
:schema="allSchemas.searchSchema"
|
||||
:is-col="false"
|
||||
@search="setSearchParams"
|
||||
@reset="setSearchParams">
|
||||
<!-- 新增等操作按钮 -->
|
||||
<template #actionMore>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['oms:draft-design-data:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px"/>
|
||||
新增
|
||||
</el-button>
|
||||
</template>
|
||||
</Search>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<Table
|
||||
:columns="allSchemas.tableColumns"
|
||||
:data="tableObject.tableList"
|
||||
:loading="tableObject.loading"
|
||||
:selection="true"
|
||||
ref="tableRef"
|
||||
@selection-change="selectionChange"
|
||||
:pagination="{
|
||||
total: tableObject.total
|
||||
}"
|
||||
v-model:pageSize="tableObject.pageSize"
|
||||
v-model:currentPage="tableObject.currentPage"
|
||||
>
|
||||
<template #action="{ row }">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', row.id)"
|
||||
v-hasPermi="['oms:draft-design-data:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
v-hasPermi="['oms:draft-design-data:delete']"
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</Table>
|
||||
</ContentWrap>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="updateVisible(false,true)">{{ t('common.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="submit">{{ t('common.ok') }}</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</Dialog>
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<DataForm ref="formRef" @success="getList"/>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="ProductInfoListDialog">
|
||||
import {allSchemas} from './config.data'
|
||||
import {ProductInfoApi, ProductInfoVO} from '@/api/oms/productinfo'
|
||||
import DataForm from './DataForm.vue'
|
||||
|
||||
/** 稿件图片库 */
|
||||
defineOptions({name: 'ProductInfoListDialog'})
|
||||
const emit = defineEmits(['update:modelValue', 'update:visible', 'submit']) // 定义 success 事件,用于操作成功后的回调
|
||||
|
||||
const {t} = useI18n() // 国际化
|
||||
|
||||
const dialogTitle = ref('产品列表') // 弹窗的标题
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
dataKey: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'id'
|
||||
},
|
||||
showKey: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'name'
|
||||
},
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '请选择'
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '64px'
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '64px'
|
||||
},
|
||||
visible: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
const that = reactive({
|
||||
inputVal: '',
|
||||
showValue: '',
|
||||
visible: false,
|
||||
})
|
||||
|
||||
const openDialog = () => {
|
||||
updateVisible(true);
|
||||
}
|
||||
const viewDetails = () => {
|
||||
if (that.inputVal) {
|
||||
openForm("preview", that.inputVal.split(",")[0])
|
||||
} else {
|
||||
openDialog();
|
||||
}
|
||||
}
|
||||
// 用监听属性变化无其他意义
|
||||
const tmp = computed(()=>{
|
||||
setTimeout(()=>{
|
||||
that.inputVal = toStr(props.modelValue,that.inputVal)
|
||||
if (that.inputVal) {
|
||||
initInput();
|
||||
}
|
||||
},100)
|
||||
return ''
|
||||
},{
|
||||
deep: true
|
||||
})
|
||||
const toStr = (data: any) => {
|
||||
if (data !== null && data !== undefined) {
|
||||
return `${data}`
|
||||
}
|
||||
return data
|
||||
}
|
||||
let map = new Map();
|
||||
const initInput = async () => {
|
||||
const dataKey = that.inputVal + ',' + props.dataKey + ',' + props.showKey + ',' + props.multiple;
|
||||
if (map.has(dataKey)) {
|
||||
const data = map.get(dataKey)
|
||||
if (data) {
|
||||
that.inputVal = data.inputVal
|
||||
that.showValue = data.showValue
|
||||
console.log('缓存数据', data)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const ids = that.inputVal.split(",");
|
||||
let tmpInput = [];
|
||||
let tmpShow = [];
|
||||
for (let i = 0; i < ids.length; i++) {
|
||||
const data = await BrandApi.getBrand(ids[i])
|
||||
tmpInput.push(data[props.dataKey]);
|
||||
tmpShow.push(data[props.showKey]);
|
||||
}
|
||||
that.inputVal = tmpInput.join(',');
|
||||
that.showValue = tmpShow.join(',');
|
||||
map.set(dataKey, {
|
||||
inputVal: that.inputVal,
|
||||
showValue: that.showValue
|
||||
})
|
||||
}
|
||||
watch(() => props.visible, (newVal) => {
|
||||
that.visible = newVal;
|
||||
})
|
||||
const clearData = () => {
|
||||
that.inputVal = '';
|
||||
that.showValue = '';
|
||||
updateValue();
|
||||
}
|
||||
const updateVisible = (visible: boolean, clearInput = false) => {
|
||||
that.visible = visible;
|
||||
emit("update:visible", visible)
|
||||
if (clearInput) {
|
||||
clearData();
|
||||
}
|
||||
}
|
||||
defineExpose({}) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
const submit = () => {
|
||||
updateValue();
|
||||
updateVisible(false)
|
||||
}
|
||||
const updateValue = () => {
|
||||
emit("update:modelValue", that.inputVal)
|
||||
}
|
||||
//
|
||||
const selectionChange = (row) => {
|
||||
if (row && row.length > 0) {
|
||||
if (props.multiple) {
|
||||
let valArr = [];
|
||||
let showArr = [];
|
||||
for (let i = 0; i < row.length; i++) {
|
||||
const tmp = row[i][props.dataKey || 'id']
|
||||
if(valArr.includes(tmp)){
|
||||
continue;
|
||||
}
|
||||
valArr.push( tmp)
|
||||
showArr.push(row[i][props.showKey || 'id'])
|
||||
}
|
||||
that.inputVal = valArr.join(',')
|
||||
that.showValue = showArr.join(',')
|
||||
} else {
|
||||
if (row.length > 1) {
|
||||
useMessage().warning('单选数据,已忽略其他')
|
||||
}
|
||||
that.showValue = row[row.length - 1][props.showKey || 'id']
|
||||
that.inputVal = row[row.length - 1][props.dataKey || 'id']
|
||||
}
|
||||
} else {
|
||||
that.inputVal = ''
|
||||
that.showValue = ''
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const {tableObject, tableMethods} = useTable({
|
||||
getListApi: ProductInfoApi.getProductInfoPage, // 分页接口
|
||||
delListApi: ProductInfoApi.deleteProductInfo // 删除接口
|
||||
})
|
||||
// 获得表格的各种操作
|
||||
const {getList, setSearchParams} = tableMethods
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = (id: number) => {
|
||||
tableMethods.delList(id, false)
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
:deep(.el-input__wrapper) {
|
||||
position: relative;
|
||||
|
||||
.el-input__inner {
|
||||
padding-right: 18px;
|
||||
}
|
||||
|
||||
.el-input__suffix {
|
||||
position: absolute;
|
||||
right: 8px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
@ -234,6 +234,55 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||
noTagsView: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/oms/produceorder', // 订单管理
|
||||
component: Layout,
|
||||
name: 'ProduceOrderCenter',
|
||||
meta: {
|
||||
hidden: true
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'produceorder/add',
|
||||
component: () => import('@/views/oms/produceorder/form/index.vue'),
|
||||
name: 'ProduceOrderAdd',
|
||||
meta: {
|
||||
noCache: false, // 需要缓存
|
||||
hidden: true,
|
||||
canTo: true,
|
||||
icon: 'ep:edit',
|
||||
title: '生产制单添加',
|
||||
activeMenu: '/oms/produceorder'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'produceorder/edit/:id(\\d+)',
|
||||
component: () => import('@/views/oms/produceorder/form/index.vue'),
|
||||
name: 'ProduceOrderEdit',
|
||||
meta: {
|
||||
noCache: true,
|
||||
hidden: true,
|
||||
canTo: true,
|
||||
icon: 'ep:edit',
|
||||
title: '生产制单编辑',
|
||||
activeMenu: '/oms/produceorder'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'produceorder/detail/:id(\\d+)',
|
||||
component: () => import('@/views/oms/produceorder/form/index.vue'),
|
||||
name: 'ProduceOrderDetail',
|
||||
meta: {
|
||||
noCache: true,
|
||||
hidden: true,
|
||||
canTo: true,
|
||||
icon: 'ep:view',
|
||||
title: '生产制单详情',
|
||||
activeMenu: '/oms/produceorder'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
export default remainingRouter
|
||||
|
|
|
|||
|
|
@ -16,15 +16,15 @@
|
|||
<el-form-item label="客户编号" prop="customerCode">
|
||||
<el-input v-model="formData.customerCode" placeholder="请输入客户编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品id" prop="productId">
|
||||
<el-input v-model="formData.productId" placeholder="请输入产品id" />
|
||||
<el-form-item label="产品" prop="productId" >
|
||||
<ProductInfoListDialog v-model="formData.productId" placeholder="请选择产品" style="width: 11100px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编号" prop="productCode">
|
||||
<!-- <el-form-item label="产品编号" prop="productCode">
|
||||
<el-input v-model="formData.productCode" placeholder="请输入产品编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<el-input v-model="formData.productName" placeholder="请输入产品名称" />
|
||||
</el-form-item>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="合约号" prop="saleContractNo">
|
||||
<el-input v-model="formData.saleContractNo" placeholder="请输入合约号" />
|
||||
</el-form-item>
|
||||
|
|
@ -37,10 +37,10 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="合约数量" prop="contractQty">
|
||||
<el-input v-model="formData.contractQty" placeholder="请输入合约数量" />
|
||||
<el-input-number v-model="formData.contractQty" placeholder="请输入合约数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产数量" prop="produceQty">
|
||||
<el-input v-model="formData.produceQty" placeholder="请输入生产数量" />
|
||||
<el-input-number v-model="formData.produceQty" placeholder="请输入生产数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="交货地点" prop="deliveryPlace">
|
||||
<el-input v-model="formData.deliveryPlace" placeholder="请输入交货地点" />
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="天数" prop="days">
|
||||
<el-input v-model="formData.days" placeholder="请输入天数" />
|
||||
<el-input-number v-model="formData.days" placeholder="请输入天数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产线" prop="produceLine">
|
||||
<el-input v-model="formData.produceLine" placeholder="请输入生产线" />
|
||||
|
|
@ -90,17 +90,27 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="交货数量" prop="deliveryQty">
|
||||
<el-input v-model="formData.deliveryQty" placeholder="请输入交货数量" />
|
||||
<el-input-number v-model="formData.deliveryQty" placeholder="请输入交货数量" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="preview" type="primary" :disabled="formLoading">预 览</el-button>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
<startPreview ref="previewRef" />
|
||||
</Dialog>
|
||||
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ProduceOrderApi, ProduceOrderVO } from '@/api/oms/produceorder'
|
||||
import template1 from "@/views/oms/produceorder/template1";
|
||||
import { hiprint } from 'vue-plugin-hiprint'
|
||||
import startPreview from "./components/preview.vue"
|
||||
import {dateUtil} from "@/utils/dateUtil";
|
||||
import {dateFormatter, formatDate} from '@/utils/formatTime'
|
||||
import ProductInfoListDialog from "@/components/Dialog/src/ProductInfoListDialog/index.vue";
|
||||
|
||||
|
||||
/** 生产制单 表单 */
|
||||
defineOptions({ name: 'ProduceOrderForm' })
|
||||
|
|
@ -122,23 +132,30 @@ const formData = ref({
|
|||
productName: undefined,
|
||||
saleContractNo: undefined,
|
||||
contractDate: undefined,
|
||||
contractDateStr: undefined,
|
||||
contractQty: undefined,
|
||||
produceQty: undefined,
|
||||
deliveryPlace: undefined,
|
||||
clerk: undefined,
|
||||
reportDate: undefined,
|
||||
reportDateStr: undefined,
|
||||
reportTimeStr: undefined,
|
||||
produceDate: undefined,
|
||||
produceDateStr: undefined,
|
||||
days: undefined,
|
||||
produceLine: undefined,
|
||||
deliveryMethod: undefined,
|
||||
inspectionDate: undefined,
|
||||
deliverydate: undefined,
|
||||
inspectionDateStr: undefined,
|
||||
deliverydateStr: undefined,
|
||||
deliveryQty: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
const previewRef = ref(null);
|
||||
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
|
|
@ -157,6 +174,7 @@ const open = async (type: string, id?: number) => {
|
|||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
|
|
@ -208,4 +226,35 @@ const resetForm = () => {
|
|||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
const preview = async () => {
|
||||
const id = formData.value.id;
|
||||
if (id) {
|
||||
formData.value = await ProduceOrderApi.getProduceOrder(id)
|
||||
}
|
||||
//日期转换
|
||||
formData.value.contractDateStr = formatDate(formData.value.contractDate,'YYYY-MM-DD')
|
||||
formData.value.reportDateStr = formatDate(formData.value.reportDate,'YYYY-MM-DD')
|
||||
formData.value.reportTimeStr = formatDate(formData.value.reportDate,'HH:mm:ss')
|
||||
formData.value.produceDateStr = formatDate(formData.value.produceDate,'YYYY-MM-DD')
|
||||
formData.value.inspectionDateStr = formatDate(formData.value.inspectionDate,'YYYY-MM-DD')
|
||||
formData.value.deliverydateStr = formatDate(formData.value.deliverydate,'YYYY-MM-DD')
|
||||
//formData.value.saleContractNo = formData.value.orderNo
|
||||
|
||||
let printData = JSON.stringify(formData.value)
|
||||
printData = JSON.parse(printData)
|
||||
let hiprintTemplate = new hiprint.PrintTemplate({template: template1});
|
||||
|
||||
// 弹出浏览器打印窗口,并填充 字段名:name 的元素
|
||||
// hiprintTemplate.print(hiprintTemplate);
|
||||
//let html = hiprintTemplate.getHtml(printData);
|
||||
//previewRef.value.showModal(html);
|
||||
|
||||
hiprintTemplate.toPdf(printData, '打印预览', {isDownload: false, type: 'pdfobjectnewwindow'}).then((res) => {
|
||||
console.log('type:', 'pdfobjectnewwindow');
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,208 @@
|
|||
<template>
|
||||
<ContentWrap v-loading="formLoading">
|
||||
<!-- 订单信息 -->
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="单据编号" prop="billno">
|
||||
<el-input v-model="formData.billno" placeholder="请输入单据编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号" prop="orderNo">
|
||||
<el-input v-model="formData.orderNo" placeholder="请输入订单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户编号" prop="customerCode">
|
||||
<el-input v-model="formData.customerCode" placeholder="请输入客户编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品id" prop="productId">
|
||||
<el-input v-model="formData.productId" placeholder="请输入产品id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编号" prop="productCode">
|
||||
<el-input v-model="formData.productCode" placeholder="请输入产品编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<el-input v-model="formData.productName" placeholder="请输入产品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合约号" prop="saleContractNo">
|
||||
<el-input v-model="formData.saleContractNo" placeholder="请输入合约号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合约日期" prop="contractDate">
|
||||
<el-date-picker
|
||||
v-model="formData.contractDate"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择合约日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="合约数量" prop="contractQty">
|
||||
<el-input v-model="formData.contractQty" placeholder="请输入合约数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产数量" prop="produceQty">
|
||||
<el-input v-model="formData.produceQty" placeholder="请输入生产数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="交货地点" prop="deliveryPlace">
|
||||
<el-input v-model="formData.deliveryPlace" placeholder="请输入交货地点" />
|
||||
</el-form-item>
|
||||
<el-form-item label="职员" prop="clerk">
|
||||
<el-input v-model="formData.clerk" placeholder="请输入职员" />
|
||||
</el-form-item>
|
||||
<el-form-item label="报告日期" prop="reportDate">
|
||||
<el-date-picker
|
||||
v-model="formData.reportDate"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择报告日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产日期" prop="produceDate">
|
||||
<el-date-picker
|
||||
v-model="formData.produceDate"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择生产日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="天数" prop="days">
|
||||
<el-input v-model="formData.days" placeholder="请输入天数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产线" prop="produceLine">
|
||||
<el-input v-model="formData.produceLine" placeholder="请输入生产线" />
|
||||
</el-form-item>
|
||||
<el-form-item label="交货方式" prop="deliveryMethod">
|
||||
<el-input v-model="formData.deliveryMethod" placeholder="请输入交货方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="验货日期" prop="inspectionDate">
|
||||
<el-date-picker
|
||||
v-model="formData.inspectionDate"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择验货日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="交货日期" prop="deliverydate">
|
||||
<el-date-picker
|
||||
v-model="formData.deliverydate"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择交货日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="交货数量" prop="deliveryQty">
|
||||
<el-input v-model="formData.deliveryQty" placeholder="请输入交货数量" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item style="float: right">
|
||||
<el-button v-if="!isDetail" :loading="formLoading" type="primary" @click="submitForm">
|
||||
保存
|
||||
</el-button>
|
||||
<el-button @click="close">返回</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup lang="ts">
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { useTagsViewStore } from '@/store/modules/tagsView'
|
||||
import { convertToInteger, floatToFixed2, formatToFraction } from '@/utils'
|
||||
import { ProduceOrderApi, ProduceOrderVO } from '@/api/oms/produceorder'
|
||||
|
||||
defineOptions({ name: 'ProduceOrderAdd' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { push, currentRoute } = useRouter() // 路由
|
||||
const { params, name } = useRoute() // 查询参数
|
||||
const { delView } = useTagsViewStore() // 视图操作
|
||||
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const isDetail = ref(false) // 是否查看详情
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
billno: undefined,
|
||||
orderNo: undefined,
|
||||
customerCode: undefined,
|
||||
productId: undefined,
|
||||
productCode: undefined,
|
||||
productName: undefined,
|
||||
saleContractNo: undefined,
|
||||
contractDate: undefined,
|
||||
contractQty: undefined,
|
||||
produceQty: undefined,
|
||||
deliveryPlace: undefined,
|
||||
clerk: undefined,
|
||||
reportDate: undefined,
|
||||
produceDate: undefined,
|
||||
days: undefined,
|
||||
produceLine: undefined,
|
||||
deliveryMethod: undefined,
|
||||
inspectionDate: undefined,
|
||||
deliverydate: undefined,
|
||||
deliveryQty: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
})
|
||||
|
||||
|
||||
/** 获得详情 */
|
||||
const getDetail = async () => {
|
||||
if ('ProduceOrderDetail' === name) {
|
||||
isDetail.value = true
|
||||
}
|
||||
const id = params.id as unknown as number
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
const res = (await ProduceOrderApi.getProduceOrder(id)) as ProduceOrderApi.ProduceOrderVO
|
||||
formData.value = res
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = async () => {
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 深拷贝一份, 这样最终 server 端不满足,不需要影响原始数据
|
||||
const deepCopyFormData = cloneDeep(unref(formData.value)) as ProduceOrderApi.ProduceOrderVO
|
||||
// 校验都通过后提交表单
|
||||
const data = deepCopyFormData as ProduceOrderApi.ProduceOrderVO
|
||||
const id = params.id as unknown as number
|
||||
if (!id) {
|
||||
await ProduceOrderApi.createProduceOrder(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await ProduceOrderApi.updateProduceOrder(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
close()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 关闭按钮 */
|
||||
const close = () => {
|
||||
delView(unref(currentRoute))
|
||||
push({ name: 'ProduceOrder' })
|
||||
}
|
||||
|
||||
/** 初始化 */
|
||||
onMounted(async () => {
|
||||
await getDetail()
|
||||
})
|
||||
|
||||
</script>
|
||||
|
|
@ -114,13 +114,13 @@
|
|||
|
||||
<el-row :gutter="10" class="-mb-1px">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
type="primary"
|
||||
@click="preview()"
|
||||
plain
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 打印
|
||||
</el-button>
|
||||
</el-button>-->
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
|
|
@ -315,6 +315,16 @@ const formRef = ref()
|
|||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
/*
|
||||
const openForm = (id?: number) => {
|
||||
// 修改
|
||||
if (typeof id === 'number') {
|
||||
push({ name: 'ProductSpuEdit', params: { id } })
|
||||
return
|
||||
}
|
||||
// 新增
|
||||
push({ name: 'ProductSpuAdd' })
|
||||
}*/
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
export default {
|
||||
"panels":
|
||||
[
|
||||
"panels": [
|
||||
{
|
||||
"index": 0,
|
||||
"name": 1,
|
||||
|
|
@ -67,7 +66,7 @@ export default {
|
|||
"bottom": 48.741851806640625,
|
||||
"vCenter": 527.2480087280273,
|
||||
"hCenter": 43.866851806640625,
|
||||
"field": "asdasd",
|
||||
"field": "batchno",
|
||||
"coordinateSync": false,
|
||||
"widthHeightSync": false,
|
||||
"fontSize": 7.5,
|
||||
|
|
@ -163,7 +162,7 @@ export default {
|
|||
"bottom": 115.49387741088867,
|
||||
"vCenter": 258.74796295166016,
|
||||
"hCenter": 110.61887741088867,
|
||||
"field": "produceDate",
|
||||
"field": "produceDateStr",
|
||||
"coordinateSync": false,
|
||||
"widthHeightSync": false,
|
||||
"fontSize": 7.5,
|
||||
|
|
@ -282,7 +281,7 @@ export default {
|
|||
"bottom": 130.74609375,
|
||||
"vCenter": 278.49609375,
|
||||
"hCenter": 125.87109375,
|
||||
"field": "inspectionDate",
|
||||
"field": "inspectionDateStr",
|
||||
"coordinateSync": false,
|
||||
"widthHeightSync": false,
|
||||
"fontSize": 7.5,
|
||||
|
|
@ -300,14 +299,14 @@ export default {
|
|||
"top": 145.33333333333331,
|
||||
"height": 16,
|
||||
"width": 120,
|
||||
"field": "contractDate",
|
||||
"field": "contractDateStr",
|
||||
"testData": "2024-02-21",
|
||||
"fontSize": 7.75,
|
||||
"fontWeight": "700",
|
||||
"textAlign": "left",
|
||||
"textContentVerticalAlign": "middle",
|
||||
"title": "合约日期",
|
||||
"qid": "contractDate",
|
||||
"qid": "contractDateStr",
|
||||
"right": 153,
|
||||
"bottom": 191.49797439575195,
|
||||
"vCenter": 93,
|
||||
|
|
@ -406,7 +405,7 @@ export default {
|
|||
"bottom": 208.49390029907227,
|
||||
"vCenter": 418.49796295166016,
|
||||
"hCenter": 203.61890029907227,
|
||||
"field": "deliverydate",
|
||||
"field": "deliverydateStr",
|
||||
"coordinateSync": false,
|
||||
"widthHeightSync": false,
|
||||
"fixed": true,
|
||||
|
|
@ -506,14 +505,14 @@ export default {
|
|||
"top": 259.5,
|
||||
"height": 16,
|
||||
"width": 120,
|
||||
"field": "reportTime",
|
||||
"field": "reportTimeStr",
|
||||
"testData": "12312",
|
||||
"fontSize": 7.75,
|
||||
"fontWeight": "700",
|
||||
"textAlign": "left",
|
||||
"textContentVerticalAlign": "middle",
|
||||
"title": "报告时间",
|
||||
"qid": "reportTime",
|
||||
"qid": "reportTimeStr",
|
||||
"right": 378.7459487915039,
|
||||
"bottom": 264.9918575286865,
|
||||
"vCenter": 318.7459487915039,
|
||||
|
|
@ -533,14 +532,14 @@ export default {
|
|||
"top": 259.5,
|
||||
"height": 16,
|
||||
"width": 120,
|
||||
"field": "reportDate",
|
||||
"field": "reportDateStr",
|
||||
"testData": "XS888888888",
|
||||
"fontSize": 7.75,
|
||||
"fontWeight": "700",
|
||||
"textAlign": "left",
|
||||
"textContentVerticalAlign": "middle",
|
||||
"title": "报告日期",
|
||||
"qid": "reportDate",
|
||||
"qid": "reportDateStr",
|
||||
"right": 137.24185180664062,
|
||||
"bottom": 277.74796295166016,
|
||||
"vCenter": 77.24185180664062,
|
||||
|
|
@ -573,7 +572,7 @@ export default {
|
|||
"coordinateSync": false,
|
||||
"widthHeightSync": false,
|
||||
"qrCodeLevel": 0,
|
||||
"field": "scxq"
|
||||
"field": "productionDetails"
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "订单编号",
|
||||
|
|
@ -1267,6 +1266,226 @@ export default {
|
|||
"title": "制单人",
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 69,
|
||||
"top": 585,
|
||||
"height": 9,
|
||||
"width": 90,
|
||||
"borderWidth": 0.75
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "横线",
|
||||
"type": "hline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 210,
|
||||
"top": 585,
|
||||
"height": 9,
|
||||
"width": 90,
|
||||
"borderWidth": 0.75
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "横线",
|
||||
"type": "hline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 357,
|
||||
"top": 585,
|
||||
"height": 9,
|
||||
"width": 90,
|
||||
"borderWidth": 0.75
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "横线",
|
||||
"type": "hline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 510,
|
||||
"top": 585,
|
||||
"height": 9,
|
||||
"width": 90,
|
||||
"borderWidth": 0.75
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "横线",
|
||||
"type": "hline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 69,
|
||||
"top": 628.5,
|
||||
"height": 9,
|
||||
"width": 90,
|
||||
"borderWidth": 0.75
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "横线",
|
||||
"type": "hline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 210,
|
||||
"top": 628.5,
|
||||
"height": 9,
|
||||
"width": 90,
|
||||
"borderWidth": 0.75
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "横线",
|
||||
"type": "hline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 355.5,
|
||||
"top": 627,
|
||||
"height": 9,
|
||||
"width": 90,
|
||||
"borderWidth": 0.75,
|
||||
"right": 446.2459487915039,
|
||||
"bottom": 637.4959487915039,
|
||||
"vCenter": 401.2459487915039,
|
||||
"hCenter": 632.9959487915039
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "横线",
|
||||
"type": "hline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 504,
|
||||
"top": 627,
|
||||
"height": 9,
|
||||
"width": 90,
|
||||
"borderWidth": 0.75,
|
||||
"right": 599.2480087280273,
|
||||
"bottom": 636.7500228881836,
|
||||
"vCenter": 554.2480087280273,
|
||||
"hCenter": 632.2500228881836
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "横线",
|
||||
"type": "hline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 69,
|
||||
"top": 669,
|
||||
"height": 9,
|
||||
"width": 90,
|
||||
"borderWidth": 0.75
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "横线",
|
||||
"type": "hline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 210,
|
||||
"top": 669,
|
||||
"height": 9,
|
||||
"width": 90,
|
||||
"borderWidth": 0.75
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "横线",
|
||||
"type": "hline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 355.5,
|
||||
"top": 670.5,
|
||||
"height": 9,
|
||||
"width": 90,
|
||||
"borderWidth": 0.75,
|
||||
"right": 444.0000228881836,
|
||||
"bottom": 677.9979858398438,
|
||||
"vCenter": 399.0000228881836,
|
||||
"hCenter": 673.4979858398438
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "横线",
|
||||
"type": "hline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 510,
|
||||
"top": 669,
|
||||
"height": 9,
|
||||
"width": 90,
|
||||
"borderWidth": 0.75
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "横线",
|
||||
"type": "hline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 510,
|
||||
"top": 712.5,
|
||||
"height": 9,
|
||||
"width": 90,
|
||||
"borderWidth": 0.75
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "横线",
|
||||
"type": "hline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 354,
|
||||
"top": 712.5,
|
||||
"height": 9,
|
||||
"width": 90,
|
||||
"borderWidth": 0.75
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "横线",
|
||||
"type": "hline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 213,
|
||||
"top": 712.5,
|
||||
"height": 9,
|
||||
"width": 90,
|
||||
"borderWidth": 0.75
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "横线",
|
||||
"type": "hline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 69,
|
||||
"top": 712.5,
|
||||
"height": 9,
|
||||
"width": 90,
|
||||
"borderWidth": 0.75
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "横线",
|
||||
"type": "hline"
|
||||
}
|
||||
}
|
||||
],
|
||||
"paperNumberLeft": 565,
|
||||
|
|
|
|||
Loading…
Reference in New Issue