Jelajahi Sumber

打印流转卡号。

jiaxiaoqiang 7 bulan lalu
induk
melakukan
3cd8920d77
1 mengubah file dengan 22 tambahan dan 8 penghapusan
  1. 22 8
      src/views/plan/workOrder/components/work-order-seq.vue

+ 22 - 8
src/views/plan/workOrder/components/work-order-seq.vue

@@ -81,8 +81,9 @@
       </div>
       <div class="slider-demo-block">
         <span class="demonstration">高度: </span>
-        <el-slider v-model="boxHeight" :min="360" :max="2000" show-input />
+        <el-slider v-model="boxHeight" :min="310" :max="2000" show-input />
       </div>
+      <el-button type="primary" @click="saveSettingLength">保存设置</el-button>
       <el-button type="primary" v-print="'#print'">打印</el-button>
 
       <table border-collapse="collapse" id="print">
@@ -95,11 +96,7 @@
                   height: `${boxHeight}px`,
                 }"
               >
-                <vue-qrcode
-                  :value="item.seqNo"
-                  :size="50"
-                  error-level="H"
-                ></vue-qrcode>
+                <vue-qrcode :value="item.seqNo" :size="40" error-level="H" />
                 <div>
                   <el-text>{{ item.seqNo }}</el-text>
                 </div>
@@ -142,8 +139,24 @@ const { isShowTable, tableType } = toRefs(useCommonStoreHook());
 const toPrintRef = ref(null);
 
 // 手动设置打印的宽度和高度
-const boxWidth = ref(200);
-const boxHeight = ref(200);
+const boxWidth = ref(150);
+const boxHeight = ref(150);
+
+const saveSettingLength = () => {
+  localStorage.setItem("boxWidth", boxWidth.value);
+  localStorage.setItem("boxHeight", boxHeight.value);
+};
+
+const loadSettingLength = () => {
+  const boxWidthValue = localStorage.getItem("boxWidth");
+  const boxHeightValue = localStorage.getItem("boxHeight");
+  if (boxWidthValue) {
+    boxWidth.value = parseInt(boxWidthValue);
+  }
+  if (boxHeightValue) {
+    boxHeight.value = parseInt(boxHeightValue);
+  }
+};
 
 const test = () => {
   isShowTable.value = true;
@@ -199,6 +212,7 @@ const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等
 
 const printCode = () => {
   dialog.visible = true;
+  loadSettingLength();
 };
 
 // 设置表格列或者其他自定义的option