diff --git a/src/api/process/process/index.ts b/src/api/process/process/index.ts index c10999632..49d75689a 100644 --- a/src/api/process/process/index.ts +++ b/src/api/process/process/index.ts @@ -1,52 +1,53 @@ -import request from '@/config/axios' - -// 执行 VO -export interface MainVO { - id: number // 主键id - contractId: number // 任务书Id - projectCode: string // 任务书编号 - projectName: string // 任务书名称 - projectLeader: string // 项目负责人 - projectLeaderId: string // 项目负责人ID - undertakingUnitName: string // 承担单位名称 - undertakingUnitId: string // 承担单位ID - projectObjectives: string // 项目目标 - projectEvaluation: string // 考核指标 - processDate: string // 执行时间区段 - deviation: string // 是否偏差 - reason: string // 偏差原因 - schedule: string // 实际进度 -} - -// 执行 API -export const MainApi = { - // 查询执行分页 - getMainPage: async (params: any) => { - return await request.get({ url: `/process/main/page`, params }) - }, - - // 查询执行详情 - getMain: async (id: number) => { - return await request.get({ url: `/process/main/get?id=` + id }) - }, - - // 新增执行 - createMain: async (data: MainVO) => { - return await request.post({ url: `/process/main/create`, data }) - }, - - // 修改执行 - updateMain: async (data: MainVO) => { - return await request.put({ url: `/process/main/update`, data }) - }, - - // 删除执行 - deleteMain: async (id: number) => { - return await request.delete({ url: `/process/main/delete?id=` + id }) - }, - - // 导出执行 Excel - exportMain: async (params) => { - return await request.download({ url: `/process/main/export-excel`, params }) - }, -} \ No newline at end of file +import request from '@/config/axios' + +// 执行 VO +export interface MainVO { + id: number // 主键id + contractId: number // 任务书Id + projectCode: string // 任务书编号 + projectName: string // 任务书名称 + projectLeader: string // 项目负责人 + projectLeaderId: string // 项目负责人ID + undertakingUnitName: string // 承担单位名称 + undertakingUnitId: string // 承担单位ID + projectObjectives: string // 项目目标 + projectEvaluation: string // 考核指标 + processDate: string // 执行时间区段 + deviation: string // 是否偏差 + reason: string // 偏差原因 + schedule: string // 实际进度 + futurePlan: string // 下一步工作计划 +} + +// 执行 API +export const MainApi = { + // 查询执行分页 + getMainPage: async (params: any) => { + return await request.get({ url: `/process/main/page`, params }) + }, + + // 查询执行详情 + getMain: async (id: number) => { + return await request.get({ url: `/process/main/get?id=` + id }) + }, + + // 新增执行 + createMain: async (data: MainVO) => { + return await request.post({ url: `/process/main/create`, data }) + }, + + // 修改执行 + updateMain: async (data: MainVO) => { + return await request.put({ url: `/process/main/update`, data }) + }, + + // 删除执行 + deleteMain: async (id: number) => { + return await request.delete({ url: `/process/main/delete?id=` + id }) + }, + + // 导出执行 Excel + exportMain: async (params) => { + return await request.download({ url: `/process/main/export-excel`, params }) + }, +} diff --git a/src/views/change/change/index.vue b/src/views/change/change/index.vue index 47a20b2b8..f1b0d8dc6 100644 --- a/src/views/change/change/index.vue +++ b/src/views/change/change/index.vue @@ -73,6 +73,9 @@ > 新增 + + 新增1 + - @@ -152,6 +154,30 @@ /> + + + + + + + + + + + + + + + + @@ -167,11 +193,16 @@ import MainForm from './MainForm.vue' defineOptions({ name: 'ChangeMain' }) const message = useMessage() // 消息弹窗 +const dialogVisible = ref(false) // 弹窗的是否展示 const { t } = useI18n() // 国际化 const loading = ref(true) // 列表的加载中 const list = ref([]) // 列表的数据 const total = ref(0) // 列表的总页数 + +const loading1 = ref(true) // 列表的加载中 +const list1 = ref([]) // 在研任务书列表的数据 +const total1 = ref(0) // 列表的总页数 const queryParams = reactive({ pageNo: 1, pageSize: 10, @@ -202,6 +233,39 @@ const queryParams = reactive({ const queryFormRef = ref() // 搜索的表单 const exportLoading = ref(false) // 导出的加载中 +/** 选中行 */ +const currentRowValue = ref(undefined) // 选中行的 value +const currentRow = ref(undefined) // 选中行 +const handleCurrentChange = (row) => { + currentRow.value = row.id +} +const queryParams1 = reactive({ + pageNo: 1, + pageSize: 10, + projectName: undefined, + projectLeader: undefined, + projectCode: undefined, + technicalField: undefined, + year: undefined, +}) +const submitForm = async () => { + try { + await MainApi.generateChange({ ids: currentRow.value }) + message.success("生成成功") + } finally { + // 关闭弹窗 + currentRow.value = undefined + currentRowValue.value = undefined + dialogVisible.value = false + } +} +/** 查询在研合同*/ +const handleInsert = async () => { + currentRowValue.value = undefined + dialogVisible.value = true + getList1() +} + /** 查询列表 */ const getList = async () => { loading.value = true @@ -245,6 +309,17 @@ const handleDelete = async (id: number) => { } catch {} } +const getList1 = async () => { + loading1.value = true + try { + const data = await MainApi.getListPage(queryParams1) + list1.value = data.list + total1.value = data.total + } finally { + loading1.value = false + } +} + /** 导出按钮操作 */ const handleExport = async () => { try { diff --git a/src/views/process/process/MainForm.vue b/src/views/process/process/MainForm.vue index da3c88922..aff394519 100644 --- a/src/views/process/process/MainForm.vue +++ b/src/views/process/process/MainForm.vue @@ -14,16 +14,19 @@ + {{formData.projectCode}} + {{formData.projectName}} + {{formData.projectLeader}} @@ -32,6 +35,7 @@ + {{formData.undertakingUnitName}} @@ -48,7 +52,7 @@ - + + + + + + +