|
@@ -1,6 +1,6 @@
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { ref, watch } from 'vue';
|
|
import { ref, watch } from 'vue';
|
|
|
-import { message } from 'ant-design-vue';
|
|
|
|
|
|
|
+import { notification } from 'ant-design-vue';
|
|
|
import { PlusOutlined } from '@ant-design/icons-vue'; // 确保导入
|
|
import { PlusOutlined } from '@ant-design/icons-vue'; // 确保导入
|
|
|
import VxeUI from 'vxe-table';
|
|
import VxeUI from 'vxe-table';
|
|
|
import { useRequest } from 'alova/client';
|
|
import { useRequest } from 'alova/client';
|
|
@@ -45,7 +45,6 @@ const { loading: branchLoading } = useRequest(branchMethod).onSuccess(({ data })
|
|
|
: [];
|
|
: [];
|
|
|
};
|
|
};
|
|
|
branch.value = to(data);
|
|
branch.value = to(data);
|
|
|
- console.log(branch.value, '获取所有的机构');
|
|
|
|
|
});
|
|
});
|
|
|
const form = reactive<SystemModel>({
|
|
const form = reactive<SystemModel>({
|
|
|
institutionName: '',
|
|
institutionName: '',
|
|
@@ -181,17 +180,16 @@ function cancel() {
|
|
|
VxeUI.modal.close(`add-items-modal`);
|
|
VxeUI.modal.close(`add-items-modal`);
|
|
|
}
|
|
}
|
|
|
function doSubmit() {
|
|
function doSubmit() {
|
|
|
- console.log(formRef.value, 'formRef==>');
|
|
|
|
|
- console.log(form, 'Form Data Before Submit');
|
|
|
|
|
formRef.value
|
|
formRef.value
|
|
|
?.validate()
|
|
?.validate()
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
form.photo = fileList.value[0]?.response?.url || fileList.value[0]?.url || '';
|
|
form.photo = fileList.value[0]?.response?.url || fileList.value[0]?.url || '';
|
|
|
submit(form);
|
|
submit(form);
|
|
|
})
|
|
})
|
|
|
- .catch((error) => {
|
|
|
|
|
- console.error('Validation Error:', error);
|
|
|
|
|
- message.error('请完善必填项');
|
|
|
|
|
|
|
+ .catch((error: any) => {
|
|
|
|
|
+ notification.error({
|
|
|
|
|
+ message: error.message,
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
// 获取方案类型
|
|
// 获取方案类型
|
|
@@ -202,15 +200,16 @@ async function getConditioningProgramType() {
|
|
|
if (res?.length > 0) {
|
|
if (res?.length > 0) {
|
|
|
typeOptions.value = res; // 直接使用返回的数据
|
|
typeOptions.value = res; // 直接使用返回的数据
|
|
|
}
|
|
}
|
|
|
- } catch (error) {
|
|
|
|
|
- console.error('获取方案类型列表失败:', error);
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
|
|
+ notification.error({
|
|
|
|
|
+ message: error.message,
|
|
|
|
|
+ });
|
|
|
} finally {
|
|
} finally {
|
|
|
typeOptionsLoading.value = false;
|
|
typeOptionsLoading.value = false;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
- console.log(props.data, '获取传来的数据');
|
|
|
|
|
const deptId = localStorage.getItem('deptId');
|
|
const deptId = localStorage.getItem('deptId');
|
|
|
if (props.data.addType === 'system' && deptId) {
|
|
if (props.data.addType === 'system' && deptId) {
|
|
|
form.institutionId = deptId;
|
|
form.institutionId = deptId;
|
|
@@ -239,10 +238,9 @@ onMounted(async () => {
|
|
|
},
|
|
},
|
|
|
]
|
|
]
|
|
|
: [];
|
|
: [];
|
|
|
- console.log(props.data, 'form==>');
|
|
|
|
|
if (props.data.addType === 'itemsList' && props.data.sourceId) {
|
|
if (props.data.addType === 'itemsList' && props.data.sourceId) {
|
|
|
form.sourceId = form.id;
|
|
form.sourceId = form.id;
|
|
|
- form.institutionId='';
|
|
|
|
|
|
|
+ form.institutionId = '';
|
|
|
delete form.id;
|
|
delete form.id;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -250,7 +248,6 @@ onMounted(async () => {
|
|
|
// getSupplier({});
|
|
// getSupplier({});
|
|
|
// 获取方案类型
|
|
// 获取方案类型
|
|
|
getConditioningProgramType();
|
|
getConditioningProgramType();
|
|
|
- console.log(form, 'form==>');
|
|
|
|
|
});
|
|
});
|
|
|
const emits = defineEmits<{
|
|
const emits = defineEmits<{
|
|
|
submit: [data?: SystemItemModel];
|
|
submit: [data?: SystemItemModel];
|