From a7db7823a897726e3692077729880f24a2c1314c Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期日, 01 十二月 2024 22:26:33 +0800
Subject: [PATCH] 开发
---
admin/src/views/contract/components/terminateLease.vue | 116 ++++++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 84 insertions(+), 32 deletions(-)
diff --git a/admin/src/views/contract/components/terminateLease.vue b/admin/src/views/contract/components/terminateLease.vue
index ed32531..31fda94 100644
--- a/admin/src/views/contract/components/terminateLease.vue
+++ b/admin/src/views/contract/components/terminateLease.vue
@@ -24,9 +24,11 @@
</el-select>
</el-form-item>
<el-form-item label="閫�绉熸棩鏈�" prop="btDate" style="width: 33%;">
+<!-- @change="changeBtDate"-->
<el-date-picker
v-model="form.btDate"
type="date"
+ @change="changeBtDate"
value-format="yyyy-MM-dd"
placeholder="璇烽�夋嫨">
</el-date-picker>
@@ -69,13 +71,14 @@
<div class="title">
<span>閫�绉熶俊鎭�</span>
<div style="display: flex; align-items: center;">
- <el-button type="primary" @click="$refs.addCollectionBill.open('鍒涘缓鏀舵璐﹀崟', { contractCode: info.code, contractId: info.id, renterName: info.renterName, renterId: info.renterId, billType: 0, billTypeCopy: 0, feeType: 0 })">娣诲姞鏀舵</el-button>
- <el-button type="primary" @click="$refs.AddPaymentBill.open('鍒涘缓浠樻璐﹀崟', { contractCode: info.code, contractId: info.id, renterName: info.renterName, renterId: info.renterId, billType: 1, billTypeCopy: 1 })">娣诲姞浠樻</el-button>
+ <el-button type="primary" @click="addZD">娣诲姞鏀舵</el-button>
+ <el-button type="primary" @click="addFK">娣诲姞浠樻</el-button>
</div>
</div>
<el-table
:data="info.terminateList"
border
+ v-loading="loading"
style="width: 100%; margin-bottom: 15px;">
<el-table-column
prop="code"
@@ -193,7 +196,7 @@
import AddCollectionBill from './addCollectionBill'
import AddPaymentBill from './addPaymentBill'
import { getUserList } from '@/api/system/user'
- import { backRent } from '@/api/contract'
+ import { backRent, getCanBackBill } from '@/api/contract'
export default {
name: "terminateLease",
components: {
@@ -236,7 +239,9 @@
agentList: [],
receivable: '',
- meet: ''
+ meet: '',
+
+ loading: false
}
},
watch: {
@@ -264,28 +269,77 @@
this.title = title
this.info = info
this.form.id = info.id
- this.info.billList.forEach(item => {
+ this.$nextTick(() => {
+ this.$refs.form.resetFields()
+ })
+ this.info.canBackRentBills.forEach(item => {
this.$set(item, 'receivableFeeCopy', item.receivableFee)
+ this.$set(item, 'receivableFee', item.needReceivableFee)
if ([2,3,7].includes(item.costType)) {
+ this.$set(item, 'billType', 1)
this.$set(item, 'price', item.actReceivableFee)
} else {
- this.$set(item, 'price', item.receivableFee)
+ this.$set(item, 'price', item.needReceivableFee)
}
})
this.info.terminateList = this.info.canBackRentBills.filter(item => {
if ([0,1,4,5,6].includes(item.costType)) {
- item.billTypeCopy = item.billType
+ item.billTypeCopy = JSON.parse(JSON.stringify(item.billType))
return item
}
})
this.info.depositList = this.info.canBackRentBills.filter(item => {
if ([2,3,7].includes(item.costType)) {
- item.billTypeCopy = item.billType
+ item.billTypeCopy = JSON.parse(JSON.stringify(item.billType))
return item
}
})
this.getUser()
this.visible = true
+ },
+ addZD () {
+ if (!this.form.btDate) return this.$message.warning('璇烽�夋嫨閫�绉熸棩鏈�')
+ this.$refs.addCollectionBill.open('鍒涘缓鏀舵璐﹀崟', {
+ contractCode: this.info.code,
+ contractId: this.info.id,
+ renterName: this.info.renterName,
+ renterId: this.info.renterId,
+ billType: 0,
+ billTypeCopy: 0,
+ feeType: 0
+ }, { startDate: this.info.startDate, endDate: this.form.btDate })
+ },
+ addFK () {
+ if (!this.form.btDate) return this.$message.warning('璇烽�夋嫨閫�绉熸棩鏈�')
+ this.$refs.AddPaymentBill.open('鍒涘缓浠樻璐﹀崟', {
+ contractCode: this.info.code,
+ contractId: this.info.id,
+ renterName: this.info.renterName,
+ renterId: this.info.renterId,
+ billType: 1,
+ billTypeCopy: 1
+ }, { startDate: this.info.startDate, endDate: this.form.btDate })
+ },
+ changeBtDate (planPayDateEnd) {
+ this.loading = true
+ getCanBackBill({
+ contractId: this.info.id,
+ planPayDateEnd
+ }).then(res => {
+ res.forEach(item => {
+ this.$set(item, 'receivableFeeCopy', item.receivableFee)
+ this.$set(item, 'receivableFee', item.needReceivableFee)
+ this.$set(item, 'price', item.needReceivableFee)
+ })
+ this.info.terminateList = res.filter(item => {
+ if ([0,1,4,5,6].includes(item.costType)) {
+ item.billTypeCopy = JSON.parse(JSON.stringify(item.billType))
+ return item
+ }
+ })
+ }).finally(() => {
+ this.loading = false
+ })
},
getObjS (obj) {
this.info.terminateList.push(obj)
@@ -336,34 +390,32 @@
row.price = 0
this.$message.warning('涓嶈兘澶т簬鍘熷搴旀敹浠橀噾棰�')
} else {
- row.price = Number(num) - row.actReceivableFee
- // 鏀�
- if (row.billTypeCopy === 0) {
- if (row.price > 0) {
- row.billType = 0
- } else if (row.price < 0) {
- row.billType = 1
+ if (num) {
+ row.price = Number(num) - row.actReceivableFee
+ // 鏀�
+ if (row.billTypeCopy === 0) {
+ if (row.price > 0) {
+ row.billType = 0
+ } else if (row.price < 0) {
+ row.billType = 1
+ } else {
+ row.billType = 0
+ }
} else {
- row.billType = 0
+ if (row.price > 0) {
+ row.billType = 1
+ } else if (row.price < 0) {
+ row.billType = 0
+ } else {
+ row.billType = 1
+ }
}
} else {
- if (row.price > 0) {
- row.billType = 1
- } else if (row.price < 0) {
- row.billType = 0
- } else {
- row.billType = 1
- }
+ row.price = 0
+ row.billType = row.billTypeCopy
+ console.log('billTypeCopy', row.billTypeCopy)
}
- // if (row.price > 0) {
- // row.billType = 0
- // } else if (row.price < 0) {
- // row.billType = 1
- // }
- row.price = String(row.price)
- if (row.price.indexOf('-') > 0) {
- row.price = row.price.substring(0, row.price.length)
- }
+ row.price = Math.abs(row.price);
}
}
}
--
Gitblit v1.9.3