Merge remote-tracking branch 'origin/0.8.X' into 0.8.X
This commit is contained in:
@@ -7,6 +7,7 @@ import javax.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -31,6 +32,11 @@ public class ApsPlanDetailBo extends BaseEntity {
|
||||
*/
|
||||
private Long planSheetId;
|
||||
|
||||
/**
|
||||
* 关联排产单ID列表(用于批量查询)
|
||||
*/
|
||||
private List<Long> planSheetIds;
|
||||
|
||||
/**
|
||||
* 内容序号
|
||||
*/
|
||||
|
||||
@@ -18,5 +18,5 @@ import java.util.List;
|
||||
*/
|
||||
public interface ApsPlanSheetMapper extends BaseMapperPlus<ApsPlanSheetMapper, ApsPlanSheet, ApsPlanSheetVo> {
|
||||
|
||||
List<ApsPlanSheetRowVo> selectList(ApsPlanSheetQueryReq req);
|
||||
List<ApsPlanSheetRowVo> selectListByReq(ApsPlanSheetQueryReq req);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,11 @@ public interface IApsPlanDetailService {
|
||||
*/
|
||||
List<ApsPlanDetailVo> queryList(ApsPlanDetailBo bo);
|
||||
|
||||
/**
|
||||
* 根据排产单ID列表查询明细
|
||||
*/
|
||||
List<ApsPlanDetailVo> queryListByPlanSheetIds(List<Long> planSheetIds);
|
||||
|
||||
/**
|
||||
* 新增排产单明细
|
||||
*/
|
||||
|
||||
@@ -105,6 +105,19 @@ public class ApsPlanDetailServiceImpl implements IApsPlanDetailService {
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据排产单ID列表查询明细
|
||||
*/
|
||||
@Override
|
||||
public List<ApsPlanDetailVo> queryListByPlanSheetIds(List<Long> planSheetIds) {
|
||||
if (planSheetIds == null || planSheetIds.isEmpty()) {
|
||||
return new java.util.ArrayList<>();
|
||||
}
|
||||
LambdaQueryWrapper<ApsPlanDetail> lqw = Wrappers.lambdaQuery();
|
||||
lqw.in(ApsPlanDetail::getPlanSheetId, planSheetIds);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ApsPlanDetail> buildQueryWrapper(ApsPlanDetailBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ApsPlanDetail> lqw = Wrappers.lambdaQuery();
|
||||
|
||||
@@ -318,7 +318,7 @@ public class ApsPlanSheetServiceImpl implements IApsPlanSheetService {
|
||||
}
|
||||
|
||||
private List<ApsPlanSheetRowVo> queryListAll(ApsPlanSheetQueryReq req) {
|
||||
return baseMapper.selectList(req);
|
||||
return baseMapper.selectListByReq(req);
|
||||
}
|
||||
|
||||
private String nvl(Object v, Object fallback) {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
<select id="selectList" parameterType="com.klp.aps.domain.dto.ApsPlanSheetQueryReq" resultType="com.klp.aps.domain.vo.ApsPlanSheetRowVo">
|
||||
<select id="selectListByReq" parameterType="com.klp.aps.domain.dto.ApsPlanSheetQueryReq" resultType="com.klp.aps.domain.vo.ApsPlanSheetRowVo">
|
||||
SELECT
|
||||
d.plan_detail_id AS detailSheetId,
|
||||
s.plan_date AS planDate,
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
@@ -43,5 +43,9 @@
|
||||
<groupId>com.klp</groupId>
|
||||
<artifactId>klp-wms</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.klp</groupId>
|
||||
<artifactId>klp-aps</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
package com.klp.crm.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
import com.klp.aps.domain.bo.ApsPlanDetailBo;
|
||||
import com.klp.aps.domain.bo.ApsPlanSheetBo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
@@ -21,6 +26,10 @@ import com.klp.crm.domain.vo.CrmOrderVo;
|
||||
import com.klp.crm.domain.bo.CrmOrderBo;
|
||||
import com.klp.crm.service.ICrmOrderService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.aps.domain.vo.ApsPlanSheetVo;
|
||||
import com.klp.aps.domain.vo.ApsPlanDetailVo;
|
||||
import com.klp.aps.service.IApsPlanSheetService;
|
||||
import com.klp.aps.service.IApsPlanDetailService;
|
||||
|
||||
/**
|
||||
* 正式订单主
|
||||
@@ -35,6 +44,8 @@ import com.klp.common.core.page.TableDataInfo;
|
||||
public class CrmOrderController extends BaseController {
|
||||
|
||||
private final ICrmOrderService iCrmOrderService;
|
||||
private final IApsPlanSheetService iApsPlanSheetService;
|
||||
private final IApsPlanDetailService iApsPlanDetailService;
|
||||
|
||||
/**
|
||||
* 查询正式订单主列表
|
||||
@@ -96,4 +107,54 @@ public class CrmOrderController extends BaseController {
|
||||
@PathVariable String[] orderIds) {
|
||||
return toAjax(iCrmOrderService.deleteWithValidByIds(Arrays.asList(orderIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询每日订单(根据排产计划获取今天的订单)
|
||||
*
|
||||
* @param planDate 排产日期,默认今天
|
||||
*/
|
||||
@GetMapping("/daily")
|
||||
public R<List<CrmOrderVo>> getDailyOrders(
|
||||
@RequestParam(value = "planDate", required = false)
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd") Date planDate) {
|
||||
if (planDate == null) {
|
||||
planDate = new Date();
|
||||
}
|
||||
// 将日期设置为当天的开始时间 00:00:00
|
||||
java.util.Calendar calendar = java.util.Calendar.getInstance();
|
||||
calendar.setTime(planDate);
|
||||
calendar.set(java.util.Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(java.util.Calendar.MINUTE, 0);
|
||||
calendar.set(java.util.Calendar.SECOND, 0);
|
||||
calendar.set(java.util.Calendar.MILLISECOND, 0);
|
||||
planDate = calendar.getTime();
|
||||
|
||||
ApsPlanSheetBo bo = new ApsPlanSheetBo();
|
||||
bo.setPlanDate(planDate);
|
||||
List<ApsPlanSheetVo> planSheetList = iApsPlanSheetService.queryList(bo);
|
||||
if (planSheetList == null || planSheetList.isEmpty()) {
|
||||
return R.ok(new ArrayList<>());
|
||||
}
|
||||
List<Long> planSheetIds = new ArrayList<>();
|
||||
for (ApsPlanSheetVo sheet : planSheetList) {
|
||||
planSheetIds.add(sheet.getPlanSheetId());
|
||||
}
|
||||
ApsPlanDetailBo detailBo = new ApsPlanDetailBo();
|
||||
detailBo.setPlanSheetIds(planSheetIds);
|
||||
List<ApsPlanDetailVo> detailList = iApsPlanDetailService.queryListByPlanSheetIds(planSheetIds);
|
||||
if (detailList == null || detailList.isEmpty()) {
|
||||
return R.ok(new ArrayList<>());
|
||||
}
|
||||
List<Long> orderIds = new ArrayList<>();
|
||||
for (ApsPlanDetailVo detail : detailList) {
|
||||
if (detail.getOrderId() != null) {
|
||||
orderIds.add(detail.getOrderId());
|
||||
}
|
||||
}
|
||||
if (orderIds.isEmpty()) {
|
||||
return R.ok(new ArrayList<>());
|
||||
}
|
||||
List<CrmOrderVo> orders = iCrmOrderService.queryByIds(orderIds);
|
||||
return R.ok(orders);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,6 +85,131 @@ public class CrmOrder extends BaseEntity {
|
||||
*/
|
||||
private String contractCode;
|
||||
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String contractName;
|
||||
|
||||
/**
|
||||
* 供方
|
||||
*/
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 需方
|
||||
*/
|
||||
private String customer;
|
||||
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
private Date signTime;
|
||||
|
||||
/**
|
||||
* 签订地点
|
||||
*/
|
||||
private String signLocation;
|
||||
|
||||
/**
|
||||
* 产品内容
|
||||
*/
|
||||
private String productContent;
|
||||
|
||||
/**
|
||||
* 合同内容
|
||||
*/
|
||||
private String contractContent;
|
||||
|
||||
/**
|
||||
* 供方地址
|
||||
*/
|
||||
private String supplierAddress;
|
||||
|
||||
/**
|
||||
* 供方电话
|
||||
*/
|
||||
private String supplierPhone;
|
||||
|
||||
/**
|
||||
* 供方开户行
|
||||
*/
|
||||
private String supplierBank;
|
||||
|
||||
/**
|
||||
* 供方账号
|
||||
*/
|
||||
private String supplierAccount;
|
||||
|
||||
/**
|
||||
* 供方税号
|
||||
*/
|
||||
private String supplierTaxNo;
|
||||
|
||||
/**
|
||||
* 需方地址
|
||||
*/
|
||||
private String customerAddress;
|
||||
|
||||
/**
|
||||
* 需方电话
|
||||
*/
|
||||
private String customerPhone;
|
||||
|
||||
/**
|
||||
* 需方开户行
|
||||
*/
|
||||
private String customerBank;
|
||||
|
||||
/**
|
||||
* 需方账号
|
||||
*/
|
||||
private String customerAccount;
|
||||
|
||||
/**
|
||||
* 需方税号
|
||||
*/
|
||||
private String customerTaxNo;
|
||||
|
||||
/**
|
||||
* 技术附件
|
||||
*/
|
||||
private String techAnnex;
|
||||
|
||||
/**
|
||||
* 商务附件
|
||||
*/
|
||||
private String businessAnnex;
|
||||
|
||||
/**
|
||||
* 排产函
|
||||
*/
|
||||
private String productionSchedule;
|
||||
|
||||
/**
|
||||
* 算单价备注
|
||||
*/
|
||||
private String unitPriceRemark;
|
||||
|
||||
/**
|
||||
* 应付定金(万元)
|
||||
*/
|
||||
private BigDecimal depositPayable;
|
||||
|
||||
/**
|
||||
* 已付定金(万元)
|
||||
*/
|
||||
private BigDecimal depositPaid;
|
||||
|
||||
/**
|
||||
* 定金比例(%)
|
||||
*/
|
||||
private BigDecimal depositRatio;
|
||||
|
||||
/**
|
||||
* 合同状态 0=草稿 1=生效 2=作废 3=已完成
|
||||
*/
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 关联合同ID(wms_contract.contract_id)
|
||||
*/
|
||||
|
||||
@@ -93,6 +93,30 @@ public class CrmOrderItem extends BaseEntity {
|
||||
* 排产批次
|
||||
*/
|
||||
private String productionBatch;
|
||||
/**
|
||||
* 表面处理
|
||||
*/
|
||||
private String surfaceTreatment;
|
||||
/**
|
||||
* 切边要求
|
||||
*/
|
||||
private String edgeCuttingReq;
|
||||
/**
|
||||
* 包装要求
|
||||
*/
|
||||
private String packagingReq;
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private BigDecimal width;
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
private BigDecimal thickness;
|
||||
/**
|
||||
* 用途
|
||||
*/
|
||||
private String purpose;
|
||||
/**
|
||||
* 删除标识 0正常 2删除
|
||||
*/
|
||||
|
||||
@@ -8,6 +8,7 @@ import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 正式订单主业务对象 crm_order
|
||||
@@ -53,6 +54,8 @@ public class CrmOrderBo extends BaseEntity {
|
||||
/**
|
||||
* 交货日期
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date deliveryDate;
|
||||
|
||||
/**
|
||||
@@ -95,6 +98,133 @@ public class CrmOrderBo extends BaseEntity {
|
||||
*/
|
||||
private String contractCode;
|
||||
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String contractName;
|
||||
|
||||
/**
|
||||
* 供方
|
||||
*/
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 需方
|
||||
*/
|
||||
private String customer;
|
||||
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date signTime;
|
||||
|
||||
/**
|
||||
* 签订地点
|
||||
*/
|
||||
private String signLocation;
|
||||
|
||||
/**
|
||||
* 产品内容
|
||||
*/
|
||||
private String productContent;
|
||||
|
||||
/**
|
||||
* 合同内容
|
||||
*/
|
||||
private String contractContent;
|
||||
|
||||
/**
|
||||
* 供方地址
|
||||
*/
|
||||
private String supplierAddress;
|
||||
|
||||
/**
|
||||
* 供方电话
|
||||
*/
|
||||
private String supplierPhone;
|
||||
|
||||
/**
|
||||
* 供方开户行
|
||||
*/
|
||||
private String supplierBank;
|
||||
|
||||
/**
|
||||
* 供方账号
|
||||
*/
|
||||
private String supplierAccount;
|
||||
|
||||
/**
|
||||
* 供方税号
|
||||
*/
|
||||
private String supplierTaxNo;
|
||||
|
||||
/**
|
||||
* 需方地址
|
||||
*/
|
||||
private String customerAddress;
|
||||
|
||||
/**
|
||||
* 需方电话
|
||||
*/
|
||||
private String customerPhone;
|
||||
|
||||
/**
|
||||
* 需方开户行
|
||||
*/
|
||||
private String customerBank;
|
||||
|
||||
/**
|
||||
* 需方账号
|
||||
*/
|
||||
private String customerAccount;
|
||||
|
||||
/**
|
||||
* 需方税号
|
||||
*/
|
||||
private String customerTaxNo;
|
||||
|
||||
/**
|
||||
* 技术附件
|
||||
*/
|
||||
private String techAnnex;
|
||||
|
||||
/**
|
||||
* 商务附件
|
||||
*/
|
||||
private String businessAnnex;
|
||||
|
||||
/**
|
||||
* 排产函
|
||||
*/
|
||||
private String productionSchedule;
|
||||
|
||||
/**
|
||||
* 算单价备注
|
||||
*/
|
||||
private String unitPriceRemark;
|
||||
|
||||
/**
|
||||
* 应付定金(万元)
|
||||
*/
|
||||
private BigDecimal depositPayable;
|
||||
|
||||
/**
|
||||
* 已付定金(万元)
|
||||
*/
|
||||
private BigDecimal depositPaid;
|
||||
|
||||
/**
|
||||
* 定金比例(%)
|
||||
*/
|
||||
private BigDecimal depositRatio;
|
||||
|
||||
/**
|
||||
* 合同状态 0=草稿 1=生效 2=作废 3=已完成
|
||||
*/
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 关联合同ID(wms_contract.contract_id)
|
||||
*/
|
||||
|
||||
@@ -108,5 +108,34 @@ public class CrmOrderItemBo extends BaseEntity {
|
||||
*/
|
||||
private String productionBatch;
|
||||
|
||||
/**
|
||||
* 表面处理
|
||||
*/
|
||||
private String surfaceTreatment;
|
||||
|
||||
/**
|
||||
* 切边要求
|
||||
*/
|
||||
private String edgeCuttingReq;
|
||||
|
||||
/**
|
||||
* 包装要求
|
||||
*/
|
||||
private String packagingReq;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private BigDecimal width;
|
||||
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
private BigDecimal thickness;
|
||||
|
||||
/**
|
||||
* 用途
|
||||
*/
|
||||
private String purpose;
|
||||
|
||||
}
|
||||
|
||||
@@ -131,5 +131,40 @@ public class CrmOrderItemVo {
|
||||
@ExcelProperty(value = "排产批次")
|
||||
private String productionBatch;
|
||||
|
||||
/**
|
||||
* 表面处理
|
||||
*/
|
||||
@ExcelProperty(value = "表面处理")
|
||||
private String surfaceTreatment;
|
||||
|
||||
/**
|
||||
* 切边要求
|
||||
*/
|
||||
@ExcelProperty(value = "切边要求")
|
||||
private String edgeCuttingReq;
|
||||
|
||||
/**
|
||||
* 包装要求
|
||||
*/
|
||||
@ExcelProperty(value = "包装要求")
|
||||
private String packagingReq;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
@ExcelProperty(value = "宽度")
|
||||
private BigDecimal width;
|
||||
|
||||
/**
|
||||
* 厚度
|
||||
*/
|
||||
@ExcelProperty(value = "厚度")
|
||||
private BigDecimal thickness;
|
||||
|
||||
/**
|
||||
* 用途
|
||||
*/
|
||||
@ExcelProperty(value = "用途")
|
||||
private String purpose;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,12 +2,15 @@ package com.klp.crm.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@@ -114,6 +117,156 @@ public class CrmOrderVo extends BaseEntity {
|
||||
@ExcelProperty(value = "合同号")
|
||||
private String contractCode;
|
||||
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
@ExcelProperty(value = "合同名称")
|
||||
private String contractName;
|
||||
|
||||
/**
|
||||
* 供方
|
||||
*/
|
||||
@ExcelProperty(value = "供方")
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 需方
|
||||
*/
|
||||
@ExcelProperty(value = "需方")
|
||||
private String customer;
|
||||
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
@ExcelProperty(value = "签订时间")
|
||||
private Date signTime;
|
||||
|
||||
/**
|
||||
* 签订地点
|
||||
*/
|
||||
@ExcelProperty(value = "签订地点")
|
||||
private String signLocation;
|
||||
|
||||
/**
|
||||
* 产品内容
|
||||
*/
|
||||
@ExcelProperty(value = "产品内容")
|
||||
private String productContent;
|
||||
|
||||
/**
|
||||
* 合同内容
|
||||
*/
|
||||
@ExcelProperty(value = "合同内容")
|
||||
private String contractContent;
|
||||
|
||||
/**
|
||||
* 供方地址
|
||||
*/
|
||||
@ExcelProperty(value = "供方地址")
|
||||
private String supplierAddress;
|
||||
|
||||
/**
|
||||
* 供方电话
|
||||
*/
|
||||
@ExcelProperty(value = "供方电话")
|
||||
private String supplierPhone;
|
||||
|
||||
/**
|
||||
* 供方开户行
|
||||
*/
|
||||
@ExcelProperty(value = "供方开户行")
|
||||
private String supplierBank;
|
||||
|
||||
/**
|
||||
* 供方账号
|
||||
*/
|
||||
@ExcelProperty(value = "供方账号")
|
||||
private String supplierAccount;
|
||||
|
||||
/**
|
||||
* 供方税号
|
||||
*/
|
||||
@ExcelProperty(value = "供方税号")
|
||||
private String supplierTaxNo;
|
||||
|
||||
/**
|
||||
* 需方地址
|
||||
*/
|
||||
@ExcelProperty(value = "需方地址")
|
||||
private String customerAddress;
|
||||
|
||||
/**
|
||||
* 需方电话
|
||||
*/
|
||||
@ExcelProperty(value = "需方电话")
|
||||
private String customerPhone;
|
||||
|
||||
/**
|
||||
* 需方开户行
|
||||
*/
|
||||
@ExcelProperty(value = "需方开户行")
|
||||
private String customerBank;
|
||||
|
||||
/**
|
||||
* 需方账号
|
||||
*/
|
||||
@ExcelProperty(value = "需方账号")
|
||||
private String customerAccount;
|
||||
|
||||
/**
|
||||
* 需方税号
|
||||
*/
|
||||
@ExcelProperty(value = "需方税号")
|
||||
private String customerTaxNo;
|
||||
|
||||
/**
|
||||
* 技术附件
|
||||
*/
|
||||
@ExcelProperty(value = "技术附件")
|
||||
private String techAnnex;
|
||||
|
||||
/**
|
||||
* 商务附件
|
||||
*/
|
||||
@ExcelProperty(value = "商务附件")
|
||||
private String businessAnnex;
|
||||
|
||||
/**
|
||||
* 排产函
|
||||
*/
|
||||
@ExcelProperty(value = "排产函")
|
||||
private String productionSchedule;
|
||||
|
||||
/**
|
||||
* 算单价备注
|
||||
*/
|
||||
@ExcelProperty(value = "算单价备注")
|
||||
private String unitPriceRemark;
|
||||
|
||||
/**
|
||||
* 应付定金(万元)
|
||||
*/
|
||||
@ExcelProperty(value = "应付定金(万元)")
|
||||
private BigDecimal depositPayable;
|
||||
|
||||
/**
|
||||
* 已付定金(万元)
|
||||
*/
|
||||
@ExcelProperty(value = "已付定金(万元)")
|
||||
private BigDecimal depositPaid;
|
||||
|
||||
/**
|
||||
* 定金比例(%)
|
||||
*/
|
||||
@ExcelProperty(value = "定金比例(%)")
|
||||
private BigDecimal depositRatio;
|
||||
|
||||
/**
|
||||
* 合同状态 0=草稿 1=生效 2=作废 3=已完成
|
||||
*/
|
||||
@ExcelProperty(value = "合同状态")
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 关联合同ID(wms_contract.contract_id)
|
||||
*/
|
||||
@@ -142,4 +295,8 @@ public class CrmOrderVo extends BaseEntity {
|
||||
private String createByName;
|
||||
//更新人
|
||||
private String updateByName;
|
||||
/**
|
||||
* 关联的钢卷列表
|
||||
*/
|
||||
private List<WmsMaterialCoilVo> coilList;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,11 @@ public interface ICrmOrderService {
|
||||
*/
|
||||
CrmOrderVo queryById(String orderId);
|
||||
|
||||
/**
|
||||
* 根据ID列表查询正式订单
|
||||
*/
|
||||
List<CrmOrderVo> queryByIds(List<Long> orderIds);
|
||||
|
||||
/**
|
||||
* 查询正式订单主列表
|
||||
*/
|
||||
|
||||
@@ -101,6 +101,12 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomizer()), CrmOrderItem::getCustomizer, bo.getCustomizer());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getShipper()), CrmOrderItem::getShipper, bo.getShipper());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProductionBatch()), CrmOrderItem::getProductionBatch, bo.getProductionBatch());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSurfaceTreatment()), CrmOrderItem::getSurfaceTreatment, bo.getSurfaceTreatment());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEdgeCuttingReq()), CrmOrderItem::getEdgeCuttingReq, bo.getEdgeCuttingReq());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPackagingReq()), CrmOrderItem::getPackagingReq, bo.getPackagingReq());
|
||||
lqw.eq(bo.getWidth() != null, CrmOrderItem::getWidth, bo.getWidth());
|
||||
lqw.eq(bo.getThickness() != null, CrmOrderItem::getThickness, bo.getThickness());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPurpose()), CrmOrderItem::getPurpose, bo.getPurpose());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.crm.domain.vo.CrmOrderOperationTraceVo;
|
||||
import com.klp.mapper.WmsCoilContractRelMapper;
|
||||
import com.klp.system.service.ISysUserService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -17,6 +18,11 @@ import com.klp.crm.domain.vo.CrmOrderVo;
|
||||
import com.klp.crm.domain.CrmOrder;
|
||||
import com.klp.crm.mapper.CrmOrderMapper;
|
||||
import com.klp.crm.service.ICrmOrderService;
|
||||
import com.klp.domain.WmsCoilContractRel;
|
||||
import com.klp.domain.bo.WmsMaterialCoilBo;
|
||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||
import com.klp.service.IWmsCoilContractRelService;
|
||||
import com.klp.service.IWmsMaterialCoilService;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -35,6 +41,10 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
|
||||
private final ISysUserService userService;
|
||||
|
||||
private final WmsCoilContractRelMapper coilContractRelMapper;
|
||||
|
||||
private final IWmsMaterialCoilService materialCoilService;
|
||||
|
||||
/**
|
||||
* 查询正式订单主
|
||||
*/
|
||||
@@ -43,6 +53,19 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
return baseMapper.selectVoById(orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID列表查询正式订单
|
||||
*/
|
||||
@Override
|
||||
public List<CrmOrderVo> queryByIds(List<Long> orderIds) {
|
||||
if (orderIds == null || orderIds.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
LambdaQueryWrapper<CrmOrder> lqw = Wrappers.lambdaQuery();
|
||||
lqw.in(CrmOrder::getOrderId, orderIds);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询正式订单主列表
|
||||
*/
|
||||
@@ -76,6 +99,57 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 查询订单关联的钢卷ID列表
|
||||
List<Long> contractIds = records.stream()
|
||||
.map(CrmOrderVo::getOrderId)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (!contractIds.isEmpty()) {
|
||||
// 批量查询钢卷与合同关联关系
|
||||
LambdaQueryWrapper<WmsCoilContractRel> coilQw = Wrappers.lambdaQuery();
|
||||
coilQw.in(WmsCoilContractRel::getContractId, contractIds);
|
||||
coilQw.eq(WmsCoilContractRel::getDelFlag, 0);
|
||||
List<WmsCoilContractRel> coilRels = coilContractRelMapper.selectList(coilQw);
|
||||
|
||||
// 按contractId分组,收集coilId列表
|
||||
Map<Long, List<Long>> coilIdMap = coilRels.stream()
|
||||
.filter(rel -> rel.getContractId() != null && rel.getCoilId() != null)
|
||||
.collect(Collectors.groupingBy(
|
||||
WmsCoilContractRel::getContractId,
|
||||
Collectors.mapping(WmsCoilContractRel::getCoilId, Collectors.toList())
|
||||
));
|
||||
|
||||
// 查询所有相关钢卷的详细信息
|
||||
Set<Long> allCoilIds = coilIdMap.values().stream()
|
||||
.flatMap(List::stream)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
Map<Long, WmsMaterialCoilVo> coilVoMap = Collections.emptyMap();
|
||||
if (!allCoilIds.isEmpty()) {
|
||||
WmsMaterialCoilBo coilBo = new WmsMaterialCoilBo();
|
||||
coilBo.setCoilIds(allCoilIds.stream().map(String::valueOf).collect(Collectors.joining(",")));
|
||||
List<WmsMaterialCoilVo> allCoils = materialCoilService.queryList(coilBo);
|
||||
coilVoMap = allCoils.stream()
|
||||
.collect(Collectors.toMap(WmsMaterialCoilVo::getCoilId, c -> c, (a, b) -> a));
|
||||
}
|
||||
|
||||
// 设置到每个订单的coilIds和coilList字段
|
||||
for (CrmOrderVo vo : records) {
|
||||
if (vo.getOrderId() != null && coilIdMap.containsKey(vo.getOrderId())) {
|
||||
List<Long> coilIdList = coilIdMap.get(vo.getOrderId());
|
||||
// 设置coilList(钢卷详细信息列表)
|
||||
List<WmsMaterialCoilVo> coilList = coilIdList.stream()
|
||||
.map(coilVoMap::get)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
vo.setCoilList(coilList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@@ -89,7 +163,10 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
.or().like("co.audit_user", bo.getKeyword())
|
||||
.or().like("co.contract_code", bo.getKeyword())
|
||||
.or().like("co.annex_files", bo.getKeyword())
|
||||
.or().like("co.remark", bo.getKeyword()));
|
||||
.or().like("co.remark", bo.getKeyword())
|
||||
.or().like("co.contract_name", bo.getKeyword())
|
||||
.or().like("co.supplier", bo.getKeyword())
|
||||
.or().like("co.customer", bo.getKeyword()));
|
||||
}
|
||||
qw.eq(StringUtils.isNotBlank(bo.getOrderCode()), "co.order_code", bo.getOrderCode());
|
||||
qw.eq(bo.getOrderType() != null, "co.order_type", bo.getOrderType());
|
||||
@@ -104,6 +181,31 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
qw.eq(bo.getFinanceStatus() != null, "co.finance_status", bo.getFinanceStatus());
|
||||
qw.eq(bo.getUnpaidAmount() != null, "co.unpaid_amount", bo.getUnpaidAmount());
|
||||
qw.like(StringUtils.isNotBlank(bo.getContractCode()), "co.contract_code", bo.getContractCode());
|
||||
qw.like(StringUtils.isNotBlank(bo.getContractName()), "co.contract_name", bo.getContractName());
|
||||
qw.like(StringUtils.isNotBlank(bo.getSupplier()), "co.supplier", bo.getSupplier());
|
||||
qw.like(StringUtils.isNotBlank(bo.getCustomer()), "co.customer", bo.getCustomer());
|
||||
qw.eq(bo.getSignTime() != null, "co.sign_time", bo.getSignTime());
|
||||
qw.like(StringUtils.isNotBlank(bo.getSignLocation()), "co.sign_location", bo.getSignLocation());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getProductContent()), "co.product_content", bo.getProductContent());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getContractContent()), "co.contract_content", bo.getContractContent());
|
||||
qw.like(StringUtils.isNotBlank(bo.getSupplierAddress()), "co.supplier_address", bo.getSupplierAddress());
|
||||
qw.like(StringUtils.isNotBlank(bo.getSupplierPhone()), "co.supplier_phone", bo.getSupplierPhone());
|
||||
qw.like(StringUtils.isNotBlank(bo.getSupplierBank()), "co.supplier_bank", bo.getSupplierBank());
|
||||
qw.like(StringUtils.isNotBlank(bo.getSupplierAccount()), "co.supplier_account", bo.getSupplierAccount());
|
||||
qw.like(StringUtils.isNotBlank(bo.getSupplierTaxNo()), "co.supplier_tax_no", bo.getSupplierTaxNo());
|
||||
qw.like(StringUtils.isNotBlank(bo.getCustomerAddress()), "co.customer_address", bo.getCustomerAddress());
|
||||
qw.like(StringUtils.isNotBlank(bo.getCustomerPhone()), "co.customer_phone", bo.getCustomerPhone());
|
||||
qw.like(StringUtils.isNotBlank(bo.getCustomerBank()), "co.customer_bank", bo.getCustomerBank());
|
||||
qw.like(StringUtils.isNotBlank(bo.getCustomerAccount()), "co.customer_account", bo.getCustomerAccount());
|
||||
qw.like(StringUtils.isNotBlank(bo.getCustomerTaxNo()), "co.customer_tax_no", bo.getCustomerTaxNo());
|
||||
qw.like(StringUtils.isNotBlank(bo.getTechAnnex()), "co.tech_annex", bo.getTechAnnex());
|
||||
qw.like(StringUtils.isNotBlank(bo.getBusinessAnnex()), "co.business_annex", bo.getBusinessAnnex());
|
||||
qw.like(StringUtils.isNotBlank(bo.getProductionSchedule()), "co.production_schedule", bo.getProductionSchedule());
|
||||
qw.like(StringUtils.isNotBlank(bo.getUnitPriceRemark()), "co.unit_price_remark", bo.getUnitPriceRemark());
|
||||
qw.eq(bo.getDepositPayable() != null, "co.deposit_payable", bo.getDepositPayable());
|
||||
qw.eq(bo.getDepositPaid() != null, "co.deposit_paid", bo.getDepositPaid());
|
||||
qw.eq(bo.getDepositRatio() != null, "co.deposit_ratio", bo.getDepositRatio());
|
||||
qw.eq(bo.getStatus() != null, "co.status", bo.getStatus());
|
||||
qw.eq(bo.getContractId() != null, "co.contract_id", bo.getContractId());
|
||||
qw.like(StringUtils.isNotBlank(bo.getAnnexFiles()), "co.annex_files", bo.getAnnexFiles());
|
||||
//逻辑删除
|
||||
@@ -139,6 +241,31 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
lqw.eq(bo.getFinanceStatus() != null, CrmOrder::getFinanceStatus, bo.getFinanceStatus());
|
||||
lqw.eq(bo.getUnpaidAmount() != null, CrmOrder::getUnpaidAmount, bo.getUnpaidAmount());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getContractCode()), CrmOrder::getContractCode, bo.getContractCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getContractName()), CrmOrder::getContractName, bo.getContractName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSupplier()), CrmOrder::getSupplier, bo.getSupplier());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomer()), CrmOrder::getCustomer, bo.getCustomer());
|
||||
lqw.eq(bo.getSignTime() != null, CrmOrder::getSignTime, bo.getSignTime());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSignLocation()), CrmOrder::getSignLocation, bo.getSignLocation());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProductContent()), CrmOrder::getProductContent, bo.getProductContent());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContractContent()), CrmOrder::getContractContent, bo.getContractContent());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSupplierAddress()), CrmOrder::getSupplierAddress, bo.getSupplierAddress());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSupplierPhone()), CrmOrder::getSupplierPhone, bo.getSupplierPhone());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSupplierBank()), CrmOrder::getSupplierBank, bo.getSupplierBank());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSupplierAccount()), CrmOrder::getSupplierAccount, bo.getSupplierAccount());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSupplierTaxNo()), CrmOrder::getSupplierTaxNo, bo.getSupplierTaxNo());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomerAddress()), CrmOrder::getCustomerAddress, bo.getCustomerAddress());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomerPhone()), CrmOrder::getCustomerPhone, bo.getCustomerPhone());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomerBank()), CrmOrder::getCustomerBank, bo.getCustomerBank());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomerAccount()), CrmOrder::getCustomerAccount, bo.getCustomerAccount());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomerTaxNo()), CrmOrder::getCustomerTaxNo, bo.getCustomerTaxNo());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getTechAnnex()), CrmOrder::getTechAnnex, bo.getTechAnnex());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getBusinessAnnex()), CrmOrder::getBusinessAnnex, bo.getBusinessAnnex());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getProductionSchedule()), CrmOrder::getProductionSchedule, bo.getProductionSchedule());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getUnitPriceRemark()), CrmOrder::getUnitPriceRemark, bo.getUnitPriceRemark());
|
||||
lqw.eq(bo.getDepositPayable() != null, CrmOrder::getDepositPayable, bo.getDepositPayable());
|
||||
lqw.eq(bo.getDepositPaid() != null, CrmOrder::getDepositPaid, bo.getDepositPaid());
|
||||
lqw.eq(bo.getDepositRatio() != null, CrmOrder::getDepositRatio, bo.getDepositRatio());
|
||||
lqw.eq(bo.getStatus() != null, CrmOrder::getStatus, bo.getStatus());
|
||||
lqw.eq(bo.getContractId() != null, CrmOrder::getContractId, bo.getContractId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getAnnexFiles()), CrmOrder::getAnnexFiles, bo.getAnnexFiles());
|
||||
return lqw;
|
||||
|
||||
@@ -23,6 +23,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="customizer" column="customizer"/>
|
||||
<result property="shipper" column="shipper"/>
|
||||
<result property="productionBatch" column="production_batch"/>
|
||||
<result property="surfaceTreatment" column="surface_treatment"/>
|
||||
<result property="edgeCuttingReq" column="edge_cutting_req"/>
|
||||
<result property="packagingReq" column="packaging_req"/>
|
||||
<result property="width" column="width"/>
|
||||
<result property="thickness" column="thickness"/>
|
||||
<result property="purpose" column="purpose"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
@@ -50,6 +56,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
customizer,
|
||||
shipper,
|
||||
production_batch,
|
||||
surface_treatment,
|
||||
edge_cutting_req,
|
||||
packaging_req,
|
||||
width,
|
||||
thickness,
|
||||
purpose,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
|
||||
@@ -20,6 +20,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="unpaidAmount" column="unpaid_amount"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="contractCode" column="contract_code"/>
|
||||
<result property="contractName" column="contract_name"/>
|
||||
<result property="supplier" column="supplier"/>
|
||||
<result property="customer" column="customer"/>
|
||||
<result property="signTime" column="sign_time"/>
|
||||
<result property="signLocation" column="sign_location"/>
|
||||
<result property="productContent" column="product_content"/>
|
||||
<result property="contractContent" column="contract_content"/>
|
||||
<result property="supplierAddress" column="supplier_address"/>
|
||||
<result property="supplierPhone" column="supplier_phone"/>
|
||||
<result property="supplierBank" column="supplier_bank"/>
|
||||
<result property="supplierAccount" column="supplier_account"/>
|
||||
<result property="supplierTaxNo" column="supplier_tax_no"/>
|
||||
<result property="customerAddress" column="customer_address"/>
|
||||
<result property="customerPhone" column="customer_phone"/>
|
||||
<result property="customerBank" column="customer_bank"/>
|
||||
<result property="customerAccount" column="customer_account"/>
|
||||
<result property="customerTaxNo" column="customer_tax_no"/>
|
||||
<result property="techAnnex" column="tech_annex"/>
|
||||
<result property="businessAnnex" column="business_annex"/>
|
||||
<result property="productionSchedule" column="production_schedule"/>
|
||||
<result property="unitPriceRemark" column="unit_price_remark"/>
|
||||
<result property="depositPayable" column="deposit_payable"/>
|
||||
<result property="depositPaid" column="deposit_paid"/>
|
||||
<result property="depositRatio" column="deposit_ratio"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="contractId" column="contract_id"/>
|
||||
<result property="annexFiles" column="annex_files"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
@@ -45,6 +70,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
co.unpaid_amount AS unpaidAmount,
|
||||
co.remark,
|
||||
co.contract_code AS contractCode,
|
||||
co.contract_name AS contractName,
|
||||
co.supplier,
|
||||
co.customer,
|
||||
co.sign_time AS signTime,
|
||||
co.sign_location AS signLocation,
|
||||
co.product_content AS productContent,
|
||||
co.contract_content AS contractContent,
|
||||
co.supplier_address AS supplierAddress,
|
||||
co.supplier_phone AS supplierPhone,
|
||||
co.supplier_bank AS supplierBank,
|
||||
co.supplier_account AS supplierAccount,
|
||||
co.supplier_tax_no AS supplierTaxNo,
|
||||
co.customer_address AS customerAddress,
|
||||
co.customer_phone AS customerPhone,
|
||||
co.customer_bank AS customerBank,
|
||||
co.customer_account AS customerAccount,
|
||||
co.customer_tax_no AS customerTaxNo,
|
||||
co.tech_annex AS techAnnex,
|
||||
co.business_annex AS businessAnnex,
|
||||
co.production_schedule AS productionSchedule,
|
||||
co.unit_price_remark AS unitPriceRemark,
|
||||
co.deposit_payable AS depositPayable,
|
||||
co.deposit_paid AS depositPaid,
|
||||
co.deposit_ratio AS depositRatio,
|
||||
co.status,
|
||||
co.contract_id AS contractId,
|
||||
co.annex_files AS annexFiles,
|
||||
co.create_by AS createBy,
|
||||
@@ -79,6 +129,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
co.unpaid_amount AS unpaidAmount,
|
||||
co.remark,
|
||||
co.contract_code AS contractCode,
|
||||
co.contract_name AS contractName,
|
||||
co.supplier,
|
||||
co.customer,
|
||||
co.sign_time AS signTime,
|
||||
co.sign_location AS signLocation,
|
||||
co.product_content AS productContent,
|
||||
co.contract_content AS contractContent,
|
||||
co.supplier_address AS supplierAddress,
|
||||
co.supplier_phone AS supplierPhone,
|
||||
co.supplier_bank AS supplierBank,
|
||||
co.supplier_account AS supplierAccount,
|
||||
co.supplier_tax_no AS supplierTaxNo,
|
||||
co.customer_address AS customerAddress,
|
||||
co.customer_phone AS customerPhone,
|
||||
co.customer_bank AS customerBank,
|
||||
co.customer_account AS customerAccount,
|
||||
co.customer_tax_no AS customerTaxNo,
|
||||
co.tech_annex AS techAnnex,
|
||||
co.business_annex AS businessAnnex,
|
||||
co.production_schedule AS productionSchedule,
|
||||
co.unit_price_remark AS unitPriceRemark,
|
||||
co.deposit_payable AS depositPayable,
|
||||
co.deposit_paid AS depositPaid,
|
||||
co.deposit_ratio AS depositRatio,
|
||||
co.status,
|
||||
co.contract_id AS contractId,
|
||||
co.annex_files AS annexFiles,
|
||||
co.create_by AS createBy,
|
||||
|
||||
@@ -52,3 +52,14 @@ export function listOrderPackaging(orderId) {
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询今日订单
|
||||
*/
|
||||
export function listTodayOrder(query) {
|
||||
return request({
|
||||
url: '/crm/order/daily',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
44
klp-ui/src/api/wms/annealOperateEvent.js
Normal file
44
klp-ui/src/api/wms/annealOperateEvent.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询退火操作事件列表
|
||||
export function listAnnealOperateEvent(query) {
|
||||
return request({
|
||||
url: '/wms/annealOperateEvent/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询退火操作事件详细
|
||||
export function getAnnealOperateEvent(eventId) {
|
||||
return request({
|
||||
url: '/wms/annealOperateEvent/' + eventId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增退火操作事件
|
||||
export function addAnnealOperateEvent(data) {
|
||||
return request({
|
||||
url: '/wms/annealOperateEvent',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改退火操作事件
|
||||
export function updateAnnealOperateEvent(data) {
|
||||
return request({
|
||||
url: '/wms/annealOperateEvent',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除退火操作事件
|
||||
export function delAnnealOperateEvent(eventId) {
|
||||
return request({
|
||||
url: '/wms/annealOperateEvent/' + eventId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -389,4 +389,12 @@ export function listTypeErrorCoil() {
|
||||
method: 'get',
|
||||
timeout: 600000
|
||||
})
|
||||
}
|
||||
|
||||
export function getCoilStatisticsList(params) {
|
||||
return request({
|
||||
url: '/wms/materialCoil/statisticsList',
|
||||
method: 'get',
|
||||
params,
|
||||
})
|
||||
}
|
||||
44
klp-ui/src/api/wms/coilContractRel.js
Normal file
44
klp-ui/src/api/wms/coilContractRel.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询钢卷与合同关联关系列表
|
||||
export function listCoilContractRel(query) {
|
||||
return request({
|
||||
url: '/wms/coilContractRel/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询钢卷与合同关联关系详细
|
||||
export function getCoilContractRel(relId) {
|
||||
return request({
|
||||
url: '/wms/coilContractRel/' + relId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增钢卷与合同关联关系
|
||||
export function addCoilContractRel(data) {
|
||||
return request({
|
||||
url: '/wms/coilContractRel',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改钢卷与合同关联关系
|
||||
export function updateCoilContractRel(data) {
|
||||
return request({
|
||||
url: '/wms/coilContractRel',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除钢卷与合同关联关系
|
||||
export function delCoilContractRel(relId) {
|
||||
return request({
|
||||
url: '/wms/coilContractRel/' + relId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -122,10 +122,13 @@ export function startProcess(actionId) {
|
||||
}
|
||||
|
||||
// 完成操作
|
||||
export function completeAction(actionId) {
|
||||
export function completeAction(actionId, newCoilIds) {
|
||||
return request({
|
||||
url: `/wms/coilPendingAction/complete/${actionId}`,
|
||||
method: 'put'
|
||||
method: 'put',
|
||||
params: {
|
||||
newCoilIds: newCoilIds || '-'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -21,13 +21,7 @@
|
||||
@close="handleClose" append-to-body :fullscreen="orderBy">
|
||||
<!-- 搜索区域 -->
|
||||
<el-form v-if="!rangeMode" inline :model="queryParams" class="search-form">
|
||||
<!-- <el-form-item label="类型">
|
||||
<el-select v-model="queryParams.selectType" placeholder="请选择类型" size="small">
|
||||
<el-option label="成品" value="product" />
|
||||
<el-option label="原料" value="raw_material" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="入场卷号">
|
||||
<el-form-item label="入场卷号">
|
||||
<el-input v-model="queryParams.enterCoilNo" placeholder="请输入入场卷号" clearable size="small"
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
@@ -35,23 +29,29 @@
|
||||
<el-input v-model="queryParams.currentCoilNo" placeholder="请输入当前卷号" clearable size="small"
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料">
|
||||
<muti-select v-model="queryParams.itemName" :options="dict.type.coil_itemname" placeholder="请选择物料"
|
||||
<el-form-item label="物料类型">
|
||||
<el-select v-model="queryParams.itemType" placeholder="请选择物料类型" size="small" clearable>
|
||||
<el-option label="成品" value="product" />
|
||||
<el-option label="原料" value="raw_material" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" v-if="queryParams.itemType">
|
||||
<muti-select v-model="queryParams.itemName" :options="dict.type.coil_itemname" placeholder="请选择物料名称"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格">
|
||||
<el-form-item label="规格" v-if="queryParams.itemType">
|
||||
<memo-input storageKey="coilSpec" v-model="queryParams.itemSpecification" placeholder="请输入规格" clearable
|
||||
size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="材质">
|
||||
<el-form-item label="材质" v-if="queryParams.itemType">
|
||||
<muti-select v-model="queryParams.itemMaterial" :options="dict.type.coil_material" placeholder="请选择材质"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="厂家">
|
||||
<el-form-item label="厂家" v-if="queryParams.itemType">
|
||||
<muti-select v-model="queryParams.itemManufacturer" :options="dict.type.coil_manufacturer" placeholder="请选择厂家"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="表面处理">
|
||||
<el-form-item label="表面处理" v-if="queryParams.itemType">
|
||||
<el-input v-model="queryParams.itemSurfaceTreatmentDesc" placeholder="请输入表面处理" clearable size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="切边" prop="trimmingRequirement" v-if="orderBy">
|
||||
@@ -68,8 +68,8 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="品质">
|
||||
<muti-select v-model="queryParams.qualityStatusCsv" :options="dict.type.coil_quality_status" placeholder="请选择品质"
|
||||
clearable />
|
||||
<muti-select v-model="queryParams.qualityStatusCsv" :options="dict.type.coil_quality_status"
|
||||
placeholder="请选择品质" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="实际库区" v-if="orderBy">
|
||||
<actual-warehouse-select v-model="queryParams.actualWarehouseId" placeholder="请选择实际库区" canSelectLevel2
|
||||
@@ -80,6 +80,8 @@
|
||||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
|
||||
<el-checkbox v-if="orderBy" style="margin-left: 10px;" v-model="showCoilMap" size="small">显示钢卷地图</el-checkbox>
|
||||
<el-checkbox v-if="orderBy && orderId" style="margin-left: 10px;" v-model="showOrderInfo"
|
||||
size="small">显示订单详情</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -115,8 +117,15 @@
|
||||
</div>
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination v-if="!rangeMode" v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
<div style="display: flex; justify-content: flex-end; align-items: flex-end; gap: 10px;">
|
||||
<span>
|
||||
总净重:{{ coilTrimStatistics.total_net_weight || 0 }}t
|
||||
</span>
|
||||
|
||||
<pagination v-if="!rangeMode" v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
</div>
|
||||
|
||||
|
||||
<div v-if="multiple && selectedCoils.length > 0" class="selected-stats">
|
||||
<div class="stats-content">
|
||||
@@ -163,12 +172,18 @@
|
||||
:id="selectedNodeId" :canToggle="false" :canRelease="false" />
|
||||
</div>
|
||||
</DragResizeBox>
|
||||
|
||||
<DragResizeBox v-if="orderBy && orderId && showOrderInfo" storageKey="coil-order-info">
|
||||
<div style="height: 100%; width: 100%; background-color: #fff;">
|
||||
<order-detail v-if="orderBy && orderId && showOrderInfo" :orderId="orderId" :editable="false" />
|
||||
</div>
|
||||
</DragResizeBox>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listMaterialCoil } from '@/api/wms/coil';
|
||||
import { listMaterialCoil, getCoilStatisticsList } from '@/api/wms/coil';
|
||||
import { listActualWarehouse } from "@/api/wms/actualWarehouse";
|
||||
import { treeActualWarehouseTwoLevel } from "@/api/wms/actualWarehouse";
|
||||
import MemoInput from '@/components/MemoInput/index.vue';
|
||||
@@ -177,6 +192,7 @@ import { defaultColumns } from './data';
|
||||
import ActualWarehouseSelect from '@/components/KLPService/ActualWarehouseSelect/index.vue';
|
||||
import WarehouseBirdMini from '@/views/wms/warehouse/components/WarehouseBirdMini.vue';
|
||||
import DragResizeBox from '@/components/DragResizeBox/index.vue';
|
||||
import OrderDetail from '@/views/crm/components/OrderDetail.vue';
|
||||
|
||||
export default {
|
||||
name: 'CoilSelector',
|
||||
@@ -185,7 +201,8 @@ export default {
|
||||
MutiSelect,
|
||||
ActualWarehouseSelect,
|
||||
WarehouseBirdMini,
|
||||
DragResizeBox
|
||||
DragResizeBox,
|
||||
OrderDetail
|
||||
},
|
||||
dicts: ['coil_itemname', 'coil_material', 'coil_manufacturer', 'coil_quality_status'],
|
||||
props: {
|
||||
@@ -254,6 +271,14 @@ export default {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
orderId: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
defaultType: {
|
||||
type: String,
|
||||
default: 'product'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -274,7 +299,8 @@ export default {
|
||||
itemMaterial: null,
|
||||
itemManufacturer: null,
|
||||
actualWarehouseId: null,
|
||||
selectType: 'product',
|
||||
itemType: this.defaultType,
|
||||
selectType: this.defaultType,
|
||||
status: 0, // 不包含已发货的钢卷
|
||||
dataType: 1 // 只查询当前数据,不查询历史数据
|
||||
},
|
||||
@@ -287,6 +313,8 @@ export default {
|
||||
warehouseTree: [],
|
||||
treeProps: { label: "actualWarehouseName", children: "children" },
|
||||
treeLoading: false,
|
||||
showOrderInfo: false,
|
||||
coilTrimStatistics: {},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -471,12 +499,18 @@ export default {
|
||||
...this.queryParams,
|
||||
...this.filters,
|
||||
};
|
||||
queryPayload.selectType = queryPayload.itemType;
|
||||
// 处于销售视角,且my视图时,只查询当前用户的钢卷
|
||||
console.log('this.salesRestricted', this.salesRestricted, this.currentTab, this.currentUserId);
|
||||
if (this.salesRestricted && this.currentTab === 'my') {
|
||||
queryPayload.saleId = this.currentUserId;
|
||||
}
|
||||
const response = await listMaterialCoil(queryPayload);
|
||||
const { pageNum, pageSize, excludeBound, orderBy, ...noPager } = queryPayload;
|
||||
getCoilStatisticsList(noPager).then((res) => {
|
||||
console.log('钢卷统计数据:', res);
|
||||
this.coilTrimStatistics = res.data || {};
|
||||
});
|
||||
if (response.code === 200) {
|
||||
this.coilList = response.rows || [];
|
||||
this.total = response.total || 0;
|
||||
@@ -522,7 +556,8 @@ export default {
|
||||
currentCoilNo: null,
|
||||
grade: null,
|
||||
dataType: 1,
|
||||
selectType: 'raw_material',
|
||||
itemType: this.defaultType,
|
||||
selectType: this.defaultType,
|
||||
};
|
||||
this.getList();
|
||||
},
|
||||
|
||||
269
klp-ui/src/components/KLPService/ContractSelect/index.vue
Normal file
269
klp-ui/src/components/KLPService/ContractSelect/index.vue
Normal file
@@ -0,0 +1,269 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="display: flex; align-items: center; margin-bottom: 12px;">
|
||||
<el-select v-model="selectedValue" placeholder="请选择合同" style="width: 100%">
|
||||
<el-option v-for="item in contractList" :key="item.orderId" :value="item.orderId"
|
||||
:label="item.contractCode" />
|
||||
</el-select>
|
||||
<!-- 编辑按钮:点击打开弹窗 -->
|
||||
<el-button v-if="mode == 'today'" @click="openSelectDialog" type="primary" size="small" style="margin-left: 8px; padding: 0 12px;">
|
||||
<i class="el-icon-setting"></i>
|
||||
</el-button>
|
||||
|
||||
<!-- 刷新时不会移除手动添加的合同 -->
|
||||
<el-button @click="handleRefresh" type="info" size="small" style="margin-left: 8px; padding: 0 12px;">
|
||||
<i class="el-icon-refresh"></i>
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 查询所有的合同和当前localstorage中的合同,可以对localstorage中的合同进行新增和删除,手动新增的合同带有手动添加的标记 -->
|
||||
<el-dialog title="可选合同配置" :visible.sync="dialogVisible" width="80%">
|
||||
<el-tabs v-model="activeTab">
|
||||
<!-- 已配置合同tab -->
|
||||
<el-tab-pane label="可选合同" name="configured">
|
||||
<div v-if="contractList.length === 0" style="text-align: center; padding: 20px;">
|
||||
暂无已配置合同
|
||||
</div>
|
||||
<el-table v-else :data="contractList" style="width: 100%" size="mini" height="600">
|
||||
<el-table-column prop="contractCode" label="合同编号" width="160" />
|
||||
<el-table-column prop="contractName" label="合同名称" width="180" />
|
||||
<el-table-column prop="customer" label="客户" width="140" />
|
||||
<el-table-column prop="salesman" label="销售人员" width="100" />
|
||||
<el-table-column prop="deliveryDate" label="交付日期" width="110">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.deliveryDate || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
|
||||
<el-table-column label="添加方式" width="90">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.isManual" type="success" size="small">手动</el-tag>
|
||||
<el-tag v-else type="info" size="small">接口</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="70">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" size="mini" @click="removeContract(scope.row.orderId)" plain>
|
||||
移除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- 所有合同tab -->
|
||||
<el-tab-pane label="所有合同" name="all">
|
||||
<div style="margin-bottom: 16px;">
|
||||
<el-input v-model="searchKeyword" placeholder="搜索合同" @input="handleSearch" clearable size="small">
|
||||
<el-button slot="append" icon="el-icon-search" size="small"></el-button>
|
||||
</el-input>
|
||||
</div>
|
||||
|
||||
<el-table :data="allContracts" style="width: 100%" size="mini" height="600">
|
||||
<el-table-column prop="contractCode" label="合同编号" width="160" />
|
||||
<el-table-column prop="contractName" label="合同名称" width="180" />
|
||||
<el-table-column prop="customer" label="客户" width="140" />
|
||||
<el-table-column prop="salesman" label="销售人员" width="100" />
|
||||
<el-table-column prop="deliveryDate" label="交付日期" width="110">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.deliveryDate || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
|
||||
<el-table-column label="状态" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="isContractInList(scope.row.orderId)" type="success" size="small">已添加</el-tag>
|
||||
<el-tag v-else type="info" size="small">未添加</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="!isContractInList(scope.row.orderId)"
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="addContract(scope.row)"
|
||||
plain
|
||||
>
|
||||
添加
|
||||
</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
type="danger"
|
||||
size="mini"
|
||||
@click="removeContract(scope.row.orderId)"
|
||||
plain
|
||||
>
|
||||
移除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div v-if="allContracts.length === 0" style="text-align: center; padding: 20px;">
|
||||
暂无合同数据
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOrder, listTodayOrder } from '@/api/crm/order';
|
||||
|
||||
export default {
|
||||
name: "ContractSelect",
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: "today" // today 或 all
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
contractList: [],
|
||||
dialogVisible: false,
|
||||
searchKeyword: '',
|
||||
allContracts: [],
|
||||
activeTab: 'configured', // 默认显示已配置合同tab
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
selectedValue: {
|
||||
get() {
|
||||
return this.value;
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('input', val);
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.mode == "today") {
|
||||
// 从localstorage中获取合同列表
|
||||
this.loadFromLocalStorage();
|
||||
} else {
|
||||
this.loadContractList();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 从localStorage中加载合同列表
|
||||
loadFromLocalStorage() {
|
||||
try {
|
||||
const storedContracts = localStorage.getItem('todayContracts');
|
||||
if (storedContracts) {
|
||||
this.contractList = JSON.parse(storedContracts);
|
||||
} else {
|
||||
// 如果localStorage中没有,从接口获取
|
||||
this.loadContractList();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load contracts from localStorage:', error);
|
||||
this.loadContractList();
|
||||
}
|
||||
},
|
||||
|
||||
// 保存合同列表到localStorage
|
||||
saveToLocalStorage() {
|
||||
try {
|
||||
localStorage.setItem('todayContracts', JSON.stringify(this.contractList));
|
||||
} catch (error) {
|
||||
console.error('Failed to save contracts to localStorage:', error);
|
||||
}
|
||||
},
|
||||
|
||||
// 加载合同列表
|
||||
async loadContractList(keyword) {
|
||||
if (this.mode == "all") {
|
||||
const res = await listOrder({
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
keyword: keyword || undefined,
|
||||
});
|
||||
this.contractList = res.rows || [];
|
||||
}
|
||||
else if (this.mode == "today") {
|
||||
const res = await listTodayOrder();
|
||||
// 获取现有手动添加的合同
|
||||
const existingManualContracts = this.contractList.filter(item => item.isManual);
|
||||
// 将接口返回的合同标记为非手动添加
|
||||
const apiContracts = (res.data || []).map(item => ({
|
||||
...item,
|
||||
isManual: false
|
||||
}));
|
||||
// 合并合同列表,保留手动添加的合同
|
||||
this.contractList = [...apiContracts, ...existingManualContracts];
|
||||
// 去重,避免重复合同
|
||||
this.contractList = this.contractList.filter((item, index, self) =>
|
||||
index === self.findIndex(t => t.orderId === item.orderId)
|
||||
);
|
||||
// 保存到localStorage
|
||||
this.saveToLocalStorage();
|
||||
}
|
||||
},
|
||||
// 打开选择弹窗
|
||||
async openSelectDialog() {
|
||||
this.dialogVisible = true;
|
||||
// 加载所有合同供选择
|
||||
await this.loadAllContracts();
|
||||
},
|
||||
|
||||
// 加载所有合同
|
||||
async loadAllContracts() {
|
||||
try {
|
||||
const res = await listOrder({
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
keyword: this.searchKeyword || undefined,
|
||||
});
|
||||
// 合并现有合同(包括手动添加的)
|
||||
const existingContracts = this.contractList;
|
||||
this.allContracts = [...res.rows || [], ...existingContracts].filter((item, index, self) =>
|
||||
index === self.findIndex(t => t.orderId === item.orderId)
|
||||
);
|
||||
} catch (error) {
|
||||
console.error('Failed to load all contracts:', error);
|
||||
this.allContracts = [];
|
||||
}
|
||||
},
|
||||
|
||||
// 搜索合同
|
||||
handleSearch() {
|
||||
this.loadAllContracts();
|
||||
},
|
||||
|
||||
// 检查合同是否在列表中
|
||||
isContractInList(orderId) {
|
||||
return this.contractList.some(item => item.orderId === orderId);
|
||||
},
|
||||
|
||||
// 添加合同
|
||||
addContract(contract) {
|
||||
if (!this.isContractInList(contract.orderId)) {
|
||||
this.contractList.push({
|
||||
...contract,
|
||||
isManual: true // 标记为手动添加
|
||||
});
|
||||
this.saveToLocalStorage();
|
||||
}
|
||||
},
|
||||
|
||||
// 移除合同
|
||||
removeContract(orderId) {
|
||||
this.contractList = this.contractList.filter(item => item.orderId !== orderId);
|
||||
this.saveToLocalStorage();
|
||||
},
|
||||
|
||||
// 刷新合同列表
|
||||
handleRefresh() {
|
||||
this.loadContractList();
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -35,6 +35,10 @@
|
||||
</div>
|
||||
<div class="param-divider"></div>
|
||||
<div class="param-coil">
|
||||
<div class="param-row" v-if="coil.actualWarehouseName">
|
||||
<span class="param-label">实际库区:</span>
|
||||
<span class="param-value">{{ coil.actualWarehouseName }}</span>
|
||||
</div>
|
||||
<div class="param-row" v-if="coil.qualityStatus">
|
||||
<span class="param-label">质量状态:</span>
|
||||
<span class="param-value">{{ coil.qualityStatus }}</span>
|
||||
@@ -136,8 +140,8 @@
|
||||
<span class="info-value" :title="coil.warehouseName">{{ coil.warehouseName || '—' }}</span>
|
||||
</div>
|
||||
<div class="info-coil">
|
||||
<span class="info-label">库区:</span>
|
||||
<span class="info-value" :title="coil.actualWarehouseName">{{ coil.actualWarehouseName || '—'
|
||||
<span class="info-label">规格:</span>
|
||||
<span class="info-value" :title="coil.specification">{{ coil.specification || '—'
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="info-coil">
|
||||
|
||||
@@ -74,8 +74,10 @@ export default {
|
||||
console.log('仓库API返回数据:', response);
|
||||
const data = response.data || [];
|
||||
console.log('处理后的数据:', data);
|
||||
this.warehouseOptions = this.buildTreeOptions(data);
|
||||
console.log('构建的树形选项:', this.warehouseOptions);
|
||||
let options = this.buildTreeOptions(data);
|
||||
options = this.sortOptionsByUsage(options);
|
||||
this.warehouseOptions = options;
|
||||
console.log('构建并排序后的树形选项:', this.warehouseOptions);
|
||||
}).catch(error => {
|
||||
console.error("加载仓库选项失败:", error);
|
||||
this.warehouseOptions = [];
|
||||
@@ -106,7 +108,36 @@ export default {
|
||||
|
||||
return options;
|
||||
},
|
||||
getWarehouseUsage() {
|
||||
try {
|
||||
const usage = localStorage.getItem('warehouseUsage');
|
||||
return usage ? JSON.parse(usage) : {};
|
||||
} catch (error) {
|
||||
console.error('获取仓库使用记录失败:', error);
|
||||
return {};
|
||||
}
|
||||
},
|
||||
updateWarehouseUsage(warehouseId) {
|
||||
try {
|
||||
const usage = this.getWarehouseUsage();
|
||||
usage[warehouseId] = (usage[warehouseId] || 0) + 1;
|
||||
localStorage.setItem('warehouseUsage', JSON.stringify(usage));
|
||||
} catch (error) {
|
||||
console.error('更新仓库使用记录失败:', error);
|
||||
}
|
||||
},
|
||||
sortOptionsByUsage(options) {
|
||||
const usage = this.getWarehouseUsage();
|
||||
return options.sort((a, b) => {
|
||||
const usageA = usage[a.warehouseId] || 0;
|
||||
const usageB = usage[b.warehouseId] || 0;
|
||||
return usageB - usageA;
|
||||
});
|
||||
},
|
||||
onChange(val) {
|
||||
if (val) {
|
||||
this.updateWarehouseUsage(val);
|
||||
}
|
||||
this.$emit('input', val);
|
||||
this.$emit('change', val);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
<script>
|
||||
import { listWarehouse } from '@/api/wms/warehouse';
|
||||
// import { listActualWarehouse } from '@/api/wms/actualWarehouse';
|
||||
import { treeActualWarehouseTwoLevel } from '@/api/wms/actualWarehouse';
|
||||
|
||||
export default {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<transition name="el-fade-in-linear">
|
||||
<div v-if="tooltipVisible && data" class="row-tooltip" :style="adjustedTooltipStyle" ref="rowTooltip">
|
||||
<slot>
|
||||
<div class="tooltip-list">
|
||||
<div class="tooltip-list" :style="{ gridTemplateColumns: `repeat(${columnCount}, 1fr)` }">
|
||||
<div class="tooltip-item" v-for="field in visibleColumns" :key="field.prop">
|
||||
<span class="label">{{ field.label }}:</span>
|
||||
<span class="value">{{ formatTooltipValue(data, field) }}</span>
|
||||
@@ -21,6 +21,10 @@ export default {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
columnCount: {
|
||||
type: Number,
|
||||
default: 2
|
||||
},
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
@@ -45,15 +49,34 @@ export default {
|
||||
const tooltipRect = this.$refs.rowTooltip?.getBoundingClientRect();
|
||||
if (!tooltipRect) return this.tooltipStyle;
|
||||
|
||||
// 检查是否超出底部边界
|
||||
if (parseInt(top) + tooltipRect.height > window.innerHeight) {
|
||||
return { ...this.tooltipStyle, top: `${window.innerHeight - tooltipRect.height - 12}px` };
|
||||
let adjustedTop = parseInt(top);
|
||||
let adjustedLeft = parseInt(left);
|
||||
const offset = 16;
|
||||
|
||||
// 检查是否超出底部边界 - 如果超出,将浮层显示在鼠标上方
|
||||
if (adjustedTop + tooltipRect.height > window.innerHeight) {
|
||||
adjustedTop = adjustedTop - tooltipRect.height - offset;
|
||||
}
|
||||
// 检查是否超出右侧边界
|
||||
if (parseInt(left) + tooltipRect.width > window.innerWidth) {
|
||||
return { ...this.tooltipStyle, left: `${window.innerWidth - tooltipRect.width - 16}px` };
|
||||
|
||||
// 检查是否超出右侧边界 - 如果超出,将浮层显示在鼠标左侧
|
||||
if (adjustedLeft + tooltipRect.width > window.innerWidth) {
|
||||
adjustedLeft = adjustedLeft - tooltipRect.width - offset;
|
||||
}
|
||||
return this.tooltipStyle;
|
||||
|
||||
// 检查是否超出顶部边界
|
||||
if (adjustedTop < 0) {
|
||||
adjustedTop = offset;
|
||||
}
|
||||
|
||||
// 检查是否超出左侧边界
|
||||
if (adjustedLeft < 0) {
|
||||
adjustedLeft = offset;
|
||||
}
|
||||
|
||||
return {
|
||||
top: `${adjustedTop}px`,
|
||||
left: `${adjustedLeft}px`
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -98,9 +121,28 @@ export default {
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
padding: 12px 14px;
|
||||
pointer-events: none;
|
||||
z-index: 5;
|
||||
/* max-height: 70%; */
|
||||
z-index: 9999;
|
||||
overflow: auto;
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.tooltip-list {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.tooltip-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.tooltip-item .label {
|
||||
flex-shrink: 0;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.tooltip-item .value {
|
||||
color: #333;
|
||||
word-break: break-word;
|
||||
}
|
||||
</style>
|
||||
@@ -18,7 +18,7 @@
|
||||
<slot name="append" v-bind="scope"></slot>
|
||||
</template>
|
||||
|
||||
<!-- 3. 透传“自定义列”插槽(直接接收<el-table-column> 嵌套的情况) -->
|
||||
<!-- 3. 透传"自定义列"插槽(直接接收<el-table-column> 嵌套的情况) -->
|
||||
<slot v-bind:tableRef="tableRef"></slot>
|
||||
|
||||
<el-table-column v-if="selectionColumn" type="selection" width="55" align="center"></el-table-column>
|
||||
@@ -27,7 +27,7 @@
|
||||
</el-table>
|
||||
<!-- 浮层组件 -->
|
||||
<KLPTableFloatLayer v-if="floatLayer" :columns="floatLayerColumns" :data="hoveredRow" :tooltipVisible="tooltipVisible"
|
||||
:tooltipStyle="tooltipStyle" />
|
||||
:tooltipStyle="tooltipStyle" :columnCount="floatLayerColumnCount" />
|
||||
</div>
|
||||
<!-- 扩展层:可后续统一添加分页(如与 MyPagination 组件联动) -->
|
||||
<slot name="pagination"></slot>
|
||||
@@ -78,7 +78,9 @@ export default {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
columns: [],
|
||||
title: '详细信息'
|
||||
title: '详细信息',
|
||||
columnCount: 2,
|
||||
excludeColumns: ['action']
|
||||
})
|
||||
},
|
||||
height: {
|
||||
@@ -101,11 +103,16 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
floatLayerColumns() {
|
||||
console.log(this.floatLayerConfig?.columns?.length > 1)
|
||||
if (this.floatLayerConfig?.columns?.length > 1) {
|
||||
return this.floatLayerConfig.columns
|
||||
}
|
||||
return this.columns;
|
||||
},
|
||||
floatLayerColumnCount() {
|
||||
return this.floatLayerConfig?.columnCount || 2;
|
||||
},
|
||||
excludeColumns() {
|
||||
return this.floatLayerConfig?.excludeColumns || ['action'];
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -157,6 +164,15 @@ export default {
|
||||
// 浮层相关
|
||||
handleCellEnter(row, column, cell, event) {
|
||||
if (!row || !event) return
|
||||
|
||||
// 检查是否是排除的列(操作列等)
|
||||
const excludeColumns = this.excludeColumns
|
||||
if (excludeColumns.includes(column.property)) {
|
||||
this.tooltipVisible = false
|
||||
this.hoveredRow = null
|
||||
return
|
||||
}
|
||||
|
||||
this.hoveredRow = row
|
||||
this.tooltipVisible = true
|
||||
this.updateTooltipPosition(event)
|
||||
|
||||
@@ -1,25 +1,34 @@
|
||||
<template>
|
||||
<div class="muti-select">
|
||||
<!-- 下拉选择模式 -->
|
||||
<el-select
|
||||
v-if="type === 'select'"
|
||||
v-model="innerValue"
|
||||
multiple
|
||||
:placeholder="placeholder"
|
||||
:filterable="filterable"
|
||||
:clearable="clearable"
|
||||
:allow-create="allowAdd"
|
||||
:disabled="disabled"
|
||||
:size="size"
|
||||
@change="handleChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<div v-if="type === 'select'" class="select-container">
|
||||
<el-select
|
||||
v-model="innerValue"
|
||||
multiple
|
||||
:placeholder="placeholder"
|
||||
:filterable="filterable"
|
||||
:clearable="clearable"
|
||||
:allow-create="allowAdd"
|
||||
:disabled="disabled"
|
||||
:size="size"
|
||||
@change="handleChange"
|
||||
>
|
||||
<!-- 全选选项 -->
|
||||
<!-- <el-option
|
||||
v-if="showSelectAll && options.length > 0"
|
||||
key="selectAll"
|
||||
label="全选"
|
||||
value="selectAll"
|
||||
@click="toggleSelectAll"
|
||||
/> -->
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!-- 复选框模式 -->
|
||||
<div v-else-if="type === 'checkbox'" class="checkbox-group">
|
||||
@@ -33,14 +42,14 @@
|
||||
{{ item.label }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
<!-- <el-button
|
||||
<el-button
|
||||
v-if="showSelectAll && options.length > 0"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="toggleSelectAll"
|
||||
>
|
||||
{{ isAllSelected ? '取消全选' : '全选' }}
|
||||
</el-button> -->
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -114,7 +123,9 @@
|
||||
methods: {
|
||||
// 处理选择变化
|
||||
handleChange(val) {
|
||||
this.$emit('change', val.join(','));
|
||||
// 过滤掉 'selectAll' 选项
|
||||
const filteredVal = val.filter(item => item !== 'selectAll');
|
||||
this.$emit('change', filteredVal.join(','));
|
||||
},
|
||||
// 处理复选框变化
|
||||
handleCheckboxChange(val) {
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
<span>订单信息</span>
|
||||
<el-button @click.stop="openOrderDialog" style="margin-left: 10px;" plain
|
||||
:type="formData.orderId ? 'success' : 'default'">
|
||||
{{ formData.orderId ? formData.orderCode : '选择订单' }}
|
||||
{{ formData.orderId ? formData.contractCode : '选择订单' }}
|
||||
</el-button>
|
||||
<div v-if="formData.orderId" @click.stop="openOrderAttachmentDialog" style="margin-left: 10px; cursor: pointer; color: #409eff;"
|
||||
type="primary">
|
||||
<div v-if="formData.orderId" @click.stop="openOrderAttachmentDialog"
|
||||
style="margin-left: 10px; cursor: pointer; color: #409eff;" type="primary">
|
||||
查看附件
|
||||
</div>
|
||||
</template>
|
||||
@@ -68,6 +68,12 @@
|
||||
|
||||
<!-- 成品信息组 -->
|
||||
<el-collapse-item title="成品信息" name="3">
|
||||
<template slot="title">
|
||||
<!-- 如果已经绑定了订单,可以在这里选择订单明细来快速录入要生产的成品信息 -->
|
||||
<span>成品信息</span>
|
||||
<el-button type="primary" plain v-if="formData.orderId" style="margin-left: 10px;"
|
||||
@click.stop="openOrderItemDialog">选择订单明细</el-button>
|
||||
</template>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成品名称" prop="productName">
|
||||
@@ -210,14 +216,8 @@
|
||||
<div class="order-dialog-content">
|
||||
<!-- 筛选条件 -->
|
||||
<el-form :model="orderQueryParams" ref="orderQueryForm" size="small" :inline="true" label-width="80px">
|
||||
<el-form-item label="合同号">
|
||||
<el-select v-model="orderQueryParams.contractId" placeholder="请选择合同">
|
||||
<el-option v-for="contract in contractList" :key="contract.contractId" :label="contract.contractNo"
|
||||
:value="contract.contractId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号">
|
||||
<el-input v-model="orderQueryParams.orderCode" placeholder="请输入订单号" style="width: 180px" />
|
||||
<el-form-item label="合同号" prop="contractCode">
|
||||
<el-input v-model="orderQueryParams.contractCode" placeholder="请输入合同号" style="width: 180px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户">
|
||||
<el-input v-model="orderQueryParams.customerName" placeholder="请输入客户名称" style="width: 180px" />
|
||||
@@ -234,9 +234,9 @@
|
||||
<!-- 订单列表 -->
|
||||
<el-table v-loading="orderLoading" :data="orderList" style="width: 100%" @row-click="handleOrderSelect">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="orderCode" label="订单号" width="150" />
|
||||
<el-table-column prop="orderType" label="订单类型" width="100" />
|
||||
<el-table-column prop="contractCode" label="合同号" width="150" />
|
||||
<el-table-column prop="signTime" label="签订时间" width="150" />
|
||||
<el-table-column prop="signLocation" label="签订地点" />
|
||||
<el-table-column prop="companyName" label="客户" width="180" />
|
||||
<el-table-column prop="salesman" label="业务员" width="100" />
|
||||
<el-table-column prop="orderAmount" label="订单金额" width="120" align="right" />
|
||||
@@ -258,6 +258,37 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="选择订单明细" :visible.sync="orderItem.open" width="80%" append-to-body>
|
||||
<el-table v-loading="orderItem.loading" :data="orderItem.list" @row-click="selectOrderItem">
|
||||
<el-table-column label="产品类型" align="center" prop="productType" />
|
||||
<el-table-column label="成品宽度" align="center" prop="width" />
|
||||
<el-table-column label="成品厚度" align="center" prop="thickness" />
|
||||
<el-table-column label="成品规格" align="center" prop="finishedProductSpec" />
|
||||
<el-table-column label="宽度公差" align="center" prop="widthTolerance" />
|
||||
<el-table-column label="厚度公差" align="center" prop="thicknessTolerance" />
|
||||
|
||||
<el-table-column label="材质" align="center" prop="material" />
|
||||
<el-table-column label="重量" align="center" prop="weight" />
|
||||
<!-- <el-table-column label="含税单价(元/吨)" align="center" prop="contractPrice" />
|
||||
<el-table-column label="含税总额" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.weight * scope.row.contractPrice }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="无税单价(元/吨)" align="center" prop="itemAmount" /> -->
|
||||
<el-table-column label="卷数" align="center" prop="productNum" />
|
||||
<el-table-column label="表面处理" align="center" prop="surfaceTreatment" />
|
||||
<el-table-column label="包装要求" align="center" prop="packagingReq" />
|
||||
<el-table-column label="切边要求" align="center" prop="edgeCuttingReq" />
|
||||
<el-table-column label="用途" align="center" prop="purpose" />
|
||||
|
||||
|
||||
<el-table-column label="特殊要求" align="center" prop="specialRequire" />
|
||||
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="合同附件" :visible.sync="attachmentOpen" width="50%" append-to-body>
|
||||
<div class="attachment-section" v-loading="loading">
|
||||
<!-- <div class="attachment-item">
|
||||
@@ -279,7 +310,7 @@
|
||||
|
||||
<script>
|
||||
import { listOrder, getOrder } from '@/api/crm/order';
|
||||
import { listContract, getContract } from '@/api/crm/contract';
|
||||
import { listOrderItem } from '@/api/crm/orderItem'
|
||||
import FileList from '@/components/FileList'
|
||||
|
||||
export default {
|
||||
@@ -351,6 +382,11 @@ export default {
|
||||
attachmentOpen: false,
|
||||
contract: {},
|
||||
loading: false,
|
||||
orderItem: {
|
||||
loading: false,
|
||||
open: false,
|
||||
list: []
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -365,10 +401,38 @@ export default {
|
||||
openOrderDialog() {
|
||||
this.dialogVisible = true;
|
||||
// 加载合同列表
|
||||
this.getContractList();
|
||||
// this.getContractList();
|
||||
// 加载订单列表
|
||||
this.getOrderList();
|
||||
},
|
||||
openOrderItemDialog() {
|
||||
this.orderItem.open = true;
|
||||
this.orderItem.loading = true;
|
||||
listOrderItem({ orderId: this.formData.orderId }).then(res => {
|
||||
this.orderItem.list = res.rows;
|
||||
this.orderItem.loading = false;
|
||||
})
|
||||
},
|
||||
selectOrderItem(row) {
|
||||
this.formData = {
|
||||
...this.formData,
|
||||
productName: row.productType,
|
||||
productMaterial: row.material,
|
||||
productWidth: row.width,
|
||||
rollingThick: row.thickness,
|
||||
markCoatThick: row.thickness,
|
||||
tonSteelLengthRange: 0,
|
||||
planQty: row.productNum,
|
||||
planWeight: row.weight,
|
||||
surfaceTreatment: row.surfaceTreatment,
|
||||
productPackaging: row.packagingReq,
|
||||
widthReq: row.edgeCuttingReq,
|
||||
productEdgeReq: row.widthTolerance,
|
||||
usageReq: row.purpose,
|
||||
}
|
||||
this.orderItem.open = false;
|
||||
// this.formData.orderItemId = row.orderItemId;
|
||||
},
|
||||
async openOrderAttachmentDialog() {
|
||||
this.loading = true;
|
||||
this.attachmentOpen = true;
|
||||
@@ -379,25 +443,13 @@ export default {
|
||||
return;
|
||||
}
|
||||
const order = await getOrder(this.formData.orderId);
|
||||
if (!order.data.contractId) {
|
||||
this.$message.error('未找到合同')
|
||||
return;
|
||||
}
|
||||
// 根据合同id拿到合同详情
|
||||
const contract = await getContract(order.data.contractId);
|
||||
this.contract = contract.data;
|
||||
this.contract = order.data;
|
||||
} catch {
|
||||
this.$message.error('获取合同附件失败')
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
/** 获取合同列表 */
|
||||
getContractList() {
|
||||
listContract().then(response => {
|
||||
this.contractList = response.rows;
|
||||
});
|
||||
},
|
||||
/** 获取订单列表 */
|
||||
getOrderList() {
|
||||
this.orderLoading = true;
|
||||
|
||||
@@ -14,25 +14,31 @@
|
||||
|
||||
<el-table v-loading="loading" :data="orderItemList">
|
||||
<el-table-column label="产品类型" align="center" prop="productType" />
|
||||
<el-table-column label="原料规格" align="center" prop="rawMaterialSpec" />
|
||||
<el-table-column label="成品宽度" align="center" prop="width" />
|
||||
<el-table-column label="成品厚度" align="center" prop="thickness" />
|
||||
<el-table-column label="成品规格" align="center" prop="finishedProductSpec" />
|
||||
<!-- <el-table-column label="原料规格" align="center" prop="rawMaterialSpec" /> -->
|
||||
<el-table-column label="宽度公差" align="center" prop="widthTolerance" />
|
||||
<el-table-column label="厚度公差" align="center" prop="thicknessTolerance" />
|
||||
<el-table-column label="成品规格" align="center" prop="finishedProductSpec" />
|
||||
|
||||
<el-table-column label="材质" align="center" prop="material" />
|
||||
<el-table-column label="等级" align="center" prop="grade" />
|
||||
<el-table-column label="重量" align="center" prop="weight" />
|
||||
<el-table-column label="合同定价" align="center" prop="contractPrice" />
|
||||
<el-table-column label="金额(元)" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-table-column label="含税单价(元/吨)" align="center" prop="contractPrice" />
|
||||
<el-table-column label="含税总额" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.weight * scope.row.contractPrice }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="定制人" align="center" prop="customizer" />
|
||||
<el-table-column label="发货人" align="center" prop="shipper" />
|
||||
<el-table-column label="排产批次" align="center" prop="productionBatch" />
|
||||
<!-- <el-table-column label="产品数量" align="center" prop="productNum" /> -->
|
||||
<!-- <el-table-column label="特殊要求" align="center" prop="specialRequire" /> -->
|
||||
<!-- <el-table-column label="明细金额" align="center" prop="itemAmount" /> -->
|
||||
<el-table-column label="无税单价(元/吨)" align="center" prop="itemAmount" />
|
||||
<el-table-column label="卷数" align="center" prop="productNum" />
|
||||
<el-table-column label="表面处理" align="center" prop="surfaceTreatment" />
|
||||
<el-table-column label="包装要求" align="center" prop="packagingReq" />
|
||||
<el-table-column label="切边要求" align="center" prop="edgeCuttingReq" />
|
||||
<el-table-column label="用途" align="center" prop="purpose" />
|
||||
|
||||
|
||||
<el-table-column label="特殊要求" align="center" prop="specialRequire" />
|
||||
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="editable">
|
||||
<template slot-scope="scope">
|
||||
@@ -52,18 +58,15 @@
|
||||
<el-form-item label="产品类型" prop="productType">
|
||||
<el-input v-model="form.productType" placeholder="请输入产品类型" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="产品数量" prop="productNum">
|
||||
<el-input v-model="form.productNum" placeholder="请输入产品数量" />
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="明细金额" prop="itemAmount">
|
||||
<el-input size="mini" v-model="form.itemAmount" placeholder="请输入明细金额" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="原料规格" prop="rawMaterialSpec">
|
||||
<el-input v-model="form.rawMaterialSpec" placeholder="请输入原料规格" />
|
||||
</el-form-item>
|
||||
<el-form-item label="成品规格" prop="finishedProductSpec">
|
||||
<el-input v-model="form.finishedProductSpec" placeholder="请输入成品规格" />
|
||||
</el-form-item>
|
||||
<el-form-item label="成品宽度" prop="width">
|
||||
<el-input v-model="form.width" placeholder="请输入宽度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="成品厚度" prop="thickness">
|
||||
<el-input v-model="form.thickness" placeholder="请输入厚度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="宽度公差" prop="widthTolerance">
|
||||
<el-input v-model="form.widthTolerance" placeholder="请输入宽度公差" />
|
||||
</el-form-item>
|
||||
@@ -73,23 +76,34 @@
|
||||
<el-form-item label="材质" prop="material">
|
||||
<el-input v-model="form.material" placeholder="请输入材质" />
|
||||
</el-form-item>
|
||||
<el-form-item label="等级" prop="grade">
|
||||
<el-input v-model="form.grade" placeholder="请输入等级" />
|
||||
</el-form-item>
|
||||
<el-form-item label="重量" prop="weight">
|
||||
<el-input v-model="form.weight" placeholder="请输入重量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同定价" prop="contractPrice">
|
||||
<el-input v-model="form.contractPrice" placeholder="请输入合同定价" />
|
||||
<el-form-item label="含税单价(元/吨)" prop="contractPrice">
|
||||
<el-input v-model="form.contractPrice" placeholder="请输入含税单价" />
|
||||
</el-form-item>
|
||||
<el-form-item label="定制人" prop="customizer">
|
||||
<el-input v-model="form.customizer" placeholder="请输入定制人" />
|
||||
<el-form-item label="无税单价(元/吨)" prop="itemAmount">
|
||||
<el-input v-model="form.itemAmount" placeholder="请输入无税单价" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发货人" prop="shipper">
|
||||
<el-input v-model="form.shipper" placeholder="请输入发货人" />
|
||||
|
||||
<el-form-item label="卷数" prop="productNum">
|
||||
<el-input v-model="form.productNum" placeholder="请输入卷数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排产批次" prop="productionBatch">
|
||||
<el-input v-model="form.productionBatch" placeholder="请输入排产批次" />
|
||||
<el-form-item label="表面处理" prop="surfaceTreatment">
|
||||
<el-input v-model="form.surfaceTreatment" placeholder="请输入表面处理" />
|
||||
</el-form-item>
|
||||
<el-form-item label="包装要求" prop="packagingReq">
|
||||
<el-input v-model="form.packagingReq" placeholder="请输入包装要求" />
|
||||
</el-form-item>
|
||||
<el-form-item label="切边要求" prop="edgeCuttingReq">
|
||||
<el-input v-model="form.edgeCuttingReq" placeholder="请输入切边要求" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用途" prop="purpose">
|
||||
<el-input v-model="form.purpose" placeholder="请输入用途" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="特殊要求" prop="specialRequire">
|
||||
<el-input v-model="form.specialRequire" placeholder="请输入特殊要求" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
@@ -113,7 +127,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOrderItem, getOrderItem, delOrderItem, addOrderItem, updateOrderItem } from "@/api/crm/orderItem";
|
||||
import { listOrderItem, getOrderItem } from "@/api/crm/orderItem";
|
||||
import { actions, ORDER_ACTIONS } from "../js/actions";
|
||||
import { getOrder } from "@/api/crm/order";
|
||||
import OrderPrinter from "./OrderPrinter.vue";
|
||||
@@ -172,29 +186,29 @@ export default {
|
||||
productType: [
|
||||
{ required: true, message: "请输入产品类型", trigger: "blur" }
|
||||
],
|
||||
productNum: [
|
||||
{ required: true, message: "请输入产品数量", trigger: "blur" }
|
||||
],
|
||||
rawMaterialSpec: [
|
||||
{ required: true, message: "请输入原料规格", trigger: "blur" }
|
||||
],
|
||||
finishedProductSpec: [
|
||||
{ required: true, message: "请输入成品规格", trigger: "blur" }
|
||||
],
|
||||
// productNum: [
|
||||
// { required: true, message: "请输入产品数量", trigger: "blur" }
|
||||
// ],
|
||||
// rawMaterialSpec: [
|
||||
// { required: true, message: "请输入原料规格", trigger: "blur" }
|
||||
// ],
|
||||
// finishedProductSpec: [
|
||||
// { required: true, message: "请输入成品规格", trigger: "blur" }
|
||||
// ],
|
||||
// 重量和合同定价不能为空,且必须是数字,最多两位小数
|
||||
weight: [
|
||||
{ required: true, message: "请输入重量", trigger: "blur" },
|
||||
// 必须是数字,最多两位小数,使用自定义的校验规则
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (!/^\d+(\.\d{1,2,3})?$/.test(value)) {
|
||||
callback(new Error("请输入最多三位小数的数字"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: "change"
|
||||
}
|
||||
],
|
||||
// weight: [
|
||||
// { required: true, message: "请输入重量", trigger: "blur" },
|
||||
// // 必须是数字,最多两位小数,使用自定义的校验规则
|
||||
// {
|
||||
// validator: (rule, value, callback) => {
|
||||
// if (!/^\d+(\.\d{1,2,3})?$/.test(value)) {
|
||||
// callback(new Error("请输入最多三位小数的数字"));
|
||||
// } else {
|
||||
// callback();
|
||||
// }
|
||||
// }, trigger: "change"
|
||||
// }
|
||||
// ],
|
||||
contractPrice: [
|
||||
{ required: true, message: "请输入合同定价", trigger: "blur" },
|
||||
// 必须是数字,最多两位小数,使用自定义的校验规则
|
||||
|
||||
@@ -23,8 +23,12 @@
|
||||
<el-input v-model="queryParams.contractName" placeholder="请输入合同名称" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同编号" prop="contractNo">
|
||||
<el-input v-model="queryParams.contractNo" placeholder="请输入合同编号" clearable
|
||||
<el-form-item label="销售员" prop="salesman">
|
||||
<el-input v-model="queryParams.salesman" placeholder="请输入销售员" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同编号" prop="contractCode">
|
||||
<el-input v-model="queryParams.contractCode" placeholder="请输入合同编号" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供方" prop="supplier">
|
||||
@@ -47,8 +51,8 @@
|
||||
<el-input v-model="queryParams.signLocation" placeholder="请输入签订地点" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同状态" prop="contractStatus">
|
||||
<el-select v-model="queryParams.contractStatus" placeholder="请选择合同状态">
|
||||
<el-form-item label="合同状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择合同状态">
|
||||
<el-option label="草稿" value="0" />
|
||||
<el-option label="已生效" value="1" />
|
||||
<el-option label="已作废" value="2" />
|
||||
@@ -70,7 +74,7 @@
|
||||
<!-- 合同名称和编号 -->
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;">
|
||||
<div style="font-weight: bold;">{{ row.contractName }}</div>
|
||||
<div style="font-size: 12px; color: #606266;">{{ row.contractNo }}</div>
|
||||
<div style="font-size: 12px; color: #606266;">{{ row.contractCode }}</div>
|
||||
</div>
|
||||
|
||||
<!-- 供方和需方 -->
|
||||
@@ -116,12 +120,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listContract, updateContract } from "@/api/crm/contract";
|
||||
import { listOrder, updateOrder } from "@/api/crm/order";
|
||||
import * as ExcelJS from 'exceljs';
|
||||
import { saveAs } from 'file-saver';
|
||||
|
||||
export default {
|
||||
name: "ContractList",
|
||||
dicts: ['wip_pack_saleman'],
|
||||
data() {
|
||||
return {
|
||||
// 合同信息表格数据
|
||||
@@ -139,7 +144,7 @@ export default {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
contractName: undefined,
|
||||
contractNo: undefined,
|
||||
contractCode: undefined,
|
||||
supplier: undefined,
|
||||
customer: undefined,
|
||||
signTime: undefined,
|
||||
@@ -156,7 +161,7 @@ export default {
|
||||
/** 查询合同信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listContract(this.queryParams).then(response => {
|
||||
listOrder(this.queryParams).then(response => {
|
||||
this.contractList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
@@ -164,7 +169,7 @@ export default {
|
||||
},
|
||||
/** 状态变更 */
|
||||
handleChangeStatus(row) {
|
||||
updateContract(row).then(response => {
|
||||
updateOrder(row).then(response => {
|
||||
this.$message({
|
||||
message: "状态变更成功",
|
||||
type: "success"
|
||||
@@ -225,7 +230,7 @@ export default {
|
||||
|
||||
// 合同编号
|
||||
worksheet.mergeCells('G2:H2');
|
||||
worksheet.getCell('G2').value = `合同编号:${row.contractNo || ''}`;
|
||||
worksheet.getCell('G2').value = `合同编号:${row.contractCode || ''}`;
|
||||
worksheet.getCell('G2').alignment = { horizontal: 'right', vertical: 'middle' };
|
||||
|
||||
// 供方信息
|
||||
@@ -687,7 +692,7 @@ export default {
|
||||
// 5. 导出文件
|
||||
const buffer = await workbook.xlsx.writeBuffer();
|
||||
const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
||||
saveAs(blob, `合同_${row.contractNo || row.contractName || '未命名'}.xlsx`);
|
||||
saveAs(blob, `合同_${row.contractCode || row.contractName || '未命名'}.xlsx`);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</el-select>
|
||||
</h3>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="合同编号">{{ contract.contractNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="合同编号">{{ contract.contractCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="合同状态">
|
||||
<el-tag :type="contract.status == 0 ? 'info' : contract.status == 1 ? 'success' : contract.status == 2 ? 'danger' : 'primary'">
|
||||
{{ contract.status == 0 ? '草稿' : contract.status == 1 ? '已生效' : contract.status == 2 ? '已作废' : '已完成' }}
|
||||
@@ -27,12 +27,12 @@
|
||||
|
||||
<div style="margin-top: 20px;">
|
||||
<h4 style="margin-bottom: 10px; color: #606266;">一、产品内容</h4>
|
||||
<ProductContent v-model="contract.productContent" readonly />
|
||||
<OrderDetail :orderId="contract.orderId" :remark="contract.remark" readonly />
|
||||
<!-- <ProductContent v-model="contract.productContent" readonly /> -->
|
||||
<!-- <div v-html="contract.productContent" style="border: 1px solid #e4e7ed; padding: 10px; border-radius: 4px;"></div> -->
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<!-- <h4 style="margin-bottom: 10px; color: #606266;">合同内容</h4> -->
|
||||
<div v-html="contract.contractContent" style="border: 1px solid #e4e7ed; padding: 10px; border-radius: 4px;"></div>
|
||||
</div>
|
||||
|
||||
@@ -61,11 +61,13 @@
|
||||
|
||||
<script>
|
||||
import ProductContent from './ProductContent.vue';
|
||||
import OrderDetail from './OrderDetail.vue';
|
||||
|
||||
export default {
|
||||
name: "ContractPreview",
|
||||
components: {
|
||||
ProductContent
|
||||
ProductContent,
|
||||
OrderDetail
|
||||
},
|
||||
props: {
|
||||
contract: {
|
||||
|
||||
@@ -1,48 +1,45 @@
|
||||
<template>
|
||||
<div class="contract-tabs">
|
||||
<div v-if="contractId" class="tabs-content">
|
||||
<div class="custom-tabbar" v-loading="tabLoading">
|
||||
<div
|
||||
v-for="tab in tabs"
|
||||
:key="tab.name"
|
||||
class="tab-item"
|
||||
:class="{ active: activeTab === tab.name }"
|
||||
@click="activeTab = tab.name"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<OrderPage v-if="activeTab === 'second'" :contractId="contractId" :customerId="customerId" />
|
||||
<KLPTable v-else-if="activeTab === 'third'" v-loading="loading" :data="financeList">
|
||||
<el-table-column label="收款日期" align="center" prop="dueDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.dueDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收款金额" align="center" prop="amount" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
</KLPTable>
|
||||
<el-table v-else-if="activeTab === 'fourth'" v-loading="loading" :data="objectionList">
|
||||
<el-table-column label="编号" align="center" prop="objectionCode" />
|
||||
<el-table-column label="状态" align="center" prop="objectionStatus">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.objectionStatus === 0" type="danger">待处理</el-tag>
|
||||
<el-tag v-else-if="scope.row.objectionStatus === 1" type="success">已处理</el-tag>
|
||||
<el-tag v-else-if="scope.row.objectionStatus === 2" type="info">已关闭</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="处理人" align="center" prop="handleUser" />
|
||||
<el-table-column label="处理时间" align="center" prop="handleTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.handleTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
</el-table>
|
||||
<DeliveryTable v-else-if="activeTab === 'seventh'" :data="wmsDeliveryWaybills" />
|
||||
<CoilTable v-else-if="activeTab === 'fifth'" :data="coilList" />
|
||||
<div v-else-if="activeTab === 'sixth'" class="attachment-section">
|
||||
<div v-if="orderId" class="tabs-content">
|
||||
<el-tabs v-model="activeTab" type="border-card">
|
||||
<el-tab-pane label="订单编辑" name="edit" v-hasPermi="['crm:order:edit']">
|
||||
<div class="order-detail" v-if="activeTab === 'edit'">
|
||||
<el-descriptions title="订单明细" />
|
||||
<OrderDetail :orderId="currentOrder.orderId" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="财务状态" name="finance" v-hasPermi="['crm:order:finance']">
|
||||
<div class="order-finance" v-if="activeTab === 'finance'">
|
||||
<!-- 财务状态内容 -->
|
||||
<ReceiveTable :order="currentOrder" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="订单异议" name="dispute" v-hasPermi="['crm:order:objection']">
|
||||
<div class="order-dispute" v-if="activeTab === 'dispute'">
|
||||
<!-- 订单异议内容 -->
|
||||
<OrderObjection :order="currentOrder" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="生产成果" name="product">
|
||||
<div class="order-record" v-if="activeTab === 'product'">
|
||||
<!-- 生产成果内容 -->
|
||||
<CoilTable :data="productList || []" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="发货配卷" name="coil">
|
||||
<div class="order-record" v-if="activeTab === 'coil'">
|
||||
<!-- 发货配卷内容 -->
|
||||
<CoilTable :data="coilList" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="发货单据" name="delivery">
|
||||
<div class="order-record" v-if="activeTab === 'delivery'">
|
||||
<!-- 发货单内容 -->
|
||||
<DeliveryTable :data="deliveryWaybillList" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="合同附件" name="attachment" v-hasPermi="['crm:order:record']">
|
||||
<div class="attachment-item">
|
||||
<h4>商务附件</h4>
|
||||
<FileList :oss-ids="contractAttachment" />
|
||||
@@ -55,8 +52,18 @@
|
||||
<h4>排产函</h4>
|
||||
<FileList :oss-ids="otherAttachment" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="attachment-item">
|
||||
<h4>其他附件</h4>
|
||||
<FileList :oss-ids="form.annexFiles" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="操作记录" name="record" v-hasPermi="['crm:order:record']">
|
||||
<div class="order-record" v-if="activeTab === 'record'">
|
||||
<!-- 操作记录内容 -->
|
||||
<OrderRecord :orderId="currentOrder.orderId" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<div v-else class="no-selection" style="display: flex; align-items: center; justify-content: center; height: 100%;">
|
||||
<el-empty description="请先选择合同" />
|
||||
@@ -65,45 +72,44 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OrderPage from "@/views/crm/order/index.vue";
|
||||
// import OrderPage from "@/views/crm/order/index.vue";
|
||||
import CoilTable from "../../components/CoilTable.vue";
|
||||
import FileList from "@/components/FileList";
|
||||
import DeliveryTable from "../../components/DeliveryTable.vue";
|
||||
|
||||
// 导入可能需要的组件
|
||||
import OrderDetail from "../../components/OrderDetail.vue";
|
||||
import OrderEdit from "../../components/OrderEdit.vue";
|
||||
import ReceiveTable from "../../components/ReceiveTable.vue";
|
||||
import OrderObjection from "../../components/OrderObjection.vue";
|
||||
import OrderRecord from "../../components/OrderRecord.vue";
|
||||
|
||||
export default {
|
||||
name: "ContractTabs",
|
||||
components: {
|
||||
OrderPage,
|
||||
CoilTable,
|
||||
FileList,
|
||||
DeliveryTable
|
||||
},
|
||||
DeliveryTable,
|
||||
OrderDetail,
|
||||
OrderEdit,
|
||||
ReceiveTable,
|
||||
OrderObjection,
|
||||
OrderRecord
|
||||
},
|
||||
props: {
|
||||
contractId: {
|
||||
orderId: {
|
||||
type: [Number, String],
|
||||
default: null
|
||||
},
|
||||
customerId: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
financeList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
objectionList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
coilList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
productList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
tabLoading: {
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
@@ -120,7 +126,16 @@ export default {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
wmsDeliveryWaybills: {
|
||||
// 新增必要的props
|
||||
form: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
currentOrder: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
deliveryWaybillList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
@@ -128,16 +143,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
// 活动tab
|
||||
activeTab: "second",
|
||||
// 标签页配置
|
||||
tabs: [
|
||||
{ label: "下发订单", name: "second" },
|
||||
{ label: "财务状态", name: "third" },
|
||||
{ label: "订单异议", name: "fourth" },
|
||||
{ label: "发货配卷", name: "fifth" },
|
||||
{ label: '发货单据', name: 'seventh' },
|
||||
{ label: "合同附件", name: "sixth" },
|
||||
]
|
||||
activeTab: "finance"
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -158,80 +164,7 @@ export default {
|
||||
.replace('{h}', hours)
|
||||
.replace('{i}', minutes)
|
||||
.replace('{s}', seconds);
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.contract-tabs {
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.tabs-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.custom-tabbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
background-color: #f5f7fa;
|
||||
padding: 4px;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
padding: 8px 16px;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
transition: all 0.3s ease;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tab-item:hover {
|
||||
color: #409eff;
|
||||
background-color: rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
|
||||
.tab-item.active {
|
||||
color: #409eff;
|
||||
background-color: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
font-weight: 500;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.tab-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.attachment-section {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.attachment-item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.attachment-item h4 {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.attachment-item .file-list-container {
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
</script>
|
||||
307
klp-ui/src/views/crm/contract/components/OrderDetail.vue
Normal file
307
klp-ui/src/views/crm/contract/components/OrderDetail.vue
Normal file
@@ -0,0 +1,307 @@
|
||||
<template>
|
||||
<div v-loading="loading">
|
||||
<!-- 网格布局实现的表格,共8列 -->
|
||||
<div class="product-content">
|
||||
<!-- 第一行合并所有八个单元格,内容为:嘉祥科伦普重工有限公司 -->
|
||||
<div class="table-row table-header">
|
||||
<div class="table-cell" colspan="3">
|
||||
<div class="company-name">产品名称:{{ productName }}</div>
|
||||
</div>
|
||||
<div class="table-cell" colspan="5">
|
||||
<div class="company-name">生产厂家:嘉祥科伦普重工有限公司</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 第二行为表头 -->
|
||||
<div class="table-row">
|
||||
<div class="table-cell">序号</div>
|
||||
<div class="table-cell">规格(mm)</div>
|
||||
<div class="table-cell">材质</div>
|
||||
<div class="table-cell">数量(吨)</div>
|
||||
<div class="table-cell">含税单价(元/吨)</div>
|
||||
<div class="table-cell">不含税单价(元/吨)</div>
|
||||
<div class="table-cell">含税总额(元)</div>
|
||||
<div class="table-cell">备注</div>
|
||||
</div>
|
||||
|
||||
<!-- 产品行 -->
|
||||
<div
|
||||
v-for="(item, index) in products"
|
||||
:key="index"
|
||||
class="table-row"
|
||||
:class="{ 'table-row-hover': !readonly }"
|
||||
>
|
||||
<div class="table-cell">
|
||||
<div class="serial-number">
|
||||
<span>{{ index + 1 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
{{ item.finishedProductSpec }}
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
{{ item.material }}
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
{{ item.weight }}
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
{{ item.contractPrice }}
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
{{ item.itemAmount }}
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
{{ item.contractPrice * item.weight }}
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
{{ item.remark }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 合计行 -->
|
||||
<div class="table-row table-total-row">
|
||||
<div class="table-cell" colspan="3">合计</div>
|
||||
<div class="table-cell">{{ totalQuantity }}</div>
|
||||
<div class="table-cell"></div>
|
||||
<div class="table-cell"></div>
|
||||
<div class="table-cell">{{ totalTaxTotal }}</div>
|
||||
<div class="table-cell"></div>
|
||||
</div>
|
||||
|
||||
<!-- 合计人民币(大写) -->
|
||||
<div class="table-row">
|
||||
<div class="table-cell" colspan="8">
|
||||
<span>合计人民币(大写):</span>
|
||||
<span>{{ totalAmountInWords }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 备注 -->
|
||||
<div class="table-row">
|
||||
<div class="table-cell" colspan="8">
|
||||
<span>备注:</span>
|
||||
<pre>{{ remark }}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOrderItem } from '@/api/crm/orderItem'
|
||||
|
||||
export default {
|
||||
name: 'ProductContent',
|
||||
props: {
|
||||
orderId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
remark: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
products: [],
|
||||
productName: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 计算总数量(吨)
|
||||
totalQuantity() {
|
||||
return this.products.reduce((sum, item) => sum + (Number(item.weight) || 0), 0)
|
||||
},
|
||||
// 计算含税总额(元)
|
||||
totalTaxTotal() {
|
||||
return this.products.reduce((sum, item) => sum + (Number(item.contractPrice) || 0) * (Number(item.weight) || 0), 0)
|
||||
},
|
||||
// 计算合计人民币(大写)
|
||||
totalAmountInWords() {
|
||||
const amount = this.totalTaxTotal
|
||||
if (amount === 0) return '零元整'
|
||||
|
||||
const digits = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']
|
||||
const units = ['', '拾', '佰', '仟']
|
||||
const bigUnits = ['', '万', '亿']
|
||||
|
||||
let integerPart = Math.floor(amount)
|
||||
let decimalPart = Math.round((amount - integerPart) * 100)
|
||||
|
||||
let result = ''
|
||||
let unitIndex = 0
|
||||
let bigUnitIndex = 0
|
||||
|
||||
if (integerPart === 0) {
|
||||
result = '零'
|
||||
} else {
|
||||
while (integerPart > 0) {
|
||||
let section = integerPart % 10000
|
||||
if (section > 0) {
|
||||
let sectionResult = ''
|
||||
let sectionUnitIndex = 0
|
||||
|
||||
while (section > 0) {
|
||||
let digit = section % 10
|
||||
if (digit > 0) {
|
||||
sectionResult = digits[digit] + units[sectionUnitIndex] + sectionResult
|
||||
} else if (sectionResult && !sectionResult.startsWith('零')) {
|
||||
sectionResult = '零' + sectionResult
|
||||
}
|
||||
section = Math.floor(section / 10)
|
||||
sectionUnitIndex++
|
||||
}
|
||||
|
||||
result = sectionResult + bigUnits[bigUnitIndex] + result
|
||||
}
|
||||
integerPart = Math.floor(integerPart / 10000)
|
||||
bigUnitIndex++
|
||||
}
|
||||
}
|
||||
|
||||
result += '元'
|
||||
|
||||
if (decimalPart === 0) {
|
||||
result += '整'
|
||||
} else {
|
||||
const jiao = Math.floor(decimalPart / 10)
|
||||
const fen = decimalPart % 10
|
||||
if (jiao > 0) {
|
||||
result += digits[jiao] + '角'
|
||||
}
|
||||
if (fen > 0) {
|
||||
result += digits[fen] + '分'
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 监听 orderId 变化,重新获取订单商品列表
|
||||
orderId: {
|
||||
handler(newVal) {
|
||||
if (newVal) {
|
||||
this.getOrderItems()
|
||||
} else {
|
||||
this.products = []
|
||||
this.productName = ''
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 获取订单商品列表
|
||||
async getOrderItems() {
|
||||
this.loading = true
|
||||
try {
|
||||
const res = await listOrderItem({
|
||||
orderId: this.orderId
|
||||
})
|
||||
if (res.code === 200) {
|
||||
this.products = res.rows || []
|
||||
this.productName = res.rows[0]?.productType || ''
|
||||
} else {
|
||||
this.products = []
|
||||
this.productName = ''
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取订单商品列表失败:', error)
|
||||
this.products = []
|
||||
this.productName = ''
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.product-content {
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.table-header {
|
||||
background-color: #f5f7fa;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
}
|
||||
|
||||
.company-name {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.table-row {
|
||||
display: grid;
|
||||
grid-template-columns: 80px 150px 120px 100px 140px 150px 120px 1fr;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
}
|
||||
|
||||
.table-row-hover:hover {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
.table-header-row {
|
||||
background-color: #f5f7fa;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.table-total-row {
|
||||
background-color: #f5f7fa;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.table-cell {
|
||||
padding: 8px;
|
||||
border-right: 1px solid #e4e7ed;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.table-cell:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.table-cell[colspan="3"] {
|
||||
grid-column: span 3;
|
||||
}
|
||||
|
||||
.table-cell[colspan="5"] {
|
||||
grid-column: span 5;
|
||||
}
|
||||
|
||||
.table-cell[colspan="8"] {
|
||||
grid-column: span 8;
|
||||
}
|
||||
|
||||
.serial-number {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.delete-btn {
|
||||
opacity: 0;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.serial-number:hover .delete-btn {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -2,13 +2,12 @@
|
||||
<div class="app-container" style="height: calc(100vh - 84px); display: flex;">
|
||||
<!-- 左侧合同列表 -->
|
||||
<div class="left-panel" style="width: 30%; border-right: 1px solid #e4e7ed; overflow-y: auto;">
|
||||
<ContractList ref="contractList"
|
||||
@add="handleAdd" @update="handleUpdate" @delete="handleDelete" @export="handleExport"
|
||||
@exportContract="handleExportContract" @rowClick="handleRowClick" />
|
||||
<ContractList ref="orderList" @add="handleAdd" @update="handleUpdate" @delete="handleDelete"
|
||||
@export="handleExport" @exportContract="handleExportContract" @rowClick="handleRowClick" />
|
||||
</div>
|
||||
|
||||
<!-- 右侧内容区域 -->
|
||||
<div class="right-panel" v-if="form.contractId" style="flex: 1; display: flex; flex-direction: column;">
|
||||
<div class="right-panel" v-if="form.orderId" style="flex: 1; display: flex; flex-direction: column;">
|
||||
<!-- 右侧上方:合同内容信息预览 -->
|
||||
<div class="preview-panel" ref="previewPanel"
|
||||
style="flex: 1; overflow-y: auto; border-bottom: 1px solid #e4e7ed;">
|
||||
@@ -24,17 +23,12 @@
|
||||
|
||||
<!-- 右侧下方:Tab标签页 -->
|
||||
<div class="tab-panel" ref="tabPanel" style="flex: 1; overflow-y: auto;">
|
||||
<ContractTabs :contractId="form.contractId"
|
||||
:customerId="form.customerId" :financeList="financeList" :objectionList="objectionList"
|
||||
:wmsDeliveryWaybills="wmsDeliveryWaybills"
|
||||
:coilList="coilList" :tabLoading="tabLoading"
|
||||
:contract-attachment="form.businessAnnex"
|
||||
:technical-agreement="form.techAnnex"
|
||||
:other-attachment="form.productionSchedule" />
|
||||
<ContractTabs :orderId="form.orderId" :deliveryWaybillList="wmsDeliveryWaybills" :coilList="coilList" :contract-attachment="form.businessAnnex" :technical-agreement="form.techAnnex"
|
||||
:other-attachment="form.productionSchedule" :currentOrder="form" :productList="form.coilList" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-else style="flex: 1; display: flex; flex-direction: column;">
|
||||
<el-empty description="选择合同后查看内容" />
|
||||
<el-empty description="选择订单后查看内容" />
|
||||
</div>
|
||||
|
||||
<!-- 添加或修改合同信息对话框 -->
|
||||
@@ -48,8 +42,8 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="合同编号" prop="contractNo">
|
||||
<el-input v-model="form.contractNo" placeholder="请输入合同编号" />
|
||||
<el-form-item label="合同编号" prop="contractCode">
|
||||
<el-input v-model="form.contractCode" placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
@@ -59,13 +53,27 @@
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="订单总金额" prop="orderAmount">
|
||||
<el-input v-model="form.orderAmount" placeholder="请输入订单总金额" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<el-form-item label="交货日期" prop="deliveryDate">
|
||||
<el-date-picker clearable v-model="form.deliveryDate" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="请选择交货日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="销售员" prop="salesman">
|
||||
<el-select style="width: 100%;" v-model="form.salesman" placeholder="请选择销售员">
|
||||
<el-option v-for="item in dict.type.wip_pack_saleman" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="签订地点" prop="signLocation">
|
||||
<el-input v-model="form.signLocation" placeholder="请输入签订地点" />
|
||||
@@ -73,9 +81,9 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="产品内容">
|
||||
<!-- <el-form-item label="产品内容">
|
||||
<ProductContent v-model="form.productContent" :readonly="false" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="合同内容">
|
||||
<editor v-model="form.contractContent" :min-height="192" />
|
||||
</el-form-item>
|
||||
@@ -107,7 +115,8 @@
|
||||
<!-- 需方信息 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="需方" prop="customer">
|
||||
<CustomerSelect v-model="form.customer" bindField="companyName" @change="handleCustomerChange" :style="{ width: '100%' }" />
|
||||
<CustomerSelect v-model="form.customer" bindField="companyName" @change="handleCustomerChange"
|
||||
:style="{ width: '100%' }" />
|
||||
<!-- <el-input v-model="form.customer" placeholder="请输入需方" /> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="需方地址" prop="customerAddress">
|
||||
@@ -142,6 +151,10 @@
|
||||
<file-upload v-model="form.productionSchedule"
|
||||
:fileType="['pdf', 'jpeg', 'jpg', 'png', 'webp']"></file-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="其他附件" prop="annexFiles">
|
||||
<file-upload v-model="form.annexFiles"
|
||||
:fileType="['pdf', 'jpeg', 'jpg', 'png', 'webp', 'xlsx', 'xls', 'docx', 'doc']"></file-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
@@ -152,7 +165,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getContract, delContract, addContract, updateContract, listContractOrderObjection, listContractPackaging } from "@/api/crm/contract";
|
||||
import { delOrder, listOrderPackaging, updateOrder, getOrder, addOrder } from "@/api/crm/order";
|
||||
import { listDeliveryWaybill } from "@/api/wms/deliveryWaybill";
|
||||
|
||||
import ContractList from "./components/ContractList.vue";
|
||||
import ContractPreview from "./components/ContractPreview.vue";
|
||||
import ContractTabs from "./components/ContractTabs.vue";
|
||||
@@ -168,6 +183,7 @@ export default {
|
||||
ProductContent,
|
||||
CustomerSelect,
|
||||
},
|
||||
dicts: ['wip_pack_saleman'],
|
||||
data() {
|
||||
return {
|
||||
financeList: [],
|
||||
@@ -187,7 +203,7 @@ export default {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
contractName: undefined,
|
||||
contractNo: undefined,
|
||||
contractCode: undefined,
|
||||
supplier: undefined,
|
||||
customer: undefined,
|
||||
signTime: undefined,
|
||||
@@ -205,9 +221,15 @@ export default {
|
||||
contractName: [
|
||||
{ required: true, message: "合同名称不能为空", trigger: "blur" }
|
||||
],
|
||||
contractNo: [
|
||||
contractCode: [
|
||||
{ required: true, message: "合同编号不能为空", trigger: "blur" }
|
||||
],
|
||||
orderAmount: [
|
||||
{ required: true, message: "订单总金额不能为空", trigger: "blur" }
|
||||
],
|
||||
salesman: [
|
||||
{ required: true, message: "销售员不能为空", trigger: "blur" }
|
||||
],
|
||||
supplier: [
|
||||
{ required: true, message: "供方不能为空", trigger: "blur" }
|
||||
],
|
||||
@@ -315,19 +337,14 @@ export default {
|
||||
/** 行点击事件 */
|
||||
handleRowClick(row) {
|
||||
this.form = row;
|
||||
this.tabLoading = true;
|
||||
this.getCoilList();
|
||||
listContractOrderObjection(row.contractId).then(response => {
|
||||
this.financeList = response.data.financeList || [];
|
||||
this.objectionList = response.data.oobjectionList || [];
|
||||
this.wmsDeliveryWaybills = response.data.wmsDeliveryWaybills || [];
|
||||
}).finally(() => {
|
||||
this.tabLoading = false;
|
||||
listDeliveryWaybill({ orderId: row.orderId, pageNum: 1, pageSize: 50 }).then(res => {
|
||||
this.wmsDeliveryWaybills = res.rows || [];
|
||||
})
|
||||
},
|
||||
/** 查询合同配卷列表 */
|
||||
getCoilList() {
|
||||
listContractPackaging(this.form.contractId).then(response => {
|
||||
listOrderPackaging(this.form.orderId).then(response => {
|
||||
this.coilList = response.data || [];
|
||||
})
|
||||
},
|
||||
@@ -336,7 +353,7 @@ export default {
|
||||
this.form = {
|
||||
contractId: undefined,
|
||||
contractName: '产品销售合同',
|
||||
contractNo: undefined,
|
||||
contractCode: undefined,
|
||||
supplier: '嘉祥科伦普重工有限公司',
|
||||
customer: undefined,
|
||||
signTime: undefined,
|
||||
@@ -435,18 +452,18 @@ export default {
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加合同信息";
|
||||
this.title = "添加订单信息";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const contractId = row.contractId || this.ids
|
||||
getContract(contractId).then(response => {
|
||||
const orderId = row.orderId || this.ids
|
||||
getOrder(orderId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改合同信息";
|
||||
this.title = "修改订单信息";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
@@ -454,19 +471,23 @@ export default {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.contractId != null) {
|
||||
updateContract(this.form).then(response => {
|
||||
const payload = {
|
||||
...this.form,
|
||||
orderCode: this.form.contractCode,
|
||||
}
|
||||
if (this.form.orderId != null) {
|
||||
updateOrder(payload).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.$refs.contractList.getList();
|
||||
this.$refs.orderList.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addContract(this.form).then(response => {
|
||||
addOrder(payload).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.$refs.contractList.getList();
|
||||
this.$refs.orderList.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
@@ -476,19 +497,19 @@ export default {
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const contractIds = row.contractId || this.ids;
|
||||
this.$modal.confirm('是否确认删除合同信息编号为"' + contractIds + '"的数据项?').then(() => {
|
||||
return delContract(contractIds);
|
||||
const orderId = row.orderId || this.ids;
|
||||
this.$modal.confirm('是否确认删除订单信息编号为"' + orderId + '"的数据项?').then(() => {
|
||||
return delOrder(orderId);
|
||||
}).then(() => {
|
||||
this.$refs.contractList.getList();
|
||||
this.$refs.orderList.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('crm/contract/export', {
|
||||
this.download('crm/order/export', {
|
||||
...this.queryParams
|
||||
}, `contract_${new Date().getTime()}.xlsx`)
|
||||
}, `order_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 导出合同操作 */
|
||||
handleExportContract(row) {
|
||||
|
||||
@@ -107,14 +107,14 @@
|
||||
</el-row>
|
||||
|
||||
<!-- 添加或修改正式订单主对话框 -->
|
||||
<el-dialog title="添加正式订单" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-dialog title="添加订单" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="订单编号" prop="orderCode">
|
||||
<el-input v-model="form.orderCode" placeholder="请输入订单编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同号" prop="contractId">
|
||||
<el-select style="width: 100%;" v-model="form.contractId" placeholder="请选择合同号" filterable clearable @change="handleContractChange">
|
||||
<el-option v-for="item in contractList" :key="item.contractId" :label="item.contractNo"
|
||||
<el-option v-for="item in contractList" :key="item.contractId" :label="item.contractCode"
|
||||
:value="item.contractId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
5
klp-ui/src/views/micro/pages/zinc/index.vue
Normal file
5
klp-ui/src/views/micro/pages/zinc/index.vue
Normal file
@@ -0,0 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
镀锌子系统
|
||||
</div>
|
||||
</template>
|
||||
@@ -105,13 +105,14 @@ export default {
|
||||
const data = response.data || {};
|
||||
this.summary = data.summary || {};
|
||||
this.detailList = data.details.map(item => {
|
||||
return item.coils.map(coil => {
|
||||
return item.coils?.map(coil => {
|
||||
return {
|
||||
...item,
|
||||
...coil,
|
||||
}
|
||||
})
|
||||
}) || []
|
||||
}).flat();
|
||||
console.log(this.detailList);
|
||||
this.loading = false;
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
|
||||
@@ -153,30 +153,36 @@
|
||||
</div>
|
||||
</div>
|
||||
<el-table :data="coilList" v-loading="coilLoading" class="light-table">
|
||||
<el-table-column label="钢卷层级" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.furnaceLevel" placeholder="请输入钢卷层级"
|
||||
@change="handlePLanCoilChange(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo" />
|
||||
<!-- <el-table-column label="当前钢卷号" align="center" prop="currentCoilNo" /> -->
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker style="width: 185px" v-model="scope.row.createTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="选择创建时间" @change="handlePLanCoilChange(scope.row)"/>
|
||||
<el-date-picker style="width: 185px" v-model="scope.row.createTime" type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择创建时间" @change="handlePLanCoilChange(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="钢卷去向" align="center" width="220">
|
||||
<template slot-scope="scope">
|
||||
<WarehouseSelect v-model="scope.row.logicWarehouseId" @change="handlePLanCoilChange(scope.row)"/>
|
||||
<el-select v-model="scope.row.logicWarehouseId" @change="handlePLanCoilChange(scope.row)">
|
||||
<el-option v-for="item in warehouseList" :key="item.warehouseId" :label="item.warehouseName"
|
||||
:value="item.warehouseId" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="钢卷层级" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.furnaceLevel" placeholder="请输入钢卷层级" @change="handlePLanCoilChange(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="100">
|
||||
|
||||
<!-- <el-table-column label="操作" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleUnbind(scope.row)">
|
||||
{{ unbindLabel(currentPlan.status) }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -184,12 +190,15 @@
|
||||
</el-row>
|
||||
|
||||
<el-dialog title="完成退火" :visible.sync="completeOpen" width="720px" append-to-body>
|
||||
<div class="complete-tip">请为每条钢卷分配实际库位,未分配将无法完成。</div>
|
||||
<div class="complete-tip">请为每条钢卷分配逻辑库区去向,未分配将无法完成。</div>
|
||||
<el-table :data="completeCoils" v-loading="completeLoading" height="360px">
|
||||
<el-table-column label="入场钢卷号" prop="enterCoilNo" align="center" />
|
||||
<el-table-column label="钢卷去向" align="center" width="240">
|
||||
<template slot-scope="scope">
|
||||
<WarehouseSelect v-model="scope.row.warehouseId" />
|
||||
<el-select v-model="scope.row.warehouseId" @change="handlePLanCoilChange(scope.row)">
|
||||
<el-option v-for="item in warehouseList" :key="item.warehouseId" :label="item.warehouseName"
|
||||
:value="item.warehouseId" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -253,7 +262,9 @@
|
||||
import { listAnnealPlan, updateAnnealPlanCoil, getAnnealPlan, addAnnealPlan, updateAnnealPlan, delAnnealPlan, changeAnnealPlanStatus, inFurnace, completeAnnealPlan, listAnnealPlanCoils, bindAnnealPlanCoils, unbindAnnealPlanCoil } from "@/api/wms/annealPlan";
|
||||
import { listAnnealFurnace } from "@/api/wms/annealFurnace";
|
||||
import { listMaterialCoil } from "@/api/wms/coil";
|
||||
import { listWarehouse } from '@/api/wms/warehouse'
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { addAnnealOperateEvent } from "@/api/wms/annealOperateEvent";
|
||||
|
||||
export default {
|
||||
name: "AnnealPlan",
|
||||
@@ -308,14 +319,15 @@ export default {
|
||||
completeLoading: false,
|
||||
completePlanId: null,
|
||||
completeCoils: [],
|
||||
warehouseList: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.loadFurnaces();
|
||||
this.getMaterialCoils();
|
||||
this.loadActualWarehouses();
|
||||
},
|
||||
this.loadWarehouses();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
@@ -325,6 +337,11 @@ export default {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
loadWarehouses() {
|
||||
listWarehouse().then(response => {
|
||||
this.warehouseList = response.data || [];
|
||||
});
|
||||
},
|
||||
loadFurnaces() {
|
||||
listAnnealFurnace({ pageNum: 1, pageSize: 999, status: 1 }).then(response => {
|
||||
this.furnaceOptions = response.rows || [];
|
||||
@@ -372,6 +389,7 @@ export default {
|
||||
this.completeLoading = true;
|
||||
listAnnealPlanCoils(this.currentPlan.planId).then(response => {
|
||||
this.completeCoils = (response.data || []).map(item => ({
|
||||
...item,
|
||||
coilId: item.coilId,
|
||||
enterCoilNo: item.enterCoilNo,
|
||||
warehouseId: item.logicWarehouseId || null
|
||||
@@ -395,6 +413,7 @@ export default {
|
||||
planId: this.currentPlan.planId,
|
||||
coilId: item.coilId
|
||||
}).then(() => {
|
||||
// anneal-todo: 新增操作事件
|
||||
this.$message.success('已加入计划');
|
||||
this.loadPlanCoils();
|
||||
}).finally(() => {
|
||||
@@ -526,6 +545,15 @@ export default {
|
||||
});
|
||||
this.loading = true;
|
||||
await inFurnace({ planId: row.planId });
|
||||
// 炉火开始加工
|
||||
const targetFurnaceName = this.furnaceOptions.find(item => item.furnaceId === row.targetFurnaceId)?.furnaceName || '';
|
||||
addAnnealOperateEvent({
|
||||
annealFurnaceId: row.targetFurnaceId,
|
||||
operateType: 'IN',
|
||||
operateContent: '退火炉' + targetFurnaceName + '开始加工',
|
||||
})
|
||||
|
||||
// anneal-todo: 新增操作事件
|
||||
this.loading = false;
|
||||
row.status = 2;
|
||||
row.actualStartTime = new Date();
|
||||
@@ -552,6 +580,13 @@ export default {
|
||||
planId: this.completePlanId,
|
||||
locations: locations
|
||||
}).then(() => {
|
||||
// anneal-todo: 新增操作事件
|
||||
const targetFurnaceName = this.furnaceOptions.find(item => item.furnaceId === this.currentPlan.targetFurnaceId)?.furnaceName || '';
|
||||
addAnnealOperateEvent({
|
||||
annealFurnaceId: this.currentPlan.targetFurnaceId,
|
||||
operateType: 'COMPLETE',
|
||||
operateContent: '退火炉' + targetFurnaceName + '完成加工。',
|
||||
})
|
||||
this.$message.success('已完成');
|
||||
this.completeOpen = false;
|
||||
this.getList();
|
||||
@@ -571,6 +606,7 @@ export default {
|
||||
coilId: row.coilId
|
||||
});
|
||||
}).then(() => {
|
||||
// anneal-todo: 新增操作事件
|
||||
this.$message.success('解绑成功');
|
||||
this.loadPlanCoils();
|
||||
});
|
||||
|
||||
@@ -67,8 +67,8 @@
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click.stop="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click.stop="handleDelete(scope.row)">删除</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-s-operation"
|
||||
@click.stop="openStatusDialog(scope.row)">状态</el-button>
|
||||
<!-- <el-button size="mini" type="text" icon="el-icon-s-operation"
|
||||
@click.stop="openStatusDialog(scope.row)">状态</el-button> -->
|
||||
<!-- <el-button v-if="scope.row.status === 0" size="mini" type="text" icon="el-icon-s-flag"
|
||||
:disabled="!scope.row.coilCount" @click.stop="handleInFurnace(scope.row)">入炉</el-button> -->
|
||||
<el-button v-if="scope.row.status === 2" size="mini" type="text" icon="el-icon-check"
|
||||
@@ -153,6 +153,12 @@
|
||||
</div> -->
|
||||
</div>
|
||||
<el-table :data="coilList" v-loading="coilLoading" class="light-table">
|
||||
<el-table-column label="钢卷层级" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.furnaceLevel" placeholder="请输入钢卷层级"
|
||||
@change="handlePLanCoilChange(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime">
|
||||
<template slot-scope="scope">
|
||||
@@ -166,7 +172,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleUnbind(scope.row)">
|
||||
<el-button v-if="currentPlan.status === 0" size="mini" type="text" icon="el-icon-delete" @click="handleUnbind(scope.row)">
|
||||
{{ unbindLabel(currentPlan.status) }}
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -208,13 +214,13 @@
|
||||
:value="item.furnaceId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<!-- <el-form-item label="状态" prop="status">
|
||||
<el-select v-model="form.status" placeholder="请选择">
|
||||
<el-option label="未开始" :value="0" />
|
||||
<el-option label="进行中" :value="2" />
|
||||
<el-option label="已完成" :value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
@@ -226,7 +232,7 @@
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="更新状态" :visible.sync="statusOpen" width="360px" append-to-body>
|
||||
<el-form label-width="90px">
|
||||
<!-- <el-form label-width="90px">
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="statusForm.status" placeholder="请选择">
|
||||
<el-option label="未开始" :value="0" />
|
||||
@@ -234,7 +240,7 @@
|
||||
<el-option label="已完成" :value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-form> -->
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitStatus">确 定</el-button>
|
||||
<el-button @click="statusOpen = false">取 消</el-button>
|
||||
@@ -244,10 +250,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listAnnealPlan, getAnnealPlan, addAnnealPlan, updateAnnealPlan, delAnnealPlan, changeAnnealPlanStatus, inFurnace, completeAnnealPlan, listAnnealPlanCoils, bindAnnealPlanCoils, unbindAnnealPlanCoil } from "@/api/wms/annealPlan";
|
||||
import { listAnnealPlan, getAnnealPlan, updateAnnealPlanCoil ,addAnnealPlan, updateAnnealPlan, delAnnealPlan, changeAnnealPlanStatus, inFurnace, completeAnnealPlan, listAnnealPlanCoils, bindAnnealPlanCoils, unbindAnnealPlanCoil } from "@/api/wms/annealPlan";
|
||||
import { listAnnealFurnace } from "@/api/wms/annealFurnace";
|
||||
import { listMaterialCoil } from "@/api/wms/coil";
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { addAnnealOperateEvent } from "@/api/wms/annealOperateEvent";
|
||||
|
||||
export default {
|
||||
name: "AnnealPlan",
|
||||
@@ -308,7 +315,6 @@ export default {
|
||||
this.getList();
|
||||
this.loadFurnaces();
|
||||
this.getMaterialCoils();
|
||||
this.loadActualWarehouses();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
@@ -345,6 +351,13 @@ export default {
|
||||
this.resetMaterialForm();
|
||||
this.handleMaterialQuery();
|
||||
},
|
||||
handlePLanCoilChange(row) {
|
||||
updateAnnealPlanCoil(row).then(() => {
|
||||
this.$message.success('已更新');
|
||||
}).finally(() => {
|
||||
this.loadPlanCoils();
|
||||
});
|
||||
},
|
||||
openCompleteDialog() {
|
||||
if (!this.currentPlan.planId) {
|
||||
this.$message.warning('请先选择计划');
|
||||
@@ -383,6 +396,15 @@ export default {
|
||||
coilId: item.coilId
|
||||
}).then(() => {
|
||||
this.$message.success('已加入计划');
|
||||
// 查找对应id退火炉的名称
|
||||
const targetFurnaceName = this.furnaceOptions.find(item => item.furnaceId === this.currentPlan.targetFurnaceId)?.furnaceName || '';
|
||||
// anneal-todo: 新增操作事件
|
||||
addAnnealOperateEvent({
|
||||
annealFurnaceId: this.currentPlan.targetFurnaceId,
|
||||
operateType: 'ADD',
|
||||
operateContent: '钢卷号' + item.enterCoilNo + '加入退火炉' + targetFurnaceName,
|
||||
coilId: item.coilId,
|
||||
})
|
||||
this.loadPlanCoils();
|
||||
}).finally(() => {
|
||||
this.coilLoading = false;
|
||||
@@ -512,6 +534,7 @@ export default {
|
||||
});
|
||||
this.loading = true;
|
||||
await inFurnace({ planId: row.planId });
|
||||
// anneal-todo: 新增操作事件
|
||||
this.loading = false;
|
||||
row.status = 2;
|
||||
row.actualStartTime = new Date();
|
||||
@@ -540,6 +563,7 @@ export default {
|
||||
}).then(() => {
|
||||
this.$message.success('已完成');
|
||||
this.completeOpen = false;
|
||||
// anneal-todo: 新增操作事件
|
||||
this.getList();
|
||||
this.loadPlanCoils();
|
||||
}).finally(() => {
|
||||
@@ -558,6 +582,15 @@ export default {
|
||||
});
|
||||
}).then(() => {
|
||||
this.$message.success('解绑成功');
|
||||
// 查找对应id退火炉的名称
|
||||
const targetFurnaceName = this.furnaceOptions.find(item => item.furnaceId === this.currentPlan.targetFurnaceId)?.furnaceName || '';
|
||||
// anneal-todo: 新增操作事件
|
||||
addAnnealOperateEvent({
|
||||
annealFurnaceId: this.currentPlan.targetFurnaceId,
|
||||
operateType: 'UNBIND',
|
||||
operateContent: '钢卷号' + row.enterCoilNo + '解绑退火炉' + targetFurnaceName,
|
||||
coilId: row.coilId,
|
||||
})
|
||||
this.loadPlanCoils();
|
||||
});
|
||||
},
|
||||
|
||||
408
klp-ui/src/views/wms/anneal/record/index.vue
Normal file
408
klp-ui/src/views/wms/anneal/record/index.vue
Normal file
@@ -0,0 +1,408 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="退火炉" prop="annealFurnaceId">
|
||||
<el-select
|
||||
v-model="queryParams.annealFurnaceId"
|
||||
placeholder="请选择退火炉"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in annealFurnaceList"
|
||||
:key="item.furnaceId"
|
||||
:label="item.furnaceName"
|
||||
:value="item.furnaceId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作类型" prop="operateType">
|
||||
<el-select
|
||||
v-model="queryParams.operateType"
|
||||
placeholder="请选择操作类型"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
>
|
||||
<el-option
|
||||
label="新增"
|
||||
value="ADD"
|
||||
/>
|
||||
<el-option
|
||||
label="解绑"
|
||||
value="UNBIND"
|
||||
/>
|
||||
<el-option
|
||||
label="入炉"
|
||||
value="IN"
|
||||
/>
|
||||
<el-option
|
||||
label="完成"
|
||||
value="COMPLETE"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>补录</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="annealOperateEventList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- <el-table-column label="主键ID" align="center" prop="eventId" v-if="true"/> -->
|
||||
<el-table-column label="退火炉" align="center" prop="annealFurnaceName">
|
||||
<template slot-scope="scope">
|
||||
{{ getAnnealFurnaceName(scope.row.annealFurnaceId) || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作类型" align="center" prop="operateType">
|
||||
<template slot-scope="scope">
|
||||
{{ getOperateTypeName(scope.row.operateType) || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作描述" align="center" prop="operateContent" />
|
||||
<!-- <el-table-column label="钢卷ID(可选)" align="center" prop="coilId" /> -->
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作人" align="center" prop="createBy" />
|
||||
<el-table-column label="操作时间" align="center" prop="createTime" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改退火操作事件对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="退火炉" prop="annealFurnaceId">
|
||||
<el-select v-model="form.annealFurnaceId" placeholder="请选择退火炉">
|
||||
<el-option v-for="item in annealFurnaceList" :key="item.furnaceId" :label="item.furnaceName" :value="item.furnaceId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作描述">
|
||||
<el-input type="textarea" v-model="form.operateContent" placeholder="请输入操作描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="操作类型" prop="operateType">
|
||||
<el-select v-model="form.operateType" placeholder="请选择操作类型" clearable>
|
||||
<el-option
|
||||
label="新增"
|
||||
value="ADD"
|
||||
/>
|
||||
<el-option
|
||||
label="解绑"
|
||||
value="UNBIND"
|
||||
/>
|
||||
<el-option
|
||||
label="入炉"
|
||||
value="IN"
|
||||
/>
|
||||
<el-option
|
||||
label="完成"
|
||||
value="COMPLETE"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作人" prop="createBy">
|
||||
<el-input v-model="form.createBy" placeholder="请输入操作人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="操作时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="form.createTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择操作时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="钢卷ID(可选)" prop="coilId">
|
||||
<el-input v-model="form.coilId" placeholder="请输入钢卷ID(可选)" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listAnnealOperateEvent, getAnnealOperateEvent, delAnnealOperateEvent, addAnnealOperateEvent, updateAnnealOperateEvent } from "@/api/wms/annealOperateEvent";
|
||||
import { listAnnealFurnace } from "@/api/wms/annealFurnace";
|
||||
|
||||
export default {
|
||||
name: "AnnealOperateEvent",
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 退火操作事件表格数据
|
||||
annealOperateEventList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
annealFurnaceId: undefined,
|
||||
operateType: undefined,
|
||||
operateContent: undefined,
|
||||
coilId: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
eventId: [
|
||||
{ required: true, message: "主键ID不能为空", trigger: "blur" }
|
||||
],
|
||||
annealFurnaceId: [
|
||||
{ required: true, message: "退火炉ID不能为空", trigger: "blur" }
|
||||
],
|
||||
operateType: [
|
||||
{ required: true, message: "操作类型 如:START/PAUSE/STOP/FEED/TAKE/RESET不能为空", trigger: "change" }
|
||||
],
|
||||
operateContent: [
|
||||
{ required: true, message: "操作内容描述不能为空", trigger: "blur" }
|
||||
],
|
||||
coilId: [
|
||||
{ required: true, message: "钢卷ID(可选)不能为空", trigger: "blur" }
|
||||
],
|
||||
delFlag: [
|
||||
{ required: true, message: "删除标志不能为空", trigger: "blur" }
|
||||
],
|
||||
// remark: [
|
||||
// { required: true, message: "备注不能为空", trigger: "blur" }
|
||||
// ],
|
||||
createBy: [
|
||||
{ required: true, message: "操作人不能为空", trigger: "blur" }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: "操作时间不能为空", trigger: "blur" }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: "更新时间不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
// 退火炉列表
|
||||
annealFurnaceList: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getAnnealFurnaceList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询退火操作事件列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listAnnealOperateEvent(this.queryParams).then(response => {
|
||||
this.annealOperateEventList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 查询退火炉列表 */
|
||||
getAnnealFurnaceList() {
|
||||
listAnnealFurnace({ pageNum: 1, pageSize: 10000 }).then(response => {
|
||||
this.annealFurnaceList = response.rows;
|
||||
});
|
||||
},
|
||||
/** 获取退火炉名称 */
|
||||
getAnnealFurnaceName(furnaceId) {
|
||||
const item = this.annealFurnaceList.find(item => item.furnaceId === furnaceId);
|
||||
return item ? item.furnaceName : '-';
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 获取操作类型名称 */
|
||||
getOperateTypeName(operateType) {
|
||||
const map = {
|
||||
'ADD': '新增',
|
||||
'UNBIND': '解绑',
|
||||
'IN': '入炉',
|
||||
'COMPLETE': '完成',
|
||||
}
|
||||
return map[operateType] || '-';
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
eventId: undefined,
|
||||
annealFurnaceId: undefined,
|
||||
operateType: undefined,
|
||||
operateContent: undefined,
|
||||
coilId: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined,
|
||||
createTime: undefined,
|
||||
createBy: undefined,
|
||||
updateTime: undefined,
|
||||
updateBy: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.eventId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加退火操作事件";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const eventId = row.eventId || this.ids
|
||||
getAnnealOperateEvent(eventId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改退火操作事件";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.eventId != null) {
|
||||
updateAnnealOperateEvent(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addAnnealOperateEvent(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const eventIds = row.eventId || this.ids;
|
||||
this.$modal.confirm('是否确认删除退火操作事件编号为"' + eventIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delAnnealOperateEvent(eventIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('wms/annealOperateEvent/export', {
|
||||
...this.queryParams
|
||||
}, `annealOperateEvent_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -82,10 +82,10 @@ export default {
|
||||
{ required: true, message: '请选择位置', trigger: 'change' },
|
||||
{ validator: this.validateArray, trigger: 'change' }
|
||||
],
|
||||
plateSurface: [
|
||||
{ required: true, message: '请选择上下板面', trigger: 'change' },
|
||||
{ validator: this.validateArray, trigger: 'change' }
|
||||
],
|
||||
// plateSurface: [
|
||||
// { required: true, message: '请选择上下板面', trigger: 'change' },
|
||||
// { validator: this.validateArray, trigger: 'change' }
|
||||
// ],
|
||||
startPosition: [
|
||||
{ required: true, message: '请输入开始位置', trigger: ['blur', 'change'] },
|
||||
{ validator: this.validateStartPosition, trigger: ['blur', 'change'] }
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<div class="section-header">
|
||||
<h4 class="section-title">异常记录</h4>
|
||||
<div>
|
||||
<el-button type="primary" size="mini" @click="handleSave">保存</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleSave" :loading="buttonLoading">保存</el-button>
|
||||
<el-button type="default" icon="el-icon-refresh" plain size="mini" @click="refreshAbnormalList"
|
||||
:loading="abnormalLoading">
|
||||
刷新
|
||||
@@ -291,10 +291,10 @@ export default {
|
||||
this.$message.error(`第${rowIndex}行:请选择断面位置`)
|
||||
return
|
||||
}
|
||||
if (!row.plateSurface || row.plateSurface.length === 0) {
|
||||
this.$message.error(`第${rowIndex}行:请选择上下板面`)
|
||||
return
|
||||
}
|
||||
// if (!row.plateSurface || row.plateSurface.length === 0) {
|
||||
// this.$message.error(`第${rowIndex}行:请选择上下板面`)
|
||||
// return
|
||||
// }
|
||||
if (!row.defectCode) {
|
||||
this.$message.error(`第${rowIndex}行:请选择缺陷代码`)
|
||||
return
|
||||
@@ -445,7 +445,7 @@ export default {
|
||||
|
||||
.exception-section {
|
||||
background-color: #fafafa;
|
||||
border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
padding: 16px;
|
||||
border: 1px solid #e4e7ed;
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@
|
||||
<span class="info-value" :title="item.warehouseName">{{ item.warehouseName || '—' }}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label">库区:</span>
|
||||
<span class="info-value" :title="item.actualWarehouseName">{{ item.actualWarehouseName || '—'
|
||||
<span class="info-label">规格:</span>
|
||||
<span class="info-value" :title="item.specification">{{ item.specification || '—'
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
@@ -292,9 +292,9 @@ import { getCoilTagPrintType } from '@/views/wms/coil/js/coilPrint'
|
||||
|
||||
export default {
|
||||
name: 'DoPage',
|
||||
dicts: ['action_type', 'coil_abnormal_code', 'coil_abnormal_position', 'coil_abnormal_degree', 'coil_quality_status'],
|
||||
dicts: ['action_type', 'coil_abnormal_code', 'coil_abnormal_position', 'coil_abnormal_degree', 'coil_quality_status', 'coil_business_purpose'],
|
||||
props: {
|
||||
label: {
|
||||
label: {
|
||||
type: String,
|
||||
default: () => '酸连轧工序'
|
||||
},
|
||||
@@ -314,7 +314,6 @@ export default {
|
||||
RawMaterialSelect,
|
||||
CoilTraceResult,
|
||||
},
|
||||
dicts: ['coil_business_purpose'],
|
||||
data() {
|
||||
return {
|
||||
traceOpen: false,
|
||||
|
||||
@@ -65,8 +65,8 @@
|
||||
<span class="info-value" :title="item.warehouseName">{{ item.warehouseName || '—' }}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label">库区:</span>
|
||||
<span class="info-value" :title="item.actualWarehouseName">{{ item.actualWarehouseName || '—'
|
||||
<span class="info-label">规格:</span>
|
||||
<span class="info-value" :title="item.specification">{{ item.specification || '—'
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
|
||||
@@ -61,9 +61,39 @@
|
||||
{value: '1988150380649967617', label: '镀锌分条成品'},
|
||||
{value: '1988151027466170370', label: '拉矫分条成品'},
|
||||
],
|
||||
'酸轧修复工序': [
|
||||
{value: '1988150044862377986', label: '酸连轧原料库'},
|
||||
{value: '1988150099140866050', label: '酸连轧成品库'},
|
||||
{value: '1988150263284953089', label: '镀锌原料库'},
|
||||
{value: '1988150545175736322', label: '脱脂原料库'},
|
||||
],
|
||||
'镀锌修复工序': [
|
||||
{value: '1988150263284953089', label: '镀锌原料库'},
|
||||
{value: '1988150323162836993', label: '镀锌成品库'},
|
||||
{value: '1988150487185289217', label: '镀锌纵剪分条原料库'},
|
||||
],
|
||||
'脱脂修复工序': [
|
||||
{value: '1988150545175736322', label: '脱脂原料库'},
|
||||
{value: '1988150586938421250', label: '脱脂成品库'},
|
||||
],
|
||||
'拉矫修复工序': [
|
||||
{value: '1988150854442741762', label: '拉矫原料库'},
|
||||
{value: '1988150915591499777', label: '拉矫成品库'},
|
||||
],
|
||||
'双机架修复工序': [
|
||||
{value: '1992873386047643650', label: '双机架原料库'},
|
||||
{value: '1992873437713080322', label: '双机架成品库'},
|
||||
],
|
||||
'镀铬修复工序': [
|
||||
{value: '1988151076996706306', label: '镀铬原料库'},
|
||||
{value: '1988151132361519105', label: '镀铬成品库'},
|
||||
],
|
||||
}
|
||||
|
||||
if (this.actionType === '镀锌工序' || this.actionType === '脱脂工序' || this.actionType === '拉矫平整工序' || this.actionType === '双机架工序' || this.actionType === '镀铬工序' || this.actionType === '纵剪分条工序' || this.actionType === '拉矫修复工序') {
|
||||
if (
|
||||
this.actionType === '镀锌工序' || this.actionType === '脱脂工序' || this.actionType === '拉矫平整工序' || this.actionType === '双机架工序' || this.actionType === '镀铬工序'
|
||||
|| this.actionType === '纵剪分条工序'
|
||||
|| this.actionType === '酸轧修复工序' || this.actionType === '镀锌修复工序' || this.actionType === '脱脂修复工序' || this.actionType === '拉矫修复工序' || this.actionType === '双机架修复工序' || this.actionType === '镀铬修复工序' ) {
|
||||
this.useSpecialSplit = true
|
||||
}
|
||||
// 从map中获取默认的查询参数
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<BasePage :qrcode="qrcode" :querys="querys" :labelType="labelType" :hideType="hideType" :showControl="showControl" />
|
||||
<BasePage
|
||||
:leftWarehouseQuery="true"
|
||||
:qrcode="qrcode" :querys="querys" :labelType="labelType" :hideType="hideType" :showControl="showControl" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<template>
|
||||
<BasePage :qrcode="qrcode" :querys="querys" :labelType="labelType" :hideType="hideType" />
|
||||
<BasePage
|
||||
:leftWarehouseQuery="true"
|
||||
:qrcode="qrcode" :querys="querys" :labelType="labelType" :hideType="hideType"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -252,6 +252,12 @@
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<el-form-item label="关联合同" prop="contractId">
|
||||
<ContractSelect v-model="targetCoil.contractId" placeholder="请选择合同" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<el-form-item label="异常信息" class="form-item-full">
|
||||
<div class="abnormal-container">
|
||||
@@ -292,7 +298,7 @@
|
||||
|
||||
<script>
|
||||
import { getMaterialCoil, mergeMaterialCoil } from '@/api/wms/coil';
|
||||
import { listPendingAction, completeAction, addPendingAction, getPendingAction } from '@/api/wms/pendingAction';
|
||||
import { listPendingAction, getPendingAction } from '@/api/wms/pendingAction';
|
||||
import CoilSelector from '@/components/CoilSelector';
|
||||
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
|
||||
import RawMaterialSelector from "@/components/KLPService/RawMaterialSelect";
|
||||
@@ -301,6 +307,8 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import TimeInput from "@/components/TimeInput";
|
||||
import AbnormalForm from './components/AbnormalForm';
|
||||
import { generateCoilNoPrefix } from "@/utils/coil/coilNo";
|
||||
import ContractSelect from "@/components/KLPService/ContractSelect";
|
||||
import { addCoilContractRel } from "@/api/wms/coilContractRel";
|
||||
|
||||
export default {
|
||||
name: 'MergeCoil',
|
||||
@@ -311,7 +319,8 @@ export default {
|
||||
ProductSelector,
|
||||
WarehouseSelect,
|
||||
TimeInput,
|
||||
AbnormalForm
|
||||
AbnormalForm,
|
||||
ContractSelect
|
||||
},
|
||||
dicts: ['coil_quality_status', 'coil_abnormal_position', 'coil_abnormal_code', 'coil_abnormal_degree', 'coil_business_purpose'],
|
||||
data() {
|
||||
@@ -700,12 +709,6 @@ export default {
|
||||
|
||||
// 保存合卷
|
||||
async handleSave() {
|
||||
// 验证源卷数量
|
||||
// if (this.sourceCoils.length < 2) {
|
||||
// this.$message.error('至少需要2个源卷才能合卷');
|
||||
// return;
|
||||
// }
|
||||
|
||||
// 验证源卷信息
|
||||
for (let i = 0; i < this.sourceCoils.length; i++) {
|
||||
const item = this.sourceCoils[i];
|
||||
@@ -758,12 +761,17 @@ export default {
|
||||
text: '正在合卷,请稍后...',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
// this.completeAllRelatedActions();
|
||||
await mergeMaterialCoil(mergeData);
|
||||
|
||||
const response = await mergeMaterialCoil(mergeData);
|
||||
|
||||
const coilId = response.data;
|
||||
|
||||
addCoilContractRel({
|
||||
coilId: coilId,
|
||||
contractId: this.targetCoil.contractId,
|
||||
})
|
||||
this.$message.success('合卷保存成功');
|
||||
|
||||
|
||||
// 延迟返回,让用户看到成功提示
|
||||
setTimeout(() => {
|
||||
this.$router.back();
|
||||
@@ -802,49 +810,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
// 完成所有相关的待操作记录
|
||||
async completeAllRelatedActions() {
|
||||
try {
|
||||
// 收集所有待操作ID
|
||||
const actionIds = [];
|
||||
const ncs = [];
|
||||
|
||||
// 当前页面的actionId(从路由参数获取)
|
||||
// if (this.actionId) {
|
||||
// actionIds.push(this.actionId);
|
||||
// }
|
||||
|
||||
// 从待合卷列表中选择的钢卷的actionId
|
||||
this.sourceCoils.forEach(item => {
|
||||
if (item.actionId) {
|
||||
actionIds.push(item.actionId);
|
||||
}
|
||||
// 或许所有需要直接完成的
|
||||
if (item.nc) {
|
||||
ncs.push(item);
|
||||
}
|
||||
});
|
||||
|
||||
// 批量完成所有待操作
|
||||
const promises1 = actionIds.map(id => completeAction(id));
|
||||
const promises2 = ncs.map(item => {
|
||||
addPendingAction({
|
||||
actionType: this.actionTypeCode, // 合卷操作
|
||||
actionStatus: '2', // 2表示已完成
|
||||
coilId: item.coilId,
|
||||
currentCoilNo: item.currentCoilNo || '',
|
||||
priority: 0,
|
||||
sourceType: 'manual',
|
||||
completeTime: new Date()
|
||||
})
|
||||
});
|
||||
await Promise.all(promises1.concat(promises2));
|
||||
} catch (error) {
|
||||
console.error('完成待操作失败:', error);
|
||||
// 不影响主流程,只记录错误
|
||||
}
|
||||
},
|
||||
|
||||
// 取消操作
|
||||
handleCancel() {
|
||||
console.log('取消合卷操作', this.$tab);
|
||||
|
||||
@@ -9,13 +9,7 @@
|
||||
<el-input v-model="queryParams.currentCoilNo" placeholder="请输入当前钢卷号" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="数据状态">
|
||||
<el-select v-model="queryParams.dataType" placeholder="请选择数据状态" clearable>
|
||||
<el-option :value="0" label="历史数据">历史数据</el-option>
|
||||
<el-option :value="1" label="当前数据">当前数据</el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="逻辑库位" prop="warehouseId" v-if="!hideWarehouseQuery">
|
||||
<el-form-item label="逻辑库位" prop="warehouseId" v-if="!hideWarehouseQuery && !leftWarehouseQuery">
|
||||
<warehouse-select v-model="queryParams.warehouseId" placeholder="请选择仓库/库区/库位"
|
||||
style="width: 100%; display: inline-block;" clearable />
|
||||
</el-form-item>
|
||||
@@ -45,9 +39,6 @@
|
||||
clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<MaterialSelect :hideType="hideType" :itemId.sync="queryParams.itemIds" :itemType.sync="queryParams.itemType"
|
||||
:multiple="true" />
|
||||
|
||||
<el-form-item v-if="showWaybill" label="发货状态">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择发货状态" clearable>
|
||||
<el-option :value="0" label="未发货">未发货</el-option>
|
||||
@@ -79,17 +70,14 @@
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8" v-if="showControl">
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
|
||||
@click="handleCheck">修正</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
|
||||
@click="handleDelete">删除</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExportAll">导出</el-button>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="2" v-if="canExportAll">
|
||||
<el-button type="info" plain icon="el-icon-printer" size="mini" :disabled="multiple"
|
||||
@click="handleBatchPrintLabel">批量打印标签</el-button>
|
||||
@@ -98,54 +86,65 @@
|
||||
<el-checkbox v-model="queryParams.orderBy" v-loading="loading" @change="getList"
|
||||
label="orderBy">按实际库区排序</el-checkbox>
|
||||
</el-col>
|
||||
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<KLPTable v-loading="loading" :data="materialCoilList" @selection-change="handleSelectionChange" :floatLayer="true"
|
||||
:floatLayerConfig="floatLayerConfig" @row-click="handleRowClick"
|
||||
:height="showAbnormal ? 'calc(100vh - 400px)' : 'calc(100vh - 300px)'">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<current-coil-no :current-coil-no="scope.row.currentCoilNo"></current-coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="厂家卷号" align="center" prop="supplierCoilNo" /> -->
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" v-if="!hideWarehouseQuery" />
|
||||
<el-table-column label="实际库区" align="center" prop="actualWarehouseName"
|
||||
v-if="!hideWarehouseQuery && !showExportTime" />
|
||||
<!-- <el-table-column label="物料类型" align="center" prop="materialType" /> -->
|
||||
<el-table-column label="产品类型" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="showAbnormal" label="异常数量" align="center" prop="abnormalCount"></el-table-column>
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" v-if="showLength" />
|
||||
<el-table-column label="更新时间" v-if="!showExportTime" align="center" prop="updateTime" />
|
||||
<el-table-column label="发货时间" v-if="showExportTime" align="center" prop="exportTime" width="205">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker @change="handleExportTimeChange(scope.row)" v-if="canEditExportTime" style="width: 100%"
|
||||
v-model="scope.row.exportTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择发货时间" />
|
||||
<div v-else>{{ scope.row.exportTime }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发货人" v-if="showExportTime" align="center" prop="exportByName" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.exportBy" placeholder="请选择发货人" filterable
|
||||
@change="handleExportByNameChange(scope.row)">
|
||||
<el-option v-for="item in userList" :key="item.userName" :value="item.userName" :label="item.nickName" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新人" v-if="!showExportTime" align="center" prop="updateByName" />
|
||||
<el-table-column label="关联信息" align="center" :show-overflow-tooltip="true">
|
||||
<div style="display: flex; align-items: flex-start;">
|
||||
<div v-if="leftWarehouseQuery"
|
||||
:style="{
|
||||
width: '220px',
|
||||
height: showAbnormal ? 'calc(100vh - 400px)' : 'calc(100vh - 300px)',
|
||||
backgroundColor: '#ffffff',
|
||||
overflowY: 'auto',
|
||||
overflowX: 'hidden' }">
|
||||
<warehouse-tree warehouseType="logic" @node-click="handleWarehouseNodeClick" />
|
||||
</div>
|
||||
<div style="flex: 1;">
|
||||
<KLPTable v-loading="loading" :data="materialCoilList" @selection-change="handleSelectionChange"
|
||||
:floatLayer="true" :floatLayerConfig="floatLayerConfig" @row-click="handleRowClick"
|
||||
:height="showAbnormal ? 'calc(100vh - 400px)' : 'calc(100vh - 300px)'">
|
||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<current-coil-no :current-coil-no="scope.row.currentCoilNo"></current-coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="净重" align="center" prop="netWeight" v-if="!hideWarehouseQuery" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" v-if="!hideWarehouseQuery" />
|
||||
<el-table-column label="实际库区" align="center" prop="actualWarehouseName"
|
||||
v-if="!hideWarehouseQuery && !showExportTime" />
|
||||
<el-table-column label="产品类型" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="showAbnormal" label="异常数量" align="center" prop="abnormalCount"></el-table-column>
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" v-if="showLength" />
|
||||
<el-table-column label="发货时间" v-if="showExportTime" align="center" prop="exportTime" width="205">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker @change="handleExportTimeChange(scope.row)" v-if="canEditExportTime" style="width: 100%"
|
||||
v-model="scope.row.exportTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="选择发货时间" />
|
||||
<div v-else>{{ scope.row.exportTime }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发货人" v-if="showExportTime" align="center" prop="exportByName" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.exportBy" placeholder="请选择发货人" filterable
|
||||
@change="handleExportByNameChange(scope.row)">
|
||||
<el-option v-for="item in userList" :key="item.userName" :value="item.userName"
|
||||
:label="item.nickName" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="关联信息" align="center" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.parentCoilNos && scope.row.hasMergeSplit === 1 && scope.row.dataType === 1">
|
||||
<el-tag type="warning" size="mini">来自母卷:{{ scope.row.parentCoilNos }}</el-tag>
|
||||
@@ -158,165 +157,188 @@
|
||||
</span>
|
||||
<span v-else>—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
|
||||
<el-table-column v-if="showGrade" label="质量状态" align="center" prop="qualityStatus">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.qualityStatus" placeholder="请选择质量状态" @change="handleGradeChange(scope.row)">
|
||||
<el-option v-for="item in dict.type.coil_quality_status" :key="item.value" :value="item.value"
|
||||
:label="item.label" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseId" v-if="editWarehouse">
|
||||
<template slot-scope="scope">
|
||||
<warehouse-select @change="handleWarehouseChange(scope.row)" v-model="scope.row.warehouseId"
|
||||
placeholder="请选择仓库/库区/库位" style="width: 100%;" clearable />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="showGrade" label="质量状态" align="center" prop="qualityStatus">
|
||||
<!-- <template slot-scope="scope">
|
||||
<el-select v-model="scope.row.qualityStatus" placeholder="请选择质量状态" @change="handleGradeChange(scope.row)">
|
||||
<el-option v-for="item in dict.type.coil_quality_status" :key="item.value" :value="item.value"
|
||||
:label="item.label" />
|
||||
</el-select>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseId" v-if="editWarehouse">
|
||||
<template slot-scope="scope">
|
||||
<warehouse-select @change="handleWarehouseChange(scope.row)" v-model="scope.row.warehouseId"
|
||||
placeholder="请选择仓库/库区/库位" style="width: 100%;" clearable />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="钢卷去向" align="center" prop="nextWarehouseId" v-if="editNext" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.nextWarehouseId" placeholder="钢卷去向" filterable
|
||||
@change="handleNextWarehouseChange(scope.row)">
|
||||
<el-option v-for="item in dict.type.wms_next_warehouse" :key="item.value" :value="item.value"
|
||||
:label="item.label" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="业务目的" align="center" prop="businessPurpose" v-if="showBusinessPurpose" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.businessPurpose" placeholder="业务目的" filterable
|
||||
@change="handleRowChange(scope.row)">
|
||||
<el-option v-for="item in dict.type.coil_business_purpose" :key="item.value" :value="item.value"
|
||||
:label="item.label" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="hasTransferType" label="调拨类型" align="center" prop="transferType" />
|
||||
|
||||
<el-table-column label="关联订单" align="center" prop="relatedToOrder" v-if="showRelatedToOrder" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-switch @change="handleRowChange(scope.row)" v-model="scope.row.isRelatedToOrder" :active-value="1"
|
||||
:inactive-value="0" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="钢卷去向" align="center" prop="nextWarehouseId" v-if="editNext" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.nextWarehouseId" placeholder="钢卷去向" filterable
|
||||
@change="handleNextWarehouseChange(scope.row)">
|
||||
<el-option v-for="item in dict.type.wms_next_warehouse" :key="item.value" :value="item.value"
|
||||
:label="item.label" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="发货计划" align="center" prop="nextWarehouseId" v-if="showWaybill" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.bindPlanName || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="业务目的" align="center" prop="businessPurpose" v-if="showBusinessPurpose" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.businessPurpose" placeholder="业务目的" filterable
|
||||
@change="handleRowChange(scope.row)">
|
||||
<el-option v-for="item in dict.type.coil_business_purpose" :key="item.value" :value="item.value"
|
||||
:label="item.label" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="发货单据" align="center" prop="nextWarehouseId" v-if="showWaybill" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-popover placement="top" width="400" trigger="hover">
|
||||
<div>
|
||||
<el-descriptions :column="2" :border="false">
|
||||
<el-descriptions-item label="单据名称">
|
||||
{{ scope.row.bindWaybillName || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="车牌号">
|
||||
{{ scope.row.bindLicensePlate || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="收货单位">
|
||||
{{ scope.row.bindConsigneeUnit || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="负责人">
|
||||
{{ scope.row.bindPrincipal || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="单据状态">
|
||||
<el-tag v-if="scope.row.bindWaybillStatus === 0" type="info" size="mini">未发货</el-tag>
|
||||
<el-tag v-else-if="scope.row.bindWaybillStatus === 1" type="info" size="mini">已发货</el-tag>
|
||||
<el-tag v-else-if="scope.row.bindWaybillStatus === 2" type="info" size="mini">未打印</el-tag>
|
||||
<el-tag v-else-if="scope.row.bindWaybillStatus === 3" type="info" size="mini">已打印</el-tag>
|
||||
<el-tag v-else type="danger" size="mini">未知状态</el-tag>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div slot="reference" class="text-ellipsis" v-text>{{ scope.row.bindLicensePlate || '-' }}</div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="关联订单" align="center" prop="relatedToOrder" v-if="showRelatedToOrder" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-switch @change="handleRowChange(scope.row)" v-model="scope.row.isRelatedToOrder" :active-value="1"
|
||||
:inactive-value="0" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="发货状态" align="center" prop="status" v-if="showWaybill" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status === 1" type="success" size="mini">已发货</el-tag>
|
||||
<el-tag v-else type="info" size="mini">未发货</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发货计划" align="center" prop="nextWarehouseId" v-if="showWaybill" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.bindPlanName || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="实测宽度" align="center" prop="width" v-if="showWidthEdit" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.actualWidth" placeholder="请输入实测宽度"
|
||||
@change="handleRowChange(scope.row)"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发货单据" align="center" prop="nextWarehouseId" v-if="showWaybill" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-popover placement="top" width="400" trigger="hover">
|
||||
<div>
|
||||
<el-descriptions :column="2" :border="false">
|
||||
<el-descriptions-item label="单据名称">
|
||||
{{ scope.row.bindWaybillName || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="车牌号">
|
||||
{{ scope.row.bindLicensePlate || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="收货单位">
|
||||
{{ scope.row.bindConsigneeUnit || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="负责人">
|
||||
{{ scope.row.bindPrincipal || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="单据状态">
|
||||
<el-tag v-if="scope.row.bindWaybillStatus === 0" type="info" size="mini">未发货</el-tag>
|
||||
<el-tag v-else-if="scope.row.bindWaybillStatus === 1" type="info" size="mini">已发货</el-tag>
|
||||
<el-tag v-else-if="scope.row.bindWaybillStatus === 2" type="info" size="mini">未打印</el-tag>
|
||||
<el-tag v-else-if="scope.row.bindWaybillStatus === 3" type="info" size="mini">已打印</el-tag>
|
||||
<el-tag v-else type="danger" size="mini">未知状态</el-tag>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div slot="reference" class="text-ellipsis" v-text>{{ scope.row.bindLicensePlate || '-' }}</div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="实测厚度(m)" align="center" prop="actualThickness" v-if="showWidthEdit" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.actualThickness" placeholder="请输入实测厚度"
|
||||
@change="handleRowChange(scope.row)"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发货状态" align="center" prop="status" v-if="showWaybill" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status === 1" type="success" size="mini">已发货</el-tag>
|
||||
<el-tag v-else type="info" size="mini">未发货</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="预留宽度" align="center" prop="width" v-if="showWidthEdit" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.reservedWidth" placeholder="请输入预留宽度"
|
||||
@change="handleRowChange(scope.row)"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实测宽度" align="center" prop="width" v-if="showWidthEdit" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.actualWidth" placeholder="请输入实测宽度"
|
||||
@change="handleRowChange(scope.row)"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="生产开始" align="center" prop="productionStartTime" v-if="showProductionTimeEdit" width="150">
|
||||
</el-table-column>
|
||||
<el-table-column label="实测厚度(m)" align="center" prop="actualThickness" v-if="showWidthEdit" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.actualThickness" placeholder="请输入实测厚度"
|
||||
@change="handleRowChange(scope.row)"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="生产结束" align="center" prop="productionEndTime" v-if="showProductionTimeEdit" width="150">
|
||||
</el-table-column>
|
||||
<el-table-column label="预留宽度" align="center" prop="width" v-if="showWidthEdit" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.reservedWidth" placeholder="请输入预留宽度"
|
||||
@change="handleRowChange(scope.row)"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="生产耗时" align="center" prop="productionDuration" v-if="showProductionTimeEdit" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ formatDuration(scope.row.productionDuration * 60 * 1000) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="生产开始" align="center" prop="productionStartTime" v-if="showProductionTimeEdit"
|
||||
width="150">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handlePreviewLabel(scope.row)">
|
||||
预览标签
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-printer" @click="handlePrintLabel(scope.row)">
|
||||
打印标签
|
||||
</el-button>
|
||||
<el-button size="mini" v-if="showStatus" type="text" icon="el-icon-upload"
|
||||
@click="handleExportCoil(scope.row)">
|
||||
发货
|
||||
</el-button>
|
||||
<el-button size="mini" v-if="showExportTime" type="text" icon="el-icon-close"
|
||||
@click="handleCancelExport(scope.row)">
|
||||
撤回发货
|
||||
</el-button>
|
||||
<el-button size="mini" v-if="showProductionTimeEdit" type="text" icon="el-icon-close"
|
||||
@click="handleProductionTimeEdit(scope.row)">
|
||||
加工修正
|
||||
</el-button>
|
||||
<el-button size="mini" v-if="showExportTime" type="text" icon="el-icon-sold-out"
|
||||
@click="handleReturnCoil(scope.row)">
|
||||
退货钢卷
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleCheck(scope.row)"
|
||||
v-if="showControl">修正</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-search" @click="handleTrace(scope.row)">追溯</el-button>
|
||||
<el-button size="mini" v-if="showWaybill" type="text" icon="el-icon-close"
|
||||
@click="handleRemoveFromWaybill(scope.row)">
|
||||
移出发货单
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</KLPTable>
|
||||
<el-table-column label="生产结束" align="center" prop="productionEndTime" v-if="showProductionTimeEdit"
|
||||
width="150">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="生产耗时" align="center" prop="productionDuration" v-if="showProductionTimeEdit"
|
||||
width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ formatDuration(scope.row.productionDuration * 60 * 1000) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="action" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handlePreviewLabel(scope.row)">
|
||||
预览标签
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-printer" @click="handlePrintLabel(scope.row)">
|
||||
打印标签
|
||||
</el-button>
|
||||
<el-button size="mini" v-if="showStatus" type="text" icon="el-icon-upload"
|
||||
@click="handleExportCoil(scope.row)">
|
||||
发货
|
||||
</el-button>
|
||||
<el-button size="mini" v-if="showExportTime" type="text" icon="el-icon-close"
|
||||
@click="handleCancelExport(scope.row)">
|
||||
撤回发货
|
||||
</el-button>
|
||||
<el-button size="mini" v-if="showProductionTimeEdit" type="text" icon="el-icon-close"
|
||||
@click="handleProductionTimeEdit(scope.row)">
|
||||
加工修正
|
||||
</el-button>
|
||||
<el-button size="mini" v-if="showExportTime" type="text" icon="el-icon-sold-out"
|
||||
@click="handleReturnCoil(scope.row)">
|
||||
退货钢卷
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleCheck(scope.row)"
|
||||
v-if="showControl">修正</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-search" @click="handleTrace(scope.row)">追溯</el-button>
|
||||
<el-button size="mini" v-if="showWaybill" type="text" icon="el-icon-close"
|
||||
@click="handleRemoveFromWaybill(scope.row)">
|
||||
移出发货单
|
||||
</el-button>
|
||||
<el-button v-if="showGrade" size="mini" type="text" icon="el-icon-edit" @click="handleJudge(scope.row)">
|
||||
改判
|
||||
</el-button>
|
||||
<el-button size="mini" v-if="hasTransferType" type="text" icon="el-icon-close"
|
||||
@click="handleReplaceLabel(scope.row)">
|
||||
重贴标签
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</KLPTable>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div v-show="total > 0" style="display: flex; justify-content: flex-end; align-items: flex-end; gap: 10px;">
|
||||
<span>
|
||||
总净重:{{ statistics.total_net_weight || 0 }}t
|
||||
</span>
|
||||
|
||||
<pagination :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 添加或修改钢卷物料对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
@@ -474,7 +496,6 @@
|
||||
@change="(value) => { productionTimeForm.productionEndTime = value; calculateProductionDuration(); }" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产耗时" prop="productionDuration">
|
||||
<!-- <div>{{ productionTimeForm.formattedDuration }}</div> -->
|
||||
<el-input v-model="productionTimeForm.formattedDuration" placeholder="自动计算" disabled />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -493,6 +514,70 @@
|
||||
<process-flow v-if="showProcessFlow" ref="processFlow"></process-flow>
|
||||
</div>
|
||||
</DragResizeBox>
|
||||
|
||||
<!-- 钢卷改判弹窗 -->
|
||||
<el-dialog title="钢卷改判" :visible.sync="judgeDialogVisible" width="800px" append-to-body>
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="入场钢卷号">{{ judgeForm.enterCoilNo || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="当前钢卷号">{{ judgeForm.currentCoilNo || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="厂家原料卷号">{{ judgeForm.supplierCoilNo || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="逻辑库位">{{ judgeForm.warehouseName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="实际库区">{{ judgeForm.actualWarehouseName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="班组">{{ judgeForm.team || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="材料类型">{{ judgeForm.materialType || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="产品/原料">{{ judgeForm.itemName || '-' }}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="规格">{{ judgeForm.specification || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="材质">{{ judgeForm.material || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="厂家">{{ judgeForm.manufacturer || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="镀层质量">{{ judgeForm.zincLayer || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="表面处理">{{ judgeForm.surfaceTreatmentDesc || '-'
|
||||
}}</el-descriptions-item>
|
||||
|
||||
|
||||
<el-descriptions-item label="质量状态">{{ judgeForm.qualityStatus || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="切边要求">{{ judgeForm.trimmingRequirement || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="原料材质">{{ judgeForm.packingStatus || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="包装要求">{{ judgeForm.packagingRequirement || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="实测厚度(m)">{{ judgeForm.actualThickness || '-' }}
|
||||
m</el-descriptions-item>
|
||||
<el-descriptions-item label="实测宽度(m)">{{ judgeForm.actualWidth || '-' }}
|
||||
m</el-descriptions-item>
|
||||
<el-descriptions-item label="长度">{{ judgeForm.length || '-' }}
|
||||
m</el-descriptions-item>
|
||||
<el-descriptions-item label="毛重">{{ judgeForm.grossWeight || '-' }} t</el-descriptions-item>
|
||||
<el-descriptions-item label="净重">{{ judgeForm.netWeight || '-' }} t</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="生产开始时间">{{ judgeForm.productionStartTime || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="生产结束时间">{{ judgeForm.productionEndTime || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="调制度">{{ judgeForm.temperGrade || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="镀层种类">{{ judgeForm.coatingType || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="钢卷表面处理">{{ judgeForm.coilSurfaceTreatment || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="2">{{ judgeForm.remark || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<div style="margin-top: 20px; padding: 15px; background-color: #f5f7fa; border-radius: 4px;">
|
||||
<el-form :model="judgeForm" label-width="120px">
|
||||
<el-form-item label="修改质量状态">
|
||||
<el-select v-model="judgeForm.qualityStatus" placeholder="请选择质量状态" style="width: 200px">
|
||||
<el-option v-for="item in dict.type.coil_quality_status" :key="item.value" :value="item.value" :label="item.label" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="通知重贴标签">
|
||||
<el-checkbox v-model="judgeForm.notifyReLabel">是否通知重贴标签</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="judgeDialogVisible = false">取消</el-button>
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitJudgeForm">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -508,6 +593,7 @@ import {
|
||||
cancelExportCoil,
|
||||
checkCoilNo,
|
||||
returnCoil,
|
||||
getCoilStatisticsList
|
||||
} from "@/api/wms/coil";
|
||||
import { listBoundCoil } from "@/api/wms/deliveryWaybillDetail";
|
||||
import { addPendingAction } from "@/api/wms/pendingAction";
|
||||
@@ -537,6 +623,7 @@ import LogTable from "@/views/wms/warehouse/components/LogTable.vue";
|
||||
import { getCoilTagPrintType } from '@/views/wms/coil/js/coilPrint';
|
||||
import DragResizeBox from '@/components/DragResizeBox/index.vue';
|
||||
import ProcessFlow from '../components/ProcessFlow.vue';
|
||||
import WarehouseTree from '@/components/KLPService/WarehouseTree/index.vue';
|
||||
import { listDeliveryWaybillDetail, delDeliveryWaybillDetail } from "@/api/wms/deliveryWaybillDetail";
|
||||
|
||||
export default {
|
||||
@@ -560,6 +647,7 @@ export default {
|
||||
LogTable,
|
||||
ProcessFlow,
|
||||
DragResizeBox,
|
||||
WarehouseTree,
|
||||
},
|
||||
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer', 'coil_quality_status', 'wms_next_warehouse', 'coil_business_purpose'],
|
||||
props: {
|
||||
@@ -657,6 +745,14 @@ export default {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
leftWarehouseQuery: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
hasTransferType: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -753,27 +849,6 @@ export default {
|
||||
],
|
||||
currentCoilNo: [
|
||||
{ required: true, message: "当前钢卷号不能为空", trigger: "blur" },
|
||||
// 仅在新增的时候校验
|
||||
// {
|
||||
// validator: (rule, value, callback) => {
|
||||
// // if (this.form.coilId) {
|
||||
// // // 修改时会有coilId,不触发校验
|
||||
// // console.log('修改时会有coilId,不触发校验');
|
||||
// // callback();
|
||||
// // } else {
|
||||
// // 没有coilId则为新增 触发校验
|
||||
// checkCoilNo({ currentCoilNo: value, coilId: this.form.coilId }).then(res => {
|
||||
// const { duplicateType } = res.data;
|
||||
// if (duplicateType === 'current' || duplicateType === 'both') {
|
||||
// // alert('当前钢卷号重复,请重新输入');
|
||||
// callback(new Error('当前钢卷号重复,请重新输入'));
|
||||
// } else {
|
||||
// callback();
|
||||
// }
|
||||
// })
|
||||
// // }
|
||||
// }, trigger: 'blur'
|
||||
// }
|
||||
],
|
||||
itemId: [
|
||||
{ required: true, message: "物品ID不能为空", trigger: "blur" }
|
||||
@@ -812,11 +887,19 @@ export default {
|
||||
{ label: '净重', prop: 'netWeight' },
|
||||
{ label: '毛重', prop: 'grossWeight' },
|
||||
{ label: '备注', prop: 'remark' },
|
||||
{ label: '创建人', prop: 'createBy' },
|
||||
{ label: '创建时间', prop: 'createTime' },
|
||||
{ label: '更新人', prop: 'updateBy' },
|
||||
{ label: '更新时间', prop: 'updateTime' },
|
||||
{ label: '质量状态', prop: 'qualityStatus' },
|
||||
{ label: '原料材质', prop: 'packingStatus' },
|
||||
{ label: '切边要求', prop: 'edgeRequirement' },
|
||||
{ label: '包装要求', prop: 'packagingRequirement' },
|
||||
{ label: '厂家', prop: 'itemManufacturer' },
|
||||
{ label: '物料名称', prop: 'itemName' },
|
||||
{ label: '材质', prop: 'material' },
|
||||
{ label: '规格', prop: 'specification' },
|
||||
{ label: '镀层质量', prop: 'zincLayer' },
|
||||
{ label: '厂家', prop: 'manufacturer' },
|
||||
{ label: '调制度', prop: 'temperGrade' },
|
||||
{ label: '镀层种类', prop: 'coatingType' },
|
||||
{ label: '实测长度(m)', prop: 'actualLength' },
|
||||
@@ -845,6 +928,23 @@ export default {
|
||||
// 统计数据:已发货的数量和未发货的数量
|
||||
shippedCount: 0,
|
||||
unshippedCount: 0,
|
||||
statistics: {},
|
||||
// 钢卷改判弹窗
|
||||
judgeDialogVisible: false,
|
||||
judgeForm: {
|
||||
coilId: undefined,
|
||||
enterCoilNo: undefined,
|
||||
currentCoilNo: undefined,
|
||||
netWeight: undefined,
|
||||
warehouseName: undefined,
|
||||
actualWarehouseName: undefined,
|
||||
qualityStatus: undefined,
|
||||
itemName: undefined,
|
||||
itemMaterial: undefined,
|
||||
itemSpecification: undefined,
|
||||
itemManufacturer: undefined,
|
||||
notifyReLabel: false
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -893,11 +993,16 @@ export default {
|
||||
// 初始化时计算一次
|
||||
this.calculateProductionDuration();
|
||||
},
|
||||
// 处理逻辑库位点击事件
|
||||
handleWarehouseNodeClick(node) {
|
||||
this.queryParams.warehouseId = node.warehouseId;
|
||||
this.getList();
|
||||
},
|
||||
async handleRemoveFromWaybill(row) {
|
||||
const coilId = row.coilId;
|
||||
// 根据id查询所在的单据明细
|
||||
const res = await listDeliveryWaybillDetail({ coilId });
|
||||
|
||||
|
||||
if (res.rows.length != 1) {
|
||||
this.$message({
|
||||
message: '发货单查找失败',
|
||||
@@ -911,17 +1016,30 @@ export default {
|
||||
this.$modal.confirm('确认要将该钢卷从发货单中移除吗?', {
|
||||
title: '确认移除',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
delDeliveryWaybillDetail(detailId).then(res => {
|
||||
this.$message({
|
||||
message: '移除成功',
|
||||
type: 'success',
|
||||
});
|
||||
this.getList();
|
||||
}).then(() => {
|
||||
delDeliveryWaybillDetail(detailId).then(res => {
|
||||
this.$message({
|
||||
message: '移除成功',
|
||||
type: 'success',
|
||||
});
|
||||
this.getList();
|
||||
});
|
||||
})
|
||||
// 打开一个弹窗列出查询到的所有单据明细
|
||||
},
|
||||
// 处理重贴标签
|
||||
handleReplaceLabel(row) {
|
||||
updateMaterialCoilSimple({
|
||||
...row,
|
||||
transferType: '',
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: '标签已重贴,记录移除',
|
||||
type: 'success',
|
||||
});
|
||||
this.getList();
|
||||
})
|
||||
},
|
||||
// 格式化毫秒值为xx天xx小时xx分钟
|
||||
formatDuration(milliseconds) {
|
||||
if (!milliseconds || milliseconds < 0) return '';
|
||||
@@ -1086,6 +1204,9 @@ export default {
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
getCoilStatisticsList(query).then(res => {
|
||||
this.statistics = res.data || [];
|
||||
})
|
||||
},
|
||||
/** 追溯按钮操作 */
|
||||
handleTrace(row) {
|
||||
@@ -1399,6 +1520,39 @@ export default {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
},
|
||||
/** 改判按钮操作 */
|
||||
handleJudge(row) {
|
||||
// 填充改判表单数据
|
||||
this.judgeForm = {
|
||||
...row,
|
||||
notifyReLabel: true
|
||||
};
|
||||
this.judgeDialogVisible = true;
|
||||
},
|
||||
/** 提交改判表单 */
|
||||
submitJudgeForm() {
|
||||
this.buttonLoading = true;
|
||||
const submitData = {
|
||||
...this.judgeForm,
|
||||
// 如果通知重贴标签,则设置 transferType 为技术部改判
|
||||
transferType: this.judgeForm.notifyReLabel ? '技术部改判' : null
|
||||
};
|
||||
updateMaterialCoilSimple(submitData).then(res => {
|
||||
this.buttonLoading = false;
|
||||
this.$message({
|
||||
message: '改判成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.judgeDialogVisible = false;
|
||||
this.getList();
|
||||
}).catch(err => {
|
||||
this.buttonLoading = false;
|
||||
this.$message({
|
||||
message: '改判失败',
|
||||
type: 'error'
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const coilIds = row.coilId || this.ids;
|
||||
@@ -1625,4 +1779,8 @@ export default {
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
::v-deep .el-table {
|
||||
margin-top: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -425,11 +425,47 @@ export default {
|
||||
border: '1px solid #2bf',
|
||||
color: '#fff'
|
||||
}
|
||||
} else if (this.acidRollingActionType == 507) {
|
||||
}
|
||||
// 各个修复工序,使用工序的代表色 + 粉色的渐变来标识
|
||||
// 酸轧修复工序
|
||||
else if (this.acidRollingActionType == 520) {
|
||||
return {
|
||||
// 亮粉色
|
||||
backgroundColor: '#FFAACC',
|
||||
border: '1px solid #FFAACC',
|
||||
background: 'linear-gradient(45deg, #5b7294 0% 90%, #FFAACC 90% 100%)',
|
||||
color: '#fff'
|
||||
}
|
||||
}
|
||||
// 镀锌修复工序
|
||||
else if (this.acidRollingActionType == 521) {
|
||||
return {
|
||||
background: 'linear-gradient(45deg, #2cb867 0% 90%, #FFAACC 90% 100%)',
|
||||
color: '#fff'
|
||||
}
|
||||
}
|
||||
// 脱脂修复工序
|
||||
else if (this.acidRollingActionType == 522) {
|
||||
return {
|
||||
background: 'linear-gradient(45deg, purple 0% 90%, #FFAACC 90% 100%)',
|
||||
color: '#fff'
|
||||
}
|
||||
}
|
||||
// 拉矫修复工序
|
||||
else if (this.acidRollingActionType == 523) {
|
||||
return {
|
||||
background: 'linear-gradient(45deg, #f56c6c 0% 90%, #FFAACC 90% 100%)',
|
||||
color: '#fff'
|
||||
}
|
||||
}
|
||||
// 双机架修复工序
|
||||
else if (this.acidRollingActionType == 524) {
|
||||
return {
|
||||
background: 'linear-gradient(45deg, #orange 0% 90%, #FFAACC 90% 100%)',
|
||||
color: '#fff'
|
||||
}
|
||||
}
|
||||
// 镀铬修复工序
|
||||
else if (this.acidRollingActionType == 525) {
|
||||
return {
|
||||
background: 'linear-gradient(45deg, #2bf 0% 90%, #FFAACC 90% 100%)',
|
||||
color: '#fff'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<el-descriptions-item label="物料名称">{{ coilInfo.itemName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="规格">{{ coilInfo.specification || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="材质">{{ coilInfo.material || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="厂家">{{ coilInfo.manufacturer || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="原料材质">{{ coilInfo.packingStatus || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="实测长度(m)">{{ coilInfo.actualLength || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="实测宽度(m)">{{ coilInfo.actualWidth || '-' }}</el-descriptions-item>
|
||||
@@ -186,7 +187,8 @@
|
||||
<MemoInput storageKey="coatingType" v-model="splitForm.coatingType" placeholder="请输入镀层种类" />
|
||||
</el-form-item>
|
||||
<el-form-item label="钢卷表面处理" prop="coilSurfaceTreatment">
|
||||
<MemoInput storageKey="surfaceTreatmentDesc" v-model="splitForm.coilSurfaceTreatment" placeholder="请输入钢卷表面处理" />
|
||||
<MemoInput storageKey="surfaceTreatmentDesc" v-model="splitForm.coilSurfaceTreatment"
|
||||
placeholder="请输入钢卷表面处理" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产开始时间" prop="productionStartTime">
|
||||
<TimeInput v-model="splitForm.productionStartTime" @input="calculateProductionDuration" />
|
||||
@@ -202,6 +204,10 @@
|
||||
<el-input v-model="splitForm.remark" placeholder="请输入备注" type="textarea" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="关联合同" prop="contractId">
|
||||
<ContractSelect v-model="splitForm.contractId" placeholder="请选择合同" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="异常信息">
|
||||
<div class="abnormal-container">
|
||||
<div v-for="(abnormal, index) in abnormals" :key="index" class="abnormal-item"
|
||||
@@ -270,7 +276,8 @@
|
||||
|
||||
<el-descriptions-item label="调制度">{{ selectedSplitItem.temperGrade || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="镀层种类">{{ selectedSplitItem.coatingType || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="钢卷表面处理">{{ selectedSplitItem.coilSurfaceTreatment || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="钢卷表面处理">{{ selectedSplitItem.coilSurfaceTreatment || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="生产开始时间">{{ selectedSplitItem.productionStartTime || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="生产结束时间">{{ selectedSplitItem.productionEndTime || '-'
|
||||
@@ -315,6 +322,8 @@ import AbnormalForm from '../components/AbnormalForm';
|
||||
import { generateCoilNoPrefix } from "@/utils/coil/coilNo";
|
||||
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
|
||||
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
|
||||
import ContractSelect from "@/components/KLPService/ContractSelect";
|
||||
import { addCoilContractRel } from "@/api/wms/coilContractRel";
|
||||
|
||||
export default {
|
||||
name: 'StepSplit',
|
||||
@@ -345,6 +354,7 @@ export default {
|
||||
AbnormalForm,
|
||||
ProductInfo,
|
||||
RawMaterialInfo,
|
||||
ContractSelect,
|
||||
},
|
||||
dicts: ['coil_quality_status', 'coil_abnormal_position', 'coil_abnormal_code', 'coil_abnormal_degree', 'coil_business_purpose'],
|
||||
data() {
|
||||
@@ -405,21 +415,6 @@ export default {
|
||||
}
|
||||
}, trigger: 'blur'
|
||||
},
|
||||
// 仅在新增的时候校验
|
||||
// {
|
||||
// validator: (rule, value, callback) => {
|
||||
// // 没有coilId则为新增 触发校验
|
||||
// checkCoilNo({ currentCoilNo: value, coilId: this.splitForm.coilId }).then(res => {
|
||||
// const { duplicateType } = res.data;
|
||||
// if (duplicateType === 'current' || duplicateType === 'both') {
|
||||
// // alert('当前钢卷号重复,请重新输入');
|
||||
// callback(new Error('当前钢卷号重复,请重新输入'));
|
||||
// } else {
|
||||
// callback();
|
||||
// }
|
||||
// })
|
||||
// }, trigger: 'blur'
|
||||
// }
|
||||
],
|
||||
materialType: [{ required: true, message: '请选择材料类型', trigger: 'change' }],
|
||||
itemId: [{ required: true, message: '请选择成品/原料', trigger: 'change' }],
|
||||
@@ -546,7 +541,6 @@ export default {
|
||||
}
|
||||
const action = await getPendingAction(this.actionId)
|
||||
this.currentAction = action.data || {}
|
||||
// this.$set(this.splitForm, 'productionStartTime', action.data.createTime)
|
||||
const coilIds = action.data.remark;
|
||||
console.log('coilIds', coilIds)
|
||||
if (!coilIds) {
|
||||
@@ -616,7 +610,7 @@ export default {
|
||||
|
||||
// 材料类型变更处理
|
||||
handleMaterialTypeChange(val) {
|
||||
// 清空物品选择
|
||||
// 清空物品选择
|
||||
this.splitForm.itemId = null;
|
||||
|
||||
// 根据材料类型设置物品类型
|
||||
@@ -680,6 +674,11 @@ export default {
|
||||
} else {
|
||||
// 新增分条:调用创建接口
|
||||
res = await createSpecialChild(this.coilId, this.actionId, splitData)
|
||||
// 新增分条后,需要添加分条的合同关系
|
||||
addCoilContractRel({
|
||||
coilId: res.data.coilId,
|
||||
contractId: this.splitForm.contractId,
|
||||
})
|
||||
}
|
||||
|
||||
this.$message.success(this.splitForm.coilId ? '编辑分条成功' : '新增分条成功')
|
||||
@@ -721,7 +720,7 @@ export default {
|
||||
}
|
||||
|
||||
// 2. 完成待办动作(根据业务逻辑调整)
|
||||
const actionRes = await completeAction(this.actionId)
|
||||
const actionRes = await completeAction(this.actionId, splitRes.data.childCoilIds.join(','))
|
||||
if (actionRes.code !== 200) {
|
||||
this.$message.error('完成待办动作失败:' + actionRes.msg)
|
||||
return
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
:hideType="hideType"
|
||||
:showLength="showLength"
|
||||
:canExportAll="canExportAll"
|
||||
:leftWarehouseQuery="true"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -249,6 +249,11 @@
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="item.remark" placeholder="请输入备注" :disabled="readonly" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="关联合同" prop="contractId">
|
||||
<ContractSelect v-model="item.contractId" placeholder="请选择合同" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="异常信息">
|
||||
<div class="abnormal-container">
|
||||
<div
|
||||
@@ -316,6 +321,8 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import TimeInput from "@/components/TimeInput";
|
||||
import AbnormalForm from './components/AbnormalForm';
|
||||
import { generateCoilNoPrefix } from "@/utils/coil/coilNo";
|
||||
import ContractSelect from "@/components/KLPService/ContractSelect";
|
||||
import { addCoilContractRel } from "@/api/wms/coilContractRel";
|
||||
|
||||
export default {
|
||||
name: 'SplitCoil',
|
||||
@@ -325,7 +332,8 @@ export default {
|
||||
ProductSelect,
|
||||
WarehouseSelect,
|
||||
TimeInput,
|
||||
AbnormalForm
|
||||
AbnormalForm,
|
||||
ContractSelect
|
||||
},
|
||||
dicts: ['coil_quality_status', 'coil_abnormal_position', 'coil_abnormal_code', 'coil_abnormal_degree', 'coil_business_purpose'],
|
||||
data() {
|
||||
@@ -674,9 +682,19 @@ export default {
|
||||
if (response.code === 200) {
|
||||
this.$message.success('分条保存成功');
|
||||
|
||||
// 拿到多个子卷的coilId
|
||||
const newCoilIds = response.msg.split(',');
|
||||
// 为每个子卷添加合同关联
|
||||
Promise.all(newCoilIds.map(async (coilId, index) => {
|
||||
addCoilContractRel({
|
||||
coilId,
|
||||
contractId: this.splitList[index].contractId
|
||||
});
|
||||
}));
|
||||
|
||||
// 如果是从待操作列表进来的,标记操作为完成
|
||||
if (this.actionId) {
|
||||
await completeAction(this.actionId);
|
||||
await completeAction(this.actionId, response.msg);
|
||||
}
|
||||
|
||||
// 延迟返回,让用户看到成功提示
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">逻辑库区:</span>
|
||||
<span class="info-value">{{ currentInfo.nextWarehouseName || '—' }}</span>
|
||||
<span class="info-value">{{ currentInfo.warehouseName || '—' }}</span>
|
||||
</div>
|
||||
<div class="info-row" v-if="currentInfo.remark">
|
||||
<span class="info-label">备注:</span>
|
||||
@@ -195,7 +195,7 @@
|
||||
|
||||
<el-form-item label="实测厚度(m)" prop="actualThickness" class="form-item-half">
|
||||
<el-input-number :controls="false" v-model="updateForm.actualThickness" placeholder="请输入实测厚度"
|
||||
type="number" :step="0.01" :disabled="readonly">
|
||||
type="number" :step="0.01">
|
||||
<template slot="append">米</template>
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
@@ -251,6 +251,10 @@
|
||||
show-word-limit />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="关联合同" prop="contractId">
|
||||
<ContractSelect v-model="updateForm.contractId" placeholder="请选择合同" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="异常信息">
|
||||
<div class="abnormal-container">
|
||||
<div
|
||||
@@ -324,11 +328,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getMaterialCoil, updateMaterialCoil, getMaterialCoilTrace, checkCoilNo } from '@/api/wms/coil';
|
||||
import { getMaterialCoil, updateMaterialCoil, getMaterialCoilTrace } from '@/api/wms/coil';
|
||||
import { completeAction, getPendingAction } from '@/api/wms/pendingAction';
|
||||
import { listWarehouse } from '@/api/wms/warehouse';
|
||||
import { listRawMaterialWithBom } from '@/api/wms/rawMaterial';
|
||||
import { listProductWithBom } from '@/api/wms/product';
|
||||
import { getAcidTypingPrefill } from '@/api/pocket/acidTyping';
|
||||
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
|
||||
import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
|
||||
@@ -337,6 +339,8 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import TimeInput from "@/components/TimeInput";
|
||||
import AbnormalForm from './components/AbnormalForm';
|
||||
import { generateCoilNoPrefix } from "@/utils/coil/coilNo";
|
||||
import { addCoilContractRel } from "@/api/wms/coilContractRel";
|
||||
import ContractSelect from "@/components/KLPService/ContractSelect";
|
||||
|
||||
export default {
|
||||
name: 'TypingCoil',
|
||||
@@ -346,7 +350,8 @@ export default {
|
||||
ProductSelect,
|
||||
WarehouseSelect,
|
||||
TimeInput,
|
||||
AbnormalForm
|
||||
AbnormalForm,
|
||||
ContractSelect
|
||||
},
|
||||
dicts: ['coil_quality_status', 'coil_abnormal_position', 'coil_abnormal_code', 'coil_abnormal_degree', 'coil_business_purpose'],
|
||||
data() {
|
||||
@@ -367,7 +372,6 @@ export default {
|
||||
netWeight: undefined,
|
||||
warehouseId: null,
|
||||
warehouseId: null,
|
||||
nextWarehouseName: '',
|
||||
status: 0,
|
||||
remark: '',
|
||||
length: undefined,
|
||||
@@ -451,8 +455,6 @@ export default {
|
||||
{ required: true, message: '请选择逻辑库区', trigger: 'change' }
|
||||
],
|
||||
},
|
||||
warehouseList: [],
|
||||
historySteps: [],
|
||||
actionId: null,
|
||||
acidPrefill: {
|
||||
visible: false,
|
||||
@@ -460,10 +462,6 @@ export default {
|
||||
title: ''
|
||||
},
|
||||
isAcidRolling: false,
|
||||
// 原材料和产品列表(实时搜索,不再保存完整备份)
|
||||
rawMaterialList: [],
|
||||
productList: [],
|
||||
itemSearchLoading: false,
|
||||
// 酸连轧最近记录
|
||||
acidRecentRecords: [],
|
||||
// 异常信息
|
||||
@@ -482,7 +480,8 @@ export default {
|
||||
defectCode: null,
|
||||
degree: null,
|
||||
remark: null
|
||||
}
|
||||
},
|
||||
contractList: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -504,26 +503,8 @@ export default {
|
||||
}
|
||||
return '请先选择材料类型';
|
||||
},
|
||||
// 当前物品列表(根据物品类型动态切换)
|
||||
currentItemList() {
|
||||
if (this.updateForm.itemType === 'raw_material') {
|
||||
return this.rawMaterialList.map(item => ({
|
||||
id: item.rawMaterialId,
|
||||
name: this.formatItemName(item)
|
||||
}));
|
||||
} else if (this.updateForm.itemType === 'product') {
|
||||
return this.productList.map(item => ({
|
||||
id: item.productId,
|
||||
name: this.formatItemName(item)
|
||||
}));
|
||||
}
|
||||
return [];
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
// 先加载库区列表
|
||||
await this.loadWarehouses();
|
||||
|
||||
// 从路由参数获取coilId和actionId
|
||||
const coilId = this.$route.query.coilId;
|
||||
const actionId = this.$route.query.actionId;
|
||||
@@ -647,12 +628,9 @@ export default {
|
||||
// 根据材料类型设置物品类型
|
||||
if (value === '成品') {
|
||||
this.$set(this.updateForm, 'itemType', 'product');
|
||||
// 清空列表,等待用户搜索
|
||||
this.productList = [];
|
||||
|
||||
} else if (value === '原料') {
|
||||
this.$set(this.updateForm, 'itemType', 'raw_material');
|
||||
// 清空列表,等待用户搜索
|
||||
this.rawMaterialList = [];
|
||||
}
|
||||
},
|
||||
|
||||
@@ -677,8 +655,6 @@ export default {
|
||||
// 填充当前信息(左侧)
|
||||
this.currentInfo = {
|
||||
...data,
|
||||
itemName: this.getItemName(data),
|
||||
nextWarehouseName: this.getWarehouseName(data.warehouseId),
|
||||
};
|
||||
|
||||
// 填充时间相关字段
|
||||
@@ -700,14 +676,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 获取物料名称
|
||||
getItemName(data) {
|
||||
if (data.itemName) {
|
||||
return data.itemName;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
|
||||
// 获取物品类型文本
|
||||
getItemTypeText(itemType) {
|
||||
if (itemType === 'raw_material') return '原材料';
|
||||
@@ -715,13 +683,6 @@ export default {
|
||||
return '—';
|
||||
},
|
||||
|
||||
// 获取库区名称
|
||||
getWarehouseName(warehouseId) {
|
||||
if (!warehouseId) return '';
|
||||
const warehouse = this.warehouseList.find(w => w.warehouseId === warehouseId);
|
||||
return warehouse ? warehouse.warehouseName : '';
|
||||
},
|
||||
|
||||
// 格式化物品名称(添加规格和参数信息)
|
||||
formatItemName(item) {
|
||||
if (!item) return '';
|
||||
@@ -756,41 +717,7 @@ export default {
|
||||
|
||||
return displayName;
|
||||
},
|
||||
|
||||
// 加载库区列表
|
||||
async loadWarehouses() {
|
||||
try {
|
||||
const response = await listWarehouse({ pageNum: 1, pageSize: 1000 });
|
||||
if (response.code === 200) {
|
||||
this.warehouseList = response.rows || response.data || [];
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载库区列表失败', error);
|
||||
}
|
||||
},
|
||||
|
||||
// 加载变更历史
|
||||
async loadHistory() {
|
||||
if (!this.currentInfo.enterCoilNo) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
this.historyLoading = true;
|
||||
const response = await getMaterialCoilTrace({
|
||||
enterCoilNo: this.currentInfo.enterCoilNo,
|
||||
currentCoilNo: this.currentInfo.currentCoilNo || undefined
|
||||
});
|
||||
|
||||
if (response.code === 200 && response.data) {
|
||||
this.historySteps = response.data.steps || [];
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载变更历史失败', error);
|
||||
} finally {
|
||||
this.historyLoading = false;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 复制当前信息到更新表单
|
||||
copyFromCurrent() {
|
||||
@@ -870,19 +797,29 @@ export default {
|
||||
enterCoilNo: this.currentInfo.enterCoilNo,
|
||||
supplierCoilNo: this.currentInfo.supplierCoilNo,
|
||||
abnormals: this.abnormals,
|
||||
// 注意:不要传newCoils,否则会走批量更新逻辑
|
||||
};
|
||||
|
||||
const response = await updateMaterialCoil(updateData);
|
||||
|
||||
// 更新完成后如果选定了合同,需要增加与合同的绑定关系
|
||||
const coilId = response.msg;
|
||||
if (this.updateForm.contractId) {
|
||||
await addCoilContractRel({
|
||||
coilId: coilId,
|
||||
contractId: this.updateForm.contractId,
|
||||
});
|
||||
}
|
||||
|
||||
if (response.code === 200) {
|
||||
this.$message.success('钢卷信息更新成功');
|
||||
|
||||
// 如果是从待操作列表进来的,标记操作为完成
|
||||
if (this.actionId) {
|
||||
await completeAction(this.actionId);
|
||||
await completeAction(this.actionId, response.msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 延迟返回
|
||||
setTimeout(() => {
|
||||
this.$router.back();
|
||||
|
||||
27
klp-ui/src/views/wms/coil/views/base/tranfer.vue
Normal file
27
klp-ui/src/views/wms/coil/views/base/tranfer.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<BasePage :qrcode="qrcode" :querys="querys" :hideWarehouseQuery="hideWarehouseQuery"
|
||||
:hideType="hideType" :showControl="showControl" :hasTransferType="hasTransferType" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BasePage from '../../panels/base.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
BasePage
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
qrcode: false,
|
||||
querys: {
|
||||
hasTransferType: true,
|
||||
// dataType: 1,
|
||||
},
|
||||
hideWarehouseQuery: true,
|
||||
hasTransferType: true,
|
||||
showControl: false,
|
||||
hideType: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="合同编号" prop="contractNo">
|
||||
<el-input v-model="queryParams.contractNo" placeholder="请输入合同编号" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-form-item label="合同编号" prop="contractCode">
|
||||
<el-input v-model="queryParams.contractCode" placeholder="请输入合同编号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同类型" prop="type" v-if="showType">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择合同类型">
|
||||
@@ -43,7 +43,7 @@
|
||||
<KLPTable v-loading="loading" :data="contractList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="合同ID" align="center" prop="contractId" v-if="false" />
|
||||
<el-table-column label="合同编号" align="center" prop="contractNo" />
|
||||
<el-table-column label="合同编号" align="center" prop="contractCode" />
|
||||
<el-table-column label="合同金额" align="center" prop="amount" />
|
||||
<el-table-column label="合同类型" align="center" prop="type" v-if="showType">
|
||||
<template slot-scope="scope">
|
||||
@@ -71,8 +71,8 @@
|
||||
<!-- 添加或修改合同信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="合同编号" prop="contractNo">
|
||||
<el-input v-model="form.contractNo" placeholder="请输入合同编号" />
|
||||
<el-form-item label="合同编号" prop="contractCode">
|
||||
<el-input v-model="form.contractCode" placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同金额" prop="amount">
|
||||
<el-input v-model="form.amount" placeholder="请输入合同金额" />
|
||||
@@ -141,7 +141,7 @@ export default {
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
contractNo: undefined,
|
||||
contractCode: undefined,
|
||||
partyA: undefined,
|
||||
partyB: undefined,
|
||||
},
|
||||
@@ -186,7 +186,7 @@ export default {
|
||||
reset() {
|
||||
this.form = {
|
||||
contractId: undefined,
|
||||
contractNo: undefined,
|
||||
contractCode: undefined,
|
||||
amount: undefined,
|
||||
type: this.type || undefined,
|
||||
accessory: undefined,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<coil-selector dialogWidth="1200px" :use-trigger="true" multiple @confirm="handleBatchAdd"
|
||||
<coil-selector dialogWidth="1200px" :use-trigger="true" multiple @confirm="handleBatchAdd" :orderId="orderId"
|
||||
:filters="{ selectType: 'product', status: 0, excludeBound: true, orderBy: true }" :orderBy="true" :disableO="true">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini">批量新增</el-button>
|
||||
</coil-selector>
|
||||
@@ -154,6 +154,10 @@ export default {
|
||||
coilList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
orderId: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
dicts: ['coil_itemname'],
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
</template>
|
||||
<template slot="panelB">
|
||||
<div style="height: 100%; overflow: auto;">
|
||||
<DeliveryWaybillDetail v-if="canEdit" ref="detailTable" :waybillId="waybillId" :coilList="coilList" />
|
||||
<DeliveryWaybillDetail v-if="canEdit" ref="detailTable" :waybillId="waybillId" :coilList="coilList" :orderId="orderId" />
|
||||
<el-empty v-else description="已发货,不可修改,点击打印查看详情" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -327,6 +327,7 @@ export default {
|
||||
orderDialogVisible: false,
|
||||
// 订单搜索关键词
|
||||
orderQuery: '',
|
||||
orderId: '',
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -354,7 +355,7 @@ export default {
|
||||
/** 加载订单列表 */
|
||||
loadOrderList() {
|
||||
this.orderLoading = true;
|
||||
listOrder({ pageNum: 1, pageSize: 100, orderType: 1, keyword: this.orderQuery }).then(response => {
|
||||
listOrder({ pageNum: 1, pageSize: 100, keyword: this.orderQuery }).then(response => {
|
||||
this.orderList = response.rows || [];
|
||||
this.orderLoading = false;
|
||||
}).catch(error => {
|
||||
@@ -495,6 +496,7 @@ export default {
|
||||
// this.$modal.msgWarning("已发货的发货单不能操作");
|
||||
return;
|
||||
}
|
||||
this.orderId = row.orderId;
|
||||
this.canEdit = true;
|
||||
this.waybillId = row.waybillId;
|
||||
},
|
||||
|
||||
@@ -199,6 +199,7 @@ import { listMealReport, getMealReport, delMealReport, addMealReport, updateMeal
|
||||
import DictSelect from "@/components/DictSelect";
|
||||
import EmployeeSelector from "@/components/EmployeeSelector";
|
||||
import { listDept } from "@/api/wms/dept"
|
||||
import { getConfigKey } from '@/api/system/config'
|
||||
|
||||
export default {
|
||||
name: "MealReport",
|
||||
@@ -233,7 +234,7 @@ export default {
|
||||
deptName: undefined,
|
||||
reportUserName: undefined,
|
||||
status: undefined,
|
||||
deadlineTime: '12:00:00' // 新增:截至时间默认12点
|
||||
deadlineTime: '16:00:00' // 新增:截至时间默认12点
|
||||
},
|
||||
form: {
|
||||
reportId: undefined,
|
||||
@@ -276,6 +277,7 @@ export default {
|
||||
created() {
|
||||
this.getList();
|
||||
this.getDeptList();
|
||||
this.getDeadlineConfig();
|
||||
},
|
||||
watch: {
|
||||
'form.dineInPeople': {
|
||||
@@ -297,6 +299,11 @@ export default {
|
||||
this.deptOptions = response.data
|
||||
})
|
||||
},
|
||||
getDeadlineConfig() {
|
||||
getConfigKey('hrm.meal.deadline').then(response => {
|
||||
this.queryParams.deadlineTime = response.msg || '16:00:00'
|
||||
})
|
||||
},
|
||||
/** 查询部门报餐主列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="生效状态">
|
||||
<el-select v-model="queryParams.isTransferred" @change="handleRegularSearch">
|
||||
<el-option :label="1">已生效</el-option>
|
||||
<el-option :label="0">未生效</el-option>
|
||||
<el-option value="1" label="已生效"></el-option>
|
||||
<el-option value="0" label="未生效"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
|
||||
@@ -172,6 +172,7 @@ export default {
|
||||
{ label: '发货绑定目标客户', value: 'bindConsigneeUnit' },
|
||||
{ label: '发货绑定单位', value: 'bindSenderUnit' },
|
||||
{ label: '发货绑定负责人', value: 'bindPrincipal' },
|
||||
{ label: '发货配卷时间', value: 'bindDeliveryTime' },
|
||||
{ label: '发货时间', value: 'exportTime' },
|
||||
],
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
<template>
|
||||
<el-descriptions title="已处理重复分条统计信息" :column="3" border>
|
||||
<el-descriptions-item label="产出数量">{{ splitSummary.outCount }}</el-descriptions-item>
|
||||
<el-descriptions-item label="产出总重">{{ splitSummary.outTotalWeight }}t</el-descriptions-item>
|
||||
<el-descriptions-item label="产出均重">{{ splitSummary.outAvgWeight }}t</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="消耗数量">{{ splitSummary.lossCount }}</el-descriptions-item>
|
||||
<el-descriptions-item label="消耗总重">{{ splitSummary.lossTotalWeight }}t</el-descriptions-item>
|
||||
<el-descriptions-item label="消耗均重">{{ splitSummary.lossAvgWeight }}t</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="数量差值">{{ splitSummary.countDiff }}</el-descriptions-item>
|
||||
<el-descriptions-item label="总重差值">{{ splitSummary.weightDiff }}t</el-descriptions-item>
|
||||
<el-descriptions-item label="均重差值">{{ splitSummary.avgWeightDiff }}t</el-descriptions-item>
|
||||
|
||||
<!-- 成品率 -->
|
||||
<el-descriptions-item label="成品率">{{ splitSummary.passRate }}</el-descriptions-item>
|
||||
<el-descriptions-item label="损耗率">{{ splitSummary.lossRate }}</el-descriptions-item>
|
||||
<!-- 异常率 -->
|
||||
<el-descriptions-item label="异常率">{{ splitSummary.abRate }}</el-descriptions-item>
|
||||
<!-- 正品率 -->
|
||||
<el-descriptions-item label="正品率">{{ splitSummary.passRate2 }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { calcSplitSummary } from "@/views/wms/report/js/calc";
|
||||
|
||||
export default {
|
||||
name: 'SplitSummary',
|
||||
props: {
|
||||
originOutputlist: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
originLossList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
commonCoilIds: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
splitSummary() {
|
||||
return calcSplitSummary(this.originOutputlist, this.originLossList, this.commonCoilIds)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@@ -118,7 +118,7 @@ export default {
|
||||
list: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 9999,
|
||||
pageSize: 99999,
|
||||
status: 1,
|
||||
dataType: 1,
|
||||
byExportTimeStart: startTime,
|
||||
@@ -170,7 +170,7 @@ export default {
|
||||
}).then(res => {
|
||||
this.list = res.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
const [thickness, width] = item.specification?.split('*') || []
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
|
||||
@@ -229,9 +229,76 @@ const calcMSummary = (list, lossList) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 处理分条信息的统计信息
|
||||
const calcSplitSummary = (originOutputlist, originLossList, commonCoilIds) => {
|
||||
// 1. 将commonCoilIds中的coilId的卷从originOutputlist和originLossList中剔除
|
||||
const list = originOutputlist.filter(item => !commonCoilIds.includes(item.coilId))
|
||||
const lossList = originLossList.filter(item => !commonCoilIds.includes(item.coilId))
|
||||
// 总钢卷数量、总重、均重
|
||||
const outCount = list.length
|
||||
const outTotalWeight = list.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错
|
||||
const outAvgWeight = outCount > 0 ? (outTotalWeight / outCount)?.toFixed(2) : 0
|
||||
|
||||
// 损失钢卷数量、总重、均重
|
||||
const lossCount = lossList.length
|
||||
const lossTotalWeight = lossList.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错
|
||||
const lossAvgWeight = lossCount > 0 ? (lossTotalWeight / lossCount)?.toFixed(2) : 0
|
||||
// 合计数量、总重、均重
|
||||
const totalCount = outCount + lossCount
|
||||
const totalWeight = parseFloat((outTotalWeight + lossTotalWeight).toFixed(2))
|
||||
const totalAvgWeight = totalCount > 0 ? (totalWeight / totalCount)?.toFixed(2) : 0
|
||||
|
||||
// 计算数量、总重、均重的插值
|
||||
const countDiff = Math.abs(outCount - lossCount)
|
||||
const weightDiff = Math.abs(parseFloat((outTotalWeight - lossTotalWeight).toFixed(2)))
|
||||
const avgWeightDiff = Math.abs(parseFloat((outAvgWeight - lossAvgWeight).toFixed(2)))
|
||||
|
||||
// 成品比率
|
||||
const passRate = outCount > 0 && lossTotalWeight > 0 ? (outTotalWeight / lossTotalWeight) : 0
|
||||
// 损失比率
|
||||
const lossRate = totalCount > 0 ? (1 - passRate) : 0
|
||||
// 异常率,成品在warehouseId在'2019583656787259393',
|
||||
// '2019583325311414274',
|
||||
// '2019583429955104769',
|
||||
// '2019583137616310273',这四个库中的占比
|
||||
const abStatus = ['O', 'C-', 'C+', 'C', 'D-', 'D+', 'D']
|
||||
const abRate = totalCount != 0 ? list.filter(item => {
|
||||
// 质量状态为O, C- , C+, C, D-, D+, D的钢卷也属于异常
|
||||
return (item.warehouseId == '2019583656787259393'
|
||||
|| item.warehouseId == '2019583325311414274'
|
||||
|| item.warehouseId == '2019583429955104769'
|
||||
|| item.warehouseId == '2019583137616310273'
|
||||
|| abStatus.includes(item.qualityStatus)
|
||||
)
|
||||
}).length / outCount : 0
|
||||
|
||||
// 正品率(1-异常率)
|
||||
const passRate2 = totalCount != 0 ? (1 - abRate) : 0
|
||||
|
||||
return {
|
||||
outCount,
|
||||
outTotalWeight: outTotalWeight.toFixed(2),
|
||||
outAvgWeight,
|
||||
lossCount,
|
||||
lossTotalWeight: lossTotalWeight.toFixed(2),
|
||||
lossAvgWeight,
|
||||
totalCount,
|
||||
totalWeight: totalWeight.toFixed(2),
|
||||
totalAvgWeight,
|
||||
countDiff,
|
||||
weightDiff,
|
||||
avgWeightDiff,
|
||||
passRate: (passRate * 100)?.toFixed(2) + '%',
|
||||
lossRate: (lossRate * 100)?.toFixed(2) + '%',
|
||||
abRate: (abRate * 100)?.toFixed(2) + '%' || 0,
|
||||
passRate2: (passRate2 * 100)?.toFixed(2) + '%' || 0,
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
calcSummary,
|
||||
calcAbSummary,
|
||||
calcTeamSummary,
|
||||
calcMSummary,
|
||||
calcSplitSummary
|
||||
}
|
||||
@@ -292,6 +292,11 @@ const defaultColumns = {
|
||||
prop: "bindPrincipal",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: '配卷事件',
|
||||
prop: 'bindDeliveryTime',
|
||||
align: 'center'
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export const dugeConfig = {
|
||||
actionTypes: [505, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'dugekuguan'
|
||||
createBys: 'dugekuguan'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'dugekuguan',
|
||||
@@ -19,7 +19,7 @@ export const dugeConfig = {
|
||||
export const lajiaoConfig = {
|
||||
actionTypes: [503, 120],
|
||||
actionQueryParams: {
|
||||
updateBy: 'lajiaokuguan'
|
||||
updateBys: 'lajiaokuguan'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'lajiaokuguan',
|
||||
@@ -37,7 +37,7 @@ export const lajiaoConfig = {
|
||||
export const shuangConfig = {
|
||||
actionTypes: [504, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'shuangkuguan'
|
||||
createBys: 'shuangkuguan'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'shuangkuguan',
|
||||
@@ -55,7 +55,7 @@ export const shuangConfig = {
|
||||
export const tuozhiConfig = {
|
||||
actionTypes: [502, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'tuozhikuguan'
|
||||
createBys: 'tuozhikuguan'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'tuozhikuguan',
|
||||
@@ -73,7 +73,7 @@ export const tuozhiConfig = {
|
||||
export const suanzhaConfig = {
|
||||
actionTypes: [11, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'suanzhakuguan'
|
||||
createBys: 'suanzhakuguan,yuanliaoku'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'suanzhakuguan',
|
||||
@@ -94,7 +94,7 @@ export const suanzhaConfig = {
|
||||
export const zincConfig = {
|
||||
actionTypes: [501, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'duxinkuguan'
|
||||
createBys: 'duxinkuguan'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'duxinkuguan',
|
||||
@@ -113,7 +113,7 @@ export const zincConfig = {
|
||||
export const splitConfig = {
|
||||
actionTypes: [506],
|
||||
actionQueryParams: {
|
||||
createBy: 'fenjiankuguan'
|
||||
createBys: 'fenjiankuguan'
|
||||
},
|
||||
baseQueryParams: {
|
||||
createBy: 'fenjiankuguan',
|
||||
|
||||
@@ -42,7 +42,7 @@ export async function fetchLossList(actionTypes, queryParams, callback) {
|
||||
return listPendingAction({
|
||||
actionStatus: 2,
|
||||
actionType,
|
||||
createBy: queryParams.createBy,
|
||||
createBys: queryParams.createBys,
|
||||
startTime: queryParams.byCreateTimeStart,
|
||||
endTime: queryParams.byCreateTimeEnd,
|
||||
pageSize: 99999,
|
||||
@@ -63,6 +63,7 @@ export async function fetchLossList(actionTypes, queryParams, callback) {
|
||||
...queryParams,
|
||||
byCreateTimeStart: undefined,
|
||||
byCreateTimeEnd: undefined,
|
||||
createBys: undefined,
|
||||
createBy: undefined,
|
||||
actionIds: actionIds,
|
||||
pageSize: 99999,
|
||||
|
||||
@@ -256,7 +256,7 @@ export default {
|
||||
]);
|
||||
this.lossList = lossRes.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
const [thickness, width] = item.specification?.split('*') || []
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
|
||||
@@ -186,7 +186,7 @@ export default {
|
||||
// actionStatus: 2,
|
||||
warehouseId: this.queryParams.planId,
|
||||
actionType: 401,
|
||||
pageSize: 9999,
|
||||
pageSize: 99999,
|
||||
pageNum: 1,
|
||||
startTime: this.queryParams.byCreateTimeStart,
|
||||
endTime: this.queryParams.byCreateTimeEnd,
|
||||
@@ -209,7 +209,7 @@ export default {
|
||||
}).then(res => {
|
||||
this.list = res.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
const [thickness, width] = item.specification?.split('*') || []
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
|
||||
@@ -1,15 +1,39 @@
|
||||
<template>
|
||||
<div class="app-container" v-loading="loading">
|
||||
<!-- 对日期的筛选另起一行 -->
|
||||
<div style="margin-bottom: 10px;">
|
||||
<!-- 单选按钮,用于切换视图,可以使用日视图、月视图、年视图、自定义, 默认使用自定义日期 -->
|
||||
<!-- 日视图时选择一天, 月视图时选择一个月, 年视图时选择一年, 自定义时选择自定义时间范围 -->
|
||||
<el-radio-group v-model="viewType" @change="handleViewTypeChange">
|
||||
<el-radio-button label="day">日视图</el-radio-button>
|
||||
<el-radio-button label="month">月视图</el-radio-button>
|
||||
<el-radio-button label="year">年视图</el-radio-button>
|
||||
<el-radio-button label="custom">自定义</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
<!-- 日视图日期选择器 -->
|
||||
<el-date-picker v-if="viewType === 'day'" style="width: 200px; margin-left: 10px;" v-model="dayDate" type="date"
|
||||
value-format="yyyy-MM-dd" placeholder="选择日期" @change="handleDayDateChange" />
|
||||
|
||||
<!-- 月视图日期选择器 -->
|
||||
<el-date-picker v-if="viewType === 'month'" style="width: 200px; margin-left: 10px;" v-model="monthDate"
|
||||
type="month" value-format="yyyy-MM" placeholder="选择月份" @change="handleMonthDateChange" />
|
||||
|
||||
<!-- 年视图日期选择器 -->
|
||||
<el-date-picker v-if="viewType === 'year'" style="width: 200px; margin-left: 10px;" v-model="yearDate" type="year"
|
||||
value-format="yyyy" placeholder="选择年份" @change="handleYearDateChange" />
|
||||
|
||||
<!-- 自定义日期选择器 -->
|
||||
<span v-if="viewType === 'custom'" style="margin-left: 10px;">
|
||||
<el-date-picker style="width: 200px;" v-model="queryParams.byCreateTimeStart"
|
||||
type="date" value-format="yyyy-MM-dd" placeholder="选择开始日期"></el-date-picker>
|
||||
至
|
||||
<el-date-picker style="width: 200px;" v-model="queryParams.byCreateTimeEnd"
|
||||
type="date" value-format="yyyy-MM-dd" placeholder="选择结束日期"></el-date-picker>
|
||||
</span>
|
||||
</div>
|
||||
<el-row>
|
||||
<el-form label-width="80px" inline>
|
||||
<el-form-item label="开始时间" prop="startDate">
|
||||
<el-date-picker style="width: 200px;" v-model="queryParams.byCreateTimeStart" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="选择开始日期" @change="handleDateChange"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="endDate">
|
||||
<el-date-picker style="width: 200px;" v-model="queryParams.byCreateTimeEnd" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="选择结束日期" @change="handleDateChange"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="入场钢卷号" prop="enterCoilNo">
|
||||
<el-input style="width: 200px; display: inline-block;" v-model="queryParams.enterCoilNo"
|
||||
placeholder="请输入入场钢卷号" clearable @keyup.enter.native="handleQuery" />
|
||||
@@ -36,7 +60,8 @@
|
||||
placeholder="请选择材质" clearable multiple />
|
||||
</el-form-item>
|
||||
<el-form-item label="厂家" prop="itemManufacturer">
|
||||
<dict-select style="width: 200px;" v-model="queryParams.itemManufacturer" dictType="coil_manufacturer" placeholder="请选择厂家" clearable multiple />
|
||||
<dict-select style="width: 200px;" v-model="queryParams.itemManufacturer" dictType="coil_manufacturer"
|
||||
placeholder="请选择厂家" clearable multiple />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleQuery">查询</el-button>
|
||||
@@ -50,26 +75,26 @@
|
||||
</el-row>
|
||||
|
||||
<el-descriptions title="统计信息" :column="3" border>
|
||||
<el-descriptions-item label="产出数量">{{ summary.outCount }}</el-descriptions-item>
|
||||
<el-descriptions-item label="产出总重">{{ summary.outTotalWeight }}t</el-descriptions-item>
|
||||
<el-descriptions-item label="产出均重">{{ summary.outAvgWeight }}t</el-descriptions-item>
|
||||
<el-descriptions-item label="产出数量">{{ summary.outCount }}<span v-if="viewType === 'day' && yesterdaySummary.outCount" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.outCount }})</span></el-descriptions-item>
|
||||
<el-descriptions-item label="产出总重">{{ summary.outTotalWeight }}t<span v-if="viewType === 'day' && yesterdaySummary.outTotalWeight" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.outTotalWeight }}t)</span></el-descriptions-item>
|
||||
<el-descriptions-item label="产出均重">{{ summary.outAvgWeight }}t<span v-if="viewType === 'day' && yesterdaySummary.outAvgWeight" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.outAvgWeight }}t)</span></el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="消耗数量">{{ summary.lossCount }}</el-descriptions-item>
|
||||
<el-descriptions-item label="消耗总重">{{ summary.lossTotalWeight }}t</el-descriptions-item>
|
||||
<el-descriptions-item label="消耗均重">{{ summary.lossAvgWeight }}t</el-descriptions-item>
|
||||
<el-descriptions-item label="消耗数量">{{ summary.lossCount }}<span v-if="viewType === 'day' && yesterdaySummary.lossCount" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.lossCount }})</span></el-descriptions-item>
|
||||
<el-descriptions-item label="消耗总重">{{ summary.lossTotalWeight }}t<span v-if="viewType === 'day' && yesterdaySummary.lossTotalWeight" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.lossTotalWeight }}t)</span></el-descriptions-item>
|
||||
<el-descriptions-item label="消耗均重">{{ summary.lossAvgWeight }}t<span v-if="viewType === 'day' && yesterdaySummary.lossAvgWeight" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.lossAvgWeight }}t)</span></el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="数量差值">{{ summary.countDiff }}</el-descriptions-item>
|
||||
<el-descriptions-item label="总重差值">{{ summary.weightDiff }}</el-descriptions-item>
|
||||
<el-descriptions-item label="均重差值">{{ summary.avgWeightDiff }}t</el-descriptions-item>
|
||||
<el-descriptions-item label="数量差值">{{ summary.countDiff }}<span v-if="viewType === 'day' && yesterdaySummary.countDiff" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.countDiff }})</span></el-descriptions-item>
|
||||
<el-descriptions-item label="总重差值">{{ summary.weightDiff }}<span v-if="viewType === 'day' && yesterdaySummary.weightDiff" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.weightDiff }})</span></el-descriptions-item>
|
||||
<el-descriptions-item label="均重差值">{{ summary.avgWeightDiff }}t<span v-if="viewType === 'day' && yesterdaySummary.avgWeightDiff" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.avgWeightDiff }}t)</span></el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="合计均重">{{ summary.totalAvgWeight }}t</el-descriptions-item> -->
|
||||
|
||||
<!-- 成品率 -->
|
||||
<el-descriptions-item label="成品率">{{ summary.passRate }}</el-descriptions-item>
|
||||
<el-descriptions-item label="损耗率">{{ summary.lossRate }}</el-descriptions-item>
|
||||
<el-descriptions-item label="成品率">{{ summary.passRate }}<span v-if="viewType === 'day' && yesterdaySummary.passRate" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.passRate }})</span></el-descriptions-item>
|
||||
<el-descriptions-item label="损耗率">{{ summary.lossRate }}<span v-if="viewType === 'day' && yesterdaySummary.lossRate" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.lossRate }})</span></el-descriptions-item>
|
||||
<!-- 异常率 -->
|
||||
<el-descriptions-item label="异常率">{{ summary.abRate }}</el-descriptions-item>
|
||||
<el-descriptions-item label="异常率">{{ summary.abRate }}<span v-if="viewType === 'day' && yesterdaySummary.abRate" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.abRate }})</span></el-descriptions-item>
|
||||
<!-- 正品率 -->
|
||||
<el-descriptions-item label="正品率">{{ summary.passRate2 }}</el-descriptions-item>
|
||||
<el-descriptions-item label="正品率">{{ summary.passRate2 }}<span v-if="viewType === 'day' && yesterdaySummary.passRate2" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.passRate2 }})</span></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<!-- 已处理M统计信息 -->
|
||||
@@ -100,14 +125,30 @@
|
||||
}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<!-- 月视图日数据折线图 -->
|
||||
<div v-if="viewType === 'month'" style="margin-top: 20px; height: 400px;">
|
||||
<el-card>
|
||||
<template slot="header">
|
||||
<div class="clearfix">
|
||||
<span>日数据趋势</span>
|
||||
</div>
|
||||
</template>
|
||||
<div ref="monthChart" style="width: 100%; height: 350px;"></div>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 分条信息统计 -->
|
||||
<split-summary v-if="productionLine == '分条线'" :origin-outputlist="list" :origin-loss-list="lossList"
|
||||
:common-coil-ids="commonCoilIds"></split-summary>
|
||||
|
||||
<el-descriptions title="明细信息" :column="3" border>
|
||||
</el-descriptions>
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="产出钢卷" name="output">
|
||||
<coil-table :columns="outputColumns" :data="list"></coil-table>
|
||||
<coil-table :columns="outputColumns" :data="list" :highlight-config="{ rows: commonCoilIds }"></coil-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="投入钢卷" name="loss">
|
||||
<coil-table :columns="lossColumns" :data="lossList"></coil-table>
|
||||
<coil-table :columns="lossColumns" :data="lossList" :highlight-config="{ rows: commonCoilIds }"></coil-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
@@ -135,7 +176,10 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { calcSummary, calcAbSummary, calcMSummary } from "@/views/wms/report/js/calc";
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
import SplitSummary from "@/views/wms/report/components/summary/splitSummary.vue";
|
||||
import { saveReportFile } from "@/views/wms/report/js/reportFile";
|
||||
import * as echarts from 'echarts';
|
||||
import { fetchLossList, fetchOutputList } from "@/views/wms/report/js/fetch";
|
||||
|
||||
export default {
|
||||
name: 'ComprehensiveTemplate',
|
||||
@@ -148,6 +192,7 @@ export default {
|
||||
WarehouseSelect,
|
||||
ColumnsSetting,
|
||||
CoilTable,
|
||||
SplitSummary,
|
||||
},
|
||||
props: {
|
||||
actionTypes: {
|
||||
@@ -226,6 +271,14 @@ export default {
|
||||
settingVisible: false,
|
||||
list: [],
|
||||
lossList: [],
|
||||
// 视图类型:day(日视图), month(月视图), year(年视图), custom(自定义)
|
||||
viewType: 'custom',
|
||||
// 日视图日期
|
||||
dayDate: currentDate.split('-').length === 3 ? currentDate : `${currentDate}-01`,
|
||||
// 月视图日期
|
||||
monthDate: currentDate,
|
||||
// 年视图日期
|
||||
yearDate: currentDate.split('-')[0],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 99999,
|
||||
@@ -258,6 +311,10 @@ export default {
|
||||
outputColumns: [],
|
||||
|
||||
actionIds: '',
|
||||
// 昨日数据
|
||||
yesterdaySummary: {},
|
||||
// 折线图实例
|
||||
monthChart: null,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -279,7 +336,28 @@ export default {
|
||||
},
|
||||
mSummary() {
|
||||
return calcMSummary(this.list, this.lossList)
|
||||
}
|
||||
},
|
||||
// 找出list和lossList中id相同的卷
|
||||
commonCoilIds() {
|
||||
if (this.productionLine !== '分条线') {
|
||||
return []
|
||||
}
|
||||
|
||||
// 获取list中的coilId集合
|
||||
const outputCoilIds = new Set(this.list.map(item => item.coilId))
|
||||
// 获取lossList中的coilId集合
|
||||
const lossCoilIds = new Set(this.lossList.map(item => item.coilId))
|
||||
|
||||
// 找出两个集合中相同的coilId
|
||||
const commonIds = []
|
||||
outputCoilIds.forEach(id => {
|
||||
if (lossCoilIds.has(id)) {
|
||||
commonIds.push(id)
|
||||
}
|
||||
})
|
||||
|
||||
return commonIds
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 加载列设置
|
||||
@@ -287,22 +365,108 @@ export default {
|
||||
this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || []
|
||||
this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || []
|
||||
},
|
||||
// 视图类型变更处理
|
||||
handleViewTypeChange() {
|
||||
switch (this.viewType) {
|
||||
case 'day':
|
||||
// 切换到日视图时,默认选中今天
|
||||
const today = new Date();
|
||||
const year = today.getFullYear();
|
||||
const month = String(today.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(today.getDate()).padStart(2, '0');
|
||||
this.dayDate = `${year}-${month}-${day}`;
|
||||
this.handleDayDateChange();
|
||||
break;
|
||||
case 'month':
|
||||
this.handleMonthDateChange();
|
||||
break;
|
||||
case 'year':
|
||||
this.handleYearDateChange();
|
||||
break;
|
||||
case 'custom':
|
||||
// 自定义视图保持当前日期范围
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 日视图日期变更处理
|
||||
handleDayDateChange() {
|
||||
if (this.dayDate) {
|
||||
const { start, end } = this.getDayTimeRange(this.dayDate);
|
||||
this.queryParams.byCreateTimeStart = start;
|
||||
this.queryParams.byCreateTimeEnd = end;
|
||||
this.handleQuery();
|
||||
}
|
||||
},
|
||||
// 月视图日期变更处理
|
||||
handleMonthDateChange() {
|
||||
if (this.monthDate) {
|
||||
const { start, end } = this.getDayTimeRange(this.monthDate);
|
||||
this.queryParams.byCreateTimeStart = start;
|
||||
this.queryParams.byCreateTimeEnd = end;
|
||||
this.handleQuery();
|
||||
}
|
||||
},
|
||||
// 年视图日期变更处理
|
||||
handleYearDateChange() {
|
||||
if (this.yearDate) {
|
||||
// 年视图:1月1日到12月31日
|
||||
this.queryParams.byCreateTimeStart = `${this.yearDate}-01-01 00:00:00`;
|
||||
this.queryParams.byCreateTimeEnd = `${this.yearDate}-12-31 23:59:59`;
|
||||
this.handleQuery();
|
||||
}
|
||||
},
|
||||
// 日期变更处理:更新开始/结束时间
|
||||
handleDateChange() {
|
||||
if (this.queryParams.startDate && this.queryParams.endDate) {
|
||||
this.queryParams.byCreateTimeStart = `${this.queryParams.startDate} 00:00:00`
|
||||
this.queryParams.byCreateTimeEnd = `${this.queryParams.endDate} 23:59:59`
|
||||
// 日期变更后自动查询
|
||||
this.handleQuery()
|
||||
if (this.viewType === 'custom') {
|
||||
// 自定义视图下,使用开始和结束日期
|
||||
if (this.queryParams.byCreateTimeStart && this.queryParams.byCreateTimeEnd) {
|
||||
// 确保时间格式正确
|
||||
if (!this.queryParams.byCreateTimeStart.includes(' ')) {
|
||||
this.queryParams.byCreateTimeStart = `${this.queryParams.byCreateTimeStart} 00:00:00`;
|
||||
}
|
||||
if (!this.queryParams.byCreateTimeEnd.includes(' ')) {
|
||||
this.queryParams.byCreateTimeEnd = `${this.queryParams.byCreateTimeEnd} 23:59:59`;
|
||||
}
|
||||
// 日期变更后自动查询
|
||||
this.handleQuery();
|
||||
}
|
||||
}
|
||||
},
|
||||
// 统一查询入口(兼容回车和按钮点击)
|
||||
handleQuery() {
|
||||
this.getList()
|
||||
},
|
||||
// 核心查询逻辑
|
||||
getList() {
|
||||
this.loading = true
|
||||
Promise.all([
|
||||
fetchLossList(this.actionTypes, {
|
||||
...this.queryParams,
|
||||
...this.actionQueryParams,
|
||||
}, (ids) => { this.actionIds = ids }),
|
||||
fetchOutputList({
|
||||
...this.queryParams,
|
||||
...this.baseQueryParams,
|
||||
warehouseIds: this.warehouseIds.join(','),
|
||||
}),
|
||||
]).then(([lossList, outputList]) => {
|
||||
this.lossList = lossList
|
||||
this.list = outputList
|
||||
if (this.viewType == 'day') {
|
||||
this.getYesterdayData()
|
||||
}
|
||||
if (this.viewType == 'month') {
|
||||
this.initMonthChart()
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 获取昨日数据
|
||||
getYesterdayData() {
|
||||
const yesterday = new Date(this.dayDate)
|
||||
yesterday.setDate(yesterday.getDate() - 1)
|
||||
const year = yesterday.getFullYear()
|
||||
const month = String(yesterday.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(yesterday.getDate()).padStart(2, '0')
|
||||
const yesterdayDate = `${year}-${month}-${day}`
|
||||
const { start, end } = this.getDayTimeRange(yesterdayDate)
|
||||
|
||||
Promise.all([
|
||||
listCoilWithIds({
|
||||
selectType: 'raw_material',
|
||||
@@ -310,6 +474,8 @@ export default {
|
||||
warehouseIds: this.warehouseIds.join(','),
|
||||
...this.queryParams,
|
||||
...this.baseQueryParams,
|
||||
byCreateTimeStart: start,
|
||||
byCreateTimeEnd: end,
|
||||
}),
|
||||
listCoilWithIds({
|
||||
selectType: 'product',
|
||||
@@ -317,68 +483,176 @@ export default {
|
||||
warehouseIds: this.warehouseIds.join(','),
|
||||
...this.queryParams,
|
||||
...this.baseQueryParams,
|
||||
byCreateTimeStart: start,
|
||||
byCreateTimeEnd: end,
|
||||
}),
|
||||
]).then((resList) => {
|
||||
console.log(resList)
|
||||
const list = resList.flatMap(res => res.rows)
|
||||
// 按照createTime 降序排序
|
||||
this.list = list.sort(
|
||||
const yesterdayList = list.sort(
|
||||
(a, b) => new Date(b.createTime) - new Date(a.createTime)
|
||||
).map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
computedWidth: parseFloat(width),
|
||||
// 确保每个项目都有 selectType 字段
|
||||
if (!item.selectType) {
|
||||
item.selectType = item.itemType === 'product' ? 'product' : 'raw_material'
|
||||
}
|
||||
return item
|
||||
})
|
||||
|
||||
// 获取昨日消耗数据
|
||||
Promise.all(this.actionTypes.map(actionType => {
|
||||
return listPendingAction({
|
||||
actionStatus: 2,
|
||||
warehouseId: this.queryParams.planId,
|
||||
actionType,
|
||||
pageSize: 99999,
|
||||
pageNum: 1,
|
||||
startTime: start,
|
||||
endTime: end,
|
||||
...this.actionQueryParams,
|
||||
})
|
||||
})).then((lossResList) => {
|
||||
const lossActions = lossResList.flatMap(item => item.rows)
|
||||
const lossCoilIds = lossActions.map(item => item.coilId).join(',')
|
||||
|
||||
if (lossCoilIds) {
|
||||
listCoilWithIds({
|
||||
...this.queryParams,
|
||||
byCreateTimeStart: undefined,
|
||||
byCreateTimeEnd: undefined,
|
||||
coilIds: lossCoilIds,
|
||||
}).then(res => {
|
||||
const yesterdayLossList = res.rows
|
||||
this.yesterdaySummary = calcSummary(yesterdayList, yesterdayLossList)
|
||||
})
|
||||
} else {
|
||||
this.yesterdaySummary = calcSummary(yesterdayList, [])
|
||||
}
|
||||
})
|
||||
this.getLossList()
|
||||
})
|
||||
},
|
||||
async getLossList() {
|
||||
this.loading = true
|
||||
const resultList = await Promise.all(this.actionTypes.map(actionType => {
|
||||
return listPendingAction({
|
||||
actionStatus: 2,
|
||||
warehouseId: this.queryParams.planId,
|
||||
actionType,
|
||||
pageSize: 99999,
|
||||
pageNum: 1,
|
||||
startTime: this.queryParams.byCreateTimeStart,
|
||||
endTime: this.queryParams.byCreateTimeEnd,
|
||||
...this.actionQueryParams,
|
||||
})
|
||||
}))
|
||||
const actions = resultList.flatMap(item => item.rows)
|
||||
this.actionIds = actions.map(item => item.actionId).join(',')
|
||||
const coilIds = actions.map(item => item.coilId).join(',')
|
||||
console.log(coilIds)
|
||||
if (!coilIds) {
|
||||
this.$message({
|
||||
message: '暂无数据',
|
||||
type: 'warning',
|
||||
})
|
||||
this.lossList = []
|
||||
this.loading = false
|
||||
return
|
||||
// 初始化月视图折线图
|
||||
initMonthChart() {
|
||||
if (!this.$refs.monthChart) return
|
||||
|
||||
// 销毁旧的图表实例
|
||||
if (this.monthChart) {
|
||||
this.monthChart.dispose()
|
||||
}
|
||||
listCoilWithIds({
|
||||
...this.queryParams,
|
||||
byCreateTimeStart: undefined,
|
||||
byCreateTimeEnd: undefined,
|
||||
coilIds: coilIds,
|
||||
}).then(res => {
|
||||
this.lossList = res.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
computedWidth: parseFloat(width),
|
||||
|
||||
// 创建新的图表实例
|
||||
this.monthChart = echarts.init(this.$refs.monthChart)
|
||||
|
||||
// 处理数据,按日期分组
|
||||
const dailyData = {}
|
||||
this.list.forEach(item => {
|
||||
const date = item.createTime.split(' ')[0]
|
||||
if (!dailyData[date]) {
|
||||
dailyData[date] = {
|
||||
outCount: 0,
|
||||
outTotalWeight: 0,
|
||||
lossCount: 0,
|
||||
lossTotalWeight: 0,
|
||||
}
|
||||
})
|
||||
this.loading = false
|
||||
}
|
||||
dailyData[date].outCount++
|
||||
dailyData[date].outTotalWeight += parseFloat(item.netWeight) || 0
|
||||
})
|
||||
|
||||
this.lossList.forEach(item => {
|
||||
const date = item.actionCompleteTime?.split(' ')[0]
|
||||
if (!dailyData[date]) {
|
||||
dailyData[date] = {
|
||||
outCount: 0,
|
||||
outTotalWeight: 0,
|
||||
lossCount: 0,
|
||||
lossTotalWeight: 0,
|
||||
}
|
||||
}
|
||||
dailyData[date].lossCount++
|
||||
dailyData[date].lossTotalWeight += parseFloat(item.netWeight) || 0
|
||||
})
|
||||
|
||||
// 生成日期数组和数据数组
|
||||
const dates = Object.keys(dailyData).sort()
|
||||
const outCountData = dates.map(date => dailyData[date].outCount)
|
||||
const outTotalWeightData = dates.map(date => dailyData[date].outTotalWeight.toFixed(2))
|
||||
const lossCountData = dates.map(date => dailyData[date].lossCount)
|
||||
const lossTotalWeightData = dates.map(date => dailyData[date].lossTotalWeight.toFixed(2))
|
||||
|
||||
// 配置项
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['产出数量', '产出总重', '消耗数量', '消耗总重']
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: dates
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '数量',
|
||||
position: 'left',
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '重量(t)',
|
||||
position: 'right',
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '产出数量',
|
||||
type: 'line',
|
||||
data: outCountData,
|
||||
yAxisIndex: 0,
|
||||
},
|
||||
{
|
||||
name: '产出总重',
|
||||
type: 'line',
|
||||
data: outTotalWeightData,
|
||||
yAxisIndex: 1,
|
||||
},
|
||||
{
|
||||
name: '消耗数量',
|
||||
type: 'line',
|
||||
data: lossCountData,
|
||||
yAxisIndex: 0,
|
||||
},
|
||||
{
|
||||
name: '消耗总重',
|
||||
type: 'line',
|
||||
data: lossTotalWeightData,
|
||||
yAxisIndex: 1,
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
// 应用配置项
|
||||
this.monthChart.setOption(option)
|
||||
|
||||
// 监听窗口大小变化
|
||||
window.addEventListener('resize', () => {
|
||||
this.monthChart.resize()
|
||||
})
|
||||
},
|
||||
// 导出
|
||||
@@ -387,18 +661,24 @@ export default {
|
||||
this.$message.warning('暂无数据可导出')
|
||||
return
|
||||
}
|
||||
// 格式化日期用于文件名
|
||||
const startDate = this.queryParams.byCreateTimeStart.split(' ')[0];
|
||||
const endDate = this.queryParams.byCreateTimeEnd.split(' ')[0];
|
||||
this.download('wms/materialCoil/export', {
|
||||
coilIds: this.list.map(item => item.coilId).join(',')
|
||||
}, `materialCoil_${this.queryParams.startDate}_${this.queryParams.endDate}_${new Date().getTime()}.xlsx`)
|
||||
}, `materialCoil_${startDate}_${endDate}_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
exportLossData() {
|
||||
if (this.lossList.length === 0) {
|
||||
this.$message.warning('暂无数据可导出')
|
||||
return
|
||||
}
|
||||
// 格式化日期用于文件名
|
||||
const startDate = this.queryParams.byCreateTimeStart.split(' ')[0];
|
||||
const endDate = this.queryParams.byCreateTimeEnd.split(' ')[0];
|
||||
this.download('wms/materialCoil/export', {
|
||||
coilIds: this.lossList.map(item => item.coilId).join(',')
|
||||
}, `materialCoil_${this.queryParams.startDate}_${this.queryParams.endDate}_${new Date().getTime()}.xlsx`)
|
||||
}, `materialCoil_${startDate}_${endDate}_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 保存产出报表
|
||||
saveOutputReport() {
|
||||
@@ -444,7 +724,7 @@ export default {
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
this.handleQuery()
|
||||
this.loadColumns()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<el-row>
|
||||
<el-form label-width="80px" inline>
|
||||
<el-form-item label="日期" prop="date">
|
||||
<el-date-picker style="width: 200px;" v-model="queryParams.date" type="date" value-format="yyyy-MM-dd"
|
||||
<el-date-picker style="width: 200px;" v-model="dayDate" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期" @change="handleDateChange"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="入场钢卷号" prop="enterCoilNo">
|
||||
@@ -47,26 +47,26 @@
|
||||
</el-row>
|
||||
|
||||
<el-descriptions title="统计信息" :column="3" border>
|
||||
<el-descriptions-item label="产出数量">{{ summary.outCount }}</el-descriptions-item>
|
||||
<el-descriptions-item label="产出总重">{{ summary.outTotalWeight }}t</el-descriptions-item>
|
||||
<el-descriptions-item label="产出均重">{{ summary.outAvgWeight }}t</el-descriptions-item>
|
||||
<el-descriptions-item label="产出数量">{{ summary.outCount }}<span v-if="yesterdaySummary.outCount" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.outCount }})</span></el-descriptions-item>
|
||||
<el-descriptions-item label="产出总重">{{ summary.outTotalWeight }}t<span v-if="yesterdaySummary.outTotalWeight" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.outTotalWeight }}t)</span></el-descriptions-item>
|
||||
<el-descriptions-item label="产出均重">{{ summary.outAvgWeight }}t<span v-if="yesterdaySummary.outAvgWeight" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.outAvgWeight }}t)</span></el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="消耗数量">{{ summary.lossCount }}</el-descriptions-item>
|
||||
<el-descriptions-item label="消耗总重">{{ summary.lossTotalWeight }}t</el-descriptions-item>
|
||||
<el-descriptions-item label="消耗均重">{{ summary.lossAvgWeight }}t</el-descriptions-item>
|
||||
<el-descriptions-item label="消耗数量">{{ summary.lossCount }}<span v-if="yesterdaySummary.lossCount" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.lossCount }})</span></el-descriptions-item>
|
||||
<el-descriptions-item label="消耗总重">{{ summary.lossTotalWeight }}t<span v-if="yesterdaySummary.lossTotalWeight" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.lossTotalWeight }}t)</span></el-descriptions-item>
|
||||
<el-descriptions-item label="消耗均重">{{ summary.lossAvgWeight }}t<span v-if="yesterdaySummary.lossAvgWeight" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.lossAvgWeight }}t)</span></el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="数量差值">{{ summary.countDiff }}</el-descriptions-item>
|
||||
<el-descriptions-item label="总重差值">{{ summary.weightDiff }}</el-descriptions-item>
|
||||
<el-descriptions-item label="均重差值">{{ summary.avgWeightDiff }}t</el-descriptions-item>
|
||||
<el-descriptions-item label="数量差值">{{ summary.countDiff }}<span v-if="yesterdaySummary.countDiff" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.countDiff }})</span></el-descriptions-item>
|
||||
<el-descriptions-item label="总重差值">{{ summary.weightDiff }}<span v-if="yesterdaySummary.weightDiff" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.weightDiff }})</span></el-descriptions-item>
|
||||
<el-descriptions-item label="均重差值">{{ summary.avgWeightDiff }}t<span v-if="yesterdaySummary.avgWeightDiff" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.avgWeightDiff }}t)</span></el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="合计均重">{{ summary.totalAvgWeight }}t</el-descriptions-item> -->
|
||||
|
||||
<!-- 成品率 -->
|
||||
<el-descriptions-item label="成品率">{{ summary.passRate }}</el-descriptions-item>
|
||||
<el-descriptions-item label="损耗率">{{ summary.lossRate }}</el-descriptions-item>
|
||||
<el-descriptions-item label="成品率">{{ summary.passRate }}<span v-if="yesterdaySummary.passRate" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.passRate }})</span></el-descriptions-item>
|
||||
<el-descriptions-item label="损耗率">{{ summary.lossRate }}<span v-if="yesterdaySummary.lossRate" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.lossRate }})</span></el-descriptions-item>
|
||||
<!-- 异常率 -->
|
||||
<el-descriptions-item label="异常率">{{ summary.abRate }}</el-descriptions-item>
|
||||
<el-descriptions-item label="异常率">{{ summary.abRate }}<span v-if="yesterdaySummary.abRate" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.abRate }})</span></el-descriptions-item>
|
||||
<!-- 正品率 -->
|
||||
<el-descriptions-item label="正品率">{{ summary.passRate2 }}</el-descriptions-item>
|
||||
<el-descriptions-item label="正品率">{{ summary.passRate2 }}<span v-if="yesterdaySummary.passRate2" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.passRate2 }})</span></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<!-- 已处理M统计信息 -->
|
||||
@@ -97,6 +97,9 @@
|
||||
}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<!-- 分条信息统计 -->
|
||||
<split-summary v-if="productionLine == '分条线'" :origin-outputlist="list" :origin-loss-list="lossList" :common-coil-ids="commonCoilIds"></split-summary>
|
||||
|
||||
<el-descriptions title="明细信息" :column="3" border>
|
||||
</el-descriptions>
|
||||
<el-tabs v-model="activeTab">
|
||||
@@ -119,6 +122,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listCoilWithIds } from "@/api/wms/coil";
|
||||
import {
|
||||
listPendingAction,
|
||||
} from '@/api/wms/pendingAction';
|
||||
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
|
||||
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
|
||||
import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
|
||||
@@ -128,6 +135,7 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { calcSummary, calcAbSummary, calcMSummary } from "@/views/wms/report/js/calc";
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
import SplitSummary from "@/views/wms/report/components/summary/splitSummary.vue";
|
||||
import { fetchLossList, fetchOutputList } from "@/views/wms/report/js/fetch";
|
||||
import { saveReportFile } from "@/views/wms/report/js/reportFile";
|
||||
|
||||
@@ -143,6 +151,7 @@ export default {
|
||||
WarehouseSelect,
|
||||
ColumnsSetting,
|
||||
CoilTable,
|
||||
SplitSummary,
|
||||
},
|
||||
props: {
|
||||
actionTypes: {
|
||||
@@ -175,13 +184,43 @@ export default {
|
||||
const now = new Date()
|
||||
const currentDate = `${now.getFullYear()}-${addZero(now.getMonth() + 1)}-${addZero(now.getDate())}`
|
||||
|
||||
// 生成指定日期的 00:00:00 和 23:59:59 时间字符串
|
||||
/**
|
||||
* 生成指定日期/月份的时间范围字符串
|
||||
* @param {string} dateStr - 支持格式:yyyy-MM(月份) 或 yyyy-MM-dd(具体日期)
|
||||
* @returns {object} 包含start(开始时间)和end(结束时间)的对象
|
||||
*/
|
||||
const getDayTimeRange = (dateStr) => {
|
||||
return {
|
||||
start: `${dateStr} 00:00:00`,
|
||||
end: `${dateStr} 23:59:59`
|
||||
// 先校验输入格式是否合法
|
||||
const monthPattern = /^\d{4}-\d{2}$/; // yyyy-MM 正则
|
||||
const dayPattern = /^\d{4}-\d{2}-\d{2}$/; // yyyy-MM-dd 正则
|
||||
|
||||
if (!monthPattern.test(dateStr) && !dayPattern.test(dateStr)) {
|
||||
throw new Error('输入格式错误,请传入 yyyy-MM 或 yyyy-MM-dd 格式的字符串');
|
||||
}
|
||||
}
|
||||
|
||||
let startDate, endDate;
|
||||
|
||||
if (monthPattern.test(dateStr)) {
|
||||
// 处理 yyyy-MM 格式:获取本月第一天和最后一天
|
||||
const [year, month] = dateStr.split('-').map(Number);
|
||||
// 月份是0基的(0=1月,1=2月...),所以要减1
|
||||
// 第一天:yyyy-MM-01
|
||||
startDate = `${dateStr}-01`;
|
||||
// 最后一天:通过 new Date(year, month, 0) 计算(month是原始月份,比如2代表2月,传2则取3月0日=2月最后一天)
|
||||
const lastDayOfMonth = new Date(year, month, 0).getDate();
|
||||
endDate = `${dateStr}-${lastDayOfMonth.toString().padStart(2, '0')}`;
|
||||
} else {
|
||||
// 处理 yyyy-MM-dd 格式:直接使用传入的日期
|
||||
startDate = dateStr;
|
||||
endDate = dateStr;
|
||||
}
|
||||
|
||||
// 拼接时间部分
|
||||
return {
|
||||
start: `${startDate} 00:00:00`,
|
||||
end: `${endDate} 23:59:59`
|
||||
};
|
||||
};
|
||||
|
||||
const { start, end } = getDayTimeRange(currentDate)
|
||||
|
||||
@@ -191,10 +230,11 @@ export default {
|
||||
settingVisible: false,
|
||||
list: [],
|
||||
lossList: [],
|
||||
// 日视图日期
|
||||
dayDate: currentDate,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 9999,
|
||||
// date: currentDate, // 绑定日期选择器的默认值(当天)
|
||||
byCreateTimeStart: start, // 默认当天0点
|
||||
byCreateTimeEnd: end, // 默认当天23:59:59
|
||||
enterCoilNo: '',
|
||||
@@ -221,6 +261,8 @@ export default {
|
||||
lossColumns: [],
|
||||
outputColumns: [],
|
||||
actionIds: '',
|
||||
// 昨日数据
|
||||
yesterdaySummary: {},
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -272,9 +314,9 @@ export default {
|
||||
this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || []
|
||||
},
|
||||
// 日期变更处理:更新开始/结束时间
|
||||
handleDateChange(date) {
|
||||
if (!date) return
|
||||
const { start, end } = this.getDayTimeRange(date)
|
||||
handleDateChange() {
|
||||
if (!this.dayDate) return
|
||||
const { start, end } = this.getDayTimeRange(this.dayDate)
|
||||
this.queryParams.byCreateTimeStart = start
|
||||
this.queryParams.byCreateTimeEnd = end
|
||||
// 日期变更后自动查询
|
||||
@@ -296,6 +338,7 @@ export default {
|
||||
]).then(([lossList, outputList]) => {
|
||||
this.lossList = lossList
|
||||
this.list = outputList
|
||||
this.getYesterdayData()
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
@@ -305,18 +348,98 @@ export default {
|
||||
this.$message.warning('暂无数据可导出')
|
||||
return
|
||||
}
|
||||
// 格式化日期用于文件名
|
||||
const startDate = this.queryParams.byCreateTimeStart.split(' ')[0];
|
||||
const endDate = this.queryParams.byCreateTimeEnd.split(' ')[0];
|
||||
this.download('wms/materialCoil/export', {
|
||||
coilIds: this.list.map(item => item.coilId).join(',')
|
||||
}, `materialCoil_${this.queryParams.date}_${new Date().getTime()}.xlsx`)
|
||||
}, `materialCoil_${startDate}_${endDate}_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
exportLossData() {
|
||||
if (this.lossList.length === 0) {
|
||||
this.$message.warning('暂无数据可导出')
|
||||
return
|
||||
}
|
||||
// 格式化日期用于文件名
|
||||
const startDate = this.queryParams.byCreateTimeStart.split(' ')[0];
|
||||
const endDate = this.queryParams.byCreateTimeEnd.split(' ')[0];
|
||||
this.download('wms/materialCoil/export', {
|
||||
actionIds: this.actionIds
|
||||
}, `materialCoil_${this.queryParams.date}_${new Date().getTime()}.xlsx`)
|
||||
}, `materialCoil_${startDate}_${endDate}_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 获取昨日数据
|
||||
getYesterdayData() {
|
||||
const yesterday = new Date(this.dayDate)
|
||||
yesterday.setDate(yesterday.getDate() - 1)
|
||||
const year = yesterday.getFullYear()
|
||||
const month = String(yesterday.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(yesterday.getDate()).padStart(2, '0')
|
||||
const yesterdayDate = `${year}-${month}-${day}`
|
||||
const { start, end } = this.getDayTimeRange(yesterdayDate)
|
||||
|
||||
Promise.all([
|
||||
listCoilWithIds({
|
||||
selectType: 'raw_material',
|
||||
itemType: 'raw_material',
|
||||
warehouseIds: this.warehouseIds.join(','),
|
||||
...this.queryParams,
|
||||
...this.baseQueryParams,
|
||||
byCreateTimeStart: start,
|
||||
byCreateTimeEnd: end,
|
||||
}),
|
||||
listCoilWithIds({
|
||||
selectType: 'product',
|
||||
itemType: 'product',
|
||||
warehouseIds: this.warehouseIds.join(','),
|
||||
...this.queryParams,
|
||||
...this.baseQueryParams,
|
||||
byCreateTimeStart: start,
|
||||
byCreateTimeEnd: end,
|
||||
}),
|
||||
]).then((resList) => {
|
||||
const list = resList.flatMap(res => res.rows)
|
||||
// 按照createTime 降序排序
|
||||
const yesterdayList = list.sort(
|
||||
(a, b) => new Date(b.createTime) - new Date(a.createTime)
|
||||
).map(item => {
|
||||
// 确保每个项目都有 selectType 字段
|
||||
if (!item.selectType) {
|
||||
item.selectType = item.itemType === 'product' ? 'product' : 'raw_material'
|
||||
}
|
||||
return item
|
||||
})
|
||||
|
||||
// 获取昨日消耗数据
|
||||
Promise.all(this.actionTypes.map(actionType => {
|
||||
return listPendingAction({
|
||||
actionStatus: 2,
|
||||
warehouseId: this.queryParams.planId,
|
||||
actionType,
|
||||
pageSize: 99999,
|
||||
pageNum: 1,
|
||||
startTime: start,
|
||||
endTime: end,
|
||||
...this.actionQueryParams,
|
||||
})
|
||||
})).then((lossResList) => {
|
||||
const lossActions = lossResList.flatMap(item => item.rows)
|
||||
const lossCoilIds = lossActions.map(item => item.coilId).join(',')
|
||||
|
||||
if (lossCoilIds) {
|
||||
listCoilWithIds({
|
||||
...this.queryParams,
|
||||
byCreateTimeStart: undefined,
|
||||
byCreateTimeEnd: undefined,
|
||||
coilIds: lossCoilIds,
|
||||
}).then(res => {
|
||||
const yesterdayLossList = res.rows
|
||||
this.yesterdaySummary = calcSummary(yesterdayList, yesterdayLossList)
|
||||
})
|
||||
} else {
|
||||
this.yesterdaySummary = calcSummary(yesterdayList, [])
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 保存产出报表
|
||||
saveOutputReport() {
|
||||
|
||||
@@ -68,10 +68,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listCoilWithIds } from "@/api/wms/coil";
|
||||
import {
|
||||
listPendingAction,
|
||||
} from '@/api/wms/pendingAction';
|
||||
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
|
||||
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
|
||||
import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
|
||||
|
||||
@@ -267,7 +267,7 @@ export default {
|
||||
});
|
||||
this.outList = outRes.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
const [thickness, width] = item.specification?.split('*') || []
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
|
||||
@@ -97,14 +97,29 @@
|
||||
}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<!-- 月视图日数据折线图 -->
|
||||
<div style="margin-top: 20px; height: 400px;">
|
||||
<el-card>
|
||||
<template slot="header">
|
||||
<div class="clearfix">
|
||||
<span>日数据趋势</span>
|
||||
</div>
|
||||
</template>
|
||||
<div ref="monthChart" style="width: 100%; height: 350px;"></div>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 分条信息统计 -->
|
||||
<split-summary v-if="productionLine == '分条线'" :origin-outputlist="list" :origin-loss-list="lossList" :common-coil-ids="commonCoilIds"></split-summary>
|
||||
|
||||
<el-descriptions title="明细信息" :column="3" border>
|
||||
</el-descriptions>
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="产出钢卷" name="output">
|
||||
<coil-table :columns="outputColumns" :data="list"></coil-table>
|
||||
<coil-table :columns="outputColumns" :data="list" :highlight-config="{ rows: commonCoilIds }"></coil-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="投入钢卷" name="loss">
|
||||
<coil-table :columns="lossColumns" :data="lossList"></coil-table>
|
||||
<coil-table :columns="lossColumns" :data="lossList" :highlight-config="{ rows: commonCoilIds }"></coil-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
@@ -132,8 +147,10 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { calcSummary, calcAbSummary, calcMSummary } from "@/views/wms/report/js/calc";
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
import SplitSummary from "@/views/wms/report/components/summary/splitSummary.vue";
|
||||
import { fetchLossList, fetchOutputList } from "@/views/wms/report/js/fetch";
|
||||
import { saveReportFile } from "@/views/wms/report/js/reportFile";
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
export default {
|
||||
name: 'MonthTemplate',
|
||||
@@ -146,6 +163,7 @@ export default {
|
||||
WarehouseSelect,
|
||||
ColumnsSetting,
|
||||
CoilTable,
|
||||
SplitSummary,
|
||||
},
|
||||
props: {
|
||||
actionTypes: {
|
||||
@@ -255,6 +273,8 @@ export default {
|
||||
outputColumns: [],
|
||||
|
||||
actionIds: '',
|
||||
// 折线图实例
|
||||
monthChart: null,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -276,7 +296,28 @@ export default {
|
||||
},
|
||||
mSummary() {
|
||||
return calcMSummary(this.list, this.lossList)
|
||||
}
|
||||
},
|
||||
// 找出list和lossList中id相同的卷
|
||||
commonCoilIds() {
|
||||
if (this.productionLine !== '分条线') {
|
||||
return []
|
||||
}
|
||||
|
||||
// 获取list中的coilId集合
|
||||
const outputCoilIds = new Set(this.list.map(item => item.coilId))
|
||||
// 获取lossList中的coilId集合
|
||||
const lossCoilIds = new Set(this.lossList.map(item => item.coilId))
|
||||
|
||||
// 找出两个集合中相同的coilId
|
||||
const commonIds = []
|
||||
outputCoilIds.forEach(id => {
|
||||
if (lossCoilIds.has(id)) {
|
||||
commonIds.push(id)
|
||||
}
|
||||
})
|
||||
|
||||
return commonIds
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 加载列设置
|
||||
@@ -374,9 +415,134 @@ export default {
|
||||
]).then(([lossList, outputList]) => {
|
||||
this.lossList = lossList
|
||||
this.list = outputList
|
||||
this.initMonthChart()
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 初始化月视图折线图
|
||||
initMonthChart() {
|
||||
if (!this.$refs.monthChart) return
|
||||
|
||||
// 销毁旧的图表实例
|
||||
if (this.monthChart) {
|
||||
this.monthChart.dispose()
|
||||
}
|
||||
|
||||
// 创建新的图表实例
|
||||
this.monthChart = echarts.init(this.$refs.monthChart)
|
||||
|
||||
// 处理数据,按日期分组
|
||||
const dailyData = {}
|
||||
this.list.forEach(item => {
|
||||
const date = item.createTime.split(' ')[0]
|
||||
if (!dailyData[date]) {
|
||||
dailyData[date] = {
|
||||
outCount: 0,
|
||||
outTotalWeight: 0,
|
||||
lossCount: 0,
|
||||
lossTotalWeight: 0,
|
||||
}
|
||||
}
|
||||
dailyData[date].outCount++
|
||||
dailyData[date].outTotalWeight += parseFloat(item.netWeight) || 0
|
||||
})
|
||||
|
||||
this.lossList.forEach(item => {
|
||||
const date = item.actionCompleteTime?.split(' ')[0]
|
||||
if (!dailyData[date]) {
|
||||
dailyData[date] = {
|
||||
outCount: 0,
|
||||
outTotalWeight: 0,
|
||||
lossCount: 0,
|
||||
lossTotalWeight: 0,
|
||||
}
|
||||
}
|
||||
dailyData[date].lossCount++
|
||||
dailyData[date].lossTotalWeight += parseFloat(item.netWeight) || 0
|
||||
})
|
||||
|
||||
// 生成日期数组和数据数组
|
||||
const dates = Object.keys(dailyData).sort()
|
||||
const outCountData = dates.map(date => dailyData[date].outCount)
|
||||
const outTotalWeightData = dates.map(date => dailyData[date].outTotalWeight.toFixed(2))
|
||||
const lossCountData = dates.map(date => dailyData[date].lossCount)
|
||||
const lossTotalWeightData = dates.map(date => dailyData[date].lossTotalWeight.toFixed(2))
|
||||
|
||||
// 配置项
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['产出数量', '产出总重', '消耗数量', '消耗总重']
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: dates
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '数量',
|
||||
position: 'left',
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '重量(t)',
|
||||
position: 'right',
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '产出数量',
|
||||
type: 'line',
|
||||
data: outCountData,
|
||||
yAxisIndex: 0,
|
||||
},
|
||||
{
|
||||
name: '产出总重',
|
||||
type: 'line',
|
||||
data: outTotalWeightData,
|
||||
yAxisIndex: 1,
|
||||
},
|
||||
{
|
||||
name: '消耗数量',
|
||||
type: 'line',
|
||||
data: lossCountData,
|
||||
yAxisIndex: 0,
|
||||
},
|
||||
{
|
||||
name: '消耗总重',
|
||||
type: 'line',
|
||||
data: lossTotalWeightData,
|
||||
yAxisIndex: 1,
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
// 应用配置项
|
||||
this.monthChart.setOption(option)
|
||||
|
||||
// 监听窗口大小变化
|
||||
window.addEventListener('resize', () => {
|
||||
this.monthChart.resize()
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.loadColumns()
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listCoilWithIds } from "@/api/wms/coil";
|
||||
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
|
||||
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
|
||||
import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
|
||||
|
||||
@@ -106,6 +106,9 @@
|
||||
}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<!-- 分条信息统计 -->
|
||||
<split-summary v-if="productionLine == '分条线'" :origin-outputlist="list" :origin-loss-list="lossList" :common-coil-ids="commonCoilIds"></split-summary>
|
||||
|
||||
<el-descriptions title="班组统计信息" :column="3" border>
|
||||
</el-descriptions>
|
||||
<el-table :data="teamSummary" border>
|
||||
@@ -118,10 +121,10 @@
|
||||
</el-descriptions>
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="产出钢卷" name="output">
|
||||
<coil-table :columns="outputColumns" :data="list"></coil-table>
|
||||
<coil-table :columns="outputColumns" :data="list" :highlight-config="{ rows: commonCoilIds }"></coil-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="投入钢卷" name="loss">
|
||||
<coil-table :columns="lossColumns" :data="lossList"></coil-table>
|
||||
<coil-table :columns="lossColumns" :data="lossList" :highlight-config="{ rows: commonCoilIds }"></coil-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
@@ -145,6 +148,7 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { calcSummary, calcAbSummary, calcTeamSummary, calcMSummary } from "@/views/wms/report/js/calc";
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
import SplitSummary from "@/views/wms/report/components/summary/splitSummary.vue";
|
||||
import { fetchLossList, fetchOutputList } from "@/views/wms/report/js/fetch";
|
||||
import { saveReportFile } from "@/views/wms/report/js/reportFile";
|
||||
|
||||
@@ -159,6 +163,7 @@ export default {
|
||||
WarehouseSelect,
|
||||
ColumnsSetting,
|
||||
CoilTable,
|
||||
SplitSummary,
|
||||
},
|
||||
props: {
|
||||
actionTypes: {
|
||||
@@ -273,7 +278,28 @@ export default {
|
||||
outWeight: formatWeight(outData.weight)
|
||||
};
|
||||
});
|
||||
}
|
||||
},
|
||||
// 找出list和lossList中id相同的卷
|
||||
commonCoilIds() {
|
||||
if (this.productionLine !== '分条线') {
|
||||
return [];
|
||||
}
|
||||
|
||||
// 获取list中的coilId集合
|
||||
const outputCoilIds = new Set(this.list.map(item => item.coilId));
|
||||
// 获取lossList中的coilId集合
|
||||
const lossCoilIds = new Set(this.lossList.map(item => item.coilId));
|
||||
|
||||
// 找出两个集合中相同的coilId
|
||||
const commonIds = [];
|
||||
outputCoilIds.forEach(id => {
|
||||
if (lossCoilIds.has(id)) {
|
||||
commonIds.push(id);
|
||||
}
|
||||
});
|
||||
|
||||
return commonIds;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 加载列设置
|
||||
|
||||
@@ -96,14 +96,17 @@
|
||||
}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<!-- 分条信息统计 -->
|
||||
<split-summary v-if="productionLine == '分条线'" :origin-outputlist="list" :origin-loss-list="lossList" :common-coil-ids="commonCoilIds"></split-summary>
|
||||
|
||||
<el-descriptions title="明细信息" :column="3" border>
|
||||
</el-descriptions>
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="产出钢卷" name="output">
|
||||
<coil-table :columns="outputColumns" :data="list"></coil-table>
|
||||
<coil-table :columns="outputColumns" :data="list" :highlight-config="{ rows: commonCoilIds }"></coil-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="投入钢卷" name="loss">
|
||||
<coil-table :columns="lossColumns" :data="lossList"></coil-table>
|
||||
<coil-table :columns="lossColumns" :data="lossList" :highlight-config="{ rows: commonCoilIds }"></coil-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
@@ -118,10 +121,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listCoilWithIds } from "@/api/wms/coil";
|
||||
import {
|
||||
listPendingAction,
|
||||
} from '@/api/wms/pendingAction';
|
||||
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
|
||||
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
|
||||
import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
|
||||
@@ -131,6 +130,7 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { calcSummary, calcAbSummary, calcMSummary } from "@/views/wms/report/js/calc";
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
import SplitSummary from "@/views/wms/report/components/summary/splitSummary.vue";
|
||||
import { fetchLossList, fetchOutputList } from "@/views/wms/report/js/fetch";
|
||||
import { saveReportFile } from "@/views/wms/report/js/reportFile";
|
||||
|
||||
@@ -145,6 +145,7 @@ export default {
|
||||
WarehouseSelect,
|
||||
ColumnsSetting,
|
||||
CoilTable,
|
||||
SplitSummary,
|
||||
},
|
||||
props: {
|
||||
actionTypes: {
|
||||
@@ -254,7 +255,28 @@ export default {
|
||||
},
|
||||
mSummary() {
|
||||
return calcMSummary(this.list, this.lossList)
|
||||
}
|
||||
},
|
||||
// 找出list和lossList中id相同的卷
|
||||
commonCoilIds() {
|
||||
if (this.productionLine !== '分条线') {
|
||||
return []
|
||||
}
|
||||
|
||||
// 获取list中的coilId集合
|
||||
const outputCoilIds = new Set(this.list.map(item => item.coilId))
|
||||
// 获取lossList中的coilId集合
|
||||
const lossCoilIds = new Set(this.lossList.map(item => item.coilId))
|
||||
|
||||
// 找出两个集合中相同的coilId
|
||||
const commonIds = []
|
||||
outputCoilIds.forEach(id => {
|
||||
if (lossCoilIds.has(id)) {
|
||||
commonIds.push(id)
|
||||
}
|
||||
})
|
||||
|
||||
return commonIds
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 加载列设置
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.klp.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.domain.vo.WmsAnnealOperateEventVo;
|
||||
import com.klp.domain.bo.WmsAnnealOperateEventBo;
|
||||
import com.klp.service.IWmsAnnealOperateEventService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 退火操作事件
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-16
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/wms/annealOperateEvent")
|
||||
public class WmsAnnealOperateEventController extends BaseController {
|
||||
|
||||
private final IWmsAnnealOperateEventService iWmsAnnealOperateEventService;
|
||||
|
||||
/**
|
||||
* 查询退火操作事件列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsAnnealOperateEventVo> list(WmsAnnealOperateEventBo bo, PageQuery pageQuery) {
|
||||
return iWmsAnnealOperateEventService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出退火操作事件列表
|
||||
*/
|
||||
@Log(title = "退火操作事件", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsAnnealOperateEventBo bo, HttpServletResponse response) {
|
||||
List<WmsAnnealOperateEventVo> list = iWmsAnnealOperateEventService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "退火操作事件", WmsAnnealOperateEventVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取退火操作事件详细信息
|
||||
*
|
||||
* @param eventId 主键
|
||||
*/
|
||||
@GetMapping("/{eventId}")
|
||||
public R<WmsAnnealOperateEventVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long eventId) {
|
||||
return R.ok(iWmsAnnealOperateEventService.queryById(eventId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增退火操作事件
|
||||
*/
|
||||
@Log(title = "退火操作事件", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsAnnealOperateEventBo bo) {
|
||||
return toAjax(iWmsAnnealOperateEventService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改退火操作事件
|
||||
*/
|
||||
@Log(title = "退火操作事件", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsAnnealOperateEventBo bo) {
|
||||
return toAjax(iWmsAnnealOperateEventService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除退火操作事件
|
||||
*
|
||||
* @param eventIds 主键串
|
||||
*/
|
||||
@Log(title = "退火操作事件", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{eventIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] eventIds) {
|
||||
return toAjax(iWmsAnnealOperateEventService.deleteWithValidByIds(Arrays.asList(eventIds), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.klp.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.domain.vo.WmsCoilContractRelVo;
|
||||
import com.klp.domain.bo.WmsCoilContractRelBo;
|
||||
import com.klp.service.IWmsCoilContractRelService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 钢卷与合同关联关系
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-18
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/wms/coilContractRel")
|
||||
public class WmsCoilContractRelController extends BaseController {
|
||||
|
||||
private final IWmsCoilContractRelService iWmsCoilContractRelService;
|
||||
|
||||
/**
|
||||
* 查询钢卷与合同关联关系列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsCoilContractRelVo> list(WmsCoilContractRelBo bo, PageQuery pageQuery) {
|
||||
return iWmsCoilContractRelService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出钢卷与合同关联关系列表
|
||||
*/
|
||||
@Log(title = "钢卷与合同关联关系", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsCoilContractRelBo bo, HttpServletResponse response) {
|
||||
List<WmsCoilContractRelVo> list = iWmsCoilContractRelService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "钢卷与合同关联关系", WmsCoilContractRelVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取钢卷与合同关联关系详细信息
|
||||
*
|
||||
* @param relId 主键
|
||||
*/
|
||||
@GetMapping("/{relId}")
|
||||
public R<WmsCoilContractRelVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long relId) {
|
||||
return R.ok(iWmsCoilContractRelService.queryById(relId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增钢卷与合同关联关系
|
||||
*/
|
||||
@Log(title = "钢卷与合同关联关系", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsCoilContractRelBo bo) {
|
||||
return toAjax(iWmsCoilContractRelService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改钢卷与合同关联关系
|
||||
*/
|
||||
@Log(title = "钢卷与合同关联关系", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsCoilContractRelBo bo) {
|
||||
return toAjax(iWmsCoilContractRelService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除钢卷与合同关联关系
|
||||
*
|
||||
* @param relIds 主键串
|
||||
*/
|
||||
@Log(title = "钢卷与合同关联关系", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{relIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] relIds) {
|
||||
return toAjax(iWmsCoilContractRelService.deleteWithValidByIds(Arrays.asList(relIds), true));
|
||||
}
|
||||
}
|
||||
@@ -134,8 +134,8 @@ public class WmsCoilPendingActionController extends BaseController {
|
||||
*/
|
||||
@Log(title = "钢卷待操作", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/complete/{actionId}")
|
||||
public R<Void> completeAction(@PathVariable("actionId") Long actionId) {
|
||||
return toAjax(iWmsCoilPendingActionService.completeAction(actionId));
|
||||
public R<Void> completeAction(@PathVariable("actionId") Long actionId, @RequestParam("newCoilIds") String newCoilIds) {
|
||||
return toAjax(iWmsCoilPendingActionService.completeAction(actionId, newCoilIds));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -68,6 +68,25 @@ public class WmsMaterialCoilController extends BaseController {
|
||||
return iWmsMaterialCoilService.queryPageListWithBindInfo(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询钢卷物料表列表(包含订单关联信息)
|
||||
* 前端调用此接口时,每个钢卷会携带其关联的订单列表(通过wms_coil_contract_rel中间表JOIN crm_order)
|
||||
* 注意:此接口比普通list多一次联表查询,仅在需要查看订单关联时使用
|
||||
*/
|
||||
@GetMapping("/listWithOrderRel")
|
||||
public TableDataInfo<WmsMaterialCoilVo> listWithOrderRel(WmsMaterialCoilBo bo, PageQuery pageQuery) {
|
||||
return iWmsMaterialCoilService.queryPageListWithOrderRel(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计筛选条件下的全量汇总数据
|
||||
* 独立的统计接口,使用与分页列表相同的查询条件
|
||||
*/
|
||||
@GetMapping("/statisticsList")
|
||||
public R<Map<String, java.math.BigDecimal>> getStatistics(WmsMaterialCoilBo bo) {
|
||||
return R.ok(iWmsMaterialCoilService.getStatistics(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 原料钢卷库位分布查询(先库位,再钢卷映射)
|
||||
*/
|
||||
@@ -224,8 +243,8 @@ public class WmsMaterialCoilController extends BaseController {
|
||||
@Log(title = "钢卷物料表", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsMaterialCoilBo bo) {
|
||||
return toAjax(iWmsMaterialCoilService.updateByBo(bo));
|
||||
public R<String> edit(@Validated(EditGroup.class) @RequestBody WmsMaterialCoilBo bo) {
|
||||
return R.ok(iWmsMaterialCoilService.updateByBo(bo, null));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -237,8 +256,8 @@ public class WmsMaterialCoilController extends BaseController {
|
||||
@Log(title = "钢卷物料表-合卷", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/merge")
|
||||
public R<Void> mergeCoils(@Validated(EditGroup.class) @RequestBody WmsMaterialCoilBo bo) {
|
||||
return toAjax(iWmsMaterialCoilService.mergeCoils(bo));
|
||||
public R<Long> mergeCoils(@Validated(EditGroup.class) @RequestBody WmsMaterialCoilBo bo) {
|
||||
return R.ok(iWmsMaterialCoilService.mergeCoils(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,6 +19,8 @@ import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import java.util.Map;
|
||||
|
||||
import com.klp.domain.vo.WmsProductVo;
|
||||
import com.klp.domain.bo.WmsProductBo;
|
||||
import com.klp.service.IWmsProductService;
|
||||
@@ -125,4 +127,14 @@ public class WmsProductController extends BaseController {
|
||||
public R<Void> addWithBom(@Validated(AddGroup.class) @RequestBody WmsProductBo bo) {
|
||||
return toAjax(iWmsProductService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新钢卷的itemId
|
||||
* 根据逻辑库区ID查询所有钢卷,然后根据itemType分别去产品表或原料表新增记录
|
||||
*/
|
||||
@Log(title = "批量更新钢卷itemId", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/batchUpdateCoilItem")
|
||||
public R<Map<String, Integer>> batchUpdateCoilItem(@RequestParam Long warehouseId, @RequestParam String newName) {
|
||||
return R.ok(iWmsProductService.batchUpdateCoilItemId(warehouseId, newName));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.klp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
|
||||
/**
|
||||
* 退火操作事件对象 wms_anneal_operate_event
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("wms_anneal_operate_event")
|
||||
public class WmsAnnealOperateEvent extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "event_id")
|
||||
private Long eventId;
|
||||
/**
|
||||
* 退火炉ID
|
||||
*/
|
||||
private Long annealFurnaceId;
|
||||
/**
|
||||
* 操作类型 如:START/PAUSE/STOP/FEED/TAKE/RESET
|
||||
*/
|
||||
private String operateType;
|
||||
/**
|
||||
* 操作内容描述
|
||||
*/
|
||||
private String operateContent;
|
||||
/**
|
||||
* 钢卷ID(可选)
|
||||
*/
|
||||
private Long coilId;
|
||||
/**
|
||||
* 删除标志(0=正常,1=已删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
45
klp-wms/src/main/java/com/klp/domain/WmsCoilContractRel.java
Normal file
45
klp-wms/src/main/java/com/klp/domain/WmsCoilContractRel.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package com.klp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
|
||||
/**
|
||||
* 钢卷与合同关联关系对象 wms_coil_contract_rel
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-18
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("wms_coil_contract_rel")
|
||||
public class WmsCoilContractRel extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "rel_id")
|
||||
private Long relId;
|
||||
/**
|
||||
* 钢卷ID
|
||||
*/
|
||||
private Long coilId;
|
||||
/**
|
||||
* 合同ID
|
||||
*/
|
||||
private Long contractId;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 删除标识 0正常 2删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
|
||||
}
|
||||
@@ -40,6 +40,10 @@ public class WmsWarehouse extends TreeEntity<WmsWarehouse> {
|
||||
* 同级排序号
|
||||
*/
|
||||
private Long sortNo;
|
||||
/**
|
||||
* 使用次数(用于排序:使用越多越靠前)
|
||||
*/
|
||||
private Integer useCount;
|
||||
/**
|
||||
* 是否启用(0=否,1=是)
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.klp.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
|
||||
/**
|
||||
* 退火操作事件业务对象 wms_anneal_operate_event
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-16
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class WmsAnnealOperateEventBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long eventId;
|
||||
|
||||
/**
|
||||
* 退火炉ID
|
||||
*/
|
||||
private Long annealFurnaceId;
|
||||
|
||||
/**
|
||||
* 操作类型 如:START/PAUSE/STOP/FEED/TAKE/RESET
|
||||
*/
|
||||
private String operateType;
|
||||
|
||||
/**
|
||||
* 操作内容描述
|
||||
*/
|
||||
private String operateContent;
|
||||
|
||||
/**
|
||||
* 钢卷ID(可选)
|
||||
*/
|
||||
private Long coilId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.klp.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
|
||||
/**
|
||||
* 钢卷与合同关联关系业务对象 wms_coil_contract_rel
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-18
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class WmsCoilContractRelBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long relId;
|
||||
|
||||
/**
|
||||
* 钢卷ID
|
||||
*/
|
||||
private Long coilId;
|
||||
|
||||
/**
|
||||
* 合同ID
|
||||
*/
|
||||
private Long contractId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -126,5 +126,7 @@ public class WmsCoilPendingActionBo extends BaseEntity {
|
||||
|
||||
// 钢卷ID列表(逗号分隔)
|
||||
private String coilIds;
|
||||
|
||||
private String createBys;
|
||||
}
|
||||
|
||||
|
||||
@@ -351,5 +351,14 @@ public class WmsMaterialCoilBo extends BaseEntity {
|
||||
* 调拨类型
|
||||
*/
|
||||
private String transferType;
|
||||
|
||||
//根据逗号分割的创建人筛选
|
||||
private String createBys;
|
||||
|
||||
/**
|
||||
* 是否查询调拨类型不为空的钢卷
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Boolean hasTransferType;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,11 @@ public class WmsWarehouseBo extends TreeEntity<WmsWarehouseBo> {
|
||||
*/
|
||||
private Long sortNo;
|
||||
|
||||
/**
|
||||
* 使用次数(用于排序:使用越多越靠前)
|
||||
*/
|
||||
private Integer useCount;
|
||||
|
||||
/**
|
||||
* 是否启用(0=否,1=是)
|
||||
*/
|
||||
@@ -57,5 +62,10 @@ public class WmsWarehouseBo extends TreeEntity<WmsWarehouseBo> {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 是否按使用次数排序(true=按useCount降序,false或不传=按sortNo升序)
|
||||
*/
|
||||
private Boolean orderByUseCount;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 退火操作事件视图对象 wms_anneal_operate_event
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-16
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WmsAnnealOperateEventVo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long eventId;
|
||||
|
||||
/**
|
||||
* 退火炉ID
|
||||
*/
|
||||
@ExcelProperty(value = "退火炉ID")
|
||||
private Long annealFurnaceId;
|
||||
|
||||
/**
|
||||
* 操作类型 如:START/PAUSE/STOP/FEED/TAKE/RESET
|
||||
*/
|
||||
@ExcelProperty(value = "操作类型 如:START/PAUSE/STOP/FEED/TAKE/RESET")
|
||||
private String operateType;
|
||||
|
||||
/**
|
||||
* 操作内容描述
|
||||
*/
|
||||
@ExcelProperty(value = "操作内容描述")
|
||||
private String operateContent;
|
||||
|
||||
/**
|
||||
* 钢卷ID(可选)
|
||||
*/
|
||||
@ExcelProperty(value = "钢卷ID(可选)")
|
||||
private Long coilId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 钢卷与合同(订单)关联关系视图对象 wms_coil_contract_rel + crm_order JOIN
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-18
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WmsCoilContractRelVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// ========== 中间表自身字段 ==========
|
||||
|
||||
/** 主键ID */
|
||||
private Long relId;
|
||||
/** 钢卷ID */
|
||||
@ExcelProperty(value = "钢卷ID")
|
||||
private Long coilId;
|
||||
/** 合同/订单ID */
|
||||
@ExcelProperty(value = "合同/订单ID")
|
||||
private Long contractId;
|
||||
/** 备注 */
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
// ========== 关联订单信息(JOIN crm_order)==========
|
||||
|
||||
/** 订单ID(主键) */
|
||||
private Long orderId;
|
||||
/** 订单编号 */
|
||||
private String orderCode;
|
||||
/** 订单类型:pre-预订单,formal-正式订单 */
|
||||
private Long orderType;
|
||||
/** 关联客户ID */
|
||||
private String customerId;
|
||||
/** 订单总金额 */
|
||||
private BigDecimal orderAmount;
|
||||
/** 销售员 */
|
||||
private String salesman;
|
||||
/** 交货日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date deliveryDate;
|
||||
/** 预订单状态 */
|
||||
private Long preOrderStatus;
|
||||
/** 审核人 */
|
||||
private String auditUser;
|
||||
/** 审核时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date auditTime;
|
||||
/** 订单状态 */
|
||||
private Long orderStatus;
|
||||
/** 财务状态 */
|
||||
private Long financeStatus;
|
||||
/** 未结款数额 */
|
||||
private BigDecimal unpaidAmount;
|
||||
/** 备注 */
|
||||
private String orderRemark;
|
||||
/** 合同号 */
|
||||
private String contractCode;
|
||||
/** 合同名称 */
|
||||
private String contractName;
|
||||
/** 供方 */
|
||||
private String supplier;
|
||||
/** 需方 */
|
||||
private String customer;
|
||||
/** 签订时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date signTime;
|
||||
/** 签订地点 */
|
||||
private String signLocation;
|
||||
/** 产品内容 */
|
||||
private String productContent;
|
||||
/** 合同内容 */
|
||||
private String contractContent;
|
||||
/** 供方地址 */
|
||||
private String supplierAddress;
|
||||
/** 供方电话 */
|
||||
private String supplierPhone;
|
||||
/** 供方开户行 */
|
||||
private String supplierBank;
|
||||
/** 供方账号 */
|
||||
private String supplierAccount;
|
||||
/** 供方税号 */
|
||||
private String supplierTaxNo;
|
||||
/** 需方地址 */
|
||||
private String customerAddress;
|
||||
/** 需方电话 */
|
||||
private String customerPhone;
|
||||
/** 需方开户行 */
|
||||
private String customerBank;
|
||||
/** 需方账号 */
|
||||
private String customerAccount;
|
||||
/** 需方税号 */
|
||||
private String customerTaxNo;
|
||||
/** 技术附件 */
|
||||
private String techAnnex;
|
||||
/** 商务附件 */
|
||||
private String businessAnnex;
|
||||
/** 排产函 */
|
||||
private String productionSchedule;
|
||||
/** 算单价备注 */
|
||||
private String unitPriceRemark;
|
||||
/** 应付定金(万元) */
|
||||
private BigDecimal depositPayable;
|
||||
/** 已付定金(万元) */
|
||||
private BigDecimal depositPaid;
|
||||
/** 定金比例(%) */
|
||||
private BigDecimal depositRatio;
|
||||
/** 合同状态 0=草稿 1=生效 2=作废 3=已完成 */
|
||||
private Long status;
|
||||
/** 关联合同ID */
|
||||
private Long orderIdInOrder; // crm_order.contract_id,与contractId可能不同
|
||||
/** 附件 */
|
||||
private String annexFiles;
|
||||
/** 创建人 */
|
||||
private String createBy;
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
/** 更新人 */
|
||||
private String updateBy;
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
@@ -76,9 +76,9 @@ public class WmsDeliveryWaybillDetailVo extends BaseEntity {
|
||||
private String senderUnit;
|
||||
|
||||
/**
|
||||
* 发货时间
|
||||
* 配卷时间
|
||||
*/
|
||||
@ExcelProperty(value = "发货时间")
|
||||
@ExcelProperty(value = "配卷时间")
|
||||
private Date deliveryTime;
|
||||
|
||||
/**
|
||||
@@ -129,6 +129,10 @@ public class WmsDeliveryWaybillDetailVo extends BaseEntity {
|
||||
@ExcelProperty(value = "当前钢卷号")
|
||||
private String currentCoilNo;
|
||||
|
||||
// 实际发货时间
|
||||
@ExcelProperty(value = "实际发货时间")
|
||||
private Date exportTime;
|
||||
|
||||
// 实际库区
|
||||
@ExcelProperty(value = "实际库区")
|
||||
private String actualWarehouseName;
|
||||
|
||||
@@ -54,7 +54,7 @@ public class WmsMaterialCoilDeliveryExportVo extends WmsMaterialCoilExportVo {
|
||||
@ExcelProperty(value = "发货单位")
|
||||
private String senderUnit;
|
||||
|
||||
@ExcelProperty(value = "发货时间")
|
||||
@ExcelProperty(value = "配卷时间")
|
||||
private Date deliveryTime;
|
||||
|
||||
@ExcelProperty(value = "磅房")
|
||||
|
||||
@@ -329,5 +329,10 @@ public class WmsMaterialCoilVo extends BaseEntity {
|
||||
* 调拨类型
|
||||
*/
|
||||
private String transferType;
|
||||
|
||||
/**
|
||||
* 关联的订单列表(通过wms_coil_contract_rel中间表JOIN crm_order)
|
||||
*/
|
||||
private List<com.klp.domain.vo.WmsCoilContractRelVo> orderList;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user