zhangwencui
10 天以前 f4c73e3d36ff577aed91bed9bcd635c9eb6dcaa6
增加废品库存从销售到入库流程
已修改4个文件
734 ■■■■ 文件已修改
src/api/inventoryManagement/stockUninventory.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/wasteStockManagement/WasteBatchNoQtyDetail.vue 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/wasteStockManagement/WasteRecord.vue 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue 582 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/inventoryManagement/stockUninventory.js
@@ -61,3 +61,21 @@
        data: params,
    });
};
// 废品库分页查询(新接口,避免影响原有库存查询流程)
export const pageWasteQuery = (params) => {
    return request({
        url: "/stockUninventory/pageWasteQuery",
        method: "get",
        params,
    });
};
// 废品库批次详情查询
export const getWasteBatchNoQty = (params) => {
    return request({
        url: "/stockUninventory/getWasteBatchNoQty",
        method: "get",
        params,
    });
};
src/views/inventoryManagement/wasteStockManagement/WasteBatchNoQtyDetail.vue
@@ -28,7 +28,7 @@
          <el-table-column label="来源"
                           show-overflow-tooltip>
            <template #default="scope">
              {{ scope.row.wasteSourceText || scope.row.qualifiedSourceText || scope.row.unQualifiedSourceText || "--" }}
              {{ scope.row.sourceText || "--" }}
            </template>
          </el-table-column>
          <el-table-column label="单位"
@@ -40,43 +40,12 @@
          <el-table-column label="库存数量"
                           prop="qualitity"
                           show-overflow-tooltip />
          <el-table-column label="冻结数量"
                           prop="lockedQuantity"
                           show-overflow-tooltip />
          <el-table-column label="可用数量"
                           prop="unLockedQuantity"
                           show-overflow-tooltip />
          <el-table-column label="备注"
                           prop="remark"
                           show-overflow-tooltip />
          <el-table-column label="最近更新时间"
                           prop="updateTime"
                           show-overflow-tooltip />
          <el-table-column fixed="right"
                           label="操作"
                           min-width="180"
                           align="center">
            <template #default="scope">
              <el-button link
                         type="primary"
                         @click="handleSubtract(scope.row)"
                         :disabled="
                  (scope.row.unLockedQuantity || 0) <= 0
                ">领用</el-button>
              <el-button link
                         type="primary"
                         v-if="
                  (scope.row.unLockedQuantity || 0) > 0
                "
                         @click="handleFrozen(scope.row)">冻结</el-button>
              <el-button link
                         type="primary"
                         v-if="
                  (scope.row.lockedQuantity || 0) > 0
                "
                         @click="handleThaw(scope.row)">解冻</el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <pagination v-show="total > 0"
@@ -92,7 +61,7 @@
<script setup>
  import pagination from "@/components/PIMTable/Pagination.vue";
  import { computed, reactive, ref, watch, onMounted } from "vue";
  import { getStockInventoryBatchNoQty } from "@/api/inventoryManagement/stockInventory.js";
  import { getWasteBatchNoQty } from "@/api/inventoryManagement/stockUninventory.js";
  import { getManufacturerOptions } from "@/api/inspectionManagement/manufacturerManageFile.js";
  const props = defineProps({
@@ -106,7 +75,7 @@
    },
  });
  const emit = defineEmits(["update:visible", "subtract", "frozen", "thaw"]);
  const emit = defineEmits(["update:visible"]);
  const isShow = computed({
    get() {
@@ -151,7 +120,7 @@
    }
    tableLoading.value = true;
    getStockInventoryBatchNoQty({
    getWasteBatchNoQty({
      current: page.current,
      size: page.size,
      productId: props.record.productId,
@@ -171,18 +140,6 @@
    page.current = obj.page;
    page.size = obj.limit;
    getList();
  };
  const handleSubtract = row => {
    emit("subtract", row);
  };
  const handleFrozen = row => {
    emit("frozen", row);
  };
  const handleThaw = row => {
    emit("thaw", row);
  };
  const closeModal = () => {
src/views/inventoryManagement/wasteStockManagement/WasteRecord.vue
@@ -82,12 +82,6 @@
        <el-table-column label="库存数量"
                         prop="qualitity"
                         show-overflow-tooltip />
        <el-table-column label="冻结数量"
                         prop="lockedQuantity"
                         show-overflow-tooltip />
        <el-table-column label="可用数量"
                         prop="unLockedQuantity"
                         show-overflow-tooltip />
        <el-table-column label="备注"
                         prop="remark"
                         show-overflow-tooltip />
@@ -114,22 +108,7 @@
    </div>
    <waste-batch-no-qty-detail v-if="isShowDetailModal"
                               v-model:visible="isShowDetailModal"
                               :record="record"
                               @subtract="handleDetailSubtract"
                               @frozen="handleDetailFrozen"
                               @thaw="handleDetailThaw" />
    <subtract-stock-inventory v-if="isShowSubtractModal"
                              v-model:visible="isShowSubtractModal"
                              :record="record"
                              type="waste"
                              @completed="handleQuery" />
    <!-- 冻结/解冻库存-->
    <frozen-and-thaw-stock-inventory v-if="isShowFrozenAndThawModal"
                                     v-model:visible="isShowFrozenAndThawModal"
                                     :record="record"
                                     :operation-type="operationType"
                                     type="waste"
                                     @completed="handleQuery" />
                               :record="record" />
  </div>
</template>
@@ -144,7 +123,7 @@
    defineAsyncComponent,
  } from "vue";
  import { ElMessageBox } from "element-plus";
  import { getStockInventoryListPageCombined } from "@/api/inventoryManagement/stockInventory.js";
  import { pageWasteQuery } from "@/api/inventoryManagement/stockUninventory.js";
  const props = defineProps({
    productId: {
@@ -154,12 +133,6 @@
    },
  });
  const SubtractStockInventory = defineAsyncComponent(() =>
    import("@/views/inventoryManagement/stockManagement/Subtract.vue")
  );
  const FrozenAndThawStockInventory = defineAsyncComponent(() =>
    import("@/views/inventoryManagement/stockManagement/FrozenAndThaw.vue")
  );
  const WasteBatchNoQtyDetail = defineAsyncComponent(() =>
    import(
      "@/views/inventoryManagement/wasteStockManagement/WasteBatchNoQtyDetail.vue"
@@ -176,14 +149,8 @@
    size: 100,
  });
  const total = ref(0);
  // 是否显示领用弹框
  const isShowSubtractModal = ref(false);
  // 是否显示冻结/解冻弹框
  const isShowFrozenAndThawModal = ref(false);
  // 是否显示详情弹框
  const isShowDetailModal = ref(false);
  // 操作类型
  const operationType = ref("frozen");
  const data = reactive({
    searchForm: {
@@ -191,7 +158,6 @@
      model: "",
      batchNo: "",
      topParentProductId: props.productId,
      type: "waste",
    },
  });
  const { searchForm } = toRefs(data);
@@ -216,21 +182,15 @@
  };
  const getList = () => {
    tableLoading.value = true;
    getStockInventoryListPageCombined({ ...searchForm.value, ...page })
    pageWasteQuery({ ...searchForm.value, ...page })
      .then(res => {
        tableLoading.value = false;
        tableData.value = res.data.records;
        total.value = res.data.total;
        tableData.value = res.data?.records || [];
        total.value = res.data?.total || 0;
      })
      .catch(() => {
        tableLoading.value = false;
      });
  };
  // 点击领用
  const showSubtractModal = row => {
    record.value = row;
    isShowSubtractModal.value = true;
  };
  // 点击详情
@@ -241,35 +201,6 @@
    }
    record.value = row;
    isShowDetailModal.value = true;
  };
  const handleDetailSubtract = row => {
    isShowDetailModal.value = false;
    showSubtractModal(row);
  };
  const handleDetailFrozen = row => {
    isShowDetailModal.value = false;
    showFrozenModal(row);
  };
  const handleDetailThaw = row => {
    isShowDetailModal.value = false;
    showThawModal(row);
  };
  // 点击冻结
  const showFrozenModal = row => {
    record.value = row;
    isShowFrozenAndThawModal.value = true;
    operationType.value = "frozen";
  };
  // 点击解冻
  const showThawModal = row => {
    record.value = row;
    isShowFrozenAndThawModal.value = true;
    operationType.value = "thaw";
  };
  // 表格选择数据
@@ -293,8 +224,8 @@
    })
      .then(() => {
        proxy.download(
          "/stockInventory/exportStockInventory",
          { topParentProductId: props.productId, type: "waste" },
          "/stockUninventory/exportWasteQuery",
          { topParentProductId: props.productId },
          "废品库存信息.xlsx"
        );
      })
src/views/salesManagement/salesLedger/index.vue
@@ -24,6 +24,18 @@
                    prefix-icon="Search"
                    @change="handleQuery" />
        </el-form-item>
        <el-form-item label="销售类型:">
          <el-select v-model="searchForm.stockType"
                     placeholder="请选择"
                     clearable
                     @change="handleQuery"
                     style="width: 150px">
            <el-option label="非废品销售"
                       value="qualified" />
            <el-option label="废品销售"
                       value="waste" />
          </el-select>
        </el-form-item>
        <el-form-item label="录入日期:">
          <el-date-picker v-model="searchForm.entryDate"
                          value-format="YYYY-MM-DD"
@@ -214,6 +226,16 @@
                         prop="salesman"
                         width="100"
                         show-overflow-tooltip />
        <el-table-column label="销售类型"
                         prop="stockType"
                         width="120"
                         align="center">
          <template #default="scope">
            <el-tag :type="scope.row.stockType === 'waste' ? 'warning' : 'success'">
              {{ scope.row.stockType === 'waste' ? '废品销售' : '非废品销售' }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column label="项目名称"
                         prop="projectName"
                         width="180"
@@ -375,6 +397,21 @@
                        placeholder="请输入"
                        clearable
                        :disabled="operationType === 'view'" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="销售类型:"
                          prop="stockType">
              <el-select v-model="form.stockType"
                         placeholder="请选择"
                         clearable
                         :disabled="operationType === 'view'"
                         style="width: 100%">
                <el-option label="非废品销售"
                           value="qualified" />
                <el-option label="废品销售"
                           value="waste" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
@@ -1169,6 +1206,7 @@
    searchForm: {
      customerName: "", // 客户名称
      salesContractNo: "", // 销售合同编号
      stockType: "", // 销售类型
      entryDate: null, // 录入日期
      entryDateStart: undefined,
      entryDateEnd: undefined,
@@ -1177,6 +1215,7 @@
      salesContractNo: "",
      autoGenerateContractNo: true,
      salesman: "",
      stockType: "qualified",
      customerId: "",
      entryPerson: "",
      entryDate: "",
@@ -1189,6 +1228,7 @@
    },
    rules: {
      salesman: [{ required: true, message: "请选择", trigger: "change" }],
      stockType: [{ required: true, message: "请选择", trigger: "change" }],
      customerId: [{ required: true, message: "请选择", trigger: "change" }],
      entryPerson: [{ required: true, message: "请选择", trigger: "change" }],
      entryDate: [{ required: true, message: "请选择", trigger: "change" }],
@@ -1707,6 +1747,8 @@
      form.value.createTime = dayjs().format("YYYY-MM-DD HH:mm:ss");
      // 默认自动生成销售合同号
      form.value.autoGenerateContractNo = true;
      // 默认非废品销售
      form.value.stockType = "qualified";
    } else {
      currentId.value = row.id;
      getSalesLedgerWithProducts({ id: row.id, type: 1 }).then(res => {
@@ -2175,286 +2217,286 @@
    // 构建打印内容
    let printContent = `
                                                                                    <!DOCTYPE html>
                                                                                    <html>
                                                                                    <head>
                                                                                      <meta charset="UTF-8">
                                                                                      <title>打印预览</title>
                                                                                      <style>
                                                                                        body {
                                                                                          margin: 0;
                                                                                          padding: 0;
                                                                                          font-family: "SimSun", serif;
                                                                                          background: white;
                                                                                        }
                                                                                                                                     .print-page {
                                                                                            width: 200mm;
                                                                                            height: 75mm;
                                                                                            padding: 10mm;
                                                                                            padding-left: 20mm;
                                                                                            background: white;
                                                                                            box-sizing: border-box;
                                                                                            page-break-after: always;
                                                                                            page-break-inside: avoid;
                                                                                          }
                                                                                         .print-page:last-child {
                                                                                           page-break-after: avoid;
                                                                                         }
                                                                                        .delivery-note {
                                                                                          width: 100%;
                                                                                          height: 100%;
                                                                                          font-size: 12px;
                                                                                          line-height: 1.2;
                                                                                          display: flex;
                                                                                          flex-direction: column;
                                                                                          color: #000;
                                                                                        }
                                                                                        .header {
                                                                                          text-align: center;
                                                                                          margin-bottom: 8px;
                                                                                        }
                                                                                        .company-name {
                                                                                          font-size: 18px;
                                                                                          font-weight: bold;
                                                                                          margin-bottom: 4px;
                                                                                        }
                                                                                        .document-title {
                                                                                          font-size: 16px;
                                                                                          font-weight: bold;
                                                                                        }
                                                                                        .info-section {
                                                                                          margin-bottom: 8px;
                                                                                          display: flex;
                                                                                          justify-content: space-between;
                                                                                          align-items: center;
                                                                                        }
                                                                                        .info-row {
                                                                                          line-height: 20px;
                                                                                        }
                                                                                        .label {
                                                                                          font-weight: bold;
                                                                                          width: 60px;
                                                                                          font-size: 12px;
                                                                                        }
                                                                                        .value {
                                                                                          margin-right: 20px;
                                                                                          min-width: 80px;
                                                                                          font-size: 12px;
                                                                                        }
                                                                                                 .table-section {
                                                                                                 margin-bottom: 40px;
                                                                                          //  flex: 0.6;
                                                                                         }
                                                                                        .product-table {
                                                                                          width: 100%;
                                                                                          border-collapse: collapse;
                                                                                          border: 1px solid #000;
                                                                                        }
                                                                                                 .product-table th, .product-table td {
                                                                                           border: 1px solid #000;
                                                                                           padding: 6px;
                                                                                           text-align: center;
                                                                                           font-size: 12px;
                                                                                           line-height: 1.4;
                                                                                         }
                                                                                        .product-table th {
                                                                                          font-weight: bold;
                                                                                        }
                                                                                        .total-value {
                                                                                          font-weight: bold;
                                                                                        }
                                                                                        .footer-section {
                                                                                          margin-top: auto;
                                                                                        }
                                                                                        .footer-row {
                                                                                          display: flex;
                                                                                          margin-bottom: 3px;
                                                                                          line-height: 22px;
                                                                                          justify-content: space-between;
                                                                                        }
                                                                                        .footer-item {
                                                                                          display: flex;
                                                                                          margin-right: 20px;
                                                                                        }
                                                                                        .footer-item .label {
                                                                                          font-weight: bold;
                                                                                          width: 80px;
                                                                                          font-size: 12px;
                                                                                        }
                                                                                        .footer-item .value {
                                                                                          min-width: 80px;
                                                                                          font-size: 12px;
                                                                                        }
                                                                                        .address-item .address-value {
                                                                                          min-width: 200px;
                                                                                        }
                                                                                        @media print {
                                                                                          body {
                                                                                            margin: 0;
                                                                                            padding: 0;
                                                                                          }
                                                                                                     .print-page {
                                                                                             margin: 0;
                                                                                             padding: 10mm;
                                                                                             /* padding-left: 20mm; */
                                                                                             page-break-inside: avoid;
                                                                                             page-break-after: always;
                                                                                           }
                                                                                           .print-page:last-child {
                                                                                             page-break-after: avoid;
                                                                                           }
                                                                                        }
                                                                                      </style>
                                                                                    </head>
                                                                                    <body>
                                                                                  `;
                                                                                                <!DOCTYPE html>
                                                                                                <html>
                                                                                                <head>
                                                                                                  <meta charset="UTF-8">
                                                                                                  <title>打印预览</title>
                                                                                                  <style>
                                                                                                    body {
                                                                                                      margin: 0;
                                                                                                      padding: 0;
                                                                                                      font-family: "SimSun", serif;
                                                                                                      background: white;
                                                                                                    }
                                                                                                                                                 .print-page {
                                                                                                        width: 200mm;
                                                                                                        height: 75mm;
                                                                                                        padding: 10mm;
                                                                                                        padding-left: 20mm;
                                                                                                        background: white;
                                                                                                        box-sizing: border-box;
                                                                                                        page-break-after: always;
                                                                                                        page-break-inside: avoid;
                                                                                                      }
                                                                                                     .print-page:last-child {
                                                                                                       page-break-after: avoid;
                                                                                                     }
                                                                                                    .delivery-note {
                                                                                                      width: 100%;
                                                                                                      height: 100%;
                                                                                                      font-size: 12px;
                                                                                                      line-height: 1.2;
                                                                                                      display: flex;
                                                                                                      flex-direction: column;
                                                                                                      color: #000;
                                                                                                    }
                                                                                                    .header {
                                                                                                      text-align: center;
                                                                                                      margin-bottom: 8px;
                                                                                                    }
                                                                                                    .company-name {
                                                                                                      font-size: 18px;
                                                                                                      font-weight: bold;
                                                                                                      margin-bottom: 4px;
                                                                                                    }
                                                                                                    .document-title {
                                                                                                      font-size: 16px;
                                                                                                      font-weight: bold;
                                                                                                    }
                                                                                                    .info-section {
                                                                                                      margin-bottom: 8px;
                                                                                                      display: flex;
                                                                                                      justify-content: space-between;
                                                                                                      align-items: center;
                                                                                                    }
                                                                                                    .info-row {
                                                                                                      line-height: 20px;
                                                                                                    }
                                                                                                    .label {
                                                                                                      font-weight: bold;
                                                                                                      width: 60px;
                                                                                                      font-size: 12px;
                                                                                                    }
                                                                                                    .value {
                                                                                                      margin-right: 20px;
                                                                                                      min-width: 80px;
                                                                                                      font-size: 12px;
                                                                                                    }
                                                                                                             .table-section {
                                                                                                             margin-bottom: 40px;
                                                                                                      //  flex: 0.6;
                                                                                                     }
                                                                                                    .product-table {
                                                                                                      width: 100%;
                                                                                                      border-collapse: collapse;
                                                                                                      border: 1px solid #000;
                                                                                                    }
                                                                                                             .product-table th, .product-table td {
                                                                                                       border: 1px solid #000;
                                                                                                       padding: 6px;
                                                                                                       text-align: center;
                                                                                                       font-size: 12px;
                                                                                                       line-height: 1.4;
                                                                                                     }
                                                                                                    .product-table th {
                                                                                                      font-weight: bold;
                                                                                                    }
                                                                                                    .total-value {
                                                                                                      font-weight: bold;
                                                                                                    }
                                                                                                    .footer-section {
                                                                                                      margin-top: auto;
                                                                                                    }
                                                                                                    .footer-row {
                                                                                                      display: flex;
                                                                                                      margin-bottom: 3px;
                                                                                                      line-height: 22px;
                                                                                                      justify-content: space-between;
                                                                                                    }
                                                                                                    .footer-item {
                                                                                                      display: flex;
                                                                                                      margin-right: 20px;
                                                                                                    }
                                                                                                    .footer-item .label {
                                                                                                      font-weight: bold;
                                                                                                      width: 80px;
                                                                                                      font-size: 12px;
                                                                                                    }
                                                                                                    .footer-item .value {
                                                                                                      min-width: 80px;
                                                                                                      font-size: 12px;
                                                                                                    }
                                                                                                    .address-item .address-value {
                                                                                                      min-width: 200px;
                                                                                                    }
                                                                                                    @media print {
                                                                                                      body {
                                                                                                        margin: 0;
                                                                                                        padding: 0;
                                                                                                      }
                                                                                                                 .print-page {
                                                                                                         margin: 0;
                                                                                                         padding: 10mm;
                                                                                                         /* padding-left: 20mm; */
                                                                                                         page-break-inside: avoid;
                                                                                                         page-break-after: always;
                                                                                                       }
                                                                                                       .print-page:last-child {
                                                                                                         page-break-after: avoid;
                                                                                                       }
                                                                                                    }
                                                                                                  </style>
                                                                                                </head>
                                                                                                <body>
                                                                                              `;
    // 为每条数据生成打印页面
    printData.value.forEach((item, index) => {
      printContent += `
                                                                                      <div class="print-page">
                                                                                        <div class="delivery-note">
                                                                                          <div class="header">
                                                                                            <div class="document-title">零售发货单</div>
                                                                                          </div>
                                                                                                  <div class="print-page">
                                                                                                    <div class="delivery-note">
                                                                                                      <div class="header">
                                                                                                        <div class="document-title">零售发货单</div>
                                                                                                      </div>
                                                                                          <div class="info-section">
                                                                                            <div class="info-row">
                                                                                              <div>
                                                                                                <span class="label">发货日期:</span>
                                                                                                <span class="value">${formatDate(
                                                                                                  item.createTime
                                                                                                )}</span>
                                                                                              </div>
                                                                                              <div>
                                                                                                <span class="label">客户名称:</span>
                                                                                                <span class="value">${
                                                                                                  item.customerName
                                                                                                }</span>
                                                                                              </div>
                                                                                            </div>
                                                                                            <div class="info-row">
                                                                                              <span class="label">单号:</span>
                                                                                              <span class="value">${
                                                                                                item.salesContractNo ||
                                                                                                ""
                                                                                              }</span>
                                                                                            </div>
                                                                                          </div>
                                                                                                      <div class="info-section">
                                                                                                        <div class="info-row">
                                                                                                          <div>
                                                                                                            <span class="label">发货日期:</span>
                                                                                                            <span class="value">${formatDate(
                                                                                                              item.createTime
                                                                                                            )}</span>
                                                                                                          </div>
                                                                                                          <div>
                                                                                                            <span class="label">客户名称:</span>
                                                                                                            <span class="value">${
                                                                                                              item.customerName
                                                                                                            }</span>
                                                                                                          </div>
                                                                                                        </div>
                                                                                                        <div class="info-row">
                                                                                                          <span class="label">单号:</span>
                                                                                                          <span class="value">${
                                                                                                            item.salesContractNo ||
                                                                                                            ""
                                                                                                          }</span>
                                                                                                        </div>
                                                                                                      </div>
                                                                                          <div class="table-section">
                                                                                            <table class="product-table">
                                                                                              <thead>
                                                                                                <tr>
                                                                                                  <th>产品名称</th>
                                                                                                  <th>规格型号</th>
                                                                                                  <th>单位</th>
                                                                                                  <th>单价</th>
                                                                                                  <th>零售数量</th>
                                                                                                  <th>零售金额</th>
                                                                                                </tr>
                                                                                              </thead>
                                                                                              <tbody>
                                                                                                ${
                                                                                                  item.products &&
                                                                                                  item
                                                                                                    .products
                                                                                                    .length >
                                                                                                    0
                                                                                                    ? item.products
                                                                                                        .map(
                                                                                                          product => `
                                                                                                    <tr>
                                                                                                      <td>${
                                                                                                        product.productCategory ||
                                                                                                        ""
                                                                                                      }</td>
                                                                                                      <td>${
                                                                                                        product.specificationModel ||
                                                                                                        ""
                                                                                                      }</td>
                                                                                                      <td>${
                                                                                                        product.unit ||
                                                                                                        ""
                                                                                                      }</td>
                                                                                                      <td>${
                                                                                                        product.taxInclusiveUnitPrice ||
                                                                                                        "0"
                                                                                                      }</td>
                                                                                                      <td>${
                                                                                                        product.quantity ||
                                                                                                        "0"
                                                                                                      }</td>
                                                                                                      <td>${
                                                                                                        product.taxInclusiveTotalPrice ||
                                                                                                        "0"
                                                                                                      }</td>
                                                                                                    </tr>
                                                                                                  `
                                                                                                        )
                                                                                                        .join(
                                                                                                          ""
                                                                                                        )
                                                                                                    : '<tr><td colspan="6" style="text-align: center; color: #999;">暂无产品数据</td></tr>'
                                                                                                }
                                                                                              </tbody>
                                                                                              <tfoot>
                                                                                                <tr>
                                                                                                  <td class="label">合计</td>
                                                                                                  <td class="total-value"></td>
                                                                                                  <td class="total-value"></td>
                                                                                                  <td class="total-value"></td>
                                                                                                  <td class="total-value">${getTotalQuantityForPrint(
                                                                                                    item.products
                                                                                                  )}</td>
                                                                                                  <td class="total-value">${getTotalAmountForPrint(
                                                                                                    item.products
                                                                                                  )}</td>
                                                                                                </tr>
                                                                                              </tfoot>
                                                                                            </table>
                                                                                          </div>
                                                                                                      <div class="table-section">
                                                                                                        <table class="product-table">
                                                                                                          <thead>
                                                                                                            <tr>
                                                                                                              <th>产品名称</th>
                                                                                                              <th>规格型号</th>
                                                                                                              <th>单位</th>
                                                                                                              <th>单价</th>
                                                                                                              <th>零售数量</th>
                                                                                                              <th>零售金额</th>
                                                                                                            </tr>
                                                                                                          </thead>
                                                                                                          <tbody>
                                                                                                            ${
                                                                                                              item.products &&
                                                                                                              item
                                                                                                                .products
                                                                                                                .length >
                                                                                                                0
                                                                                                                ? item.products
                                                                                                                    .map(
                                                                                                                      product => `
                                                                                                                <tr>
                                                                                                                  <td>${
                                                                                                                    product.productCategory ||
                                                                                                                    ""
                                                                                                                  }</td>
                                                                                                                  <td>${
                                                                                                                    product.specificationModel ||
                                                                                                                    ""
                                                                                                                  }</td>
                                                                                                                  <td>${
                                                                                                                    product.unit ||
                                                                                                                    ""
                                                                                                                  }</td>
                                                                                                                  <td>${
                                                                                                                    product.taxInclusiveUnitPrice ||
                                                                                                                    "0"
                                                                                                                  }</td>
                                                                                                                  <td>${
                                                                                                                    product.quantity ||
                                                                                                                    "0"
                                                                                                                  }</td>
                                                                                                                  <td>${
                                                                                                                    product.taxInclusiveTotalPrice ||
                                                                                                                    "0"
                                                                                                                  }</td>
                                                                                                                </tr>
                                                                                                              `
                                                                                                                    )
                                                                                                                    .join(
                                                                                                                      ""
                                                                                                                    )
                                                                                                                : '<tr><td colspan="6" style="text-align: center; color: #999;">暂无产品数据</td></tr>'
                                                                                                            }
                                                                                                          </tbody>
                                                                                                          <tfoot>
                                                                                                            <tr>
                                                                                                              <td class="label">合计</td>
                                                                                                              <td class="total-value"></td>
                                                                                                              <td class="total-value"></td>
                                                                                                              <td class="total-value"></td>
                                                                                                              <td class="total-value">${getTotalQuantityForPrint(
                                                                                                                item.products
                                                                                                              )}</td>
                                                                                                              <td class="total-value">${getTotalAmountForPrint(
                                                                                                                item.products
                                                                                                              )}</td>
                                                                                                            </tr>
                                                                                                          </tfoot>
                                                                                                        </table>
                                                                                                      </div>
                                                                                          <div class="footer-section">
                                                                                            <div class="footer-row">
                                                                                              <div class="footer-item">
                                                                                                <span class="label">收货电话:</span>
                                                                                                <span class="value"></span>
                                                                                              </div>
                                                                                              <div class="footer-item">
                                                                                                <span class="label">收货人:</span>
                                                                                                <span class="value"></span>
                                                                                              </div>
                                                                                              <div class="footer-item address-item">
                                                                                                <span class="label">收货地址:</span>
                                                                                                <span class="value address-value"></span>
                                                                                              </div>
                                                                                            </div>
                                                                                            <div class="footer-row">
                                                                                              <div class="footer-item">
                                                                                                <span class="label">操作员:</span>
                                                                                                <span class="value">${
                                                                                                  userStore.nickName ||
                                                                                                  "撕开前"
                                                                                                }</span>
                                                                                              </div>
                                                                                              <div class="footer-item">
                                                                                                <span class="label">打印日期:</span>
                                                                                                <span class="value">${formatDateTime(
                                                                                                  new Date()
                                                                                                )}</span>
                                                                                              </div>
                                                                                            </div>
                                                                                          </div>
                                                                                        </div>
                                                                                      </div>
                                                                                    `;
                                                                                                      <div class="footer-section">
                                                                                                        <div class="footer-row">
                                                                                                          <div class="footer-item">
                                                                                                            <span class="label">收货电话:</span>
                                                                                                            <span class="value"></span>
                                                                                                          </div>
                                                                                                          <div class="footer-item">
                                                                                                            <span class="label">收货人:</span>
                                                                                                            <span class="value"></span>
                                                                                                          </div>
                                                                                                          <div class="footer-item address-item">
                                                                                                            <span class="label">收货地址:</span>
                                                                                                            <span class="value address-value"></span>
                                                                                                          </div>
                                                                                                        </div>
                                                                                                        <div class="footer-row">
                                                                                                          <div class="footer-item">
                                                                                                            <span class="label">操作员:</span>
                                                                                                            <span class="value">${
                                                                                                              userStore.nickName ||
                                                                                                              "撕开前"
                                                                                                            }</span>
                                                                                                          </div>
                                                                                                          <div class="footer-item">
                                                                                                            <span class="label">打印日期:</span>
                                                                                                            <span class="value">${formatDateTime(
                                                                                                              new Date()
                                                                                                            )}</span>
                                                                                                          </div>
                                                                                                        </div>
                                                                                                      </div>
                                                                                                    </div>
                                                                                                  </div>
                                                                                                `;
    });
    printContent += `
                                                                                    </body>
                                                                                    </html>
                                                                                  `;
                                                                                                </body>
                                                                                                </html>
                                                                                              `;
    // 写入内容到新窗口
    printWindow.document.write(printContent);