Commit 4a60bc89360bc882af1cfbf93943ee133c57cf26
1 parent
e4e31451
完成费用项页面
Showing
9 changed files
with
1306 additions
and
2 deletions
src/api/fee/feeConfigManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 获取费用配置列表 | |
| 4 | +export function listFeeConfigs(params) { | |
| 5 | + return new Promise((resolve, reject) => { | |
| 6 | + request({ | |
| 7 | + url: '/feeConfig.listFeeConfigs', | |
| 8 | + method: 'get', | |
| 9 | + params | |
| 10 | + }).then(response => { | |
| 11 | + const res = response.data | |
| 12 | + resolve(res) | |
| 13 | + }).catch(error => { | |
| 14 | + reject(error) | |
| 15 | + }) | |
| 16 | + }) | |
| 17 | +} | |
| 18 | + | |
| 19 | +// 添加费用配置 | |
| 20 | +export function saveFeeConfig(data) { | |
| 21 | + return new Promise((resolve, reject) => { | |
| 22 | + request({ | |
| 23 | + url: '/feeConfig.saveFeeConfig', | |
| 24 | + method: 'post', | |
| 25 | + data | |
| 26 | + }).then(response => { | |
| 27 | + const res = response.data | |
| 28 | + resolve(res) | |
| 29 | + }).catch(error => { | |
| 30 | + reject(error) | |
| 31 | + }) | |
| 32 | + }) | |
| 33 | +} | |
| 34 | + | |
| 35 | +// 更新费用配置 | |
| 36 | +export function updateFeeConfig(data) { | |
| 37 | + return new Promise((resolve, reject) => { | |
| 38 | + request({ | |
| 39 | + url: '/feeConfig.updateFeeConfig', | |
| 40 | + method: 'post', | |
| 41 | + data | |
| 42 | + }).then(response => { | |
| 43 | + const res = response.data | |
| 44 | + if (res.code === 0) { | |
| 45 | + resolve(res) | |
| 46 | + } else { | |
| 47 | + reject(new Error(res.msg || '更新费用配置失败')) | |
| 48 | + } | |
| 49 | + }).catch(error => { | |
| 50 | + reject(error) | |
| 51 | + }) | |
| 52 | + }) | |
| 53 | +} | |
| 54 | + | |
| 55 | +// 删除费用配置 | |
| 56 | +export function deleteFeeConfig(data) { | |
| 57 | + return new Promise((resolve, reject) => { | |
| 58 | + request({ | |
| 59 | + url: '/feeConfig.deleteFeeConfig', | |
| 60 | + method: 'post', | |
| 61 | + data | |
| 62 | + }).then(response => { | |
| 63 | + const res = response.data | |
| 64 | + if (res.code === 0) { | |
| 65 | + resolve(res) | |
| 66 | + } else { | |
| 67 | + reject(new Error(res.msg || '删除费用配置失败')) | |
| 68 | + } | |
| 69 | + }).catch(error => { | |
| 70 | + reject(error) | |
| 71 | + }) | |
| 72 | + }) | |
| 73 | +} | |
| 0 | 74 | \ No newline at end of file | ... | ... |
src/components/fee/addFeeConfig.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog :title="$t('common.add')" :visible.sync="visible" width="80%" @close="resetForm"> | |
| 3 | + <el-form :model="form" label-width="150px" ref="form"> | |
| 4 | + <el-row :gutter="20"> | |
| 5 | + <el-col :span="12"> | |
| 6 | + <el-form-item :label="$t('feeConfigManage.feeType')" prop="feeTypeCd" required> | |
| 7 | + <el-select | |
| 8 | + v-model="form.feeTypeCd" | |
| 9 | + @change="changeAddFeeTypeCd" | |
| 10 | + :placeholder="$t('feeConfigManage.selectFeeType')" | |
| 11 | + class="full-width-select" | |
| 12 | + > | |
| 13 | + <el-option v-for="item in feeTypeCds" :key="item.statusCd" :label="item.name" :value="item.statusCd" /> | |
| 14 | + </el-select> | |
| 15 | + </el-form-item> | |
| 16 | + </el-col> | |
| 17 | + <el-col :span="12"> | |
| 18 | + <el-form-item :label="$t('feeConfigManage.feeItem')" prop="feeName" required> | |
| 19 | + <el-input v-model="form.feeName" :placeholder="$t('feeConfigManage.enterFeeItem')" /> | |
| 20 | + </el-form-item> | |
| 21 | + </el-col> | |
| 22 | + <el-col :span="12"> | |
| 23 | + <el-form-item :label="$t('feeConfigManage.feeFlag')" prop="feeFlag" required> | |
| 24 | + <el-select | |
| 25 | + v-model="form.feeFlag" | |
| 26 | + :placeholder="$t('feeConfigManage.selectFeeFlag')" | |
| 27 | + class="full-width-select" | |
| 28 | + > | |
| 29 | + <el-option v-for="item in feeFlags" :key="item.statusCd" :label="item.name" :value="item.statusCd" /> | |
| 30 | + </el-select> | |
| 31 | + </el-form-item> | |
| 32 | + </el-col> | |
| 33 | + <el-col :span="12"> | |
| 34 | + <el-form-item :label="$t('feeConfigManage.paymentType')" prop="paymentCd" required> | |
| 35 | + <el-select | |
| 36 | + v-model="form.paymentCd" | |
| 37 | + :placeholder="$t('feeConfigManage.selectPaymentType')" | |
| 38 | + class="full-width-select" | |
| 39 | + > | |
| 40 | + <el-option v-for="item in paymentCds" :key="item.statusCd" :label="item.name" :value="item.statusCd" /> | |
| 41 | + </el-select> | |
| 42 | + </el-form-item> | |
| 43 | + </el-col> | |
| 44 | + | |
| 45 | + <el-col :span="12" v-if="form.feeFlag != '2006012'"> | |
| 46 | + <el-form-item :label="$t('feeConfigManage.paymentCycle')" prop="paymentCycle" required> | |
| 47 | + <el-input v-model="form.paymentCycle" :placeholder="$t('feeConfigManage.enterPaymentCycle')" /> | |
| 48 | + </el-form-item> | |
| 49 | + </el-col> | |
| 50 | + <el-col :span="12" v-if="form.paymentCd == '1200'"> | |
| 51 | + <el-form-item :label="$t('feeConfigManage.prepaymentPeriod')" prop="prepaymentPeriod" required> | |
| 52 | + <el-input v-model="form.prepaymentPeriod" :placeholder="$t('feeConfigManage.enterPrepaymentPeriod')" /> | |
| 53 | + </el-form-item> | |
| 54 | + </el-col> | |
| 55 | + | |
| 56 | + <el-col :span="12"> | |
| 57 | + <el-form-item :label="$t('feeConfigManage.unit')" prop="units" required> | |
| 58 | + <el-input v-model="form.units" :placeholder="$t('feeConfigManage.enterUnit')" /> | |
| 59 | + </el-form-item> | |
| 60 | + </el-col> | |
| 61 | + <el-col :span="12"> | |
| 62 | + <el-form-item :label="$t('feeConfigManage.accountDeduction')" prop="deductFrom"> | |
| 63 | + <el-select v-model="form.deductFrom" class="full-width-select"> | |
| 64 | + <el-option :label="$t('common.yes')" value="Y" /> | |
| 65 | + <el-option :label="$t('common.no')" value="N" /> | |
| 66 | + </el-select> | |
| 67 | + </el-form-item> | |
| 68 | + </el-col> | |
| 69 | + | |
| 70 | + <el-col :span="12"> | |
| 71 | + <el-form-item :label="$t('feeConfigManage.mobilePayment')" prop="payOnline"> | |
| 72 | + <el-select v-model="form.payOnline" class="full-width-select"> | |
| 73 | + <el-option :label="$t('common.yes')" value="Y" /> | |
| 74 | + <el-option :label="$t('common.no')" value="N" /> | |
| 75 | + </el-select> | |
| 76 | + </el-form-item> | |
| 77 | + </el-col> | |
| 78 | + <el-col :span="12"> | |
| 79 | + <el-form-item :label="$t('feeConfigManage.roundingMethod')" prop="scale"> | |
| 80 | + <el-select v-model="form.scale" class="full-width-select"> | |
| 81 | + <el-option :label="$t('feeConfigManage.roundHalfUp')" value="1" /> | |
| 82 | + <el-option :label="$t('feeConfigManage.roundUp')" value="3" /> | |
| 83 | + <el-option :label="$t('feeConfigManage.roundDown')" value="4" /> | |
| 84 | + </el-select> | |
| 85 | + </el-form-item> | |
| 86 | + </el-col> | |
| 87 | + | |
| 88 | + <el-col :span="12"> | |
| 89 | + <el-form-item :label="$t('feeConfigManage.decimalPlaces')" prop="decimalPlace"> | |
| 90 | + <el-select v-model="form.decimalPlace" class="full-width-select"> | |
| 91 | + <el-option :label="$t('feeConfigManage.integer')" value="0" /> | |
| 92 | + <el-option :label="$t('feeConfigManage.oneDecimal')" value="1" /> | |
| 93 | + <el-option :label="$t('feeConfigManage.twoDecimal')" value="2" /> | |
| 94 | + <el-option :label="$t('feeConfigManage.threeDecimal')" value="3" /> | |
| 95 | + <el-option :label="$t('feeConfigManage.fourDecimal')" value="4" /> | |
| 96 | + </el-select> | |
| 97 | + </el-form-item> | |
| 98 | + </el-col> | |
| 99 | + <el-col :span="12"> | |
| 100 | + <el-form-item :label="$t('common.status')" prop="state"> | |
| 101 | + <el-select v-model="form.state" class="full-width-select"> | |
| 102 | + <el-option :label="$t('common.enabled')" value="Y" /> | |
| 103 | + <el-option :label="$t('common.disabled')" value="N" /> | |
| 104 | + </el-select> | |
| 105 | + </el-form-item> | |
| 106 | + </el-col> | |
| 107 | + | |
| 108 | + <el-col :span="24"> | |
| 109 | + <el-form-item :label="$t('feeConfigManage.formula')" prop="computingFormula" required> | |
| 110 | + <el-select | |
| 111 | + v-model="form.computingFormula" | |
| 112 | + :placeholder="$t('feeConfigManage.selectFormula')" | |
| 113 | + class="full-width-select" | |
| 114 | + > | |
| 115 | + <el-option v-for="item in computingFormulas" :key="item.statusCd" :label="item.name" :value="item.statusCd" /> | |
| 116 | + </el-select> | |
| 117 | + </el-form-item> | |
| 118 | + </el-col> | |
| 119 | + | |
| 120 | + <template v-if="shouldShowUnitPrice"> | |
| 121 | + <el-col :span="24"> | |
| 122 | + <el-form-item :label="$t('feeConfigManage.unitPrice')" prop="squarePrice" required> | |
| 123 | + <el-input v-model="form.squarePrice" :placeholder="$t('feeConfigManage.enterUnitPrice')" /> | |
| 124 | + </el-form-item> | |
| 125 | + </el-col> | |
| 126 | + </template> | |
| 127 | + | |
| 128 | + <template v-if="shouldShowAdditionalAmount"> | |
| 129 | + <el-col :span="24"> | |
| 130 | + <el-form-item :label="additionalAmountLabel" prop="additionalAmount" required> | |
| 131 | + <el-input v-model="form.additionalAmount" :placeholder="$t('feeConfigManage.enterAdditionalFee')" /> | |
| 132 | + </el-form-item> | |
| 133 | + </el-col> | |
| 134 | + </template> | |
| 135 | + | |
| 136 | + <template v-if="form.computingFormula == '7007'"> | |
| 137 | + <el-col :span="24"> | |
| 138 | + <el-form-item :label="$t('feeConfigManage.formula')" prop="computingFormulaText" required> | |
| 139 | + <el-input type="textarea" v-model="form.computingFormulaText" :placeholder="$t('feeConfigManage.enterFormula')" :rows="4" /> | |
| 140 | + </el-form-item> | |
| 141 | + </el-col> | |
| 142 | + <el-col :span="24"> | |
| 143 | + <el-form-item :label="$t('common.explanation')"> | |
| 144 | + <div>C {{ $t('feeConfigManage.explanationC') }}</div> | |
| 145 | + <div>F {{ $t('feeConfigManage.explanationF') }}</div> | |
| 146 | + <div>U {{ $t('feeConfigManage.explanationU') }}</div> | |
| 147 | + <div>R {{ $t('feeConfigManage.explanationR') }}</div> | |
| 148 | + <div>X {{ $t('feeConfigManage.explanationX') }}</div> | |
| 149 | + <div>L {{ $t('feeConfigManage.explanationL') }}</div> | |
| 150 | + <div>{{ $t('feeConfigManage.example1') }}</div> | |
| 151 | + <div>{{ $t('feeConfigManage.example2') }}</div> | |
| 152 | + </el-form-item> | |
| 153 | + </el-col> | |
| 154 | + </template> | |
| 155 | + </el-row> | |
| 156 | + </el-form> | |
| 157 | + | |
| 158 | + <div slot="footer"> | |
| 159 | + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | |
| 160 | + <el-button type="primary" @click="saveFeeConfigInfo">{{ $t('common.save') }}</el-button> | |
| 161 | + </div> | |
| 162 | + </el-dialog> | |
| 163 | +</template> | |
| 164 | + | |
| 165 | +<script> | |
| 166 | +import { saveFeeConfig } from '@/api/fee/feeConfigManageApi' | |
| 167 | +import { getDict } from '@/api/community/communityApi' | |
| 168 | + | |
| 169 | +export default { | |
| 170 | + name: 'AddFeeConfig', | |
| 171 | + data() { | |
| 172 | + return { | |
| 173 | + visible: false, | |
| 174 | + form: { | |
| 175 | + feeTypeCd: '', | |
| 176 | + feeName: '', | |
| 177 | + feeFlag: '', | |
| 178 | + paymentCd: '1200', | |
| 179 | + paymentCycle: '', | |
| 180 | + prepaymentPeriod: '1', | |
| 181 | + computingFormula: '', | |
| 182 | + squarePrice: '', | |
| 183 | + additionalAmount: '0.00', | |
| 184 | + units: '元', | |
| 185 | + deductFrom: 'Y', | |
| 186 | + payOnline: 'Y', | |
| 187 | + scale: '1', | |
| 188 | + decimalPlace: '2', | |
| 189 | + state: 'Y', | |
| 190 | + computingFormulaText: '', | |
| 191 | + startTime:'2025-01-01', | |
| 192 | + endTime:'2050-01-01', | |
| 193 | + billType:'002', | |
| 194 | + communityId: this.getCommunityId() | |
| 195 | + }, | |
| 196 | + feeTypeCds: [], | |
| 197 | + computingFormulas: [], | |
| 198 | + feeFlags: [], | |
| 199 | + paymentCds: [] | |
| 200 | + } | |
| 201 | + }, | |
| 202 | + computed: { | |
| 203 | + shouldShowUnitPrice() { | |
| 204 | + return !['2002', '7007', '8008', '1101', '1102', '4004', '9009'].includes(this.form.computingFormula) | |
| 205 | + }, | |
| 206 | + shouldShowAdditionalAmount() { | |
| 207 | + return !['7007', '8008', '1101', '1102', '4004', '9009'].includes(this.form.computingFormula) | |
| 208 | + }, | |
| 209 | + additionalAmountLabel() { | |
| 210 | + return this.form.computingFormula == '1001' | |
| 211 | + ? this.$t('feeConfigManage.additionalFee') | |
| 212 | + : this.$t('feeConfigManage.fixedFee') | |
| 213 | + } | |
| 214 | + }, | |
| 215 | + created() { | |
| 216 | + this.loadDicts() | |
| 217 | + }, | |
| 218 | + methods: { | |
| 219 | + open() { | |
| 220 | + this.visible = true | |
| 221 | + }, | |
| 222 | + | |
| 223 | + async loadDicts() { | |
| 224 | + try { | |
| 225 | + const [feeTypeCds, computingFormulas, feeFlags, paymentCds] = await Promise.all([ | |
| 226 | + getDict('pay_fee_config', 'fee_type_cd'), | |
| 227 | + getDict('pay_fee_config', 'computing_formula'), | |
| 228 | + getDict('pay_fee_config', 'fee_flag'), | |
| 229 | + getDict('pay_fee_config', 'payment_cd') | |
| 230 | + ]) | |
| 231 | + | |
| 232 | + this.feeTypeCds = feeTypeCds | |
| 233 | + this.computingFormulas = computingFormulas | |
| 234 | + this.feeFlags = feeFlags | |
| 235 | + this.paymentCds = paymentCds | |
| 236 | + } catch (error) { | |
| 237 | + console.error('Failed to load dictionaries:', error) | |
| 238 | + this.$message.error(this.$t('common.loadFailed')) | |
| 239 | + } | |
| 240 | + }, | |
| 241 | + | |
| 242 | + changeAddFeeTypeCd() { | |
| 243 | + const feeTypeCd = this.form.feeTypeCd | |
| 244 | + | |
| 245 | + // 水费、电费、煤气费 | |
| 246 | + if (['888800010015', '888800010016', '888800010009'].includes(feeTypeCd)) { | |
| 247 | + this.form.feeFlag = '2006012' | |
| 248 | + this.form.computingFormula = '5005' | |
| 249 | + this.form.paymentCd = '2100' | |
| 250 | + } | |
| 251 | + | |
| 252 | + // 押金 | |
| 253 | + if (feeTypeCd === '888800010006') { | |
| 254 | + this.form.feeFlag = '2006012' | |
| 255 | + } | |
| 256 | + | |
| 257 | + // 取暖费 | |
| 258 | + if (feeTypeCd === '888800010011') { | |
| 259 | + this.form.feeFlag = '4012024' | |
| 260 | + this.form.computingFormula = '3003' | |
| 261 | + } | |
| 262 | + | |
| 263 | + // 物业费 | |
| 264 | + if (feeTypeCd === '888800010001') { | |
| 265 | + this.form.feeFlag = '1003006' | |
| 266 | + this.form.computingFormula = '1001' | |
| 267 | + } | |
| 268 | + | |
| 269 | + // 租金 | |
| 270 | + if (feeTypeCd === '888800010018') { | |
| 271 | + this.form.feeFlag = '1003006' | |
| 272 | + this.form.computingFormula = '1101' | |
| 273 | + } | |
| 274 | + | |
| 275 | + // 停车费 | |
| 276 | + if (feeTypeCd === '888800010008') { | |
| 277 | + this.form.feeFlag = '1003006' | |
| 278 | + this.form.computingFormula = '2002' | |
| 279 | + this.form.paymentCycle = '1' | |
| 280 | + } | |
| 281 | + | |
| 282 | + // 公摊费 | |
| 283 | + if (feeTypeCd === '888800010017') { | |
| 284 | + this.form.feeFlag = '2006012' | |
| 285 | + this.form.computingFormula = '4004' | |
| 286 | + this.form.paymentCd = '2100' | |
| 287 | + } | |
| 288 | + }, | |
| 289 | + | |
| 290 | + async saveFeeConfigInfo() { | |
| 291 | + try { | |
| 292 | + // 处理特殊公式 | |
| 293 | + if (this.form.computingFormula === '2002') { | |
| 294 | + this.form.squarePrice = "0.00" | |
| 295 | + } | |
| 296 | + | |
| 297 | + if (['7007', '8008', '1101', '1102', '4004', '9009'].includes(this.form.computingFormula)) { | |
| 298 | + this.form.squarePrice = "0.00" | |
| 299 | + this.form.additionalAmount = "0.00" | |
| 300 | + } | |
| 301 | + | |
| 302 | + if (this.form.feeFlag === '2006012') { | |
| 303 | + this.form.paymentCycle = '1' | |
| 304 | + } | |
| 305 | + | |
| 306 | + if (this.form.paymentCd !== '1200') { | |
| 307 | + this.form.prepaymentPeriod = '0' | |
| 308 | + } | |
| 309 | + | |
| 310 | + // 表单验证 | |
| 311 | + await this.$refs.form.validate() | |
| 312 | + | |
| 313 | + // 调用API保存 | |
| 314 | + await saveFeeConfig(this.form) | |
| 315 | + | |
| 316 | + this.$message.success(this.$t('common.saveSuccess')) | |
| 317 | + this.visible = false | |
| 318 | + this.$emit('success') | |
| 319 | + } catch (error) { | |
| 320 | + this.$message.error(error.message || this.$t('common.saveFail')) | |
| 321 | + } | |
| 322 | + }, | |
| 323 | + | |
| 324 | + resetForm() { | |
| 325 | + this.$refs.form.resetFields() | |
| 326 | + this.form = { | |
| 327 | + feeTypeCd: '', | |
| 328 | + feeName: '', | |
| 329 | + feeFlag: '', | |
| 330 | + paymentCd: '1200', | |
| 331 | + paymentCycle: '', | |
| 332 | + prepaymentPeriod: '1', | |
| 333 | + computingFormula: '', | |
| 334 | + squarePrice: '', | |
| 335 | + additionalAmount: '0.00', | |
| 336 | + units: '元', | |
| 337 | + deductFrom: 'Y', | |
| 338 | + payOnline: 'Y', | |
| 339 | + scale: '1', | |
| 340 | + decimalPlace: '2', | |
| 341 | + state: 'Y', | |
| 342 | + startTime:'2025-01-01', | |
| 343 | + endTime:'2050-01-01', | |
| 344 | + billType:'002', | |
| 345 | + computingFormulaText: '', | |
| 346 | + communityId: this.getCommunityId() | |
| 347 | + } | |
| 348 | + }, | |
| 349 | + } | |
| 350 | +} | |
| 351 | +</script> | |
| 352 | + | |
| 353 | +<style scoped> | |
| 354 | +.full-width-select { | |
| 355 | + width: 100%; | |
| 356 | +} | |
| 357 | +</style> | |
| 0 | 358 | \ No newline at end of file | ... | ... |
src/components/fee/deleteFeeConfig.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog :title="$t('common.operation')" :visible.sync="visible" width="500px"> | |
| 3 | + <p>{{ $t('feeConfigManage.confirmDeleteFeeItem') }}</p> | |
| 4 | + | |
| 5 | + <div slot="footer"> | |
| 6 | + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | |
| 7 | + <el-button type="primary" @click="deleteFeeConfig">{{ $t('common.delete') }}</el-button> | |
| 8 | + </div> | |
| 9 | + </el-dialog> | |
| 10 | +</template> | |
| 11 | + | |
| 12 | +<script> | |
| 13 | +import { deleteFeeConfig } from '@/api/fee/feeConfigManageApi' | |
| 14 | + | |
| 15 | +export default { | |
| 16 | + name: 'DeleteFeeConfig', | |
| 17 | + data() { | |
| 18 | + return { | |
| 19 | + visible: false, | |
| 20 | + configId: '' | |
| 21 | + } | |
| 22 | + }, | |
| 23 | + methods: { | |
| 24 | + open(feeConfig) { | |
| 25 | + this.configId = feeConfig.configId | |
| 26 | + this.visible = true | |
| 27 | + }, | |
| 28 | + | |
| 29 | + async deleteFeeConfig() { | |
| 30 | + try { | |
| 31 | + await deleteFeeConfig({ | |
| 32 | + configId: this.configId, | |
| 33 | + communityId: this.getCommunityId() | |
| 34 | + }) | |
| 35 | + | |
| 36 | + this.$message.success(this.$t('common.deleteSuccess')) | |
| 37 | + this.visible = false | |
| 38 | + this.$emit('success') | |
| 39 | + } catch (error) { | |
| 40 | + this.$message.error(error.message || this.$t('common.deleteFail')) | |
| 41 | + } | |
| 42 | + } | |
| 43 | + } | |
| 44 | +} | |
| 45 | +</script> | |
| 0 | 46 | \ No newline at end of file | ... | ... |
src/components/fee/editFeeConfig.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog :title="$t('common.edit')" :visible.sync="visible" width="80%" @close="resetForm"> | |
| 3 | + <el-form :model="form" label-width="150px" ref="form"> | |
| 4 | + <el-row :gutter="20"> | |
| 5 | + <el-col :span="12"> | |
| 6 | + <el-form-item :label="$t('feeConfigManage.feeType')" prop="feeTypeCd" required> | |
| 7 | + <el-select | |
| 8 | + v-model="form.feeTypeCd" | |
| 9 | + :disabled="form.isDefault === 'T'" | |
| 10 | + :placeholder="$t('feeConfigManage.selectFeeType')" | |
| 11 | + class="full-width-select" | |
| 12 | + > | |
| 13 | + <el-option v-for="item in feeTypeCds" :key="item.statusCd" :label="item.name" :value="item.statusCd" /> | |
| 14 | + </el-select> | |
| 15 | + </el-form-item> | |
| 16 | + </el-col> | |
| 17 | + <el-col :span="12"> | |
| 18 | + <el-form-item :label="$t('feeConfigManage.feeItem')" prop="feeName" required> | |
| 19 | + <el-input v-model="form.feeName" :disabled="form.isDefault === 'T'" | |
| 20 | + :placeholder="$t('feeConfigManage.enterFeeItem')" /> | |
| 21 | + </el-form-item> | |
| 22 | + </el-col> | |
| 23 | + <el-col :span="12"> | |
| 24 | + <el-form-item :label="$t('feeConfigManage.feeFlag')" prop="feeFlag" required> | |
| 25 | + <el-select | |
| 26 | + v-model="form.feeFlag" | |
| 27 | + :disabled="form.isDefault === 'T'" | |
| 28 | + :placeholder="$t('feeConfigManage.selectFeeFlag')" | |
| 29 | + class="full-width-select" | |
| 30 | + > | |
| 31 | + <el-option v-for="item in feeFlags" :key="item.statusCd" :label="item.name" :value="item.statusCd" /> | |
| 32 | + </el-select> | |
| 33 | + </el-form-item> | |
| 34 | + </el-col> | |
| 35 | + <el-col :span="12"> | |
| 36 | + <el-form-item :label="$t('feeConfigManage.paymentType')" prop="paymentCd" required> | |
| 37 | + <el-select | |
| 38 | + v-model="form.paymentCd" | |
| 39 | + :placeholder="$t('feeConfigManage.selectPaymentType')" | |
| 40 | + class="full-width-select" | |
| 41 | + > | |
| 42 | + <el-option v-for="item in paymentCds" :key="item.statusCd" :label="item.name" :value="item.statusCd" /> | |
| 43 | + </el-select> | |
| 44 | + </el-form-item> | |
| 45 | + </el-col> | |
| 46 | + | |
| 47 | + <el-col :span="12" v-if="form.feeFlag != '2006012'"> | |
| 48 | + <el-form-item :label="$t('feeConfigManage.paymentCycle')" prop="paymentCycle" required> | |
| 49 | + <el-input v-model="form.paymentCycle" :placeholder="$t('feeConfigManage.enterPaymentCycle')" /> | |
| 50 | + </el-form-item> | |
| 51 | + </el-col> | |
| 52 | + <el-col :span="12" v-if="form.paymentCd == '1200'"> | |
| 53 | + <el-form-item :label="$t('feeConfigManage.prepaymentPeriod')" prop="prepaymentPeriod" required> | |
| 54 | + <el-input v-model="form.prepaymentPeriod" :placeholder="$t('feeConfigManage.enterPrepaymentPeriod')" /> | |
| 55 | + </el-form-item> | |
| 56 | + </el-col> | |
| 57 | + | |
| 58 | + <el-col :span="12"> | |
| 59 | + <el-form-item :label="$t('feeConfigManage.unit')" prop="units" required> | |
| 60 | + <el-input v-model="form.units" :placeholder="$t('feeConfigManage.enterUnit')" /> | |
| 61 | + </el-form-item> | |
| 62 | + </el-col> | |
| 63 | + <el-col :span="12"> | |
| 64 | + <el-form-item :label="$t('feeConfigManage.accountDeduction')" prop="deductFrom"> | |
| 65 | + <el-select v-model="form.deductFrom" class="full-width-select"> | |
| 66 | + <el-option :label="$t('common.yes')" value="Y" /> | |
| 67 | + <el-option :label="$t('common.no')" value="N" /> | |
| 68 | + </el-select> | |
| 69 | + </el-form-item> | |
| 70 | + </el-col> | |
| 71 | + | |
| 72 | + <el-col :span="12"> | |
| 73 | + <el-form-item :label="$t('feeConfigManage.mobilePayment')" prop="payOnline"> | |
| 74 | + <el-select v-model="form.payOnline" class="full-width-select"> | |
| 75 | + <el-option :label="$t('common.yes')" value="Y" /> | |
| 76 | + <el-option :label="$t('common.no')" value="N" /> | |
| 77 | + </el-select> | |
| 78 | + </el-form-item> | |
| 79 | + </el-col> | |
| 80 | + <el-col :span="12"> | |
| 81 | + <el-form-item :label="$t('feeConfigManage.roundingMethod')" prop="scale"> | |
| 82 | + <el-select v-model="form.scale" class="full-width-select"> | |
| 83 | + <el-option :label="$t('feeConfigManage.roundHalfUp')" value="1" /> | |
| 84 | + <el-option :label="$t('feeConfigManage.roundUp')" value="3" /> | |
| 85 | + <el-option :label="$t('feeConfigManage.roundDown')" value="4" /> | |
| 86 | + </el-select> | |
| 87 | + </el-form-item> | |
| 88 | + </el-col> | |
| 89 | + | |
| 90 | + <el-col :span="12"> | |
| 91 | + <el-form-item :label="$t('feeConfigManage.decimalPlaces')" prop="decimalPlace"> | |
| 92 | + <el-select v-model="form.decimalPlace" class="full-width-select"> | |
| 93 | + <el-option :label="$t('feeConfigManage.integer')" value="0" /> | |
| 94 | + <el-option :label="$t('feeConfigManage.oneDecimal')" value="1" /> | |
| 95 | + <el-option :label="$t('feeConfigManage.twoDecimal')" value="2" /> | |
| 96 | + <el-option :label="$t('feeConfigManage.threeDecimal')" value="3" /> | |
| 97 | + <el-option :label="$t('feeConfigManage.fourDecimal')" value="4" /> | |
| 98 | + </el-select> | |
| 99 | + </el-form-item> | |
| 100 | + </el-col> | |
| 101 | + <el-col :span="12"> | |
| 102 | + <el-form-item :label="$t('common.status')" prop="state"> | |
| 103 | + <el-select v-model="form.state" class="full-width-select"> | |
| 104 | + <el-option :label="$t('common.enabled')" value="Y" /> | |
| 105 | + <el-option :label="$t('common.disabled')" value="N" /> | |
| 106 | + <el-option :label="$t('feeConfigManage.disabledAndEndFee')" value="NA" /> | |
| 107 | + </el-select> | |
| 108 | + </el-form-item> | |
| 109 | + </el-col> | |
| 110 | + | |
| 111 | + <el-col :span="24"> | |
| 112 | + <el-form-item :label="$t('feeConfigManage.formula')" prop="computingFormula" required> | |
| 113 | + <el-select | |
| 114 | + v-model="form.computingFormula" | |
| 115 | + :disabled="form.isDefault === 'T'" | |
| 116 | + :placeholder="$t('feeConfigManage.selectFormula')" | |
| 117 | + class="full-width-select" | |
| 118 | + > | |
| 119 | + <el-option v-for="item in computingFormulas" :key="item.statusCd" :label="item.name" :value="item.statusCd" /> | |
| 120 | + </el-select> | |
| 121 | + </el-form-item> | |
| 122 | + </el-col> | |
| 123 | + | |
| 124 | + <template v-if="shouldShowUnitPrice"> | |
| 125 | + <el-col :span="24"> | |
| 126 | + <el-form-item :label="$t('feeConfigManage.unitPrice')" prop="squarePrice" required> | |
| 127 | + <el-input v-model="form.squarePrice" :placeholder="$t('feeConfigManage.enterUnitPrice')" /> | |
| 128 | + </el-form-item> | |
| 129 | + </el-col> | |
| 130 | + </template> | |
| 131 | + | |
| 132 | + <template v-if="shouldShowAdditionalAmount"> | |
| 133 | + <el-col :span="24"> | |
| 134 | + <el-form-item :label="additionalAmountLabel" prop="additionalAmount" required> | |
| 135 | + <el-input v-model="form.additionalAmount" :placeholder="$t('feeConfigManage.enterAdditionalFee')" /> | |
| 136 | + </el-form-item> | |
| 137 | + </el-col> | |
| 138 | + </template> | |
| 139 | + | |
| 140 | + <template v-if="form.computingFormula == '7007'"> | |
| 141 | + <el-col :span="24"> | |
| 142 | + <el-form-item :label="$t('feeConfigManage.formula')" prop="computingFormulaText" required> | |
| 143 | + <el-input type="textarea" v-model="form.computingFormulaText" | |
| 144 | + :placeholder="$t('feeConfigManage.enterFormula')" :rows="4" /> | |
| 145 | + </el-form-item> | |
| 146 | + </el-col> | |
| 147 | + <el-col :span="24"> | |
| 148 | + <el-form-item :label="$t('common.explanation')"> | |
| 149 | + <div>C {{ $t('feeConfigManage.explanationC') }}</div> | |
| 150 | + <div>F {{ $t('feeConfigManage.explanationF') }}</div> | |
| 151 | + <div>U {{ $t('feeConfigManage.explanationU') }}</div> | |
| 152 | + <div>R {{ $t('feeConfigManage.explanationR') }}</div> | |
| 153 | + <div>X {{ $t('feeConfigManage.explanationX') }}</div> | |
| 154 | + <div>L {{ $t('feeConfigManage.explanationL') }}</div> | |
| 155 | + <div>{{ $t('feeConfigManage.example1') }}</div> | |
| 156 | + <div>{{ $t('feeConfigManage.example2') }}</div> | |
| 157 | + </el-form-item> | |
| 158 | + </el-col> | |
| 159 | + </template> | |
| 160 | + </el-row> | |
| 161 | + </el-form> | |
| 162 | + | |
| 163 | + <div slot="footer"> | |
| 164 | + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | |
| 165 | + <el-button type="primary" @click="editFeeConfig">{{ $t('common.save') }}</el-button> | |
| 166 | + </div> | |
| 167 | + </el-dialog> | |
| 168 | +</template> | |
| 169 | + | |
| 170 | +<script> | |
| 171 | +import { updateFeeConfig } from '@/api/fee/feeConfigManageApi' | |
| 172 | +import { getDict } from '@/api/community/communityApi' | |
| 173 | + | |
| 174 | +export default { | |
| 175 | + name: 'EditFeeConfig', | |
| 176 | + data() { | |
| 177 | + return { | |
| 178 | + visible: false, | |
| 179 | + form: { | |
| 180 | + configId: '', | |
| 181 | + feeTypeCd: '', | |
| 182 | + feeName: '', | |
| 183 | + feeFlag: '', | |
| 184 | + startTime: '', | |
| 185 | + endTime: '', | |
| 186 | + computingFormula: '', | |
| 187 | + squarePrice: '', | |
| 188 | + additionalAmount: '0.00', | |
| 189 | + isDefault: '', | |
| 190 | + paymentCycle: '', | |
| 191 | + paymentCd: '', | |
| 192 | + computingFormulaText: '', | |
| 193 | + deductFrom: '', | |
| 194 | + payOnline: 'Y', | |
| 195 | + scale: '1', | |
| 196 | + decimalPlace: '2', | |
| 197 | + units: '元', | |
| 198 | + prepaymentPeriod: '1', | |
| 199 | + state: 'Y', | |
| 200 | + communityId: this.getCommunityId() | |
| 201 | + }, | |
| 202 | + feeTypeCds: [], | |
| 203 | + computingFormulas: [], | |
| 204 | + feeFlags: [], | |
| 205 | + paymentCds: [] | |
| 206 | + } | |
| 207 | + }, | |
| 208 | + computed: { | |
| 209 | + shouldShowUnitPrice() { | |
| 210 | + return !['2002', '7007', '8008', '1101', '1102', '4004', '9009'].includes(this.form.computingFormula) | |
| 211 | + }, | |
| 212 | + shouldShowAdditionalAmount() { | |
| 213 | + return !['7007', '8008', '1101', '1102', '4004', '9009'].includes(this.form.computingFormula) | |
| 214 | + }, | |
| 215 | + additionalAmountLabel() { | |
| 216 | + return this.form.computingFormula == '1001' | |
| 217 | + ? this.$t('feeConfigManage.additionalFee') | |
| 218 | + : this.$t('feeConfigManage.fixedFee') | |
| 219 | + } | |
| 220 | + }, | |
| 221 | + created() { | |
| 222 | + this.loadDicts() | |
| 223 | + }, | |
| 224 | + methods: { | |
| 225 | + open(feeConfig) { | |
| 226 | + this.form = { ...feeConfig } | |
| 227 | + this.visible = true | |
| 228 | + }, | |
| 229 | + | |
| 230 | + async loadDicts() { | |
| 231 | + try { | |
| 232 | + const [feeTypeCds, computingFormulas, feeFlags, paymentCds] = await Promise.all([ | |
| 233 | + getDict('pay_fee_config', 'fee_type_cd'), | |
| 234 | + getDict('pay_fee_config', 'computing_formula'), | |
| 235 | + getDict('pay_fee_config', 'fee_flag'), | |
| 236 | + getDict('pay_fee_config', 'payment_cd') | |
| 237 | + ]) | |
| 238 | + | |
| 239 | + this.feeTypeCds = feeTypeCds | |
| 240 | + this.computingFormulas = computingFormulas | |
| 241 | + this.feeFlags = feeFlags | |
| 242 | + this.paymentCds = paymentCds | |
| 243 | + } catch (error) { | |
| 244 | + console.error('Failed to load dictionaries:', error) | |
| 245 | + this.$message.error(this.$t('common.loadFailed')) | |
| 246 | + } | |
| 247 | + }, | |
| 248 | + | |
| 249 | + async editFeeConfig() { | |
| 250 | + try { | |
| 251 | + // 处理特殊公式 | |
| 252 | + if (this.form.computingFormula === '2002') { | |
| 253 | + this.form.squarePrice = "0.00" | |
| 254 | + } | |
| 255 | + | |
| 256 | + if (['7007', '8008', '1101', '1102', '4004', '9009'].includes(this.form.computingFormula)) { | |
| 257 | + this.form.squarePrice = "0.00" | |
| 258 | + this.form.additionalAmount = "0.00" | |
| 259 | + } | |
| 260 | + | |
| 261 | + if (this.form.feeFlag === '2006012') { | |
| 262 | + this.form.paymentCycle = '1' | |
| 263 | + } | |
| 264 | + | |
| 265 | + if (this.form.paymentCd === '1200' && !this.form.prepaymentPeriod) { | |
| 266 | + throw new Error(this.$t('feeConfigManage.prepaymentPeriodRequired')) | |
| 267 | + } | |
| 268 | + | |
| 269 | + if (this.form.paymentCd !== '1200') { | |
| 270 | + this.form.prepaymentPeriod = '0' | |
| 271 | + } | |
| 272 | + | |
| 273 | + // 表单验证 | |
| 274 | + await this.$refs.form.validate() | |
| 275 | + this.form.communityId = this.getCommunityId() | |
| 276 | + | |
| 277 | + // 调用API更新 | |
| 278 | + await updateFeeConfig(this.form) | |
| 279 | + | |
| 280 | + this.$message.success(this.$t('common.saveSuccess')) | |
| 281 | + this.visible = false | |
| 282 | + this.$emit('success') | |
| 283 | + } catch (error) { | |
| 284 | + this.$message.error(error.message || this.$t('common.saveFail')) | |
| 285 | + } | |
| 286 | + }, | |
| 287 | + | |
| 288 | + resetForm() { | |
| 289 | + this.$refs.form.resetFields() | |
| 290 | + this.form = { | |
| 291 | + configId: '', | |
| 292 | + feeTypeCd: '', | |
| 293 | + feeName: '', | |
| 294 | + feeFlag: '', | |
| 295 | + startTime: '', | |
| 296 | + endTime: '', | |
| 297 | + computingFormula: '', | |
| 298 | + squarePrice: '', | |
| 299 | + additionalAmount: '0.00', | |
| 300 | + isDefault: '', | |
| 301 | + paymentCycle: '', | |
| 302 | + paymentCd: '', | |
| 303 | + computingFormulaText: '', | |
| 304 | + deductFrom: '', | |
| 305 | + payOnline: 'Y', | |
| 306 | + scale: '1', | |
| 307 | + decimalPlace: '2', | |
| 308 | + units: '元', | |
| 309 | + prepaymentPeriod: '1', | |
| 310 | + state: 'Y', | |
| 311 | + communityId: this.getCommunityId() | |
| 312 | + } | |
| 313 | + }, | |
| 314 | + | |
| 315 | + | |
| 316 | + } | |
| 317 | +} | |
| 318 | +</script> | |
| 319 | + | |
| 320 | +<style scoped> | |
| 321 | +.full-width-select { | |
| 322 | + width: 100%; | |
| 323 | +} | |
| 324 | +</style> | |
| 0 | 325 | \ No newline at end of file | ... | ... |
src/i18n/commonLang.js
| ... | ... | @@ -32,7 +32,13 @@ export const messages = { |
| 32 | 32 | male: 'Male', |
| 33 | 33 | all: 'All', |
| 34 | 34 | refresh: 'Refresh', |
| 35 | - export: 'Export' | |
| 35 | + export: 'Export', | |
| 36 | + query: 'Query', | |
| 37 | + yes: 'Yes', | |
| 38 | + no: 'No', | |
| 39 | + status: 'Status', | |
| 40 | + enabled: 'Enabled', | |
| 41 | + disabled: 'Disabled', | |
| 36 | 42 | } |
| 37 | 43 | }, |
| 38 | 44 | zh: { |
| ... | ... | @@ -68,7 +74,13 @@ export const messages = { |
| 68 | 74 | male: '男', |
| 69 | 75 | all: '全部', |
| 70 | 76 | refresh: '刷新', |
| 71 | - export: '导出' | |
| 77 | + export: '导出', | |
| 78 | + query: '查询', | |
| 79 | + yes: '是', | |
| 80 | + no: '否', | |
| 81 | + status: '状态', | |
| 82 | + enabled: '启用', | |
| 83 | + disabled: '禁用', | |
| 72 | 84 | } |
| 73 | 85 | } |
| 74 | 86 | } |
| 75 | 87 | \ No newline at end of file | ... | ... |
src/i18n/index.js
| ... | ... | @@ -120,6 +120,7 @@ import { messages as communityMiniMessages } from '../views/community/communityM |
| 120 | 120 | import { messages as communityPaymentMessages } from '../views/fee/communityPaymentLang' |
| 121 | 121 | import { messages as enterCommunityMessages } from '../views/community/enterCommunityLang' |
| 122 | 122 | import { messages as roomRenovationManageMessages } from '../views/community/roomRenovationManageLang' |
| 123 | +import { messages as feeConfigManageMessages } from '../views/fee/feeConfigManageLang' | |
| 123 | 124 | |
| 124 | 125 | Vue.use(VueI18n) |
| 125 | 126 | |
| ... | ... | @@ -244,6 +245,7 @@ const messages = { |
| 244 | 245 | ...communityPaymentMessages.en, |
| 245 | 246 | ...enterCommunityMessages.en, |
| 246 | 247 | ...roomRenovationManageMessages.en, |
| 248 | + ...feeConfigManageMessages.en, | |
| 247 | 249 | }, |
| 248 | 250 | zh: { |
| 249 | 251 | ...loginMessages.zh, |
| ... | ... | @@ -364,6 +366,7 @@ const messages = { |
| 364 | 366 | ...communityPaymentMessages.zh, |
| 365 | 367 | ...enterCommunityMessages.zh, |
| 366 | 368 | ...roomRenovationManageMessages.zh, |
| 369 | + ...feeConfigManageMessages.zh, | |
| 367 | 370 | } |
| 368 | 371 | } |
| 369 | 372 | ... | ... |
src/router/index.js
| ... | ... | @@ -586,6 +586,11 @@ const routes = [ |
| 586 | 586 | name: '/pages/property/roomRenovationManage', |
| 587 | 587 | component: () => import('@/views/community/roomRenovationManageList.vue') |
| 588 | 588 | }, |
| 589 | + { | |
| 590 | + path:'/pages/property/feeConfigManage', | |
| 591 | + name:'/pages/property/feeConfigManage', | |
| 592 | + component: () => import('@/views/fee/feeConfigManageList.vue') | |
| 593 | + }, | |
| 589 | 594 | // 其他子路由可以在这里添加 |
| 590 | 595 | ] |
| 591 | 596 | }, | ... | ... |
src/views/fee/feeConfigManageLang.js
0 → 100644
| 1 | +export const messages = { | |
| 2 | + en: { | |
| 3 | + feeConfigManage: { | |
| 4 | + queryCondition: 'Query Conditions', | |
| 5 | + feeItems: 'Fee Items', | |
| 6 | + hide: 'Hide', | |
| 7 | + more: 'More', | |
| 8 | + enterFeeItemId: 'Please enter fee item ID', | |
| 9 | + enterFeeItem: 'Please enter fee item', | |
| 10 | + selectFeeFlag: 'Please select fee flag', | |
| 11 | + selectPaymentType: 'Please select payment type', | |
| 12 | + selectAccountDeduction: 'Please select account deduction', | |
| 13 | + selectDefaultFee: 'Please select default fee', | |
| 14 | + number: 'Number', | |
| 15 | + feeType: 'Fee Type', | |
| 16 | + feeItem: 'Fee Item', | |
| 17 | + feeFlag: 'Fee Flag', | |
| 18 | + paymentType: 'Payment Type', | |
| 19 | + paymentCycle: 'Payment Cycle (months)', | |
| 20 | + formula: 'Formula', | |
| 21 | + unitPrice: 'Unit Price (¥)', | |
| 22 | + additionalFee: 'Additional/Fixed Fee (¥)', | |
| 23 | + accountDeduction: 'Account Deduction', | |
| 24 | + operation: 'Operation', | |
| 25 | + discount: 'Discount', | |
| 26 | + detail: 'Detail', | |
| 27 | + feeFlagTip: 'Fee flag: Periodic fees are charged continuously (e.g., property fees), one-time fees are charged only once (e.g., deposits).', | |
| 28 | + paymentTypeTip: 'Payment type: Prepaid fees are charged in advance, postpaid fees are charged afterward.', | |
| 29 | + accountDeductionTip: 'Account deduction: Indicates whether fees can be deducted from the account balance.', | |
| 30 | + enterFeeType: 'Required, please select fee type', | |
| 31 | + enterFeeItemRequired: 'Required, please enter fee item', | |
| 32 | + selectFeeFlagRequired: 'Required, please select fee flag', | |
| 33 | + enterPaymentCycle: 'Required, please enter payment cycle', | |
| 34 | + enterPrepaymentPeriod: 'Required, please enter prepayment period', | |
| 35 | + enterUnit: 'Required, please enter unit (e.g., yuan)', | |
| 36 | + mobilePayment: 'Mobile Payment', | |
| 37 | + roundingMethod: 'Rounding Method', | |
| 38 | + roundHalfUp: 'Round Half Up', | |
| 39 | + roundUp: 'Round Up', | |
| 40 | + roundDown: 'Round Down', | |
| 41 | + decimalPlaces: 'Decimal Places', | |
| 42 | + integer: 'Integer', | |
| 43 | + oneDecimal: '1 decimal', | |
| 44 | + twoDecimal: '2 decimals', | |
| 45 | + threeDecimal: '3 decimals', | |
| 46 | + fourDecimal: '4 decimals', | |
| 47 | + status: 'Status', | |
| 48 | + formulaRequired: 'Required, please select formula', | |
| 49 | + enterUnitPrice: 'Required, please enter unit price', | |
| 50 | + enterAdditionalFee: 'Required, please enter additional fee', | |
| 51 | + enterFormula: 'Required, please enter formula', | |
| 52 | + explanationC: 'represents community area corresponding to the property', | |
| 53 | + explanationF: 'represents building area corresponding to the property', | |
| 54 | + explanationU: 'represents unit area corresponding to the property', | |
| 55 | + explanationR: 'represents property area', | |
| 56 | + explanationX: 'represents property fee coefficient (configured in property management)', | |
| 57 | + explanationL: 'represents property floor number', | |
| 58 | + example1: 'Example: Elevator usage fee (floor number - 5) * unit price per floor + base fee', | |
| 59 | + example2: 'Formula: (L-5)*5 + 10', | |
| 60 | + confirmOperation: 'Please confirm your operation', | |
| 61 | + confirmDeleteFeeItem: 'Are you sure you want to delete this fee item?', | |
| 62 | + confirmDelete: 'Confirm Delete', | |
| 63 | + cancelDelete: 'Cancel', | |
| 64 | + fixedFee: 'Fixed Fee', | |
| 65 | + prepaymentPeriodRequired: 'Prepayment period is required', | |
| 66 | + disabledAndEndFee: 'Disabled and End Fee', | |
| 67 | + prepaid: 'Prepaid', | |
| 68 | + postpaid: 'Postpaid', | |
| 69 | + unit: 'Unit', | |
| 70 | + prepaymentPeriod: 'Prepayment Period', | |
| 71 | + } | |
| 72 | + }, | |
| 73 | + zh: { | |
| 74 | + feeConfigManage: { | |
| 75 | + queryCondition: '查询条件', | |
| 76 | + feeItems: '费用项', | |
| 77 | + hide: '隐藏', | |
| 78 | + more: '更多', | |
| 79 | + enterFeeItemId: '请输入费用项ID', | |
| 80 | + enterFeeItem: '请输入收费项目', | |
| 81 | + selectFeeFlag: '请选择费用标识', | |
| 82 | + selectPaymentType: '请选择付费类型', | |
| 83 | + selectAccountDeduction: '请选择账户抵扣', | |
| 84 | + selectDefaultFee: '请选择默认费用', | |
| 85 | + number: '编号', | |
| 86 | + feeType: '费用类型', | |
| 87 | + feeItem: '收费项目', | |
| 88 | + feeFlag: '费用标识', | |
| 89 | + paymentType: '付费类型', | |
| 90 | + paymentCycle: '缴费周期(单位:月)', | |
| 91 | + formula: '公式', | |
| 92 | + unitPrice: '计费单价(单位:元)', | |
| 93 | + additionalFee: '附加/固定费用(单位:元)', | |
| 94 | + accountDeduction: '账户抵扣', | |
| 95 | + operation: '操作', | |
| 96 | + discount: '折扣', | |
| 97 | + detail: '详情', | |
| 98 | + feeFlagTip: '费用标识:分为周期费用和一次性费用,周期费是连续收费的费用比如物业费每年都会收取,所以物业费建议用周期费;', | |
| 99 | + paymentTypeTip: '付费类型:分为预付费和后付费,预付费表示费用提前收费 后付费表示之后收取;', | |
| 100 | + accountDeductionTip: '账户抵扣:表示费用是否可以从账户余额中抵扣;', | |
| 101 | + enterFeeType: '必填,请选择费用类型', | |
| 102 | + enterFeeItemRequired: '必填,请填写收费项目', | |
| 103 | + selectFeeFlagRequired: '必填,请选择费用标识', | |
| 104 | + enterPaymentCycle: '必填,请填写缴费周期', | |
| 105 | + enterPrepaymentPeriod: '必填,请填写预付期', | |
| 106 | + enterUnit: '必填,请填写单位(如:元)', | |
| 107 | + mobilePayment: '手机缴费', | |
| 108 | + roundingMethod: '进位方式', | |
| 109 | + roundHalfUp: '四舍五入', | |
| 110 | + roundUp: '向上进位', | |
| 111 | + roundDown: '向下进位', | |
| 112 | + decimalPlaces: '保留小数位', | |
| 113 | + integer: '取整', | |
| 114 | + oneDecimal: '1位', | |
| 115 | + twoDecimal: '2位', | |
| 116 | + threeDecimal: '3位', | |
| 117 | + fourDecimal: '4位', | |
| 118 | + status: '状态', | |
| 119 | + formulaRequired: '必填,请选择计算公式', | |
| 120 | + enterUnitPrice: '必填,请填写计费单价', | |
| 121 | + enterAdditionalFee: '必填,请填写附加费用', | |
| 122 | + enterFormula: '必填,请填写公式', | |
| 123 | + explanationC: '代表房屋对应小区面积', | |
| 124 | + explanationF: '代表房屋对应楼栋面积', | |
| 125 | + explanationU: '代表房屋对应单元面积', | |
| 126 | + explanationR: '代表房屋面积', | |
| 127 | + explanationX: '代表房屋收费系数(房屋管理中配置)', | |
| 128 | + explanationL: '代表房屋层数', | |
| 129 | + example1: '举例:电梯使用费 (层数-5)*每层单价+基础费用', | |
| 130 | + example2: '公式:(L-5)*5 + 10', | |
| 131 | + confirmOperation: '请确认您的操作', | |
| 132 | + confirmDeleteFeeItem: '确定删除费用项?', | |
| 133 | + confirmDelete: '确认删除', | |
| 134 | + cancelDelete: '点错了', | |
| 135 | + fixedFee: '固定费用', | |
| 136 | + prepaymentPeriodRequired: '预付期不能为空', | |
| 137 | + disabledAndEndFee: '停用并结束费用', | |
| 138 | + prepaid: '预付费', | |
| 139 | + postpaid: '后付费', | |
| 140 | + unit: '单位', | |
| 141 | + prepaymentPeriod: '预付期' | |
| 142 | + } | |
| 143 | + } | |
| 144 | +} | |
| 0 | 145 | \ No newline at end of file | ... | ... |
src/views/fee/feeConfigManageList.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="animated fadeInRight"> | |
| 3 | + <el-row :gutter="20"> | |
| 4 | + <el-col :span="3"> | |
| 5 | + <div class="border-radius"> | |
| 6 | + <div class="margin-xs-r treeview"> | |
| 7 | + <ul class="list-group text-center border-radius"> | |
| 8 | + <li v-for="(item, index) in feeTypeCds" :key="index" @click="swatchFeeTypeCd(item)" | |
| 9 | + :class="{ 'vc-node-selected': conditions.feeTypeCd == item.statusCd }" class="list-group-item node-orgTree"> | |
| 10 | + {{ item.name }} | |
| 11 | + </li> | |
| 12 | + </ul> | |
| 13 | + </div> | |
| 14 | + </div> | |
| 15 | + </el-col> | |
| 16 | + <el-col :span="21"> | |
| 17 | + <el-card class="ibox"> | |
| 18 | + <div slot="header" class="flex justify-between"> | |
| 19 | + <span>{{ $t('feeConfigManage.queryCondition') }}</span> | |
| 20 | + <el-button type="text" style="float: right;" @click="_moreCondition()"> | |
| 21 | + {{ moreCondition ? $t('feeConfigManage.hide') : $t('feeConfigManage.more') }} | |
| 22 | + </el-button> | |
| 23 | + </div> | |
| 24 | + <el-form :model="conditions" label-width="0"> | |
| 25 | + <el-row :gutter="20"> | |
| 26 | + <el-col :span="4"> | |
| 27 | + <el-form-item> | |
| 28 | + <el-input v-model="conditions.configId" :placeholder="$t('feeConfigManage.enterFeeItemId')" /> | |
| 29 | + </el-form-item> | |
| 30 | + </el-col> | |
| 31 | + <el-col :span="4"> | |
| 32 | + <el-form-item> | |
| 33 | + <el-input v-model="conditions.feeName" :placeholder="$t('feeConfigManage.enterFeeItem')" /> | |
| 34 | + </el-form-item> | |
| 35 | + </el-col> | |
| 36 | + <el-col :span="4"> | |
| 37 | + <el-form-item> | |
| 38 | + <el-select v-model="conditions.feeFlag" :placeholder="$t('feeConfigManage.selectFeeFlag')" clearable> | |
| 39 | + <el-option v-for="item in feeFlags" :key="item.statusCd" :label="item.name" :value="item.statusCd" /> | |
| 40 | + </el-select> | |
| 41 | + </el-form-item> | |
| 42 | + </el-col> | |
| 43 | + <el-col :span="4"> | |
| 44 | + <el-form-item> | |
| 45 | + <el-select v-model="conditions.paymentCd" :placeholder="$t('feeConfigManage.selectPaymentType')" | |
| 46 | + clearable> | |
| 47 | + <el-option v-for="item in paymentCds" :key="item.statusCd" :label="item.name" | |
| 48 | + :value="item.statusCd" /> | |
| 49 | + </el-select> | |
| 50 | + </el-form-item> | |
| 51 | + </el-col> | |
| 52 | + <el-col :span="4"> | |
| 53 | + <el-form-item> | |
| 54 | + <el-select v-model="conditions.deductFrom" :placeholder="$t('feeConfigManage.selectAccountDeduction')" | |
| 55 | + clearable> | |
| 56 | + <el-option label="是" value="Y" /> | |
| 57 | + <el-option label="否" value="N" /> | |
| 58 | + </el-select> | |
| 59 | + </el-form-item> | |
| 60 | + </el-col> | |
| 61 | + <el-col :span="4"> | |
| 62 | + <el-form-item> | |
| 63 | + <el-button type="primary" @click="_queryFeeConfigMethod"> | |
| 64 | + {{ $t('common.query') }} | |
| 65 | + </el-button> | |
| 66 | + <el-button @click="_resetFeeConfigMethod" style="margin-left: 10px;"> | |
| 67 | + {{ $t('common.reset') }} | |
| 68 | + </el-button> | |
| 69 | + </el-form-item> | |
| 70 | + </el-col> | |
| 71 | + </el-row> | |
| 72 | + <el-row v-show="moreCondition" :gutter="20"> | |
| 73 | + <el-col :span="4"> | |
| 74 | + <el-form-item> | |
| 75 | + <el-select v-model="conditions.isDefault" :placeholder="$t('feeConfigManage.selectDefaultFee')" | |
| 76 | + clearable> | |
| 77 | + <el-option v-for="item in isDefaults" :key="item.statusCd" :label="item.name" | |
| 78 | + :value="item.statusCd" /> | |
| 79 | + </el-select> | |
| 80 | + </el-form-item> | |
| 81 | + </el-col> | |
| 82 | + </el-row> | |
| 83 | + </el-form> | |
| 84 | + </el-card> | |
| 85 | + | |
| 86 | + <el-card class="ibox"> | |
| 87 | + <div slot="header" class="flex justify-between"> | |
| 88 | + <span>{{ $t('feeConfigManage.feeItems') }}</span> | |
| 89 | + <div style="float: right;"> | |
| 90 | + <el-button type="primary" size="small" icon="el-icon-document" @click="showMarkdown"> | |
| 91 | + {{ $t('common.document') }} | |
| 92 | + </el-button> | |
| 93 | + <el-button v-if="hasPrivilege('502022022571930560')" type="primary" size="small" | |
| 94 | + @click="_openAddFeeConfigModal"> | |
| 95 | + {{ $t('common.add') }} | |
| 96 | + </el-button> | |
| 97 | + </div> | |
| 98 | + </div> | |
| 99 | + | |
| 100 | + <el-table :data="feeConfigs" border style="width: 100%"> | |
| 101 | + <el-table-column prop="configId" :label="$t('feeConfigManage.number')" align="center" /> | |
| 102 | + <el-table-column prop="feeTypeCdName" :label="$t('feeConfigManage.feeType')" align="center" /> | |
| 103 | + <el-table-column prop="feeName" :label="$t('feeConfigManage.feeItem')" align="center" /> | |
| 104 | + <el-table-column prop="feeFlagName" :label="$t('feeConfigManage.feeFlag')" align="center" /> | |
| 105 | + <el-table-column :label="$t('feeConfigManage.paymentType')" align="center"> | |
| 106 | + <template slot-scope="scope"> | |
| 107 | + {{ scope.row.paymentCd == '1200' ? $t('feeConfigManage.prepaid') : $t('feeConfigManage.postpaid') }} | |
| 108 | + </template> | |
| 109 | + </el-table-column> | |
| 110 | + <el-table-column prop="paymentCycle" :label="$t('feeConfigManage.paymentCycle')" align="center" /> | |
| 111 | + <el-table-column prop="computingFormulaName" :label="$t('feeConfigManage.formula')" align="center" /> | |
| 112 | + <el-table-column :label="$t('feeConfigManage.unitPrice')" align="center"> | |
| 113 | + <template slot-scope="scope"> | |
| 114 | + {{ scope.row.computingFormula == '2002' ? '-' : scope.row.squarePrice }} | |
| 115 | + </template> | |
| 116 | + </el-table-column> | |
| 117 | + <el-table-column prop="additionalAmount" :label="$t('feeConfigManage.additionalFee')" align="center" /> | |
| 118 | + <el-table-column :label="$t('feeConfigManage.accountDeduction')" align="center"> | |
| 119 | + <template slot-scope="scope"> | |
| 120 | + {{ scope.row.deductFrom == 'Y' ? $t('common.yes') : $t('common.no') }} | |
| 121 | + </template> | |
| 122 | + </el-table-column> | |
| 123 | + <el-table-column :label="$t('common.status')" align="center"> | |
| 124 | + <template slot-scope="scope"> | |
| 125 | + {{ scope.row.state == 'Y' ? $t('common.enabled') : $t('common.disabled') }} | |
| 126 | + </template> | |
| 127 | + </el-table-column> | |
| 128 | + <el-table-column :label="$t('common.operation')" align="center" width="280"> | |
| 129 | + <template slot-scope="scope"> | |
| 130 | + <el-button v-if="hasPrivilege('502022022549630561')" type="text" | |
| 131 | + @click="_openEditFeeConfigModel(scope.row)"> | |
| 132 | + {{ $t('common.edit') }} | |
| 133 | + </el-button> | |
| 134 | + <el-button type="text" @click="_settingConfigDiscount(scope.row)"> | |
| 135 | + {{ $t('feeConfigManage.discount') }} | |
| 136 | + </el-button> | |
| 137 | + <el-button v-if="scope.row.isDefault == 'F' && hasPrivilege('502022022586400562')" type="text" | |
| 138 | + @click="_openDeleteFeeConfigModel(scope.row)"> | |
| 139 | + {{ $t('common.delete') }} | |
| 140 | + </el-button> | |
| 141 | + <el-button type="text" @click="_openFeeConfigDetail(scope.row)"> | |
| 142 | + {{ $t('common.detail') }} | |
| 143 | + </el-button> | |
| 144 | + </template> | |
| 145 | + </el-table-column> | |
| 146 | + </el-table> | |
| 147 | + | |
| 148 | + <el-row :gutter="20" style="margin-top: 15px;"> | |
| 149 | + <el-col :span="18" class="text-left"> | |
| 150 | + <div> | |
| 151 | + <p>{{ $t('feeConfigManage.feeFlagTip') }}</p> | |
| 152 | + <p>{{ $t('feeConfigManage.paymentTypeTip') }}</p> | |
| 153 | + <p>{{ $t('feeConfigManage.accountDeductionTip') }}</p> | |
| 154 | + </div> | |
| 155 | + </el-col> | |
| 156 | + <el-col :span="6"> | |
| 157 | + <el-pagination :current-page.sync="curPage" :page-size="pageSize" :total="total" | |
| 158 | + layout="total, prev, pager, next" @current-change="handlePageChange" /> | |
| 159 | + </el-col> | |
| 160 | + </el-row> | |
| 161 | + </el-card> | |
| 162 | + </el-col> | |
| 163 | + </el-row> | |
| 164 | + | |
| 165 | + <add-fee-config ref="addFeeConfig" @success="handleSuccess" /> | |
| 166 | + <edit-fee-config ref="editFeeConfig" @success="handleSuccess" /> | |
| 167 | + <delete-fee-config ref="deleteFeeConfig" @success="handleSuccess" /> | |
| 168 | + </div> | |
| 169 | +</template> | |
| 170 | + | |
| 171 | +<script> | |
| 172 | +import { listFeeConfigs } from '@/api/fee/feeConfigManageApi' | |
| 173 | +import AddFeeConfig from '@/components/fee/addFeeConfig' | |
| 174 | +import EditFeeConfig from '@/components/fee/editFeeConfig' | |
| 175 | +import DeleteFeeConfig from '@/components/fee/deleteFeeConfig' | |
| 176 | +import {getDict} from '@/api/community/communityApi' | |
| 177 | + | |
| 178 | +export default { | |
| 179 | + name: 'FeeConfigManageList', | |
| 180 | + components: { | |
| 181 | + AddFeeConfig, | |
| 182 | + EditFeeConfig, | |
| 183 | + DeleteFeeConfig | |
| 184 | + }, | |
| 185 | + data() { | |
| 186 | + return { | |
| 187 | + feeTypeCds: [], | |
| 188 | + feeFlags: [], | |
| 189 | + paymentCds: [], | |
| 190 | + isDefaults: [], | |
| 191 | + feeConfigs: [], | |
| 192 | + total: 0, | |
| 193 | + curPage: 1, | |
| 194 | + pageSize: 10, | |
| 195 | + moreCondition: false, | |
| 196 | + conditions: { | |
| 197 | + configId: '', | |
| 198 | + feeFlag: '', | |
| 199 | + feeName: '', | |
| 200 | + feeTypeCd: '', | |
| 201 | + isDefault: 'F', | |
| 202 | + paymentCd: '', | |
| 203 | + deductFrom: '' | |
| 204 | + } | |
| 205 | + } | |
| 206 | + }, | |
| 207 | + created() { | |
| 208 | + this._listFeeConfigs() | |
| 209 | + this.loadDicts() | |
| 210 | + }, | |
| 211 | + methods: { | |
| 212 | + async loadDicts() { | |
| 213 | + | |
| 214 | + const data = await getDict('pay_fee_config', 'fee_type_cd') | |
| 215 | + this.feeTypeCds = data | |
| 216 | + }, | |
| 217 | + | |
| 218 | + async _listFeeConfigs() { | |
| 219 | + try { | |
| 220 | + const params = { | |
| 221 | + ...this.conditions, | |
| 222 | + page: this.curPage, | |
| 223 | + row: this.pageSize, | |
| 224 | + communityId: this.getCommunityId() | |
| 225 | + } | |
| 226 | + | |
| 227 | + const { feeConfigs, total } = await listFeeConfigs(params) | |
| 228 | + this.feeConfigs = feeConfigs | |
| 229 | + this.total = total | |
| 230 | + } catch (error) { | |
| 231 | + this.$message.error(this.$t('common.loadFail')) | |
| 232 | + } | |
| 233 | + }, | |
| 234 | + | |
| 235 | + _queryFeeConfigMethod() { | |
| 236 | + this.curPage = 1 | |
| 237 | + this._listFeeConfigs() | |
| 238 | + }, | |
| 239 | + | |
| 240 | + _resetFeeConfigMethod() { | |
| 241 | + this.conditions = { | |
| 242 | + configId: '', | |
| 243 | + feeFlag: '', | |
| 244 | + feeName: '', | |
| 245 | + feeTypeCd: '', | |
| 246 | + isDefault: 'F', | |
| 247 | + paymentCd: '', | |
| 248 | + deductFrom: '' | |
| 249 | + } | |
| 250 | + this.curPage = 1 | |
| 251 | + this._listFeeConfigs() | |
| 252 | + }, | |
| 253 | + | |
| 254 | + _moreCondition() { | |
| 255 | + this.moreCondition = !this.moreCondition | |
| 256 | + }, | |
| 257 | + | |
| 258 | + swatchFeeTypeCd(item) { | |
| 259 | + this.conditions.feeTypeCd = item.statusCd | |
| 260 | + this._listFeeConfigs() | |
| 261 | + }, | |
| 262 | + | |
| 263 | + _openAddFeeConfigModal() { | |
| 264 | + this.$refs.addFeeConfig.open() | |
| 265 | + }, | |
| 266 | + | |
| 267 | + _openEditFeeConfigModel(feeConfig) { | |
| 268 | + this.$refs.editFeeConfig.open(feeConfig) | |
| 269 | + }, | |
| 270 | + | |
| 271 | + _openDeleteFeeConfigModel(feeConfig) { | |
| 272 | + this.$refs.deleteFeeConfig.open(feeConfig) | |
| 273 | + }, | |
| 274 | + | |
| 275 | + _settingConfigDiscount(feeConfig) { | |
| 276 | + this.$router.push({ | |
| 277 | + path: '/fee/payFeeConfigDiscountManage', | |
| 278 | + query: { | |
| 279 | + configId: feeConfig.configId, | |
| 280 | + feeName: feeConfig.feeName | |
| 281 | + } | |
| 282 | + }) | |
| 283 | + }, | |
| 284 | + | |
| 285 | + _openFeeConfigDetail(feeConfig) { | |
| 286 | + window.open(`/#/fee/feeConfigDetail?configId=${feeConfig.configId}`) | |
| 287 | + }, | |
| 288 | + | |
| 289 | + handlePageChange(page) { | |
| 290 | + this.curPage = page | |
| 291 | + this._listFeeConfigs() | |
| 292 | + }, | |
| 293 | + | |
| 294 | + handleSuccess() { | |
| 295 | + this._listFeeConfigs() | |
| 296 | + }, | |
| 297 | + | |
| 298 | + showMarkdown() { | |
| 299 | + // 显示文档的实现 | |
| 300 | + } | |
| 301 | + } | |
| 302 | +} | |
| 303 | +</script> | |
| 304 | + | |
| 305 | +<style scoped> | |
| 306 | +.border-radius { | |
| 307 | + border-radius: 4px; | |
| 308 | + border: 1px solid #ebeef5; | |
| 309 | + background: #fff; | |
| 310 | +} | |
| 311 | + | |
| 312 | +.list-group { | |
| 313 | + list-style: none; | |
| 314 | + padding: 0; | |
| 315 | + margin: 0; | |
| 316 | +} | |
| 317 | + | |
| 318 | +.list-group-item { | |
| 319 | + padding: 12px 15px; | |
| 320 | + cursor: pointer; | |
| 321 | + border-bottom: 1px solid #ebeef5; | |
| 322 | +} | |
| 323 | + | |
| 324 | +.list-group-item:hover { | |
| 325 | + background-color: #f5f7fa; | |
| 326 | +} | |
| 327 | + | |
| 328 | +.vc-node-selected { | |
| 329 | + background-color: #ecf5ff; | |
| 330 | + color: #409eff; | |
| 331 | + font-weight: bold; | |
| 332 | +} | |
| 333 | + | |
| 334 | +.margin-xs-r { | |
| 335 | + margin-right: 5px; | |
| 336 | +} | |
| 337 | + | |
| 338 | +.ibox { | |
| 339 | + margin-bottom: 20px; | |
| 340 | +} | |
| 341 | +</style> | |
| 0 | 342 | \ No newline at end of file | ... | ... |