|
@@ -0,0 +1,54 @@
|
|
|
+<template>
|
|
|
+ <!-- 五年计划 -->
|
|
|
+ <Form
|
|
|
+ :formModel="formModel"
|
|
|
+ :formOptions="formOptions"
|
|
|
+ :load="loadData"
|
|
|
+ />
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import { ref, type Ref } from 'vue';
|
|
|
+import { useRoute } from 'vue-router';
|
|
|
+import Form from './form.vue';
|
|
|
+import InheritorContent, { PlanInfo } from '@/api/inheritor/InheritorContent';
|
|
|
+import type { IDynamicFormOptions } from '@imengyu/vue-dynamic-form';
|
|
|
+
|
|
|
+const formModel = ref(new PlanInfo()) as Ref<PlanInfo>;
|
|
|
+const formOptions = ref<IDynamicFormOptions>({
|
|
|
+ formLabelCol: { span: 6 },
|
|
|
+ formWrapperCol: { span: 24 },
|
|
|
+ formAdditionaProps: {
|
|
|
+ layout: 'vertical',
|
|
|
+ scrollToFirstError: true,
|
|
|
+ },
|
|
|
+ formNestNameGenerateType: 'array',
|
|
|
+ formItems: [
|
|
|
+ { label: '预算项目名称', name: 'name', type: 'text', additionalProps: { placeholder: '请输入预算项目名称' } },
|
|
|
+ { label: '经费投入(万元)', name: 'investment', type: 'number', additionalProps: { placeholder: '请输入经费投入(万元)', min: 0, precision: 2 } },
|
|
|
+ { label: '依据说明', name: 'desc', type: 'text-area', additionalProps: { placeholder: '请输入依据说明' } },
|
|
|
+ { label: '预期目标', name: 'target', type: 'text-area', additionalProps: { placeholder: '请输入预期目标' } },
|
|
|
+ { label: '保护单位自筹资金', name: 'unit', type: 'number', additionalProps: { placeholder: '请输入保护单位自筹资金', min: 0, precision: 2 } },
|
|
|
+ { label: '地方(部门)投入资金', name: 'department', type: 'number', additionalProps: { placeholder: '请输入地方(部门)投入资金', min: 0, precision: 2 } }
|
|
|
+ ],
|
|
|
+ formRules: {
|
|
|
+ name: [{ required: true, message: '请输入预算项目名称' }],
|
|
|
+ investment: [{ required: true, message: '请输入经费投入(万元)' }, { type: 'number', min: 0, message: '经费投入不能为负数' }],
|
|
|
+ desc: [{ required: true, message: '请输入依据说明' }],
|
|
|
+ target: [{ required: true, message: '请输入预期目标' }],
|
|
|
+ unit: [{ required: true, message: '请输入保护单位自筹资金' }, { type: 'number', min: 0, message: '保护单位自筹资金不能为负数' }],
|
|
|
+ department: [{ required: true, message: '请输入地方(部门)投入资金' }, { type: 'number', min: 0, message: '地方(部门)投入资金不能为负数' }]
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+const route = useRoute();
|
|
|
+
|
|
|
+async function loadData() {
|
|
|
+ const id = parseFloat(route.query.id as string);
|
|
|
+ if (id) {
|
|
|
+ const ichId = (await InheritorContent.getIchInfo()).id;
|
|
|
+ formModel.value = (await InheritorContent.getPlanList(ichId)).find((item) => item.id === id) || new PlanInfo();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|