Blame view

src/components/contract/ContractChangeAssets.vue 3.34 KB
b25b036d   wuxw   v1.9 优化日期
1
  <template>
bc37d685   wuxw   开发完成合同功能
2
3
4
    <el-card class="box-card">
      <div slot="header" class="flex justify-between">
        <span>{{ $t('contractChangeAssets.title') }}</span>
7d596bb5   wuxw   v1.9 丢掉合同租期变更丢掉房屋...
5
        <el-button type="primary" size="small" style="float: right" @click="openSeachRoom">
bc37d685   wuxw   开发完成合同功能
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
          <i class="el-icon-plus"></i>
          {{ $t('common.add') }}
        </el-button>
      </div>
  
      <el-table :data="contractChangeAssetsInfo.rooms" border style="width: 100%">
        <el-table-column prop="roomNum" :label="$t('contractChangeAssets.room')" align="center">
          <template slot-scope="scope">
            {{ scope.row.floorNum }}-{{ scope.row.unitNum }}-{{ scope.row.roomNum }}
          </template>
        </el-table-column>
  
        <el-table-column prop="ownerName" :label="$t('contractChangeAssets.owner')" align="center" />
  
        <el-table-column prop="link" :label="$t('contractChangeAssets.phone')" align="center" />
  
        <el-table-column prop="builtUpArea" :label="$t('contractChangeAssets.area')" align="center">
          <template slot-scope="scope">
            {{ scope.row.builtUpArea }} {{ $t('contractChangeAssets.squareMeters') }}
          </template>
        </el-table-column>
  
        <el-table-column prop="stateName" :label="$t('contractChangeAssets.status')" align="center" />
  
        <el-table-column :label="$t('common.operation')" align="center" width="120">
          <template slot-scope="scope">
            <el-button type="danger" size="mini" @click="openDelRoomModel(scope.row)">
              {{ $t('common.delete') }}
            </el-button>
          </template>
        </el-table-column>
      </el-table>
7d596bb5   wuxw   v1.9 丢掉合同租期变更丢掉房屋...
38
39
  
      <search-room ref="searchRoom" @chooseRoom="chooseRoom" />
bc37d685   wuxw   开发完成合同功能
40
41
42
43
    </el-card>
  </template>
  
  <script>
7d596bb5   wuxw   v1.9 丢掉合同租期变更丢掉房屋...
44
45
  import SearchRoom from '@/components/room/searchRoom'
  import { queryContractRoom } from '@/api/contract/addContractApi'
bc37d685   wuxw   开发完成合同功能
46
47
  export default {
    name: 'ContractChangeAssets',
7d596bb5   wuxw   v1.9 丢掉合同租期变更丢掉房屋...
48
49
50
    components: {
      SearchRoom
    },
bc37d685   wuxw   开发完成合同功能
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
    data() {
      return {
        contractChangeAssetsInfo: {
          rooms: [],
          contractId: '',
          planType: '3003'
        }
      }
    },
    watch: {
      contractChangeAssetsInfo: {
        deep: true,
        handler(newVal) {
          this.$emit('changeNotify', newVal)
        }
      }
    },
    methods: {
7d596bb5   wuxw   v1.9 丢掉合同租期变更丢掉房屋...
69
70
71
72
73
74
      open(param) {
        this.contractChangeAssetsInfo.contractId = param.contractId
        this.loadContractRooms()
      },
      openSeachRoom() {
        this.$refs.searchRoom.open()
bc37d685   wuxw   开发完成合同功能
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
      },
      openDelRoomModel(room) {
        this.$confirm(
          this.$t('contractChangeAssets.confirmDelete'),
          this.$t('common.tip'),
          {
            confirmButtonText: this.$t('common.confirm'),
            cancelButtonText: this.$t('common.cancel'),
            type: 'warning'
          }
        ).then(() => {
          this.removeRoom(room)
        })
      },
      removeRoom(room) {
        this.contractChangeAssetsInfo.rooms = this.contractChangeAssetsInfo.rooms.filter(
          item => item.roomId !== room.roomId
        )
      },
7d596bb5   wuxw   v1.9 丢掉合同租期变更丢掉房屋...
94
95
96
97
98
      async loadContractRooms() {
        const res = await queryContractRoom({ contractId: this.contractChangeAssetsInfo.contractId, page: 1, row: 500 })
        this.contractChangeAssetsInfo.rooms = res.data
      },
      chooseRoom(room) {
bc37d685   wuxw   开发完成合同功能
99
100
101
102
103
104
        const exists = this.contractChangeAssetsInfo.rooms.some(
          item => item.roomId === room.roomId
        )
        if (!exists) {
          this.contractChangeAssetsInfo.rooms.push(room)
        }
7d596bb5   wuxw   v1.9 丢掉合同租期变更丢掉房屋...
105
106
      }
    },
bc37d685   wuxw   开发完成合同功能
107
108
109
110
111
112
113
114
  }
  </script>
  
  <style scoped>
  .box-card {
    margin-bottom: 20px;
  }
  </style>