From 212c847a4ac8c7d3e1ce6c68d049bffbcc113d70 Mon Sep 17 00:00:00 2001 From: cxc Date: Tue, 22 Nov 2022 11:12:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=AE=A1=E6=A0=B8=E5=92=8C?= =?UTF-8?q?=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/dataApproval/achivement.js | 48 +++++--- src/api/dataApproval/enterpriseProduct.js | 41 +++++-- .../dataApproval/enterpriseServiceDemand.js | 16 ++- .../enterpriseTechnologyDemand.js | 25 ++++- .../Enterpriseproducts/index.vue | 105 ++++++++++++------ src/views/dataAuditList/achievement/index.vue | 70 +++++++++++- src/views/dataAuditList/demand/index.vue | 85 +++++++++++++- .../dataAuditList/serviceDemand/index.vue | 70 +++++++++--- 8 files changed, 369 insertions(+), 91 deletions(-) diff --git a/src/api/dataApproval/achivement.js b/src/api/dataApproval/achivement.js index 79c6d3b..b6d5f36 100644 --- a/src/api/dataApproval/achivement.js +++ b/src/api/dataApproval/achivement.js @@ -1,23 +1,43 @@ -import request from '@/utils/request' +import request from "@/utils/request"; // 获取成果审核列表 -export const expertAchievementList = (params) => request({ +export const expertAchievementList = (params) => + request({ url: "/business/dataReview/expertAchievementList", - method: 'get', - params -}) + method: "get", + params, + }); // 获取成果详情 -export const expertAchievementInfo = (params) => request({ +export const expertAchievementInfo = (params) => + request({ url: "/business/dataReview/expertAchievementInfo", - method: 'get', - params -}) + method: "get", + params, + }); // 修改成果 -export const updateExpertAchievement = (data) => request({ +export const updateExpertAchievement = (data) => + request({ url: "/business/dataReview/updateExpertAchievement", - method: 'put', - data -}) - + method: "put", + data, + }); +// 批量审核成果 +export const batchAchievement = (ids) => + request({ + url: `/business/dataReview/batchAchievement`, + method: "put", + data: { + ids, + }, + }); +// 批量删除成果 +export const deleteAchievementByIds = (ids) => + request({ + url: `/business/dataReview/deleteAchievementByIds`, + method: "DELETE", + data: { + ids, + }, + }); diff --git a/src/api/dataApproval/enterpriseProduct.js b/src/api/dataApproval/enterpriseProduct.js index 2c97416..5087698 100644 --- a/src/api/dataApproval/enterpriseProduct.js +++ b/src/api/dataApproval/enterpriseProduct.js @@ -1,19 +1,36 @@ -import request from '@/utils/request' +import request from "@/utils/request"; // 获取企业产品审核列表 -export const enterpriseProductApprovalList = (params) => request({ +export const enterpriseProductApprovalList = (params) => + request({ url: "/business/dataReview/enterpriseProductList", - method: 'get', - params -}) + method: "get", + params, + }); // 获取企业产品审核详情 -export const getProductApprovalInfo = (id) => request({ +export const getProductApprovalInfo = (id) => + request({ url: `/business/dataReview/getProductInfo/${id}`, - method: 'get', -}) + method: "get", + }); // 修改企业产品审核状态 -export const updateEnterpriseApprovalProduct = (data) => request({ +export const updateEnterpriseApprovalProduct = (data) => + request({ url: `/business/dataReview/updateEnterpriseProduct`, - method: 'post', - data -}) \ No newline at end of file + method: "post", + data, + }); + +// 批量审核企业产品 +export const batchEnterpriseProduct = (ids) => + request({ + url: `/business/dataReview/batchEnterpriseProduct/${ids}`, + method: "PUT", + }); + +// 批量删除企业产品 +export const deleteEnterpriseProduct = (ids) => + request({ + url: `/business/dataReview/deleteEnterpriseProduct/${ids}`, + method: "DELETE", + }); diff --git a/src/api/dataApproval/enterpriseServiceDemand.js b/src/api/dataApproval/enterpriseServiceDemand.js index 521de4b..37551b6 100644 --- a/src/api/dataApproval/enterpriseServiceDemand.js +++ b/src/api/dataApproval/enterpriseServiceDemand.js @@ -22,9 +22,23 @@ export const updateCasDemand = (data) => method: "PUT", data, }); -// 修改企业服务需求 +// 删除企业服务需求 export const deleteCasDemand = (ids) => request({ url: `/business/dataReview/listCasDemand/${ids}`, method: "DELETE", }); + +// 批量审核企业服务需求 +export const batchCasDemand = (ids) => + request({ + url: `/business/dataReview/batchCasDemand/${ids}`, + method: "PUT", + }); + +// // 批量删除企业技术需求 +// export const deleteTechnologyDemand = (ids) => +// request({ +// url: `/business/dataReview/deleteTechnologyDemand/${ids}`, +// method: "DELETE", +// }); diff --git a/src/api/dataApproval/enterpriseTechnologyDemand.js b/src/api/dataApproval/enterpriseTechnologyDemand.js index e031829..b005d76 100644 --- a/src/api/dataApproval/enterpriseTechnologyDemand.js +++ b/src/api/dataApproval/enterpriseTechnologyDemand.js @@ -1,8 +1,23 @@ -import request from '@/utils/request' +import request from "@/utils/request"; // 修改企业技术需求审核 -export const updateTechnologyDemand = (data) => request({ +export const updateTechnologyDemand = (data) => + request({ url: "/business/dataReview/updateTechnologyDemand", - method: 'POST', - data -}) \ No newline at end of file + method: "POST", + data, + }); + +// 批量审核企业技术需求 +export const batchTechnologyDemand = (ids) => + request({ + url: `/business/dataReview/batchTechnologyDemand/${ids}`, + method: "PUT", + }); + +// 批量删除企业技术需求 +export const deleteTechnologyDemand = (ids) => + request({ + url: `/business/dataReview/deleteTechnologyDemand/${ids}`, + method: "DELETE", + }); diff --git a/src/views/dataAuditList/Enterpriseproducts/index.vue b/src/views/dataAuditList/Enterpriseproducts/index.vue index 214fcdb..9a208ec 100644 --- a/src/views/dataAuditList/Enterpriseproducts/index.vue +++ b/src/views/dataAuditList/Enterpriseproducts/index.vue @@ -36,8 +36,30 @@ + + 批量审核 + 批量删除 + - + + 审批 + 删除 @@ -90,8 +119,16 @@ import { reactive, ref, toRefs } from "vue"; import SiteOptions from "@/views/components/SiteOptions"; import { tenantSelect } from "@/api/subPlatform/tenant"; -import { enterpriseProductApprovalList } from "@/api/dataApproval/enterpriseProduct"; +import { + enterpriseProductApprovalList, + batchEnterpriseProduct, + deleteEnterpriseProduct, +} from "@/api/dataApproval/enterpriseProduct"; +import useUserStore from "@/store/modules/user"; + import { useRouter } from "vue-router"; +import { ElMessage, ElMessageBox } from "element-plus"; +const userStore = useUserStore(); const router = useRouter(); const dataList = ref([]); const siteList = ref([]); @@ -142,41 +179,39 @@ const resetQuery = () => { } handleQuery(); }; -// dataList.value = [ -// { -// id: "123", -// name: "新型高功率LED路灯照明市场分析", -// obj: "电子信息", -// time: "2015-09-28 08:50:08", -// }, -// { -// id: "123", -// name: "一种新型的自动调节升降按摩椅", -// obj: "电子信息", -// time: "2015-09-28 08:50:08", -// }, -// { -// id: "123", -// name: "汽车用先进传感器成果", -// obj: "电子信息", -// time: "2015-09-28 08:50:08", -// }, -// { id: "123", name: "微波遥感", obj: "电子信息", time: "2015-09-28 08:50:08" }, -// { -// id: "123", -// name: "一种高压电柜的散热控", -// obj: "电子信息", -// time: "2015-09-28 08:50:08", -// }, -// { -// id: "123", -// name: "高电压快充技术", -// obj: "电子信息", -// time: "2015-09-28 08:50:08", -// }, -// ]; + const handleApproval = (id) => { router.push(`/auditing/Enterpriseproducts/approval?id=${id}`); }; + +const selectedIds = ref([]); +// 选中状态改变 +const handleSelectionChange = (val) => { + selectedIds.value = val.map((el) => el.id); +}; + +const handleDelete = async (...ids) => { + ElMessageBox.confirm(`是否确认删除编号为${ids.join(",")}的数据项?`) + .then(async () => { + await deleteEnterpriseProduct(ids); + userStore.getApprovalCount(); + getList(); + ElMessage.success("删除成功"); + }) + .catch(() => {}); +}; + +const handleBatchApproval = async () => { + ElMessageBox.confirm( + `是否确认批量审核通过编号为${selectedIds.value.join(",")}的数据项?` + ) + .then(async () => { + await batchEnterpriseProduct(selectedIds.value); + userStore.getApprovalCount(); + getList(); + ElMessage.success("批量审核成功"); + }) + .catch(() => {}); +}; diff --git a/src/views/dataAuditList/achievement/index.vue b/src/views/dataAuditList/achievement/index.vue index 3c3647a..185d302 100644 --- a/src/views/dataAuditList/achievement/index.vue +++ b/src/views/dataAuditList/achievement/index.vue @@ -38,11 +38,25 @@ - 批量审核 + 批量审核 + 批量删除 - - + + @@ -94,9 +117,17 @@ diff --git a/src/views/dataAuditList/demand/index.vue b/src/views/dataAuditList/demand/index.vue index 5f870d0..2ca6cfa 100644 --- a/src/views/dataAuditList/demand/index.vue +++ b/src/views/dataAuditList/demand/index.vue @@ -14,6 +14,8 @@ 待审核 已通过 已驳回 + 已结束 + @@ -36,8 +38,26 @@ + + 批量审核 + 批量删除 + - + + @@ -115,7 +143,14 @@ import SiteOptions from "@/views/components/SiteOptions"; import { tenantSelect } from "@/api/subPlatform/tenant"; import { ref, toRefs, defineComponent } from "vue"; import { cloneDeep } from "lodash"; - +import useUserStore from "@/store/modules/user"; +import { + batchTechnologyDemand, + deleteTechnologyDemand, + updateTechnologyDemand, +} from "@/api/dataApproval/enterpriseTechnologyDemand"; +import { ElMessage, ElMessageBox } from "element-plus"; +const userStore = useUserStore(); const data = reactive({ queryParams: { pageNum: 1, @@ -124,6 +159,7 @@ const data = reactive({ }, demandForm: {}, }); + const siteList = ref([]); const dataList = ref([]); const total = ref(0); @@ -168,6 +204,45 @@ const resetQuery = () => { handleQuery(); }; +const selectedIds = ref([]); +// 选中状态改变 +const handleSelectionChange = (val) => { + selectedIds.value = val.map((el) => el.id); +}; +const handleDelete = async (...ids) => { + ElMessageBox.confirm(`是否确认删除编号为${ids.join(",")}的数据项?`) + .then(async () => { + await deleteTechnologyDemand(ids); + userStore.getApprovalCount(); + getList(); + ElMessage.success("删除成功"); + }) + .catch(() => {}); +}; +const handleBatchApproval = async () => { + ElMessageBox.confirm( + `是否确认批量审核通过编号为${selectedIds.value.join(",")}的数据项?` + ) + .then(async () => { + await batchTechnologyDemand(selectedIds.value); + userStore.getApprovalCount(); + getList(); + ElMessage.success("批量审核成功"); + }) + .catch(() => {}); +}; + +// 修改为完成状态 +const complete = (id) => { + ElMessageBox.confirm(`是否确认结束编号为${id}的数据项?`) + .then(async () => { + await updateTechnologyDemand({ id, status: 4 }); + userStore.getApprovalCount(); + getList(); + ElMessage.success("删除成功"); + }) + .catch(() => {}); +}; getSiteList(); getList(); diff --git a/src/views/dataAuditList/serviceDemand/index.vue b/src/views/dataAuditList/serviceDemand/index.vue index 7e75422..6c27211 100644 --- a/src/views/dataAuditList/serviceDemand/index.vue +++ b/src/views/dataAuditList/serviceDemand/index.vue @@ -4,7 +4,7 @@ - + 待审核 已通过 已驳回 + 已结束 - - + + + + + + @@ -36,8 +41,22 @@ - - 批量审核 + + 批量审核 + 批量删除 @@ -100,8 +119,8 @@ 审批 - 结束完成 { const selectedIds = ref([]); // 选中状态改变 const handleSelectionChange = (val) => { - selectedIds.value = val; - // console.log(val); + selectedIds.value = val.map((el) => el.id); }; /** 重置按钮操作 */ @@ -212,17 +232,39 @@ const resetQuery = () => { handleQuery(); }; -const handleDelete = async (id) => { - ElMessageBox.confirm(`是否确认删除编号为${id}的数据项?`) +const handleDelete = async (...ids) => { + ElMessageBox.confirm(`是否确认删除编号为${ids.join(",")}的数据项?`) .then(async () => { - await deleteCasDemand(id); + await deleteCasDemand(ids); + userStore.getApprovalCount(); + getList(); + ElMessage.success("删除成功"); + }) + .catch(() => {}); +}; +const handleBatchApproval = async () => { + ElMessageBox.confirm( + `是否确认批量审核通过编号为${selectedIds.value.join(",")}的数据项?` + ) + .then(async () => { + await batchCasDemand(selectedIds.value); + userStore.getApprovalCount(); + getList(); + ElMessage.success("批量审核成功"); + }) + .catch(() => {}); +}; +// 修改为完成状态 +const complete = (id) => { + ElMessageBox.confirm(`是否确认结束编号为${id}的数据项?`) + .then(async () => { + await updateCasDemand({ id, status: 4 }); userStore.getApprovalCount(); getList(); ElMessage.success("删除成功"); }) .catch(() => {}); }; - getSiteList(); getList();