Commit f0032091d606278be29fdd35ab996978e4adb8b4
1 parent
4a60bc89
完成费用项页面
Showing
8 changed files
with
603 additions
and
1 deletions
src/api/fee/payFeeConfigDiscountManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 3 | + | |
| 4 | +// 查询费用折扣列表 | |
| 5 | +export function getPayFeeConfigDiscountList(params) { | |
| 6 | + return new Promise((resolve, reject) => { | |
| 7 | + const communityId = getCommunityId() | |
| 8 | + request({ | |
| 9 | + url: '/payFeeConfigDiscount/queryPayFeeConfigDiscount', | |
| 10 | + method: 'get', | |
| 11 | + params: { ...params, communityId } | |
| 12 | + }).then(response => { | |
| 13 | + const res = response.data | |
| 14 | + if (res.code === 0) { | |
| 15 | + resolve({ | |
| 16 | + data: res.data, | |
| 17 | + total: res.total | |
| 18 | + }) | |
| 19 | + } else { | |
| 20 | + reject(new Error(res.msg || '获取费用折扣列表失败')) | |
| 21 | + } | |
| 22 | + }).catch(error => { | |
| 23 | + reject(error) | |
| 24 | + }) | |
| 25 | + }) | |
| 26 | +} | |
| 27 | + | |
| 28 | +// 查询折扣列表 | |
| 29 | +export function getFeeDiscountList(params) { | |
| 30 | + return new Promise((resolve, reject) => { | |
| 31 | + const communityId = getCommunityId() | |
| 32 | + request({ | |
| 33 | + url: '/feeDiscount/queryFeeDiscount', | |
| 34 | + method: 'get', | |
| 35 | + params: { ...params, communityId } | |
| 36 | + }).then(response => { | |
| 37 | + const res = response.data | |
| 38 | + if (res.code === 0) { | |
| 39 | + resolve({ | |
| 40 | + data: res.data, | |
| 41 | + total: res.total | |
| 42 | + }) | |
| 43 | + } else { | |
| 44 | + reject(new Error(res.msg || '获取折扣列表失败')) | |
| 45 | + } | |
| 46 | + }).catch(error => { | |
| 47 | + reject(error) | |
| 48 | + }) | |
| 49 | + }) | |
| 50 | +} | |
| 51 | + | |
| 52 | +// 保存费用折扣 | |
| 53 | +export function savePayFeeConfigDiscount(data) { | |
| 54 | + return new Promise((resolve, reject) => { | |
| 55 | + data.communityId = getCommunityId() | |
| 56 | + request({ | |
| 57 | + url: '/payFeeConfigDiscount/savePayFeeConfigDiscount', | |
| 58 | + method: 'post', | |
| 59 | + data | |
| 60 | + }).then(response => { | |
| 61 | + const res = response.data | |
| 62 | + if (res.code === 0) { | |
| 63 | + resolve(res) | |
| 64 | + } else { | |
| 65 | + reject(new Error(res.msg || '保存费用折扣失败')) | |
| 66 | + } | |
| 67 | + }).catch(error => { | |
| 68 | + reject(error) | |
| 69 | + }) | |
| 70 | + }) | |
| 71 | +} | |
| 72 | + | |
| 73 | +// 删除费用折扣 | |
| 74 | +export function deletePayFeeConfigDiscount(data) { | |
| 75 | + return new Promise((resolve, reject) => { | |
| 76 | + data.communityId = getCommunityId() | |
| 77 | + request({ | |
| 78 | + url: '/payFeeConfigDiscount/deletePayFeeConfigDiscount', | |
| 79 | + method: 'post', | |
| 80 | + data | |
| 81 | + }).then(response => { | |
| 82 | + const res = response.data | |
| 83 | + if (res.code === 0) { | |
| 84 | + resolve(res) | |
| 85 | + } else { | |
| 86 | + reject(new Error(res.msg || '删除费用折扣失败')) | |
| 87 | + } | |
| 88 | + }).catch(error => { | |
| 89 | + reject(error) | |
| 90 | + }) | |
| 91 | + }) | |
| 92 | +} | |
| 0 | 93 | \ No newline at end of file | ... | ... |
src/components/fee/addPayFeeConfigDiscount.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog | |
| 3 | + :title="$t('addPayFeeConfigDiscount.addTitle')" | |
| 4 | + :visible.sync="visible" | |
| 5 | + width="800px" | |
| 6 | + :close-on-click-modal="false" | |
| 7 | + @closed="resetForm" | |
| 8 | + > | |
| 9 | + <el-form ref="form" :model="form" :rules="rules" label-width="160px"> | |
| 10 | + <el-form-item :label="$t('addPayFeeConfigDiscount.discountType')" prop="discountType"> | |
| 11 | + <el-select | |
| 12 | + v-model="form.discountType" | |
| 13 | + :placeholder="$t('addPayFeeConfigDiscount.requiredPlaceholder')" | |
| 14 | + @change="changeDiscountType" | |
| 15 | + style="width: 100%" | |
| 16 | + > | |
| 17 | + <el-option disabled value="">{{ $t('addPayFeeConfigDiscount.selectDiscountType') }}</el-option> | |
| 18 | + <el-option value="1001">{{ $t('addPayFeeConfigDiscount.discount') }}</el-option> | |
| 19 | + <el-option value="2002">{{ $t('addPayFeeConfigDiscount.penalty') }}</el-option> | |
| 20 | + </el-select> | |
| 21 | + </el-form-item> | |
| 22 | + | |
| 23 | + <el-form-item :label="$t('addPayFeeConfigDiscount.discountName')" prop="discountId"> | |
| 24 | + <el-select | |
| 25 | + v-model="form.discountId" | |
| 26 | + :placeholder="$t('addPayFeeConfigDiscount.requiredPlaceholder')" | |
| 27 | + style="width: 100%" | |
| 28 | + > | |
| 29 | + <el-option disabled value="">{{ $t('addPayFeeConfigDiscount.selectDiscountName') }}</el-option> | |
| 30 | + <el-option | |
| 31 | + v-for="item in discounts" | |
| 32 | + :key="item.discountId" | |
| 33 | + :label="item.discountName" | |
| 34 | + :value="item.discountId" | |
| 35 | + /> | |
| 36 | + </el-select> | |
| 37 | + </el-form-item> | |
| 38 | + | |
| 39 | + <el-form-item :label="$t('addPayFeeConfigDiscount.paymentPeriod')" required> | |
| 40 | + <el-col :span="11"> | |
| 41 | + <el-form-item prop="startTime"> | |
| 42 | + <el-date-picker | |
| 43 | + v-model="form.startTime" | |
| 44 | + type="datetime" | |
| 45 | + :placeholder="$t('addPayFeeConfigDiscount.startTimePlaceholder')" | |
| 46 | + style="width: 100%" | |
| 47 | + /> | |
| 48 | + </el-form-item> | |
| 49 | + <div class="el-form-item__tip">{{ $t('addPayFeeConfigDiscount.paymentPeriodTip') }}</div> | |
| 50 | + </el-col> | |
| 51 | + <el-col :span="2" class="text-center">-</el-col> | |
| 52 | + <el-col :span="11"> | |
| 53 | + <el-form-item prop="endTime"> | |
| 54 | + <el-date-picker | |
| 55 | + v-model="form.endTime" | |
| 56 | + type="datetime" | |
| 57 | + :placeholder="$t('addPayFeeConfigDiscount.endTimePlaceholder')" | |
| 58 | + style="width: 100%" | |
| 59 | + /> | |
| 60 | + </el-form-item> | |
| 61 | + </el-col> | |
| 62 | + </el-form-item> | |
| 63 | + | |
| 64 | + <el-form-item | |
| 65 | + v-if="form.discountType !== '2002'" | |
| 66 | + :label="$t('addPayFeeConfigDiscount.discountEndTime')" | |
| 67 | + prop="payMaxEndTime" | |
| 68 | + > | |
| 69 | + <el-date-picker | |
| 70 | + v-model="form.payMaxEndTime" | |
| 71 | + type="datetime" | |
| 72 | + :placeholder="$t('addPayFeeConfigDiscount.discountEndTimePlaceholder')" | |
| 73 | + style="width: 100%" | |
| 74 | + /> | |
| 75 | + <div class="el-form-item__tip">{{ $t('addPayFeeConfigDiscount.discountEndTimeTip') }}</div> | |
| 76 | + </el-form-item> | |
| 77 | + </el-form> | |
| 78 | + | |
| 79 | + <div slot="footer"> | |
| 80 | + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | |
| 81 | + <el-button type="primary" @click="savePayFeeConfigDiscount" :loading="loading"> | |
| 82 | + {{ $t('common.save') }} | |
| 83 | + </el-button> | |
| 84 | + </div> | |
| 85 | + </el-dialog> | |
| 86 | +</template> | |
| 87 | + | |
| 88 | +<script> | |
| 89 | +import { savePayFeeConfigDiscount, getFeeDiscountList } from '@/api/fee/payFeeConfigDiscountManageApi' | |
| 90 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 91 | + | |
| 92 | +export default { | |
| 93 | + name: 'AddPayFeeConfigDiscount', | |
| 94 | + data() { | |
| 95 | + return { | |
| 96 | + visible: false, | |
| 97 | + loading: false, | |
| 98 | + form: { | |
| 99 | + configDiscountId: '', | |
| 100 | + discountId: '', | |
| 101 | + configId: '', | |
| 102 | + discountType: '', | |
| 103 | + startTime: '', | |
| 104 | + endTime: '', | |
| 105 | + payMaxEndTime: '', | |
| 106 | + communityId: '' | |
| 107 | + }, | |
| 108 | + discounts: [], | |
| 109 | + rules: { | |
| 110 | + discountType: [ | |
| 111 | + { required: true, message: this.$t('addPayFeeConfigDiscount.discountTypeRequired'), trigger: 'change' } | |
| 112 | + ], | |
| 113 | + discountId: [ | |
| 114 | + { required: true, message: this.$t('addPayFeeConfigDiscount.discountNameRequired'), trigger: 'change' } | |
| 115 | + ], | |
| 116 | + startTime: [ | |
| 117 | + { required: true, message: this.$t('addPayFeeConfigDiscount.startTimeRequired'), trigger: 'change' } | |
| 118 | + ], | |
| 119 | + endTime: [ | |
| 120 | + { required: true, message: this.$t('addPayFeeConfigDiscount.endTimeRequired'), trigger: 'change' } | |
| 121 | + ] | |
| 122 | + } | |
| 123 | + } | |
| 124 | + }, | |
| 125 | + methods: { | |
| 126 | + open(configId) { | |
| 127 | + this.form.configId = configId | |
| 128 | + this.form.communityId = getCommunityId() | |
| 129 | + this.visible = true | |
| 130 | + }, | |
| 131 | + resetForm() { | |
| 132 | + this.$refs.form.resetFields() | |
| 133 | + this.form = { | |
| 134 | + configDiscountId: '', | |
| 135 | + discountId: '', | |
| 136 | + configId: this.form.configId, | |
| 137 | + discountType: '', | |
| 138 | + startTime: '', | |
| 139 | + endTime: '', | |
| 140 | + payMaxEndTime: '', | |
| 141 | + communityId: this.form.communityId | |
| 142 | + } | |
| 143 | + this.discounts = [] | |
| 144 | + }, | |
| 145 | + async changeDiscountType() { | |
| 146 | + if (!this.form.discountType) return | |
| 147 | + | |
| 148 | + try { | |
| 149 | + const params = { | |
| 150 | + page: 1, | |
| 151 | + row: 100, | |
| 152 | + communityId: this.form.communityId, | |
| 153 | + discountType: this.form.discountType | |
| 154 | + } | |
| 155 | + const response = await getFeeDiscountList(params) | |
| 156 | + this.discounts = response.data | |
| 157 | + } catch (error) { | |
| 158 | + this.$message.error(this.$t('addPayFeeConfigDiscount.fetchDiscountsError')) | |
| 159 | + } | |
| 160 | + }, | |
| 161 | + async savePayFeeConfigDiscount() { | |
| 162 | + this.$refs.form.validate(async valid => { | |
| 163 | + if (!valid) return | |
| 164 | + | |
| 165 | + try { | |
| 166 | + this.loading = true | |
| 167 | + await savePayFeeConfigDiscount(this.form) | |
| 168 | + this.$message.success(this.$t('addPayFeeConfigDiscount.saveSuccess')) | |
| 169 | + this.visible = false | |
| 170 | + this.$emit('success') | |
| 171 | + } catch (error) { | |
| 172 | + this.$message.error(error.message || this.$t('addPayFeeConfigDiscount.saveError')) | |
| 173 | + } finally { | |
| 174 | + this.loading = false | |
| 175 | + } | |
| 176 | + }) | |
| 177 | + } | |
| 178 | + } | |
| 179 | +} | |
| 180 | +</script> | |
| 181 | + | |
| 182 | +<style lang="scss" scoped> | |
| 183 | +.text-center { | |
| 184 | + text-align: center; | |
| 185 | +} | |
| 186 | +.el-form-item__tip { | |
| 187 | + text-align: left; | |
| 188 | + color: #999; | |
| 189 | +} | |
| 190 | +</style> | |
| 0 | 191 | \ No newline at end of file | ... | ... |
src/components/fee/deletePayFeeConfigDiscount.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog | |
| 3 | + :title="$t('deletePayFeeConfigDiscount.title')" | |
| 4 | + :visible.sync="visible" | |
| 5 | + width="500px" | |
| 6 | + :close-on-click-modal="false" | |
| 7 | + > | |
| 8 | + <div class="text-center"> | |
| 9 | + <p>{{ $t('deletePayFeeConfigDiscount.confirmText') }}</p> | |
| 10 | + </div> | |
| 11 | + | |
| 12 | + <div slot="footer"> | |
| 13 | + <el-button @click="visible = false">{{ $t('deletePayFeeConfigDiscount.cancel') }}</el-button> | |
| 14 | + <el-button type="primary" @click="deletePayFeeConfigDiscount" :loading="loading"> | |
| 15 | + {{ $t('common.confirm') }} | |
| 16 | + </el-button> | |
| 17 | + </div> | |
| 18 | + </el-dialog> | |
| 19 | +</template> | |
| 20 | + | |
| 21 | +<script> | |
| 22 | +import { deletePayFeeConfigDiscount } from '@/api/fee/payFeeConfigDiscountManageApi' | |
| 23 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 24 | + | |
| 25 | +export default { | |
| 26 | + name: 'DeletePayFeeConfigDiscount', | |
| 27 | + data() { | |
| 28 | + return { | |
| 29 | + visible: false, | |
| 30 | + loading: false, | |
| 31 | + configDiscount: {} | |
| 32 | + } | |
| 33 | + }, | |
| 34 | + methods: { | |
| 35 | + open(configDiscount) { | |
| 36 | + this.configDiscount = { ...configDiscount } | |
| 37 | + this.configDiscount.communityId = getCommunityId() | |
| 38 | + this.visible = true | |
| 39 | + }, | |
| 40 | + async deletePayFeeConfigDiscount() { | |
| 41 | + try { | |
| 42 | + this.loading = true | |
| 43 | + await deletePayFeeConfigDiscount(this.configDiscount) | |
| 44 | + this.$message.success(this.$t('deletePayFeeConfigDiscount.deleteSuccess')) | |
| 45 | + this.visible = false | |
| 46 | + this.$emit('success') | |
| 47 | + } catch (error) { | |
| 48 | + this.$message.error(error.message || this.$t('deletePayFeeConfigDiscount.deleteError')) | |
| 49 | + } finally { | |
| 50 | + this.loading = false | |
| 51 | + } | |
| 52 | + } | |
| 53 | + } | |
| 54 | +} | |
| 55 | +</script> | |
| 0 | 56 | \ No newline at end of file | ... | ... |
src/i18n/index.js
| ... | ... | @@ -121,6 +121,8 @@ import { messages as communityPaymentMessages } from '../views/fee/communityPaym |
| 121 | 121 | import { messages as enterCommunityMessages } from '../views/community/enterCommunityLang' |
| 122 | 122 | import { messages as roomRenovationManageMessages } from '../views/community/roomRenovationManageLang' |
| 123 | 123 | import { messages as feeConfigManageMessages } from '../views/fee/feeConfigManageLang' |
| 124 | +import { messages as payFeeConfigDiscountManageMessages } from '../views/fee/payFeeConfigDiscountManageLang' | |
| 125 | + | |
| 124 | 126 | |
| 125 | 127 | Vue.use(VueI18n) |
| 126 | 128 | |
| ... | ... | @@ -246,6 +248,7 @@ const messages = { |
| 246 | 248 | ...enterCommunityMessages.en, |
| 247 | 249 | ...roomRenovationManageMessages.en, |
| 248 | 250 | ...feeConfigManageMessages.en, |
| 251 | + ...payFeeConfigDiscountManageMessages.en, | |
| 249 | 252 | }, |
| 250 | 253 | zh: { |
| 251 | 254 | ...loginMessages.zh, |
| ... | ... | @@ -367,6 +370,7 @@ const messages = { |
| 367 | 370 | ...enterCommunityMessages.zh, |
| 368 | 371 | ...roomRenovationManageMessages.zh, |
| 369 | 372 | ...feeConfigManageMessages.zh, |
| 373 | + ...payFeeConfigDiscountManageMessages.zh, | |
| 370 | 374 | } |
| 371 | 375 | } |
| 372 | 376 | ... | ... |
src/router/index.js
| ... | ... | @@ -591,6 +591,11 @@ const routes = [ |
| 591 | 591 | name:'/pages/property/feeConfigManage', |
| 592 | 592 | component: () => import('@/views/fee/feeConfigManageList.vue') |
| 593 | 593 | }, |
| 594 | + { | |
| 595 | + path:'/views/fee/payFeeConfigDiscountManage', | |
| 596 | + name:'/views/fee/payFeeConfigDiscountManage', | |
| 597 | + component: () => import('@/views/fee/payFeeConfigDiscountManageList.vue') | |
| 598 | + }, | |
| 594 | 599 | // 其他子路由可以在这里添加 |
| 595 | 600 | ] |
| 596 | 601 | }, | ... | ... |
src/views/fee/feeConfigManageList.vue
| ... | ... | @@ -274,7 +274,7 @@ export default { |
| 274 | 274 | |
| 275 | 275 | _settingConfigDiscount(feeConfig) { |
| 276 | 276 | this.$router.push({ |
| 277 | - path: '/fee/payFeeConfigDiscountManage', | |
| 277 | + path: '/views/fee/payFeeConfigDiscountManage', | |
| 278 | 278 | query: { |
| 279 | 279 | configId: feeConfig.configId, |
| 280 | 280 | feeName: feeConfig.feeName | ... | ... |
src/views/fee/payFeeConfigDiscountManageLang.js
0 → 100644
| 1 | +export const messages = { | |
| 2 | + en: { | |
| 3 | + payFeeConfigDiscountManage: { | |
| 4 | + title: 'Fee Discount', | |
| 5 | + discountId: 'Discount ID', | |
| 6 | + feeName: 'Fee Item', | |
| 7 | + discountName: 'Discount Name', | |
| 8 | + rule: 'Rule', | |
| 9 | + discountType: 'Discount Type', | |
| 10 | + discount: 'Discount', | |
| 11 | + penalty: 'Penalty', | |
| 12 | + paymentPeriod: 'Payment Period', | |
| 13 | + discountEndTime: 'Discount End Time', | |
| 14 | + operation: 'Operation', | |
| 15 | + paymentPeriodTip: 'Payment Period: This constrains the payment time, which is the time when the cashier operates the payment.', | |
| 16 | + discountEndTimeTip: 'Discount End Time: This indicates the maximum payment time.', | |
| 17 | + currentYearTip1: 'If the current year fee cannot enjoy the discount, select "No Arrears Rule" in the discount settings and set the arrears duration to 0.', | |
| 18 | + currentYearTip2: 'This way, all overdue fees will not enjoy the discount, and the current year fee is considered overdue so it will not enjoy the discount.', | |
| 19 | + fetchError: 'Failed to fetch discount data' | |
| 20 | + }, | |
| 21 | + addPayFeeConfigDiscount: { | |
| 22 | + addTitle: 'Add Discount', | |
| 23 | + discountType: 'Discount Type', | |
| 24 | + requiredPlaceholder: 'Required', | |
| 25 | + selectDiscountType: 'Please select discount type', | |
| 26 | + discount: 'Discount', | |
| 27 | + penalty: 'Penalty', | |
| 28 | + discountName: 'Discount Name', | |
| 29 | + selectDiscountName: 'Please select discount name', | |
| 30 | + paymentPeriod: 'Payment Period', | |
| 31 | + startTimePlaceholder: 'Required, payment start time', | |
| 32 | + endTimePlaceholder: 'Required, payment end time', | |
| 33 | + paymentPeriodTip: 'Payment can only enjoy this discount during this period', | |
| 34 | + discountEndTime: 'Discount End Time', | |
| 35 | + discountEndTimePlaceholder: 'Optional, discount end time', | |
| 36 | + discountEndTimeTip: 'Maximum payment time, e.g., for 2024 fee discount, fill in 2025-01-01', | |
| 37 | + discountTypeRequired: 'Discount type is required', | |
| 38 | + discountNameRequired: 'Discount name is required', | |
| 39 | + startTimeRequired: 'Payment start time is required', | |
| 40 | + endTimeRequired: 'Payment end time is required', | |
| 41 | + fetchDiscountsError: 'Failed to fetch discounts', | |
| 42 | + saveSuccess: 'Discount added successfully', | |
| 43 | + saveError: 'Failed to add discount' | |
| 44 | + }, | |
| 45 | + deletePayFeeConfigDiscount: { | |
| 46 | + title: 'Confirm Operation', | |
| 47 | + confirmText: 'Are you sure to delete this fee discount?', | |
| 48 | + cancel: 'Cancel', | |
| 49 | + deleteSuccess: 'Discount deleted successfully', | |
| 50 | + deleteError: 'Failed to delete discount' | |
| 51 | + }, | |
| 52 | + }, | |
| 53 | + zh: { | |
| 54 | + payFeeConfigDiscountManage: { | |
| 55 | + title: '费用折扣', | |
| 56 | + discountId: '费用折扣ID', | |
| 57 | + feeName: '费用项名称', | |
| 58 | + discountName: '折扣名称', | |
| 59 | + rule: '规则', | |
| 60 | + discountType: '折扣类型', | |
| 61 | + discount: '优惠', | |
| 62 | + penalty: '违约', | |
| 63 | + paymentPeriod: '缴费时间段', | |
| 64 | + discountEndTime: '折扣终止时间', | |
| 65 | + operation: '操作', | |
| 66 | + paymentPeriodTip: '缴费时间段:这个约束缴费的时间,也就是前台收银员操作缴费的时间', | |
| 67 | + discountEndTimeTip: '折扣终止时间:这个表示最大缴费到什么时候', | |
| 68 | + currentYearTip1: '如果本年度费用不能享受优惠 那么在折扣设置中规则选择打折无欠费规则,并且欠费时长为0', | |
| 69 | + currentYearTip2: '这样所有欠费的费用则不享受优惠,本年度的费用属于欠费所以不享受优惠', | |
| 70 | + fetchError: '获取折扣数据失败' | |
| 71 | + }, | |
| 72 | + addPayFeeConfigDiscount: { | |
| 73 | + addTitle: '添加折扣', | |
| 74 | + discountType: '折扣类型', | |
| 75 | + requiredPlaceholder: '必填', | |
| 76 | + selectDiscountType: '请选择折扣类型', | |
| 77 | + discount: '优惠', | |
| 78 | + penalty: '违约', | |
| 79 | + discountName: '折扣名称', | |
| 80 | + selectDiscountName: '请选择折扣名称', | |
| 81 | + paymentPeriod: '缴费时间段', | |
| 82 | + startTimePlaceholder: '必填,请填写缴费起始时间', | |
| 83 | + endTimePlaceholder: '必填,请填写缴费结束时间', | |
| 84 | + paymentPeriodTip: '这段时间内缴费才能享受该优惠', | |
| 85 | + discountEndTime: '折扣终止时间', | |
| 86 | + discountEndTimePlaceholder: '可选,填写折扣终止时间', | |
| 87 | + discountEndTimeTip: '最大缴费到什么时候,比如想2024年费用优惠,那么就填写2025-01-01', | |
| 88 | + discountTypeRequired: '折扣类型不能为空', | |
| 89 | + discountNameRequired: '折扣名称不能为空', | |
| 90 | + startTimeRequired: '有效期起始时间不能为空', | |
| 91 | + endTimeRequired: '有效期终止时间不能为空', | |
| 92 | + fetchDiscountsError: '获取折扣列表失败', | |
| 93 | + saveSuccess: '添加成功', | |
| 94 | + saveError: '添加失败' | |
| 95 | + }, | |
| 96 | + deletePayFeeConfigDiscount: { | |
| 97 | + title: '确认操作', | |
| 98 | + confirmText: '确定删除费用折扣吗?', | |
| 99 | + cancel: '点错了', | |
| 100 | + deleteSuccess: '删除成功', | |
| 101 | + deleteError: '删除失败' | |
| 102 | + } | |
| 103 | + } | |
| 104 | +} | |
| 0 | 105 | \ No newline at end of file | ... | ... |
src/views/fee/payFeeConfigDiscountManageList.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-card class="pay-fee-config-discount-manage"> | |
| 3 | + <div slot="header"> | |
| 4 | + <el-row type="flex" justify="space-between" align="middle"> | |
| 5 | + <el-col :span="12" class="text-left"> | |
| 6 | + <h5>{{ $t('payFeeConfigDiscountManage.title') }}</h5> | |
| 7 | + </el-col> | |
| 8 | + <el-col :span="12" class="text-right"> | |
| 9 | + <el-button type="primary" size="small" @click="goBack"> | |
| 10 | + {{ $t('common.back') }} | |
| 11 | + </el-button> | |
| 12 | + <el-button type="primary" size="small" icon="el-icon-plus" @click="openAddModal"> | |
| 13 | + {{ $t('common.add') }} | |
| 14 | + </el-button> | |
| 15 | + </el-col> | |
| 16 | + </el-row> | |
| 17 | + </div> | |
| 18 | + | |
| 19 | + <el-table :data="payFeeConfigDiscounts" border style="width: 100%"> | |
| 20 | + <el-table-column prop="configDiscountId" :label="$t('payFeeConfigDiscountManage.discountId')" align="center" /> | |
| 21 | + <el-table-column prop="feeName" :label="$t('payFeeConfigDiscountManage.feeName')" align="center" /> | |
| 22 | + <el-table-column prop="discountName" :label="$t('payFeeConfigDiscountManage.discountName')" align="center" /> | |
| 23 | + <el-table-column :label="$t('payFeeConfigDiscountManage.rule')" align="center"> | |
| 24 | + <template slot-scope="scope"> | |
| 25 | + <div v-for="(item, index) in scope.row.feeDiscountSpecs" :key="index"> | |
| 26 | + {{ item.specName }}:{{ item.specValue }} | |
| 27 | + </div> | |
| 28 | + </template> | |
| 29 | + </el-table-column> | |
| 30 | + <el-table-column :label="$t('payFeeConfigDiscountManage.discountType')" align="center"> | |
| 31 | + <template slot-scope="scope"> | |
| 32 | + {{ scope.row.discountType === '1001' ? $t('payFeeConfigDiscountManage.discount') : $t('payFeeConfigDiscountManage.penalty') }} | |
| 33 | + </template> | |
| 34 | + </el-table-column> | |
| 35 | + <el-table-column :label="$t('payFeeConfigDiscountManage.paymentPeriod')" align="center"> | |
| 36 | + <template slot-scope="scope"> | |
| 37 | + {{ scope.row.startTime }}<br />~{{ scope.row.endTime }} | |
| 38 | + </template> | |
| 39 | + </el-table-column> | |
| 40 | + <el-table-column prop="payMaxEndTime" :label="$t('payFeeConfigDiscountManage.discountEndTime')" align="center" /> | |
| 41 | + <el-table-column :label="$t('common.operation')" align="center" width="150"> | |
| 42 | + <template slot-scope="scope"> | |
| 43 | + <el-button type="danger" size="mini" @click="openDeleteModal(scope.row)"> | |
| 44 | + {{ $t('common.delete') }} | |
| 45 | + </el-button> | |
| 46 | + </template> | |
| 47 | + </el-table-column> | |
| 48 | + </el-table> | |
| 49 | + | |
| 50 | + <el-row class="margin-top-xs"> | |
| 51 | + <el-col :span="21" class="text-left"> | |
| 52 | + <div>{{ $t('payFeeConfigDiscountManage.paymentPeriodTip') }}</div> | |
| 53 | + <div>{{ $t('payFeeConfigDiscountManage.discountEndTimeTip') }}</div> | |
| 54 | + <div>{{ $t('payFeeConfigDiscountManage.currentYearTip1') }}</div> | |
| 55 | + <div>{{ $t('payFeeConfigDiscountManage.currentYearTip2') }}</div> | |
| 56 | + </el-col> | |
| 57 | + <el-col :span="3" class="text-right"> | |
| 58 | + <el-pagination | |
| 59 | + :current-page.sync="page.current" | |
| 60 | + :page-sizes="[10, 20, 30, 50]" | |
| 61 | + :page-size="page.size" | |
| 62 | + :total="page.total" | |
| 63 | + layout="total, prev, pager, next" | |
| 64 | + @size-change="handleSizeChange" | |
| 65 | + @current-change="handleCurrentChange" | |
| 66 | + /> | |
| 67 | + </el-col> | |
| 68 | + </el-row> | |
| 69 | + | |
| 70 | + <add-pay-fee-config-discount ref="addModal" @success="fetchData" /> | |
| 71 | + <delete-pay-fee-config-discount ref="deleteModal" @success="fetchData" /> | |
| 72 | + </el-card> | |
| 73 | +</template> | |
| 74 | + | |
| 75 | +<script> | |
| 76 | +import { getPayFeeConfigDiscountList } from '@/api/fee/payFeeConfigDiscountManageApi' | |
| 77 | +import AddPayFeeConfigDiscount from '@/components/fee/addPayFeeConfigDiscount' | |
| 78 | +import DeletePayFeeConfigDiscount from '@/components/fee/deletePayFeeConfigDiscount' | |
| 79 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 80 | + | |
| 81 | +export default { | |
| 82 | + name: 'PayFeeConfigDiscountManageList', | |
| 83 | + components: { | |
| 84 | + AddPayFeeConfigDiscount, | |
| 85 | + DeletePayFeeConfigDiscount | |
| 86 | + }, | |
| 87 | + data() { | |
| 88 | + return { | |
| 89 | + payFeeConfigDiscounts: [], | |
| 90 | + page: { | |
| 91 | + current: 1, | |
| 92 | + size: 10, | |
| 93 | + total: 0 | |
| 94 | + }, | |
| 95 | + configId: '', | |
| 96 | + feeName: '', | |
| 97 | + communityId: '' | |
| 98 | + } | |
| 99 | + }, | |
| 100 | + created() { | |
| 101 | + this.communityId = getCommunityId() | |
| 102 | + this.configId = this.$route.query.configId | |
| 103 | + this.feeName = this.$route.query.feeName | |
| 104 | + this.fetchData() | |
| 105 | + }, | |
| 106 | + methods: { | |
| 107 | + async fetchData() { | |
| 108 | + try { | |
| 109 | + const params = { | |
| 110 | + page: this.page.current, | |
| 111 | + row: this.page.size, | |
| 112 | + configId: this.configId, | |
| 113 | + communityId: this.communityId | |
| 114 | + } | |
| 115 | + const response = await getPayFeeConfigDiscountList(params) | |
| 116 | + this.payFeeConfigDiscounts = response.data | |
| 117 | + this.page.total = response.total | |
| 118 | + } catch (error) { | |
| 119 | + this.$message.error(this.$t('payFeeConfigDiscountManage.fetchError')) | |
| 120 | + } | |
| 121 | + }, | |
| 122 | + handleSizeChange(size) { | |
| 123 | + this.page.size = size | |
| 124 | + this.fetchData() | |
| 125 | + }, | |
| 126 | + handleCurrentChange(current) { | |
| 127 | + this.page.current = current | |
| 128 | + this.fetchData() | |
| 129 | + }, | |
| 130 | + goBack() { | |
| 131 | + this.$router.go(-1) | |
| 132 | + }, | |
| 133 | + openAddModal() { | |
| 134 | + this.$refs.addModal.open(this.configId) | |
| 135 | + }, | |
| 136 | + openDeleteModal(row) { | |
| 137 | + this.$refs.deleteModal.open(row) | |
| 138 | + } | |
| 139 | + } | |
| 140 | +} | |
| 141 | +</script> | |
| 142 | + | |
| 143 | +<style lang="scss" scoped> | |
| 144 | +.pay-fee-config-discount-manage { | |
| 145 | + .margin-top-xs { | |
| 146 | + margin-top: 20px; | |
| 147 | + } | |
| 148 | + .text-right { | |
| 149 | + text-align: right; | |
| 150 | + } | |
| 151 | +} | |
| 152 | +</style> | |
| 0 | 153 | \ No newline at end of file | ... | ... |