Blame view

src/views/fee/printPayFeeBangTaiList.vue 9.62 KB
b25b036d   wuxw   v1.9 优化日期
1
  <template>
f99ceb4f   wuxw   收据优化完成
2
    <div class="print-pay-fee-container">
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
      <div class="text-center">
        <div style="color:#000;font-size:36px">
          {{ printPayFeeInfo.communityName }}
          <span v-if="printPayFeeInfo.apply === 'Y'">{{ $t('printPayFeeBangTai.applyForm') }}</span>
          <span v-if="printPayFeeInfo.apply === 'N'">{{ $t('printPayFeeBangTai.receiptForm') }}</span>
        </div>
        <span style="color:#000;font-size:20px">
          {{ $t('printPayFeeBangTai.receiptNum') }}:{{ printPayFeeInfo.receiptNum }}
        </span>
      </div>
      <div style="color:#000;font-size:20px;margin-left:20px">
        <div class="float-left">
          <span>{{ $t('printPayFeeBangTai.owner') }}</span>:{{ printPayFeeInfo.payObjName }}
        </div>
        <div class="float-right text-right">
          <span>{{ $t('printPayFeeBangTai.paymentTime') }}</span>:{{ printPayFeeInfo.feeTime }}
        </div>
      </div>
  
      <table class="table vc-table-border" style="color:#000;font-size:20px;width:100%;border-collapse:collapse;">
        <thead>
          <tr>
            <th class="text-center" width="80px">{{ $t('printPayFeeBangTai.serialNum') }}</th>
            <th class="text-center">{{ $t('printPayFeeBangTai.feeItem') }}</th>
            <th class="text-center">{{ $t('printPayFeeBangTai.houseCar') }}</th>
            <th class="text-center">{{ $t('printPayFeeBangTai.feeRange') }}</th>
            <th class="text-center">{{ $t('printPayFeeBangTai.cycle') }}</th>
            <th class="text-center">{{ $t('printPayFeeBangTai.unitPrice') }}</th>
            <th class="text-center">{{ $t('printPayFeeBangTai.areaUsage') }}</th>
            <th class="text-center">{{ $t('printPayFeeBangTai.paymentMethod') }}</th>
            <th class="text-center">{{ $t('printPayFeeBangTai.amount') }}</th>
            <th class="text-center">{{ $t('printPayFeeBangTai.discountAmount') }}</th>
            <th class="text-center">{{ $t('printPayFeeBangTai.remark') }}</th>
          </tr>
        </thead>
        <tbody style="color:#000;font-size:20px">
          <tr v-for="(item, index) in printPayFeeInfo.fees" :key="index">
            <th scope="row" class="text-center">{{ index + 1 }}</th>
            <td class="text-center">{{ item.feeName }}</td>
            <td class="text-center">{{ item.objName }}</td>
            <td class="text-center">
              <div v-if="item.preDegrees">
                {{ formatDate(item.startTime) }}{{ $t('printPayFeeBangTai.to') }}{{ formatDate(item.endTime) }}<br>
                {{ item.preDegrees }} {{ $t('printPayFeeBangTai.to') }} {{ item.curDegrees }}
f99ceb4f   wuxw   收据优化完成
47
              </div>
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
48
49
              <div v-else-if="item.feeTypeCd === '888800010006'">
                {{ $t('printPayFeeBangTai.none') }}
f99ceb4f   wuxw   收据优化完成
50
              </div>
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
51
52
              <div v-else>
                {{ formatDate(item.startTime) }}{{ $t('printPayFeeBangTai.to') }}{{ formatDate(item.endTime) }}
f99ceb4f   wuxw   收据优化完成
53
              </div>
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
54
55
56
57
58
59
60
61
62
63
64
65
            </td>
            <td class="text-center">{{ item.cycle }}</td>
            <td class="text-center">{{ item.squarePrice }}</td>
            <td class="text-center">{{ item.area }}</td>
            <td class="text-center">{{ item.primeRate }}</td>
            <td class="text-center">{{ item.amount }}</td>
            <td class="text-center">{{ item.discountPrice }}</td>
            <td class="text-center" width="200px">{{ item.remark }}</td>
          </tr>
          <tr>
            <td colspan="3" class="text-center">{{ $t('printPayFeeBangTai.capitalRMB') }}(元)</td>
            <td colspan="4" class="text-center">{{ changeNumMoneyToChinese(printPayFeeInfo.amount) }}</td>
63d1b6d5   wuxw   v1.9 邦泰收据 把现金两个字写...
66
            <td colspan="1" class="text-center">金额</td>
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
            <td colspan="3" class="text-center">{{ printPayFeeInfo.amount }}</td>
          </tr>
          <tr v-if="printPayFeeInfo.content || printPayFeeInfo.qrImg" height="60px">
            <td colspan="6">
              <div style="max-width: 600px;" v-html="printPayFeeInfo.content"></div>
            </td>
            <td colspan="5">
              <img v-if="printPayFeeInfo.qrImg" :src="printPayFeeInfo.qrImg" width="100px" height="100px">
            </td>
          </tr>
        </tbody>
      </table>
  
      <el-row style="color:#000;font-size:18px;margin-left: 10px;" class="flex justify-between">
        <el-col :span="6">{{ $t('printPayFeeBangTai.departmentHead') }}</el-col>
        <el-col :span="6">{{ $t('printPayFeeBangTai.handler') }}:{{ userInfo.name }}</el-col>
        <el-col :span="6">{{ $t('printPayFeeBangTai.financialCollection') }}</el-col>
        <el-col :span="6">{{ $t('printPayFeeBangTai.customerConfirmation') }}</el-col>
      </el-row>
  
      <el-row id="print-btn">
        <el-col :span="24">
          <el-button type="primary" class="float-right" @click="handlePrint">
            <i class="el-icon-printer"></i>&nbsp;{{ $t('common.print') }}
          </el-button>
          <el-button type="warning" class="float-right" style="margin-right:20px;" @click="handleClose">
            {{ $t('common.cancel') }}
          </el-button>
        </el-col>
      </el-row>
f99ceb4f   wuxw   收据优化完成
97
98
99
100
101
    </div>
  </template>
  
  <script>
  import { queryFeeReceipt, queryFeeReceiptDetail, queryFeePrintSpec } from '@/api/fee/printPayFeeBangTaiApi'
19bafb73   wuxw   v1.9 优化采购相关bug
102
  import { getCommunityId,getCommunityName } from '@/api/community/communityApi'
f99ceb4f   wuxw   收据优化完成
103
  import { getUserId,getUserName } from '@/api/user/userApi'
1a0bdbe0   wuxw   优化缴费页面
104
  import { dateFormat } from '@/utils/dateUtil'
814833f5   wuxw   优化费用缴费代码
105
  import { changeNumMoneyToChinese } from '@/utils/moneyUtil'
f99ceb4f   wuxw   收据优化完成
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
  
  export default {
    name: 'PrintPayFeeBangTaiList',
    data() {
      return {
        printPayFeeInfo: {
          communityName: '',
          receiptId: '',
          receiptIds: '',
          roomName: '',
          amount: 0.00,
          fees: [],
          feeTime: '',
          wechatName: '',
          content: '',
          qrImg: '',
          payObjName: '',
          feeReceipt: [],
          apply: 'N',
          receiptNum: '',
          merge: ''
        },
        printFlag: '0',
        userInfo: {},
        communityId: ''
      }
    },
    created() {
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
134
135
136
137
138
      this.communityId = getCommunityId()
      this.userInfo = {
        userId: getUserId(),
        name: getUserName()
      }
f99ceb4f   wuxw   收据优化完成
139
      this.initData()
f99ceb4f   wuxw   收据优化完成
140
141
142
143
144
    },
    methods: {
      initData() {
        this.printPayFeeInfo.receiptId = this.$route.query.receiptId
        this.printPayFeeInfo.receiptIds = this.$route.query.receiptIds
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
145
146
        this.printPayFeeInfo.detailIds = this.$route.query.detailIds
  
f99ceb4f   wuxw   收据优化完成
147
148
        this.printPayFeeInfo.apply = this.$route.query.apply || 'N'
        this.printPayFeeInfo.merge = this.$route.query.merge
19bafb73   wuxw   v1.9 优化采购相关bug
149
        this.printPayFeeInfo.communityName = getCommunityName()
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
150
151
152
  
        this.loadReceipt()
        this.loadPrintSpec()
f99ceb4f   wuxw   收据优化完成
153
      },
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
      loadReceipt() {
        const params = {
          page: 1,
          row: 30,
          receiptId: this.printPayFeeInfo.receiptId,
          receiptIds: this.printPayFeeInfo.receiptIds,
          detailIds: this.printPayFeeInfo.detailIds,
          communityId: this.communityId
        }
  
        queryFeeReceipt(params).then(response => {
          const feeReceipt = response.data
          let amount = 0
          feeReceipt.forEach(item => {
            amount += parseFloat(item.amount)
f99ceb4f   wuxw   收据优化完成
169
170
          })
  
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
171
172
173
174
175
176
177
178
179
          this.printPayFeeInfo.amount = amount.toFixed(2)
          this.printPayFeeInfo.roomName = feeReceipt[0].objName
          this.printPayFeeInfo.feeTime = feeReceipt[0].createTime
          this.printPayFeeInfo.payObjName = feeReceipt[0].payObjName
          this.printPayFeeInfo.feeReceipt = feeReceipt
          this.printPayFeeInfo.receiptNum = feeReceipt[0].receiptCode
  
          this.loadReceiptDetail()
        })
f99ceb4f   wuxw   收据优化完成
180
      },
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
      loadReceiptDetail() {
        const params = {
          page: 1,
          row: 100,
          receiptId: this.printPayFeeInfo.receiptId,
          receiptIds: this.printPayFeeInfo.receiptIds,
          detailIds: this.printPayFeeInfo.detailIds,
  
          communityId: this.communityId,
          mergeFee: this.printPayFeeInfo.merge
        }
  
        queryFeeReceiptDetail(params).then(response => {
          const feeReceiptDetails = response.data
          this.printPayFeeInfo.receiptNum = this.printPayFeeInfo.receiptNum + "(" + feeReceiptDetails[0].payOrderId + ")"
          feeReceiptDetails.forEach(item => {
f99ceb4f   wuxw   收据优化完成
197
198
199
200
201
202
203
            this.printPayFeeInfo.feeReceipt.forEach(im => {
              if (item.receiptId == im.receiptId) {
                item.objName = im.objName
                item.feeTypeCd = im.feeTypeCd
              }
            })
          })
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
204
205
          this.printPayFeeInfo.fees = feeReceiptDetails
        })
f99ceb4f   wuxw   收据优化完成
206
      },
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
207
208
209
210
211
212
213
214
215
216
      loadPrintSpec() {
        const params = {
          page: 1,
          row: 1,
          specCd: 2020,
          communityId: this.communityId
        }
  
        queryFeePrintSpec(params).then(response => {
          const data = response.data
f99ceb4f   wuxw   收据优化完成
217
218
219
220
221
222
223
          if (data.length > 0) {
            this.printPayFeeInfo.content = data[0].content
            this.printPayFeeInfo.qrImg = data[0].qrImg
            if (data[0].printName) {
              this.printPayFeeInfo.communityName = data[0].printName
            }
          }
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
224
        })
f99ceb4f   wuxw   收据优化完成
225
226
      },
      computeSumArea() {
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
227
        let sum = 0.00
f99ceb4f   wuxw   收据优化完成
228
229
        this.printPayFeeInfo.fees.forEach(item => {
          if (item.area && this.isNumber(item.area)) {
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
230
            sum += parseFloat(item.area)
f99ceb4f   wuxw   收据优化完成
231
232
          }
        })
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
233
        return sum.toFixed(2)
f99ceb4f   wuxw   收据优化完成
234
235
236
237
238
239
      },
      isNumber(value) {
        return !isNaN(parseFloat(value)) && isFinite(value)
      },
      formatDate(date) {
        if (!date) return ''
1a0bdbe0   wuxw   优化缴费页面
240
        return dateFormat(date)
f99ceb4f   wuxw   收据优化完成
241
      },
814833f5   wuxw   优化费用缴费代码
242
      changeNumMoneyToChinese,
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
243
      handlePrint() {
f99ceb4f   wuxw   收据优化完成
244
245
246
        this.printFlag = '1'
        document.getElementById("print-btn").style.display = "none"
        window.print()
f99ceb4f   wuxw   收据优化完成
247
248
        window.close()
      },
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
249
      handleClose() {
f99ceb4f   wuxw   收据优化完成
250
251
252
253
254
255
256
257
258
259
260
        window.close()
      }
    }
  }
  </script>
  
  <style scoped>
  .print-pay-fee-container {
    padding: 20px;
  }
  
f99ceb4f   wuxw   收据优化完成
261
262
263
264
265
266
267
268
  .float-left {
    float: left;
  }
  
  .float-right {
    float: right;
  }
  
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
269
270
271
272
273
274
  .text-center {
    text-align: center;
  }
  
  .text-right {
    text-align: right;
f99ceb4f   wuxw   收据优化完成
275
276
277
278
279
280
281
282
  }
  
  .vc-table-border th,
  .vc-table-border td {
    border: 1px solid #000;
    padding: 5px;
  }
  
0f7e0a51   wuxw   v1.9 优化客户反馈 欠费缴费选择问题
283
284
285
286
287
288
289
  .el-row {
    width: 100%;
    margin-bottom: 20px;
  }
  
  .el-col {
    width: 100%;
f99ceb4f   wuxw   收据优化完成
290
291
  }
  </style>