huang_an 2 éve
szülő
commit
d0ae88e11c

+ 1 - 0
src/components/AssetDialog/categoryDialog.vue

@@ -147,6 +147,7 @@
 
       // 树结构点击事件
       async handleNodeClick(data, node) {
+        this.rootId = data.parentId;
         this.currentTreeData = data;
         this._getClassificationList();
       },

+ 19 - 105
src/views/ledgerAssets/boat/components/boat-list.vue

@@ -60,81 +60,16 @@
         </el-link>
       </template>
     </ele-pro-table>
-    <ele-modal title="二维码" :visible.sync="QRvisible" width="800px">
-      <div id="printSection">
-        <div
-          v-for="(item, index) in checkRadioData"
-          :key="index"
-          style="
-            display: flex;
-            padding-left: 20px;
-            align-items: center;
-            justify-content: center;
-            margin: auto;
-          "
-        >
-          <div style="width: 250px; height: 240px">
-            <img
-              :src="item.qrcode"
-              alt="QR Code"
-              style="width: 240px; height: 240px"
-            />
-          </div>
-          <div
-            style="
-              width: 440px;
-              height: 240px;
-              display: flex;
-              flex-direction: column;
-              flex-wrap: wrap;
-              justify-content: space-between;
-              align-items: flex-start;
-            "
-          >
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">编码:</span>
-              <span style="color: #000">{{ item.code }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">名称:</span>
-              <span style="color: #000">{{ item.name }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">型号:</span>
-              <span style="color: #000">{{ item.category.modelType }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">规格:</span>
-              <span style="color: #000">{{ item.category.specification }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">编号:</span>
-              <span style="color: #000">{{ item.codeNumber }}</span>
-            </div>
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px"
-                >固资编码:</span
-              >
-              <span style="color: #000">{{ item.fixCode }}</span>
-            </div>
-          </div>
-        </div>
-      </div>
-
-      <div slot="footer">
-        <el-button @click="print">打印预览</el-button>
-        <el-button @click="QRvisible = false">关闭</el-button>
-      </div>
-    </ele-modal>
+    <print ref="printRef"></print>
+    <printSr ref="printSrRef"></printSr>
+    <printTg ref="printTgRef"></printTg>
   </div>
 </template>
 
 <script>
-  import QRCode from 'qrcode';
+  import print from '@/views/ledgerAssets/components/print.vue';
+  import printSr from '@/views/ledgerAssets/components/printSr';
+  import printTg from '@/views/ledgerAssets/components/printTg';
   import { getByCode } from '@/api/system/dictionary-data';
   import { businessStatus, networkStatus } from '@/utils/dict/warehouse';
   import BoatSearch from './boat-search.vue';
@@ -155,7 +90,7 @@
   import { getToken, setToken } from '@/utils/token-util';
   export default {
     mixins: [dictMixins],
-    components: { BoatSearch },
+    components: { BoatSearch, print, printSr, printTg },
     props: {
       // 类别id
       categoryId: [Number, String],
@@ -327,45 +262,24 @@
         ]
       };
     },
+    computed: {
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
     created() {
       this.requestDict('角度');
       this.getAssetLevelOptions();
     },
     methods: {
       allPrinting() {
-        this.QRvisible = true;
-        this.$nextTick(() => {
-          this.generateQRCodes();
-        });
-      },
-      generateQRCodes() {
-        this.checkRadioData.forEach((item) => {
-          QRCode.toDataURL(item.code)
-            .then((url) => {
-              item.qrcode = url;
-              this.$forceUpdate();
-            })
-            .catch((err) => {
-              console.error(err);
-            });
-        });
-      },
-      print() {
-        const printSection = document.getElementById('printSection');
-        // 创建打印任务
-        const printWindow = window.open('', '_blank');
-        printWindow.document.open();
-        printWindow.document.write('<html><head><title>打印预览</title>');
-        printWindow.document.write(
-          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
-        );
-        printWindow.document.write('</head><body>');
-        printWindow.document.write(printSection.innerHTML);
-        printWindow.document.write('</body></html>');
-        printWindow.document.close();
-        printWindow.onload = function () {
-          printWindow.print();
-        };
+        if (this.clientEnvironmentId == 2) {
+          this.$refs.printSrRef.open(this.checkRadioData);
+        } else if (this.clientEnvironmentId == 3) {
+          this.$refs.printTgRef.open(this.checkRadioData);
+        } else {
+          this.$refs.printRef.open(this.checkRadioData);
+        }
       },
       // 全选
       changeSelectAll(arr) {

+ 157 - 0
src/views/ledgerAssets/components/print.vue

@@ -0,0 +1,157 @@
+<template>
+  <ele-modal
+    title="二维码"
+    :visible.sync="QRvisible"
+    v-if="QRvisible"
+    width="800px"
+  >
+    <div id="printSection">
+      <div
+        v-for="(item, index) in codeList"
+        :key="index"
+        style="
+          display: flex;
+          padding-left: 20px;
+          align-items: center;
+          justify-content: center;
+          margin: auto;
+        "
+      >
+        <div style="width: 250px; height: 240px">
+          <img
+            :src="item.qrcode"
+            alt="QR Code"
+            style="width: 240px; height: 240px"
+          />
+        </div>
+        <div
+          style="
+            width: 440px;
+            height: 240px;
+            display: flex;
+            flex-direction: column;
+            flex-wrap: wrap;
+            justify-content: space-between;
+            align-items: flex-start;
+          "
+        >
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block; width: 100px">编码:</span>
+            <span style="color: #000">{{ item.code }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block; width: 100px">名称:</span>
+            <span style="color: #000">{{ item.name }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block; width: 100px">型号:</span>
+            <span style="color: #000">{{ item.category.modelType }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block; width: 100px">规格:</span>
+            <span style="color: #000">{{ item.category.specification }}</span>
+          </div>
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block; width: 100px">编号:</span>
+            <span style="color: #000">{{ item.codeNumber }}</span>
+          </div>
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block; width: 100px">固资编码:</span>
+            <span style="color: #000">{{ item.fixCode }}</span>
+          </div>
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block; width: 100px">工位名称:</span>
+            <span style="color: #000">{{
+              item.workstation ? item.workstation.name : ''
+            }}</span>
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <div slot="footer">
+      <el-button @click="print">打印预览</el-button>
+      <el-button @click="close">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import QRCode from 'qrcode';
+  export default {
+    name: 'print',
+    data() {
+      return {
+        QRvisible: false,
+        codeList: []
+      };
+    },
+
+    methods: {
+      open(data) {
+        this.codeList = data;
+        this.QRvisible = true;
+        this.$nextTick(() => {
+          this.generateQRCodes();
+        });
+        // queryPrint({ ids }).then(res => {
+        //     this.codeList = res;
+        //     this.QRvisible = true
+        //     this.$nextTick(() => {
+        //         this.generateQRCodes()
+        //     })
+        // })
+      },
+
+      generateQRCodes() {
+        this.codeList.forEach((item) => {
+          QRCode.toDataURL(item.code)
+            .then((url) => {
+              item.qrcode = url;
+              this.$forceUpdate();
+            })
+            .catch((err) => {
+              console.error(err);
+            });
+        });
+      },
+
+      close() {
+        this.QRvisible = false;
+      },
+
+      print() {
+        const printSection = document.getElementById('printSection');
+        // 创建打印任务
+        const printWindow = window.open('', '_blank');
+        printWindow.document.open();
+        printWindow.document.write('<html><head><title>打印预览</title>');
+        printWindow.document.write(
+          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+        );
+        printWindow.document.write('</head><body>');
+        printWindow.document.write(printSection.innerHTML);
+        printWindow.document.write('</body></html>');
+        printWindow.document.close();
+        printWindow.onload = function () {
+          printWindow.print();
+        };
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  @media print {
+    #printSection {
+      font-size: 34px;
+
+      span {
+        font-size: 34px;
+      }
+    }
+  }
+</style>

+ 166 - 0
src/views/ledgerAssets/components/printSr.vue

@@ -0,0 +1,166 @@
+<template>
+  <ele-modal
+    title="二维码"
+    :visible.sync="QRvisible"
+    v-if="QRvisible"
+    width="800px"
+  >
+    <div id="printSection">
+      <div
+        v-for="(item, index) in codeList"
+        :key="index"
+        style="
+          width: 100%;
+          height: 100%;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        "
+      >
+        <div
+          style="
+            width: 160px;
+            height: 160px;
+            margin-right: 10px;
+            padding-left: 0px;
+          "
+        >
+          <img
+            :src="item.qrcode"
+            alt="QR Code"
+            style="width: 160px; height: 160px"
+          />
+        </div>
+        <div
+          style="
+            width: 640px;
+            display: flex;
+            flex-direction: column;
+            flex-wrap: wrap;
+            justify-content: space-between;
+            align-items: flex-start;
+          "
+        >
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">编码:</span>
+            <span style="color: #000">{{ item.code }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">名称:</span>
+            <span style="color: #000">{{ item.name }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">型号:</span>
+            <span style="color: #000">{{ item.category.modelType }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">规格:</span>
+            <span style="color: #000">{{ item.category.specification }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">编号:</span>
+            <span style="color: #000">{{ item.codeNumber }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">固资编码:</span>
+            <span style="color: #000">{{ item.fixCode }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">工位名称:</span>
+            <span style="color: #000">{{
+              item.workstation ? item.workstation.name : ''
+            }}</span>
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <div slot="footer">
+      <el-button @click="print">打印预览</el-button>
+      <el-button @click="close">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import QRCode from 'qrcode';
+  export default {
+    name: 'print',
+    data() {
+      return {
+        QRvisible: false,
+        codeList: []
+      };
+    },
+
+    methods: {
+      open(data) {
+        this.codeList = data;
+        this.QRvisible = true;
+        this.$nextTick(() => {
+          this.generateQRCodes();
+        });
+        // queryPrint({ ids }).then(res => {
+        //     this.codeList = res;
+        //     this.QRvisible = true
+        //     this.$nextTick(() => {
+        //         this.generateQRCodes()
+        //     })
+        // })
+      },
+
+      generateQRCodes() {
+        this.codeList.forEach((item) => {
+          QRCode.toDataURL(item.code)
+            .then((url) => {
+              item.qrcode = url;
+              this.$forceUpdate();
+            })
+            .catch((err) => {
+              console.error(err);
+            });
+        });
+      },
+
+      close() {
+        this.QRvisible = false;
+      },
+
+      print() {
+        const printSection = document.getElementById('printSection');
+        // 创建打印任务
+        const printWindow = window.open('', '_blank');
+        printWindow.document.open();
+        printWindow.document.write('<html><head><title>打印预览</title>');
+        printWindow.document.write(
+          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+        );
+        printWindow.document.write('</head><body>');
+        printWindow.document.write(printSection.innerHTML);
+        printWindow.document.write('</body></html>');
+        printWindow.document.close();
+        printWindow.onload = function () {
+          printWindow.print();
+        };
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  @media print {
+    #printSection {
+      font-size: 34px;
+
+      span {
+        font-size: 34px;
+      }
+    }
+  }
+</style>

+ 160 - 0
src/views/ledgerAssets/components/printTg.vue

@@ -0,0 +1,160 @@
+<template>
+  <ele-modal
+    title="二维码"
+    :visible.sync="QRvisible"
+    v-if="QRvisible"
+    width="800px"
+  >
+    <div id="printSection">
+      <div
+        v-for="(item, index) in codeList"
+        :key="index"
+        style="
+          display: flex;
+          width: 100%;
+          height: 100%;
+          align-items: center;
+          justify-content: center;
+          margin: auto;
+        "
+      >
+        <div style="width: 200px; height: 200px; margin-right: 18px">
+          <img
+            :src="item.qrcode"
+            alt="QR Code"
+            style="width: 200px; height: 200px"
+          />
+        </div>
+        <div
+          style="
+            width: 520px;
+            display: flex;
+            flex-direction: column;
+            flex-wrap: wrap;
+            justify-content: space-between;
+            align-items: flex-start;
+          "
+        >
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">编码:</span>
+            <span style="color: #000">{{ item.code }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">名称:</span>
+            <span style="color: #000">{{ item.name }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">型号:</span>
+            <span style="color: #000">{{ item.category.modelType }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">规格:</span>
+            <span style="color: #000">{{ item.category.specification }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">编号:</span>
+            <span style="color: #000">{{ item.codeNumber }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">固资编码:</span>
+            <span style="color: #000">{{ item.fixCode }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">工位名称:</span>
+            <span style="color: #000">{{
+              item.workstation ? item.workstation.name : ''
+            }}</span>
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <div slot="footer">
+      <el-button @click="print">打印预览</el-button>
+      <el-button @click="close">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import QRCode from 'qrcode';
+  export default {
+    name: 'print',
+    data() {
+      return {
+        QRvisible: false,
+        codeList: []
+      };
+    },
+
+    methods: {
+      open(data) {
+        this.codeList = data;
+        this.QRvisible = true;
+        this.$nextTick(() => {
+          this.generateQRCodes();
+        });
+        // queryPrint({ ids }).then(res => {
+        //     this.codeList = res;
+        //     this.QRvisible = true
+        //     this.$nextTick(() => {
+        //         this.generateQRCodes()
+        //     })
+        // })
+      },
+
+      generateQRCodes() {
+        this.codeList.forEach((item) => {
+          QRCode.toDataURL(item.code)
+            .then((url) => {
+              item.qrcode = url;
+              this.$forceUpdate();
+            })
+            .catch((err) => {
+              console.error(err);
+            });
+        });
+      },
+
+      close() {
+        this.QRvisible = false;
+      },
+
+      print() {
+        const printSection = document.getElementById('printSection');
+        // 创建打印任务
+        const printWindow = window.open('', '_blank');
+        printWindow.document.open();
+        printWindow.document.write('<html><head><title>打印预览</title>');
+        printWindow.document.write(
+          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+        );
+        printWindow.document.write('</head><body>');
+        printWindow.document.write(printSection.innerHTML);
+        printWindow.document.write('</body></html>');
+        printWindow.document.close();
+        printWindow.onload = function () {
+          printWindow.print();
+        };
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  @media print {
+    #printSection {
+      font-size: 34px;
+
+      span {
+        font-size: 34px;
+      }
+    }
+  }
+</style>

+ 19 - 105
src/views/ledgerAssets/equipment/components/equipment-list.vue

@@ -85,81 +85,16 @@
       </template>
     </ele-pro-table>
     <DialogMoveto ref="movetoRef" @success="sucesstion" />
-    <ele-modal title="二维码" :visible.sync="QRvisible" width="800px">
-      <div id="printSection">
-        <div
-          v-for="(item, index) in checkRadioData"
-          :key="index"
-          style="
-            display: flex;
-            padding-left: 20px;
-            align-items: center;
-            justify-content: center;
-            margin: auto;
-          "
-        >
-          <div style="width: 250px; height: 240px">
-            <img
-              :src="item.qrcode"
-              alt="QR Code"
-              style="width: 240px; height: 240px"
-            />
-          </div>
-          <div
-            style="
-              width: 440px;
-              height: 240px;
-              display: flex;
-              flex-direction: column;
-              flex-wrap: wrap;
-              justify-content: space-between;
-              align-items: flex-start;
-            "
-          >
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">编码:</span>
-              <span style="color: #000">{{ item.code }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">名称:</span>
-              <span style="color: #000">{{ item.name }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">型号:</span>
-              <span style="color: #000">{{ item.category.modelType }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">规格:</span>
-              <span style="color: #000">{{ item.category.specification }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">编号:</span>
-              <span style="color: #000">{{ item.codeNumber }}</span>
-            </div>
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px"
-                >固资编码:</span
-              >
-              <span style="color: #000">{{ item.fixCode }}</span>
-            </div>
-          </div>
-        </div>
-      </div>
-
-      <div slot="footer">
-        <el-button @click="print">打印预览</el-button>
-        <el-button @click="QRvisible = false">关闭</el-button>
-      </div>
-    </ele-modal>
+    <print ref="printRef"></print>
+    <printSr ref="printSrRef"></printSr>
+    <printTg ref="printTgRef"></printTg>
   </div>
 </template>
 
 <script>
-  import QRCode from 'qrcode';
+  import print from '@/views/ledgerAssets/components/print.vue';
+  import printSr from '@/views/ledgerAssets/components/printSr';
+  import printTg from '@/views/ledgerAssets/components/printTg';
   import { getByCode } from '@/api/system/dictionary-data';
   import { businessStatus, networkStatus } from '@/utils/dict/warehouse';
   import EquipmentSearch from './equipment-search.vue';
@@ -181,7 +116,7 @@
   import { getToken, setToken } from '@/utils/token-util';
 
   export default {
-    components: { EquipmentSearch, DialogMoveto },
+    components: { EquipmentSearch, DialogMoveto, print, printSr, printTg },
     mixins: [dictMixins],
     props: {
       // 类别id
@@ -373,45 +308,24 @@
         QRvisible: false
       };
     },
+    computed: {
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
     created() {
       this.requestDict('网络状态');
       this.getAssetLevelOptions();
     },
     methods: {
       allPrinting() {
-        this.QRvisible = true;
-        this.$nextTick(() => {
-          this.generateQRCodes();
-        });
-      },
-      generateQRCodes() {
-        this.checkRadioData.forEach((item) => {
-          QRCode.toDataURL(item.code)
-            .then((url) => {
-              item.qrcode = url;
-              this.$forceUpdate();
-            })
-            .catch((err) => {
-              console.error(err);
-            });
-        });
-      },
-      print() {
-        const printSection = document.getElementById('printSection');
-        // 创建打印任务
-        const printWindow = window.open('', '_blank');
-        printWindow.document.open();
-        printWindow.document.write('<html><head><title>打印预览</title>');
-        printWindow.document.write(
-          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
-        );
-        printWindow.document.write('</head><body>');
-        printWindow.document.write(printSection.innerHTML);
-        printWindow.document.write('</body></html>');
-        printWindow.document.close();
-        printWindow.onload = function () {
-          printWindow.print();
-        };
+        if (this.clientEnvironmentId == 2) {
+          this.$refs.printSrRef.open(this.checkRadioData);
+        } else if (this.clientEnvironmentId == 3) {
+          this.$refs.printTgRef.open(this.checkRadioData);
+        } else {
+          this.$refs.printRef.open(this.checkRadioData);
+        }
       },
       // 获取资产级别下拉
       async getAssetLevelOptions() {

+ 19 - 105
src/views/ledgerAssets/meter/components/equipment-list.vue

@@ -84,81 +84,16 @@
       </template>
     </ele-pro-table>
     <DialogMoveto ref="movetoRef" @success="sucesstion" />
-    <ele-modal title="二维码" :visible.sync="QRvisible" width="800px">
-      <div id="printSection">
-        <div
-          v-for="(item, index) in checkRadioData"
-          :key="index"
-          style="
-            display: flex;
-            padding-left: 20px;
-            align-items: center;
-            justify-content: center;
-            margin: auto;
-          "
-        >
-          <div style="width: 250px; height: 240px">
-            <img
-              :src="item.qrcode"
-              alt="QR Code"
-              style="width: 240px; height: 240px"
-            />
-          </div>
-          <div
-            style="
-              width: 440px;
-              height: 240px;
-              display: flex;
-              flex-direction: column;
-              flex-wrap: wrap;
-              justify-content: space-between;
-              align-items: flex-start;
-            "
-          >
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">编码:</span>
-              <span style="color: #000">{{ item.code }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">名称:</span>
-              <span style="color: #000">{{ item.name }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">型号:</span>
-              <span style="color: #000">{{ item.category.modelType }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">规格:</span>
-              <span style="color: #000">{{ item.category.specification }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">编号:</span>
-              <span style="color: #000">{{ item.codeNumber }}</span>
-            </div>
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px"
-                >固资编码:</span
-              >
-              <span style="color: #000">{{ item.fixCode }}</span>
-            </div>
-          </div>
-        </div>
-      </div>
-
-      <div slot="footer">
-        <el-button @click="print">打印预览</el-button>
-        <el-button @click="QRvisible = false">关闭</el-button>
-      </div>
-    </ele-modal>
+    <print ref="printRef"></print>
+    <printSr ref="printSrRef"></printSr>
+    <printTg ref="printTgRef"></printTg>
   </div>
 </template>
 
 <script>
-  import QRCode from 'qrcode';
+  import print from '@/views/ledgerAssets/components/print.vue';
+  import printSr from '@/views/ledgerAssets/components/printSr';
+  import printTg from '@/views/ledgerAssets/components/printTg';
   import { getByCode } from '@/api/system/dictionary-data';
   import { businessStatus, networkStatus } from '@/utils/dict/warehouse';
   import EquipmentSearch from './equipment-search.vue';
@@ -180,7 +115,7 @@
   import { getToken, setToken } from '@/utils/token-util';
 
   export default {
-    components: { EquipmentSearch, DialogMoveto },
+    components: { EquipmentSearch, DialogMoveto, print, printSr, printTg },
     mixins: [dictMixins],
     props: {
       // 类别id
@@ -373,45 +308,24 @@
         checkRadioData: []
       };
     },
+    computed: {
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
     created() {
       this.requestDict('网络状态');
       this.getAssetLevelOptions();
     },
     methods: {
       allPrinting() {
-        this.QRvisible = true;
-        this.$nextTick(() => {
-          this.generateQRCodes();
-        });
-      },
-      generateQRCodes() {
-        this.checkRadioData.forEach((item) => {
-          QRCode.toDataURL(item.code)
-            .then((url) => {
-              item.qrcode = url;
-              this.$forceUpdate();
-            })
-            .catch((err) => {
-              console.error(err);
-            });
-        });
-      },
-      print() {
-        const printSection = document.getElementById('printSection');
-        // 创建打印任务
-        const printWindow = window.open('', '_blank');
-        printWindow.document.open();
-        printWindow.document.write('<html><head><title>打印预览</title>');
-        printWindow.document.write(
-          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
-        );
-        printWindow.document.write('</head><body>');
-        printWindow.document.write(printSection.innerHTML);
-        printWindow.document.write('</body></html>');
-        printWindow.document.close();
-        printWindow.onload = function () {
-          printWindow.print();
-        };
+        if (this.clientEnvironmentId == 2) {
+          this.$refs.printSrRef.open(this.checkRadioData);
+        } else if (this.clientEnvironmentId == 3) {
+          this.$refs.printTgRef.open(this.checkRadioData);
+        } else {
+          this.$refs.printRef.open(this.checkRadioData);
+        }
       },
       // 跳转到详情页
       details({ id }) {

+ 19 - 105
src/views/ledgerAssets/mould/components/mould-list.vue

@@ -85,81 +85,16 @@
         </el-link>
       </template>
     </ele-pro-table>
-    <ele-modal title="二维码" :visible.sync="QRvisible" width="800px">
-      <div id="printSection">
-        <div
-          v-for="(item, index) in checkRadioData"
-          :key="index"
-          style="
-            display: flex;
-            padding-left: 20px;
-            align-items: center;
-            justify-content: center;
-            margin: auto;
-          "
-        >
-          <div style="width: 250px; height: 240px">
-            <img
-              :src="item.qrcode"
-              alt="QR Code"
-              style="width: 240px; height: 240px"
-            />
-          </div>
-          <div
-            style="
-              width: 440px;
-              height: 240px;
-              display: flex;
-              flex-direction: column;
-              flex-wrap: wrap;
-              justify-content: space-between;
-              align-items: flex-start;
-            "
-          >
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">编码:</span>
-              <span style="color: #000">{{ item.code }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">名称:</span>
-              <span style="color: #000">{{ item.name }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">型号:</span>
-              <span style="color: #000">{{ item.category.modelType }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">规格:</span>
-              <span style="color: #000">{{ item.category.specification }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">编号:</span>
-              <span style="color: #000">{{ item.codeNumber }}</span>
-            </div>
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px"
-                >固资编码:</span
-              >
-              <span style="color: #000">{{ item.fixCode }}</span>
-            </div>
-          </div>
-        </div>
-      </div>
-
-      <div slot="footer">
-        <el-button @click="print">打印预览</el-button>
-        <el-button @click="QRvisible = false">关闭</el-button>
-      </div>
-    </ele-modal>
+    <print ref="printRef"></print>
+    <printSr ref="printSrRef"></printSr>
+    <printTg ref="printTgRef"></printTg>
   </div>
 </template>
 
 <script>
-  import QRCode from 'qrcode';
+  import print from '@/views/ledgerAssets/components/print.vue';
+  import printSr from '@/views/ledgerAssets/components/printSr';
+  import printTg from '@/views/ledgerAssets/components/printTg';
   import { getByCode } from '@/api/system/dictionary-data';
   import { businessStatus, networkStatus } from '@/utils/dict/warehouse';
   import MouldSearch from './mould-search.vue';
@@ -174,7 +109,7 @@
   import { download } from '@/utils/file';
   import { getToken, setToken } from '@/utils/token-util';
   export default {
-    components: { MouldSearch },
+    components: { MouldSearch, print, printSr, printTg },
     mixins: [dictMixins],
     props: {
       // 类别id
@@ -347,45 +282,24 @@
         checkRadioData: []
       };
     },
+    computed: {
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
     created() {
       this.requestDict('生命周期');
       this.getAssetLevelOptions();
     },
     methods: {
       allPrinting() {
-        this.QRvisible = true;
-        this.$nextTick(() => {
-          this.generateQRCodes();
-        });
-      },
-      generateQRCodes() {
-        this.checkRadioData.forEach((item) => {
-          QRCode.toDataURL(item.code)
-            .then((url) => {
-              item.qrcode = url;
-              this.$forceUpdate();
-            })
-            .catch((err) => {
-              console.error(err);
-            });
-        });
-      },
-      print() {
-        const printSection = document.getElementById('printSection');
-        // 创建打印任务
-        const printWindow = window.open('', '_blank');
-        printWindow.document.open();
-        printWindow.document.write('<html><head><title>打印预览</title>');
-        printWindow.document.write(
-          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
-        );
-        printWindow.document.write('</head><body>');
-        printWindow.document.write(printSection.innerHTML);
-        printWindow.document.write('</body></html>');
-        printWindow.document.close();
-        printWindow.onload = function () {
-          printWindow.print();
-        };
+        if (this.clientEnvironmentId == 2) {
+          this.$refs.printSrRef.open(this.checkRadioData);
+        } else if (this.clientEnvironmentId == 3) {
+          this.$refs.printTgRef.open(this.checkRadioData);
+        } else {
+          this.$refs.printRef.open(this.checkRadioData);
+        }
       },
       // 全选
       changeSelectAll(arr) {

+ 19 - 105
src/views/ledgerAssets/office/components/data-list.vue

@@ -85,81 +85,16 @@
         </el-link>
       </template>
     </ele-pro-table>
-    <ele-modal title="二维码" :visible.sync="QRvisible" width="800px">
-      <div id="printSection">
-        <div
-          v-for="(item, index) in checkRadioData"
-          :key="index"
-          style="
-            display: flex;
-            padding-left: 20px;
-            align-items: center;
-            justify-content: center;
-            margin: auto;
-          "
-        >
-          <div style="width: 250px; height: 240px">
-            <img
-              :src="item.qrcode"
-              alt="QR Code"
-              style="width: 240px; height: 240px"
-            />
-          </div>
-          <div
-            style="
-              width: 440px;
-              height: 240px;
-              display: flex;
-              flex-direction: column;
-              flex-wrap: wrap;
-              justify-content: space-between;
-              align-items: flex-start;
-            "
-          >
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">编码:</span>
-              <span style="color: #000">{{ item.code }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">名称:</span>
-              <span style="color: #000">{{ item.name }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">型号:</span>
-              <span style="color: #000">{{ item.category.modelType }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">规格:</span>
-              <span style="color: #000">{{ item.category.specification }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">编号:</span>
-              <span style="color: #000">{{ item.codeNumber }}</span>
-            </div>
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px"
-                >固资编码:</span
-              >
-              <span style="color: #000">{{ item.fixCode }}</span>
-            </div>
-          </div>
-        </div>
-      </div>
-
-      <div slot="footer">
-        <el-button @click="print">打印预览</el-button>
-        <el-button @click="QRvisible = false">关闭</el-button>
-      </div>
-    </ele-modal>
+    <print ref="printRef"></print>
+    <printSr ref="printSrRef"></printSr>
+    <printTg ref="printTgRef"></printTg>
   </div>
 </template>
 
 <script>
-  import QRCode from 'qrcode';
+  import print from '@/views/ledgerAssets/components/print.vue';
+  import printSr from '@/views/ledgerAssets/components/printSr';
+  import printTg from '@/views/ledgerAssets/components/printTg';
   import { getByCode } from '@/api/system/dictionary-data';
   import { businessStatus, networkStatus } from '@/utils/dict/warehouse';
   import UserSearch from './user-search.vue';
@@ -174,7 +109,7 @@
   import { download } from '@/utils/file';
   import { getToken, setToken } from '@/utils/token-util';
   export default {
-    components: { UserSearch },
+    components: { UserSearch, print, printSr, printTg },
     mixins: [dictMixins],
     props: {
       // 类别id
@@ -363,45 +298,24 @@
         ]
       };
     },
+    computed: {
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
     created() {
       this.requestDict('生命周期');
       this.getAssetLevelOptions();
     },
     methods: {
       allPrinting() {
-        this.QRvisible = true;
-        this.$nextTick(() => {
-          this.generateQRCodes();
-        });
-      },
-      generateQRCodes() {
-        this.checkRadioData.forEach((item) => {
-          QRCode.toDataURL(item.code)
-            .then((url) => {
-              item.qrcode = url;
-              this.$forceUpdate();
-            })
-            .catch((err) => {
-              console.error(err);
-            });
-        });
-      },
-      print() {
-        const printSection = document.getElementById('printSection');
-        // 创建打印任务
-        const printWindow = window.open('', '_blank');
-        printWindow.document.open();
-        printWindow.document.write('<html><head><title>打印预览</title>');
-        printWindow.document.write(
-          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
-        );
-        printWindow.document.write('</head><body>');
-        printWindow.document.write(printSection.innerHTML);
-        printWindow.document.write('</body></html>');
-        printWindow.document.close();
-        printWindow.onload = function () {
-          printWindow.print();
-        };
+        if (this.clientEnvironmentId == 2) {
+          this.$refs.printSrRef.open(this.checkRadioData);
+        } else if (this.clientEnvironmentId == 3) {
+          this.$refs.printTgRef.open(this.checkRadioData);
+        } else {
+          this.$refs.printRef.open(this.checkRadioData);
+        }
       },
       // 全选
       changeSelectAll(arr) {

+ 19 - 105
src/views/ledgerAssets/sparepart/components/sparepart-list.vue

@@ -100,81 +100,16 @@
         </el-link>
       </template>
     </ele-pro-table>
-    <ele-modal title="二维码" :visible.sync="QRvisible" width="800px">
-      <div id="printSection">
-        <div
-          v-for="(item, index) in checkRadioData"
-          :key="index"
-          style="
-            display: flex;
-            padding-left: 20px;
-            align-items: center;
-            justify-content: center;
-            margin: auto;
-          "
-        >
-          <div style="width: 250px; height: 240px">
-            <img
-              :src="item.qrcode"
-              alt="QR Code"
-              style="width: 240px; height: 240px"
-            />
-          </div>
-          <div
-            style="
-              width: 440px;
-              height: 240px;
-              display: flex;
-              flex-direction: column;
-              flex-wrap: wrap;
-              justify-content: space-between;
-              align-items: flex-start;
-            "
-          >
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">编码:</span>
-              <span style="color: #000">{{ item.code }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">名称:</span>
-              <span style="color: #000">{{ item.name }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">型号:</span>
-              <span style="color: #000">{{ item.category.modelType }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">规格:</span>
-              <span style="color: #000">{{ item.category.specification }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">编号:</span>
-              <span style="color: #000">{{ item.codeNumber }}</span>
-            </div>
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px"
-                >固资编码:</span
-              >
-              <span style="color: #000">{{ item.fixCode }}</span>
-            </div>
-          </div>
-        </div>
-      </div>
-
-      <div slot="footer">
-        <el-button @click="print">打印预览</el-button>
-        <el-button @click="QRvisible = false">关闭</el-button>
-      </div>
-    </ele-modal>
+    <print ref="printRef"></print>
+    <printSr ref="printSrRef"></printSr>
+    <printTg ref="printTgRef"></printTg>
   </div>
 </template>
 
 <script>
-  import QRCode from 'qrcode';
+  import print from '@/views/ledgerAssets/components/print.vue';
+  import printSr from '@/views/ledgerAssets/components/printSr';
+  import printTg from '@/views/ledgerAssets/components/printTg';
   import { getByCode } from '@/api/system/dictionary-data';
   import { businessStatus, networkStatus } from '@/utils/dict/warehouse';
   import SparepartSearch from './sparepart-search.vue';
@@ -190,7 +125,7 @@
   import { getToken, setToken } from '@/utils/token-util';
 
   export default {
-    components: { SparepartSearch },
+    components: { SparepartSearch, print, printSr, printTg },
     mixins: [dictMixins],
     props: {
       // 类别id
@@ -368,45 +303,24 @@
         ]
       };
     },
+    computed: {
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
     created() {
       this.requestDict('生命周期');
       this.getAssetLevelOptions();
     },
     methods: {
       allPrinting() {
-        this.QRvisible = true;
-        this.$nextTick(() => {
-          this.generateQRCodes();
-        });
-      },
-      generateQRCodes() {
-        this.checkRadioData.forEach((item) => {
-          QRCode.toDataURL(item.code)
-            .then((url) => {
-              item.qrcode = url;
-              this.$forceUpdate();
-            })
-            .catch((err) => {
-              console.error(err);
-            });
-        });
-      },
-      print() {
-        const printSection = document.getElementById('printSection');
-        // 创建打印任务
-        const printWindow = window.open('', '_blank');
-        printWindow.document.open();
-        printWindow.document.write('<html><head><title>打印预览</title>');
-        printWindow.document.write(
-          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
-        );
-        printWindow.document.write('</head><body>');
-        printWindow.document.write(printSection.innerHTML);
-        printWindow.document.write('</body></html>');
-        printWindow.document.close();
-        printWindow.onload = function () {
-          printWindow.print();
-        };
+        if (this.clientEnvironmentId == 2) {
+          this.$refs.printSrRef.open(this.checkRadioData);
+        } else if (this.clientEnvironmentId == 3) {
+          this.$refs.printTgRef.open(this.checkRadioData);
+        } else {
+          this.$refs.printRef.open(this.checkRadioData);
+        }
       },
       // 全选
       changeSelectAll(arr) {

+ 19 - 105
src/views/ledgerAssets/turnoverCar/components/turnovercar-list.vue

@@ -73,81 +73,16 @@
         </el-link>
       </template>
     </ele-pro-table>
-    <ele-modal title="二维码" :visible.sync="QRvisible" width="800px">
-      <div id="printSection">
-        <div
-          v-for="(item, index) in checkRadioData"
-          :key="index"
-          style="
-            display: flex;
-            padding-left: 20px;
-            align-items: center;
-            justify-content: center;
-            margin: auto;
-          "
-        >
-          <div style="width: 250px; height: 240px">
-            <img
-              :src="item.qrcode"
-              alt="QR Code"
-              style="width: 240px; height: 240px"
-            />
-          </div>
-          <div
-            style="
-              width: 440px;
-              height: 240px;
-              display: flex;
-              flex-direction: column;
-              flex-wrap: wrap;
-              justify-content: space-between;
-              align-items: flex-start;
-            "
-          >
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">编码:</span>
-              <span style="color: #000">{{ item.code }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">名称:</span>
-              <span style="color: #000">{{ item.name }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">型号:</span>
-              <span style="color: #000">{{ item.category.modelType }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">规格:</span>
-              <span style="color: #000">{{ item.category.specification }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">编号:</span>
-              <span style="color: #000">{{ item.codeNumber }}</span>
-            </div>
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px"
-                >固资编码:</span
-              >
-              <span style="color: #000">{{ item.fixCode }}</span>
-            </div>
-          </div>
-        </div>
-      </div>
-
-      <div slot="footer">
-        <el-button @click="print">打印预览</el-button>
-        <el-button @click="QRvisible = false">关闭</el-button>
-      </div>
-    </ele-modal>
+    <print ref="printRef"></print>
+    <printSr ref="printSrRef"></printSr>
+    <printTg ref="printTgRef"></printTg>
   </div>
 </template>
 
 <script>
-  import QRCode from 'qrcode';
+  import print from '@/views/ledgerAssets/components/print.vue';
+  import printSr from '@/views/ledgerAssets/components/printSr';
+  import printTg from '@/views/ledgerAssets/components/printTg';
   import { getByCode } from '@/api/system/dictionary-data';
   import { businessStatus, networkStatus } from '@/utils/dict/warehouse';
   import TurnovercarSearch from './turnovercar-search.vue';
@@ -164,7 +99,7 @@
   import { getToken, setToken } from '@/utils/token-util';
 
   export default {
-    components: { TurnovercarSearch },
+    components: { TurnovercarSearch, print, printSr, printTg },
     mixins: [dictMixins],
     props: {
       // 类别id
@@ -337,6 +272,11 @@
         ]
       };
     },
+    computed: {
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
     created() {
       this.requestDict('生命周期');
       this.requestDict('周转车材质');
@@ -344,39 +284,13 @@
     },
     methods: {
       allPrinting() {
-        this.QRvisible = true;
-        this.$nextTick(() => {
-          this.generateQRCodes();
-        });
-      },
-      generateQRCodes() {
-        this.checkRadioData.forEach((item) => {
-          QRCode.toDataURL(item.code)
-            .then((url) => {
-              item.qrcode = url;
-              this.$forceUpdate();
-            })
-            .catch((err) => {
-              console.error(err);
-            });
-        });
-      },
-      print() {
-        const printSection = document.getElementById('printSection');
-        // 创建打印任务
-        const printWindow = window.open('', '_blank');
-        printWindow.document.open();
-        printWindow.document.write('<html><head><title>打印预览</title>');
-        printWindow.document.write(
-          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
-        );
-        printWindow.document.write('</head><body>');
-        printWindow.document.write(printSection.innerHTML);
-        printWindow.document.write('</body></html>');
-        printWindow.document.close();
-        printWindow.onload = function () {
-          printWindow.print();
-        };
+        if (this.clientEnvironmentId == 2) {
+          this.$refs.printSrRef.open(this.checkRadioData);
+        } else if (this.clientEnvironmentId == 3) {
+          this.$refs.printTgRef.open(this.checkRadioData);
+        } else {
+          this.$refs.printRef.open(this.checkRadioData);
+        }
       },
       // 全选
       changeSelectAll(arr) {

+ 19 - 105
src/views/ledgerAssets/turnoverDisks/components/equipment-list.vue

@@ -84,81 +84,16 @@
       </template>
     </ele-pro-table>
     <DialogMoveto ref="movetoRef" @success="sucesstion" />
-    <ele-modal title="二维码" :visible.sync="QRvisible" width="800px">
-      <div id="printSection">
-        <div
-          v-for="(item, index) in checkRadioData"
-          :key="index"
-          style="
-            display: flex;
-            padding-left: 20px;
-            align-items: center;
-            justify-content: center;
-            margin: auto;
-          "
-        >
-          <div style="width: 250px; height: 240px">
-            <img
-              :src="item.qrcode"
-              alt="QR Code"
-              style="width: 240px; height: 240px"
-            />
-          </div>
-          <div
-            style="
-              width: 440px;
-              height: 240px;
-              display: flex;
-              flex-direction: column;
-              flex-wrap: wrap;
-              justify-content: space-between;
-              align-items: flex-start;
-            "
-          >
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">编码:</span>
-              <span style="color: #000">{{ item.code }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">名称:</span>
-              <span style="color: #000">{{ item.name }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">型号:</span>
-              <span style="color: #000">{{ item.category.modelType }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">规格:</span>
-              <span style="color: #000">{{ item.category.specification }}</span>
-            </div>
-
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px">编号:</span>
-              <span style="color: #000">{{ item.codeNumber }}</span>
-            </div>
-            <div style="text-align: left; font-size: 20px">
-              <span style="display: inline-block; width: 100px"
-                >固资编码:</span
-              >
-              <span style="color: #000">{{ item.fixCode }}</span>
-            </div>
-          </div>
-        </div>
-      </div>
-
-      <div slot="footer">
-        <el-button @click="print">打印预览</el-button>
-        <el-button @click="QRvisible = false">关闭</el-button>
-      </div>
-    </ele-modal>
+    <print ref="printRef"></print>
+    <printSr ref="printSrRef"></printSr>
+    <printTg ref="printTgRef"></printTg>
   </div>
 </template>
 
 <script>
-  import QRCode from 'qrcode';
+  import print from '@/views/ledgerAssets/components/print.vue';
+  import printSr from '@/views/ledgerAssets/components/printSr';
+  import printTg from '@/views/ledgerAssets/components/printTg';
   import { getByCode } from '@/api/system/dictionary-data';
   import { businessStatus, networkStatus } from '@/utils/dict/warehouse';
   import EquipmentSearch from './equipment-search.vue';
@@ -180,7 +115,7 @@
   import { getToken, setToken } from '@/utils/token-util';
 
   export default {
-    components: { EquipmentSearch, DialogMoveto },
+    components: { EquipmentSearch, DialogMoveto, print, printSr, printTg },
     mixins: [dictMixins],
     props: {
       // 类别id
@@ -355,45 +290,24 @@
         ]
       };
     },
+    computed: {
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
     created() {
       this.requestDict('网络状态');
       this.getAssetLevelOptions();
     },
     methods: {
       allPrinting() {
-        this.QRvisible = true;
-        this.$nextTick(() => {
-          this.generateQRCodes();
-        });
-      },
-      generateQRCodes() {
-        this.checkRadioData.forEach((item) => {
-          QRCode.toDataURL(item.code)
-            .then((url) => {
-              item.qrcode = url;
-              this.$forceUpdate();
-            })
-            .catch((err) => {
-              console.error(err);
-            });
-        });
-      },
-      print() {
-        const printSection = document.getElementById('printSection');
-        // 创建打印任务
-        const printWindow = window.open('', '_blank');
-        printWindow.document.open();
-        printWindow.document.write('<html><head><title>打印预览</title>');
-        printWindow.document.write(
-          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
-        );
-        printWindow.document.write('</head><body>');
-        printWindow.document.write(printSection.innerHTML);
-        printWindow.document.write('</body></html>');
-        printWindow.document.close();
-        printWindow.onload = function () {
-          printWindow.print();
-        };
+        if (this.clientEnvironmentId == 2) {
+          this.$refs.printSrRef.open(this.checkRadioData);
+        } else if (this.clientEnvironmentId == 3) {
+          this.$refs.printTgRef.open(this.checkRadioData);
+        } else {
+          this.$refs.printRef.open(this.checkRadioData);
+        }
       },
       // 获取资产级别下拉
       async getAssetLevelOptions() {