From 286cc500a08fdbbb1604d85ec9177e8fe7009176 Mon Sep 17 00:00:00 2001
From: liting <994745334@qq.com>
Date: Thu, 13 Jun 2024 19:40:04 +0800
Subject: [PATCH] =?UTF-8?q?=E9=AA=8C=E6=94=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/acceptance/acceptance/index.ts | 224 +++++++++--------
src/views/acceptance/acceptance/MainForm.vue | 212 ++++++++--------
src/views/acceptance/acceptance/index.vue | 241 +++++++++++++++----
src/views/contract/contract/index.vue | 11 -
4 files changed, 431 insertions(+), 257 deletions(-)
diff --git a/src/api/acceptance/acceptance/index.ts b/src/api/acceptance/acceptance/index.ts
index 84ea156f2..a0921cf92 100644
--- a/src/api/acceptance/acceptance/index.ts
+++ b/src/api/acceptance/acceptance/index.ts
@@ -1,103 +1,121 @@
-import request from '@/config/axios'
-
-// 验收 VO
-export interface MainVO {
- id: number // 主键Id
- contractId: number // 合同Id
- projectCode: string // 任务书编号
- projectName: string // 任务书名称
- projectLeader: string // 项目负责人
- projectLeaderId: number // 项目负责人ID
- undertakingUnitName: string // 承担单位名称
- undertakingUnitId: number // 承担单位ID
- beginDate: Date // 开始时间
- endDate: Date // 结束时间
- accYear: string // 验收年度
- accDate: Date // 验收时间
- competentDeptId: number // 主管部门ID
- competentDeptName: string // 主管部门
- managerId: number // 主管工程师ID
- managerName: string // 主管工程师
- maintenanceUnitName: string // 维护单位名称
- maintenanceUnitId: number // 维护单位ID
- reviewUnitName: string // 审核单位名称
- reviewUnitId: number // 审核单位ID
- accMode: string // 验收形式
- accResult: string // 验收结果
- state: string // 状态
-}
-
-// 验收 API
-export const MainApi = {
- // 查询验收分页
- getMainPage: async (params: any) => {
- return await request.get({ url: `/acceptance/main/page`, params })
- },
-
- // 查询验收详情
- getMain: async (id: number) => {
- return await request.get({ url: `/acceptance/main/get?id=` + id })
- },
-
- // 新增验收
- createMain: async (data: MainVO) => {
- return await request.post({ url: `/acceptance/main/create`, data })
- },
-
- // 修改验收
- updateMain: async (data: MainVO) => {
- return await request.put({ url: `/acceptance/main/update`, data })
- },
-
- // 删除验收
- deleteMain: async (id: number) => {
- return await request.delete({ url: `/acceptance/main/delete?id=` + id })
- },
-
- // 导出验收 Excel
- exportMain: async (params) => {
- return await request.download({ url: `/acceptance/main/export-excel`, params })
- },
-
-// ==================== 子表(验收详细) ====================
-
- // 获得验收详细
- getInfoByAcceptanceId: async (acceptanceId) => {
- return await request.get({ url: `/acceptance/main/info/get-by-acceptance-id?acceptanceId=` + acceptanceId })
- },
-
-// ==================== 子表(验收项目目标) ====================
-
- // 获得验收项目目标列表
- getTargetListByAcceptanceId: async (acceptanceId) => {
- return await request.get({ url: `/acceptance/main/target/list-by-acceptance-id?acceptanceId=` + acceptanceId })
- },
-
-// ==================== 子表(验收考核指标) ====================
-
- // 获得验收考核指标列表
- getCheckListByAcceptanceId: async (acceptanceId) => {
- return await request.get({ url: `/acceptance/main/check/list-by-acceptance-id?acceptanceId=` + acceptanceId })
- },
-
-// ==================== 子表(验收项目论文成果) ====================
-
- // 获得验收项目论文成果列表
- getPublicationsListByAcceptanceId: async (acceptanceId) => {
- return await request.get({ url: `/acceptance/main/publications/list-by-acceptance-id?acceptanceId=` + acceptanceId })
- },
-
-// ==================== 子表(验收其他成果) ====================
-
- // 获得验收其他成果列表
- getAchieListByAcceptanceId: async (acceptanceId) => {
- return await request.get({ url: `/acceptance/main/achie/list-by-acceptance-id?acceptanceId=` + acceptanceId })
- },
-
-// ==================== 子表(验收经费-新) ====================
-
- // 获得验收经费-新列表
- getFundsListByAcceptanceId: async (acceptanceId) => {
- return await request.get({ url: `/acceptance/main/funds/list-by-acceptance-id?acceptanceId=` + acceptanceId })
- },
-}
\ 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: number // 项目负责人ID
+ undertakingUnitName: string // 承担单位名称
+ undertakingUnitId: number // 承担单位ID
+ beginDate: Date // 开始时间
+ endDate: Date // 结束时间
+ accYear: string // 验收年度
+ accDate: Date // 验收时间
+ competentDeptId: number // 主管部门ID
+ competentDeptName: string // 主管部门
+ managerId: number // 主管工程师ID
+ managerName: string // 主管工程师
+ maintenanceUnitName: string // 维护单位名称
+ maintenanceUnitId: number // 维护单位ID
+ reviewUnitName: string // 审核单位名称
+ reviewUnitId: number // 审核单位ID
+ accMode: string // 验收形式
+ accResult: string // 验收结果
+ state: string // 状态
+}
+
+// 验收 API
+export const MainApi = {
+ // 查询验收分页
+ getMainPage: async (params: any) => {
+ return await request.get({ url: `/acceptance/main/page`, params })
+ },
+
+ // 查询验收详情
+ getMain: async (id: number) => {
+ return await request.get({ url: `/acceptance/main/get?id=` + id })
+ },
+
+ // 新增验收
+ createMain: async (data: MainVO) => {
+ return await request.post({ url: `/acceptance/main/create`, data })
+ },
+
+ // 修改验收
+ updateMain: async (data: MainVO) => {
+ return await request.put({ url: `/acceptance/main/update`, data })
+ },
+
+ // 删除验收
+ deleteMain: async (id: number) => {
+ return await request.delete({ url: `/acceptance/main/delete?id=` + id })
+ },
+
+ // 导出验收 Excel
+ exportMain: async (params) => {
+ return await request.download({ url: `/acceptance/main/export-excel`, params })
+ },
+ // 导入立项
+ getListPage: async (params) => {
+ return await request.get({ url: `/acceptance/main/contractPage`, params })
+ },
+
+ generateAcceptance: async (params: any) => {
+ return await request.post({ url: `/acceptance/main/generateAcceptance`, params })
+ },
+ //审核
+ auditAcceptance: async (data: MainVO) => {
+ return await request.post({ url: `/acceptance/main/auditAcceptance`, data })
+ },
+ //提报
+ presentingAcceptance: async (params: any) => {
+ return await request.post({ url: `/acceptance/main/presentingAcceptance`, params })
+ },
+ getAuditList: async (params) => {
+ return await request.get({ url: `/contract/main/getAuditList`, params })
+ },
+// ==================== 子表(验收详细) ====================
+
+ // 获得验收详细
+ getInfoByAcceptanceId: async (acceptanceId) => {
+ return await request.get({ url: `/acceptance/main/info/get-by-acceptance-id?acceptanceId=` + acceptanceId })
+ },
+
+// ==================== 子表(验收项目目标) ====================
+
+ // 获得验收项目目标列表
+ getTargetListByAcceptanceId: async (acceptanceId) => {
+ return await request.get({ url: `/acceptance/main/target/list-by-acceptance-id?acceptanceId=` + acceptanceId })
+ },
+
+// ==================== 子表(验收考核指标) ====================
+
+ // 获得验收考核指标列表
+ getCheckListByAcceptanceId: async (acceptanceId) => {
+ return await request.get({ url: `/acceptance/main/check/list-by-acceptance-id?acceptanceId=` + acceptanceId })
+ },
+
+// ==================== 子表(验收项目论文成果) ====================
+
+ // 获得验收项目论文成果列表
+ getPublicationsListByAcceptanceId: async (acceptanceId) => {
+ return await request.get({ url: `/acceptance/main/publications/list-by-acceptance-id?acceptanceId=` + acceptanceId })
+ },
+
+// ==================== 子表(验收其他成果) ====================
+
+ // 获得验收其他成果列表
+ getAchieListByAcceptanceId: async (acceptanceId) => {
+ return await request.get({ url: `/acceptance/main/achie/list-by-acceptance-id?acceptanceId=` + acceptanceId })
+ },
+
+// ==================== 子表(验收经费-新) ====================
+
+ // 获得验收经费-新列表
+ getFundsListByAcceptanceId: async (acceptanceId) => {
+ return await request.get({ url: `/acceptance/main/funds/list-by-acceptance-id?acceptanceId=` + acceptanceId })
+ },
+}
diff --git a/src/views/acceptance/acceptance/MainForm.vue b/src/views/acceptance/acceptance/MainForm.vue
index b75591713..ba69eb894 100644
--- a/src/views/acceptance/acceptance/MainForm.vue
+++ b/src/views/acceptance/acceptance/MainForm.vue
@@ -1,103 +1,109 @@
@@ -330,16 +398,22 @@ import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { MainApi, MainVO } from '@/api/acceptance/acceptance'
import MainForm from './MainForm.vue'
-
+import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
+import { formatDate } from '@/utils/formatTime'
/** 验收 列表 */
defineOptions({ name: 'AcceptanceMain' })
-
+const dialogVisible = ref(false) // 弹窗的是否展示
+const dialogVisible1 = ref(false) // 弹窗的是否展示
+const dialogVisible2 = ref(false) // 弹窗的是否展示
const message = useMessage() // 消息弹窗
const { t } = useI18n() // 国际化
-
const loading = ref(true) // 列表的加载中
+const loading1 = ref(true) // 列表的加载中
const list = ref([]) // 列表的数据
+const logList = ref([]) // 弹窗的是否展示
+const list1 = ref([]) // 导入立项列表的数据
const total = ref(0) // 列表的总页数
+const total1 = ref(0) // 列表的总页数
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
@@ -380,7 +454,9 @@ const getList = async () => {
loading.value = false
}
}
-
+const formRules = reactive({
+ comment: [{ required: true, message: '审核意见不能为空', trigger: 'blur' }],
+})
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
@@ -398,7 +474,31 @@ const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
+// 点击导入立项
+const handleInsert = async () => {
+ currentRowValue.value = undefined
+ dialogVisible.value = true
+ getList1()
+}
+const queryParams1 = reactive({
+ pageNo: 1,
+ pageSize: 10,
+ projectName: undefined,
+ projectLeader: undefined,
+ projectCode: undefined,
+ technicalField: undefined,
+ year: undefined,
+})
+const { wsCache } = useCache()
+const user = wsCache.get(CACHE_KEY.USER).user
+const formData = ref({
+ itemId: undefined,
+ moduleId: "5",
+ creatorName: user.nickname,
+ status: '1',
+ comment: '',
+})
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
@@ -411,7 +511,66 @@ const handleDelete = async (id: number) => {
await getList()
} catch {}
}
+const handlePresenting = async (id: number) => {
+ try {
+ var par = { id: id }
+ await MainApi.presentingAcceptance(par)
+ await getList()
+ } catch { }
+}
+//审核
+const handleauditContract = async (id: number) => {
+ formData.value.itemId = id;
+ dialogVisible1.value = true
+}
+const handleRecord = async (id: number) => {
+ dialogVisible2.value = true
+ try {
+ const data = await MainApi.getAuditList({ id: id })
+ logList.value = data
+ } finally {
+ loading.value = false
+ }
+}
+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 currentRowValue = ref(undefined) // 选中行的 value
+const currentRow = ref(undefined) // 选中行
+const handleCurrentChange = (row) => {
+ currentRow.value = row.id
+}
+const submitForm = async () => {
+ try {
+ await MainApi.generateAcceptance({ id: currentRow.value })
+ message.success("提报成功")
+ } finally {
+ // 关闭弹窗
+ currentRow.value = undefined
+ currentRowValue.value = undefined
+ dialogVisible.value = false
+ }
+}
+const submitForm1 = async () => {
+ try {
+ await MainApi.auditAcceptance(formData.value as unknown as MainVO)
+ message.success("审核成功")
+ } finally {
+ // 关闭弹窗
+ currentRow.value = undefined
+ currentRowValue.value = undefined
+ dialogVisible.value = false
+ }
+}
/** 导出按钮操作 */
const handleExport = async () => {
try {
diff --git a/src/views/contract/contract/index.vue b/src/views/contract/contract/index.vue
index 50fcad8b9..20f38d51d 100644
--- a/src/views/contract/contract/index.vue
+++ b/src/views/contract/contract/index.vue
@@ -200,17 +200,6 @@ const queryParams = reactive({
technicalField: undefined,
year: undefined,
})
-/** 获得 userType 颜色 */
-const getUserTypeColor = (type: any) => {
-
- switch (type) {
- case '1':
- return '#67C23A'
- case '0':
- return '#E6A23C'
- }
- return '#409EFF'
-}
const queryParams1 = reactive({
pageNo: 1,
pageSize: 10,