Ben Lin
2025-01-09 7bcfc0507043dc878c801a259aa7d058f4982551
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<template>
  <div id="print-area">
    <div class="item" v-for="(items, index) in tableData" :key="items.id">
      <div v-if="index == 0">
        <div class="flex relative">
          <div class="head">成品入库单 </div>
          <div class="absolute right-12 m-4 z-2">
            <!-- <QrCode
              :value="qrInstoreOrder"
              :width="64"
              :height="64"
              :options="{ margin: 5 }"
              ref="qrDiyRef"
            /> -->
          </div>
        </div>
        <div style="display: flex; flex-direction: row; height: 30px; margin: 2px">
          <div style="width: 40%"></div>
          <div style="width: 17%"></div>
          <div style="width: 18%"></div>
          <div style="width: 25%">入库日期:{{ formatToDate(new Date()) }}</div>
        </div>
      </div>
      <div class="main">
        <table class=" ">
          <tr>
            <!-- <th class="material_table_td w-1/14">序号</th> -->
            <th class="material_table_td" style="width: 14%">入库单号</th>
            <th class="material_table_td" style="width: 14%">销售订单号</th>
            <th class="material_table_td" style="width: 16%">包装工单号</th>
            <th class="material_table_td" style="width: 16%">料号</th>
            <th class="material_table_td" style="width: 24%">描述</th>
            <th class="material_table_td" style="width: 8%">计划数量</th>
            <th class="material_table_td" style="width: 8%">入库数量</th>
          </tr>
          <tr v-for="(item, indexs) in items.Items.filter((q) => q.STATUS == 'Y')" :key="indexs">
            <!-- <td class="material_table_td">
              {{ Number(indexs) + 1 }}
            </td> -->
            <td class="instore_td">
              <QrCode
                :value="item.ORDER_NO"
                :width="70"
                :height="70"
                :options="{ margin: 1 }"
                ref="qrDiyRef"
              />
            </td>
            <td class="instore_td">
              {{ item.SALES_ORDER }}
            </td>
            <td class="instore_td">
              {{ item.WORK_ORDER }}
            </td>
            <td class="instore_td">
              {{ item.ITEM_CODE }}
            </td>
            <td class="instore_td">
              {{ item.ITEM_NAME }}
            </td>
            <td class="instore_td">
              {{ item.PLAN_QTY }}
            </td>
            <td class="instore_td">
              {{ item.SCAN_QTY }}
            </td>
          </tr>
        </table>
      </div>
      <div style="display: flex; flex-direction: row; height: 30px; margin-bottom: 15px; " v-if="index == Number(tableData?.length) - 1">
        <div style="width: 20%; margin-left: 15px;">入库人员:{{}}</div>
        <div style="width: 20%">生产主管:{{}}</div>
        <div style="width: 20%">品管确认:{{}}</div>
        <div style="width: 20%">PMC审核:{{}}</div>
        <div style="width: 20%">仓库签收:{{}}</div>
      </div>
      <div class="footer flex">
        <div style="width: 40%"></div>
        <div style="width: 10%">第{{ index + 1 }}页</div>
        <div style="width: 10%">共{{ tableData?.length }}页</div>
        <div style="width: 40%"></div>
      </div>
    </div>
  </div>
</template>
<script lang="ts" setup>
  import { ref, toRefs } from 'vue';
  import { QrCode } from '/@/components/Qrcode/index';
  import { formatToDate } from '/@/utils/dateUtil';
 
  const props = defineProps({
    tableData: { type: Object as PropType<any[]> },
    qrInstoreOrder: { type: String },
  });
  const { tableData, qrInstoreOrder } = toRefs(props);
</script>
<style lang="scss" scoped>
  #print-area {
    position: absolute;
    inset: 0;
    background-color: #fff;
 
    .item {
      display: flex;
      flex-direction: column;
      // background-color: bisque;
      page-break-after: always;
      height: 100%;
 
      .head {
        z-index: 1;
        width: 100%;
        background-color: azure;
        font-size: 36px;
        font-weight: bold;
        line-height: 100px;
        text-align: center;
      }
 
      .main {
        display: flex;
        flex: 1;
        // align-items: center;
        justify-content: center;
        padding: 15px;
 
        table {
          border-collapse: collapse;
        }
 
        table,
        th,
        td {
          border: solid 1px black;
        }
 
        tr > th {
          height: 60px;
        }
 
        /* 设置标题字段字体大小 */
        // :deep() {
        //   .ant-table-tbody > tr > td {
        //     font-size: 3px; /* 修改为你想要的字体大小 */
        //     line-height: 18px;
        //   }
 
        //   .ant-table-thead > tr > th {
        //     line-height: 21px;
        //   }
 
        //   .ant-table-title {
        //     font-size: 4px; /* 设置你想要的字体大小 */
        //   }
        // }
 
        .instore_td {
          border: 1px solid #000;
          font-size: 6px; /* 修改为你想要的字体大小 */
          line-height: 20px;
          text-align: center;
          word-break: break-all;
        }
 
        .material_table_td {
          border: 1px solid #000;
          font-size: 6px; /* 修改为你想要的字体大小 */
          line-height: 20px;
          text-align: center;
          word-break: break-all;
        }
      }
 
      .footer {
        display: flex;
        margin-bottom: 15px;
        background-color: #eee;
        font-size: 14px;
        // font-weight: bold;
        line-height: 100px;
        text-align: center;
      }
    }
  }
</style>