chenlu
2024-11-22 068b53bcfd44dcab4f6688f6c32707208d525f12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<script setup>
import request from "@/utils/request"
import {ElDatePicker, ElMessage} from "element-plus"
import {nextTick, onMounted, onUnmounted, reactive, ref, watch} from "vue"
import {Search} from "@element-plus/icons-vue"
import {useRouter} from 'vue-router'
import {changeFilterEvent, filterChanged} from "@/hook"
import {useI18n} from 'vue-i18n'
import deepClone from "@/utils/deepClone";
import QRCode from "qrcode";
import companyInfo from "@/stores/sd/companyInfo";
import userInfo from "@/stores/userInfo"
//语言获取
const company = companyInfo()
const {t} = useI18n()
let router = useRouter()
let produceList = ref([])
let list = ref()
const details = ref([])
const user=userInfo()
 
 
const data = ref({
  printList: []
})
 
let props = defineProps({
  printList: null,
})
 
const {currentRoute} = useRouter()
const route = currentRoute.value
 
 
data.value.printList = JSON.parse(props.printList)
 
onMounted(() => {
  selectPrint()
    }
)
const selectPrint = () => {
  request.post(`/finishedGoodsInventory/getSelectPrint`, data.value).then((res) => {
    if (res.code == 200) {
      produceList.value = deepClone(res.data.data)
      console.log(produceList.value)
    } else {
      ElMessage.warning(res.msg)
      router.push("/login")
    }
  })
}
 
</script>
 
<template>
<div>
  <div style="width: 49%;height: 100%" v-for="(item,id) in produceList"  :key="id">
    <div  style="height: 100%;width: 100%;">
      <table>
        <thead>
        <tr>
          <td colspan="5" style="text-align: center;font-weight: bolder">
            <div>金华福喜天成玻璃有限公司</div>
          </td>
        </tr>
        <tr style="width: 100%;" v-for="(itemFlow,index) in item.detail" :key="index">
          <td colspan="5">
            <div>客户名称:&nbsp;&nbsp;&nbsp;{{itemFlow.customer_name}}</div>
            <div>项目名称:&nbsp;&nbsp;&nbsp;{{itemFlow.project}}</div>
            <div>订单号:&nbsp;&nbsp;&nbsp;{{itemFlow.order_id}} &nbsp;&nbsp;&nbsp; 箱号:&nbsp;&nbsp;&nbsp;{{itemFlow.remarks}}</div>
          </td>
        </tr>
        <tr>
          <td style="width: 170px;">编号</td>
          <td style="width: 70px;">宽</td>
          <td style="width: 70px;">高</td>
          <td style="width: 70px;">数量</td>
          <td style="width: 70px;">面积</td>
        </tr>
        </thead>
        <tbody>
        <tr v-for="(itemDatile,index) in item.detailList" :key="index">
          <td>{{ itemDatile.building_number }}</td>
          <td>{{ itemDatile.width }}</td>
          <td>{{ itemDatile.height }}</td>
          <td>{{ itemDatile.quantity }}</td>
          <td>{{ itemDatile.area }}</td>
        </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>
 
</template>
 
<style scoped>
* {
  margin: 0;
  padding: 0;
}
 
#contentTable{
  width: 49%;
  height: 100%;
}
 
#record{
  display: flex;
  flex-wrap: wrap
}
 
@media print {
  @page {
    size: auto;  /* auto is the initial value */
    margin: 4mm 5mm 0mm 5mm  /* this affects the margin in the printer settings */
 
  }
 
  table {
    page-break-before: always;
    page-break-inside: auto;
  }
 
  thead {
    display: table-header-group;
    page-break-inside: avoid;
  }
 
}
 
</style>