chenlu
2024-08-20 2b49c5d247ca32b5aaa47e50749f8b17efa3f408
north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet3.vue
@@ -11,6 +11,7 @@
let otherMoney = []
let otherMoney1 = []
let money = ref("")
let dialogVisible = ref(false)
let otherMoneys = 0
let sumMoney = 0
let takeCare = "注意:请妥善保管好我司的玻璃架,如有丢失或损坏,按1500元只赔偿。谢谢配合!"
@@ -23,15 +24,18 @@
})
const form = ref({
})
const selectedValues = ref([])
let productIdData = ref({
})
const getData = () => {
  if(props.orderId===null  || props.orderId===undefined || props.orderId===''){
    return
  }
  form.value.orderId=props.orderId
  request.post(`/Delivery/getSelectOrderPrinting`,form.value).then((res) => {
  request.post(`/Delivery/getSelectOrderPrinting/null`,form.value).then((res) => {
    if(res.code==200){
      productIdData.value=deepClone(res.data.data)
      produceList.value = deepClone(res.data.data)
      delivery.value=deepClone(res.data.delivery)
      money.value=deepClone(res.data.money)
@@ -103,9 +107,60 @@
  })
}
const handleChange = () => {
  if(selectedValues.value.length===0){
    selectedValues.value=null;
  }
  request.post(`/Delivery/getSelectOrderPrinting/${selectedValues.value}`,form.value).then((res) => {
    if(res.code==200){
      sumMoney=0
      produceList.value = deepClone(res.data.data)
      delivery.value=deepClone(res.data.delivery)
      money.value=deepClone(res.data.money)
      produceList.value.forEach(item => {
        sumMoney+=item.DeliveryDetail.grossAmount
      })
      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")
    }
  })
}
onMounted(() => {
  getData()
})
const handleDoubleClick = () => {
  dialogVisible.value=true
}
@@ -118,7 +173,7 @@
<template>
  <div id="sheet">
  <div id="sheet" @dblclick="handleDoubleClick">
    <table border="1" >
      <tr class="title-s">
        <th colspan="9">
@@ -231,11 +286,24 @@
      <el-col :span="24"><div class="bottom">{{remark}}</div></el-col>
    </el-row>
    <el-dialog v-model="dialogVisible" style="width: 40%;height: 20%;margin-top: 10%" >
      <el-select v-model="selectedValues" style="width: 100%" @change="handleChange" multiple  placeholder="请选择">
        <el-option
            v-for="item in productIdData"
            :key="item"
            :label='item.productId+"   "+item.productName'
            :value="item.productId">
        </el-option>
      </el-select>
    </el-dialog>
  </div>
</template>
<style scoped>
h1,h3{
  left:0;