Merge branch 'dev' of https://git.yfgame.vip/r/hangtag into dev

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
This commit is contained in:
YuanFeng 2024-10-23 23:58:42 +08:00
commit 21a0ca112e
32 changed files with 1315 additions and 247 deletions

View File

@ -0,0 +1,21 @@
package cn.hangtag.module.oms.enums;
public interface CodeRuleIDConstants {
/**
* 客户
*/
Long KH = 5L;
/**
* 销售订单
*/
Long XSDD = 6L;
/**
* 销售合约
*/
Long XSHY = 7L;
/**
* 生产制单
*/
Long SCZD = 8L;
}

View File

@ -13,6 +13,7 @@ public interface ErrorCodeConstants extends cn.hangtag.module.system.enums.Erro
ErrorCode SHAPE_TEMPLATE_NOT_EXISTS = new ErrorCode(3400, "图形模板管理 不存在");
ErrorCode DRAFT_DESIGN_DATA_NOT_EXISTS = new ErrorCode(3500, "稿件模板数据 不存在");
ErrorCode SALE_ORDER_NOT_EXISTS = new ErrorCode(3600, "OMS销售订单不存在");
ErrorCode SALE_ORDER_NOT_DELETE = new ErrorCode(3601, "OMS销售订单已审核不允许删除");
ErrorCode SALE_ORDER_ENTRY_NOT_EXISTS = new ErrorCode(3700, "OMS销售订单明细不存在");
ErrorCode SALE_ORDER_ENTRY_PRICE_NOT_NULL= new ErrorCode(3701, "单价不允许为空");
ErrorCode SALE_ORDER_SKU_NOT_EXISTS = new ErrorCode(3702, "产品单价记录不存在");

View File

@ -11,13 +11,14 @@ import lombok.Getter;
@AllArgsConstructor
public enum BillStatusEnum {
//订单状态已下单生产中已完成
//单据状态暂存已提交已审核
//单据状态暂存已提交已审核已排产
REJECT("AA", "驳回"),
SAVE("A", "暂存"),
SUBMIT("B", "已提交"),
AUDIT("C", "已审核"),
INVALID("D", "作废");
INVALID("D", "作废"),
YPLAN("E", "已排产");
/**
* 状态

View File

@ -70,6 +70,18 @@ public class CustomerRespVO {
@ExcelProperty("类型")
private String type;
@Schema(description = "发票抬头")
@ExcelProperty("发票抬头")
private String invoiceCode;
@Schema(description = "发票名称")
@ExcelProperty("发票名称")
private String invoiceName;
@Schema(description = "发票地址")
@ExcelProperty("发票地址")
private String invoiceAddress;
@Schema(description = "数据状态", example = "2")
@ExcelProperty(value = "数据状态", converter = DictConvert.class)
@DictFormat("oms_data_status") // TODO 代码优化建议设置到对应的 DictTypeConstants 枚举类中

View File

@ -54,6 +54,24 @@ public class CustomerSaveReqVO {
@Schema(description = "备注")
private String remarks;
/**
* 发票抬头
*/
@Schema(description = "发票抬头")
private String invoiceCode;
/**
* 发票名称
*/
@Schema(description = "发票名称")
private String invoiceName;
/**
* 发票地址
*/
@Schema(description = "发票地址")
private String invoiceAddress;
@Schema(description = "订单地址列表")
private List<CustomerAddressDO> customerAddresss;

View File

@ -28,6 +28,9 @@ public class ProduceOrderRespVO {
@ExcelProperty("客户编号")
private String customerCode;
@Schema(description = "产品ID", example = "11111")
private Long productId;
@Schema(description = "产品编号", example = "11111")
@ExcelProperty("产品编号")
private String productCode;
@ -92,4 +95,16 @@ public class ProduceOrderRespVO {
@ExcelProperty("交货数量")
private Long deliveryQty;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "更新时间")
@ExcelProperty("更新时间")
private LocalDateTime updateTime;
@Schema(description = "详情")
private String details;
}

View File

@ -20,6 +20,9 @@ public class ProduceOrderSaveReqVO {
@Schema(description = "订单号")
private String orderNo;
@Schema(description = "客户ID")
private Long customerId;
@Schema(description = "客户编号")
private String customerCode;
@ -47,7 +50,7 @@ public class ProduceOrderSaveReqVO {
@Schema(description = "交货地点")
private String deliveryPlace;
@Schema(description = "职员")
@Schema(description = "职员")
private String clerk;
@Schema(description = "报告日期")
@ -74,4 +77,7 @@ public class ProduceOrderSaveReqVO {
@Schema(description = "交货数量")
private Long deliveryQty;
@Schema(description = "详情")
private String details;
}

View File

@ -27,7 +27,7 @@ public class SaleOrderEntryItemDTO implements Serializable {
/**
* 产品id
*/
private Integer productId;
private Long productId;
/**
* 产品编码

View File

@ -79,6 +79,21 @@ public class CustomerDO extends BaseDO {
* 备注
*/
private String remarks;
/**
* 发票抬头
*/
private String invoiceCode;
/**
* 发票名称
*/
private String invoiceName;
/**
* 发票地址
*/
private String invoiceAddress;
/**
* 数据状态
*

View File

@ -116,5 +116,9 @@ public class ProduceOrderDO extends BaseDO {
* 交货数量
*/
private Long deliveryQty;
/**
* 详情
*/
private String details;
}

View File

@ -94,17 +94,14 @@ public class SaleOrderDO extends BaseDO {
* 发票名称
*/
private String invoiceName;
/**
* 发票地址
*/
private String invoiceAddress;
/**
* 发票备注
*/
private String invoiceRemarks;
/**
* 地址
*/
@ -113,7 +110,6 @@ public class SaleOrderDO extends BaseDO {
* 货币
*/
private String currency;
/**
* 驳回原因
*/
@ -126,7 +122,6 @@ public class SaleOrderDO extends BaseDO {
* 审核时间
*/
private LocalDateTime auditorTime;
/**
* 订单号
*/
@ -147,24 +142,18 @@ public class SaleOrderDO extends BaseDO {
* 零售商单号
*/
private String retailerCode;
/**
* 品牌id
*/
private Integer brandId;
/**
* 是否分批交货 分批交货以明细表中的交货日期为准
*/
private Boolean isBatch;
/**
* 交货地址
*/
private String deliveryAddress;
/**
* 交货备注
*/

View File

@ -34,7 +34,7 @@ public class SaleOrderEntryDO extends BaseDO {
/**
* 物料id
*/
private Integer materialId;
private Long materialId;
/**
* 物料名称
*/

View File

@ -39,4 +39,11 @@ public interface SaleOrderSkuMapper extends BaseMapperX<SaleOrderSkuDO> {
.orderByDesc(SaleOrderSkuDO::getId));
}
default List<SaleOrderSkuDO> selectListByEntryId(Long entryId) {
return selectList(SaleOrderSkuDO::getEntryId, entryId);
}
default int deleteByEntryId(Long entryId) {
return delete(SaleOrderSkuDO::getEntryId, entryId);
}
}

View File

@ -6,6 +6,7 @@ import cn.hangtag.framework.common.util.FuncUtil;
import cn.hangtag.framework.common.util.validation.ValidationUtils;
import cn.hangtag.framework.mybatis.core.dataobject.BaseDO;
import cn.hangtag.module.oms.dal.dataobject.saleorder.SaleOrderDO;
import cn.hangtag.module.oms.enums.CodeRuleIDConstants;
import cn.hangtag.module.oms.serialnumber.CodingRulesUtils;
import cn.hangtag.module.system.controller.admin.user.vo.user.UserImportRespVO;
import cn.hangtag.module.system.controller.admin.user.vo.user.UserSaveReqVO;
@ -140,7 +141,7 @@ public class ProduceOrderServiceImpl implements ProduceOrderService {
while (true){
count --;
try {
s = CodingRulesUtils.generateCode(5L, false);
s = CodingRulesUtils.generateCode(CodeRuleIDConstants.SCZD, false);
checkCode(null,s);
return s;
}catch (ServiceException e){

View File

@ -14,6 +14,7 @@ import cn.hangtag.module.oms.controller.admin.trade.vo.TradeOrderTrendRespVO;
import cn.hangtag.module.oms.dal.dataobject.saleorder.SaleOrderDO;
import cn.hangtag.module.oms.dal.dataobject.saleorderentry.SaleOrderEntryDO;
import cn.hangtag.framework.common.pojo.PageResult;
import cn.hangtag.module.oms.dal.dataobject.saleordersku.SaleOrderSkuDO;
/**
* 销售订单 Service 接口
@ -72,9 +73,7 @@ public interface SaleOrderService {
Map<Integer, Long> getTabsCount(Long customerId);
default void updateSaleOrderBillStatus(List<Long> ids, String status){
updateSaleOrderBillStatus(ids,status,null);
}
void updateSaleOrderBillStatus(List<Long> ids, String status);
void updateSaleOrderBillStatus(List<Long> ids, String status,Map<String,Object> params);
void generateProduceOrder(List<Long> ids);
@ -110,4 +109,7 @@ public interface SaleOrderService {
Long placeOrder(CreateSaleOrderDTO dto);
public String getNewOrderCode();
public String getNewOrderCode2();
List<SaleOrderSkuDO> getSaleOrderSkuEntryListByEntryId(Long entryId);
}

View File

@ -14,6 +14,7 @@ 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.front.dto.CreateSaleOrderDTO;
import cn.hangtag.module.oms.controller.admin.saleorder.front.dto.SaleOrderEntryItemDTO;
import cn.hangtag.module.oms.controller.admin.saleorder.front.dto.SaleOrderSkuDTO;
@ -25,6 +26,7 @@ import cn.hangtag.module.oms.controller.admin.trade.vo.TradeOrderTrendReqVO;
import cn.hangtag.module.oms.controller.admin.trade.vo.TradeOrderTrendRespVO;
import cn.hangtag.module.oms.convert.saleorder.SaleOrderConvert;
import cn.hangtag.module.oms.dal.dataobject.customer.CustomerDO;
import cn.hangtag.module.oms.dal.dataobject.produceorder.ProduceOrderDO;
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;
@ -32,6 +34,8 @@ import cn.hangtag.module.oms.dal.dataobject.salecontractentry.SaleContractEntryD
import cn.hangtag.module.oms.dal.dataobject.saleorder.SaleOrderDO;
import cn.hangtag.module.oms.dal.dataobject.saleorderentry.SaleOrderEntryDO;
import cn.hangtag.module.oms.dal.dataobject.saleordersku.SaleOrderSkuDO;
import cn.hangtag.module.oms.dal.mysql.customer.CustomerMapper;
import cn.hangtag.module.oms.dal.mysql.salecontract.SaleContractMapper;
import cn.hangtag.module.oms.dal.mysql.saleorder.SaleOrderMapper;
import cn.hangtag.module.oms.dal.mysql.saleorderentry.SaleOrderEntryMapper;
import cn.hangtag.module.oms.dal.mysql.saleordersku.SaleOrderSkuMapper;
@ -46,11 +50,15 @@ 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.hangtag.module.system.mq.message.mail.MailSendMessage;
import cn.hangtag.module.system.service.mail.MailAccountService;
import cn.hangtag.module.system.service.mail.MailSendService;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IORuntimeException;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
@ -58,12 +66,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.thymeleaf.TemplateEngine;
import org.thymeleaf.context.Context;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotNull;
import java.io.File;
@ -73,14 +84,12 @@ import java.io.InputStream;
import java.math.BigDecimal;
import java.time.Duration;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import static cn.hangtag.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.hangtag.module.oms.enums.ErrorCodeConstants.SALE_ORDER_NOT_DELETE;
import static cn.hangtag.module.oms.enums.ErrorCodeConstants.SALE_ORDER_NOT_EXISTS;
/**
@ -91,19 +100,45 @@ import static cn.hangtag.module.oms.enums.ErrorCodeConstants.SALE_ORDER_NOT_EXIS
@Service
@Validated
@Slf4j
@AllArgsConstructor
//@AllArgsConstructor
public class SaleOrderServiceImpl implements SaleOrderService {
@Resource
private SaleOrderMapper saleOrderMapper;
@Resource
private SaleContractMapper saleContractMapper;
@Resource
private SaleOrderEntryMapper saleOrderEntryMapper;
@Resource
private SaleOrderSkuMapper skuOrderSkuMapper;
@Resource
private ProduceOrderService produceOrderService;
@Resource
private ProductInfoService productInfoService;
@Resource
private SaleContractService saleContractService;
@Resource
private CustomerService customerService;
@Resource
private CustomerMapper customerMapper;
@Resource
private ProductPriceService productPriceService;
@Resource
private TemplateEngine templateEngine;
@Resource
private MailSendService mailSendService;
@Value("${oms.partyb}")
private String partyb;
@Value("${oms.partybAddress}")
private String partybAddress;
@Value("${pdfPath}")
private String pdfPath;
private final SaleOrderMapper saleOrderMapper;
private final SaleOrderEntryMapper saleOrderEntryMapper;
private final SaleOrderSkuMapper skuOrderSkuMapper;
private final ProduceOrderService produceOrderService;
private final ProductInfoService productInfoService;
private final SaleContractService saleContractService;
private final CustomerService customerService;
private final ProductPriceService productPriceService;
private final TemplateEngine templateEngine;
@Override
@ -127,7 +162,6 @@ public class SaleOrderServiceImpl implements SaleOrderService {
// 更新
SaleOrderDO updateObj = BeanUtils.toBean(updateReqVO, SaleOrderDO.class);
saleOrderMapper.updateById(updateObj);
// 更新子表
updateSaleOrderEntryList(updateReqVO.getId(), updateReqVO.getEntrys());
}
@ -136,6 +170,7 @@ public class SaleOrderServiceImpl implements SaleOrderService {
@Transactional(rollbackFor = Exception.class)
public void deleteSaleOrder(Long id) {
// 校验存在
validateSaleOrderStatus(id);
validateSaleOrderExists(id);
// 删除
saleOrderMapper.deleteById(id);
@ -150,6 +185,15 @@ public class SaleOrderServiceImpl implements SaleOrderService {
}
}
private void validateSaleOrderStatus(Long id) {
SaleOrderDO saleOrderDO = saleOrderMapper.selectById(id);
if (saleOrderDO == null) {
if(BillStatusEnum.AUDIT.getValue().equals(saleOrderDO.getBillStatus())){
throw exception(SALE_ORDER_NOT_DELETE);
}
}
}
@Override
public SaleOrderDO getSaleOrder(Long id) {
return saleOrderMapper.selectById(id);
@ -210,9 +254,14 @@ public class SaleOrderServiceImpl implements SaleOrderService {
saleOrderMapper.selectCount(lambdaQueryWrapper2));
return counts;
}
@Override
public void updateSaleOrderBillStatus(List<Long> ids, String status,Map<String,Object> params) {
@Transactional(rollbackFor = Exception.class)
public void updateSaleOrderBillStatus(List<Long> ids, String status){
updateSaleOrderBillStatus(ids,status,null);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateSaleOrderBillStatus(List<Long> ids, String status,Map<String,Object> params){
List<SaleOrderDO> saleOrders = saleOrderMapper.selectList(SaleOrderDO::getId, ids);
switch (status){
case "invalid":
@ -251,7 +300,7 @@ public class SaleOrderServiceImpl implements SaleOrderService {
if(entrys==null||entrys.isEmpty()){
throw new ServiceException(001,"产品明细为空");
}
for (cn.hangtag.module.oms.dal.dataobject.saleorderentry.SaleOrderEntryDO entry : entrys) {
for (SaleOrderEntryDO entry : entrys) {
BigDecimal price = entry.getPrice();
if(price==null){
throw new ServiceException(ErrorCodeConstants.SALE_ORDER_ENTRY_PRICE_NOT_NULL);
@ -259,7 +308,7 @@ public class SaleOrderServiceImpl implements SaleOrderService {
}
saleOrder.setBillStatus(BillStatusEnum.AUDIT.getValue());
saleOrder.setOrderStatus(SaleOrderStatusEnum.YWC.getValue());
saleOrder.setOrderStatus(SaleOrderStatusEnum.SCZ.getValue());
Long userId = SecurityFrameworkUtils.getLoginUserId();
saleOrder.setAuditor(userId.toString());
saleOrder.setAuditorTime(LocalDateTime.now());
@ -267,15 +316,39 @@ public class SaleOrderServiceImpl implements SaleOrderService {
//生成产品单价记录
for (cn.hangtag.module.oms.dal.dataobject.saleorderentry.SaleOrderEntryDO entry : entrys) {
for (SaleOrderEntryDO entry : entrys) {
Long parentId = entry.getParentId();
BigDecimal price = entry.getPrice();
generateProductPrice(parentId,price);
}
//生成销售合约
Long saleContractId = generateSaleContract(saleOrder,entrys);
String htmlContent = generateHtmlContent(saleContractId);
String fileName = StrUtil.format(pdfPath+"/销售合约_{}",
new Date().getTime());
String templatePath = fileName + ".html";
String pdfPath = fileName + ".pdf";
FileUtil.writeString(htmlContent,templatePath, "UTF-8");
WKHtmlToPdfUtil.convert(templatePath, pdfPath);
//发送消息
String emails = saleOrder.getEmails();
if(StringUtils.isNotBlank(emails)){
MailSendMessage message = new MailSendMessage();
message.setAccountId(1L);
message.setMail(emails);
message.setTitle("OMS订单系统");
message.setContent("您好,您的订单:"+saleOrder.getBillno()+",已审核通过!");
mailSendService.doSendMail(message,new File(pdfPath));
}
}
}
break;
}
}
@ -290,27 +363,56 @@ public class SaleOrderServiceImpl implements SaleOrderService {
}
@Override
@Transactional(rollbackFor = Exception.class)
public void generateProduceOrder(List<Long> ids) {
List<SaleOrderDO> saleOrders = saleOrderMapper.selectList(SaleOrderDO::getId, ids);
for (SaleOrderDO saleOrder : saleOrders) {
ProduceOrderSaveReqVO saveReqVO = new ProduceOrderSaveReqVO();
saveReqVO.setOrderNo(saleOrder.getBillno());
saveReqVO.setCustomerCode("客户编号");
saveReqVO.setProductId(0L);
saveReqVO.setProduceLine("测试线");
saveReqVO.setDeliveryMethod("交货方式");
saveReqVO.setDeliveryQty(1111111L);
saveReqVO.setDays(5L);
saveReqVO.setClerk("职员");
saveReqVO.setContractDate(LocalDateTime.now() );
Long produceOrderId = produceOrderService.createProduceOrder(saveReqVO);
CustomerDO customer = customerService.getCustomer(saleOrder.getCustomerId());
List<SaleOrderEntryDO> entrys = getSaleOrderEntryListByParentId(saleOrder.getId());
for (SaleOrderEntryDO entry : entrys) {
List<SaleOrderSkuDO> saleOrderSkuDO = getSaleOrderSkuEntryListByEntryId(entry.getId());
ProductInfoDO productInfo = productInfoService.getProductInfo(entry.getMaterialId());
ProduceOrderSaveReqVO saveReqVO = new ProduceOrderSaveReqVO();
saveReqVO.setOrderNo(saleOrder.getBillno());
saveReqVO.setSaleContractNo(saleOrder.getBillno());
saveReqVO.setCustomerId(customer.getId());
saveReqVO.setCustomerCode(customer.getNumber());
saveReqVO.setProductId(entry.getMaterialId());
saveReqVO.setProductCode(productInfo.getCode());
saveReqVO.setProductName(productInfo.getName());
saveReqVO.setProduceLine("");
saveReqVO.setDeliveryMethod("全部");
saveReqVO.setDeliveryQty(Long.valueOf(entry.getQty()));
saveReqVO.setContractQty(Long.valueOf(entry.getQty()));
saveReqVO.setProduceQty(Long.valueOf(entry.getQty()));
saveReqVO.setDays(1L);
saveReqVO.setClerk(customer.getSaleperson());
saveReqVO.setContractDate(LocalDateTime.now());
saveReqVO.setReportDate(LocalDateTime.now());
saveReqVO.setProduceDate(LocalDateTime.now());
saveReqVO.setInspectionDate(LocalDateTime.now());
saveReqVO.setDeliverydate(LocalDateTime.now());
Double specSizeWidth = productInfo.getSpecSizeWidth();
Double specSizeHeight = productInfo.getSpecSizeHeight();
Double specSizeThk = productInfo.getSpecSizeThk();
String specMaterial = productInfo.getSpecMaterial();
StringBuffer str = new StringBuffer();
str.append(String.format("货名:%s\r\n",productInfo.getName()));
str.append(String.format("规格:%s × %s \r\n",specSizeWidth,specSizeHeight));
str.append(String.format("纸质:%s × %s \r\n",specMaterial));
saveReqVO.setDetails(str.toString());
Long produceOrderId = produceOrderService.createProduceOrder(saveReqVO);
}
//更新销售订单已完成
/*if(produceOrderId!=null){
SaleOrderSaveReqVO saleOrderSaveReqVO = new SaleOrderSaveReqVO();
saleOrderSaveReqVO.setId(saleOrder.getId());
saleOrderSaveReqVO.setOrderStatus(SaleOrderStatusEnum.YWC.getValue());
updateSaleOrder(saleOrderSaveReqVO);
}*/
//if(produceOrderId!=null){
SaleOrderDO saleOrderDO = new SaleOrderDO();
saleOrderDO.setId(saleOrder.getId());
saleOrderDO.setOrderStatus(SaleOrderStatusEnum.YWC.getValue());
saleOrderMapper.updateById(saleOrderDO);
//}
}
}
@ -320,14 +422,14 @@ public class SaleOrderServiceImpl implements SaleOrderService {
CustomerDO customer = customerService.getCustomer(saleContract.getCustomerId());
Context context = new Context();
context.setVariable("title", "销售合约");
context.setVariable("partyACompany", saleContract.getPartyA());
context.setVariable("contractNo", saleContract.getBillno());
context.setVariable("partyACompany", saleContract.getPartyA());
context.setVariable("partyAAddress", customer.getCompanyAddress());
context.setVariable("partyBCompany", partyb);
context.setVariable("partyBAddress", partybAddress);
context.setVariable("bizDate", DateUtil.date(saleContract.getBizdate()).toDateStr());
context.setVariable("customerNo", customer.getNumber());
context.setVariable("headUserName", saleContract.getHead());
context.setVariable("partyBCompany", "乙方公司");
context.setVariable("partyBAddress", "乙方地址XXXXXXXXXXX");
context.setVariable("phone", saleContract.getPhone());
context.setVariable("fax", saleContract.getFax());
context.setVariable("clerk", saleContract.getClerk());
@ -342,7 +444,10 @@ public class SaleOrderServiceImpl implements SaleOrderService {
String code = productInfo.getCode();
String name = productInfo.getName();
String details = productInfo.getDetails();
Double specSizeHeight = productInfo.getSpecSizeHeight();
Double specSizeWidth = productInfo.getSpecSizeWidth();
Double specSizeThk = productInfo.getSpecSizeThk();
String spec = specSizeWidth.doubleValue()+ " * " + specSizeHeight.doubleValue() + " " + specSizeThk.doubleValue();
int j = i+1;
context.setVariable("item"+j, j+"");
context.setVariable("explain"+j, code);
@ -350,10 +455,10 @@ public class SaleOrderServiceImpl implements SaleOrderService {
context.setVariable("price"+j, saleContractEntryDO.getPrice());
context.setVariable("discount"+j, saleContractEntryDO.getDiscount());
context.setVariable("amount"+j, saleContractEntryDO.getAmount());
context.setVariable("deliverydate"+j, saleContractEntryDO.getDeliveryDate());
context.setVariable("deliverydate"+j, DateUtil.date(saleContractEntryDO.getDeliveryDate()).toDateStr());
context.setVariable("explain"+j+"1", name);
context.setVariable("explain"+j+"2", details);
context.setVariable("explain"+j+"3", "");
context.setVariable("explain"+j+"3", spec);
}
return templateEngine.process("pdf_template", context);
}
@ -491,10 +596,13 @@ public class SaleOrderServiceImpl implements SaleOrderService {
saleOrderMapper.insert(order);
saleOrderEntryMapper.insertBatch(entryList);
skuOrderSkuMapper.insertBatch(skuList);
updateCustomerInvoiceData(order);
System.out.println(order);
return order.getId();
}
private static final long codeId = 6L;
private static final long saleContractCodeId = 7L;
@Override
public String getNewOrderCode() {
String s = "";
@ -514,6 +622,25 @@ public class SaleOrderServiceImpl implements SaleOrderService {
}
}
}
@Override
public String getNewOrderCode2() {
String s = "";
int count = 10;
while (true){
count --;
try {
s = CodingRulesUtils.generateCode(saleContractCodeId, false);
checkCode2(null,s);
return s;
}catch (ServiceException e){
log.warn("重复或者下一个编码");
if(count < 0){
log.error("编码获取失败");
return "";
}
}
}
}
private void checkCode(Long id,String code){
if(FuncUtil.isNotEmpty(code)){
LambdaQueryWrapper<SaleOrderDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
@ -534,6 +661,28 @@ public class SaleOrderServiceImpl implements SaleOrderService {
}
}
}
private void checkCode2(Long id,String code){
if(FuncUtil.isNotEmpty(code)){
LambdaQueryWrapper<SaleContractDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.select(SaleContractDO::getId,SaleContractDO::getBillno, BaseDO::getDeleted);
lambdaQueryWrapper.eq(SaleContractDO::getBillno, code);
lambdaQueryWrapper.eq(SaleContractDO::getDeleted,false);
List<SaleContractDO> dos = saleContractMapper.selectList(lambdaQueryWrapper);
if(FuncUtil.isEmpty(id) && FuncUtil.isNotEmpty(dos)){
throw exception(GlobalErrorCodeConstants.DATA_DUPLICATE);
}
if (FuncUtil.isNotEmpty(id) && FuncUtil.isNotEmpty(dos)) {
for (SaleContractDO aDo : dos) {
// 出现重复并当前id 不一致
if(!FuncUtil.equals(aDo.getId(), id)){
throw exception(GlobalErrorCodeConstants.DATA_DUPLICATE);
}
}
}
}
}
private SaleOrderDO wrapperEntity(SaleOrderDO order,CreateSaleOrderDTO dto){
// 客户信息
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
@ -549,7 +698,7 @@ public class SaleOrderServiceImpl implements SaleOrderService {
order.setPlansenddate( FuncUtil.parseDate(dto.getPlansenddate()));
// 设置订单状态
order.setOrderStatus(SaleOrderStatusEnum.YXD.getValue());
order.setBillStatus(BillStatusEnum.SAVE.getValue());
order.setBillStatus(BillStatusEnum.SUBMIT.getValue());
String orderType = order.getOrderType();
if(FuncUtil.isEmpty(orderType)){
order.setOrderType(SaleOrderTypeEnum.NORMAL.getType());
@ -586,8 +735,27 @@ public class SaleOrderServiceImpl implements SaleOrderService {
}
private void createSaleOrderEntryList(Long parentId, List<SaleOrderEntryDO> list) {
BigDecimal amount = BigDecimal.ZERO;
list.forEach(o -> o.setParentId(parentId));
for (SaleOrderEntryDO saleOrderEntryDO : list) {
BigDecimal price = saleOrderEntryDO.getPrice();
Integer qty = saleOrderEntryDO.getQty();
BigDecimal discount = saleOrderEntryDO.getDiscount();
if(price!=null){
if(discount!=null){
saleOrderEntryDO.setAmount(price.multiply(BigDecimal.valueOf(qty)).multiply(discount));
}else {
saleOrderEntryDO.setAmount(price.multiply(BigDecimal.valueOf(qty)));
}
amount = amount.add(saleOrderEntryDO.getAmount());
}
}
saleOrderEntryMapper.insertBatch(list);
//更新总金额
SaleOrderDO saleOrderDO = new SaleOrderDO();
saleOrderDO.setId(parentId);
saleOrderDO.setOrderAmount(amount);
saleOrderMapper.updateById(saleOrderDO);
}
private void updateSaleOrderEntryList(Long parentId, List<SaleOrderEntryDO> list) {
@ -601,5 +769,65 @@ public class SaleOrderServiceImpl implements SaleOrderService {
}
/**
* 更新客户发票数据
*/
private void updateCustomerInvoiceData(SaleOrderDO order){
String invoiceCode = order.getInvoiceCode();
String invoiceName = order.getInvoiceName();
String invoiceAddress = order.getInvoiceAddress();
Long customerId = order.getCustomerId();
if(customerId!=null){
CustomerDO customer = customerService.getCustomer(customerId);
if(customer!=null){
customer.setInvoiceCode(invoiceCode);
customer.setInvoiceName(invoiceName);
customer.setInvoiceAddress(invoiceAddress);
customerMapper.updateById(customer);
}
}
}
private Long generateSaleContract(SaleOrderDO saleOrder, List<SaleOrderEntryDO> entrys){
CustomerDO customer = customerService.getCustomer(saleOrder.getCustomerId());
SaleContractSaveReqVO saveReqVO = new SaleContractSaveReqVO();
saveReqVO.setBillno(getNewOrderCode2());
saveReqVO.setCustomerId(saleOrder.getCustomerId());
saveReqVO.setCustomerName(customer.getName());
saveReqVO.setCustomerBuyNo(saleOrder.getBillno());
saveReqVO.setBizdate(saleOrder.getBizdate());
saveReqVO.setPartyA(customer.getCompany());
saveReqVO.setHead(customer.getGdperson());
saveReqVO.setClerk(customer.getSaleperson());
saveReqVO.setPhone(customer.getPhone());
saveReqVO.setFax(saleOrder.getFax());
saveReqVO.setAmount(saleOrder.getOrderAmount());
saveReqVO.setAddress(saleOrder.getDeliveryAddress());
List<SaleContractEntryDO> list = new ArrayList<>();
for (SaleOrderEntryDO entry : entrys) {
ProductInfoDO productInfo = productInfoService.getProductInfo(entry.getMaterialId());
SaleContractEntryDO saleContractEntryDO = new SaleContractEntryDO();
saleContractEntryDO.setProductId(entry.getMaterialId());
saleContractEntryDO.setProductNumber(productInfo.getCode());
saleContractEntryDO.setProductName(productInfo.getName());
saleContractEntryDO.setPrice(entry.getPrice());
saleContractEntryDO.setQty(entry.getQty());
saleContractEntryDO.setDiscount(entry.getDiscount());
saleContractEntryDO.setDeliveryDate(entry.getDeliveryDate());
saleContractEntryDO.setAmount(entry.getAmount());
list.add(saleContractEntryDO);
}
saveReqVO.setSaleContractEntrys(list);
return saleContractService.createSaleContract(saveReqVO);
}
@Override
public List<SaleOrderSkuDO> getSaleOrderSkuEntryListByEntryId(Long entryId) {
return skuOrderSkuMapper.selectListByEntryId(entryId);
}
}

View File

@ -2,6 +2,7 @@ package cn.hangtag.module.system.service.mail;
import cn.hangtag.module.system.mq.message.mail.MailSendMessage;
import java.io.File;
import java.util.Map;
/**
@ -55,6 +56,9 @@ public interface MailSendService {
*
* @param message 邮件
*/
void doSendMail(MailSendMessage message);
default void doSendMail(MailSendMessage message){
doSendMail(message, null);
}
void doSendMail(MailSendMessage message, File... files);
}

View File

@ -14,10 +14,15 @@ import cn.hangtag.module.system.service.member.MemberService;
import cn.hangtag.module.system.service.user.AdminUserService;
import com.google.common.annotations.VisibleForTesting;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import static cn.hangtag.framework.common.exception.util.ServiceExceptionUtil.exception;
@ -101,14 +106,25 @@ public class MailSendServiceImpl implements MailSendService {
}
@Override
public void doSendMail(MailSendMessage message) {
public void doSendMail(MailSendMessage message, File... files) {
// 1. 创建发送账号
MailAccountDO account = validateMailAccount(message.getAccountId());
MailAccount mailAccount = buildMailAccount(account, message.getNickname());
// 2. 发送邮件
try {
String messageId = MailUtil.send(mailAccount, message.getMail(),
message.getTitle(), message.getContent(), true);
String messageId = null;
List<String> mails = new ArrayList<>();
String mail = message.getMail();
if(StringUtils.isNotBlank(mail) && mail.contains(";")){
mails = Arrays.asList(mail.split(";"));
}
if(mails!=null && mails.size()>0){
messageId = MailUtil.send(mailAccount, mails,
message.getTitle(), message.getContent(), true,files);
}else {
messageId = MailUtil.send(mailAccount, message.getMail(),
message.getTitle(), message.getContent(), true,files);
}
// 3. 更新结果成功
mailLogService.updateMailSendResult(message.getLogId(), messageId, null);
} catch (Exception e) {

View File

@ -47,9 +47,9 @@ spring:
primary: master
datasource:
master:
url: jdbc:mysql://127.0.0.1:3306/hangtag?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
url: jdbc:mysql://202.74.40.60:33061/oms-uat?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
username: root
password: 123456
password: qygo5gYNhivG
# slave: # 模拟从库,可根据自己需要修改
# lazy: true # 开启懒加载,保证启动速度
# url: jdbc:mysql://43.136.71.164:3306/hangtag?allowMultiQueries=true&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&useUnicode=true&characterEncoding=UTF-8
@ -240,3 +240,4 @@ justauth:
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟

View File

@ -273,4 +273,10 @@ debug: false
# 积木报表配置
jeecg:
jmreport:
saas-mode: tenant
saas-mode: tenant
oms:
partyb: 东莞市网络网纳科技有限公司
partybAddress: 东莞市南城*********
pdfPath: C:\Users\Admin\Desktop\1111111\test

View File

@ -108,7 +108,7 @@ const dialogTitle = ref('产品列表') // 弹窗的标题
const props = defineProps({
modelValue: {
type: String,
type: [String,Number],
required: true
},
dataKey: {
@ -153,7 +153,12 @@ const that = reactive({
showValue: '',
visible: false,
})
const toStr = (data: any, def = '') => {
if (data !== null && data !== undefined) {
return `${data}`
}
return def
}
const openDialog = () => {
updateVisible(true);
}
@ -164,24 +169,6 @@ const viewDetails = () => {
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;
@ -199,7 +186,7 @@ const initInput = async () => {
let tmpInput = [];
let tmpShow = [];
for (let i = 0; i < ids.length; i++) {
const data = await BrandApi.getBrand(ids[i])
const data = await ProductInfoApi.getProductInfo(ids[i])
tmpInput.push(data[props.dataKey]);
tmpShow.push(data[props.showKey]);
}
@ -212,7 +199,29 @@ const initInput = async () => {
}
watch(() => props.visible, (newVal) => {
that.visible = newVal;
})
watch(() => props.modelValue, (newVal)=>{
that.inputVal = toStr(newVal,'')
if (that.inputVal) {
initInput();
}
},{
immediate: true
})
//
const tmp = computed(()=>{
setTimeout(()=>{
that.inputVal = toStr(props.modelValue,that.inputVal)
if (that.inputVal) {
initInput();
}
},100)
return ''
},{deep: true})
const clearData = () => {
that.inputVal = '';
that.showValue = '';

View File

@ -0,0 +1,190 @@
<!-- eslint-disable vue/this-in-template -->
<template>
<div
:id="cellInfo.id"
class="node-content"
:class="{ 'node-content-group' : this.cellInfo.editMode && this.cellInfo.propGroupId }"
:title="this.cellInfo.propGroupName"
v-reSize="changSize">
<div
style="position: absolute;"
:style="cellInfo.style">
</div>
</div>
</template>
<script lang="ts">
import {defineComponent} from 'vue'
import {
filterUnsafeHtml,
getSafeValue,
mergeDeepObject,
nextId
} from "@/components/DraftDesign/utils/FuncUtil";
import {configInfo, getDraftDesignState} from "@/components/DraftDesign/config";
export default defineComponent({
name: 'LineCellNode',
inject: ['getNode'],
data() {
return {
cellInfo: {
id: '',
label: '',
showInput: false,
style: {}
},
nodeInfo: {
store: {
data: {
data: {
label: ''
}
}
}
},
fontSize: 12,
targetElement: null
}
},
mounted() {
const node = (this as any).getNode()
this.nodeInfo = node
if (node && node.data) {
this.setCellInfo(node.data)
}
node.on('change:data', ({current}) => {
this.setCellInfo(current)
})
},
unmounted() {
},
methods: {
safeHtml(val) {
if (val) {
val = val.replace(/[\n\r]/g, "<br/>")
}
return filterUnsafeHtml(val)
},
inputBlur() {
this.cellInfo.showInput = false
},
inputChange() {
if (this.nodeInfo.store && this.nodeInfo.store.data) {
this.nodeInfo.store.data.data.label = this.cellInfo.label
}
},
setInput(val: boolean) {
this.cellInfo.showInput = val
},
changSize(size: any) {
},
changeFontSize() {
// this.cellInfo.style.height = `${this.fontSize }px`
},
removeTransform(val: string) {
let t = this.cellInfo.style.text.transform;
if (t) {
const split = t.split(' ');
const split1 = val.split("(");
let str = ""
for (let i = 0; i < split.length; i++) {
if (split[i].startsWith(split1[0])) {
continue
}
str += `${split[i]} `
}
this.cellInfo.style.text.transform = str;
}
},
addTransform(val: string) {
let t = this.cellInfo.style.text.transform;
if (t) {
const split = t.split(' ');
const split1 = val.split("(");
let add = true;
let str = ""
for (let i = 0; i < split.length; i++) {
if (split[i].startsWith(split1[0])) {
split[i] = val;
add = false
}
str += `${split[i]} `
}
if (add) {
str += `${val} `;
}
this.cellInfo.style.text.transform = str;
}
},
setCellInfo(info: any) {
if (!info) {
info = {
style: {
text: {}
}
}
}
const text = getSafeValue(info, 'style.text') || {}
const style = getSafeValue(info, 'style') || {}
this.cellInfo = mergeDeepObject({
showInput: false,
id: nextId(),
label: '',
style: {
bottom: 0,/* 直线在容器底部 */
width: '100%', /* 直线宽度匹配容器宽度 */
height: '20%', /* 直线的高度 */
backgroundColor: '#000', /* 直线的颜色 */
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%) scale(1)',
borderRadius: '0px 0px 0px 0px',
}
}, info)
setTimeout(() => {
if (this.nodeInfo.store && this.nodeInfo.store.data) {
this.nodeInfo.store.data.data = this.cellInfo
}
}, 300)
this.setInput(this.cellInfo.showInput)
this.cellInfo.editMode = getDraftDesignState();
if(this.cellInfo.editMode && this.cellInfo.propGroupId){
const showRandomGroupColor = configInfo.LK_SHOW_RANDOM_GROUP_COLOR()
if(!showRandomGroupColor){
setTimeout(()=>{
const [type, id] = this.cellInfo.propGroupId.split("_")
if(id){
document.getElementById(this.cellInfo.id)?.style.setProperty(
"--lk-prop-group-color",
`#${id}`
);
}
},100)
}
}
this.changeFontSize();
}
}
})
</script>
<style scoped lang="scss">
.node-content {
width: 100%;
height: 100%;
position: relative;
display: flex;
}
</style>

View File

@ -0,0 +1,282 @@
<!-- eslint-disable vue/this-in-template -->
<template>
<div
:id="cellInfo.id"
class="node-content"
:style="{
'alignItems' :cellInfo.style.alignItems
}"
:class="{ 'node-content-group' : this.cellInfo.editMode && this.cellInfo.propGroupId }"
:title="this.cellInfo.propGroupName"
v-reSize="changSize">
<span
:id="textElId"
:style="cellInfo.style.text"
v-html="safeHtml(cellInfo.label)">
</span>
<el-dialog
v-model="cellInfo.showInput"
append-to-body
>
<el-input
v-if="cellInfo.showInput"
v-model="cellInfo.label"
@input="inputChange"
style="width:100%;height: 100%;z-index: 9999;"
autosize
resize="none"
placeholder="输入文字"
@blur="inputBlur"
type="textarea"
/>
<template #footer>
<el-button type="primary" @click="setInput(false)">关闭</el-button>
</template>
</el-dialog>
</div>
</template>
<script lang="ts">
import {defineComponent} from 'vue'
import {
filterUnsafeHtml,
getSafeValue,
mergeDeepObject,
nextId
} from "@/components/DraftDesign/utils/FuncUtil";
import {configInfo, getDraftDesignState} from "@/components/DraftDesign/config";
export default defineComponent({
name: 'TextCellNode',
inject: ['getNode'],
data() {
return {
textElId: nextId(),
cellInfo: {
id: nextId(),
label: '新文本',
showInput: false,
style: {
alignItems: 'start', // start end center
text: {
minWidth: 'max-content',
minHeight: 'max-content',
fontSize: '14px',
marginLeft: 'auto',
fontWeight: 600,
fontFamily: '仿宋',
color: '#ffffff',
textAlign: 'left',
top: '50%',
left: '50%',
padding: '0 0',
transform: 'scaleX(1) scaleY(1) translate(-50%, -50%)',
textIndent: 0,
textDecoration: 'none',
textTransform: 'none',
textShadow: 'none',
textOverflow: 'clip',
whiteSpace: 'normal',
wordBreak: 'break-all',
whiteSpace: 'pre-wrap',
wordWrap: 'break-word',
}
}
},
nodeInfo: {
store: {
data: {
data: {
label: ''
}
}
}
},
fontSize: 12,
fontTop: 12,
targetElement: null
}
},
mounted() {
const node = (this as any).getNode()
this.nodeInfo = node
if (node && node.data) {
this.setCellInfo(node.data)
}
node.on('change:data', ({current}) => {
this.setCellInfo(current)
})
},
methods: {
safeHtml(val) {
if (val) {
val = val.replace(/[\n\r]/g, "<br/>")
}
return filterUnsafeHtml(val)
},
inputBlur() {
this.cellInfo.showInput = false
this.inputChange();
},
inputChange() {
if (this.nodeInfo.store && this.nodeInfo.store.data) {
// this.nodeInfo.store.data.data.label = this.cellInfo.label
this.nodeInfo.store.data.data = {
...this.nodeInfo.store.data.data,
...this.cellInfo
}
}
},
setInput(val: boolean) {
this.cellInfo.showInput = val;
this.inputChange();
},
changSize(size: any) {
// console.log("cellInfo.label",this.cellInfo.label)
// let s = size.height+12;
// if(s > 60){
// s= s + s / 3
// }
// if(s < 6){
// s = 6
// }else if(s >= 1000){
// s = 1000
// }
//
// // this.nodeInfo.store.data.size.width = size.width;
// console.log(" this.nodeInfo.width", this.nodeInfo)
// this.fontSize = s;
// this.changeFontSize();
},
changeFontSize() {
// let c = Math.floor((this.fontSize / 84))
// this.fontTop = 12
// if(c > 0){
// c *= 24
// this.fontTop = c;
// }
// this.cellInfo.style.text.top = `-${this.fontTop}px`
this.cellInfo.style.text.fontSize = `${this.fontSize}px`
},
removeTransform(val: string) {
let t = this.cellInfo.style.text.transform;
if (t) {
const split = t.split(' ');
const split1 = val.split("(");
let str = ""
for (let i = 0; i < split.length; i++) {
if (split[i].startsWith(split1[0])) {
continue
}
str += `${split[i]} `
}
this.cellInfo.style.text.transform = str;
}
},
addTransform(val: string) {
let t = this.cellInfo.style.text.transform;
if (t) {
const split = t.split(' ');
const split1 = val.split("(");
let add = true;
let str = ""
for (let i = 0; i < split.length; i++) {
if (split[i].startsWith(split1[0])) {
split[i] = val;
add = false
}
str += `${split[i]} `
}
if (add) {
str += `${val} `;
}
this.cellInfo.style.text.transform = str;
}
},
setCellInfo(info: any) {
if (!info) {
info = {
style: {
text: {}
}
}
}
this.cellInfo = mergeDeepObject({
showInput: false,
id: nextId(),
label: '新文本',
style: {
alignItems: 'start', // start end center
text: {
width: `100%`,
height: '100%',
fontSizeVal: 12,
fontSize: '16px',
fontWeight: 100,
fontStyle: 'normal', // italic
fontFamily: '仿宋',
color: '#000000',
textAlign: 'center',
padding: '0px 0px',
textIndent: 0,
textDecoration: 'none',
textTransform: 'none',
textShadow: 'none',
textOverflow: 'clip',
whiteSpace: 'normal',
wordBreak: 'break-all',
overflow: 'visible', // hidden,
whiteSpace: 'pre-wrap',
wordWrap: 'break-word',
}
}
}, info)
// setTimeout(() => {
// if (this.nodeInfo.store && this.nodeInfo.store.data) {
// this.nodeInfo.store.data.data = this.cellInfo
// }
// }, 300)
this.fontSize = parseInt(getSafeValue(this.cellInfo.style.text, 'fontSizeVal') || '12')
// this.fontSize = parseInt(getSafeValue(this.cellInfo.style.text, 'fontSize') || '14')
this.setInput(this.cellInfo.showInput)
this.cellInfo.editMode = getDraftDesignState();
if(this.cellInfo.editMode && this.cellInfo.propGroupId){
const showRandomGroupColor = configInfo.LK_SHOW_RANDOM_GROUP_COLOR()
if(!showRandomGroupColor){
setTimeout(()=>{
const [type, id] = this.cellInfo.propGroupId.split("_")
if(id){
document.getElementById(this.cellInfo.id)?.style.setProperty(
"--lk-prop-group-color",
`#${id}`
);
}
},100)
}
}
this.changeFontSize();
}
}
})
</script>
<style scoped lang="scss">
.node-content {
width: 100%;
height: 100%;
position: relative;
display: flex;
}
</style>

View File

@ -7,37 +7,66 @@
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="编码" prop="number">
<div class="flex w-full">
<el-input v-model="formData.number" :placeholder="formData.id==null?'编码为空时自动生成':''" :disabled="!inputCode" />
<el-button @click=" inputCode = true">手动输入</el-button>
</div>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入名称" />
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="编码" prop="number">
<div class="flex w-full">
<el-input v-model="formData.number" :placeholder="formData.id==null?'编码为空时自动生成':''" :disabled="!inputCode" />
<el-button @click=" inputCode = true">手动输入</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入名称" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="公司" prop="company">
<el-input v-model="formData.company" placeholder="请输入公司" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="公司地址" prop="companyAddress">
<el-input v-model="formData.companyAddress" placeholder="请输入公司地址" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="邮箱" prop="email">
<el-input v-model="formData.email" placeholder="请输入邮箱" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人" prop="contacts">
<el-input v-model="formData.contacts" placeholder="请输入联系人" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="联系人手机号" prop="phone">
<el-input v-model="formData.phone" placeholder="请输入联系人手机号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="跟单员" prop="gdperson">
<el-input v-model="formData.gdperson" placeholder="请输入跟单员" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="销售员" prop="saleperson">
<el-input v-model="formData.saleperson" placeholder="请输入销售员" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属地区" prop="areaId">
<el-cascader
v-model="formData.areaId"
@ -49,14 +78,21 @@
placeholder="请选择城市"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="发票抬头" prop="invoiceCode">
<el-input v-model="formData.invoiceCode" placeholder="请输入发票抬头" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发票名称" prop="invoiceName">
<el-input v-model="formData.invoiceName" placeholder="请输入发票名称" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="发票地址" prop="invoiceAddress">
<el-input v-model="formData.invoiceAddress" placeholder="请输入发票地址" />

View File

@ -78,7 +78,7 @@
</el-table>
</el-form>
<el-row justify="center" class="mt-3">
<el-button @click="handleAdd" round>+ 添加户地址</el-button>
<el-button @click="handleAdd" round>+ 添加户地址</el-button>
</el-row>
</template>
<script setup lang="ts">

View File

@ -7,27 +7,43 @@
label-width="100px"
v-loading="formLoading"
>
<el-row>
<el-col :span="12">
<el-form-item label="单据编号" prop="billno">
<el-input v-model="formData.billno" placeholder="请输入单据编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="订单号" prop="orderNo">
<el-input v-model="formData.orderNo" placeholder="请输入订单号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="客户编号" prop="customerCode">
<el-input v-model="formData.customerCode" placeholder="请输入客户编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品" prop="productId" >
<ProductInfoListDialog v-model="formData.productId" placeholder="请选择产品" style="width: 11100px;"/>
</el-form-item>
</el-col>
</el-row>
<!-- <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-row>
<el-col :span="12">
<el-form-item label="合约号" prop="saleContractNo">
<el-input v-model="formData.saleContractNo" placeholder="请输入合约号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="合约日期" prop="contractDate">
<el-date-picker
v-model="formData.contractDate"
@ -36,18 +52,40 @@
placeholder="选择合约日期"
/>
</el-form-item>
<el-form-item label="合约数量" prop="contractQty">
<el-input-number v-model="formData.contractQty" placeholder="请输入合约数量" />
</el-form-item>
<el-form-item label="生产数量" prop="produceQty">
<el-input-number v-model="formData.produceQty" placeholder="请输入生产数量" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="职员" prop="clerk">
<el-input v-model="formData.clerk" placeholder="请输入职员" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="合约数量" prop="contractQty">
<el-input-number v-model="formData.contractQty" placeholder="请输入合约数量" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<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-col>
<el-col :span="12">
<el-form-item label="生产数量" prop="produceQty">
<el-input-number v-model="formData.produceQty" placeholder="请输入生产数量" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="报告日期" prop="reportDate">
<el-date-picker
v-model="formData.reportDate"
@ -56,23 +94,41 @@
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-number v-model="formData.days" placeholder="请输入天数" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="天数" prop="days">
<el-input-number v-model="formData.days" placeholder="请输入天数" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="生产日期" prop="produceDate">
<el-date-picker
v-model="formData.produceDate"
type="date"
value-format="x"
placeholder="选择生产日期"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="生产线" prop="produceLine">
<el-input v-model="formData.produceLine" placeholder="请输入生产线" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="交货方式" prop="deliveryMethod">
<el-input v-model="formData.deliveryMethod" placeholder="请输入交货方式" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="验货日期" prop="inspectionDate">
<el-date-picker
v-model="formData.inspectionDate"
@ -81,6 +137,10 @@
placeholder="选择验货日期"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="交货日期" prop="deliverydate">
<el-date-picker
v-model="formData.deliverydate"
@ -89,9 +149,13 @@
placeholder="选择交货日期"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="交货数量" prop="deliveryQty">
<el-input-number v-model="formData.deliveryQty" placeholder="请输入交货数量" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button @click="downpdf" type="primary" v-if="formData.id" :disabled="formLoading"> </el-button>
@ -149,6 +213,7 @@ const formData = ref({
inspectionDateStr: undefined,
deliverydateStr: undefined,
deliveryQty: undefined,
details: undefined,
})
const formRules = reactive({
})
@ -262,7 +327,7 @@ const downpdf = async () => {
const preview = async () => {
const id = formData.value.id;
if (id) {
formData.value = await ProduceOrderApi.getProduceOrder(id)
//formData.value = await ProduceOrderApi.getProduceOrder(id)
}
//
formData.value.contractDateStr = formatDate(formData.value.contractDate,'YYYY-MM-DD')

View File

@ -160,15 +160,15 @@
<!-- <el-table-column label="ID" align="center" prop="id" />-->
<el-table-column label="序号" align="center" type="index" width="80"/>
<el-table-column label="单据编号" align="center" prop="billno" width="240" />
<el-table-column label="订单号" align="center" prop="orderNo" width="140"/>
<el-table-column label="订单号" align="center" prop="orderNo" width="240"/>
<el-table-column label="客户编号" align="center" prop="customerCode" width="140"/>
<el-table-column label="产品名称" align="center" prop="productName" />
<el-table-column label="合约号" align="center" prop="saleContractNo" />
<el-table-column label="产品名称" align="center" prop="productName" width="140"/>
<el-table-column label="合约号" align="center" prop="saleContractNo" width="240"/>
<el-table-column
label="合约日期"
align="center"
prop="contractDate"
:formatter="dateFormatter"
:formatter="dateFormatter2"
width="180px"
/>
<el-table-column label="合约数量" align="center" prop="contractQty" />
@ -179,14 +179,14 @@
label="报告日期"
align="center"
prop="reportDate"
:formatter="dateFormatter"
:formatter="dateFormatter2"
width="180px"
/>
<el-table-column
label="生产日期"
align="center"
prop="produceDate"
:formatter="dateFormatter"
:formatter="dateFormatter2"
width="180px"
/>
<el-table-column label="天数" align="center" prop="days" />
@ -196,17 +196,24 @@
label="验货日期"
align="center"
prop="inspectionDate"
:formatter="dateFormatter2"
width="180px"
/>
<el-table-column label="交货数量" align="center" prop="deliveryQty" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column
label="交货日期"
label="更新时间"
align="center"
prop="deliverydate"
prop="updatetime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="交货数量" align="center" prop="deliveryQty" />
<el-table-column label="操作" align="center" fixed="right" width="150">
<template #default="scope">
<el-button
@ -247,7 +254,7 @@
</template>
<script setup lang="ts">
import { dateFormatter } from '@/utils/formatTime'
import {dateFormatter, dateFormatter2} from '@/utils/formatTime'
import download from '@/utils/download'
import { ProduceOrderApi, ProduceOrderVO } from '@/api/oms/produceorder'
import ProduceOrderForm from './ProduceOrderForm.vue'

View File

@ -37,7 +37,7 @@ export default {
"left": 258,
"top": 54,
"height": 9.75,
"width": 120,
"width": 200,
"title": "生产单编号",
"right": 414.74388885498047,
"bottom": 49.49592590332031,
@ -48,7 +48,8 @@ export default {
"widthHeightSync": false,
"fontSize": 7.5,
"fontWeight": "700",
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "文本",
@ -71,7 +72,8 @@ export default {
"widthHeightSync": false,
"fontSize": 7.5,
"fontWeight": "700",
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "文本",
@ -83,7 +85,7 @@ export default {
"left": 13.5,
"top": 54,
"height": 16,
"width": 120,
"width": 200,
"field": "billno",
"testData": "VVVVVVVVVVVVVV",
"fontSize": 7.75,
@ -98,7 +100,8 @@ export default {
"right": 133.49185180664062,
"bottom": 60.24388885498047,
"vCenter": 73.49185180664062,
"hCenter": 52.24388885498047
"hCenter": 52.24388885498047,
"fixed": true
},
"printElementType": {
"title": "订单编号",
@ -110,7 +113,7 @@ export default {
"left": 258,
"top": 76.83333333333333,
"height": 9.75,
"width": 120,
"width": 200,
"title": "产品名称",
"right": 296.99388885498047,
"bottom": 74.99388885498047,
@ -121,7 +124,8 @@ export default {
"widthHeightSync": false,
"fontSize": 7.5,
"fontWeight": "700",
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "文本",
@ -133,7 +137,7 @@ export default {
"left": 13.5,
"top": 76.83333333333333,
"height": 16,
"width": 120,
"width": 200,
"field": "productCode",
"testData": "XS888888888",
"fontSize": 7.75,
@ -144,7 +148,8 @@ export default {
"qid": "orderId_1",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "订单编号",
@ -156,7 +161,7 @@ export default {
"left": 258,
"top": 99.66666666666666,
"height": 9.75,
"width": 120,
"width": 200,
"title": "生产日期",
"right": 318.74796295166016,
"bottom": 115.49387741088867,
@ -167,7 +172,8 @@ export default {
"widthHeightSync": false,
"fontSize": 7.5,
"fontWeight": "700",
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "文本",
@ -177,9 +183,9 @@ export default {
{
"options": {
"left": 13.5,
"top": 99.66666666666666,
"top": 99,
"height": 16,
"width": 120,
"width": 200,
"field": "customerCode",
"testData": "XS888888888",
"fontSize": 7.75,
@ -190,7 +196,8 @@ export default {
"qid": "orderId_2",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "订单编号",
@ -213,7 +220,8 @@ export default {
"widthHeightSync": false,
"fontSize": 7.5,
"fontWeight": "700",
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "文本",
@ -225,7 +233,7 @@ export default {
"left": 258,
"top": 121.5,
"height": 9.75,
"width": 120,
"width": 200,
"title": "生产线",
"right": 318.7418746948242,
"bottom": 150,
@ -236,7 +244,8 @@ export default {
"widthHeightSync": false,
"fontSize": 7.5,
"fontWeight": "700",
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "文本",
@ -248,7 +257,7 @@ export default {
"left": 13.5,
"top": 121.5,
"height": 16,
"width": 120,
"width": 200,
"field": "saleContractNo",
"testData": "XS888888888",
"fontSize": 7.75,
@ -263,7 +272,8 @@ export default {
"hCenter": 108.5,
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "订单编号",
@ -275,7 +285,7 @@ export default {
"left": 258,
"top": 145.33333333333331,
"height": 9.75,
"width": 120,
"width": 200,
"title": "验货日期",
"right": 338.49609375,
"bottom": 130.74609375,
@ -286,7 +296,8 @@ export default {
"widthHeightSync": false,
"fontSize": 7.5,
"fontWeight": "700",
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "文本",
@ -298,7 +309,7 @@ export default {
"left": 13.5,
"top": 145.33333333333331,
"height": 16,
"width": 120,
"width": 200,
"field": "contractDateStr",
"testData": "2024-02-21",
"fontSize": 7.75,
@ -314,7 +325,8 @@ export default {
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"dataType": "datetime"
"dataType": "datetime",
"fixed": true
},
"printElementType": {
"title": "订单编号",
@ -326,7 +338,7 @@ export default {
"left": 258,
"top": 165,
"height": 9.75,
"width": 120,
"width": 200,
"title": "交货方式",
"right": 350.25,
"bottom": 153.75,
@ -337,7 +349,8 @@ export default {
"widthHeightSync": false,
"fontSize": 7.5,
"fontWeight": "700",
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "文本",
@ -349,7 +362,7 @@ export default {
"left": 13.5,
"top": 165,
"height": 16,
"width": 120,
"width": 200,
"field": "contractQty",
"testData": "XS888888888",
"fontSize": 7.75,
@ -364,7 +377,8 @@ export default {
"hCenter": 179.74796295166016,
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "订单编号",
@ -387,7 +401,8 @@ export default {
"widthHeightSync": false,
"fontSize": 7.5,
"fontWeight": "700",
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "文本",
@ -399,7 +414,7 @@ export default {
"left": 258,
"top": 187.5,
"height": 9.75,
"width": 120,
"width": 200,
"title": "交货日期",
"right": 478.49796295166016,
"bottom": 208.49390029907227,
@ -423,7 +438,7 @@ export default {
"left": 13.5,
"top": 187.5,
"height": 16,
"width": 120,
"width": 200,
"field": "produceQty",
"testData": "XS888888888",
"fontSize": 7.75,
@ -438,7 +453,8 @@ export default {
"hCenter": 197.74185180664062,
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "订单编号",
@ -450,7 +466,7 @@ export default {
"left": 13.5,
"top": 213.83333333333334,
"height": 16,
"width": 120,
"width": 200,
"field": "deliveryPlace",
"testData": "XS888888888",
"fontSize": 7.75,
@ -465,7 +481,8 @@ export default {
"hCenter": 212.74388885498047,
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "订单编号",
@ -477,7 +494,7 @@ export default {
"left": 13.5,
"top": 236.66666666666669,
"height": 16,
"width": 120,
"width": 200,
"field": "clerk",
"testData": "XS888888888",
"fontSize": 7.75,
@ -492,7 +509,8 @@ export default {
"hCenter": 256.24796295166016,
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "订单编号",
@ -504,7 +522,7 @@ export default {
"left": 258,
"top": 259.5,
"height": 16,
"width": 120,
"width": 200,
"field": "reportTimeStr",
"testData": "12312",
"fontSize": 7.75,
@ -519,7 +537,8 @@ export default {
"hCenter": 256.9918575286865,
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "订单编号",
@ -531,7 +550,7 @@ export default {
"left": 13.5,
"top": 259.5,
"height": 16,
"width": 120,
"width": 200,
"field": "reportDateStr",
"testData": "XS888888888",
"fontSize": 7.75,
@ -546,7 +565,8 @@ export default {
"hCenter": 269.74796295166016,
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "订单编号",
@ -558,7 +578,7 @@ export default {
"left": 13.5,
"top": 297,
"height": 16,
"width": 120,
"width": 46.5,
"fontSize": 9,
"fontWeight": "700",
"textAlign": "left",
@ -572,7 +592,8 @@ export default {
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "productionDetails"
"field": "productionDetails",
"fixed": true
},
"printElementType": {
"title": "订单编号",
@ -582,8 +603,8 @@ export default {
{
"options": {
"left": 15,
"top": 483,
"height": 37.5,
"top": 490,
"height": 43.5,
"width": 565.5,
"title": "备注",
"right": 582,
@ -621,7 +642,8 @@ export default {
"coordinateSync": false,
"widthHeightSync": false,
"hideTitle": true,
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "订单编号",
@ -647,7 +669,8 @@ export default {
"coordinateSync": false,
"widthHeightSync": false,
"hideTitle": true,
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "订单编号",
@ -670,7 +693,8 @@ export default {
"qrCodeLevel": 0,
"field": "asd",
"fontSize": 7.5,
"fontWeight": "700"
"fontWeight": "700",
"fixed": true
},
"printElementType": {
"title": "文本",
@ -693,7 +717,8 @@ export default {
"qrCodeLevel": 0,
"field": "xxx",
"fontSize": 7.5,
"fontWeight": "700"
"fontWeight": "700",
"fixed": true
},
"printElementType": {
"title": "文本",
@ -717,7 +742,8 @@ export default {
"widthHeightSync": false,
"fontSize": 7.5,
"fontWeight": "700",
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "文本",
@ -740,7 +766,8 @@ export default {
"qrCodeLevel": 0,
"field": "12",
"fontSize": 7.5,
"fontWeight": "700"
"fontWeight": "700",
"fixed": true
},
"printElementType": {
"title": "文本",
@ -766,7 +793,8 @@ export default {
"coordinateSync": false,
"widthHeightSync": false,
"hideTitle": true,
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "订单编号",
@ -789,7 +817,8 @@ export default {
"qrCodeLevel": 0,
"field": "fed",
"fontSize": 7.5,
"fontWeight": "700"
"fontWeight": "700",
"fixed": true
},
"printElementType": {
"title": "文本",
@ -812,7 +841,8 @@ export default {
"qrCodeLevel": 0,
"field": "xxxc",
"fontSize": 7.5,
"fontWeight": "700"
"fontWeight": "700",
"fixed": true
},
"printElementType": {
"title": "文本",
@ -835,7 +865,8 @@ export default {
"qrCodeLevel": 0,
"field": "asdas",
"fontSize": 7.5,
"fontWeight": "700"
"fontWeight": "700",
"fixed": true
},
"printElementType": {
"title": "文本",
@ -858,7 +889,8 @@ export default {
"qrCodeLevel": 0,
"field": "33",
"fontSize": 7.5,
"fontWeight": "700"
"fontWeight": "700",
"fixed": true
},
"printElementType": {
"title": "文本",
@ -884,7 +916,8 @@ export default {
"coordinateSync": false,
"widthHeightSync": false,
"hideTitle": true,
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "订单编号",
@ -907,7 +940,8 @@ export default {
"widthHeightSync": false,
"fontSize": 7.5,
"fontWeight": "700",
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "文本",
@ -930,7 +964,8 @@ export default {
"widthHeightSync": false,
"fontSize": 7.5,
"fontWeight": "700",
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "文本",
@ -953,7 +988,8 @@ export default {
"widthHeightSync": false,
"fontSize": 7.5,
"fontWeight": "700",
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "文本",
@ -976,7 +1012,8 @@ export default {
"widthHeightSync": false,
"fontSize": 7.5,
"fontWeight": "700",
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "文本",
@ -1002,7 +1039,8 @@ export default {
"coordinateSync": false,
"widthHeightSync": false,
"hideTitle": true,
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "订单编号",
@ -1025,7 +1063,8 @@ export default {
"qrCodeLevel": 0,
"field": "hhh",
"fontSize": 7.5,
"fontWeight": "700"
"fontWeight": "700",
"fixed": true
},
"printElementType": {
"title": "文本",
@ -1048,7 +1087,8 @@ export default {
"widthHeightSync": false,
"fontSize": 7.5,
"fontWeight": "700",
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "文本",
@ -1071,7 +1111,8 @@ export default {
"widthHeightSync": false,
"fontSize": 7.5,
"fontWeight": "700",
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "文本",
@ -1094,7 +1135,8 @@ export default {
"widthHeightSync": false,
"fontSize": 7.5,
"fontWeight": "700",
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "文本",
@ -1114,7 +1156,8 @@ export default {
"widthHeightSync": false,
"fontSize": 7.5,
"fontWeight": "700",
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "这是更新后的元素",
@ -1127,11 +1170,14 @@ export default {
"top": 741,
"height": 9,
"width": 513,
"borderWidth": 0.75,
"borderWidth": "0.75",
"right": 158.24796295166016,
"bottom": 751.4918746948242,
"vCenter": 113.24796295166016,
"hCenter": 746.9918746948242
"hCenter": 746.9918746948242,
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1141,14 +1187,17 @@ export default {
{
"options": {
"left": 237,
"top": 789,
"top": 804,
"height": 9,
"width": 121.5,
"borderWidth": 0.75,
"borderWidth": "0.75",
"right": 359.2418746948242,
"bottom": 797.2479629516602,
"vCenter": 299.9918746948242,
"hCenter": 792.7479629516602
"hCenter": 792.7479629516602,
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1158,14 +1207,17 @@ export default {
{
"options": {
"left": 451.5,
"top": 789,
"top": 804,
"height": 9,
"width": 130.5,
"borderWidth": 0.75,
"borderWidth": "0.75",
"right": 569.2418746948242,
"bottom": 798.7459487915039,
"vCenter": 509.9918746948242,
"hCenter": 794.2459487915039
"hCenter": 794.2459487915039,
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1175,10 +1227,13 @@ export default {
{
"options": {
"left": 28.5,
"top": 789,
"top": 804,
"height": 9,
"width": 126,
"borderWidth": 0.75
"borderWidth": "0.75",
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1188,7 +1243,7 @@ export default {
{
"options": {
"left": 237.5,
"top": 790,
"top": 805,
"height": 16,
"width": 120,
"field": "creater",
@ -1205,7 +1260,8 @@ export default {
"hCenter": 797.75,
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "制单人",
@ -1215,7 +1271,7 @@ export default {
{
"options": {
"left": 451.5,
"top": 790,
"top": 805,
"height": 16,
"width": 120,
"field": "creater",
@ -1243,7 +1299,7 @@ export default {
{
"options": {
"left": 30,
"top": 790.5,
"top": 805,
"height": 16,
"width": 120,
"field": "creater",
@ -1260,7 +1316,8 @@ export default {
"hCenter": 788,
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
"qrCodeLevel": 0,
"fixed": true
},
"printElementType": {
"title": "制单人",
@ -1273,7 +1330,10 @@ export default {
"top": 585,
"height": 9,
"width": 90,
"borderWidth": 0.75
"borderWidth": "0.75",
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1286,7 +1346,10 @@ export default {
"top": 585,
"height": 9,
"width": 90,
"borderWidth": 0.75
"borderWidth": "0.75",
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1299,7 +1362,10 @@ export default {
"top": 585,
"height": 9,
"width": 90,
"borderWidth": 0.75
"borderWidth": "0.75",
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1312,7 +1378,10 @@ export default {
"top": 585,
"height": 9,
"width": 90,
"borderWidth": 0.75
"borderWidth": "0.75",
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1325,7 +1394,10 @@ export default {
"top": 628.5,
"height": 9,
"width": 90,
"borderWidth": 0.75
"borderWidth": "0.75",
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1338,7 +1410,10 @@ export default {
"top": 628.5,
"height": 9,
"width": 90,
"borderWidth": 0.75
"borderWidth": "0.75",
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1351,11 +1426,14 @@ export default {
"top": 627,
"height": 9,
"width": 90,
"borderWidth": 0.75,
"borderWidth": "0.75",
"right": 446.2459487915039,
"bottom": 637.4959487915039,
"vCenter": 401.2459487915039,
"hCenter": 632.9959487915039
"hCenter": 632.9959487915039,
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1368,11 +1446,14 @@ export default {
"top": 627,
"height": 9,
"width": 90,
"borderWidth": 0.75,
"borderWidth": "0.75",
"right": 599.2480087280273,
"bottom": 636.7500228881836,
"vCenter": 554.2480087280273,
"hCenter": 632.2500228881836
"hCenter": 632.2500228881836,
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1385,7 +1466,10 @@ export default {
"top": 669,
"height": 9,
"width": 90,
"borderWidth": 0.75
"borderWidth": "0.75",
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1398,7 +1482,10 @@ export default {
"top": 669,
"height": 9,
"width": 90,
"borderWidth": 0.75
"borderWidth": "0.75",
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1411,11 +1498,14 @@ export default {
"top": 670.5,
"height": 9,
"width": 90,
"borderWidth": 0.75,
"borderWidth": "0.75",
"right": 444.0000228881836,
"bottom": 677.9979858398438,
"vCenter": 399.0000228881836,
"hCenter": 673.4979858398438
"hCenter": 673.4979858398438,
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1428,7 +1518,10 @@ export default {
"top": 669,
"height": 9,
"width": 90,
"borderWidth": 0.75
"borderWidth": "0.75",
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1441,7 +1534,10 @@ export default {
"top": 712.5,
"height": 9,
"width": 90,
"borderWidth": 0.75
"borderWidth": "0.75",
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1454,7 +1550,10 @@ export default {
"top": 712.5,
"height": 9,
"width": 90,
"borderWidth": 0.75
"borderWidth": "0.75",
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1467,7 +1566,10 @@ export default {
"top": 712.5,
"height": 9,
"width": 90,
"borderWidth": 0.75
"borderWidth": "0.75",
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
@ -1480,12 +1582,35 @@ export default {
"top": 712.5,
"height": 9,
"width": 90,
"borderWidth": 0.75
"borderWidth": "0.75",
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "横线",
"type": "hline"
}
},
{
"options": {
"left": 58,
"top": 300,
"height": 190.5,
"width": 532,
"right": 586.75,
"bottom": 480.74796867370605,
"vCenter": 320.75,
"hCenter": 390.74796867370605,
"field": "details",
"coordinateSync": false,
"widthHeightSync": false,
"fixed": true
},
"printElementType": {
"title": "",
"type": "longText"
}
}
],
"paperNumberLeft": 565,
@ -1497,3 +1622,8 @@ export default {
}
]
}

View File

@ -201,11 +201,6 @@ const updateAddress = () => {
updateAddressFormRef.value?.open(formData.value)
}
const changeRow = async (row,key:string) => {
if('price' == key || 'discount' == key ){
let price = row.price
@ -234,6 +229,8 @@ const handleAudit = async () => {
await itemFormEntrysRef.value.validate()
//
await message.confirm('确认审核订单吗?')
//
await SaleOrderApi.updateOrderEntrys(formData.value)
//
await SaleOrderApi.updateSaleOrderBillStatus([formData.value.id],'audit')
message.success('审核成功')

View File

@ -130,13 +130,13 @@
>
作废
</el-button>
<el-button
<!-- <el-button
type="warning"
plain
@click="handleUpdateBillStatus('submit')"
:disabled="selectionList.length === 0"
>提交
</el-button>
</el-button>-->
<el-button
type="primary"
plain
@ -182,7 +182,7 @@
:row-class-name="tableRowClassName"
>
<el-table-column width="30" label="选择" type="selection" />
<el-table-column label="单据编号" align="center" prop="billno" width="120px"/>
<el-table-column label="单据编号" align="center" prop="billno" width="220px"/>
<el-table-column label="客户" align="center" prop="customerId" width="120px"/>
<el-table-column label="销售员" align="center" prop="customerId" width="180px"/>
<el-table-column label="跟单员" align="center" prop="customerId" width="180px"/>
@ -307,17 +307,17 @@ const total = ref(0) // 列表的总页数
// tabs
const tabsData = ref([
{
name: '已下单',
name: '待审核',
type: 0,
count: 0
},
{
name: '生产中',
name: '待排产',
type: 1,
count: 0
},
{
name: '已完成',
name: '已排产',
type: 2,
count: 0
}
@ -358,6 +358,7 @@ const getList = async () => {
} finally {
loading.value = false
}
getTabsCount()
}
@ -574,8 +575,8 @@ onActivated(() => {
/** 初始化 **/
onMounted(() => {
getList()
//
getTabsCount()
//
//getTabsCount()
})
</script>

View File

@ -589,6 +589,9 @@ onMounted(async () => {
formData.value.company = customerData.company;
formData.value.contactName = customerData.contacts;
formData.value.phone = customerData.phone;
formData.value.invoiceCode = customerData.invoiceCode;
formData.value.invoiceName = customerData.invoiceName;
formData.value.invoiceAddress = customerData.invoiceAddress;
if(!formData.value.deliveryAddress && that.addressList.length > 0){
formData.value.deliveryAddress = that.addressList[0].address;
that.addressId = that.addressList[0].id;

View File

@ -357,6 +357,7 @@ const getList = async () => {
} finally {
loading.value = false
}
getTabsCount()
}
@ -574,7 +575,7 @@ onActivated(() => {
onMounted(() => {
getList()
//
getTabsCount()
//getTabsCount()
})
</script>