From 2c86a8bd60deed0dd0e044bad6fb83f75d19a332 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期日, 26 十月 2025 15:05:50 +0800
Subject: [PATCH] Merge branch 'feature-task'

---
 ruoyi-ui/src/views/system/dept/index.vue |   69 +++++++++++++++++++++++++++++++++-
 1 files changed, 66 insertions(+), 3 deletions(-)

diff --git a/ruoyi-ui/src/views/system/dept/index.vue b/ruoyi-ui/src/views/system/dept/index.vue
index e502b4e..2d72209 100644
--- a/ruoyi-ui/src/views/system/dept/index.vue
+++ b/ruoyi-ui/src/views/system/dept/index.vue
@@ -53,11 +53,30 @@
       v-loading="loading"
       :data="deptList"
       row-key="deptId"
-      :default-expand-all="isExpandAll"
+      :default-expand-all="false"
+      :expand-row-keys="expandRowKeys"
       :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
     >
       <el-table-column prop="deptName" label="閮ㄩ棬鍚嶇О" width="260"></el-table-column>
-      <el-table-column prop="orderNum" label="鎺掑簭" width="200"></el-table-column>
+      <el-table-column prop="departmentId" label="SQL Server閮ㄩ棬ID" width="150" align="center">
+        <template slot-scope="scope">
+          <span v-if="scope.row.departmentId">{{ scope.row.departmentId }}</span>
+          <span v-else style="color: #909399;">-</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="serviceOrderClass" label="鏈嶅姟鍗曠紪鐮�" width="120" align="center">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.serviceOrderClass" type="success" size="mini">{{ scope.row.serviceOrderClass }}</el-tag>
+          <span v-else style="color: #909399;">-</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="dispatchOrderClass" label="璋冨害鍗曠紪鐮�" width="120" align="center">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.dispatchOrderClass" type="warning" size="mini">{{ scope.row.dispatchOrderClass }}</el-tag>
+          <span v-else style="color: #909399;">-</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="orderNum" label="鎺掑簭" width="150"></el-table-column>
       <el-table-column prop="status" label="鐘舵��" width="100">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
@@ -115,6 +134,25 @@
           <el-col :span="12">
             <el-form-item label="鏄剧ず鎺掑簭" prop="orderNum">
               <el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="SQL Server閮ㄩ棬ID" prop="departmentId">
+              <el-input v-model="form.departmentId" placeholder="SQL Server涓殑閮ㄩ棬ID" :disabled="true" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="鏈嶅姟鍗曠紪鐮�" prop="serviceOrderClass">
+              <el-input v-model="form.serviceOrderClass" placeholder="璇疯緭鍏ユ湇鍔″崟缂栫爜" maxlength="20" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="璋冨害鍗曠紪鐮�" prop="dispatchOrderClass">
+              <el-input v-model="form.dispatchOrderClass" placeholder="璇疯緭鍏ヨ皟搴﹀崟缂栫爜" maxlength="20" />
             </el-form-item>
           </el-col>
         </el-row>
@@ -181,7 +219,9 @@
       // 鏄惁鏄剧ず寮瑰嚭灞�
       open: false,
       // 鏄惁灞曞紑锛岄粯璁ゅ叏閮ㄥ睍寮�
-      isExpandAll: true,
+      isExpandAll: false,
+      // 榛樿灞曞紑鐨勮
+      expandRowKeys: [],
       // 閲嶆柊娓叉煋琛ㄦ牸鐘舵��
       refreshTable: true,
       // 鏌ヨ鍙傛暟
@@ -228,6 +268,8 @@
       this.loading = true;
       listDept(this.queryParams).then(response => {
         this.deptList = this.handleTree(response.data, "deptId");
+        // 榛樿鍙睍寮�绗竴灞傦紙鎬诲叕鍙稿強鍏剁洿鎺ュ瓙閮ㄩ棬锛�
+        this.expandRowKeys = this.deptList.map(item => item.deptId);
         this.loading = false;
       });
     },
@@ -253,6 +295,9 @@
         deptId: undefined,
         parentId: undefined,
         deptName: undefined,
+        departmentId: undefined,
+        serviceOrderClass: undefined,
+        dispatchOrderClass: undefined,
         orderNum: undefined,
         leader: undefined,
         phone: undefined,
@@ -286,10 +331,28 @@
     toggleExpandAll() {
       this.refreshTable = false;
       this.isExpandAll = !this.isExpandAll;
+      if (this.isExpandAll) {
+        // 灞曞紑鍏ㄩ儴锛氭敹闆嗘墍鏈夐儴闂↖D
+        this.expandRowKeys = this.getAllDeptIds(this.deptList);
+      } else {
+        // 鏀惰捣锛氬彧灞曞紑绗竴灞�
+        this.expandRowKeys = this.deptList.map(item => item.deptId);
+      }
       this.$nextTick(() => {
         this.refreshTable = true;
       });
     },
+    /** 鑾峰彇鎵�鏈夐儴闂↖D锛堥�掑綊锛� */
+    getAllDeptIds(depts) {
+      let ids = [];
+      depts.forEach(dept => {
+        ids.push(dept.deptId);
+        if (dept.children && dept.children.length > 0) {
+          ids = ids.concat(this.getAllDeptIds(dept.children));
+        }
+      });
+      return ids;
+    },
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate(row) {
       this.reset();

--
Gitblit v1.9.1