廖井涛
2025-12-01 2bdd525d521205f0106c6008f4e8e14d7b8051f6
north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet2.vue
@@ -15,7 +15,7 @@
let remark = company.deliveryRemark
let produceList2 = ref([])
let props = defineProps({
  deliveryId:null
})
@@ -26,19 +26,24 @@
    return
  }
  form.value.deliveryId=props.deliveryId
  form.value.type=company.productName
  request.post(`/delivery/getSelectDeliveryPrinting`,form.value).then((res) => {
    if(res.code==200){
      produceList.value = deepClone(res.data.data)
      delivery.value=deepClone(res.data.delivery)
      money.value=deepClone(res.data.money)
      otherMoney.value=deepClone(res.data.otherMoney)
      otherMoney.value.forEach(item => {
        if(item.DeliveryDetailOtherMoney.monery!=null){
          otherMoneys+=item.DeliveryDetailOtherMoney.monery
        }
      })
      produceList.value = deepClone(res.data)
      for(let i=0;i<produceList.value.length;i++){
        let produceList1= ({
          data:null,
          delivery:null,
        })
        produceList1.data=produceList.value[i].data
        produceList1.delivery=produceList.value[i].delivery
        produceList2.value.push(produceList1)
      }
    }else{
      ElMessage.warning(res.msg)
      router.push("/login")
@@ -85,6 +90,12 @@
const printSheet = () => {
}
const showSimpleOrderId = ref(true);
// 2. 切换显示状态的函数
const toggleOrderDisplay = () => {
  showSimpleOrderId.value = !showSimpleOrderId.value;
};
@@ -95,7 +106,7 @@
<template>
  <div id="sheet">
    <table >
    <table class="pages" v-for="(itme1, index) in produceList2" :key="index" >
      <thead>
      <tr class="title-s">
        <th colspan="9">
@@ -108,18 +119,22 @@
      <tr  class="title-s">
        <th colspan="2" style="width: 30%"></th>
        <th colspan="5" style="width: 40%;">
          <h4 v-if="!company.showDeliveryCreator" >金华市乐动智能科技有限公司</h4>
          <h3>销售发货单</h3>
        </th>
        <th colspan="2" style="width: 30%;text-align: left;">发货单号:<span>{{delivery.deliveryId}}</span></th>
        <th colspan="2" style="width: 30%;text-align: left;">发货单号:<span>{{itme1.delivery.deliveryId}}</span></th>
      </tr>
      <tr>
        <th style="text-align: left;border:none;" colspan="4">客户名称:<span>{{delivery.customerName}}</span></th>
        <th style="text-align: left;border:none;" colspan="3">项目名称:<span>{{delivery.project}}</span></th>
        <th style="text-align: left;border:none;" colspan="2">联系人:<span>{{delivery.contacts}}</span></th>
        <th style="text-align: left;border:none;" colspan="4">客户名称:<span>{{itme1.delivery.customerName}}</span></th>
        <th style="text-align: left;border:none;" v-if="itme1.data[0].DeliveryDetail.order.batch!==''" colspan="3">
          项目名称:<span>{{itme1.delivery.project}}({{itme1.data[0].DeliveryDetail.order.batch}})</span></th>
        <th style="text-align: left;border:none;" v-else colspan="3">项目名称:<span>{{itme1.delivery.project}}</span></th>
        <th style="text-align: left;border:none;" colspan="2">联系人:<span>{{itme1.delivery.contacts}}</span></th>
      </tr>
      <tr>
        <th style="text-align: left;border:none;" colspan="7">送货地址:<span>{{delivery.deliveryAddress}}</span></th>
        <th style="text-align: left;border:none;" colspan="2">联系电话:<span>{{delivery.contactNumber}}</span></th>
        <th style="text-align: left;border:none;" colspan="7">送货地址:<span>{{itme1.delivery.deliveryAddress}}</span></th>
        <th style="text-align: left;border:none;" colspan="2">联系电话:<span>{{itme1.delivery.contactNumber}}</span></th>
      </tr>
@@ -127,11 +142,12 @@
      <tr style="border-style: none">
        <td colspan="9" style="border-style: none">
          <table style="border-style: none;width: 100%;height: 100%">
            <template v-for="(item, index) in produceList" :key="index" >
            <template v-for="(item, index) in itme1.data" :key="index" >
              <thead>
              <tr v-if="index===0">
                <th style="width: 6%;">序号</th>
                <th style="width: 20%;">楼层编号</th>
                <th style="width: 10%;">楼层编号</th>
                <th style="width: 10%;">箱号</th>
                <th style="width: 20%;" colspan="2">宽X高</th>
                <th style="width: 10%;">数量</th>
                <th style="width: 10%;">面积</th>
@@ -141,31 +157,38 @@
              </thead>
              <tr>
                <td style="font-size: 15px;text-align: left" colspan="4">产品名称:<span>{{item.DeliveryDetail.orderDetail.productName}}</span></td>
                <td style="font-size: 15px;text-align: left" colspan="2">对方单号:</td>
                <td style="font-size: 15px;text-align: left" colspan="3">订单编号:<span>{{item.DeliveryDetail.orderDetail.orderId}}</span></td>
                <td style="font-size: 15px;text-align: left" colspan="5">产品名称:<span>{{item.DeliveryDetail.orderDetail.productName}}</span></td>
                <td v-if="company.showDeliveryCreator" style="font-size: 15px;text-align: left" colspan="2">订货日期:<span>{{item.DeliveryDetail.order.contractId}}</span></td>
                <td style="font-size: 15px;text-align: left" v-show="showSimpleOrderId"
                    @dblclick="toggleOrderDisplay" colspan="3">订单编号:<span>{{item.DeliveryDetail.orderDetail.orderId}}</span></td>
                <td style="font-size: 15px;text-align: left" v-show="!showSimpleOrderId"
                    @dblclick="toggleOrderDisplay" colspan="3">订单编号:<span>{{item.DeliveryDetail.orderDetail.orderId}}({{item.DeliveryDetail.order.batch}})</span></td>
              </tr>
              <tr class="day-in" v-for="(items, index1) in item.DeliveryDetailList" :key="index1">
                <td>{{items.order_number}}</td>
                <td>{{items.buildingNumber}}</td>
                <td colspan="2" style="font-size: 15px;font-weight: bold;" v-if="items.other_columns!=null&&(JSON.parse(items.other_columns).S02!=null)">{{JSON.parse(items.other_columns).S02}}</td>
                <td colspan="2" style="font-size: 15px;font-weight: bold;" v-else>{{items.width}}x{{items.height}}</td>
                <td >{{items.buildingNumber}}</td>
                <td >{{items.box_no}}</td>
<!--                <td colspan="2" style="font-size: 15px;font-weight: bold;" v-if="items.other_columns!=null&&(JSON.parse(items.other_columns).S02!=null && company.companyName==='金华福喜天成玻璃有限公司')">{{JSON.parse(items.other_columns).S02}}</td>-->
                <td colspan="2" style="font-size: 15px;font-weight: bold;" >
                  {{items.other_columns!=null&&(JSON.parse(items.other_columns).S02!=null )?"("+JSON.parse(items.other_columns).S02+")":''}}
                  {{items.width}}x{{items.height}}
                </td>
                <td>{{items.quantity}}</td>
                <td>{{items.area}}</td>
                <td colspan="3">{{items.processingNote}}</td>
              </tr>
              <tr class="day-in" >
                <td style="font-size: 15px;" colspan="4">小计:</td>
                <td style="font-size: 15px;" colspan="5">小计:</td>
                <td>{{item.DeliveryDetail.quantity}}</td>
                <td>{{item.DeliveryDetail.area}}</td>
              </tr>
            </template>
            <tr class="day-in">
              <td style="font-size: 15px;" colspan="4">合计:</td>
              <td>{{delivery.quantity}}</td>
              <td>{{delivery.area}}</td>
              <td style="font-size: 15px;" colspan="5">合计:</td>
              <td>{{itme1.delivery.quantity}}</td>
              <td>{{itme1.delivery.area}}</td>
            </tr>
@@ -181,8 +204,8 @@
            <tr class="day-in" style="border: 0;" v-if="company.showDeliveryCreator">
              <td colspan="9" style="border: 0;">
                <div style="display:flex;;text-align: left"  class="bottom">
                  <div style="width: 15%">制单员:{{ delivery.creator }}</div>
                  <div style="width: 25%">制单日期:{{ delivery.createTime }}</div>
                  <div style="width: 15%">制单员:{{ itme1.delivery.creator }}</div>
                  <div style="width: 25%">制单日期:{{ itme1.delivery.createTime }}</div>
                  <div style="width: 10%">发货员:</div>
                  <div style="width: 10%">司机:</div>
                  <div style="width: 15%">客户签字:</div>
@@ -219,8 +242,8 @@
            <tr class="day-in" style="border: 0;" v-if="!company.showDeliveryCreator">
              <td colspan="9" style="border: 0;">
                <div style="display:flex;;text-align: left"  class="bottom">
                  <div style="width: 15%">制单员:{{ delivery.creator }}</div>
                  <div style="width: 25%">制单日期:{{ delivery.createTime }}</div>
                  <div style="width: 15%">制单员:{{ itme1.delivery.creator }}</div>
                  <div style="width: 25%">制单日期:{{ itme1.delivery.createTime }}</div>
                  <div style="width: 10%">发货员:</div>
                  <div style="width: 10%">司机:</div>
                  <div style="width: 15%">客户签字:</div>
@@ -246,7 +269,20 @@
<style scoped>
@media print {
  @page {
    margin: 12mm 10mm 20mm 10mm !important;
  }
  .pages {
    page-break-after: always;
  }
  @page {
    @top-right {
      margin-top: 50px;
      content: "第 " counter(page)  " 页"; /* 使用counter添加页码 */
    }
  }
}
h1,h3{
  left:0;
  right:0;