zhangherong
2025-04-27 dbb3445dc720a8f36b3424e73f2e02a6b0f9deb6
src/views/eam/equipment/modules/NameplateModal.vue
@@ -6,62 +6,70 @@
    @cancel="handleCancel"
    :maskClosable="false"
  >
    <table id="nameplateTable" border="1" cellpadding="12" cellspacing="0" align="center" width="80%">
      <thead>
      <tr>
        <th colspan="3">设备管理牌</th>
      </tr>
      </thead>
      <tbody>
      <tr>
        <td rowspan="3">
          <QrcodeVue :value="httpUrl"/>
        </td>
        <td>设备编号</td>
        <td>{{ model.equipmentCode }}</td>
      </tr>
    <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>
      <tr>
        <td>设备名称</td>
        <td>{{ model.equipmentName }}</td>
      </tr>
        <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>{{ model.equipmentModel }}</td>
      </tr>
        <tr>
          <td>设备名称</td>
          <td>{{ item.equipmentName }}</td>
        </tr>
      <tr>
        <td>设备管理</td>
        <td>使用部门</td>
        <td>{{ model.orgId_dictText }}</td>
      </tr>
        <tr>
          <td>设备型号</td>
          <td>{{ item.equipmentModel }}</td>
        </tr>
      <tr>
        <td rowspan="3">
          <QrcodeVue :value="model.equipmentCode"/>
        </td>
        <td>出厂编号</td>
        <td>{{ model.factoryNumber }}</td>
      </tr>
        <tr>
          <td>设备管理</td>
          <td>使用车间</td>
          <td>{{ item.orgId_dictText }}</td>
        </tr>
      <tr>
        <td>设备管理员</td>
        <td>{{ model.equipmentManager_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>{{ model.installationPosition }}</td>
      </tr>
        <tr>
          <td>设备管理员</td>
          <td>{{ item.equipmentManager_dictText }}</td>
        </tr>
      <tr>
        <td>MES</td>
        <td colspan="2" style="color: #f00;font-weight: bold;letter-spacing: 1px">非管理员勿动此铭牌</td>
      </tr>
      </tbody>
    </table>
        <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>
@@ -71,42 +79,73 @@
</template>
<script>
import QrcodeVue from 'qrcode.vue'
  import QrcodeVue from 'qrcode.vue'
export default {
  name: 'NameplateModal',
  components: { QrcodeVue },
  data() {
    return {
      title: '铭牌',
      visible: false,
      model: {},
      httpUrl: ''
    }
  },
  methods: {
    handleCancel() {
      this.visible = false
  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>
table {
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  color: #000;
  text-align: center;
  /deep/ .ant-modal {
    height: 75%;
    overflow: hidden;
  th {
    font-size: 28px;
    letter-spacing: 3px;
    padding: 20px;
    .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;
      }
    }
  }
  td {
    font-size: 18px;
    width: 33%;
  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>