zhaowei
2025-06-25 872362acd0e306bb2150d72cce1b556d272e6ba5
Merge remote-tracking branch 'origin/master'
已添加1个文件
已修改7个文件
215 ■■■■ 文件已修改
src/views/tms/modules/baseTools/BaseToolsListLeft.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/baseTools/BaseToolsListRight.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/inbound/InboundListLeft.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/inbound/InboundListRight.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/inbound/QrCodePrint.vue 165 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/toolLedger/ToolLedgerListLeft.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/toolLedger/ToolLedgerListRight.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/toolsClassify/ToolsClassifyForm.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/baseTools/BaseToolsListLeft.vue
@@ -3,7 +3,6 @@
    :loading="cardLoading"
    :bordered="false"
    title="工具信息"
    style="height: 100%;"
  >
    <a-spin :spinning="loading">
      <a-alert
@@ -55,13 +54,11 @@
      />
      <!-- showLine -->
      <div style="flex: 1;overflow:auto;margin-top: 10px;max-height: 400px; min-height: 400px">
      <a-tree
        :checkStrictly="checkStrictly"
        :selectedKeys="selectedKeys"
        :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
        :treeData="treeDataSource"
        :defaultExpandAll="true"
        @select="onSelect"
        @expand="onExpand"
@@ -90,6 +87,8 @@
      
        </template>
      </a-tree>
      </div>
    </a-spin>
  </a-card>
</template>
@@ -228,7 +227,7 @@
      this.expandedKeys = this.allTreeKeys;
    },
    closeAll() {
      this.expandedKeys = this.allSiteIds;
      this.expandedKeys = [];
    },
    refreshTree() {
      this.queryTreeData();
src/views/tms/modules/baseTools/BaseToolsListRight.vue
@@ -1,5 +1,5 @@
<template>
  <a-card :bordered="false">
  <a-card :bordered="false" style="flex: 1;overflow:auto;max-height: 600px; min-height: 600px">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
@@ -206,8 +206,8 @@
        /* åˆ†é¡µå‚æ•° */
      ipagination:{
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['10', '20', '50'],
        pageSize: 5,
        pageSizeOptions: ['5', '10', '30'],
        showTotal: (total, range) => {
          return range[0] + "-" + range[1] + " å…±" + total + "条"
        },
@@ -549,7 +549,7 @@
              this.selectedRowKeys[0] = res.result.records[0].id
              this.onSelectChange(this.selectedRowKeys)
            } else {
              this.$message.warning("请选择叶子节点进行查询");
              //this.$message.warning("请选择叶子节点进行查询");
              this.ipagination.total = 0
            }
          })
@@ -557,7 +557,7 @@
            this.loading = false;
          });
        } else {
          this.$message.warning("请选择叶子节点进行查询");
          //this.$message.warning("请选择叶子节点进行查询");
        }
      },
      onClearSelected() {
src/views/tms/modules/inbound/InboundListLeft.vue
@@ -3,7 +3,6 @@
    :loading="cardLoading"
    :bordered="false"
    title="工具分类"
    style="height: 100%;"
  >
    <a-spin :spinning="loading">
      <a-alert
@@ -55,6 +54,7 @@
      />
      <!-- showLine -->
      <div style="flex: 1;overflow:auto;margin-top: 10px;max-height: 400px; min-height: 400px">
      <a-tree
        :checkStrictly="checkStrictly"
      
@@ -90,6 +90,7 @@
      
        </template>
      </a-tree>
      </div>
    </a-spin>
  </a-card>
</template>
src/views/tms/modules/inbound/InboundListRight.vue
@@ -1,5 +1,5 @@
<template>
  <a-card :bordered="false">
  <a-card :bordered="false" style="flex: 1;overflow:auto;max-height: 600px; min-height: 600px">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
@@ -188,8 +188,8 @@
        /* åˆ†é¡µå‚æ•° */
      ipagination:{
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['10', '20', '50'],
        pageSize: 5,
        pageSizeOptions: ['5', '10', '30'],
        showTotal: (total, range) => {
          return range[0] + "-" + range[1] + " å…±" + total + "条"
        },
@@ -493,7 +493,7 @@
              this.selectedRowKeys[0] = res.result.records[0].id
              this.onSelectChange(this.selectedRowKeys)
            } else {
              this.$message.warning("请选择叶子节点进行查询");
              //this.$message.warning("请选择叶子节点进行查询");
              this.ipagination.total = 0
            }
          })
@@ -501,7 +501,7 @@
            this.loading = false;
          });
        } else {
          this.$message.warning("请选择叶子节点进行查询");
          //this.$message.warning("请选择叶子节点进行查询");
        }
      },
      onClearSelected() {
src/views/tms/modules/inbound/QrCodePrint.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,165 @@
<template>
  <a-card>
    <!-- æ“ä½œæŒ‰é’® -->
    <a-button type="primary" @click="handlePrint">生成并打印二维码</a-button>
    <a-button @click="handleBatchGenerate">批量生成二维码</a-button>
    <!-- éšè—çš„æ‰“印区域 -->
    <div id="printContainer" v-show="false">
      <img :src="qrData.image" alt="二维码" style="width: 5cm; height: 5cm;">
      <div style="margin-top: 10px; font-size: 16px;" class="qr-content">{{ qrData.content }}</div>
    </div>
    <div id="printArea" style="display: block;">
      <div v-for="(item, index) in qrList" :key="index" class="qrcode-item">
        <img :src="item.base64" alt="QR Code">
        <p>{{ item.content }}</p>
      </div>
    </div>
  </a-card>
</template>
<script>
import { getAction } from '@/api/manage'
import printJS from 'print-js';
export default {
  data() {
    return {
      qrData: {
        image: '',
        content: ''
      },
      qrList: []
    }
  },
  methods: {
    // ç”Ÿæˆå¹¶æ‰“印二维码
    handlePrint() {
      getAction('/tms/qyCode/generate').then(res => {
        if (res.success) {
          this.qrData = res.result;
          // ç¡®ä¿DOM更新后执行打印
          this.$nextTick(() => {
            this.printQrCode();
          });
        }
      });
    },
    // æ‰§è¡Œæ‰“印操作
    printQrCode() {
      // 1. åˆ›å»ºæ‰“印内容
      const printContent = document.getElementById('printContainer').innerHTML;
      // 2. åˆ›å»ºæ‰“印窗口
      const printWindow = window.open('', '_blank');
      // 3. å†™å…¥æ‰“印内容
      printWindow.document.write(`
        <!DOCTYPE html>
        <html>
          <head>
            <title>二维码打印</title>
            <style>
              body {
                margin: 0;
                padding: 0;
                font-family: Arial, sans-serif;
              }
              @media print {
                @page {
                  size: auto;
                  margin: 0;
                }
                body {
                  margin: 0;
                }
              }
              .qr-label {
                width: 60mm;
                height: 40mm;
                padding: 2mm;
                box-sizing: border-box;
                border: 1px dotted #ccc; /* æ‰“印时不会显示 */
                text-align: center;
              }
              .qr-image {
                width: 30mm;
                height: 30mm;
                display: block;
                margin: 0 auto;
              }
              .qr-content {
                font-size: 10pt;
                margin-top: 1mm;
                word-break: break-all;
              }
            </style>
          </head>
          <body>
            ${printContent}
            <script>
              // è‡ªåŠ¨è§¦å‘æ‰“å°å¹¶å…³é—­çª—å£
              window.onload = function() {
                setTimeout(function() {
                  window.print();
                  window.onafterprint = function() {
                    window.close();
                  };
                  // å…¼å®¹Safari
                  if (window.matchMedia) {
                    const mediaQueryList = window.matchMedia('print');
                    mediaQueryList.addListener(function(mql) {
                      if (!mql.matches) {
                        setTimeout(function() {
                          window.close();
                        }, 300);
                      }
                    });
                  }
                }, 100);
              };
            <\/script>
          </body>
        </html>
      `);
      printWindow.document.close();
    },
    // æ‰¹é‡ç”ŸæˆäºŒç»´ç 
    async handleBatchGenerate() {
      getAction('/tms/qyCode/batchGenerate').then(res => {
      if (res.success) {
        this.qrList = res.result.map((content, i) => ({
          content:res.result[i].content,
          base64: res.result[i].image
        }));
        this.handleBacthPrint();
      }
      })
    },
    // æ‰§è¡Œæ‰“印
    handleBacthPrint() {
      this.$nextTick(() => {
        printJS({
          printable: 'printArea',
          type: 'html',
          style: `
            .qrcode-item {
              page-break-inside: avoid;
              margin: 10px;
              text-align: center;
            }
            img { width: 100px; height: 100px; }
          `,
          scanStyles: false
        });
      });
    }
  }
}
</script>
src/views/tms/modules/toolLedger/ToolLedgerListLeft.vue
@@ -3,7 +3,6 @@
    :loading="cardLoading"
    :bordered="false"
    title="工具信息"
    style="height: 100%;"
  >
    <a-spin :spinning="loading">
      <a-alert
@@ -55,6 +54,7 @@
      />
      <!-- showLine -->
       <div style="flex: 1;overflow:auto;margin-top: 10px;max-height: 400px; min-height: 400px">
      <a-tree
        :checkStrictly="checkStrictly"
      
@@ -90,6 +90,7 @@
      
        </template>
      </a-tree>
       </div>
    </a-spin>
  </a-card>
</template>
src/views/tms/modules/toolLedger/ToolLedgerListRight.vue
@@ -1,5 +1,5 @@
<template>
  <a-card :bordered="false">
  <a-card :bordered="false" style="flex: 1;overflow:auto;max-height: 600px; min-height: 600px">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
@@ -220,8 +220,8 @@
        /* åˆ†é¡µå‚æ•° */
      ipagination:{
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['10', '20', '50'],
        pageSize: 5,
        pageSizeOptions: ['5', '10', '30'],
        showTotal: (total, range) => {
          return range[0] + "-" + range[1] + " å…±" + total + "条"
        },
@@ -410,6 +410,7 @@
      onSelectChange(selectedRowKeys,selectionRows) {
        this.selectedRowKeys = selectedRowKeys;
        this.selectionRows = selectionRows
        console.log("22222",selectedRowKeys)
        //通过id查询管理参数和参数数据
        getAction(this.url.queryParaByToolCode, { toolCode: this.selectedRowKeys[0],paraTypeFlag:this.paraTypeFlag}).then((res) => {
          if (res.success) {
@@ -460,9 +461,10 @@
              this.ipagination.total = res.result.total
              //默认选中第一条数据
              this.selectedRowKeys[0] = res.result.records[0].id
              this.onSelectChange(this.selectedRowKeys)
              this.onSelectChange(this.selectedRowKeys,this.selectionRows)
              console.log("1111111",this.selectedRowKeys,this.selectionRows)
            } else {
              this.$message.warning("请选择叶子节点进行查询");
              //this.$message.warning("请选择叶子节点进行查询");
              this.ipagination.total = 0
            }
          })
@@ -470,7 +472,7 @@
            this.loading = false;
          });
        } else {
          this.$message.warning("请选择叶子节点进行查询");
         // this.$message.warning("请选择叶子节点进行查询");
        }
      },
      onClearSelected() {
src/views/tms/modules/toolsClassify/ToolsClassifyForm.vue
@@ -164,6 +164,7 @@
      },
      submitForm () {
        const that = this;
        console.log("111",this.model.id)
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {