jiangping
2025-06-06 a2299a6d4a6f99e9c11132138f5d3e9ec68f03ea
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;