|
@@ -1,104 +1,130 @@
|
|
<template>
|
|
<template>
|
|
- <div class="robotRanking flex-col" v-if="showRobotRankingDiv">
|
|
|
|
- <div class="box1 flex-col">
|
|
|
|
- <s-header :name="$t('robotRanking.machineSalesRanking')" :noback="true" :isFixed="false"></s-header>
|
|
|
|
- <div class="box3 flex-col">
|
|
|
|
- <div class="main1 flex-col">
|
|
|
|
- <div class="mod1 flex-col">
|
|
|
|
- <div class="section1 flex-row justify-between">
|
|
|
|
- <div class="ImageText1 flex-col">
|
|
|
|
- <div class="group4 flex-row justify-between">
|
|
|
|
- <div class="layer3 flex-col"></div>
|
|
|
|
- <span class="word3 flex-col">
|
|
|
|
- {{ $t("robotRanking.machineSalesRanking") }}
|
|
|
|
- </span>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div class="flex-col">
|
|
|
|
- <div @click="noticeClk" class="main5 flex-row justify-between">
|
|
|
|
- <img class="label2" src="@/assets/device/searchIcon.png" />
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <img class="img1" referrerpolicy="no-referrer" src="../assets/line.png" />
|
|
|
|
- <!-- 日销售排行 -->
|
|
|
|
- <div class="l-f l-flex-e o-plr-15">
|
|
|
|
- <span class="robotLabelName l-in c-text-13" style="color: #404d74">{{ $t("robotRanking.dailySalesRanking")
|
|
|
|
- }}:</span>
|
|
|
|
- <kTabs @tabclk="(e) => tabclk(e, 'day')" :tabList="tabDayList"></kTabs>
|
|
|
|
- </div>
|
|
|
|
- <div v-if="!totalNoData('day')" ref="dayChartBox" class="mod3 flex-col"></div>
|
|
|
|
- <kNoData v-else></kNoData>
|
|
|
|
- <div class="groove"></div>
|
|
|
|
- <!-- 周销售排行 -->
|
|
|
|
- <div class="l-f l-flex-e o-plr-15">
|
|
|
|
- <span class="robotLabelName l-in o-mr-6 c-text-13" style="color: #404d74">{{
|
|
|
|
- $t("robotRanking.salesRankingThisWeek") }}:</span>
|
|
|
|
- <kTabs @tabclk="(e) => tabclk(e, 'week')" :tabList="tabWeekList"></kTabs>
|
|
|
|
|
|
+ <div class="robotRanking">
|
|
|
|
+ <div class="sales-rank-view">
|
|
|
|
+ <!-- 头部 -->
|
|
|
|
+ <s-header
|
|
|
|
+ :name="$t('robotRanking.machineSalesRanking')"
|
|
|
|
+ :noback="true"
|
|
|
|
+ class="modern-header"
|
|
|
|
+ />
|
|
|
|
+
|
|
|
|
+ <!-- 主体内容 -->
|
|
|
|
+ <main class="rank-container">
|
|
|
|
+ <!-- 筛选栏 -->
|
|
|
|
+ <div class="filter-card">
|
|
|
|
+ <div class="card-header">
|
|
|
|
+ <h3 class="card-title">
|
|
|
|
+ <span class="title-accent"></span>
|
|
|
|
+ {{ $t("robotRanking.machineSalesRanking") }}
|
|
|
|
+ </h3>
|
|
|
|
+ <van-icon name="filter-o" class="filter-icon" @click="noticeClk" />
|
|
</div>
|
|
</div>
|
|
- <div v-if="!totalNoData('week')" ref="weekChartBox" class="mod5 flex-col"></div>
|
|
|
|
- <kNoData v-else></kNoData>
|
|
|
|
- <div class="groove"></div>
|
|
|
|
- <!-- 月销售排行 -->
|
|
|
|
- <div class="l-f l-flex-e o-plr-15">
|
|
|
|
- <span class="robotLabelName l-in o-mr-6 c-text-13" style="color: #404d74">{{
|
|
|
|
- $t("robotRanking.salesRankingThisMonth") }}:</span>
|
|
|
|
- <kTabs @tabclk="(e) => tabclk(e, 'month')" :tabList="tabMonthList"></kTabs>
|
|
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- 时间维度卡片 -->
|
|
|
|
+ <div
|
|
|
|
+ v-for="(period, index) in timePeriods"
|
|
|
|
+ :key="index"
|
|
|
|
+ class="rank-card"
|
|
|
|
+ >
|
|
|
|
+ <div class="period-header">
|
|
|
|
+ <h3 class="period-title">
|
|
|
|
+ <span class="period-icon"></span>
|
|
|
|
+ {{ $t(`robotRanking.${period.titleKey}`) }}
|
|
|
|
+ </h3>
|
|
|
|
+ <kTabs
|
|
|
|
+ :tabList="period.tabList"
|
|
|
|
+ @tabclk="(e) => tabclk(e, period.type)"
|
|
|
|
+ class="type-tabs"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
- <div v-if="!totalNoData('month')" ref="monthChartBox" class="mod9 flex-col"></div>
|
|
|
|
- <kNoData v-else></kNoData>
|
|
|
|
- <div class="groove"></div>
|
|
|
|
- <!-- 年销售排行 -->
|
|
|
|
- <div class="l-f l-flex-e o-plr-15">
|
|
|
|
- <span class="robotLabelName l-in o-mr-6 c-text-13" style="color: #404d74">{{
|
|
|
|
- $t("robotRanking.salesRankingThisYear") }}:</span>
|
|
|
|
- <kTabs @tabclk="(e) => tabclk(e, 'year')" :tabList="tabYearList"></kTabs>
|
|
|
|
|
|
+
|
|
|
|
+ <div class="chart-wrapper">
|
|
|
|
+ <div
|
|
|
|
+ v-if="!totalNoData(period.type)"
|
|
|
|
+ :ref="(el) => setChartRef(el, period.type)"
|
|
|
|
+ class="chart-box"
|
|
|
|
+ ></div>
|
|
|
|
+ <kNoData v-else class="no-data-tip" />
|
|
</div>
|
|
</div>
|
|
- <div v-if="!totalNoData('year')" ref="yearChartBox" class="mod11 flex-col"></div>
|
|
|
|
- <kNoData v-else></kNoData>
|
|
|
|
- <div class="groove"></div>
|
|
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
|
|
+ </main>
|
|
</div>
|
|
</div>
|
|
<!-- 筛选弹窗 -->
|
|
<!-- 筛选弹窗 -->
|
|
- <kDialog :dialogTitle="$t('orderExport.searchPop.title')" :confirmBtnTxt="$t('orderExport.searchPop.filter')"
|
|
|
|
- ref="kDialogRef" @confirmclk="confirmClk">
|
|
|
|
|
|
+ <kDialog
|
|
|
|
+ :dialogTitle="$t('orderExport.searchPop.title')"
|
|
|
|
+ :confirmBtnTxt="$t('orderExport.searchPop.filter')"
|
|
|
|
+ ref="kDialogRef"
|
|
|
|
+ @confirmclk="confirmClk"
|
|
|
|
+ >
|
|
<template #content>
|
|
<template #content>
|
|
<div class="cust_vantBorder">
|
|
<div class="cust_vantBorder">
|
|
- <van-field @click-input="changeTypeInpClk" readonly clearable v-model="searchForm.changeTypeName"
|
|
|
|
- :placeholder="$t('robotRanking.changeTypePlace')" :label="$t('robotRanking.changeType')">
|
|
|
|
|
|
+ <van-field
|
|
|
|
+ @click-input="changeTypeInpClk"
|
|
|
|
+ readonly
|
|
|
|
+ clearable
|
|
|
|
+ v-model="searchForm.changeTypeName"
|
|
|
|
+ :placeholder="$t('robotRanking.changeTypePlace')"
|
|
|
|
+ :label="$t('robotRanking.changeType')"
|
|
|
|
+ >
|
|
<template #right-icon>
|
|
<template #right-icon>
|
|
<div class="l-flex-RC">
|
|
<div class="l-flex-RC">
|
|
- <van-icon v-if="searchForm.changeTypeName" @click="
|
|
|
|
- searchForm.changeTypeName = '';
|
|
|
|
- searchForm.changeType = '';
|
|
|
|
- " class="o-mr-6" name="clear" />
|
|
|
|
|
|
+ <van-icon
|
|
|
|
+ v-if="searchForm.changeTypeName"
|
|
|
|
+ @click="
|
|
|
|
+ searchForm.changeTypeName = '';
|
|
|
|
+ searchForm.changeType = '';
|
|
|
|
+ "
|
|
|
|
+ class="o-mr-6"
|
|
|
|
+ name="clear"
|
|
|
|
+ />
|
|
<van-icon @click="changeTypeInpClk" name="arrow-down" />
|
|
<van-icon @click="changeTypeInpClk" name="arrow-down" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</van-field>
|
|
</van-field>
|
|
- <van-field @click-input="machineTypeInpClk" readonly clearable v-model="searchForm.machineTypeName"
|
|
|
|
- :placeholder="$t('robotRanking.machineTypePlace')" :label="$t('robotRanking.machineType')">
|
|
|
|
|
|
+ <van-field
|
|
|
|
+ @click-input="machineTypeInpClk"
|
|
|
|
+ readonly
|
|
|
|
+ clearable
|
|
|
|
+ v-model="searchForm.machineTypeName"
|
|
|
|
+ :placeholder="$t('robotRanking.machineTypePlace')"
|
|
|
|
+ :label="$t('robotRanking.machineType')"
|
|
|
|
+ >
|
|
<template #right-icon>
|
|
<template #right-icon>
|
|
<div class="l-flex-RC">
|
|
<div class="l-flex-RC">
|
|
- <van-icon v-if="searchForm.machineTypeName" @click="
|
|
|
|
- searchForm.machineTypeName = '';
|
|
|
|
- searchForm.machineType = '';
|
|
|
|
- " class="o-mr-6" name="clear" />
|
|
|
|
|
|
+ <van-icon
|
|
|
|
+ v-if="searchForm.machineTypeName"
|
|
|
|
+ @click="
|
|
|
|
+ searchForm.machineTypeName = '';
|
|
|
|
+ searchForm.machineType = '';
|
|
|
|
+ "
|
|
|
|
+ class="o-mr-6"
|
|
|
|
+ name="clear"
|
|
|
|
+ />
|
|
<van-icon @click="machineTypeInpClk" name="arrow-down" />
|
|
<van-icon @click="machineTypeInpClk" name="arrow-down" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</van-field>
|
|
</van-field>
|
|
- <van-field v-if="isAdmin()" @click-input="companyTypeInpClk" readonly clearable
|
|
|
|
- v-model="searchForm.companyTypeName" :placeholder="$t('robotRanking.companyTypePlaceholder')"
|
|
|
|
- :label="$t('robotRanking.companyTypeLabel')">
|
|
|
|
|
|
+ <van-field
|
|
|
|
+ v-if="isAdmin()"
|
|
|
|
+ @click-input="companyTypeInpClk"
|
|
|
|
+ readonly
|
|
|
|
+ clearable
|
|
|
|
+ v-model="searchForm.companyTypeName"
|
|
|
|
+ :placeholder="$t('robotRanking.companyTypePlaceholder')"
|
|
|
|
+ :label="$t('robotRanking.companyTypeLabel')"
|
|
|
|
+ >
|
|
<template #right-icon>
|
|
<template #right-icon>
|
|
<div class="l-flex-RC">
|
|
<div class="l-flex-RC">
|
|
- <van-icon v-if="searchForm.companyTypeName" @click="
|
|
|
|
- searchForm.companyTypeName = '';
|
|
|
|
- searchForm.companyType = '';
|
|
|
|
- " class="o-mr-6" name="clear" />
|
|
|
|
|
|
+ <van-icon
|
|
|
|
+ v-if="searchForm.companyTypeName"
|
|
|
|
+ @click="
|
|
|
|
+ searchForm.companyTypeName = '';
|
|
|
|
+ searchForm.companyType = '';
|
|
|
|
+ "
|
|
|
|
+ class="o-mr-6"
|
|
|
|
+ name="clear"
|
|
|
|
+ />
|
|
<van-icon @click="companyTypeInpClk" name="arrow-down" />
|
|
<van-icon @click="companyTypeInpClk" name="arrow-down" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -106,56 +132,88 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</kDialog>
|
|
</kDialog>
|
|
- <!-- 商家选择框 -->
|
|
|
|
- <van-popup v-model:show="busiPopShow" position="bottom">
|
|
|
|
- <van-picker :title="$t('subLedgerManage.search.busiPlaceholder')" :columns="busiPopList"
|
|
|
|
- :columns-field-names="busiPopFieldName" @confirm="busiPopConfirm" @cancel="busiPopShow = false" />
|
|
|
|
- </van-popup>
|
|
|
|
<!-- 统计方式弹窗 -->
|
|
<!-- 统计方式弹窗 -->
|
|
<van-popup v-model:show="changeTypeShow" position="bottom">
|
|
<van-popup v-model:show="changeTypeShow" position="bottom">
|
|
- <van-picker :default-index="chgTypeDefaIdx" :title="$t('robotRanking.changeTypePlace')" :columns="changeTypePopList"
|
|
|
|
- :columns-field-names="yearPopFieldName" @confirm="changeTypePopConfirm" @cancel="changeTypeShow = false" />
|
|
|
|
|
|
+ <van-picker
|
|
|
|
+ :default-index="chgTypeDefaIdx"
|
|
|
|
+ :title="$t('robotRanking.changeTypePlace')"
|
|
|
|
+ :columns="changeTypePopList"
|
|
|
|
+ :columns-field-names="yearPopFieldName"
|
|
|
|
+ @confirm="changeTypePopConfirm"
|
|
|
|
+ @cancel="changeTypeShow = false"
|
|
|
|
+ />
|
|
</van-popup>
|
|
</van-popup>
|
|
<!-- 设备类型弹窗 -->
|
|
<!-- 设备类型弹窗 -->
|
|
<van-popup v-model:show="machineTypeShow" position="bottom">
|
|
<van-popup v-model:show="machineTypeShow" position="bottom">
|
|
- <van-picker :default-index="maTypeDefaIdx" :title="$t('robotRanking.machineTypePlace')"
|
|
|
|
- :columns="machineTypePopList" :columns-field-names="yearPopFieldName" @confirm="machineTypePopConfirm"
|
|
|
|
- @cancel="machineTypeShow = false" />
|
|
|
|
|
|
+ <van-picker
|
|
|
|
+ :default-index="maTypeDefaIdx"
|
|
|
|
+ :title="$t('robotRanking.machineTypePlace')"
|
|
|
|
+ :columns="machineTypePopList"
|
|
|
|
+ :columns-field-names="yearPopFieldName"
|
|
|
|
+ @confirm="machineTypePopConfirm"
|
|
|
|
+ @cancel="machineTypeShow = false"
|
|
|
|
+ />
|
|
</van-popup>
|
|
</van-popup>
|
|
<!-- 公司平台弹窗 -->
|
|
<!-- 公司平台弹窗 -->
|
|
<van-popup v-model:show="companyTypeShow" position="bottom">
|
|
<van-popup v-model:show="companyTypeShow" position="bottom">
|
|
- <van-picker :default-index="maTypeDefaIdx" :title="$t('robotRanking.companyTypePlaceholder')"
|
|
|
|
- :columns="companyTypePopList" :columns-field-names="yearPopFieldName" @confirm="companyTypePopConfirm"
|
|
|
|
- @cancel="companyTypeShow = false" />
|
|
|
|
|
|
+ <van-picker
|
|
|
|
+ :default-index="maTypeDefaIdx"
|
|
|
|
+ :title="$t('robotRanking.companyTypePlaceholder')"
|
|
|
|
+ :columns="companyTypePopList"
|
|
|
|
+ :columns-field-names="yearPopFieldName"
|
|
|
|
+ @confirm="companyTypePopConfirm"
|
|
|
|
+ @cancel="companyTypeShow = false"
|
|
|
|
+ />
|
|
</van-popup>
|
|
</van-popup>
|
|
<!-- 日的日期选择弹窗 -->
|
|
<!-- 日的日期选择弹窗 -->
|
|
- <van-calendar @confirm="calendarDayConfirm" v-model:show="dayShow" color="#4d6add" :min-date="minDate" :max-date="maxDate"
|
|
|
|
- :show-confirm="false" />
|
|
|
|
|
|
+ <van-calendar
|
|
|
|
+ @confirm="calendarDayConfirm"
|
|
|
|
+ v-model:show="dayShow"
|
|
|
|
+ color="#4d6add"
|
|
|
|
+ :min-date="minDate"
|
|
|
|
+ :max-date="maxDate"
|
|
|
|
+ :show-confirm="false"
|
|
|
|
+ />
|
|
<!-- 周的日期选择弹窗 -->
|
|
<!-- 周的日期选择弹窗 -->
|
|
- <van-calendar @confirm="(e) => {
|
|
|
|
- calendarWeekOrMonConfirm(e, 1);
|
|
|
|
- }
|
|
|
|
- " v-model:show="weekShow" :allow-same-day="true" color="#4d6add" :min-date="minDate" :max-date="maxDate" type="range" :max-range="7" />
|
|
|
|
|
|
+ <van-calendar
|
|
|
|
+ @confirm="
|
|
|
|
+ (e) => {
|
|
|
|
+ calendarWeekOrMonConfirm(e, 1);
|
|
|
|
+ }
|
|
|
|
+ "
|
|
|
|
+ v-model:show="weekShow"
|
|
|
|
+ :allow-same-day="true"
|
|
|
|
+ color="#4d6add"
|
|
|
|
+ :min-date="minDate"
|
|
|
|
+ :max-date="maxDate"
|
|
|
|
+ type="range"
|
|
|
|
+ :max-range="7"
|
|
|
|
+ />
|
|
<!-- 月的日期选择弹窗 -->
|
|
<!-- 月的日期选择弹窗 -->
|
|
- <van-calendar @confirm="(e) => {
|
|
|
|
- calendarWeekOrMonConfirm(e, 2);
|
|
|
|
- }
|
|
|
|
- " v-model:show="monthShow" :allow-same-day="true" color="#4d6add" :min-date="minDate" :max-date="maxDate" type="range" :max-range="31" />
|
|
|
|
|
|
+ <van-calendar
|
|
|
|
+ @confirm="
|
|
|
|
+ (e) => {
|
|
|
|
+ calendarWeekOrMonConfirm(e, 2);
|
|
|
|
+ }
|
|
|
|
+ "
|
|
|
|
+ v-model:show="monthShow"
|
|
|
|
+ :allow-same-day="true"
|
|
|
|
+ color="#4d6add"
|
|
|
|
+ :min-date="minDate"
|
|
|
|
+ :max-date="maxDate"
|
|
|
|
+ type="range"
|
|
|
|
+ :max-range="31"
|
|
|
|
+ />
|
|
<!-- 年的日期选择弹窗 -->
|
|
<!-- 年的日期选择弹窗 -->
|
|
<van-popup v-model:show="yearShow" position="bottom">
|
|
<van-popup v-model:show="yearShow" position="bottom">
|
|
- <van-picker :title="$t('robotRanking.yearPopTitle')" :columns="yearPopList" :columns-field-names="yearPopFieldName"
|
|
|
|
- @confirm="yearPopConfirm" @cancel="yearShow = false" />
|
|
|
|
|
|
+ <van-picker
|
|
|
|
+ :title="$t('robotRanking.yearPopTitle')"
|
|
|
|
+ :columns="yearPopList"
|
|
|
|
+ :columns-field-names="yearPopFieldName"
|
|
|
|
+ @confirm="yearPopConfirm"
|
|
|
|
+ @cancel="yearShow = false"
|
|
|
|
+ />
|
|
</van-popup>
|
|
</van-popup>
|
|
- <!-- <nav-bar></nav-bar> -->
|
|
|
|
- </div>
|
|
|
|
- <div v-else class="noPermission" style="justify-content: center;">
|
|
|
|
- <div class="box1 flex-col" style="text-align: center;">
|
|
|
|
- <s-header :name="$t('robotRanking.machineSalesRanking')" :noback="true" :isFixed="false"></s-header>
|
|
|
|
- <view>
|
|
|
|
- <br />
|
|
|
|
- </view>
|
|
|
|
- <view>{{ $t('robotRanking.noPermission') }}</view>
|
|
|
|
- </div>
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -166,7 +224,7 @@ import { onMounted, ref, reactive, computed, nextTick } from "vue";
|
|
import sHeader from "../components/SimpleHeader";
|
|
import sHeader from "../components/SimpleHeader";
|
|
// import navBar from "../components/NavBar";
|
|
// import navBar from "../components/NavBar";
|
|
import { getRankingList } from "../service/robotRanking";
|
|
import { getRankingList } from "../service/robotRanking";
|
|
-import { getLoginUser, styleUrl } from "../common/js/utils";
|
|
|
|
|
|
+import { getLoginUser } from "../common/js/utils";
|
|
import kTabs from "../components/commom/kTabs/index.vue";
|
|
import kTabs from "../components/commom/kTabs/index.vue";
|
|
import kDialog from "../components/commom/kDialog/index.vue";
|
|
import kDialog from "../components/commom/kDialog/index.vue";
|
|
import moment from "moment";
|
|
import moment from "moment";
|
|
@@ -210,7 +268,9 @@ export default {
|
|
changeTypeShow.value = true;
|
|
changeTypeShow.value = true;
|
|
};
|
|
};
|
|
// 是否管理员
|
|
// 是否管理员
|
|
- const isAdmin = () => { return (user && user.type === 0); }
|
|
|
|
|
|
+ const isAdmin = () => {
|
|
|
|
+ return user && user.type === 0;
|
|
|
|
+ };
|
|
// 公司平台弹窗
|
|
// 公司平台弹窗
|
|
const companyTypeInpClk = () => {
|
|
const companyTypeInpClk = () => {
|
|
companyTypeShow.value = true;
|
|
companyTypeShow.value = true;
|
|
@@ -416,6 +476,29 @@ export default {
|
|
id: 3,
|
|
id: 3,
|
|
},
|
|
},
|
|
]);
|
|
]);
|
|
|
|
+
|
|
|
|
+ const timePeriods = ref([
|
|
|
|
+ {
|
|
|
|
+ type: "day",
|
|
|
|
+ titleKey: "dailySalesRanking",
|
|
|
|
+ tabList: tabDayList.value,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: "week",
|
|
|
|
+ titleKey: "salesRankingThisWeek",
|
|
|
|
+ tabList: tabWeekList.value,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: "month",
|
|
|
|
+ titleKey: "salesRankingThisMonth",
|
|
|
|
+ tabList: tabMonthList.value,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: "year",
|
|
|
|
+ titleKey: "salesRankingThisYear",
|
|
|
|
+ tabList: tabYearList.value,
|
|
|
|
+ },
|
|
|
|
+ ]);
|
|
// 默认进来的时间
|
|
// 默认进来的时间
|
|
const defaultTime = reactive({
|
|
const defaultTime = reactive({
|
|
// 今日
|
|
// 今日
|
|
@@ -434,17 +517,18 @@ export default {
|
|
weekStart: moment().weekday(1).format("YYYY-MM-DD") + " 00:00:00",
|
|
weekStart: moment().weekday(1).format("YYYY-MM-DD") + " 00:00:00",
|
|
weekEnd: moment().weekday(7).format("YYYY-MM-DD") + " 23:59:59",
|
|
weekEnd: moment().weekday(7).format("YYYY-MM-DD") + " 23:59:59",
|
|
// 上周
|
|
// 上周
|
|
- lastWeekStart: moment().week(moment().week() - 1).startOf('week').add(1, 'days').format("YYYY-MM-DD") + " 00:00:00",
|
|
|
|
- // moment()
|
|
|
|
- // .week(moment().week() - 1)
|
|
|
|
- // .startOf("week")
|
|
|
|
- // .format("YYYY-MM-DD") + " 00:00:00",
|
|
|
|
-
|
|
|
|
- lastWeekEnd: moment().week(moment().week() - 1).endOf('week').add(1, 'days').format("YYYY-MM-DD") + " 23:59:59",
|
|
|
|
- // moment()
|
|
|
|
- // .week(moment().week() - 1)
|
|
|
|
- // .endOf("week")
|
|
|
|
- // .format("YYYY-MM-DD") + " 23:59:59",
|
|
|
|
|
|
+ lastWeekStart:
|
|
|
|
+ moment()
|
|
|
|
+ .week(moment().week() - 1)
|
|
|
|
+ .startOf("week")
|
|
|
|
+ .add(1, "days")
|
|
|
|
+ .format("YYYY-MM-DD") + " 00:00:00",
|
|
|
|
+ lastWeekEnd:
|
|
|
|
+ moment()
|
|
|
|
+ .week(moment().week() - 1)
|
|
|
|
+ .endOf("week")
|
|
|
|
+ .add(1, "days")
|
|
|
|
+ .format("YYYY-MM-DD") + " 23:59:59",
|
|
|
|
|
|
// 这个月
|
|
// 这个月
|
|
monthStart: moment().startOf("month").format("YYYY-MM-DD") + " 00:00:00",
|
|
monthStart: moment().startOf("month").format("YYYY-MM-DD") + " 00:00:00",
|
|
@@ -598,9 +682,9 @@ export default {
|
|
type: "shadow",
|
|
type: "shadow",
|
|
},
|
|
},
|
|
borderWidth: 1,
|
|
borderWidth: 1,
|
|
- textStyle:{
|
|
|
|
- fontSize : 12
|
|
|
|
- }
|
|
|
|
|
|
+ textStyle: {
|
|
|
|
+ fontSize: 12,
|
|
|
|
+ },
|
|
},
|
|
},
|
|
// 固定屏幕显示多少个,其余的滑动
|
|
// 固定屏幕显示多少个,其余的滑动
|
|
dataZoom: [
|
|
dataZoom: [
|
|
@@ -688,10 +772,8 @@ export default {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
];
|
|
];
|
|
- dayChartOption.dataZoom[0]["startValue"] =
|
|
|
|
- data.data.categories[0];
|
|
|
|
- dayChartOption.dataZoom[0]["endValue"] =
|
|
|
|
- data.data.categories[3];
|
|
|
|
|
|
+ dayChartOption.dataZoom[0]["startValue"] = data.data.categories[0];
|
|
|
|
+ dayChartOption.dataZoom[0]["endValue"] = data.data.categories[3];
|
|
// 解决resize不起作用,配合onMounted里的方法使用
|
|
// 解决resize不起作用,配合onMounted里的方法使用
|
|
switch (chartType) {
|
|
switch (chartType) {
|
|
case "day":
|
|
case "day":
|
|
@@ -728,9 +810,6 @@ export default {
|
|
});
|
|
});
|
|
};
|
|
};
|
|
const user = getLoginUser();
|
|
const user = getLoginUser();
|
|
- // 默认能看到机器排行
|
|
|
|
- const showRobotRankingDiv = ref(true);
|
|
|
|
- const isM11Included = user.menuCodeList.some((item) => item === "M11");
|
|
|
|
|
|
|
|
// 日、周、月、年的图表
|
|
// 日、周、月、年的图表
|
|
const dayChartBox = ref();
|
|
const dayChartBox = ref();
|
|
@@ -739,28 +818,12 @@ export default {
|
|
const yearChartBox = ref();
|
|
const yearChartBox = ref();
|
|
// 初始化页面获取列表
|
|
// 初始化页面获取列表
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
- // 加载样式
|
|
|
|
- styleUrl('robotRanking');
|
|
|
|
// 默认筛选选中
|
|
// 默认筛选选中
|
|
searchForm.changeTypeName = t("robotRanking.salesStatistics");
|
|
searchForm.changeTypeName = t("robotRanking.salesStatistics");
|
|
searchForm.changeType = 0;
|
|
searchForm.changeType = 0;
|
|
searchForm.companyTypeName = t("robotRanking.whole");
|
|
searchForm.companyTypeName = t("robotRanking.whole");
|
|
searchForm.machineTypeName = t("robotRanking.whole");
|
|
searchForm.machineTypeName = t("robotRanking.whole");
|
|
- // 查询是否有订单数据权限
|
|
|
|
- // const isOrderData = user.menuCodeList.some((item) => {
|
|
|
|
- // return item === "M4";
|
|
|
|
- // })
|
|
|
|
- // 子商家type=3和公司人员type=1,默认看不到
|
|
|
|
- if ((user.type > 2 || user.type === 1) && !isM11Included) {
|
|
|
|
- showRobotRankingDiv.value = false;
|
|
|
|
- }
|
|
|
|
- // 如果是type为admin或者商家或者是有订单数据权限M4的子商家才可以查看
|
|
|
|
- // if (user.type === 0 || user.type === 2 || isOrderData) {
|
|
|
|
- // init();
|
|
|
|
- // }
|
|
|
|
- if (user.type === 0 || user.type === 2 || isM11Included) {
|
|
|
|
- init();
|
|
|
|
- }
|
|
|
|
|
|
+ init();
|
|
|
|
|
|
window.addEventListener("resize", () => {
|
|
window.addEventListener("resize", () => {
|
|
chartObj.day && chartObj.day.resize();
|
|
chartObj.day && chartObj.day.resize();
|
|
@@ -787,7 +850,7 @@ export default {
|
|
machineTypeName: "",
|
|
machineTypeName: "",
|
|
machineType: "",
|
|
machineType: "",
|
|
companyTypeName: "",
|
|
companyTypeName: "",
|
|
- companyType: ""
|
|
|
|
|
|
+ companyType: "",
|
|
});
|
|
});
|
|
const kDialogRef = ref(null);
|
|
const kDialogRef = ref(null);
|
|
const busiPopShow = ref(false);
|
|
const busiPopShow = ref(false);
|
|
@@ -832,6 +895,25 @@ export default {
|
|
const busiPopCancel = () => {
|
|
const busiPopCancel = () => {
|
|
busiPopShow.value = false;
|
|
busiPopShow.value = false;
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+ const setChartRef = (el, type) => {
|
|
|
|
+ if (el) {
|
|
|
|
+ switch (type) {
|
|
|
|
+ case "day":
|
|
|
|
+ dayChartBox.value = el;
|
|
|
|
+ break;
|
|
|
|
+ case "week":
|
|
|
|
+ weekChartBox.value = el;
|
|
|
|
+ break;
|
|
|
|
+ case "month":
|
|
|
|
+ monthChartBox.value = el;
|
|
|
|
+ break;
|
|
|
|
+ case "year":
|
|
|
|
+ yearChartBox.value = el;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ };
|
|
return {
|
|
return {
|
|
dayChartBox,
|
|
dayChartBox,
|
|
weekChartBox,
|
|
weekChartBox,
|
|
@@ -884,8 +966,8 @@ export default {
|
|
maTypeDefaIdx,
|
|
maTypeDefaIdx,
|
|
chgTypeDefaIdx,
|
|
chgTypeDefaIdx,
|
|
isAdmin,
|
|
isAdmin,
|
|
-
|
|
|
|
- showRobotRankingDiv,
|
|
|
|
|
|
+ timePeriods,
|
|
|
|
+ setChartRef,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
components: { sHeader, kTabs, kDialog, kNoData },
|
|
components: { sHeader, kTabs, kDialog, kNoData },
|
|
@@ -893,5 +975,160 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
-@import "../styles/robotRanking/index";
|
|
|
|
|
|
+@primary-color: #4d6add;
|
|
|
|
+@text-primary: #2d3542;
|
|
|
|
+@text-secondary: #64748b;
|
|
|
|
+@border-color: #e4e7ec;
|
|
|
|
+@card-bg: #ffffff;
|
|
|
|
+
|
|
|
|
+.sales-rank-view {
|
|
|
|
+ background: #f8f9fb;
|
|
|
|
+ height: calc(100% - 50px);
|
|
|
|
+ overflow: auto;
|
|
|
|
+ overflow-x: hidden;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.modern-header {
|
|
|
|
+ box-shadow: 0 2px 12px rgba(@primary-color, 0.1);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.rank-container {
|
|
|
|
+ padding: 0 10px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.filter-card {
|
|
|
|
+ background: @card-bg;
|
|
|
|
+ border-radius: 12px;
|
|
|
|
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ margin: 10px 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.card-header {
|
|
|
|
+ padding: 16px 24px;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.card-title {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ margin: 0;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ color: @text-primary;
|
|
|
|
+ font-weight: 600;
|
|
|
|
+
|
|
|
|
+ .title-accent {
|
|
|
|
+ width: 4px;
|
|
|
|
+ height: 18px;
|
|
|
|
+ background: @primary-color;
|
|
|
|
+ border-radius: 2px;
|
|
|
|
+ margin-right: 12px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.filter-icon {
|
|
|
|
+ font-size: 22px;
|
|
|
|
+ color: @text-primary;
|
|
|
|
+ transition: all 0.3s ease;
|
|
|
|
+ padding: 8px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+
|
|
|
|
+ &:hover {
|
|
|
|
+ color: @primary-color;
|
|
|
|
+ transform: rotate(90deg) scale(1.1);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ &:active {
|
|
|
|
+ transform: rotate(90deg) scale(0.9);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+@media (max-width: 768px) {
|
|
|
|
+ .card-header {
|
|
|
|
+ padding: 12px 16px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .filter-icon {
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ padding: 6px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.rank-card {
|
|
|
|
+ background: white;
|
|
|
|
+ border-radius: 12px;
|
|
|
|
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+ height: 400px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+
|
|
|
|
+ .period-header {
|
|
|
|
+ padding: 16px;
|
|
|
|
+
|
|
|
|
+ .period-title {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ margin: 0 0 12px;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ color: @text-primary;
|
|
|
|
+
|
|
|
|
+ .period-icon {
|
|
|
|
+ width: 6px;
|
|
|
|
+ height: 6px;
|
|
|
|
+ background: @primary-color;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ margin-right: 10px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .type-tabs {
|
|
|
|
+ width: 100% !important;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .chart-wrapper {
|
|
|
|
+ padding: 0 16px 16px;
|
|
|
|
+ height: 400px;
|
|
|
|
+
|
|
|
|
+ .chart-box {
|
|
|
|
+ height: 300px;
|
|
|
|
+ width: 100%;
|
|
|
|
+ border-radius: 8px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .no-data-tip {
|
|
|
|
+ height: 300px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/* 响应式设计 */
|
|
|
|
+@media (max-width: 768px) {
|
|
|
|
+ .rank-container {
|
|
|
|
+ padding: 0 10px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .rank-card {
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+
|
|
|
|
+ .chart-wrapper {
|
|
|
|
+ height: 250px;
|
|
|
|
+ padding: 0 12px 12px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .filter-container {
|
|
|
|
+ .rank-title {
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .filter-btn {
|
|
|
|
+ padding: 6px 16px;
|
|
|
|
+ font-size: 13px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|