lilei 1 year ago
parent
commit
677148ae11
5 changed files with 42 additions and 22 deletions
  1. 1 1
      public/version.json
  2. 29 19
      src/components/tools/UserMenu.vue
  3. 1 2
      src/libs/JGPrint.js
  4. 1 0
      src/store/getters.js
  5. 10 0
      src/store/modules/app.js

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1719209322954
+  "version": 1719212534938
 }

+ 29 - 19
src/components/tools/UserMenu.vue

@@ -5,16 +5,16 @@
         <img style="width: 18px;height: 18px;vertical-align: middle;margin: 0 5px;" src="../../assets/icon_movie.png"/>
         <span style="vertical-align: middle;color: #666;">帮助</span>
       </p>
-      
+
       <p class="help-cont" @click="showShopCar" v-if="$hasPermissions('M_shoppingCart')">
         <a-popover placement="bottom">
-        <template slot="content">
-          <span>购物车</span>
-        </template>
-        <a-badge :count="cartCount" :overflow-count="999">
-          <a-icon type="shopping-cart" style="font-size:16px;margin: 0 5px;color: #666;"/>
-        </a-badge>
-      </a-popover>
+          <template slot="content">
+            <span>购物车</span>
+          </template>
+          <a-badge :count="cartCount" :overflow-count="999">
+            <a-icon type="shopping-cart" style="font-size:16px;margin: 0 5px;color: #666;"/>
+          </a-badge>
+        </a-popover>
       </p>
       <!-- 通知 -->
       <notice-icon class="action"/>
@@ -22,7 +22,7 @@
       <a-popover title="系统设置">
         <div slot="content" :style="{width: fontSize == 'large' ? '340px' : '300px'}">
           <a-form-model :label-col="{ span: 9 }" :wrapper-col="{ span: 15 }">
-            <a-form-model-item label="主题">
+            <a-form-model-item label="主题" style="margin-bottom:10px;">
               <a-radio-group :value="theme" @change="changeTheme">
                 <a-radio-button value="dark">
                   深色
@@ -32,7 +32,7 @@
                 </a-radio-button>
               </a-radio-group>
             </a-form-model-item>
-            <a-form-model-item label="字体大小">
+            <a-form-model-item label="字体大小" style="margin-bottom:10px;">
               <a-radio-group :value="fontSize" @change="changeFontSize">
                 <a-radio-button value="small">
@@ -45,7 +45,7 @@
                 </a-radio-button>
               </a-radio-group>
             </a-form-model-item>
-            <a-form-model-item label="默认针式打印机">
+            <a-form-model-item label="默认针式打印机" style="margin-bottom:10px;">
               <div style="line-height: normal;padding-top: 10px;">
                 <span style="color: #999;">{{ printName ||'还未设置默认打印机' }}</span>
                 <div style="padding-top: 10px;">
@@ -53,6 +53,9 @@
                 </div>
               </div>
             </a-form-model-item>
+            <a-form-model-item label="打印是否节省纸" style="margin-bottom:10px;">
+              <a-switch style="margin-left: 10px;" checked-children="开" un-checked-children="关" v-model="printContentType" @change="changeContentType"/>
+            </a-form-model-item>
           </a-form-model>
         </div>
         <span class="skin">
@@ -62,11 +65,11 @@
 
       <p class="help-cont" @click="screen">
         <a-popover placement="bottom">
-        <template slot="content">
-          <span>{{ isFullscreen?'取消全屏':'全屏' }}</span>
-        </template>
-        <a-icon :type="isFullscreen?'fullscreen-exit':'fullscreen'" style="font-size:14px;margin: 0 5px;color: #666;"/>
-      </a-popover>
+          <template slot="content">
+            <span>{{ isFullscreen?'取消全屏':'全屏' }}</span>
+          </template>
+          <a-icon :type="isFullscreen?'fullscreen-exit':'fullscreen'" style="font-size:14px;margin: 0 5px;color: #666;"/>
+        </a-popover>
       </p>
 
       <a-dropdown>
@@ -113,7 +116,7 @@ export default {
     NoticeIcon
   },
   computed: {
-    ...mapGetters(['nickname', 'avatar', 'authOrgs', 'userInfo', 'nowRoute', 'theme', 'fontSize', 'printDefNeedle', 'cartCount']),
+    ...mapGetters(['nickname', 'avatar', 'authOrgs', 'userInfo', 'nowRoute', 'theme', 'fontSize', 'printDefNeedle', 'cartCount', 'printDefPageSize']),
     authOrgsList () { //  过滤掉当前登录账户(不可由自己切换为自己)
       const _this = this
       const arr = []
@@ -137,14 +140,18 @@ export default {
     printName () {
       const defName = this.printDefNeedle
       return defName && defName != 'undefined' ? defName : null
-    },
+    }
   },
   data () {
     return {
       defaultAvatar: defaultAvatar,
-      isFullscreen: false
+      isFullscreen: false,
+      printContentType: false
     }
   },
+  mounted () {
+    this.printContentType = this.printDefPageSize == 3
+  },
   methods: {
     ...mapActions(['Logout', 'SetOrgSn', 'Login']),
     // 打开视频播放弹窗
@@ -222,6 +229,9 @@ export default {
       this.$store.dispatch('TogglePrintSettingType', type)
       // 选择打印机
       this.$store.commit('SET_showSelectPrint', true)
+    },
+    changeContentType (value) {
+      this.$store.dispatch('TogglePrintDefPageSize', value ? 3 : 0)
     }
   }
 }

+ 1 - 2
src/libs/JGPrint.js

@@ -217,11 +217,10 @@ export const pdfPrint = function (data,index){
        store.commit('SET_printLoading',false)
      }
   };
-  console.log(store.state.app.printDefNeedle)
   // 指定打印机
   LODOP.SET_PRINTER_INDEX(store.state.app.printDefNeedle)
   LODOP.ADD_PRINT_PDF(0, 0, '100%', '100%', data[index])
-  LODOP.SET_PRINT_PAGESIZE(3, 2090, (index==dlen-1)?50:0, '')
+  LODOP.SET_PRINT_PAGESIZE(store.state.app.printDefPageSize||3, 2090, (index==dlen-1)?50:0, '')
   LODOP.PRINT()
 }
 // 判断当前单据是否已存在打印任务列表中

+ 1 - 0
src/store/getters.js

@@ -25,6 +25,7 @@ const getters = {
   closeTabPages: state => state.app.closeTabPages,
   loadingStatus: state => state.app.loadingStatus,
   printDefNeedle: state => state.app.printDefNeedle,
+  printDefPageSize: state => state.app.printDefPageSize,
   printDefInk: state => state.app.printDefInk,
   printUseing: state => state.app.printUseing,
   printSettingType: state => state.app.printSettingType,

+ 10 - 0
src/store/modules/app.js

@@ -48,6 +48,7 @@ const app = {
     printUseing: '0', // 选择打印机的用途 0 设置打印机,1打印时
     printSettingType: '', // 设置打印机类型,0 针式,1 喷墨
     printDefNeedle: undefined,// 默认针式打印机
+    printDefPageSize:'3', // 默认针式打印机纸张自适应高度,3:auto,0:pageEnd
     printDefInk: undefined, // 默认喷墨打印机
     defectiveReturnReason: [], // 不良品申请退货列表
     goodReturnReason: [], // 良品申请退货列表
@@ -148,6 +149,10 @@ const app = {
       state.printDefNeedle = val
       localStorage.setItem('DEFAULT_PRINT_NEEDLE',val)
     },
+    SET_printDefPageSize: (state, val) => {
+      state.printDefPageSize = val
+      localStorage.setItem('DEFAULT_PRINT_PAGESIZE',val)
+    },
     SET_printDefInk: (state, val) => {
       state.printDefInk = val
       localStorage.setItem('DEFAULT_PRINT_INK',val)
@@ -193,6 +198,11 @@ const app = {
     }, str) {
       commit('SET_printDefNeedle', str)
     },
+    TogglePrintDefPageSize({
+      commit
+      },str){
+      commit('SET_printDefPageSize', str)
+    },
     TogglePrintDefInk({
       commit
     }, str) {