jiangping
2024-12-23 406dc15a07638f1e6354fb57e2e5dace603c3248
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
<template>
  <GlobalWindow
    :title="title"
    :visible.sync="visible"
    :withFooter="false"
    :confirm-working="isWorking"
    @close="close"
    @confirm="confirm">
    <div style="width: 100%; position: sticky; top: 0; left: 0; z-index: 999; background: #ffffff;">
      <div class="home_title" v-if="info">
        <div class="left">
          <span class="mr10">单位名称:{{info.renterName}}</span>
          <el-tag type="success" v-if="info.status === 0">待执行</el-tag>
          <el-tag type="success" v-if="info.status === 1">正常执行中</el-tag>
          <el-tag type="info" v-if="info.status === 2">已到期</el-tag>
          <el-tag type="info" v-if="info.status === 3">退租结算中</el-tag>
          <el-tag type="info" v-if="info.status === 4">已退租</el-tag>
        </div>
        <el-button plain type="danger" v-if="[0, 1, 2].includes(info.status)" @click="refund">退租</el-button>
      </div>
      <div class="remark" v-if="info">{{info.remark}}</div>
      <div class="remark" v-if="info && info.status === 3">{{info.btRemark}}</div>
      <div class="tabs">
        <div class="tab" :class="{ active: activeTabs === 0 }" @click="tabsClick(0)">合同信息</div>
        <div class="tab" :class="{ active: activeTabs === 1 }" @click="tabsClick(1)">关联账单</div>
        <div class="tab" :class="{ active: activeTabs === 2 }" @click="tabsClick(2)">操作记录</div>
      </div>
    </div>
    <div class="main" v-if="activeTabs === 0 && info">
      <div class="title">基础信息</div>
      <div class="list">
        <div class="item">
          <div class="la">合同编号</div>
          <div class="val">{{ info.code }}</div>
        </div>
        <div class="item">
          <div class="la">经办人</div>
          <div class="val">{{ info.userName }}</div>
        </div>
        <div class="item">
          <div class="la">创建人</div>
          <div class="val">{{ info.creatorName }}</div>
        </div>
        <div class="item">
          <div class="la">合同租赁数</div>
          <div class="val">{{ info.totalArea }}㎡</div>
        </div>
        <div class="item">
          <div class="la">所属公司</div>
          <div class="val">{{ info.companyName }}</div>
        </div>
        <div class="item">
          <div class="la">签订日期</div>
          <div class="val">{{ info.signDate }}</div>
        </div>
        <div class="item">
          <div class="la">开始日期</div>
          <div class="val">{{ info.startDate }}</div>
        </div>
        <div class="item">
          <div class="la">结束日期</div>
          <div class="val">{{ info.endDate }}</div>
        </div>
        <div class="item">
          <div class="la">所属项目</div>
          <div class="val">{{ info.projectName }}</div>
        </div>
        <div class="item">
          <div class="la">结果取整(四舍五入)</div>
          <div class="val">{{ info.roundedUp === 1 ? '是' : '否' }}</div>
        </div>
      </div>
      <div class="title">房源信息</div>
      <div class="list">
        <el-table :data="info.roomList" stripe>
          <el-table-column prop="projectName" label="项目名称" show-overflow-tooltip />
          <el-table-column prop="buildingName" label="楼宇名称" show-overflow-tooltip />
          <el-table-column prop="" label="楼层/房号" show-overflow-tooltip>
            <template slot-scope="{row}">
              {{row.floorName}}/{{row.code}}
            </template>
          </el-table-column>
          <el-table-column prop="area" label="面积" show-overflow-tooltip>
            <template slot-scope="{row}">
              {{row.area}}㎡
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div class="title">租客信息</div>
      <div class="list">
        <div class="item">
          <div class="la">租客</div>
          <div class="val">{{ info.renterName }}</div>
        </div>
        <div class="item">
          <div class="la">经办人</div>
          <div class="val">{{ info.userName }}</div>
        </div>
      </div>
      <div class="title" v-if="info.type === 2 || info.type === 0">租赁条款</div>
      <div class="list" style="background: #F7F7F7; padding: 15px 20px;" v-if="info.type === 2 || info.type === 0">
        <div class="item">
          <div class="la">押金金额</div>
          <div class="val">{{ info.zlDeposit }}元</div>
        </div>
        <div class="item">
          <div class="la">付款方式</div>
          <div class="val" v-if="info.zlPayType === 0">一次性付款</div>
          <div class="val" v-if="info.zlPayType === 1">每三个月一付</div>
          <div class="val" v-if="info.zlPayType === 2">六个月一付</div>
          <div class="val" v-if="info.zlPayType === 3">一年一付</div>
        </div>
        <div class="item">
          <div class="la">免租期</div>
          <div class="val" v-if="info.zlFreeStartDate && info.zlFreeEndDate">
            {{ info.zlFreeStartDate }} ~ {{ info.zlFreeEndDate }}
          </div>
          <div class="val" v-else>
            -
          </div>
        </div>
      </div>
      <el-table :data="info.zlDetailList" stripe style="margin-bottom: 20px;" v-if="info.type === 2 || info.type === 0">
        <el-table-column prop="startDate" label="开始日期" :key="Date.now()" min-width="100" show-overflow-tooltip />
        <el-table-column prop="endDate" label="结束日期" :key="Date.now()" min-width="100" show-overflow-tooltip />
        <el-table-column label="合同单价" min-width="100" show-overflow-tooltip>
          <template slot-scope="{row}">
            {{row.price}} {{returnUnit(row.circleType)}}
          </template>
        </el-table-column>
        <el-table-column label="付款提前天数" min-width="100" show-overflow-tooltip>
          <template slot-scope="{row}">
            <template v-if="row.advanceDays">
              {{row.advanceDays}}天
            </template>
          </template>
        </el-table-column>
      </el-table>
      <div class="title" v-if="info.type === 1 || info.type === 0">物业费条款</div>
      <div class="list" style="background: #F7F7F7; padding: 15px 20px;" v-if="info.type === 1 || info.type === 0">
        <div class="item">
          <div class="la">押金金额</div>
          <div class="val">{{ info.wyDeposit }}元</div>
        </div>
        <div class="item">
          <div class="la">付款方式</div>
          <div class="val" v-if="info.wyPayType === 0">一次性付款</div>
          <div class="val" v-if="info.wyPayType === 1">每三个月一付</div>
          <div class="val" v-if="info.wyPayType === 2">六个月一付</div>
          <div class="val" v-if="info.wyPayType === 3">一年一付</div>
        </div>
        <div class="item">
          <div class="la">免租期</div>
          <div class="val">{{ info.wyFreeStartDate }} ~ {{ info.wyFreeEndDate }}</div>
        </div>
      </div>
      <el-table :data="info.wyDetailList" stripe style="margin-bottom: 20px;" v-if="info.type === 1 || info.type === 0">
        <el-table-column prop="startDate" label="开始日期" :key="Date.now()" min-width="100" show-overflow-tooltip />
        <el-table-column prop="endDate" label="结束日期" :key="Date.now()" min-width="100" show-overflow-tooltip />
        <el-table-column label="合同单价" min-width="100" show-overflow-tooltip>
          <template slot-scope="{row}">
            {{row.price}} {{returnUnit(row.circleType)}}
          </template>
        </el-table-column>
        <el-table-column label="付款提前天数" min-width="100" show-overflow-tooltip>
          <template slot-scope="{row}">
            {{row.advanceDays}}天
          </template>
        </el-table-column>
      </el-table>
      <div class="title">合同附件</div>
      <div class="list">
        <el-table :data="info.fileList" stripe>
          <el-table-column label="附件名称" show-overflow-tooltip>
            <template slot-scope="{row}">
              <u style="color: #0c6ce3; cursor: pointer;" @click="xiazai(row.fileurlFull)">{{row.name}}</u>
            </template>
          </el-table-column>
          <el-table-column prop="userName" label="操作人" show-overflow-tooltip />
          <el-table-column prop="createDate" label="操作时间" show-overflow-tooltip />
        </el-table>
      </div>
    </div>
    <div class="main" v-if="activeTabs === 1 && info">
      <el-radio-group v-model="type" @change="changeType" style="margin-bottom: 20px;">
        <el-radio-button :label="0">收款账单</el-radio-button>
        <el-radio-button :label="1">付款账单</el-radio-button>
      </el-radio-group>
      <el-table
        :data="tableData"
        border
        v-loading="loading"
        style="width: 100%">
        <el-table-column
          label="费用类型">
          <template slot-scope="{row}">
            <span v-if="row.costType === 0">租赁费</span>
            <span v-if="row.costType === 1">物业费</span>
            <span v-if="row.costType === 2">租赁押金</span>
            <span v-if="row.costType === 3">物业押金</span>
            <span v-if="row.costType === 4">水电费</span>
            <span v-if="row.costType === 5">杂项费</span>
            <span v-if="row.costType === 6">其他</span>
            <span v-if="row.costType === 7">保证金</span>
          </template>
        </el-table-column>
        <el-table-column
          prop="totleFee"
          label="账单金额">
        </el-table-column>
        <el-table-column
          :key="Date.now()"
          prop="receivableFee"
          :label="`应${type === 0 ? '收' : '付'}金额`">
        </el-table-column>
        <el-table-column
          prop="actReceivableFee"
          :label="`实${type === 0 ? '收' : '付'}金额`">
        </el-table-column>
        <el-table-column
          :label="`需${type === 0 ? '收' : '付'}金额`">
          <template slot-scope="{row}">
            <template v-if="type === 0">
              <el-tag type="success" v-if="row.needReceivableFee > 0">收</el-tag>
              <el-tag type="warning" v-else-if="row.needReceivableFee < 0">付</el-tag>
            </template>
            <template v-else>
              <el-tag type="warning" v-if="row.needReceivableFee !== 0">付</el-tag>
            </template>
            <span style="margin-left: 10px;">{{Math.abs(row.needReceivableFee)}}</span>
          </template>
        </el-table-column>
        <el-table-column
          label="账单来源">
          <template slot-scope="{row}">
            <span v-if="row.type === 0">合同账单</span>
            <span v-if="row.type === 1">自建账单</span>
          </template>
        </el-table-column>
        <el-table-column
          width="200"
          label="计费周期">
          <template slot-scope="{row}">
            {{ row.startDate }} ~ {{ row.endDate }}
          </template>
        </el-table-column>
        <el-table-column
          prop="planPayDate"
          label="应收日期">
        </el-table-column>
        <el-table-column
          label="是否逾期">
          <template slot-scope="{row}">
            <span v-if="row.isOverdue === 0">否</span>
            <span v-if="row.isOverdue === 1">是</span>
          </template>
        </el-table-column>
        <el-table-column
          fixed="right"
          label="状态">
          <template slot-scope="{row}">
            <span v-if="row.payStatus === 0">待收款</span>
            <span v-if="row.payStatus === 1">已结清</span>
            <span v-if="row.payStatus === 2">部分结清</span>
            <span v-if="row.payStatus === 3">待付款</span>
            <span v-if="row.payStatus === 4">待退款</span>
            <span v-if="row.payStatus === 5">已关闭</span>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="page"
        :page-sizes="[10, 15, 20, 25]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total">
      </el-pagination>
    </div>
    <div class="main" v-if="activeTabs === 2 && info">
      <div class="title">操作记录</div>
      <el-table
        :data="info.logList"
        border
        style="width: 100%">
        <el-table-column
          :key="Date.now()"
          width="200"
          prop="param1"
          label="操作人">
        </el-table-column>
        <el-table-column
          :key="Date.now()"
          width="200"
          prop="createDate"
          label="操作时间">
        </el-table-column>
        <el-table-column
          :key="Date.now()"
          width="150"
          label="操作">
          <template slot-scope="{row}">
            <span v-if="row.objType === 0">工单创建</span>
            <span v-if="row.objType === 1">指派</span>
            <span v-if="row.objType === 2">处理</span>
            <span v-if="row.objType === 3">合同创建</span>
            <span v-if="row.objType === 4">合同变更</span>
            <span v-if="row.objType === 5">合同退租</span>
          </template>
        </el-table-column>
        <el-table-column
          :key="Date.now()"
          prop="content"
          label="操作内容">
        </el-table-column>
      </el-table>
    </div>
    <!--  退租  -->
    <TerminateLease ref="terminateLease" @success="getData" />
  </GlobalWindow>
</template>
 
<script>
import GlobalWindow from '@/components/common/GlobalWindow'
import BaseOpera from '@/components/base/BaseOpera'
import TerminateLease from './terminateLease'
import { getById } from '@/api/contract'
import { fetchList } from '@/api/bill'
export default {
  components: {
    GlobalWindow,
    TerminateLease
  },
  extends: BaseOpera,
  data() {
    return {
      id: '',
      visible: false,
      activeTabs: 0,
      type: 0,
      info: null,
      pageSize: 10,
      page: 1,
      total: 0,
      tableData: [],
      
      loading: false
    }
  },
  methods: {
    open (title, id) {
      this.title = title
      this.activeTabs = 0
      this.type = 0
      this.page = 1
      this.pageSize = 10
      this.tableData = []
      this.id = id
      this.getData()
    },
    xiazai (url) {
      window.open(url)
    },
    returnUnit (type) {
      switch (type) {
        case 0:
          return '元/m²·天'
        case 1:
          return '元/m²·月'
        case 2:
          return '元/m²·年'
        case 3:
          return '元/天'
        case 4:
          return '元/月'
        case 5:
          return '元/年'
        case 6:
          return '元/场'
      }
    },
    getData () {
      getById(this.id)
        .then(res => {
          this.info = res
          this.getList()
          this.visible = true
        })
    },
    refund () {
      this.$refs.terminateLease.open('新建退租协议', JSON.parse(JSON.stringify(this.info)))
    },
    getList () {
      this.loading = true
      fetchList({
        capacity: this.pageSize,
        page: this.page,
        model: {
          status: 0,
          billType: this.type,
          contractId: this.info.id
        }
      }).then(res => {
        this.loading = false
        this.tableData = res.records
        this.total = res.total
      })
    },
    changeType (e) {
      this.type = e
      this.page = 1
      this.pageSize = 10
      this.tableData = []
      this.getList()
    },
    tabsClick(val) {
      this.activeTabs = val
    },
    getDetail() {
 
    },
    handleSizeChange (e) {
      this.pageSize = e
      this.getList()
    },
    handleCurrentChange (e) {
      this.page = e
      this.getList()
    }
  }
}
</script>
 
<style lang="scss" scoped>
@import '@/assets/style/variables.scss';
.home_title {
  display: flex;
  justify-content: space-between;
  align-items: center;
 
  .left {
    font-weight: 500;
    font-size: 16px;
    margin-right: 10px;
    display: flex;
    align-items: center;
 
    .status {
      padding: 0 6px;
      height: 22px;
      line-height: 22px;
      border-radius: 2px;
      border: 1px solid #00BA92;
      color: #00BA92;
      font-weight: 400;
      font-size: 12px;
      color: #00BA92;
    }
  }
}
 
.remark {
  background: #E8EBF7;
  border-radius: 2px;
  padding: 10px 20px;
  font-size: 16px;
  margin: 20px 0
}
 
.tabs {
  border-bottom: 1px solid #DFE2E8;
  display: flex;
  margin-bottom: 20px;
  .tab {
    height: 58px;
    line-height: 58px;
    font-size: 16px;
    color: #666666;
    margin-right: 30px;
    cursor: pointer;
  }
 
  .active {
    font-weight: 500;
    color: $primary-color;
    border-bottom: 2px solid $primary-color;
  }
}
 
.main {
  .title {
    font-weight: 500;
    font-size: 18px;
    color: $primary-color;
    margin-bottom: 15px;
  }
 
  .list {
    display: flex;
    flex-wrap: wrap;
    /*background: #F7F7F7;*/
    border-radius: 2px;
    /*padding: 15px 20px;*/
    margin-bottom: 20px;
 
    .item {
      width: 25%;
      margin-bottom: 16px;
 
      .la {
        color: #7f7f7f;
        margin-bottom: 10px;
      }
    }
  }
}
</style>