瀏覽代碼

修改统计图表、调整老库存表单及接口、外协订单详情页

xuezizhuo 11 月之前
父節點
當前提交
f073b5f815

+ 509 - 1
zkqy-custom-business/src/main/java/com/zkqy/business/domain/ProductInventory.java

@@ -137,7 +137,18 @@ public class ProductInventory extends BaseEntity
     /** 产品色泽 */
     private String productColour;
 
-    public void setId(Long id) 
+    /** 库存类型 */
+    private String inventoryType;
+
+    public String getInventoryType() {
+        return inventoryType;
+    }
+
+    public void setInventoryType(String inventoryType) {
+        this.inventoryType = inventoryType;
+    }
+
+    public void setId(Long id)
     {
         this.id = id;
     }
@@ -457,3 +468,500 @@ public class ProductInventory extends BaseEntity
             .toString();
     }
 }
+
+//老库存导入
+//
+//public class ProductInventory extends BaseEntity
+//{
+//    private static final long serialVersionUID = 1L;
+//
+//    /** 编号 */
+//    private Long id;
+//
+//    /** 码单号 */
+//    @Excel(name = "码单号")
+//    private String qrCode;
+//
+//    @Excel(name = "类型")
+//    private String productType;
+//
+//    @Excel(name = "品名")
+//    private String productName;
+//
+//    @Excel(name = "规格")
+//    private String specifications;
+//
+//    /** 产品色泽 */
+//    @Excel(name = "色泽")
+//    private String productColour;
+//
+//    /** 批号 */
+//    @Excel(name = "批号")
+//    private String lotNum;
+//
+//    /** 等级 */
+//    @Excel(name = "等级")
+//    private String levels;
+//
+//    /** 合计筒数 */
+//    @Excel(name = "筒数")
+//    private Integer totalCanisterNum;
+//
+//    /** 合计箱数 */
+//    @Excel(name = "箱数")
+//    private Integer totalBoxNum;
+//
+//    /** 合计净重 */
+//    @Excel(name = "重量")
+//    private Double totalSuttle;
+//
+//
+//
+//    /** 货品编号 */
+////    @Excel(name = "货品编号")
+//    private Long productId;
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//    /** 筒数 */
+////    @Excel(name = "筒数")
+//    private Integer canisterNum;
+//
+//    /** 箱数 */
+////    @Excel(name = "箱数")
+//    private Integer boxNum;
+//
+//    /** 净重 */
+////    @Excel(name = "净重")
+//    private Double suttle;
+//
+//    /** 生产日期 */
+//    @JsonFormat(pattern = "yyyy-MM-dd")
+////    @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd")
+//    private Date productionDate;
+//
+//    /** 仓库编号 */
+////    @Excel(name = "仓库编号")
+//    private Long warehouseId;
+//
+//    /** 机台 */
+////    @Excel(name = "机台")
+//    private Long machineTool;
+//
+//    /** 毛重 */
+////    @Excel(name = "毛重")
+//    private Double grossWeight;
+//
+//    /** 包装 */
+////    @Excel(name = "包装")
+//    private String packaging;
+//
+//    /** 班次 */
+////    @Excel(name = "班次")
+//    private String workShifts;
+//
+//    /** 外贸号 */
+////    @Excel(name = "外贸号")
+//    private String foreignTradeNumber;
+//
+//    /** 筒重 */
+////    @Excel(name = "筒重")
+//    private Double canisterWeight;
+//
+//    /** 箱重 */
+////    @Excel(name = "箱重")
+//    private Double boxWeight;
+//
+//    /** 管色 */
+////    @Excel(name = "管色")
+//    private String tubeColor;
+//
+//    /** 端口(usb端口号) */
+////    @Excel(name = "端口", readConverterExp = "u=sb端口号")
+//    private String comPort;
+//
+//    /** 打印格式(打印二维码格式) */
+////    @Excel(name = "打印格式", readConverterExp = "打=印二维码格式")
+//    private String printFormat;
+//
+//    /** 包装类型(暂未使用) */
+////    @Excel(name = "包装类型", readConverterExp = "暂=未使用")
+//    private String packagingType;
+//
+//    /** 库位(暂未使用) */
+////    @Excel(name = "库位", readConverterExp = "暂=未使用")
+//    private String storageLocation;
+//
+//    /** 区域编号(暂未使用) */
+////    @Excel(name = "区域编号", readConverterExp = "暂=未使用")
+//    private Long warehouseregionId;
+//
+//    /** 删除标志(0:否;2:是) */
+//    private String delFlag;
+//
+//    /** 创建者编号 */
+//    private Long createById;
+//
+//    /** 更新者编号 */
+//    private Long updateById;
+//
+//
+//
+//
+//
+//    /** 合计毛重 */
+////    @Excel(name = "合计毛重")
+//    private Double totalGrossWeight;
+//
+//
+//
+//    public String getProductName() {
+//        return productName;
+//    }
+//
+//    public void setProductName(String productName) {
+//        this.productName = productName;
+//    }
+//
+//    public String getSpecifications() {
+//        return specifications;
+//    }
+//
+//    public void setSpecifications(String specifications) {
+//        this.specifications = specifications;
+//    }
+//
+//    public String getProductType() {
+//        return productType;
+//    }
+//
+//    public void setProductType(String productType) {
+//        this.productType = productType;
+//    }
+//
+//    public void setId(Long id)
+//    {
+//        this.id = id;
+//    }
+//
+//    public Long getId()
+//    {
+//        return id;
+//    }
+//    public void setQrCode(String qrCode)
+//    {
+//        this.qrCode = qrCode;
+//    }
+//
+//    public String getQrCode()
+//    {
+//        return qrCode;
+//    }
+//    public void setLotNum(String lotNum)
+//    {
+//        this.lotNum = lotNum;
+//    }
+//
+//    public String getLotNum()
+//    {
+//        return lotNum;
+//    }
+//    public void setProductId(Long productId)
+//    {
+//        this.productId = productId;
+//    }
+//
+//    public Long getProductId()
+//    {
+//        return productId;
+//    }
+//    public void setLevels(String levels)
+//    {
+//        this.levels = levels;
+//    }
+//
+//    public String getLevels()
+//    {
+//        return levels;
+//    }
+//    public void setCanisterNum(Integer canisterNum)
+//    {
+//        this.canisterNum = canisterNum;
+//    }
+//
+//    public Integer getCanisterNum()
+//    {
+//        return canisterNum;
+//    }
+//    public void setBoxNum(Integer boxNum)
+//    {
+//        this.boxNum = boxNum;
+//    }
+//
+//    public Integer getBoxNum()
+//    {
+//        return boxNum;
+//    }
+//    public void setSuttle(Double suttle)
+//    {
+//        this.suttle = suttle;
+//    }
+//
+//    public Double getSuttle()
+//    {
+//        return suttle;
+//    }
+//    public void setProductionDate(Date productionDate)
+//    {
+//        this.productionDate = productionDate;
+//    }
+//
+//    public Date getProductionDate()
+//    {
+//        return productionDate;
+//    }
+//    public void setWarehouseId(Long warehouseId)
+//    {
+//        this.warehouseId = warehouseId;
+//    }
+//
+//    public Long getWarehouseId()
+//    {
+//        return warehouseId;
+//    }
+//    public void setMachineTool(Long machineTool)
+//    {
+//        this.machineTool = machineTool;
+//    }
+//
+//    public Long getMachineTool()
+//    {
+//        return machineTool;
+//    }
+//    public void setGrossWeight(Double grossWeight)
+//    {
+//        this.grossWeight = grossWeight;
+//    }
+//
+//    public Double getGrossWeight()
+//    {
+//        return grossWeight;
+//    }
+//    public void setPackaging(String packaging)
+//    {
+//        this.packaging = packaging;
+//    }
+//
+//    public String getPackaging()
+//    {
+//        return packaging;
+//    }
+//    public void setWorkShifts(String workShifts)
+//    {
+//        this.workShifts = workShifts;
+//    }
+//
+//    public String getWorkShifts()
+//    {
+//        return workShifts;
+//    }
+//    public void setForeignTradeNumber(String foreignTradeNumber)
+//    {
+//        this.foreignTradeNumber = foreignTradeNumber;
+//    }
+//
+//    public String getForeignTradeNumber()
+//    {
+//        return foreignTradeNumber;
+//    }
+//    public void setCanisterWeight(Double canisterWeight)
+//    {
+//        this.canisterWeight = canisterWeight;
+//    }
+//
+//    public Double getCanisterWeight()
+//    {
+//        return canisterWeight;
+//    }
+//    public void setBoxWeight(Double boxWeight)
+//    {
+//        this.boxWeight = boxWeight;
+//    }
+//
+//    public Double getBoxWeight()
+//    {
+//        return boxWeight;
+//    }
+//    public void setTubeColor(String tubeColor)
+//    {
+//        this.tubeColor = tubeColor;
+//    }
+//
+//    public String getTubeColor()
+//    {
+//        return tubeColor;
+//    }
+//    public void setComPort(String comPort)
+//    {
+//        this.comPort = comPort;
+//    }
+//
+//    public String getComPort()
+//    {
+//        return comPort;
+//    }
+//    public void setPrintFormat(String printFormat)
+//    {
+//        this.printFormat = printFormat;
+//    }
+//
+//    public String getPrintFormat()
+//    {
+//        return printFormat;
+//    }
+//    public void setPackagingType(String packagingType)
+//    {
+//        this.packagingType = packagingType;
+//    }
+//
+//    public String getPackagingType()
+//    {
+//        return packagingType;
+//    }
+//    public void setStorageLocation(String storageLocation)
+//    {
+//        this.storageLocation = storageLocation;
+//    }
+//
+//    public String getStorageLocation()
+//    {
+//        return storageLocation;
+//    }
+//    public void setWarehouseregionId(Long warehouseregionId)
+//    {
+//        this.warehouseregionId = warehouseregionId;
+//    }
+//
+//    public Long getWarehouseregionId()
+//    {
+//        return warehouseregionId;
+//    }
+//    public void setDelFlag(String delFlag)
+//    {
+//        this.delFlag = delFlag;
+//    }
+//
+//    public String getDelFlag()
+//    {
+//        return delFlag;
+//    }
+//    public void setCreateById(Long createById)
+//    {
+//        this.createById = createById;
+//    }
+//
+//    public Long getCreateById()
+//    {
+//        return createById;
+//    }
+//    public void setUpdateById(Long updateById)
+//    {
+//        this.updateById = updateById;
+//    }
+//
+//    public Long getUpdateById()
+//    {
+//        return updateById;
+//    }
+//    public void setTotalCanisterNum(Integer totalCanisterNum)
+//    {
+//        this.totalCanisterNum = totalCanisterNum;
+//    }
+//
+//    public Integer getTotalCanisterNum()
+//    {
+//        return totalCanisterNum;
+//    }
+//    public void setTotalBoxNum(Integer totalBoxNum)
+//    {
+//        this.totalBoxNum = totalBoxNum;
+//    }
+//
+//    public Integer getTotalBoxNum()
+//    {
+//        return totalBoxNum;
+//    }
+//    public void setTotalSuttle(Double totalSuttle)
+//    {
+//        this.totalSuttle = totalSuttle;
+//    }
+//
+//    public Double getTotalSuttle()
+//    {
+//        return totalSuttle;
+//    }
+//    public void setTotalGrossWeight(Double totalGrossWeight)
+//    {
+//        this.totalGrossWeight = totalGrossWeight;
+//    }
+//
+//    public Double getTotalGrossWeight()
+//    {
+//        return totalGrossWeight;
+//    }
+//
+//    public String getProductColour() {
+//        return productColour;
+//    }
+//
+//    public void setProductColour(String productColour) {
+//        this.productColour = productColour;
+//    }
+//
+//    @Override
+//    public String toString() {
+//        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+//                .append("id", getId())
+//                .append("qrCode", getQrCode())
+//                .append("lotNum", getLotNum())
+//                .append("productId", getProductId())
+//                .append("levels", getLevels())
+//                .append("canisterNum", getCanisterNum())
+//                .append("boxNum", getBoxNum())
+//                .append("suttle", getSuttle())
+//                .append("productionDate", getProductionDate())
+//                .append("warehouseId", getWarehouseId())
+//                .append("machineTool", getMachineTool())
+//                .append("grossWeight", getGrossWeight())
+//                .append("packaging", getPackaging())
+//                .append("workShifts", getWorkShifts())
+//                .append("foreignTradeNumber", getForeignTradeNumber())
+//                .append("canisterWeight", getCanisterWeight())
+//                .append("boxWeight", getBoxWeight())
+//                .append("tubeColor", getTubeColor())
+//                .append("comPort", getComPort())
+//                .append("printFormat", getPrintFormat())
+//                .append("packagingType", getPackagingType())
+//                .append("storageLocation", getStorageLocation())
+//                .append("warehouseregionId", getWarehouseregionId())
+//                .append("remark", getRemark())
+//                .append("delFlag", getDelFlag())
+//                .append("createBy", getCreateBy())
+//                .append("createById", getCreateById())
+//                .append("createTime", getCreateTime())
+//                .append("updateBy", getUpdateBy())
+//                .append("updateById", getUpdateById())
+//                .append("updateTime", getUpdateTime())
+//                .append("totalCanisterNum", getTotalCanisterNum())
+//                .append("totalBoxNum", getTotalBoxNum())
+//                .append("totalSuttle", getTotalSuttle())
+//                .append("totalGrossWeight", getTotalGrossWeight())
+//                .toString();
+//    }
+//}

+ 3 - 3
zkqy-custom-business/src/main/java/com/zkqy/business/mapper/SaleOrderMapper.java

@@ -213,17 +213,17 @@ public interface SaleOrderMapper {
     /**
      * 销售单销量
      */
-    Map<String,Object> saleOrderSaleVolume(@Param("timeType") String timeType,@Param("timeParam") String timeParam);
+    Map<String,Object> saleOrderSaleVolume(@Param("productType") String productType,@Param("timeType") String timeType,@Param("timeParam") String timeParam);
 
     /**
      * 零售单销量
      */
-    Map<String,Object> retailOrderSaleVolume(@Param("timeType") String timeType,@Param("timeParam") String timeParam);
+    Map<String,Object> retailOrderSaleVolume(@Param("productType") String productType,@Param("timeType") String timeType,@Param("timeParam") String timeParam);
 
     /**
      * 产量
      */
-    Map<String,Object> productionVolume(@Param("timeType") String timeType,@Param("timeParam") String timeParam);
+    Map<String,Object> productionVolume(@Param("productType") String productType,@Param("timeType") String timeType,@Param("timeParam") String timeParam);
 
     /**
      * 销售排行   按时间可以进行查询、默认当月、可选择日、月、季度、年度进行筛选

+ 3 - 3
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/SaleOrderServiceImpl.java

@@ -797,11 +797,11 @@ public class SaleOrderServiceImpl implements ISaleOrderService {
     @Override
     public Map<String, Object> productionMarketingRatio(Map<String, Object> map) {
         //销售单销量
-        Map<String, Object> saleOrderSaleVolume = saleOrderMapper.saleOrderSaleVolume(map.get("timeType").toString(), map.get("timeParam").toString());
+        Map<String, Object> saleOrderSaleVolume = saleOrderMapper.saleOrderSaleVolume(map.get("productType").toString(),map.get("timeType").toString(), map.get("timeParam").toString());
         //零售单销量
-        Map<String, Object> retailOrderSaleVolume = saleOrderMapper.retailOrderSaleVolume(map.get("timeType").toString(), map.get("timeParam").toString());
+        Map<String, Object> retailOrderSaleVolume = saleOrderMapper.retailOrderSaleVolume(map.get("productType").toString(),map.get("timeType").toString(), map.get("timeParam").toString());
         //产量
-        Map<String, Object> productionVolume = saleOrderMapper.productionVolume(map.get("timeType").toString(), map.get("timeParam").toString());
+        Map<String, Object> productionVolume = saleOrderMapper.productionVolume(map.get("productType").toString(),map.get("timeType").toString(), map.get("timeParam").toString());
 
         Double saleWeight = (Double)saleOrderSaleVolume.get("weight");
         double sale = saleWeight != null ? saleWeight : 0.0;

+ 6 - 1
zkqy-custom-business/src/main/resources/mapper/business/ProductInventoryMapper.xml

@@ -41,10 +41,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="totalSuttle"    column="total_suttle"    />
         <result property="totalGrossWeight"    column="total_gross_weight"    />
         <result property="productColour" column="product_colour"/>
+        <result property="inventoryType" column="inventory_type"/>
     </resultMap>
 
     <sql id="selectProductInventoryVo">
-        select id, qr_code, lot_num, product_id, levels, canister_num, box_num, suttle, production_date, warehouse_id, machine_tool, gross_weight, packaging, work_shifts, foreign_trade_number, canister_weight, box_weight, tube_color, com_port, print_format, packaging_type, storage_location, warehouseregion_id, remark, del_flag, create_by, create_by_id, create_time, update_by, update_by_id, update_time, total_canister_num, total_box_num, total_suttle, total_gross_weight,product_colour from {DBNAME}.product_inventory
+        select id, qr_code, lot_num, product_id, levels, canister_num, box_num, suttle, production_date, warehouse_id, machine_tool, gross_weight, packaging, work_shifts, foreign_trade_number, canister_weight, box_weight, tube_color, com_port, print_format, packaging_type, storage_location, warehouseregion_id, remark, del_flag, create_by, create_by_id, create_time, update_by, update_by_id, update_time, total_canister_num, total_box_num, total_suttle, total_gross_weight,product_colour,inventory_type from {DBNAME}.product_inventory
     </sql>
 
     <select id="selectProductInventoryList" parameterType="com.zkqy.business.domain.ProductInventory" resultMap="ProductInventoryResult">
@@ -118,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="totalSuttle != null">total_suttle,</if>
             <if test="totalGrossWeight != null">total_gross_weight,</if>
             <if test="productColour != null">product_colour,</if>
+            <if test="inventoryType != null">inventory_type,</if>
             del_flag
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -152,6 +154,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="totalSuttle != null">#{totalSuttle},</if>
             <if test="totalGrossWeight != null">#{totalGrossWeight},</if>
             <if test="productColour != null">#{productColour},</if>
+            <if test="inventoryType != null">#{inventoryType},</if>
             '0'
          </trim>
     </insert>
@@ -190,6 +193,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="totalSuttle != null">total_suttle = #{totalSuttle},</if>
             <if test="totalGrossWeight != null">total_gross_weight = #{totalGrossWeight},</if>
             <if test="productColour != null">product_colour = #{productColour},</if>
+            <if test="inventoryType != null">inventory_type = #{inventoryType},</if>
         </trim>
         where id = #{id}
     </update>
@@ -216,6 +220,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="lotNum != null and lotNum != '' ">and lot_num = #{lotNum}</if>
         <if test="productId != null">and product_id = #{productId}</if>
         <if test="productColour != null and productColour != ''"> and product_colour = #{productColour}</if>
+        <if test="inventoryType != null and inventoryType != ''"> and inventory_type = #{inventoryType}</if>
     </select>
 
     <select id="selectComprehensiveInventoryList" resultType="com.zkqy.business.domain.vo.ProductCodeListVO">

+ 13 - 10
zkqy-custom-business/src/main/resources/mapper/business/SaleOrderMapper.xml

@@ -837,9 +837,9 @@
                           left join {DBNAME}.production p on p.product_no = sp.product_no and p.del_flag = '0'
         WHERE
             so.sale_order_technology_no NOT IN ( 'retailOrder', 'outsourceOrder', 'processingOrder' )
-	AND so.del_flag = '0'
-	AND so.`status` = '6'
-
+	    AND so.del_flag = '0'
+	    AND so.`status` = '6'
+        and p.product_type = #{productType}
         <if test="timeType == 'days'">
             and DATE( so.sale_date ) = #{timeParam}
         </if>
@@ -863,6 +863,7 @@
                 left join {DBNAME}.sale_order so on pi.sale_order_no = so.sale_no and so.del_flag = '0' and so.`status` = '6' and so.sale_order_technology_no = 'retailOrder'
                 left join {DBNAME}.production p on p.id = por.product_id
         where por.del_flag = '0'
+        and p.product_type = #{productType}
         <if test="timeType == 'days'">
             and DATE( so.sale_date ) = #{timeParam}
         </if>
@@ -879,22 +880,24 @@
 
     <select id="productionVolume" resultType="map">
         SELECT
-        IFNULL(TRUNCATE( sum( suttle ), 2 ),0) AS weight
+        IFNULL(TRUNCATE( sum( pwr.suttle ), 2 ),0) AS weight
         FROM
-            {DBNAME}.product_warehousing_record
+            {DBNAME}.product_warehousing_record pwr
+        left join {DBNAME}.production p ON p.id = pwr.product_id
         WHERE
-            del_flag = '0'
+        pwr.del_flag = '0'
+        and p.product_type = #{productType}
         <if test="timeType == 'days'">
-           and DATE( warehousing_time ) = #{timeParam}
+           and DATE( pwr.warehousing_time ) = #{timeParam}
         </if>
         <if test="timeType == 'months'">
-           and DATE_FORMAT( warehousing_time, '%Y-%m' ) = #{timeParam}
+           and DATE_FORMAT( pwr.warehousing_time, '%Y-%m' ) = #{timeParam}
         </if>
         <if test="timeType == 'quarters'">
-           and CONCAT(YEAR ( warehousing_time ),'-',QUARTER ( warehousing_time )) = #{timeParam}
+           and CONCAT(YEAR ( pwr.warehousing_time ),'-',QUARTER ( pwr.warehousing_time )) = #{timeParam}
         </if>
         <if test="timeType == 'years'">
-           and YEAR ( warehousing_time ) = #{timeParam}
+           and YEAR ( pwr.warehousing_time ) = #{timeParam}
         </if>
     </select>
 

+ 3484 - 0
zkqy-ui/src/views/orderMange/order/oldStockOrder.vue

@@ -0,0 +1,3484 @@
+<template>
+  <el-card shadow="always" :body-style="{ padding: '10px' }">
+    <div class="app-container">
+      <el-dialog
+        :title="upload.title"
+        :visible.sync="upload.open"
+        width="400px"
+        append-to-body
+      >
+        <el-upload
+          ref="upload"
+          :limit="1"
+          accept=".xlsx, .xls"
+          :headers="upload.headers"
+          :action="
+            upload.url +
+            '?updateSupport=' +
+            upload.updateSupport +
+            '&tableName=' +
+            tableName +
+            '&sqlKey=' +
+            tableKey
+          "
+          v-loading="upload.isUploading"
+          :disabled="upload.isUploading"
+          :on-progress="handleFileUploadProgress"
+          :on-success="handleFileSuccess"
+          :auto-upload="false"
+          :onChange="handleChange"
+          drag
+        >
+          <i class="el-icon-upload"></i>
+          <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+          <div class="el-upload__tip text-center" slot="tip">
+            <!--          <div class="el-upload__tip" slot="tip">-->
+            <!--            <el-checkbox v-model="upload.updateSupport"/>-->
+            <!--            是否更新已经存在的用户数据-->
+            <!--          </div>-->
+            <span>仅允许导入xls、xlsx格式文件。</span>
+            <el-link
+              type="primary"
+              :underline="false"
+              style="font-size: 12px; vertical-align: baseline"
+              @click="importTemplate"
+            >下载模板
+            </el-link>
+          </div>
+        </el-upload>
+        <div slot="footer" class="dialog-footer">
+          <el-button type="primary" @click="submitFileForm">确 定</el-button>
+          <el-button @click="upload.open = false">取 消</el-button>
+        </div>
+      </el-dialog>
+      <Queryfrom
+        :form-vals="templateInfo.where"
+        :statisticList="statisticList"
+        :showCount="showCount"
+        :showSearch="showSearch"
+        @getList="getList"
+        ref="mychild"
+      />
+      <el-row :gutter="10" class="mb8">
+        <el-col :span="1.5">
+          <el-button
+            type="primary"
+            plain
+            icon="el-icon-plus"
+            size="mini"
+            v-hasPermi="['system:RetailOrder:insert']"
+            @click="addHandler"
+          >新增
+          </el-button>
+        </el-col>
+        <!-- <el-col :span="1.5" v-if="false">
+        <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"
+            v-hasPermi="['system:RetailOrder:remove']"
+            @click="myDeleteHandler"
+          >删除
+          </el-button>
+        </el-col>
+        <!-- <el-col :span="1.5">
+          <el-button
+            plain
+            icon="el-icon-upload2"
+            size="mini"
+            @click="upload.open = true"
+            >导入
+          </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
+          style="float: right"
+          :showCount.sync="showCount"
+          :showSearch.sync="showSearch"
+          :counts="true"
+          @queryTable="pageList"
+        ></right-toolbar> -->
+        <el-radio-group
+          style="float: right; margin-right: 100px"
+          v-model="queryParams.status"
+          @change="orderStartChange"
+          size="mini"
+        >
+          <!--        未提交/和待出库  -->
+          <el-radio-button :label="100">未完成</el-radio-button>
+          <el-radio-button :label="200">已完成</el-radio-button>
+        </el-radio-group>
+      </el-row>
+
+      <el-table
+        v-loading="loading"
+        :data="tableList"
+        @selection-change="handleSelectionChange"
+        ref="tableRef"
+        :cell-style="cellStyle"
+        row-key="id"
+      >
+        <el-table-column
+          type="selection"
+          width="55"
+          :reserve-selection="true"
+          align="center"
+        >
+        </el-table-column>
+        <!-- <el-table-column type="selection" width="55" /> -->
+        <el-table-column prop="saleNo" align="center" label="合同号" />
+        <el-table-column prop="saleDate" align="center" label="日期" />
+        <el-table-column prop="customName" align="center" label="客户名称" />
+        <el-table-column prop="deliveryDate" align="center" label="交货日期" />
+        <el-table-column prop="saleLeadTime" align="center" label="交货天数" />
+        <el-table-column prop="saleAmountInWords" align="center" label="合计金额(大写)" />
+        <el-table-column label="付款方式" align="center" prop="salePayType">
+          <template slot-scope="scope">
+            {{
+              getDictLabel(scope.row.salePayType, "payment_method")
+            }}
+          </template>
+        </el-table-column>
+        <el-table-column prop="status" align="center" label="状态">
+          <template slot-scope="scope">
+            <el-tag :type="scope.row.listClass">{{
+                getDictLabel(scope.row.status, "sales_order_status")
+              }}</el-tag>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="salesman" align="center" label="销售员" />
+        <el-table-column prop="remark" align="center" label="备注" />
+        <el-table-column label="操作" align="center">
+          <template slot-scope="scope">
+            <el-dropdown>
+              <el-button type="warning" plain size="small">
+                操作<i class="el-icon-arrow-down el-icon--right"></i>
+              </el-button>
+              <el-dropdown-menu slot="dropdown">
+                <el-dropdown-item v-show="scope.row.status != 6">
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-edit"
+                    v-hasPermi="['system:RetailOrder:update']"
+                    @click="handleUpdate(scope.row)"
+                  >修改
+                  </el-button>
+                </el-dropdown-item>
+                <el-dropdown-item v-show="scope.row.status == 9">
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-edit"
+                    v-hasPermi="['system:RetailOrder:update']"
+                    @click="handleComplate(scope.row)"
+                  >完成
+                  </el-button>
+                </el-dropdown-item>
+                <el-dropdown-item>
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-tickets"
+                    v-hasPermi="['system:RetailOrder:info']"
+                    @click="handlePrint(scope.row)"
+                  >详情
+                  </el-button>
+                </el-dropdown-item>
+                <!-- <el-dropdown-item>
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-folder-checked"
+                    v-hasPermi="['system:RetailOrder:submit']"
+                    @click="handleSubmit(scope.row)"
+                    >提交
+                  </el-button>
+                </el-dropdown-item> -->
+                <!-- <el-dropdown-item v-show="scope.row.status == 5">
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-folder-delete"
+                    v-hasPermi="['system:RetailOrder:update']"
+                    @click="handleSubmitCancel(scope.row)"
+                    >撤销
+                  </el-button>
+                </el-dropdown-item> -->
+                <el-dropdown-item v-show="scope.row.status != 1">
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-folder-delete"
+                    @click="handleOutDetail(scope.row)"
+                  >出库明细
+                  </el-button>
+                </el-dropdown-item>
+                <el-dropdown-item v-show="scope.row.status == 5">
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-folder-delete"
+                    @click="myPrintOutBoundHandler(scope.row)"
+                  >打印出库单
+                  </el-button>
+                </el-dropdown-item>
+                <el-dropdown-item v-show="scope.row.status != 6">
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-delete"
+                    v-hasPermi="['system:RetailOrder:remove']"
+                    @click="myDeleteHandler(scope.row)"
+                  >删除
+                  </el-button>
+                </el-dropdown-item>
+              </el-dropdown-menu>
+            </el-dropdown>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="pageList"
+      />
+
+      <!-- 添加或修改销售出库单:- 过磅记录生成数据对话框 -->
+      <el-dialog
+        :title="title"
+        width="1400px"
+        :visible.sync="open"
+        append-to-body
+      >
+        <el-row :gutter="20">
+          <el-form
+            :model="formData"
+            ref="formDataRef"
+            :rules="rules"
+            label-width="100px"
+            :inline="true"
+            size="normal"
+          >
+            <el-col :span="12">
+              <el-form-item prop="saleNo" label="合同号:">
+                <!-- <el-input size="small" v-model="formData.saleNo"></el-input> -->
+                {{ formData.saleNo }}
+              </el-form-item>
+            </el-col>
+            <!-- <el-col :span="12">
+              <el-form-item prop="lotNumber" label="批号:">
+                <el-input size="small" v-model="formData.lotNumber"></el-input>
+              </el-form-item>
+            </el-col> -->
+            <el-col :span="12">
+              <el-form-item prop="saleDate" label="日期:">
+                <!-- <el-date-picker
+                  size="small"
+                  v-model="formData.saleDate"
+                  value-format="yyyy-MM-dd"
+                  format="yyyy-MM-dd"
+                  type="date"
+                  placeholder="选择日期"
+                >
+                </el-date-picker> -->
+                {{ formData.saleDate }}
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item prop="saleCustomNo" label="客户名称:">
+                <el-select
+                  size="small"
+                  v-model="formData.saleCustomNo"
+                  placeholder="请选择客户"
+                  clearable
+                  filterable
+                  @change="customChangeHandler"
+                >
+                  <el-option
+                    v-for="item in customerOptions"
+                    :key="item.customNo"
+                    :label="item.customName"
+                    :value="item.customNo"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="12">
+              <el-form-item v-if="isLeader" label="业务员:">
+                <el-select
+                  size="small"
+                  v-model="formData.salesman"
+                  placeholder="请选择业务员"
+                  clearable
+                  filterable
+                  @change="salemanChange"
+                >
+                  <el-option
+                    v-for="item in salesmanList"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item v-else label="业务员:">
+                <!-- <el-input
+            v-model="formData.salesman"
+            size="small"
+            clearable
+          ></el-input> -->
+                {{ nickName }}
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="联系人:" size="normal">
+                {{ formData.contactPerson }}
+              </el-form-item>
+              <el-form-item label="客户地址:" size="normal">
+                {{ formData.customAddress }}
+              </el-form-item>
+              <el-form-item label="客户国别:" size="normal">
+                {{ formData.customCountryType }}
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label-width="120px" label="合计金额(大写):">
+                <!-- <el-input
+                  v-model="formData.saleAmountInWords"
+                  size="small"
+                  clearable
+                ></el-input> -->
+                {{ formData.saleAmountInWords }}
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label-width="120px" label="货车登记:">
+                <el-input
+                  v-model="form.truckRegistration"
+                  size="small"
+                  clearable
+                ></el-input>
+                <!-- {{ formData.saleAmountInWords }} -->
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="12">
+              <el-form-item prop="salePayType" label="付款方式">
+                <!-- <el-input
+                v-model="formData.salePayType"
+                size="small"
+                clearable
+              ></el-input> -->
+                <el-select
+                  v-model="formData.salePayType"
+                  size="small"
+                  clearable
+                  filterable
+                >
+                  <el-option
+                    v-for="item in dict.type.payment_method"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+
+
+            <!-- <el-col :span="12">
+              <el-form-item label="付款方式:">
+                <el-select
+                  v-model="formData.salePayType"
+                  size="small"
+                  clearable
+                  filterable
+                >
+                  <el-option
+                    v-for="item in dict.type.retail_order_pay_method"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  ></el-option>
+                </el-select>
+                零售单
+              </el-form-item>
+            </el-col> -->
+
+            <!-- <el-col :span="12">
+              <el-form-item
+                label-width="120px"
+                prop="saleOrderEstimatedTime"
+                label="预计下单时间:"
+              >
+                {{ formData.saleOrderEstimatedTime }}
+              </el-form-item>
+            </el-col> -->
+
+            <!-- <el-col :span="12">
+              <el-form-item label="交货日期:" size="normal" prop="deliveryDate">
+                {{ formData.deliveryDate }}
+              </el-form-item>
+            </el-col> -->
+            <!-- <el-col :span="12">
+              <el-form-item label="交货天数:" size="normal" prop="saleLeadTime">
+                {{ formData.saleLeadTime }}
+              </el-form-item>
+            </el-col> -->
+            <el-col :span="24">
+              <el-divider>货品明细</el-divider>
+            </el-col>
+            <el-table
+              ref="productionTableRef"
+              :data="productionTableData"
+              border
+              show-summary
+              :summary-method="getSummaries"
+              sum-text="小计"
+              style="width: 100%"
+            >
+              <el-table-column prop="productName" label="品名" width="180">
+                <template slot-scope="scope">
+                  <!-- <el-input
+                v-model="scope.row.productName"
+                size="small"
+                clearable
+              ></el-input> -->
+                  <el-form-item
+                    :prop="'productName-' + scope.$index"
+                    :name="'productName-' + scope.$index"
+                    style="margin: 0px; padding: 0px"
+                  >
+                    <!--
+                    @change="
+                        handleProductChange(scope.row.productNo, scope.row)
+                      "
+                      @blur="handleProductBlur(productNo)"
+                   -->
+                    <el-select
+                      v-model="scope.row.productName"
+                      placeholder=""
+                      filterable
+                      @change="
+                        newProductChange(scope.row.productName, scope.row)
+                      "
+                    >
+                      <el-option
+                        v-for="item in productionOptions"
+                        :key="item.productName"
+                        :label="item.productName"
+                        :value="item.productName"
+                      >
+                        <!-- <span class="discribe" style="float: left">{{
+                          item.productName
+                        }}</span>
+                        <span
+                          style="float: right; color: #8492a6; font-size: 13px"
+                          >{{ item.productSpecifications }}</span
+                        > -->
+                      </el-option>
+                    </el-select>
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column prop="productSpecifications" label="规格">
+                <template slot-scope="scope">
+                  <el-select
+                    v-model="scope.row.productSpecifications"
+                    @change="handleSpecificationsChange(scope.row)"
+                    placeholder=""
+                    filterable
+                  >
+                    <el-option
+                      v-for="item in scope.row.specificationsList"
+                      :key="item.productSpecifications"
+                      :label="item.productSpecifications"
+                      :value="item.productSpecifications"
+                    >
+                      <span class="discribe" style="float: left">{{
+                          item.productSpecifications
+                        }}</span>
+                      <span
+                        style="float: right; color: #8492a6; font-size: 13px"
+                      >{{ item.productType }}</span
+                      >
+                    </el-option>
+                  </el-select>
+                </template>
+              </el-table-column>
+              <el-table-column prop="colourNumber" width="150" label="色号">
+                <template slot-scope="scope">
+                  <el-form-item
+                    :prop="'colourNumber-' + scope.$index"
+                    :name="'colourNumber-' + scope.$index"
+                    style="margin: 0px; padding: 0px"
+                  >
+                    <el-select
+                      v-model="scope.row.colourNumber"
+                      placeholder=""
+                      clearable
+                      filterable
+                      @change="colourNumberChangeHandler(scope.row)"
+                    >
+                      <el-option
+                        v-for="item in colourNumberOptions"
+                        :key="item.materielCode"
+                        :label="item.materieEncoding + item.materieColorNumber"
+                        :value="item.materielCode"
+                      >
+                        <span class="discribe" style="float: left">{{
+                            item.materieEncoding + item.materieColorNumber
+                          }}</span>
+                        <!-- <span
+                        style="float: right; color: #8492a6; font-size: 13px"
+                        >{{ item.materielCode }}</span
+                      > -->
+                      </el-option>
+                    </el-select>
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column prop="productType" label="类型">
+              </el-table-column>
+
+              <el-table-column prop="lotNumber" width="120" label="批号">
+                <template slot-scope="scope">
+                  <el-input
+                    v-model="scope.row.lotNumber"
+                    placeholder=""
+                    size="small"
+                    clearable
+                    @blur="updateStorage(scope.row, 'lotNumber')"
+                  ></el-input>
+                </template>
+              </el-table-column>
+
+              <!-- <el-table-column prop="sliceType" label="切片型号">
+                <template slot-scope="scope">
+                  <el-form-item
+                    :prop="'sliceType-' + scope.$index"
+                    :name="'sliceType-' + scope.$index"
+                    style="margin: 0px; padding: 0px"
+                  >
+                    <el-select
+                      v-model="scope.row.sliceType"
+                      placeholder=""
+                      clearable
+                      filterable
+                      @change="sliceTypeChangeHandler(scope.row)"
+                    >
+                      <el-option
+                        v-for="item in sliceTypeOptions"
+                        :key="item.materielCode"
+                        :label="item.materielName"
+                        :value="item.materielCode"
+                      >
+                      </el-option>
+                    </el-select>
+                  </el-form-item>
+                </template>
+              </el-table-column> -->
+
+              <el-table-column prop="productNumber" label="箱数">
+                <template slot-scope="scope">
+                  <el-form-item
+                    :prop="'productNumber-' + scope.$index"
+                    :name="'productNumber-' + scope.$index"
+                    style="margin: 0px; padding: 0px"
+                  >
+                    <el-input
+                      v-model="scope.row.productNumber"
+                      oninput="value=value.replace(/[^0-9.]/g,'')"
+                      size="small"
+                      clearable
+                      @change="computedPrice(scope.row)"
+                    ></el-input>
+                  </el-form-item>
+                </template>
+              </el-table-column>
+<!--              <el-table-column prop="productUnitPrice" label="单价">-->
+<!--                <template slot-scope="scope">-->
+<!--                  <el-form-item-->
+<!--                    :prop="'productUnitPrice-' + scope.$index"-->
+<!--                    :name="'productUnitPrice-' + scope.$index"-->
+<!--                    style="margin: 0px; padding: 0px"-->
+<!--                  >-->
+<!--                    <el-input-->
+<!--                      v-model="scope.row.productUnitPrice"-->
+<!--                      size="small"-->
+<!--                      oninput="value=value.replace(/[^0-9.]/g,'')"-->
+<!--                      @change="computedPrice(scope.row)"-->
+<!--                      clearable-->
+<!--                    ></el-input>-->
+<!--                  </el-form-item>-->
+<!--                </template>-->
+<!--              </el-table-column>-->
+<!--              <el-table-column prop="productAmounts" label="金额">-->
+<!--                <template slot-scope="scope">-->
+<!--                  {{ scope.row.productAmounts }}-->
+<!--                </template>-->
+<!--              </el-table-column>-->
+              <el-table-column prop="inventoryBoxNum" label="库存箱数">
+                <template slot-scope="scope">
+                  {{ scope.row.inventoryBoxNum }}
+                </template>
+              </el-table-column>
+              <el-table-column prop="inventoryWeight" label="库存重量/kg">
+                <template slot-scope="scope">
+                  {{ scope.row.inventoryWeight }}
+                </template>
+              </el-table-column>
+              <el-table-column prop="remark" label="备注">
+                <template slot-scope="scope">
+                  <el-input
+                    v-model="scope.row.remark"
+                    size="small"
+                    clearable
+                  ></el-input>
+                </template>
+              </el-table-column>
+              <el-table-column label="操作">
+                <template slot-scope="scope">
+                  <el-button
+                    type="danger"
+                    size="small"
+                    @click="deleteProduct(scope.$index)"
+                  >删除</el-button
+                  >
+                </template>
+              </el-table-column>
+            </el-table>
+            <el-button
+              class="mt5"
+              type="primary"
+              style="width: 100%"
+              size="small"
+              @click="addProduct"
+            >添加货品</el-button
+            >
+            <el-col :span="24">
+              <el-divider>备注</el-divider>
+            </el-col>
+            <el-col :span="24">
+              <el-input
+                type="textarea"
+                v-model="formData.orderRemark"
+                placeholder=""
+                size="normal"
+                clearable
+              ></el-input>
+            </el-col>
+          </el-form>
+        </el-row>
+        <div slot="footer" class="dialog-footer">
+          <el-button type="primary" @click="editConfirm">出库</el-button>
+          <el-button @click="cancel">取 消</el-button>
+        </div>
+      </el-dialog>
+
+      <!-- 自定义弹窗 -->
+      <el-dialog title="提交" :visible.sync="deliverShow" width="1200px">
+        <!-- <DialogTemplate
+        ref="dialogRef"
+        :groupKey="groupKey"
+        :rowobj="rowobj"
+        :subCount="subCount"
+        :tableCount="tableCount"
+        :subTableName="subTableName"
+        @addList="addListHandler"
+      >
+      </DialogTemplate> -->
+        <RetailProvide ref="deliverRef"></RetailProvide>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="deliverShow = false">取 消</el-button>
+          <!-- <el-button @click="btnSave">保 存</el-button> -->
+          <el-button type="primary" @click="btnComfirm">确 定</el-button>
+        </span>
+      </el-dialog>
+      <!-- 详情弹窗 -->
+      <el-dialog title="详情" :visible.sync="detailShow" width="1250px">
+        <div ref="detailTable" id="detail"></div>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="detailShow = false">取 消</el-button>
+          <el-button type="primary" @click="detailPrintHandler"
+          >打 印</el-button
+          >
+        </span>
+      </el-dialog>
+      <!-- 销售出库弹窗 -->
+      <el-dialog
+        title="打印-销售出库单"
+        :visible.sync="outBoundShow"
+        width="1000px"
+      >
+        <OutBound ref="outBoundRef" :currentRow="currentRow"></OutBound>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="outBoundShow = false">取 消</el-button>
+          <el-button type="primary" @click="outBoundPrintHandler">
+            打印</el-button
+          >
+        </span>
+      </el-dialog>
+      <!-- 出库详情 -->
+      <el-dialog title="出库明细" :visible.sync="outStockShow" width="1200px">
+        <OutStock ref="outStockRef"></OutStock>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="outStockShow = false">关 闭</el-button>
+          <!-- <el-button @click="btnSave">保 存</el-button> -->
+          <!-- <el-button type="primary" @click="btnComfirm">确 定</el-button> -->
+        </span>
+      </el-dialog>
+      <div id="printDom"></div>
+    </div>
+  </el-card>
+</template>
+<script>
+import {
+  delTableData,
+  dragTableInfo,
+  listTable,
+  unionListTableData,
+  getInfoBySqlKey,
+  btnCommonApi,
+  addTableData,
+  batchEdit,
+  getStatisticList,
+  getTableList1,
+  checkOrderNo,
+  delOrder,
+  productInvoiceInfo,
+  addProductInvoice,
+  updateProductInvoice,
+  queryMaterielList,
+  getSaleOrderProductionListDistinct,
+  getProductSpecificationsByProductName,
+} from "@/api/tablelist/commonTable";
+import {
+  saleOrderList,
+  getRoleUser,
+  addRetailOrder,
+  getRetailOrderInfo,
+  editRetailOrder,
+  retailProductInvoiceInfo,
+  submitRetailOrder,
+  cancelRetailOrder,
+  deleRetailOrder,
+  submitProductInvoice,
+  getProductInventory,
+  updateOrder,
+} from "@/api/system/retailMange.js";
+import { listData } from "@/api/system/tenant/data";
+import { getToken } from "@/utils/auth";
+import Queryfrom from "@/views/tablelist/commonTable/queryfrom.vue";
+import { camelCase, toUnderline } from "@/utils";
+import { inputDisableComplete } from "@/utils/other";
+import Menu from "@/views/tablelist/commonTable/BtnMenu.vue";
+import { checkRole } from "@/utils/permission";
+import DialogTemplate from "@/views/dialogTemplate/components/index.vue";
+import {
+  queryDropDownBoxData,
+  getSaleOrderProductionList,
+} from "@/api/dragform/form";
+import { v4 as uuidv4 } from "uuid";
+import { mapState } from "vuex";
+import moment from "moment";
+import Deliver from "@/views/orderMange/components/dialogForm/Deliver.vue";
+import RetailProvide from "@/views/orderMange/components/dialogForm/RetailProvide.vue";
+import OutStock from "@/views/orderMange/components/dialogForm/OutStock.vue";
+import OutBound from "@/views/orderMange/components/dialogForm/OutBound.vue";
+import outBoundPrint from "@/utils/print/outBoundPrint";
+import { listCustomer } from "@/api/system/customer";
+import { numToCapital } from "@/utils/other";
+export default {
+  name: "oldStockOrder",
+  dicts: [
+    "payment_method",
+    "direction_of_twist",
+    "retail_order_pay_method",
+    "sales_order_status",
+  ],
+  components: {
+    Queryfrom,
+    Menu,
+    DialogTemplate,
+    Deliver,
+    OutBound,
+    RetailProvide,
+    OutStock,
+  },
+  data() {
+    return {
+      // 提交  表单数据  start
+      form: {
+        noticeNumber: "", //通知单号
+        noticeDate: "", //通知日期
+        salesman: "", //销售员
+        customerId: "", //客户编号
+        drawer: "", //开票员
+        dispatchNoteRemark: "", //发货单备注
+        billingType: "", //开票类型
+        truckRegistration: "", //货车登记
+        documentType: "", //单据类型
+        sellingUnit: "", //售货单位
+        auditOpinion: "", //审核意见
+        inventoryBoxNum: "", //库存箱数
+        inventoryWeight: "", //库存重量
+
+        batchNumberType: 1, //批次类型
+        computeType: 1, //计算方式
+      },
+      // 提交  表单数据  end
+      outStockShow: false, //出库详情弹窗
+      totalMoney: "", //合计金额  小写
+      createById: "", //创建者id
+      salesmanList: [], //销售员列表
+      isLeader: false, //当前登录用户是否为领导
+      selection: [], //勾选的数据
+      // 出库单 start
+      outBoundShow: false,
+      // 出库单 end
+      // 发货 start
+      deliverShow: false,
+      // 发货 end
+
+      // 出库单  start
+
+      // 出库单  end
+      myDelIds: [], //新增接口 删除的id
+      // 详情弹窗数据
+      detailShow: false,
+      printDomData: "",
+      // k-form-build组件渲染弹窗
+      kOpen: false,
+      // 新的自定义数据 start
+      orderType: 0, //新的条件查询参数
+      productIds: [], //货品Ids
+      isEdit: false,
+      formData: {
+        //订单表数据
+        saleNo: "", //合同号
+        saleCustomNo: "", //客户编号
+        saleDate: "", //销售单日期
+        saleOrderEstimatedTime: "", //预计下单时间
+        saleLeadTime: "1", //交货周期
+        deliveryDate: "", //交货日期
+        saleAmounts: "", //合计金额 小写
+        saleAmountInWords: "", //合计金额 大写
+        salePayType: "2", //支付方式
+        earnestMoney: "", //定金
+        salesman: "", //业务员
+        saleLeader: "", //业务主管
+        finance: "", //财务部
+        production: "", //生产部
+        saleApprover: "", //批准人
+        customAddress: "", //客户地址
+        customCountryType: "", //国家类型
+        contactPerson: "", //联系人
+        // 货品明细表数据
+        lotNumber: "", //批号
+        productNo: "", //货品号
+        productName: "", //货品名称
+        productNumber: "", //销售数量
+        productWeight: "", //销售重量kg
+        productUnitPrice: "", //单价
+        productAmounts: "", //金额
+        sliceType: "", //切片类型
+        sliceTypeLabel: "",
+        colourNumberLabel: "",
+        colourNumber: "", //色号
+        remark: "", //备注
+        // 工艺表
+        orderRemark: "",
+      },
+      sliceTypeOptions: [], //切片型号选项
+      colourNumberOptions: [], //色号选项
+      allProductionOptions: [], //所有产品选项
+      productionOptions: [],
+      customerOptions: [],
+      productionTableData: [
+        // {
+        //   productNo: "", //货品名称
+        //   productNumber: 2, //销售数量
+        //   productWeight: 1, //销售重量kg
+        //   productUnitPrice: 20, //单价
+        //   productAmounts: 20, //金额
+        //   remark: "", //备注
+        // },
+      ],
+      rules: {
+        saleNo: [
+          {
+            required: true,
+            message: "请输入合同号",
+            trigger: "blur",
+          },
+          // {
+          //   validator: this.validateOrderNo,
+          //   trigger: "blur",
+          // },
+        ],
+        saleDate: [
+          {
+            required: true,
+            message: "请选择日期",
+            trigger: "change",
+          },
+        ],
+        // lotNumber: [
+        //   {
+        //     required: true,
+        //     message: "请输入批号",
+        //     trigger: "blur",
+        //   },
+        // ],
+        saleCustomNo: [
+          {
+            required: true,
+            message: "请选择客户",
+            trigger: "change",
+          },
+        ],
+        salePayType: [
+          {
+            required: true,
+            message: "请选择付款方式",
+            trigger: "change",
+          },
+        ],
+        saleOrderEstimatedTime: [
+          {
+            required: true,
+            message: "请选择预计下单时间",
+            trigger: "change",
+          },
+        ],
+        saleLeadTime: [
+          {
+            required: true,
+            message: "请输入交货天数",
+            trigger: "blur",
+          },
+        ],
+        // earnestMoney: [
+        //   {
+        //     validator: this.validateEarnestMoney,
+        //     trigger: "blur",
+        //   },
+        // ],
+      },
+
+      // end
+      // 绑定按钮dialog
+      btnDialogVisible: false,
+      // 绑定修改dialog
+      groupKey: "",
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示统计
+      showCount: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 用户表格数据
+      tableList: [],
+      // 弹出层标题
+      title: "",
+      // 日期范围
+      dateRange: [],
+      // cru 弹窗
+      open: false,
+      // excel共通导入数据
+      upload: {
+        // 是否显示弹出层
+        open: false,
+        // 弹出层标题(
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API1 + "common/uploadData",
+      },
+      // 排序方式 默认降序
+      sortOrder: true,
+      // 共通查询参数接受子组件的参数
+      queryParams: {
+        saleOrderTechnologyNo: "retailOrder",
+        pageNum: 1, // 第几页
+        pageSize: 10, // 每页大小
+        orderByColumn: "", // 根据某列排序
+        isAsc: "", // desc(降序)或 asc(升序)
+        saleOrderOrderType: "",
+        status: 100, //订单是否已完成/为完成
+        // 基本查询参数
+        basicMap: {
+          tableName: "drag_form",
+        },
+        // 当前表字段筛选参数
+        queryMap: {
+          queryCriteriaValue: "",
+        },
+      },
+      // 列信息
+      columns: {},
+      // 当前模版信息
+      templateInfo: {},
+      // 查询条件
+      queryFromWhere: {},
+      // 当前table唯一标识
+      tableKey: null,
+      // 当前表名称
+      tableName: null,
+      //存放html代码块
+      iframeUrl: "",
+      //存放表单渲染数据
+      jsonData: {},
+      // 回显表格数据,
+      defaultValue: {},
+      // 统计card
+      statisticList: [],
+      // 样式表
+      styleList: [],
+      // 字典样式对象
+      dictStyleObj: {},
+      // 操作列 按钮数据
+      excuteBtnArr: [],
+      // 下拉框动态数据
+      dynamicData: {},
+      // 当前点击按钮的数据
+      currentBtnData: {},
+      // 修改选中行
+      rowobj: {},
+      // 该行的统计信息
+      subCount: [],
+      tableCount: [],
+      // 弹窗新增数据
+      addLists: [],
+      subTableName: "",
+      // 当前点击行的数据
+      currentRow: {},
+    };
+  },
+
+  created() {
+    // 得到当前展示的table的唯一标识
+    this.tableKey = this.$route.query.tableKey;
+  },
+  watch: {
+    totalMoney: {
+      handler(newVal, oldVal) {
+        if (isNaN(Number(newVal))) {
+          this.formData.saleAmountInWords = "零";
+        } else {
+          const ntc = new numToCapital();
+          this.formData.saleAmountInWords = ntc.uppercase(newVal);
+        }
+      },
+      deep: true,
+      immediate: true,
+    },
+  },
+  async mounted() {
+    await this.getDropDownData();
+  },
+  computed: {
+    isShowExcuteCol() {
+      return !this.excuteBtnArr?.every((arr) => arr.children.length == 0);
+    },
+    ...mapState({
+      nickName: (state) => state.user.nickName,
+      userInfo: (state) => state.user,
+      username: (state) => state.user.name,
+    }),
+  },
+  methods: {
+    orderStartChange(status) {
+      this.getList(false, status);
+    },
+    // 零售订单完成回调
+    async handleComplate(row) {
+      console.log(row);
+      let payload = {
+        id: row.id,
+        status: 6,
+        saleNo: row.saleNo,
+        completionTime: new Date(),
+      };
+      let res = await updateOrder(payload);
+      if (res.code == 200) {
+        this.$message({
+          type: "success",
+          message: "订单已完成",
+        });
+        this.getList();
+      } else {
+        this.$message({
+          type: "error",
+          message: "订单已完成失败,请稍后再试",
+        });
+        console.log(res);
+      }
+    },
+    // 更新库存箱数和重量
+    async updateStorage(row) {
+      let {
+        productNo,
+        productType,
+        lotNumber,
+        productName,
+        productSpecifications,
+        colourNumber,
+        specificationsList,
+      } = row;
+
+      let productColour = "";
+      let targetColor = this.colourNumberOptions.find((item) => {
+        return item.materielCode == colourNumber;
+      });
+      let productId = "";
+      if (specificationsList && specificationsList.length > 0) {
+        let targetItem = specificationsList.find(
+          (item) => item.productSpecifications == productSpecifications
+        );
+        productId = targetItem.id;
+      }
+      if (targetColor) {
+        productColour =
+          targetColor.materieEncoding + "" + targetColor.materieColorNumber;
+      }
+      let payload = {
+        productId,
+        productType,
+        lotNum: lotNumber,
+        productName,
+        productSpecifications,
+        productColour,
+        inventoryType:'2',
+      };
+      if (
+        !lotNumber &&
+        !productId &&
+        !productType &&
+        !productName &&
+        !productSpecifications &&
+        !productColour
+      )
+        return;
+      let res = await getProductInventory(payload);
+      if ((res.code = 200)) {
+        console.log(res);
+        row.inventoryWeight = res.data.inventoryWeight || 0;
+        row.inventoryBoxNum = res.data.inventoryBoxNum || 0;
+      } else {
+        console.log(res);
+      }
+    },
+    // 规格变化回调
+    handleSpecificationsChange(row) {
+      let { productSpecifications, specificationsList } = row;
+      if (productSpecifications) {
+        let targetItem = specificationsList.find(
+          (item) => item.productSpecifications == productSpecifications
+        );
+        console.log(targetItem);
+        row.productNo = targetItem?.productNo;
+        row.productType = targetItem?.productType;
+      } else {
+        row.productNo = "";
+        row.productType = "";
+      }
+      this.updateStorage(row);
+    },
+    // 新的产品改变回调
+    async newProductChange(productName, row) {
+      // 发请求获取对应的规格数据
+      if (!productName) {
+        row.specificationsList = [];
+        (row.productNo = ""), (row.productType = "");
+        row.productSpecifications = "";
+        return;
+      }
+      // let targetItem = this.productionOptions.find(
+      //   (item) => item.productNo == productNo
+      // );
+      // row.productName = targetItem?.productName;
+      // row.productType = targetItem?.productType;
+      // 获取规格数据
+      let res = await getProductSpecificationsByProductName({
+        productName: productName,
+      });
+      if (res.code == 200) {
+        row.specificationsList = res.data;
+        console.log(row.specificationsList);
+        let defaultItem = row.specificationsList.find(
+          (item) => item.isDefaultSpecifications
+        );
+        if (defaultItem) {
+          row.productSpecifications = defaultItem.productSpecifications;
+          row.productNo = defaultItem.productNo;
+          row.productType = defaultItem.productType;
+        } else {
+          row.productSpecifications =
+            row.specificationsList[0]?.productSpecifications || "";
+          row.productNo = row.specificationsList[0]?.productNo || "";
+          row.productType = row.specificationsList[0]?.productType || "";
+        }
+      } else {
+        row.specificationsList = [];
+      }
+      this.updateStorage(row);
+    },
+    // 出库单回调
+    async myPrintOutBoundHandler(row) {
+      console.log("row", row);
+      this.currentRow = row;
+      this.outBoundShow = true;
+      this.$nextTick(() => {
+        this.$refs.outBoundRef.getTableData(row);
+      });
+    },
+    // 出库详情回调
+    handleOutDetail(row) {
+      this.outStockShow = true;
+      this.$nextTick(() => {
+        this.$refs.outStockRef.getOutStockDetail(row);
+      });
+    },
+    // 业务员改变回调
+    salemanChange(val) {
+      if (!val) {
+        this.createById = "";
+        return;
+      } else {
+        this.createById = this.salesmanList.find(
+          (item) => item.value == val
+        ).id;
+      }
+    },
+    // 生成合同号
+    getSaleNo() {
+      let timeStr = moment().format("YYYYMMDD");
+      for (var i = 0; i < 5; i++) {
+        timeStr += parseInt(Math.random() * 10);
+      }
+      return timeStr;
+    },
+    // 自定义筛选方法
+    mySelectFilter(value, row) {
+      console.log(value);
+      // row.productNo = value;
+      if (value) {
+        let target = [];
+        // 在全部列表中查找
+        target = this.allProductionOptions.filter((item) =>
+          item.productName.includes(value)
+        );
+        console.log(target);
+        if (target.length) {
+          this.productionOptions = target;
+          return true;
+        } else {
+          return false;
+        }
+      } else {
+        this.productionOptions = this.allProductionOptions.slice(0, 500);
+      }
+    },
+
+    // // 出库单回调
+    // async myPrintOutBoundHandler(row, data) {
+    //   console.log("row", row);
+    //   this.currentRow = row;
+    //   this.outBoundShow = true;
+    //   this.$nextTick(() => {
+    //     this.$refs.outBoundRef.getTableData(row);
+    //   });
+    // },
+    // 出库单打印回调
+    async outBoundPrintHandler() {
+      let res = await this.$refs.outBoundRef.getPrintData();
+      console.log(res);
+      if (res.flag) {
+        res.data.form.printUser = this.nickName;
+        outBoundPrint(res.data, "printDom", true);
+      }
+    },
+    // 产品名失焦
+    handleProductBlur(productNo) {
+      console.log("blur", productNo);
+      // if (!productNo) {
+      //   this.productionOptions = this.allProductionOptions.slice(0, 500);
+      // }
+    },
+    // 产品名称改变
+    handleProductChange(productNo, row) {
+      if (!productNo) {
+        this.productionOptions = this.allProductionOptions.slice(0, 500);
+        return;
+      }
+      row.productName = this.productionOptions.find(
+        (item) => item.productNo == productNo
+      )?.productName;
+      row.productType = this.productionOptions.find(
+        (item) => item.productNo == productNo
+      )?.productType;
+      this.productionOptions = this.allProductionOptions.slice(0, 500);
+    },
+
+    // 重置审计表单数据
+    resetFormData() {
+      Object.assign(this.formData, {
+        //订单表数据
+        saleNo: this.getSaleNo(), //合同号
+        saleCustomNo: "", //客户编号
+        saleDate: moment(new Date()).format("YYYY-MM-DD"), //销售单日期
+        saleOrderEstimatedTime: moment(new Date()).format("YYYY-MM-DD"), //预计下单时间
+        saleLeadTime: "1", //交货周期
+        deliveryDate: moment(new Date()).format("YYYY-MM-DD"),
+        saleAmounts: "", //合计金额 小写
+        saleAmountInWords: "", //合计金额 大写
+        salePayType: "2", //支付方式
+        earnestMoney: "",
+        salesman: "", //业务员
+        saleLeader: "", //业务主管
+        finance: "", //财务部
+        production: "", //生产部
+        saleApprover: "", //批准人
+        customAddress: "", //客户地址
+        customCountryType: "", //国家类型
+        contactPerson: "", //联系人
+        // 货品明细表数据
+        lotNumber: "", //批号
+        productNo: "", //货品号
+        productName: "", //货品名称
+        productNumber: "", //销售数量
+        productWeight: "", //销售重量kg
+        productUnitPrice: "", //单价
+        productAmounts: "", //金额
+        sliceType: "", //切片类型
+        sliceTypeLabel: "",
+        colourNumberLabel: "",
+        colourNumber: "", //色号
+        remark: "", //备注
+        // 工艺表
+        craftGrid: "", //网络
+        craftOil: "", //油剂
+        craftPackage: "", //卷装
+        craftColorFastness: "", //色牢度
+        directionOfTwist: "",
+        craftOther: "", //其它工艺要求
+        craftMark: "", //包装/贴唛
+        shippingMethod: "", //运输方式
+      });
+      this.productionTableData = [];
+    },
+    // 自定义的小计计算方法
+    getSummaries(param) {
+      const { columns, data } = param;
+      console.log(columns, data);
+      const sums = [];
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = "小计";
+          return;
+        }
+        const values = data.map((item) => Number(item[column.property]));
+        if (
+          index === 1 ||
+          index === 2 ||
+          index === 3 ||
+          index === 4 ||
+          index === 8 ||
+          index === 9 ||
+          index === 10 ||
+          index === 11
+        ) {
+          sums[index] = "";
+        } else if (!values.every((value) => isNaN(value))) {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          if (index == 7 || index == 6) {
+            sums[index] = sums[index]?.toFixed(2);
+          }
+          console.log(sums[index], index);
+          if (index == 7) {
+            this.totalMoney = sums[index];
+          }
+        } else {
+          sums[index] = "N/A";
+        }
+      });
+
+      return sums;
+    },
+    // 货品表格数据删除回调
+    deleteProduct(index) {
+      this.productionTableData.splice(index, 1);
+      this.initTableValidate();
+    },
+    // 货品表格数据新增回调
+    addProduct() {
+      this.productionTableData.push({
+        saleProductNo: uuidv4(),
+        productNo: "", //货品编号
+        productType: "", //类型
+        lotNumber: "", //批号
+        productName: "", //货品名称
+        productNumber: 0, //销售数量
+        productWeight: "", //销售重量kg
+        productUnitPrice: 0, //单价
+        productAmounts: "", //金额
+        sliceType: "022", //切片类型  初始为  切片
+        sliceTypeLabel: "",
+        colourNumberLabel: "",
+        colourNumber: "", //色号
+        remark: "", //备注
+        specificationsList: [],
+        productSpecifications: "", //型号
+
+        inventoryBoxNum: "", //库存箱数
+        inventoryWeight: "", //库存重量
+      });
+      // 添加校验规则
+      this.initTableValidate();
+    },
+    // 自定义校验规则
+    validateTableField(rule, value, callback) {
+      let { message, field } = rule;
+      let index = field.split("-")[1],
+        fieldName = field.split("-")[0];
+      console.log(
+        index,
+        fieldName,
+        this.productionTableData[Number(index)][fieldName]
+      );
+      console.log(this.productionTableData);
+      if (
+        !this.productionTableData[Number(index)][fieldName] &&
+        this.productionTableData[Number(index)][fieldName] !== 0 &&
+        this.productionTableData[Number(index)][fieldName] !== "0"
+      ) {
+        callback(new Error(message));
+      } else {
+        callback();
+      }
+    },
+    // 初始化校验规则
+    initTableValidate() {
+      let length = this.productionTableData.length;
+      for (let i = 0; i < length; i++) {
+        this.rules["productNo-" + i] = [
+          {
+            // required: true,
+            message: "请选择货品",
+            trigger: "change",
+            validator: this.validateTableField,
+          },
+        ];
+        this.rules["productNumber-" + i] = [
+          {
+            // required: true,
+            message: "请输入数量",
+            trigger: "blur",
+            validator: this.validateTableField,
+          },
+        ];
+        this.rules["productUnitPrice-" + i] = [
+          {
+            // required: true,
+            message: "请输入单价",
+            trigger: "blur",
+            validator: this.validateTableField,
+          },
+        ];
+        this.rules["sliceType-" + i] = [
+          {
+            // required: true,
+            message: "请选择切片类型",
+            trigger: "change",
+            validator: this.validateTableField,
+          },
+        ];
+        this.rules["colourNumber-" + i] = [
+          {
+            // required: true,
+            message: "请选择色号",
+            trigger: "change",
+            validator: this.validateTableField,
+          },
+        ];
+      }
+      console.log(this.rules);
+    },
+    // 客户名称改变回调
+    customChangeHandler(val) {
+      // if (!val) return;
+      let customData = this.customerOptions.find(
+        (item) => item.customNo == val
+      );
+      this.formData.customAddress = customData?.customAddress || "无";
+      this.formData.customCountryType = customData?.customCountryType || "无";
+      this.formData.contactPerson = customData?.contactPerson || "无";
+    },
+    // 获取销售员角色列表
+    async getRoleUser() {
+      try {
+        let res = await getRoleUser("salesman");
+        if (res.code == 200) {
+          this.salesmanList = res.data.map((item) => {
+            return {
+              label: item.nickName,
+              value: item.nickName,
+              id: item.userId,
+            };
+          });
+        } else {
+          this.$message.error("获取销售员角色列表失败");
+        }
+      } catch (error) {
+        console.log(error);
+      }
+    },
+    //审计新增
+    async addHandler() {
+      this.isEdit = false;
+
+      await this.getDropDownData();
+      // 判断是否是销售员
+      console.log(this.userInfo);
+      this.isLeader = !this.userInfo.roles.includes("salesman");
+      if (!this.isLeader) {
+        this.createById = this.userInfo.userId;
+      }
+      await this.getRoleUser();
+      this.resetFormData();
+
+      this.title = "新增零售单";
+      this.open = true;
+      this.$nextTick(() => {
+        this.$refs.formDataRef.resetFields();
+        this.formData.orderRemark = "";
+        // this.$refs["formDataRef"].clearValidate();
+      });
+    },
+    // 获取下拉框数据
+    async getDropDownData() {
+      try {
+        // let payLoad = [
+        //   {
+        //     basicMap: {
+        //       tableName: "production",
+        //     },
+        //   },
+        //   {
+        //     basicMap: {
+        //       tableName: "customer",
+        //     },
+        //   },
+        // ];
+        // let res = await queryDropDownBoxData(payLoad);
+
+        // 新的获取客户选项数据的接口
+        let res = await listCustomer({ isEnablePaging: false });
+        if (res.code == 200) {
+          // let { customer } = res.data.resultMap;
+          // this.allProductionOptions = production || [];
+          // this.productionOptions =
+          //   this.allProductionOptions.slice(0, 100) || [];
+          this.customerOptions = res.rows || [];
+        } else {
+          throw Error("获取下拉框数据失败");
+        }
+        let proRes = await getSaleOrderProductionListDistinct();
+        if (proRes.code == 200) {
+          // let { production, customer } = proRes.data.resultMap;
+          this.productionOptions = proRes.data;
+        } else {
+          throw Error("获取下拉框数据失败");
+        }
+        let allProRes = await getSaleOrderProductionList();
+        if (allProRes.code == 200) {
+          this.allProductionOptions = allProRes.data || [];
+        } else {
+          console.log(allProRes);
+        }
+      } catch (error) {
+        console.log(error);
+      }
+      // 色号数据
+      try {
+        let payLoad = [
+          {
+            basicMap: {
+              tableName: "materiel",
+            },
+            conditionMap: {
+              materiel_species: ["1"],
+            },
+          },
+        ];
+        // let res = await queryDropDownBoxData(payLoad);
+        let res = await queryMaterielList();
+        if (res.code == 200) {
+          // let { materiel } = res.data;
+          this.colourNumberOptions = res.data || [];
+        } else {
+          throw Error("获取下拉框数据失败");
+        }
+      } catch (error) {
+        console.log(error);
+      }
+      // 切片型号
+      try {
+        let payLoad = [
+          {
+            basicMap: {
+              tableName: "materiel",
+            },
+            conditionMap: {
+              materiel_species: ["6"],
+            },
+          },
+        ];
+        let res = await queryDropDownBoxData(payLoad);
+        if (res.code == 200) {
+          console.log(res.data.resultMap);
+          let { materiel } = res.data.resultMap;
+          this.sliceTypeOptions = materiel || [];
+        } else {
+          throw Error("获取下拉框数据失败");
+        }
+      } catch (error) {
+        console.log(error);
+      }
+    },
+    //
+    // 获取row-key
+    getRowKey(row) {
+      return row[
+        camelCase(this.tableName + "_" + this.templateInfo.template?.primaryKey)
+        ];
+    },
+    /** 查询列表 */
+    async getList() {
+      this.loading = true;
+      try {
+        let res = await saleOrderList(this.queryParams);
+        console.log(res);
+        if (res.code == 200) {
+          this.tableList = res.rows;
+          console.log(this.dict.type.sales_order_status);
+          this.tableList.forEach((item) => {
+            item.listClass = this.dict.type.sales_order_status.find(
+              (i) => i.value == item.status
+            ).raw.listClass;
+          });
+          this.total = res.total;
+        } else {
+          this.$message.error(res.msg);
+        }
+        this.loading = false;
+      } catch (error) {
+        console.log(error);
+        this.loading = false;
+      }
+    },
+    // 校验定金
+    validateEarnestMoney(rule, value, callback) {
+      console.log(value);
+      if (this.formData.salePayType == "1") {
+        if (value == "" || value == null || value == undefined) {
+          callback(new Error("请输入定金金额"));
+        } else {
+          callback();
+        }
+      } else {
+        callback();
+      }
+    },
+    // 校验订单号是否有效
+    async validateOrderNo(rule, value, callback) {
+      console.log(value);
+      // let saleNo = this.formData.orderNo;
+      // 检验订单号合法
+      let checkNoPayload = {
+        saleNo: value,
+      };
+      if (this.isEdit) {
+        checkNoPayload.id = this.formData.id;
+      }
+      let result = await checkOrderNo(checkNoPayload);
+      if (result.code == 200) {
+        if (result.data) {
+          callback();
+        } else {
+          callback(new Error("合同号已存在"));
+        }
+      } else {
+        callback(new Error("校验失败,请稍后再试"));
+      }
+    },
+    // 校验表格数据
+    validateTableData() {
+      if (this.productionTableData.length == 0) {
+        return {
+          res: false,
+          msg: "请添加货品明细",
+        };
+      }
+      let res = this.productionTableData.every((item) => {
+        return (
+          item.productNo &&
+          item.productNumber &&
+          item.productUnitPrice &&
+          item.productAmounts &&
+          item.sliceType &&
+          item.colourNumber
+        );
+      });
+      if (!res) {
+        return {
+          res: false,
+          msg: "请填写完整货品明细",
+        };
+      }
+      return {
+        res: true,
+        msg: "",
+      };
+    },
+    // 审计   提交编辑结果按钮回调
+    async editConfirm() {
+      // let tableValidate = this.validateTableData();
+      // if (!tableValidate.res) {
+      //   this.$message.warning(tableValidate.msg);
+      // }
+      this.$refs.formDataRef.validate(async (valid) => {
+        if (valid) {
+          console.log(valid);
+
+          let {
+            id,
+            //订单表数据
+            saleNo,
+            saleCustomNo,
+            saleDate,
+            saleOrderEstimatedTime,
+            saleLeadTime,
+            deliveryDate,
+            saleAmounts,
+            saleAmountInWords,
+            salePayType,
+            salesman,
+            customAddress,
+            customCountryType, //国家类型
+            contactPerson, //联系人
+
+            // 工艺表数据
+            orderRemark,
+          } = this.formData;
+          let payload = {
+            createById: this.createById,
+            saleOrderTechnologyNo: "retailOrder",
+            saleNo,
+            saleCustomNo,
+            saleDate,
+            saleOrderEstimatedTime,
+            saleLeadTime,
+            deliveryDate,
+            saleAmounts,
+            saleAmountInWords,
+            salePayType,
+            customAddress, //客户地址
+            customCountryType, //国家类型
+            contactPerson, //联系人
+            remark: orderRemark,
+            salesman: this.isLeader ? salesman : this.nickName,
+            status: 1,
+          };
+          payload.saleProductsList = this.productionTableData;
+
+          // 准备  提交  数据 start
+          this.form.saleCustomNo = saleCustomNo;
+          this.form.salesman = salesman;
+          this.form.noticeDate = moment(new Date()).format("YYYY-MM-DD");
+          this.form.drawer = this.username;
+          this.form.documentType = "1";
+          this.form.billingType = "1";
+          this.form.saleOrderNo = saleNo;
+          this.form.dispatchNoteRemark = orderRemark;
+          this.form.customerId = this.customerOptions.find(
+            (item) => item.customNo == saleCustomNo
+          )?.id;
+          // 准备  提交  数据 end
+          if (this.isEdit) {
+            payload.id = id;
+            payload.truckRegistration = this.form.truckRegistration;
+            delete payload.status;
+            let res = await editRetailOrder(payload);
+            if (res.code === 200) {
+              this.$message.success("修改成功");
+              this.open = false;
+              this.getList();
+            } else {
+              this.$message.error("修改失败");
+            }
+          } else {
+            //新增
+            payload.orderType = 1;
+            let res = await addRetailOrder(payload);
+            if (res.code == 200) {
+              // 准备新增时 提交  数据 start
+              this.form.noticeNumber = this.getOrderNo();
+              this.form.status = 5;
+              this.form.id = res.data;
+              // 提交 新增接口
+              let result = await submitRetailOrder({
+                ...this.form,
+                saleProductInfoList: this.productionTableData,
+              });
+              if (result.code == 200) {
+                this.$message.success("提交成功");
+                this.open = false;
+                this.getList();
+              } else {
+                this.$message.error("提交失败");
+              }
+              // 准备新增时 提交  数据 end
+            } else {
+              this.$message.error("添加失败");
+            }
+          }
+          // Object.keys(saleValue).map((k) => {
+          //   saleData.commMap[k] = saleValue[k];
+          // });
+        } else {
+          this.$message.warning("请填写完整信息");
+        }
+      });
+    },
+    // 单号生成
+    getOrderNo() {
+      let year = new Date().getFullYear();
+      let month = new Date().getMonth() + 1;
+      let day = new Date().getDate();
+      if (month < 10) {
+        month = "0" + month;
+      }
+      if (day < 10) {
+        day = "0" + day;
+      }
+      let hour = new Date().getHours();
+      let minute = new Date().getMinutes();
+      let second = new Date().getSeconds();
+      if (hour < 10) {
+        hour = "0" + hour;
+      }
+      if (minute < 10) {
+        minute = "0" + minute;
+      }
+      if (second < 10) {
+        second = "0" + second;
+      }
+      let orderNo = year + month + day + hour + minute + second;
+      return orderNo;
+    },
+    // 审计   编辑回调
+    async handleEdit(index, row) {
+      console.log(row);
+      let { saleOrderSaleNo } = row;
+      try {
+        let payLoad = [
+          {
+            basicMap: {
+              tableName: "sale_order",
+            },
+            conditionMap: {
+              sale_no: [saleOrderSaleNo],
+            },
+          },
+          {
+            basicMap: {
+              tableName: "sale_products",
+            },
+            conditionMap: {
+              sale_order_no: [saleOrderSaleNo],
+            },
+          },
+          {
+            basicMap: {
+              tableName: "sale_craft",
+            },
+            conditionMap: {
+              sale_order_no: [saleOrderSaleNo],
+            },
+          },
+        ];
+        let res = await queryDropDownBoxData(payLoad);
+        if (res.code == 200) {
+          this.isEdit = true;
+          let { sale_craft, sale_order, sale_products } = res.data.resultMap;
+
+          Object.assign(this.formData, {
+            ...sale_craft[0],
+            ...sale_order[0],
+          });
+          let { saleDate, saleOrderEstimatedTime, deliveryDate } =
+            sale_order[0];
+          saleDate && (this.formData.saleDate = new Date(saleDate));
+          saleOrderEstimatedTime &&
+          (this.formData.saleOrderEstimatedTime = saleOrderEstimatedTime);
+          deliveryDate && (this.formData.deliveryDate = new Date(deliveryDate));
+
+          this.productIds = sale_products.map((item) => item.saleProductNo);
+
+          await this.getDropDownData();
+          this.productionTableData = sale_products.map((item) => {
+            item.productType = this.allProductionOptions.find(
+              (i) => item.productNo == i.productNo
+            )?.productType;
+            return item;
+          });
+          if (this.formData.saleCustomNo) {
+            this.customChangeHandler(this.formData.saleCustomNo);
+          }
+          this.title = "编辑审计单";
+          this.open = true;
+        }
+      } catch (error) {
+        console.log(error);
+      }
+    },
+    // 审计   批量删除回调
+    async batchDelete() {
+      if (!this.ids.length) return;
+      try {
+        await this.$confirm("是否确认删除选中的数据?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        let orderPayload = {
+          basicMap: {
+            tableName: "sale_order",
+          },
+          conditionMap: {
+            saleNo: this.ids,
+          },
+        };
+        let productsPayload = {
+          basicMap: {
+            tableName: "sale_products",
+          },
+          conditionMap: {
+            saleOrderNo: this.ids,
+          },
+        };
+        let craftPayload = {
+          basicMap: {
+            tableName: "sale_craft",
+          },
+          conditionMap: {
+            saleOrderNo: this.ids,
+          },
+        };
+        let orderRes = await delTableData(orderPayload);
+        // let productRes = await delTableData(productsPayload);
+        // let craftRes = await delTableData(craftPayload);
+        if (orderRes.code == 200) {
+          this.$message.success("删除成功");
+          this.getList();
+        } else {
+          this.$message.error("删除失败");
+          throw Error("删除失败");
+        }
+        this.ids = [];
+        this.$refs.tableRef.clearSelection();
+      } catch (error) {
+        console.log(error);
+      }
+    },
+    // 计算金额
+    computedPrice(row) {
+      let { productNumber, productUnitPrice } = row;
+      console.log(
+        "productNumber, productUnitPrice",
+        productNumber,
+        productUnitPrice
+      );
+      row.productAmounts = (
+        Number(productNumber) * Number(productUnitPrice)
+      ).toFixed(2);
+    },
+    isUpperCase(char) {
+      return char === char.toUpperCase();
+    },
+    // 下划线命名转驼峰命名
+    toUnderScoreCase(str) {
+      if (str === null) {
+        return null;
+      }
+      let sb = "";
+      // 前置字符是否大写
+      let preCharIsUpperCase = true;
+      // 当前字符是否大写
+      let curreCharIsUpperCase = true;
+      // 下一字符是否大写
+      let nexteCharIsUpperCase = true;
+      for (let i = 0; i < str.length; i++) {
+        let c = str.charAt(i);
+        if (i > 0) {
+          preCharIsUpperCase = isUpperCase(str.charAt(i - 1));
+        } else {
+          preCharIsUpperCase = false;
+        }
+
+        curreCharIsUpperCase = isUpperCase(c);
+
+        if (i < str.length - 1) {
+          nexteCharIsUpperCase = isUpperCase(str.charAt(i + 1));
+        }
+
+        if (
+          preCharIsUpperCase &&
+          curreCharIsUpperCase &&
+          !nexteCharIsUpperCase
+        ) {
+          sb += SEPARATOR;
+        } else if (i !== 0 && !preCharIsUpperCase && curreCharIsUpperCase) {
+          sb += SEPARATOR;
+        }
+        sb += c.toLowerCase();
+      }
+
+      return sb;
+    },
+    // 处理列表信息
+    columnsHandler(columns) {
+      let resArr = [];
+      console.log(columns, 111);
+      columns.forEach((item) => {
+        for (const key in item) {
+          let tempObj = {};
+          tempObj.key = camelCase(key);
+          tempObj.value = item[key];
+          resArr.push(tempObj);
+        }
+      });
+      console.log(resArr, 222);
+      return resArr;
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      // this.reset();
+    },
+    // k-form-build 取消按钮
+    kCancel() {
+      this.kOpen = false;
+      // this.reset();
+    },
+    // 分页查询
+    pageList(row) {
+      // 调用子组件-》携带子组件参数请求后台
+      this.$refs.mychild.pageList(
+        row == undefined
+          ? {
+            limit: this.queryParams.pageSize,
+            page: this.queryParams.pageNum,
+          }
+          : row
+      );
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      // this.ids = selection.map(
+      //   (item) =>
+      //     item[
+      //       camelCase(
+      //         this.tableName + "_" + this.templateInfo.template?.primaryKey
+      //       )
+      //     ]
+      // );
+      this.selection = selection;
+      this.myDelIds = selection.map((item) => item.id);
+      console.log(this.myDelIds);
+      this.ids = selection.map((item) => item.saleOrderSaleNo);
+      this.single = selection.length != 1;
+      this.multiple = !selection.length;
+    },
+
+    // 更多操作触发
+    handleCommand(command, row) {
+      switch (command) {
+        case "handleResetPwd":
+          this.handleResetPwd(row);
+          break;
+        case "handleAuthRole":
+          this.handleAuthRole(row);
+          break;
+        default:
+          break;
+      }
+    },
+    /** 新增按钮操作 */
+    handleAdd(row) {
+      // this.reset();
+      this.defaultValue = {};
+      getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({ data }) => {
+        if (!data || !data.dfVueTemplate) {
+          this.jsonData = false;
+          this.$message.error("当前表格未绑定表单!");
+          return;
+        }
+        if (data.dfFormSql) {
+          let dynamicData = JSON.parse(data.dfFormSql);
+          Object.assign(this.dynamicData, dynamicData);
+        }
+        this.jsonData = JSON.parse(data.dfVueTemplate);
+        this.open = true;
+        this.title = "添加信息";
+        this.form.password = this.initPassword;
+        this.$nextTick(() => {
+          this.$refs.addFromRef.reset();
+          inputDisableComplete();
+        });
+      });
+    },
+    longestCommonSubstring(strs) {
+      if (!strs || strs.includes("")) return "";
+      let str1_Length = strs[0].length;
+      let str_Nums = strs.length;
+      let flag = 0;
+      for (let i = 0; i < str1_Length && flag == 0; i++) {
+        let char = strs[0][i];
+        for (var j = 1; j < str_Nums; j++) {
+          if (char !== strs[j][i] || i == strs[j].length) {
+            return strs[1].substring(0, i);
+          }
+        }
+      }
+      return strs[0];
+    },
+    // 绑定dialog对话框关闭
+    handleClose() {
+      this.btnDialogVisible = false;
+    },
+    getLastUppercaseWord(text) {
+      const pattern = /\b[A-Z][a-z]*\b/g;
+      const matches = [...text.matchAll(pattern)];
+      if (matches.length > 0) {
+        const lastMatch = matches[matches.length - 1][0];
+        return lastMatch;
+      } else {
+        return null;
+      }
+    },
+    // 初始化数据
+    async initData(data) {
+      let {
+        id,
+        //订单表数据
+        saleNo,
+        saleCustomNo,
+        saleDate,
+        saleOrderEstimatedTime,
+        saleLeadTime,
+        deliveryDate,
+        saleAmounts,
+        saleAmountInWords,
+        salePayType,
+        salesman,
+        customAddress,
+        customCountryType, //国家类型
+        contactPerson, //联系人
+        truckRegistration, //货车登记
+
+        // 工艺表数据
+        remark,
+
+        // 产品列表
+        saleProductsList,
+      } = data;
+      this.form.truckRegistration = truckRegistration;
+      Object.assign(this.formData, {
+        id,
+        //订单表数据
+        saleNo,
+        saleCustomNo,
+        saleDate,
+        saleOrderEstimatedTime,
+        saleLeadTime,
+        deliveryDate,
+        saleAmounts,
+        saleAmountInWords,
+        salePayType,
+        salesman,
+        customAddress,
+        customCountryType, //国家类型
+        contactPerson, //联系人
+
+        // 工艺表数据
+        orderRemark: remark,
+      });
+      this.customChangeHandler(saleCustomNo);
+      let promiseArr = [],
+        promiseArr2 = [];
+      this.productionTableData = saleProductsList.map((item, index) => {
+        let {
+          id,
+          saleProductNo,
+          productNo, //货品编号
+          productName, //货品名称
+          productNumber, //销售数量
+          productWeight, //销售重量kg
+          productUnitPrice, //单价
+          productAmounts, //金额
+          sliceType, //切片类型  初始为  切片
+          sliceTypeLabel,
+          colourNumberLabel,
+          colourNumber, //色号
+          remark, //备注
+          lotNumber, //批号
+        } = item;
+        let targetItem = this.allProductionOptions.find(
+          (i) => item.productNo == i.productNo
+        );
+        // item.productType = targetItem?.productType;
+        let productType = targetItem?.productType;
+        let productSpecifications = targetItem?.productSpecifications;
+        promiseArr[index] = getProductSpecificationsByProductName({
+          productName: item.productName,
+        });
+        promiseArr2[index] = getProductInventory({
+          productNo,
+          productType,
+          lotNumber,
+          productName,
+          productSpecifications,
+        });
+        return {
+          id,
+          saleProductNo,
+          productSpecifications, //规格
+          productNo, //货品编号
+          productType, //类型
+          productName, //货品名称
+          productNumber, //销售数量
+          productWeight, //销售重量kg
+          productUnitPrice, //单价
+          productAmounts, //金额
+          sliceType, //切片类型  初始为  切片
+          sliceTypeLabel,
+          colourNumberLabel,
+          colourNumber, //色号
+          remark,
+          lotNumber,
+          inventoryBoxNum: 0,
+          inventoryWeight: 0,
+          specificationsList: [],
+        };
+      });
+      let promiseRes = await Promise.all(promiseArr);
+      promiseRes.forEach((item, index) => {
+        this.productionTableData[index].specificationsList = item.data;
+      });
+      let promiseRes2 = await Promise.all(promiseArr2);
+      promiseRes2.forEach((item, index) => {
+        this.productionTableData[index].inventoryWeight =
+          item.data.inventoryWeight || 0;
+        this.productionTableData[index].inventoryBoxNum =
+          item.data.inventoryBoxNum || 0;
+      });
+      // this.productionTableData.forEach((item, index) => {
+      //   item.inventoryWeight=promiseArr2[index].
+      // });
+
+      this.initTableValidate();
+    },
+    /** 修改按钮操作 */
+    async handleUpdate(row) {
+      console.log(row);
+      this.isEdit = true;
+      await this.getDropDownData();
+      this.isLeader = !this.userInfo.roles.includes("salesman");
+      if (!this.isLeader) {
+        this.createById = this.userInfo.userId;
+      }
+      await this.getRoleUser();
+      this.title = "修改零售单";
+      try {
+        let res = await getRetailOrderInfo(row.id);
+        console.log(res);
+        if (res.code == 200) {
+          this.initData(res.data);
+          this.open = true;
+        } else {
+          this.$message.error(res.msg);
+        }
+      } catch (error) {
+        console.log(error);
+      }
+    },
+    //详情  打印回调
+    async handlePrint(row) {
+      await this.getDropDownData();
+      this.isLeader = !this.userInfo.roles.includes("salesman");
+      if (!this.isLeader) {
+        this.createById = this.userInfo.userId;
+      }
+      await this.getRoleUser();
+      try {
+        let res = await getRetailOrderInfo(row.id);
+        console.log(res);
+        if (res.code == 200) {
+          await this.initData(res.data);
+          this.printDomData = this.getPrintDom(res.data);
+          this.detailShow = true;
+          this.$nextTick(() => {
+            this.$refs.detailTable.innerHTML = this.printDomData;
+          });
+        } else {
+          this.$message.error(res.msg);
+        }
+      } catch (error) {
+        console.log(error);
+      }
+    },
+    // 提交  回调
+    async handleSubmit(row) {
+      this.deliverShow = true;
+      this.$nextTick(() => {
+        this.$refs.deliverRef.productInvoiceInfo(row);
+      });
+    },
+    // 取消提交
+    async handleSubmitCancel(row) {
+      console.log(row);
+      this.$confirm("此操作将撤回该次提交, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          // this.$message({
+          //   type: 'success',
+          //   message: '删除成功!'
+          // });
+          try {
+            let { saleNo } = row;
+            let payLoad = {
+              saleOrderNo: saleNo,
+              status: 1,
+            };
+            let res = await cancelRetailOrder(payLoad);
+            if (res.code == 200) {
+              this.$message.success("取消成功");
+              this.getList();
+            } else {
+              this.$message.error("取消失败");
+              console.log(res);
+            }
+          } catch (error) {
+            console.log(error);
+          }
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消",
+          });
+        });
+    },
+    // 获取打印dom
+    getPrintDom(data) {
+      let {
+        id,
+        //订单表数据
+        saleNo,
+        saleCustomNo,
+        saleDate,
+        saleOrderEstimatedTime,
+        saleLeadTime,
+        deliveryDate,
+        saleAmounts,
+        saleAmountInWords,
+        salePayType,
+        salesman,
+        customAddress,
+        customCountryType, //国家类型
+        contactPerson, //联系人
+
+        // 工艺表数据
+        orderRemark,
+      } = this.formData;
+      console.log(this.form, this.productionTableData);
+      let { truckRegistration } = this.form;
+      let customData = this.customerOptions.find(
+        (item) => item.customNo == saleCustomNo
+      );
+      let customerName = customData ? customData.customName : "";
+      let printStr = `
+        <table style="width:1200px; border-collapse:collapse;" border="1" cellpadding="10" align="center">
+            <div style="text-align:center;font-size: 20px;">诸暨市新丝维纤维有限公司</div>
+            <div style="text-align:center;">销售合同审计单</div>
+            <tbody>
+                <tr>
+                    <td width="600px" colspan="4">合同号:${saleNo}</td>
+                    <td width="600px" colspan="5">日期:${saleDate.replace(
+        "T",
+        " "
+      )}</td>
+                </tr>
+                <tr align="center">
+                    <td width="300px" colspan="2">客户名称:</td>
+                    <td width="300px" colspan="3">${customerName}</td>
+                    <td colspan="2">业务员:</td>
+                    <td colspan="2">${salesman}</td>
+
+                </tr>
+                <tr align="center">
+                    <td width="300px" colspan="2">客户地址:</td>
+                    <td width="300px" colspan="3">${customAddress}</td>
+                    <td width="300px" colspan="2">客户国别:</td>
+                    <td width="300px" colspan="2">${customCountryType}</td>
+                </tr>
+                <tr align="center">
+                    <td width="300px" colspan="2">联系人:</td>
+                    <td width="150px" colspan="2">${contactPerson}</td>
+                    <td  colspan="2">合计金额(大写):</td>
+                    <td colspan="3">${saleAmountInWords}</td>
+                </tr>
+                <tr align="center">
+                    <td colspan="9">货品明细</td>
+                </tr>
+                <tr align="center">
+                    <td width="150px">品名</td>
+                    <td width="100px">规格</td>
+                    <td width="100px">色号</td>
+                    <td width="100px">类型</td>
+                    <td width="100px">批号</td>
+                    <td width="100px">箱数</td>
+                    <td width="100px">单价</td>
+                    <td width="100px">金额</td>
+                    <td width="100px">备注</td>
+                </tr>`;
+      let amountTotal = 0,
+        singlTotal = 0,
+        moneyTotal = 0;
+      for (let i = 0; i < this.productionTableData.length; i++) {
+        let item = this.productionTableData[i];
+        amountTotal += Number(item.productNumber);
+        singlTotal += Number(item.productUnitPrice);
+        moneyTotal += Number(item.productAmounts);
+        let productData = this.allProductionOptions.find(
+          (pro) => pro.productNo == item.productNo
+        );
+        item.sliceTypeLabel =
+          this.sliceTypeOptions.find((k) => k.materielCode == item.sliceType)
+            ?.materielName || "";
+        item.colourNumberLabel = this.colourNumberOptions.find(
+          (k) => k.materielCode == item.colourNumber
+        )?.materieColorNumber;
+        let productName = productData ? productData.productName : "";
+        let productType = productData ? productData.productType : "";
+        printStr += `<tr align="center">
+                    <td>${item.productName}</td>
+                    <td>${item.productSpecifications}</td>
+                    <td>${item.colourNumberLabel}</td>
+                    <td>${item.productType}</td>
+                    <td>${item.lotNumber}</td>
+                    <td>${item.productNumber}</td>
+                    <td>${item.productUnitPrice}</td>
+                    <td>${item.productAmounts}</td>
+                    <td>${item.remark}</td>
+                </tr>`;
+      }
+      // 计算小计
+      amountTotal = amountTotal;
+      singlTotal = singlTotal.toFixed(2);
+      moneyTotal = moneyTotal.toFixed(2);
+      printStr += `
+        <tr align="center">
+          <td>小计:</td>
+           <td></td>
+           <td></td>
+          <td></td>
+          <td></td>
+          <td>${amountTotal}</td>
+          <td>${singlTotal}</td>
+          <td>${moneyTotal}</td>
+          <td></td>
+        </tr>`;
+      printStr += `<tr align="left">
+                    <td colspan="9">订单备注:${orderRemark}</td>
+                </tr>
+                </tbody>
+        </table>`;
+      return printStr;
+    },
+    // 添加真正的字段名
+    addRealFieldName(row) {
+      let fieldList = Object.keys(row);
+      // let tableName = this.longestCommonSubstring(fieldList);
+      let tableName = camelCase(this.tableName);
+      fieldList.forEach((field) => {
+        let realField = field.replace(tableName, "");
+        realField = realField[0].toLocaleLowerCase() + realField.substring(1);
+        row[realField] = row[field];
+      });
+    },
+
+    /** 提交按钮 */
+    submitForm: function () {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          if (this.form.userId != undefined) {
+            updateUser(this.form).then((response) => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addUser(this.form).then((response) => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作
+     *
+     * 删除提示信息语句(标识)
+     * */
+    handleDelete(row, btnData) {
+      let delIds = this.ids;
+      let primary = camelCase(this.templateInfo.template?.primaryKey);
+      // let realyKey=
+      this.addRealFieldName(row);
+      if (row[primary] != undefined && row[primary] != null) {
+        delIds = [];
+        delIds.push(row[primary]);
+      }
+      let data = {
+        basicMap: {
+          btnType: btnData.btnType,
+          btnKey: btnData.btnKey,
+          tableName: this.tableName,
+        },
+        conditionMap: {
+          // id: delIds,
+        },
+        btnParametersMap: {},
+      };
+      if (this.currentBtnData.btnParams) {
+        let btnParams =
+          JSON.parse(this.currentBtnData.btnParams)?.commonFieldData || [];
+        let conditionData =
+          JSON.parse(this.currentBtnData.btnParams).conditionData || [];
+        conditionData.forEach((item) => {
+          data.conditionMap[item.fieldName.split(".")[1]] = item.fieldValue
+            ? item.fieldValue
+            : this.currentRow[camelCase(item.fieldName.replace(".", "_"))];
+        });
+        btnParams.forEach((item) => {
+          data.btnParametersMap[item.fieldName.split(".")[1]] = item.fieldValue
+            ? item.fieldValue
+            : this.currentRow[camelCase(item.fieldName.replace(".", "_"))];
+        });
+      }
+      // data.conditionMap[this.templateInfo.template?.primaryKey] = delIds;
+      this.$modal
+        .confirm('是否确认删除"' + delIds + '"的数据项?')
+        .then(function () {
+          // return delTableData(data);
+          return btnCommonApi(data);
+        })
+        .then(() => {
+          // 调用子组件查询方法 目的是携带上子组件中的查询参数
+          this.$refs.mychild.pageList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+    // 批量删除接口
+    handleBatchDelete() {
+      let delIds = this.ids;
+      let primary = camelCase(this.templateInfo.template?.primaryKey);
+      // if (row && row[primary] != undefined && row[primary] != null) {
+      //   delIds = [];
+      //   delIds.push(row[primary]);
+      // }
+      let data = {
+        basicMap: {
+          tableName: this.tableName,
+        },
+        conditionMap: {
+          // id: delIds,
+        },
+      };
+      // if (this.currentBtnData.btnParams) {
+      //   let btnParams = JSON.parse(this.currentBtnData.btnParams);
+      //   btnParams.forEach((item) => {
+      //     data.btnParametersMap[
+      //       this.formatField(item.fieldName, camelCase(this.tableName))
+      //     ] = item.fieldValue
+      //       ? item.fieldValue
+      //       : this.currentRow[item.fieldName];
+      //   });
+      // }
+      data.conditionMap[this.templateInfo.template?.primaryKey] = delIds;
+      this.$modal
+        .confirm('是否确认删除"' + delIds + '"的数据项?')
+        .then(function () {
+          return delTableData(data);
+          // return btnCommonApi(data);
+        })
+        .then(() => {
+          // 调用子组件查询方法 目的是携带上子组件中的查询参数
+          this.$refs.mychild.pageList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      let primary = "saleOrderId";
+      let realyKey = "saleOrderId";
+      if (this.myDelIds.length > 0) {
+        this.queryParams["execlMap"] = [];
+        this.myDelIds.forEach((item) => {
+          this.queryParams.execlMap.push(
+            this.tableList.find((ttem) => {
+              return ttem[realyKey] === item;
+            })
+          );
+        });
+      } else {
+        this.$message.warning("请至少勾选一条导出数据");
+        return;
+      }
+      this.queryParams.execlMap = JSON.stringify(this.queryParams.execlMap);
+      this.download(
+        process.env.VUE_APP_BASE_API1 + "common/export",
+        {
+          ...this.queryParams,
+        },
+        `文件名称_${new Date().getTime()}.xlsx`
+      );
+    },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.title = "当前导入";
+      this.upload.open = true;
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      this.download(
+        process.env.VUE_APP_BASE_API1 +
+        `common/exportTemplate?tableName=${this.tableName}&sqlkey=${this.templateInfo.template.sqlKey}`,
+        {},
+        `下载模版名称${new Date().getTime()}.xlsx`
+      );
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(
+        "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
+        response.msg +
+        "</div>",
+        "导入结果",
+        { dangerouslyUseHTMLString: true }
+      );
+      this.$refs.mychild.pageList({
+        limit: this.queryParams.pageSize,
+        page: this.queryParams.pageNum,
+      });
+    },
+    //重点在这里
+    handleChange(file, fileList) {
+      file.name = this.tableName + "." + file.name.split(".")[1];
+      fileList.forEach((item) => {
+        item.name = this.tableName + "." + file.name.split(".")[1];
+      });
+      let newFile = new File(
+        [file],
+        this.tableName + "." + file.name.split(".")[1]
+      ); //创建出来也是不可编辑的file对象
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
+    // 弹窗新增的数
+    addListHandler(val) {
+      this.addLists.push(...val);
+    },
+    // 绑定弹窗Dialog确定按钮
+    async btnComfirm() {
+      let res = await this.$refs.deliverRef.getAllData();
+      let { flag, isEdit, data } = res;
+      if (flag) {
+        // if (isEdit) {
+        //   //编辑
+        //   let payLoad = {
+        //     ...data.formData,
+        //     saleProductInfoList: data.tableData,
+        //   };
+        //   let res = await updateProductInvoice(payLoad);
+        //   if (res.code == 200) {
+        //     this.$message.success("修改成功");
+        //     this.deliverShow = false;
+        //     this.getList();
+        //   } else {
+        //     this.$message.error("网络异常");
+        //   }
+        // } else {
+        //新增
+        let payLoad = {
+          ...data.formData,
+          saleProductInfoList: data.tableData,
+        };
+
+        // let res = await addProductInvoice(payLoad);
+        let reqAPI = isEdit ? submitProductInvoice : submitRetailOrder;
+        if (!isEdit) {
+          payLoad.status = 5;
+        }
+        let res = await reqAPI(payLoad);
+        if (res.code == 200) {
+          this.$message.success("提交成功");
+          this.deliverShow = false;
+          this.getList();
+        } else {
+          this.$message.error("网络异常");
+        }
+        // }
+      }
+    },
+    // 保存提交数据
+    async btnSave() {
+      let res = await this.$refs.deliverRef.getAllData();
+      let { flag, isEdit, data } = res;
+      if (flag) {
+        let payLoad = {
+          ...data.formData,
+          saleProductInfoList: data.tableData,
+        };
+        payLoad.status = 1;
+        let res = await updateProductInvoice(payLoad);
+        if (res.code == 200) {
+          this.$message.success("保存成功");
+          this.deliverShow = false;
+          this.getList();
+        } else {
+          this.$message.error("网络异常");
+        }
+        // }
+      }
+    },
+    // 去掉表名 开头字母小写
+    formatField(field = "", tableName) {
+      let temp = field.replace(tableName, "");
+      return toUnderline(temp[0].toLowerCase() + temp.slice(1));
+    },
+    //提交编辑结果按钮回调
+    async editConfirmHandler() {
+      if (this.$refs.addFromRef) {
+        this.$refs.addFromRef
+          .getData()
+          .then(async (values) => {
+            let data = {
+              basicMap: {
+                tableName: this.tableName,
+                // btnKey: btnData.btnKey,
+                btnKey: this.currentBtnData.btnKey,
+              },
+              addListMap: [values],
+              conditionMap: {},
+              commMap: {},
+              btnParametersMap: {},
+            };
+            if (this.currentBtnData.btnParams) {
+              let btnParams =
+                JSON.parse(this.currentBtnData.btnParams)?.commonFieldData ||
+                [];
+              let conditionData =
+                JSON.parse(this.currentBtnData.btnParams).conditionData || [];
+              // let
+              btnParams.forEach((item) => {
+                data.btnParametersMap[item.fieldName.split(".")[1]] =
+                  item.fieldValue
+                    ? item.fieldValue
+                    : this.currentRow[
+                      camelCase(item.fieldName.replace(".", "_"))
+                      ];
+              });
+              conditionData.forEach((item) => {
+                data.conditionMap[item.fieldName.split(".")[1]] =
+                  item.fieldValue
+                    ? item.fieldValue
+                    : this.currentRow[
+                      camelCase(item.fieldName.replace(".", "_"))
+                      ];
+              });
+            }
+            if (Object.keys(this.defaultValue).length) {
+              // data.conditionMap[this.templateInfo.template?.primaryKey] =
+              //   this.defaultValue[this.templateInfo.template?.primaryKey];
+              Object.keys(values).map((k) => {
+                data.commMap[k] = values[k];
+              });
+              data.basicMap.btnType = this.currentBtnData.btnType;
+              data.basicMap.visible = true;
+            } else {
+              data.basicMap.btnType = "INSERT";
+              data.basicMap.visible = true;
+            }
+            try {
+              let res = await btnCommonApi(data);
+              if (res.code == 200) {
+                this.$message.success("操作成功");
+              } else {
+                this.$message.error("网络异常,请稍后再试");
+              }
+            } catch (error) {
+              console.log(error);
+              this.$message.error("网络异常,请稍后再试");
+            }
+            this.getList();
+            this.defaultValue = {};
+            this.kOpen = false;
+          })
+          .catch((res) => {
+            console.log(res);
+            this.$modal.msgError("表单校验失败,请规范填写数据");
+          });
+      } else {
+        // 没有绑定表单
+        let data = {
+          basicMap: {
+            tableName: this.tableName,
+            // btnKey: btnData.btnKey,
+            btnKey: this.currentBtnData.btnKey,
+            btnType: this.currentBtnData.btnType,
+            visible: true,
+          },
+          addListMap: [],
+          conditionMap: {},
+          commMap: {},
+          btnParametersMap: {},
+        };
+        if (this.currentBtnData.btnParams) {
+          let btnParams =
+            JSON.parse(this.currentBtnData.btnParams)?.commonFieldData || [];
+          let conditionData =
+            JSON.parse(this.currentBtnData.btnParams).conditionData || [];
+          conditionData.forEach((item) => {
+            data.conditionMap[item.fieldName.split(".")[1]] = item.fieldValue
+              ? item.fieldValue
+              : this.currentRow[camelCase(item.fieldName.replace(".", "_"))];
+          });
+          btnParams.forEach((item) => {
+            data.btnParametersMap[item.fieldName.split(".")[1]] =
+              item.fieldValue
+                ? item.fieldValue
+                : this.currentRow[camelCase(item.fieldName.replace(".", "_"))];
+          });
+        }
+        // data.basicMap.btnType = this.currentBtnData.btnType;
+        // data.basicMap.visible = true;
+        try {
+          let res = await btnCommonApi(data);
+          if (res.code == 200) {
+            this.$message.success("操作成功");
+          } else {
+            this.$message.error("网络异常,请稍后再试");
+          }
+        } catch (error) {
+          console.log(error);
+          this.$message.error("网络异常,请稍后再试");
+        }
+        this.getList();
+        this.defaultValue = {};
+        this.kOpen = false;
+      }
+    },
+    // 使用提交数据类型的按钮获取数据
+    tempSubBtn(getData) {
+      getData()
+        .then((values) => {
+          console.log("验证通过", values);
+        })
+        .catch(() => {
+          console.log("验证未通过,获取失败");
+        });
+    },
+    // 判断是否生效行样式
+    cellStyle({ row, column, rowIndex, columnIndex }) {
+      let rowStyleList = this.styleList.filter((item) => item.styleType == 0);
+      if (!rowStyleList.length) return "";
+      let mainTableName = this.templateInfo.querySql.tableAlias; //主表名
+      for (let i = 0; i < rowStyleList.length; i++) {
+        let item = rowStyleList[i];
+        let judgeRes = this.determineCondition(item.styleCondtion, row);
+        if (judgeRes) {
+          let styleCode = JSON.parse(item.styleCode);
+          return `background-color:${styleCode.rowBgColor};`;
+        }
+      }
+    },
+
+    // 获取生效条件组结果
+    determineCondition(conditionStr, row) {
+      let conditionList = JSON.parse(conditionStr);
+      if (!conditionList.length) return false;
+      return conditionList.every((item) => this.judgeOneCondition(item, row));
+    },
+
+    // 获取单个判断条件结果
+    judgeOneCondition(item, row) {
+      let fullField = camelCase(item.tableName + "_" + item.fieldName);
+      switch (item.condition) {
+        case 1:
+          return row[fullField] > item.flagValue;
+        case 2:
+          return row[fullField] < item.flagValue;
+        case 3:
+          return row[fullField] == item.flagValue;
+        case 4:
+          return row[fullField] >= item.flagValue;
+        case 5:
+          return row[fullField] <= item.flagValue;
+        default:
+          return true; //默认为true
+      }
+    },
+
+    // 设置表格字段样式
+    async setFieldStyleData(tableList) {
+      console.log(JSON.parse(JSON.stringify(tableList)));
+      let fieldConditionList = this.styleList.filter(
+        (item) => item.styleType == 1 || item.styleType == 2
+      );
+      if (!fieldConditionList.length) return tableList;
+      let res = await this.setDictStyleData();
+
+      this.dictStyleObj = res.reduce((pre, item) => {
+        return {
+          ...pre,
+          ...item,
+        };
+      }, {});
+      // console.log("this.dictStyleObj", this.dictStyleObj);
+      tableList.forEach((row) => {
+        // if (!row.styleFieldObj) row.styleFieldObj = {};
+        for (let i = 0; i < fieldConditionList.length; i++) {
+          let item = fieldConditionList[i];
+          if (item.styleType == 1) {
+            //字段样式
+            let judgeRes = this.determineCondition(item.styleCondtion, row);
+            if (judgeRes) {
+              let styleCode = JSON.parse(item.styleCode);
+              if (!row.styleFieldObj) row.styleFieldObj = {};
+              row.styleFieldObj[item.styleField] = {
+                styleType: item.styleType,
+                fieldStyleType: styleCode.fieldStyleType,
+                fontColor: styleCode.fontColor,
+                isTagFullBg: styleCode.isTagFullBg,
+                tagType: styleCode.tagType,
+              };
+              // row.styleField = item.styleField; //样式生效字段
+              // row.styleType = item.styleType; //0:行样式 1:字段样式 2:字典样式
+              // row.fieldStyleType = styleCode.fieldStyleType; //0:文本  1:标签
+              // row.fontColor = styleCode.fontColor;
+              // row.isTagFullBg = styleCode.isTagFullBg; //true/false
+              // row.tagType = styleCode.tagType; //string
+            }
+          } else {
+            //字典样式
+            let dicStyle = this.dictStyleObj[item.styleField]?.find((dict) => {
+              return dict.dictValue == row[item.styleField];
+            });
+            if (dicStyle) {
+              if (!row.styleFieldObj) row.styleFieldObj = {};
+              row.styleFieldObj[item.styleField] = dicStyle; //设置该字段应该显示的字典样式
+              row.styleFieldObj[item.styleField].styleType = 2;
+            }
+          }
+        }
+      });
+      return tableList;
+    },
+
+    //设置表格字典相关数据
+    setDictStyleData() {
+      let fieldConditionList = this.styleList.filter(
+        (item) => item.styleType == 2
+      );
+      if (!fieldConditionList.length) return;
+      let PromiseList = fieldConditionList.map((item) => {
+        return new Promise((resolve, reject) => {
+          let temp = {};
+          try {
+            listData({
+              isEnablePaging: false,
+              dictType: item.styleCondtion,
+            }).then((res) => {
+              temp[item.styleField] = res.rows;
+              resolve(temp);
+            });
+          } catch (error) {
+            reject(error);
+          }
+        });
+      });
+      return Promise.all(PromiseList);
+    },
+
+    // 内链页面跳转
+    routerHandler(btnData, type) {
+      let { url, commonFieldData } = JSON.parse(btnData.btnParams);
+      let tempArr = [];
+      if (commonFieldData) {
+        let queryArr = JSON.parse(commonFieldData);
+
+        tempArr = queryArr.map((item) => {
+          let key = this.formatField(item.fieldName, camelCase(this.tableName));
+          let value = item.fieldValue
+            ? item.fieldValue
+            : this.currentRow[item.fieldName];
+          return key + "=" + value;
+        });
+      }
+      if (tempArr.length) {
+        url += "?" + tempArr.join("&");
+      }
+      // let link = btnData.btnParams;
+      if (type == "INNERLINK") {
+        this.$router.push(url);
+      } else {
+        window.open("http://" + url, "_blank");
+      }
+    },
+    async handleDetail(row) {
+      this.printDomData = await this.getDetailTableString(row);
+      this.detailShow = true;
+      this.$nextTick(() => {
+        this.$refs.detailTable.innerHTML = this.printDomData;
+      });
+    },
+    // 切片类型改变回调
+    sliceTypeChangeHandler(row) {
+      let { sliceType } = row;
+      if (sliceType) {
+        row.sliceTypeLabel = this.sliceTypeOptions.find(
+          (item) => item.materielCode == sliceType
+        )?.materielName;
+      }
+    },
+    // 色号改变回调
+    colourNumberChangeHandler(row) {
+      let { colourNumber } = row;
+      if (colourNumber) {
+        let target = this.colourNumberOptions.find(
+          (item) => item.materielCode == colourNumber
+        );
+        if (target) {
+          row.colourNumberLabel =
+            target.materieEncoding + target.materieColorNumber;
+        }
+        // row.colourNumberLabel = this.colourNumberOptions.find(
+        //   (item) => item.materielCode == colourNumber
+        // )?.materieColorNumber;
+        this.updateStorage(row);
+      }
+    },
+    // 打印回调
+    detailPrintHandler() {
+      document.body.innerHTML = document.getElementById("printDom").innerHTML =
+        this.printDomData;
+      window.print(); //打印
+      window.location.reload();
+      return false;
+    },
+    // 根据字典value获取字典label
+    getDictLabel(value, dict) {
+      return (
+        this.dict.type[dict].find((item) => {
+          return item.value === value;
+        })?.label || ""
+      );
+    },
+    // 获取详情html字符串
+    async getDetailTableString(row) {
+      let { saleOrderSaleNo } = row;
+      let payLoad = [
+        {
+          basicMap: {
+            tableName: "sale_order",
+          },
+          conditionMap: {
+            sale_no: [saleOrderSaleNo],
+          },
+        },
+        {
+          basicMap: {
+            tableName: "sale_products",
+          },
+          conditionMap: {
+            sale_order_no: [saleOrderSaleNo],
+          },
+        },
+        {
+          basicMap: {
+            tableName: "sale_craft",
+          },
+          conditionMap: {
+            sale_order_no: [saleOrderSaleNo],
+          },
+        },
+      ];
+      let res = await queryDropDownBoxData(payLoad);
+      if (res.code == 200) {
+        console.log(res);
+        let { sale_craft, sale_order, sale_products } = res.data.resultMap;
+        let {
+          //订单表数据
+          saleNo, //合同号
+          lotNumber, //批号
+          saleCustomNo, //客户编号
+          saleDate, //销售单日期
+          saleOrderEstimatedTime, //预计下单时间
+          saleLeadTime, //交货周期
+          deliveryDate,
+          saleAmounts, //合计金额 小写
+          saleAmountInWords, //合计金额 大写
+          salePayType, //支付方式
+          earnestMoney,
+          salesman, //业务员
+          saleLeader, //业务主管
+          finance, //财务部
+          production, //生产部
+          saleApprover, //批准人
+          // customAddress, //客户地址
+          // customCountryType, //国家类型
+          // contactPerson, //联系人
+          // 货品明细表数据
+          // productNo, //货品号
+          // productName, //货品名称
+          // productNumber: "", //销售数量
+          // productWeight: "", //销售重量kg
+          // productUnitPrice: "", //单价
+          // productAmounts: "", //金额
+          // remark: "", //备注
+          // 工艺表
+          craftGrid, //网络
+          craftOil, //油剂
+          craftPackage, //卷装
+          craftColorFastness, //色牢度
+          directionOfTwist,
+          craftOther, //其它工艺要求
+          craftMark, //包装/贴唛
+          shippingMethod, //运输方式
+        } = { ...sale_craft[0], ...sale_order[0] };
+        let customData = this.customerOptions.find(
+          (item) => item.customNo == saleCustomNo
+        );
+        let payType = this.getDictLabel(salePayType, "payment_method"); //付款方式
+        let customerName = customData ? customData.customName : "";
+        let customAddress = customData?.customAddress || "无";
+        let customCountryType = customData?.customCountryType || "";
+        let contactPerson = customData?.contactPerson || "无";
+        let directionOfTwistDescription = directionOfTwist
+          ? this.getDictLabel(directionOfTwist, "direction_of_twist")
+          : "";
+        let printStr = `
+        <table style="width:1200px; border-collapse:collapse;" border="1" cellpadding="10" align="center">
+            <div style="text-align:center;font-size: 20px;">诸暨市新丝维纤维有限公司</div>
+            <div style="text-align:center;">销售合同审计单</div>
+            <tbody>
+                <tr>
+                    <td width="600px" colspan="4">合同号:${saleNo}</td>
+                    <td width="600px" colspan="4">日期:${saleDate.replace(
+          "T",
+          " "
+        )}</td>
+                </tr>
+                <tr align="center">
+                    <td width="300px" colspan="2">客户名称:</td>
+                    <td width="300px" colspan="2">${customerName}</td>
+                    <td width="300px" colspan="2">联系人:</td>
+                    <td width="150px" colspan="1">${contactPerson}</td>
+                </tr>
+                <tr align="center">
+                    <td width="300px" colspan="2">客户地址:</td>
+                    <td width="300px" colspan="2">${customAddress}</td>
+                    <td width="300px" colspan="2">客户国别:</td>
+                    <td width="300px" colspan="2">${customCountryType}</td>
+                </tr>
+                <tr align="center">
+                    <td width="300px" colspan="2">预计下单时间:</td>
+                    <td  colspan="1">${saleOrderEstimatedTime.replace(
+          "T",
+          " "
+        )}</td>
+                    <td  colspan="1">交货周期:</td>
+                    <td >${saleLeadTime}</td>
+                    <td  colspan="2">交货日期:</td>
+                    <td >${deliveryDate.replace("T", " ")}</td>
+                </tr>
+                <tr align="center">
+                    <td colspan="8">货品明细</td>
+                </tr>
+                <tr align="center">
+                    <td width="150px">品名</td>
+                    <td width="150px">类型</td>
+                    <td width="150px">箱数</td>
+                    <td width="150px">单价</td>
+                    <td width="150px">金额</td>
+                    <td width="150px">切片型号</td>
+                    <td width="150px">色号</td>
+                    <td width="150px">备注</td>
+                </tr>`;
+        let amountTotal = 0,
+          singlTotal = 0,
+          moneyTotal = 0;
+        for (let i = 0; i < sale_products.length; i++) {
+          let item = sale_products[i];
+          amountTotal += Number(item.productNumber);
+          singlTotal += Number(item.productUnitPrice);
+          moneyTotal += Number(item.productAmounts);
+          let productData = this.productionOptions.find(
+            (pro) => pro.productNo == item.productNo
+          );
+          console.log("item", item);
+          item.sliceTypeLabel =
+            this.sliceTypeOptions.find((k) => k.materielCode == item.sliceType)
+              ?.materielName || "";
+          item.colourNumberLabel = this.colourNumberOptions.find(
+            (k) => k.materielCode == item.colourNumber
+          )?.materieColorNumber;
+          let productName = productData ? productData.productName : "";
+          let productType = productData ? productData.productType : "";
+          printStr += `<tr align="center">
+                    <td>${productName}</td>
+                    <td>${productType}</td>
+                    <td>${item.productNumber}</td>
+                    <td>${item.productUnitPrice}</td>
+                    <td>${item.productAmounts}</td>
+                    <td>${item.sliceTypeLabel}</td>
+                    <td>${item.colourNumberLabel}</td>
+                    <td>${item.remark}</td>
+                </tr>`;
+        }
+        // 计算小计
+        printStr += `
+        <tr align="center">
+          <td>小计:</td>
+           <td></td>
+          <td>${amountTotal}</td>
+          <td>${singlTotal}</td>
+          <td>${moneyTotal}</td>
+          <td></td>
+          <td></td>
+          <td></td>
+        </tr>
+                <tr>
+                    <td colspan="8">合计金额(大写):${saleAmountInWords}</td>
+                </tr>
+                `;
+
+        if (salePayType == "1") {
+          //定金
+          printStr += `
+          <tr>
+            <td colspan="4">付款方式:${payType}</td>
+            <td colspan="4">定金:${earnestMoney}</td>
+          </tr>`;
+        } else {
+          printStr += `
+         <tr>
+              <td colspan="8">付款方式:${payType}</td>
+          </tr>`;
+        }
+        printStr += `<tr align="center">
+                    <td colspan="8">工艺要求</td>
+                </tr>
+                <tr align="center">
+                    <td width="150px">网络</td>
+                    <td width="150px">油剂</td>
+                    <td width="150px">卷装</td>
+                    <td width="150px">色牢度</td>
+                    <td width="150px">捻向</td>
+                    <td width="150px">其他</td>
+                    <td width="150px"></td>
+                    <td width="150px"></td>
+                </tr>
+                <tr align="center">
+                    <td >${craftGrid}</td>
+                    <td>${craftOil}</td>
+                    <td>${craftPackage}</td>
+                    <td>${craftColorFastness}</td>
+                    <td>${directionOfTwistDescription}</td>
+                    <td>${craftOther}</td>
+                    <td width="150px"></td>
+                    <td width="150px"></td>
+                </tr>
+                <tr>
+                    <td colspan="8">包装/贴唛:${craftMark}</td>
+                </tr>
+                <tr>
+                    <td colspan="8">装运方式:${shippingMethod}</td>
+                </tr>
+                <tr align="center">
+                    <td colspan="2">业务员:</td>
+                    <td colspan="2">${salesman}</td>
+                    <td colspan="2">财务部:</td>
+                    <td colspan="2">${finance}</td>
+
+                </tr>
+
+                <tr align="center">
+                    <td colspan="2">业务主管:</td>
+                    <td colspan="2">${saleApprover}</td>
+                    <td></td>
+                    <td></td>
+                    <td></td>
+                    <td></td>
+                </tr>
+            </tbody>
+        </table>
+        `;
+        return printStr;
+        // <td colspan="2">业务主管:</td>
+        // <td colspan="2">${saleLeader}</td>
+        // <tr align="center">
+
+        //     // <td colspan="2">生产部:</td>
+        //     // <td colspan="2">${production}</td>
+        // </tr>
+        //         <tr align="center">
+        //             <td colspan="2"> 2</td>
+        //             <td> </td>
+        //             <td> </td>
+        //             <td> </td>
+        //             <td> </td>
+        //         </tr>
+        //         <tr>
+        //             <td colspan="2">小计:</td>
+        //             <td></td>
+        //             <td></td>
+        //             <td></td>
+        //             <td></td>
+        //         </tr>
+      }
+    },
+    // 自定义删除按钮
+    async myDeleteHandler(row) {
+      console.log(row);
+      let stateArr = ["6"];
+      let isDeleteValidate = this.selection.some((item) => {
+        return stateArr.includes(item.status);
+      });
+      console.log(this.selection);
+      console.log(isDeleteValidate);
+      if (isDeleteValidate) {
+        this.$message.error("'已完成'状态订单不可删除!");
+        return;
+      }
+      await this.$confirm("是否确认删除选中的数据?", "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      });
+      let payLoad = row.id ? [row.id] : this.myDelIds;
+      payLoad = payLoad.join(",");
+      console.log(payLoad);
+
+      try {
+        let res = await deleRetailOrder(payLoad);
+        if (res.code === 200) {
+          this.$message.success("删除成功");
+          this.getList();
+          this.myDelIds = [];
+          this.$nextTick(() => {
+            this.$refs.tableRef?.clearSelection();
+          });
+        } else {
+          this.$message.error(res.msg);
+        }
+      } catch (error) {}
+    },
+    // 发货回调
+    myDeliverHandler(row) {
+      this.currentRow = row;
+      this.deliverShow = true;
+      this.$nextTick(() => {
+        this.$refs.deliverRef.productInvoiceInfo(row);
+      });
+    },
+  },
+};
+</script>
+
+<style scoped lang="scss">
+::v-deep .el-dialog:not(.is-fullscreen) {
+  min-width: 610px !important;
+}
+</style>
+

+ 222 - 18
zkqy-ui/src/views/orderMange/order/outsourceOrder.vue

@@ -130,24 +130,24 @@
                 >删除</el-button
                 >
               </el-dropdown-item>
-                <el-dropdown-item>
-                  <el-button
-                    size="mini"
-                    type="text"
-                    icon="el-icon-edit"
-                    @click="submitOrder(scope.row)"
-                  >提交</el-button
-                  >
-                </el-dropdown-item>
-<!--              <el-dropdown-item>-->
-<!--                <el-button-->
-<!--                  size="mini"-->
-<!--                  type="text"-->
-<!--                  icon="el-icon-edit"-->
-<!--                  @click="handleDetail(scope.row)"-->
-<!--                >详情</el-button-->
-<!--                >-->
-<!--              </el-dropdown-item>-->
+<!--                <el-dropdown-item>-->
+<!--                  <el-button-->
+<!--                    size="mini"-->
+<!--                    type="text"-->
+<!--                    icon="el-icon-edit"-->
+<!--                    @click="submitOrder(scope.row)"-->
+<!--                  >提交</el-button-->
+<!--                  >-->
+<!--                </el-dropdown-item>-->
+              <el-dropdown-item>
+                <el-button
+                  size="mini"
+                  type="text"
+                  icon="el-icon-edit"
+                  @click="handleDetail(scope.row)"
+                >详情</el-button
+                >
+              </el-dropdown-item>
             </el-dropdown-menu>
           </el-dropdown>
         </template>
@@ -479,6 +479,18 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 详情弹窗 -->
+    <el-dialog title="详情" :visible.sync="detailShow" width="1080px">
+      <div ref="detailTable" id="detail"></div>
+      <span slot="footer" class="dialog-footer">
+          <el-button @click="detailShow = false">取 消</el-button>
+          <el-button type="primary" @click="detailPrintHandler"
+          >打 印</el-button
+          >
+        </span>
+    </el-dialog>
+    <div id="printDom"></div>
   </div>
 </template>
 
@@ -496,6 +508,9 @@ export default {
   dicts: ["outsource_order_payment_method","sales_order_status"],
   data() {
     return {
+      // 详情弹窗数据
+      detailShow: false,
+      printDomData: "",
       totalMoney: "", //总金额 小写
       // 遮罩层
       loading: true,
@@ -622,7 +637,196 @@ export default {
     }),
   },
   methods: {
+    async handleDetail(row) {
+      this.printDomData = await this.getDetailTableString(row);
+      this.detailShow = true;
+      this.$nextTick(() => {
+        this.$refs.detailTable.innerHTML = this.printDomData;
+      });
+    },
+    // 获取详情html字符串
+    async getDetailTableString(row) {
+      let { saleNo } = row;
+
+      let res = await getOutsourceOrderInfo(saleNo);
+      // console.log("res",res)
+      if (res.code == 200) {
+        let {
+          //订单表数据
+          saleNo, //合同号
+          saleDate, //销售单日期
+          processingUnit,//加工单位
+          contactPerson,//联系人
+          address,//地址
+          shippingMethod,//运输方式
+          saleOrderEstimatedTime, //下单时间
+          saleLeadTime, //交货周期
+          materialType,//领料类型
+
+          saleAmountInWords, //合计金额 大写
+          salePayType, //支付方式
+          earnestMoney,
+          salesman, //业务员
+          saleLeader, //业务主管
+          finance, //财务部
+          production, //生产部
+          saleApprover, //批准人
+
+          // 工艺表
+          craftGrid, //网络
+          craftOil, //油剂
+          craftPackage, //卷装
+          craftColorFastness, //色牢度
+          directionOfTwist,
+          craftOther, //其它
+          craftMark, //包装/贴唛
+        } = {...res.data,...res.data.saleCraft}
+        let payType = this.getDictLabel(salePayType, "outsource_order_payment_method"); //付款方式
+        let printStr = `
+        <table style=" border-collapse:collapse;" border="1" cellpadding="10" align="center">
+            <div style="text-align:center;font-size: 20px;">诸暨市新丝维纤维有限公司</div>
+            <div style="text-align:center;">外协加工生产单</div>
+            <tbody>
+                <tr>
+                    <td width="500" colspan="3">合同号:${saleNo}</td>
+                    <td width="500" colspan="2">日期:${saleDate.replace(
+          "T",
+          " "
+        )}</td>
+                </tr>
 
+                <tr align="center">
+                    <td width="275px" colspan="1">加工单位:</td>
+                    <td width="275px"colspan="2">${processingUnit}</td>
+
+                    <td width="225px" colspan="1">联系人:</td>
+                    <td width="225px" colspan="1">${contactPerson}</td>
+                </tr>
+                <tr align="center">
+                    <td width="275px" colspan="1">地址:</td>
+                    <td width="275px"colspan="2">${address}</td>
+
+                    <td width="225px" colspan="1">运输方式:</td>
+                    <td width="225px" colspan="1">${shippingMethod}</td>
+                </tr>
+                <tr align="center">
+                    <td width="275px" colspan="1">下单时间:</td>
+                    <td width="275px"colspan="2">${saleOrderEstimatedTime.replace(
+                    "T",
+                    " "
+                  )}</td>
+
+                    <td width="225px" colspan="1">交货周期:</td>
+                    <td width="225px" colspan="1">${saleLeadTime}</td>
+                </tr>
+                <tr align="center">
+                    <td colspan="5">货品明细</td>
+                </tr>
+                <tr align="center">
+                    <td width="150px">品名</td>
+                    <td width="150px">数量/kg</td>
+                    <td width="150px">加工单价(元)</td>
+                    <td width="150px">金额</td>
+                    <td width="150px">备注</td>
+                </tr>`;
+        let amountTotal = 0,
+          singlTotal = 0,
+          moneyTotal = 0;
+        for (let i = 0; i < res.data.saleProductsList.length; i++) {
+          let item = res.data.saleProductsList[i];
+          amountTotal += Number(item.productNumber);
+          singlTotal += Number(item.productUnitPrice);
+          moneyTotal += Number(item.productAmounts);
+          printStr += `<tr align="center">
+                    <td>${item.productName}</td>
+                    <td>${item.productNumber}</td>
+                    <td>${item.productUnitPrice}</td>
+                    <td>${item.productAmounts}</td>
+                    <td>${item.remark}</td>
+                </tr>`;
+        }
+        // 计算小计
+        printStr += `
+        <tr align="center">
+          <td>小计:</td>
+
+          <td>${amountTotal.toFixed(2)}</td>
+          <td>${singlTotal.toFixed(2)}</td>
+          <td>${moneyTotal.toFixed(2)}</td>
+          <td></td>
+
+        </tr>
+                <tr>
+                    <td colspan="5">合计金额(大写):${saleAmountInWords}</td>
+                </tr>
+                `;
+
+        if (salePayType == "1") {
+          //定金
+          printStr += `
+          <tr>
+            <td colspan="3">付款方式:${payType}</td>
+            <td colspan="2">定金:${earnestMoney}</td>
+          </tr>`;
+        } else {
+          printStr += `
+         <tr>
+              <td colspan="5">付款方式:${payType}</td>
+          </tr>`;
+        }
+        printStr += `<tr align="center">
+                    <td colspan="5">工艺要求</td>
+                </tr>
+                <tr align="center">
+                    <td width="150px">网络</td>
+                    <td width="150px">油剂</td>
+                    <td width="150px">卷装</td>
+                    <td width="150px">色牢度</td>
+                    <td width="150px">其他</td>
+                </tr>
+                <tr align="center">
+                    <td >${craftGrid}</td>
+                    <td>${craftOil}</td>
+                    <td>${craftPackage}</td>
+                    <td>${craftColorFastness}</td>
+                    <td>${craftOther}</td>
+
+                </tr>
+                <tr>
+                    <td colspan="5">包装/贴唛:${craftMark}</td>
+                </tr>
+                <tr>
+                    <td colspan="5">领料类型:${materialType}</td>
+                </tr>
+                <tr align="center">
+                    <td colspan="1">业务员:</td>
+                    <td colspan="2">${salesman}</td>
+                    <td colspan="1">财务部:</td>
+                    <td colspan="1">${finance}</td>
+
+                </tr>
+
+                <tr align="center">
+                    <td colspan="1">业务主管:</td>
+                    <td colspan="2">${saleApprover}</td>
+                    <td></td>
+
+                </tr>
+            </tbody>
+        </table>
+        `;
+        return printStr;
+
+      }
+    },
+    // 打印回调
+    detailPrintHandler() {
+      document.body.innerHTML = document.getElementById("printDom").innerHTML =
+        this.printDomData;
+      window.print(); //打印
+      window.location.reload();
+      return false;
+    },
     submitOrder(row){
       this.$confirm('是否确认执行该操作?', '系统提示', {
         confirmButtonText: '确定',

+ 3 - 0
zkqy-ui/src/views/orderMange/order/processingOrder.vue

@@ -1607,6 +1607,7 @@ export default {
             return item;
           });
           // 获取操作列的按钮数据
+          console.log("button--------------",res.data.resultMap.button)
           this.excuteBtnArr = res.data.resultMap.button;
           console.log(this.excuteBtnArr, "excuteBtnArr");
           // if (this.excuteBtnArr.length) {
@@ -1678,6 +1679,8 @@ export default {
               btnHasPermi: "huaxian:xsglddgl:INSERT",
             }
           );
+
+          this.excuteBtnArr[0].children = this.excuteBtnArr[0].children.filter(child => child.btnName !== "提交");
           // }
 
           this.queryParams.orderByColumn =

+ 44 - 6
zkqy-ui/src/views/orderMange/statisticalAnalysis/ProductionSalesRatio.vue

@@ -17,6 +17,7 @@
           placeholder="选择日期"
           size="mini"
           @change="fetchData"
+          style="width: 130px;"
         ></el-date-picker>
         <el-date-picker
           v-else-if="selectedType === 'months'"
@@ -25,6 +26,7 @@
           placeholder="选择月份"
           size="mini"
           @change="fetchData"
+          style="width: 130px;"
         ></el-date-picker>
         <el-date-picker
           v-else-if="selectedType === 'quarters'"
@@ -34,6 +36,7 @@
           size="mini"
           @change="fetchData"
           :picker-options="quarterShortcuts"
+          style="width: 130px;"
         ></el-date-picker>
         <el-date-picker
           v-else-if="selectedType === 'years'"
@@ -42,24 +45,37 @@
           placeholder="选择年份"
           size="mini"
           @change="fetchData"
+          style="width: 130px;"
         ></el-date-picker>
       </el-form-item>
+      <el-form-item label="选择产品类型">
+        <el-select v-model="selectedProductType" @change="fetchData" placeholder="请选择产品类型" size="mini" style="width: 120px;">
+          <el-option
+            v-for="item in productTypes"
+            :key="item.id"
+            :label="item.codeName"
+            :value="item.codeName"
+          ></el-option>
+        </el-select>
+      </el-form-item>
     </el-form>
-    <div id="pieChart" style="width: 480px; height: 300px;"></div>
+    <div id="pieChart" style="width: 480px; height: 245px;"></div>
   </div>
 </template>
 
 <script>
 import * as echarts from 'echarts';
-import { productionMarketingRatio } from "@/api/statisticalAnalysis/index";
+import { productionMarketingRatio,getProductType } from "@/api/statisticalAnalysis/index";
 
 export default {
   name: 'ProductionSalesRatio',
   data() {
     return {
+      selectedProductType:null,
       selectedType: 'months',
       selectedDate: new Date(),
       chart: null,
+      productTypes: [],
       salesProportion: 19.06,
       productionProportion: 80.94,
       quarterShortcuts: {
@@ -96,12 +112,30 @@ export default {
       },
     };
   },
+  created() {
+    // 确保 productTypes 已经被填充后再设置 selectedProductType
+    this.fetchProductTypes();
+  },
   mounted() {
     this.chart = echarts.init(document.getElementById('pieChart'));
     this.initChart();
     this.fetchData();
   },
   methods: {
+    fetchProductTypes() {
+      let payload = {
+        codeType: 'type',
+        isEnablePaging: false
+      };
+      // 调用后台接口获取产品类型列表
+      getProductType(payload).then(response => {
+        this.productTypes = response.rows;
+        if (this.productTypes.length > 0) {
+          this.selectedProductType = this.productTypes[0].codeName;
+          this.fetchData(); // 获取默认产品类型的数据并更新图表
+        }
+      });
+    },
     onTypeChange() {
       this.selectedDate = '';
       this.chart.clear();
@@ -126,9 +160,11 @@ export default {
         const quarters = Math.ceil((month + 1) / 3);
         timeParam = `${year}-${quarters}`;
       }
+      if (!this.selectedProductType) return;
       let payload = {
         timeType: this.selectedType,
-        timeParam: timeParam
+        timeParam: timeParam,
+        productType: this.selectedProductType
       };
 
       productionMarketingRatio(payload).then(response => {
@@ -166,7 +202,8 @@ export default {
                 formatter: params => {
                   return `${params.name}: ${params.value} `;
                 },
-                position: 'inside'
+                position: 'outside',
+                color:"#000000"
               }
             },
             emphasis: {
@@ -211,7 +248,8 @@ export default {
                   console.log('params====',params)
                   return `${params.name}: ${params.value}`;
                 },
-                position: 'inside'
+                position: 'outside',
+                color:"#000000"
               }
             },
             emphasis: {
@@ -233,7 +271,7 @@ export default {
 <style scoped>
 #pieChart {
   width: 480px;
-  height: 300px;
+  height: 240px;
 }
 </style>
 

+ 1 - 1
zkqy-ui/src/views/orderMange/statisticalAnalysis/customerOrderRanking.vue

@@ -54,7 +54,7 @@ export default {
 
         grid: {
           left: '2%',
-          top:'1%',
+          top:'20px',
           right: '5%',
           bottom: '0%',
           containLabel: true

+ 4 - 4
zkqy-ui/src/views/orderMange/statisticalAnalysis/customerStatistics.vue

@@ -177,10 +177,10 @@ export default {
           top: 'top'
         },
         grid: {
-          left: 15,
-          top: 20,
-          right: 15,
-          bottom: 0,
+          left: '15',
+          top: '20px',
+          right: "15",
+          bottom: "0",
           containLabel: true
         },
         tooltip: {

+ 1 - 1
zkqy-ui/src/views/orderMange/statisticalAnalysis/fastSellingProduct.vue

@@ -160,7 +160,7 @@ export default {
         },
         grid: {
           left: 1,
-          top: 10,
+          top: 30,
           right: '50',
           bottom: 0,
           containLabel: true

+ 11 - 11
zkqy-ui/src/views/orderMange/statisticalAnalysis/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <el-row>
-      <el-col :span="8">
+      <el-col :span="16">
         <el-card class="box-card" style="margin-left: 20px;margin-top: 20px">
           <!--产量统计-->
           <div>
@@ -10,24 +10,24 @@
         </el-card>
       </el-col>
       <el-col :span="8">
-        <el-card class="box-card" style="margin-left: 20px;margin-top: 20px">
+        <el-card class="box-card" style="margin-left: 20px;margin-top: 20px;margin-right: 20px">
           <!--销售统计-产销比例-->
           <div>
             <child-component3></child-component3>
           </div>
         </el-card>
       </el-col>
-      <el-col :span="8">
-        <el-card class="box-card" style="margin-left: 20px;margin-top: 20px;margin-right: 20px">
-          <!-- 销售排行 -->
-          <div>
-            <child-component4></child-component4>
-          </div>
-        </el-card>
-      </el-col>
+<!--      <el-col :span="8">-->
+<!--        <el-card class="box-card" style="margin-left: 20px;margin-top: 20px;margin-right: 20px">-->
+<!--          &lt;!&ndash; 销售排行 &ndash;&gt;-->
+<!--          <div>-->
+<!--            <child-component4></child-component4>-->
+<!--          </div>-->
+<!--        </el-card>-->
+<!--      </el-col>-->
     </el-row>
 
-    <el-row>
+    <el-row style="margin-bottom: 20px">
       <el-col :span="8">
         <el-card class="box-card" style="margin-left: 20px;margin-top: 20px">
           <!-- 销售品类占比 -->

+ 1 - 1
zkqy-ui/src/views/orderMange/statisticalAnalysis/saleIndex.vue

@@ -20,7 +20,7 @@
       </el-col>
     </el-row>
 
-    <el-row>
+    <el-row style="margin-bottom: 20px">
       <!-- 客户订单排行表,排行前10名和单据总量和货品总数量 -->
       <el-col :span="12">
         <el-card class="box-card" style="margin-left: 20px;margin-top: 20px;padding-top: 40px;padding-bottom: 18px">

+ 167 - 365
zkqy-ui/src/views/orderMange/statisticalAnalysis/yield.vue

@@ -48,7 +48,7 @@
     </el-form>
 
     <!-- 图表容器 -->
-    <div id="main" style="width: 480px; height: 300px;"></div>
+    <div id="main" style="width: 1020px; height: 300px;"></div>
   </div>
 </template>
 
@@ -156,10 +156,11 @@ export default {
           top: 'top'
         },
         tooltip: {
-          show: true,
           trigger: 'axis',
           axisPointer: {
-            type: 'shadow'
+            lineStyle: {
+              color: '#57617B'
+            }
           },
           formatter: (params) => {
             const item = this.chartData.output[params[0].dataIndex];
@@ -167,136 +168,77 @@ export default {
           }
         },
         grid: {
-          left: 15,
-          top: 20,
-          right: 15,
-          bottom: 0,
+          left: '0',
+          right: '20',
+          top: '30px',
+          bottom: '0',
           containLabel: true
         },
         xAxis: [{
           data: this.chartData.output.map(item => item.name),
-          //坐标轴
+          type: 'category',
+          boundaryGap: false,
           axisLine: {
+            show: false,
             lineStyle: {
-              color: "#3eb2e8",
-            },
-          },
-          //坐标值标注
+              color: '#000000'
+            }
+          }
+        }],
+        yAxis: {
           axisLabel: {
             show: true,
-            fontSize: 10,
-            interval: 0, // 强制显示所有标签
-            rotate: 45, // 旋转角度
             textStyle: {
-              color: "#000000",
-            },
+              color: '#000000'
+            }
           },
-        }],
-        yAxis: {
-          //坐标轴
           axisLine: {
             show: false,
+
           },
-          //坐标值标注
-          axisLabel: {
-            show: true,
-            textStyle: {
-              color: "#000000",
-            },
-          },
-          //分格线
           splitLine: {
             lineStyle: {
-              color: "#4784e8",
-            },
-          },
+              type:'dotted',
+              color: '#0a3256'
+            }
+          }
         },
         series: [
           {
             name: '重量',
-            tooltip: {
-              show: true,
-            },
-            type: 'bar',
-            barWidth: 24.5,
+            // tooltip: {
+            //   show: true,
+            // },
+            type: 'line',
+            symbol: 'circle',
+            symbolSize: 5,
             data: this.chartData.output.map(item => item.data),
-            itemStyle: {
+            lineStyle: {
               normal: {
-                color: new echarts.graphic.LinearGradient(
-                  0,
-                  1,
-                  0,
-                  0,
-                  [
-                    {
-                      offset: 0,
-                      color: "#0B4EC3", // 0% 处的颜色
-                    },
-                    {
-                      offset: 0.6,
-                      color: "#138CEB", // 60% 处的颜色
-                    },
-                    {
-                      offset: 1,
-                      color: "#17AAFE", // 100% 处的颜色
-                    },
-                  ],
-                  false
-                ),
-              },
+                width: 2
+              }
             },
-            barGap: 0,
-          },
-          {
-            type: "bar",
-            barWidth: 8,
-            itemStyle: {
+            areaStyle: {
               normal: {
-                color: new echarts.graphic.LinearGradient(
-                  0,
-                  1,
-                  0,
-                  0,
-                  [
-                    {
-                      offset: 0,
-                      color: "#09337C", // 0% 处的颜色
-                    },
-                    {
-                      offset: 0.6,
-                      color: "#0761C0", // 60% 处的颜色
-                    },
-                    {
-                      offset: 1,
-                      color: "#0575DE", // 100% 处的颜色
-                    },
-                  ],
-                  false
-                ),
-              },
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(98, 201, 141, 0.5)'
+                }, {
+                  offset: 1,
+                  color: 'rgba(98, 201, 141, 0.1)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
             },
-            barGap: 0,
-            data: this.chartData.output.map(item => item.data),
-          },
-          {
-            name: "b",
-            tooltip: {
-              show: false,
-            },
-            type: "pictorialBar",
             itemStyle: {
-              borderWidth: 1,
-              borderColor: "#0571D5",
-              color: "#1779E0",
+              normal: {
+                color: '#4cb9cf',
+                borderColor: 'rgba(98, 201, 141,0.27)',
+                borderWidth: 12
+              }
             },
-            symbol: "path://M 0,0 l 120,0 l -30,60 l -120,0 z",
-            symbolSize: ["33", "8"],
-            symbolOffset: ["0", "-5"],
-            //symbolRotate: -5,
-            symbolPosition: "end",
-            data: this.chartData.output.map(item => item.data),
-            z: 3,
-          },
+          }
         ]
       };
       this.chart.setOption(option);
@@ -307,19 +249,20 @@ export default {
 
 <style scoped>
 #main {
-  width: 480px;
+  width: 1020px;
   height: 300px;
 }
 </style>
 
 
 
+
 <!--<template>-->
 <!--  <div>-->
 <!--    &lt;!&ndash; 表单容器 &ndash;&gt;-->
 <!--    <el-form inline>-->
-<!--      <el-form-item label="选择统计类型">-->
-<!--        <el-select v-model="selectedType" @change="onTypeChange" placeholder="请选择">-->
+<!--      <el-form-item label="日期类型">-->
+<!--        <el-select v-model="selectedType" @change="onTypeChange" placeholder="请选择" size="mini" style="width: 80px;">-->
 <!--          <el-option label="日" value="days"></el-option>-->
 <!--          <el-option label="月" value="months"></el-option>-->
 <!--          <el-option label="季度" value="quarters"></el-option>-->
@@ -332,6 +275,7 @@ export default {
 <!--          v-model="selectedDate"-->
 <!--          type="date"-->
 <!--          placeholder="选择日期"-->
+<!--          size="mini"-->
 <!--          @change="fetchData"-->
 <!--        ></el-date-picker>-->
 <!--        <el-date-picker-->
@@ -339,6 +283,7 @@ export default {
 <!--          v-model="selectedDate"-->
 <!--          type="month"-->
 <!--          placeholder="选择月份"-->
+<!--          size="mini"-->
 <!--          @change="fetchData"-->
 <!--        ></el-date-picker>-->
 <!--        <el-date-picker-->
@@ -346,6 +291,7 @@ export default {
 <!--          v-model="selectedDate"-->
 <!--          type="month"-->
 <!--          placeholder="选择季度"-->
+<!--          size="mini"-->
 <!--          @change="fetchData"-->
 <!--          :picker-options="quarterShortcuts"-->
 <!--        ></el-date-picker>-->
@@ -354,13 +300,14 @@ export default {
 <!--          v-model="selectedDate"-->
 <!--          type="year"-->
 <!--          placeholder="选择年份"-->
+<!--          size="mini"-->
 <!--          @change="fetchData"-->
 <!--        ></el-date-picker>-->
 <!--      </el-form-item>-->
 <!--    </el-form>-->
 
 <!--    &lt;!&ndash; 图表容器 &ndash;&gt;-->
-<!--    <div id="main" style="width: 600px; height: 400px;"></div>-->
+<!--    <div id="main" style="width: 980px; height: 300px;"></div>-->
 <!--  </div>-->
 <!--</template>-->
 
@@ -462,17 +409,13 @@ export default {
 <!--    updateChart() {-->
 <!--      // 使用柱状图的配置项-->
 <!--      const option = {-->
-<!--        color: ['#1aa1ff', '#31c17b', '#ff6535'],-->
 <!--        title: {-->
 <!--          text: '产量统计',-->
-<!--          // subtext: 'Fake Data',-->
 <!--          left: 'center',-->
-<!--          textStyle: { // 添加 textStyle 属性-->
-<!--            backgroundColor: 'transparent', // 设置背景颜色为透明-->
-<!--            borderColor: 'transparent' // 设置边框颜色为透明-->
-<!--          }-->
+<!--          top: 'top'-->
 <!--        },-->
 <!--        tooltip: {-->
+<!--          show: true,-->
 <!--          trigger: 'axis',-->
 <!--          axisPointer: {-->
 <!--            type: 'shadow'-->
@@ -483,279 +426,136 @@ export default {
 <!--          }-->
 <!--        },-->
 <!--        grid: {-->
-<!--          left: '0%',-->
-<!--          top:'15px',-->
-<!--          right: '0%',-->
-<!--          bottom: '3%',-->
+<!--          left: 15,-->
+<!--          top: 20,-->
+<!--          right: 15,-->
+<!--          bottom: 0,-->
 <!--          containLabel: true-->
 <!--        },-->
-<!--        // legend: {-->
-<!--        //   data: ['产量']-->
-<!--        // },-->
-<!--        xAxis: {-->
-<!--          type: 'category',-->
+<!--        xAxis: [{-->
 <!--          data: this.chartData.output.map(item => item.name),-->
-<!--          axisLine: {show:false,},-->
+<!--          //坐标轴-->
+<!--          axisLine: {-->
+<!--            lineStyle: {-->
+<!--              color: "#3eb2e8",-->
+<!--            },-->
+<!--          },-->
+<!--          //坐标值标注-->
 <!--          axisLabel: {-->
-<!--            color: '#000000',-->
-<!--            fontSize: 12,-->
+<!--            show: true,-->
+<!--            fontSize: 10,-->
 <!--            interval: 0, // 强制显示所有标签-->
-<!--            rotate: 45 // 旋转角度-->
-<!--          }-->
-<!--        },-->
+<!--            rotate: 45, // 旋转角度-->
+<!--            textStyle: {-->
+<!--              color: "#000000",-->
+<!--            },-->
+<!--          },-->
+<!--        }],-->
 <!--        yAxis: {-->
-<!--          type: 'value',-->
-<!--          name: "(人)",-->
-<!--          splitNumber:4,-->
-<!--          nameTextStyle: {-->
-<!--            color: '#000000',-->
-<!--            fontSize: 12-->
+<!--          //坐标轴-->
+<!--          axisLine: {-->
+<!--            show: false,-->
 <!--          },-->
-<!--          axisLine: { show:false, },-->
+<!--          //坐标值标注-->
 <!--          axisLabel: {-->
-<!--            color: '#000000',-->
-<!--            fontSize: 12-->
+<!--            show: true,-->
+<!--            textStyle: {-->
+<!--              color: "#000000",-->
+<!--            },-->
 <!--          },-->
+<!--          //分格线-->
 <!--          splitLine: {-->
 <!--            lineStyle: {-->
-<!--              color: "#595B5D",-->
-<!--              type: "dotted"-->
-<!--            }-->
+<!--              color: "#4784e8",-->
+<!--            },-->
 <!--          },-->
 <!--        },-->
 <!--        series: [-->
 <!--          {-->
-<!--            name: '产量',-->
+<!--            name: '重量',-->
+<!--            tooltip: {-->
+<!--              show: true,-->
+<!--            },-->
 <!--            type: 'bar',-->
-<!--            barWidth: '25%',-->
+<!--            barWidth: 24.5,-->
+<!--            data: this.chartData.output.map(item => item.data),-->
 <!--            itemStyle: {-->
-
 <!--              normal: {-->
-<!--                barBorderRadius: 50,-->
-<!--                color: function(params) {-->
-<!--                  const colorList = ['#4591e3', '#04b8e5', '#04dde5', '#04e5bd',-->
-<!--                    '#04e57e', '#fedb5b', '#e59e04', '#ff632d', '#ff639e',-->
-<!--                    '#ff82e9', '#b562e4'-->
-<!--                  ];-->
-
-<!--                  return colorList[params.dataIndex]-->
-
-<!--                },-->
-
-<!--                label: {-->
-
-<!--                  show: true,-->
-<!--                  position: 'top',-->
-<!--                  formatter: '{c}',-->
-<!--                  color: 'rgba(255,255,255,.4)',-->
-<!--                  fontSize: 12-->
-<!--                }-->
-
-<!--              }-->
-
-<!--            },-->
-<!--            data: this.chartData.output.map(item => item.data)-->
-<!--          }-->
-<!--        ]-->
-<!--      };-->
-<!--      this.chart.setOption(option);-->
-<!--    }-->
-<!--  }-->
-<!--};-->
-<!--</script>-->
-
-<!--<style scoped>-->
-<!--#main {-->
-<!--  width: 100%;-->
-<!--  height: 400px;-->
-<!--}-->
-<!--</style>-->
-
-
-<!--<template>-->
-<!--  <div>-->
-<!--    &lt;!&ndash; 表单容器 &ndash;&gt;-->
-<!--    <el-form inline>-->
-<!--      <el-form-item label="选择统计类型">-->
-<!--        <el-select v-model="selectedType" @change="onTypeChange" placeholder="请选择">-->
-<!--          <el-option label="日" value="days"></el-option>-->
-<!--          <el-option label="月" value="months"></el-option>-->
-<!--          <el-option label="季度" value="quarters"></el-option>-->
-<!--          <el-option label="年" value="years"></el-option>-->
-<!--        </el-select>-->
-<!--      </el-form-item>-->
-<!--      <el-form-item label="选择时间">-->
-<!--        <el-date-picker-->
-<!--          v-if="selectedType === 'days'"-->
-<!--          v-model="selectedDate"-->
-<!--          type="date"-->
-<!--          placeholder="选择日期"-->
-<!--          @change="fetchData"-->
-<!--        ></el-date-picker>-->
-<!--        <el-date-picker-->
-<!--          v-else-if="selectedType === 'months'"-->
-<!--          v-model="selectedDate"-->
-<!--          type="month"-->
-<!--          placeholder="选择月份"-->
-<!--          @change="fetchData"-->
-<!--        ></el-date-picker>-->
-<!--        <el-date-picker-->
-<!--          v-else-if="selectedType === 'quarters'"-->
-<!--          v-model="selectedDate"-->
-<!--          type="month"-->
-<!--          placeholder="选择季度"-->
-<!--          @change="fetchData"-->
-<!--          :picker-options="quarterShortcuts"-->
-<!--        ></el-date-picker>-->
-<!--        <el-date-picker-->
-<!--          v-else-if="selectedType === 'years'"-->
-<!--          v-model="selectedDate"-->
-<!--          type="year"-->
-<!--          placeholder="选择年份"-->
-<!--          @change="fetchData"-->
-<!--        ></el-date-picker>-->
-<!--      </el-form-item>-->
-<!--    </el-form>-->
-
-<!--    &lt;!&ndash; 图表容器 &ndash;&gt;-->
-<!--    <div id="main" style="width: 600px; height: 400px;"></div>-->
-<!--  </div>-->
-<!--</template>-->
-
-<!--<script>-->
-<!--import * as echarts from 'echarts';-->
-<!--import 'element-ui/lib/theme-chalk/index.css';-->
-<!--import { productionStatistics } from "@/api/statisticalAnalysis/index";-->
-
-<!--export default {-->
-<!--  name: 'yield',-->
-<!--  data() {-->
-<!--    return {-->
-<!--      selectedType: 'months',-->
-<!--      selectedDate: new Date(),-->
-<!--      chart: null,-->
-<!--      chartData: {},-->
-<!--      quarterShortcuts: {-->
-<!--        shortcuts: [-->
-<!--          {-->
-<!--            text: '第一季度',-->
-<!--            onClick(picker) {-->
-<!--              const start = new Date(new Date().getFullYear(), 0, 1);-->
-<!--              picker.$emit('pick', start);-->
+<!--                color: new echarts.graphic.LinearGradient(-->
+<!--                  0,-->
+<!--                  1,-->
+<!--                  0,-->
+<!--                  0,-->
+<!--                  [-->
+<!--                    {-->
+<!--                      offset: 0,-->
+<!--                      color: "#0B4EC3", // 0% 处的颜色-->
+<!--                    },-->
+<!--                    {-->
+<!--                      offset: 0.6,-->
+<!--                      color: "#138CEB", // 60% 处的颜色-->
+<!--                    },-->
+<!--                    {-->
+<!--                      offset: 1,-->
+<!--                      color: "#17AAFE", // 100% 处的颜色-->
+<!--                    },-->
+<!--                  ],-->
+<!--                  false-->
+<!--                ),-->
+<!--              },-->
 <!--            },-->
+<!--            barGap: 0,-->
 <!--          },-->
 <!--          {-->
-<!--            text: '第二季度',-->
-<!--            onClick(picker) {-->
-<!--              const start = new Date(new Date().getFullYear(), 3, 1);-->
-<!--              picker.$emit('pick', start);-->
+<!--            type: "bar",-->
+<!--            barWidth: 8,-->
+<!--            itemStyle: {-->
+<!--              normal: {-->
+<!--                color: new echarts.graphic.LinearGradient(-->
+<!--                  0,-->
+<!--                  1,-->
+<!--                  0,-->
+<!--                  0,-->
+<!--                  [-->
+<!--                    {-->
+<!--                      offset: 0,-->
+<!--                      color: "#09337C", // 0% 处的颜色-->
+<!--                    },-->
+<!--                    {-->
+<!--                      offset: 0.6,-->
+<!--                      color: "#0761C0", // 60% 处的颜色-->
+<!--                    },-->
+<!--                    {-->
+<!--                      offset: 1,-->
+<!--                      color: "#0575DE", // 100% 处的颜色-->
+<!--                    },-->
+<!--                  ],-->
+<!--                  false-->
+<!--                ),-->
+<!--              },-->
 <!--            },-->
+<!--            barGap: 0,-->
+<!--            data: this.chartData.output.map(item => item.data),-->
 <!--          },-->
 <!--          {-->
-<!--            text: '第三季度',-->
-<!--            onClick(picker) {-->
-<!--              const start = new Date(new Date().getFullYear(), 6, 1);-->
-<!--              picker.$emit('pick', start);-->
+<!--            name: "b",-->
+<!--            tooltip: {-->
+<!--              show: false,-->
 <!--            },-->
-<!--          },-->
-<!--          {-->
-<!--            text: '第四季度',-->
-<!--            onClick(picker) {-->
-<!--              const start = new Date(new Date().getFullYear(), 9, 1);-->
-<!--              picker.$emit('pick', start);-->
+<!--            type: "pictorialBar",-->
+<!--            itemStyle: {-->
+<!--              borderWidth: 1,-->
+<!--              borderColor: "#0571D5",-->
+<!--              color: "#1779E0",-->
 <!--            },-->
+<!--            symbol: "path://M 0,0 l 120,0 l -30,60 l -120,0 z",-->
+<!--            symbolSize: ["33", "8"],-->
+<!--            symbolOffset: ["0", "-5"],-->
+<!--            //symbolRotate: -5,-->
+<!--            symbolPosition: "end",-->
+<!--            data: this.chartData.output.map(item => item.data),-->
+<!--            z: 3,-->
 <!--          },-->
-<!--        ],-->
-<!--      },-->
-<!--    };-->
-<!--  },-->
-<!--  mounted() {-->
-<!--    this.chart = echarts.init(document.getElementById('main'));-->
-<!--    this.fetchData();-->
-<!--  },-->
-<!--  created() {-->
-<!--    this.fetchData();-->
-<!--  },-->
-<!--  methods: {-->
-<!--    onTypeChange() {-->
-<!--      this.selectedDate = '';-->
-<!--      this.chart.clear();-->
-<!--    },-->
-<!--    fetchData() {-->
-<!--      // 模拟从后端获取数据-->
-<!--      // 实际上应根据selectedType和selectedDate发送请求到后端获取数据-->
-<!--      let timeParam;-->
-<!--      if (this.selectedType === 'years') {-->
-<!--        timeParam = this.selectedDate.getFullYear();-->
-<!--      } else if (this.selectedType === 'months') {-->
-<!--        const year = this.selectedDate.getFullYear();-->
-<!--        const month = ('0' + (this.selectedDate.getMonth() + 1)).slice(-2); // 获取月份并补零-->
-<!--        timeParam = `${year}-${month}`;-->
-<!--      } else if (this.selectedType === 'days') {-->
-<!--        const year = this.selectedDate.getFullYear();-->
-<!--        const month = ('0' + (this.selectedDate.getMonth() + 1)).slice(-2);-->
-<!--        const day = ('0' + this.selectedDate.getDate()).slice(-2); // 获取日期并补零-->
-<!--        timeParam = `${year}-${month}-${day}`;-->
-<!--      } else if (this.selectedType === 'quarters') {-->
-<!--        const month = this.selectedDate.getMonth();-->
-<!--        // 计算季度,可以通过除以3并向上取整得到-->
-<!--        const year = this.selectedDate.getFullYear();-->
-<!--        const quarters = Math.ceil((month + 1) / 3);-->
-<!--        timeParam = `${year}-${quarters}`;-->
-<!--      }-->
-<!--      let payload = {-->
-<!--        timeType: this.selectedType,-->
-<!--        timeParam: timeParam-->
-<!--      };-->
-
-<!--      productionStatistics(payload).then(response => {-->
-<!--        this.chartData = response.data;-->
-<!--        this.updateChart();-->
-<!--      });-->
-
-<!--    },-->
-<!--    initChart() {-->
-<!--      this.updateChart();-->
-<!--    },-->
-<!--    updateChart() {-->
-<!--      // 使用柱状图的配置项-->
-<!--      const option = {-->
-<!--        title: {-->
-<!--          text: '产量统计',-->
-<!--          // subtext: 'Fake Data',-->
-<!--          left: 'center',-->
-<!--          textStyle: { // 添加 textStyle 属性-->
-<!--            backgroundColor: 'transparent', // 设置背景颜色为透明-->
-<!--            borderColor: 'transparent' // 设置边框颜色为透明-->
-<!--          }-->
-<!--        },-->
-<!--        tooltip: {-->
-<!--          trigger: 'axis',-->
-<!--          formatter: (params) => {-->
-<!--            const item = this.chartData.output[params[0].dataIndex];-->
-<!--            return `${item.name}<br/>重量: ${item.data}<br/>色号: ${item.productColour}`;-->
-<!--          }-->
-<!--        },-->
-<!--        legend: {-->
-<!--          data: ['产量']-->
-<!--        },-->
-<!--        xAxis: {-->
-<!--          type: 'category',-->
-<!--          data: this.chartData.output.map(item => item.name),-->
-<!--          axisLabel: {-->
-<!--            interval: 0, // 强制显示所有标签-->
-<!--            rotate: 45 // 旋转角度-->
-<!--          }-->
-<!--        },-->
-<!--        yAxis: {-->
-<!--          type: 'value'-->
-<!--        },-->
-<!--        series: [-->
-<!--          {-->
-<!--            name: '产量',-->
-<!--            type: 'bar',-->
-<!--            data: this.chartData.output.map(item => item.data)-->
-<!--          }-->
 <!--        ]-->
 <!--      };-->
 <!--      this.chart.setOption(option);-->
@@ -766,8 +566,10 @@ export default {
 
 <!--<style scoped>-->
 <!--#main {-->
-<!--  width: 100%;-->
-<!--  height: 400px;-->
+<!--  width: 980px;-->
+<!--  height: 300px;-->
 <!--}-->
 <!--</style>-->
 
+
+