From 16217be9c85f95cb236e639da6e546bb38cdc53d Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期四, 05 十二月 2024 14:45:07 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- admin/src/views/contract/components/terminateLease.vue | 72 +++++++++++++++++++++-------------- 1 files changed, 43 insertions(+), 29 deletions(-) diff --git a/admin/src/views/contract/components/terminateLease.vue b/admin/src/views/contract/components/terminateLease.vue index 31fda94..83108ee 100644 --- a/admin/src/views/contract/components/terminateLease.vue +++ b/admin/src/views/contract/components/terminateLease.vue @@ -24,7 +24,6 @@ </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" @@ -85,6 +84,7 @@ label="璐﹀崟缂栧彿"> </el-table-column> <el-table-column + width="100" label="璐圭敤绫诲瀷"> <template slot-scope="{row}"> <span v-if="row.costType === 0">绉熻祦璐�</span> @@ -104,13 +104,14 @@ label="搴旀敹浠橀噾棰�/鍘熷搴旀敹浠�"> <template v-slot="{row}"> <div style="display: flex; align-items: center;"> - <el-input v-model="row.receivableFee" @input="changeReceivableFee($event, row)" placeholder="璇疯緭鍏ュ唴瀹�" style="width: 90px;"></el-input> + <el-input v-model="row.receivableFee" @input="changeReceivableFee($event, row)" placeholder="璇疯緭鍏ュ唴瀹�" style="flex: 1;"></el-input> <span style="margin: 0 10px;">/</span> {{row.receivableFeeCopy}} </div> </template> </el-table-column> <el-table-column + width="120" prop="actReceivableFee" label="瀹炴敹/浠橀噾棰�"> </el-table-column> @@ -197,12 +198,16 @@ import AddPaymentBill from './addPaymentBill' import { getUserList } from '@/api/system/user' import { backRent, getCanBackBill } from '@/api/contract' + import { mapState } from 'vuex' export default { name: "terminateLease", components: { GlobalWindow, AddCollectionBill, AddPaymentBill + }, + computed: { + ...mapState(['userInfo']) }, extends: BaseOpera, data() { @@ -244,41 +249,24 @@ loading: false } }, - watch: { - info: { - deep: true, - immediate: true, - handler(news, olds) { - const arr = [...this.info.terminateList, ...this.info.depositList] - let total1 = 0 - let total2 = 0 - arr.forEach(item => { - if (item.billType === 0) { - total1 += Number(item.price) - } else if (item.billType === 1) { - total2 += Number(item.price) - } - }) - this.receivable = total1 - this.meet = total2 - } - } - }, methods: { open (title, info) { this.title = title this.info = info this.form.id = info.id + this.form.btSignDate = this.getDay() + console.log(this.userInfo) + this.form.btUserId = this.userInfo.id 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, 'receivableFeeCopy', item.receivableFee) + this.$set(item, 'receivableFee', item.needReceivableFee) this.$set(item, 'price', item.needReceivableFee) } }) @@ -294,8 +282,30 @@ return item } }) + this.countData() this.getUser() this.visible = true + }, + countData () { + const arr = [...this.info.terminateList, ...this.info.depositList] + let total1 = 0 + let total2 = 0 + arr.forEach(item => { + if (item.billType === 0) { + total1 += Number(item.price) + } else if (item.billType === 1) { + total2 += Number(item.price) + } + }) + this.receivable = total1.toFixed(2) + this.meet = total2.toFixed(2) + }, + getDay () { + const today = new Date(); + const year = today.getFullYear(); + const month = today.getMonth() + 1; // 鏈堜唤鏄粠 0 寮�濮嬬殑锛屽洜姝ら渶瑕佸姞 1 + const day = today.getDate(); + return `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`; }, addZD () { if (!this.form.btDate) return this.$message.warning('璇烽�夋嫨閫�绉熸棩鏈�') @@ -317,6 +327,7 @@ renterName: this.info.renterName, renterId: this.info.renterId, billType: 1, + feeType: 0, billTypeCopy: 1 }, { startDate: this.info.startDate, endDate: this.form.btDate }) }, @@ -337,16 +348,18 @@ return item } }) + this.countData() }).finally(() => { this.loading = false }) }, getObjS (obj) { this.info.terminateList.push(obj) - this.info.terminateList.forEach(item => { - item.receivableFee = Number(item.receivableFee) + 1 - item.receivableFee = Number(item.receivableFee) - 1 - }) + // this.info.terminateList.forEach(item => { + // item.receivableFee = Number(item.receivableFee) + 1 + // item.receivableFee = Number(item.receivableFee) - 1 + // }) + this.countData() }, confirm () { this.$refs.form.validate((valid) => { @@ -388,6 +401,7 @@ if (Number(num) > row.receivableFeeCopy) { row.receivableFee = '' row.price = 0 + this.countData() this.$message.warning('涓嶈兘澶т簬鍘熷搴旀敹浠橀噾棰�') } else { if (num) { @@ -413,9 +427,9 @@ } else { row.price = 0 row.billType = row.billTypeCopy - console.log('billTypeCopy', row.billTypeCopy) } row.price = Math.abs(row.price); + this.countData() } } } -- Gitblit v1.9.3