|
|
@@ -0,0 +1,262 @@
|
|
|
+<script setup lang="ts">
|
|
|
+import { ref, onMounted } from "vue"
|
|
|
+import moment from "moment"
|
|
|
+import Rs from "@/core/services/RequestService"
|
|
|
+import { useRouter } from "vue-router"
|
|
|
+const router = useRouter()
|
|
|
+const ringOptions = {
|
|
|
+ legend: { top: "center", bottom: "auto", right: "20%", orient: "vertical" },
|
|
|
+ pieCenter: ["40%", "50%"],
|
|
|
+ titleText: "",
|
|
|
+}
|
|
|
+const timeType = ref(0)
|
|
|
+const date = ref<[Date, Date]>([new Date(), new Date()])
|
|
|
+const chartDatas = ref<Array<any>>([{}, {}, {}, {}])
|
|
|
+function queryChart(type: number) {
|
|
|
+ let url = ""
|
|
|
+ let data: any = {}
|
|
|
+ switch (type) {
|
|
|
+ case 0:
|
|
|
+ url = "sys/overdueCompany/selectOverdueCountByOrgChart"
|
|
|
+ data = {
|
|
|
+ time_type: timeType.value,
|
|
|
+ query_start_time: moment(date.value[0]).format("YYYYMMDD"),
|
|
|
+ query_end_time: moment(date.value[1]).format("YYYYMMDD"),
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case 1:
|
|
|
+ url = "sys/overdueCompany/selectPurifierCountByOrgChart"
|
|
|
+ break
|
|
|
+ }
|
|
|
+ if (type == 1) {
|
|
|
+ Rs.get(url).then((res) => {
|
|
|
+ chartDatas.value[type] = res.data
|
|
|
+ chartDatas.value[type].chartData.title = ""
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ Rs.post(url, { data: data, successAlert: false }).then((res) => {
|
|
|
+ chartDatas.value[type] = res.data
|
|
|
+ chartDatas.value[type].chartData.title = ""
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const size = ref<any>("default")
|
|
|
+const dySearchSelectStyle = { width: "120px" }
|
|
|
+const companyName = ref("")
|
|
|
+const orgId = ref<string | null>(null)
|
|
|
+//const operateStatus = ref("")
|
|
|
+const type = ref("")
|
|
|
+const cateringScale = ref("")
|
|
|
+const cateringStyle = ref("")
|
|
|
+const queryParams = ref<any>({
|
|
|
+ time_type: timeType.value,
|
|
|
+})
|
|
|
+const cols = ref([
|
|
|
+ {
|
|
|
+ name: "序号",
|
|
|
+ field: "index",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "区域",
|
|
|
+ field: "org_name",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "商户名称",
|
|
|
+ field: "name",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "菜系",
|
|
|
+ field: "catering_style_name",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "规模",
|
|
|
+ field: "catering_scale_name",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "净化器数量",
|
|
|
+ field: "purifier_num",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "操作",
|
|
|
+ width: 150,
|
|
|
+ field: "action",
|
|
|
+ },
|
|
|
+])
|
|
|
+const jump = function (v: any) {
|
|
|
+ console.log("jump", v)
|
|
|
+ router.push({
|
|
|
+ path: "/goLineData/oilFumeConcentration",
|
|
|
+ query: {
|
|
|
+ comName: v.company_name,
|
|
|
+ company_id: v.company_id,
|
|
|
+ backNeed: 1,
|
|
|
+ },
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+function query() {
|
|
|
+ const params = {
|
|
|
+ time_type: timeType.value,
|
|
|
+ org_id: orgId.value,
|
|
|
+ name: companyName.value,
|
|
|
+ //operate_status: operateStatus.value,
|
|
|
+ type: type.value,
|
|
|
+ catering_scale: cateringScale.value,
|
|
|
+ catering_style: cateringStyle.value,
|
|
|
+ query_start_time: moment(date.value[0]).format("YYYYMMDD"),
|
|
|
+ query_end_time: moment(date.value[1]).format("YYYYMMDD"),
|
|
|
+ }
|
|
|
+ // const keys = Object.keys(params)
|
|
|
+ // keys.forEach((key) => {
|
|
|
+ // if (params[key] == "" && key != "clean_flag" && key != "exceed_company_flag") {
|
|
|
+ // delete params[key]
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ queryParams.value = params
|
|
|
+ queryChart(0)
|
|
|
+ queryChart(1)
|
|
|
+}
|
|
|
+function reset() {
|
|
|
+ type.value = ""
|
|
|
+ companyName.value = ""
|
|
|
+ orgId.value = "0"
|
|
|
+ //operateStatus.value = ""
|
|
|
+ type.value = ""
|
|
|
+ cateringScale.value = ""
|
|
|
+ cateringStyle.value = ""
|
|
|
+ timeType.value = 0
|
|
|
+ date.value = [new Date(), new Date()]
|
|
|
+ query()
|
|
|
+}
|
|
|
+function exported() {
|
|
|
+ const params = {
|
|
|
+ name: companyName.value,
|
|
|
+ catering_scale: cateringScale.value,
|
|
|
+ catering_style: cateringStyle.value,
|
|
|
+ type: type.value,
|
|
|
+ org_id: orgId.value,
|
|
|
+ time_type: timeType.value,
|
|
|
+ query_start_time: moment(date.value[0]).format("YYYYMMDD"),
|
|
|
+ query_end_time: moment(date.value[1]).format("YYYYMMDD"),
|
|
|
+ }
|
|
|
+ let str = ""
|
|
|
+ for (const key in params) {
|
|
|
+ str += `${key}=${params[key]}&`
|
|
|
+ }
|
|
|
+ window.open("/api/sys/overdueCompany/export?" + str)
|
|
|
+}
|
|
|
+const detail = function (row: any) {
|
|
|
+ router.push({
|
|
|
+ path: "/purify/washInfo/details",
|
|
|
+ query: { company_id: row.company_id },
|
|
|
+ })
|
|
|
+}
|
|
|
+function init() {
|
|
|
+ queryChart(0)
|
|
|
+ queryChart(1)
|
|
|
+}
|
|
|
+onMounted(init)
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <el-row :gutter="20" class="mb-8">
|
|
|
+ <el-col :span="12">
|
|
|
+ <div class="card card-bordered border-primary h-325px">
|
|
|
+ <div class="card-header bg-light-primary min-h-50px">
|
|
|
+ <div class="card-title">
|
|
|
+ <h3 class="text-primary">逾期商户数量</h3>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="card-body p-2">
|
|
|
+ <BaseChart :data="chartDatas[0]" type="ring" h="100%" :options="ringOptions"></BaseChart>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <div class="card card-bordered border-primary h-325px">
|
|
|
+ <div class="card-header bg-light-primary min-h-50px">
|
|
|
+ <div class="card-title">
|
|
|
+ <h3 class="text-primary">净化器数量</h3>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="card-body p-2">
|
|
|
+ <BaseChart :data="chartDatas[1]" type="ring" h="100%" :options="ringOptions"></BaseChart>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <VbDataTable
|
|
|
+ ref="table"
|
|
|
+ :header="cols"
|
|
|
+ url="sys/overdueCompany/selectForPage"
|
|
|
+ method="post"
|
|
|
+ :query-params="queryParams"
|
|
|
+ :has-checkbox="false"
|
|
|
+ >
|
|
|
+ <template v-slot:table-tool="">
|
|
|
+ <el-form class="align-items-center" :inline="true">
|
|
|
+ <el-form-item class="mb-0 me-5 align-items-center" label="商户名称">
|
|
|
+ <el-input class="" style="width: 180px" v-model="companyName" placeholder="请输入商户名称" :size="size" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="mb-0 me-5 align-items-center" label="区域">
|
|
|
+ <OrgSelectTree v-model:value="orgId" style="width: 180px"></OrgSelectTree>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="mb-0 me-5 align-items-center" label="菜系">
|
|
|
+ <DySelect
|
|
|
+ v-model="cateringStyle"
|
|
|
+ :formatRemoteData="(v:any)=>{return v?.list}"
|
|
|
+ :url="'sys/dict/getList?code=000010001&key=temp'"
|
|
|
+ :style="dySearchSelectStyle"
|
|
|
+ placeholder="请选择菜系"
|
|
|
+ ></DySelect>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="mb-0 me-5 align-items-center" label="规模">
|
|
|
+ <DySelect
|
|
|
+ v-model="cateringScale"
|
|
|
+ :formatRemoteData="(v:any)=>{return v?.list}"
|
|
|
+ :url="'sys/dict/getList?code=000090001&key=temp'"
|
|
|
+ :style="dySearchSelectStyle"
|
|
|
+ placeholder="请选择规模"
|
|
|
+ ></DySelect>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="mb-0 me-5 align-items-center" label="类型">
|
|
|
+ <DySelect
|
|
|
+ v-model="type"
|
|
|
+ :formatRemoteData="(v:any)=>{return v?.list}"
|
|
|
+ :url="'sys/dict/getList?code=000200000&key=temp'"
|
|
|
+ :style="dySearchSelectStyle"
|
|
|
+ placeholder="请选择类型"
|
|
|
+ ></DySelect>
|
|
|
+ </el-form-item>
|
|
|
+ <DateRangeSelect
|
|
|
+ v-model:date-value="date"
|
|
|
+ v-model:select-value="timeType"
|
|
|
+ :select-class="'mb-0 align-items-center'"
|
|
|
+ :date-class="'mb-0 mt-3 align-items-center'"
|
|
|
+ :style="dySearchSelectStyle"
|
|
|
+ :size="size"
|
|
|
+ />
|
|
|
+ <!-- <el-form-item class="mb-0 me-5 align-items-center" label="营业状态">
|
|
|
+ <el-select v-model="operateStatus" style="width: 150px" placeholder="请选择营业状态" :clearable="true">
|
|
|
+ <el-option value="0" label="营业"></el-option>
|
|
|
+ <el-option value="1" label="间休"></el-option>
|
|
|
+ <el-option value="2" label="停业"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item> -->
|
|
|
+ <el-form-item class="mb-0 me-0 align-items-center" :class="timeType == 4 ? `mt-3` : ''">
|
|
|
+ <el-button class="ms-3 mt-0 btn btn-sm btn-primary" @click="query">查询</el-button>
|
|
|
+ <el-button class="ms-3 mt-0 btn btn-sm btn-light-primary btn-outline" @click="reset">重置</el-button>
|
|
|
+ <el-button class="ms-3 mt-0 btn btn-sm btn-light-info btn-outline" @click="exported">导出</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </template>
|
|
|
+ <template #name="{ row }">
|
|
|
+ <span class="text-primary" @click="jump(row)" style="cursor: pointer">{{ row["company_name"] }}</span>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #action="{ row }">
|
|
|
+ <span class="table-action" @click="detail(row)">查看详情</span>
|
|
|
+ </template>
|
|
|
+ </VbDataTable>
|
|
|
+</template>
|