Przeglądaj źródła

fix:异常增加提示框

zh 2 lat temu
rodzic
commit
cfd66dbd0d

+ 4 - 5
src/mixin/print.js

@@ -214,7 +214,7 @@ export default {
       return date.slice(0, 10)
     },
     // 添加次数
-   async addPrint(funcType = 'getDeliverDetail') {
+    async addPrint(funcType = 'getDeliverDetail') {
       let ids = []
       for (let i = this.clonelData.length; i > 0; i--) {
         const tempData = this.clonelData[i - 1].invoicePickBeans
@@ -242,16 +242,15 @@ export default {
           funcType = addPrints
         }
 
-        const  promise = await  funcType(requestParams)
+        const promise = await funcType(requestParams)
         // 清空当前克隆数据,避免重复添加次数
         this.clonelData = []
         return promise
       } catch (error) {
-        console.log('失败');
-
+        // console.log('失败');
         // console.error('添加打印次数失败')
         this.clonelData = []
-        this.$errorMsg('添加打印次数失败' + JSON.stringify(requestParams))
+        // this.$errorMsg('添加打印次数失败' + JSON.stringify(requestParams))
         return Promise.reject()
       }
     },

+ 16 - 14
src/views/supply/apply/components/design/preview.vue

@@ -30,14 +30,14 @@ import { addPrint } from './print-data'
 import { detailArr } from './print-data'
 
 export default {
-    name: 'PrintPreview',
+  name: 'PrintPreview',
   props: {
     addPrint: {
       type: Function,
       default: null
-    },
+    }
   },
- 
+
   data() {
     return {
       visible: false,
@@ -81,7 +81,6 @@ export default {
       }, 500)
     },
     print() {
-
       try {
         if (typeof this.addPrint === 'function') {
           this.addPrint('addPrints').then(() => {
@@ -96,27 +95,30 @@ export default {
                   //   // this.$successMsg('更新成功')
                   // }, 1000)
                   setTimeout(() => {
-                    console.error('更新发货汇总列表')
+                    this.hideModal()
                     this.$emit('refreshList')
                   }, 1000)
                 }
               }
             )
-
-          }).catch(err=>{
-            this.$errorMsg('刷新重试打印')
+          }).catch(() => {
+            this.$confirm('系统提示:单被商家取消预约,请刷新页面,重新选择打印', '提示', {
+              confirmButtonText: '确定',
+              showCancelButton: false,
+              type: 'warning',
+              center: true
+            }).then(() => {
+              this.hideModal()
+              this.$emit('refreshList')
+            })
           })
         } else {
-          throw new Error('加载失败,刷新重试')
+          // throw new Error('加载失败,刷新重试')
         }
       } catch (e) {
-        this.$errorMsg(e)
+        // this.$errorMsg(e)
         // '调用打印次数接口失败'
       }
-
-      setTimeout(() => {
-        this.hideModal()
-      }, 2000)
     }
     // toPdf() {
     //   downloadPDF(this.$refs.printDom);

+ 16 - 12
src/views/supply/deliver/components/design/preview.vue

@@ -87,34 +87,38 @@ export default {
               this.printData,
               {},
               {
-                callback: async () => {
+                callback: async() => {
                   this.hiprintTemplate = {}
                   // setTimeout(() => {
                   //   console.error('更新发货汇总列表')
                   //   // this.$successMsg('更新成功')
                   // }, 1000)
                   this.$emit('refreshList')
-                    console.log(33);
+                  console.log(33)
                   setTimeout(() => {
-                    console.error('更新发货汇总列表')
-                  }, 1000)
+                    this.hideModal()
+                  }, 2000)
                 }
               }
             )
-          }).catch(err=>{
-            this.$errorMsg('刷新重试打印')
+          }).catch(() => {
+            this.$confirm('系统提示:单被商家取消预约,请刷新页面,重新选择打印', '提示', {
+              confirmButtonText: '确定',
+              showCancelButton: false,
+              type: 'warning',
+              center: true
+            }).then(() => {
+              this.hideModal()
+              this.$emit('refreshList')
+            })
           })
         } else {
-          throw new Error('加载失败,刷新重试')
+          // throw new Error('加载失败,刷新重试')
         }
       } catch (e) {
-        this.$errorMsg(e)
+        // this.$errorMsg(e)
         // '调用打印次数接口失败'
       }
-
-      setTimeout(() => {
-        this.hideModal()
-      }, 2000)
     }
     // toPdf() {
     //   downloadPDF(this.$refs.printDom);

+ 16 - 13
src/views/supply/pickup/components/design/preview.vue

@@ -30,14 +30,14 @@ import { addPrint } from './print-data'
 import { detailArr } from './print-data'
 
 export default {
-    name: 'PrintPreview',
+  name: 'PrintPreview',
   props: {
     addPrint: {
       type: Function,
       default: null
-    },
+    }
   },
- 
+
   data() {
     return {
       visible: false,
@@ -81,7 +81,6 @@ export default {
       }, 500)
     },
     print() {
-
       try {
         if (typeof this.addPrint === 'function') {
           this.addPrint('getDtailPrintDis').then(() => {
@@ -96,27 +95,31 @@ export default {
                   //   // this.$successMsg('更新成功')
                   // }, 1000)
                   setTimeout(() => {
-                    console.error('更新发货汇总列表')
+                    this.hideModal()
                     this.$emit('refreshList')
                   }, 1000)
                 }
               }
             )
-
-          }).catch(err=>{
-            this.$errorMsg('刷新重试打印')
+          }).catch(() => {
+            this.$confirm('系统提示:单被商家取消预约,请刷新页面,重新选择打印', '提示', {
+              confirmButtonText: '确定',
+              showCancelButton: false,
+              type: 'warning',
+              center: true
+            }).then(() => {
+              this.hideModal()
+              this.$emit('refreshList')
+            })
           })
         } else {
-          throw new Error('加载失败,刷新重试')
+          console.log(333)
+          // throw new Error('加载失败,刷新重试')
         }
       } catch (e) {
         this.$errorMsg(e)
         // '调用打印次数接口失败'
       }
-
-      setTimeout(() => {
-        this.hideModal()
-      }, 2000)
     }
     // toPdf() {
     //   downloadPDF(this.$refs.printDom);