自动审核数量提示

This commit is contained in:
cxc
2022-12-07 11:24:31 +08:00
parent 698e012ef3
commit e6dfe8008a
7 changed files with 72 additions and 27 deletions

View File

@ -0,0 +1,22 @@
import request from "@/utils/request";
// 获取未审核数量
export const getUnApprovalCount = (name) =>
request({
url: "/app/map/handleReadCount",
method: "get",
params: {
name,
type: "1",
},
});
// 重置未审核
export const resetUnApprovalCount = (name) =>
request({
url: "/app/map/handleReadCount",
method: "get",
params: {
name,
type: "3",
},
});

View File

@ -8,6 +8,10 @@ import { listCasDemand } from "../../api/dataApproval/enterpriseServiceDemand";
import { expertAchievementList } from "../../api/dataApproval/achivement";
import { businessList } from "../../api/Businessneeds";
import { enterpriseProductApprovalList } from "../../api/dataApproval/enterpriseProduct";
import {
getUnApprovalCount,
resetUnApprovalCount,
} from "../../api/dataApproval/count";
const useUserStore = defineStore("user", {
state: () => ({
@ -88,6 +92,11 @@ const useUserStore = defineStore("user", {
this.getTechnologyTotal();
},
async resetUnApproval(name, field) {
await resetUnApprovalCount(name);
this[field] = 0;
},
async getUnApprovedBusiness() {
const resp = await companyList({
examineStatus: 0,
@ -105,32 +114,20 @@ const useUserStore = defineStore("user", {
this.unApprovedExpert = resp.total;
},
async getUnApprovedAchivement() {
const resp = await expertAchievementList({
status: 0,
pageNum: 1,
pageSize: 10,
});
this.unApprovedAchivement = resp.total;
const resp = await getUnApprovalCount("achievement");
this.unApprovedAchivement = resp.data ?? 0;
},
async getUnApprovedTechnology() {
const resp = await businessList({ status: 0, pageNum: 1, pageSize: 10 });
this.unApprovedTechnology = resp.total;
const resp = await getUnApprovalCount("technology");
this.unApprovedTechnology = resp.data ?? 0;
},
async getUnApprovedService() {
const resp = await listCasDemand({
pageNum: 1,
pageSize: 10,
status: 0,
});
this.unApprovedService = resp.total;
const resp = await getUnApprovalCount("service");
this.unApprovedService = resp.data ?? 0;
},
async getUnApprovedProduct() {
const resp = await enterpriseProductApprovalList({
pageNum: 1,
pageSize: 10,
status: 0,
});
this.unApprovedProduct = resp.total;
const resp = await getUnApprovalCount("product");
this.unApprovedProduct = resp.data ?? 0;
},
async getServiceDemandTotal() {

View File

@ -51,6 +51,11 @@
:disabled="!selectedIds.length"
@click="handleDelete(...selectedIds)"
>批量删除</el-button
><el-button
size="small"
type="primary"
@click="userStore.resetUnApproval('product', 'unApprovedProduct')"
>未读归零</el-button
>
</el-row>
<!-- 表格区域 -->

View File

@ -218,7 +218,7 @@ const submitForm = async (status) => {
case "2":
successMessage = "已驳回";
}
userStore.getUnApprovedAchivement();
userStore.getUnApprovedAchivement("achievement");
ElMessage.success(successMessage);
router.back();
};

View File

@ -53,6 +53,14 @@
@click="handleDelete(...selectedIds)"
>批量删除</el-button
>
<el-button
size="small"
type="primary"
@click="
userStore.resetUnApproval('achievement', 'unApprovedAchivement')
"
>未读归零</el-button
>
</el-row>
<!-- 表格区域 -->
<el-table :data="dataList" @selection-change="handleSelectionChange">
@ -115,6 +123,8 @@
</div>
</template>
<script setup>
// import SiteOptions from "@/views/components/SiteOptions";
// import {} from "../../../api/dataApproval/achivement";
import { reactive, ref, toRefs } from "vue";
import { tenantSelect } from "@/api/subPlatform/tenant";
import {
@ -122,15 +132,15 @@ import {
batchAchievement,
deleteAchievementByIds,
} from "@/api/dataApproval/achivement";
import SiteOptions from "@/views/components/SiteOptions";
import useUserStore from "@/store/modules/user";
import { useRouter } from "vue-router";
// import {} from "../../../api/dataApproval/achivement";
import { ElMessage, ElMessageBox } from "element-plus";
const userStore = useUserStore();
const router = useRouter();
const data = reactive({
queryParams: {
pageNum: 1,
pageSize: 10,
status: 0,
},
});
@ -141,10 +151,10 @@ const dataList = ref([]);
const siteList = ref([]);
const total = ref(0);
// 获取站点列表
const getSiteList = async () => {
const resp = await tenantSelect();
siteList.value = resp.rows;
};
// const getSiteList = async () => {
// const resp = await tenantSelect();
// siteList.value = resp.rows;
// };
// getSiteList();
const getList = async () => {

View File

@ -54,6 +54,12 @@
@click="handleDelete(...selectedIds)"
>批量删除</el-button
>
<el-button
size="small"
type="primary"
@click="userStore.resetUnApproval('technology', 'unApprovedTechnology')"
>未读归零</el-button
>
</el-row>
<!-- 表格区域 -->
<el-table :data="dataList" @selection-change="handleSelectionChange">

View File

@ -56,6 +56,11 @@
:disabled="!selectedIds.length"
@click="handleDelete(...selectedIds)"
>批量删除</el-button
><el-button
size="small"
type="primary"
@click="userStore.resetUnApproval('service', 'unApprovedService')"
>未读归零</el-button
>
</el-row>
<!-- 表格区域 -->