From eecb531137599c1a0bde3c40fc549cd3b2cd5bed Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 22 一月 2025 09:18:45 +0800
Subject: [PATCH] 1

---
 admin/src/views/project/components/houseDetails.vue |  641 +++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 459 insertions(+), 182 deletions(-)

diff --git a/admin/src/views/project/components/houseDetails.vue b/admin/src/views/project/components/houseDetails.vue
index 5e61c5c..394d64a 100644
--- a/admin/src/views/project/components/houseDetails.vue
+++ b/admin/src/views/project/components/houseDetails.vue
@@ -1,11 +1,16 @@
 <template>
     <GlobalWindow
-        title="妤煎畤璇︽儏"
+        :title="title"
         :showConfirm="false"
         :visible.sync="visible"
-        width="800px">
+        width="100%">
         <div class="right">
-            <div class="right_head">椤圭洰鍚嶇О</div>
+            <div class="right_head">
+                <span>{{info.roomNum}}</span>
+                <el-tag type="success" v-if="info.leaseStatus === 0">寰呯璧�</el-tag>
+                <el-tag type="success" v-if="info.leaseStatus === 1">宸茬璧�</el-tag>
+                <el-tag type="success" v-if="info.leaseStatus === 2">鏈紑鍚璧�</el-tag>
+            </div>
             <div class="right_cate">
                 <el-tabs v-model="activeName" @tab-click="handleClick">
                     <el-tab-pane label="鎴挎簮淇℃伅" name="houseinfo">
@@ -17,39 +22,40 @@
                                 <div class="xm_info">
                                     <div class="xm_info_row" style="width: 25%;">
                                         <span>鎵�灞為」鐩�</span>
-                                        <span>XXXXXXXXXX</span>
+                                        <span>{{info.projectName}}</span>
                                     </div>
                                     <div class="xm_info_row" style="width: 25%;">
                                         <span>妤煎畤</span>
-                                        <span>缁煎悎妤�</span>
+                                        <span>{{info.buildingName}}</span>
                                     </div>
                                     <div class="xm_info_row" style="width: 25%;">
                                         <span>妤煎眰</span>
-                                        <span>1</span>
+                                        <span>{{info.floorName}}</span>
                                     </div>
                                     <div class="xm_info_row" style="width: 25%;">
                                         <span>鎴垮彿</span>
-                                        <span>101娲诲姩瀹�</span>
+                                        <span>{{info.roomNum}}</span>
                                     </div>
                                     <div class="xm_info_row" style="width: 25%; margin-top: 15px;">
                                         <span>鎴块棿缂栧彿</span>
-                                        <span>101</span>
+                                        <span>{{info.code}}</span>
                                     </div>
                                     <div class="xm_info_row" style="width: 25%; margin-top: 15px;">
                                         <span>鏄惁鎷涘晢</span>
-                                        <span>鍚�</span>
+                                        <span v-if="info.isInvestment === 0">鍚�</span>
+                                        <span v-if="info.isInvestment === 1">鏄�</span>
                                     </div>
                                     <div class="xm_info_row" style="width: 25%; margin-top: 15px;">
                                         <span>寤虹瓚闈㈢Н</span>
-                                        <span>50銕�</span>
+                                        <span>{{info.area}}銕�</span>
                                     </div>
                                     <div class="xm_info_row" style="width: 25%; margin-top: 15px;">
                                         <span>璁$闈㈢Н</span>
-                                        <span>50銕�</span>
+                                        <span>{{info.rentArea}}銕�</span>
                                     </div>
                                     <div class="xm_info_row" style="width: 25%; margin-top: 15px;">
                                         <span>璁¤垂闈㈢Н</span>
-                                        <span>45銕�</span>
+                                        <span>{{info.feeArea}}銕�</span>
                                     </div>
                                 </div>
                             </el-card>
@@ -62,37 +68,51 @@
                                     <span>褰撳墠鍦ㄧ鍚堝悓</span>
                                 </div>
                                 <div class="xm_table">
-                                    <el-input v-model="input" style="width: 300px; margin-bottom: 15px;" placeholder="璇疯緭鍏ュ悎鍚岀紪鍙�"></el-input>
+                                    <div style="width: 100%; display: flex; align-items: center; margin-bottom: 15px;">
+                                        <el-input v-model="form.code" style="width: 300px;" placeholder="璇疯緭鍏ュ悎鍚岀紪鍙�"></el-input>
+                                        <el-button type="primary" style="margin-left: 15px;" @click="getTenantContract()">鎼滅储</el-button>
+                                    </div>
                                     <el-table
                                         :data="tableData"
                                         border
+                                        v-loading="loading"
                                         style="width: 100%">
                                         <el-table-column
-                                            prop="date"
                                             label="鍚堝悓缂栧彿">
+                                            <template slot-scope="{row}">
+                                                <el-button type="text" @click="$refs.ContractDetailRef.open('鍚堝悓璇︽儏', row.id)" v-if="row.status === 1">{{row.code}}</el-button>
+                                                <el-button type="text" v-else>{{row.code}}</el-button>
+                                            </template>
                                         </el-table-column>
                                         <el-table-column
-                                            prop="name"
+                                            prop="renterName"
                                             label="瀹㈡埛鍚嶇О">
                                         </el-table-column>
                                         <el-table-column
-                                            prop="address"
+                                            prop="startDate"
                                             label="寮�濮嬫棩鏈�">
                                         </el-table-column>
                                         <el-table-column
-                                            prop="address"
+                                            prop="endDate"
                                             label="缁撴潫鏃ユ湡">
                                         </el-table-column>
                                         <el-table-column
-                                            prop="address"
                                             label="绉熻祦鍗曚环">
+                                            <template slot-scope="{row}">
+                                                <div style="display: flex; align-items: center;">
+                                                    <span>{{row.zlFirstPrice || row.wyFirstPrice}}</span>
+                                                    <span>{{row.zlFirstCircleStr || row.wyFirstCircleStr}}</span>
+                                                </div>
+                                            </template>
                                         </el-table-column>
                                         <el-table-column
-                                            prop="address"
                                             label="绉熻祦闈㈢Н锛堛帯锛�">
+                                            <template slot-scope="{row}">
+                                                {{row.totalArea}}銕�
+                                            </template>
                                         </el-table-column>
                                         <el-table-column
-                                            prop="address"
+                                            prop="signDate"
                                             label="绛捐鏃�">
                                         </el-table-column>
                                         <el-table-column
@@ -100,8 +120,14 @@
                                             label="鍚堝悓鏉ユ簮">
                                         </el-table-column>
                                         <el-table-column
-                                            prop="address"
                                             label="鍚堝悓鐘舵��">
+                                            <template slot-scope="{row}">
+                                                <span class="primaryColor" v-if="row.status === 0">寰呮墽琛�</span>
+                                                <span class="green" v-if="row.status === 1">姝e父鎵ц涓�</span>
+                                                <span class="gary" v-if="row.status === 2">宸插埌鏈�</span>
+                                                <span class="gary" v-if="row.status === 3">閫�绉熺粨绠椾腑</span>
+                                                <span class="gary" v-if="row.status === 4">宸查��绉�</span>
+                                            </template>
                                         </el-table-column>
                                     </el-table>
                                     <div class="xm_table_f">
@@ -125,84 +151,93 @@
                                 <div class="xm_one1">
                                     <div class="xm_one_row">
                                         <span>寰呮寚娲炬暟閲�</span>
-                                        <span>15</span>
+                                        <span>{{numObj.waitAssignAmount || 0}}</span>
                                     </div>
                                     <div class="xm_one_row">
                                         <span>寰呭鐞嗘暟閲�</span>
-                                        <span>15</span>
+                                        <span>{{numObj.waitDealAmount || 0}}</span>
                                     </div>
                                     <div class="xm_one_row">
                                         <span>鏈湀宸ュ崟鏁�</span>
-                                        <span>15</span>
+                                        <span>{{numObj.monthAmount || 0}}</span>
                                     </div>
                                     <div class="xm_one_row">
                                         <span>绱宸ュ崟鏁�</span>
-                                        <span>15</span>
+                                        <span>{{numObj.amount || 0}}</span>
                                     </div>
                                 </div>
                             </el-card>
                             <el-card style="margin-top: 20px;">
                                 <div class="xm_table">
                                     <div class="xm_table_search">
-                                        <el-select v-model="value" style="width: 300px; margin-right: 15px;" placeholder="浣嶇疆绫诲瀷">
-                                            <el-option
-                                                    v-for="item in options"
-                                                    :key="item.value"
-                                                    :label="item.label"
-                                                    :value="item.value">
-                                            </el-option>
-                                        </el-select>
-                                        <el-select v-model="value" style="width: 300px;" placeholder="宸ュ崟鍒嗙被">
-                                            <el-option
-                                                    v-for="item in options"
-                                                    :key="item.value"
-                                                    :label="item.label"
-                                                    :value="item.value">
-                                            </el-option>
-                                        </el-select>
+                                        <div>
+                                            <el-cascader style="width: 150px; margin-right: 15px;" v-model="form.areaIds" @change="changeSel" placeholder="璇烽�夋嫨宸ュ崟鍒嗙被" clearable
+                                                :options="cateList" :props="{
+                                                    label: 'name',
+                                                    value: 'id',
+                                                    children: 'childCategoryList'
+                                                }" />
+                                            <el-select v-model="form.status" style="width: 150px; margin-right: 15px;" placeholder="宸ュ崟鐘舵��">
+                                                <el-option label="鍚敤" :value="0"></el-option>
+                                                <el-option label="绂佺敤" :value="1"></el-option>
+                                            </el-select>
+                                            <el-button type="primary" @click="getFetchList">鏌ヨ</el-button>
+                                            <el-button @click="clear">娓呯┖</el-button>
+                                        </div>
+                                        <el-button type="primary" @click="$refs.operaYwWorkorderWindow.open('鏂板缓宸ュ崟')">鏂板宸ュ崟</el-button>
                                     </div>
                                     <el-table
-                                            :data="tableData"
-                                            border
-                                            style="width: 100%">
+                                        :data="tableData"
+                                        border
+                                        v-loading="loading"
+                                        style="width: 100%">
                                         <el-table-column
-                                                prop="date"
-                                                label="宸ュ崟鍒嗙被">
+                                            prop="categoryName"
+                                            label="宸ュ崟鍒嗙被">
                                         </el-table-column>
                                         <el-table-column
-                                                prop="name"
-                                                label="鎶ヤ慨鍖哄煙">
+                                            label="鎶ヤ慨鍖哄煙">
+                                            <template v-slot="scope">
+                                                <span>{{ scope.row.buildingName }} / {{ scope.row.areaType == 0 ? scope.row.roomNum : scope.row.floorName
+                                                  }}</span>
+                                            </template>
                                         </el-table-column>
                                         <el-table-column
-                                                prop="address"
-                                                label="涓婃姤浜�">
+                                            prop="creatorName"
+                                            label="涓婃姤浜�">
                                         </el-table-column>
                                         <el-table-column
-                                                prop="address"
-                                                label="涓婃姤鏃堕棿">
+                                            prop="createDate"
+                                            label="涓婃姤鏃堕棿">
                                         </el-table-column>
                                         <el-table-column
-                                                prop="address"
-                                                label="澶勭悊浜�">
+                                            prop="dealUserName"
+                                            label="澶勭悊浜�">
                                         </el-table-column>
                                         <el-table-column
-                                                prop="address"
-                                                label="宸ュ崟鐘舵��">
+                                            label="宸ュ崟鐘舵��">
+                                            <template slot-scope="{row}">
+                                                <span v-if="row.dealStatus === 0">寰呮寚娲�</span>
+                                                <span v-if="row.dealStatus === 1">宸叉寚娲�</span>
+                                                <span v-if="row.dealStatus === 2">宸插鐞�</span>
+                                            </template>
                                         </el-table-column>
                                         <el-table-column
-                                                prop="address"
-                                                label="鎿嶄綔">
+                                            label="鎿嶄綔">
+                                            <template slot-scope="{row}">
+                                                <el-button type="text" @click="handleDetail(row)">鏌ョ湅璇︽儏</el-button>
+                                            </template>
                                         </el-table-column>
                                     </el-table>
                                     <div class="xm_table_f">
                                         <el-pagination
-                                                @size-change="handleSizeChange"
-                                                @current-change="handleCurrentChange"
-                                                :current-page="page"
-                                                :page-sizes="[10, 20, 30, 40]"
-                                                :page-size="pageTotal"
-                                                layout="total, sizes, prev, pager, next, jumper"
-                                                :total="total">
+                                            @size-change="handleSizeChange"
+                                            @current-change="handleCurrentChange"
+                                            :current-page="page"
+                                            :page-sizes="[10, 20, 30, 40]"
+                                            :page-size="pageTotal"
+                                            layout="total, sizes, prev, pager, next, jumper"
+                                            :total="total">
                                         </el-pagination>
                                     </div>
                                 </div>
@@ -223,62 +258,64 @@
                                 <div class="xm_table">
                                     <div class="xm_table_search">
                                         <div class="xm_table_search_left">
-                                            <el-input v-model="input" placeholder="璇疯緭鍏ヨ澶囧悕绉�/缂栫爜" style="width: 200px; margin-right: 15px;"></el-input>
-                                            <el-select v-model="value" style="width: 200px; margin-right: 15px;" placeholder="璁惧鐘舵��">
-                                                <el-option
-                                                        v-for="item in options"
-                                                        :key="item.value"
-                                                        :label="item.label"
-                                                        :value="item.value">
-                                                </el-option>
+                                            <el-input v-model="form.name" placeholder="璇疯緭鍏ヨ澶囧悕绉�/缂栫爜" style="width: 200px; margin-right: 15px;"></el-input>
+                                            <el-select v-model="form.status" style="width: 150px; margin-right: 15px;" placeholder="璁惧鐘舵��">
+                                                <el-option label="姝e父" :value="0"></el-option>
+                                                <el-option label="鎹熷潖" :value="1"></el-option>
+                                                <el-option label="鎶ュ簾" :value="2"></el-option>
                                             </el-select>
-                                            <el-button type="primary">鏌ヨ</el-button>
-                                            <el-button>娓呯┖</el-button>
+                                            <el-button type="primary" @click="getDevicePage">鏌ヨ</el-button>
+                                            <el-button @click="clear">娓呯┖</el-button>
                                         </div>
-                                        <el-button type="primary">鏂板</el-button>
+                                        <el-button type="primary" @click="handleEdit">鏂板</el-button>
                                     </div>
                                     <el-table
-                                            :data="tableData"
-                                            border
-                                            style="width: 100%">
+                                        :data="tableData"
+                                        border
+                                        v-loading="loading"
+                                        style="width: 100%">
                                         <el-table-column
-                                                prop="date"
-                                                label="宸ュ崟鍒嗙被">
+                                            prop="code"
+                                            label="璁惧缂栫爜">
                                         </el-table-column>
                                         <el-table-column
-                                                prop="name"
-                                                label="鎶ヤ慨鍖哄煙">
+                                            prop="name"
+                                            label="璁惧鍚嶇О">
                                         </el-table-column>
                                         <el-table-column
-                                                prop="address"
-                                                label="涓婃姤浜�">
+                                            prop="categoryName"
+                                            label="璁惧鍒嗙被">
                                         </el-table-column>
                                         <el-table-column
-                                                prop="address"
-                                                label="涓婃姤鏃堕棿">
+                                            prop="modelNo"
+                                            label="璁惧鍨嬪彿">
                                         </el-table-column>
                                         <el-table-column
-                                                prop="address"
-                                                label="澶勭悊浜�">
+                                            prop="realName"
+                                            label="璁惧绠$悊鍛�">
                                         </el-table-column>
                                         <el-table-column
-                                                prop="address"
-                                                label="宸ュ崟鐘舵��">
+                                            prop="supplier"
+                                            label="璁惧渚涘簲鍟�">
                                         </el-table-column>
                                         <el-table-column
-                                                prop="address"
-                                                label="鎿嶄綔">
+                                            label="璁惧鐘舵��">
+                                            <template slot-scope="{row}">
+                                                <span v-if="row.status === 0">姝e父</span>
+                                                <span v-if="row.status === 1">鎹熷潖</span>
+                                                <span v-if="row.status === 2">鎶ュ簾</span>
+                                            </template>
                                         </el-table-column>
                                     </el-table>
                                     <div class="xm_table_f">
                                         <el-pagination
-                                                @size-change="handleSizeChange"
-                                                @current-change="handleCurrentChange"
-                                                :current-page="page"
-                                                :page-sizes="[10, 20, 30, 40]"
-                                                :page-size="pageTotal"
-                                                layout="total, sizes, prev, pager, next, jumper"
-                                                :total="total">
+                                            @size-change="handleSizeChange"
+                                            @current-change="handleCurrentChange"
+                                            :current-page="page"
+                                            :page-sizes="[10, 20, 30, 40]"
+                                            :page-size="pageTotal"
+                                            layout="total, sizes, prev, pager, next, jumper"
+                                            :total="total">
                                         </el-pagination>
                                     </div>
                                 </div>
@@ -294,62 +331,65 @@
                                 <div class="xm_table">
                                     <div class="xm_table_search">
                                         <div class="xm_table_search_left">
-                                            <el-input v-model="input" placeholder="璇疯緭鍏ヨ祫浜у悕绉�/缂栫爜" style="width: 200px; margin-right: 15px;"></el-input>
+                                            <el-input v-model="form.code" placeholder="璇疯緭鍏ヨ祫浜у悕绉�/缂栫爜" style="width: 200px; margin-right: 15px;"></el-input>
                                             <el-select v-model="value" style="width: 200px; margin-right: 15px;" placeholder="璧勪骇鍒嗙被">
                                                 <el-option
-                                                        v-for="item in options"
-                                                        :key="item.value"
-                                                        :label="item.label"
-                                                        :value="item.value">
+                                                    v-for="item in options"
+                                                    :key="item.value"
+                                                    :label="item.label"
+                                                    :value="item.value">
                                                 </el-option>
                                             </el-select>
-                                            <el-button type="primary">鏌ヨ</el-button>
-                                            <el-button>娓呯┖</el-button>
+                                            <el-button type="primary" @click="getPropertyLists">鏌ヨ</el-button>
+                                            <el-button @click="clear">娓呯┖</el-button>
                                         </div>
-                                        <el-button type="primary">鏂板</el-button>
+                                        <el-button type="primary" @click="$refs.newMaterial.open('鏂板缓鐗╂枡')">鏂板</el-button>
                                     </div>
                                     <el-table
-                                            :data="tableData"
-                                            border
-                                            style="width: 100%">
+                                        :data="tableData"
+                                        border
+                                        v-loading="loading"
+                                        style="width: 100%">
                                         <el-table-column
-                                                prop="date"
-                                                label="璧勪骇缂栫爜">
+                                            prop="code"
+                                            label="璧勪骇缂栫爜">
                                         </el-table-column>
                                         <el-table-column
-                                                prop="name"
-                                                label="璧勪骇鍚嶇О">
+                                            prop="name"
+                                            label="璧勪骇鍚嶇О">
                                         </el-table-column>
                                         <el-table-column
-                                                prop="address"
-                                                label="鏉$爜">
+                                            prop="qrcode"
+                                            label="鏉$爜">
                                         </el-table-column>
                                         <el-table-column
-                                                prop="address"
-                                                label="鍝佺墝">
+                                            prop="brand"
+                                            label="鍝佺墝">
                                         </el-table-column>
                                         <el-table-column
-                                                prop="address"
-                                                label="瑙勬牸鍨嬪彿">
+                                            prop="attr"
+                                            label="瑙勬牸鍨嬪彿">
                                         </el-table-column>
                                         <el-table-column
-                                                prop="address"
-                                                label="鍗曚綅">
+                                            prop="unitName"
+                                            label="鍗曚綅">
                                         </el-table-column>
                                         <el-table-column
-                                                prop="address"
-                                                label="搴撳瓨鏁伴噺">
+                                            label="搴撳瓨鏁伴噺">
+                                            <template v-slot="scope">
+                                                <span>{{ scope.row.maxStock }} ~ {{ scope.row.minStock }}</span>
+                                            </template>
                                         </el-table-column>
                                     </el-table>
                                     <div class="xm_table_f">
                                         <el-pagination
-                                                @size-change="handleSizeChange"
-                                                @current-change="handleCurrentChange"
-                                                :current-page="page"
-                                                :page-sizes="[10, 20, 30, 40]"
-                                                :page-size="pageTotal"
-                                                layout="total, sizes, prev, pager, next, jumper"
-                                                :total="total">
+                                            @size-change="handleSizeChange"
+                                            @current-change="handleCurrentChange"
+                                            :current-page="page"
+                                            :page-sizes="[10, 20, 30, 40]"
+                                            :page-size="pageTotal"
+                                            layout="total, sizes, prev, pager, next, jumper"
+                                            :total="total">
                                         </el-pagination>
                                     </div>
                                 </div>
@@ -359,34 +399,222 @@
                 </el-tabs>
             </div>
         </div>
+        <!--    鍚堝悓璇︽儏    -->
+        <ContractDetail ref="ContractDetailRef" />
+        <!--    宸ュ崟璇︽儏    -->
+        <Detail v-if="showDetail" ref="DetailRef" @close="showDetail = false" />
+        <!--    鏂板缓宸ュ崟    -->
+        <OperaYwWorkorderWindow ref="operaYwWorkorderWindow" @success="getFetchList" />
+        <!--    鏂板缓璁惧    -->
+        <Edit v-if="showEdit1" ref="EditRef" @success="getDevicePage" @close="showEdit1 = false" />
+        <!--    鏂板缓璧勪骇    -->
+        <newMaterial ref="newMaterial" @success="getPropertyLists" />
     </GlobalWindow>
 </template>
 
 <script>
   import BaseOpera from '@/components/base/BaseOpera'
   import GlobalWindow from '@/components/common/GlobalWindow'
+  import newMaterial from '../../stock/components/newMaterial'
   import * as echarts from 'echarts';
+  import { detailById } from '@/api/project/ywRoom'
+  import { fetchList as TenantContract } from '@/api/contract'
+  import { getDataVO, fetchList } from '@/api/workorder/ywWorkorder'
+  import ContractDetail from '../../contract/components/contractDetail'
+  import { fetchList as getCateList } from '@/api/business/category.js'
+  import { fetchList as getPropertyList } from '@/api/ywMaterial'
+  import { getDeviceStatus, getDeviceCateData, fetchList as devicePage } from '@/api/Inspection/device'
+  import Detail from '../../workorder/components/detail'
+  import OperaYwWorkorderWindow from '../../workorder/components/OperaYwWorkorderWindow'
+  import Edit from '../../operation/components/deviceEdit'
   export default {
     name: "houseDetails",
     extends: BaseOpera,
-    components: { GlobalWindow },
+    components: { GlobalWindow, ContractDetail, Detail, OperaYwWorkorderWindow, Edit, newMaterial },
     data() {
       return {
         info: {},
+        houseId: '',
+        propsName: '',
         activeName: 'houseinfo',
         total: 0,
         pageTotal: 10,
         page: 1,
-        tableData: []
+        numObj: {},
+        tableData: [],
+        loading: false,
+        form: {
+          code: '',
+          areaIds: [],
+          cateId: '',
+          status: '',
+          name: ''
+        },
+        cateList: [],
+        categaryList: [],
+        deviceList: [],
+        showDetail: false,
+        showEdit1: false
       }
     },
     methods: {
-      open (title, target) {
+      open (title, id) {
         this.title = title
-        this.visible = true
+        this.houseId = id
+        detailById(id)
+          .then(res => {
+            this.info = res
+            this.visible = true
+          })
+      },
+      handleEdit(row) {
+        this.showEdit1 = true
         this.$nextTick(() => {
-          this.reand()
-          this.reand1()
+          this.$refs.EditRef.isShowModal = true
+        })
+      },
+      handleDetail(row) {
+        this.showDetail = true
+        this.$nextTick(() => {
+          this.$refs.DetailRef.visible = true
+          this.$refs.DetailRef.id = row.id
+          this.$refs.DetailRef.getDetail()
+        })
+      },
+      // 鑾峰彇璁惧鐘舵��
+      getDevice() {
+        getDeviceStatus({ roomId: this.houseId })
+            .then(res => {
+              this.$nextTick(() => {
+                this.deviceList = [
+                  { value: res.workAmount || 0, name: '姝e父' },
+                  { value: res.exceptionAmount || 0, name: '寮傚父' },
+                  { value: res.errAmount || 0, name: '鎶ュ簾' }
+                ]
+                this.reand()
+              })
+            })
+      },
+      // 璁惧鏁伴噺鍒嗗竷缁熻
+      getDeviceCateDatas() {
+        getDeviceCateData({
+          roomId: this.houseId
+        }).then(res => {
+          this.categaryList = res
+          this.$nextTick(() => {
+            this.reand1()
+          })
+        })
+      },
+      // 鑾峰彇璁惧鍒嗛〉
+      getDevicePage() {
+        this.loading = true
+        devicePage({
+          capacity: this.pageTotal,
+          page: this.page,
+          model: {
+            roomId: this.houseId,
+            status: this.form.status,
+            name: this.form.name
+          }
+        }).then(res => {
+          this.tableData = res.records
+          this.total = res.total
+        }).finally(() => {
+          this.loading = false
+        })
+      },
+      // 鑾峰彇璧勪骇鍒楄〃
+      getPropertyLists() {
+        this.loading = true
+        getPropertyList({
+          capacity: this.pageTotal,
+          page: this.page,
+          model: {
+            roomId: this.houseId,
+            name: this.form.name
+          }
+        }).then(res => {
+          this.tableData = res.records
+          this.total = res.total
+        }).finally(() => {
+          this.loading = false
+        })
+      },
+      getCate() {
+        getCateList({
+          model: { type: 3 },
+          capacity: 1000,
+          page: 1,
+        }).then(res => {
+          this.cateList = res.records || []
+        })
+      },
+      changeSel(e) {
+        if (e && e.length == 2) {
+          this.$set(this.form, 'cateId', e[1])
+        } else {
+          this.$set(this.form, 'cateId', '')
+        }
+      },
+      clear() {
+        this.page = 1
+        this.form.status = ''
+        this.form.areaIds = []
+        this.form.cateId = ''
+        this.form.name = ''
+        if (this.propsName === 'project') {
+          this.getTenantContract()
+        } else if (this.propsName === 'second') {
+          this.getFetchList()
+        } else if (this.propsName === 'third') {
+          this.getDevicePage()
+        } else if (this.propsName === 'fourth') {
+          this.getPropertyLists()
+        }
+      },
+      // 鑾峰彇宸ュ崟鏁�
+      getDataVOs() {
+        getDataVO({
+          queryId: this.houseId,
+          queryType: 3
+        }).then(res => {
+          this.numObj = res
+        })
+      },
+      // 鑾峰彇宸ュ崟鍒楄〃
+      getFetchList() {
+        this.loading = true
+        fetchList({
+          capacity: 10,
+          page: 1,
+          model: {
+            roomId: this.houseId,
+            status: this.form.status,
+            cateId: this.form.cateId
+          }
+        }).then(res => {
+          this.tableData = res.records
+          this.total = res.total
+        }).finally(() => {
+          this.loading = false
+        })
+      },
+      // 鑾峰彇鍚堝悓鍒嗛〉
+      getTenantContract() {
+        this.loading = true
+        TenantContract({
+          capacity: this.pageTotal,
+          page: this.page,
+          model: {
+            roomIds: [this.houseId],
+            code: this.form.code
+          }
+        }).then(res => {
+          this.tableData = res.records
+          this.total = res.total
+        }).finally(() => {
+          this.loading = false
         })
       },
       reand() {
@@ -394,38 +622,29 @@
         var myChart = echarts.init(chartDom);
         var option;
         option = {
+          title: {
+            text: '璁惧鐘舵��'
+          },
           tooltip: {
             trigger: 'item'
           },
           legend: {
-            top: '5%',
-            left: 'center'
+            left: 'right',
+            top: 'middle',
+            width: '80'
           },
           series: [
             {
-              name: 'Access From',
+              name: '璁惧鐘舵��',
               type: 'pie',
               radius: ['40%', '80%'],
-              avoidLabelOverlap: false,
               label: {
-                show: false,
-                position: 'center'
+                show: true,
+                position: 'center',
+                fontWeight: 'bold',
+                fontSize: 22
               },
-              emphasis: {
-                label: {
-                  show: true,
-                  fontSize: 40,
-                  fontWeight: 'bold'
-                }
-              },
-              labelLine: {
-                show: false
-              },
-              data: [
-                { value: 1048, name: '姝e父' },
-                { value: 735, name: '寮傚父' },
-                { value: 580, name: '鎶ュ簾' }
-              ]
+              data: this.deviceList
             }
           ]
         };
@@ -435,7 +654,6 @@
         var chartDom = document.getElementById('chat2');
         var myChart = echarts.init(chartDom);
         var option;
-        // There should not be negative values in rawData
         const rawData = [
           [100, 302, 301, 334, 390, 330, 320],
           [320, 132, 101, 134, 90, 230, 210],
@@ -451,12 +669,6 @@
           }
           totalData.push(sum);
         }
-        const grid = {
-          left: 100,
-          right: 100,
-          top: 50,
-          bottom: 50
-        };
         const series = [
           'Direct',
           'Mail Ad',
@@ -469,41 +681,103 @@
             type: 'bar',
             stack: 'total',
             barWidth: '60%',
-            label: {
-              show: true,
-              formatter: (params) => Math.round(params.value * 1000) / 10 + '%'
-            },
             data: rawData[sid].map((d, did) =>
               totalData[did] <= 0 ? 0 : d / totalData[did]
             )
           };
         });
+        let seriesArr = this.categaryList.map(item => {
+          return {
+            name: item.cateName,
+            type: 'bar',
+            stack: 'total',
+            barWidth: '60%',
+            data: item.ywDeviceCateDataVOList.map((child) =>
+              child.deviceAmount
+            )
+          }
+        })
+        let xAxisData = this.categaryList.map(item => item.cateName)
+        console.log(series)
+        console.log(seriesArr)
+        console.log(xAxisData)
         option = {
-          legend: {
-            selectedMode: false
+          title: {
+            text: '璁惧鏁伴噺鍒嗙被缁熻'
           },
-          grid,
+          grid: {
+            left: 50,
+            right: 50,
+            top: 50,
+            bottom: 50
+          },
+          tooltip: {
+            trigger: 'axis',
+            axisPointer: {
+              type: 'shadow'
+            }
+          },
           yAxis: {
             type: 'value'
           },
           xAxis: {
             type: 'category',
-            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
+            data: xAxisData
           },
-          series
+          series: seriesArr
         };
 
         option && myChart.setOption(option);
       },
-      handleClick(tab, event) {
-        console.log(tab, event);
+      handleClick(tab) {
+        this.page = 1
+        this.pageTotal = 10
+        this.tableData = []
+        this.total = 0
+        this.form.code = ''
+        this.form.areaIds = []
+        this.form.cateId = ''
+        this.form.status = ''
+        this.form.name = ''
+        this.propsName = tab._props.name
+        if (tab._props.name === 'project') {
+          this.getTenantContract()
+        } else if (tab._props.name === 'second') {
+          this.getDataVOs()
+          this.getCate()
+          this.getFetchList()
+        } else if (tab._props.name === 'third') {
+          this.getDevice()
+          this.getDeviceCateDatas()
+          this.getDevicePage()
+        } else if (this.propsName === 'fourth') {
+          this.getPropertyLists()
+        }
       },
       handleCurrentChange(page) {
         this.page = page
+        if (this.propsName === 'project') {
+          this.getTenantContract()
+        } else if (this.propsName === 'second') {
+          this.getFetchList()
+        } else if (tab._props.name === 'third') {
+          this.getDevicePage()
+        } else if (this.propsName === 'fourth') {
+          this.getPropertyLists()
+        }
       },
       handleSizeChange(pageTotal) {
         this.pageTotal = pageTotal
-      },
+        if (this.propsName === 'project') {
+          this.getTenantContract()
+        } else if (this.propsName === 'second') {
+          this.getFetchList()
+        } else if (tab._props.name === 'third') {
+          this.getDevicePage()
+        } else if (this.propsName === 'fourth') {
+          this.getPropertyLists()
+        }
+      }
     }
   }
 </script>
@@ -517,10 +791,13 @@
             width: 100%;
             padding: 20px;
             box-sizing: border-box;
-            font-size: 16px;
-            font-weight: bold;
-            color: black;
-            background: #ffffff;
+            span {
+                font-size: 16px;
+                font-weight: bold;
+                color: black;
+                background: #ffffff;
+                margin-right: 10px;
+            }
         }
         .right_cate {
             width: 100%;

--
Gitblit v1.9.3