| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706 |
- <template>
- <vue-fullscreen
- class="box-container"
- v-cloak
- v-model="isFullscreen"
- fullscreenClass="box-container"
- :exit-on-click-wrapper="false"
- >
- <div class="box-container" v-cloak>
- <div class="box-header">
- <div class="logo">
- <!-- <img style="width: 20% ;height: 100%;transform: translate(51%,15%)" src="../../../assets/TGLOGO.png" alt="">-->
- </div>
- <div class="title">
- 采购仓储数据看板
- </div>
- <div class="time">
- <span
- style="color: #7fa7ce;margin: 5px 10px 15px 0;cursor: pointer" @click.passive="onFullscreen">
- <i v-if="isFullscreen" title="取消全屏" class="el-icon-_screen-restore"></i>
- <i v-else title="全屏" class="el-icon-_screen-full"></i>
- </span>
- <div style="margin-right: 10px">
- <span style="color: #7fa7ce">{{ date }}</span>
- <span style="color: rgb(210 215 221); padding: 0 5px;">{{ time }}</span>
- <span style="color: #7fa7ce;">{{ week }}
- </span>
- </div>
- </div>
- </div>
- <div class="box-middle">
- <div class="box-middle-content" style="width: 35%;cursor: pointer" @click="handelRouterTo('/page-eos/purchaseOrder')">
- <div class="box-middle-content-left">
- <span>月度总金额</span>
- <span>(万元)</span>
- </div>
- <div class="box-middle-content-right">
- <template v-for="item in MonthlyAmount">
- <span style="display: flex;align-content: flex-end"
- v-if="item=='.'">{{ '.' }}</span>
- <span v-else class="box-border8">{{ item }}</span>
- </template>
- </div>
- </div>
- <div class="box-middle-content">
- <div class="box-middle-content-left">
- <span>年度总金额</span>
- <span>(万元)</span>
- </div>
- <div class="box-middle-content-right">
- <template v-for="item in YearlyAmount">
- <span style="display: flex;align-content: flex-end;"
- v-if="item=='.'">{{ '.' }}</span>
- <span v-else class="box-border8" style=" width: 10%;">{{ item }}</span>
- </template>
- </div>
- </div>
- </div>
- <div class="box-footer">
- <div class="box-footer-right">
- <div class="box-echarts-top">
- <span class="box-top-name">月度采购明细</span>
- </div>
- <dv-scroll-board v-if="isFlag" :config="config" style="width:92%;height:80%;transform: translate(5%,7%);"/>
- </div>
- <div class="box-footer-left">
- <div class="box-echarts">
- <div class="box-echarts-top">
- <span class="box-top-name">年度采购统计</span>
- <span class="box-top-unit">(万元)</span>
- </div>
- <div class="monthly_sales_volume">
- <div v-if="isFlag" id="monthly_sales_volume" ref="monthly_sales_volume"></div>
- </div>
- <!-- <div style="position: fixed; transform: translate(13%, 110%);">-->
- <!-- <div style="color:#03c391">-->
- <!-- <span>{{ '累计签单金额 ' }}</span>-->
- <!-- <span style="font-weight: bold">{{ borderData[0].value }}</span>-->
- <!-- </div>-->
- <!-- <div style="color:#ea5082">-->
- <!-- <span>{{ '累计交货金额 ' }}</span>-->
- <!-- <span style="font-weight: bold">{{ borderData[1].value }}</span>-->
- <!-- </div>-->
- <!-- <div style="color:#faab46">-->
- <!-- <span>{{ '累计销售金额 ' }}</span>-->
- <!-- <span style="font-weight: bold">{{ borderData[2].value }}</span>-->
- <!-- </div>-->
- <!-- </div>-->
- </div>
- </div>
- </div>
- </div>
- </vue-fullscreen>
- </template>
- <script>
- import dvBorderContent from "./dv-border-content.vue";
- import * as echarts from 'echarts'
- import {component} from 'vue-fullscreen'
- import {
- getMonthlyPurchaseDetailAPI,
- getYearlyPurchaseAmountAPI,
- getMonthlyPurchaseAmountAPI,
- getYearlyPurchaseStatisticAPI,
- } from "@/api/bpm/visPage";
- import {toggleFullscreen} from "ele-admin";
- export default {
- name: 'index',
- components: {
- dvBorderContent,
- VueFullscreen: component
- },
- computed: {
- contentWidth() {
- return this.$store.state.theme.contentWidth;
- }
- },
- watch: {
- isFullscreen: {
- handler() {
- this.isFlag = false
- this.$nextTick(() => {
- let {clientWidth: deviceWidth, clientHeight: deviceHeight} = document.documentElement;
- let eleAdminHeaderHeight = (!this.isFullscreen && document.getElementsByClassName('ele-admin-header')[0]?.offsetHeight) || 0;
- let eleAdminSidebarWidth = (!this.isFullscreen && document.getElementsByClassName('ele-admin-sidebar')[0]?.offsetWidth) || 0;
- let eleAdminTabsWidth = (!this.isFullscreen && document.getElementsByClassName('ele-admin-tabs')[0]?.offsetHeight) || 0;
- const setContainerSize = (item) => {
- item.style.height = deviceHeight - eleAdminHeaderHeight - eleAdminTabsWidth + 'px';
- item.style.width = deviceWidth - eleAdminSidebarWidth + 'px';
- };
- let boxContainer = [...document.getElementsByClassName('box-container')];
- boxContainer.forEach(setContainerSize);
- document.documentElement.style.fontSize = this.isFullscreen ? '24px' : '16px'
- this.isFlag = true
- this.$nextTick(() => {
- let chartDom = this.$refs.monthly_sales_volume;
- this.salesChart = echarts.init(chartDom);
- this.getMonthlySalesStatistic()
- })
- })
- }, immediate: true
- },
- contentWidth: {
- handler() {
- clearTimeout(this.resizeTimer);
- this.isFlag = false
- this.resizeTimer = setTimeout(() => {
- this.$nextTick(() => {
- let {clientWidth: deviceWidth, clientHeight: deviceHeight} = document.documentElement;
- let eleAdminHeaderHeight = (!this.isFullscreen && document.getElementsByClassName('ele-admin-header')[0]?.offsetHeight) || 0;
- let eleAdminSidebarWidth = (!this.isFullscreen && document.getElementsByClassName('ele-admin-sidebar')[0]?.offsetWidth) || 0;
- let eleAdminTabsWidth = (!this.isFullscreen && document.getElementsByClassName('ele-admin-tabs')[0]?.offsetHeight) || 0;
- const setContainerSize = (item) => {
- item.style.height = deviceHeight - eleAdminHeaderHeight - eleAdminTabsWidth + 'px';
- item.style.width = deviceWidth - eleAdminSidebarWidth + 'px';
- };
- let boxContainer = [...document.getElementsByClassName('box-container')];
- boxContainer.forEach(setContainerSize);
- document.documentElement.style.fontSize = this.isFullscreen ? '24px' : '16px'
- this.isFlag = true
- this.$nextTick(() => {
- let chartDom = this.$refs.monthly_sales_volume;
- this.salesChart = echarts.init(chartDom);
- this.getMonthlySalesStatistic()
- })
- })
- }, 300)
- }, immediate: true
- },
- },
- data() {
- return {
- isFullscreen: false, // 是否是全屏
- isFlag: false, // 是否展示图表
- resizeTimer: null,
- timer: null,
- date: '',
- time: '',
- week: '',
- MonthlyAmount: 0,
- YearlyAmount: 0,
- salesChart: null,
- monthlySalesVolumeOption: {
- legend: {
- left: 'center',
- selectedMode: false,
- bottom: '85%',
- itemGap: 50,
- textStyle: {
- fontSize: '0.7rem',
- color: '#fff',
- lineHeight: 0,
- padding: [10, 0, 0, 0]
- }
- },
- grid: {
- bottom: '5%', // 组件离容器底部的距离
- containLabel: true // 包含坐标轴的标签
- },
- xAxis: {
- type: 'category',
- data: [],
- axisLabel: {
- interval: 0,
- formatter: function (value, index) {
- let month = value.split('-')
- return month[1] + '月';
- },
- textStyle: {
- color: '#fff', // 修改字体颜色为红色
- fontSize: '0.7rem',
- fontFamily: 'AlibabaPuHuiTi' // 修改字体为Arial
- }
- },
- axisLine: {},
- axisTick: {}
- },
- yAxis: {
- type: 'value',
- axisLabel: {
- textStyle: {
- color: '#fff', // 修改字体颜色为红色
- fontSize: '0.7rem',
- fontFamily: 'AlibabaPuHuiTi' // 修改字体为Arial
- }
- }
- },
- series: []
- },
- tableHeader: ['客户代号', '销售订单号', '采购订单', '数量', '到货情况', '入库情况', '质检状态', '合格率'],
- config: {
- header: [],
- data: [],
- align: ['center', 'center', 'center', 'center', 'center', 'center', 'center', 'center'],
- headerBGC: '#031d42',
- columnWidth: [110, 200],
- headerHeight: 20,
- oddRowBGC: '#031d42',
- evenRowBGC: '#031d42',
- waitTime: 5000,
- rowNum: 6
- },
- //1已检0未检
- qcStatusList: [
- {
- dictKey: 1,
- dictValue: '已检'
- },
- {
- dictKey: 0,
- dictValue: '未检'
- },
- ],
- // 1在途2提前3按时4延期
- receiveStatusList: [
- {
- dictKey: 1,
- dictValue: '在途'
- },
- {
- dictKey: 2,
- dictValue: '提前'
- },
- {
- dictKey: 3,
- dictValue: '按时'
- },
- {
- dictKey: 4,
- dictValue: '延期'
- }
- ],
- //入库状态 1已入库0未入库 integer(int32)
- inStoreStatusList: [
- {
- dictKey: 1,
- dictValue: '已入库'
- },
- {
- dictKey: 0,
- dictValue: '未入库'
- }
- ],
- };
- },
- created() {
- this.updateTimer = setInterval(this.updateTime, 1000)
- },
- mounted() {
- this.getSalesFinishList()
- this.timer = setInterval(() => {
- this.getSalesFinishList()
- }, 3600000)
- },
- // 在组件销毁时清除定时器
- beforeDestroy() {
- clearInterval(this.updateTimer)
- },
- methods: {
- handelRouterTo(path) {
- window.history.pushState(null, '', path);
- },
- /* 全屏切换 */
- onFullscreen() {
- this.isFullscreen = !this.isFullscreen
- },
- //获取年度采购统计
- async getMonthlySalesStatistic() {
- let data = await getYearlyPurchaseStatisticAPI()
- let series = [
- {
- field: 'contractPrice',
- name: '采购订单金额',
- data: [],
- type: 'bar',
- itemStyle: {
- color: '#03c391'
- }
- },
- {
- field: 'qcInStorePrice',
- name: '合格入库金额',
- data: [],
- type: 'bar',
- itemStyle: {
- color: '#ea5082'
- }
- }
- ]
- this.monthlySalesVolumeOption.xAxis.data = data.map(item => item.monthStr)
- series.forEach(item => {
- item.data = data.map(i => i[item.field])
- })
- this.monthlySalesVolumeOption.series = series
- this.salesChart.setOption(this.monthlySalesVolumeOption)
- },
- // 获取销售完成列表数据
- async getSalesFinishList() {
- // customerMark 客户代号 string
- // inStoreStatus 入库状态 1已入库0未入库 integer(int32)
- // purchaseOrderCode 采购订单 string
- // qcRate 合格率 number
- // qcStatus 质检状态 1已检0未检 integer(int32)
- // receiveStatus 到货情况 1在途2提前3按时4延期 integer(int32)
- // saleOrderCode 销售订单 string
- let data = await getMonthlyPurchaseDetailAPI()
- this.config = {
- header: this.tableHeader.map(item => `<div style="color: #f4d29c;font-size: 0.9rem;font-weight: bold">${item}</div>`),
- data: data.map(item => {
- let list = []
- for (let i in item) {
- let div = ''
- if (i === 'customerMark') {
- div = `<div class="white" style="font-size: 0.8rem;">${item[i] || '-'}</div>`
- list[0] = div
- }
- if (i === 'saleOrderCode') {
- div = `<div class="white" style="font-size: 0.8rem;">${item[i] || '-'}</div>`
- list[1] = div
- }
- if (i === 'purchaseOrderCode') {
- div = `<div class="white" style="font-size: 0.8rem;">${item[i] || '-'}</div>`
- list[2] = div
- }
- if (i === 'productTotalCount') {
- div = `<div class="white" style="font-size: 0.8rem;">${item[i]||'-'}</div>`
- list[3] = div
- }
- if (i === 'receiveStatus') {
- div = `<div class="white" style="font-size: 0.8rem;">${this.getValue('receiveStatus', item[i])}</div>`
- list[4] = div
- }
- if (i === 'inStoreStatus') {
- div = `<div class="white" style="font-size: 0.8rem;">${this.getValue('inStoreStatus', item[i])}</div>`
- list[5] = div
- }
- if (i === 'qcStatus') {
- div = `<div class="white" style="font-size: 0.8rem;">${this.getValue('qcStatus', item[i])}</div>`
- list[6] = div
- }
-
- if (i === 'qcRate') {
- div = `<div class="white" style="font-size: 0.8rem;">${item[i]||0 + '%'}</div>`
- list[7] = div
- }
- }
- return list
- }) ?? [],
- align: ['center', 'center', 'center', 'center', 'center', 'center', 'center', 'center'],
- headerBGC: '#031d42',
- columnWidth: [],
- headerHeight: 30,
- oddRowBGC: '#031d42',
- evenRowBGC: '#031d42',
- waitTime: 5000,
- rowNum: 6,
- }
- /*年度总金额*/
- this.YearlyAmount = await getYearlyPurchaseAmountAPI()
- this.YearlyAmount = (this.YearlyAmount + '').includes('.') ? ((this.YearlyAmount.toFixed(2)) + '').padStart(8, 0) : (this.YearlyAmount + '').padStart(8, 0)
- /*月度总金额*/
- this.MonthlyAmount = await getMonthlyPurchaseAmountAPI()
- this.MonthlyAmount = (this.MonthlyAmount + '').includes('.') ? ((this.MonthlyAmount.toFixed(2)) + '').padStart(7, 0) : (this.MonthlyAmount + '').padStart(7, 0)
- },
- // 获取自定义字典值
- getValue(name, key) {
- let find = this[name + 'List'].find(item => item.dictKey == key) || {}
- return find.dictValue || ''
- },
- //实时更新日期
- updateTime() {
- let now = new Date();
- let hours = now.getHours();
- let minutes = now.getMinutes();
- let seconds = now.getSeconds();
- this.time = hours.toString().padStart(2, '0') + ":" +
- minutes.toString().padStart(2, '0') + ":" +
- seconds.toString().padStart(2, '0');
- let year = now.getFullYear();
- let month = now.getMonth() + 1;
- let day = now.getDate();
- this.date = year + '年' + month + '月' + day + '日'
- let weekInfo = {
- 1: '一',
- 2: '二',
- 3: '三',
- 4: '四',
- 5: '五',
- 6: '六',
- 0: '日',
- }
- this.week = '星期' + weekInfo[now.getDay()]
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- [v-cloak] {
- display: none;
- }
- .box-container {
- font-size: 16px;
- font-family: 'AlibabaPuHuiTi';
- background: #011635;
- display: flex;
- flex-direction: column;
- .box-header {
- background-image: url("@/assets/border2.png");
- background-repeat: no-repeat;
- background-size: 100% 100%;
- display: flex;
- width: 100% !important;
- height: 10%;
- justify-content: space-between;
- .title {
- font-family: '优设标题黑';
- font-size: 2.85rem;
- flex: 1;
- display: flex;
- justify-content: center;
- align-items: center;
- color: #fff;
- transform: translate(2%, -10%);
- letter-spacing: 0.4rem;
- }
- .logo {
- display: inline-block;
- width: 20%;
- }
- .time {
- width: 20%;
- display: flex;
- align-items: center;
- justify-content: space-around;
- flex-direction: column;
- align-items: flex-end;
- justify-content: flex-start;
- font-size: 0.8rem;
- }
- }
- .box-middle {
- width: 100% !important;
- height: 10% !important;
- display: flex;
- justify-content: center;
- margin: 5px 0 10px 0;
- .box-middle-content {
- width: 45%;
- height: 100%;
- background-image: url("@/assets/png/border6.png");
- background-repeat: no-repeat;
- background-size: 100% 100%;
- margin: 0 28px 10px 0;
- display: flex;
- align-items: center;
- .box-middle-content-left {
- width: 30%;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- height: 100%;
- font-size: 1rem;
- font-weight: bold;
- color: #fff;
- }
- .box-middle-content-right {
- flex: 1;
- display: flex;
- //font-family: 'LCD2B';
- font-size: 3rem;
- color: #fff;
- justify-content: space-evenly;
- height: 61%;
- .box-border8 {
- background-image: url("@/assets/png/border8.png");
- background-repeat: no-repeat;
- background-size: 100% 100%;
- width: 12%;
- display: flex;
- font-size: 3rem;
- justify-content: center;
- font-family: 'DS-DIGIT';
- align-items: center;
- }
- .border-box-content {
- }
- }
- }
- }
- .box-footer {
- flex: 1;
- display: flex;
- flex-direction: column;
- justify-content: space-around;
- .box-footer-left {
- width: 100%;
- height: 50%;
- .box-echarts {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- background-image: url("@/assets/png/border5.png");
- background-repeat: no-repeat;
- background-size: 100% 100%;
- .box-echarts-top {
- background-image: url("@/assets/png/border7.png");
- background-repeat: no-repeat;
- background-size: 94% 100%;
- height: 15.5%;
- width: 100%;
- display: flex;
- align-items: center;
- /* justify-content: space-around; */
- transform: translate(2%, 20%);
- color: #fff;
- .box-top-name {
- font-family: '优设标题黑';
- transform: translateX(40%);
- display: inline-block;
- font-size: 1.8rem;
- }
- .box-top-unit {
- font-family: '优设标题黑';
- display: inline-block;
- font-size: 1rem;
- transform: translate(150%, 20%);
- letter-spacing: 0.9px;
- }
- }
- .monthly_sales_volume {
- transform: translateX(-7%);
- flex: 1;
- //width: 100%;
- //height: 100%;
- #monthly_sales_volume {
- width: 113%;
- height: 100%;
- }
- }
- .monthly_output {
- transform: translateX(-7%);
- flex: 1;
- #monthly_output {
- width: 113%;
- height: 100%;
- //width: 100%;
- //height: 100%;
- }
- }
- }
- }
- .box-footer-right {
- width: 100%;
- height: 50%;
- background-image: url("@/assets/png/border5.png");
- background-repeat: no-repeat;
- background-size: 100% 100%;
- .box-echarts-top {
- background-image: url("@/assets/png/border7.png");
- background-repeat: no-repeat;
- background-size: 94% 100%;
- height: 15.5%;
- width: 100%;
- display: flex;
- align-items: center;
- transform: translate(2%, 20%);
- /* justify-content: space-around; */
- color: #fff;
- font-size: 1.1rem;
- letter-spacing: 2px;
- .box-top-name {
- font-family: '优设标题黑';
- transform: translateX(40%);
- display: inline-block;
- font-size: 1.8rem;
- }
- }
- }
- }
- }
- </style>
- <style>
- .white {
- color: #ffffff;
- }
- .yellow {
- color: #ffd16c;
- }
- .green {
- color: green;
- }
- .red {
- color: red;
- }
- </style>
|