sidemenu service demand count.
This commit is contained in:
@ -22,3 +22,9 @@ export const updateCasDemand = (data) =>
|
||||
method: "PUT",
|
||||
data,
|
||||
});
|
||||
// 修改企业服务需求
|
||||
export const deleteCasDemand = (ids) =>
|
||||
request({
|
||||
url: `/business/dataReview/listCasDemand/${ids}`,
|
||||
method: "DELETE",
|
||||
});
|
||||
|
@ -7,9 +7,6 @@
|
||||
:value="getCount(basePath)"
|
||||
class="count-badge"
|
||||
>
|
||||
<!-- <template #default>
|
||||
<div>231</div>
|
||||
</template> -->
|
||||
<div>
|
||||
<template
|
||||
v-if="
|
||||
@ -23,6 +20,9 @@
|
||||
:to="resolvePath(onlyOneChild.path, onlyOneChild.query)"
|
||||
>
|
||||
<el-menu-item
|
||||
:style="{
|
||||
paddingRight: '0px',
|
||||
}"
|
||||
:index="resolvePath(onlyOneChild.path)"
|
||||
:class="{ 'submenu-title-noDropdown': !isNest }"
|
||||
>
|
||||
@ -35,7 +35,11 @@
|
||||
><span
|
||||
class="menu-title"
|
||||
:title="hasTitle(onlyOneChild.meta.title)"
|
||||
>{{ onlyOneChild.meta.title }}</span
|
||||
>{{
|
||||
["/auditing/serviceDemand"].includes(basePath)
|
||||
? `${onlyOneChild.meta.title} (${getCount(basePath)})`
|
||||
: onlyOneChild.meta.title
|
||||
}}</span
|
||||
></template
|
||||
>
|
||||
</el-menu-item>
|
||||
@ -95,11 +99,12 @@ const onlyOneChild = ref({});
|
||||
const userStore = useUserStore();
|
||||
|
||||
const getCount = (basePath) => {
|
||||
console.log(basePath);
|
||||
if (basePath == "/approval/list") {
|
||||
return userStore.unApprovedBusiness;
|
||||
} else if (props.basePath == "/approval/dataList/approval") {
|
||||
return userStore.unApprovedExpert;
|
||||
} else if (props.basePath == "/auditing/serviceDemand") {
|
||||
return userStore.serviceDemandTotal;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import defAva from "@/assets/images/profile.jpg";
|
||||
import md5 from "js-md5";
|
||||
import { companyList } from "@/api/dataList/enterprise";
|
||||
import { expertList } from "@/api/expert/expert";
|
||||
import { listCasDemand } from "../../api/dataApproval/enterpriseServiceDemand";
|
||||
|
||||
const useUserStore = defineStore("user", {
|
||||
state: () => ({
|
||||
@ -14,6 +15,7 @@ const useUserStore = defineStore("user", {
|
||||
permissions: [],
|
||||
unApprovedBusiness: 10,
|
||||
unApprovedExpert: 20,
|
||||
serviceDemandTotal: 0,
|
||||
}),
|
||||
actions: {
|
||||
// 登录
|
||||
@ -75,9 +77,11 @@ const useUserStore = defineStore("user", {
|
||||
pageSize: 1,
|
||||
pageNum: 10,
|
||||
}),
|
||||
listCasDemand(),
|
||||
]);
|
||||
this.unApprovedBusiness = resps[0].total;
|
||||
this.unApprovedExpert = resps[1].total;
|
||||
this.serviceDemandTotal = resps[2].total;
|
||||
},
|
||||
unApprovedBusinessPlus() {
|
||||
this.unApprovedBusiness++;
|
||||
|
@ -14,7 +14,6 @@
|
||||
<div :style="{ marginLeft: 140 + 'px' }">
|
||||
<el-button @click="submitForm('2')">审核拒绝</el-button>
|
||||
<el-button type="primary" @click="submitForm('1')">通过审核</el-button>
|
||||
<el-button type="primary" @click="testCount">通过审核</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -32,9 +31,9 @@ import { useRoute, useRouter } from "vue-router";
|
||||
import { ElMessage } from "element-plus";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
|
||||
const testCount = () => {
|
||||
useUserStore().unApprovedBusinessPlus();
|
||||
};
|
||||
// const testCount = () => {
|
||||
// useUserStore().unApprovedBusinessPlus();
|
||||
// };
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
@ -48,6 +48,42 @@
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
|
||||
<el-row v-if="formType == 2">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="联系人" prop="contact">
|
||||
<el-input v-model="modelValue.contact"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="formType == 2">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="联系方式" prop="mobilephone">
|
||||
<el-input
|
||||
v-model="modelValue.mobilephone"
|
||||
:maxlength="11"
|
||||
oninput="
|
||||
value = value
|
||||
.replace(/[^\d.]/g, '')
|
||||
.replace(/\.{2,}/g, '.')
|
||||
.replace('.', '$#$')
|
||||
.replace(/\./g, '')
|
||||
.replace('$#$', '.')
|
||||
.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')
|
||||
.replace(/^\./g, '')
|
||||
"
|
||||
></el-input>
|
||||
<!-- v-number -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="formType == 2">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="modelValue.email"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="formType == 2">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="企业类型:" prop="kind">
|
||||
@ -241,7 +277,7 @@
|
||||
ref="researchsFormRef"
|
||||
/> -->
|
||||
|
||||
<InputBoxAdd
|
||||
<!-- <InputBoxAdd
|
||||
v-if="formType == 2"
|
||||
:labelWidth="labelWidth"
|
||||
v-model="modelValue"
|
||||
@ -250,17 +286,17 @@
|
||||
placeholder="请输入生产方向"
|
||||
fieldKey="directions"
|
||||
ref="directionsFormRef"
|
||||
/>
|
||||
/> -->
|
||||
|
||||
<el-row v-if="formType == 2">
|
||||
<el-col :span="24">
|
||||
<!-- <el-col :span="24">
|
||||
<el-form-item label="邀请码:">
|
||||
<el-input
|
||||
v-model="modelValue.inviterCode"
|
||||
:disabled="!isAdd"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="24">
|
||||
<el-form-item label="企业网站:">
|
||||
<el-input v-model="modelValue.url"></el-input>
|
||||
@ -441,13 +477,11 @@ const validateForm = async () => {
|
||||
);
|
||||
} else if (formType.value == 2) {
|
||||
//企业
|
||||
const directionsFormValid = await directionsFormRef.value.validateForm(); //生产方向验证
|
||||
// const directionsFormValid = await directionsFormRef.value.validateForm(); //生产方向验证
|
||||
return (
|
||||
formValid &&
|
||||
cityFormValid &&
|
||||
fieldFormValid &&
|
||||
formValid && cityFormValid && fieldFormValid
|
||||
// keywordsFormValid &&
|
||||
directionsFormValid
|
||||
// directionsFormValid
|
||||
);
|
||||
} else {
|
||||
throw "未知的formType";
|
||||
|
@ -82,7 +82,12 @@
|
||||
></el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button type="text" @click="approval(row)">审批</el-button>
|
||||
<el-button type="text" size="small" @click="approval(row)"
|
||||
>审批</el-button
|
||||
>
|
||||
<el-button type="text" size="small" @click="approval(row)"
|
||||
>结束</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -36,14 +36,23 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-row style="margin-bottom: 20px">
|
||||
<el-button size="small" type="primary">批量审核</el-button>
|
||||
</el-row>
|
||||
<!-- 表格区域 -->
|
||||
<el-table :data="dataList">
|
||||
<el-table :data="dataList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="80"></el-table-column>
|
||||
<el-table-column label="编号" align="center" prop="id"></el-table-column>
|
||||
<el-table-column
|
||||
label="需求名称"
|
||||
align="center"
|
||||
prop="title"
|
||||
></el-table-column>
|
||||
<el-table-column label="需求类型" align="center">
|
||||
<template #default="{ row }">
|
||||
{{ categoryMap[row.category] }}需求
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="所属领域"
|
||||
align="center"
|
||||
@ -88,7 +97,19 @@
|
||||
></el-table-column> -->
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button type="text" @click="approval(row.id)">审批</el-button>
|
||||
<el-button type="text" size="small" @click="approval(row.id)"
|
||||
>审批</el-button
|
||||
>
|
||||
<el-button type="text" size="small" @click="approval(row.id)"
|
||||
>结束</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
icon="delete3"
|
||||
@click="handleDelete(row.id)"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -103,16 +124,22 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { businessList } from "@/api/Businessneeds/index.js";
|
||||
import { listCasDemand } from "../../../api/dataApproval/enterpriseServiceDemand";
|
||||
// import { businessList } from "@/api/Businessneeds/index.js";
|
||||
import {
|
||||
listCasDemand,
|
||||
deleteCasDemand,
|
||||
} from "@/api/dataApproval/enterpriseServiceDemand";
|
||||
|
||||
// import Edialog from "@/views/components/Businessneeds/Approvaldetails.vue";
|
||||
import SiteOptions from "@/views/components/SiteOptions";
|
||||
import { tenantSelect } from "@/api/subPlatform/tenant";
|
||||
import { ref, toRefs, defineComponent } from "vue";
|
||||
import { cloneDeep } from "lodash";
|
||||
import { ref, toRefs } from "vue";
|
||||
// import { cloneDeep } from "lodash";
|
||||
import { useRouter } from "vue-router";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
const router = useRouter();
|
||||
const userStore = useUserStore();
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@ -121,6 +148,12 @@ const data = reactive({
|
||||
},
|
||||
demandForm: {},
|
||||
});
|
||||
|
||||
const categoryMap = {
|
||||
1: "企业",
|
||||
2: "专家",
|
||||
};
|
||||
|
||||
const siteList = ref([]);
|
||||
const dataList = ref([]);
|
||||
const total = ref(0);
|
||||
@ -131,6 +164,7 @@ const getList = async () => {
|
||||
const resp = await listCasDemand(queryParams.value);
|
||||
dataList.value = resp.rows;
|
||||
total.value = resp.total;
|
||||
// userStore.serviceDemandTotal = resp.total;
|
||||
};
|
||||
const approval = (id) => {
|
||||
// demandForm.value = cloneDeep(row);
|
||||
@ -163,6 +197,13 @@ const handleQuery = () => {
|
||||
getList();
|
||||
};
|
||||
|
||||
const selectedIds = ref([]);
|
||||
// 选中状态改变
|
||||
const handleSelectionChange = (val) => {
|
||||
selectedIds.value = val;
|
||||
// console.log(val);
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
if (queryFormRef.value) {
|
||||
@ -171,6 +212,17 @@ const resetQuery = () => {
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
const handleDelete = async (id) => {
|
||||
ElMessageBox.confirm(`是否确认删除编号为${id}的数据项?`)
|
||||
.then(async () => {
|
||||
await deleteCasDemand(id);
|
||||
userStore.getApprovalCount();
|
||||
getList();
|
||||
ElMessage.success("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
getSiteList();
|
||||
getList();
|
||||
</script>
|
||||
|
@ -221,7 +221,7 @@
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<CityOptions v-model="form" />
|
||||
<CityOptions v-model="form" ref="cityOptionsRef" />
|
||||
<!-- <el-form-item label="地点:" required>
|
||||
<el-row type="flex" justify="space-between" :gutter="10">
|
||||
<el-col :span="8">
|
||||
@ -285,7 +285,7 @@
|
||||
<el-form-item label="详细地址:" prop="address">
|
||||
<el-input v-model="form.address" placeholder="请输入详细地址" />
|
||||
</el-form-item>
|
||||
<FieldOptions v-model="form" />
|
||||
<FieldOptions v-model="form" ref="fieldOptionsRef" />
|
||||
|
||||
<!-- <el-form-item label="活动分类:" required>
|
||||
<el-row type="flex" justify="space-between">
|
||||
@ -642,15 +642,23 @@ const handleUpdate = async (row) => {
|
||||
title.value = "修改";
|
||||
};
|
||||
|
||||
// const siteOptionsRef = ref();
|
||||
const cityOptionsRef = ref();
|
||||
const fieldOptionsRef = ref();
|
||||
const submitForm = async () => {
|
||||
// let notifys = 0;
|
||||
// form.value.notifyCrowd.map((item) => {
|
||||
// notifys = notifys | (item - 0);
|
||||
// });
|
||||
// let formData = cloneDeep(form.value);
|
||||
// formData.notifyCrowd = notifys;
|
||||
// formData.industrys = [form.value.industrys.join("-")];
|
||||
await formRef.value.validate();
|
||||
// const siteOptionsValid =
|
||||
const cityOptionsValid = await cityOptionsRef.value.validateForm();
|
||||
const fieldOptionsValid = await fieldOptionsRef.value.validateForm();
|
||||
const valid = await formRef.value.validate();
|
||||
form.value.notifyCrowd = form.value.notifyCrowds.join(",");
|
||||
if (!valid || !cityOptionsValid || !fieldOptionsValid) {
|
||||
console.log("校验未通过");
|
||||
return;
|
||||
}
|
||||
if (form.value.id != undefined) {
|
||||
activityEdit(form.value).then((response) => {
|
||||
ElMessage.success("修改成功");
|
||||
|
Reference in New Issue
Block a user