| | |
| | | "@jiaminghi/data-view": "^2.10.0", |
| | | "async-validator": "^4.2.5", |
| | | "axios": "^0.24.0", |
| | | "dv-ui": "^1.0.3", |
| | | "echarts": "^5.4.0", |
| | | "ejs": "^3.1.8", |
| | | "element-ui": "^2.15.10", |
| | |
| | | // import { config } from 'vue/types/umd'; |
| | | axios.defaults.withCredentials=true; |
| | | axios.defaults.crossDomain=true; |
| | | axios.defaults.baseURL = 'http://10.30.4.92:7081';//'http://192.168.2.51:8099'; //'http://localhost:8099'; //'http://192.168.2.51:8099';// |
| | | axios.defaults.baseURL = 'http://127.0.0.1:7081';//'http://192.168.2.51:8099'; //'http://localhost:8099'; //'http://192.168.2.51:8099';// |
| | | axios.defaults.headers.post["Content-Type"]="application/json;charset=utf-8"; |
| | | // é误信æ¯å¤ç |
| | | const errorHandle = (status, other) => { |
| | |
| | | import axios from './ajax'; |
| | | //æåæ§è¡ä»»å¡ç»è®¡ |
| | | export function Floorfault (data) { |
| | | return axios.post('/api/Large/ProMonthTaskStatistics', data)//è¿åçæ¶promieså¯¹è±¡ï¼æä»¥ç´æ¥returnåºå»å°±å¥½äº |
| | | return axios.post('/api/Large/ProMonthTaskStatistics?id=7', data)//è¿åçæ¶promieså¯¹è±¡ï¼æä»¥ç´æ¥returnåºå»å°±å¥½äº |
| | | } |
| | | //æåè´§ä½ç»è®¡ |
| | | export function ProLocationStatistics (data) { |
| | |
| | | export function ProductionStock (data) { |
| | | return axios.post('/api/Large/ProductionStock', data)//è¿åçæ¶promieså¯¹è±¡ï¼æä»¥ç´æ¥returnåºå»å°±å¥½äº |
| | | } |
| | | //æå产ååºåæ»æ°ç»è®¡ |
| | | //æååºåºå®¢æ·æ»æ°åç»ç»è®¡ |
| | | export function GetCPLargeStockCount (data) { |
| | | return axios.post('/api/Large/GetCPLargeStockCount', data)//è¿åçæ¶promieså¯¹è±¡ï¼æä»¥ç´æ¥returnåºå»å°±å¥½äº |
| | | } |
| | |
| | | |
| | | <ItemWrap |
| | | class="contetn_left-bottom contetn_lr-item" |
| | | title="æå彿æ§è¡ä»»å¡ç»è®¡" |
| | | title="æåæ§è¡ä¸ä»»å¡ç»è®¡" |
| | | > |
| | | <stationone/> |
| | | </ItemWrap> |
| | | |
| | | <ItemWrap |
| | | class="contetn_left-bottom contetn_lr-item" |
| | | title="æåä»äº§ååºåæ»æ°ç»è®¡" |
| | | title="æ å é å® å®¢ æ· ç» è®¡" |
| | | > |
| | | <stationtwo/> |
| | | </ItemWrap> |
| | |
| | | <div v-else style="color: white; text-align: center; padding-top: 50px"> |
| | | æ°æ®å è½½ä¸... |
| | | </div> |
| | | <div v-if="error" style="color: red; text-align: center; padding-top: 50px"> |
| | | æ°æ®å 载失败: {{ error }} |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | }, |
| | | }, |
| | | series: [ |
| | | { name: 'æåå
¥åº', type: 'line', data: [] }, |
| | | { name: 'æååºåº', type: 'line', data: [] }, |
| | | { name: '空æ¡åæµ', type: 'line', data: [] }, |
| | | { name: 'æåååº', type: 'line', data: [] } |
| | | { |
| | | name: 'æåå
¥åº', |
| | | type: 'line', |
| | | data: [], |
| | | areaStyle: { |
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ |
| | | { offset: 0, color: 'rgba(0, 255, 255, 0.3)' }, |
| | | { offset: 1, color: 'rgba(0, 255, 255, 0)' } |
| | | ]) |
| | | } |
| | | }, |
| | | { |
| | | name: 'æååºåº', |
| | | type: 'line', |
| | | data: [], |
| | | areaStyle: { |
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ |
| | | { offset: 0, color: 'rgba(255, 0, 255, 0.3)' }, |
| | | { offset: 1, color: 'rgba(255, 0, 255, 0)' } |
| | | ]) |
| | | } |
| | | }, |
| | | { |
| | | name: '空æ¡åæµ', |
| | | type: 'line', |
| | | data: [], |
| | | areaStyle: { |
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ |
| | | { offset: 0, color: 'rgba(255, 255, 0, 0.3)' }, |
| | | { offset: 1, color: 'rgba(255, 255, 0, 0)' } |
| | | ]) |
| | | } |
| | | }, |
| | | { |
| | | name: 'æåååº', |
| | | type: 'line', |
| | | data: [], |
| | | areaStyle: { |
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ |
| | | { offset: 0, color: 'rgba(0, 255, 0, 0.3)' }, |
| | | { offset: 1, color: 'rgba(0, 255, 0, 0)' } |
| | | ]) |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | }, |
| | | async fetchData() { |
| | | this.loading = true; |
| | | this.loading = true; |
| | | this.error = null; |
| | | |
| | | try { |
| | |
| | | } |
| | | }, |
| | | updateChart(data) { |
| | | |
| | | |
| | | const dates = data.dateRange; |
| | | const stats = data.dailyStatistics; |
| | | |
| | |
| | | </script> |
| | | |
| | | <style lang='scss' scoped> |
| | | /* æ ·å¼é¨åä¿æä¸å */ |
| | | .user_Overview { |
| | | li { |
| | | flex: 1; |
| | |
| | | } |
| | | |
| | | .allnum { |
| | | // background-image: url("../../assets/img/left_top_lan.png"); |
| | | &::before { |
| | | background-image: url("../../assets/img/left_top_lan.png"); |
| | | } |
| | |
| | | <!-- |
| | | * @Author: daidai |
| | | * @Date: 2022-02-28 16:16:42 |
| | | * @LastEditors: Please set LastEditors |
| | | * @LastEditTime: 2022-07-20 17:57:11 |
| | | * @FilePath: \web-pc\src\pages\big-screen\view\indexs\left-center.vue |
| | | --> |
| | | <template> |
| | | <ul class="user_Overview flex" v-if="pageflag"> |
| | | <li class="user_Overview-item" style="color: #00fdfa"> |
| | | <li class="user_Overview-item" style="color: #b3d1ff"> |
| | | <div class="user_Overview_nums allnum "> |
| | | <dv-digital-flop :config="inboundConfig" style="width:100%;height:100%;" /> |
| | | </div> |
| | | <p>æåå
¥åº</p> |
| | | <p>æåå
¥åºå æ¯</p> |
| | | <br> |
| | | <!-- <p>{{stationstate[0].station_state}}</p> --> |
| | | <!-- <p v-if="stationstate[0].station_state == 'æ£ä¿®ä¸'">{{stationstate[0].station_checkName}}</p> --> |
| | | </li> |
| | | <li class="user_Overview-item" style="color: #07f7a8"> |
| | | <li class="user_Overview-item" style="color: #f8c8dc"> |
| | | <div class="user_Overview_nums online"> |
| | | <dv-digital-flop :config="outboundConfig" style="width:100%;height:100%;" /> |
| | | </div> |
| | | <p>æååºåº</p> |
| | | <p>æååºåºå æ¯</p> |
| | | <br> |
| | | <!-- <p>{{stationstate[1].station_state}}</p> --> |
| | | <!-- <p v-if="stationstate[1].station_state == 'æ£ä¿®ä¸'">{{stationstate[1].station_checkName}}</p> --> |
| | | </li> |
| | | <li class="user_Overview-item" style="color: #E6A23C"> |
| | | <div class="user_Overview_nums offline"> |
| | | <dv-digital-flop :config="backConfig" style="width:100%;height:100%;" /> |
| | | </div> |
| | | <p>æååæ¡</p> |
| | | <p>æåè°æ¨å æ¯</p> |
| | | <br> |
| | | <!-- <p>{{stationstate[1].station_state}}</p> --> |
| | | <!-- <p v-if="stationstate[1].station_state == 'æ£ä¿®ä¸'">{{stationstate[1].station_checkName}}</p> --> |
| | | </li> |
| | | <li class="user_Overview-item" style="color: #f56c6c"> |
| | | <div class="user_Overview_nums laramnum"> |
| | | <dv-digital-flop :config="surplusConfig" style="width:100%;height:100%;" /> |
| | | </div> |
| | | <p>æåéåº</p> |
| | | <p>æåéæå æ¯</p> |
| | | <br> |
| | | <!-- <p>{{stationstate[1].station_state}}</p> --> |
| | | <!-- <p v-if="stationstate[1].station_state == 'æ£ä¿®ä¸'">{{stationstate[1].station_checkName}}</p> --> |
| | | </li> |
| | | <!-- <li class="user_Overview-item" style="color: #e3b337"> |
| | | <div class="user_Overview_nums offline"> |
| | | <dv-digital-flop :config="offlineconfig" style="width:100%;height:100%;" /> |
| | | </div> |
| | | <p>3å·æ£ä¿®å°</p> |
| | | <br> |
| | | <p>{{stationstate[2].station_state}}</p> |
| | | <p v-if="stationstate[2].station_state == 'æ£ä¿®ä¸'">{{stationstate[2].station_checkName}}</p> |
| | | </li> |
| | | <li class="user_Overview-item" style="color: #e3b337"> |
| | | <div class="user_Overview_nums offline"> |
| | | <dv-digital-flop :config="offlineconfig" style="width:100%;height:100%;" /> |
| | | </div> |
| | | <p>4å·æ£ä¿®å°</p> |
| | | <br> |
| | | <p>{{stationstate[3].station_state}}</p> |
| | | <p v-if="stationstate[3].station_state == 'æ£ä¿®ä¸'">{{stationstate[3].station_checkName}}</p> |
| | | </li> --> |
| | | </ul> |
| | | <Reacquire v-else @onclick="getData" line-height="200px"> |
| | | éæ°è·å |
| | |
| | | |
| | | <script> |
| | | import { currentGET } from 'api/modules' |
| | | import {Floorfault} from "@/api/http.js" |
| | | import { Floorfault } from "@/api/http.js" |
| | | let style = { |
| | | fontSize: 24 |
| | | } |
| | |
| | | onlineNum: 5, |
| | | totalNum: 10, |
| | | }, |
| | | stationstate:[], |
| | | stationstate: [], |
| | | pageflag: true, |
| | | timer: null, |
| | | backConfig: { //æååæ¡ |
| | | number: [9999], |
| | | content: '{nt}', |
| | | backConfig: { // æååæ¡ |
| | | number: [0], |
| | | content: '{nt}%', |
| | | style: { |
| | | ...style, |
| | | // stroke: "#00fdfa", |
| | | fill: "#E6A23C", |
| | | fill: "#b3d1ff", |
| | | }, |
| | | }, |
| | | surplusConfig: { //æå使 |
| | | number: [100], |
| | | content: '{nt}', |
| | | surplusConfig: { // æå使 |
| | | number: [0], |
| | | content: '{nt}%', |
| | | style: { |
| | | ...style, |
| | | // stroke: "#00fdfa", |
| | | fill: "#f56c6c", |
| | | }, |
| | | }, |
| | | inboundConfig: { //æåå
¥åº |
| | | number: [100], |
| | | content: '{nt}', |
| | | inboundConfig: { // æåå
¥åº |
| | | number: [0], |
| | | content: '{nt}%', |
| | | style: { |
| | | ...style, |
| | | // stroke: "#00fdfa", |
| | | fill: "#00fdfa", |
| | | }, |
| | | }, |
| | | outboundConfig: { //æååºåº |
| | | outboundConfig: { // æååºåº |
| | | number: [0], |
| | | content: '{nt}', |
| | | content: '{nt}%', |
| | | style: { |
| | | ...style, |
| | | // stroke: "#07f7a8", |
| | | fill: "#07f7a8", |
| | | }, |
| | | }, |
| | |
| | | }, |
| | | beforeDestroy() { |
| | | this.clearData() |
| | | |
| | | }, |
| | | methods: { |
| | | clearData() { |
| | |
| | | }, |
| | | async getData() { |
| | | this.pageflag = true; |
| | | // currentGET("big2").then((res) => { |
| | | // if (!this.timer) { |
| | | // console.log("è®¾å¤æ»è§2", res); |
| | | // } |
| | | // if (res.success) { |
| | | // this.userOverview = res.data; |
| | | // this.onlineconfig = { |
| | | // ...this.onlineconfig, |
| | | // number: [1] |
| | | // } |
| | | // this.config = { |
| | | // ...this.config, |
| | | // number: [7] |
| | | // } |
| | | // this.offlineconfig = { |
| | | // ...this.offlineconfig, |
| | | // number: [4] |
| | | // } |
| | | // this.laramnumconfig = { |
| | | // ...this.laramnumconfig, |
| | | // number: [10] |
| | | // } |
| | | // this.switper(); |
| | | // } else { |
| | | // this.pageflag = false; |
| | | // this.$Message.warning(res.msg); |
| | | // } |
| | | // }); |
| | | var rep = await Floorfault(); |
| | | try { |
| | | const rep = await Floorfault(); |
| | | |
| | | // æåå个类åçæ°é |
| | | const values = [ |
| | | rep.inboundCount || 0, |
| | | rep.outboundCount || 0, |
| | | rep.allocateCount || 0, |
| | | rep.surplusCount || 0 |
| | | ]; |
| | | |
| | | // è®¡ç®æ»å |
| | | const total = values.reduce((sum, value) => sum + value, 0); |
| | | |
| | | // 计ç®åç±»åç¾åæ¯ï¼ç¡®ä¿æ»å为100%ï¼ |
| | | let percentSum = 0; |
| | | const percentages = values.map((value, index) => { |
| | | // æåä¸ä¸ªç¾åæ¯éè¿åæ³ç¡®ä¿æ»å为100% |
| | | const isLast = index === values.length - 1; |
| | | const percent = isLast |
| | | ? 100 - percentSum |
| | | : total > 0 ? parseFloat(((value / total) * 100).toFixed(1)) : 0; |
| | | |
| | | this.inboundConfig={ |
| | | ...this.inboundConfig, |
| | | number: [rep.inboundCount] |
| | | } |
| | | this.outboundConfig={ |
| | | ...this.outboundConfig, |
| | | number: [rep.outboundCount] |
| | | } |
| | | this.backConfig={ |
| | | ...this.backConfig, |
| | | number: [rep.backboundCount] |
| | | } |
| | | this.surplusConfig={ |
| | | ...this.surplusConfig, |
| | | number: [rep.surplusCount] |
| | | } |
| | | // this.onlineconfig = { |
| | | // ...this.onlineconfig, |
| | | // number: [rep[0].station_qty] |
| | | // } |
| | | // this.config = { |
| | | // ...this.config, |
| | | // number: [rep[1].station_qty] |
| | | // } |
| | | // this.offlineconfig = { |
| | | // ...this.offlineconfig, |
| | | // number: [rep[2].station_qty] |
| | | // } |
| | | // this.offlineconfig = { |
| | | // ...this.offlineconfig, |
| | | // number: [rep[3].station_qty] |
| | | // } |
| | | this.switper(); |
| | | percentSum += percent; |
| | | return percent; |
| | | }); |
| | | |
| | | // æ´æ°æ°åç¿»çå¨é
ç½® |
| | | this.inboundConfig = { ...this.inboundConfig, number: [percentages[0]] }; |
| | | this.outboundConfig = { ...this.outboundConfig, number: [percentages[1]] }; |
| | | this.backConfig = { ...this.backConfig, number: [percentages[3]] }; |
| | | this.surplusConfig = { ...this.surplusConfig, number: [percentages[3]] }; |
| | | |
| | | this.switper(); |
| | | } catch (error) { |
| | | this.pageflag = false; |
| | | console.error("è·åæ°æ®å¤±è´¥ï¼", error); |
| | | this.$Message.warning("æ°æ®è·å失败ï¼è¯·éè¯"); |
| | | } |
| | | }, |
| | | //轮询 |
| | | // 轮询 |
| | | switper() { |
| | | if (this.timer) { |
| | | return |
| | | } |
| | | let looper = (a) => { |
| | | let looper = () => { |
| | | this.getData() |
| | | }; |
| | | this.timer = setInterval(looper, this.$store.state.setting.echartsAutoTime); |
| | |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang='scss' scoped> |
| | | .user_Overview { |
| | | li { |
| | |
| | | text-align: center; |
| | | height: 16px; |
| | | font-size: 16px; |
| | | white-space: nowrap; // 鲿¢æåæ¢è¡ |
| | | margin: 5px 0; // è°æ´é´è· |
| | | } |
| | | |
| | | .user_Overview_nums { |
| | |
| | | } |
| | | |
| | | .allnum { |
| | | |
| | | // background-image: url("../../assets/img/left_top_lan.png"); |
| | | &::before { |
| | | background-image: url("../../assets/img/left_top_lan.png"); |
| | | |
| | | } |
| | | } |
| | | |
| | | .online { |
| | | &::before { |
| | | background-image: url("../../assets/img/left_top_lv.png"); |
| | | |
| | | } |
| | | } |
| | | |
| | | .offline { |
| | | &::before { |
| | | background-image: url("../../assets/img/left_top_huang.png"); |
| | | |
| | | } |
| | | } |
| | | |
| | | .laramnum { |
| | | &::before { |
| | | background-image: url("../../assets/img/left_top_hong.png"); |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <div class="tech-chart-container"> |
| | | <Echart |
| | | :options="options" |
| | | :autoresize="true" |
| | | style="width: 100%; height: 100%" |
| | | /> |
| | | <div id="name" style="width: 100%; height: 100%"> |
| | | <!-- 渲æ ECharts é¥¼å¾ --> |
| | | <Echart :options="options" style="width: 100%; height: 100%"></Echart> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { currentGET } from "api/modules"; |
| | | import { GetCPLargeStockCount } from "@/api/http.js"; |
| | | import * as echarts from 'echarts'; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | options: { |
| | | backgroundColor: 'transparent', |
| | | title: { |
| | | text: 'æå产ååºåæ»æ°', |
| | | subtext: 'å è½½ä¸...', |
| | | textStyle: { |
| | | color: '#00b5f3', |
| | | fontSize: 14, |
| | | }, |
| | | subtextStyle: { |
| | | align: 'center', |
| | | fontSize: 28, |
| | | color: '#4be1ff', |
| | | fontWeight: 'bold', |
| | | textShadow: '0 0 15px rgba(75, 225, 255, 0.7)' |
| | | }, |
| | | x: 'center', |
| | | y: 'center', |
| | | }, |
| | | tooltip: { |
| | | show: false // å®å
¨ç¦ç¨tooltip |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'åºåæ°é', |
| | | type: 'pie', |
| | | radius: ['65%', '85%'], |
| | | center: ['50%', '50%'], |
| | | hoverAnimation: false, // ç¦ç¨æ¬åå¨ç» |
| | | silent: true, // ç¦ç¨ææäº¤äº |
| | | label: { |
| | | show: false |
| | | }, |
| | | labelLine: { |
| | | show: false |
| | | }, |
| | | itemStyle: { |
| | | borderWidth: 0, |
| | | shadowBlur: 20, |
| | | shadowColor: 'rgba(0, 150, 255, 0.5)' |
| | | }, |
| | | data: [{ |
| | | value: 0, |
| | | name: '', |
| | | itemStyle: { |
| | | // éèè²å°èç½è²æ¸åï¼æ·»å å¨æææ |
| | | color: { |
| | | type: 'linear', |
| | | x: 0, |
| | | y: 0, |
| | | x2: 0, |
| | | y2: 1, |
| | | colorStops: [ |
| | | { offset: 0, color: '#00ffcc' }, |
| | | { offset: 0.5, color: '#00b4ff' }, |
| | | { offset: 1, color: '#0062ff' } |
| | | ], |
| | | global: false |
| | | } |
| | | } |
| | | }] |
| | | }, |
| | | // æ·»å å¤åå
åç¯ |
| | | { |
| | | type: 'pie', |
| | | radius: ['85%', '87%'], |
| | | center: ['50%', '50%'], |
| | | hoverAnimation: false, |
| | | silent: true, |
| | | label: { show: false }, |
| | | labelLine: { show: false }, |
| | | itemStyle: { |
| | | // éèè²å°èç½è²æ¸åï¼æ·»å å¨æææ |
| | | color: { |
| | | type: 'linear', |
| | | x: 0, |
| | | y: 0, |
| | | x2: 0, |
| | | y2: 1, |
| | | colorStops: [ |
| | | { offset: 0, color: '#00ffcc' }, |
| | | { offset: 0.5, color: '#00b4ff' }, |
| | | { offset: 1, color: '#0062ff' } |
| | | ], |
| | | global: false |
| | | } |
| | | }, |
| | | data: [{ |
| | | value: 1, |
| | | name: '' |
| | | }] |
| | | }, |
| | | // æ·»å å
åå
åç¯ |
| | | { |
| | | type: 'pie', |
| | | radius: ['63%', '65%'], |
| | | center: ['50%', '50%'], |
| | | hoverAnimation: false, |
| | | silent: true, |
| | | label: { show: false }, |
| | | labelLine: { show: false }, |
| | | itemStyle: { |
| | | // éèè²å°èç½è²æ¸åï¼æ·»å å¨æææ |
| | | color: { |
| | | type: 'linear', |
| | | x: 0, |
| | | y: 0, |
| | | x2: 0, |
| | | y2: 1, |
| | | colorStops: [ |
| | | { offset: 0, color: '#00ffcc' }, |
| | | { offset: 0.5, color: '#00b4ff' }, |
| | | { offset: 1, color: '#0062ff' } |
| | | ], |
| | | global: false |
| | | } |
| | | }, |
| | | data: [{ |
| | | value: 1, |
| | | name: '' |
| | | }] |
| | | }, |
| | | // æ·»å 卿ç²åææ |
| | | { |
| | | type: 'scatter', |
| | | coordinateSystem: 'none', |
| | | data: this.generateParticles(30), |
| | | symbolSize: (val) => { |
| | | return val[2] * 2; |
| | | }, |
| | | itemStyle: { |
| | | color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [ |
| | | { offset: 0, color: 'rgba(0, 255, 255, 0.8)' }, |
| | | { offset: 1, color: 'rgba(0, 255, 255, 0)' } |
| | | ]) |
| | | }, |
| | | // æ·»å ç²åéªçææ |
| | | effect: { |
| | | show: true, |
| | | period: 2, |
| | | trailLength: 0.1, |
| | | symbol: 'circle', |
| | | symbolSize: 0 |
| | | } |
| | | } |
| | | ] |
| | | }, |
| | | timer: null, |
| | | particleTimer: null, |
| | | gradientTimer: null |
| | | pageflag: true, |
| | | options: {}, // åå¨ ECharts é
ç½® |
| | | timer: null // 宿¶å¨æ è¯ |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.fetchData(); |
| | | this.startAutoRefresh(); |
| | | this.startParticleAnimation(); |
| | | this.startGradientAnimation(); |
| | | }, |
| | | beforeDestroy() { |
| | | this.stopAutoRefresh(); |
| | | this.stopParticleAnimation(); |
| | | this.stopGradientAnimation(); |
| | | created() { |
| | | this.getData(); |
| | | }, |
| | | methods: { |
| | | generateParticles(count) { |
| | | const particles = []; |
| | | for (let i = 0; i < count; i++) { |
| | | const angle = Math.random() * Math.PI * 2; |
| | | const radius = 0.7 + Math.random() * 0.2; |
| | | particles.push([ |
| | | Math.cos(angle) * radius, |
| | | Math.sin(angle) * radius, |
| | | Math.random() * 2 + 1 |
| | | ]); |
| | | } |
| | | return particles; |
| | | async getData() { |
| | | const rep = await GetCPLargeStockCount(); |
| | | // ç»è£
饼徿°æ®ï¼[{value: æ°é, name: 产åç¼ç }, ...] |
| | | const pieData = rep.map(item => ({ |
| | | value: item.qtys, |
| | | name: item.pCode |
| | | })); |
| | | // è®¡ç®æ»åï¼ç¨äºè®¡ç®ç¾åæ¯ |
| | | const total = pieData.reduce((acc, cur) => acc + cur.value, 0); |
| | | // é
ç½® ECharts é¥¼å¾ |
| | | this.options = { |
| | | backgroundColor: '#000', |
| | | tooltip: { |
| | | trigger: 'item', // é¼ æ æ¬æµ®æç¤ºï¼è§¦åæ¹å¼ä¸ºâitemâï¼é坹饼徿åºï¼ |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: '客æ·ä»£ç ', |
| | | type: 'pie', |
| | | radius: ['40%', '70%'], // 饼å¾å
å¤åå¾ï¼å®ç°ç¯å½¢/æå½¢ææ |
| | | center: ['50%', '50%'], // 饼å¾å¨å®¹å¨ä¸çä¸å¿ä½ç½® |
| | | color: [ |
| | | 'rgba(135,183,255, 1)', // 对åºç¤ºä¾é¥¼å¾é¢è²ï¼å¯æéè°æ´ |
| | | 'rgba(248,195,248, 1)', |
| | | 'rgba(100,255,249, 1)', |
| | | 'rgba(100,255,249, 1)', |
| | | 'rgba(248,195,248, 1)' |
| | | ], |
| | | label: { |
| | | show: true, |
| | | position: 'outside', |
| | | textStyle: { |
| | | color: '#b3ccf8', |
| | | fontSize: 14, |
| | | fontFamily: 'PingFangSC-Regular' |
| | | }, |
| | | // æ ¼å¼åæ ç¾ï¼æ¾ç¤ºåç§°åç¾åæ¯ |
| | | formatter: (params) => { |
| | | const percent = ((params.value / total) * 100).toFixed(2) + '%'; |
| | | return `${params.name}\n${percent}`; |
| | | } |
| | | }, |
| | | data: pieData, |
| | | }, |
| | | ], |
| | | }; |
| | | }, |
| | | async fetchData() { |
| | | try { |
| | | const response = await GetCPLargeStockCount({}); |
| | | const stockCount = response.stockCount || 0; |
| | | this.updateChart(stockCount); |
| | | } catch (error) { |
| | | console.error('è·ååºåæ»æ°å¤±è´¥:', error); |
| | | this.options.title.subtext = 'æ°æ®å¼å¸¸'; |
| | | this.options.title.subtextStyle.color = '#ff4d4f'; |
| | | } |
| | | // è½®è¯¢ï¼æ¯éä¸å¤©è¯·æ±ä¸æ¬¡æ°æ®ï¼ |
| | | switper() { |
| | | if (this.timer) return; |
| | | // æ¯éä¸å¤©ï¼86400000 毫ç§ï¼æ§è¡ä¸æ¬¡ getData |
| | | this.timer = setInterval(() => { |
| | | this.getData(); |
| | | }, 86400000); |
| | | }, |
| | | updateChart(count) { |
| | | this.options.series[0].data[0].value = count; |
| | | this.options.title.subtext = count + 'ç§'; |
| | | this.options.title.subtextStyle.color = count > 0? '#4be1ff' : '#ff4d4f'; |
| | | }, |
| | | startAutoRefresh() { |
| | | this.stopAutoRefresh(); |
| | | this.timer = setInterval(() => { |
| | | this.fetchData(); |
| | | }, 3000); |
| | | }, |
| | | stopAutoRefresh() { |
| | | if (this.timer) clearInterval(this.timer); |
| | | }, |
| | | startParticleAnimation() { |
| | | this.stopParticleAnimation(); |
| | | this.particleTimer = setInterval(() => { |
| | | this.options.series[3].data = this.generateParticles(30); |
| | | this.options = {...this.options }; // 触åè§å¾æ´æ° |
| | | }, 2000); |
| | | }, |
| | | stopParticleAnimation() { |
| | | if (this.particleTimer) clearInterval(this.particleTimer); |
| | | }, |
| | | startGradientAnimation() { |
| | | this.stopGradientAnimation(); |
| | | this.gradientTimer = setInterval(() => { |
| | | const offset = Math.random(); |
| | | this.options.series.forEach(series => { |
| | | if (series.itemStyle.color.type === 'linear') { |
| | | series.itemStyle.color.colorStops.forEach(stop => { |
| | | stop.offset = (stop.offset + offset) % 1; |
| | | }); |
| | | } |
| | | }); |
| | | this.options = {...this.options }; // 触åè§å¾æ´æ° |
| | | }, 1000); |
| | | }, |
| | | stopGradientAnimation() { |
| | | if (this.gradientTimer) clearInterval(this.gradientTimer); |
| | | }, |
| | | beforeDestroy() { |
| | | // ç»ä»¶éæ¯æ¶æ¸
é¤å®æ¶å¨ |
| | | if (this.timer) { |
| | | clearInterval(this.timer); |
| | | this.timer = null; |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.switper(); // æè½½åå¯å¨å®æ¶å¨ |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .tech-chart-container { |
| | | width: 100%; |
| | | height: 100%; |
| | | position: relative; |
| | | background: radial-gradient(circle at center, #021228 0%, #000810 100%); |
| | | border-radius: 8px; |
| | | overflow: hidden; |
| | | box-shadow: 0 0 30px rgba(0, 100, 255, 0.2); |
| | | |
| | | &::before { |
| | | content: ''; |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background: |
| | | radial-gradient(circle at 20% 30%, rgba(0, 150, 255, 0.1) 0%, transparent 50%), |
| | | radial-gradient(circle at 80% 70%, rgba(0, 200, 255, 0.1) 0%, transparent 50%); |
| | | z-index: 0; |
| | | animation: pulse 8s infinite alternate; |
| | | } |
| | | } |
| | | |
| | | @keyframes pulse { |
| | | 0% { |
| | | opacity: 0.3; |
| | | } |
| | | 100% { |
| | | opacity: 0.7; |
| | | } |
| | | } |
| | | |
| | | ::v-deep .echarts { |
| | | position: relative; |
| | | z-index: 1; |
| | | } |
| | | <style lang='scss' scoped> |
| | | /* è¥æ éç¹æ®æ ·å¼ï¼å¯ç®åæå é¤ */ |
| | | </style> |
| | |
| | | <el-col :span="6"> |
| | | <el-form-item |
| | | required |
| | | :prop="'detailList.' + index + '.scrapProCode'" |
| | | :rules="{ required: true, message: 'è¯·éæ©äº§åç¼ç ', trigger: 'blur' }" |
| | | label="产åç¼ç ï¼" |
| | | > |
| | | <el-select |
| | | v-model="detail.scrapProCode" |
| | |
| | | style="width: 100%;" |
| | | > |
| | | <el-option |
| | | v-for="(code, index) in proCodeOptions" |
| | | :key="index" |
| | | v-for="(code, idx) in proCodeOptions" |
| | | :key="idx" |
| | | :label="code" |
| | | :value="code" |
| | | ></el-option> |
| | |
| | | <el-col :span="5"> |
| | | <el-form-item |
| | | required |
| | | :prop="'detailList.' + index + '.scrapProVersion'" |
| | | :rules="{ required: true, message: 'è¯·éæ©çæ¬', trigger: 'blur' }" |
| | | label="çæ¬ï¼" |
| | | > |
| | | <el-select |
| | | v-model="detail.scrapProVersion" |
| | |
| | | <el-col :span="5"> |
| | | <el-form-item |
| | | required |
| | | :prop="'detailList.' + index + '.scrapProLotNo'" |
| | | :rules="{ required: true, message: 'è¯·éæ©æ¹æ¬¡å·', trigger: 'blur' }" |
| | | label="æ¹æ¬¡å·ï¼" |
| | | > |
| | | <el-select |
| | | v-model="detail.scrapProLotNo" |
| | |
| | | <el-col :span="4"> |
| | | <el-form-item |
| | | required |
| | | :prop="'detailList.' + index + '.scrapPcsQty'" |
| | | :rules="{ |
| | | required: true, |
| | | message: '请è¾å
¥PCSæ°é', |
| | | trigger: 'blur', |
| | | validator: validateNumber // èªå®ä¹æ°åæ ¡éª |
| | | }" |
| | | label="PCSæ°éï¼" |
| | | > |
| | | <el-input |
| | | v-model="detail.scrapPcsQty" |
| | |
| | | export default { |
| | | components: { VolBox }, |
| | | data() { |
| | | const validateNumber = (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(new Error('请è¾å
¥æ°é')); |
| | | } |
| | | const numberRegex = /^\d+(\.\d+)?$/; |
| | | if (!numberRegex.test(value)) { |
| | | return callback(new Error('请è¾å
¥ææçæ°å')); |
| | | } |
| | | if (parseFloat(value) <= 0) { |
| | | return callback(new Error('æ°éå¿
须大äº0')); |
| | | } |
| | | callback(); |
| | | }; |
| | | |
| | | return { |
| | | showDetialBox: false, |
| | | warehouses: [], |
| | |
| | | warehouseId: "", |
| | | proScrapSheetOrderNo: "" |
| | | }, |
| | | |
| | | detailList: [ |
| | | { |
| | | scrapProCode: "", |
| | |
| | | versionOptions: [], |
| | | lotNoOptions: [] |
| | | } |
| | | ], |
| | | validateNumber |
| | | ] |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | warehouseId: "", |
| | | proScrapSheetOrderNo: "" |
| | | }; |
| | | this.proCodeOptions = []; // æ¸
空产åç¼ç å表 |
| | | this.detailList = [this.createEmptyDetail()]; |
| | | |
| | | // å è½½ä»åºå表 |
| | |
| | | |
| | | // ä»åºåæ´äºä»¶ |
| | | handleWarehouseChange(warehouseId) { |
| | | if (!warehouseId) return; |
| | | if (!warehouseId) { |
| | | this.proCodeOptions = []; // ä»åºä¸ºç©ºæ¶æ¸
空产åç¼ç å表 |
| | | return; |
| | | } |
| | | // æ ¹æ®ä»åºIDå 载产åç¼ç å表 |
| | | this.http |
| | | .post(`api/ProStockInfo/GetProCodeByWarehouse?warehouseId=${this.form.warehouseId}`,null, "å è½½äº§åæ°æ®ä¸") |
| | | .post(`api/ProStockInfo/GetProCodeByWarehouse?warehouseId=${warehouseId}`,null, "å è½½äº§åæ°æ®ä¸") |
| | | .then((res) => { |
| | | if (res.status) { |
| | | this.proCodeOptions = [...new Set(res.data)]; |
| | |
| | | |
| | | // 产åç¼ç åæ´äºä»¶ |
| | | handleProCodeChange(detail, index) { |
| | | // æ¸
ç©ºçæ¬åæ¹æ¬¡å· |
| | | detail.versionOptions = []; |
| | | detail.lotNoOptions = []; |
| | | detail.scrapProVersion = ""; |
| | | detail.scrapProLotNo = ""; |
| | | |
| | | if (!detail.scrapProCode) { |
| | | detail.versionOptions = []; |
| | | detail.lotNoOptions = []; |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | // æäº¤è¡¨å |
| | | submitForm() { |
| | | if (!this.form.warehouseId) { |
| | | return this.$message.error("è¯·éæ©æå±ä»åº"); |
| | | } |
| | | // èªå®ä¹éªè¯é»è¾ |
| | | let isValid = true; |
| | | let errorMessage = ''; |
| | | |
| | | const invalidDetail = this.detailList.find(item => |
| | | !item.scrapProCode || !item.scrapProVersion || !item.scrapProLotNo || !item.scrapPcsQty || isNaN(parseFloat(item.scrapPcsQty))|| parseFloat(item.scrapPcsQty) <= 0 |
| | | ); |
| | | |
| | | if (invalidDetail) { |
| | | return this.$message.error("è¯·ä¸ºæææç»è¾å
¥ææçæ°éå¼ï¼å¤§äº0çæ°åï¼"); |
| | | } |
| | | // éªè¯ä»åº |
| | | if (!this.form.warehouseId) { |
| | | isValid = false; |
| | | errorMessage = 'è¯·éæ©æå±ä»åº'; |
| | | } |
| | | |
| | | const submitData = { |
| | | warehouseId: this.form.warehouseId, |
| | | details: this.detailList.map(item => ({ |
| | | scrapProCode: item.scrapProCode, |
| | | scrapProVersion: item.scrapProVersion, |
| | | scrapProLotNo: item.scrapProLotNo, |
| | | scrapPcsQty: parseFloat(item.scrapPcsQty), |
| | | remark: item.remark |
| | | })) |
| | | }; |
| | | // éªè¯æç» |
| | | if (isValid) { |
| | | const invalidDetail = this.detailList.find(item => |
| | | !item.scrapProCode || |
| | | !item.scrapProVersion || |
| | | !item.scrapProLotNo || |
| | | !item.scrapPcsQty || |
| | | isNaN(parseFloat(item.scrapPcsQty)) || |
| | | parseFloat(item.scrapPcsQty) <= 0 |
| | | ); |
| | | |
| | | if (invalidDetail) { |
| | | isValid = false; |
| | | errorMessage = 'æäº¤æ°æ®åå¨ç©ºå¼æè¾å
¥æ°éä¸åæ³ï¼è¯·æ£æ¥ï¼'; |
| | | } |
| | | } |
| | | |
| | | this.http |
| | | .post("api/ErpProScrapSheet/Save", submitData, "æäº¤ä¸") |
| | | .then((res) => { |
| | | // æ ¹æ®éªè¯ç»æå¤ç |
| | | if (!isValid) { |
| | | this.$message.error(errorMessage); |
| | | return; |
| | | } |
| | | |
| | | // éªè¯éè¿ï¼åå¤æäº¤æ°æ® |
| | | const submitData = { |
| | | warehouseId: this.form.warehouseId, |
| | | details: this.detailList.map(item => ({ |
| | | scrapProCode: item.scrapProCode, |
| | | scrapProVersion: item.scrapProVersion, |
| | | scrapProLotNo: item.scrapProLotNo, |
| | | scrapPcsQty: parseFloat(item.scrapPcsQty), |
| | | remark: item.remark |
| | | })) |
| | | }; |
| | | |
| | | this.http |
| | | .post("api/ErpProScrapSheet/Save", submitData, "æäº¤ä¸") |
| | | .then((res) => { |
| | | if (!res.status) return this.$message.error(res.message); |
| | | this.$message.success("æä½æå"); |
| | | this.proCodeOptions = []; |
| | | this.close(); |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.refresh(); |
| | |
| | | // å
³éå¼¹çª |
| | | close() { |
| | | this.showDetialBox = false; |
| | | // æ¸
空产åç¼ç å表 |
| | | this.proCodeOptions = []; |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | ::-webkit-scrollbar-track { |
| | | background-color: #f5f5f5; |
| | | } |
| | | |
| | | /* å¢å éæ©æ¡çé¿åº¦ */ |
| | | .el-select { |
| | | width: 100% !important; |
| | | min-width: 150px !important; |
| | | padding-right:10px; |
| | | } |
| | | .el-input { |
| | | width: 100% !important; |
| | | min-width: 150px !important; |
| | | padding-right:10px; |
| | | } |
| | | |
| | | </style> |
| | |
| | | { |
| | | try |
| | | { |
| | | List<Dt_PurchaseOrderDetail> purchaseOrderDetails = BaseDal.QueryData(x => x.WarehouseId == warehouseId && x.PurchaseDetailStatus != PurchaseOrderDetailStatusEnum.Received.ObjToInt()); |
| | | List<Dt_PurchaseOrderDetail> purchaseOrderDetails = BaseDal.QueryData(x => x.WarehouseId == warehouseId && x.PurchaseDetailStatus != PurchaseOrderDetailStatusEnum.Received.ObjToInt() && x.PurchaseDetailStatus != PurchaseOrderDetailStatusEnum.Closed.ObjToInt()); |
| | | List<string> MaterielCodes = purchaseOrderDetails.Select(x => x.MaterielCode).ToList(); |
| | | MaterielCodes = MaterielCodes.Distinct().ToList(); |
| | | return WebResponseContent.Instance.OK(data: MaterielCodes); |
| | |
| | | { |
| | | try |
| | | { |
| | | List<Dt_PurchaseOrderDetail> purchaseOrderDetails = BaseDal.QueryData(x => x.MaterielCode == materielCode && x.PurchaseDetailStatus != PurchaseOrderDetailStatusEnum.Received.ObjToInt()); |
| | | List<Dt_PurchaseOrderDetail> purchaseOrderDetails = BaseDal.QueryData(x => x.MaterielCode == materielCode && x.PurchaseDetailStatus != PurchaseOrderDetailStatusEnum.Received.ObjToInt()&& x.PurchaseDetailStatus!=PurchaseOrderDetailStatusEnum.Closed.ObjToInt()); |
| | | List<int> PurchaseOrderIds = purchaseOrderDetails.Select(x => x.PurchaseOrderId).ToList(); |
| | | List<Dt_PurchaseOrder> purchaseOrders = BaseDal.Db.Queryable<Dt_PurchaseOrder>().Where(x => PurchaseOrderIds.Contains(x.Id)).ToList(); |
| | | List<string> PurchaseOrderNos = purchaseOrders.Select(x => x.PurchaseOrderNo).ToList(); |
| | |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.Seed; |
| | | using WIDESEA_DTO.Outbound; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_Model.Models; |
| | |
| | | public partial class ErpProScrapSheetService : ServiceBase<Dt_ErpProScrapSheet, IErpProScrapSheetRepository>, IErpProScrapSheetService |
| | | { |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly IWarehouseService _warehouseService; |
| | | |
| | | public IErpProScrapSheetRepository Repository => BaseDal; |
| | | |
| | | public ErpProScrapSheetService(IErpProScrapSheetRepository BaseDal, IUnitOfWorkManage unitOfWorkManage,IWarehouseService warehouseService) : base(BaseDal) |
| | | public ErpProScrapSheetService(IErpProScrapSheetRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _warehouseService = warehouseService; |
| | | } |
| | | public override WebResponseContent AddData(SaveModel saveModel) |
| | | { |