wlzboy
2025-11-16 f67945d53b20f6a45ae50b27d74c966eb1355bb4
ruoyi-ui/src/views/system/vehicle/index.vue
@@ -14,7 +14,7 @@
        <el-select v-model="queryParams.vehicleType" placeholder="请选择车辆类型" clearable size="small">
          <el-option
            v-for="dict in dict.type.sys_vehicle_type"
            :key="dict.value"
            :key="'vtype-' + dict.value"
            :label="dict.label"
            :value="dict.value"
          />
@@ -24,7 +24,7 @@
        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
          <el-option
            v-for="dict in dict.type.sys_normal_disable"
            :key="dict.value"
            :key="'status-' + dict.value"
            :label="dict.label"
            :value="dict.value"
          />
@@ -34,7 +34,7 @@
        <el-select v-model="queryParams.platformCode" placeholder="请选择平台" clearable size="small">
          <el-option
            v-for="dict in dict.type.sys_platform"
            :key="dict.value"
            :key="'platform-' + dict.value"
            :label="dict.label"
            :value="dict.value"
          />
@@ -174,7 +174,7 @@
          <el-select v-model="form.vehicleType" placeholder="请选择车辆类型" clearable style="width: 100%">
            <el-option
              v-for="dict in dict.type.sys_vehicle_type"
              :key="dict.value"
              :key="'form-vtype-' + dict.value"
              :label="dict.label"
              :value="dict.value"
            />
@@ -190,7 +190,7 @@
          <el-select v-model="form.platformCode" placeholder="请选择平台" clearable>
            <el-option
              v-for="dict in dict.type.sys_platform"
              :key="dict.value"
              :key="'form-platform-' + dict.value"
              :label="dict.label"
              :value="dict.value"
            />
@@ -200,7 +200,7 @@
          <el-radio-group v-model="form.status">
            <el-radio
              v-for="dict in dict.type.sys_normal_disable"
              :key="dict.value"
              :key="'form-status-' + dict.value"
              :label="dict.value"
            >{{dict.label}}</el-radio>
          </el-radio-group>
@@ -315,9 +315,12 @@
    /** 获取部门列表(只显示分公司:parent_id=100) */
    getDeptList() {
      listDept({ parentId: 100 }).then(response => {
        // 过滤出分公司(parent_id=100的部门)
        if (response.data) {
          this.deptList = response.data.filter(dept => dept.parentId === 100);
          this.deptList = response.data.filter(dept => dept.parentId === "100");
          // console.log("deptList: ",this.deptList,response.data.filter(dept => dept.parentId === "100"));
        } else {
          this.deptList = [];
        }
@@ -372,13 +375,13 @@
      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 = [];
          }
        // 确保deptIds是一个数组
        if (!this.form.deptIds) {
          this.form.deptIds = [];
        }
        // 如果deptIds为空数组,但deptId有值,则添加deptId到deptIds中
        if (this.form.deptIds.length === 0 && this.form.deptId) {
          this.form.deptIds = [this.form.deptId];
        }
        this.open = true;
        this.title = "修改车辆信息";