Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn
| | |
| | | // import { config } from 'vue/types/umd'; |
| | | axios.defaults.withCredentials=true; |
| | | axios.defaults.crossDomain=true; |
| | | axios.defaults.baseURL = 'http://10.30.4.92:9283';//'http://192.168.2.51:8099'; //'http://localhost:8099'; //'http://192.168.2.51:8099';// |
| | | 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.headers.post["Content-Type"]="application/json;charset=utf-8"; |
| | | // é误信æ¯å¤ç |
| | | const errorHandle = (status, other) => { |
| | |
| | | let baseUrl = UtilVar.baseUrl |
| | | const CancelToken = axios.CancelToken; |
| | | export { baseUrl }; |
| | | // axios.defaults.withCredentials = true; |
| | | axios.defaults.withCredentials = true; |
| | | // æ·»å è¯·æ±æ¦æªå¨ |
| | | axios.interceptors.request.use(function (config) { |
| | | // å¨åé请æ±ä¹ååäºä»ä¹ ä¼ token |
| | |
| | | export function ProLocationStatistics (data) { |
| | | return axios.post('/api/Large/ProLocationStatistics?id=7', data)//è¿åçæ¶promieså¯¹è±¡ï¼æä»¥ç´æ¥returnåºå»å°±å¥½äº |
| | | } |
| | | //æåè¿ä¸å¤©ç»è®¡ |
| | | //æåå
¥åºäº§éç»è®¡ |
| | | export function Productions (data) { |
| | | return axios.post('/api/Large/Productions', data)//è¿åçæ¶promieså¯¹è±¡ï¼æä»¥ç´æ¥returnåºå»å°±å¥½äº |
| | | } |
| | |
| | | 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åºå»å°±å¥½äº |
| | | } |
| | | //æåè¿ä¸å¤©ä»»å¡ç»è®¡ |
| | | export function GetProWeekTasks (data) { |
| | | return axios.post('/api/Large/GetProWeekTasks', data)//è¿åçæ¶promieså¯¹è±¡ï¼æä»¥ç´æ¥returnåºå»å°±å¥½äº |
| | | } |
| | |
| | | ]; |
| | | const router = new VueRouter({ |
| | | mode: "hash", |
| | | // base: process.env.BASE_URL, |
| | | base: process.env.BASE_URL, |
| | | routes |
| | | }); |
| | | |
| | |
| | | limitMoveNum: 4, // å¼å§æ ç¼æ»å¨çæ°æ®é this.dataList.length |
| | | singleHeight: 0, // 忥è¿å¨åæ¢çé«åº¦(é»è®¤å¼0æ¯æ ç¼ä¸åæ¢çæ»å¨) direction => 0/1 |
| | | singleWidth: 0, // 忥è¿å¨åæ¢ç宽度(é»è®¤å¼0æ¯æ ç¼ä¸åæ¢çæ»å¨) direction => 2/3 |
| | | waitTime: 3000 // 忥è¿å¨åæ¢çæ¶é´(é»è®¤å¼1000ms) |
| | | waitTime: 8000 // 忥è¿å¨åæ¢çæ¶é´(é»è®¤å¼1000ms) |
| | | }, |
| | | echartsAutoTime:3000,//echarts å¾èªå¨è¯·æ±æ¥å£æ¶é´ |
| | | echartsAutoTime:8000,//echarts å¾èªå¨è¯·æ±æ¥å£æ¶é´ |
| | | }), |
| | | getters: { |
| | | //æ ¹æ®èåè·¯å¾è·å èåä¿¡æ¯ |
| | |
| | | color: "#FFF", |
| | | show: true, |
| | | }, |
| | | // colorBy: "data", |
| | | colorBy: "data", |
| | | itemStyle: { |
| | | color: "rgba(255,255,255,1)", |
| | | borderColor: "rgba(2255,255,255,2)", |
| | |
| | | #00eaff 48.8525390625%, |
| | | #01aaff 100% |
| | | ); |
| | | -webkit-background-clip: text; |
| | | |
| | | -webkit-text-fill-color: transparent; |
| | | margin: 0 10px; |
| | | } |
| | |
| | | |
| | | <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> |
| | | <div class="contetn_center"> |
| | | <ItemWrap class="contetn_left-bottom contetn_lr-item" style="height: 66vh;" title="æåä»»å¡ç»è®¡"> |
| | | <ItemWrap class="contetn_left-bottom contetn_lr-item" style="height: 66vh;" title="æåè¿ä¹å¤©ä»»å¡ç»è®¡"> |
| | | <LeftBottom/> |
| | | </ItemWrap> |
| | | <ItemWrap |
| | |
| | | <!-- |
| | | * @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> |
| | | <div id="name" style="width: 100%; height: 100%"> |
| | | <Echart :options="options" style="width: 100%; height: 100%"></Echart> |
| | | <Echart |
| | | :options="options" |
| | | style="width: 100%; height: 100%" |
| | | v-if="!loading" |
| | | /> |
| | | <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> |
| | | |
| | | <script> |
| | | import { currentGET } from "api/modules"; |
| | | import { ProLocationStatistics } from "@/api/http.js"; |
| | | import { GetProWeekTasks } from "@/api/http.js"; |
| | | import * as echarts from 'echarts'; |
| | | let style = { |
| | | fontSize: 24, |
| | | }; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | pageflag: true, |
| | | myChart: {}, |
| | | options: {}, |
| | | loading: false, |
| | | error: null, |
| | | timer: null |
| | | }; |
| | | }, |
| | | filters: { |
| | | numsFilter(msg) { |
| | | return msg || 0; |
| | | }, |
| | | }, |
| | | created() { |
| | | this.getData(); |
| | | }, |
| | | mounted() { |
| | | this.init(); |
| | | this.fetchData(); |
| | | this.startAutoRefresh(); |
| | | }, |
| | | beforeDestroy() { |
| | | this.clearData(); |
| | | this.stopAutoRefresh(); |
| | | }, |
| | | methods: { |
| | | init() { |
| | | initEmptyChart() { |
| | | this.options = { |
| | | //æµ®å¨æ¡ |
| | | tooltip: {}, |
| | | //å¾ä¾ |
| | | legend: { |
| | | right: '12%', |
| | | bottom: '4%', |
| | | textStyle: { |
| | | color: '#fff', |
| | | fontSize: '13' |
| | | }, |
| | | itemGap: 20, |
| | | itemWidth: 10, |
| | | itemHeight: 10, |
| | | icon: 'circle', |
| | | data: ['PM2.5', 'CO2', 'SO'] |
| | | }, |
| | | grid: { |
| | | left: '8%', |
| | | top: '15%', |
| | | bottom: '14%', |
| | | width: '86%', |
| | | }, |
| | | visualMap: [{ |
| | | type: 'piecewise', |
| | | show: false, |
| | | pieces: [{ |
| | | gt: 0, |
| | | lte: 60, |
| | | color: '#69dbf7' |
| | | }, { |
| | | gte: 60, |
| | | color: '#e5421b' |
| | | }], |
| | | seriesName: 'SO', |
| | | seriesIndex: 2 |
| | | }, { |
| | | type: 'piecewise', |
| | | show: false, |
| | | pieces: [{ |
| | | gt: 0, |
| | | lte: 60, |
| | | color: '#1be57a' |
| | | }, { |
| | | gte: 60, |
| | | color: '#e5421b' |
| | | }], |
| | | seriesName: 'CO2', |
| | | seriesIndex: 1 |
| | | }, { |
| | | type: 'piecewise', |
| | | show: false, |
| | | pieces: [{ |
| | | gt: 0, |
| | | lte: 60, |
| | | color: '#feb01e' |
| | | }, { |
| | | gte: 60, |
| | | color: '#e5421b' |
| | | }], |
| | | seriesName: 'PM2.5', |
| | | seriesIndex: 0 |
| | | }, { |
| | | type: 'piecewise', |
| | | show: false, |
| | | pieces: [{ |
| | | gt: 0, |
| | | lte: 60, |
| | | color: '#69dbf7' |
| | | }, { |
| | | gte: 60, |
| | | color: '#e5421b' |
| | | }], |
| | | seriesName: 'SO', |
| | | seriesIndex: 5 |
| | | }, { |
| | | type: 'piecewise', |
| | | show: false, |
| | | pieces: [{ |
| | | gt: 0, |
| | | lte: 60, |
| | | color: '#1be57a' |
| | | }, { |
| | | gte: 60, |
| | | color: '#e5421b' |
| | | }], |
| | | seriesName: 'CO2', |
| | | seriesIndex: 4 |
| | | }, { |
| | | type: 'piecewise', |
| | | show: false, |
| | | pieces: [{ |
| | | gt: 0, |
| | | lte: 60, |
| | | color: '#feb01e' |
| | | }, { |
| | | gte: 60, |
| | | color: '#e5421b' |
| | | }], |
| | | seriesName: 'PM2.5', |
| | | seriesIndex: 3 |
| | | }], |
| | | //xè½´ |
| | | xAxis: { |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: '#132987' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | textStyle: { |
| | | color: '#FFF', |
| | | fontSize: 12 |
| | | }, |
| | | }, |
| | | //å»åº¦çº¿ |
| | | axisTick: { |
| | | show: false |
| | | }, |
| | | //åæ è½´æ¾ç¤ºå¼ |
| | | data: ["1æ¶", "2æ¶", "3æ¶", "4æ¶", "5æ¶", "6æ¶", "7æ¶", "8æ¶"] |
| | | }, |
| | | //yè½´ |
| | | yAxis: { |
| | | min: 0, |
| | | max: 100, |
| | | axisLabel: { // æ¹åyè½´åä½é¢è²åå¤§å° |
| | | //formatter: '{value} m³ ', // ç»yè½´æ·»å åä½ |
| | | textStyle: { |
| | | color: '#fff', |
| | | fontSize: 12, |
| | | }, |
| | | }, |
| | | //åæ è½´çº¿ |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | //å»åº¦çº¿ |
| | | axisTick: { |
| | | show: false |
| | | }, |
| | | //å¨gridåºåä¸çåé线 |
| | | splitLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: '#132987', |
| | | } |
| | | }, |
| | | }, |
| | | |
| | | // |
| | | series: [{ |
| | | name: 'PM2.5', |
| | | type: 'line', |
| | | symbolSize: [0, 0], |
| | | itemStyle: { |
| | | color: '#feb01e' |
| | | }, |
| | | data: [43, 50, 41, 18, 28, 25, 26, 40], |
| | | }, { |
| | | name: 'CO2', |
| | | type: 'line', |
| | | symbolSize: [0, 0], |
| | | itemStyle: { |
| | | color: '#1be57a' |
| | | }, |
| | | data: [21, 30, 37, 39, 23, 37, 5, 50] |
| | | }, { |
| | | name: 'SO', |
| | | type: 'line', |
| | | symbolSize: [0, 0], |
| | | itemStyle: { |
| | | color: '#69dbf7' |
| | | }, |
| | | data: [76, 58, 60, 38, 49, 59, 78, 60] |
| | | }, { //æ°´æ³¢çº¹ç¹ |
| | | name: 'PM2.5', |
| | | type: 'effectScatter', |
| | | symbolSize: [5, 5], |
| | | rippleEffect: { |
| | | period: 1, |
| | | scale: 4, |
| | | brushType: 'fill' |
| | | }, |
| | | itemStyle: { |
| | | color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{ |
| | | offset: 0, |
| | | color: '#feb01e' |
| | | }, { |
| | | offset: 1, |
| | | color: 'rgba(254,176,30,.3)' |
| | | }]) |
| | | }, |
| | | data: [43, 50, 41, 18, 28, 25, 26, 40] |
| | | |
| | | }, { //æ°´æ³¢çº¹ç¹ |
| | | name: 'CO2', |
| | | type: 'effectScatter', |
| | | symbolSize: [5, 5], |
| | | rippleEffect: { |
| | | period: 1, |
| | | scale: 4, |
| | | brushType: 'fill' |
| | | }, |
| | | itemStyle: { |
| | | color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{ |
| | | offset: 0, |
| | | color: '#1be57a' |
| | | }, { |
| | | offset: 1, |
| | | color: 'rgba(27,229,122,.3)' |
| | | }]) |
| | | }, |
| | | data: [21, 30, 37, 39, 23, 37, 5, 50] |
| | | |
| | | }, { //æ°´æ³¢çº¹ç¹ |
| | | name: 'SO', |
| | | type: 'effectScatter', |
| | | symbolSize: [5, 5], |
| | | rippleEffect: { |
| | | period: 1, |
| | | scale: 4, |
| | | brushType: 'fill' |
| | | }, |
| | | itemStyle: { |
| | | color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{ |
| | | offset: 0, |
| | | color: '#69dbf7' |
| | | }, { |
| | | offset: 1, |
| | | color: '#aefbc3' |
| | | }]) |
| | | }, |
| | | markLine: { |
| | | symbol: "none", |
| | | label: { |
| | | normal: { |
| | | show: false, |
| | | } |
| | | }, |
| | | lineStyle: { |
| | | type: "solid", |
| | | color: 'rgba(210,56,56,.6)', |
| | | width: 2 |
| | | }, |
| | | data: [{ |
| | | yAxis: 60 |
| | | }] |
| | | }, |
| | | data: [76, 58, 60, 38, 49, 59, 78, 60] |
| | | |
| | | }] |
| | | }; |
| | | }, |
| | | clearData() { |
| | | if (this.timer) { |
| | | clearInterval(this.timer); |
| | | this.timer = null; |
| | | } |
| | | }, |
| | | 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 ProLocationStatistics(); |
| | | this.options = { |
| | | //æµ®å¨æ¡ |
| | | tooltip: {}, |
| | | //å¾ä¾ |
| | | legend: { |
| | | right: '12%', |
| | | bottom: '4%', |
| | | textStyle: { |
| | | color: '#fff', |
| | | fontSize: '13' |
| | | }, |
| | | itemGap: 20, |
| | | itemWidth: 10, |
| | | itemHeight: 10, |
| | | icon: 'circle', |
| | | data: ['æåå
¥åº', 'æååºåº', 'æååæ¡'] |
| | | }, |
| | | grid: { |
| | | left: '8%', |
| | | top: '15%', |
| | | bottom: '14%', |
| | | width: '86%', |
| | | }, |
| | | visualMap: [{ |
| | | type: 'piecewise', |
| | | show: false, |
| | | pieces: [{ |
| | | gt: 0, |
| | | lte: 60, |
| | | color: '#69dbf7' |
| | | }, { |
| | | gte: 60, |
| | | color: '#e5421b' |
| | | }], |
| | | seriesName: 'æåå
¥åº', |
| | | seriesIndex: 2 |
| | | }, { |
| | | type: 'piecewise', |
| | | show: false, |
| | | pieces: [{ |
| | | gt: 0, |
| | | lte: 60, |
| | | color: '#1be57a' |
| | | }, { |
| | | gte: 60, |
| | | color: '#e5421b' |
| | | }], |
| | | seriesName: 'æååºåº', |
| | | seriesIndex: 1 |
| | | }, { |
| | | type: 'piecewise', |
| | | show: false, |
| | | pieces: [{ |
| | | gt: 0, |
| | | lte: 60, |
| | | color: '#feb01e' |
| | | }, { |
| | | gte: 60, |
| | | color: '#e5421b' |
| | | }], |
| | | seriesName: 'æååæ¡', |
| | | seriesIndex: 0 |
| | | }], |
| | | //xè½´ |
| | | xAxis: { |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: '#132987' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | textStyle: { |
| | | color: '#FFF', |
| | | fontSize: 12 |
| | | }, |
| | | }, |
| | | //å»åº¦çº¿ |
| | | axisTick: { |
| | | show: false |
| | | }, |
| | | //åæ è½´æ¾ç¤ºå¼ |
| | | data: ["04/19", "04/20", "04/21", "04/22", "04/23", "04/24", "04/25"] |
| | | }, |
| | | //yè½´ |
| | | yAxis: { |
| | | axisLabel: { // æ¹åyè½´åä½é¢è²åå¤§å° |
| | | //formatter: '{value} m³ ', // ç»yè½´æ·»å åä½ |
| | | textStyle: { |
| | | color: '#fff', |
| | | fontSize: 12, |
| | | }, |
| | | }, |
| | | //åæ è½´çº¿ |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | //å»åº¦çº¿ |
| | | axisTick: { |
| | | show: false |
| | | }, |
| | | //å¨gridåºåä¸çåé线 |
| | | splitLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: '#132987', |
| | | } |
| | | }, |
| | | }, |
| | | |
| | | // |
| | | series: [{ |
| | | name: 'æåå
¥åº', |
| | | type: 'line', |
| | | symbolSize: [0, 0], |
| | | itemStyle: { |
| | | color: '#feb01e' |
| | | }, |
| | | data: [160, 156, 150, 180, 170, 200, 20], |
| | | }, { |
| | | name: 'æååºåº', |
| | | type: 'line', |
| | | symbolSize: [0, 0], |
| | | itemStyle: { |
| | | color: '#1be57a' |
| | | }, |
| | | data: [80, 115, 120, 130, 91, 99, 20] |
| | | }, { |
| | | name: 'æååæ¡', |
| | | type: 'line', |
| | | symbolSize: [0, 0], |
| | | itemStyle: { |
| | | color: '#69dbf7' |
| | | }, |
| | | data: [70, 113, 118, 111, 89, 99, 32] |
| | | }, { //æ°´æ³¢çº¹ç¹ |
| | | name: 'æåå
¥åº', |
| | | type: 'effectScatter', |
| | | symbolSize: [5, 5], |
| | | rippleEffect: { |
| | | period: 1, |
| | | scale: 4, |
| | | brushType: 'fill' |
| | | }, |
| | | itemStyle: { |
| | | color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{ |
| | | offset: 0, |
| | | color: '#feb01e' |
| | | }, { |
| | | offset: 1, |
| | | color: 'rgba(254,176,30,.3)' |
| | | }]) |
| | | }, |
| | | data: [160, 156, 150, 180, 170, 200, 20] |
| | | |
| | | }, { //æ°´æ³¢çº¹ç¹ |
| | | name: 'æååºåº', |
| | | type: 'effectScatter', |
| | | symbolSize: [5, 5], |
| | | rippleEffect: { |
| | | period: 1, |
| | | scale: 4, |
| | | brushType: 'fill' |
| | | }, |
| | | itemStyle: { |
| | | color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{ |
| | | offset: 0, |
| | | color: '#1be57a' |
| | | }, { |
| | | offset: 1, |
| | | color: 'rgba(27,229,122,.3)' |
| | | }]) |
| | | }, |
| | | data: [80, 115, 120, 130, 91, 99, 20] |
| | | |
| | | }, { //æ°´æ³¢çº¹ç¹ |
| | | name: 'æååæ¡', |
| | | type: 'effectScatter', |
| | | symbolSize: [5, 5], |
| | | rippleEffect: { |
| | | period: 1, |
| | | scale: 4, |
| | | brushType: 'fill' |
| | | }, |
| | | itemStyle: { |
| | | color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{ |
| | | offset: 0, |
| | | color: '#69dbf7' |
| | | }, { |
| | | offset: 1, |
| | | color: '#aefbc3' |
| | | }]) |
| | | }, |
| | | markLine: { |
| | | symbol: "none", |
| | | label: { |
| | | normal: { |
| | | show: false, |
| | | } |
| | | }, |
| | | lineStyle: { |
| | | type: "solid", |
| | | color: 'rgba(210,56,56,.6)', |
| | | width: 2 |
| | | }, |
| | | data: [{ |
| | | yAxis: 60 |
| | | }] |
| | | }, |
| | | data: [70, 113, 118, 111, 89, 99, 32] |
| | | |
| | | }] |
| | | }; |
| | | this.switper(); |
| | | }, |
| | | //轮询 |
| | | switper() { |
| | | if (this.timer) { |
| | | return; |
| | | } |
| | | let looper = (a) => { |
| | | this.getData(); |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | formatter: params => { |
| | | let result = `${params[0].axisValue}<br>`; |
| | | params.forEach(item => { |
| | | result += `${item.marker} ${item.seriesName}: ${item.value}<br>`; |
| | | }); |
| | | return result; |
| | | } |
| | | }, |
| | | legend: { |
| | | right: '12%', |
| | | bottom: '4%', |
| | | textStyle: { |
| | | color: '#fff', |
| | | fontSize: '13' |
| | | }, |
| | | itemGap: 20, |
| | | itemWidth: 10, |
| | | itemHeight: 10, |
| | | icon: 'circle', |
| | | data: ['æåå
¥åº', 'æååºåº', '空æ¡åæµ', 'æåååº'] |
| | | }, |
| | | grid: { |
| | | left: '8%', |
| | | top: '15%', |
| | | bottom: '14%', |
| | | width: '86%', |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: '#132987' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | textStyle: { |
| | | color: '#FFF', |
| | | fontSize: 12 |
| | | }, |
| | | }, |
| | | axisTick: { |
| | | show: false |
| | | }, |
| | | data: ['å è½½ä¸...'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | axisLabel: { |
| | | textStyle: { |
| | | color: '#fff', |
| | | fontSize: 12, |
| | | }, |
| | | }, |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | axisTick: { |
| | | show: false |
| | | }, |
| | | splitLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: '#132987', |
| | | } |
| | | }, |
| | | }, |
| | | series: [ |
| | | { name: 'æåå
¥åº', type: 'line', data: [] }, |
| | | { name: 'æååºåº', type: 'line', data: [] }, |
| | | { name: '空æ¡åæµ', type: 'line', data: [] }, |
| | | { name: 'æåååº', type: 'line', data: [] } |
| | | ] |
| | | }; |
| | | this.timer = setInterval( |
| | | looper, |
| | | this.$store.state.setting.echartsAutoTime |
| | | ); |
| | | }, |
| | | }, |
| | | async fetchData() { |
| | | this.loading = true; |
| | | this.error = null; |
| | | |
| | | try { |
| | | console.log('æ£å¨è¯·æ±æ°æ®...'); |
| | | const response = await GetProWeekTasks({}); |
| | | console.log('宿´ååº:', response); // æå°å®æ´ååºæ¥çç»æ |
| | | |
| | | // ç´æ¥ä½¿ç¨responseä½ä¸ºæ°æ®ï¼æ ¹æ®å®é
ååºç»æè°æ´ï¼ |
| | | if (!response || !response.dateRange || !response.dailyStatistics) { |
| | | throw new Error('æ°æ®æ ¼å¼ä¸æ£ç¡®'); |
| | | } |
| | | |
| | | this.updateChart(response); // ç´æ¥ä¼ å
¥responseï¼èéresponse.data |
| | | } catch (error) { |
| | | console.error('è·åæ°æ®é误:', error); |
| | | this.error = error.message; |
| | | this.initEmptyChart(); |
| | | } finally { |
| | | this.loading = false; |
| | | } |
| | | }, |
| | | updateChart(data) { |
| | | |
| | | |
| | | const dates = data.dateRange; |
| | | const stats = data.dailyStatistics; |
| | | |
| | | const seriesData = { |
| | | 'æåå
¥åº': [], |
| | | 'æååºåº': [], |
| | | '空æ¡åæµ': [], |
| | | 'æåååº': [] |
| | | }; |
| | | |
| | | // æ ¹æ®å®é
æ°æ®æ ¼å¼è°æ´å段åï¼å°åå¼å¤´ï¼ |
| | | stats.forEach(day => { |
| | | seriesData['æåå
¥åº'].push(day.inProduct || 0); |
| | | seriesData['æååºåº'].push(day.outProduct || 0); |
| | | seriesData['空æ¡åæµ'].push(day.emptyProductBack || 0); |
| | | seriesData['æåååº'].push(day.inProductBack || 0); |
| | | }); |
| | | |
| | | this.options = { |
| | | ...this.options, |
| | | xAxis: { |
| | | ...this.options.xAxis, |
| | | data: dates |
| | | }, |
| | | series: this.options.series.map(series => ({ |
| | | ...series, |
| | | data: seriesData[series.name] || [] |
| | | })) |
| | | }; |
| | | }, |
| | | startAutoRefresh() { |
| | | this.stopAutoRefresh(); |
| | | this.timer = setInterval(() => { |
| | | this.fetchData(); |
| | | }, this.$store.state.setting.echartsAutoTime || 10000); |
| | | }, |
| | | stopAutoRefresh() { |
| | | if (this.timer) clearInterval(this.timer); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang='scss' scoped> |
| | | .user_Overview { |
| | | li { |
| | |
| | | <!-- |
| | | * @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> |
| | | <div id="name" style="width: 100%; height: 100%"> |
| | | <Echart :options="options" style="width: 100%; height: 100%"></Echart> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { currentGET } from "api/modules"; |
| | | import { ProductionStock } from "@/api/http.js"; |
| | | import * as echarts from 'echarts'; |
| | | let style = { |
| | | fontSize: 24, |
| | | }; |
| | | export default { |
| | | data() { |
| | | return { |
| | | pageflag: true, |
| | | myChart: {}, |
| | | options: {}, |
| | | }; |
| | | }, |
| | | filters: { |
| | | numsFilter(msg) { |
| | | return msg || 0; |
| | | }, |
| | | }, |
| | | created() { |
| | | this.getData(); |
| | | }, |
| | | mounted() { |
| | | this.init(); |
| | | }, |
| | | beforeDestroy() { |
| | | this.clearData(); |
| | | }, |
| | | methods: { |
| | | init() { |
| | | let dataPie = [ |
| | | <div class="tech-chart-container"> |
| | | <Echart |
| | | :options="options" |
| | | :autoresize="true" |
| | | style="width: 100%; height: 100%" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | { |
| | | value: 410, |
| | | name: 'ä¼ä¸' |
| | | }, |
| | | { |
| | | value: 380, |
| | | name: 'æ¿åº' |
| | | }, |
| | | { |
| | | value: 501, |
| | | name: '个人' |
| | | }, |
| | | ]; |
| | | let colorPie = ['#173852', '#0b2036', '#002e49']; |
| | | let colorWrap = ['#3087d6', '#afe1ff', '#4be1ff']; |
| | | let baseDataPie = [], |
| | | baseDataWrap = []; |
| | | for (var i = 0; i < dataPie.length; i++) { |
| | | baseDataPie.push({ |
| | | value: dataPie[i].value, |
| | | name: dataPie[i].name, |
| | | itemStyle: { |
| | | normal: { |
| | | borderWidth: 50, |
| | | <script> |
| | | import { GetCPLargeStockCount } from "@/api/http.js"; |
| | | import * as echarts from 'echarts'; |
| | | |
| | | borderColor: colorPie[i], |
| | | |
| | | } |
| | | } |
| | | }); |
| | | baseDataWrap.push({ |
| | | value: dataPie[i].value, |
| | | name: dataPie[i].name, |
| | | itemStyle: { |
| | | normal: { |
| | | color: colorWrap[i], |
| | | borderWidth: 10, |
| | | borderColor: colorWrap[i], |
| | | shadowBlur: 50, |
| | | shadowColor: 'rgba(48, 135, 214, 0.3)', |
| | | } |
| | | } |
| | | }, { |
| | | value: 10, |
| | | name: '', |
| | | itemStyle: { |
| | | normal: { |
| | | color: 'transparent', |
| | | borderWidth: 10, |
| | | borderColor: 'transparent', |
| | | |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | this.options = { |
| | | backgroundColor: '#021228', |
| | | title: { |
| | | text: 'æ¥è¦æ»æ°', |
| | | subtext: '10,225', |
| | | textStyle: { |
| | | export default { |
| | | data() { |
| | | return { |
| | | options: { |
| | | backgroundColor: 'transparent', |
| | | title: { |
| | | text: 'æå产ååºåæ»æ°', |
| | | subtext: 'å è½½ä¸...', |
| | | textStyle: { |
| | | color: '#00b5f3', |
| | | fontSize: 12, |
| | | |
| | | }, |
| | | subtextStyle: { |
| | | fontSize: 14, |
| | | }, |
| | | subtextStyle: { |
| | | align: 'center', |
| | | fontSize: 18, |
| | | color: ['#85c7e3'], |
| | | fontWeight:800 |
| | | fontSize: 28, |
| | | color: '#4be1ff', |
| | | fontWeight: 'bold', |
| | | textShadow: '0 0 15px rgba(75, 225, 255, 0.7)' |
| | | }, |
| | | x: 'center', |
| | | y: 'center', |
| | | }, |
| | | x: '38%', |
| | | y: 'center', |
| | | }, |
| | | tooltip: { |
| | | show: true, |
| | | trigger: 'item', |
| | | formatter: "{a}ï¼{b} <br/>å æ¯ï¼{d}%" |
| | | }, |
| | | legend: { |
| | | data: ['ä¼ä¸', 'æ¿åº', '个人'], |
| | | icon: 'vertical', |
| | | right: '1%', |
| | | top: 'center', |
| | | orient: 'vertical', |
| | | itemGap: 20, |
| | | itemWidth: 15, |
| | | itemHeight: 8, |
| | | |
| | | formatter: function(name) { |
| | | let target; |
| | | for (let i = 0; i < dataPie.length; i++) { |
| | | if (dataPie[i].name === name) { |
| | | target = dataPie[i].value |
| | | } |
| | | } |
| | | let arr = [name, target]; |
| | | return arr.join("\n") |
| | | |
| | | tooltip: { |
| | | show: false // å®å
¨ç¦ç¨tooltip |
| | | }, |
| | | textStyle: { |
| | | lineHeight: 20, |
| | | color: '#9ed2f5', |
| | | |
| | | }, |
| | | }, |
| | | grid: { |
| | | left: '1%', // ä¸å®¹å¨å·¦ä¾§çè·ç¦» |
| | | right: '1%', // ä¸å®¹å¨å³ä¾§çè·ç¦» |
| | | top: '1%', // ä¸å®¹å¨é¡¶é¨çè·ç¦» |
| | | bottom: '1%', // ä¸å®¹å¨åºé¨çè·ç¦» |
| | | |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '', |
| | | series: [ |
| | | { |
| | | name: 'åºåæ°é', |
| | | type: 'pie', |
| | | clockWise: false, //顺æ¶å è½½ |
| | | hoverAnimation: false, //é¼ æ ç§»å
¥å大 |
| | | center: ['40%', '50%'], |
| | | radius: ['80%', '81%'], |
| | | tooltip: { |
| | | show: false |
| | | }, |
| | | radius: ['65%', '85%'], |
| | | center: ['50%', '50%'], |
| | | hoverAnimation: false, // ç¦ç¨æ¬åå¨ç» |
| | | silent: true, // ç¦ç¨ææäº¤äº |
| | | label: { |
| | | normal: { |
| | | show: false |
| | | } |
| | | show: false |
| | | }, |
| | | data: baseDataWrap |
| | | }, |
| | | { |
| | | |
| | | name: 'æ¥è¦', |
| | | 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', |
| | | color: colorPie, |
| | | selectedMode: 'single', |
| | | radius: ['55%', '58%'], |
| | | center: ['40%', '50%'], |
| | | radius: ['85%', '87%'], |
| | | center: ['50%', '50%'], |
| | | hoverAnimation: false, |
| | | label: { |
| | | normal: { |
| | | show: 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: baseDataPie |
| | | }, |
| | | |
| | | ] |
| | | }; |
| | | }, |
| | | clearData() { |
| | | if (this.timer) { |
| | | clearInterval(this.timer); |
| | | this.timer = null; |
| | | } |
| | | }, |
| | | 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 ProductionStock(); |
| | | let dataPie = [ |
| | | { |
| | | value: 430, |
| | | name: 'åºå产å' |
| | | }, |
| | | ]; |
| | | let colorPie = ['#173852']; |
| | | let colorWrap = ['#3087d6']; |
| | | let baseDataPie = [], |
| | | baseDataWrap = []; |
| | | for (var i = 0; i < dataPie.length; i++) { |
| | | baseDataPie.push({ |
| | | value: dataPie[i].value, |
| | | name: dataPie[i].name, |
| | | itemStyle: { |
| | | normal: { |
| | | borderWidth: 50, |
| | | |
| | | borderColor: colorPie[i], |
| | | |
| | | } |
| | | } |
| | | }); |
| | | baseDataWrap.push({ |
| | | value: dataPie[i].value, |
| | | name: dataPie[i].name, |
| | | itemStyle: { |
| | | normal: { |
| | | color: colorWrap[i], |
| | | borderWidth: 10, |
| | | borderColor: colorWrap[i], |
| | | shadowBlur: 50, |
| | | shadowColor: 'rgba(48, 135, 214, 0.3)', |
| | | } |
| | | } |
| | | }, { |
| | | value: 10, |
| | | name: '', |
| | | itemStyle: { |
| | | normal: { |
| | | color: 'transparent', |
| | | borderWidth: 10, |
| | | borderColor: 'transparent', |
| | | |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | this.options = { |
| | | title: { |
| | | text: 'äº§åæ»æ°', |
| | | subtext: '430', |
| | | textStyle: { |
| | | color: '#00b5f3', |
| | | fontSize: 12, |
| | | |
| | | }, |
| | | subtextStyle: { |
| | | align: 'center', |
| | | fontSize: 18, |
| | | color: ['#85c7e3'], |
| | | fontWeight:800 |
| | | }, |
| | | x: '33%', |
| | | y: 'center', |
| | | }, |
| | | tooltip: { |
| | | show: true, |
| | | trigger: 'item', |
| | | formatter: "{a}ï¼{b} <br/>å æ¯ï¼{d}%" |
| | | }, |
| | | legend: { |
| | | data: ['åºå产å'], |
| | | icon: 'vertical', |
| | | right: '1%', |
| | | top: 'center', |
| | | orient: 'vertical', |
| | | itemGap: 20, |
| | | itemWidth: 15, |
| | | itemHeight: 8, |
| | | |
| | | formatter: function(name) { |
| | | let target; |
| | | for (let i = 0; i < dataPie.length; i++) { |
| | | if (dataPie[i].name === name) { |
| | | target = dataPie[i].value |
| | | } |
| | | } |
| | | let arr = [name, target]; |
| | | return arr.join("\n") |
| | | |
| | | }, |
| | | textStyle: { |
| | | lineHeight: 20, |
| | | color: '#9ed2f5', |
| | | |
| | | }, |
| | | }, |
| | | grid: { |
| | | left: '1%', // ä¸å®¹å¨å·¦ä¾§çè·ç¦» |
| | | right: '1%', // ä¸å®¹å¨å³ä¾§çè·ç¦» |
| | | top: '1%', // ä¸å®¹å¨é¡¶é¨çè·ç¦» |
| | | bottom: '1%', // ä¸å®¹å¨åºé¨çè·ç¦» |
| | | |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '', |
| | | data: [{ |
| | | value: 1, |
| | | name: '' |
| | | }] |
| | | }, |
| | | // æ·»å å
åå
åç¯ |
| | | { |
| | | type: 'pie', |
| | | clockWise: false, //顺æ¶å è½½ |
| | | hoverAnimation: false, //é¼ æ ç§»å
¥å大 |
| | | center: ['40%', '50%'], |
| | | radius: ['80%', '81%'], |
| | | tooltip: { |
| | | show: false |
| | | }, |
| | | label: { |
| | | normal: { |
| | | show: false |
| | | } |
| | | }, |
| | | data: baseDataWrap |
| | | }, |
| | | { |
| | | |
| | | name: 'ç§ç±»', |
| | | type: 'pie', |
| | | color: colorPie, |
| | | selectedMode: 'single', |
| | | radius: ['55%', '58%'], |
| | | center: ['40%', '50%'], |
| | | radius: ['63%', '65%'], |
| | | center: ['50%', '50%'], |
| | | hoverAnimation: false, |
| | | label: { |
| | | normal: { |
| | | show: 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: baseDataPie |
| | | }, |
| | | |
| | | ] |
| | | }; |
| | | this.switper(); |
| | | 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 |
| | | } |
| | | } |
| | | ] |
| | | }, |
| | | //轮询 |
| | | switper() { |
| | | if (this.timer) { |
| | | return; |
| | | } |
| | | let looper = (a) => { |
| | | this.getData(); |
| | | }; |
| | | this.timer = setInterval( |
| | | looper, |
| | | this.$store.state.setting.echartsAutoTime |
| | | ); |
| | | }, |
| | | timer: null, |
| | | particleTimer: null, |
| | | gradientTimer: null |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.fetchData(); |
| | | this.startAutoRefresh(); |
| | | this.startParticleAnimation(); |
| | | this.startGradientAnimation(); |
| | | }, |
| | | beforeDestroy() { |
| | | this.stopAutoRefresh(); |
| | | this.stopParticleAnimation(); |
| | | this.stopGradientAnimation(); |
| | | }, |
| | | 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; |
| | | }, |
| | | }; |
| | | </script> |
| | | <style lang='scss' scoped> |
| | | .user_Overview { |
| | | li { |
| | | flex: 1; |
| | | |
| | | p { |
| | | text-align: center; |
| | | height: 16px; |
| | | font-size: 16px; |
| | | 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'; |
| | | } |
| | | |
| | | .user_Overview_nums { |
| | | width: 100px; |
| | | height: 100px; |
| | | text-align: center; |
| | | line-height: 100px; |
| | | font-size: 22px; |
| | | margin: 50px auto 30px; |
| | | background-size: cover; |
| | | background-position: center center; |
| | | position: relative; |
| | | |
| | | &::before { |
| | | content: ""; |
| | | position: absolute; |
| | | width: 100%; |
| | | height: 100%; |
| | | top: 0; |
| | | left: 0; |
| | | } |
| | | |
| | | &.bgdonghua::before { |
| | | animation: rotating 14s linear infinite; |
| | | } |
| | | } |
| | | |
| | | .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"); |
| | | } |
| | | } |
| | | }, |
| | | 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); |
| | | } |
| | | } |
| | | </style> |
| | | }; |
| | | </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> |
| | |
| | | :selectable="detailSelectable" |
| | | ></vol-table> |
| | | </div> |
| | | |
| | | <!--æç»bodyèªå®ä¹ç»ä»¶--> |
| | | <component |
| | | :is="dynamicComponent.modelSpec" |
| | | ref="modelSpec" |
| | | @parentCall="parentCall" |
| | | ></component> |
| | | |
| | | |
| | | <!--æç»footerèªå®ä¹ç»ä»¶--> |
| | | <component |
| | | :is="dynamicComponent.modelFooter" |
| | |
| | | gridFooter: Empty, |
| | | modelHeader: Empty, |
| | | modelBody: Empty, |
| | | modelFooter: Empty |
| | | modelFooter: Empty, |
| | | modelSpec:Empty |
| | | }; |
| | | //åå¹¶æ©å±ç»ä»¶ |
| | | if (props.extend.components) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <vol-box |
| | | :lazy="true" |
| | | v-model="model" |
| | | title="éæ©ç©æè§æ ¼" |
| | | :width="280" |
| | | :padding="0" |
| | | > |
| | | <div> |
| | | <div> |
| | | <!-- æç´¢é
ç½® --> |
| | | <div class="search-form"> |
| | | <label>ç©æè§æ ¼ï¼</label> |
| | | <el-input style="width: 160px" v-model="MaterialCode"></el-input> |
| | | </div> |
| | | <el-table |
| | | ref="singleTable" |
| | | :data="filteredData" |
| | | style="width: 100%; height: 100%" |
| | | highlight-current-row |
| | | height="500px" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | > |
| | | <el-table-column type="selection" width="55"> </el-table-column> |
| | | <el-table-column |
| | | v-for="(item, index) in tableColumns.filter((x) => !x.hidden)" |
| | | :key="index" |
| | | :prop="item.prop" |
| | | :label="item.title" |
| | | align="center" |
| | | > |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | <template #footer> |
| | | <div><el-button type="primary" @click="onSelect">确认</el-button></div> |
| | | </template> |
| | | </vol-box> |
| | | </template> |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | |
| | | /******注æï¼å¦æåºç°æç¤ºæ²¡ææéçé®é¢ï¼è§åå°å¼åææ¡£ä¸çãéååå°æéã*****/ |
| | | |
| | | //è¿é使ç¨çvue2è¯æ³ï¼ä¹å¯ä»¥åævue3è¯æ³ |
| | | export default { |
| | | components: { |
| | | "vol-box": VolBox, |
| | | }, |
| | | methods: {}, |
| | | data() { |
| | | return { |
| | | model: false, //å¼¹åºæ¡ |
| | | wareId: null, |
| | | materielSpec:null, |
| | | showDetialBox: false, |
| | | MaterialCode:null, |
| | | selection:null, |
| | | tableData: [], |
| | | filteredData: [], |
| | | tableColumns: [ |
| | | { |
| | | prop: "materielSpec", |
| | | title: "ç©æè§æ ¼", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | }; |
| | | }, |
| | | watch: { |
| | | MaterialCode(newVal) { |
| | | this.filterLocalData(newVal); |
| | | } |
| | | }, |
| | | methods: { |
| | | open(purchaseOrderNo, materielCode) { // éå½ååæ°ï¼è¯ä¹æ´æ¸
æ° |
| | | this.model = true; |
| | | this.purchaseOrderNo = purchaseOrderNo; // åå¨éè´åå· |
| | | this.materielCode = materielCode; // åå¨ç©æç¼å· |
| | | this.getData(); // è°ç¨è·åæ°æ®æ¹æ³ |
| | | }, |
| | | filterLocalData(code) { |
| | | if (code) { |
| | | this.filteredData = this.tableData.filter((item) => { |
| | | return item.materielSpec.includes(code); |
| | | }); |
| | | console.log(this.filteredData.length); |
| | | console.log(this.tableData.length); |
| | | } else { |
| | | this.filteredData = [...this.tableData]; // éç½®ä¸ºå®æ´æ°æ® |
| | | } |
| | | }, |
| | | handleSelectionChange(val,val2) { |
| | | this.selection = val; |
| | | this.selection1 = val2; |
| | | if (this.selection.length > 1) { |
| | | this.$message.error("ä»
鿩䏿¡æ°æ®"); |
| | | // æ¸
空éä¸çç¬¬ä¸æ¡æ°æ® |
| | | this.$refs.singleTable.clearSelection(); |
| | | } |
| | | if (this.selection1.length > 1) { |
| | | this.$message.error("ä»
鿩䏿¡æ°æ®"); |
| | | // æ¸
空éä¸çç¬¬ä¸æ¡æ°æ® |
| | | this.$refs.singleTable.clearSelection(); |
| | | } |
| | | console.log(this.selection); |
| | | }, |
| | | getData() { |
| | | const url = `/api/PurchaseOrderDetail/GetOrderMaterielSpec?` + |
| | | `purchaseOrderNo=${encodeURIComponent(this.purchaseOrderNo)}&` + |
| | | `materielCode=${encodeURIComponent(this.materielCode)}`; |
| | | |
| | | this.http.post(url, null, "æ¥è¯¢ä¸") |
| | | .then((x) => { |
| | | if (!x.status) { |
| | | return this.$error(x.message); |
| | | } |
| | | this.tableData = x.data.map((item) => ({ |
| | | materielSpec: item // å设æ¥å£è¿åçè§æ ¼ç´æ¥æ¯å符串 |
| | | })); |
| | | this.filteredData = [...this.tableData]; // éç½®è¿æ»¤æ°æ® |
| | | }) |
| | | .catch((error) => { |
| | | console.error("æ¥å£è¯·æ±å¤±è´¥:", error); |
| | | this.$message.error("è·åç©æè§æ ¼å¤±è´¥ï¼è¯·éè¯"); |
| | | }); |
| | | }, |
| | | onSelect() { |
| | | if (!this.selection) { |
| | | return this.$message.error("è¯·éæ©æ°æ®"); |
| | | } |
| | | this.$emit("parentCall", ($parent) => { |
| | | //å¦ï¼ååç¼è¾è¡¨åæ°æ® |
| | | $parent.editFormFields.materielSpec = this.selection[0].materielSpec; |
| | | this.model = false; |
| | | }); |
| | | this.MaterialCode = null; |
| | | this.tableData = []; |
| | | this.filteredData = []; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <style lang="less" scoped> |
| | | .search-form { |
| | | display: flex; |
| | | padding: 10px; |
| | | line-height: 34px; |
| | | button { |
| | | margin-left: 10px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | import modelHeader from './extend/materielcodeSelectView.vue' |
| | | import modelBody from './extend/purchaseOrderNoSelectView.vue' |
| | | import modelFooter from './extend/GetOrderQuantityView.vue' |
| | | import modelSpec from './extend/GetOrderMaterielSpec.vue' |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: modelHeader, |
| | | modelBody: modelBody, |
| | | modelFooter: modelFooter |
| | | modelFooter: modelFooter, |
| | | modelSpec: modelSpec |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | |
| | | } |
| | | }); |
| | | }); |
| | | this.editFormOptions.forEach((option) => { |
| | | option.forEach((item) => { |
| | | if (item.field == 'materielSpec') { |
| | | //åå§åå¼¹åºæ¡éæ©å¨é
ç½® |
| | | item.extra = { |
| | | icon: 'el-icon-zoom-out', //æ¾ç¤ºå¾æ |
| | | text: 'éæ©ç©æè§æ ¼', //æ¾ç¤ºææ¬ |
| | | style: 'color: #3a8ee6;font-size: 13px;cursor: pointer;', |
| | | //触åäºä»¶ |
| | | click: (item) => { |
| | | this.$refs.modelSpec.open(this.editFormFields.purchaseOrderNo,this.editFormFields.materielCode); |
| | | } |
| | | }; |
| | | } |
| | | }); |
| | | }); |
| | | // warehouseIdOption.onChange = (val, option) => { |
| | | // this.editFormFields.materielCode = ""; |
| | | // materielCodeOption.data = []; |
| | |
| | | // } |
| | | }); |
| | | |
| | | // 页é¢å è½½æ¶åå§åå·²é«äº®çè¡ |
| | | const initHighlightedRows = () => { |
| | | try { |
| | | const highlightedRowIds = localStorage.getItem('highlightedRowIds'); |
| | | if (highlightedRowIds) { |
| | | this.highlightedRowIds = JSON.parse(highlightedRowIds); |
| | | } else { |
| | | this.highlightedRowIds = []; |
| | | } |
| | | } catch (e) { |
| | | console.error('Failed to load highlighted rows from localStorage:', e); |
| | | this.highlightedRowIds = []; |
| | | } |
| | | }; |
| | | |
| | | // ä¿åé«äº®è¡IDå°æ¬å°åå¨ |
| | | const saveHighlightedRows = () => { |
| | | try { |
| | | localStorage.setItem('highlightedRowIds', JSON.stringify(this.highlightedRowIds)); |
| | | } catch (e) { |
| | | console.error('Failed to save highlighted rows to localStorage:', e); |
| | | } |
| | | }; |
| | | |
| | | // å¨ç»ä»¶åå§åæ¶è°ç¨ |
| | | initHighlightedRows(); |
| | | |
| | | this.columns.push({ |
| | | field: 'æä½', |
| | | title: 'æä½', |
| | |
| | | align: 'center', |
| | | formatter: (row) => { |
| | | return ( |
| | | '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-printer">æå°</i>' |
| | | '<i style="cursor: pointer;color: #2d8cf0;" class="el-icon-printer">æå°</i>' |
| | | ); |
| | | }, |
| | | click: (row) => { |
| | | // æå¼è¯¦æ
|
| | | this.$refs.gridBody.open(row); |
| | | // è·åè¡çå¯ä¸æ è¯ï¼å设row.idæ¯å¯ä¸IDï¼ |
| | | const rowId = row.id; |
| | | // æ·»å å°å·²é«äº®å表 |
| | | if (!this.highlightedRowIds.includes(rowId)) { |
| | | this.highlightedRowIds.push(rowId); |
| | | // ä¿åå°æ¬å°åå¨ |
| | | saveHighlightedRows(); |
| | | // å·æ°è¡¨æ ¼ä»¥åºç¨æ ·å¼ |
| | | this.$refs.gridBody.refresh(); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // é
ç½®cellStyle |
| | | this.columns.forEach((column) => { |
| | | // ä¿ååæçcellStyle彿° |
| | | const originalCellStyle = column.cellStyle; |
| | | |
| | | column.cellStyle = (row) => { |
| | | // å
åºç¨åæçæ ·å¼é»è¾ |
| | | let style = originalCellStyle ? originalCellStyle(row) : {}; |
| | | |
| | | // 妿è¡è¢«æ 记为é«äº®ï¼åæ·»å 绿è²èæ¯ |
| | | if (this.highlightedRowIds.includes(row.id)) { |
| | | style = { |
| | | ...style, |
| | | background: '#d4edda', |
| | | color: '#155724' |
| | | }; |
| | | } |
| | | |
| | | return style; |
| | | }; |
| | | }); |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | width: 150, |
| | | }, |
| | | { |
| | | prop: "productionDate", |
| | | title: "çäº§æ¥æ", |
| | | type: "string", |
| | | width: 160, |
| | | |
| | | }, |
| | | { |
| | | prop: "effectiveDate", |
| | | title: "æææ", |
| | | type: "string", |
| | | width: 160, |
| | | |
| | | }, |
| | | { |
| | | prop: "locationCode", |
| | | title: "è´§ä½ç¼å·", |
| | | type: "string", |
| | |
| | | "æ¥è¯¢ä¸" |
| | | ) |
| | | .then((x) => { |
| | | |
| | | var label=[ |
| | | { label: 'å·²åé
', value: 0 }, |
| | | { label: 'åºåºä¸', value: 1 }, |
| | |
| | | <p><strong>è´§ä½å·:</strong>{{ currentLocation.locationCode }}</p> |
| | | <p> |
| | | <strong>è´§ä½æåå±:</strong> {{ currentLocation.row }}æ{{ |
| | | currentLocation.layer |
| | | }}å{{ currentLocation.index }}å± |
| | | currentLocation.index |
| | | }}å{{ currentLocation.layer }}å± |
| | | </p> |
| | | <p><strong>ç¶æ:</strong> {{ getStatusText(currentLocation) }}</p> |
| | | <p> |
| | |
| | | ], |
| | | [ |
| | | { |
| | | title: "ç©æè§æ ¼", |
| | | field: "materielSpec", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "æ¹æ¬¡å·", |
| | | field: "lotNo", |
| | | required: true, |
| | |
| | | field: "materielName", |
| | | title: "ç©æåç§°", |
| | | type: "string", |
| | | width: 100, |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materielSpec", |
| | | title: "ç©æè§æ ¼", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | field: "pickCode", |
| | | title: "ç³è¯·åæåå·", |
| | | type: "select", |
| | | width: 160, |
| | | width: 180, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | |
| | | field: "mCode", |
| | | title: "ç©æç¼ç ", |
| | | type: "string", |
| | | width: 90, |
| | | width: 130, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "qty", |
| | | title: "å¯éæ°é", |
| | | type: "float", |
| | | width: 130, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "returnQty", |
| | | title: "éåæ°é", |
| | | type: "float", |
| | | width: 130, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "overReturnQty", |
| | | title: "å·²éåæ°é", |
| | | type: "float", |
| | | width: 130, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | |
| | | field: "materielSpec", |
| | | title: "ç©æè§æ ¼", |
| | | type: "string", |
| | | width: 90, |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productionDate", |
| | | title: "çäº§æ¥æ", |
| | | type: "string", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "effectiveDate", |
| | | title: "æææ", |
| | | type: "string", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "taskNum", |
| | | title: "ä»»å¡å·", |
| | | type: "string", |
| | |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | title: "åºå主é®", |
| | | readonly:true, |
| | | field: "stockId", |
| | | type: "string", |
| | | }, |
| | | |
| | | { |
| | | title: "ç©æç¼å·", |
| | | required: true, |
| | | field: "materielCode", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "åæ®ç¼å·", |
| | | title: "ç©æåç§°", |
| | | required: true, |
| | | field: "materielName", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "æ¹æ¬¡å·", |
| | | required: true, |
| | | title: "åæ®ç¼å·", |
| | | readonly: true, |
| | | field: "orderNo", |
| | | type: "string", |
| | | }, |
| | | |
| | | ], |
| | | [ |
| | | { |
| | | title: "æ¹æ¬¡å·", |
| | | required: true, |
| | | field: "batchNo", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "åºåæ°é", |
| | | required: true, |
| | | field: "stockQuantity", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "çäº§æ¥æ", |
| | | required: true, |
| | | field: "productionDate", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "æææ", |
| | | required: true, |
| | | field: "effectiveDate", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "åºåå·", |
| | | required: true, |
| | | readonly: true, |
| | | field: "serialNumber", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "åºåºæ°é", |
| | | required: true, |
| | | field: "outboundQuantity", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "åºåæç»ç¶æ", |
| | | readonly: true, |
| | | field: "status", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "å
¥åºåæç»è¡å·", |
| | | readonly: true, |
| | | field: "inboundOrderRowNo", |
| | | type: "string", |
| | | }, |
| | | ], |
| | |
| | | bind: { key: "stockStatusEmun", data: [] }, |
| | | }, |
| | | { |
| | | field: "productionDate", |
| | | title: "çäº§æ¥æ", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | |
| | | }, |
| | | { |
| | | field: "effectiveDate", |
| | | title: "æææ", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "materielCode", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "quantity", |
| | | title: "ç©ææ°é", |
| | | type: "float", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "materielCode", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "quantity", |
| | | title: "ç©ææ°é", |
| | | type: "float", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | |
| | | WebResponseContent GetPurchaseOrderNos(string materielCode); |
| | | |
| | | WebResponseContent GetOrderQuantity(string purchaseOrderNo); |
| | | |
| | | WebResponseContent GetOrderMaterielSpec(string purchaseOrderNo, string materielCode); |
| | | } |
| | | } |
| | |
| | | |
| | | stockInfoDetails.Add(stockInfoDetail); |
| | | |
| | | notGroupDetail.ReceiptQuantity += model.Quantity; |
| | | if (notGroupDetail.ReceiptQuantity>notGroupDetail.OrderQuantity) |
| | | decimal decimalReceiptQuantity = Convert.ToDecimal(notGroupDetail.ReceiptQuantity); |
| | | decimal decimalModelQuantity = Convert.ToDecimal(model.Quantity); |
| | | decimal decimalOrderQuantity = Convert.ToDecimal(notGroupDetail.OrderQuantity); |
| | | decimalReceiptQuantity += decimalModelQuantity; |
| | | // æ£æ¥æ¯å¦è¶
åºè®¢åæ°é |
| | | if (decimalReceiptQuantity > decimalOrderQuantity) |
| | | { |
| | | return WebResponseContent.Instance.Error($"ç»çæ°é溢åº{notGroupDetail.ReceiptQuantity - notGroupDetail.OrderQuantity}"); |
| | | return WebResponseContent.Instance.Error($"ç»çæ°é溢åº{decimalReceiptQuantity - decimalOrderQuantity}"); |
| | | } |
| | | // 转åfloatç±»ååå¨ï¼ä½æ¯è¾å计ç®é½ä½¿ç¨decimal宿 |
| | | notGroupDetail.ReceiptQuantity = Convert.ToSingle(decimalReceiptQuantity); |
| | | if (notGroupDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) |
| | | { |
| | | notGroupDetail.OrderDetailStatus = OrderDetailStatusEnum.GroupAndInbound.ObjToInt(); |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent GetOrderMaterielSpec(string purchaseOrderNo, string materielCode) |
| | | { |
| | | try |
| | | { |
| | | List<Dt_PurchaseOrder> purchaseOrders = BaseDal.Db.Queryable<Dt_PurchaseOrder>().Where(x => x.PurchaseOrderNo == purchaseOrderNo).ToList(); |
| | | List<int> purchaseOrderIds = purchaseOrders.Select(x => x.Id).ToList(); |
| | | List<Dt_PurchaseOrderDetail> purchaseOrderDetails = BaseDal.Db.Queryable<Dt_PurchaseOrderDetail>() |
| | | .Where(x => purchaseOrderIds.Contains(x.PurchaseOrderId)&& x.MaterielCode == materielCode).ToList(); |
| | | List<string> materielSpec = purchaseOrderDetails.Select(x => x.MaterielSpec).ToList(); |
| | | return WebResponseContent.Instance.OK(data: materielSpec); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ä¾åºåç¼ç ")] |
| | | public string SupplierCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æè§æ ¼ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç©æè§æ ¼")] |
| | | public string MaterielSpec { get; set; } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç¶æ")] |
| | | public int Status { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çäº§æ¥æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "çäº§æ¥æ")] |
| | | public string ProductionDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æææ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æææ")] |
| | | public string EffectiveDate { get; set; } |
| | | } |
| | | } |
| | |
| | | [ExporterHeader(DisplayName = "夿³¨")] |
| | | [SugarColumn(IsNullable = true, Length = 255, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | /// <summary> |
| | | /// ç©æç¼å· |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ç©æç¼å·")] |
| | | [ExporterHeader(DisplayName = "ç©æç¼å·")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "ç©æç¼å·")] |
| | | public string MaterielCode { get; set; } |
| | | /// <summary> |
| | | /// ç©ææ°é |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ç©ææ°é")] |
| | | [ExporterHeader(DisplayName = "ç©ææ°é")] |
| | | [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "ç©ææ°é")] |
| | | public float Quantity { get; set; } |
| | | } |
| | | } |
| | |
| | | OriginalQuantity = item.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).Sum(x => x.StockQuantity), |
| | | Status = taskNum == null ? OutLockStockStatusEnum.å·²åé
.ObjToInt() : OutLockStockStatusEnum.åºåºä¸.ObjToInt(), |
| | | StockId = item.Id, |
| | | TaskNum = taskNum |
| | | TaskNum = taskNum, |
| | | ProductionDate = item.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).FirstOrDefault()?.ProductionDate, |
| | | EffectiveDate = item.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).FirstOrDefault()?.EffectiveDate |
| | | |
| | | }; |
| | | outStockLockInfos.Add(outStockLockInfo); |
| | | } |
| | |
| | | TaskNum = taskNum, |
| | | OrderQuantity = outboundOrderDetail.OrderQuantity, |
| | | Unit = outboundOrderDetail.Unit, |
| | | ProductionDate = outStock.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).FirstOrDefault()?.ProductionDate, |
| | | EffectiveDate = outStock.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).FirstOrDefault()?.EffectiveDate |
| | | }; |
| | | |
| | | return outStockLockInfo; |
| | |
| | | StockId = outStock.Id, |
| | | TaskNum = taskNum, |
| | | OrderQuantity = mesOutboundOrder.OrderQuantity, |
| | | Unit = mesOutboundOrder.Unit |
| | | Unit = mesOutboundOrder.Unit, |
| | | ProductionDate = outStock.Details.Where(x => x.MaterielCode == mesOutboundOrder.MaterialCode).FirstOrDefault()?.ProductionDate, |
| | | EffectiveDate = outStock.Details.Where(x => x.MaterielCode == mesOutboundOrder.MaterialCode).FirstOrDefault()?.EffectiveDate |
| | | |
| | | }; |
| | | |
| | | return outStockLockInfo; |
| | |
| | | StockId = item.Id, |
| | | TaskNum = taskNum, |
| | | OrderQuantity = mesPPCutOutboundOrderDetail.OrderQuantity, |
| | | Unit = mesPPCutOutboundOrderDetail.Unit |
| | | Unit = mesPPCutOutboundOrderDetail.Unit, |
| | | ProductionDate = item.Details.Where(x => x.MaterielCode == mesPPCutOutboundOrderDetail.MaterielCode).FirstOrDefault()?.ProductionDate, |
| | | EffectiveDate = item.Details.Where(x => x.MaterielCode == mesPPCutOutboundOrderDetail.MaterielCode).FirstOrDefault()?.EffectiveDate |
| | | }; |
| | | outStockLockInfos.Add(outStockLockInfo); |
| | | } |
| | |
| | | StockId = outStock.Id, |
| | | TaskNum = taskNum, |
| | | OrderQuantity = mesPPOutboundOrder.OrderQuantity, |
| | | Unit = mesPPOutboundOrder.Unit |
| | | Unit = mesPPOutboundOrder.Unit, |
| | | ProductionDate = outStock.Details.Where(x => x.MaterielCode == mesPPOutboundOrder.MaterialCode).FirstOrDefault()?.ProductionDate, |
| | | EffectiveDate = outStock.Details.Where(x => x.MaterielCode == mesPPOutboundOrder.MaterialCode).FirstOrDefault()?.EffectiveDate |
| | | }; |
| | | |
| | | return outStockLockInfo; |
| | |
| | | StockId = stockInfo.Id, |
| | | TaskNum = 0, |
| | | OrderQuantity = outboundOrderDetail.OrderQuantity, |
| | | Unit = outboundOrderDetail.Unit |
| | | Unit = outboundOrderDetail.Unit, |
| | | ProductionDate = stockInfoDetail.ProductionDate, |
| | | EffectiveDate = stockInfoDetail.EffectiveDate |
| | | }; |
| | | |
| | | #region ä¿®æ¹åºåºå |
| | |
| | | using System.Text.RegularExpressions; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Core.CodeConfigEnum; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | |
| | | TaskType = TaskTypeEnum.InProduct.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = warehouse.WarehouseId, |
| | | PalletType = proStockInfo.PalletType |
| | | PalletType = proStockInfo.PalletType, |
| | | MaterielCode = proStockInfo.proStockInfoDetails.Where(x => x.ProStockId == proStockInfo.Id).FirstOrDefault()?.ProductCode, |
| | | Quantity = (float)proStockInfo.proStockInfoDetails.Where(x => x.ProStockId == proStockInfo.Id).Sum(x => x.StockPcsQty) |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | int taskId = BaseDal.AddData(newTask); |
| | |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType |
| | | PalletType = stockInfo.PalletType, |
| | | MaterielCode = stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode, |
| | | Quantity = (float)stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.StockQuantity, |
| | | }; |
| | | LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus; |
| | | _unitOfWorkManage.BeginTran(); |
| | |
| | | TaskType = TaskTypeEnum.OutAllocate.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType |
| | | PalletType = stockInfo.PalletType, |
| | | MaterielCode = stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode, |
| | | Quantity = (float)stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.StockQuantity, |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | BaseDal.AddData(newTask); |
| | |
| | | }); |
| | | //æ´æ°ä»»å¡ç¶æ |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | FeedBackWCSTaskCompleted(taskNum); |
| | | _unitOfWorkManage.BeginTran(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); |
| | |
| | | } |
| | | |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | FeedBackWCSTaskCompleted(taskNum); |
| | | _unitOfWorkManage.BeginTran(); |
| | | |
| | | if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt() || task.TaskType == TaskTypeEnum.OutAllocate.ObjToInt() || task.TaskType == TaskTypeEnum.MesHandPickOutbound.ObjToInt() || task.TaskType == TaskTypeEnum.MesHandOutbound.ObjToInt()) |
| | |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId); |
| | | |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, (LocationStatusEnum)beforeStatus, LocationStatusEnum.Free, LocationChangeType.OutboundCompleted, stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.APIEnum; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.OtherEnum; |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// åè°wcsæå¨å®æä»»å¡ |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent FeedBackWCSTaskCompleted(int taskNum) |
| | | { |
| | | try |
| | | { |
| | | Dt_ApiInfo? url = _apiInfoRepository.QueryData(x => x.ApiCode == APIEnum.FeedBackWCSTaskCompleted.ToString()).First(); |
| | | string? apiAddress = url.ApiAddress; |
| | | if (string.IsNullOrEmpty(apiAddress)) |
| | | { |
| | | return WebResponseContent.Instance.Error($"{taskNum},æªæ¾å°WCSä»»å¡å®ææ¥å£,è¯·æ£æ¥æ¥å£é
ç½®"); |
| | | } |
| | | string responseStr = HttpHelper.Get(apiAddress + "?taskNum=" + taskNum); |
| | | WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(responseStr) ?? WebResponseContent.Instance.Error("æªæ¾å°ä»»å¡å®æè¿åå¼"); |
| | | return content; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType |
| | | PalletType = stockInfo.PalletType, |
| | | MaterielCode = stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode, |
| | | Quantity = (float)stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.StockQuantity, |
| | | }; |
| | | //è·åæ¯å¦åå¨å
¥åºå |
| | | Dt_InboundOrder? inboundOrder = null; |
| | |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType |
| | | PalletType = stockInfo.PalletType, |
| | | MaterielCode = stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode, |
| | | Quantity = (float)stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.StockQuantity, |
| | | }; |
| | | |
| | | //è·åæ¯å¦åå¨å
¥åºå |
| | |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType |
| | | PalletType = stockInfo.PalletType, |
| | | MaterielCode = stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode, |
| | | Quantity = (float)stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.StockQuantity, |
| | | }; |
| | | |
| | | |
| | |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType |
| | | PalletType = stockInfo.PalletType, |
| | | MaterielCode = stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode, |
| | | Quantity = (float)stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.StockQuantity, |
| | | }; |
| | | |
| | | if (stockInfo.StockStatus == StockStatusEmun.æå¨ç»çæå.ObjToInt()) |
| | |
| | | TaskType = TaskTypeEnum.InProductBack.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = warePoint.WarehouseId, |
| | | PalletType = proStockInfo.PalletType |
| | | PalletType = proStockInfo.PalletType, |
| | | MaterielCode = proStockInfo.proStockInfoDetails.Where(x => x.ProStockId == proStockInfo.Id).FirstOrDefault()?.ProductCode, |
| | | Quantity = (float)proStockInfo.proStockInfoDetails.Where(x => x.ProStockId == proStockInfo.Id).Sum(x => x.StockPcsQty) |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | int taskId = BaseDal.AddData(newTask); |
| | |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | PalletType = stockInfo.PalletType, |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | GroupId= groupId |
| | | GroupId= groupId, |
| | | MaterielCode = stockInfo.proStockInfoDetails.Where(x => x.ProStockId == stockInfo.Id).FirstOrDefault()?.ProductCode, |
| | | Quantity = (float)stockInfo.proStockInfoDetails.Where(x => x.ProStockId == stockInfo.Id).Sum(x=> x.StockPcsQty) |
| | | }; |
| | | tasks.Add(task); |
| | | } |
| | |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | PalletType = stockInfo.PalletType, |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | MaterielCode = stockInfo.Details.Where(x =>x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode, |
| | | Quantity =(float)stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.StockQuantity, |
| | | }; |
| | | if (stockInfo.StockLength>0) |
| | | { |
| | |
| | | StockId = x.Id, |
| | | TaskNum = 0, |
| | | OrderQuantity = OrderDetail.OrderQuantity, |
| | | Unit = OrderDetail.Unit |
| | | Unit = OrderDetail.Unit, |
| | | ProductionDate = v.ProductionDate, |
| | | EffectiveDate = v.EffectiveDate |
| | | }; |
| | | outStockLockInfos.Add(outStockLockInfo); |
| | | } |
| | |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçç»ç¹è´§ä½ä¿¡æ¯"); |
| | | } |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | FeedBackWCSTaskCompleted(task.TaskNum); |
| | | _unitOfWorkManage.BeginTran(); |
| | | stockInfo.LocationCode = locationInfoEnd.LocationCode; |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | |
| | | { |
| | | return Service.GetOrderQuantity(purchaseOrderNo); |
| | | } |
| | | //è·åç©æè§æ ¼ |
| | | [HttpPost, HttpGet, Route("GetOrderMaterielSpec"), AllowAnonymous] |
| | | public WebResponseContent GetOrderMaterielSpec(string purchaseOrderNo, string materielCode) |
| | | { |
| | | return Service.GetOrderMaterielSpec(purchaseOrderNo, materielCode); |
| | | } |
| | | } |
| | | } |