chenlu
2024-09-06 d809ecd16cbb23f5aad86a6844f51ffea0455fe8
north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet1.vue
@@ -7,8 +7,12 @@
import {ElMessage} from "element-plus";
const company = companyInfo()
let produceList = ref([])
let otherMoney = []
let otherMoney1 = []
let delivery = ref([])
let money = ref("")
let otherMoneys = 0
let sumMoney = 0
let takeCare = "注意:请妥善保管好我司的玻璃架,如有丢失或损坏,按1500元只赔偿。谢谢配合!"
let remark = "备注:本批玻璃为优等合格品,请在卸货时,当面消点验收、如有质量问题在一周内与本公司联系,否则概不负责!"
@@ -31,7 +35,36 @@
      produceList.value = deepClone(res.data.data)
      delivery.value=deepClone(res.data.delivery)
      money.value=deepClone(res.data.money)
      otherMoney.value=deepClone(res.data.otherMoney)
      produceList.value.forEach(item => {
        sumMoney+=item.DeliveryDetail.money
      })
      otherMoney1=[]
      otherMoney=deepClone(res.data.otherMoney)
      for(let i=0;i<otherMoney.length;i++){
        if(otherMoney[i].DeliveryDetailOtherMoney.monery!=null){
          otherMoneys+=otherMoney[i].DeliveryDetailOtherMoney.monery
          if(otherMoney1.length===0){
            otherMoney1.push(otherMoney[i])
          }
          else{
            for(let s=0;s<otherMoney1.length;s++){
              if(otherMoney[i].DeliveryDetailOtherMoney.alias===otherMoney1[s].DeliveryDetailOtherMoney.alias){
                otherMoney1[s].DeliveryDetailOtherMoney.count=otherMoney[i].DeliveryDetailOtherMoney.count+otherMoney1[s].DeliveryDetailOtherMoney.count
                otherMoney1[s].DeliveryDetailOtherMoney.monery =otherMoney[i].DeliveryDetailOtherMoney.monery+otherMoney1[s].DeliveryDetailOtherMoney.monery
                break
              }
              if(s+1===otherMoney1.length){
                otherMoney1.push(otherMoney[i])
                break
              }
            }
          }
        }
      }
    }else{
      ElMessage.warning(res.msg)
      router.push("/login")
@@ -86,146 +119,348 @@
});
</script>
<template>
  <div id="sheet">
    <table >
      <thead>
      <tr class="title-s">
        <th colspan="9">
          <h1>
            {{company.companyName}}
          </h1>
        </th>
      </tr>
  <div>
      <tr  class="title-s">
        <th colspan="2" style="width: 30%"></th>
        <th colspan="5" style="width: 40%;">
          <h3>销售发货单</h3>
        </th>
        <th colspan="2" style="width: 30%;text-align: left;">发货单号:<span>{{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>
      </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>
      </tr>
    <div id="sheet" style="width: 100%;height: 100%">
      <div style="font-size: 30px;text-align: center;font-weight: bold;">{{company.companyName}}</div>
      <el-row :gutter="20">
        <el-col :span="7"><div></div></el-col>
        <el-col :span="10"><div style="font-size: 25px;text-align: center;font-weight: bold;">销售发货单</div></el-col>
        <el-col :span="7">
          <div style="display: flex;margin-top: 10px;">
            <div style="font-weight: bold;font-size: 15px">发货单号:</div>
            <div style="font-weight: bold;font-size: 15px">{{delivery.deliveryId}}</div>
      </thead>
      <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" >
              <thead>
              <tr v-if="index===0">
                <th style="width: 6%;">序号</th>
                <th style="width: 15%;">楼层编号</th>
                <th style="width: 17%;" colspan="1">宽X高</th>
                <th style="width: 10%;">数量</th>
                <th style="width: 10%;">面积</th>
                <th style="width: 10%;">单价</th>
                <th style="width: 12%;">金额</th>
                <th style="width: 20%;" colspan="2">加工要求</th>
              </tr>
              </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>
              </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="1" 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="1" style="font-size: 15px;font-weight: bold;" v-else>{{items.width}}x{{items.height}}</td>
                <td>{{items.quantity}}</td>
                <td>{{items.area}}</td>
                <td>{{items.price}}</td>
                <td>{{items.money}}</td>
                <td colspan="2">{{items.processingNote}}</td>
              </tr>
              <tr class="day-in" >
                <td style="font-size: 15px;" colspan="3">小计:</td>
                <td>{{item.DeliveryDetail.quantity}}</td>
                <td>{{item.DeliveryDetail.area}}</td>
                <td></td>
                <td>{{item.DeliveryDetail.money}}</td>
                <td colspan="2"></td>
              </tr>
            </template>
            <tr class="day-in">
              <td style="font-size: 15px;" colspan="3">合计:</td>
              <td>{{delivery.quantity}}</td>
              <td>{{delivery.area}}</td>
              <td></td>
              <td>{{parseFloat(sumMoney.toFixed(2))}}</td>
              <td colspan="2"></td>
            </tr>
            <tr class="day-in">
              <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6" colspan="4">
                <div style="display: flex;font-size: 10px;text-align: center;">
                  <div style="width: 25%">加工费用</div>
                  <div  style="width: 25%">单价</div>
                  <div  style="width: 25%">数量</div>
                  <div  style="width: 25%">金额</div>
                </div>
              </td>
              <td style="text-align: left;border:none;font-size: 15px;" colspan="5">总金额:&nbsp;&nbsp;&nbsp;&nbsp;{{delivery.money}}</td>
            </tr>
            <tr class="day-in">
              <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6;" colspan="4" >
                <div style="display: flex;font-size: 10px;text-align: center" v-for="(item, index2) in otherMoney1" :key="index2">
                  <div style="width: 25%">{{item.DeliveryDetailOtherMoney.alias}}</div>
                  <div  style="width: 25%">{{item.DeliveryDetailOtherMoney.price}}</div>
                  <div  style="width: 25%">{{item.DeliveryDetailOtherMoney.count}}</div>
                  <div  style="width: 25%">{{parseFloat(item.DeliveryDetailOtherMoney.monery.toFixed(2))}}</div>
                </div>
                <div style="display: flex;font-size: 10px;text-align: center" v-if="delivery.freight>0">
                  <div style="width: 25%">运费</div>
                  <div  style="width: 25%">{{delivery.freightPrice}}</div>
                  <div  style="width: 25%">{{delivery.freightQuantity}}</div>
                  <div  style="width: 25%">{{delivery.freight}}</div>
                </div>
              </td>
              <td style="text-align: left;border:none;font-size: 15px;" colspan="5">大写金额:&nbsp;&nbsp;&nbsp;&nbsp;{{money}}</td>
            </tr>
            <!--      <el-row :gutter="24">
                    <el-col :span="4"><div style="font-size: 12px" class="bottom">制单员:{{data.order.creator}}<span style="font-size: 10px"></span></div></el-col>
                    <el-col :span="6"><div style="font-size: 12px" class="bottom">制单日期:{{data.order.createTime}}<span style="font-size: 10px"></span></div></el-col>
                    <el-col :span="4"><div style="font-size: 12px" class="bottom">审核员:{{data.order.verifier}}</div></el-col>
                    <el-col :span="6"><div style="font-size: 12px" class="bottom">审核日期:{{data.order.updateTime}}</div></el-col>
                    <el-col :span="4"><div style="font-size: 12px" class="bottom">打印人:{{username}}</div></el-col>
                  </el-row>-->
            <tr class="day-in" style="border: 0;">
              <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: 10%">发货员:</div>
                  <div style="width: 10%">司机:</div>
                  <div style="width: 15%">客户签字:</div>
                  <div style="width: 15%">签收日期:</div>
                </div>
              </td>
            </tr>
            <tr class="day-in" style="border: 0;">
              <td colspan="9" style="border: 0;">
                <div style="display:flex;" class="bottom">
                  架子&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;只&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  {{takeCare}}
                </div>
              </td>
            </tr>
            <tr class="day-in" style="border: 0;">
              <td colspan="9" style="border: 0;">
                <div style="display:flex;" class="bottom">
                  {{remark}}
                </div>
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    <!--    <table border="1" >
      <thead>
      <tr class="title-s">
        <th colspan="13">
          <h1>
            {{company.companyName}}
          </h1>
        </th>
      </tr>
      <tr  class="title-s">
        <th colspan="2"></th>
        <th colspan="5">
          <h3>销售发货单</h3>
        </th>
        <th colspan="2" style="text-align: left;">发货单号:<span>{{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>
      </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>
      </tr>
      <tr>
        <th style="width: 6%;">序号</th>
        <th style="width: 20%;">楼层编号</th>
        <th style="width: 20%;" colspan="2">宽X高</th>
        <th style="width: 10%;">数量</th>
        <th style="width: 10%;">面积</th>
        <th style="width: 10%;">单价</th>
        <th style="width: 12%;">金额</th>
        <th style="width: 12%;" colspan="2">加工要求</th>
      </tr>
      </thead>
      <template v-for="(item, index) in produceList" :key="index" >
        <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="3">对方单号:</td>
          <td style="font-size: 15px;text-align: left" colspan="3">订单编号:<span>{{item.DeliveryDetail.orderDetail.orderId}}</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;">{{items.width}}x{{items.height}}</td>
          <td>{{items.quantity}}</td>
          <td>{{items.area}}</td>
          <td>{{items.price}}</td>
          <td>{{items.money}}</td>
          <td colspan="2">{{items.processingNote}}</td>
        </tr>
        <tr class="day-in" >
          <td style="font-size: 15px;" colspan="4">小计:</td>
          <td>{{item.DeliveryDetail.quantity}}</td>
          <td>{{item.DeliveryDetail.area}}</td>
          <td></td>
          <td>{{item.DeliveryDetail.money}}</td>
          <td></td>
        </tr>
      </template>
      <tr class="day-in">
        <td style="font-size: 15px;" colspan="4">合计:</td>
        <td>{{delivery.quantity}}</td>
        <td>{{delivery.area}}</td>
        <td></td>
        <td>{{delivery.money-otherMoneys-delivery.freight}}</td>
        <td></td>
      </tr>
      <tr class="day-in">
        <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6" colspan="4">
          <div style="display: flex;font-size: 10px;text-align: center;">
            <div style="width: 25%">加工费用</div>
            <div  style="width: 25%">单价</div>
            <div  style="width: 25%">数量</div>
            <div  style="width: 25%">金额</div>
          </div>
        </el-col>
      </el-row>
      <div style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%;height: 100%;">
        <table id="table1" style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%;height: 100%;">
          <tr>
            <th style="text-align: left;border:none;" colspan="3">客户名称:<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>
          </tr>
          <tr>
            <th style="text-align: left;border:none;" colspan="6">送货地址:<span>{{delivery.deliveryAddress}}</span></th>
            <th style="text-align: left;border:none;" colspan="2">联系电话:<span>{{delivery.contactNumber}}</span></th>
          </tr>
          <tr>
            <th style="width: 6%;">序号</th>
            <th style="width: 20%;">楼层编号</th>
            <th style="width: 20%;">宽(弧度)*高</th>
            <th style="width: 10%;">数量</th>
            <th style="width: 10%;">面积</th>
            <th style="width: 10%;">单价</th>
            <th style="width: 12%;">金额</th>
            <th style="width: 12%;">加工要求</th>
          </tr>
          <template v-for="(item, index) in produceList" :key="index" >
            <tr>
              <td style="font-size: 15px;font-weight: bold;" colspan="3">产品名称:<span>{{item.DeliveryDetail.orderDetail.productName}}</span></td>
              <td style="font-size: 15px;font-weight: bold;" colspan="3">对方单号:</td>
              <td style="font-size: 15px;font-weight: bold;" colspan="2">订单编号:<span>{{item.DeliveryDetail.orderDetail.orderId}}</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 style="font-size: 15px;font-weight: bold;">{{items.width}}x{{items.height}}</td>
              <td>{{items.quantity}}</td>
              <td>{{items.area}}</td>
              <td>{{items.price}}</td>
              <td>{{items.money}}</td>
              <td>{{items.processingNote}}</td>
            </tr>
            <tr class="day-in" >
              <td style="font-size: 15px;font-weight: bold;" colspan="3">小计:</td>
              <td>{{item.DeliveryDetail.quantity}}</td>
              <td>{{item.DeliveryDetail.area}}</td>
              <td></td>
              <td>{{item.DeliveryDetail.money}}</td>
              <td></td>
            </tr>
          </template>
          <tr class="day-in">
            <td style="font-size: 15px;font-weight: bold;" colspan="3">合计:</td>
            <td>{{delivery.quantity}}</td>
            <td>{{delivery.area}}</td>
            <td></td>
            <td>{{delivery.money}}</td>
            <td></td>
          </tr>
          <tr class="day-in">
            <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6" colspan="3">
              <div style="display: flex;font-size: 10px;">
                <div>加工费用</div>
                <div  style="margin-left: 20%">单价</div>
                <div  style="margin-left: 20%">数量</div>
                <div  style="margin-left: 20%">金额</div>
              </div>
            </td>
            <td style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="5">总金额:&nbsp;&nbsp;&nbsp;&nbsp;{{delivery.money}}</td>
          </tr>
          <tr class="day-in">
            <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6;" colspan="3"></td>
            <td style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="5">大写金额:&nbsp;&nbsp;&nbsp;&nbsp;{{money}}</td>
          </tr>
        </table>
      </div>
      <el-row :gutter="20">
        <el-col :span="3"><div class="bottom">制单员:<span style="font-size: 10px">{{delivery.creator}}</span></div></el-col>
        <el-col :span="5"><div class="bottom">制单日期:<span style="font-size: 10px">{{delivery.createTime}}</span></div></el-col>
        <el-col :span="4"><div class="bottom">发货员:</div></el-col>
        <el-col :span="4"><div class="bottom">司机:</div></el-col>
        <el-col :span="4"><div class="bottom">客户签字:</div></el-col>
        <el-col :span="4"><div class="bottom">签收日期:</div></el-col>
      </el-row>
      <el-row :gutter="20" style="margin-top: 20px;">
        <el-col :span="3"><div class="bottom">架子&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;只</div></el-col>
        <el-col :span="21"><div class="bottom">{{takeCare}}</div></el-col>
      </el-row>
      <el-row :gutter="20" style="margin-top: 20px;">
        <el-col :span="24"><div class="bottom">{{remark}}</div></el-col>
      </el-row>
        </td>
        <td style="text-align: left;border:none;font-size: 15px;" colspan="5">总金额:&nbsp;&nbsp;&nbsp;&nbsp;{{delivery.money}}</td>
      </tr>
      <tr class="day-in">
        <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6;" colspan="4" >
          <div style="display: flex;font-size: 10px;text-align: center" v-for="(item, index2) in otherMoney" :key="index2">
            <div style="width: 25%">{{item.DeliveryDetailOtherMoney.alias}}</div>
            <div  style="width: 25%">{{item.DeliveryDetailOtherMoney.price}}</div>
            <div  style="width: 25%">{{item.DeliveryDetailOtherMoney.count}}</div>
            <div  style="width: 25%">{{item.DeliveryDetailOtherMoney.monery}}</div>
          </div>
          <div style="display: flex;font-size: 10px;text-align: center" v-if="delivery.freight>0">
            <div style="width: 25%">运费</div>
            <div  style="width: 25%">{{delivery.freightPrice}}</div>
            <div  style="width: 25%">{{delivery.freightQuantity}}</div>
            <div  style="width: 25%">{{delivery.freight}}</div>
          </div>
        </td>
        <td style="text-align: left;border:none;font-size: 15px;" colspan="5">大写金额:&nbsp;&nbsp;&nbsp;&nbsp;{{money}}</td>
      </tr>
      <tfoot style="border: 0">
      &lt;!&ndash;      <el-row :gutter="24">
              <el-col :span="4"><div style="font-size: 12px" class="bottom">制单员:{{data.order.creator}}<span style="font-size: 10px"></span></div></el-col>
              <el-col :span="6"><div style="font-size: 12px" class="bottom">制单日期:{{data.order.createTime}}<span style="font-size: 10px"></span></div></el-col>
              <el-col :span="4"><div style="font-size: 12px" class="bottom">审核员:{{data.order.verifier}}</div></el-col>
              <el-col :span="6"><div style="font-size: 12px" class="bottom">审核日期:{{data.order.updateTime}}</div></el-col>
              <el-col :span="4"><div style="font-size: 12px" class="bottom">打印人:{{username}}</div></el-col>
    </div>
            </el-row>&ndash;&gt;
      <tr class="day-in" style="border: 0;">
        <td colspan="9" style="border: 0;">
          <div style="display:flex;">
            <div style="width: 15%">制单员:{{ delivery.creator }}</div>
            <div style="width: 25%">制单日期:{{ delivery.createTime }}</div>
            <div style="width: 10%">发货员:</div>
            <div style="width: 10%">司机:</div>
            <div style="width: 15%">客户签字:</div>
            <div style="width: 15%">签收日期:</div>
          </div>
        </td>
      </tr>
      <tr>
        <td colspan="9" style="border: 0;">
          <div style="display:flex;" class="bottom">架子&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;只</div>
          <div style="display:flex;" class="bottom">
            {{takeCare}}
          </div>
        </td>
      </tr>
      <tr>
        <td colspan="9" style="border: 0;">
          <div style="display:flex;" class="bottom">
            {{remark}}
          </div>
        </td>
      </tr>
      </tfoot>
    </table>-->
  </div>
</template>
<style scoped>
#sheet{
h1,h3{
  left:0;
  right:0;
  top:0;
  bottom:0;
  margin:auto;
}
#table1 tr{
  height: 30px;
h1{
  font-size: 1.5rem;
}
#table1 th{
  height: 30px;
  border: 1px solid #d3dce6;
h3{
  font-size: 1.2rem;
  font-weight: bolder;
}
table{
  border-collapse: collapse;
  font-size: 15px;
  font-weight: bold;
}
.day-in td{
  width: 100%;
  text-align: center;
}
#table1 td{
  border: 1px solid #d3dce6;
  border-collapse: collapse;
tr,td,th{
  border: 1px solid black;
}
#deliveryPrinting .el-dialog__header{
  visibility:hidden
th,.no-change-row {
  white-space: nowrap;
}
.title-1{
@@ -241,6 +476,17 @@
  background-color: black;
  color: black;
}
table {
  border-collapse: collapse;
  width: 100%;
}
td > table {
  margin: 0;
  padding: 0;
}
</style>