Browse Source

fix: 补打问题

LaveyD 3 weeks ago
parent
commit
ab155e5aa7
1 changed files with 22 additions and 5 deletions
  1. 22 5
      src/pages/queryReport/salesQuery.vue

+ 22 - 5
src/pages/queryReport/salesQuery.vue

@@ -1548,6 +1548,7 @@ import { getSelf } from '@/api/systemSetting/account'
 import { getSystemConfigList } from '@/api/systemConfig'
 import { addUserConfig, getUserConfig } from '@/api/configSetting'
 import { EventBus } from '@/utils/eventBus'
+import { cloneDeep } from 'lodash'
 
 const COLUMN_SCHEMA = [
   { key: 'orderCategory', label: '订单类型', group: '订单', column: 'extra', apiKey: 'orderCategory' },
@@ -2102,13 +2103,20 @@ export default {
         type: 'warning'
       }).then(() => {
         reprintTicket(this.secondPrintInfo).then(res => {
-          if (res.code === '999999') {
+          if (res.code === '200') {
+            if (this.currentOrder) {
+              const order = cloneDeep(this.currentOrder)
+              order.ticketList = order.ticketList.filter(v => this.secondPrintInfo.ticketIdList.includes(v.id))
+              console.log('print currentOrder tickets', this.secondPrintInfo.ticketIdList)
+              this.$print(order)
+            }
+
+            this.$message.success('操作成功')
+            this.secondPrintDialogVisible = false
+            this.getOrderList()
+          } else {
             this.$message.warning(res.msg || '操作失败')
-            return
           }
-          this.$message.success('操作成功')
-          this.secondPrintDialogVisible = false
-          this.getOrderList()
         })
       })
     },
@@ -2183,6 +2191,15 @@ export default {
         printTickets(ticketIdList).then(res => {
           if (res.code === '200') {
             this.$message.success('操作成功')
+
+            if (this.currentOrder) {
+              const order = cloneDeep(this.currentOrder)
+              order.ticketList = order.ticketList.filter(v => ticketIdList.includes(v.id))
+              console.log('print currentOrder tickets', ticketIdList)
+              this.$print(order)
+            }
+          } else {
+            this.$message.warning(res.msg || '操作失败')
           }
         })
       })