Blame view

src/components/fee/payFeeOrderResult.vue 2.94 KB
1a0bdbe0   wuxw   优化缴费页面
1
  <template>
c036402c   wuxw   优化缴费页面
2
3
    <el-dialog :title="$t('payFeeOrderResult.title')" :visible.sync="dialogVisible" width="40%" @close="handleClose"
      :close-on-click-modal="false">
1a0bdbe0   wuxw   优化缴费页面
4
5
6
7
8
9
10
      <div class="result-content">
        <p>{{ $t('payFeeOrderResult.success') }}</p>
        <p v-if="!receiptId">{{ $t('payFeeOrderResult.receiptTip') }}</p>
      </div>
  
      <div slot="footer" class="dialog-footer">
        <el-button @click="back">{{ $t('payFeeOrderResult.back') }}</el-button>
c036402c   wuxw   优化缴费页面
11
        <el-button v-if="receiptId" type="primary" @click="printSmallAndBack">
1a0bdbe0   wuxw   优化缴费页面
12
13
          {{ $t('payFeeOrderResult.printSmall') }}
        </el-button>
c036402c   wuxw   优化缴费页面
14
        <el-button v-if="receiptId" type="primary" @click="printAndBack('ON')">
1a0bdbe0   wuxw   优化缴费页面
15
16
          {{ $t('payFeeOrderResult.mergePrint') }}
        </el-button>
c036402c   wuxw   优化缴费页面
17
        <el-button v-if="receiptId" type="primary" @click="printAndBack('OFF')">
1a0bdbe0   wuxw   优化缴费页面
18
19
20
21
22
23
24
25
          {{ $t('payFeeOrderResult.printReceipt') }}
        </el-button>
      </div>
    </el-dialog>
  </template>
  
  <script>
  import { getCommunityId } from '@/api/community/communityApi'
c036402c   wuxw   优化缴费页面
26
  import { listFeePrintPages, queryFeeReceipt } from '@/api/fee/payFeeOrderApi'
1a0bdbe0   wuxw   优化缴费页面
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
  
  export default {
    name: 'PayFeeOrderResult',
    data() {
      return {
        dialogVisible: false,
        receiptId: '',
        printUrl: '/print.html#/pages/property/printPayFee'
      }
    },
    created() {
      this.listFeePrintPages()
    },
    methods: {
      open(params) {
        if (!params) {
          this.dialogVisible = true
          return
        }
        this.queryPayFeeReceiptId(params)
      },
      close() {
        this.dialogVisible = false
      },
      async queryPayFeeReceiptId(params) {
        try {
          const communityId = await getCommunityId()
c036402c   wuxw   优化缴费页面
54
55
56
57
58
          const response = await queryFeeReceipt({
            detailIds: params.detailId,
            communityId,
            page: 1,
            row: 1
1a0bdbe0   wuxw   优化缴费页面
59
          })
c036402c   wuxw   优化缴费页面
60
61
62
  
          if (response.code === 0 && response.data && response.data.length > 0) {
            this.receiptId = response.data[0].receiptId
1a0bdbe0   wuxw   优化缴费页面
63
64
65
66
67
68
69
70
          }
          this.dialogVisible = true
        } catch (error) {
          console.error('查询收据ID失败:', error)
        }
      },
      async listFeePrintPages() {
        try {
dd2c2983   wuxw   优化缴费页面
71
72
          const communityId = getCommunityId()
          const response = await listFeePrintPages({
c036402c   wuxw   优化缴费页面
73
74
75
76
            page: 1,
            row: 1,
            state: 'T',
            communityId
1a0bdbe0   wuxw   优化缴费页面
77
          })
c036402c   wuxw   优化缴费页面
78
  
dd2c2983   wuxw   优化缴费页面
79
80
          if (response.data && response.data.length > 0) {
            this.printUrl = response.data[0].url
1a0bdbe0   wuxw   优化缴费页面
81
82
83
84
85
86
87
88
89
90
91
92
93
          }
        } catch (error) {
          console.error('获取打印页面失败:', error)
        }
      },
      printAndBack(merge) {
        window.open(`${this.printUrl}?receiptId=${this.receiptId}&merge=${merge}`)
      },
      printSmallAndBack() {
        window.open(`/smallPrint.html#/pages/property/printSmallPayFee?receiptId=${this.receiptId}`)
      },
      back() {
        this.close()
c036402c   wuxw   优化缴费页面
94
        this.$router.go(-1)
1a0bdbe0   wuxw   优化缴费页面
95
96
97
98
99
100
101
102
103
104
105
106
107
      },
      handleClose() {
        this.receiptId = ''
      }
    }
  }
  </script>
  
  <style scoped>
  .result-content {
    text-align: center;
    padding: 20px;
  }
c036402c   wuxw   优化缴费页面
108
  
1a0bdbe0   wuxw   优化缴费页面
109
110
111
112
  .dialog-footer {
    text-align: center;
  }
  </style>