Commit c036402c595419c5c420ffe72009daa991a19008
1 parent
76d4c8fc
优化缴费页面
Showing
6 changed files
with
176 additions
and
68 deletions
src/api/fee/payFeeOrderApi.js
| @@ -102,7 +102,7 @@ export function payFee(data) { | @@ -102,7 +102,7 @@ export function payFee(data) { | ||
| 102 | return new Promise((resolve, reject) => { | 102 | return new Promise((resolve, reject) => { |
| 103 | data.communityId = getCommunityId() | 103 | data.communityId = getCommunityId() |
| 104 | request({ | 104 | request({ |
| 105 | - url: '/fee/payFee', | 105 | + url: '/fee.payFee', |
| 106 | method: 'post', | 106 | method: 'post', |
| 107 | data | 107 | data |
| 108 | }).then(response => { | 108 | }).then(response => { |
src/components/fee/payFeeOrderConfirm.vue
| 1 | <template> | 1 | <template> |
| 2 | - <el-dialog :title="$t('payFeeOrderConfirm.title')" :visible.sync="dialogVisible" width="50%" @close="handleClose" | 2 | + <div> |
| 3 | + <el-dialog :title="$t('payFeeOrderConfirm.title')" :visible.sync="dialogVisible" width="40%" @close="handleClose" | ||
| 3 | :close-on-click-modal="false"> | 4 | :close-on-click-modal="false"> |
| 4 | - <el-form label-width="120px"> | 5 | + <el-form label-width="120px" class="text-left"> |
| 5 | <el-form-item :label="$t('payFeeOrderConfirm.payerObj')"> | 6 | <el-form-item :label="$t('payFeeOrderConfirm.payerObj')"> |
| 6 | <span>{{ formData.payerObjName }}</span> | 7 | <span>{{ formData.payerObjName }}</span> |
| 7 | </el-form-item> | 8 | </el-form-item> |
| @@ -82,11 +83,15 @@ | @@ -82,11 +83,15 @@ | ||
| 82 | </el-button> | 83 | </el-button> |
| 83 | </div> | 84 | </div> |
| 84 | </el-dialog> | 85 | </el-dialog> |
| 86 | + <pay-fee-order-result ref="payFeeOrderResult"></pay-fee-order-result> | ||
| 87 | + | ||
| 88 | +</div> | ||
| 85 | </template> | 89 | </template> |
| 86 | 90 | ||
| 87 | <script> | 91 | <script> |
| 88 | -import { qrCodePayment, checkPayFinish } from '@/api/fee/payFeeOrderApi' | 92 | +import { qrCodePayment, checkPayFinish ,payFee} from '@/api/fee/payFeeOrderApi' |
| 89 | import { dateFormat } from '@/utils/dateUtil' | 93 | import { dateFormat } from '@/utils/dateUtil' |
| 94 | +import PayFeeOrderResult from '@/components/fee/payFeeOrderResult' | ||
| 90 | export default { | 95 | export default { |
| 91 | name: 'PayFeeOrderConfirm', | 96 | name: 'PayFeeOrderConfirm', |
| 92 | data() { | 97 | data() { |
| @@ -99,6 +104,9 @@ export default { | @@ -99,6 +104,9 @@ export default { | ||
| 99 | } | 104 | } |
| 100 | } | 105 | } |
| 101 | }, | 106 | }, |
| 107 | + components: { | ||
| 108 | + PayFeeOrderResult | ||
| 109 | + }, | ||
| 102 | methods: { | 110 | methods: { |
| 103 | dateFormat, | 111 | dateFormat, |
| 104 | open(params) { | 112 | open(params) { |
| @@ -129,8 +137,7 @@ export default { | @@ -129,8 +137,7 @@ export default { | ||
| 129 | 137 | ||
| 130 | this.formData.subServiceCode = 'fee.payFee' | 138 | this.formData.subServiceCode = 'fee.payFee' |
| 131 | 139 | ||
| 132 | - const response = await qrCodePayment(this.formData) | ||
| 133 | - const data = response.data | 140 | + const data = await qrCodePayment(this.formData) |
| 134 | 141 | ||
| 135 | if (data.code === 404) { | 142 | if (data.code === 404) { |
| 136 | this.$message.error(data.msg) | 143 | this.$message.error(data.msg) |
| @@ -164,8 +171,8 @@ export default { | @@ -164,8 +171,8 @@ export default { | ||
| 164 | 171 | ||
| 165 | this.formData.subServiceCode = 'fee.payFee' | 172 | this.formData.subServiceCode = 'fee.payFee' |
| 166 | 173 | ||
| 167 | - const response = await checkPayFinish(this.formData) | ||
| 168 | - const data = response.data | 174 | + const data = await checkPayFinish(this.formData) |
| 175 | + | ||
| 169 | 176 | ||
| 170 | if (data.code === 404) { | 177 | if (data.code === 404) { |
| 171 | this.$message.error(data.msg) | 178 | this.$message.error(data.msg) |
| @@ -178,6 +185,7 @@ export default { | @@ -178,6 +185,7 @@ export default { | ||
| 178 | } | 185 | } |
| 179 | 186 | ||
| 180 | this.close() | 187 | this.close() |
| 188 | + this.$refs.payFeeOrderResult.open(data.data) | ||
| 181 | this.$emit('success', data.data) | 189 | this.$emit('success', data.data) |
| 182 | } catch (error) { | 190 | } catch (error) { |
| 183 | console.error('检查支付状态失败:', error) | 191 | console.error('检查支付状态失败:', error) |
| @@ -185,11 +193,11 @@ export default { | @@ -185,11 +193,11 @@ export default { | ||
| 185 | }, | 193 | }, |
| 186 | async payFee() { | 194 | async payFee() { |
| 187 | try { | 195 | try { |
| 188 | - const response = await this.$http.post('/fee.payFee', this.formData) | ||
| 189 | - const data = response.data | 196 | + const data = await payFee(this.formData) |
| 190 | 197 | ||
| 191 | if (data.code === 0) { | 198 | if (data.code === 0) { |
| 192 | this.close() | 199 | this.close() |
| 200 | + this.$refs.payFeeOrderResult.open(data.data) | ||
| 193 | this.$emit('success', data.data) | 201 | this.$emit('success', data.data) |
| 194 | } else { | 202 | } else { |
| 195 | this.$message.error(data.msg) | 203 | this.$message.error(data.msg) |
src/components/fee/payFeeOrderResult.vue
| 1 | <template> | 1 | <template> |
| 2 | - <el-dialog | ||
| 3 | - :title="$t('payFeeOrderResult.title')" | ||
| 4 | - :visible.sync="dialogVisible" | ||
| 5 | - width="40%" | ||
| 6 | - @close="handleClose" | ||
| 7 | - :close-on-click-modal="false" | ||
| 8 | - > | 2 | + <el-dialog :title="$t('payFeeOrderResult.title')" :visible.sync="dialogVisible" width="40%" @close="handleClose" |
| 3 | + :close-on-click-modal="false"> | ||
| 9 | <div class="result-content"> | 4 | <div class="result-content"> |
| 10 | <p>{{ $t('payFeeOrderResult.success') }}</p> | 5 | <p>{{ $t('payFeeOrderResult.success') }}</p> |
| 11 | <p v-if="!receiptId">{{ $t('payFeeOrderResult.receiptTip') }}</p> | 6 | <p v-if="!receiptId">{{ $t('payFeeOrderResult.receiptTip') }}</p> |
| @@ -13,25 +8,13 @@ | @@ -13,25 +8,13 @@ | ||
| 13 | 8 | ||
| 14 | <div slot="footer" class="dialog-footer"> | 9 | <div slot="footer" class="dialog-footer"> |
| 15 | <el-button @click="back">{{ $t('payFeeOrderResult.back') }}</el-button> | 10 | <el-button @click="back">{{ $t('payFeeOrderResult.back') }}</el-button> |
| 16 | - <el-button | ||
| 17 | - v-if="receiptId" | ||
| 18 | - type="primary" | ||
| 19 | - @click="printSmallAndBack" | ||
| 20 | - > | 11 | + <el-button v-if="receiptId" type="primary" @click="printSmallAndBack"> |
| 21 | {{ $t('payFeeOrderResult.printSmall') }} | 12 | {{ $t('payFeeOrderResult.printSmall') }} |
| 22 | </el-button> | 13 | </el-button> |
| 23 | - <el-button | ||
| 24 | - v-if="receiptId" | ||
| 25 | - type="primary" | ||
| 26 | - @click="printAndBack('ON')" | ||
| 27 | - > | 14 | + <el-button v-if="receiptId" type="primary" @click="printAndBack('ON')"> |
| 28 | {{ $t('payFeeOrderResult.mergePrint') }} | 15 | {{ $t('payFeeOrderResult.mergePrint') }} |
| 29 | </el-button> | 16 | </el-button> |
| 30 | - <el-button | ||
| 31 | - v-if="receiptId" | ||
| 32 | - type="primary" | ||
| 33 | - @click="printAndBack('OFF')" | ||
| 34 | - > | 17 | + <el-button v-if="receiptId" type="primary" @click="printAndBack('OFF')"> |
| 35 | {{ $t('payFeeOrderResult.printReceipt') }} | 18 | {{ $t('payFeeOrderResult.printReceipt') }} |
| 36 | </el-button> | 19 | </el-button> |
| 37 | </div> | 20 | </div> |
| @@ -40,7 +23,7 @@ | @@ -40,7 +23,7 @@ | ||
| 40 | 23 | ||
| 41 | <script> | 24 | <script> |
| 42 | import { getCommunityId } from '@/api/community/communityApi' | 25 | import { getCommunityId } from '@/api/community/communityApi' |
| 43 | -import { listFeePrintPages } from '@/api/fee/payFeeOrderApi' | 26 | +import { listFeePrintPages, queryFeeReceipt } from '@/api/fee/payFeeOrderApi' |
| 44 | 27 | ||
| 45 | export default { | 28 | export default { |
| 46 | name: 'PayFeeOrderResult', | 29 | name: 'PayFeeOrderResult', |
| @@ -68,17 +51,15 @@ export default { | @@ -68,17 +51,15 @@ export default { | ||
| 68 | async queryPayFeeReceiptId(params) { | 51 | async queryPayFeeReceiptId(params) { |
| 69 | try { | 52 | try { |
| 70 | const communityId = await getCommunityId() | 53 | const communityId = await getCommunityId() |
| 71 | - const response = await this.$http.get('/feeReceipt/queryFeeReceipt', { | ||
| 72 | - params: { | ||
| 73 | - detailIds: params.detailId, | ||
| 74 | - communityId, | ||
| 75 | - page: 1, | ||
| 76 | - row: 1 | ||
| 77 | - } | 54 | + const response = await queryFeeReceipt({ |
| 55 | + detailIds: params.detailId, | ||
| 56 | + communityId, | ||
| 57 | + page: 1, | ||
| 58 | + row: 1 | ||
| 78 | }) | 59 | }) |
| 79 | - | ||
| 80 | - if (response.data.code === 0 && response.data.data && response.data.data.length > 0) { | ||
| 81 | - this.receiptId = response.data.data[0].receiptId | 60 | + |
| 61 | + if (response.code === 0 && response.data && response.data.length > 0) { | ||
| 62 | + this.receiptId = response.data[0].receiptId | ||
| 82 | } | 63 | } |
| 83 | this.dialogVisible = true | 64 | this.dialogVisible = true |
| 84 | } catch (error) { | 65 | } catch (error) { |
| @@ -89,12 +70,12 @@ export default { | @@ -89,12 +70,12 @@ export default { | ||
| 89 | try { | 70 | try { |
| 90 | const communityId = getCommunityId() | 71 | const communityId = getCommunityId() |
| 91 | const response = await listFeePrintPages({ | 72 | const response = await listFeePrintPages({ |
| 92 | - page: 1, | ||
| 93 | - row: 1, | ||
| 94 | - state: 'T', | ||
| 95 | - communityId | 73 | + page: 1, |
| 74 | + row: 1, | ||
| 75 | + state: 'T', | ||
| 76 | + communityId | ||
| 96 | }) | 77 | }) |
| 97 | - | 78 | + |
| 98 | if (response.data && response.data.length > 0) { | 79 | if (response.data && response.data.length > 0) { |
| 99 | this.printUrl = response.data[0].url | 80 | this.printUrl = response.data[0].url |
| 100 | } | 81 | } |
| @@ -110,7 +91,7 @@ export default { | @@ -110,7 +91,7 @@ export default { | ||
| 110 | }, | 91 | }, |
| 111 | back() { | 92 | back() { |
| 112 | this.close() | 93 | this.close() |
| 113 | - this.$emit('back') | 94 | + this.$router.go(-1) |
| 114 | }, | 95 | }, |
| 115 | handleClose() { | 96 | handleClose() { |
| 116 | this.receiptId = '' | 97 | this.receiptId = '' |
| @@ -124,6 +105,7 @@ export default { | @@ -124,6 +105,7 @@ export default { | ||
| 124 | text-align: center; | 105 | text-align: center; |
| 125 | padding: 20px; | 106 | padding: 20px; |
| 126 | } | 107 | } |
| 108 | + | ||
| 127 | .dialog-footer { | 109 | .dialog-footer { |
| 128 | text-align: center; | 110 | text-align: center; |
| 129 | } | 111 | } |
src/utils/dateUtil.js
| @@ -124,3 +124,35 @@ export function addOneDay (date) { | @@ -124,3 +124,35 @@ export function addOneDay (date) { | ||
| 124 | // 返回新的日期对象 | 124 | // 返回新的日期对象 |
| 125 | return newDate; | 125 | return newDate; |
| 126 | } | 126 | } |
| 127 | + | ||
| 128 | +export function daysInMonth (year, month) { | ||
| 129 | + if (month == 1) { | ||
| 130 | + if (year % 4 == 0 && year % 100 != 0) | ||
| 131 | + return 29; | ||
| 132 | + else | ||
| 133 | + return 28; | ||
| 134 | + } else if ((month <= 6 && month % 2 == 0) || (month = 6 && month % 2 == 1)) | ||
| 135 | + return 31; | ||
| 136 | + else | ||
| 137 | + return 30; | ||
| 138 | +} | ||
| 139 | +export function addMonth (_date, _month) { | ||
| 140 | + let y = _date.getFullYear(); | ||
| 141 | + let m = _date.getMonth(); | ||
| 142 | + let nextY = y; | ||
| 143 | + let nextM = m; | ||
| 144 | + //如果当前月+要加上的月>11 这里之所以用11是因为 js的月份从0开始 | ||
| 145 | + if ((m + _month) > 11) { | ||
| 146 | + nextY = y + 1; | ||
| 147 | + nextM = parseInt(m + _month) - 12; | ||
| 148 | + } else { | ||
| 149 | + nextM = m + _month | ||
| 150 | + } | ||
| 151 | + let daysInNextMonth = daysInMonth(nextY, nextM); | ||
| 152 | + let day = _date.getDate(); | ||
| 153 | + if (day > daysInNextMonth) { | ||
| 154 | + day = daysInNextMonth; | ||
| 155 | + } | ||
| 156 | + let _newDate = new Date(nextY, nextM, day) | ||
| 157 | + return _newDate.getFullYear() + '-' + (_newDate.getMonth() + 1) + '-' + _newDate.getDate() + " " + _date.getHours() + ":" + _date.getMinutes() + ":" + _date.getSeconds(); | ||
| 158 | +} | ||
| 127 | \ No newline at end of file | 159 | \ No newline at end of file |
src/utils/vc.js
| @@ -61,3 +61,16 @@ export function deepCopy(srcObj, targetObj = {}) { | @@ -61,3 +61,16 @@ export function deepCopy(srcObj, targetObj = {}) { | ||
| 61 | export function isDate(value) { | 61 | export function isDate(value) { |
| 62 | return value instanceof Date && !isNaN(value.getTime()); | 62 | return value instanceof Date && !isNaN(value.getTime()); |
| 63 | } | 63 | } |
| 64 | + | ||
| 65 | +export function copyObject (org, dst) { | ||
| 66 | + | ||
| 67 | + if (!org || !dst) { | ||
| 68 | + return; | ||
| 69 | + } | ||
| 70 | + //for(key in Object.getOwnPropertyNames(dst)){ | ||
| 71 | + for (let key in dst) { | ||
| 72 | + if (Object.prototype.hasOwnProperty.call(org, key)) { | ||
| 73 | + dst[key] = org[key] | ||
| 74 | + } | ||
| 75 | + } | ||
| 76 | +} | ||
| 64 | \ No newline at end of file | 77 | \ No newline at end of file |
src/views/fee/payFeeOrderList.vue
| @@ -104,14 +104,14 @@ | @@ -104,14 +104,14 @@ | ||
| 104 | <el-col :span="7" style="padding-left: 30px;"> | 104 | <el-col :span="7" style="padding-left: 30px;"> |
| 105 | <el-form label-width="100px"> | 105 | <el-form label-width="100px"> |
| 106 | <el-form-item :label="$t('payFeeOrder.paymentTime')"> | 106 | <el-form-item :label="$t('payFeeOrder.paymentTime')"> |
| 107 | - <el-date-picker v-model="payFeeOrderInfo.createTime" type="datetime" | 107 | + <el-date-picker v-model="payFeeOrderInfo.createTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" |
| 108 | :placeholder="$t('payFeeOrder.paymentTimePlaceholder')" style="width: 100%;" readonly> | 108 | :placeholder="$t('payFeeOrder.paymentTimePlaceholder')" style="width: 100%;" readonly> |
| 109 | </el-date-picker> | 109 | </el-date-picker> |
| 110 | </el-form-item> | 110 | </el-form-item> |
| 111 | 111 | ||
| 112 | <el-form-item v-if="payFeeOrderInfo.feeFlag != '2006012'" :label="$t('payFeeOrder.paymentCycle')"> | 112 | <el-form-item v-if="payFeeOrderInfo.feeFlag != '2006012'" :label="$t('payFeeOrder.paymentCycle')"> |
| 113 | <el-select v-model="payFeeOrderInfo.tempCycles" :placeholder="$t('payFeeOrder.selectPaymentCycle')" | 113 | <el-select v-model="payFeeOrderInfo.tempCycles" :placeholder="$t('payFeeOrder.selectPaymentCycle')" |
| 114 | - style="width: 100%;" @change="changeMonth"> | 114 | + style="width: 100%;" @change="changeMonth(payFeeOrderInfo.tempCycles)"> |
| 115 | <el-option v-for="item in payFeeOrderInfo.paymentCycles" :key="item" | 115 | <el-option v-for="item in payFeeOrderInfo.paymentCycles" :key="item" |
| 116 | :label="item + $t('payFeeOrder.month')" :value="item"> | 116 | :label="item + $t('payFeeOrder.month')" :value="item"> |
| 117 | </el-option> | 117 | </el-option> |
| @@ -189,7 +189,6 @@ | @@ -189,7 +189,6 @@ | ||
| 189 | 189 | ||
| 190 | <pay-fee-user-account ref="payFeeUserAccount"></pay-fee-user-account> | 190 | <pay-fee-user-account ref="payFeeUserAccount"></pay-fee-user-account> |
| 191 | <pay-fee-deposit ref="payFeeDeposit"></pay-fee-deposit> | 191 | <pay-fee-deposit ref="payFeeDeposit"></pay-fee-deposit> |
| 192 | - <pay-fee-order-result ref="payFeeOrderResult"></pay-fee-order-result> | ||
| 193 | <pay-fee-order-confirm ref="payFeeOrderConfirm"></pay-fee-order-confirm> | 192 | <pay-fee-order-confirm ref="payFeeOrderConfirm"></pay-fee-order-confirm> |
| 194 | <pay-fee-discount ref="payFeeDiscount"></pay-fee-discount> | 193 | <pay-fee-discount ref="payFeeDiscount"></pay-fee-discount> |
| 195 | <pay-fee-coupon ref="payFeeCoupon"></pay-fee-coupon> | 194 | <pay-fee-coupon ref="payFeeCoupon"></pay-fee-coupon> |
| @@ -205,7 +204,7 @@ import { getDict } from '@/api/community/communityApi' | @@ -205,7 +204,7 @@ import { getDict } from '@/api/community/communityApi' | ||
| 205 | import { getCommunityId } from '@/api/community/communityApi' | 204 | import { getCommunityId } from '@/api/community/communityApi' |
| 206 | import PayFeeUserAccount from '@/components/fee/payFeeUserAccount' | 205 | import PayFeeUserAccount from '@/components/fee/payFeeUserAccount' |
| 207 | import PayFeeDeposit from '@/components/fee/payFeeDeposit' | 206 | import PayFeeDeposit from '@/components/fee/payFeeDeposit' |
| 208 | -import PayFeeOrderResult from '@/components/fee/payFeeOrderResult' | 207 | + |
| 209 | import PayFeeOrderConfirm from '@/components/fee/payFeeOrderConfirm' | 208 | import PayFeeOrderConfirm from '@/components/fee/payFeeOrderConfirm' |
| 210 | import PayFeeDiscount from '@/components/fee/payFeeDiscount' | 209 | import PayFeeDiscount from '@/components/fee/payFeeDiscount' |
| 211 | import PayFeeCoupon from '@/components/fee/payFeeCoupon' | 210 | import PayFeeCoupon from '@/components/fee/payFeeCoupon' |
| @@ -214,14 +213,14 @@ import ViewRoomData from '@/components/fee/viewRoomData' | @@ -214,14 +213,14 @@ import ViewRoomData from '@/components/fee/viewRoomData' | ||
| 214 | import ViewFeeData from '@/components/fee/viewFeeData' | 213 | import ViewFeeData from '@/components/fee/viewFeeData' |
| 215 | import ViewFeeConfigData from '@/components/fee/viewFeeConfigData' | 214 | import ViewFeeConfigData from '@/components/fee/viewFeeConfigData' |
| 216 | import { listFeeObj } from '@/api/fee/payFeeOrderApi' | 215 | import { listFeeObj } from '@/api/fee/payFeeOrderApi' |
| 217 | -import { dateAdd, dateSub } from '@/utils/dateUtil' | 216 | +import { dateAdd, dateSub, addMonth } from '@/utils/dateUtil' |
| 217 | +import { copyObject } from '@/utils/vc' | ||
| 218 | 218 | ||
| 219 | export default { | 219 | export default { |
| 220 | name: 'PayFeeOrderList', | 220 | name: 'PayFeeOrderList', |
| 221 | components: { | 221 | components: { |
| 222 | PayFeeUserAccount, | 222 | PayFeeUserAccount, |
| 223 | PayFeeDeposit, | 223 | PayFeeDeposit, |
| 224 | - PayFeeOrderResult, | ||
| 225 | PayFeeOrderConfirm, | 224 | PayFeeOrderConfirm, |
| 226 | PayFeeDiscount, | 225 | PayFeeDiscount, |
| 227 | PayFeeCoupon, | 226 | PayFeeCoupon, |
| @@ -267,7 +266,7 @@ export default { | @@ -267,7 +266,7 @@ export default { | ||
| 267 | scale: 1, | 266 | scale: 1, |
| 268 | decimalPlace: 2, | 267 | decimalPlace: 2, |
| 269 | receivedAmountSwitch: '1', | 268 | receivedAmountSwitch: '1', |
| 270 | - createTime: new Date(), | 269 | + createTime: new Date().toISOString().slice(0, 19).replace('T', ' '), |
| 271 | accountAmount: 0.0, | 270 | accountAmount: 0.0, |
| 272 | viewAccountAmount: 0.0, | 271 | viewAccountAmount: 0.0, |
| 273 | deductionAmount: 0.0, | 272 | deductionAmount: 0.0, |
| @@ -339,18 +338,86 @@ export default { | @@ -339,18 +338,86 @@ export default { | ||
| 339 | } | 338 | } |
| 340 | }, | 339 | }, |
| 341 | openPayFee(type) { | 340 | openPayFee(type) { |
| 341 | + // 周期不为空且不是自定义周期 | ||
| 342 | + if (this.payFeeOrderInfo.tempCycles != "" && this.payFeeOrderInfo.tempCycles != '-102') { | ||
| 343 | + this.payFeeOrderInfo.cycles = this.payFeeOrderInfo.tempCycles; | ||
| 344 | + } | ||
| 345 | + // 一次性费用 | ||
| 346 | + if (this.payFeeOrderInfo.feeFlag == '2006012') { | ||
| 347 | + this.payFeeOrderInfo.cycles = '1'; | ||
| 348 | + this.payFeeOrderInfo.tempCycles = '1'; | ||
| 349 | + } | ||
| 350 | + // 新增缴费周期必选项 | ||
| 351 | + if (this.payFeeOrderInfo.tempCycles == "") { | ||
| 352 | + this.$message.warning("请选择缴费周期"); | ||
| 353 | + return; | ||
| 354 | + } | ||
| 355 | + | ||
| 356 | + // 缴费周期为正整数时,显示缴费结束时间 | ||
| 357 | + if (!(/(^[1-9]\d*$)/.test(this.payFeeOrderInfo.cycles))) { | ||
| 358 | + this.payFeeOrderInfo.showEndTime = ''; | ||
| 359 | + } else { | ||
| 360 | + this.payFeeOrderInfo.showEndTime = addMonth(new Date(this.payFeeOrderInfo.endTime), parseInt(this.payFeeOrderInfo.cycles)); | ||
| 361 | + } | ||
| 362 | + if (this.payFeeOrderInfo.selectUserAccount.length > 0 && | ||
| 363 | + this.payFeeOrderInfo.accountAmount >= this.payFeeOrderInfo.receivedAmount) { | ||
| 364 | + this.payFeeOrderInfo.flag = ""; | ||
| 365 | + } | ||
| 366 | + if (this.payFeeOrderInfo.selectUserAccount.length == 1) { //现金账户 | ||
| 367 | + this.payFeeOrderInfo.integralAmount = ""; | ||
| 368 | + } else { | ||
| 369 | + this.payFeeOrderInfo.integralAmount = ""; | ||
| 370 | + this.payFeeOrderInfo.cashAmount = ""; | ||
| 371 | + } | ||
| 372 | + this.payFeeOrderInfo.selectUserAccount.forEach(item => { | ||
| 373 | + | ||
| 374 | + //现金账户 | ||
| 375 | + if (this.payFeeOrderInfo.receivedAmount && this.payFeeOrderInfo.flag != 'true' && parseFloat(item.amount) > parseFloat(this.payFeeOrderInfo.receivedAmount)) { | ||
| 376 | + this.payFeeOrderInfo.cashAmount = this.payFeeOrderInfo.receivedAmount; | ||
| 377 | + } else if (this.payFeeOrderInfo.receivedAmountNumber != null && this.payFeeOrderInfo.receivedAmountNumber != '' && parseFloat(item.amount) > parseFloat(this.payFeeOrderInfo.receivedAmountNumber)) { | ||
| 378 | + this.payFeeOrderInfo.cashAmount = this.payFeeOrderInfo.receivedAmountNumber; | ||
| 379 | + } else { | ||
| 380 | + this.payFeeOrderInfo.cashAmount = item.amount; | ||
| 381 | + } | ||
| 382 | + }); | ||
| 342 | this.$refs.payFeeOrderConfirm.open({ | 383 | this.$refs.payFeeOrderConfirm.open({ |
| 343 | ...this.payFeeOrderInfo, | 384 | ...this.payFeeOrderInfo, |
| 344 | payType: type | 385 | payType: type |
| 345 | }) | 386 | }) |
| 346 | }, | 387 | }, |
| 347 | - changeMonth(cycles) { | 388 | + changeMonth(_cycles) { |
| 348 | // 实现周期变更逻辑 | 389 | // 实现周期变更逻辑 |
| 349 | - console.log(cycles) | 390 | + this.payFeeOrderInfo.custEndTime = ''; |
| 391 | + if ('-102' == _cycles) { | ||
| 392 | + this.payFeeOrderInfo.totalFeePrice = 0.00; | ||
| 393 | + this.payFeeOrderInfo.receivedAmount = 0.00; | ||
| 394 | + if (this.payFeeOrderInfo.cycles) { | ||
| 395 | + this.listAndComputeFeeInfo(this.payFeeOrderInfo.cycles); | ||
| 396 | + } | ||
| 397 | + return; | ||
| 398 | + } else if ('-101' == _cycles) { | ||
| 399 | + this.payFeeOrderInfo.cycles = "101"; | ||
| 400 | + return; | ||
| 401 | + } else if ('-103' == _cycles) { | ||
| 402 | + this.payFeeOrderInfo.cycles = "103"; | ||
| 403 | + return; | ||
| 404 | + } else if ('-105' == _cycles) { | ||
| 405 | + this.payFeeOrderInfo.cycles = "105"; | ||
| 406 | + return; | ||
| 407 | + } | ||
| 408 | + let _newCycles = _cycles; | ||
| 409 | + if (_cycles == '') { | ||
| 410 | + _newCycles = this.payFeeOrderInfo.paymentCycles[0]; | ||
| 411 | + } | ||
| 412 | + this.listAndComputeFeeInfo(_newCycles); | ||
| 350 | }, | 413 | }, |
| 351 | - changeCycle(cycles) { | 414 | + changeCycle(_cycles) { |
| 352 | // 实现周期变更逻辑 | 415 | // 实现周期变更逻辑 |
| 353 | - console.log(cycles) | 416 | + console.log(_cycles) |
| 417 | + if (_cycles == '') { | ||
| 418 | + return; | ||
| 419 | + } | ||
| 420 | + this.listAndComputeFeeInfo(_cycles); | ||
| 354 | }, | 421 | }, |
| 355 | async listAndComputeFeeInfo(_cycles) { | 422 | async listAndComputeFeeInfo(_cycles) { |
| 356 | // 实现费用计算逻辑 | 423 | // 实现费用计算逻辑 |
| @@ -359,12 +426,12 @@ export default { | @@ -359,12 +426,12 @@ export default { | ||
| 359 | } | 426 | } |
| 360 | 427 | ||
| 361 | let param = { | 428 | let param = { |
| 362 | - communityId: getCommunityId(), | ||
| 363 | - feeId: this.payFeeOrderInfo.feeId, | ||
| 364 | - page: 1, | ||
| 365 | - row: 1, | ||
| 366 | - cycle: _cycles | ||
| 367 | - | 429 | + communityId: getCommunityId(), |
| 430 | + feeId: this.payFeeOrderInfo.feeId, | ||
| 431 | + page: 1, | ||
| 432 | + row: 1, | ||
| 433 | + cycle: _cycles | ||
| 434 | + | ||
| 368 | }; | 435 | }; |
| 369 | if (_cycles && _cycles == 103) { | 436 | if (_cycles && _cycles == 103) { |
| 370 | let _custEndTime = dateAdd(this.payFeeOrderInfo.custEndTime); | 437 | let _custEndTime = dateAdd(this.payFeeOrderInfo.custEndTime); |
| @@ -378,6 +445,10 @@ export default { | @@ -378,6 +445,10 @@ export default { | ||
| 378 | param.params.customStartTime = this.payFeeOrderInfo.customStartTime | 445 | param.params.customStartTime = this.payFeeOrderInfo.customStartTime |
| 379 | } | 446 | } |
| 380 | const listRoomData = await listFeeObj(param) | 447 | const listRoomData = await listFeeObj(param) |
| 448 | + this.payFeeOrderInfo.paymentCycles = []; | ||
| 449 | + for (let index = 1; index < 7; index++) { | ||
| 450 | + this.payFeeOrderInfo.paymentCycles.push(index * listRoomData.data.paymentCycle); | ||
| 451 | + } | ||
| 381 | console.log('listRoomData', listRoomData) | 452 | console.log('listRoomData', listRoomData) |
| 382 | //发送get请求 | 453 | //发送get请求 |
| 383 | 454 | ||
| @@ -387,7 +458,7 @@ export default { | @@ -387,7 +458,7 @@ export default { | ||
| 387 | if (Object.prototype.hasOwnProperty.call(listRoomData.data, 'customEndTime')) { | 458 | if (Object.prototype.hasOwnProperty.call(listRoomData.data, 'customEndTime')) { |
| 388 | delete listRoomData.data.customEndTime | 459 | delete listRoomData.data.customEndTime |
| 389 | } | 460 | } |
| 390 | - this.payFeeOrderInfo = { ...this.payFeeOrderInfo, ...listRoomData.data } | 461 | + copyObject(listRoomData.data, this.payFeeOrderInfo) |
| 391 | // 由于返回的键与档期那页面自定义的键不一致,单独赋值toFiexedSign | 462 | // 由于返回的键与档期那页面自定义的键不一致,单独赋值toFiexedSign |
| 392 | //vc.emit('payFeeOrder', 'initData', listRoomData.data); | 463 | //vc.emit('payFeeOrder', 'initData', listRoomData.data); |
| 393 | this.payFeeOrderInfo.totalFeePrice = listRoomData.data.feeTotalPrice; | 464 | this.payFeeOrderInfo.totalFeePrice = listRoomData.data.feeTotalPrice; |
| @@ -421,10 +492,12 @@ export default { | @@ -421,10 +492,12 @@ export default { | ||
| 421 | 492 | ||
| 422 | 493 | ||
| 423 | }, | 494 | }, |
| 495 | + | ||
| 424 | async _listFeeIntegral(_cycles) { | 496 | async _listFeeIntegral(_cycles) { |
| 425 | // 实现积分计算逻辑 | 497 | // 实现积分计算逻辑 |
| 426 | console.log(_cycles) | 498 | console.log(_cycles) |
| 427 | - } | 499 | + }, |
| 500 | + | ||
| 428 | } | 501 | } |
| 429 | } | 502 | } |
| 430 | </script> | 503 | </script> |