zh 2 years ago
parent
commit
54b35533a2

+ 2 - 1
src/mixin/print.js

@@ -247,10 +247,11 @@ export default {
         this.clonelData = []
         return promise
       } catch (error) {
+
         // console.error('添加打印次数失败')
         this.clonelData = []
         // this.$errorMsg('添加打印次数失败' + JSON.stringify(requestParams))
-        return Promise.reject(error)
+        return Promise.reject('系统提示:单被商家取消预约,请刷新页面,重新选择打印')
       }
     },
     /**

+ 5 - 2
src/views/supply/pickup/check.vue

@@ -419,7 +419,7 @@
         <el-button type="primary" @click="submitDialogForm">确 定</el-button>
       </div>
     </el-dialog>
-    <print-preview ref="preView" :add-print="addPrint" :get-oval-dateil="getOvalDateil" :get-new-detail-print-dis-string="getNewDetailPrintDisString" @initPrint="handleInitPrint" @refreshList="handleRefreshList" />
+    <print-preview ref="preView" :add-print="addPrint" :get-oval-dateil="getOvalDateil" :get-new-detail-print-dis-string="getNewDetailPrintDisString" @refreshTableSelection="refreshTableSelection" @initPrint="handleInitPrint" @refreshList="handleRefreshList" />
 
     <!-- <PickupPrint :listItem="queryItem" v-if="isShowPrint" @backListFormDetail="backList" /> -->
   </div>
@@ -764,11 +764,13 @@ export default {
     },
     getOvalDateil() {
       this.getDateil(this.tableSelection, 'getDtailPrintDis', this.check).then(res => {
-        this.tableSelection = []
         this.$endLoading()
         this.$refs.preView.show(this.hiprintTemplate, this.outputData)
       })
     },
+    refreshTableSelection() {
+      this.tableSelection = []
+    },
     async getNewDetailPrintDisString() {
       const params = []
       const len = this.tableSelection.length
@@ -779,6 +781,7 @@ export default {
           invoiceId: this.tableSelection[i - 1].invoiceId
         })
       }
+      console.log(params, this.tableSelection)
       return await getDetailPrintDisString(params)
     },
     // 关闭弹窗

+ 9 - 3
src/views/supply/pickup/components/design/preview.vue

@@ -57,7 +57,8 @@ export default {
       hiprintTemplate: {},
       // 数据
       printData: {},
-      loading: true
+      loading: true,
+      flag:false
     }
   },
   computed: {},
@@ -89,7 +90,8 @@ export default {
     async print() {
       if (this.getNewDetailPrintDisString) {
         const { data } = await this.getNewDetailPrintDisString()
-        if (!data) {
+
+        if (!data || this.flag) {
           try {
             if (typeof this.addPrint === 'function') {
               this.addPrint('getDtailPrintDis')
@@ -101,7 +103,9 @@ export default {
                       callback: async() => {
                         this.hiprintTemplate = {}
                         setTimeout(() => {
+                          this.flag = false
                           this.hideModal()
+                          this.$emit('refreshTableSelection')
                           this.$emit('refreshList')
                         }, 1000)
                       }
@@ -120,7 +124,7 @@ export default {
           // '调用打印次数接口失败'
           }
         } else {
-          this.$confirm('已打印', '提示', {
+          this.$confirm(data, '提示', {
             showClose: false,
             confirmButtonText: '确定',
             showCancelButton: false,
@@ -128,6 +132,7 @@ export default {
             center: true
           }).then(() => {
             this.getOvalDateil()
+            this.flag = true
           })
         }
       }
@@ -141,6 +146,7 @@ export default {
         center: true
       }).then(() => {
         this.hideModal()
+        this.$emit('refreshTableSelection')
         this.$emit('refreshList')
       })
     }