From 2288061f2d0afd7bd29660a5b724d8c69cb844a9 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 04 三月 2025 09:11:51 +0800
Subject: [PATCH] 改bug
---
admin/src/views/contract/components/contractEdit.vue | 116 ++++++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 97 insertions(+), 19 deletions(-)
diff --git a/admin/src/views/contract/components/contractEdit.vue b/admin/src/views/contract/components/contractEdit.vue
index 7e13e64..6867919 100644
--- a/admin/src/views/contract/components/contractEdit.vue
+++ b/admin/src/views/contract/components/contractEdit.vue
@@ -178,8 +178,15 @@
</div>
</div>
<el-button style="width: 100%;height: 48px;" type="primary" plain @click="generateZL">鐢熸垚璐﹀崟鏄庣粏</el-button>
+ <div style="width: 100%; text-align: right; margin-bottom: 10px; margin-top: 15px;" v-if="zlList.length > 0">
+ <el-button icon="el-icon-edit" v-if="!isShow" @click="changeEdit(1)">缂栬緫</el-button>
+ <el-popconfirm v-if="isShow" title="鏄惁鏀惧純鎵嬪姩淇敼鎵�濉殑鏁版嵁锛�" @confirm="isShow = false">
+ <el-button slot="reference" style="margin-right: 15px;">鍙栨秷</el-button>
+ </el-popconfirm>
+ <el-button type="primary" v-if="isShow" @click="changeNum(1)">淇濆瓨</el-button>
+ </div>
<el-table :data="zlList" class="mt20" stripe>
- <el-table-column label="璐圭敤绫诲瀷" align="center" show-overflow-tooltip>
+ <el-table-column label="璐圭敤绫诲瀷" align="center" :key="Date.now()" show-overflow-tooltip>
<template slot-scope="{row}">
<span v-if="row.costType === 0">绉熻祦璐�</span>
<span v-if="row.costType === 1">鐗╀笟璐�</span>
@@ -191,20 +198,26 @@
<span v-if="row.costType === 7">淇濊瘉閲�</span>
</template>
</el-table-column>
- <el-table-column label="鏈熸暟" align="center" show-overflow-tooltip>
+ <el-table-column label="鏈熸暟" align="center" :key="Date.now()" show-overflow-tooltip>
<template slot-scope="{row}">
<el-tag type="success" v-if="row.sortnum > 0">{{ row.sortnum }}</el-tag>
</template>
</el-table-column>
- <el-table-column label="鍖洪棿" align="center" show-overflow-tooltip>
+ <el-table-column label="鍖洪棿" align="center" :key="Date.now()" show-overflow-tooltip>
<template slot-scope="{row}">
{{ row.startDate }} ~ {{ row.endDate }}
</template>
</el-table-column>
- <el-table-column prop="planPayDate" label="浠樻鏃�" align="center" show-overflow-tooltip />
- <el-table-column label="搴旀敹" align="center" show-overflow-tooltip>
+ <el-table-column prop="planPayDate" label="浠樻鏃�" align="center" :key="Date.now()" show-overflow-tooltip />
+ <el-table-column label="搴旀敹" align="center" :key="Date.now()" show-overflow-tooltip>
<template slot-scope="{row}">
- {{ row.receivableFee }}鍏�
+ <span v-if="[2,3].includes(row.costType)">{{ row.totleFee }}鍏�</span>
+ <template v-else>
+ <span v-if="!isShow">{{ row.totleFee }}鍏�</span>
+ <div style="display: flex; align-items: center;" v-if="isShow">
+ <el-input v-model="row.totleFeeCopy" placeholder="璇疯緭鍏�"></el-input>鍏�
+ </div>
+ </template>
</template>
</el-table-column>
</el-table>
@@ -273,8 +286,15 @@
</div>
</div>
<el-button style="width: 100%;height: 48px;" type="primary" plain @click="generateWY">鐢熸垚璐﹀崟鏄庣粏</el-button>
+ <div style="width: 100%; text-align: right; margin-bottom: 10px; margin-top: 15px;">
+ <el-button icon="el-icon-edit" v-if="!isShow" @click="changeEdit(1)">缂栬緫</el-button>
+ <el-popconfirm v-if="isShow" title="鏄惁鏀惧純鎵嬪姩淇敼鎵�濉殑鏁版嵁锛�" @confirm="isShow = false">
+ <el-button slot="reference" style="margin-right: 15px;">鍙栨秷</el-button>
+ </el-popconfirm>
+ <el-button type="primary" v-if="isShow" @click="changeNum(2)">淇濆瓨</el-button>
+ </div>
<el-table :data="wyList" class="mt20" stripe>
- <el-table-column label="璐圭敤绫诲瀷" align="center" show-overflow-tooltip>
+ <el-table-column label="璐圭敤绫诲瀷" align="center" :key="Date.now()" show-overflow-tooltip>
<template slot-scope="{row}">
<span v-if="row.costType === 0">绉熻祦璐�</span>
<span v-if="row.costType === 1">鐗╀笟璐�</span>
@@ -286,20 +306,26 @@
<span v-if="row.costType === 7">淇濊瘉閲�</span>
</template>
</el-table-column>
- <el-table-column label="鏈熸暟" align="center" show-overflow-tooltip>
+ <el-table-column label="鏈熸暟" align="center" :key="Date.now()" show-overflow-tooltip>
<template slot-scope="{row}">
<el-tag type="success" v-if="row.sortnum > 0">{{ row.sortnum }}</el-tag>
</template>
</el-table-column>
- <el-table-column label="鍖洪棿" align="center" show-overflow-tooltip>
+ <el-table-column label="鍖洪棿" align="center" :key="Date.now()" show-overflow-tooltip>
<template slot-scope="{row}">
{{ row.startDate }} ~ {{ row.endDate }}
</template>
</el-table-column>
- <el-table-column prop="planPayDate" label="浠樻鏃�" align="center" show-overflow-tooltip />
- <el-table-column prop="receivableFee" label="搴旀敹" align="center" show-overflow-tooltip>
+ <el-table-column prop="planPayDate" label="浠樻鏃�" :key="Date.now()" align="center" show-overflow-tooltip />
+ <el-table-column label="搴旀敹" :key="Date.now()" align="center" show-overflow-tooltip>
<template slot-scope="{row}">
- {{ row.receivableFee }}鍏�
+ <span v-if="[2,3].includes(row.costType)">{{ row.totleFee }}鍏�</span>
+ <template v-else>
+ <span v-if="!isShow">{{ row.totleFee }}鍏�</span>
+ <div style="display: flex; align-items: center;" v-if="isShow">
+ <el-input v-model="row.totleFeeCopy" placeholder="璇疯緭鍏�"></el-input>鍏�
+ </div>
+ </template>
</template>
</el-table-column>
</el-table>
@@ -309,7 +335,8 @@
</div>
</div>
</div>
- <div class="window__footer" style="position: sticky; bottom: 0; left: 0; z-index: 9; background: #ffffff;">
+ <div style="width: 100%; height: 50px;"></div>
+ <div class="window__footer">
<slot name="footer">
<el-button @click="confirm" :loading="confirmWorking" type="primary">{{ activeTabs === 0 ? '涓嬩竴姝�' :
'鎻愪氦'}}</el-button>
@@ -331,7 +358,7 @@
import { ywList } from '@/api/customer'
import { getUserList } from '@/api/system/user'
import { getProjectList, tree } from '@/api/project/ywProject'
-import { companyList } from '@/api/company'
+import {companyListConstract as companyList } from '@/api/company'
import { Message, Loading } from 'element-ui'
import { mapState } from 'vuex'
export default {
@@ -448,7 +475,9 @@
{ name: '鍏�/鍦�', value: 6 },
],
- houseLvThree: []
+
+ houseLvThree: [],
+ isShow: false
}
},
methods: {
@@ -500,6 +529,39 @@
this.form.roundedUp = 0
// this.getHouseTree()
})
+ },
+ changeEdit(type) {
+ if (type === 1) {
+ this.zlList.forEach(item => {
+ item.totleFeeCopy = JSON.parse(JSON.stringify(item.totleFee))
+ })
+ this.isShow = true
+ } else if (type === 2) {
+ this.isShow = false
+ }
+ },
+ changeNum(type) {
+ // 绉熻祦璁$畻
+ if (type === 1) {
+ let num = 0
+ this.zlList.forEach(item => {
+ if (item.costType !== 2) {
+ num += Number(item.totleFeeCopy)
+ item.totleFee = JSON.parse(JSON.stringify(item.totleFeeCopy))
+ }
+ })
+ this.zlPrice = num
+ } else if (type === 2) {
+ let num = 0
+ this.wyList.forEach(item => {
+ if (item.costType !== 3) {
+ num += Number(item.totleFeeCopy)
+ item.totleFee = JSON.parse(JSON.stringify(item.totleFeeCopy))
+ }
+ })
+ this.wyPrice = num
+ }
+ this.isShow = false
},
changePayType(e) {
if (e === 0) {
@@ -651,7 +713,7 @@
submit() {
// 璋冪敤鏂板缓鎺ュ彛
this.isWorking = true
- create({ ...this.form })
+ create({ ...this.form, ywContractBillDTOList: [...this.wyList, ...this.zlList] })
.then(res => {
this.visible = false
this.$tip.apiSuccess('鍒涘缓鎴愬姛')
@@ -709,8 +771,9 @@
let zlPrice = 0
let arr = []
res.forEach(item => {
+ item.totleFeeCopy = JSON.parse(JSON.stringify(item.totleFee))
if (item.costType === 0) {
- zlPrice += item.receivableFee
+ zlPrice += item.totleFee
}
arr.push(item)
})
@@ -726,7 +789,8 @@
let arr = []
res.forEach(item => {
if (item.costType === 1) {
- zlPrice += item.receivableFee
+ zlPrice += item.totleFee
+ item.totleFeeCopy = JSON.parse(JSON.stringify(item.totleFee))
}
arr.push(item)
})
@@ -815,6 +879,7 @@
this.activeTabs = val
},
ctabsClick(val) {
+ this.isShow = false
this.cactiveTabs = val
},
handleRent() {
@@ -860,6 +925,7 @@
close() {
if (this.activeTabs === 0) {
this.$emit('close')
+ this.visible = false
} else {
this.activeTabs = 0
this.zlList = []
@@ -880,7 +946,19 @@
left: 0;
z-index: 999;
}
-
+.window__footer {
+ position: absolute;
+ width: 100%;
+ bottom: 0;
+ left: 0;
+ z-index: 9;
+ background: #ffffff;
+ user-select: none;
+ border-top: 1px solid #eee;
+ height: 60px;
+ line-height: 60px;
+ text-align: center;
+}
.tabs {
border-bottom: 1px solid #DFE2E8;
display: flex;
--
Gitblit v1.9.3