From 2a61dad694bad8ddcea768ac973cc0c2339a54cc Mon Sep 17 00:00:00 2001
From: lin <sbla5888@163.com>
Date: Mon, 06 May 2024 14:46:05 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/place/mallList.vue                           |    4 +
 src/views/propertySupervision/houseHoldSupervision.vue |    2 
 src/views/userHouse/houseList.vue                      |  110 ++++++++++++++++++++++--------------
 src/api/userHouse/list/userHouseList.js                |    7 ++
 src/util/util.js                                       |   16 +++++
 src/views/grid/index.vue                               |    2 
 src/styles/avue-ui.scss                                |    2 
 src/views/place/index.vue                              |    2 
 src/views/userHouse/houseHoldList.vue                  |    2 
 src/views/place/components/baseAllInfo.vue             |    2 
 src/views/district/index.vue                           |    2 
 src/views/propertySupervision/residentSupervision.vue  |    8 +-
 12 files changed, 103 insertions(+), 56 deletions(-)

diff --git a/src/api/userHouse/list/userHouseList.js b/src/api/userHouse/list/userHouseList.js
index 6edb9ce..4445984 100644
--- a/src/api/userHouse/list/userHouseList.js
+++ b/src/api/userHouse/list/userHouseList.js
@@ -70,6 +70,13 @@
     }
   })
 }
+export const saveOrUpdateHouseLabelInfo = (row) => {
+  return request({
+    url: '/api/blade-householdLabel/householdLabel/saveOrUpdateHouseLabel',
+    method: 'post',
+    data: row
+  })
+}
 export const saveOrUpdateHouseholdLabel = (row) => {
   return request({
     url: '/api/blade-householdLabel/householdLabel/saveOrUpdateHouseholdLabel',
diff --git a/src/styles/avue-ui.scss b/src/styles/avue-ui.scss
index 888d681..b75931a 100644
--- a/src/styles/avue-ui.scss
+++ b/src/styles/avue-ui.scss
@@ -67,7 +67,7 @@
     .echarts-cell {
       //   margin: 0 5px;
       height: 300px;
-      width: calc(33.3% - 10px);
+      width: calc(25% - 10px);
       display: flex;
       flex-direction: column;
       background: #fff;
diff --git a/src/util/util.js b/src/util/util.js
index 7510d0a..ccf5261 100644
--- a/src/util/util.js
+++ b/src/util/util.js
@@ -473,3 +473,19 @@
     }
   }
 };
+
+
+//转换房屋标签颜色
+export const setHouseLabelColor = (color) => {
+  let obj = {
+    blue: "#4397F7",
+    yellow: "#FFB42B",
+    green: "#30D17C",
+  };
+
+  for (let i in obj) {
+    if (color == i) {
+      return obj[i];
+    }
+  }
+};
diff --git a/src/views/district/index.vue b/src/views/district/index.vue
index 234c45e..18632c6 100644
--- a/src/views/district/index.vue
+++ b/src/views/district/index.vue
@@ -90,7 +90,7 @@
                         searchSpan: 4,
                         searchType: 'input',
                         type: "tree",
-                        dicUrl: "/api/blade-system/region/tree",
+                        dicUrl: "/api/blade-system/region/treeToCommunity",
                         props: {
                             label: "name",
                             value: "id"
diff --git a/src/views/grid/index.vue b/src/views/grid/index.vue
index 4d16b8f..5ca1eac 100644
--- a/src/views/grid/index.vue
+++ b/src/views/grid/index.vue
@@ -96,7 +96,7 @@
               prop: "communityCode",
               search: false,
               type: "tree",
-              dicUrl: "/api/blade-system/region/tree",
+              dicUrl: "/api/blade-system/region/treeToCommunity",
               row: true,
               // cascader: ['principal'],
               props: {
diff --git a/src/views/place/components/baseAllInfo.vue b/src/views/place/components/baseAllInfo.vue
index 558c9d1..9baf10c 100644
--- a/src/views/place/components/baseAllInfo.vue
+++ b/src/views/place/components/baseAllInfo.vue
@@ -146,7 +146,7 @@
               prop: "neiCode",
               search: false,
               type: "tree",
-              dicUrl: "/api/blade-system/region/tree",
+              dicUrl: "/api/blade-system/region/treeToCommunity",
               props: {
                 label: "name",
                 value: "id",
diff --git a/src/views/place/index.vue b/src/views/place/index.vue
index 60db9df..57cbf2f 100644
--- a/src/views/place/index.vue
+++ b/src/views/place/index.vue
@@ -225,7 +225,7 @@
                         search: false,
                         width: 150,
                         type: "tree",
-                        dicUrl: "/api/blade-system/region/tree",
+                        dicUrl: "/api/blade-system/region/treeToCommunity",
                         props: {
                             label: "name",
                             value: "id",
diff --git a/src/views/place/mallList.vue b/src/views/place/mallList.vue
index 4c972cb..624884c 100644
--- a/src/views/place/mallList.vue
+++ b/src/views/place/mallList.vue
@@ -225,7 +225,7 @@
                         search: false,
                         width: 150,
                         type: "tree",
-                        dicUrl: "/api/blade-system/region/tree",
+                        dicUrl: "/api/blade-system/region/treeToCommunity",
                         props: {
                             label: "name",
                             value: "id",
@@ -684,6 +684,8 @@
         },
 
         rowSave(row, done, loading) {
+            // 商超
+            row['source'] = 3
             if (row.imageUrls.length > 0) {
                 var urls = []
                 var split = row.imageUrls.split(",").filter(item => item != '')
diff --git a/src/views/propertySupervision/houseHoldSupervision.vue b/src/views/propertySupervision/houseHoldSupervision.vue
index 753900e..319347a 100644
--- a/src/views/propertySupervision/houseHoldSupervision.vue
+++ b/src/views/propertySupervision/houseHoldSupervision.vue
@@ -214,7 +214,7 @@
           searchMenuSpan: 3,
           menuWidth: 350,
           menu: false,
-          height: 'auto',
+          height: '320',
           calcHeight: 80,
           tip: false,
           border: true,
diff --git a/src/views/propertySupervision/residentSupervision.vue b/src/views/propertySupervision/residentSupervision.vue
index 0963b56..8444f22 100644
--- a/src/views/propertySupervision/residentSupervision.vue
+++ b/src/views/propertySupervision/residentSupervision.vue
@@ -200,11 +200,10 @@
             option: {
                 labelWidth: 144,
                 searchLabelWidth: 96,
-                searchShow: true,
-                searchMenuSpan: 3,
-                menuWidth: 280,
+                // searchShow: true,
+                searchMenuSpan: 6,
                 menu: false,
-                height: 'auto',
+                height: '280',
                 calcHeight: 80,
                 tip: false,
                 border: true,
@@ -221,6 +220,7 @@
                     width: 110,
                     label: "姓名",
                     prop: "name",
+                    searchLabelWidth: 48,
                     searchSpan: 3,
                     searchLabelWidth: 50,
                     search: true,
diff --git a/src/views/userHouse/houseHoldList.vue b/src/views/userHouse/houseHoldList.vue
index f8a11a6..b642cc8 100644
--- a/src/views/userHouse/houseHoldList.vue
+++ b/src/views/userHouse/houseHoldList.vue
@@ -874,7 +874,7 @@
   mounted() { },
   methods: {
     onsubmit() {
-      if (this.labelForm.color === '#EBEDF0') {
+      if (this.labelForm.color === '#999') {
         let params = {
           householdId: this.currentRow.id,
           labelId: this.currentLabel.id,
diff --git a/src/views/userHouse/houseList.vue b/src/views/userHouse/houseList.vue
index c785db9..b673a97 100644
--- a/src/views/userHouse/houseList.vue
+++ b/src/views/userHouse/houseList.vue
@@ -32,8 +32,8 @@
                         <el-button :size="size" type="text" icon="el-icon-circle-plus-outline"
                             v-if="permission.house_manager" @click="handleHouseholdManager(row)">住户管理
                         </el-button>
-                        <el-button :size="size" type="text" icon="el-icon-circle-plus-outline" v-if="permission.house_tag"
-                            @click="manageLabel(row)">标签
+                        <el-button :size="size" type="text" icon="el-icon-circle-plus-outline"
+                            v-if="permission.house_tag" @click="manageLabel(row)">标签
                         </el-button>
                     </template>
 
@@ -99,9 +99,9 @@
         </el-col>
     </el-row>
 </template>
- 
+
 <script>
-import { setLabelColor } from '@/util/util'
+import { setHouseLabelColor } from '@/util/util'
 
 import {
     getList,
@@ -113,7 +113,7 @@
 } from "@/api/userHouse/list/house.js"
 import {
     removeHouseholdLabel,
-    saveOrUpdateHouseholdLabel
+    saveOrUpdateHouseLabelInfo
 } from "@/api/userHouse/list/userHouseList.js"
 import {
     getLabelList,
@@ -142,7 +142,7 @@
     components: {
         householdManager
     },
-    data () {
+    data() {
 
         //手机号格式校验
         let validatorPhone = function (rule, value, callback) {
@@ -328,7 +328,7 @@
                         prop: "neiCode",
                         search: false,
                         type: "tree",
-                        dicUrl: "/api/blade-system/region/tree",
+                        dicUrl: "/api/blade-system/region/treeToCommunity",
                         props: {
                             label: "name",
                             value: "id",
@@ -511,7 +511,7 @@
     },
     watch: {
         'form.source': {
-            handler (newData) {
+            handler(newData) {
 
                 let locationColumn = this.findObject(
                     this.option.column,
@@ -528,7 +528,7 @@
     },
     computed: {
         ...mapGetters(["userInfo", "permission"]),
-        permissionList () {
+        permissionList() {
             return {
                 addBtn: this.vaildData(this.permission.house_add, true),
                 viewBtn: this.vaildData(this.permission.house_view, true),
@@ -537,7 +537,7 @@
             }
         },
 
-        textDispose () {
+        textDispose() {
             return (row, flag, type) => {
                 if (row[flag] || row[type] == null) {
                     return row[type]
@@ -550,7 +550,7 @@
                 }
             }
         },
-        showLocation () {
+        showLocation() {
             return (data) => {
                 if (data != null && data.indexOf(',') != -1) {
                     data = data.split(',')
@@ -562,21 +562,21 @@
             }
         },
 
-        labelDispose () {
+        labelDispose() {
             return (list) => {
                 return list.map(item => item.labelName).join(',')
             }
         },
 
-        getColor () {
+        getColor() {
             return (data) => {
-                return setLabelColor(data)
+                return setHouseLabelColor(data)
             }
         }
     },
-    mounted () { },
+    mounted() { },
     methods: {
-        locationDispose (data) {
+        locationDispose(data) {
             data = data.split(',')
 
             return {
@@ -586,8 +586,8 @@
             }
         },
 
-        onsubmit () {
-            if (this.labelForm.color === '#EBEDF0') {
+        onsubmit() {
+            if (this.labelForm.color === '#999') {
                 let params = {
                     householdId: this.currentRow.id,
                     labelId: this.currentLabel.id
@@ -606,7 +606,7 @@
                 this.labelForm.householdId = this.currentRow.id
                 this.labelForm.labelId = this.currentLabel.id
                 this.labelForm.lableType = 2
-                saveOrUpdateHouseholdLabel(this.labelForm).then(res => {
+                saveOrUpdateHouseLabelInfo(this.labelForm).then(res => {
                     this.$message({
                         type: "success",
                         message: "操作成功!"
@@ -618,13 +618,35 @@
             }
         },
 
-        changLabel (item) {
-            this.editLabelFlge = true
+        changLabel(item) {
+            // this.editLabelFlge = true
             this.currentLabel = item
-            this.labelForm.color = item.color
-            this.labelForm.remark = item.remark
+            // this.labelForm.color = item.color
+            // this.labelForm.remark = item.remark
+            // console.log(item,9999)
+            if(item.name == '闲置'){
+                this.labelForm.color = 'green'
+            }
+            if(item.name == '自住'){
+                this.labelForm.color = 'blue'
+            }
+            if(item.name == '出租'){
+                this.labelForm.color = 'yellow'
+            }
+            this.labelForm.houseCode = this.currentRow.houseCode
+            this.labelForm.labelId = this.currentLabel.id
+            this.labelForm.lableType = 2
+            saveOrUpdateHouseLabelInfo(this.labelForm).then(res => {
+                this.$message({
+                    type: "success",
+                    message: "操作成功!"
+                })
+                // this.editLabelFlge = false
+                this.manageLabel(this.currentRow)
+                this.loading = false
+            })
         },
-        manageLabel (item) {
+        manageLabel(item) {
             this.loading = true
             this.currentRow = item
             this.labelFlag = true
@@ -658,14 +680,14 @@
                 })
             })
         },
-        handleHouseholdManager (row) {
+        handleHouseholdManager(row) {
             var that = this
             this.householdManagerVisible = true
             this.$nextTick(() => {
                 that.$refs.householdManager.init(row)
             })
         },
-        rowSave (row, done, loading) {
+        rowSave(row, done, loading) {
             if (row.imageUrls.length > 0) {
                 var urls = []
                 var split = row.imageUrls.split(",")
@@ -690,7 +712,7 @@
                 loading()
             })
         },
-        rowUpdate (row, index, done, loading) {
+        rowUpdate(row, index, done, loading) {
             if (row.imageUrls.length > 0) {
                 var urls = []
                 var split = row.imageUrls.split(",")
@@ -714,7 +736,7 @@
                 loading()
             })
         },
-        rowDel (row) {
+        rowDel(row) {
             this.$confirm("确定将选择数据删除?", {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消",
@@ -731,25 +753,25 @@
                     })
                 })
         },
-        searchReset () {
+        searchReset() {
             this.query = {}
             this.treeDeptId = ''
             this.onLoad(this.page)
         },
-        searchChange (params, done) {
+        searchChange(params, done) {
             this.query = params
             this.page.currentPage = 1
             this.onLoad(this.page, params)
             done()
         },
-        selectionChange (list) {
+        selectionChange(list) {
             this.selectionList = list
         },
-        selectionClear () {
+        selectionClear() {
             this.selectionList = []
             this.$refs.crud.toggleSelection()
         },
-        handleDelete () {
+        handleDelete() {
             if (this.selectionList.length === 0) {
                 this.$message.warning("请选择至少一条数据")
                 return
@@ -771,16 +793,16 @@
                     this.$refs.crud.toggleSelection()
                 })
         },
-        handleImport () {
+        handleImport() {
             this.excelBox = true
         },
-        uploadAfter (res, done, loading, column) {
+        uploadAfter(res, done, loading, column) {
             window.console.log(column)
             this.excelBox = false
             this.refreshChange()
             done()
         },
-        handleExport () {
+        handleExport() {
             this.$confirm("是否导出房屋数据?", "提示", {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消",
@@ -799,12 +821,12 @@
                 })
             })
         },
-        handleTemplate () {
+        handleTemplate() {
             exportBlob(`/api/blade-system/user/export-template?${this.website.tokenHeader}=${getToken()}`).then(res => {
                 downloadXls(res.data, "房屋数据模板.xlsx")
             })
         },
-        beforeOpen (done, type) {
+        beforeOpen(done, type) {
             if (["edit", "view"].includes(type)) {
                 getDetatil({
                     id: this.form.id
@@ -828,16 +850,16 @@
             this.initFlag = true
             done()
         },
-        currentChange (currentPage) {
+        currentChange(currentPage) {
             this.page.currentPage = currentPage
         },
-        sizeChange (pageSize) {
+        sizeChange(pageSize) {
             this.page.pageSize = pageSize
         },
-        refreshChange () {
+        refreshChange() {
             this.onLoad(this.page, this.query)
         },
-        onLoad (page, params = {}) {
+        onLoad(page, params = {}) {
             this.loading = true
 
             getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
@@ -867,13 +889,13 @@
                 this.selectionClear()
             })
         },
-        showStringDispose (row, type) {
+        showStringDispose(row, type) {
             row[type] = !row[type]
         }
     }
 }
 </script>
- 
+
 <style>
 .box {
     height: 800px;

--
Gitblit v1.9.3