廖井涛
2025-07-03 733ad4523cb3e32876dc2155d12c1c527c590f6b
洛阳发货单打印功能新增以及优化模块部分修改
6个文件已修改
1个文件已添加
391 ■■■■■ 已修改文件
north-glass-erp/northglass-erp/src/components/mm/PrintPackingListLuoyang.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheetLuoyang.vue 255 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/ProjectCreate.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ProjectDetail.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/GlassOptimize.xml 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/DeliveryDetailMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/mm/PrintPackingListLuoyang.vue
@@ -131,7 +131,7 @@
              <template v-for="(itemDatile,index) in item.detailList" :key="index">
                <tr style="width: 100%;">
                  <td colspan="1" style="font-weight: bold">加工品种:</td>
                  <td colspan="4"><el-input type="textarea" :autosize="{ minRows: 2, maxRows: 20 }"  v-model="itemDatile.product_name"/></td>
                  <td colspan="4"><el-input class="textarea" type="textarea" :autosize="{ minRows: 2, maxRows: 20 }"  v-model="itemDatile.product_name"/></td>
                </tr>
                <template v-for="(item,index) in itemDatile.detailList" :key="index">
                  <tr style="width: 100%;margin-top: 20px">
@@ -249,6 +249,12 @@
  font-size: 15px;
}
.textarea{
  --el-border-color: rgba(255,255,255,0.0);
  --el-input-focus-border-color: rgba(255,255,255,0.0);
  --el-input-focus-border-width: 0px;
  --el-input-hover-border-color: rgba(255,255,255,0.0);
  --el-input-hover-border-width: 0px;
}
</style>
north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheetLuoyang.vue
New file
@@ -0,0 +1,255 @@
<script setup>
import request from "@/utils/request"
import {computed, onMounted, ref} from "vue"
import PrintFoot from "@/components/sd/order/PrintFoot.vue"
import companyInfo from "@/stores/sd/companyInfo"
import deepClone from "@/utils/deepClone";
import {ElMessage} from "element-plus";
import {add,multiply,multiplyAuto,divideAuto} from '@/utils/decimal';
const company = companyInfo()
let produceList = ref([])
let otherMoney = []
let otherMoney1 = []
let delivery = ref([])
let money = ref("")
let otherMoneys = 0
let sumMoney = 0
let takeCare =ref("具体规格详见清单")
let remark =ref(company.deliveryRemark)
let props = defineProps({
  deliveryId:null,
  type:null
})
const form = ref({
})
let produceList2 = ref([])
const getData = () => {
  if(props.deliveryId===null  || props.deliveryId===undefined || props.deliveryId===''){
    return
  }
  form.value.deliveryId=props.deliveryId
  form.value.type=company.productName
  request.post(`/delivery/getSelectDeliveryPrinting`,form.value).then((res) => {
    if(res.code==200){
      console.log(res.data)
      produceList.value = deepClone(res.data)
      for(let i=0;i<produceList.value.length;i++){
        let produceList1= ({
          data:null,
          otherMoney:null,
          otherMoney1:null,
          delivery:null,
          money:null,
          otherMoneys:0,
          sumMoney:0
        })
        produceList1.data=produceList.value[i].data
        produceList1.delivery=produceList.value[i].delivery
        produceList1.money=produceList.value[i].money
        produceList1.otherMoney=produceList.value[i].otherMoney
        for(let j=0;j<produceList1.data.length;j++){
          produceList1.sumMoney+=produceList1.data[j].DeliveryDetail.money
        }
        otherMoney1=[]
        for(let i=0;i<produceList1.otherMoney.length;i++){
          if(produceList1.otherMoney[i].DeliveryDetailOtherMoney.monery!=null){
            produceList1.otherMoneys+=produceList1.otherMoney[i].DeliveryDetailOtherMoney.monery
            if(otherMoney1.length===0){
              otherMoney1.push(produceList1.otherMoney[i])
            }
            else{
              for(let s=0;s<otherMoney1.length;s++){
                if(produceList1.otherMoney[i].DeliveryDetailOtherMoney.alias===otherMoney1[s].DeliveryDetailOtherMoney.alias){
                  otherMoney1[s].DeliveryDetailOtherMoney.count=add(produceList1.otherMoney[i].DeliveryDetailOtherMoney.count,otherMoney1[s].DeliveryDetailOtherMoney.count)
                  otherMoney1[s].DeliveryDetailOtherMoney.monery =add(produceList1.otherMoney[i].DeliveryDetailOtherMoney.monery,otherMoney1[s].DeliveryDetailOtherMoney.monery)
                  break
                }
                if(s+1===otherMoney1.length){
                  otherMoney1.push(produceList1.otherMoney[i])
                  break
                }
              }
            }
          }
        }
        produceList1.otherMoney1=otherMoney1
        produceList2.value.push(produceList1)
      }
      for(let j=0;j<produceList2.value.length;j++){
        if(produceList2.value[j].delivery.money.toFixed(0)!==(produceList2.value[j].otherMoneys
            +produceList2.value[j].sumMoney+produceList2.value[j].delivery.freight).toFixed(0)){
          console.log(produceList2.value[j])
          console.log(produceList2.value[j].delivery.money)
          console.log((produceList2.value[j].otherMoneys
              +produceList2.value[j].sumMoney).toFixed(0))
          console.log(produceList2.value[j].delivery.deliveryId)
        }
      }
    }else{
      ElMessage.warning(res.msg)
      router.push("/login")
    }
  })
}
onMounted(() => {
  getData()
})
const  stringToJson = (productList) => {
  productList.forEach(item => {
    item.otherColumns = JSON.parse(item.otherColumns)
  })
}
const getQuantity = (productList) => {
  let quantity = 0
  productList.forEach(item => {
    quantity += item.quantity
  })
  return parseFloat(quantity.toFixed(3))
}
const getArea = (productList) => {
  let area = 0
  productList.forEach(item => {
    area += item.grossArea
  })
  return parseFloat(area.toFixed(3))
}
const getPerimeter = (productList) => {
  let perimeter = 0
  productList.forEach(item => {
    perimeter += item.perimeter
  })
  return parseFloat(perimeter.toFixed(3))
}
const printSheet = () => {
}
defineExpose({
  printSheet
});
</script>
<template>
  <div id="sheet">
    <div v-for="(item, index) in produceList2" :key="index">
    <div id="header">
      <div id="header-pane">
        <div>洛阳玻璃公司</div>
        <div style="margin: auto;">{{item.delivery.deliveryId}}</div>
        <div>{{item.delivery.deliveryDate }}</div>
      </div>
      <div id="header-customer" style="display: flex;height: 50px;line-height: 50px">
        <div>{{item.delivery.customerName }}</div>
        <div style="margin-left: 60%;">{{item.delivery.project }}</div>
      </div>
      <div id="header-order-id" style="height: 50px;line-height: 50px">
        <div>{{item.delivery.orderId }}</div>
      </div>
    </div>
    <div id="content">
      <div style="display:flex;margin-top: 20px" id="content-pane" v-for="(items, index) in item.data" :key="index">
        <div style="width: 200px;">
          <el-input  class="textarea" type="textarea" :autosize="{ minRows: 2, maxRows: 20 }" v-model="items.DeliveryDetail.orderDetail.productName" />
        </div>
        <div style="width: 200px">
          <el-input  class="textarea" type="textarea" :autosize="{ minRows: 2, maxRows: 20 }" v-model="takeCare" />
        </div>
        <div style="width: 70px">{{items.DeliveryDetail.quantity}}</div>
        <div style="width: 70px">{{items.DeliveryDetail.area}}</div>
        <div style="width: 70px" v-if="props.type===1">{{items.DeliveryDetail.price}}</div>
        <div style="width: 70px" v-if="props.type===1">{{items.DeliveryDetail.money}}</div>
      </div>
      <div style="display:flex;height: 50px" id="content-total">
        <div style="width: 200px;"></div>
        <div style="width: 200px"></div>
        <div style="width: 70px">{{item.delivery.quantity}}</div>
        <div style="width: 70px">{{item.delivery.area}}</div>
        <div style="width: 70px"></div>
        <div style="width: 70px" v-if="props.type===1">{{item.delivery.money }}</div>
      </div>
      <div style="height: 70px" id="content-name">
        <div style="margin-left: 610px">{{item.delivery.creator }}</div>
      </div>
      <div style="display:flex;" id="content-customer">
        <div style="margin-left: 80px">{{item.delivery.contacts}}&nbsp;{{item.delivery.contactNumber }}</div>
        <div style="margin-left: 200px">{{item.delivery.deliveryAddress}}</div>
      </div>
    </div>
  </div>
  </div>
</template>
<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添加页码 */
    }
  }
}
#header-pane{
  display: flex;
  width: 100%;
  height: 90px;
  line-height: 90px;
}
.textarea{
--el-border-color: rgba(255,255,255,0.0);
--el-input-focus-border-color: rgba(255,255,255,0.0);
--el-input-focus-border-width: 0px;
--el-input-hover-border-color: rgba(255,255,255,0.0);
--el-input-hover-border-width: 0px;
}
</style>
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/ProjectCreate.vue
@@ -122,12 +122,18 @@
      const projectNumber = row.projectNumber;
      const thickness = row.glass_thickness;
      const glassType = row.glass_type;
      const quantity = row.quantity;
      const area = row.glass_total_area;
      const optimizeState = row.optimize_state;
      await router.push({
        name: 'optimizeInfo',
        params: {
          projectNo: projectNumber,
          thickNess: thickness,
          model: glassType
          model: glassType,
          quantity: quantity,
          area: area,
          optimizeState:optimizeState
        }
      });
    }
@@ -183,13 +189,16 @@
}
// 公共处理函数,处理相同数据时的操作,并返回targetRoute对象(右键菜单和双击打开)
const handleSameDataOperation = async ({projectNumber, thickness, glassType}) => {
const handleSameDataOperation = async ({projectNumber, thickness, glassType,quantity,glass_total_area,optimize_state}) => {
  const targetRoute = {
    name: 'optimizeInfo',
    params: {
      projectNo: projectNumber,
      thickNess: String(thickness),
      model: glassType
      thickNess: thickness,
      model: glassType,
      quantity: quantity,
      area: glass_total_area,
      optimizeState:optimize_state
    }
  };
  const currentRoute = router.currentRoute.value;
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ProjectDetail.vue
@@ -609,11 +609,9 @@
          return formattedItem;
        });
        data.forEach(item => {
          if(formattedData[0].autoFillEdge==="true"){
            item.longGrind1=0
            item.longGrind2=0
            item.shortGrind1=0
            item.shortGrind2=0
            if(item.width>=formattedData[0].minAutoLenght){
              item.longGrind1 = formattedData[0].leftEdge;
              item.longGrind2 = formattedData[0].rightEdge;
@@ -623,6 +621,10 @@
              item.shortGrind2 = formattedData[0].downEdge;
            }
          }
          item.longGrind1=0
          item.longGrind2=0
          item.shortGrind1=0
          item.shortGrind2=0
          item.height=parseFloat(item.height.toFixed(2))
          item.width=parseFloat(item.width.toFixed(2))
north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue
@@ -13,13 +13,16 @@
import {CircleCheck, Download, Printer} from "@element-plus/icons-vue/global";
import PrintSheet1 from "@/components/sd/delivery/PrintSheet1.vue";
import PrintSheet2 from "@/components/sd/delivery/PrintSheet2.vue";
import PrintSheetLuoyang from "@/components/sd/delivery/PrintSheetLuoyang.vue";
import useOrderInfoStore from "@/stores/sd/order/orderInfo";
import { saveAs } from "file-saver"
import companyInfo from "@/stores/sd/companyInfo";
//语言获取
const { t } = useI18n()
const orderInfo = useOrderInfoStore()
const router = useRouter()
const company = companyInfo()
const userStore = useUserInfoStore()
const username = userStore.user.userName
const userid = userStore.user.userId
@@ -107,6 +110,10 @@
    orderInfo.selectDeliveryDate = res.data.selectDate
    pageNum.value=1
    produceList = deepClone(res.data.data)
    if(company.companyName=='洛阳北方玻璃技术股份有限公司'){
      xGrid.value.menuConfig.body.options[0][2].visible=true
      xGrid.value.menuConfig.body.options[0][3].visible=true
    }
    xGrid.value.loadData(produceList)
    gridOptions.loading=false
  }else{
@@ -146,6 +153,10 @@
      pageNum.value=1
      produceList = deepClone(res.data.data)
      xGrid.value.loadData(produceList)
      if(company.companyName=='洛阳北方玻璃技术股份有限公司'){
        xGrid.value.menuConfig.body.options[0][2].visible=true
        xGrid.value.menuConfig.body.options[0][3].visible=true
      }
      gridOptions.loading=false
    }else{
      ElMessage.warning(res.msg)
@@ -165,6 +176,10 @@
      }
      produceList = deepClone(res.data.data)
      xGrid.value.loadData(produceList)
      if(company.companyName=='洛阳北方玻璃技术股份有限公司'){
        xGrid.value.menuConfig.body.options[0][2].visible=true
        xGrid.value.menuConfig.body.options[0][3].visible=true
      }
      gridOptions.loading=false
    }else{
      ElMessage.warning(res.msg)
@@ -263,6 +278,72 @@
          }
          break
        }
        case 'sheet3': {
          const selectRecords = $grid.getCheckboxRecords()
          if (selectRecords.length === 0) {
            if(rowClickIndex.value.deliveryState>0){
              ElMessage.warning(t('order.printingNumber')+rowClickIndex.value.printingNumber)
              let delivery=([])
              delivery.push(rowClickIndex.value)
              flowData.value.delivery=delivery
              dialogTableVisible.value = true
              sheetIndex.value=3
            }else{
              ElMessage.warning(t('order.orderNotApproved'))
            }
          }else{
            let a=0
            selectRecords.forEach((item) => {
              if(item.deliveryState==0){
                ElMessage.warning(t('order.orderNotApproved'))
                a=1
              }
            })
            if(a==0){
              flowData.value.delivery=selectRecords
              dialogTableVisible.value = true
              sheetIndex.value=3
            }
          }
          break
        }
        case 'sheet4': {
          const selectRecords = $grid.getCheckboxRecords()
          if (selectRecords.length === 0) {
            if(rowClickIndex.value.deliveryState>0){
              ElMessage.warning(t('order.printingNumber')+rowClickIndex.value.printingNumber)
              let delivery=([])
              delivery.push(rowClickIndex.value)
              flowData.value.delivery=delivery
              dialogTableVisible.value = true
              sheetIndex.value=4
            }else{
              ElMessage.warning(t('order.orderNotApproved'))
            }
          }else{
            let a=0
            selectRecords.forEach((item) => {
              if(item.deliveryState==0){
                ElMessage.warning(t('order.orderNotApproved'))
                a=1
              }
            })
            if(a==0){
              flowData.value.delivery=selectRecords
              dialogTableVisible.value = true
              sheetIndex.value=4
            }
          }
          break
        }
      }
    }
  },
@@ -305,6 +386,8 @@
        [
          { code: 'sheet1', name: t('basicData.print'), prefixIcon: 'vxe-icon-file-txt', visible: true},
          { code: 'sheet2', name: t('basicData.print')+ t('delivery.noMoney'), prefixIcon: 'vxe-icon-file-txt', visible: true},
          { code: 'sheet3', name: t('洛阳打印'), prefixIcon: 'vxe-icon-file-txt', visible: false},
          { code: 'sheet4', name: t('洛阳打印')+ t('delivery.noMoney'), prefixIcon: 'vxe-icon-file-txt', visible: false},
        ]
      ]
    }
@@ -501,6 +584,8 @@
      </template>
      <print-sheet1 id="child"  v-if="sheetIndex===1" :deliveryId="flowData.delivery" />
      <print-sheet2 id="child"  v-if="sheetIndex===2" :deliveryId="flowData.delivery" />
      <print-sheet-luoyang id="child"  v-if="sheetIndex===3" :deliveryId="flowData.delivery" :type=1 />
      <print-sheet-luoyang id="child"  v-if="sheetIndex===4" :deliveryId="flowData.delivery" :type=2 />
    </el-dialog>
  </div>
north-glass-erp/src/main/resources/mapper/pp/GlassOptimize.xml
@@ -545,7 +545,7 @@
               数量 as quantity,
               形状 as shape,
               项目 as project,
               单片名称 as glass_child,
               产品名称 as glass_child,
               面积 as area,
               GlassType as glassType,
               patch_state
@@ -561,7 +561,7 @@
               数量 as quantity,
               形状 as shape,
               项目 as project,
               单片名称 as glass_child,
               产品名称 as glass_child,
               面积 as area,
               GlassType as glassType,
               patch_state
@@ -577,7 +577,7 @@
               数量 as quantity,
               形状 as shape,
               项目 as project,
               单片名称 as glass_child,
               产品名称 as glass_child,
               面积 as area,
               GlassType as glassType,
               patch_state
@@ -727,7 +727,8 @@
            p.remark,
            a.name,
            p.create_time,
            p.update_time
            p.update_time,
            p.optimize_state
        FROM
            (
                pp.optimize_project p
@@ -1360,7 +1361,7 @@
               数量 as quantity,
               形状 as shape,
               项目 as project,
               单片名称 as glass_child,
               产品名称 as glass_child,
               面积 as area,
               GlassType as glassType,
               patch_state
north-glass-erp/src/main/resources/mapper/sd/DeliveryDetailMapper.xml
@@ -106,6 +106,7 @@
        <result column="delivery_number" property="deliveryNumber"/>
        <result column="quantity" property="quantity"/>
        <result column="area" property="area"/>
        <result column="price" property="price"/>
        <result column="money" property="money"/>
        <result column="delivery_detail_remakes" property="deliveryDetailRemakes"/>
        <result column="delivery_detail_state" property="deliveryDetailState"/>
@@ -991,7 +992,7 @@
    </select>
    <select id="getSelectDeliveryPrinting" resultMap="selectDeliveryDetailOrderDetail" >
        select dd.delivery_id,od.order_id,od.product_id,IF(#{type}='product_abbreviation',pt.remarks,od.product_name) as product_name,sum(dd.area) as area,
        select dd.delivery_id,od.order_id,od.product_id,IF(#{type}='product_abbreviation',pt.remarks,od.product_name) as product_name,dd.price,sum(dd.area) as area,
               sum(dd.money) as money,sum(dd.quantity) as quantity,o.contract_id from
        delivery_detail dd left join order_detail od on dd.order_id=od.order_id and dd.order_number=od.order_number
                                                            left join product pt on pt.id=od.product_id