|
@@ -2,7 +2,22 @@
|
|
|
<div id="detail">
|
|
|
<el-row>
|
|
|
<el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
|
|
|
- <el-col :span="24" class="one">系统首页</el-col>
|
|
|
+ <el-col :span="24" class="one">
|
|
|
+ <cSearch :is_title="false" :is_back="true" @toBack="toBack"></cSearch>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="two">
|
|
|
+ <cForm :span="24" :fields="fields" :form="form" :rules="rules" :isSave="false" :disabled="true" label-width="auo">
|
|
|
+ <template #techol_stage>
|
|
|
+ <el-option v-for="i in stageList" :key="i.value" :label="i.label" :value="i.value"></el-option>
|
|
|
+ </template>
|
|
|
+ <template #techol_level>
|
|
|
+ <el-option v-for="i in levelList" :key="i.value" :label="i.label" :value="i.value"></el-option>
|
|
|
+ </template>
|
|
|
+ <template #field>
|
|
|
+ <el-option v-for="i in fieldList" :key="i.value" :label="i.label" :value="i.value"></el-option>
|
|
|
+ </template>
|
|
|
+ </cForm>
|
|
|
+ </el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -11,28 +26,104 @@
|
|
|
<script setup lang="ts">
|
|
|
// 基础
|
|
|
import type { Ref } from 'vue';
|
|
|
-// reactive,
|
|
|
-import { onMounted, ref, getCurrentInstance } from 'vue';
|
|
|
+import { ref, reactive, onMounted } from 'vue';
|
|
|
+import { useRoute } from 'vue-router';
|
|
|
+import type { FormRules } from 'element-plus';
|
|
|
// 接口
|
|
|
-//import { TestStore } from '@common/src/stores/test';
|
|
|
-//import type { IQueryResult } from '@/util/types.util';
|
|
|
-//const testAxios = TestStore();
|
|
|
-const { proxy } = getCurrentInstance() as any;
|
|
|
+import { ProjectInfoStore } from '@common/src/stores/project/projectInfo';
|
|
|
+import { DictDataStore } from '@common/src/stores/system/dictData'; // 字典表
|
|
|
+import type { IQueryResult } from '@/util/types.util';
|
|
|
+const infoAxios = ProjectInfoStore();
|
|
|
+const dictAxios = DictDataStore();
|
|
|
+
|
|
|
+// 路由
|
|
|
+const route = useRoute();
|
|
|
+
|
|
|
// 加载中
|
|
|
const loading: Ref<any> = ref(false);
|
|
|
-// 分页数据
|
|
|
-// const skip = 0;
|
|
|
-// const limit = proxy.limit;;
|
|
|
+
|
|
|
+// 表单
|
|
|
+let form: Ref<any> = ref({});
|
|
|
+let fields: Ref<any[]> = ref([
|
|
|
+ { label: '年度', model: 'year', options: { disabled: true } },
|
|
|
+ { label: '项目名称', model: 'name' },
|
|
|
+ { label: '项目负责人', model: 'pro_contact' },
|
|
|
+ { label: '项目负责人手机号', model: 'pro_phone' },
|
|
|
+ { label: '技术阶段', model: 'techol_stage', type: 'select' },
|
|
|
+ { label: '技术水平', model: 'techol_level', type: 'select' },
|
|
|
+ { label: '领域分类', model: 'field', type: 'select' },
|
|
|
+ { label: '市场预估(亿元/年)', model: 'scale' },
|
|
|
+ { label: '建议单位名称', model: 'proposal_company' },
|
|
|
+ { label: '建议单位联系人', model: 'proposal_contact' },
|
|
|
+ { label: '建议单位手机号', model: 'proposal_phone' },
|
|
|
+ { label: '合作单位名称', model: 'coopera_company' },
|
|
|
+ { label: '合作单位联系人', model: 'coopera_contact' },
|
|
|
+ { label: '合作单位手机号', model: 'coopera_phone' },
|
|
|
+ { label: '立项背景', model: 'sign', type: 'textarea', options: { maxlength: '500', 'show-word-limit': true, autosize: { minRows: 5, maxRows: 5 } } },
|
|
|
+ { label: '前期基础', model: 'work_basics', type: 'textarea', options: { maxlength: '500', 'show-word-limit': true, autosize: { minRows: 5, maxRows: 5 } } },
|
|
|
+ { label: '研究内容', model: 'content', type: 'textarea', options: { maxlength: '500', 'show-word-limit': true, autosize: { minRows: 5, maxRows: 5 } } },
|
|
|
+ { label: '技术路线', model: 'route', type: 'textarea', options: { maxlength: '500', 'show-word-limit': true, autosize: { minRows: 5, maxRows: 5 } } },
|
|
|
+ { label: '核心指标', model: 'quota', type: 'textarea', options: { maxlength: '500', 'show-word-limit': true, autosize: { minRows: 5, maxRows: 5 } } },
|
|
|
+ { label: '经济效益', model: 'influence', type: 'textarea', options: { maxlength: '500', 'show-word-limit': true, autosize: { minRows: 5, maxRows: 5 } } }
|
|
|
+]);
|
|
|
+const rules = reactive<FormRules>({
|
|
|
+ name: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
|
|
|
+ pro_contact: [{ required: true, message: '请输入项目负责人', trigger: 'blur' }],
|
|
|
+ pro_phone: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
|
|
|
+ techol_stage: [{ required: true, message: '请选择技术阶段', trigger: 'change' }],
|
|
|
+ techol_level: [{ required: true, message: '请选择技术水平', trigger: 'change' }],
|
|
|
+ field: [{ required: true, message: '请选择领域分类', trigger: 'change' }],
|
|
|
+ scale: [{ required: true, message: '请输入市场预估', trigger: 'blur' }],
|
|
|
+ proposal_company: [{ required: true, message: '请输入建议单位名称', trigger: 'blur' }],
|
|
|
+ proposal_contact: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
|
|
|
+ proposal_phone: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
|
|
|
+ coopera_company: [{ required: true, message: '请输入合作单位名称', trigger: 'blur' }],
|
|
|
+ coopera_contact: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
|
|
|
+ coopera_phone: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
|
|
|
+ sign: [{ required: true, message: '请输入立项背景(含解决“卡脖子”技术问题及在行业中所处的地位和作用)', trigger: 'blur' }],
|
|
|
+ work_basics: [{ required: true, message: '请输入前期基础(含知识产权状况)', trigger: 'blur' }],
|
|
|
+ content: [{ required: true, message: '请输入研究内容(含项目创新点)', trigger: 'blur' }],
|
|
|
+ route: [{ required: true, message: '请输入技术路线(含拟解决关键技术)', trigger: 'blur' }],
|
|
|
+ quota: [{ required: true, message: '请输入核心指标(要求可量化、可考核、可检测)', trigger: 'blur' }],
|
|
|
+ influence: [{ required: true, message: '请输入经济效益(含市场分析和产业化预期)', trigger: 'blur' }]
|
|
|
+});
|
|
|
+
|
|
|
+// 字典表
|
|
|
+const levelList: Ref<any> = ref([]);
|
|
|
+const stageList: Ref<any> = ref([]);
|
|
|
+const fieldList: Ref<any> = ref([]);
|
|
|
+
|
|
|
// 请求
|
|
|
onMounted(async () => {
|
|
|
loading.value = true;
|
|
|
- // await search({ skip, limit });
|
|
|
+ await searchOther();
|
|
|
+ await search();
|
|
|
loading.value = false;
|
|
|
});
|
|
|
-//const search = async (e: { skip: number; limit: number }) => {
|
|
|
-// const info = { skip: e.skip, limit: e.limit, ...searchInfo.value };
|
|
|
-// const res: IQueryResult = await testAxios.query(info);
|
|
|
-// console.log(res);
|
|
|
-//};
|
|
|
+const search = async () => {
|
|
|
+ if (route.query.id) {
|
|
|
+ let res: IQueryResult = await infoAxios.fetch(route.query.id);
|
|
|
+ if (res.errcode == 0) form.value = res.data as {};
|
|
|
+ } else form.value = { is_use: '0' };
|
|
|
+};
|
|
|
+
|
|
|
+// 查询其他信息
|
|
|
+const searchOther = async () => {
|
|
|
+ let res: IQueryResult;
|
|
|
+ //水平
|
|
|
+ res = await dictAxios.query({ type: 'project_collect_level' });
|
|
|
+ if (res.errcode == 0) levelList.value = res.data;
|
|
|
+ //阶段
|
|
|
+ res = await dictAxios.query({ type: 'project_collect_stage' });
|
|
|
+ if (res.errcode == 0) stageList.value = res.data;
|
|
|
+ //领域
|
|
|
+ res = await dictAxios.query({ type: 'project_collect_field' });
|
|
|
+ if (res.errcode == 0) fieldList.value = res.data;
|
|
|
+};
|
|
|
+
|
|
|
+// 返回上一页
|
|
|
+const toBack = () => {
|
|
|
+ window.history.go(-1);
|
|
|
+};
|
|
|
</script>
|
|
|
<style scoped lang="scss"></style>
|