Commit b0222bb0457544f84548bb9237900fe934df6c62
1 parent
2e006672
v1.9 优化加入费用拆分功能和费用合并功能
Showing
5 changed files
with
31 additions
and
17 deletions
src/api/fee/feeDetailSubApi.js
| @@ -27,11 +27,7 @@ export function listFee(params) { | @@ -27,11 +27,7 @@ export function listFee(params) { | ||
| 27 | params | 27 | params |
| 28 | }).then(response => { | 28 | }).then(response => { |
| 29 | const res = response.data | 29 | const res = response.data |
| 30 | - if (res.code === 0) { | ||
| 31 | resolve(res) | 30 | resolve(res) |
| 32 | - } else { | ||
| 33 | - reject(new Error(res.msg || 'Failed to get fee list')) | ||
| 34 | - } | ||
| 35 | }).catch(error => { | 31 | }).catch(error => { |
| 36 | reject(error) | 32 | reject(error) |
| 37 | }) | 33 | }) |
src/components/fee/feeDetailSub.vue
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | <el-row> | 3 | <el-row> |
| 4 | <el-col :span="24" class="text-right"> | 4 | <el-col :span="24" class="text-right"> |
| 5 | <el-button type="primary" size="small" style="margin-left: 10px" | 5 | <el-button type="primary" size="small" style="margin-left: 10px" |
| 6 | - v-if="hasPrivilege('502020090427190001') && feeDetailSubInfo.fee.state === '2008001'" @click="_splitPayFee"> | 6 | + v-if="hasPrivilege('502020090427190001') && feeDetailSubInfo.fee.state == '2008001'" @click="_splitPayFee"> |
| 7 | {{ $t('feeDetailSub.split') }} | 7 | {{ $t('feeDetailSub.split') }} |
| 8 | </el-button> | 8 | </el-button> |
| 9 | </el-col> | 9 | </el-col> |
| @@ -49,8 +49,8 @@ | @@ -49,8 +49,8 @@ | ||
| 49 | </el-col> | 49 | </el-col> |
| 50 | </el-row> | 50 | </el-row> |
| 51 | 51 | ||
| 52 | - <merge-fee ref="mergeFee" @merge-success="loadData" /> | ||
| 53 | - <split-fee ref="splitFee" @split-success="loadData" /> | 52 | + <merge-fee ref="mergeFee" @success="loadData" /> |
| 53 | + <split-fee ref="splitFee" @success="loadData" /> | ||
| 54 | </div> | 54 | </div> |
| 55 | </template> | 55 | </template> |
| 56 | 56 |
src/components/fee/mergeFee.vue
| @@ -5,13 +5,8 @@ | @@ -5,13 +5,8 @@ | ||
| 5 | width="50%" | 5 | width="50%" |
| 6 | :before-close="closeMergeFeeModel" | 6 | :before-close="closeMergeFeeModel" |
| 7 | > | 7 | > |
| 8 | - <el-table :data="[]" border style="width: 100%"> | ||
| 9 | - <el-table-column align="center"> | ||
| 10 | - <template > | ||
| 11 | - {{ $t('mergeFee.mergeDescription') }} | ||
| 12 | - </template> | ||
| 13 | - </el-table-column> | ||
| 14 | - </el-table> | 8 | + {{ $t('mergeFee.mergeDescription') }} |
| 9 | + | ||
| 15 | <span slot="footer" class="dialog-footer"> | 10 | <span slot="footer" class="dialog-footer"> |
| 16 | <el-button @click="closeMergeFeeModel">{{ $t('mergeFee.cancel') }}</el-button> | 11 | <el-button @click="closeMergeFeeModel">{{ $t('mergeFee.cancel') }}</el-button> |
| 17 | <el-button type="primary" @click="_doMergeFee">{{ $t('mergeFee.confirmMerge') }}</el-button> | 12 | <el-button type="primary" @click="_doMergeFee">{{ $t('mergeFee.confirmMerge') }}</el-button> |
| @@ -50,7 +45,7 @@ export default { | @@ -50,7 +45,7 @@ export default { | ||
| 50 | const res = await mergePayFee(params) | 45 | const res = await mergePayFee(params) |
| 51 | if (res.code === 0) { | 46 | if (res.code === 0) { |
| 52 | this.closeMergeFeeModel() | 47 | this.closeMergeFeeModel() |
| 53 | - this.$emit('merge-success') | 48 | + this.$emit('success') |
| 54 | this.$message.success(this.$t('common.operationSuccess')) | 49 | this.$message.success(this.$t('common.operationSuccess')) |
| 55 | } else { | 50 | } else { |
| 56 | this.$message.error(res.msg) | 51 | this.$message.error(res.msg) |
src/components/fee/splitFee.vue
| 1 | <template> | 1 | <template> |
| 2 | <el-dialog :title="$t('splitFee.title')" :visible.sync="visible" width="50%"> | 2 | <el-dialog :title="$t('splitFee.title')" :visible.sync="visible" width="50%"> |
| 3 | - <el-form :model="splitFeeInfo" label-width="120px"> | 3 | + <el-form :model="splitFeeInfo" label-width="120px" class="text-left"> |
| 4 | <el-form-item :label="$t('splitFee.timePeriod')"> | 4 | <el-form-item :label="$t('splitFee.timePeriod')"> |
| 5 | <div>{{ splitFeeInfo.endTime }} ~ {{ splitFeeInfo.deadlineTime }}</div> | 5 | <div>{{ splitFeeInfo.endTime }} ~ {{ splitFeeInfo.deadlineTime }}</div> |
| 6 | </el-form-item> | 6 | </el-form-item> |
| @@ -33,6 +33,8 @@ | @@ -33,6 +33,8 @@ | ||
| 33 | 33 | ||
| 34 | <script> | 34 | <script> |
| 35 | import { splitFee } from '@/api/fee/listCarFeeApi' | 35 | import { splitFee } from '@/api/fee/listCarFeeApi' |
| 36 | +import {dateFormat} from '@/utils/dateUtil' | ||
| 37 | +import {getCommunityId} from '@/api/community/communityApi' | ||
| 36 | 38 | ||
| 37 | export default { | 39 | export default { |
| 38 | name: 'SplitFee', | 40 | name: 'SplitFee', |
| @@ -52,7 +54,7 @@ export default { | @@ -52,7 +54,7 @@ export default { | ||
| 52 | open(fee) { | 54 | open(fee) { |
| 53 | this.splitFeeInfo = { | 55 | this.splitFeeInfo = { |
| 54 | feeId: fee.feeId, | 56 | feeId: fee.feeId, |
| 55 | - endTime: this.$formatDate(fee.endTime), | 57 | + endTime: dateFormat(fee.endTime), |
| 56 | deadlineTime: this._computeSplitDeadLineTime(fee), | 58 | deadlineTime: this._computeSplitDeadLineTime(fee), |
| 57 | splitTime: '', | 59 | splitTime: '', |
| 58 | remark: '' | 60 | remark: '' |
| @@ -71,6 +73,7 @@ export default { | @@ -71,6 +73,7 @@ export default { | ||
| 71 | const data = { | 73 | const data = { |
| 72 | preFeeId: this.splitFeeInfo.feeId, | 74 | preFeeId: this.splitFeeInfo.feeId, |
| 73 | splitTime: this.splitFeeInfo.splitTime, | 75 | splitTime: this.splitFeeInfo.splitTime, |
| 76 | + communityId:getCommunityId(), | ||
| 74 | remark: this.splitFeeInfo.remark | 77 | remark: this.splitFeeInfo.remark |
| 75 | } | 78 | } |
| 76 | 79 |
src/views/fee/feeDetailLang.js
| @@ -243,6 +243,16 @@ export const messages = { | @@ -243,6 +243,16 @@ export const messages = { | ||
| 243 | }, | 243 | }, |
| 244 | feeDetailSubDemo: { | 244 | feeDetailSubDemo: { |
| 245 | openComponent: 'Open Fee Detail Sub Component' | 245 | openComponent: 'Open Fee Detail Sub Component' |
| 246 | + }, | ||
| 247 | + splitFee: { | ||
| 248 | + title: 'Split Fee', | ||
| 249 | + timePeriod: 'Time Period', | ||
| 250 | + splitTime: 'Split Time', | ||
| 251 | + splitTimePlaceholder: 'Please select split time', | ||
| 252 | + note: 'Note: The split time must be within the billing period', | ||
| 253 | + remark: 'Remark', | ||
| 254 | + remarkPlaceholder: 'Please enter remark', | ||
| 255 | + splitTimeRequired: 'Split time is required' | ||
| 246 | } | 256 | } |
| 247 | }, | 257 | }, |
| 248 | zh: { | 258 | zh: { |
| @@ -488,6 +498,16 @@ export const messages = { | @@ -488,6 +498,16 @@ export const messages = { | ||
| 488 | }, | 498 | }, |
| 489 | feeDetailSubDemo: { | 499 | feeDetailSubDemo: { |
| 490 | openComponent: '打开费用子详情组件' | 500 | openComponent: '打开费用子详情组件' |
| 501 | + }, | ||
| 502 | + splitFee: { | ||
| 503 | + title: '拆分费用', | ||
| 504 | + timePeriod: '时间段', | ||
| 505 | + splitTime: '拆分时间', | ||
| 506 | + splitTimePlaceholder: '请选择拆分时间', | ||
| 507 | + note: '注意:拆分时间必须在计费时间段内', | ||
| 508 | + remark: '备注', | ||
| 509 | + remarkPlaceholder: '请输入备注', | ||
| 510 | + splitTimeRequired: '拆分时间不能为空' | ||
| 491 | } | 511 | } |
| 492 | } | 512 | } |
| 493 | } | 513 | } |