123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314 |
- <template>
- <div class="content">
- <div class="bck">
- <el-form :inline="true" :model="queryForm">
- <el-form-item label="">
- <el-date-picker
- v-model="queryForm.aa"
- type="month"
- placeholder="月份"
- @change="onQuery"
- />
- </el-form-item>
- <el-form-item label="">
- <el-radio-group v-model="queryForm.bb" size="large" @change="onQuery">
- <el-radio-button label="本日" />
- <el-radio-button label="本周" />
- <el-radio-button label="本月" />
- <el-radio-button label="今年" />
- <el-radio-button label="其他" />
- </el-radio-group>
- </el-form-item>
- <el-form-item>
- <el-date-picker
- v-model="queryForm.timeArr"
- type="daterange"
- unlink-panels
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- value-format="YYYY-MM-DD"
- @change="onQuery"
- />
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="onQuery">搜索</el-button>
- <el-button type="defualt" @click="onReset">重置</el-button>
- </el-form-item>
- </el-form>
- </div>
- <div class="bck statistics" style="margin-top: 10px">
- <div class="item first">
- <div class="left_">
- <div class="money">
- {{ moneyFormat(0, 2) }}
- </div>
- <div>销售额({{ 0 }})</div>
- </div>
- <div class="right_">
- <div class="icon">
- <img src="@/assets/images/portrait/icon_sales.png" alt="" />
- </div>
- </div>
- </div>
- <div class="item two">
- <div class="left_">
- <div class="money">
- {{ moneyFormat(0, 2) }}
- </div>
- <div>订单(单)</div>
- </div>
- <div class="right_">
- <div class="icon">
- <img src="@/assets/images/portrait/icon_profits.png" alt="" />
- </div>
- </div>
- </div>
- <div class="item three">
- <div class="left_">
- <div class="money">
- {{ 0 }}
- </div>
- <div>下单客户数(人)</div>
- </div>
- <div class="right_">
- <div class="icon">
- <img src="@/assets/images/portrait/icon_email.png" alt="" />
- </div>
- </div>
- </div>
- </div>
- <div class="bck scatter" style="margin-top: 10px">
- <el-row>
- <el-col :span="8">
- <TitleInfo :content="titleList[0]"></TitleInfo>
- <div ref="echartDom" style="height: 40vh"></div>
- </el-col>
- <el-col :span="16">
- <byTable
- :source="sourceList.scatterData"
- :pagination="sourceList.scatterPagination"
- :config="scatterConfig"
- :loading="scatterLoading"
- highlight-current-row
- :selectConfig="[]"
- @get-list="getList"
- >
- </byTable>
- </el-col>
- </el-row>
- </div>
- </div>
- </template>
- <script setup>
- import * as echarts from "echarts";
- import TitleInfo from "@/components/TitleInfo/index.vue";
- const titleList = [
- "销售分布",
- "客户分类",
- "业务员销售趋势",
- "商品销售额",
- "商品销量",
- ];
- const { proxy } = getCurrentInstance();
- const scatterLoading = ref(false);
- const loadingOne = ref(false);
- const loadingTwo = ref(false);
- const queryForm = reactive({
- beginTime: "",
- endTime: "",
- timeArr: "",
- });
- const sourceList = ref({
- scatterData: [],
- scatterPagination: {
- total: 3,
- pageNum: 1,
- pageSize: 10,
- },
- });
- //图表
- const echartDom = ref(null);
- let myChart = null;
- const option = reactive({
- data: {
- tooltip: {
- trigger: "item",
- },
- legend: {
- top: "0%",
- left: "center",
- },
- series: [
- {
- name: "销售分布",
- type: "pie",
- radius: ["20%", "50%"],
- avoidLabelOverlap: false,
- itemStyle: {
- borderRadius: 10,
- borderColor: "#fff",
- borderWidth: 2,
- },
- label: {
- show: false,
- position: "center",
- },
- emphasis: {
- label: {
- show: true,
- fontSize: 40,
- fontWeight: "bold",
- },
- },
- labelLine: {
- show: false,
- },
- data: [2000, 1000],
- },
- ],
- },
- });
- const scatterConfig = computed(() => {
- return [
- {
- attrs: {
- label: "序列",
- prop: "receiptWarehouseName",
- },
- },
- {
- attrs: {
- label: "国家",
- prop: "receiptWarehouseName",
- },
- },
- {
- attrs: {
- label: "订单量(单)",
- prop: "receiptWarehouseName",
- },
- },
- {
- attrs: {
- label: "交易金额(¥)",
- prop: "amount",
- },
- render(amount) {
- return proxy.moneyFormat(amount, 2);
- },
- },
- ];
- });
- const getData = () => {
- // loading.value = true;
- loadingOne.value = true;
- loadingTwo.value = true;
- // proxy.post("/saleQuotation/sourceStatistics", queryForm).then((res) => {
- // allData.sourceData = res;
- // setTimeout(() => {
- // loading.value = false;
- // }, 200);
- // });
- // proxy.post("/saleQuotation/typeStatistics", queryForm).then((res) => {
- // allData.typeData = res;
- // setTimeout(() => {
- // loadingOne.value = false;
- // }, 200);
- // });
- proxy.post("/contract/salesStatistics", queryForm).then((res) => {
- console.log(res, "aa");
- });
- };
- const onQuery = () => {
- queryForm.beginTime = queryForm.timeArr[0];
- queryForm.endTime = queryForm.timeArr[1];
- getData();
- };
- const onReset = () => {};
- onMounted(() => {
- myChart = echarts.init(echartDom.value);
- window.addEventListener("resize", () => {
- myChart.resize();
- });
- myChart.setOption(option.data);
- getData();
- });
- </script>
- <style lang="scss" scoped>
- .content {
- margin: 20px;
- }
- :deep(.el-form-item) {
- margin-bottom: 0px;
- }
- .bck {
- background-color: #fff;
- padding: 15px;
- }
- .statistics {
- display: flex;
- // justify-content: space-around;
- .item {
- border-radius: 10px;
- margin-right: 20px;
- width: 13vw;
- height: 70px;
- padding: 10px;
- box-sizing: border-box;
- display: flex;
- justify-content: space-between;
- .left_ {
- display: flex;
- flex-direction: column;
- justify-content: space-around;
- .money {
- font-weight: 700;
- color: #333333;
- font-size: 15px;
- }
- }
- .right_ {
- .icon {
- img {
- width: 20px;
- height: 20px;
- margin-top: 6px;
- }
- width: 34px;
- height: 34px;
- margin-top: 10px;
- border-radius: 8px;
- background-color: #ffffff;
- text-align: center;
- line-height: 34px;
- }
- }
- }
- .first {
- background: linear-gradient(#c7e3fe, #dfecff);
- }
- .two {
- background: linear-gradient(#eae8fb, #ded9ff);
- }
- .three {
- background: linear-gradient(#fcf1e4, #fce5ca);
- }
- .four {
- background: linear-gradient(#e2fbe8, #e2fbe8);
- }
- .five {
- background: linear-gradient(#ffebe9, #ffebe9);
- }
- }
- .scatter {
- // display: flex;
- }
- </style>
|