Commit b0222bb0457544f84548bb9237900fe934df6c62

Authored by wuxw
1 parent 2e006672

v1.9 优化加入费用拆分功能和费用合并功能

src/api/fee/feeDetailSubApi.js
... ... @@ -27,11 +27,7 @@ export function listFee(params) {
27 27 params
28 28 }).then(response => {
29 29 const res = response.data
30   - if (res.code === 0) {
31 30 resolve(res)
32   - } else {
33   - reject(new Error(res.msg || 'Failed to get fee list'))
34   - }
35 31 }).catch(error => {
36 32 reject(error)
37 33 })
... ...
src/components/fee/feeDetailSub.vue
... ... @@ -3,7 +3,7 @@
3 3 <el-row>
4 4 <el-col :span="24" class="text-right">
5 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 7 {{ $t('feeDetailSub.split') }}
8 8 </el-button>
9 9 </el-col>
... ... @@ -49,8 +49,8 @@
49 49 </el-col>
50 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 54 </div>
55 55 </template>
56 56  
... ...
src/components/fee/mergeFee.vue
... ... @@ -5,13 +5,8 @@
5 5 width="50%"
6 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 10 <span slot="footer" class="dialog-footer">
16 11 <el-button @click="closeMergeFeeModel">{{ $t('mergeFee.cancel') }}</el-button>
17 12 <el-button type="primary" @click="_doMergeFee">{{ $t('mergeFee.confirmMerge') }}</el-button>
... ... @@ -50,7 +45,7 @@ export default {
50 45 const res = await mergePayFee(params)
51 46 if (res.code === 0) {
52 47 this.closeMergeFeeModel()
53   - this.$emit('merge-success')
  48 + this.$emit('success')
54 49 this.$message.success(this.$t('common.operationSuccess'))
55 50 } else {
56 51 this.$message.error(res.msg)
... ...
src/components/fee/splitFee.vue
1 1 <template>
2 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 4 <el-form-item :label="$t('splitFee.timePeriod')">
5 5 <div>{{ splitFeeInfo.endTime }} ~ {{ splitFeeInfo.deadlineTime }}</div>
6 6 </el-form-item>
... ... @@ -33,6 +33,8 @@
33 33  
34 34 <script>
35 35 import { splitFee } from '@/api/fee/listCarFeeApi'
  36 +import {dateFormat} from '@/utils/dateUtil'
  37 +import {getCommunityId} from '@/api/community/communityApi'
36 38  
37 39 export default {
38 40 name: 'SplitFee',
... ... @@ -52,7 +54,7 @@ export default {
52 54 open(fee) {
53 55 this.splitFeeInfo = {
54 56 feeId: fee.feeId,
55   - endTime: this.$formatDate(fee.endTime),
  57 + endTime: dateFormat(fee.endTime),
56 58 deadlineTime: this._computeSplitDeadLineTime(fee),
57 59 splitTime: '',
58 60 remark: ''
... ... @@ -71,6 +73,7 @@ export default {
71 73 const data = {
72 74 preFeeId: this.splitFeeInfo.feeId,
73 75 splitTime: this.splitFeeInfo.splitTime,
  76 + communityId:getCommunityId(),
74 77 remark: this.splitFeeInfo.remark
75 78 }
76 79  
... ...
src/views/fee/feeDetailLang.js
... ... @@ -243,6 +243,16 @@ export const messages = {
243 243 },
244 244 feeDetailSubDemo: {
245 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 258 zh: {
... ... @@ -488,6 +498,16 @@ export const messages = {
488 498 },
489 499 feeDetailSubDemo: {
490 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 }
... ...