lilei hace 3 años
padre
commit
a7062c5e2e
Se han modificado 4 ficheros con 26 adiciones y 28 borrados
  1. 1 1
      public/version.json
  2. 9 11
      src/libs/JGPrint.js
  3. 9 13
      src/views/common/pdfViewModal.vue
  4. 7 3
      src/views/common/selectPrint.vue

+ 1 - 1
public/version.json

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

+ 9 - 11
src/libs/JGPrint.js

@@ -266,17 +266,15 @@ export const jGPrint = function (data, type, printerType, taskName) {
       store.commit('SET_showPdfPrint', data.data)
       store.commit('SET_printTaskName', taskName)
     } else if (type == 'print') { //  pdf 打印
-      hasExitTaskByName(function(){
-        // 选择打印机
-        const isDefault = store.state.app.printUseDefault
-        if(isDefault == '0'){
-          store.commit('SET_pdfPrintList', data.data)
-          store.commit('SET_showSelectPrint', true)
-          store.commit('SET_printTaskName', taskName)
-        }else{
-          pdfPrint(data.data, 0)
-        }
-      })
+      // 选择打印机
+      const isDefault = store.state.app.printUseDefault
+      if(isDefault == '0'){
+        store.commit('SET_pdfPrintList', data.data)
+        store.commit('SET_showSelectPrint', true)
+        store.commit('SET_printTaskName', taskName)
+      }else{
+        pdfPrint(data.data, 0)
+      }
     }
   } else {
     // 喷墨打印

+ 9 - 13
src/views/common/pdfViewModal.vue

@@ -43,7 +43,7 @@
 <script>
 import pdf from 'vue-pdf-signature'
 import CMapReaderFactory from 'vue-pdf-signature/src/CMapReaderFactory.js'
-import { hasExitTaskByName, pdfPrint } from '@/libs/JGPrint'
+import { pdfPrint } from '@/libs/JGPrint'
 export default {
   components: {
     pdf
@@ -121,23 +121,19 @@ export default {
     // 确定
     handleCommonOk () {
       const _this = this
-      // 判断当前单据是否已经正在打印中
-      hasExitTaskByName(function () {
-        const isDefault = _this.$store.state.app.printUseDefault
-        if (isDefault == '0') {
-          // 选择打印机
-          _this.$store.commit('SET_showSelectPrint', true)
-        } else {
-          pdfPrint(_this.$store.state.app.pdfPrintList, 0)
-        }
-        _this.$emit('ok')
-      })
+      const isDefault = _this.$store.state.app.printUseDefault
+      if (isDefault == '0') {
+        // 选择打印机
+        _this.$store.commit('SET_showSelectPrint', true)
+      } else {
+        pdfPrint(_this.$store.state.app.pdfPrintList, 0)
+      }
+      _this.$emit('ok')
     },
     // 取消
     handleCommonCancel () {
       this.isShow = false
       this.pdfList = []
-	  console.log('6-6-6')
       this.$store.commit('SET_pdfPrintList', [])
       this.$store.commit('SET_showPdfPrint', false)
       this.$emit('cancel')

+ 7 - 3
src/views/common/selectPrint.vue

@@ -30,7 +30,7 @@
 </template>
 
 <script>
-import { getPrintList, pdfPrint } from '@/libs/JGPrint'
+import { getPrintList, pdfPrint, hasExitTaskByName } from '@/libs/JGPrint'
 export default {
   name: 'CommonModal',
   props: {
@@ -74,12 +74,15 @@ export default {
   methods: {
     // 确定
     handleCommonOk () {
+      const pdfList = this.$store.state.app.pdfPrintList
       if (this.printIndex >= 0) {
         // 关闭弹框
         this.$store.commit('SET_showSelectPrint', false)
         this.$emit('cancel')
-        // 继续打印
-        pdfPrint(this.$store.state.app.pdfPrintList, 0)
+        hasExitTaskByName(function () {
+          // 继续打印
+          pdfPrint(pdfList, 0)
+        })
       } else {
         this.$message.info('请选择打印机')
       }
@@ -97,6 +100,7 @@ export default {
     },
     changePrint (v) {
       this.$store.state.app.defaultPrint = v
+      this.$store.state.app.printTaskID = undefined
       this.printIndex = v
     }
   },