123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071 |
- <template>
- <div class="app-container">
- <div v-if="showOld == 1">
- <div style="margin-bottom: 15px">
- <el-date-picker
- v-model="uploadDate"
- style="width: 240px"
- value-format="yyyy-MM-dd"
- format="yyyy-MM-dd"
- type="daterange"
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :picker-options="pickerOptions"
- ></el-date-picker>
- <el-button
- type="primary"
- icon="el-icon-search"
- size="mini"
- @click="handleQuery"
- style="margin-left: 15px"
- >搜索
- </el-button
- >
- </div>
- <el-row class="top-sum" :gutter="24">
- <el-col :span="12">
- <el-card shadow="never" class="card-show" v-loading="totalOneLoading">
- <div style="display: flex; width: 100%; margin-bottom: 15px">
- <div style="flex: 1">
- <p class="p-title">订单总数</p>
- <p class="p-main">{{ order.orderNum }}</p>
- </div>
- <div style="flex: 1">
- <p class="p-title">有效订单数</p>
- <p class="p-main">{{ order.validOrderNUm }}</p>
- </div>
- <div style="flex: 1">
- <p class="p-title">失效订单数</p>
- <p class="p-main">{{ order.invalidOrderNUm }}</p>
- </div>
- </div>
- <div style="display: flex; width: 100%">
- <div style="margin-right: 20px">
- <p class="p-main-data">
- 数据对比:<i
- :style="ratioData.orderTotalRatio > 0 ? 'color:red' : 'color:green'"
- >{{ (ratioData.orderTotalRatio * 100).toFixed(2) + "%" }}</i
- >
- </p>
- </div>
- <div
- style="margin-right: 20px"
- :style="dateType == 0 ? '' : 'visibility: hidden'"
- >
- <p class="p-main-data">
- 周同比:<i :style="order.yearRatio > 0 ? 'color:red' : 'color:green'">{{
- (order.yearRatio * 100).toFixed(2) + "%"
- }}</i>
- </p>
- </div>
- <div :style="dateType == 0 ? '' : 'visibility: hidden'">
- <p class="p-main-data">
- 日环比:<i :style="order.ringRatio > 0 ? 'color:red' : 'color:green'"
- >{{ (order.ringRatio * 100).toFixed(2) + "%" }}
- </i>
- </p>
- </div>
- </div>
- <!-- ringRatio: 0, -->
- </el-card>
- </el-col>
- <el-col :span="12">
- <el-card shadow="never" class="card-show" v-loading="totalTwoLoading">
- <div style="display: flex; width: 100%; margin-bottom: 15px">
- <div style="flex: 1">
- <p class="p-title">订单金额</p>
- <p class="p-main">
- {{ priceFormat(regimentalPromotion.regimentalPromotionAmount) }}
- </p>
- </div>
- <div style="flex: 1">
- <p class="p-title">累计货款基数</p>
- <p class="p-main">
- {{ priceFormat(regimentalPromotion.personData) }}
- </p>
- </div>
- <div style="flex: 1">
- <p class="p-title">预估服务费</p>
- <p class="p-main">
- {{ priceFormat(regimentalPromotion.complete) }}
- </p>
- </div>
- </div>
- <div style="display: flex; width: 100%">
- <div style="margin-right: 20px">
- <p class="p-main-data">
- 数据对比:<i
- :style="ratioData.orderAmountRatio > 0 ? 'color:red' : 'color:green'"
- >{{ (ratioData.orderAmountRatio * 100).toFixed(2) + "%" }}</i
- >
- </p>
- </div>
- <div
- style="margin-right: 20px"
- :style="dateType == 0 ? '' : 'visibility: hidden'"
- >
- <p class="p-main-data">
- 周同比:
- <i
- :style="
- regimentalPromotion.yearRatio > 0 ? 'color:red' : 'color:green'
- "
- >{{ (regimentalPromotion.yearRatio * 100).toFixed(2) + "%" }}
- </i>
- </p>
- </div>
- <div :style="dateType == 0 ? '' : 'visibility: hidden'">
- <p class="p-main-data">
- 日环比:<i
- :style="
- regimentalPromotion.ringRatio > 0 ? 'color:red' : 'color:green'
- "
- >{{ (regimentalPromotion.ringRatio * 100).toFixed(2) + "%" }}</i
- >
- </p>
- </div>
- </div>
- <!-- ringRatio: 0, -->
- </el-card>
- </el-col>
- <el-col :span="12" style="margin-top: 24px">
- <el-card shadow="never" class="card-show" v-loading="totalThreeLoading">
- <div style="display: flex; width: 100%; margin-bottom: 15px">
- <div style="flex: 1">
- <p class="p-title">达人总数</p>
- <p class="p-main">{{ taskNumber.noStarted }}</p>
- </div>
- <div style="flex: 1">
- <p class="p-title">发货数</p>
- <p class="p-main">{{ taskNumber.complete }}</p>
- </div>
- <div style="flex: 1">
- <p class="p-title">发货率</p>
- <p class="p-main">
- {{
- !!taskNumber.deliveryRadio
- ? (taskNumber.deliveryRadio * 100).toFixed(2) + "%"
- : "-"
- }}
- </p>
- </div>
- </div>
- <div style="display: flex; width: 100%; visibility: hidden">
- <div style="margin-right: 20px">
- <p class="p-main-data">周同比:{{ order.yearRatio }}</p>
- </div>
- <div>
- <p class="p-main-data">日环比:{{ order.ringRatio }}</p>
- </div>
- </div>
- <!-- ringRatio: 0, -->
- </el-card>
- </el-col>
- </el-row>
- <el-row class="top-sum" :gutter="24" style="margin-top: 24px">
- <el-col :span="24">
- <el-card
- shadow="never"
- class="card-show"
- style="width: 100%; min-height: 700px"
- v-loading="echartsLoading"
- >
- <div slot="header" class="clearfix">
- <span style="font-size: 16px; font-weight: bold; float: left"
- >订单统计</span
- >
- <el-select
- v-model="echartsType"
- placeholder="请选择类型"
- clearable
- style="width: 240px; float: right; padding: 3px 0"
- @change="changeEchartsType"
- >
- <el-option label="订单数" value="orderNum"/>
- <el-option label="有效订单数" value="validOrderNum"/>
- <el-option label="订单金额" value="orderAmount"/>
- <el-option label="货款基数" value="baseAmount"/>
- <el-option label="发货数" value="deliveryNum"/>
- </el-select>
- </div>
- <!-- <el-date-picker
- v-model="uploadDateEcharts"
- style="width: 240px; float: left"
- value-format="yyyy-MM-dd"
- format="yyyy-MM-dd"
- type="daterange"
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :picker-options="pickerOptions"
- @change="getAllEchartsData"
- ></el-date-picker> -->
- <div
- id="echart"
- ref="echart"
- style="height: 500px; width: 100%; margin-top: 50px"
- ></div>
- </el-card>
- </el-col>
- </el-row>
- <el-row class="top-sum" :gutter="24" style="margin-top: 24px">
- <el-col :span="12">
- <el-card
- shadow="never"
- class="card-show"
- style="width: 100%; min-height: 700px"
- >
- <div slot="header" class="clearfix">
- <span style="font-size: 16px; font-weight: bold; float: left"
- >商品排行榜</span
- >
- <el-button
- style="float: right; padding: 3px 0"
- type="text"
- @click="toOrderList"
- >更多>>
- </el-button
- >
- </div>
- <el-table v-loading="orderRankLoading" :data="orderRankList">
- <!-- <el-table-column type="selection" width="55" align="center" /> -->
- <el-table-column type="index" :index="indexMethod"></el-table-column>
- <el-table-column label="商品名称" align="center" prop="itemTitle">
- <template slot-scope="scope">
- <a
- :title="scope.row.itemTitle"
- @click="toOrderDetail(scope.row)"
- style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden"
- >
- {{ scope.row.itemTitle }}
- </a>
- </template>
- </el-table-column>
- <el-table-column label="订单数" align="center" prop="orderNum">
- </el-table-column>
- <el-table-column label="有效订单" align="center" prop="validOrderNUm">
- </el-table-column>
- <el-table-column label="有效率" align="center" prop="validRadio">
- <template slot-scope="scope">
- {{
- scope.row.validRadio
- ? (scope.row.validRadio * 100).toFixed(2) + "%"
- : "-"
- }}
- </template>
- </el-table-column>
- <el-table-column label="发货数" align="center" prop="deliveryNum">
- </el-table-column>
- <el-table-column label="发货率" align="center" prop="deliveryRadio">
- <template slot-scope="scope">
- {{
- scope.row.deliveryRadio
- ? (scope.row.deliveryRadio * 100).toFixed(2) + "%"
- : "-"
- }}
- </template>
- </el-table-column>
- <el-table-column label="日涨幅" align="center" prop="radio">
- <template slot-scope="scope">
- <i :style="scope.row.radio > 0 ? 'color:red' : 'color:green'">{{
- scope.row.radio ? (scope.row.radio * 100).toFixed(2) + "%" : "-"
- }}</i>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="orderTotal > 0"
- :total="orderTotal"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getIndexOrderRank"
- layout="total, prev, pager, next, jumper"
- :small="true"
- />
- </el-card>
- </el-col>
- <el-col :span="12">
- <el-card
- shadow="never"
- class="card-show"
- style="width: 100%; min-height: 700px"
- >
- <div slot="header" class="clearfix">
- <span style="font-size: 16px; font-weight: bold; float: left"
- >达人排行榜</span
- >
- <el-button
- style="float: right; padding: 3px 0"
- type="text"
- @click="toPersonList"
- >更多>>
- </el-button
- >
- </div>
- <el-table v-loading="promoterLoading" :data="promoterRankList">
- <!-- <el-table-column type="selection" width="55" align="center" /> -->
- <el-table-column type="index" :index="indexMethodTwo" width="70">
- </el-table-column>
- <el-table-column label="达人名称" align="center" prop="promoterNickName">
- <template slot-scope="scope">
- <a
- :title="scope.row.promoterNickName"
- @click="toPersonDetail(scope.row)"
- style="
- width: 200px;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- text-align: left;
- "
- >
- {{ scope.row.promoterNickName }}
- </a>
- </template>
- </el-table-column>
- <el-table-column label="订单数" align="center" prop="orderNum">
- </el-table-column>
- <el-table-column label="有效订单" align="center" prop="validOrderNUm">
- </el-table-column>
- <el-table-column label="有效率" align="center" prop="validRadio">
- <template slot-scope="scope">
- {{
- scope.row.validRadio
- ? (scope.row.validRadio * 100).toFixed(2) + "%"
- : "-"
- }}
- </template>
- </el-table-column>
- <el-table-column label="日涨幅" align="center" prop="radio">
- <template slot-scope="scope">
- <i :style="scope.row.radio > 0 ? 'color:red' : 'color:green'">{{
- scope.row.radio ? (scope.row.radio * 100).toFixed(2) + "%" : "-"
- }}</i>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="promoterTotal > 0"
- :total="promoterTotal"
- :page.sync="queryParams.promoterPageNum"
- :limit.sync="queryParams.pageSize"
- layout="total, prev, pager, next, jumper"
- @pagination="getIndexPromoterRank"
- :small="true"
- />
- </el-card>
- </el-col>
- </el-row>
- </div>
- <staging v-else-if="showOld == 2"/>
- <operationHome v-else-if="showOld == 3"/>
- <jiaoyang v-else-if="showOld == 4"/>
- </div>
- </template>
- <script>
- import {
- getIndexOrderInfo, //获取订单数据
- getIndexServiceAmountInfo, //获取服务费数据
- getIndexAmountInfo, //获取金额数据
- getIndexPromoterRank, //获取达人排行
- getIndexOrderRank, //获取商品排行
- getIndexStatistics, //echarts图表
- getTimeRatio, //时间段对比
- } from "@/api/index";
- import staging from "./staging.vue";
- import jiaoyang from "./jiaoyang/jyHome.vue";
- import operationHome from "./report/operationHome.vue";
- var echarts = require("echarts");
- export default {
- name: "Index",
- components: {
- staging,
- operationHome,
- jiaoyang
- },
- data() {
- return {
- showOld: 1,
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 字典表格数据
- typeList: [],
- // 弹出层标题
- title: "",
- // 是否显示弹出层
- open: false,
- // 分配销售
- openAllocation: false,
- // 选择的销售id
- saleId: undefined,
- // 销售列表
- saleList: [],
- // 分配销售确定loading
- confirmLoadingSale: false,
- // 汇总数据获取
- taskNumber: {
- complete: 0,
- deliveryRadio: 0,
- noStarted: 0,
- },
- order: {
- orderNum: 0,
- validOrderNUm: 0,
- invalidOrderNUm: 0,
- ringRatio: 0,
- yearRatio: 0,
- },
- regimentalPromotion: {
- regimentalPromotionAmount: 0,
- personData: 0,
- complete: 0,
- ringRatio: 0,
- yearRatio: 0,
- },
- ratioData: {
- orderAmountRatio: 0,
- orderTotalRatio: 0,
- },
- userId: undefined,
- dateType: 0,
- uploadDate: [new Date(), new Date()],
- uploadDateEcharts: [new Date(), new Date()],
- orderRankList: [],
- orderRankLoading: false,
- orderTotal: 0,
- queryParams: {pageNum: 1, pageSize: 10, promoterPageNum: 1},
- promoterRankList: [],
- promoterLoading: false,
- promoterTotal: 0,
- totalOneLoading: false,
- totalTwoLoading: false,
- totalThreeLoading: false,
- echartsType: "orderNum",
- echartsLoading: false,
- pickerOptions: {
- shortcuts: [
- {
- text: "今天",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- picker.$emit("pick", [start, end]);
- },
- },
- {
- text: "昨天",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
- end.setTime(end.getTime() - 3600 * 1000 * 24 * 1);
- picker.$emit("pick", [start, end]);
- },
- },
- {
- text: "最近三天",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
- picker.$emit("pick", [start, end]);
- },
- },
- {
- text: "最近一周",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
- picker.$emit("pick", [start, end]);
- },
- },
- {
- text: "最近一个月",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
- picker.$emit("pick", [start, end]);
- },
- },
- {
- text: "最近三个月",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
- picker.$emit("pick", [start, end]);
- },
- },
- ],
- },
- };
- },
- filters: {},
- created() {
- this.userId = this.$store.getters.userId;
- let date = new Date();
- let y = date.getFullYear();
- let MM = date.getMonth() + 1;
- MM = MM < 10 ? "0" + MM : MM;
- let dd = date.getDate();
- dd = dd < 10 ? "0" + dd : dd;
- this.uploadDate = [`${y}-${MM}-${dd}`, `${y}-${MM}-${dd}`];
- let start = new Date();
- let end = new Date();
- let ey = end.getFullYear();
- let eMM = end.getMonth() + 1;
- eMM = eMM < 10 ? "0" + eMM : eMM;
- let edd = end.getDate();
- edd = edd < 10 ? "0" + edd : edd;
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
- let sy = start.getFullYear();
- let sMM = start.getMonth() + 1;
- sMM = sMM < 10 ? "0" + sMM : sMM;
- let sdd = start.getDate();
- sdd = sdd < 10 ? "0" + sdd : sdd;
- this.uploadDateEcharts = [`${sy}-${sMM}-${sdd}`, `${ey}-${eMM}-${edd}`];
- this.showOld =
- this.$store.getters.roles[0] == "courtshipManager" ||
- this.$store.getters.roles[0] == "courtship" ||
- this.$store.getters.roles[0] == "bdManager" ||
- this.$store.getters.roles[0] == "bd" ||
- this.$store.getters.roles[0] == "association" ||
- this.$store.getters.roles[0] == "associationManager" ||
- this.$store.getters.roles[0] == "supplyChainAdmin"
- ? 2
- : this.$store.getters.roles[0] == "operations" ||
- this.$store.getters.roles[0] == "operationsManager" ||
- this.$store.getters.roles[0] == "directorOperations" ||
- this.$store.getters.roles[0] == "operator"
- ? 3
- : this.$store.getters.roles[0] == "jy_bd_manage" ||
- this.$store.getters.roles[0] == "jy_bd" ||
- this.$store.getters.roles[0] == "jy_scissors_manage" ||
- this.$store.getters.roles[0] == "jy_admnin" ||
- this.$store.getters.roles[0] == "jy_scissors" ||
- this.$store.getters.roles[0] == "jy_out_operation" ||
- this.$store.getters.roles[0] == "jy_out_operation_manager" ||
- this.$store.getters.roles[0] == "jy_expert_business" ||
- this.$store.getters.roles[0] == "jy_expert_mentor"
- ? 4
- : 1;
- },
- mounted() {
- if (this.showOld) {
- this.getIndexOrderInfo();
- this.getIndexServiceAmountInfo();
- this.getIndexAmountInfo();
- this.getIndexPromoterRank();
- this.getIndexOrderRank();
- this.getIndexStatistics();
- this.getTimeRatio();
- }
- },
- methods: {
- getAllEchartsData(e) {
- if (e.length == 2) {
- this.getIndexStatistics();
- } else {
- this.$message({
- message: "请选择时间",
- type: "error",
- });
- }
- },
- changeEchartsType(e) {
- console.log(e);
- if (!!e) {
- this.getIndexStatistics();
- } else {
- this.$message({
- message: "请选择类型",
- type: "error",
- });
- }
- },
- getIndexStatistics() {
- this.echartsLoading = true;
- getIndexStatistics({
- type: this.echartsType,
- orderStartDate: this.uploadDate[0],
- orderEndDate: this.uploadDate[1],
- }).then((response) => {
- this.echartsLoading = false;
- this.initEchart("echart", this.handlerEchartOption(response, this.echartsType));
- });
- },
- /** 获取echart的值 */
- initEchart(idName, optionName) {
- let that = this;
- const chart = this.$refs[idName];
- if (chart) {
- const myChart = echarts.init(document.getElementById(idName));
- myChart.setOption(optionName);
- window.addEventListener("resize", function () {
- that.clientWidth = document.documentElement.clientWidth - 224;
- myChart.resize();
- });
- }
- },
- /** echarts数据展示 订单统计*/
- handlerEchartOption(data, typeShow) {
- var typeName;
- switch (typeShow) {
- case "orderNum":
- typeName = "订单数";
- break;
- case "validOrderNum":
- typeName = "有效订单数";
- break;
- case "orderAmount":
- typeName = "订单金额";
- break;
- case "baseAmount":
- typeName = "货款基数";
- break;
- case "deliveryNum":
- typeName = "发货数";
- break;
- }
- let option = {
- noDataLoadingOption: {
- text: "暂无数据",
- effect: "bubble",
- effectOption: {
- effect: {
- n: 0,
- },
- },
- },
- tooltip: {
- trigger: "axis",
- // formatter: function(params) {
- // if(typeShow == 'play_duration_3s'){
- // return `${params[0].marker}${params[0].name}<br/>${params[0].seriesName}:${params[0].value}%`
- // }else{
- // return `${params[0].marker}${params[0].name}<br/>${params[0].seriesName}:${params[0].value}`
- // }
- // },
- },
- grid: {
- left: "3%",
- right: "4%",
- bottom: "3%",
- containLabel: true,
- },
- legend: {
- icon: "circle",
- top: "5%",
- right: "5%",
- itemWidth: 6,
- itemGap: 20,
- textStyle: {
- color: "#556677",
- },
- },
- xAxis: {
- type: "category",
- data: data.map((item) => {
- return item.date;
- }),
- boundaryGap: false,
- // 坐标轴线
- axisLine: {
- show: false,
- lineStyle: {
- color: "#999",
- },
- },
- // 分割线
- splitLine: {
- show: true,
- lineStyle: {
- type: "dashed",
- color: "#e5e5e5",
- },
- },
- },
- yAxis: {
- type: "value",
- axisLine: {
- show: false,
- lineStyle: {
- color: "#999",
- },
- },
- splitLine: {
- lineStyle: {
- type: "dashed",
- color: "#e5e5e5",
- },
- },
- },
- series: [
- {
- smooth: true,
- name: typeName,
- type: "line",
- stack: "总量",
- data: data.map((item) => {
- return item[typeShow];
- }),
- symbol: "circle",
- symbolSize: 6,
- lineStyle: {
- normal: {
- width: 2,
- },
- },
- itemStyle: {
- borderColor: "#ffffff",
- borderWidth: 0,
- },
- },
- ],
- };
- return option;
- },
- getTimeRatio() {
- getTimeRatio(
- this.addDateRange({}, this.uploadDate, "orderStartDate", "orderEndDate")
- ).then((response) => {
- this.ratioData = {
- orderAmountRatio: response.orderAmountRatio,
- orderTotalRatio: response.orderTotalRatio,
- };
- });
- },
- /** 获取订单数据 */
- getIndexOrderInfo() {
- this.totalOneLoading = true;
- getIndexOrderInfo(
- this.addDateRange(
- {dateType: this.dateType},
- this.uploadDate,
- "orderStartDate",
- "orderEndDate"
- )
- ).then((response) => {
- this.totalOneLoading = false;
- this.order = {
- orderNum: response.orderTotal.orderNum,
- validOrderNUm: response.orderTotal.validOrderNUm,
- invalidOrderNUm: response.orderTotal.invalidOrderNUm,
- ringRatio: this.dateType == 0 ? response.ratio.ringRatio : 0,
- yearRatio: this.dateType == 0 ? response.ratio.yearRatio : 0,
- };
- });
- },
- getIndexServiceAmountInfo() {
- this.totalThreeLoading = true;
- getIndexServiceAmountInfo(
- this.addDateRange(
- {dateType: this.dateType},
- this.uploadDate,
- "orderStartDate",
- "orderEndDate"
- )
- ).then((response) => {
- this.totalThreeLoading = false;
- this.taskNumber = {
- complete: response.serviceAmountTotal.deliveryNum,
- noStarted: response.serviceAmountTotal.promoterNum,
- deliveryRadio: response.serviceAmountTotal.deliveryRadio,
- };
- });
- },
- getIndexAmountInfo() {
- this.totalTwoLoading = true;
- getIndexAmountInfo(
- this.addDateRange(
- {dateType: this.dateType},
- this.uploadDate,
- "orderStartDate",
- "orderEndDate"
- )
- ).then((response) => {
- this.totalTwoLoading = false;
- this.regimentalPromotion = {
- regimentalPromotionAmount: response.amountTotal.orderAmount / 100,
- personData: response.amountTotal.baseAmount / 100,
- complete: response.amountTotal.regimentalPromotionAmount / 100,
- ringRatio: this.dateType == 0 ? response.amountRatio.amountRingRatio : 0,
- yearRatio: this.dateType == 0 ? response.amountRatio.amountYearRatio : 0,
- };
- });
- },
- getIndexPromoterRank() {
- this.promoterLoading = true;
- getIndexPromoterRank(
- this.addDateRange(
- {
- dateType: this.dateType,
- pageNum: this.queryParams.promoterPageNum,
- pageSize: 10,
- },
- this.uploadDate,
- "orderStartDate",
- "orderEndDate"
- )
- ).then((response) => {
- this.promoterRankList = response.rows;
- this.promoterTotal = response.total;
- this.promoterLoading = false;
- });
- },
- getIndexOrderRank() {
- this.orderRankLoading = true;
- getIndexOrderRank(
- this.addDateRange(
- {
- dateType: this.dateType,
- pageNum: this.queryParams.pageNum,
- pageSize: 10,
- },
- this.uploadDate,
- "orderStartDate",
- "orderEndDate"
- )
- ).then((response) => {
- this.orderRankList = response.rows;
- this.orderTotal = response.total;
- this.orderRankLoading = false;
- });
- },
- indexMethod(index) {
- return index + 1 + (this.queryParams.pageNum - 1) * 10;
- },
- indexMethodTwo(index) {
- return index + 1 + (this.queryParams.promoterPageNum - 1) * 10;
- },
- toOrderDetail(item) {
- this.$router.replace({
- path: "/supplyChain/kuaishou/goodsDetails",
- query: {
- id: item.itemId,
- name: item.itemTitle,
- orderStartDate: this.uploadDate[0],
- orderEndDate: this.uploadDate[1],
- },
- });
- },
- toOrderList() {
- this.$router.replace({
- path: "/supplyChain/kuaishou/goods",
- });
- },
- toPersonDetail(item) {
- this.$router.replace({
- path: "/supplyChain/kuaishou/indexDetails",
- query: {
- id: item.promoterId,
- name: item.promoterNickName,
- orderStartDate: this.uploadDate[0],
- orderEndDate: this.uploadDate[1],
- },
- });
- },
- toPersonList() {
- this.$router.replace({
- path: "/supplyChain/kuaishou/index",
- });
- },
- handleQuery() {
- let date = new Date();
- let y = date.getFullYear();
- let MM = date.getMonth() + 1;
- MM = MM < 10 ? "0" + MM : MM;
- let dd = date.getDate();
- dd = dd < 10 ? "0" + dd : dd;
- if (this.uploadDate.length == 2) {
- if (
- this.uploadDate[0] == `${y}-${MM}-${dd}` &&
- this.uploadDate[1] == `${y}-${MM}-${dd}`
- ) {
- this.dateType = 0;
- } else {
- this.dateType = 1;
- }
- this.queryParams.promoterPageNum = 1;
- this.queryParams.pageNum = 1;
- this.getIndexOrderInfo();
- this.getIndexServiceAmountInfo();
- this.getIndexAmountInfo();
- this.getIndexPromoterRank();
- this.getIndexOrderRank();
- this.getIndexStatistics();
- this.getTimeRatio();
- } else {
- this.$message({
- message: "请选择时间",
- type: "error",
- });
- }
- },
- /** 金额格式化 */
- priceFormat(num, n) {
- n = n || 2;
- let symbol = ",";
- if (num === null) return num;
- if (typeof num !== "number") throw new TypeError("num参数应该是一个number类型");
- if (n < 0) throw new Error("参数n不应该小于0");
- let hasDot = parseInt(num) != num; //这里检测num是否为小数,true表示小数
- let m = n != undefined && n != null ? n : 1;
- num =
- m == 0
- ? num.toFixed(m) + "."
- : hasDot
- ? n
- ? num.toFixed(n)
- : num
- : num.toFixed(m);
- symbol = symbol || ",";
- num = num.toString().replace(/(\d)(?=(\d{3})+\.)/g, function (match, p1, p2) {
- return p1 + symbol;
- });
- if (n == 0 || (!hasDot && !n)) {
- //如果n为0或者传入的num是整数并且没有指定整数的保留位数,则去掉前面操作中的小数位
- num = num.substring(0, num.indexOf("."));
- }
- return num;
- },
- },
- };
- </script>
- <style scoped lang="scss">
- .top-sum {
- margin-bottom: 15px;
- ::v-deep .card-show {
- text-align: center;
- .p-title {
- width: 100%;
- font-size: 16px;
- color: darkgray;
- text-align: left;
- }
- .p-main {
- width: 100%;
- font-size: 22px;
- font-weight: bold;
- text-align: left;
- }
- .p-main-data {
- width: 100%;
- color: darkgray;
- font-size: 14px;
- text-align: left;
- margin: 0;
- }
- }
- }
- ::v-deep .el-form-item__label {
- white-space: nowrap;
- }
- ::v-deep a {
- color: #409eff;
- display: block;
- }
- </style>
- <style scoped lang="scss">
- .home {
- blockquote {
- padding: 10px 20px;
- margin: 0 0 20px;
- font-size: 17.5px;
- border-left: 5px solid #eee;
- }
- hr {
- margin-top: 20px;
- margin-bottom: 20px;
- border: 0;
- border-top: 1px solid #eee;
- }
- .col-item {
- margin-bottom: 20px;
- }
- ul {
- padding: 0;
- margin: 0;
- }
- font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-size: 13px;
- color: #676a6c;
- overflow-x: hidden;
- ul {
- list-style-type: none;
- }
- h4 {
- margin-top: 0px;
- }
- h2 {
- margin-top: 10px;
- font-size: 26px;
- font-weight: 100;
- }
- p {
- margin-top: 10px;
- b {
- font-weight: 700;
- }
- }
- .update-log {
- ol {
- display: block;
- list-style-type: decimal;
- margin-block-start: 1em;
- margin-block-end: 1em;
- margin-inline-start: 0;
- margin-inline-end: 0;
- padding-inline-start: 40px;
- }
- }
- }
- </style>
|