1 Commits

60 changed files with 9136 additions and 10522 deletions

View File

@@ -1,23 +1,19 @@
### ###
# @Author: zhp # @Author: zhp
# @Date: 2024-04-28 13:42:51 # @Date: 2024-04-28 13:42:51
# @LastEditTime: 2024-06-03 08:50:41 # @LastEditTime: 2024-05-29 17:06:55
# @LastEditors: DY # @LastEditors: zhp
# @Description: # @Description:
### ###
# 开发环境配置 # 开发环境配置
ENV = 'development' ENV = 'development'
# 页面标题 # 页面标题
VUE_APP_TITLE = 发电玻璃智能管控平台 VUE_APP_TITLE = 芋道管理系统
# 芋道管理系统/开发环境 # 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://192.168.1.70:30307' VUE_APP_BASE_API = 'http://192.168.1.61:48080'
VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com' # VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com'
# sara
# VUE_APP_BASE_API = 'http://192.168.1.63:48080'
# 张一丁
# VUE_APP_BASE_API = 'http://192.168.4.139:48080'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true
@@ -26,7 +22,7 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true
VUE_APP_TENANT_ENABLE = true VUE_APP_TENANT_ENABLE = true
# 验证码的开关 # 验证码的开关
VUE_APP_CAPTCHA_ENABLE = false VUE_APP_CAPTCHA_ENABLE = true
# 文档的开关 # 文档的开关
VUE_APP_DOC_ENABLE = true VUE_APP_DOC_ENABLE = true

View File

@@ -2,7 +2,7 @@
ENV = 'development' ENV = 'development'
# 页面标题 # 页面标题
VUE_APP_TITLE = 发电玻璃智能管控平台 VUE_APP_TITLE = 芋道管理系统
# 芋道管理系统/本地环境 # 芋道管理系统/本地环境
VUE_APP_BASE_API = 'http://api-dashboard.yudao.iocoder.cn' VUE_APP_BASE_API = 'http://api-dashboard.yudao.iocoder.cn'
@@ -14,7 +14,7 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true
VUE_APP_TENANT_ENABLE = true VUE_APP_TENANT_ENABLE = true
# 验证码的开关 # 验证码的开关
VUE_APP_CAPTCHA_ENABLE = false VUE_APP_CAPTCHA_ENABLE = true
# 文档的开关 # 文档的开关
VUE_APP_DOC_ENABLE = true VUE_APP_DOC_ENABLE = true

View File

@@ -2,7 +2,7 @@
NODE_ENV = 'production' NODE_ENV = 'production'
# 页面标题 # 页面标题
VUE_APP_TITLE = 发电玻璃智能管控平台 VUE_APP_TITLE = 玻璃控股信息平台
# 芋道管理系统/生产环境 # 芋道管理系统/生产环境
VUE_APP_BASE_API = '' VUE_APP_BASE_API = ''
@@ -16,7 +16,7 @@ PUBLIC_PATH = ''
VUE_APP_TENANT_ENABLE = true VUE_APP_TENANT_ENABLE = true
# 验证码的开关 # 验证码的开关
VUE_APP_CAPTCHA_ENABLE = false VUE_APP_CAPTCHA_ENABLE = true
# 文档的开关 # 文档的开关
VUE_APP_DOC_ENABLE = false VUE_APP_DOC_ENABLE = false

View File

@@ -1,7 +1,7 @@
NODE_ENV = production NODE_ENV = production
# 页面标题 # 页面标题
VUE_APP_TITLE = 发电玻璃智能管控平台 VUE_APP_TITLE = 芋道管理系统
# 测试环境配置 # 测试环境配置
ENV = 'staging' ENV = 'staging'
@@ -16,7 +16,7 @@ PUBLIC_PATH = 'http://static.yudao.iocoder.cn/'
VUE_APP_TENANT_ENABLE = true VUE_APP_TENANT_ENABLE = true
# 验证码的开关 # 验证码的开关
VUE_APP_CAPTCHA_ENABLE = false VUE_APP_CAPTCHA_ENABLE = true
# 文档的开关 # 文档的开关
VUE_APP_DOC_ENABLE = false VUE_APP_DOC_ENABLE = false

View File

@@ -4,7 +4,7 @@ NODE_ENV = development
ENV = 'staging' ENV = 'staging'
# 页面标题 # 页面标题
VUE_APP_TITLE = 发电玻璃智能管控平台 VUE_APP_TITLE = 芋道管理系统
# 芋道管理系统/测试环境 # 芋道管理系统/测试环境
VUE_APP_BASE_API = 'http://127.0.0.1:48080' VUE_APP_BASE_API = 'http://127.0.0.1:48080'
@@ -18,7 +18,7 @@ VUE_APP_APP_NAME ='/admin-ui-vue2/'
VUE_APP_TENANT_ENABLE = true VUE_APP_TENANT_ENABLE = true
# 验证码的开关 # 验证码的开关
VUE_APP_CAPTCHA_ENABLE = false VUE_APP_CAPTCHA_ENABLE = true
# 文档的开关 # 文档的开关
VUE_APP_DOC_ENABLE = true VUE_APP_DOC_ENABLE = true

View File

@@ -51,14 +51,10 @@
"crypto-js": "^4.0.0", "crypto-js": "^4.0.0",
"echarts": "5.4.0", "echarts": "5.4.0",
"element-ui": "2.15.12", "element-ui": "2.15.12",
"exceljs": "^4.4.0",
"file-saver": "^2.0.5",
"fuse.js": "6.6.2", "fuse.js": "6.6.2",
"highlight.js": "^11.9.0", "highlight.js": "^11.9.0",
"html2canvas": "^1.4.1",
"js-beautify": "^1.15.1", "js-beautify": "^1.15.1",
"jsencrypt": "3.3.1", "jsencrypt": "3.3.1",
"jspdf": "^2.5.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"moment": "^2.30.1", "moment": "^2.30.1",
@@ -73,8 +69,7 @@
"vue-quill-editor": "^3.0.6", "vue-quill-editor": "^3.0.6",
"vue-router": "3.4.9", "vue-router": "3.4.9",
"vuedraggable": "2.24.3", "vuedraggable": "2.24.3",
"vuex": "3.6.2", "vuex": "3.6.2"
"xlsx": "^0.18.5"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "4.5.18", "@vue/cli-plugin-babel": "4.5.18",

View File

@@ -1,13 +1,13 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2024-05-07 08:54:59 * @Date: 2024-05-07 08:54:59
* @LastEditTime: 2024-06-03 08:52:02 * @LastEditTime: 2024-05-22 16:31:08
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
*/ */
import request from '@/utils/request' import request from '@/utils/request'
// 查询生产数据管理分页 // 查询部门列表
export function getProduceDataPage(data) { export function getProduceDataPage(data) {
return request({ return request({
url: 'ip/prod-output/prodOutputDataPage', url: 'ip/prod-output/prodOutputDataPage',
@@ -33,15 +33,6 @@ export function exportOutPutExcel(data) {
}) })
} }
// 获取生产数据管理列表
export function prodOutputDataList(data) {
return request({
url: '/ip/prod-output/prodOutputDataList',
method: 'post',
data: data
})
}
// 获取生产管理生产目标管理碲化镉工厂分页 // 获取生产管理生产目标管理碲化镉工厂分页
export function prodTargetDiPage(data) { export function prodTargetDiPage(data) {
return request({ return request({
@@ -119,7 +110,7 @@ export function importToTarget(data) {
return request({ return request({
url: '/ip/prod-target/to-target-import-excel', url: '/ip/prod-target/to-target-import-excel',
method: 'post', method: 'post',
data: data data
}) })
} }
@@ -128,7 +119,7 @@ export function importDiTarget(data) {
return request({ return request({
url: '/ip/prod-target/di-target-import-excel', url: '/ip/prod-target/di-target-import-excel',
method: 'post', method: 'post',
data: data data
}) })
} }
@@ -147,12 +138,3 @@ export function cockpitDataMonitor(data) {
data: data data: data
}) })
} }
export function exportFactoryDataExcel(data) {
return request({
url: '/ip/prod-output-month/export/excel',
method: 'post',
data: data,
responseType: 'blob'
})
}

View File

@@ -1,52 +0,0 @@
/*
* @Author: zhp
* @Date: 2024-05-07 08:54:59
* @LastEditTime: 2024-05-31 15:08:27
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 查询工单分页
export function getWorkOrderPage(data) {
return request({
url: '/ip/prod-work-order/page',
method: 'post',
data: data
})
}
// 查询工单趋势数据
export function getDailyTrend(data) {
return request({
url: '/ip/prod-work-order/getDailyTrend',
method: 'post',
data: data
})
}
// 获得工单
export function getWorkOrderDetail(id){
return request({
url: '/ip/prod-work-order/get?id=' + id,
method: 'get'
})
}
// 获得工单设备加工数量
export function getEqNum(id){
return request({
url: '/ip/prod-work-order/getEqNum?workOrderId=' + id,
method: 'get'
})
}
// 导出工单数据
export function exportExcel(data) {
return request({
url: '/ip/prod-work-order/export-excel',
method: 'post',
data: data,
responseType: 'blob'
})
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 7.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 6.5 MiB

BIN
src/assets/logo/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -49,7 +49,7 @@
</template> </template>
<script> <script>
import logoImg from "@/assets/logo/cnbm.png"; import logoImg from "@/assets/logo/logo.png";
import variables from "@/assets/styles/variables.scss"; import variables from "@/assets/styles/variables.scss";
export default { export default {
@@ -70,7 +70,7 @@ export default {
}, },
data() { data() {
return { return {
title: "发电玻璃智能管控平台", title: "玻璃控股信息平台",
logo: logoImg, logo: logoImg,
}; };
}, },
@@ -104,7 +104,7 @@ export default {
width: 32px; width: 32px;
height: 32px; height: 32px;
vertical-align: middle; vertical-align: middle;
margin-right: 10px; margin-right: 12px;
} }
& .sidebar-title { & .sidebar-title {
@@ -113,7 +113,7 @@ export default {
color: #fff; color: #fff;
font-weight: 600; font-weight: 600;
line-height: 50px; line-height: 50px;
font-size: 19px; font-size: 14px;
font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif; font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
vertical-align: middle; vertical-align: middle;
} }

View File

@@ -4,16 +4,16 @@ function __resizeHandler(entries) {
console.log(entries) console.log(entries)
for (const entry of entries) { for (const entry of entries) {
if (entry.contentBoxSize) { if (entry.contentBoxSize) {
// const contentBoxSize = Array.isArray(entry.contentBoxSize) const contentBoxSize = Array.isArray(entry.contentBoxSize)
// ? entry.contentBoxSize[0] ? entry.contentBoxSize[0]
// : entry.contentBoxSize; : entry.contentBoxSize;
// this.chart_mixin_chartInstance.resize({ this.chart_mixin_chartInstance.resize({
// width: width:
// contentBoxSize.inlineSize < this.MIN_WIDTH contentBoxSize.inlineSize < this.MIN_WIDTH
// ? this.MIN_WIDTH ? this.MIN_WIDTH
// : contentBoxSize.inlineSize, : contentBoxSize.inlineSize,
// height: contentBoxSize.blockSize, height: contentBoxSize.blockSize,
// }); });
} else { } else {
// manipulate contentRect // manipulate contentRect
this.chart_mixin_chartInstance.resize({ this.chart_mixin_chartInstance.resize({

View File

@@ -92,11 +92,10 @@ const actions = {
/** 初始化首页数据 */ /** 初始化首页数据 */
async initHome({ commit }) { async initHome({ commit }) {
const dataArr = await getHomeInfo(); const dataArr = await getHomeInfo();
console.log('dataArr', dataArr); console.log('dataArr',dataArr);
let preData = dataArr.previousProdOutputOutDO
let preFtoData = dataArr.previousProdOutputFtoDO
// const targetArr = await getHomeInfo(); // const targetArr = await getHomeInfo();
const payload = splitCurrentAndPrevious(dataArr.prodOutputOutDO, dataArr.prodTargetDO,dataArr.prodOutputFtoDO,preData,preFtoData); const payload = splitCurrentAndPrevious(dataArr.prodOutputOutDO, dataArr.prodTargetDO,dataArr.prodOutputFtoDO
);
commit("SET_HOME_INFO", payload); commit("SET_HOME_INFO", payload);
}, },
/** 初始化驾驶舱数据 */ /** 初始化驾驶舱数据 */
@@ -126,7 +125,6 @@ const actions = {
// const payload = handler(factoryData) // const payload = handler(factoryData)
// commit("SET_COPILOT_INFO", { type, payload }); // commit("SET_COPILOT_INFO", { type, payload });
// } else { // } else {
console.log('factoryList',factoryList)
let factoryData = factoryList.prodOutputOutDO ? factoryList.prodOutputOutDO : factoryList.prodOutputRateDO let factoryData = factoryList.prodOutputOutDO ? factoryList.prodOutputOutDO : factoryList.prodOutputRateDO
let preData = factoryList.previousProdOutputOutDO ? factoryList.previousProdOutputOutDO : factoryList.previousProdOutputRateDO let preData = factoryList.previousProdOutputOutDO ? factoryList.previousProdOutputOutDO : factoryList.previousProdOutputRateDO
let preFtoData = factoryList.previousProdOutputFtoDO ? factoryList.previousProdOutputFtoDO : [] let preFtoData = factoryList.previousProdOutputFtoDO ? factoryList.previousProdOutputFtoDO : []

View File

@@ -74,9 +74,9 @@ export const SystemDataScopeEnum = {
/** /**
* 工厂名称 * 工厂名称
*/ */
// export const factoryList =['瑞昌中建材光电材料有限公司', '邯郸中建材光电材料有限公司', '中建材株洲光电材料有限公司', '佳木斯中建材光电材料有限公司', '成都中建材光电材料有限公司', '凯盛光伏材料有限公司', '蚌埠兴科玻璃有限公司'] export const factoryList =['瑞昌中建材光电材料有限公司', '邯郸中建材光电材料有限公司', '中建材株洲光电材料有限公司', '佳木斯中建材光电材料有限公司', '成都中建材光电材料有限公司', '凯盛光伏材料有限公司', '蚌埠兴科玻璃有限公司']
export const factoryArray1 =[ export const dhgfactoryList =[
{ {
name: '瑞昌中建材光电材料有限公司', name: '瑞昌中建材光电材料有限公司',
id: 0 id: 0
@@ -97,43 +97,12 @@ export const factoryArray1 =[
name: '成都中建材光电材料有限公司', name: '成都中建材光电材料有限公司',
id: 4 id: 4
}, },
{
name: '凯盛光伏材料有限公司',
id: 5
},
{ {
name: '蚌埠兴科玻璃有限公司', name: '蚌埠兴科玻璃有限公司',
id: 6 id: 6
} }
] ]
// export const dhgfactoryList =[
// {
// name: '瑞昌中建材光电材料有限公司',
// id: 0
// },
// {
// name: '邯郸中建材光电材料有限公司',
// id: 1
// },
// {
// name: '中建材株洲光电材料有限公司',
// id: 2
// },
// {
// name: '佳木斯中建材光电材料有限公司',
// id: 3
// },
// {
// name: '成都中建材光电材料有限公司',
// id: 4
// },
// {
// name: '蚌埠兴科玻璃有限公司',
// id: 6
// }
// ]
export const tyjxfactoryList =[ export const tyjxfactoryList =[
{ {
name: '凯盛光伏材料有限公司', name: '凯盛光伏材料有限公司',
@@ -141,30 +110,6 @@ export const tyjxfactoryList =[
} }
] ]
// 暂时只有瑞昌邯郸数据
export const factoryList =['瑞昌中建材光电材料有限公司', '邯郸中建材光电材料有限公司']
export const factoryArray =[
{
name: '瑞昌中建材光电材料有限公司',
id: 0
},
{
name: '邯郸中建材光电材料有限公司',
id: 1
}
]
export const dhgfactoryList =[
{
name: '瑞昌中建材光电材料有限公司',
id: 0
},
{
name: '邯郸中建材光电材料有限公司',
id: 1
}
]
/** /**
* 代码生成模板类型 * 代码生成模板类型
*/ */

View File

@@ -19,7 +19,7 @@
<CopilotButton v-for="i in ['日', '周', '月', '年']" :key="i" :label="i" :active="i === period" <CopilotButton v-for="i in ['日', '周', '月', '年']" :key="i" :label="i" :active="i === period"
@click="() => $emit('update:period', i)" /> @click="() => $emit('update:period', i)" />
<div class="btn-group"> <div class="btn-group">
<!-- <button type="button" class="export-btn" @click="handleExport" /> --> <button type="button" class="export-btn" />
<button type="button" class="fullscreen-btn" :class="[isFullscreen ? 'exit-fullscreen' : '']" <button type="button" class="fullscreen-btn" :class="[isFullscreen ? 'exit-fullscreen' : '']"
@click="toggleFullScreen" /> @click="toggleFullScreen" />
<!-- <button class="times-btn"> {{ times }} </button> --> <!-- <button class="times-btn"> {{ times }} </button> -->
@@ -31,7 +31,6 @@
<script> <script>
import CopilotButton from "./button.vue"; import CopilotButton from "./button.vue";
import screenfull from "screenfull"; import screenfull from "screenfull";
import { exportFactoryDataExcel } from "@/api/produceData";
export default { export default {
name: "CopilotHeader", name: "CopilotHeader",
@@ -59,15 +58,6 @@ export default {
}, },
computed: {}, computed: {},
methods: { methods: {
handleExport() {
exportFactoryDataExcel({
// factoryId: this.companyId,
timeSelection: this.period === 1 ? 0 : this.period === 2 ? 1 : this.period === 3 ? 2 : 3,
}).then(response => {
this.$download.excel(response, `生产数据.xls`);
// this.exportLoading = false;
}).catch(() => { });
},
getTimes() { getTimes() {
setInterval(this.getTimesInterval, 60000); setInterval(this.getTimesInterval, 60000);
}, },

View File

@@ -7,7 +7,7 @@
<CopilotButton v-for="i in ['同比', '环比']" :key="i" :label="i" :active="i === than" <CopilotButton v-for="i in ['同比', '环比']" :key="i" :label="i" :active="i === than"
@click="() => $emit('update:than', i)" /> @click="() => $emit('update:than', i)" />
<div class="btn-group"> <div class="btn-group">
<button type="button" class="export-btn" @click="handleExport" /> <button type="button" class="export-btn" />
<button type="button" class="fullscreen-btn" :class="[isFullscreen ? 'exit-fullscreen' : '']" <button type="button" class="fullscreen-btn" :class="[isFullscreen ? 'exit-fullscreen' : '']"
@click="toggleFullScreen" /> @click="toggleFullScreen" />
</div> </div>
@@ -25,8 +25,6 @@
import FactorySelect from "./FactorySelect.vue"; import FactorySelect from "./FactorySelect.vue";
import screenfull from "screenfull"; import screenfull from "screenfull";
import CopilotButton from "./button.vue"; import CopilotButton from "./button.vue";
import { exportFactoryDataExcel } from "@/api/produceData";
export default { export default {
name: "FactoryDataHeader", name: "FactoryDataHeader",
components: { CopilotButton, FactorySelect }, components: { CopilotButton, FactorySelect },
@@ -57,15 +55,6 @@ export default {
}, },
computed: {}, computed: {},
methods: { methods: {
handleExport() {
exportFactoryDataExcel({
factoryId: this.companyId,
timeSelection: this.period === 1 ? 0 : this.period === 2 ? 1 : this.period === 3 ? 2 : 3,
}).then(response => {
this.$download.excel(response, `${this.companyName}生产数据.xls`);
// this.exportLoading = false;
}).catch(() => { });
},
toggleFullScreen() { toggleFullScreen() {
this.isFullscreen = !this.isFullscreen; this.isFullscreen = !this.isFullscreen;

View File

@@ -1,15 +1,8 @@
<!-- <!--
* @Author: zhp
* @Date: 2024-04-28 13:42:51
* @LastEditTime: 2024-05-31 13:26:32
* @LastEditors: zhp
* @Description:
-->
<!--
filename: button.vue filename: button.vue
author: liubin author: liubin
date: 2024-04-16 15:02:34 date: 2024-04-16 15:02:34
description: description:
--> -->
<template> <template>
@@ -57,7 +50,7 @@ button {
padding: 12px; padding: 12px;
padding-left: 20px; padding-left: 20px;
color: #fff; color: #fff;
font-size: 18px; font-size: 22px;
letter-spacing: 10px; letter-spacing: 10px;
cursor: pointer; cursor: pointer;
} }

View File

@@ -1,10 +1,16 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-23 15:49:14 * @Date: 2024-05-23 15:49:14
* @LastEditTime: 2024-05-31 16:06:50 * @LastEditTime: 2024-05-29 10:56:21
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<!--
filename: BarChartBase.vue
author: liubin
date: 2024-04-10 08:59:28
description:
-->
<template> <template>
<chart-container class="bar-chart-base"> <chart-container class="bar-chart-base">

View File

@@ -35,7 +35,7 @@ export default {
data() { data() {
return { return {
page: "产量", page: "产量",
period: "", period: "",
than:'同比', than:'同比',
currentsStyles: '', currentsStyles: '',
}; };

View File

@@ -36,9 +36,7 @@ export default {
}, },
data() { data() {
// 城市数组的顺序必须是固定的 // 城市数组的顺序必须是固定的
const cities = ["瑞昌", "邯郸", const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"];
// "株洲", "佳木斯", "成都", "凯盛", "蚌埠"
];
return { return {
xAxis: cities, xAxis: cities,
}; };

View File

@@ -1,15 +1,15 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-10 11:10:54 * @Date: 2024-05-10 11:10:54
* @LastEditTime: 2024-05-31 16:19:45 * @LastEditTime: 2024-05-30 13:23:03
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<template> <template>
<div class="chip-rate"> <div class="chip-rate">
<ChipRateItem :period="period" :than="than" :cities="['邯郸', '瑞昌']" :color="1" /> <ChipRateItem :period="period" :than="than" :cities="['成都', '邯郸', '株洲', '瑞昌']" :color="1" />
<!-- <ChipRateItem :period="period" :than="than" :cities="['佳木斯', '凯盛光伏', '蚌埠兴科']" :color="2" /> --> <ChipRateItem :period="period" :than="than" :cities="['佳木斯', '凯盛光伏', '蚌埠兴科']" :color="2" />
</div> </div>
</template> </template>
@@ -43,15 +43,15 @@ export default {
gap: 5px; gap: 5px;
position: relative; position: relative;
// &:after { &:after {
// content: ""; content: "";
// position: absolute; position: absolute;
// left: 50%; left: 50%;
// top: 0; top: 0;
// width: 3px; width: 3px;
// height: 100%; height: 100%;
// transform: translateX(-50%); transform: translateX(-50%);
// background: linear-gradient(to bottom, transparent, #00f2ff, transparent); background: linear-gradient(to bottom, transparent, #00f2ff, transparent);
// } }
} }
</style> </style>

View File

@@ -1,21 +1,21 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-07 10:25:10 * @Date: 2024-05-07 10:25:10
* @LastEditTime: 2024-05-31 16:38:29 * @LastEditTime: 2024-05-30 11:19:51
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<template> <template>
<!-- <div class="order"> --> <!-- <div class="order"> -->
<div class="std-rate" style="width: 100%; overflow: hidden scroll; height: 400px"> <div class="std-rate" style="width: 100%; overflow: hidden scroll; height: 400px">
<!-- <div class="span-2"> <div class="span-2">
<StdRateItem :period="period" :city="cities[5]" /> <StdRateItem :period="period" :city="cities[5]" />
</div> --> </div>
<div class="span-2" v-for="item in cities.filter((val, index) => index != 5)" :key="item.name"> <div class="flex-item" v-for="item in cities.filter((val, index) => index != 5)" :key="item.name">
<StdRateItem :period="period" :than="than" :city="item" /> <StdRateItem :period="period" :than="than" :city="item" />
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
@@ -49,8 +49,8 @@ export default {
// break; // break;
// } // }
const _cities = [ const _cities = [
{ name: "瑞昌", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, }, { name: "瑞昌", target: 0, total: 0, current: 0, componentYield: 0, goodNumber:0,},
{ name: "邯郸",target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, }, { name: "邯郸", target: 0, total: 0, current: 0, componentYield: 0, goodNumber: 0, },
{ name: "株洲", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, }, { name: "株洲", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, },
{ name: "佳木斯", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, }, { name: "佳木斯", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, },
{ name: "成都", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, }, { name: "成都", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, },
@@ -80,10 +80,7 @@ export default {
} }
// 删掉凯盛光伏 // 删掉凯盛光伏
// _cities.splice(4, 1); // _cities.splice(4, 1);
let arr = [] return _cities;
arr.push(_cities[0])
arr.push(_cities[1])
return arr;
}, },
}, },
data() { data() {

View File

@@ -36,9 +36,7 @@ export default {
}, },
data() { data() {
// 城市数组的顺序必须是固定的 // 城市数组的顺序必须是固定的
const cities = ["瑞昌", "邯郸", const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"];
// "株洲", "佳木斯", "成都", "凯盛", "蚌埠"
];
return { return {
xAxis: cities, xAxis: cities,
}; };

View File

@@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-07 13:22:43 * @Date: 2024-05-07 13:22:43
* @LastEditTime: 2024-05-31 15:55:00 * @LastEditTime: 2024-05-29 14:09:08
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@@ -11,7 +11,7 @@
<span v-for="(item,index) in legend" :key="index" class="legend-item" <span v-for="(item,index) in legend" :key="index" class="legend-item"
:style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }">{{ item.label }}</span> :style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }">{{ item.label }}</span>
</div> </div>
<div ref="oeeChart" style="height:100%;width:100%"></div> <div ref="oeeChart" style="height:96%;width:100%"></div>
</chart-container> </chart-container>
</template> </template>
@@ -220,30 +220,30 @@ export default {
this.canvasReset() this.canvasReset()
}, },
/** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */ /** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */
// isFullscreen(val) { isFullscreen(val) {
// this.actualOptions.series.map((item) => { this.actualOptions.series.map((item) => {
// item.barWidth = val ? 18 : 12; item.barWidth = val ? 18 : 12;
// }); });
// this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12; this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
// this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12; this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
// this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12; this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
// // if (val === false && this.isOpen === true) { // if (val === false && this.isOpen === true) {
// // console.log(val) // console.log(val)
// // this.width = 97 + '%' // this.width = 97 + '%'
// // this.canvasReset() // this.canvasReset()
// // } else if (val === false && this.isOpen === false) { // } else if (val === false && this.isOpen === false) {
// // this.width = 100 + '%' // this.width = 100 + '%'
// // this.canvasReset() // this.canvasReset()
// // } // }
// // this.actualOptions.series.map((item) => { // this.actualOptions.series.map((item) => {
// // item.barWidth = val ? 18 : 12; // item.barWidth = val ? 18 : 12;
// // }); // });
// // this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12; // this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
// // this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12; // this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
// // this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12; // this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
// this.initChart(this.actualOptions) this.initChart(this.actualOptions)
// this.canvasReset() this.canvasReset()
// }, },
series(val) { series(val) {
if (!val) { if (!val) {
this.initChart(this.options); this.initChart(this.options);

View File

@@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-23 15:50:44 * @Date: 2024-05-23 15:50:44
* @LastEditTime: 2024-05-31 15:54:41 * @LastEditTime: 2024-05-29 14:25:10
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@@ -11,7 +11,7 @@
<span v-for="(item,index) in legend" :key="index" class="legend-item" <span v-for="(item,index) in legend" :key="index" class="legend-item"
:style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }">{{ item.label }}</span> :style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }">{{ item.label }}</span>
</div> </div>
<div ref="oeeChart" style="height:100%;width:100%"></div> <div ref="oeeChart" style="height:96%;width:100%"></div>
</chart-container> </chart-container>
</template> </template>
@@ -241,7 +241,7 @@ export default {
// this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12; // this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
// this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12; // this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
// this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12; // this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
// this.initChart(this.actualOptions) this.initChart(this.actualOptions)
// this.canvasReset() // this.canvasReset()
}, },
series(val) { series(val) {

View File

@@ -79,64 +79,15 @@ export default {
]; ];
}, },
options() { options() {
// const single = this.period === "日" || this.period === "周"; const single = this.period === "日" || this.period === "周";
const today = new Date().getDate();
const year = new Date().getFullYear(); const year = new Date().getFullYear();
const month = new Date().getMonth() + 1; const month = new Date().getMonth() + 1;
const vt = this.valueTuple; const vt = this.valueTuple;
let items = []; let titleValue = single
var day1 = new Date(); ? (vt[1] != null && `${vt[1] * 100}%`) || "0%"
day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); : vt[0] != null && vt[2] != null && vt[2] !== 0
var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() ? `${((vt[1] / vt[2]) * 100).toFixed(0)}%`
//今天的时间 : "0%",
// var day2 = new Date();
// day2.setTime(day2.getTime());
// var s2 = (day2.getMonth() + 1) + "月" + day2.getDate() + '日';
// const today = new Date().getDate();
// let yesterday = new Date().getDate() -1;
// const month = new Date().getMonth() + 1;
const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1;
// const year = new Date().getFullYear();
if (this.period === '日' && this.than === '同比') {
items = [
{ label: `${month}${today}日良率`, },
{ label: `去年${month}${today}日良率` },
];
} else if (this.period === '日' && this.than === '环比') {
items = [
{ label: `${month}${today}日良率` },
{ label: `${yesterday}日良率` },
];
} else if (this.period === '周' && this.than === '同比') {
items = [
{ label: `本周良率`, },
{ label: `去年本周良率` },
];
} else if (this.period === '周' && this.than === '环比') {
items = [
{ label: `本周良率`, },
{ label: `上周良率`, },
];
} else if (this.period === '月' && this.than === '同比') {
items = [
{ label: `${month}月良率`, },
{ label: `去年${month}月良率`, },
{ label: `${month}月目标良率`, },
];
} else if (this.period === '月' && this.than === '环比') {
items = [
{ label: `${month}月良率`, },
{ label: `${lastMonth}月良率`, },
{ label: `${month}月目标良率`, },
];
} else {
items = [
{ label: `${year}年良率`, },
{ label: `${year - 1}年良率` },
{ label: `${year}年目标良率` },
];
}
let titleValue = vt[1] === null ? 0 + '%' : this.formatNumber(vt[1]) + '%',
subtitle = { subtitle = {
: "本日良率", : "本日良率",
: "本周良率", : "本周良率",
@@ -145,12 +96,10 @@ export default {
}[this.period]; }[this.period];
const t = getOptions({ const t = getOptions({
// single, single,
color: this.color == 1 ? "#4CF0E8" : "#1065ff", color: this.color == 1 ? "#4CF0E8" : "#1065ff",
titleValue, titleValue,
subtitle, subtitle,
currentName: items[0].label,
preName: items[1].label,
previousSum: vt[0], previousSum: vt[0],
currentSum: vt[1], currentSum: vt[1],
targetSum: vt[2], targetSum: vt[2],
@@ -173,45 +122,41 @@ export default {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
if (this.period === '日' && this.than === '同比') { if (this.period === '日' && this.than === '同比') {
items = [ items = [
{ label: `去年${month}${today}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0]) ) + "%" }, { label: `${month}${today}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" },
{ label: `${month}${today}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, { label: `去年${month}${today}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" },
]; ];
} else if (this.period === '日' && this.than === '环比') { } else if (this.period === '日' && this.than === '环比') {
items = [ items = [
{ label: `${yesterday}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" }, { label: `${month}${today}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" },
{ label: `${month}${today}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, { label: `${yesterday}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" },
]; ];
} else if (this.period === '周' && this.than === '同比') { } else if (this.period === '周' && this.than === '同比') {
items = [ items = [
{ label: `去年本周良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" }, { label: `本周良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" },
{ label: `本周良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, { label: `去年本周良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" },
]; ];
} else if (this.period === '周' && this.than === '环比') { } else if (this.period === '周' && this.than === '环比') {
items = [ items = [
{ label: `周良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" }, { label: `周良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" },
{ label: `周良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, { label: `周良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" },
]; ];
} else if (this.period === '月' && this.than === '同比') { } else if (this.period === '月' && this.than === '同比') {
items = [ items = [
{ label: `去年${month}月良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" }, { label: `${month}月良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" },
{ label: `${month}月良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, { label: `去年${month}月良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" },
{ label: `${month}月目标良率`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.valueTuple[2]) + "%" },
{ label: `${month}月目标良率`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" },
]; ];
} else if (this.period === '月' && this.than === '环比') { } else if (this.period === '月' && this.than === '环比') {
items = [ items = [
{ label: `${lastMonth}月良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" }, { label: `${month}月良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" },
{ label: `${month}月良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, { label: `${lastMonth}月良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" },
{ label: `${month}月目标良率`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.valueTuple[2]) + "%" },
{ label: `${month}月目标良率`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" },
]; ];
} else { } else {
items = [ items = [
{ label: `${year - 1}年良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, { label: `${year}年良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" },
{ label: `${year}年良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, { label: `${year - 1}年良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" },
{ label: `${year}年目标良率`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.valueTuple[2]) + "%" },
{ label: `${year}年目标良率`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" },
]; ];
} }
return items return items
@@ -246,15 +191,6 @@ export default {
}, },
}, },
methods: { methods: {
formatNumber(num) {
// 判断是否为整数
if (Number.isInteger(num)) {
return num; // 如果是整数,直接转换为字符串
} else {
// 如果不是整数,保留两位小数并转换为字符串
return num.toFixed(2);
}
},
handleCityUpdate(id) { handleCityUpdate(id) {
this.factoryId = id; this.factoryId = id;
}, },
@@ -280,11 +216,14 @@ export default {
.chart { .chart {
// margin-left: 5%; // margin-left: 5%;
// width: 290px; // width: 290px;
flex: 1 1 auto; align-self: stretch;
padding: 0 15%; // flex: 1 1 auto;
// align-items: center;
// margin:0 auto;
// padding: 0 10%;;
/* margin: 10%; */ /* margin: 10%; */
/* min-width: 300px; */ /* min-width: 300px; */
align-self: stretch; height: 200px;
} }
.legend { .legend {
height: 80px; height: 80px;

View File

@@ -1,8 +1,8 @@
<!-- <!--
filename: DoubleRingChart.vue filename: DoubleRingChart.vue
author: liubin author: liubin
date: 2024-04-17 11:01:55 date: 2024-04-17 11:01:55
description: description:
--> -->
<template> <template>

View File

@@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-07 10:04:53 * @Date: 2024-05-07 10:04:53
* @LastEditTime: 2024-05-31 13:19:34 * @LastEditTime: 2024-05-30 11:13:01
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->

View File

@@ -1,138 +1,163 @@
export default ({ export default function ({
single = false,
color,
titleValue, titleValue,
subtitle, subtitle,
previousSum, previousSum,
currentSum, currentSum,
targetSum, targetSum,
currentName, }) {
preName, return {
}) => ({ grid: {
grid: { left: 0,
left: 0, right: 0,
right: 0, bottom: 0,
bottom: 0, top: 0,
top: 0, containLabel: true,
containLabel: true,
},
tooltip: {},
title: {
text: titleValue,
left: "44%",
top: "37%",
textAlign: "center",
textStyle: {
fontWeight: 600,
fontSize: 32,
color: "#fffd",
}, },
subtext: `\u2002${subtitle}\u2002`, tooltip: {
subtextStyle: { // formatter(params) {
fontSize: 14, // return `${params.name}: ${(params.value * 100).toFixed(0)}%`;
fontWeight: 100, // }
color: "#fffd",
align: "right",
}, },
}, title: {
series: [ text: titleValue,
// 背景 series left: "49%",
{ top: "39%",
type: "pie", textAlign: "center",
name: "当前良率", textStyle: {
radius: ["70%", "85%"], fontWeight: 600,
center: ["45%", "52%"], fontSize: 32,
emptyCircleStyle: { color: "#fffd",
color: "#042c5f33", },
subtext: `\u2002${subtitle}\u2002`,
subtextStyle: {
fontSize: 14,
fontWeight: 100,
color: "#fffd",
align: "right",
}, },
}, },
// 数据 series series: [
{ // 背景 series
type: "pie", {
radius: ["70%", "85%"], type: "pie",
center: ["45%", "52%"], name: "当前目标",
avoidLabelOvervlap: false, radius: ["70%", "85%"],
label: { center: ["50%", "52%"],
show: false, emptyCircleStyle: {
color: "#040c5f45",
},
}, },
labelLine: { // 数据 series
show: false, {
}, type: "pie",
data: [ radius: ["70%", "85%"],
{ center: ["50%", "52%"],
value: currentSum, avoidLabelOvervlap: false,
name: currentName, label: {
selected: false, show: false,
itemStyle: { },
borderJoin: "round", labelLine: {
borderCap: "round", show: false,
borderWidth: 12, },
borderRadius: "50%", data: [
color: { {
type: "linear", value: currentSum,
x: 1, name: "当前良率",
y: 0, selected: false,
x2: 0, itemStyle: {
y2: 1, borderJoin: "round",
colorStops: [ borderCap: "round",
{ offset: 0, color: "#4CF0E811" }, borderWidth: 12,
{ offset: 1, color: "#4CF0E8" }, borderRadius: "50%",
], color: {
type: "linear",
x: 1,
y: 0,
x2: 0,
y2: 1,
colorStops: single
? [
{ offset: 0, color: `${color}11` },
{ offset: 1, color: `${color}` },
]
: [
{ offset: 0, color: "#4CF0E811" },
{ offset: 1, color: "#4CF0E8" },
],
},
}, },
}, },
}, {
{ value:
value:currentSum == 0 targetSum > currentSum
? 1 ? targetSum - currentSum
: 0, : targetSum == 0
name: "未达成良率", ? currentSum == 0
itemStyle: { color: "transparent" }, ? 1
label: { show: false }, : 0
}, : targetSum,
],
}, name: "未达成",
// 数据 series2 - 2023累计 itemStyle: { color: "transparent" },
{ label: { show: false },
type: "pie",
radius: ["55%", "70%"],
center: ["45%", "52%"],
avoidLabelOvervlap: false,
label: {
show: false,
},
labelLine: {
show: false,
},
data: [
{
value: previousSum,
name: preName,
selected: false,
itemStyle: {
borderJoin: "round",
borderCap: "round",
borderWidth: 12,
borderRadius: "50%",
color: {
type: "linear",
x: 1,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{ offset: 0, color: "#1065ff66" },
{ offset: 1, color: "#1065ff" },
],
},
}, },
}, ],
{ },
value:previousSum == 0 // 数据 series2 - 2023累计
? 1 single
: 0, ? null
name: "-", : {
itemStyle: { color: "transparent" }, type: "pie",
label: { show: false }, radius: ["55%", "70%"],
}, center: ["50%", "52%"],
], avoidLabelOvervlap: false,
}, label: {
], show: false,
}); },
labelLine: {
show: false,
},
data: [
{
value: previousSum,
name: "上期良率",
selected: false,
itemStyle: {
borderJoin: "round",
borderCap: "round",
borderWidth: 12,
borderRadius: "50%",
color: {
type: "linear",
x: 1,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{ offset: 0, color: "#1065ff66" },
{ offset: 1, color: "#1065ff" },
],
},
},
},
{
value:
targetSum > previousSum
? targetSum - previousSum
: previousSum == 0
? 1
: 0,
name: "-",
formatter: {
show: false
},
itemStyle: { color: "transparent" },
label: { show: false },
},
],
},
],
};
}

View File

@@ -1,13 +1,13 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-20 16:04:18 * @Date: 2024-05-20 16:04:18
* @LastEditTime: 2024-05-31 13:16:26 * @LastEditTime: 2024-05-30 11:14:17
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<template> <template>
<!-- <div class="copilot-layout" ref="copilot-layout"> --> <!-- <div class="copilot-layout" ref="copilot-layout"> -->
<div class="copilot-layout" ref="copilot-layout"> <div class="copilot-layout other" ref="copilot-layout">
<CopilotHeaderVue :than="than" :active="page" :period="period" @update:active="updateActive" <CopilotHeaderVue :than="than" :active="page" :period="period" @update:active="updateActive"
@update:period="period = $event" @update:than="updateThan" /> @update:period="period = $event" @update:than="updateThan" />
@@ -34,7 +34,7 @@ export default {
return { return {
than:'同比', than:'同比',
page: "效率", page: "效率",
period: "", period: "",
currentsStyles: '', currentsStyles: '',
}; };
}, },
@@ -101,7 +101,7 @@ export default {
position: absolute; position: absolute;
left: -16px; left: -16px;
/* top: -8px; */ /* top: -8px; */
height: calc(100% + 240px); /* height: calc(100% + 38px); */
width: calc(100% + 30px); width: calc(100% + 30px);
z-index: 1001; z-index: 1001;
color: #fff; color: #fff;
@@ -114,7 +114,7 @@ export default {
height: calc(100% + 38px); height: calc(100% + 38px);
} }
.other { .other {
/* height: calc(100% + 240px); */ height: calc(100% + 240px);
} }
.copilot-footer { .copilot-footer {
/** position: absolute; /** position: absolute;

View File

@@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-30 08:58:39 * @Date: 2024-05-30 08:58:39
* @LastEditTime: 2024-05-31 15:52:28 * @LastEditTime: 2024-05-30 10:38:32
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@@ -11,7 +11,7 @@
<span v-for="(item,index) in legend" :key="index" class="legend-item" <span v-for="(item,index) in legend" :key="index" class="legend-item"
:style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }">{{ item.label }}</span> :style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }">{{ item.label }}</span>
</div> </div>
<div ref="oeeChart" style="height:100%"></div> <div ref="oeeChart" style="height:96%;width:100%"></div>
</chart-container> </chart-container>
</template> </template>
@@ -79,7 +79,7 @@ export default {
data: this.xAxis, data: this.xAxis,
}, },
yAxis: { yAxis: {
name: "单位/", name: "单位/%",
nameTextStyle: { nameTextStyle: {
color: "#fff", color: "#fff",
fontSize: 12, fontSize: 12,

View File

@@ -5,7 +5,7 @@
</div> </div>
<div class="chart"> <div class="chart">
<div class="chart-title"> <div class="chart-title">
<span class="title">工单情况</span> <span class="title">生产情况</span>
<span class="line"></span> <span class="line"></span>
</div> </div>
<barChartBase :energyCockpits="prodOrder" ref="barChart" style="height: 0;flex:1"></barChartBase> <barChartBase :energyCockpits="prodOrder" ref="barChart" style="height: 0;flex:1"></barChartBase>

View File

@@ -23,10 +23,7 @@ export default {
components: { BarChartBase }, components: { BarChartBase },
data() { data() {
// 城市数组的顺序必须是固定的 // 城市数组的顺序必须是固定的
const cities = ["瑞昌", "邯郸", const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"];
// "株洲", "佳木斯", "成都", "凯盛", "蚌埠"
];
return { return {
xAxis: cities, xAxis: cities,
}; };

View File

@@ -23,10 +23,7 @@ export default {
components: { BarChartBase }, components: { BarChartBase },
data() { data() {
// 城市数组的顺序必须是固定的 // 城市数组的顺序必须是固定的
const cities = ["瑞昌", "邯郸", const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"];
// "株洲", "佳木斯", "成都", "凯盛", "蚌埠"
];
return { return {
xAxis: cities, xAxis: cities,
}; };

View File

@@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-20 13:32:59 * @Date: 2024-05-20 13:32:59
* @LastEditTime: 2024-05-31 15:05:20 * @LastEditTime: 2024-05-30 13:35:00
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@@ -151,10 +151,9 @@ export default {
]; ];
} }
let titleValue = let titleValue =
vt[1] != null && vt[2] !== 0 vt[0] != null && vt[2] != null && vt[2] !== 0
? this.formatNumber((vt[1] / vt[2] * 100)) + '%' ? `${vt[1] / vt[2]}%`
: (vt[1] != 0 && vt[1] != null) && vt[2] == 0 : "0%",
? "100%" : '0%',
subtitle = subtitle =
this.period == "日" ? `${month}${today}日累计` : this.period == "周" ? `本周` : this.period == "月" ? `${month}月累计产出` : `${year}年累计产出`; this.period == "日" ? `${month}${today}日累计` : this.period == "周" ? `本周` : this.period == "月" ? `${month}月累计产出` : `${year}年累计产出`;
console.log(this.valueTuple[0], this.valueTuple[1], this.valueTuple[2],) console.log(this.valueTuple[0], this.valueTuple[1], this.valueTuple[2],)
@@ -197,15 +196,6 @@ export default {
} }
}, },
methods: { methods: {
formatNumber(num) {
// 判断是否为整数
if (Number.isInteger(num)) {
return num; // 如果是整数,直接转换为字符串
} else {
// 如果不是整数,保留两位小数并转换为字符串
return num.toFixed(2);
}
}
// fullscreen mixin 需要的回调 // fullscreen mixin 需要的回调
// fullscreenCallback(isFullscreen) { // fullscreenCallback(isFullscreen) {
// console.log("isFullscreen--->", isFullscreen); // console.log("isFullscreen--->", isFullscreen);
@@ -229,40 +219,40 @@ function calculateItems(period, valueTuple,than) {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
if (period === '日' && than === '同比') { if (period === '日' && than === '同比') {
items = [ items = [
{ label: `去年${month}${today}日累计`, value: valueTuple[0] },
{ label: `${month}${today}日累计`, value: valueTuple[1] }, { label: `${month}${today}日累计`, value: valueTuple[1] },
{ label: `去年${month}${today}日累计`, value: valueTuple[0] },
]; ];
} else if (period === '日' && than === '环比') { } else if (period === '日' && than === '环比') {
items = [ items = [
{ label: `${yesterday}日累计`, value: valueTuple[0] },
{ label: `${month}${today}日累计`, value: valueTuple[1] }, { label: `${month}${today}日累计`, value: valueTuple[1] },
{ label: `${yesterday}日累计`, value: valueTuple[0] },
]; ];
} else if (period === '周' && than === '同比') { } else if (period === '周' && than === '同比') {
items = [ items = [
{ label: `去年本周累计`, value: valueTuple[0] },
{ label: `本周累计`, value: valueTuple[1] }, { label: `本周累计`, value: valueTuple[1] },
{ label: `去年本周累计`, value: valueTuple[0] },
]; ];
} else if (period === '周' && than === '环比') { } else if (period === '周' && than === '环比') {
items = [ items = [
{ label: `上周累计`, value: valueTuple[0] },
{ label: `本周累计`, value: valueTuple[1] }, { label: `本周累计`, value: valueTuple[1] },
{ label: `上周累计`, value: valueTuple[0] },
]; ];
} else if (period === '月' && than === '同比') { } else if (period === '月' && than === '同比') {
items = [ items = [
{ label: `去年${month}月累计`, value: valueTuple[0] },
{ label: `${month}月累计`, value: valueTuple[1] }, { label: `${month}月累计`, value: valueTuple[1] },
{ label: `去年${month}月累计`, value: valueTuple[0] },
{ label: `${month}月目标`, value: valueTuple[2] }, { label: `${month}月目标`, value: valueTuple[2] },
]; ];
} else if (period === '月' && than === '环比') { } else if (period === '月' && than === '环比') {
items = [ items = [
{ label: `${lastMonth}月累计`, value: valueTuple[0] },
{ label: `${month}月累计`, value: valueTuple[1] }, { label: `${month}月累计`, value: valueTuple[1] },
{ label: `${lastMonth}月累计`, value: valueTuple[0] },
{ label: `${month}月目标`, value: valueTuple[2] }, { label: `${month}月目标`, value: valueTuple[2] },
]; ];
} else { } else {
items = [ items = [
{ label: `${year - 1}年累计`, value: valueTuple[0] },
{ label: `${year}年累计`, value: valueTuple[1] }, { label: `${year}年累计`, value: valueTuple[1] },
{ label: `${year - 1}年累计`, value: valueTuple[0] },
{ label: `${year}年目标`, value: valueTuple[2] }, { label: `${year}年目标`, value: valueTuple[2] },
]; ];
} }
@@ -324,17 +314,17 @@ function calculateItems(period, valueTuple,than) {
left: -18px; left: -18px;
} }
.legend-item:nth-child(2) .legend-item__label::before { .legend-item:nth-child(1) .legend-item__label::before {
background: #12fff5; background: #12fff5;
} }
.legend-item:nth-child(2) .legend-item__value { .legend-item:nth-child(1) .legend-item__value {
color: #12fff5; color: #12fff5;
} }
.legend-item:nth-child(1) .legend-item__label::before { .legend-item:nth-child(2) .legend-item__label::before {
background: #0f65ff; background: #0f65ff;
} }
.legend-item:nth-child(1) .legend-item__value { .legend-item:nth-child(2) .legend-item__value {
color: #0f65ff; color: #0f65ff;
} }

View File

@@ -1,10 +1,3 @@
<!--
* @Author: zhp
* @Date: 2024-05-30 16:00:50
* @LastEditTime: 2024-05-31 16:15:51
* @LastEditors: zhp
* @Description:
-->
<!-- <!--
filename: DoubleRingWrapper.vue filename: DoubleRingWrapper.vue
author: liubin author: liubin
@@ -49,13 +42,13 @@ export default {
return { return {
factoryId: 4, // 默认成都 factoryId: 4, // 默认成都
cityOptions: [ cityOptions: [
// "成都", "成都",
"邯郸", "邯郸",
// "株洲", "株洲",
"瑞昌", "瑞昌",
// "佳木斯", "佳木斯",
// "凯盛光伏", "凯盛光伏",
// "蚌埠兴科", "蚌埠兴科",
], ],
}; };
}, },

View File

@@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-24 15:15:00 * @Date: 2024-05-24 15:15:00
* @LastEditTime: 2024-05-31 16:16:16 * @LastEditTime: 2024-05-28 08:42:36
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@@ -54,12 +54,12 @@ export default {
return { return {
factoryId: 4, // 默认成都 factoryId: 4, // 默认成都
cityOptions: [ cityOptions: [
// "成都", "成都",
"邯郸", "邯郸",
// "株洲", "株洲",
// "佳木斯", "佳木斯",
// "凯盛光伏", "凯盛光伏",
// "蚌埠兴科", "蚌埠兴科",
], ],
}; };
}, },

View File

@@ -80,9 +80,15 @@ export default ({
}, },
}, },
{ {
value:currentSum == 0 value:
? 1 targetSum > currentSum
? targetSum - currentSum
: targetSum == 0
? currentSum == 0
? 1
: 0
: 0, : 0,
name: "未达成累计", name: "未达成累计",
itemStyle: { color: "transparent" }, itemStyle: { color: "transparent" },
label: { show: false }, label: { show: false },
@@ -125,7 +131,10 @@ export default ({
}, },
}, },
{ {
value:previousSum == 0 value:
targetSum > previousSum
? targetSum - previousSum
: previousSum == 0
? 1 ? 1
: 0, : 0,
name: "-", name: "-",

View File

@@ -1,15 +1,8 @@
<!-- <!--
* @Author: zhp
* @Date: 2024-04-28 13:42:51
* @LastEditTime: 2024-05-31 16:14:09
* @LastEditors: zhp
* @Description:
-->
<!--
filename: Bipv.vue filename: Bipv.vue
author: liubin author: liubin
date: 2024-04-10 15:39:54 date: 2024-04-10 15:39:54
description: description:
--> -->
<template> <template>
@@ -31,10 +24,7 @@ export default {
data() { data() {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
// 城市数组的顺序必须是固定的 // 城市数组的顺序必须是固定的
const cities = ["瑞昌", "邯郸", const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"];
// "株洲", "佳木斯", "成都", "凯盛", "蚌埠"
];
return { return {
legend: [ legend: [
{ label: `${year}年目标值`, color: "#f3c000" }, { label: `${year}年目标值`, color: "#f3c000" },

View File

@@ -1,8 +1,8 @@
<!-- <!--
filename: chip-invest.vue filename: chip-invest.vue
author: liubin author: liubin
date: 2024-04-10 08:59:28 date: 2024-04-10 08:59:28
description: description:
--> -->
<template> <template>
@@ -23,9 +23,7 @@ export default {
data() { data() {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
// 城市数组的顺序必须是固定的 // 城市数组的顺序必须是固定的
const cities = ["瑞昌", "邯郸", const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"];
// "株洲", "佳木斯", "成都", "凯盛", "蚌埠"
];
return { return {
legend: [ legend: [
{ label: `${year - 1}`, color: "#12f7f1" }, { label: `${year - 1}`, color: "#12f7f1" },

View File

@@ -1,8 +1,8 @@
<!-- <!--
filename: ChipYield.vue filename: ChipYield.vue
author: liubin author: liubin
date: 2024-04-11 10:46:47 date: 2024-04-11 10:46:47
description: description:
--> -->
<template> <template>
@@ -11,24 +11,24 @@
<section class="right-part"> <section class="right-part">
<div class="yield-location"> <div class="yield-location">
<section class="btn-group"> <section class="btn-group">
<!-- <button <button
@click="activeLoc = '1'" @click="activeLoc = '1'"
:class="activeLoc === '1' ? 'active' : ''" :class="activeLoc === '1' ? 'active' : ''"
> >
成都 成都
</button> --> </button>
<button <button
@click="activeLoc = '2'" @click="activeLoc = '2'"
:class="activeLoc === '2' ? 'active' : ''" :class="activeLoc === '2' ? 'active' : ''"
> >
邯郸 邯郸
</button> </button>
<!-- <button <button
@click="activeLoc = '3'" @click="activeLoc = '3'"
:class="activeLoc === '3' ? 'active' : ''" :class="activeLoc === '3' ? 'active' : ''"
> >
株洲 株洲
</button> --> </button>
<button <button
@click="activeLoc = '4'" @click="activeLoc = '4'"
:class="activeLoc === '4' ? 'active' : ''" :class="activeLoc === '4' ? 'active' : ''"
@@ -37,7 +37,7 @@
</button> </button>
</section> </section>
<section class="btn-group"> <section class="btn-group">
<!-- <button <button
@click="activeLoc = '5'" @click="activeLoc = '5'"
:class="activeLoc === '5' ? 'active' : ''" :class="activeLoc === '5' ? 'active' : ''"
class="fixwidth" class="fixwidth"
@@ -55,7 +55,7 @@
:class="activeLoc === '7' ? 'active' : ''" :class="activeLoc === '7' ? 'active' : ''"
> >
蚌埠兴科 蚌埠兴科
</button> --> </button>
</section> </section>
</div> </div>
<div class="yield-summary"> <div class="yield-summary">
@@ -85,14 +85,13 @@ export default {
props: {}, props: {},
data() { data() {
return { return {
activeLoc: "2", activeLoc: "1",
}; };
}, },
computed: { computed: {
output() { output() {
// ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"] // ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"]
const chipOutput = this.$store.getters.home.chipOutput; const chipOutput = this.$store.getters.home.chipOutput;
console.log('chipOutput', chipOutput);
if ( if (
!chipOutput || !chipOutput ||
!chipOutput.target || !chipOutput.target ||

View File

@@ -1,15 +1,8 @@
<!-- <!--
* @Author: zhp
* @Date: 2024-04-28 13:42:51
* @LastEditTime: 2024-05-31 16:11:56
* @LastEditors: zhp
* @Description:
-->
<!--
filename: ChipYield.vue filename: ChipYield.vue
author: liubin author: liubin
date: 2024-04-11 10:46:47 date: 2024-04-11 10:46:47
description: description:
--> -->
<template> <template>

View File

@@ -1,15 +1,8 @@
<!-- <!--
* @Author: zhp
* @Date: 2024-04-28 13:42:51
* @LastEditTime: 2024-05-31 16:11:06
* @LastEditors: zhp
* @Description:
-->
<!--
filename: fto.vue filename: fto.vue
author: liubin author: liubin
date: 2024-04-10 08:59:28 date: 2024-04-10 08:59:28
description: description:
--> -->
<template> <template>
@@ -30,9 +23,7 @@ export default {
data() { data() {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
// 城市数组的顺序必须是固定的 // 城市数组的顺序必须是固定的
const cities = ["瑞昌", "邯郸", const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"];
// "株洲", "佳木斯", "成都", "凯盛", "蚌埠"
];
return { return {
legend: [ legend: [
{ label: `${year - 1}`, color: "#12f7f1" }, { label: `${year - 1}`, color: "#12f7f1" },

View File

@@ -1,8 +1,8 @@
<!-- <!--
filename: left-chart-base filename: left-chart-base
author: liubin author: liubin
date: 2024-04-10 08:59:28 date: 2024-04-10 08:59:28
description: description:
--> -->
<template> <template>
@@ -113,16 +113,6 @@ export default {
barWidth: 12, barWidth: 12,
itemStyle: { itemStyle: {
borderRadius: [10, 10, 0, 0], borderRadius: [10, 10, 0, 0],
normal: {
label: {
show: true, //开启显示
position: 'top', //在上方显示
textStyle: { //数值样式
color: '#DFF1FE',
fontSize: 16
}
}
},
color: { color: {
type: "linear", type: "linear",
x: 0, x: 0,
@@ -156,6 +146,11 @@ export default {
name: '', // this.series[1].name, name: '', // this.series[1].name,
type: "bar", type: "bar",
barWidth: 12, barWidth: 12,
// tooltip: {
// valueFormatter: function (value) {
// return value + " ml";
// },
// },
itemStyle: { itemStyle: {
borderRadius: [10, 10, 0, 0], borderRadius: [10, 10, 0, 0],
color: { color: {

View File

@@ -1,15 +1,8 @@
<!-- <!--
* @Author: zhp
* @Date: 2024-04-28 13:42:51
* @LastEditTime: 2024-05-31 16:13:47
* @LastEditors: zhp
* @Description:
-->
<!--
filename: right-chart-base filename: right-chart-base
author: liubin author: liubin
date: 2024-04-10 08:59:28 date: 2024-04-10 08:59:28
description: description:
--> -->
<template> <template>

View File

@@ -1,8 +1,8 @@
<!-- <!--
filename: Bipv.vue filename: Bipv.vue
author: liubin author: liubin
date: 2024-04-10 15:39:54 date: 2024-04-10 15:39:54
description: description:
--> -->
<template> <template>
@@ -25,9 +25,7 @@ export default {
data() { data() {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
// 城市数组的顺序必须是固定的 // 城市数组的顺序必须是固定的
const cities = ["瑞昌", "邯郸", const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"];
// "株洲", "佳木斯", "成都", "凯盛", "蚌埠"
];
return { return {
legend: [ legend: [
{ label: `${year}年目标值`, color: "#f3c000" }, { label: `${year}年目标值`, color: "#f3c000" },

View File

@@ -1,18 +1,18 @@
<template> <template>
<div class="dashboard-factory-all"> <div class="dashboard-factory-all">
<div id="map-container"> <div id="map-container">
<!-- <div v-if="visible" class="cdLine"></div> --> <div v-if="visible" class="cdLine"></div>
<!-- <div v-if="visible" class="zzLine"></div> --> <div v-if="visible" class="zzLine"></div>
<div v-if="visible" class="rcLine"></div> <div v-if="visible" class="rcLine"></div>
<div v-if="visible" class="rcLineTwo"></div> <div v-if="visible" class="rcLineTwo"></div>
<div v-if="visible" class="hdLine"></div> <div v-if="visible" class="hdLine"></div>
<div v-if="visible" class="hdLineTwo"></div> <div v-if="visible" class="hdLineTwo"></div>
<!-- <div v-if="visible" class="ksLine"></div> --> <div v-if="visible" class="ksLine"></div>
<!-- <div v-if="visible" class="bbLine"></div> --> <div v-if="visible" class="bbLine"></div>
<!-- <div v-if="visible" class="bbLineTwo"></div> --> <div v-if="visible" class="bbLineTwo"></div>
<!-- <div v-if="visible" class="bbLineThree"></div> --> <div v-if="visible" class="bbLineThree"></div>
<!-- <div v-if="visible" class="jmsLine"></div> --> <div v-if="visible" class="jmsLine"></div>
<!-- <div v-if="visible" class="jmsLineTwo"></div> --> <div v-if="visible" class="jmsLineTwo"></div>
<div class="databoard"> <div class="databoard">
<db-header class="db-header"></db-header> <db-header class="db-header"></db-header>
<div class="db-body"> <div class="db-body">
@@ -61,19 +61,19 @@ import StdChart from "./dashboard/charts/StdChart.vue";
const LOCATIONS = [ const LOCATIONS = [
// 佳木斯 // 佳木斯
// { x: 67, y: 20, tx: 60, ty: 29, path: 'factoryData/jmsIndex' }, { x: 67, y: 20, tx: 60, ty: 29, path: 'copilot/jmsIndex' },
// 成都 // 成都
// { x: 46, y: 56, tx: 46, ty: 93, path: 'factoryData/cdIndex' }, { x: 46, y: 56,tx:46,ty:93, path: 'copilot/cdIndex' },
// 蚌埠1 // 蚌埠1
// { x: 60, y: 52, tx: 35.5, ty: 48.3, path: 'factoryData/bbIndex' }, { x: 60, y: 52, tx: 35.5, ty: 48.3, path: 'copilot/bbIndex' },
// 蚌埠2 // 蚌埠2
// { x: 61, y: 53, tx: 39, ty: 68, path: 'factoryData/ksIndex' }, { x: 61, y: 53,tx:39,ty:68, path: 'copilot/ksIndex' },
// 江西 瑞昌 // 江西 瑞昌
{ x: 60, y: 58, tx: 68, ty: 52, path: 'factoryData/factory-data' }, { x: 60, y: 58, tx: 68, ty: 52, path: 'copilot/factory-data' },
// 湖南 株洲 // 湖南 株洲
// { x: 56, y: 60, tx: 60, ty: 95, path: 'factoryData/zzIndex' }, { x: 56, y: 60, tx: 60, ty: 95, path: 'copilot/zzIndex' },
// 邯郸 // 邯郸
{ x: 58, y: 45, tx: 47, ty: 34, path: 'factoryData/hdIndex' }, { x: 58, y: 45, tx: 47, ty: 34, path: 'copilot/hdIndex' },
]; ];
export default { export default {
@@ -213,41 +213,39 @@ export default {
{ label: "标准组件产出", value: 0 }, // Math.floor(Math.random() * 1000000) }, { label: "标准组件产出", value: 0 }, // Math.floor(Math.random() * 1000000) },
], ],
}; };
if if (position === LOCATIONS[0]) {
// (position === LOCATIONS[0]) { templateInfo.companyName = "佳木斯中建材";
// templateInfo.companyName = "佳木斯中建材"; this.jmsHintPosition = position;
// this.jmsHintPosition = position; templateInfo.items[0].value = this.homeStore.ftoInvest.current[3];
// templateInfo.items[0].value = this.homeStore.ftoInvest.current[3]; templateInfo.items[2].value = this.homeStore.chipInvest.current[3];
// templateInfo.items[2].value = this.homeStore.chipInvest.current[3]; templateInfo.items[1].value = this.homeStore.chipOutput.current[3];
// templateInfo.items[1].value = this.homeStore.chipOutput.current[3]; templateInfo.items[3].value = this.homeStore.stdOutput.current[3];
// templateInfo.items[3].value = this.homeStore.stdOutput.current[3]; this.jmsInfo = templateInfo;
// this.jmsInfo = templateInfo; } else if (position === LOCATIONS[1]) {
// } else if (position === LOCATIONS[1]) { this.cdHintPosition = position;
// this.cdHintPosition = position; templateInfo.companyName = "成都中建材";
// templateInfo.companyName = "成都中建材"; templateInfo.items[0].value = this.homeStore.ftoInvest?.current[4];
// templateInfo.items[0].value = this.homeStore.ftoInvest?.current[4]; templateInfo.items[2].value = this.homeStore.chipInvest.current[4];
// templateInfo.items[2].value = this.homeStore.chipInvest.current[4]; templateInfo.items[1].value = this.homeStore.chipOutput.current[4];
// templateInfo.items[1].value = this.homeStore.chipOutput.current[4]; templateInfo.items[3].value = this.homeStore.stdOutput.current[4];
// templateInfo.items[3].value = this.homeStore.stdOutput.current[4]; this.cdInfo = templateInfo;
// this.cdInfo = templateInfo; } else if (position === LOCATIONS[2]) {
// } else if (position === LOCATIONS[2]) { this.bbHintPosition = position;
// this.bbHintPosition = position; templateInfo.companyName = "蚌埠兴科";
// templateInfo.companyName = "蚌埠兴科"; templateInfo.items[0].value = this.homeStore.ftoInvest?.current[6];
// templateInfo.items[0].value = this.homeStore.ftoInvest?.current[6]; templateInfo.items[2].value = this.homeStore.chipInvest.current[6];
// templateInfo.items[2].value = this.homeStore.chipInvest.current[6]; templateInfo.items[1].value = this.homeStore.chipOutput?.current[6];
// templateInfo.items[1].value = this.homeStore.chipOutput?.current[6]; templateInfo.items[3].value = this.homeStore.stdOutput.current[6];
// templateInfo.items[3].value = this.homeStore.stdOutput.current[6]; this.bbInfo = templateInfo;
// this.bbInfo = templateInfo; } else if (position === LOCATIONS[3]) {
// } else if (position === LOCATIONS[3]) { this.ksHintPosition = position;
// this.ksHintPosition = position; templateInfo.companyName = "凯盛光伏";
// templateInfo.companyName = "凯盛光伏"; templateInfo.items[0].value = this.homeStore.ftoInvest?.current[5];
// templateInfo.items[0].value = this.homeStore.ftoInvest?.current[5]; templateInfo.items[2].value = this.homeStore.chipInvest.current[5];
// templateInfo.items[2].value = this.homeStore.chipInvest.current[5]; templateInfo.items[1].value = this.homeStore.chipOutput.current[5];
// templateInfo.items[1].value = this.homeStore.chipOutput.current[5]; templateInfo.items[3].value = this.homeStore.stdOutput.current[5];
// templateInfo.items[3].value = this.homeStore.stdOutput.current[5]; this.ksInfo = templateInfo;
// this.ksInfo = templateInfo; } else if (position === LOCATIONS[4]) {
// }
(position === LOCATIONS[0]) {
this.rcHintPosition = position; this.rcHintPosition = position;
templateInfo.companyName = "瑞昌中建材"; templateInfo.companyName = "瑞昌中建材";
templateInfo.items[0].value = this.homeStore.ftoInvest?.current[0]; templateInfo.items[0].value = this.homeStore.ftoInvest?.current[0];
@@ -255,15 +253,15 @@ export default {
templateInfo.items[1].value = this.homeStore.chipOutput.current[0]; templateInfo.items[1].value = this.homeStore.chipOutput.current[0];
templateInfo.items[3].value = this.homeStore.stdOutput.current[0]; templateInfo.items[3].value = this.homeStore.stdOutput.current[0];
this.info = templateInfo; this.info = templateInfo;
// } else if (position === LOCATIONS[5]) { } else if (position === LOCATIONS[5]) {
// this.zzHintPosition = position; this.zzHintPosition = position;
// templateInfo.companyName = "株洲中建材"; templateInfo.companyName = "株洲中建材";
// templateInfo.items[0].value = this.homeStore.ftoInvest?.current[2]; templateInfo.items[0].value = this.homeStore.ftoInvest?.current[2];
// templateInfo.items[2].value = this.homeStore.chipInvest.current[2]; templateInfo.items[2].value = this.homeStore.chipInvest.current[2];
// templateInfo.items[1].value = this.homeStore.chipOutput.current[2]; templateInfo.items[1].value = this.homeStore.chipOutput.current[2];
// templateInfo.items[3].value = this.homeStore.stdOutput.current[2]; templateInfo.items[3].value = this.homeStore.stdOutput.current[2];
// this.zzInfo = templateInfo; this.zzInfo = templateInfo;
} else if (position === LOCATIONS[1]) { } else if (position === LOCATIONS[6]) {
this.hdHintPosition = position; this.hdHintPosition = position;
templateInfo.companyName = "邯郸中建材"; templateInfo.companyName = "邯郸中建材";
templateInfo.items[0].value = this.homeStore.ftoInvest?.current[1]; templateInfo.items[0].value = this.homeStore.ftoInvest?.current[1];

View File

@@ -218,7 +218,7 @@ export default {
data() { data() {
return { return {
codeUrl: "", codeUrl: "",
captchaEnable: false, captchaEnable: true,
tenantEnable: true, tenantEnable: true,
mobileCodeTimer: 0, mobileCodeTimer: 0,
loginForm: { loginForm: {

View File

@@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-15 10:49:13 * @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-05-31 19:14:05 * @LastEditTime: 2024-05-22 15:25:11
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@@ -10,17 +10,17 @@
<div class="app-container" style="padding: 16px 24px 0;height: auto; flex-grow: 1;"> <div class="app-container" style="padding: 16px 24px 0;height: auto; flex-grow: 1;">
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item label="时间维度" prop="date"> <el-form-item label="时间维度" prop="date">
<el-select size="small" clearable v-model="listQuery.mode" placeholder="请选择"> <el-select size="small" clearable v-model="listQuery.date" placeholder="请选择">
<el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value"> <el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.mode === 0 || listQuery.mode === ''" label="时间范围" prop="reportTime"> <el-form-item v-show="listQuery.date === 0 || listQuery.date === ''" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="datetimerange" range-separator="至" <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="datetimerange" range-separator="至"
start-placeholder="开始日期" value-format="timestamp" format="yyyy-MM-dd" @change="changeDayTime" end-placeholder="结束日期"> start-placeholder="开始日期" value-format="timestamp" @change="changeDayTime" end-placeholder="结束日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.mode === 1" label="时间范围" prop="reportTime"> <el-form-item v-show="listQuery.date === 1" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.start" type="week" format="yyyy 第 WW 周" placeholder="选择周" <el-date-picker size="small" clearable v-model="listQuery.start" type="week" format="yyyy 第 WW 周" placeholder="选择周"
style="width: 180px" @change="onValueChange"> style="width: 180px" @change="onValueChange">
</el-date-picker> </el-date-picker>
@@ -32,12 +32,12 @@
{{ date1 }} {{ date2 }} {{ weekNum }} {{ date1 }} {{ date2 }} {{ weekNum }}
</span> </span>
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.mode === 2" label="时间范围" prop="reportTime"> <el-form-item v-show="listQuery.date === 2" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="monthrange" value-format="timestamp" range-separator="至" <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="monthrange" value-format="timestamp" range-separator="至"
start-placeholder="开始月份" end-placeholder="结束月份" @change="changeTime"> start-placeholder="开始月份" end-placeholder="结束月份" @change="changeTime">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.mode === 3" label="时间范围" prop="reportTime"> <el-form-item v-show="listQuery.date === 3" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.start" format="yyyy-MM-dd" value-format="timestamp" type="year" <el-date-picker size="small" clearable v-model="listQuery.start" format="yyyy-MM-dd" value-format="timestamp" type="year"
placeholder="开始时间"> placeholder="开始时间">
</el-date-picker> </el-date-picker>
@@ -48,7 +48,7 @@
</el-form-item> </el-form-item>
<el-form-item label="工厂名称" prop="factorys"> <el-form-item label="工厂名称" prop="factorys">
<el-select size="small" clearable v-model="listQuery.factorys" placeholder="请选择工厂名称" multiple > <el-select size="small" clearable v-model="listQuery.factorys" placeholder="请选择工厂名称" multiple >
<el-option v-for="item in factoryArray" :key="item.id" :label="item.name" :value="item.id"> <el-option v-for="item in factoryList" :key="item.id" :label="item.name" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -59,7 +59,7 @@
</el-select> </el-select>
</el-form-item> --> </el-form-item> -->
<el-form-item label="玻璃类型" prop="type"> <el-form-item label="玻璃类型" prop="type">
<el-select size="small" clearable v-model="listQuery.type" multiple placeholder="请选择玻璃类型"> <el-select size="small" clearable v-model="listQuery.type" placeholder="请选择玻璃类型">
<el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id"> <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
@@ -94,7 +94,7 @@
@pagination="getDataList" @pagination="getDataList"
/> />
</div> </div>
<add-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" :date="listQuery.mode" @refreshDataList="successSubmit" @destroy="detailOrUpdateVisible = false" /> <add-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" :date="listQuery.date" @refreshDataList="successSubmit" @destroy="detailOrUpdateVisible = false" />
<!-- <inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all" <!-- <inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all"
:type="listQuery.reportType" @refreshDataList="getDataList" /> --> :type="listQuery.reportType" @refreshDataList="getDataList" /> -->
<!-- <pagination <!-- <pagination
@@ -107,29 +107,27 @@
<script> <script>
// import { parseTime } from '../../core/mixins/code-filter'; // import { parseTime } from '../../core/mixins/code-filter';
import { getProduceDataPage, prodOutputDataList, exportOutPutExcel } from '@/api/produceData'; import { getProduceDataPage, exportOutPutExcel } from '@/api/produceData';
// import inputTable from './inputTable.vue'; // import inputTable from './inputTable.vue';
import lineChart from './lineChart'; import lineChart from './lineChart';
import moment from 'moment' import moment from 'moment'
import ButtonNav from '@/components/ButtonNav' import ButtonNav from '@/components/ButtonNav'
import basicPage from '@/mixins/basic-page' import basicPage from '@/mixins/basic-page'
import AddOrUpdate from './add-or-updata' import AddOrUpdate from './add-or-updata';
import { factoryList, factoryArray, factoryArray1 } from "@/utils/constants";
// import FileSaver from 'file-saver'
// import * as XLSX from 'xlsx'
export default { export default {
components: { lineChart, ButtonNav, AddOrUpdate }, components: { lineChart, ButtonNav, AddOrUpdate },
mixins: [basicPage], mixins: [basicPage],
data() { data() {
return { return {
factoryList,
factoryArray,
factoryArray1,
listQuery: { listQuery: {
size: 20, size: 20,
current: 1, current: 1,
factorys: undefined, factorys: [],
total: 0, total: 0,
mode: 0, date: 1,
type:undefined, type:undefined,
// reportType: 2, // reportType: 2,
beginTime: undefined, beginTime: undefined,
@@ -165,6 +163,31 @@ export default {
id: 2, id: 2,
}, },
], ],
// weekNum: undefined,
dataList: [
{
id:'first',
},
{
id: 'second',
},
{
id: 'third',
},
{
id: 'fourth',
},
{
id: 'fifth',
},
{
id: 'sixth',
},
],
urlOptions: {
// getDataListURL: getGlassPage,
// exportURL: exportGlasscExcel
},
formConfig: [ formConfig: [
{ {
type: 'title', type: 'title',
@@ -195,6 +218,36 @@ export default {
label: '年' label: '年'
} }
], ],
factoryList: [
{
name: '瑞昌中建材光电材料有限公司',
id: 0
},
{
name: '邯郸中建材光电材料有限公司',
id: 1
},
{
name: '中建材株洲光电材料有限公司',
id: 2
},
{
name: '佳木斯中建材光电材料有限公司',
id: 3
},
{
name: '成都中建材光电材料有限公司',
id: 4
},
{
name: '凯盛光伏材料有限公司',
id: 5
},
{
name: '蚌埠兴科玻璃有限公司',
id: 6
}
],
tableProps: [ tableProps: [
{ {
prop: 'tableTime', prop: 'tableTime',
@@ -205,7 +258,7 @@ export default {
{ {
prop: 'factory', prop: 'factory',
label: '工厂名称', label: '工厂名称',
filter: (val) => factoryList[val], filter: (val) => ['瑞昌中建材光电材料有限公司', '邯郸中建材光电材料有限公司', '中建材株洲光电材料有限公司', '佳木斯中建材光电材料有限公司', '成都中建材光电材料有限公司', '凯盛光伏材料有限公司', '蚌埠兴科玻璃有限公司'][val],
minWidth: 200, minWidth: 200,
showOverflowtooltip: true showOverflowtooltip: true
}, },
@@ -229,30 +282,21 @@ export default {
{ {
prop: 'yieldRate', prop: 'yieldRate',
label: '良品率%', label: '良品率%',
filter: (val) => val + '%'
}, },
], ],
tableData: [], tableData: [],
lineData: [], xAxis: []
chart: null,
seriesList: []
// proLineList: [], // proLineList: [],
// all: {} // all: {}
}; };
}, },
computed: { computed: {
weekNum() { weekNum() {
return Math.round((this.listQuery.end - this.listQuery.start) / (24 * 60 * 60 * 1000 * 7)) + 1 return Math.round((this.listQuery.end - this.listQuery.start) / (24 * 60 * 60 * 1000 * 7)) + 1
}, },
}, },
created() {
const today = new Date()
const sevenDaysAgo = new Date(today.getTime() - (7 * 24 * 60 * 60 * 1000))
this.listQuery.beginTime = sevenDaysAgo.getTime()
this.listQuery.endTime = today.getTime()
this.listQuery.reportTime = [this.listQuery.beginTime, this.listQuery.endTime]
},
mounted() { mounted() {
this.getDataList()
}, },
methods: { methods: {
otherMethods(val) { otherMethods(val) {
@@ -262,6 +306,9 @@ export default {
this.$refs.detailOrUpdate.init(val.data.id); this.$refs.detailOrUpdate.init(val.data.id);
}); });
}, },
// buttonClick() {
// },
getYear(e) { getYear(e) {
if (this.listQuery.end - this.listQuery.start > 10*365*24*60*60*1000) { if (this.listQuery.end - this.listQuery.start > 10*365*24*60*60*1000) {
this.$message({ this.$message({
@@ -333,100 +380,75 @@ export default {
console.log(this.listQuery.reportTime[0]) console.log(this.listQuery.reportTime[0])
} }
}, },
async getDataList() { // async getDict() {
// const res = await getProduceDataPage(this.listQuery) // 产线列表
// console.log(res) // const res = await getCorePLList();
// if (res.code === 0) { // this.proLineList = res.data;
// this.tableData = res.data.records // },
// this.listQuery.total = res.data.total // 获取数据列表
// if (this.listQuery.total > 0) { multipliedByHundred(str) {
// this.tableData.forEach(item => { console.log(str);
// item.tableTime = item?.reportDate?.length > 0 ? item.reportDate[0] + '-' + item.reportDate[1] + '-' + item.reportDate[2] : '--' // console.log(str)
// }) if ( str != 0) {
// } let floatVal = parseFloat(str);
// } if (isNaN(floatVal)) {
return 0;
// 图表
await prodOutputDataList({
current: 1,
size: 99,
beginTime: this.listQuery.beginTime,
endTime: this.listQuery.endTime,
factorys: this.listQuery.factorys,
mode: this.listQuery.mode,
type: this.listQuery.type
}).then(resp => {
console.log('Aaa', resp.data)
this.lineData = resp?.data || []
if (this.lineData.length > 0) {
this.buildChart(this.lineData)
} }
floatVal = Math.round(str * 10000) / 100;
let strVal = floatVal.toString();
let searchVal = strVal.indexOf('.');
if (searchVal < 0) {
searchVal = strVal.length;
strVal += '.';
}
while (strVal.length <= searchVal + 2) {
strVal += '0';
}
return parseFloat(strVal);
}
},
async getDataList() {
const res = await getProduceDataPage(this.listQuery)
console.log(res)
this.tableData = res.data.records
this.tableData.forEach(item => {
item.tableTime = item?.reportDate?.length > 0 ? item.reportDate[0] + '-' + item.reportDate[1] + '-' + item.reportDate[2] : '--'
}) })
// this.buildChart(this.tableData) this.listQuery.total = res.data.total
this.buildChart(this.tableData)
}, },
buildChart(list) { buildChart(list) {
let temp = [] const chartList = Object.groupBy(list, (item) => item.tableTime)
let xAxisData = [] this.xAxis = []
list.forEach(item => { this.seriesList = []
temp.push(item.groupTime) for (const keyIndex in chartList) {
}) // X坐标轴数据
// x轴数据 this.xAxis.push(keyIndex)
xAxisData = Array.from(new Set(temp)) }
// y轴数据 // y轴数据
for (const y of this.factoryArray1) { for (const y of this.factoryList) {
for (const type of this.typeList) { // y: {name: , id: }
const seriesItem = { const seriesItem = {
name: y.name, name: y.name,
record: type.name,
type: 'bar', type: 'bar',
emphasis: { emphasis: {
focus: 'series' focus: 'series'
}, },
data: Array(xAxisData.length).fill(0) data: Array(this.xAxis.length).fill(0)
} }
list.forEach(data => { for (const a in chartList) {
xAxisData.forEach((x, index) => { for (const z of chartList[a]) {
if (x === data.groupTime && y.id === data.factory && type.id === data.glassType) { this.xAxis.forEach((item, index) => {
seriesItem.data[index] = data.goodNumber if (z.factory === y.id && a === item) {
seriesItem.data[index] = z.goodNumber
} }
}) })
}) }
this.seriesList.push(seriesItem)
} }
this.seriesList.push(seriesItem)
} }
console.log('啊啊', this.seriesList) this.$refs.lineChart.initChart(this.xAxis, this.seriesList)
this.$refs.lineChart.initChart(xAxisData, this.seriesList)
// const chartList = Object.groupBy(list, (item) => item.tableTime)
// this.xAxis = []
// this.seriesList = []
// for (const keyIndex in chartList) {
// // X坐标轴数据
// this.xAxis.push(keyIndex)
// }
// // y轴数据
// for (const y of this.factoryArray) {
// // y: {name: , id: }
// const seriesItem = {
// name: y.name,
// type: 'bar',
// emphasis: {
// focus: 'series'
// },
// data: Array(this.xAxis.length).fill(0)
// }
// for (const a in chartList) {
// for (const z of chartList[a]) {
// this.xAxis.forEach((item, index) => {
// if (z.factory === y.id && a === item) {
// seriesItem.data[index] = z.goodNumber
// }
// })
// }
// }
// this.seriesList.push(seriesItem)
// }
// this.$refs.lineChart.initChart(this.xAxis, this.seriesList)
}, },
buttonClick(val) { buttonClick(val) {
this.listQuery.reportTime = val.reportTime ? val.reportTime : undefined; this.listQuery.reportTime = val.reportTime ? val.reportTime : undefined;

View File

@@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2022-01-21 14:43:06 * @Date: 2022-01-21 14:43:06
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-05-30 14:52:05 * @LastEditTime: 2024-05-22 13:48:58
* @Description: * @Description:
--> -->
<template> <template>

View File

@@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-17 16:31:51 * @Date: 2024-04-17 16:31:51
* @LastEditTime: 2024-05-29 14:06:16 * @LastEditTime: 2024-05-20 18:09:09
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@@ -29,30 +29,20 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="时间维度" prop="targetType"> <el-form-item label="时间维度" prop="targetType">
<el-select v-model="dataForm.targetType" placeholder="请选择时间维度" clearable> <el-select v-model="dataForm.targetType" placeholder="请选择时间维度" clearable @change="clearTime">
<!-- <el-option v-for="item in factoryList" :key="item.id" :label="item.name" :value="item.id"> --> <!-- <el-option v-for="item in factoryList" :key="item.id" :label="item.name" :value="item.id"> -->
<el-option label="" :value="0" /> <el-option label="" :value="0" />
<el-option label="" :value="1" /> <el-option label="" :value="1" />
<el-option label="月" :value="2" />
<el-option label="年" :value="3" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item v-show="dataForm.targetType === 0 || dataForm.targetType === ''" label="时间" prop="reportTime"> <el-form-item v-show="dataForm.targetType !== 1" label="时间" prop="reportTime">
<el-date-picker v-model="reportTime" value-format="yyyyMMdd" type="date" placeholder="选择"> <el-date-picker v-model="dataForm.reportTime" value-format="yyyy-MM" type="month" placeholder="选择月份">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item v-show="dataForm.targetType === 1" label="时间" prop="week"> <el-form-item v-show="dataForm.targetType === 1" label="时间" prop="targetYear">
<el-date-picker v-model="week" type="week" format="yyyy 第 WW 周" placeholder="选择周"> <el-date-picker clearable v-model="dataForm.showYear" value-format="yyyy" type="year" placeholder="开始时间">
</el-date-picker>
</el-form-item>
<el-form-item v-show="dataForm.targetType === 2" label="时间" prop="reportTime">
<el-date-picker v-model="reportTime" value-format="yyyyMM" type="month" placeholder="选择月份">
</el-date-picker>
</el-form-item>
<el-form-item v-show="dataForm.targetType === 3" label="时间" prop="reportTime">
<el-date-picker clearable v-model="reportTime" value-format="yyyy" type="year" placeholder="开始时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -235,7 +225,6 @@
import SmallTitle from './SmallTitle'; import SmallTitle from './SmallTitle';
import { createProduce, getProduceTargetDetail, updateProduceTarget } from '@/api/produceData'; import { createProduce, getProduceTargetDetail, updateProduceTarget } from '@/api/produceData';
import { factoryList, tyjxfactoryList, dhgfactoryList } from "@/utils/constants"; import { factoryList, tyjxfactoryList, dhgfactoryList } from "@/utils/constants";
import moment from 'moment'
export default { export default {
components: { components: {
@@ -258,16 +247,57 @@ export default {
workOrderList: [], workOrderList: [],
detList: [], detList: [],
teamList: [], teamList: [],
sourceList: [
{
id: 1,
name: '手动',
},
{
id: 2,
name: '自动',
}
],
// factoryList: [
// {
// name: '瑞昌中建材光电材料有限公司',
// id: 0
// },
// {
// name: '邯郸中建材光电材料有限公司',
// id: 1
// },
// {
// name: '中建材株洲光电材料有限公司',
// id: 2
// },
// {
// name: '佳木斯中建材光电材料有限公司',
// id: 3
// },
// {
// name: '成都中建材光电材料有限公司',
// id: 4
// },
// {
// name: '凯盛光伏材料有限公司',
// id: 5
// },
// {
// name: '蚌埠兴科玻璃有限公司',
// id: 6
// }
// ],
sectionList: [], sectionList: [],
visible: false, visible: false,
reportTime: undefined,
week: undefined,
dataForm: { dataForm: {
factoryType: 0, factoryType: 0,
id: undefined, id: undefined,
reportTime: undefined, // 月时间
factory: undefined, factory: undefined,
targetTime: undefined, targetType: undefined,
targetType: 0, targetYear: undefined,
showYear: undefined,
targetMonth: undefined,
chipYield: undefined, chipYield: undefined,
chipYieldRate: undefined, chipYieldRate: undefined,
chipBom: undefined, chipBom: undefined,
@@ -315,20 +345,31 @@ export default {
this.$refs.dataForm.resetFields() this.$refs.dataForm.resetFields()
} }
}, },
// clearTime() { clearTime() {
// this.dataForm.targetTime = undefined this.dataForm.targetYear = undefined
// }, this.dataForm.targetMonth = undefined
},
handleClose() { handleClose() {
// 新增 // 新增
if (this.dataForm.targetType === 1) { if (this.dataForm.targetType === 0) {
this.dataForm.targetTime = this.week ? Number(moment(this.week.getTime()).format('YYYYWW')) : undefined const timeArray = this.dataForm.reportTime.split('-')
} else { this.dataForm.targetYear = Number(timeArray[0])
this.dataForm.targetTime = this.reportTime ? Number(this.reportTime) : undefined this.dataForm.targetMonth = Number(timeArray[1])
} }
if (this.dataForm.targetType === 1) {
this.dataForm.targetYear = Number(this.dataForm.showYear)
}
// if (this.dataForm.factory === 5) {
// this.dataForm.factoryType = 1
// } else {
// this.dataForm.factoryType = 0
// }
if (this.dataForm.id) { if (this.dataForm.id) {
// 修改 // 修改
updateProduceTarget({ updateProduceTarget({
...this.dataForm ...this.dataForm,
showYear: undefined,
reportTime: undefined
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success('修改成功!') this.$message.success('修改成功!')
@@ -339,7 +380,9 @@ export default {
} else { } else {
// 新增 // 新增
createProduce({ createProduce({
...this.dataForm ...this.dataForm,
showYear: undefined,
reportTime: undefined
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success('新增成功!') this.$message.success('新增成功!')
@@ -356,16 +399,19 @@ export default {
if (this.dataForm.id) { if (this.dataForm.id) {
getProduceTargetDetail(this.dataForm.id).then(res => { getProduceTargetDetail(this.dataForm.id).then(res => {
this.dataForm = res.data this.dataForm = res.data
if (this.dataForm.targetType === 0 || this.dataForm.targetType === 2 || this.dataForm.targetType === 3) {
this.reportTime = String(this.dataForm.targetTime)
}
if (this.dataForm.targetType === 1) { if (this.dataForm.targetType === 1) {
const date = new Date() if (this.dataForm.targetYear) {
date.setFullYear(String(this.dataForm.targetTime).slice(0, 4)) this.$set(this.dataForm, 'showYear', String(this.dataForm.targetYear))
date.setMonth(0) }
date.setDate((Number(String(this.dataForm.targetTime).slice(4)) - 1)* 7 + 1) }
// console.log('你好', date, moment(date).format('yyyyWW'), String(this.dataForm.targetTime).slice(4)) if (this.dataForm.targetType === 0) {
this.week = date if (this.dataForm.targetYear && this.dataForm.targetMonth !== null) {
if (this.dataForm.targetMonth < 10) {
this.$set(this.dataForm, 'reportTime', String(this.dataForm.targetYear) + '-0' + String(this.dataForm.targetMonth))
} else {
this.$set(this.dataForm, 'reportTime', String(this.dataForm.targetYear) + '-' + String(this.dataForm.targetMonth))
}
}
} }
}) })
} }
@@ -378,7 +424,6 @@ export default {
position: absolute; position: absolute;
bottom: 1%; bottom: 1%;
right: 2%; right: 2%;
z-index: 999;
} }
.drawer-footer { .drawer-footer {
width: 100%; width: 100%;

View File

@@ -1,13 +1,13 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-15 10:49:13 * @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-05-31 16:41:12 * @LastEditTime: 2024-05-22 16:22:57
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
<template> <template>
<div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 31px)"> <div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 31px)">
<ButtonNav v-show="false" :menus="['碲化镉工厂', '铜铟镓硒工厂']" :button-mode="true" @change="changeFactory" style="margin-top: -10px"> <ButtonNav :menus="['碲化镉工厂', '铜铟镓硒工厂']" :button-mode="true" @change="changeFactory" style="margin-top: -10px">
</ButtonNav> </ButtonNav>
<div class="app-container" style="padding: 16px 24px 0;height: auto; flex-grow: 1;"> <div class="app-container" style="padding: 16px 24px 0;height: auto; flex-grow: 1;">
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
@@ -29,34 +29,34 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.date === 1 || listQuery.date === ''" label="时间范围" prop="reportTime"> <!-- <el-form-item v-show="timeSelect === 'day'" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="datetimerange" range-separator="至" <el-date-picker v-model="listQuery.reportTime" type="datetimerange" range-separator="至"
start-placeholder="开始日期" value-format="yyyyMMdd" @change="changeDayTime" end-placeholder="结束日期"> start-placeholder="开始日期" value-format="yyyy-MM-dd HH:mm:ss" @change="changeDayTime" end-placeholder="结束日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item> -->
<el-form-item v-show="listQuery.date === 2" label="时间范围" prop="reportTime"> <!-- <el-form-item v-show="timeSelect === 'week'" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="start" type="week" format="yyyy 第 WW 周" placeholder="选择周" <el-date-picker v-model="listQuery.reportTime[0]" type="week" format="yyyy 第 WW 周" placeholder="选择周"
style="width: 180px" @change="onValueChange"> style="width: 180px" @change="onValueChange">
</el-date-picker> </el-date-picker>
<el-date-picker size="small" clearable v-model="end" type="week" format="yyyy 第 WW 周" placeholder="选择周" <el-date-picker v-model="listQuery.reportTime[1]" type="week" format="yyyy 第 WW 周" placeholder="选择周"
style="width: 180px" @change="onValueChange"> style="width: 180px" @change="onValueChange">
</el-date-picker> </el-date-picker>
<span v-if="start && end" style="margin-left: 10px"> <span v-if="listQuery.reportTime[0] && listQuery.reportTime[1]" style="margin-left: 10px">
{{ date1 }} {{ date2 }} {{ weekNum }} {{ date1 }} {{ date2 }} {{ weekNum }}
</span> </span>
</el-form-item> </el-form-item> -->
<el-form-item v-show="listQuery.date === 3" label="时间值" prop="reportTime"> <el-form-item v-show="listQuery.date !== 4" label="时间值" prop="reportTime">
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange" value-format="yyyyMM" range-separator="至" start-placeholder="开始月份" <el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange" value-format="timestamp" range-separator="至" start-placeholder="开始月份"
end-placeholder="结束月份" @change="changeTime"> end-placeholder="结束月份" @change="changeTime">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.date === 4" label="时间值" prop="reportTime"> <el-form-item v-show="listQuery.date === 4" label="时间值" prop="reportTime">
<el-date-picker size="small" clearable v-model="start" value-format="yyyy" type="year" <el-date-picker size="small" clearable v-model="start" value-format="timestamp" type="year"
placeholder="开始时间"> placeholder="开始时间">
</el-date-picker> </el-date-picker>
~ ~
<el-date-picker size="small" clearable v-model="end" value-format="yyyy" type="year" placeholder="结束时间" <el-date-picker size="small" clearable v-model="end" value-format="timestamp" type="year" placeholder="结束时间"
@change="getYear"> @change="getYear">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@@ -173,7 +173,7 @@ export default {
current: 1, current: 1,
factorys: null, factorys: null,
total: 0, total: 0,
date: 1, date: undefined,
beginTime: undefined, beginTime: undefined,
endTime: undefined, endTime: undefined,
reportTime: [] reportTime: []
@@ -314,17 +314,9 @@ export default {
}, },
], ],
timeList: [ timeList: [
{
value: 1,
label: '日'
},
{
value: 2,
label: '周'
},
{ {
value: 3, value: 3,
label: '月' label:'月'
}, },
{ {
value: 4, value: 4,
@@ -340,13 +332,13 @@ export default {
showOverflowtooltip: true showOverflowtooltip: true
}, },
{ {
prop: 'targetTime', prop: 'tagertTime',
label: '目标时间', label: '目标时间',
minWidth: 150, minWidth: 150,
showOverflowtooltip: true showOverflowtooltip: true
}, },
{ {
prop: 'updateTime', prop: 'createTime',
label: '提交时间', label: '提交时间',
filter: parseTime, filter: parseTime,
minWidth: 150, minWidth: 150,
@@ -426,11 +418,11 @@ export default {
// all: {} // all: {}
}; };
}, },
computed: { // computed: {
weekNum() { // weekNum() {
return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1 // return Math.round((this.listQuery.reportTime[1] - this.listQuery.reportTime[0]) / (24 * 60 * 60 * 1000 * 7)) + 1
}, // },
}, // },
watch: { watch: {
facType(value) { facType(value) {
if (value === 0) { if (value === 0) {
@@ -577,75 +569,36 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.detailOrUpdate.init(val.data.id); this.$refs.detailOrUpdate.init(val.data.id);
}); });
},
buttonClick() {
}, },
getYear(e) { getYear(e) {
if (this.end && Number(this.end) - Number(this.start) > 10) { if (this.end && e - this.start > 10 * 365*24*60*60*1000) {
this.$message({ this.$message({
message: '年份起止时间不能超过十年', message: '年份起止时间不能超过十年',
type: 'warning' type: 'warning'
}); });
this.start = undefined
this.end = undefined
// console.log(); // console.log();
} else { } else {
if (Number(this.end) < Number(this.start)) { if (this.end < this.start) {
this.$message({ this.$message({
message: '结束年份不能小于开始年份', message: '结束年份不能小于开始年份',
type: 'warning' type: 'warning'
}); });
this.start = undefined
this.end = undefined
} else {
this.listQuery.beginTime = Number(this.start)
this.listQuery.endTime = Number(this.end)
} }
} }
// console.log(e); // console.log(e);
}, },
changeTime() { changeTime() {
if (this.listQuery.reportTime) { if (this.listQuery.reportTime) {
const numDays = Number(this.listQuery.reportTime[1]) - Number(this.listQuery.reportTime[0]) const numDays = this.listQuery.reportTime[1] - this.listQuery.reportTime[0]
if (numDays > 24) { if (numDays > 2*365*24*60*60*1000) {
this.$message({ this.$message({
message: '时间范围不能超过24个月', message: '时间范围不能超过24个月',
type: 'warning' type: 'warning'
}); });
this.listQuery.reportTime = []; this.listQuery.reportTime = [];
} else {
this.listQuery.beginTime = Number(this.listQuery.reportTime[0])
this.listQuery.endTime = Number(this.listQuery.reportTime[1])
}
}
},
onValueChange(picker, k) { // 选中近k周后触发的操作
if (this.start && this.end) {
this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
if (numDays > 168) {
console.log(numDays)
this.$message({
message: '周范围不能超过24周',
type: 'warning'
});
} else {
this.listQuery.beginTime = Number(moment(this.start.getTime()).format('YYYYWW'))
this.listQuery.endTime = Number(moment(this.end.getTime()).format('YYYYWW'))
}
}
},
changeDayTime() {
if (this.listQuery.reportTime) {
const numDays = Number(this.listQuery.reportTime[1]) - Number(this.listQuery.reportTime[0])
if (numDays > 30) {
this.$message({
message: '时间范围不能超过30天',
type: 'warning'
});
this.listQuery.reportTime = [];
} else {
this.listQuery.beginTime = Number(this.listQuery.reportTime[0])
this.listQuery.endTime = Number(this.listQuery.reportTime[1])
} }
} }
}, },
@@ -673,22 +626,27 @@ export default {
}, },
async getDataList() { async getDataList() {
// if (this.listQuery.date === 3) { if (this.listQuery.date === 3) {
// if (this.listQuery.reportTime?.length > 0) { if (this.listQuery.reportTime?.length > 0) {
// this.listQuery.beginTime = this.listQuery.reportTime[0] ? Number(this.listQuery.reportTime[0]) : undefined this.listQuery.beginTime = this.listQuery.reportTime[0] ? this.listQuery.reportTime[0] : undefined
// this.listQuery.endTime = this.listQuery.reportTime[1] ? this.listQuery.reportTime[1] : undefined this.listQuery.endTime = this.listQuery.reportTime[1] ? this.listQuery.reportTime[1] : undefined
// } }
// } }
// if (this.listQuery.date === 4) { if (this.listQuery.date === 4) {
// if (this.listQuery.reportTime?.length > 0) { if (this.listQuery.reportTime?.length > 0) {
// this.listQuery.beginTime = this.start ? this.start : undefined this.listQuery.beginTime = this.start ? this.start : undefined
// this.listQuery.endTime = this.end ? this.end : undefined this.listQuery.endTime = this.end ? this.end : undefined
// } }
// } }
if (this.currentMenu === '碲化镉工厂') { if (this.currentMenu === '碲化镉工厂') {
await prodTargetDiPage(this.listQuery).then(res => { await prodTargetDiPage(this.listQuery).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.tableData = res.data.records this.tableData = res.data.records
this.tableData.forEach(item => {
const year = item.targetYear ? item.targetYear + '年' : ''
const month = item.targetMonth ? item.targetMonth + '月' : ''
item.tagertTime = year + month
})
this.listQuery.total = res.data.total this.listQuery.total = res.data.total
} }
}) })

View File

@@ -1,65 +0,0 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// 取值范围: xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@@ -1,399 +0,0 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2024-05-31 16:13:22
* @LastEditors: DY
* @Description:
-->
<template>
<el-drawer class="drawer" :visible.sync="visible" size="85%" @closed="$emit('destroy')">
<small-title slot="title" :no-padding="true">
{{ '详情' }}
<el-button type="primary" plain size="small" style="float: right" @click="exportDetail">导出</el-button>
</small-title>
<div ref="detail" class="detailBox">
<el-row :gutter="20">
<el-col :span="3">
<p class="title">工单号</p>
<p class="text">{{ dataForm.workOrderNumber }}</p>
</el-col>
<el-col :span="3">
<p class="title">订单号</p>
<p class="text">{{ dataForm.orderNumber }}</p>
</el-col>
<el-col :span="3">
<p class="title">工单类型</p>
<p class="text">{{ ['', '芯片订单', '组件类型', 'bipv类型'][dataForm.workOrderType] }}</p>
</el-col>
<el-col :span="3">
<p class="title">工单来源</p>
<p class="text">{{ ['', '手动', 'ERP'][dataForm.source] }}</p>
</el-col>
<el-col :span="3">
<p class="title">工艺流程</p>
<p class="text">{{ dataForm.process }}</p>
</el-col>
<el-col :span="3">
<p class="title">BOM</p>
<p class="text">{{ dataForm.bom }}</p>
</el-col>
<el-col :span="3">
<p class="title">工单状态</p>
<p class="text">{{ ['未开始', '生产中', '已完成'][dataForm.orderStatus] }}</p>
</el-col>
<el-col :span="3">
<p class="title">投入状态</p>
<p class="text">{{ dataForm.inStatus }}</p>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="3">
<p class="title">计划投入量</p>
<p class="text">{{ dataForm.plannedInvestment }}</p>
</el-col>
<el-col :span="3">
<p class="title">目标产量</p>
<p class="text">{{ dataForm.targetProduction }}</p>
</el-col>
<el-col :span="3">
<p class="title">实际投入</p>
<p class="text">{{ dataForm.actualInvestment }}</p>
</el-col>
<el-col :span="3">
<p class="title">实际产出</p>
<p class="text">{{ dataForm.actualProduction }}</p>
</el-col>
<el-col :span="3">
<p class="title">创建时间</p>
<p class="text">{{ parseTime(dataForm.createTime) }}</p>
</el-col>
<el-col :span="3">
<p class="title">开始时间</p>
<p class="text">{{ dataForm.startDate?.length > 0 ? dataForm.startDate[0] + '-' + dataForm.startDate[1] + '-' + dataForm.startDate[2] : '' }}</p>
</el-col>
<el-col :span="3">
<p class="title">完成时间</p>
<p class="text">{{ dataForm.endDate?.length > 0 ? dataForm.endDate[0] + '-' + dataForm.endDate[1] + '-' + dataForm.endDate[2] : '' }}</p>
</el-col>
</el-row>
<el-divider></el-divider>
<div class="chartDiv">
<div ref="bar" :style="{ height: '30vh', width: '40vw' }" />
<div ref="pie" :style="{ height: '30vh', width: '40vw' }" />
</div>
<div class="chartDiv">
<div ref="equipmentLine" :style="{ height: '30vh', width: '40vw' }" />
<div ref="line" v-show="dataForm.orderStatus === 1" :style="{ height: '30vh', width: '40vw' }" />
</div>
</div>
</el-drawer>
</template>
<script>
// import basicAdd from './basic-add';
import * as echarts from 'echarts'
import resize from '@/mixins/resize'
import { getWorkOrderDetail, getEqNum, getDailyTrend } from '@/api/produceData/order';
import SmallTitle from './SmallTitle';
import jsPDF from 'jspdf';
import html2canvas from 'html2canvas';
export default {
components: {
SmallTitle,
},
mixins: [resize],
props: {
date: {
type: Number,
default: 0
}
},
data() {
return {
lineChart: null,
pieChart: null,
barChart: null,
equipmentLineChart: null,
visible: false,
dataForm: {}
}
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
mounted() {
// this.getCurrentTime()
},
methods: {
exportDetail() {
// 导出
const pdf = new jsPDF('l', 'pt', 'a4');
const options = {
scale: 2
};
const element = this.$refs['detail'];
html2canvas(element, options).then((canvas) => {
const imgData = canvas.toDataURL('image/png');
pdf.addImage(imgData, 'PNG', 0, 0, pdf.internal.pageSize.getWidth(), pdf.internal.pageSize.getHeight());
pdf.save(this.dataForm.workOrderNumber + '详情.pdf');
});
},
init(id) {
this.visible = true
this.$nextTick(() => {
this.initLineChart()
})
if (id) {
getWorkOrderDetail(id).then(res => {
this.dataForm = res.data
this.buildChart(this.dataForm)
if (this.dataForm.orderStatus === 1) {
this.trend()
}
})
getEqNum(id).then(response => {
if (response.code === 0) {
const xAxisList = Object.keys(response.data)
const yAxisList = Object.values(response.data)
this.initEqLineChart(xAxisList, yAxisList)
}
})
}
},
trend() {
// 趋势图
getDailyTrend({ factory: this.dataForm.id }).then(trendRes => {
if (trendRes?.data.length > 0) {
const seriesList = []
const dateList = []
trendRes.data.forEach(element => {
seriesList.push(element.actualProduction)
dateList.push(element.recordTime[0] + '-' + element.recordTime[1] + '-' + element.recordTime[2])
})
this.initLineChart(dateList, seriesList)
}
})
},
buildChart(data) {
// 生产明细
const barList = [data.targetProduction, data.plannedInvestment, data.actualInvestment, data.actualProduction, data.wasteNum, data.reworkNum]
this.initChart(barList)
// 良品率
const pieList = [
{ value: data.actualProduction, name: '实际产出' },
{ value: data.wasteNum, name: '废品数量' },
{ value: data.reworkNum, name: '待再加工数量' }
]
this.initPieChart(pieList)
},
initChart(barData) {
this.barChart = echarts.init(this.$refs['bar'])
this.barChart.setOption({
title: {
text: '生产明细',
left: 'center'
// subtext: 'Fake Data'
},
tooltip: {
trigger: 'axis'
},
grid: { top: 100, right: 90, bottom: 10, left: 10, containLabel: true },
calculable: true,
grid: {
top: '20%',
left: "1%",
right: "3%",
bottom: "1%",
containLabel: true
},
xAxis: {
type: 'category',
data: ['目标产量', '计划投入量', '实际投入', '实际产出', '废品数量', '待再加工数量'],
axisLabel: {
rotate:45
}
},
yAxis: {
type: 'value'
},
series: [
{
data: barData,
type: 'bar',
barWidth: '40%'
}
]
}, true)
},
initPieChart(pieData) {
this.pieChart = echarts.init(this.$refs['pie'])
this.pieChart.setOption({
title: {
text: '产品良率',
left: 'center'
// subtext: 'Fake Data'
},
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'right',
orient: 'vertical'
},
series: [
{
name: 'Access From',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: false,
fontSize: 40,
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: pieData
}
]
}, true)
},
initEqLineChart(xAxisList, yAxisList) {
this.equipmentLineChart = echarts.init(this.$refs['equipmentLine'])
this.equipmentLineChart.setOption({
title: {
text: '在制品分布',
left: 'center'
// subtext: 'Fake Data'
},
tooltip: {
trigger: 'axis'
},
grid: { top: 100, right: 90, bottom: 10, left: 10, containLabel: true },
calculable: true,
grid: {
top: '20%',
left: "1%",
right: "3%",
bottom: "1%",
containLabel: true
},
xAxis: {
type: 'category',
data: xAxisList,
axisLabel: {
rotate:45,
// width: '10%'
}
},
yAxis: {
type: 'value'
},
series: [
{
data: yAxisList,
type: 'bar',
barWidth: '40px'
}
]
}, true)
},
initLineChart(xAxisList, seriesList) {
this.lineChart = echarts.init(this.$refs['line'])
this.lineChart.setOption({
title: {
text: '历史趋势',
left: 'center' // 设置标题居中
},
xAxis: {
type: 'category',
data: xAxisList,
axisLabel: {
rotate:45
}
},
yAxis: {
type: 'value'
},
series: [
{
data: seriesList,
type: 'line'
}
]
}, true)
}
// getCurrentTime() {
// // new Date().Format("yyyy-MM-dd HH:mm:ss")
// this.dataForm.logTime = new Date()
// // this.dataForm.logTime = year + "-" + month + "-" + day;
// console.log(this.dataForm.logTime);
// },
},
};
</script>
<style scoped>
.chartDiv {
display: flex;
justify-content: space-between;
width: 100%;
padding: 5px;
padding-left: 30px;
}
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
/* margin-bottom: 30px; */
}
.detailBox p {
margin: 0;
padding: 0 32px;
}
.detailBox .title {
/* width: 56px; */
/* height: 14px; */
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 14px;
color: rgba(0, 0, 0, 0.85);
line-height: 16px;
text-align: left;
font-style: normal;
text-transform: none;
}
.detailBox .text {
font-size: 14px;
font-weight: 400;
color: rgba(102,102,102,0.75);
padding-bottom: 20px;
}
.detailBox {
padding-top: 30px;
width: 99%;
}
</style>

View File

@@ -1,320 +0,0 @@
<!--
* @Author: zhp
* @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-05-31 17:13:56
* @LastEditors: DY
* @Description:
-->
<template>
<div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 31px)">
<div class="app-container" style="margin-top: 8px;padding: 16px; height: auto;">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
</div>
<div class="app-container" style="margin-top: 8px;flex-grow: 1; height: auto; padding: 16px;">
<search-bar :formConfigs="formConfig2" ref="searchBarForm" style="margin-bottom: 0" />
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
:table-data="tableData">
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right"
:method-list="tableBtn" @clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList"
/>
</div>
<add-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" :date="listQuery.date" @refreshDataList="successSubmit" @destroy="detailOrUpdateVisible = false" />
</div>
</template>
<script>
// import { parseTime } from '../../core/mixins/code-filter';
import { getWorkOrderPage, exportExcel } from '@/api/produceData/order';
// import inputTable from './inputTable.vue';
import lineChart from './lineChart';
import moment from 'moment'
// import ButtonNav from '@/components/ButtonNav'
import basicPage from '@/mixins/basic-page'
import AddOrUpdate from './add-or-updata';
import { factoryList, factoryArray } from "@/utils/constants";
// import FileSaver from 'file-saver'
// import * as XLSX from 'xlsx'
export default {
components: { lineChart, AddOrUpdate },
mixins: [basicPage],
data() {
return {
factoryList,
factoryArray,
listQuery: {
pageSize: 20,
pageNo: 1,
factorys: undefined,
total: 0,
time: undefined,
orderStatus:undefined
},
detailOrUpdateVisible:false,
tableBtn: [
{
type: 'detail',
btnName: '详情',
},
// {
// type: 'delete',
// btnName: '删除',
// },
].filter((v) => v),
typeList: [
{
name: '芯片',
id: 0,
},
{
name: '标准组件',
id: 1,
},
{
name: 'BIPV产品',
id: 2,
},
],
formConfig: [
{
type: "select",
label: "工厂名称",
selectOptions: factoryArray,
labelField: 'name',
valueField: 'id',
param: "factory",
multiple: true,
filterable: true
},
{
type: "select",
label: "工单状态",
selectOptions: [
{
label: '未开始',
value: 0
},
{
label: '生产中',
value: 1
},
{
label: '已完成',
value: 2
}
],
labelField: "label",
valueField: "value",
param: "orderStatus",
multiple: true,
filterable: true
},
{
type: "datePicker",
label: "时间段",
dateType: "daterange",
format: "yyyy-MM-dd",
valueFormat: "yyyy-MM-dd",
rangeSeparator: "-",
startPlaceholder: "开始日期",
endPlaceholder: "结束日期",
param: "timeSlot",
defaultSelect: [],
defaultTime: ["00:00:00", "23:59:59"],
width: 250,
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "separate",
},
{
type: "button",
btnName: "导出",
name: "export",
color: "primary",
plain: true
},
],
formConfig2: [
{
type: 'title',
label: '工厂信息',
},
],
formConfig1: [
{
type: 'title',
label: '良品数量',
},
],
tableProps: [
{
prop: 'factory',
label: '工厂名称',
filter: (val) => factoryList[val],
minWidth: 200,
showOverflowtooltip: true
},
{
prop: 'workOrderNumber',
label: '工单号',
// filter: (val) => ['玻璃芯片', '标准组件', 'BIPV', '定制组件'][val]
},
{
prop: 'workOrderType',
label: '工单类型',
filter: (val) => ['', '芯片订单', '组件类型', 'bipv类型'][val],
},
{
prop: 'plannedInvestment',
label: '计划投入',
},
{
prop: 'actualInvestment',
label: '实际投入',
},
{
prop: 'targetProduction',
label: '目标产量',
},
{
prop: 'actualProduction',
label: '实际产量',
},
{
prop: 'productionProgress',
label: '生产进度',
filter: (val) => (val * 100) + '%'
},
{
prop: 'orderStatus',
label: '工单状态',
filter: (val) => ['未开始', '生产中', '已完成'][val],
},
{
prop: 'startTime',
label: '开始时间',
minWidth: 100,
showOverflowtooltip: true
},
{
prop: 'endTime',
label: '完成时间',
minWidth: 100,
showOverflowtooltip: true
}
],
tableData: [],
xAxis: [],
lineData: {}
// proLineList: [],
// all: {}
};
},
created() {
const today = new Date()
const sevenDaysAgo = new Date(today.getTime() - (7 * 24 * 60 * 60 * 1000))
this.listQuery.time = [moment(sevenDaysAgo).format('yyyy-MM-DD'), moment(today).format('yyyy-MM-DD')]
this.formConfig[2].defaultSelect = this.listQuery.time
},
methods: {
otherMethods(val) {
this.detailOrUpdateVisible = true;
// this.addOrEditTitle = "详情";
this.$nextTick(() => {
this.$refs.detailOrUpdate.init(val.data.id);
});
},
async getDataList() {
const res = await getWorkOrderPage(this.listQuery)
this.tableData = res.data.list
this.listQuery.total = res.data.total
if (this.listQuery.total > 0) {
this.tableData.forEach(item => {
item.startTime = item.startDate ? item.startDate[0] + '-' + item.startDate[1] + '-' + item.startDate[2] : '--'
item.endTime = item.endDate ? item.endDate[0] + '-' + item.endDate[1] + '-' + item.endDate[2] : '--'
})
}
},
buttonClick(val) {
this.listQuery.factorys = val.factory?.length > 0 ? val.factory : undefined
this.listQuery.orderStatus = val.orderStatus?.length > 0 ? val.orderStatus : undefined
this.listQuery.time = val.timeSlot?.length > 0 ? val.timeSlot : undefined
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 20;
if (this.listQuery.time) {
this.getDataList();
} else {
this.$message.warning('请选择时间范围!')
}
break;
case 'export':
if (this.listQuery.time) {
this.handleExport();
} else {
this.$message.warning('请选择时间范围!')
}
break;
default:
console.log(val);
}
},
/** 导出按钮操作 */
handleExport() {
this.$modal.confirm('是否确认导出工单数据?').then(() => {
// 处理查询参数
// let params = {...this.listQuery};
// params.current = 1;
// params.size = 999;
this.exportLoading = true;
return exportExcel({
factorys: this.listQuery.factorys,
orderStatus: this.listQuery.orderStatus,
time: this.listQuery.time
});
}).then(response => {
this.$download.excel(response, '工单数据.xls');
this.exportLoading = false;
}).catch(() => {})
},
},
};
</script>
<style scoped>
/* .blueTip { */
/* padding-bottom: 10px; */
/* } */
/* .blueTi */
.blueTip::before{
display: inline-block;
content: '';
width: 4px;
height: 18px;
background: #0B58FF;
border-radius: 1px;
margin-right: 8PX;
margin-top: 8px;
}
.app-container {
margin: 0 0px 0;
background-color: #fff;
border-radius: 4px;
padding: 16px 16px 0;
height: calc(100vh - 134px);
overflow: auto;
}
</style>

View File

@@ -1,169 +0,0 @@
<!--
* @Author: zwq
* @Date: 2022-01-21 14:43:06
* @LastEditors: DY
* @LastEditTime: 2024-05-30 09:51:16
* @Description:
-->
<template>
<!-- <div> -->
<!-- <div :id="id" :class="className" :style="{ height: '65%', width:width}" /> -->
<div :id="id" :class="className" :style="{ height: height, width: width }" />
<!-- </div> -->
</template>
<script>
import * as echarts from 'echarts'
import 'echarts/theme/macarons' // echarts theme
import resize from '@/mixins/resize'
export default {
name: 'LineChart',
mixins: [resize],
props: {
id: {
type: String,
default: 'reportChart'
},
className: {
type: String,
default: 'reportChart'
},
width: {
type: String,
default: '100%'
},
beilv: {
type: Number,
default: 1
},
height: {
type: String,
default: '30vh'
},
legendPosition: {
type: String,
default: 'center'
},
showLegend: {
type: Boolean,
default: false
},
legendData: {
type: Array,
default: () => []
}
},
data() {
return {
chart: null
}
},
// mounted() {
// this.$nextTick(() => {
// this.initChart()
// })
// },
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart(xAxis, seriesList) {
this.chart = echarts.init(document.getElementById(this.id))
console.log(this.$parent);
this.chart.setOption({
title: {
text: '',
// subtext: 'Fake Data'
},
tooltip: {
trigger: 'axis'
},
grid: { top: 100, right: 90, bottom: 10, left: 10, containLabel: true },
legend: {
// data: ['工厂1', '工厂2'],
right: '90px',
top: '0%',
icon: 'rect',
itemWidth: 10,
itemHeight: 10,
itemGap: 40,
},
// toolbox: {
// show: true,
// feature: {
// dataView: { show: true, readOnly: false },
// magicType: { show: true, type: ['line', 'bar'] },
// restore: { show: true },
// saveAsImage: { show: true }
// }
// },
calculable: true,
xAxis: [
{
type: 'category',
// prettier-ignore
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
}
],
yAxis: [
{
type: 'value'
}
],
grid: {
top: '20%',
left: "1%",
right: "3%",
bottom: "1%",
containLabel: true
},
series: [
{
name: 'Email',
type: 'line',
stack: 'Total',
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: 'Union Ads',
type: 'line',
stack: 'Total',
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: 'Video Ads',
type: 'line',
stack: 'Total',
data: [150, 232, 201, 154, 190, 330, 410]
},
{
name: 'Direct',
type: 'line',
stack: 'Total',
data: [320, 332, 301, 334, 390, 330, 320]
},
{
name: 'Search Engine',
type: 'line',
stack: 'Total',
data: [820, 932, 901, 934, 1290, 1330, 1320]
}
]
}, true)
}
}
}
</script>
<style scoped>
/* .reportChart {
position: absolute;
height: 100%;
width: 100%;
top: 10px;
} */
</style>

View File

@@ -6,143 +6,60 @@
* @Description: * @Description:
--> -->
<template> <template>
<div <div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 31px)">
style=" <div class="app-container" style="padding: 16px 24px 0; max-height: 45vh; flex-grow: 1;">
display: flex;
flex-direction: column;
min-height: calc(100vh - 96px - 31px);
"
>
<div
class="app-container"
style="padding: 16px; max-height: 45vh; flex-grow: 1"
>
<!-- <div style="position: relative;z-index: 999;"> --> <!-- <div style="position: relative;z-index: 999;"> -->
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item label="时间维度" prop="reportTime"> <el-form-item label="时间维度" prop="reportTime">
<el-select <el-select clearable v-model="timeSelect" placeholder="请选择">
clearable <el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value">
v-model="timeSelect"
placeholder="请选择"
style="width: 80px"
>
<el-option
v-for="item in timeList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item v-show="timeSelect === 'month'" label="时间范围" prop="reportTime">
v-show="timeSelect === 'month'" <el-date-picker clearable v-model="listQuery.reportTime" type="monthrange" range-separator="至"
label="时间范围" start-placeholder="开始月份" end-placeholder="结束月份" @change="changeTime">
prop="reportTime"
>
<el-date-picker
clearable
v-model="listQuery.reportTime"
type="monthrange"
range-separator=""
start-placeholder="开始月份"
end-placeholder="结束月份"
@change="changeTime"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item <el-form-item v-show="timeSelect === 'year'" label="时间范围" prop="reportTime">
v-show="timeSelect === 'year'" <el-date-picker clearable v-model="listQuery.reportTime[0]" value-format="yyyy" type="year"
label="时间范围" placeholder="开始时间">
prop="reportTime"
>
<el-date-picker
clearable
v-model="listQuery.reportTime[0]"
value-format="yyyy"
type="year"
placeholder="开始时间"
>
</el-date-picker> </el-date-picker>
~ ~
<el-date-picker <el-date-picker v-model="listQuery.reportTime[1]" value-format="yyyy" type="year" placeholder="结束时间"
v-model="listQuery.reportTime[1]" @change="getYear">
value-format="yyyy"
type="year"
placeholder="结束时间"
@change="getYear"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="工厂名称" prop="factoryId"> <el-form-item label="工厂名称" prop="factoryId">
<el-select <el-select clearable v-model="listQuery.factoryId" placeholder="请选择工厂名称">
multiple <el-option v-for="item in factoryList" :key="item.id" :label="item.name" :value="item.id">
collapse-tags
v-model="listQuery.factoryId"
placeholder="请选择工厂名称"
>
<el-option
v-for="item in factoryList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="玻璃类型" prop="type"> <el-form-item label="玻璃类型" prop="type">
<el-select <el-select clearable v-model="listQuery.type" placeholder="请选择玻璃类型">
clearable <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id">
v-model="listQuery.type"
placeholder="请选择玻璃类型"
style="width: 120px"
>
<el-option
v-for="item in typeList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" size="small" @click="getDataList" <el-button type="primary" size="small" @click="getDataList">查询</el-button>
>查询</el-button <el-button type="primary" size="small" plain @click="handleExport">导出</el-button>
>
<el-button type="primary" size="small" plain @click="handleExport"
>导出</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- </div> --> <!-- </div> -->
<!-- <el-row style="height: 500px;"> --> <!-- <el-row style="height: 500px;"> -->
<!-- <div> --> <!-- <div> -->
<line-chart <line-chart class="yearChart" ref="lineChart" style="height: 35vh;width: 100%"></line-chart>
class="yearChart"
ref="lineChart"
style="height: 35vh; width: 100%"
></line-chart>
<!-- </div> --> <!-- </div> -->
<!-- </el-row> --> <!-- </el-row> -->
</div> </div>
<!-- <el-row style="height: 400px;"> --> <!-- <el-row style="height: 400px;"> -->
<!-- </el-row> --> <!-- </el-row> -->
<div <div class="app-container" style="margin-top: 18px; height: unset; flex-grow: 1; padding: 16px;">
class="app-container" <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
style="margin-top: 18px; height: unset; flex-grow: 1; padding: 16px" <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
> :table-data="tableData">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData"
>
</base-table> </base-table>
</div> </div>
</div> </div>
@@ -152,14 +69,14 @@
// import { parseTime } from '../../core/mixins/code-filter'; // import { parseTime } from '../../core/mixins/code-filter';
// import { getGlassPage, exportGlasscExcel } from '@/api/report/glass'; // import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
// import inputTable from './inputTable.vue'; // import inputTable from './inputTable.vue';
import { report } from "process"; import { report } from 'process';
import lineChart from "./lineChart"; import lineChart from './lineChart';
import moment from "moment"; import moment from 'moment'
// import FileSaver from 'file-saver' // import FileSaver from 'file-saver'
// import * as XLSX from 'xlsx' // import * as XLSX from 'xlsx'
export default { export default {
components: { lineChart }, components: { lineChart },
data() { data() {
return { return {
listQuery: { listQuery: {
pageSize: 10, pageSize: 10,
@@ -168,62 +85,50 @@ export default {
total: 0, total: 0,
type: null, type: null,
// reportType: 2, // reportType: 2,
reportTime: [], reportTime: []
}, },
// startDatePicker: this.beginDate(), // startDatePicker: this.beginDate(),
// endDatePicker: this.processDate(), // endDatePicker: this.processDate(),
yeartsStart: "", yeartsStart: '',
yeartsEnd: "", yeartsEnd: '',
urlOptions: { urlOptions: {
// getDataListURL: getGlassPage, // getDataListURL: getGlassPage,
// exportURL: exportGlasscExcel // exportURL: exportGlasscExcel
}, },
timeList: [ timeList: [
{ {
value: "day", value: 'month',
label: "日", label:'月'
}, },
{ {
value: "week", value: 'year',
label: "周", label: '年'
}, }
{
value: "month",
label: "月",
},
{
value: "year",
label: "年",
},
], ],
factoryList: [ factoryList: [
{ {
name: "瑞昌", name: '测试',
id: 1, id:1
}, }
{
name: "邯郸",
id: 2,
},
], ],
typeList: [ typeList: [
{ {
name: "芯片", name: '芯片',
id: 0, id:0,
}, },
{ {
name: "标准组件", name: '标准组件',
id: 1, id: 1,
}, },
{ {
name: "BIPV产品", name: 'BIPV产品',
id: 2, id: 2,
}, },
], ],
formConfig: [ formConfig: [
{ {
type: "title", type: 'title',
label: "报表管理", label: '报表管理',
}, },
], ],
tableProps: [ tableProps: [
@@ -235,72 +140,69 @@ export default {
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), // filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// }, // },
{ {
prop: "userName", prop: 'userName',
label: "科目", label: '科目',
}, },
{ {
prop: "nickName", prop: 'nickName',
label: "类别", label: '类别',
}, },
{ {
prop: "datas", prop: 'datas',
label: "数值", label: '数值',
// subcomponent: row // subcomponent: row
}, },
{ {
prop: "unit", prop: 'unit',
label: "单位", label: '单位',
// subcomponent: row // subcomponent: row
}, },
{ {
prop: "remark", prop: 'remark',
label: "备注", label: '备注',
// subcomponent: row // subcomponent: row
}, }
], ],
timeSelect: "month", timeSelect:'month',
startTimeStamp: null, //开始时间 startTimeStamp:null, //开始时间
endTimeStamp: null, //结束时间 endTimeStamp:null, //结束时间
date: "凯盛玻璃控股成员企业2024生产数据", date:'凯盛玻璃控股成员企业2024生产数据',
// reportTime: '', // reportTime: '',
startTimeStamp: "", startTimeStamp: '',
endTimeStamp: "", endTimeStamp: '',
tableData: [ tableData: [
{ {
userName: "userName", userName: 'userName',
nickName: "用户名", nickName: '用户名',
datas: "111111", datas:'111111'
}, },
{ {
userName: "userName", userName: 'userName',
nickName: "用户名", nickName: '用户名',
datas: "111111", datas: '111111'
}, },
{ {
userName: "userName", userName: 'userName',
nickName: "用户名", nickName: '用户名',
datas: "111111", datas: '111111'
// subcomponent: row // subcomponent: row
}, }
], ],
// proLineList: [], // proLineList: [],
// all: {} // all: {}
}; };
}, },
mounted() { mounted() {
this.getDict(); this.getDict()
// this.getCurrentYearFirst() // this.getCurrentYearFirst()
// this.getDataList() // this.getDataList()
}, },
methods: { methods: {
getYear(e) { getYear(e) {
if ( if (this.listQuery.reportTime[0] && e - this.listQuery.reportTime[0] > 10) {
this.listQuery.reportTime[0] &&
e - this.listQuery.reportTime[0] > 10
) {
this.$message({ this.$message({
message: "年份起止时间不能超过十年", message: '年份起止时间不能超过十年',
type: "warning", type: 'warning'
}); });
// console.log(); // console.log();
} }
@@ -308,67 +210,59 @@ export default {
}, },
changeTime() { changeTime() {
if (this.listQuery.reportTime) { if (this.listQuery.reportTime) {
this.createStartDate = moment( this.createStartDate = moment(new Date(this.listQuery.reportTime[0]), 'yyyy-MM-dd hh:mm:ss');
new Date(this.listQuery.reportTime[0]), this.createEndDate = moment(new Date(this.listQuery.reportTime[1]), 'yyyy-MM-dd hh:mm:ss');
"yyyy-MM-dd hh:mm:ss" const numDays = (new Date(this.listQuery.reportTime[1]).getTime() - new Date(this.listQuery.reportTime[0]).getTime()) / (24 * 3600 * 1000); if (numDays > 730) {
);
this.createEndDate = moment(
new Date(this.listQuery.reportTime[1]),
"yyyy-MM-dd hh:mm:ss"
);
const numDays =
(new Date(this.listQuery.reportTime[1]).getTime() -
new Date(this.listQuery.reportTime[0]).getTime()) /
(24 * 3600 * 1000);
if (numDays > 730) {
this.$message({ this.$message({
message: "时间范围不能超过24个月", message: '时间范围不能超过24个月',
type: "warning", type: 'warning'
}); });
this.listQuery.reportTime = []; this.listQuery.reportTime = [];
this.createStartDate = ""; this.createStartDate = '';
this.createEndDate = ""; this.createEndDate = '';
} }
} else { } else {
this.createStartDate = ""; this.createStartDate = '';
this.createEndDate = ""; this.createEndDate = '';
} }
}, },
async getDict() { async getDict() {
this.$refs.lineChart.initChart(); this.$refs.lineChart.initChart()
// 产线列表 // 产线列表
// const res = await getCorePLList(); // const res = await getCorePLList();
// this.proLineList = res.data; // this.proLineList = res.data;
}, },
// 获取数据列表 // 获取数据列表
multipliedByHundred(str) { multipliedByHundred(str) {
console.log(str); console.log(str);
// console.log(str) // console.log(str)
if (str != 0) { if ( str != 0) {
let floatVal = parseFloat(str); let floatVal = parseFloat(str);
if (isNaN(floatVal)) { if (isNaN(floatVal)) {
return 0; return 0;
} }
floatVal = Math.round(str * 10000) / 100; floatVal = Math.round(str * 10000) / 100;
let strVal = floatVal.toString(); let strVal = floatVal.toString();
let searchVal = strVal.indexOf("."); let searchVal = strVal.indexOf('.');
if (searchVal < 0) { if (searchVal < 0) {
searchVal = strVal.length; searchVal = strVal.length;
strVal += "."; strVal += '.';
} }
while (strVal.length <= searchVal + 2) { while (strVal.length <= searchVal + 2) {
strVal += "0"; strVal += '0';
} }
return parseFloat(strVal); return parseFloat(strVal);
} }
},
async getDataList() {
}, },
async getDataList() {},
add0(m) { add0(m) {
return m < 10 ? "0" + m : m; return m < 10 ? '0' + m : m
}, },
format(shijianchuo) { format(shijianchuo) {
//shijianchuo是整数否则要parseInt转换 //shijianchuo是整数否则要parseInt转换
var time = moment(new Date(shijianchuo)).format("YYYY-MM-DD HH:mm:ss"); var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss')
// console.log(time) // console.log(time)
// var y = time.getFullYear(); // var y = time.getFullYear();
// var m = time.getMonth() + 1; // var m = time.getMonth() + 1;
@@ -376,9 +270,9 @@ export default {
// var h = time.getHours(); // var h = time.getHours();
// var mm = time.getMinutes(); // var mm = time.getMinutes();
// var s = time.getSeconds(); // var s = time.getSeconds();
return time; return time
}, },
// changeTime(val) { // changeTime(val) {
// if (val) { // if (val) {
// // console.log(val) // // console.log(val)
// // console.log(val.setHours(7, 0, 0)) // // console.log(val.setHours(7, 0, 0))
@@ -390,41 +284,35 @@ export default {
// this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 // this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
// this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 // this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// console.log(this.listQuery.reportTime); // console.log(this.listQuery.reportTime);
// } else { // } else {
// this.listQuery.reportTime = [] // this.listQuery.reportTime = []
// } // }
// }, // },
//时间戳转为yy-mm-dd hh:mm:ss //时间戳转为yy-mm-dd hh:mm:ss
timeFun(unixtimestamp) { timeFun(unixtimestamp) {
var unixtimestamp = new Date(unixtimestamp); var unixtimestamp = new Date(unixtimestamp);
var year = 1900 + unixtimestamp.getYear(); var year = 1900 + unixtimestamp.getYear();
var month = "0" + (unixtimestamp.getMonth() + 1); var month = "0" + (unixtimestamp.getMonth() + 1);
var date = "0" + unixtimestamp.getDate(); var date = "0" + unixtimestamp.getDate();
return ( return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
year + },
"-" + buttonClick(val) {
month.substring(month.length - 2, month.length) + this.listQuery.reportTime = val.reportTime ? val.reportTime : undefined;
"-" + switch (val.btnName) {
date.substring(date.length - 2, date.length) case 'search':
); this.listQuery.pageNo = 1;
}, this.listQuery.pageSize = 10;
buttonClick(val) { this.getDataList();
this.listQuery.reportTime = val.reportTime ? val.reportTime : undefined; break;
switch (val.btnName) { case 'export':
case "search": this.handleExport();
this.listQuery.pageNo = 1; break;
this.listQuery.pageSize = 10; default:
this.getDataList(); console.log(val);
break; }
case "export": },
this.handleExport(); /** 导出按钮操作 */
break;
default:
console.log(val);
}
},
/** 导出按钮操作 */
handleExport() { handleExport() {
// 处理查询参数 // 处理查询参数
// var xlsxParam = { raw: true }; // var xlsxParam = { raw: true };
@@ -456,23 +344,25 @@ export default {
// return wbout; // return wbout;
// //do something...... // //do something......
// }) // })
}, },
}, },
}; };
</script> </script>
<style scoped> <style scoped>
.blueTip::before { .blueTip::before{
display: inline-block; display: inline-block;
content: ""; content: '';
width: 4px; width: 4px;
height: 18px; height: 18px;
background: #0b58ff; background: #0B58FF;
border-radius: 1px; border-radius: 1px;
margin-right: 8px; margin-right: 8PX;
margin-top: 8px; margin-top: 8px;
} }
.app-container { .app-container {
margin: 0 16px 0;
background-color: #fff; background-color: #fff;
border-radius: 4px; border-radius: 4px;
padding: 16px 16px 0; padding: 16px 16px 0;

View File

@@ -714,7 +714,7 @@ export default {
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 10,
username: undefined, username: undefined,
mobile: undefined, mobile: undefined,
status: undefined, status: undefined,

16674
yarn.lock

File diff suppressed because it is too large Load Diff