zhaowei
2025-07-01 a5731794ec99d70341980afda64418287a642a8c
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
<template>
  <j-modal
    title="铭牌"
    :width="750"
    :visible="visible"
    @cancel="handleCancel"
    :maskClosable="false"
  >
 
    <div id="nameplateTable">
      <table border="1" cellpadding="12" cellspacing="0" align="center" width="80%" v-for="item in printedRows"
             :key="item.id">
        <thead>
        <tr>
          <th colspan="3">设备管理牌</th>
        </tr>
        </thead>
 
        <tbody>
        <tr>
          <td rowspan="3" align="center">
            <div style="height: 80%;width: 50%">
              <QrcodeVue :value="httpUrl+item.id" :size="50"/>
            </div>
          </td>
          <td>设备编号</td>
          <td>{{ item.equipmentCode }}</td>
        </tr>
 
        <tr>
          <td>设备名称</td>
          <td>{{ item.equipmentName }}</td>
        </tr>
 
        <tr>
          <td>设备型号</td>
          <td>{{ item.equipmentModel }}</td>
        </tr>
 
        <tr>
          <td>设备管理</td>
          <td>使用车间</td>
          <td>{{ item.orgId_dictText }}</td>
        </tr>
 
        <tr>
          <td rowspan="3" align="center">
            <div style="height: 80%;width: 50%">
              <QrcodeVue :value="item.equipmentCode" :size="50"/>
            </div>
          </td>
          <td>出厂编号</td>
          <td>{{ item.factoryNumber }}</td>
        </tr>
 
        <tr>
          <td>设备管理员</td>
          <td>{{ item.equipmentManager_dictText }}</td>
        </tr>
 
        <tr>
          <td>安装位置</td>
          <td>{{ item.installationPosition }}</td>
        </tr>
 
        <tr>
          <td>MES</td>
          <td colspan="2" style="color: #f00;font-weight: bold;letter-spacing: 1px">非管理员勿动此铭牌</td>
        </tr>
        </tbody>
      </table>
    </div>
 
    <template slot="footer">
      <a-button @click="handleCancel">关闭</a-button>
      <a-button type="primary" v-print="'#nameplateTable'">打印</a-button>
    </template>
  </j-modal>
</template>
 
<script>
  import QrcodeVue from 'qrcode.vue'
 
  export default {
    name: 'NameplateModal',
    components: { QrcodeVue },
    props: {
      printedRows: {
        type: Array
      }
    },
    data() {
      return {
        title: '铭牌',
        visible: false,
        httpUrl: ''
      }
    },
    methods: {
      handleCancel() {
        this.visible = false
      }
    }
  }
</script>
 
<style lang="less" scoped>
  /deep/ .ant-modal {
    height: 75%;
    overflow: hidden;
 
    .ant-modal-content {
      height: 100%;
      display: flex;
      flex-direction: column;
      overflow: hidden;
 
      ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
      }
 
      .ant-modal-body {
        flex: 1;
        overflow: auto;
      }
    }
  }
 
  table {
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    color: #000;
    text-align: center;
 
    &:not(:last-child) {
      margin-bottom: 10px;
    }
 
    th {
      font-size: 24px;
      letter-spacing: 3px;
      padding: 12px;
    }
 
    td {
      font-size: 14px;
      width: 33%;
      padding: 6px;
    }
  }
</style>