同步
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="AddBuildingBox">
|
||||
<PageHeader :title="userid ? '编辑车辆信息' : '添加车辆信息'"></PageHeader>
|
||||
<PageHeader></PageHeader>
|
||||
<div class="AddBuildingBody">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="addBuildingFormBody">
|
||||
@@ -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;
|
||||
@@ -107,19 +108,15 @@ function init() {
|
||||
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);
|
||||
}
|
||||
}
|
||||
});
|
||||
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' + '';
|
||||
handleChange(res.data.parentId);
|
||||
});
|
||||
}
|
||||
}
|
||||
init();
|
||||
// !== 提交 =============================================================================
|
||||
|
||||
Reference in New Issue
Block a user