From 13a31edf7f569cdcf15d3c43a476a2c947f47fbf Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期日, 09 十一月 2025 22:33:24 +0800
Subject: [PATCH] feat: 增加hospdata表,同步sqlserver过来

---
 ruoyi-ui/src/views/system/vehicle/index.vue |   35 ++++++++++++++++++++++++++++++-----
 1 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/ruoyi-ui/src/views/system/vehicle/index.vue b/ruoyi-ui/src/views/system/vehicle/index.vue
index 30bfde2..e1fdf89 100644
--- a/ruoyi-ui/src/views/system/vehicle/index.vue
+++ b/ruoyi-ui/src/views/system/vehicle/index.vue
@@ -118,12 +118,19 @@
           <dict-tag :options="dict.type.sys_platform" :value="scope.row.platformCode"/>
         </template>
       </el-table-column>
+      <el-table-column label="褰掑睘鍒嗗叕鍙�" align="center" prop="deptNames" width="200">
+        <template slot-scope="scope">
+          <span v-if="scope.row.deptNames && scope.row.deptNames.length > 0">
+            {{ scope.row.deptNames.join('銆�') }}
+          </span>
+          <span v-else>-</span>
+        </template>
+      </el-table-column>
       <el-table-column label="鐘舵��" align="center" prop="status">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
         </template>
       </el-table-column>
-      <el-table-column label="褰掑睘閮ㄩ棬" align="center" prop="deptName" />
       <el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.createTime) }}</span>
@@ -198,8 +205,8 @@
             >{{dict.label}}</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="褰掑睘閮ㄩ棬" prop="deptId">
-          <el-select v-model="form.deptId" placeholder="璇烽�夋嫨褰掑睘閮ㄩ棬" clearable style="width: 100%">
+        <el-form-item label="褰掑睘鍒嗗叕鍙�" prop="deptIds">
+          <el-select v-model="form.deptIds" placeholder="璇烽�夋嫨褰掑睘鍒嗗叕鍙�" multiple clearable style="width: 100%">
             <el-option
               v-for="dept in deptList"
               :key="dept.deptId"
@@ -271,7 +278,8 @@
         status: "0",
         remark: null,
         platformCode: null,
-        deptId: null
+        deptId: null,
+        deptIds: []  // 澶氫釜鍒嗗叕鍙窱D鏁扮粍
       },
       // 琛ㄥ崟鏍¢獙
       rules: {
@@ -283,6 +291,9 @@
         ],
         platformCode: [
           { required: true, message: "骞冲彴鏍囪瘑涓嶈兘涓虹┖", trigger: "change" }
+        ],
+        deptIds: [
+          { required: true, message: "褰掑睘鍒嗗叕鍙镐笉鑳戒负绌�", trigger: "change", type: 'array' }
         ]
       }
     };
@@ -328,7 +339,8 @@
         status: "0",
         remark: null,
         platformCode: null,
-        deptId: null
+        deptId: null,
+        deptIds: []  // 閲嶇疆涓虹┖鏁扮粍
       };
       this.resetForm("form");
     },
@@ -360,6 +372,14 @@
       const vehicleId = row.vehicleId || this.ids
       getVehicle(vehicleId).then(response => {
         this.form = response.data;
+        // 濡傛灉娌℃湁deptIds锛屽垯浠� deptId 鍜� deptName 涓濉�
+        if (!this.form.deptIds || this.form.deptIds.length === 0) {
+          if (this.form.deptId) {
+            this.form.deptIds = [this.form.deptId];
+          } else {
+            this.form.deptIds = [];
+          }
+        }
         this.open = true;
         this.title = "淇敼杞﹁締淇℃伅";
       });
@@ -368,6 +388,11 @@
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
+          // 濡傛灉閫夋嫨浜嗗涓垎鍏徃锛屽皢绗竴涓缃负deptId锛堜富鍒嗗叕鍙革級
+          if (this.form.deptIds && this.form.deptIds.length > 0) {
+            this.form.deptId = this.form.deptIds[0];
+          }
+          
           if (this.form.vehicleId != null) {
             updateVehicle(this.form).then(response => {
               this.$modal.msgSuccess("淇敼鎴愬姛");

--
Gitblit v1.9.1