同步6/16

This commit is contained in:
Zy
2026-06-01 18:12:58 +08:00
parent 38274ab612
commit 50e7b14fd6
183 changed files with 8956 additions and 4803 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div class="AddBuildingBox">
<PageHeader :title="userid ? '编辑车辆信息' : '添加车辆信息'"></PageHeader>
<PageHeader></PageHeader>
<div class="AddBuildingBody">
<div class="title">基本信息</div>
<div class="addBuildingFormBody">
@@ -41,7 +41,7 @@
<el-col :span="11">
<el-form-item label="隶属父级" prop="email">
<el-select @change="handleChange" v-model="form.parentId" placeholder="请选择隶属父级" style="width: 240px">
<el-option v-for="item in options" :key="item.id" :label="item.projectName" :value="item.id" />
<el-option v-for="item in options" :key="item.id" :disabled="item.disabled" :label="item.projectName" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
@@ -59,7 +59,7 @@
<script setup lang="ts">
import { ref } from 'vue';
import PageHeader from '@/components/Pageheader/index.vue';
import { addRepairProject, listRepairProject, updateRepairProject } from '@/api/system/RepairProject';
import { addRepairProject, getRepairProject, listRepairProject, updateRepairProject } from '@/api/system/RepairProject';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { com_repair_project_types } = toRefs<any>(proxy?.useDict('com_repair_project_types'));
const { com_repair_project_status } = toRefs<any>(proxy?.useDict('com_repair_project_status'));
@@ -88,6 +88,7 @@ const userid = ref(null);
const options = ref([]);
function handleChange(val) {
if (!val) return;
const find = options.value.find((item) => item.id === val);
if (find) {
form.value.projectType = find.projectType;
@@ -95,7 +96,7 @@ function handleChange(val) {
}
// != ==========================================
function init() {
async function init() {
form.value = {
id: null,
projectName: null, // 项目名称
@@ -104,22 +105,26 @@ function init() {
projectLevel: 0, //项目层级
status: '0' //状态
};
listRepairProject().then((res) => {
const arr = res.rows.filter((ite) => ite.projectLevel === 0);
options.value = arr;
if (route.query.id) {
userid.value = route.query.id;
const find = res.rows.find((item) => item.id === userid.value);
if (find) {
form.value = {
...form.value,
...find,
projectLevel: find.projectLevel
};
handleChange(find.parentId);
}
}
});
const res = await listRepairProject();
const arr = res.rows.filter((ite) => ite.projectLevel === 0);
options.value = arr;
if (route.query.id) {
userid.value = route.query.id;
getRepairProject(userid.value).then((res) => {
form.value = res.data;
form.value.status = res.data.status ?? '0' + '';
options.value = options.value.map((ite) => {
if (ite.id === res.data.id) {
ite.disabled = true;
} else {
ite.disabled = false;
}
return ite;
});
handleChange(res.data.parentId);
});
}
}
init();
// !== 提交 =============================================================================