|
@@ -0,0 +1,274 @@
|
|
|
+<template>
|
|
|
+ <div class="card-search">
|
|
|
+ <a-form
|
|
|
+ ref="formRef"
|
|
|
+ name="advanced_search"
|
|
|
+ class="ant-advanced-search-form"
|
|
|
+ :model="searchParams"
|
|
|
+ >
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item label="日期" :label-col="{ span: 8 }" name="emphasisTypeId">
|
|
|
+ <a-range-picker format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']" v-model:value="reportDate"
|
|
|
+ @change="onRangeChange"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6" style="text-align: left">
|
|
|
+ <a-button type="primary" html-type="submit" @click="onFinish">查询</a-button>
|
|
|
+ <a-button
|
|
|
+ style="margin: 0 8px"
|
|
|
+ @click="
|
|
|
+ () => {
|
|
|
+ formRef.resetFields();
|
|
|
+ onFinish();
|
|
|
+ }
|
|
|
+ ">重置
|
|
|
+ </a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ <!-- 操作按钮 -->
|
|
|
+ <a-row class="edit-operation" style="margin-bottom: 20px">
|
|
|
+ <a-col :span="24" class="flex-space-between">
|
|
|
+ <div>
|
|
|
+ <a-radio-group v-model:value="searchType" button-style="solid" @change="searchTypeChange">
|
|
|
+ <a-radio-button value="companyCount">企业入库与走访情况统计</a-radio-button>
|
|
|
+ <a-radio-button value="workSituationCount">企业用工人数与岗位招聘人数统计</a-radio-button>
|
|
|
+ </a-radio-group>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ </div>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <!-- 数据展示 -->
|
|
|
+ <!-- 企业入库与走访情况统计 -->
|
|
|
+ <div v-show="searchType == 'companyCount'">
|
|
|
+ <a-table :columns="companyCountDataTableColumns" :data-source="companyCountDataList"
|
|
|
+ :scroll="{ x:'100%' }"
|
|
|
+ :loading="searchLoading"
|
|
|
+ :pagination="false"
|
|
|
+ bordered>
|
|
|
+ </a-table>
|
|
|
+ </div>
|
|
|
+ <!-- 企业用工人数与岗位招聘人数统计 -->
|
|
|
+ <div v-show="searchType == 'workSituationCount'">
|
|
|
+ <a-table :columns="workSituationCountDataTableColumns" :data-source="workSituationCountDataList"
|
|
|
+ :scroll="{ x:'100%' }"
|
|
|
+ :loading="searchLoading"
|
|
|
+ :pagination="false"
|
|
|
+ bordered>
|
|
|
+ </a-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import {onMounted, reactive, ref} from "vue";
|
|
|
+import type {RangeValue} from "ant-design-vue/es/vc-picker/interface";
|
|
|
+import dayjs from "dayjs";
|
|
|
+import {getSysDictionaryList} from "@/api/system/dictionary";
|
|
|
+import {getRegionCompanyModelCompanyCount, getRegionCompanyWorkSituationCount} from "@/api/statistics";
|
|
|
+
|
|
|
+const searchParams = reactive({
|
|
|
+ startDate: "",
|
|
|
+ endDate: "",
|
|
|
+});
|
|
|
+const reportDate = ref<RangeValue<any>>();
|
|
|
+const searchType = ref("companyCount");
|
|
|
+const formRef = ref();
|
|
|
+const searchLoading = ref(false);
|
|
|
+const companyModelList = ref<Array<any>>();
|
|
|
+// 企业入库与走访情况统计表结构
|
|
|
+const companyCountDataTableColumns = ref<Array<any>>([
|
|
|
+ {
|
|
|
+ title: '区县', dataIndex: 'regionName', key: 'regionName', align: "center", width: 280
|
|
|
+ },
|
|
|
+]);
|
|
|
+const companyCountDataList = ref<Array<any>>([]);
|
|
|
+const companyCountKeyTemp = ref<Array<any>>([]);
|
|
|
+// 企业用工人数与岗位招聘人数统计表结构
|
|
|
+const workSituationCountDataTableColumns = ref<Array<any>>([
|
|
|
+ {
|
|
|
+ title: '区县', dataIndex: 'regionName', key: 'regionName', align: "center", width: 280
|
|
|
+ },
|
|
|
+]);
|
|
|
+const workSituationCountDataList = ref<Array<any>>([]);
|
|
|
+const workSituationCountKeyTemp = ref<Array<any>>([]);
|
|
|
+
|
|
|
+// 时间段变更事件
|
|
|
+const onRangeChange = (dateString: [string, string]) => {
|
|
|
+ searchParams.startDate = dateString != null ? dayjs(dateString[0]).format("YYYY-MM-DD") : "";
|
|
|
+ searchParams.endDate = dateString != null ? dayjs(dateString[1]).format("YYYY-MM-DD") : "";
|
|
|
+ onFinish();
|
|
|
+};
|
|
|
+
|
|
|
+function onFinish() {
|
|
|
+ searchTypeChange();
|
|
|
+}
|
|
|
+
|
|
|
+// 获取企业规模
|
|
|
+function getCompanyModel() {
|
|
|
+ getSysDictionaryList("CompanyModel").then((result: any) => {
|
|
|
+ companyModelList.value = result;
|
|
|
+ // 生成表结构
|
|
|
+ result.forEach((item: any) => {
|
|
|
+ const key = 'companyModel' + item.value;
|
|
|
+ // 企业入库与走访情况统计表结构
|
|
|
+ companyCountKeyTemp.value.push(...[key + 'Count', key + 'SigninCount']);
|
|
|
+ companyCountDataTableColumns.value.push({
|
|
|
+ title: item.name, dataIndex: key, key, align: "center",
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ title: '入库',
|
|
|
+ dataIndex: key + 'Count',
|
|
|
+ key: key + 'Count',
|
|
|
+ align: "center"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '走访',
|
|
|
+ dataIndex: key + 'SigninCount',
|
|
|
+ key: key + 'SigninCount',
|
|
|
+ align: "center"
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ // 企业用工人数与岗位招聘人数统计表结构
|
|
|
+ workSituationCountKeyTemp.value.push(...[key + 'WorkSituationCount', key + 'RecruitCount']);
|
|
|
+ workSituationCountDataTableColumns.value.push({
|
|
|
+ title: item.name, dataIndex: key, key, align: "center",
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ title: '用工人数',
|
|
|
+ dataIndex: key + 'WorkSituationCount',
|
|
|
+ key: key + 'WorkSituationCount',
|
|
|
+ align: "center"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '岗位人数',
|
|
|
+ dataIndex: key + 'RecruitCount',
|
|
|
+ key: key + 'RecruitCount',
|
|
|
+ align: "center"
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ })
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+function searchTypeChange() {
|
|
|
+ if (searchType.value == "companyCount") {
|
|
|
+ searchLoading.value = true;
|
|
|
+ companyCountDataList.value = [];
|
|
|
+ getRegionCompanyModelCompanyCount({...searchParams}).then((result: any) => {
|
|
|
+ // 初始化合计数据
|
|
|
+ let count = {
|
|
|
+ regionCode: -1,
|
|
|
+ regionName: "合计",
|
|
|
+ }
|
|
|
+ // 初始化字段值为O
|
|
|
+ companyCountKeyTemp.value.forEach((key: any) => {
|
|
|
+ count[key] = 0;
|
|
|
+ })
|
|
|
+ result.forEach((resItem: any) => {
|
|
|
+ const key = 'companyModel' + resItem.companyModel;
|
|
|
+ // 查询获取区县数据的下标,保证每个区县只存在一条数据
|
|
|
+ const findIndex = companyCountDataList.value.findIndex((find: any) => find.regionCode == resItem.regionCode);
|
|
|
+ if (findIndex > -1) {
|
|
|
+ // 区县已存在,修改这条数据
|
|
|
+ if (resItem.companyCount > 0) {
|
|
|
+ companyCountDataList.value[findIndex][key + 'Count'] = resItem.companyCount;
|
|
|
+ count[key + 'Count'] += resItem.companyCount;
|
|
|
+ }
|
|
|
+ if (resItem.signinCompanyCount > 0) {
|
|
|
+ companyCountDataList.value[findIndex][key + 'SigninCount'] = resItem.signinCompanyCount;
|
|
|
+ count[key + 'SigninCount'] += resItem.signinCompanyCount;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 不存在,新增一条数据
|
|
|
+ const newData = {
|
|
|
+ regionCode: resItem.regionCode,
|
|
|
+ regionName: resItem.regionName,
|
|
|
+ }
|
|
|
+ companyCountKeyTemp.value.forEach((key: any) => {
|
|
|
+ newData[key] = 0;
|
|
|
+ })
|
|
|
+ if (resItem.companyCount > 0) {
|
|
|
+ newData[key + 'Count'] = resItem.companyCount;
|
|
|
+ count[key + 'Count'] += resItem.companyCount;
|
|
|
+ }
|
|
|
+ if (resItem.signinCompanyCount > 0) {
|
|
|
+ newData[key + 'SigninCount'] = resItem.signinCompanyCount;
|
|
|
+ count[key + 'SigninCount'] += resItem.signinCompanyCount;
|
|
|
+ }
|
|
|
+ companyCountDataList.value.push(newData);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log(count);
|
|
|
+ companyCountDataList.value.push(count);
|
|
|
+ }).finally(() => {
|
|
|
+ searchLoading.value = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (searchType.value == "workSituationCount") {
|
|
|
+ searchLoading.value = true;
|
|
|
+ workSituationCountDataList.value = [];
|
|
|
+ getRegionCompanyWorkSituationCount({...searchParams}).then((result: any) => {
|
|
|
+ // 初始化合计数据
|
|
|
+ let count = {
|
|
|
+ regionCode: -1,
|
|
|
+ regionName: "合计",
|
|
|
+ }
|
|
|
+ // 初始化字段值为O
|
|
|
+ workSituationCountKeyTemp.value.forEach((key: any) => {
|
|
|
+ count[key] = 0;
|
|
|
+ });
|
|
|
+ result.forEach((resItem: any) => {
|
|
|
+ const key = 'companyModel' + resItem.companyModel;
|
|
|
+ // 查询获取区县数据的下标,保证每个区县只存在一条数据
|
|
|
+ const findIndex = workSituationCountDataList.value.findIndex((find: any) => find.regionCode == resItem.regionCode);
|
|
|
+ if (findIndex > -1) {
|
|
|
+ // 区县已存在,修改这条数据
|
|
|
+ if (resItem.workSituationCount > 0) {
|
|
|
+ workSituationCountDataList.value[findIndex][key + 'WorkSituationCount'] = resItem.workSituationCount;
|
|
|
+ count[key + 'WorkSituationCount'] += resItem.workSituationCount;
|
|
|
+ }
|
|
|
+ if (resItem.recruitCount > 0) {
|
|
|
+ workSituationCountDataList.value[findIndex][key + 'RecruitCount'] = resItem.recruitCount;
|
|
|
+ count[key + 'RecruitCount'] += resItem.recruitCount;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 不存在,新增一条数据
|
|
|
+ const newData = {
|
|
|
+ regionCode: resItem.regionCode,
|
|
|
+ regionName: resItem.regionName,
|
|
|
+ }
|
|
|
+ workSituationCountKeyTemp.value.forEach((key: any) => {
|
|
|
+ newData[key] = 0;
|
|
|
+ })
|
|
|
+ if (resItem.workSituationCount > 0) {
|
|
|
+ newData[key + 'WorkSituationCount'] = resItem.workSituationCount;
|
|
|
+ count[key + 'WorkSituationCount'] += resItem.workSituationCount;
|
|
|
+ }
|
|
|
+ if (resItem.recruitCount > 0) {
|
|
|
+ newData[key + 'RecruitCount'] = resItem.recruitCount;
|
|
|
+ count[key + 'RecruitCount'] += resItem.recruitCount;
|
|
|
+ }
|
|
|
+ workSituationCountDataList.value.push(newData);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ workSituationCountDataList.value.push(count);
|
|
|
+ }).finally(() => {
|
|
|
+ searchLoading.value = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getCompanyModel();
|
|
|
+ onFinish();
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|