Browse Source

fix: 地图筛选,照片弹框,接口对接

lxf 2 days ago
parent
commit
9accca32f1

+ 58 - 7
src/views/home/album_compoents/albumCarousel.vue

@@ -90,8 +90,13 @@
 
                                     <el-form-item v-if="treeItemData?.miniUserId" label="守护人" prop="user">
                                         <div class="avatar-content">
-                                            <el-avatar :size="36" :src="treeItemData.icon" />
-                                            <div class="avatar-name">{{ treeItemData.userNickName || treeItemData.miniUserId }}</div>
+                                            <div class="avatar-l">
+                                                <el-avatar :size="36" :src="treeItemData.icon" />
+                                                <div class="avatar-name">{{ treeItemData.userNickName || treeItemData.miniUserId }}</div>
+                                            </div>
+                                            <div class="avatar-r" @click="warningMessage(treeItemData)">
+                                                取消守护权限
+                                            </div>
                                         </div>
                                     </el-form-item>
                                     <el-form-item v-else label="预留守护人" prop="user">
@@ -103,7 +108,7 @@
                             </div>
                         </div>
 
-                        <div class="overview-file">
+                        <!-- <div class="overview-file">
                             <div class="box-title">产量详情</div>
                             <div class="box-wrap">
                                 <div class="box-item" v-for="(item, index) in outputBox" :key="index">
@@ -121,7 +126,7 @@
                                     <div class="item-val">{{ item.value }}</div>
                                 </div>
                             </div>
-                        </div>
+                        </div> -->
                     </div>
 
                     
@@ -141,7 +146,7 @@ import "./cacheImg.js";
 import AlbumCarouselItem from "./albumCarouselItem";
 import { dateFormat } from "@/utils/date_util.js";
 import eventBus from "@/api/eventBus";
-import { ElMessage } from "element-plus";
+import { ElMessage, ElMessageBox } from "element-plus";
 
 const lock = ref(false);
 const farmId = ref(766);
@@ -271,6 +276,7 @@ const activeOuput = ref(null);
 
 function closeDialog() {
     ruleForm.offlineTakeSelected = {}
+    changeAuth.value = false
     ruleFormRef.value.resetFields()
     activeOuput.value = null;
     eventBus.emit("change:watermark", "");
@@ -322,7 +328,7 @@ async function saveEdit(isToSave) {
                 if (changeAuth.value) {
                     const params = {
                         sampleIds: [sampleIdVal.value],
-                        isRenyang: changeAuth.value ? 1 : 0,
+                        isRenyang: switchAuth.value ? 1 : 0,
                         farmId: Number(sessionStorage.getItem("currentFarmId"))
                     };
                     
@@ -331,6 +337,7 @@ async function saveEdit(isToSave) {
                 VE_API.manage_interface.editFosterSample({...ruleForm, sampleId: sampleIdVal.value}).then((res) => {
                     if (res.code === 0) {
                         ElMessage.success("修改成功")
+                        dialogVisible.value = false
                         eventBus.emit("refreshMapData")
                     }
                 })
@@ -353,7 +360,36 @@ onMounted(() => {
 // 开放权限
 const switchAuth = ref(true)
 function handleAuthChange() {
-    switchAuth.value = !switchAuth.value
+    changeAuth.value = true
+}
+
+
+// 取消守护权限
+function warningMessage(item) {
+    ElMessageBox.confirm(`确认取消 ${item.userNickName} 的守护权限吗?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+    }).then(() => {
+        console.log('item', item);
+        // VE_API.manage_user.cleanBind({ miniUserId: item.miniUserId }).then(({ code }) => {
+        //     if (code === 0) {
+        //         ElMessage.success(`已取消 ${item.userNickName} 的守护权限`);
+        //         getUserList();
+        //     }
+        // });
+        // VE_API.manage_user.deleteUser({
+        //     id: item.id,
+        // }).then(({code}) => {
+        //     if (code === 0) {
+        //         ElMessage({
+        //             type: 'success',
+        //             message: `已取消 ${item.name} 的守护权限`,
+        //         });
+        //         getUserList();
+        //     }
+        // });
+    }).catch(() => {});
 }
 </script>
 
@@ -519,6 +555,7 @@ function handleAuthChange() {
             margin-top: 8px;
         }
         .file-content {
+            min-height: 520px;
             height: calc(100% - 30px);
             display: flex;
             flex-direction: column;
@@ -529,9 +566,23 @@ function handleAuthChange() {
         .avatar-content {
             display: flex;
             align-items: center;
+            justify-content: space-between;
+            width: 100%;
             .avatar-name {
                 padding-left: 10px;
             }
+            .avatar-l {
+                display: flex;
+                align-items: center;
+            }
+            .avatar-r {
+                font-size: 12px;
+                padding: 0 10px;
+                border-radius: 20px;
+                cursor: pointer;
+                color: #F04337;
+                background-color: rgba(240, 67, 55, 0.1);
+            }
         }
         .box-wrap {
             display: flex;

+ 58 - 20
src/views/home/components/applyList.vue

@@ -1,7 +1,14 @@
 <template>
     <div class="apply-list">
         <div class="search-wrap">
-            
+            <el-input
+                @change="getUserList"
+                v-model="searchWord"
+                style="width: 100%"
+                size="large"
+                placeholder="搜索用户昵称/手机号"
+                :prefix-icon="Search"
+                />
         </div>
         <div class="list-wrap">
             <el-collapse v-model="activeNames" expand-icon-position="left">
@@ -89,6 +96,7 @@
                     </div>
                 </el-collapse-item>
             </el-collapse>
+            <div class="no-data" v-show="!groupList.length">暂无数据</div>
         </div>
     </div>
     <!-- 新增客户、编辑客户 -->
@@ -96,18 +104,27 @@
 </template>
 
 <script setup>
-import { onMounted, ref } from "vue";
+import { onMounted, ref, watch } from "vue";
 import editClientPopup from "@/components/editClientPopup.vue";
 import eventBus from "@/api/eventBus";
 import { ElMessage, ElMessageBox } from 'element-plus'
 import { useRouter } from "vue-router";
+import { Search } from '@element-plus/icons-vue'
 const router = useRouter();
+const props = defineProps({
+    // 是否开始重新加载列表
+    startReloadList: {
+        type: Boolean,
+        default: false,
+    },
+});
 
 const editClientRef = ref(null);
 const handlePerson = (type, data) => {
     editClientRef.value.openClientPopup(type, data);
 };
 
+const searchWord = ref(null)
 const groupList = ref([]);
 const activeNames = ref([0]);
 onMounted(() => {
@@ -115,13 +132,13 @@ onMounted(() => {
 });
 
 function getUserList() {
-    VE_API.manage_interface.fetchGroupList({ farmId: 766, isAllot: 1 }).then(({ data }) => {
-        groupList.value = Object.keys(data).map((key) => {
-            return {
+    VE_API.manage_interface.fetchGroupList({ farmId: 766, isAllot: 1, word: searchWord.value }).then(({ data }) => {
+        groupList.value = Object.keys(data)
+            .filter(key => data[key] && data[key].length > 0) // 先过滤掉空的 key
+            .map(key => ({
                 name: key,
-                list: data[key],
-            };
-        });
+                list: data[key]
+            }));
     });
 }
 
@@ -145,24 +162,35 @@ function warningMessage(item) {
         cancelButtonText: '取消',
         type: 'warning',
     }).then(() => {
-        VE_API.manage_user.deleteUser({
-            id: item.id,
-        }).then(({code}) => {
+        console.log('item', item);
+        VE_API.manage_user.cleanBind({ miniUserId: item.miniUserId }).then(({ code }) => {
             if (code === 0) {
-                ElMessage({
-                    type: 'success',
-                    message: `已取消 ${item.name} 的守护权限`,
-                });
+                ElMessage.success(`已取消 ${item.name} 的守护权限`);
                 getUserList();
             }
         });
+        // VE_API.manage_user.deleteUser({
+        //     id: item.id,
+        // }).then(({code}) => {
+        //     if (code === 0) {
+        //         ElMessage({
+        //             type: 'success',
+        //             message: `已取消 ${item.name} 的守护权限`,
+        //         });
+        //         getUserList();
+        //     }
+        // });
     }).catch(() => {});
 }
 
-
-function toCustomOneTree(data) {
-    router.push(`/layout/customTree?type=single&data=${JSON.stringify(data)}`);
-}
+watch(
+    () => props.startReloadList,
+    (newVal) => {
+        if (newVal) {
+            getUserList(); // 重新加载用户列表
+        }
+    }
+);
 
 </script>
 
@@ -180,8 +208,18 @@ function toCustomOneTree(data) {
         margin-left: 4px;
         border-radius: 4px;
     }
+    .search-wrap {
+        padding: 0 16px;
+        box-sizing: border-box;
+        ::v-deep {
+            .el-input__wrapper {
+                background: rgba(120, 120, 120, 0.05);
+                box-shadow: 0 0 0 1px rgba(120, 120, 120, 0.05) inset;
+            }
+        }
+    }
     .list-wrap {
-        height: 100%;
+        height: calc(100% - 40px);
         overflow: auto;
         padding: 0 8px;
         ::v-deep {

+ 6 - 6
src/views/home/components/clientList.vue

@@ -64,6 +64,7 @@
                     </div>
                 </el-collapse-item>
             </el-collapse>
+            <div class="no-data" v-show="!groupList.length">暂无数据</div>
         </div>
 
         <!-- 渐变主色按钮 -->
@@ -140,12 +141,12 @@ onMounted(() => {
 function getUserList() {
     VE_API.manage_interface.fetchGroupList({ farmId: 766, isAllot: 0 }).then(({ data }) => {
         // defalutList.value = data
-        groupList.value = Object.keys(data).map((key) => {
-            return {
+        groupList.value = Object.keys(data)
+            .filter(key => data[key] && data[key].length > 0) // 先过滤掉空的 key
+            .map(key => ({
                 name: key,
-                list: data[key],
-            };
-        });
+                list: data[key]
+            }));
         initGroupCheckStates(); // 初始化分组选择状态
     });
 }
@@ -190,7 +191,6 @@ const updateGroupCheckStatus = (groupIndex) => {
 
     groupCheckStates.value[groupIndex].checkAll = checkedCount === currentGroup.list.length;
     groupCheckStates.value[groupIndex].isIndeterminate = checkedCount > 0 && checkedCount < currentGroup.list.length;
-    console.log('groupList.value', checkedCities.value);
 
     emit("update:checkData", checkedCities.value);
 };

+ 11 - 5
src/views/home/homeMap.vue

@@ -22,6 +22,7 @@ import albumCarousel from "./album_compoents/albumCarousel.vue";
 import { onMounted, ref } from "vue";
 import { useStore } from "vuex";
 import { unByKey } from "ol/Observable";
+import { deepClone } from "@/common/commonFun";
 
 const store = useStore();
 const areaRef = ref(null);
@@ -135,8 +136,12 @@ const enableBoxSelect = () => {
 
 // 启用框选--分配果树
 const enableDistributeBoxSelect = () => {
-    const data = mapPoint.value.filter(item => item.isRenyang === 1 && !item.miniUserId);
-    updateClusterData(data, 1);
+    const data = mapPoint.value.filter(item => item.isRenyang === 1);
+    const treeData = deepClone(data)
+    treeData.map(item => {
+        item.isTreePoint = true
+    })
+    updateClusterData(treeData, 1);
     isDrawing.value = true;
     
     dragBox = new DragBox({
@@ -151,13 +156,13 @@ const enableDistributeBoxSelect = () => {
 };
 
 const handleKeyDown = (e) => {
-    if (e.ctrlKey) {
+    if (e.ctrlKey && areaRef.value) {
         areaRef.value.style.cursor = "crosshair";
     }
 };
 
 const handleKeyUp = (e) => {
-    if (!e.ctrlKey) {
+    if (!e.ctrlKey && areaRef.value) {
         areaRef.value.style.cursor = "";
     }
 };
@@ -299,7 +304,8 @@ const getSingleFeatureStyle = (feature) => {
 
     // 有图标的使用照片样式优先
     const imgIcon = feature.get('icon');
-    if (imgIcon) {
+    const isTreePoint = feature.get('isTreePoint');
+    if (imgIcon && !isTreePoint) {
         try {
             return styleCache.photoStyle(imgIcon);
         } catch (e) {

+ 18 - 4
src/views/home/index.vue

@@ -22,7 +22,10 @@
                                     ></client-list>
                             </el-tab-pane>
                             <el-tab-pane label="已分配" name="已分配">
-                                <apply-list></apply-list>
+                                <apply-list
+                                    :startReloadList="startReloadList"
+                                    @update:userList="setReload"
+                                ></apply-list>
                             </el-tab-pane>
                             <!-- <el-tab-pane label="确认地址" name="确认地址">
                                 <address-list></address-list>
@@ -80,7 +83,7 @@
             </div>
             <div v-show="checkDistributeShow" class="center-button">
                 <div class="cancel yes-events" @click="handleCancel">取消分配</div>
-                <div class="yes-events" @click="saveDistributeEdit" :class="{'disabled': !selectedTree.length || !selectedTels.length}">
+                <div class="yes-events" @click="saveDistributeEdit" :class="{'disabled': (!selectedTree.length || !selectedTels.length) || selectedTree.length < selectedTels.length}">
                     确认分配<span class="select-text">(已选{{selectedTree.length}}/<span class="select-total">{{ selectedTels.length }}</span>)</span>
                 </div>
             </div>
@@ -108,7 +111,7 @@ import customMap from "./homeMap.vue";
 import applyList from "./components/applyList.vue";
 import addressList from "./components/addressList.vue";
 import { convertPointToArray } from "@/utils/index";
-import { useRouter } from "vue-router";
+import { useRoute } from "vue-router";
 import { useStore } from "vuex";
 import eventBus from "@/api/eventBus";
 import PdfDialog from "../../components/PdfDialog";
@@ -119,7 +122,7 @@ const components = {
     treeDetail,
 };
 
-const router = useRouter();
+const route = useRoute();
 const mapRef = ref(null);
 
 const activeName = ref("果树列表");
@@ -133,6 +136,9 @@ onMounted(() => {
     // 修改单棵树信息后刷新地图数据
     eventBus.off("refreshMapData", getPointList);
     eventBus.on("refreshMapData", getPointList);
+    if (route.query.acitveName) {
+        activeName.value = route.query.acitveName
+    }
 });
 
 onUnmounted(() => {
@@ -193,6 +199,8 @@ const handleSelectedTree = (data) => {
 const handleCancel = () => {
     checkShow.value = false;
     checkDistributeShow.value = false;
+    selectedTree.value = []
+    selectedTels.value = []
     // mapRef.value.clearSelection()
     mapRef.value.stopBoxSelect();
 };
@@ -218,6 +226,7 @@ const saveDistributeEdit = () => {
         if (code === 0) {
             ElMessage.success("分配成功");
             startReloadList.value = true; // 触发重新加载列表
+            activeName.value = "已分配"
             handleCancel()
             return;
         }
@@ -274,6 +283,10 @@ function backHome() {
     currentComponent.value = "leftTabs";
     mapRef.value.resetCurrentTree();
 }
+
+function setReload() {
+    startReloadList.value = true
+}
 </script>
 
 <style lang="scss" scoped>
@@ -487,6 +500,7 @@ function backHome() {
             }
             .disabled {
                 opacity: 0.6;
+                pointer-events: none;
                 cursor: not-allowed;
             }
         }

+ 111 - 71
src/views/settingTree/index.vue

@@ -11,11 +11,29 @@
                     果树列表
                 </div>
                 <div class="select-wrap">
-                    <el-select class="select-item" @change="handleAreaChange" v-model="areaVal" placeholder="分区" style="width: 146px">
+                    <el-select
+                        class="select-item"
+                        @change="handleAreaChange"
+                        v-model="areaVal"
+                        placeholder="分区"
+                        style="width: 146px"
+                    >
                         <el-option label="全部分区" :value="0"></el-option>
-                        <el-option v-for="(item, index) in areaOptions" :key="index" :label="item.name" :value="item.id" />
+                        <el-option
+                            v-for="(item, index) in areaOptions"
+                            :key="index"
+                            :label="item.name"
+                            :value="item.id"
+                        />
                     </el-select>
-                    <el-select class="select-item" filterable @change="handleTypeChange" v-model="typeVal" placeholder="全部品类" style="width: 146px">
+                    <el-select
+                        class="select-item"
+                        filterable
+                        @change="handleTypeChange"
+                        v-model="typeVal"
+                        placeholder="全部品类"
+                        style="width: 146px"
+                    >
                         <el-option label="全部品类" :value="0"></el-option>
                         <el-option
                             v-for="(species, index) in speciesList"
@@ -24,7 +42,13 @@
                             :value="species.name"
                         />
                     </el-select>
-                    <el-select class="select-item" v-model="ageVal" placeholder="树龄" style="width: 146px">
+                    <el-select
+                        class="select-item"
+                        v-model="ageVal"
+                        @change="handleTypeChange"
+                        placeholder="树龄"
+                        style="width: 146px"
+                    >
                         <el-option
                             v-for="item in ageOptions"
                             :key="item.value"
@@ -34,11 +58,7 @@
                     </el-select>
                 </div>
                 <div class="tree-list">
-                    <div
-                        class="list-item"
-                        v-for="(item, index) in allTrees"
-                        :key="index"
-                    >
+                    <div class="list-item" v-for="(item, index) in allTrees" :key="index">
                         <div class="tree-icon">
                             <img class="tree-img" src="@/assets/images/foster-home/tree-item.png" alt="" />
                             <div class="tree-type-name-tag">{{ item.pz }}</div>
@@ -52,15 +72,21 @@
                             <div class="center-item p-t-2 age-line">
                                 <div class="age-wrap">
                                     <div class="has-age">
-                                        <div class="age">栽种时间:<span class="unit">{{item.plantDate || '--'}}</span></div>
+                                        <div class="age">
+                                            栽种时间:<span class="unit">{{ item.plantDate || "--" }}</span>
+                                        </div>
                                     </div>
                                     <div class="sort-line"></div>
                                 </div>
-                                树龄:<span class="unit">{{ (item.age && item.age+'年') || '--' }}</span>
+                                树龄:<span class="unit">{{ (item.age && item.age + "年") || "--" }}</span>
+                            </div>
+                            <div class="center-item">
+                                栽种区域:<span>{{ (item.area && item.area + "区") || "--" }}</span>
                             </div>
-                            <div class="center-item">栽种区域:<span>{{ (item.area && item.area + '区') || '--' }}</span></div>
                         </div>
                     </div>
+
+                    <div v-show="!allTrees.length" class="no-data">暂无数据</div>
                 </div>
                 <div class="pagination-wrap">
                     <el-pagination
@@ -72,7 +98,7 @@
                         :total="totalVal"
                         @size-change="handleSizeChange"
                         @current-change="getSamplePage"
-                        />
+                    />
                 </div>
             </div>
             <div class="custom-r">
@@ -83,36 +109,36 @@
                 <div class="custom-detail">
                     <div class="setting-item">
                         <span class="edit-label">树龄:</span>
-                            <el-input-number
-                                @change="settingSinglePrice"
-                                class="number-input"
-                                :controls="false"
-                                placeholder="请输入树龄"
-                                v-model="settingAge"
-                                :min="0"
-                            />
-                            <span class="unit">年</span>
+                        <el-input-number
+                            @change="settingSinglePrice"
+                            class="number-input"
+                            :controls="false"
+                            placeholder="请输入树龄"
+                            v-model="settingAge"
+                            :min="0"
+                        />
+                        <span class="unit">年</span>
                     </div>
                     <div class="setting-item">
                         <span class="edit-label">品种:</span>
-                            <el-select
-                                class="blue-select"
-                                v-model="settingPz"
-                                filterable
-                                style="width: 190px"
-                                placeholder="请选择品种"
-                            >
-                                <el-option
-                                    v-for="(species, index) in speciesList"
-                                    :key="index"
-                                    :label="species.name"
-                                    :value="species.name"
-                                />
-                            </el-select>
+                        <el-select
+                            class="blue-select"
+                            v-model="settingPz"
+                            filterable
+                            style="width: 190px"
+                            placeholder="请选择品种"
+                        >
+                            <el-option
+                                v-for="(species, index) in speciesList"
+                                :key="index"
+                                :label="species.name"
+                                :value="species.name"
+                            />
+                        </el-select>
                     </div>
                     <div class="setting-item date-picker">
                         <span class="edit-label">栽种时间:</span>
-                            <!-- <el-input-number @change="settingSinglePrice" class="number-input" :controls="false" v-model="item.total" :min="0" /> -->
+                        <!-- <el-input-number @change="settingSinglePrice" class="number-input" :controls="false" v-model="item.total" :min="0" /> -->
                         <el-date-picker
                             v-model="plantDate"
                             type="date"
@@ -122,7 +148,6 @@
                             placeholder="请选择时间"
                         />
                     </div>
-                    
                 </div>
                 <!-- 渐变主色按钮 -->
                 <div class="btn-group">
@@ -150,8 +175,12 @@ const typeVal = ref(0);
 const ageVal = ref(0);
 const ageOptions = ref([
     { label: "全部树龄", value: 0 },
-    { label: "0-10年", value: 1 },
-    { label: "10-20年", value: 2 },
+    { label: "0-10年", value: 10 },
+    { label: "10-20年", value: 20 },
+    { label: "20-30年", value: 30 },
+    { label: "30-40年", value: 40 },
+    { label: "40-50年", value: 50 },
+    { label: "50年以上", value: 60 },
 ]);
 
 const currentPage = ref(1);
@@ -166,15 +195,15 @@ function goBack() {
 }
 
 onMounted(() => {
-    getSamplePage()
-    
+    getSamplePage();
+
     VE_API.manage_interface.speciesList({ farmId: 766 }).then(({ data }) => {
         speciesList.value = data;
     });
 
     // 获取区域列表
     getBlueRegionList();
-})
+});
 
 function getBlueRegionList() {
     VE_API.manage_interface.fetchRegionList({ farmId: 766 }).then(({ data }) => {
@@ -193,10 +222,19 @@ function handleTypeChange() {
 }
 
 function getSamplePage() {
-    VE_API.manage_interface.fetchSamplePage({farmId: 766, pz: typeVal.value ? typeVal.value : null, page: currentPage.value, limit: pageSize.value}).then(({data, count}) => {
-        allTrees.value = data
-        totalVal.value = count;
-    })
+    VE_API.manage_interface
+        .fetchSamplePage({
+            farmId: 766,
+            regionId: areaVal.value === 0 ? null : areaVal.value,
+            pz: typeVal.value ? typeVal.value : null,
+            ageRange: ageVal.value === 0 ? null : [ageVal.value - 10, ageVal.value],
+            page: currentPage.value,
+            limit: pageSize.value,
+        })
+        .then(({ data, count }) => {
+            allTrees.value = data;
+            totalVal.value = count;
+        });
 }
 function handleSizeChange(newSize) {
     pageSize.value = newSize;
@@ -204,7 +242,6 @@ function handleSizeChange(newSize) {
     getSamplePage();
 }
 
-
 const editClientRef = ref(null);
 
 // 批量编辑
@@ -212,7 +249,6 @@ const settingAge = ref(null);
 const settingPz = ref(null);
 const plantDate = ref(null);
 
-
 const speciesList = ref([]);
 
 function settingSinglePrice() {
@@ -220,7 +256,7 @@ function settingSinglePrice() {
 }
 
 function settingForm() {
-    const sampleIds = allTrees.value.map(item => item.sampleId);
+    const sampleIds = allTrees.value.map((item) => item.sampleId);
     const params = {
         sampleIds,
         farmId: Number(sessionStorage.getItem("currentFarmId")),
@@ -228,7 +264,7 @@ function settingForm() {
         pz: settingPz.value,
         plantDate: plantDate.value,
     };
-    VE_API.manage_interface.batchEditFosterSample(params).then(({code}) => {
+    VE_API.manage_interface.batchEditFosterSample(params).then(({ code }) => {
         if (code === 0) {
             ElMessage.success("批量设置成功");
             getSamplePage();
@@ -263,7 +299,7 @@ function settingForm() {
         box-sizing: border-box;
         padding: 0 28px;
         border: 1px solid rgba(255, 255, 255, 0.78);
-        background: #2199F8;
+        background: #2199f8;
         border-radius: 4px;
         color: #fff;
         img {
@@ -310,7 +346,7 @@ function settingForm() {
                 align-items: center;
                 font-family: "PangMenZhengDao";
                 margin-bottom: 16px;
-                color: #2199F8;
+                color: #2199f8;
                 img {
                     margin-right: 8px;
                 }
@@ -322,13 +358,19 @@ function settingForm() {
                 padding-top: 8px;
                 max-height: calc(100% - 32px - 32px - 52px);
                 overflow: auto;
+                .no-data {
+                    padding-top: 20px;
+                    width: 100%;
+                    text-align: center;
+                    font-size: 16px;
+                    color: rgba(0, 0, 0, 0.6);
+                }
             }
             .pagination-wrap {
                 position: absolute;
                 bottom: 12px;
                 left: 50%;
                 transform: translateX(-50%);
-
             }
         }
         .list-item {
@@ -345,10 +387,10 @@ function settingForm() {
             cursor: pointer;
             width: calc(25% - 8px);
             box-sizing: border-box;
-            color: #FFFFFF;
+            color: #ffffff;
             &.selected {
                 background: rgba(33, 153, 248, 0.1);
-                border-color: #2199F8;
+                border-color: #2199f8;
             }
             &.disabled {
                 opacity: 0.5;
@@ -406,7 +448,7 @@ function settingForm() {
                         }
                     }
                 }
-                
+
                 .age-line {
                     display: flex;
                     align-items: center;
@@ -418,7 +460,7 @@ function settingForm() {
                             margin: 0 10px;
                             height: 10px;
                             width: 1px;
-                            background: #6C6C6C;
+                            background: #6c6c6c;
                         }
                     }
                 }
@@ -429,13 +471,13 @@ function settingForm() {
                         font-size: 12px;
                         color: #999999;
                         .over {
-                            color: #FFD489;
+                            color: #ffd489;
                         }
                     }
                 }
             }
         }
-        
+
         .right-tree-list + .right-tree-list {
             margin-top: 12px;
         }
@@ -451,12 +493,12 @@ function settingForm() {
             border-radius: 8px;
             .second-title {
                 border-radius: 8px 8px 0 0;
-                color: #2199F8;
+                color: #2199f8;
                 font-size: 22px;
                 padding: 14px 12px;
                 font-family: "PangMenZhengDao";
             }
-            
+
             .user-name {
                 font-size: 16px;
                 color: rgba(0, 0, 0, 0.9);
@@ -470,7 +512,6 @@ function settingForm() {
                 overflow: auto;
                 position: relative;
 
-                
                 .number-input {
                     // margin: 0 12px;
                     ::v-deep {
@@ -514,7 +555,7 @@ function settingForm() {
                         }
                     }
                 }
-                
+
                 .date-picker {
                     ::v-deep {
                         .el-date-editor {
@@ -548,7 +589,7 @@ function settingForm() {
                 padding-top: 12px;
             }
             .main-unit {
-                color: #F3C11D;
+                color: #f3c11d;
             }
             .box-line {
                 width: 100%;
@@ -572,19 +613,18 @@ function settingForm() {
             }
             .selected-tips {
                 background: rgba(33, 153, 248, 0.1);
-                border: 1px solid #2199F8;
+                border: 1px solid #2199f8;
                 width: 100%;
                 text-align: center;
                 border-radius: 8px;
                 height: 50px;
                 line-height: 50px;
-                color: #2199F8;
+                color: #2199f8;
                 box-sizing: border-box;
             }
 
             .bottom-btn {
                 height: 60px;
-                
             }
             .btn-group {
                 display: flex;
@@ -601,13 +641,13 @@ function settingForm() {
                     padding: 8px 44px;
                     font-size: 16px;
                     border-radius: 4px;
-                    border: 1px solid #2199F8;
+                    border: 1px solid #2199f8;
                 }
                 .cancel-btn {
-                    color: #2199F8;
+                    color: #2199f8;
                 }
                 .edit-btn {
-                    background: #2199F8;
+                    background: #2199f8;
                     color: #fff;
                 }
                 .btn + .btn {

+ 24 - 2
src/views/user/index.vue

@@ -5,7 +5,7 @@
                 <el-icon size="24" class="user-icon" color="#000000"><UserFilled /></el-icon>
                 <span class="user-name">用户管理</span>
                 <span class="title-line"></span>
-                <span class="title-info">共 258 个用户,更新日期于 2025.06.26</span>
+                <span class="title-info">共 {{ totalVal }} 个用户,更新日期于 {{ formattedStartDate }}</span>
             </div>
             <div class="title-r">
                 <el-input
@@ -84,7 +84,12 @@
                         }}</span>
                     </template>
                 </el-table-column>
-                <el-table-column property="fosterCode" label="守护树编号" />
+                <el-table-column property="fosterCode" label="守护树编号">
+                    <template #default="scope">
+                        <span v-if="scope.row.fosterCode">{{ scope.row.fosterCode }}</span>
+                        <span v-else @click="toHomeBatch" class="wait-text">待分配</span>
+                    </template>
+                </el-table-column>
                 <el-table-column label="状态">
                     <template #default="scope">
                         <span :class="['status-text']">{{ scope.row.fosterStatus }}</span>
@@ -144,6 +149,9 @@ import { useStore } from "vuex";
 import { ElMessage, ElMessageBox } from "element-plus";
 import addGroup from "@/components/addGroup.vue";
 let store = useStore();
+import { useRouter } from "vue-router";
+import { dateFormat } from "@/utils/date_util";
+const router = useRouter();
 
 const searchVal = ref(null);
 
@@ -186,6 +194,10 @@ const levelOptions = ref([]);
 const currentPage = ref(1);
 const pageSize = ref(20); // 每页显示20条数据
 const totalVal = ref(0);
+const startDate = new Date();
+
+// 格式化日期
+const formattedStartDate = dateFormat(startDate, "YY.mm.dd");
 
 onMounted(() => {
     getTableData();
@@ -297,6 +309,11 @@ function openGroupPopup() {
 function batchGroup() {
     addGroupRef.value.openClientPopup("edit", selectedRows.value.map(item => item.tel));
 }
+
+// 去待分配
+function toHomeBatch() {
+    router.push("/layout/home?acitveName=待分配")
+}
 </script>
 
 <style lang="scss" scoped>
@@ -400,6 +417,11 @@ function batchGroup() {
         .status-2 {
             color: #2199f8;
         }
+        .wait-text {
+            cursor: pointer;
+            color: #2199f8;
+            text-decoration: underline;
+        }
     }
     .pagination-wrap {
         padding: 16px 0;