Merge branch 'projects/mescc/develop' into projects/mescc/zjl
This commit is contained in:
commit
4b0e8dfab6
4
.env.dev
4
.env.dev
@ -1,8 +1,8 @@
|
|||||||
###
|
###
|
||||||
# @Author: zhp
|
# @Author: zhp
|
||||||
# @Date: 2024-04-28 13:42:51
|
# @Date: 2024-04-28 13:42:51
|
||||||
# @LastEditTime: 2024-05-20 08:31:10
|
# @LastEditTime: 2024-05-22 16:29:35
|
||||||
# @LastEditors: zhp
|
# @LastEditors: DY
|
||||||
# @Description:
|
# @Description:
|
||||||
###
|
###
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2024-05-07 08:54:59
|
* @Date: 2024-05-07 08:54:59
|
||||||
* @LastEditTime: 2024-05-14 15:43:50
|
* @LastEditTime: 2024-05-22 16:31:08
|
||||||
* @LastEditors: zhp
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
@ -16,14 +16,121 @@ export function getProduceDataPage(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getProduceDataDetail(data){
|
export function getProduceDataDetail(id){
|
||||||
return request({
|
return request({
|
||||||
url: '/ip/prod-output/get=' + id,
|
url: '/ip/prod-output/get?id=' + id,
|
||||||
method: 'get',
|
method: 'get'
|
||||||
query: data
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 导出生产数据
|
||||||
|
export function exportOutPutExcel(data) {
|
||||||
|
return request({
|
||||||
|
url: '/ip/prod-output/output-export-excel',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取生产管理生产目标管理碲化镉工厂分页
|
||||||
|
export function prodTargetDiPage(data) {
|
||||||
|
return request({
|
||||||
|
url: '/ip/prod-target/prodTargetDiPage',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取生产管理生产目标管理铜铟镓硒工厂分页
|
||||||
|
export function prodTargetToPage(data) {
|
||||||
|
return request({
|
||||||
|
url: '/ip/prod-target/prodTargetToPage',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建生产目标
|
||||||
|
export function createProduce(data) {
|
||||||
|
return request({
|
||||||
|
url: '/ip/prod-target/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得生产目标
|
||||||
|
export function getProduceTargetDetail(id){
|
||||||
|
return request({
|
||||||
|
url: '/ip/prod-target/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改生产目标
|
||||||
|
export function updateProduceTarget(data) {
|
||||||
|
return request({
|
||||||
|
url: '/ip/prod-target/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出碲化镉生产目标数据
|
||||||
|
export function exportDiTargetExcel(data) {
|
||||||
|
return request({
|
||||||
|
url: '/ip/prod-target/di-target-export-excel',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出铜铟镓硒生产目标数据
|
||||||
|
export function exportToTargetExcel(data) {
|
||||||
|
return request({
|
||||||
|
url: '/ip/prod-target/to-target-export-excel',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除生产目标
|
||||||
|
export function delTarget(id) {
|
||||||
|
return request({
|
||||||
|
url: '/ip/prod-target/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导入铜铟镓硒工厂
|
||||||
|
export function importToTarget(data) {
|
||||||
|
return request({
|
||||||
|
url: '/ip/prod-target/to-target-import-excel',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导入碲化镉工厂
|
||||||
|
export function importDiTarget(data) {
|
||||||
|
return request({
|
||||||
|
url: '/ip/prod-target/di-target-import-excel',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// export function cockpitDataMonitor(data) {
|
||||||
|
// return request({
|
||||||
|
// url: '/ip/prod-output/cockpitDataMonitor',
|
||||||
|
// method: 'post',
|
||||||
|
// data: data
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
export function cockpitDataMonitor(data) {
|
export function cockpitDataMonitor(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/ip/prod-output/cockpitDataMonitor',
|
url: '/ip/prod-output/cockpitDataMonitor',
|
||||||
|
@ -82,6 +82,8 @@ export default {
|
|||||||
border: none;
|
border: none;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
border-bottom-left-radius: 5px;
|
||||||
|
border-bottom-right-radius: 5px;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
color: #888;
|
color: #888;
|
||||||
letter-spacing: 2px;
|
letter-spacing: 2px;
|
||||||
|
@ -71,6 +71,45 @@ export const SystemDataScopeEnum = {
|
|||||||
DEPT_SELF: 5 // 仅本人数据权限
|
DEPT_SELF: 5 // 仅本人数据权限
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂名称
|
||||||
|
*/
|
||||||
|
export const factoryList =['瑞昌中建材光电材料有限公司', '邯郸中建材光电材料有限公司', '中建材株洲光电材料有限公司', '佳木斯中建材光电材料有限公司', '成都中建材光电材料有限公司', '凯盛光伏材料有限公司', '蚌埠兴科玻璃有限公司']
|
||||||
|
|
||||||
|
export const dhgfactoryList =[
|
||||||
|
{
|
||||||
|
name: '瑞昌中建材光电材料有限公司',
|
||||||
|
id: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '邯郸中建材光电材料有限公司',
|
||||||
|
id: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '中建材株洲光电材料有限公司',
|
||||||
|
id: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '佳木斯中建材光电材料有限公司',
|
||||||
|
id: 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '成都中建材光电材料有限公司',
|
||||||
|
id: 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '蚌埠兴科玻璃有限公司',
|
||||||
|
id: 6
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
export const tyjxfactoryList =[
|
||||||
|
{
|
||||||
|
name: '凯盛光伏材料有限公司',
|
||||||
|
id: 5
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代码生成模板类型
|
* 代码生成模板类型
|
||||||
*/
|
*/
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2023-11-06 15:15:30
|
* @Date: 2023-11-06 15:15:30
|
||||||
* @LastEditTime: 2024-05-07 09:31:54
|
* @LastEditTime: 2024-05-20 18:02:10
|
||||||
* @LastEditors: zhp
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<el-drawer class="drawer" :visible.sync="visible" size="50%">
|
<el-drawer class="drawer" :visible.sync="visible" size="55%" @closed="$emit('destroy')">
|
||||||
<small-title slot="title" :no-padding="true">
|
<small-title slot="title" :no-padding="true">
|
||||||
{{ '碲化镉工厂生产数据详情' }}
|
{{ '碲化镉工厂生产数据详情' }}
|
||||||
</small-title>
|
</small-title>
|
||||||
@ -14,15 +14,15 @@
|
|||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<p class="title">工厂名称</p>
|
<p class="title">工厂名称</p>
|
||||||
<p class="text">{{ }}</p>
|
<p class="text">{{ dataForm.factory }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<p class="title">时间维度</p>
|
<p class="title">时间维度</p>
|
||||||
<p class="text">{{ dataForm.code }}</p>
|
<p class="text">{{ date }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<p class="title">时间</p>
|
<p class="title">时间</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<p class="text">{{ dataForm.reportDate.length > 0 ? dataForm.reportDate[0] + '年' + dataForm.reportDate[1] + '月' + dataForm.reportDate[2] + '日' : '' }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-divider></el-divider>
|
<el-divider></el-divider>
|
||||||
@ -36,43 +36,43 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">芯片良率</p>
|
<p class="title">芯片良率</p>
|
||||||
<p class="text">{{ dataForm.code }}</p>
|
<p class="text">{{ dataForm.yieldRate }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">芯片良率</p>
|
<p class="title">芯片BOM</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<p class="text">{{ dataForm.bom }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">芯片总功率</p>
|
<p class="title">芯片总功率</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<p class="text">{{ dataForm.totalPower }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">FTO投入量</p>
|
<p class="title">FTO投入量</p>
|
||||||
<p class="text">{{ }}</p>
|
<p class="text">{{ dataForm.chipInput }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">CSS稼动率</p>
|
<p class="title">CSS稼动率</p>
|
||||||
<p class="text">{{ dataForm.code }}</p>
|
<p class="text">{{ dataForm.marriageRate }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">芯片段OEE</p>
|
<p class="title">芯片段OEE</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<p class="text">{{ dataForm.oee }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">芯片平均功率</p>
|
<p class="title">芯片平均功率</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<p class="text">{{ dataForm.averagePower }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">芯片人均产量</p>
|
<p class="title">芯片人均产量</p>
|
||||||
<p class="text">{{ }}</p>
|
<p class="text">{{ dataForm.annualAverageProduction }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">芯片产能利用率</p>
|
<p class="title">芯片产能利用率</p>
|
||||||
<p class="text">{{ dataForm.code }}</p>
|
<p class="text">{{ dataForm.capacityUtilizationRate }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
||||||
@ -81,19 +81,20 @@
|
|||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">封装BOM</p>
|
<p class="title">封装BOM</p>
|
||||||
<p class="text">{{ }}</p>
|
<!-- 没参数 -->
|
||||||
|
<!-- <p class="text">{{ dataForm.bom }}</p> -->
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">封装线OEE</p>
|
<p class="title">封装线OEE</p>
|
||||||
<p class="text">{{ dataForm.code }}</p>
|
<!-- <p class="text">{{ dataForm.code }}</p> -->
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">标准组件良率</p>
|
<p class="title">标准组件良率</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<!-- <p class="text">{{ dataForm.productName }}</p> -->
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">标准组件产量</p>
|
<p class="title">标准组件产量</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<!-- <p class="text">{{ dataForm.productName }}</p> -->
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
@ -103,15 +104,15 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">封装产能利用率</p>
|
<p class="title">封装产能利用率</p>
|
||||||
<p class="text">{{ dataForm.code }}</p>
|
<!-- <p class="text">{{ dataForm.code }}</p> -->
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">标准组件人均产量</p>
|
<p class="title">标准组件人均产量</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<!-- <p class="text">{{ dataForm.productName }}</p> -->
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">标准组件人均产量</p>
|
<p class="title">标准组件平均功率</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<!-- <p class="text">{{ dataForm.productName }}</p> -->
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
||||||
@ -166,6 +167,12 @@ export default {
|
|||||||
SmallTitle,
|
SmallTitle,
|
||||||
},
|
},
|
||||||
// mixins: [basicAdd],
|
// mixins: [basicAdd],
|
||||||
|
props: {
|
||||||
|
date: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
urlOptions: {
|
urlOptions: {
|
||||||
@ -224,8 +231,12 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
init(id) {
|
init(id) {
|
||||||
this.visible = true
|
this.visible = true
|
||||||
|
console.log('打印', id)
|
||||||
if (id) {
|
if (id) {
|
||||||
getProduceDataDetail()
|
getProduceDataDetail(id).then(res => {
|
||||||
|
this.dataForm = res.data
|
||||||
|
console.log('你好', res.data)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// getCurrentTime() {
|
// getCurrentTime() {
|
||||||
|
@ -1,53 +1,53 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2024-04-15 10:49:13
|
* @Date: 2024-04-15 10:49:13
|
||||||
* @LastEditTime: 2024-05-07 09:18:01
|
* @LastEditTime: 2024-05-22 15:25:11
|
||||||
* @LastEditors: zhp
|
* @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)">
|
||||||
<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="reportTime">
|
<el-form-item label="时间维度" prop="date">
|
||||||
<el-select clearable v-model="listQuery.date" 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.date === 0" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.date === 0 || listQuery.date === ''" label="时间范围" prop="reportTime">
|
||||||
<el-date-picker 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="yyyy-MM-dd HH:mm:ss" @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.date === 1" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.date === 1" label="时间范围" prop="reportTime">
|
||||||
<el-date-picker clearable v-model="listQuery.reportTime[0]" 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>
|
||||||
至
|
至
|
||||||
<el-date-picker clearable v-model="listQuery.reportTime[1]" type="week" format="yyyy 第 WW 周" placeholder="选择周"
|
<el-date-picker size="small" clearable v-model="listQuery.end" 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="listQuery.reportTime[0] && listQuery.reportTime[1]" style="margin-left: 10px">
|
<span v-if="listQuery.start && listQuery.end" 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 === 2" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.date === 2" label="时间范围" prop="reportTime">
|
||||||
<el-date-picker clearable v-model="listQuery.reportTime" type="monthrange" 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.date === 3" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.date === 3" label="时间范围" prop="reportTime">
|
||||||
<el-date-picker clearable v-model="listQuery.reportTime[0]" value-format="yyyy" 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>
|
||||||
~
|
~
|
||||||
<el-date-picker clearable v-model="listQuery.reportTime[1]" value-format="yyyy" type="year" placeholder="结束时间"
|
<el-date-picker size="small" clearable v-model="listQuery.end" format="yyyy-MM-dd" value-format="timestamp" type="year" placeholder="结束时间"
|
||||||
@change="getYear">
|
@change="getYear">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="工厂名称" prop="factorys">
|
<el-form-item label="工厂名称" prop="factorys">
|
||||||
<el-select clearable v-model="listQuery.factorys" placeholder="请选择工厂名称" multiple >
|
<el-select size="small" clearable v-model="listQuery.factorys" placeholder="请选择工厂名称" multiple >
|
||||||
<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>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
@ -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 clearable v-model="listQuery.type" 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>
|
||||||
@ -69,23 +69,32 @@
|
|||||||
<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 class="app-container" style="margin-top: 8px;padding: 16px; height: auto; flex-grow: 1;">
|
||||||
<!-- <el-row :gutter="24"> -->
|
<!-- <el-row :gutter="24"> -->
|
||||||
<!-- <el-col :span="12" v-for="item in dataList" :key="item.id"> -->
|
<!-- <el-col :span="12" v-for="item in dataList" :key="item.id"> -->
|
||||||
|
<search-bar :formConfigs="formConfig1" ref="searchBarForm1" style="margin-bottom: 0" />
|
||||||
<line-chart class="yearChart" ref="lineChart" style="height: 40vh;width: 100%"></line-chart>
|
<line-chart class="yearChart" ref="lineChart" style="height: 40vh;width: 100%"></line-chart>
|
||||||
<!-- </el-col> -->
|
<!-- </el-col> -->
|
||||||
<!-- <el-col :span="12">
|
<!-- <el-col :span="12">
|
||||||
<line-chart :id=" 'second' " class="yearChart" ref="lineChart" style="height: 40vh;width: 100%"></line-chart>
|
<line-chart :id=" 'second' " class="yearChart" ref="lineChart" style="height: 40vh;width: 100%"></line-chart>
|
||||||
</el-col> -->
|
</el-col> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="app-container" style="margin-top: 18px;flex-grow: 1; height: auto; padding: 16px;">
|
<div class="app-container" style="margin-top: 8px;flex-grow: 1; height: auto; padding: 16px;">
|
||||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" style="margin-bottom: 0" />
|
||||||
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
|
<base-table :table-props="tableProps" :page="listQuery.current" :limit="listQuery.size"
|
||||||
:table-data="tableData">
|
:table-data="tableData">
|
||||||
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right"
|
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right"
|
||||||
:method-list="tableBtn" @clickBtn="handleClick" />
|
:method-list="tableBtn" @clickBtn="handleClick" />
|
||||||
</base-table>
|
</base-table>
|
||||||
|
<pagination
|
||||||
|
:limit.sync="listQuery.size"
|
||||||
|
:page.sync="listQuery.current"
|
||||||
|
:total="listQuery.total"
|
||||||
|
@pagination="getDataList"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<add-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" @refreshDataList="successSubmit" />
|
<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
|
||||||
@ -98,7 +107,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import { parseTime } from '../../core/mixins/code-filter';
|
// import { parseTime } from '../../core/mixins/code-filter';
|
||||||
import { getProduceDataPage } 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'
|
||||||
@ -114,7 +123,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
listQuery: {
|
listQuery: {
|
||||||
size: 10,
|
size: 20,
|
||||||
current: 1,
|
current: 1,
|
||||||
factorys: [],
|
factorys: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
@ -123,7 +132,9 @@ export default {
|
|||||||
// reportType: 2,
|
// reportType: 2,
|
||||||
beginTime: undefined,
|
beginTime: undefined,
|
||||||
endTime:undefined,
|
endTime:undefined,
|
||||||
reportTime: []
|
reportTime: [],
|
||||||
|
start: undefined,
|
||||||
|
end: undefined
|
||||||
},
|
},
|
||||||
detailOrUpdateVisible:false,
|
detailOrUpdateVisible:false,
|
||||||
date1: undefined,
|
date1: undefined,
|
||||||
@ -177,88 +188,16 @@ export default {
|
|||||||
// getDataListURL: getGlassPage,
|
// getDataListURL: getGlassPage,
|
||||||
// exportURL: exportGlasscExcel
|
// exportURL: exportGlasscExcel
|
||||||
},
|
},
|
||||||
mainFormConfig: [
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '工单',
|
|
||||||
placeholder: '请选择工单',
|
|
||||||
param: 'workOrderId',
|
|
||||||
selectOptions: [],
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// type: 'select',
|
|
||||||
// label: '产线',
|
|
||||||
// placeholder: '请选择产线',
|
|
||||||
// param: 'lineId',
|
|
||||||
// selectOptions: [],
|
|
||||||
// },
|
|
||||||
// 选项切换
|
|
||||||
// {
|
|
||||||
// type: 'select',
|
|
||||||
// label: '时间类型',
|
|
||||||
// param: 'dateFilterType',
|
|
||||||
// defaultSelect: 0,
|
|
||||||
// selectOptions: [
|
|
||||||
// { id: 0, name: '按时间段' },
|
|
||||||
// { id: 1, name: '按日期' },
|
|
||||||
// ],
|
|
||||||
// index: 2,
|
|
||||||
// extraOptions: [
|
|
||||||
{
|
|
||||||
// parent: 'dateFilterType',
|
|
||||||
// 时间段选择
|
|
||||||
type: 'datePicker',
|
|
||||||
label: '时间段',
|
|
||||||
// dateType: 'datetimerange',
|
|
||||||
dateType: 'datetimerange',
|
|
||||||
format: 'yyyy-MM-dd HH:mm:ss',
|
|
||||||
valueFormat: 'yyyy-MM-ddTHH:mm:ss',
|
|
||||||
rangeSeparator: '-',
|
|
||||||
rangeSeparator: '-',
|
|
||||||
startPlaceholder: '开始时间',
|
|
||||||
endPlaceholder: '结束时间',
|
|
||||||
param: 'recordTime',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// parent: 'dateFilterType',
|
|
||||||
// // 日期选择
|
|
||||||
// type: 'datePicker',
|
|
||||||
// // label: '日期',
|
|
||||||
// dateType: 'date',
|
|
||||||
// placeholder: '选择日期',
|
|
||||||
// format: 'yyyy-MM-dd',
|
|
||||||
// valueFormat: 'yyyy-MM-dd',
|
|
||||||
// param: 'timeday',
|
|
||||||
// },
|
|
||||||
// ],
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
type:'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type:'separate'
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// type: this.$auth.hasPermi(
|
|
||||||
// 'analysis:equipment:export'
|
|
||||||
// )
|
|
||||||
// ? 'separate'
|
|
||||||
// : '',
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
type:'button',
|
|
||||||
btnName: '导出',
|
|
||||||
name: 'export',
|
|
||||||
color: 'warning',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
formConfig: [
|
formConfig: [
|
||||||
{
|
{
|
||||||
type: 'title',
|
type: 'title',
|
||||||
label: '生产数据管理',
|
label: '工厂信息',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
formConfig1: [
|
||||||
|
{
|
||||||
|
type: 'title',
|
||||||
|
label: '良品数量',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
timeList: [
|
timeList: [
|
||||||
@ -281,24 +220,52 @@ export default {
|
|||||||
],
|
],
|
||||||
factoryList: [
|
factoryList: [
|
||||||
{
|
{
|
||||||
name: '测试',
|
name: '瑞昌中建材光电材料有限公司',
|
||||||
id:1
|
id: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '邯郸中建材光电材料有限公司',
|
||||||
|
id: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '中建材株洲光电材料有限公司',
|
||||||
|
id: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '佳木斯中建材光电材料有限公司',
|
||||||
|
id: 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '成都中建材光电材料有限公司',
|
||||||
|
id: 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '凯盛光伏材料有限公司',
|
||||||
|
id: 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '蚌埠兴科玻璃有限公司',
|
||||||
|
id: 6
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
tableProps: [
|
tableProps: [
|
||||||
{
|
{
|
||||||
prop: 'createTime',
|
prop: 'tableTime',
|
||||||
label: '日期',
|
label: '日期',
|
||||||
|
minWidth: 100,
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'factory',
|
prop: 'factory',
|
||||||
label: '工厂名称',
|
label: '工厂名称',
|
||||||
filter: (val) => ['瑞昌中建材光电材料有限公司', '邯郸中建材光电材料有限公司', '中建材株洲光电材料有限公司', '佳木斯中建材光电材料有限公司', '成都中建材光电材料有限公司', '凯盛光伏材料有限公司', '蚌埠兴科玻璃有限公司'][val]
|
filter: (val) => ['瑞昌中建材光电材料有限公司', '邯郸中建材光电材料有限公司', '中建材株洲光电材料有限公司', '佳木斯中建材光电材料有限公司', '成都中建材光电材料有限公司', '凯盛光伏材料有限公司', '蚌埠兴科玻璃有限公司'][val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'glassType',
|
prop: 'glassType',
|
||||||
label: '玻璃类型',
|
label: '玻璃类型',
|
||||||
filter: (val) => ['玻璃芯片', '标准组件', 'BIPV'][val]
|
filter: (val) => ['玻璃芯片', '标准组件', 'BIPV', '定制组件'][val]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'inputNumber',
|
prop: 'inputNumber',
|
||||||
@ -318,19 +285,18 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
xAxis: []
|
||||||
// proLineList: [],
|
// proLineList: [],
|
||||||
// all: {}
|
// all: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
weekNum() {
|
weekNum() {
|
||||||
return Math.round((this.listQuery.reportTime[1] - this.listQuery.reportTime[0]) / (24 * 60 * 60 * 1000 * 7)) + 1
|
return Math.round((this.listQuery.end - this.listQuery.start) / (24 * 60 * 60 * 1000 * 7)) + 1
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getDict()
|
this.getDataList()
|
||||||
// this.getCurrentYearFirst()
|
|
||||||
// this.getDataList()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
otherMethods(val) {
|
otherMethods(val) {
|
||||||
@ -340,32 +306,41 @@ export default {
|
|||||||
this.$refs.detailOrUpdate.init(val.data.id);
|
this.$refs.detailOrUpdate.init(val.data.id);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
buttonClick() {
|
// buttonClick() {
|
||||||
|
|
||||||
},
|
// },
|
||||||
getYear(e) {
|
getYear(e) {
|
||||||
if (this.listQuery.reportTime[0] && e - this.listQuery.reportTime[0] > 10) {
|
if (this.listQuery.end - this.listQuery.start > 10*365*24*60*60*1000) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '年份起止时间不能超过十年',
|
message: '年份起止时间不能超过十年',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
});
|
});
|
||||||
|
this.listQuery.reportTime = []
|
||||||
|
this.listQuery.start = undefined
|
||||||
|
this.listQuery.end = undefined
|
||||||
// console.log();
|
// console.log();
|
||||||
|
} else {
|
||||||
|
this.listQuery.beginTime = this.listQuery.start
|
||||||
|
this.listQuery.endTime = this.listQuery.end
|
||||||
}
|
}
|
||||||
// console.log(e);
|
// console.log(e);
|
||||||
},
|
},
|
||||||
onValueChange(picker, k) { // 选中近k周后触发的操作
|
onValueChange(picker, k) { // 选中近k周后触发的操作
|
||||||
if (this.listQuery.reportTime[0] && this.listQuery.reportTime[1]) {
|
// console.log(this.listQuery.reportTime[0], this.listQuery.reportTime[1])
|
||||||
console.log(this.listQuery.reportTime[0].getTime() - 24 * 60 * 60 * 1000)
|
if (this.listQuery.start && this.listQuery.end) {
|
||||||
this.date1 = moment(this.listQuery.reportTime[0].getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
console.log(this.listQuery.reportTime)
|
||||||
// this.onValueChange() // 这里为我们希望value改变时触发的方法
|
this.date1 = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
||||||
this.date2 = moment(this.listQuery.reportTime[1].getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
this.date2 = moment(this.listQuery.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) {
|
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
|
||||||
|
if (numDays > 168) {
|
||||||
console.log(numDays)
|
console.log(numDays)
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '周范围不能超过24周',
|
message: '周范围不能超过24周',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
});
|
});
|
||||||
// this.onValueChange()
|
} else {
|
||||||
|
this.listQuery.beginTime = this.listQuery.start.getTime() - 24 * 60 * 60 * 1000
|
||||||
|
this.listQuery.endTime = this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -374,103 +349,42 @@ export default {
|
|||||||
// this.createStartDate = moment(new Date(this.listQuery.reportTime[0]), 'yyyy-MM-dd hh:mm:ss');
|
// this.createStartDate = moment(new Date(this.listQuery.reportTime[0]), 'yyyy-MM-dd hh:mm:ss');
|
||||||
// this.createEndDate = moment(new Date(this.listQuery.reportTime[1]), 'yyyy-MM-dd hh:mm:ss');
|
// this.createEndDate = moment(new Date(this.listQuery.reportTime[1]), 'yyyy-MM-dd hh:mm:ss');
|
||||||
console.log(this.listQuery.reportTime[1])
|
console.log(this.listQuery.reportTime[1])
|
||||||
const numDays = (new Date(this.listQuery.reportTime[1]).getTime() - new Date(this.listQuery.reportTime[0]).getTime()) / (24 * 3600 * 1000); if (numDays > 30) {
|
const numDays = (this.listQuery.reportTime[1] - this.listQuery.reportTime[0]) / (24 * 3600 * 1000);
|
||||||
|
if (numDays > 30) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '时间范围不能超过30天',
|
message: '时间范围不能超过30天',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
});
|
});
|
||||||
this.listQuery.reportTime = [];
|
this.listQuery.reportTime = [];
|
||||||
|
} else {
|
||||||
|
this.listQuery.beginTime = this.listQuery.reportTime[0]
|
||||||
|
this.listQuery.endTime = this.listQuery.reportTime[1]
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeTime(value) {
|
changeTime(value) {
|
||||||
if (this.listQuery.reportTime) {
|
if (this.listQuery.reportTime) {
|
||||||
const timeStamp = this.listQuery.reportTime[1].getMonth(); //标准时间转为时间戳,毫秒级别
|
const numDays = this.listQuery.reportTime[1] - this.listQuery.reportTime[0];
|
||||||
const fullyear = this.listQuery.reportTime[1].getFullYear()
|
if (numDays > 2*365*24*60*60*1000) {
|
||||||
let days = 0
|
|
||||||
switch (timeStamp) {
|
|
||||||
case 0:
|
|
||||||
case 2:
|
|
||||||
case 4:
|
|
||||||
case 6:
|
|
||||||
case 7:
|
|
||||||
case 9:
|
|
||||||
case 11:
|
|
||||||
days = 31
|
|
||||||
break
|
|
||||||
case 3:
|
|
||||||
case 4:
|
|
||||||
case 8:
|
|
||||||
case 10:
|
|
||||||
days = 30
|
|
||||||
break
|
|
||||||
case 1:
|
|
||||||
if ((fullyear % 400 === 0) || (fullyear % 4 === 0 && fullyear % 100 !== 0)) {
|
|
||||||
days = 29
|
|
||||||
} else {
|
|
||||||
days = 28
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
let startTime = moment(new Date(this.listQuery.reportTime[0]).setDate(1, 0, 0, 0)).format('YYYY-MM-DD HH:mm:ss')
|
|
||||||
// this.startTimeStamp = this.timeFun(new Date(fullyear, timeStamp, 1, 7, 0, 1).getTime()); //开始时间
|
|
||||||
let endTime = this.timeFun(new Date(fullyear, timeStamp, days).getTime()) + ' 23:59:59'; //结束时间
|
|
||||||
// console.log(endTimeStamp);
|
|
||||||
// let endTime = moment(this.listQuery.reportTime[1]).month(monthNum - 1).date(1).endOf("month").format("YYYY-MM-DD");
|
|
||||||
// console.log(endTime);
|
|
||||||
// console.log(moment(new Date(this.listQuery.reportTime[1]).setDate(31, 23, 59, 59)).format('YYYY-MM-DD HH:mm:ss'))
|
|
||||||
// console.log(moment(new Date(this.listQuery.reportTime[1]).getTime()).format('YYYY-MM-DD HH:mm:ss'))
|
|
||||||
|
|
||||||
// this.createStartDate = moment(new Date(this.listQuery.reportTime[0]), 'yyyy-MM-dd hh:mm:ss');
|
|
||||||
// this.createEndDate = moment(new Date(this.listQuery.reportTime[1]), 'yyyy-MM-dd hh:mm:ss');
|
|
||||||
const numDays = (new Date(endTime).getTime() - new Date(startTime).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 = [];
|
||||||
} else {
|
} else {
|
||||||
this.listQuery.reportTime[0] = startTime
|
this.listQuery.beginTime = this.listQuery.reportTime[0]
|
||||||
this.listQuery.reportTime[1] = endTime
|
this.listQuery.endTime = this.listQuery.reportTime[1]
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log(this.listQuery.reportTime[0])
|
console.log(this.listQuery.reportTime[0])
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// handleTime() {
|
// async getDict() {
|
||||||
// this.$forceUpdate()
|
|
||||||
// // this.$nextTick(() => [
|
|
||||||
|
|
||||||
// // ])
|
|
||||||
// },
|
|
||||||
// getCurrentYearFirst() {
|
|
||||||
// let date = new Date();
|
|
||||||
// date.setDate(1);
|
|
||||||
// date.setMonth(0);
|
|
||||||
// this.reportTime = date;
|
|
||||||
// this.startTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 0, 1, 7, 0, 1).getTime()); //开始时间
|
|
||||||
// this.endTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 11, 31, 7, 0, 0).getTime()); //结束时间
|
|
||||||
// this.listQuery.reportTime[0] = parseTime(new Date(new Date().getFullYear(), 0, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
|
||||||
// this.listQuery.reportTime[1] = parseTime(new Date(new Date().getFullYear(), 11, 31, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 100
|
|
||||||
// },
|
|
||||||
// changeTime(val) {
|
|
||||||
// if (val) {
|
|
||||||
// // let timeStamp = val.getTime(); //标准时间转为时间戳,毫秒级别
|
|
||||||
// // this.endTimeStamp = this.timeFun(new Date(val.getFullYear(), 11, 31, 7, 0, 0).getTime()); //开始时间
|
|
||||||
// // this.startTimeStamp = this.timeFun(new Date(val.getFullYear(), 0, 1, 7, 0, 1).getTime()); //结束时间
|
|
||||||
// // this.listQuery.reportTime[0] = parseTime(new Date(val.getFullYear(), 0, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
|
||||||
// // this.listQuery.reportTime[1] = parseTime(new Date(val.getFullYear(), 11, 31, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
|
||||||
// } else {
|
|
||||||
// this.listQuery.reportTime = []
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
async getDict() {
|
|
||||||
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);
|
||||||
@ -498,36 +412,50 @@ export default {
|
|||||||
const res = await getProduceDataPage(this.listQuery)
|
const res = await getProduceDataPage(this.listQuery)
|
||||||
console.log(res)
|
console.log(res)
|
||||||
this.tableData = res.data.records
|
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.listQuery.total = res.data.total
|
||||||
|
this.buildChart(this.tableData)
|
||||||
},
|
},
|
||||||
add0(m) {
|
buildChart(list) {
|
||||||
return m < 10 ? '0' + m : m
|
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.factoryList) {
|
||||||
|
// y: {name: , id: }
|
||||||
|
const seriesItem = {
|
||||||
|
name: y.name,
|
||||||
|
type: 'bar',
|
||||||
|
emphasis: {
|
||||||
|
focus: 'series'
|
||||||
},
|
},
|
||||||
format(shijianchuo) {
|
data: Array(this.xAxis.length).fill(0)
|
||||||
//shijianchuo是整数,否则要parseInt转换
|
}
|
||||||
var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss')
|
for (const a in chartList) {
|
||||||
// console.log(time)
|
for (const z of chartList[a]) {
|
||||||
// var y = time.getFullYear();
|
this.xAxis.forEach((item, index) => {
|
||||||
// var m = time.getMonth() + 1;
|
if (z.factory === y.id && a === item) {
|
||||||
// var d = time.getDate();
|
seriesItem.data[index] = z.goodNumber
|
||||||
// var h = time.getHours();
|
}
|
||||||
// var mm = time.getMinutes();
|
})
|
||||||
// var s = time.getSeconds();
|
}
|
||||||
return time
|
}
|
||||||
},
|
this.seriesList.push(seriesItem)
|
||||||
//时间戳转为yy-mm-dd hh:mm:ss
|
}
|
||||||
timeFun(unixtimestamp) {
|
this.$refs.lineChart.initChart(this.xAxis, this.seriesList)
|
||||||
var unixtimestamp = new Date(unixtimestamp);
|
|
||||||
var year = 1900 + unixtimestamp.getYear();
|
|
||||||
var month = "0" + (unixtimestamp.getMonth() + 1);
|
|
||||||
var date = "0" + unixtimestamp.getDate();
|
|
||||||
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
|
|
||||||
},
|
},
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
this.listQuery.reportTime = val.reportTime ? val.reportTime : undefined;
|
this.listQuery.reportTime = val.reportTime ? val.reportTime : undefined;
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.current = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.size = 20;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
@ -539,6 +467,17 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
|
this.$modal.confirm('是否确认导出生产数据?').then(() => {
|
||||||
|
// 处理查询参数
|
||||||
|
let params = {...this.listQuery};
|
||||||
|
params.current = 1;
|
||||||
|
params.size = 999;
|
||||||
|
this.exportLoading = true;
|
||||||
|
return exportOutPutExcel(params);
|
||||||
|
}).then(response => {
|
||||||
|
this.$download.excel(response, '生产数据.xls');
|
||||||
|
this.exportLoading = false;
|
||||||
|
}).catch(() => {});
|
||||||
// 处理查询参数
|
// 处理查询参数
|
||||||
// var xlsxParam = { raw: true };
|
// var xlsxParam = { raw: true };
|
||||||
// /* 从表生成工作簿对象 */
|
// /* 从表生成工作簿对象 */
|
||||||
@ -591,7 +530,7 @@ export default {
|
|||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
.app-container {
|
.app-container {
|
||||||
margin: 0 16px 0;
|
margin: 0 0px 0;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 16px 16px 0;
|
padding: 16px 16px 0;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2022-01-21 14:43:06
|
* @Date: 2022-01-21 14:43:06
|
||||||
* @LastEditors: zhp
|
* @LastEditors: DY
|
||||||
* @LastEditTime: 2024-04-17 10:03:39
|
* @LastEditTime: 2024-05-22 13:48:58
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@ -58,11 +58,11 @@ export default {
|
|||||||
chart: null
|
chart: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
// mounted() {
|
||||||
this.$nextTick(() => {
|
// this.$nextTick(() => {
|
||||||
this.initChart()
|
// this.initChart()
|
||||||
})
|
// })
|
||||||
},
|
// },
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
if (!this.chart) {
|
if (!this.chart) {
|
||||||
return
|
return
|
||||||
@ -71,8 +71,7 @@ export default {
|
|||||||
this.chart = null
|
this.chart = null
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initChart() {
|
initChart(xAxis, seriesList) {
|
||||||
console.log(1111)
|
|
||||||
this.chart = echarts.init(document.getElementById(this.id))
|
this.chart = echarts.init(document.getElementById(this.id))
|
||||||
console.log(this.$parent);
|
console.log(this.$parent);
|
||||||
this.chart.setOption({
|
this.chart.setOption({
|
||||||
@ -85,7 +84,7 @@ export default {
|
|||||||
},
|
},
|
||||||
grid: { top: 100, right: 90, bottom: 10, left: 10, containLabel: true },
|
grid: { top: 100, right: 90, bottom: 10, left: 10, containLabel: true },
|
||||||
legend: {
|
legend: {
|
||||||
data: ['工厂1', '工厂2'],
|
// data: ['工厂1', '工厂2'],
|
||||||
right: '90px',
|
right: '90px',
|
||||||
top: '0%',
|
top: '0%',
|
||||||
icon: 'rect',
|
icon: 'rect',
|
||||||
@ -107,7 +106,7 @@ export default {
|
|||||||
{
|
{
|
||||||
type: 'category',
|
type: 'category',
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
data: xAxis
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
yAxis: [
|
yAxis: [
|
||||||
@ -122,39 +121,8 @@ export default {
|
|||||||
bottom: "1%",
|
bottom: "1%",
|
||||||
containLabel: true
|
containLabel: true
|
||||||
},
|
},
|
||||||
series: [
|
series: seriesList
|
||||||
{
|
}, true)
|
||||||
name: '工厂1',
|
|
||||||
type: 'bar',
|
|
||||||
itemStyle: {
|
|
||||||
normal: {
|
|
||||||
color: 'rgba(99, 189, 255, 1)', //改变折线点的颜色
|
|
||||||
lineStyle: {
|
|
||||||
color: 'rgba(99, 189, 255, 1)' //改变折线颜色
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data: [
|
|
||||||
2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '工厂2',
|
|
||||||
type: 'bar',
|
|
||||||
itemStyle: {
|
|
||||||
normal: {
|
|
||||||
color: 'rgba(142, 240, 171, 1)', //改变折线点的颜色
|
|
||||||
lineStyle: {
|
|
||||||
color: 'rgba(142, 240, 171, 1)' //改变折线颜色
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data: [
|
|
||||||
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,40 +1,49 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2024-04-17 16:31:51
|
* @Date: 2024-04-17 16:31:51
|
||||||
* @LastEditTime: 2024-04-17 17:01:14
|
* @LastEditTime: 2024-05-20 18:09:09
|
||||||
* @LastEditors: zhp
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<el-drawer class="drawer" :visible.sync="visible" size="50%">
|
<el-drawer class="drawer" :visible.sync="visible" size="55%" @closed="$emit('destroy')">
|
||||||
<small-title slot="title" :no-padding="true">
|
<small-title slot="title" :no-padding="true">
|
||||||
{{ '新增' }}
|
{{ dataForm.id ? '编辑' : '新增' }}
|
||||||
</small-title>
|
</small-title>
|
||||||
<div class="detailBox">
|
<div class="detailBox">
|
||||||
<el-form ref="form" :model="dataForm" label-width="80px" label-position="top">
|
<el-form ref="form" :model="dataForm" label-width="80px" label-position="top">
|
||||||
<el-row :gutter="24" style="padding: 0 32px;">
|
<el-row :gutter="24" style="padding: 0 32px;">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="工厂名称" prop="factoryId">
|
<el-form-item v-if="ftype === 0" label="工厂名称" prop="factory">
|
||||||
<el-select v-model="dataForm.factoryId" placeholder="请选择工厂名称" multiple="true" clearable>
|
<el-select v-model="dataForm.factory" placeholder="请选择工厂名称" clearable>
|
||||||
<el-option v-for="item in factoryList" :key="item.id" :label="item.name" :value="item.id">
|
<el-option v-for="(item, index) in dhgfactoryList" :key="index" :label="item.name" :value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-else label="工厂名称" prop="factory">
|
||||||
|
<el-select v-model="dataForm.factory" placeholder="请选择工厂名称" clearable>
|
||||||
|
<el-option v-for="(item, index) in tyjxfactoryList" :key="index" :label="item.name" :value="item.id">
|
||||||
</el-option>
|
</el-option>
|
||||||
</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 label="工厂名称" prop="factoryId">
|
<el-form-item label="时间维度" prop="targetType">
|
||||||
<el-select v-model="dataForm.factoryId" placeholder="请选择工厂名称" multiple="true" 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>
|
<el-option label="月" :value="0" />
|
||||||
|
<el-option label="年" :value="1" />
|
||||||
</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 label="工厂名称" prop="factoryId">
|
<el-form-item v-show="dataForm.targetType !== 1" label="时间" prop="reportTime">
|
||||||
<el-select v-model="dataForm.factoryId" placeholder="请选择工厂名称" multiple="true" clearable>
|
<el-date-picker v-model="dataForm.reportTime" value-format="yyyy-MM" type="month" placeholder="选择月份">
|
||||||
<el-option v-for="item in factoryList" :key="item.id" :label="item.name" :value="item.id">
|
</el-date-picker>
|
||||||
</el-option>
|
</el-form-item>
|
||||||
</el-select>
|
<el-form-item v-show="dataForm.targetType === 1" label="时间" prop="targetYear">
|
||||||
|
<el-date-picker clearable v-model="dataForm.showYear" value-format="yyyy" type="year" placeholder="开始时间">
|
||||||
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -44,59 +53,63 @@
|
|||||||
</small-title>
|
</small-title>
|
||||||
<el-row :gutter="24" style="padding: 0 32px;">
|
<el-row :gutter="24" style="padding: 0 32px;">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="芯片产量" prop="factoryId">
|
<el-form-item label="芯片产量" prop="chipYield">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片产量"></el-input>
|
<el-input-number v-model="dataForm.chipYield" :precision="0" controls-position="right" placeholder="请输入芯片产量" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="芯片良率" prop="factoryId">
|
<el-form-item label="芯片良率" prop="chipYieldRate">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片良率"></el-input>
|
<el-input-number v-model="dataForm.chipYieldRate" :precision="2" :max="100" controls-position="right" placeholder="请输入芯片良率" style="width: 100%" />
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="芯片BOM" prop="factoryId">
|
<el-form-item label="芯片BOM" prop="chipBom">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片BOM"></el-input>
|
<el-input-number v-model="dataForm.chipBom" :precision="2" controls-position="right" placeholder="请输入芯片BOM" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="芯片总功率" prop="factoryId">
|
<el-form-item label="芯片总功率" prop="chipTotalPower">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片总功率"></el-input>
|
<el-input-number v-model="dataForm.chipTotalPower" :precision="2" controls-position="right" placeholder="请输入芯片总功率" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="24" style="padding: 0 32px;">
|
<el-row :gutter="24" style="padding: 0 32px;">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="FTO投入量" prop="factoryId">
|
<el-form-item v-if="ftype === 0" label="FTO投入量" prop="ftoInput">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入FTO投入量"></el-input>
|
<el-input-number v-model="dataForm.ftoInput" :precision="0" controls-position="right" placeholder="请输入FTO投入量" style="width: 100%" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-else label="钼电极投入量" prop="molybdenumElectrodeInput">
|
||||||
|
<el-input-number v-model="dataForm.molybdenumElectrodeInput" :precision="0" controls-position="right" placeholder="请输入钼电极投入量" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="CSS稼动率" prop="factoryId">
|
<el-form-item v-if="ftype === 0" label="CSS稼动率" prop="chipCssMarriageRate">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入CSS稼动率"></el-input>
|
<el-input-number v-model="dataForm.chipCssMarriageRate" :precision="2" controls-position="right" placeholder="请输入CSS稼动率" style="width: 100%" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-else label="PID6稼动率" prop="chipCssMarriageRate">
|
||||||
|
<el-input-number v-model="dataForm.chipCssMarriageRate" :precision="2" controls-position="right" placeholder="请输入PID6稼动率" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="芯片段OEE" prop="factoryId">
|
<el-form-item label="芯片段OEE" prop="chipOee">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片段OEE"></el-input>
|
<el-input-number v-model="dataForm.chipOee" :precision="2" controls-position="right" placeholder="请输入芯片段OEE" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="芯片平均功率" prop="factoryId">
|
<el-form-item label="芯片平均功率" prop="chipAveragePower">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片平均功率"></el-input>
|
<el-input-number v-model="dataForm.chipAveragePower" :precision="2" controls-position="right" placeholder="请输入芯片平均功率" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="24" style="padding: 0 32px;">
|
<el-row :gutter="24" style="padding: 0 32px;">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="芯片人均产量" prop="factoryId">
|
<el-form-item label="芯片人均产量" prop="chipAnnualAverageProduction">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片人均产量"></el-input>
|
<el-input-number v-model="dataForm.chipAnnualAverageProduction" :precision="2" controls-position="right" placeholder="请输入芯片人均产量" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="芯片人均产量" prop="factoryId">
|
<el-form-item label="芯片产能利用率" prop="chipCapacityUtilizationRate">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片人均产量"></el-input>
|
<el-input-number v-model="dataForm.chipCapacityUtilizationRate" :precision="2" controls-position="right" placeholder="请输入芯片产能利用率" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -106,45 +119,45 @@
|
|||||||
</small-title>
|
</small-title>
|
||||||
<el-row :gutter="24" style="padding: 0 32px;">
|
<el-row :gutter="24" style="padding: 0 32px;">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="封装BOM" prop="factoryId">
|
<el-form-item label="封装BOM" prop="componentBom">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入封装BOM"></el-input>
|
<el-input-number v-model="dataForm.componentBom" :precision="2" controls-position="right" placeholder="请输入封装BOM" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="封装线OEE" prop="factoryId">
|
<el-form-item label="封装线OEE" prop="componentOee">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入封装线OEE"></el-input>
|
<el-input-number v-model="dataForm.componentOee" :precision="2" controls-position="right" placeholder="请输入封装线OEE" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="标准组件良率" prop="factoryId">
|
<el-form-item label="标准组件良率" prop="componentYieldRate">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入标准组件良率"></el-input>
|
<el-input-number v-model="dataForm.componentYieldRate" :precision="2" controls-position="right" placeholder="请输入标准组件良率" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="标准组件良率" prop="factoryId">
|
<el-form-item label="标准组件产量" prop="componentYield">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入标准组件良率"></el-input>
|
<el-input-number v-model="dataForm.componentYield" :precision="0" controls-position="right" placeholder="请输入标准组件产量" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="24" style="padding: 0 32px;">
|
<el-row :gutter="24" style="padding: 0 32px;">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="标准组件总功率" prop="factoryId">
|
<el-form-item label="标准组件总功率" prop="componentTotalPower">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入标准组件总功率"></el-input>
|
<el-input-number v-model="dataForm.componentTotalPower" :precision="2" controls-position="right" placeholder="请输入标准组件总功率" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="标准组件总功率" prop="factoryId">
|
<el-form-item label="封装产能利用率" prop="componentCapacityUtilizationRate">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入标准组件总功率"></el-input>
|
<el-input-number v-model="dataForm.componentCapacityUtilizationRate" :precision="2" controls-position="right" placeholder="请输入封装产能利用率" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="标准组件人均产量" prop="factoryId">
|
<el-form-item label="标准组件人均产量" prop="componentAnnualAverageProduction">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入标准组件人均产量"></el-input>
|
<el-input-number v-model="dataForm.componentAnnualAverageProduction" :precision="2" controls-position="right" placeholder="请输入标准组件人均产量" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="标准组件平均功率" prop="factoryId">
|
<el-form-item label="标准组件平均功率" prop="componentAveragePower">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入标准组件平均功率"></el-input>
|
<el-input-number v-model="dataForm.componentAveragePower" :precision="2" controls-position="right" placeholder="请输入标准组件平均功率" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -155,47 +168,47 @@
|
|||||||
</small-title>
|
</small-title>
|
||||||
<el-row :gutter="24" style="padding: 0 32px;">
|
<el-row :gutter="24" style="padding: 0 32px;">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="产品产量" prop="factoryId">
|
<el-form-item label="产品产量" prop="bipvProductOutput">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入产品产量"></el-input>
|
<el-input-number v-model="dataForm.bipvProductOutput" :precision="0" controls-position="right" placeholder="请输入产品产量" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="人均产量" prop="factoryId">
|
<el-form-item label="人均产量" prop="bipvAnnualAverageProduction">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入人均产量"></el-input>
|
<el-input-number v-model="dataForm.bipvAnnualAverageProduction" :precision="2" controls-position="right" placeholder="请输入人均产量" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="芯片使用量" prop="factoryId">
|
<el-form-item label="芯片使用量" prop="bipvChipUsage">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片使用量"></el-input>
|
<el-input-number v-model="dataForm.bipvChipUsage" :precision="0" controls-position="right" placeholder="请输入芯片使用量" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="芯片利用率" prop="factoryId">
|
<el-form-item label="芯片利用率" prop="bipvChipUtilizationRate">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片利用率"></el-input>
|
<el-input-number v-model="dataForm.bipvChipUtilizationRate" :precision="2" controls-position="right" placeholder="请输入芯片利用率" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="24" style="padding: 0 32px;">
|
<el-row :gutter="24" style="padding: 0 32px;">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="内部材料成本" prop="factoryId">
|
<el-form-item label="内部材料成本" prop="bipvInsideMaterialCost">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入内部材料成本"></el-input>
|
<el-input-number v-model="dataForm.bipvInsideMaterialCost" :precision="2" controls-position="right" placeholder="请输入内部材料成本" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="OEM及委外材料成本" prop="factoryId">
|
<el-form-item label="OEM及委外材料成本" prop="bipvOeeMaterialCost">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入OEM及委外材料成本"></el-input>
|
<el-input-number v-model="dataForm.bipvOeeMaterialCost" :precision="2" controls-position="right" placeholder="请输入OEM及委外材料成本" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="综合材料成本" prop="factoryId">
|
<el-form-item label="综合材料成本" prop="bipvComprehensiveMaterialCost">
|
||||||
<el-input v-model="dataForm.factoryId" placeholder="请输入综合材料成本"></el-input>
|
<el-input-number v-model="dataForm.bipvComprehensiveMaterialCost" :precision="2" controls-position="right" placeholder="请输入综合材料成本" style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<el-button @click="cancelForm">取 消</el-button>
|
<el-button @click="visible = false">取 消</el-button>
|
||||||
<el-button type="primary" @click="handleClose()">确 定</el-button>
|
<el-button type="primary" @click="handleClose()">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
@ -210,20 +223,25 @@
|
|||||||
// } from "@/api/base/qualityScrapLog";
|
// } from "@/api/base/qualityScrapLog";
|
||||||
// import { getList, } from "@/api/base/qualityScrapType";
|
// import { getList, } from "@/api/base/qualityScrapType";
|
||||||
import SmallTitle from './SmallTitle';
|
import SmallTitle from './SmallTitle';
|
||||||
|
import { createProduce, getProduceTargetDetail, updateProduceTarget } from '@/api/produceData';
|
||||||
|
import { factoryList, tyjxfactoryList, dhgfactoryList } from "@/utils/constants";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
SmallTitle,
|
SmallTitle,
|
||||||
},
|
},
|
||||||
// mixins: [basicAdd],
|
// mixins: [basicAdd],
|
||||||
|
props: {
|
||||||
|
ftype: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
urlOptions: {
|
factoryList,
|
||||||
isGetCode: false,
|
dhgfactoryList,
|
||||||
// codeURL: getCode,
|
tyjxfactoryList,
|
||||||
// createURL: createQualityScrapLog,
|
|
||||||
// updateURL: updateQualityScrapLog,
|
|
||||||
// infoURL: getQualityScrapLog,
|
|
||||||
},
|
|
||||||
lineList: [],
|
lineList: [],
|
||||||
typeList: [],
|
typeList: [],
|
||||||
workOrderList: [],
|
workOrderList: [],
|
||||||
@ -239,138 +257,166 @@ export default {
|
|||||||
name: '自动',
|
name: '自动',
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
factoryList:[],
|
// 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,
|
||||||
dataForm: {
|
dataForm: {
|
||||||
|
factoryType: 0,
|
||||||
id: undefined,
|
id: undefined,
|
||||||
logTime: undefined,
|
reportTime: undefined, // 月时间
|
||||||
source: 1,
|
factory: undefined,
|
||||||
detId: undefined,
|
targetType: undefined,
|
||||||
workOrderId: null,
|
targetYear: undefined,
|
||||||
teamId: undefined,
|
showYear: undefined,
|
||||||
num: undefined,
|
targetMonth: undefined,
|
||||||
lineId: undefined,
|
chipYield: undefined,
|
||||||
description: undefined,
|
chipYieldRate: undefined,
|
||||||
// description: undefined,
|
chipBom: undefined,
|
||||||
remark: undefined,
|
chipTotalPower: undefined,
|
||||||
|
ftoInput: undefined,
|
||||||
|
chipCssMarriageRate: undefined,
|
||||||
|
chipOee: undefined,
|
||||||
|
chipAveragePower: undefined,
|
||||||
|
chipAnnualAverageProduction: undefined,
|
||||||
|
chipCapacityUtilizationRate: undefined,
|
||||||
|
componentBom: undefined,
|
||||||
|
componentOee: undefined,
|
||||||
|
componentYieldRate: undefined,
|
||||||
|
componentYield: undefined,
|
||||||
|
componentTotalPower: undefined,
|
||||||
|
componentCapacityUtilizationRate: undefined,
|
||||||
|
componentAnnualAverageProduction: undefined,
|
||||||
|
componentAveragePower: undefined,
|
||||||
|
bipvProductOutput: undefined,
|
||||||
|
bipvAnnualAverageProduction: undefined,
|
||||||
|
bipvChipUsage: undefined,
|
||||||
|
bipvChipUtilizationRate: undefined,
|
||||||
|
bipvInsideMaterialCost: undefined,
|
||||||
|
bipvOeeMaterialCost: undefined,
|
||||||
|
bipvComprehensiveMaterialCost: undefined,
|
||||||
|
molybdenumElectrodeInput: undefined
|
||||||
},
|
},
|
||||||
// materialList: [],
|
// materialList: [],
|
||||||
dataRule: {
|
dataRule: {
|
||||||
// materialId: [{ required: true, message: "", trigger: "blur" }],
|
// materialId: [{ required: true, message: "", trigger: "blur" }],
|
||||||
workOrderId: [{ required: true, message: "工单号不能为空", trigger: "change" }],
|
// workOrderId: [{ required: true, message: "工单号不能为空", trigger: "change" }],
|
||||||
num: [{ required: true, message: "数量不能为空", trigger: "blur" }],
|
// num: [{ required: true, message: "数量不能为空", trigger: "blur" }],
|
||||||
detId: [{ required: true, message: "报废原因不能为空", trigger: "change" }],
|
// detId: [{ required: true, message: "报废原因不能为空", trigger: "change" }],
|
||||||
|
|
||||||
logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }],
|
// logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }],
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getDict()
|
|
||||||
console.log('我看看', this.dataForm)
|
|
||||||
// this.getCurrentTime()
|
// this.getCurrentTime()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
formClear() {
|
||||||
this.visible = true
|
if (this.$refs.dataForm !== undefined) {
|
||||||
|
this.$refs.dataForm.resetFields()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// getCurrentTime() {
|
clearTime() {
|
||||||
// // new Date().Format("yyyy-MM-dd HH:mm:ss")
|
this.dataForm.targetYear = undefined
|
||||||
// this.dataForm.logTime = new Date()
|
this.dataForm.targetMonth = undefined
|
||||||
// // this.dataForm.logTime = year + "-" + month + "-" + day;
|
},
|
||||||
// console.log(this.dataForm.logTime);
|
handleClose() {
|
||||||
// },
|
// 新增
|
||||||
async getDict() {
|
if (this.dataForm.targetType === 0) {
|
||||||
// // 物料列表
|
const timeArray = this.dataForm.reportTime.split('-')
|
||||||
// const res = await getList()
|
this.dataForm.targetYear = Number(timeArray[0])
|
||||||
// this.typeList = res.data
|
this.dataForm.targetMonth = Number(timeArray[1])
|
||||||
// getWorkOrderList().then((res) => {
|
}
|
||||||
// console.log(res);
|
if (this.dataForm.targetType === 1) {
|
||||||
// // console.log(response);
|
this.dataForm.targetYear = Number(this.dataForm.showYear)
|
||||||
// this.workOrderList = res.data.map((item) => {
|
}
|
||||||
// return {
|
// if (this.dataForm.factory === 5) {
|
||||||
// name: item.name,
|
// this.dataForm.factoryType = 1
|
||||||
// id: item.id
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// // console.log(this.formConfig[0].selectOptions);
|
|
||||||
// // this.listQuery.total = response.data.total;
|
|
||||||
// })
|
|
||||||
// getLineList().then((res) => {
|
|
||||||
// console.log(res);
|
|
||||||
// // console.log(response);
|
|
||||||
// this.lineList = res.data.map((item) => {
|
|
||||||
// return {
|
|
||||||
// name: item.name,
|
|
||||||
// id: item.id
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// // console.log(this.formConfig[0].selectOptions);
|
|
||||||
// // this.listQuery.total = response.data.total;
|
|
||||||
// })
|
|
||||||
// getDetList().then((res) => {
|
|
||||||
// console.log(res);
|
|
||||||
// // console.log(response);
|
|
||||||
// this.detList = res.data.map((item) => {
|
|
||||||
// return {
|
|
||||||
// name: item.content,
|
|
||||||
// id: item.id
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// // console.log(this.formConfig[0].selectOptions);
|
|
||||||
// // this.listQuery.total = response.data.total;
|
|
||||||
// })
|
|
||||||
// getTeamList().then((res) => {
|
|
||||||
// console.log(res);
|
|
||||||
// // console.log(response);
|
|
||||||
// this.teamList = res.data.map((item) => {
|
|
||||||
// return {
|
|
||||||
// name: item.name,
|
|
||||||
// id: item.id
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// // console.log(this.formConfig[0].selectOptions);
|
|
||||||
// // this.listQuery.total = response.data.total;
|
|
||||||
// })
|
|
||||||
// },
|
|
||||||
// async getWorksectionById(lineId) {
|
|
||||||
// if (lineId) {
|
|
||||||
// const { code, data } = await this.$axios({
|
|
||||||
// url: '/base/core-workshop-section/listByParentId',
|
|
||||||
// method: 'get',
|
|
||||||
// params: {
|
|
||||||
// id: lineId,
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
// if (code == 0) {
|
|
||||||
// console.log(data)
|
|
||||||
// this.sectionList = data.map((item) => {
|
|
||||||
// return {
|
|
||||||
// name: item.name,
|
|
||||||
// id: item.id,
|
|
||||||
// };
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// } else {
|
// } else {
|
||||||
// this.$axios({
|
// this.dataForm.factoryType = 0
|
||||||
// url: '/base/core-workshop-section/listAll',
|
|
||||||
// method: 'get',
|
|
||||||
// // params: {
|
|
||||||
// // id: lineId,
|
|
||||||
// // },
|
|
||||||
// }).then((res) => {
|
|
||||||
// // console.log(data)
|
|
||||||
// this.sectionList = res.data.map((item) => {
|
|
||||||
// return {
|
|
||||||
// name: item.name,
|
|
||||||
// id: item.id,
|
|
||||||
// };
|
|
||||||
// });
|
|
||||||
// })
|
|
||||||
// }
|
// }
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
// 修改
|
||||||
|
updateProduceTarget({
|
||||||
|
...this.dataForm,
|
||||||
|
showYear: undefined,
|
||||||
|
reportTime: undefined
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.$message.success('修改成功!')
|
||||||
|
this.visible = false
|
||||||
|
this.$emit('refreshDataList')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 新增
|
||||||
|
createProduce({
|
||||||
|
...this.dataForm,
|
||||||
|
showYear: undefined,
|
||||||
|
reportTime: undefined
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.$message.success('新增成功!')
|
||||||
|
this.visible = false
|
||||||
|
this.$emit('refreshDataList')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
init(id) {
|
||||||
|
this.dataForm.id = id || undefined
|
||||||
|
this.dataForm.factoryType = this.ftype
|
||||||
|
this.visible = true
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
getProduceTargetDetail(this.dataForm.id).then(res => {
|
||||||
|
this.dataForm = res.data
|
||||||
|
if (this.dataForm.targetType === 1) {
|
||||||
|
if (this.dataForm.targetYear) {
|
||||||
|
this.$set(this.dataForm, 'showYear', String(this.dataForm.targetYear))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.dataForm.targetType === 0) {
|
||||||
|
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))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@ -1,28 +1,28 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2023-11-06 15:15:30
|
* @Date: 2023-11-06 15:15:30
|
||||||
* @LastEditTime: 2024-04-17 16:40:01
|
* @LastEditTime: 2024-05-22 15:29:18
|
||||||
* @LastEditors: zhp
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<el-drawer class="drawer" :visible.sync="visible" size="50%">
|
<el-drawer class="drawer" :visible.sync="visible" size="58%" @closed="$emit('destroy')">
|
||||||
<small-title slot="title" :no-padding="true">
|
<small-title slot="title" :no-padding="true">
|
||||||
{{ '碲化镉工厂生产数据详情' }}
|
{{ ftype === 0 ? '碲化镉工厂生产数据详情' : '铜铟镓硒工厂生产数据详情' }}
|
||||||
</small-title>
|
</small-title>
|
||||||
<div class="detailBox">
|
<div class="detailBox">
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<p class="title">工厂名称</p>
|
<p class="title">工厂名称</p>
|
||||||
<p class="text">{{ }}</p>
|
<p class="text">{{ factoryList[dataForm.factory] }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<p class="title">时间维度</p>
|
<p class="title">时间维度</p>
|
||||||
<p class="text">{{ dataForm.code }}</p>
|
<p class="text">{{ dataForm.targetType === 0 ? '月' : '年' }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<p class="title">时间</p>
|
<p class="title">时间</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<p class="text">{{ dataForm.targetType === 1 ? dataForm.targetYear + '年' : dataForm.targetYear + '年' + dataForm.targetMonth + '月'}}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-divider></el-divider>
|
<el-divider></el-divider>
|
||||||
@ -32,47 +32,47 @@
|
|||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">芯片产量</p>
|
<p class="title">芯片产量</p>
|
||||||
<p class="text">{{ }}</p>
|
<p class="text">{{ dataForm.chipYield }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">芯片良率</p>
|
<p class="title">芯片良率</p>
|
||||||
<p class="text">{{ dataForm.code }}</p>
|
<p class="text">{{ dataForm.chipYieldRate }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">芯片良率</p>
|
<p class="title">芯片BOM</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<p class="text">{{ dataForm.chipBom }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">芯片总功率</p>
|
<p class="title">芯片总功率</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<p class="text">{{ dataForm.chipTotalPower }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">FTO投入量</p>
|
<p class="title">{{ ftype === 0 ? 'FTO投入量' : '钼电极投入量' }}</p>
|
||||||
<p class="text">{{ }}</p>
|
<p class="text">{{ ftype === 0 ? dataForm.ftoInput : dataForm.molybdenumElectrodeInput }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">CSS稼动率</p>
|
<p class="title">{{ ftype === 0 ? 'CSS稼动率' : 'PID6稼动率' }}</p>
|
||||||
<p class="text">{{ dataForm.code }}</p>
|
<p class="text">{{ dataForm.chipCssMarriageRate }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">芯片段OEE</p>
|
<p class="title">芯片段OEE</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<p class="text">{{ dataForm.chipOee }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">芯片平均功率</p>
|
<p class="title">芯片平均功率</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<p class="text">{{ dataForm.chipAveragePower }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">芯片人均产量</p>
|
<p class="title">芯片人均产量</p>
|
||||||
<p class="text">{{ }}</p>
|
<p class="text">{{ dataForm.chipAnnualAverageProduction }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">芯片产能利用率</p>
|
<p class="title">芯片产能利用率</p>
|
||||||
<p class="text">{{ dataForm.code }}</p>
|
<p class="text">{{ dataForm.chipCapacityUtilizationRate }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
||||||
@ -81,37 +81,37 @@
|
|||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">封装BOM</p>
|
<p class="title">封装BOM</p>
|
||||||
<p class="text">{{ }}</p>
|
<p class="text">{{ dataForm.componentBom }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">封装线OEE</p>
|
<p class="title">封装线OEE</p>
|
||||||
<p class="text">{{ dataForm.code }}</p>
|
<p class="text">{{ dataForm.componentOee }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">标准组件良率</p>
|
<p class="title">标准组件良率</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<p class="text">{{ dataForm.componentYieldRate }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">标准组件产量</p>
|
<p class="title">标准组件产量</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<p class="text">{{ dataForm.componentYield }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">标准组件总功率</p>
|
<p class="title">标准组件总功率</p>
|
||||||
<p class="text">{{ }}</p>
|
<p class="text">{{ dataForm.componentTotalPower }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">封装产能利用率</p>
|
<p class="title">封装产能利用率</p>
|
||||||
<p class="text">{{ dataForm.code }}</p>
|
<p class="text">{{ dataForm.componentCapacityUtilizationRate }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">标准组件人均产量</p>
|
<p class="title">标准组件人均产量</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<p class="text">{{ dataForm.componentAnnualAverageProduction }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">标准组件人均产量</p>
|
<p class="title">标准组件平均功率</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<p class="text">{{ dataForm.componentAveragePower }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
||||||
@ -120,33 +120,33 @@
|
|||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">产品产量</p>
|
<p class="title">产品产量</p>
|
||||||
<p class="text">{{ }}</p>
|
<p class="text">{{ dataForm.bipvProductOutput }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">人均产量</p>
|
<p class="title">人均产量</p>
|
||||||
<p class="text">{{ dataForm.code }}</p>
|
<p class="text">{{ dataForm.bipvAnnualAverageProduction }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">芯片使用量</p>
|
<p class="title">芯片使用量</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<p class="text">{{ dataForm.bipvChipUsage }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">芯片使用量</p>
|
<p class="title">芯片利用率</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<p class="text">{{ dataForm.bipvChipUtilizationRate }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">内部材料成本</p>
|
<p class="title">内部材料成本</p>
|
||||||
<p class="text">{{ }}</p>
|
<p class="text">{{ dataForm.bipvInsideMaterialCost }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">内部材料成本</p>
|
<p class="title">OEM及委外材料成本</p>
|
||||||
<p class="text">{{ dataForm.code }}</p>
|
<p class="text">{{ dataForm.bipvOeeMaterialCost }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">内部材料成本</p>
|
<p class="title">综合材料成本</p>
|
||||||
<p class="text">{{ dataForm.productName }}</p>
|
<p class="text">{{ dataForm.bipvComprehensiveMaterialCost }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@ -155,20 +155,24 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import basicAdd from './basic-add';
|
import { getProduceTargetDetail } from '@/api/produceData';
|
||||||
// import {
|
|
||||||
// createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList,
|
|
||||||
// getTeamList, getDetList, getLineList
|
|
||||||
// } from "@/api/base/qualityScrapLog";
|
|
||||||
// import { getList, } from "@/api/base/qualityScrapType";
|
|
||||||
import SmallTitle from './SmallTitle';
|
import SmallTitle from './SmallTitle';
|
||||||
|
import { factoryList } from "@/utils/constants";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
SmallTitle,
|
SmallTitle,
|
||||||
},
|
},
|
||||||
|
props: {
|
||||||
|
ftype: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
// mixins: [basicAdd],
|
// mixins: [basicAdd],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
factoryList,
|
||||||
urlOptions: {
|
urlOptions: {
|
||||||
isGetCode: false,
|
isGetCode: false,
|
||||||
// codeURL: getCode,
|
// codeURL: getCode,
|
||||||
@ -223,8 +227,14 @@ export default {
|
|||||||
// this.getCurrentTime()
|
// this.getCurrentTime()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init(id) {
|
||||||
this.visible = true
|
this.visible = true
|
||||||
|
console.log('打印', id)
|
||||||
|
if (id) {
|
||||||
|
getProduceTargetDetail(id).then(res => {
|
||||||
|
this.dataForm = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// getCurrentTime() {
|
// getCurrentTime() {
|
||||||
// // new Date().Format("yyyy-MM-dd HH:mm:ss")
|
// // new Date().Format("yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ -1,18 +1,30 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2024-04-15 10:49:13
|
* @Date: 2024-04-15 10:49:13
|
||||||
* @LastEditTime: 2024-04-17 16:37:35
|
* @LastEditTime: 2024-05-22 16:22:57
|
||||||
* @LastEditors: zhp
|
* @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)">
|
||||||
<div class="app-container" style="padding: 16px 24px 0;height: auto; flex-grow: 1;">
|
<ButtonNav :menus="['碲化镉工厂', '铜铟镓硒工厂']" :button-mode="true" @change="changeFactory" style="margin-top: -10px">
|
||||||
<ButtonNav :menus="['碲化镉工厂', '铜铟镓硒工厂']" :button-mode="true" @change="currentMenu = $event">
|
|
||||||
</ButtonNav>
|
</ButtonNav>
|
||||||
|
<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="reportTime">
|
<el-form-item v-if="facType === 0" label="工厂名称" prop="factorys">
|
||||||
<el-select clearable v-model="timeSelect" placeholder="请选择">
|
<el-select size="small" v-model="listQuery.factorys" placeholder="请选择工厂名称" multiple clearable>
|
||||||
|
<el-option v-for="item in dhgfactoryList" :key="item.id" :label="item.name" :value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-else label="工厂名称" prop="factorys">
|
||||||
|
<el-select size="small" v-model="listQuery.factorys" placeholder="请选择工厂名称" multiple clearable>
|
||||||
|
<el-option v-for="item in tyjxfactoryList" :key="item.id" :label="item.name" :value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="时间维度" prop="date">
|
||||||
|
<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>
|
||||||
@ -34,26 +46,20 @@
|
|||||||
{{ date1 }} 至 {{ date2 }},共 {{ weekNum }} 周
|
{{ date1 }} 至 {{ date2 }},共 {{ weekNum }} 周
|
||||||
</span>
|
</span>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<el-form-item v-show="timeSelect === 'month'" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.date !== 4" label="时间值" prop="reportTime">
|
||||||
<el-date-picker v-model="listQuery.reportTime" type="monthrange" 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="timeSelect === 'year'" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.date === 4" label="时间值" prop="reportTime">
|
||||||
<el-date-picker clearable v-model="listQuery.reportTime[0]" 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 clearable v-model="listQuery.reportTime[1]" 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>
|
||||||
<el-form-item label="工厂名称" prop="factoryId">
|
|
||||||
<el-select v-model="listQuery.factoryId" placeholder="请选择工厂名称" multiple="true" clearable>
|
|
||||||
<el-option v-for="item in factoryList" :key="item.id" :label="item.name" :value="item.id">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- <el-form-item label="玻璃类型" prop="type">
|
<!-- <el-form-item label="玻璃类型" prop="type">
|
||||||
<el-select v-model="listQuery.type" placeholder="请选择玻璃类型">
|
<el-select 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">
|
||||||
@ -68,28 +74,62 @@
|
|||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" size="small" @click="getDataList">查询</el-button>
|
<el-button type="primary" size="small" @click="getDataList">查询</el-button>
|
||||||
|
<el-divider direction="vertical"></el-divider>
|
||||||
|
<el-button type="primary" size="small" plain @click="handleImport">导入</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-button type="success" size="small" plain @click="addFactory">新增</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<!-- <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> -->
|
<!-- <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> -->
|
||||||
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
|
<base-table :table-props="tableProps" :page="listQuery.current" :limit="listQuery.size"
|
||||||
:table-data="tableData">
|
:table-data="tableData">
|
||||||
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right"
|
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right"
|
||||||
:method-list="tableBtn" @clickBtn="handleClick" />
|
:method-list="tableBtn" @clickBtn="handleClick" />
|
||||||
</base-table>
|
</base-table>
|
||||||
<detail-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" @refreshDataList="successSubmit" />
|
<pagination
|
||||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="successSubmit" />
|
:limit.sync="listQuery.size"
|
||||||
|
:page.sync="listQuery.current"
|
||||||
<!-- <el-row :gutter="24"> -->
|
:total="listQuery.total"
|
||||||
<!-- <el-col :span="12" v-for="item in dataList" :key="item.id"> -->
|
@pagination="getDataList"
|
||||||
<!-- <line-chart class="yearChart" ref="lineChart" style="height: 40vh;width: 100%"></line-chart> -->
|
/>
|
||||||
<!-- </el-col> -->
|
<detail-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" :ftype="facType" @destroy="detailOrUpdateVisible = false" />
|
||||||
<!-- <el-col :span="12">
|
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :ftype="facType" @refreshDataList="getDataList" @destroy="addOrUpdateVisible = false" />
|
||||||
<line-chart :id=" 'second' " class="yearChart" ref="lineChart" style="height: 40vh;width: 100%"></line-chart>
|
|
||||||
</el-col> -->
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 用户导入对话框 -->
|
||||||
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||||
|
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls"
|
||||||
|
:headers="upload.headers"
|
||||||
|
:action="upload.url"
|
||||||
|
:file-list="fileList"
|
||||||
|
:disabled="upload.isUploading"
|
||||||
|
:on-success="handleFileSuccess"
|
||||||
|
:on-progress="handleFileUploadProgress"
|
||||||
|
:auto-upload="false" drag>
|
||||||
|
<i class="el-icon-upload"></i>
|
||||||
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||||
|
<div class="el-upload__tip text-center" slot="tip">
|
||||||
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||||
|
</div>
|
||||||
|
</el-upload>
|
||||||
|
<!-- <el-upload
|
||||||
|
ref="upload"
|
||||||
|
class="upload-demo"
|
||||||
|
action="#"
|
||||||
|
:limit="1"
|
||||||
|
:file-list="fileList"
|
||||||
|
:auto-upload="false"
|
||||||
|
:http-request="handleFileSuccess"> -->
|
||||||
|
<!-- <el-button size="small" type="primary">点击上传</el-button>
|
||||||
|
<div slot="tip" class="el-upload__tip">只能上传.xlsx, .xls文件,且不超过500kb</div>
|
||||||
|
</el-upload> -->
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||||
|
<el-button @click="upload.open = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<!-- <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
|
||||||
@ -101,8 +141,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import { parseTime } from '../../core/mixins/code-filter';
|
import { parseTime } from '@/utils/ruoyi';
|
||||||
// import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
|
import { prodTargetDiPage, prodTargetToPage, exportDiTargetExcel, exportToTargetExcel, delTarget, importToTarget, importDiTarget } 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'
|
||||||
@ -110,28 +150,53 @@ import ButtonNav from '@/components/ButtonNav'
|
|||||||
import basicPage from '@/mixins/basic-page'
|
import basicPage from '@/mixins/basic-page'
|
||||||
import detailOrUpdate from './detail-or-updata';
|
import detailOrUpdate from './detail-or-updata';
|
||||||
import addOrUpdate from './add-or-updata';
|
import addOrUpdate from './add-or-updata';
|
||||||
|
import { factoryList, dhgfactoryList, tyjxfactoryList } from "@/utils/constants";
|
||||||
|
import {getBaseHeader} from "@/utils/request";
|
||||||
|
|
||||||
|
|
||||||
// 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, ButtonNav, detailOrUpdate,addOrUpdate },
|
components: { lineChart, ButtonNav, detailOrUpdate, addOrUpdate },
|
||||||
mixins: [basicPage],
|
mixins: [basicPage],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
factoryList,
|
||||||
|
dhgfactoryList,
|
||||||
|
tyjxfactoryList,
|
||||||
|
currentMenu: '碲化镉工厂',
|
||||||
|
fileList: [],
|
||||||
|
start: undefined,
|
||||||
|
end: undefined,
|
||||||
listQuery: {
|
listQuery: {
|
||||||
pageSize: 10,
|
size: 10,
|
||||||
pageNo: 1,
|
current: 1,
|
||||||
factoryId: null,
|
factorys: null,
|
||||||
total: 0,
|
total: 0,
|
||||||
type: null,
|
date: undefined,
|
||||||
// reportType: 2,
|
beginTime: undefined,
|
||||||
|
endTime: undefined,
|
||||||
reportTime: []
|
reportTime: []
|
||||||
},
|
},
|
||||||
detailOrUpdateVisible: false,
|
detailOrUpdateVisible: false,
|
||||||
addOrUpdateVisible:false,
|
addOrUpdateVisible:false,
|
||||||
date1: undefined,
|
date1: undefined,
|
||||||
date2: undefined,
|
date2: undefined,
|
||||||
|
// 用户导入参数
|
||||||
|
upload: {
|
||||||
|
// 是否显示弹出层(用户导入)
|
||||||
|
open: false,
|
||||||
|
// 弹出层标题(用户导入)
|
||||||
|
title: "导入",
|
||||||
|
// 是否禁用上传
|
||||||
|
isUploading: false,
|
||||||
|
// 是否更新已经存在的用户数据
|
||||||
|
// updateSupport: 0,
|
||||||
|
// 设置上传的请求头部
|
||||||
|
headers: getBaseHeader(),
|
||||||
|
// 上传的地址
|
||||||
|
url: process.env.VUE_APP_BASE_API + '/admin-api/ip/prod-target/di-target-import-excel'
|
||||||
|
},
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
{
|
{
|
||||||
type: 'detail',
|
type: 'detail',
|
||||||
@ -144,7 +209,7 @@ export default {
|
|||||||
{
|
{
|
||||||
type: 'delete',
|
type: 'delete',
|
||||||
btnName: '删除',
|
btnName: '删除',
|
||||||
},
|
}
|
||||||
].filter((v) => v),
|
].filter((v) => v),
|
||||||
typeList: [
|
typeList: [
|
||||||
{
|
{
|
||||||
@ -159,27 +224,6 @@ export default {
|
|||||||
name: 'BIPV产品',
|
name: 'BIPV产品',
|
||||||
id: 2,
|
id: 2,
|
||||||
},
|
},
|
||||||
],
|
|
||||||
// weekNum: undefined,
|
|
||||||
dataList: [
|
|
||||||
{
|
|
||||||
id:'first',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'second',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'third',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'fourth',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'fifth',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'sixth',
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
urlOptions: {
|
urlOptions: {
|
||||||
// getDataListURL: getGlassPage,
|
// getDataListURL: getGlassPage,
|
||||||
@ -270,135 +314,220 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
timeList: [
|
timeList: [
|
||||||
// {
|
|
||||||
// value: 'day',
|
|
||||||
// label: '日'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// value: 'week',
|
|
||||||
// label: '周'
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
value: 'month',
|
value: 3,
|
||||||
label:'月'
|
label:'月'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'year',
|
value: 4,
|
||||||
label: '年'
|
label: '年'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
factoryList: [
|
|
||||||
{
|
|
||||||
name: '测试',
|
|
||||||
id:1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '测试2',
|
|
||||||
id: 2
|
|
||||||
}
|
|
||||||
],
|
|
||||||
tableProps: [
|
tableProps: [
|
||||||
// {
|
|
||||||
// prop: 'createTime',
|
|
||||||
// label: '添加时间',
|
|
||||||
// fixed: true,
|
|
||||||
// width: 180,
|
|
||||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
|
||||||
// },
|
|
||||||
|
|
||||||
{
|
{
|
||||||
prop: 'nickName',
|
prop: 'factory',
|
||||||
label: '工厂名称',
|
label: '工厂名称',
|
||||||
|
filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'userName',
|
prop: 'tagertTime',
|
||||||
label: '目标时间',
|
label: '目标时间',
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'type',
|
prop: 'createTime',
|
||||||
label: '提交时间',
|
label: '提交时间',
|
||||||
|
filter: parseTime,
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'inNum',
|
prop: 'ftoInput',
|
||||||
label: '钼电极投入量(片)',
|
label: 'FTO投入量(片)',
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'putNum',
|
prop: 'chipYield',
|
||||||
label: '芯片产量(片)',
|
label: '芯片产量(片)',
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'goodNum',
|
prop: 'chipAveragePower',
|
||||||
label: '芯片平均功率(W)',
|
label: '芯片平均功率(W)',
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'goodYelid',
|
prop: 'chipYieldRate',
|
||||||
label: '芯片良率(%)',
|
label: '芯片良率(%)',
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'goodYelid',
|
prop: 'chipTotalPower',
|
||||||
label: '芯片总功率(KW)',
|
label: '芯片总功率(KW)',
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'goodYelid',
|
prop: 'chipCssMarriageRate',
|
||||||
label: 'PID6稼动率(%)',
|
label: 'CSS稼动率(%)',
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'goodYelid',
|
prop: 'chipOee',
|
||||||
label: '芯片段OEE(%)',
|
label: '芯片段OEE(%)',
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'goodYelid',
|
prop: 'chipCapacityUtilizationRate',
|
||||||
label: '芯片产能利用率(%)',
|
label: '芯片产能利用率(%)',
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'goodYelid',
|
prop: 'chipAnnualAverageProduction',
|
||||||
label: '芯片人均产量(片/人)',
|
label: '芯片人均产量(片/人)',
|
||||||
|
minWidth: 180,
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'goodYelid',
|
prop: 'chipBom',
|
||||||
label: '芯片BOM',
|
label: '芯片BOM',
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
timeSelect:'month',
|
// timeSelect:'month',
|
||||||
startTimeStamp:null, //开始时间
|
startTimeStamp:null, //开始时间
|
||||||
endTimeStamp:null, //结束时间
|
endTimeStamp:null, //结束时间
|
||||||
// date:'凯盛玻璃控股成员企业2024生产数据',
|
// date:'凯盛玻璃控股成员企业2024生产数据',
|
||||||
// reportTime: '',
|
// reportTime: '',
|
||||||
startTimeStamp: '',
|
startTimeStamp: '',
|
||||||
endTimeStamp: '',
|
endTimeStamp: '',
|
||||||
tableData: [
|
tableData: [],
|
||||||
{
|
facType: 0
|
||||||
userName: 'userName',
|
|
||||||
nickName: '用户名',
|
|
||||||
datas:'111111'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
userName: 'userName',
|
|
||||||
nickName: '用户名',
|
|
||||||
datas: '111111'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
userName: 'userName',
|
|
||||||
nickName: '用户名',
|
|
||||||
datas: '111111'
|
|
||||||
// subcomponent: row
|
|
||||||
}
|
|
||||||
],
|
|
||||||
// proLineList: [],
|
// proLineList: [],
|
||||||
// all: {}
|
// all: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
// computed: {
|
||||||
weekNum() {
|
// weekNum() {
|
||||||
return Math.round((this.listQuery.reportTime[1] - this.listQuery.reportTime[0]) / (24 * 60 * 60 * 1000 * 7)) + 1
|
// return Math.round((this.listQuery.reportTime[1] - this.listQuery.reportTime[0]) / (24 * 60 * 60 * 1000 * 7)) + 1
|
||||||
},
|
// },
|
||||||
|
// },
|
||||||
|
watch: {
|
||||||
|
facType(value) {
|
||||||
|
if (value === 0) {
|
||||||
|
this.$set(this.tableProps, 3, {
|
||||||
|
prop: 'ftoInput',
|
||||||
|
label: 'FTO投入量(片)',
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true
|
||||||
|
})
|
||||||
|
this.upload.url = process.env.VUE_APP_BASE_API + '/admin-api/ip/prod-target/di-target-import-excel'
|
||||||
|
} else {
|
||||||
|
this.$set(this.tableProps, 3, {
|
||||||
|
prop: 'molybdenumElectrodeInput',
|
||||||
|
label: '钼电极投入量(片)',
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true
|
||||||
|
})
|
||||||
|
this.upload.url = process.env.VUE_APP_BASE_API + '/admin-api/ip/prod-target/to-target-import-excel'
|
||||||
|
}
|
||||||
|
console.log(112, this.tableProps)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getDict()
|
// this.getDict()
|
||||||
// this.getCurrentYearFirst()
|
// this.getCurrentYearFirst()
|
||||||
// this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleImport() {
|
||||||
|
this.upload.title = "生产目标导入";
|
||||||
|
this.upload.open = true;
|
||||||
|
this.fileList = []
|
||||||
|
},
|
||||||
|
// 文件上传中处理
|
||||||
|
handleFileUploadProgress(event, file, fileList) {
|
||||||
|
this.upload.isUploading = true;
|
||||||
|
},
|
||||||
|
// 文件上传成功处理
|
||||||
|
// handleFileSuccess(param, type) {
|
||||||
|
// console.log('带的', param.file)
|
||||||
|
// const formData = new FormData()
|
||||||
|
// formData.append('multipartFile', param.file)
|
||||||
|
// console.log('送送', param)
|
||||||
|
// importDiTarget(formData).then(res => {
|
||||||
|
// console.log(res)
|
||||||
|
// if (res.code !== 0) {
|
||||||
|
// this.$modal.msgError(response.msg)
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// this.upload.open = false;
|
||||||
|
// this.upload.isUploading = false;
|
||||||
|
// this.$refs.upload.clearFiles();
|
||||||
|
// }).catch(() => {
|
||||||
|
// this.upload.open = false
|
||||||
|
// this.upload.isUploading = false
|
||||||
|
// })
|
||||||
|
// // 拼接提示语
|
||||||
|
// // let data = response.data;
|
||||||
|
// // let text = '创建成功数量:' + data.createUsernames.length;
|
||||||
|
// // for (const username of data.createUsernames) {
|
||||||
|
// // text += '<br /> ' + username;
|
||||||
|
// // }
|
||||||
|
// // text += '<br />更新成功数量:' + data.updateUsernames.length;
|
||||||
|
// // for (const username of data.updateUsernames) {
|
||||||
|
// // text += '<br /> ' + username;
|
||||||
|
// // }
|
||||||
|
// // text += '<br />更新失败数量:' + Object.keys(data.failureUsernames).length;
|
||||||
|
// // for (const username in data.failureUsernames) {
|
||||||
|
// // text += '<br /> ' + username + ':' + data.failureUsernames[username];
|
||||||
|
// // }
|
||||||
|
// this.$message.success('导入成功!');
|
||||||
|
// this.getDataList();
|
||||||
|
// },
|
||||||
|
// 文件上传成功处理
|
||||||
|
handleFileSuccess(response, file, fileList) {
|
||||||
|
if (response.code !== 0) {
|
||||||
|
this.$modal.msgError(response.msg)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.upload.open = false;
|
||||||
|
this.upload.isUploading = false;
|
||||||
|
this.$refs.upload.clearFiles();
|
||||||
|
this.$message.success('导入成功!')
|
||||||
|
this.getDataList()
|
||||||
|
},
|
||||||
|
// 提交上传文件
|
||||||
|
submitFileForm() {
|
||||||
|
this.$refs.upload.submit();
|
||||||
|
},
|
||||||
|
addFactory() {
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
changeFactory($event) {
|
||||||
|
this.currentMenu = $event
|
||||||
|
this.facType = this.currentMenu === '碲化镉工厂' ? 0 : 1
|
||||||
|
// if (this.facType === 0) {
|
||||||
|
// this.upload.url = process.env.VUE_APP_BASE_API + '/admin-api/ip/prod-target/di-target-import-excel'
|
||||||
|
// } else {
|
||||||
|
// this.upload.url = process.env.VUE_APP_BASE_API + '/admin-api/ip/prod-target/to-target-import-excel'
|
||||||
|
// }
|
||||||
|
this.getDataList()
|
||||||
|
},
|
||||||
handleClick(val) {
|
handleClick(val) {
|
||||||
if (val.type === "edit") {
|
if (val.type === "edit") {
|
||||||
this.addOrUpdateVisible = true;
|
this.addOrUpdateVisible = true;
|
||||||
@ -407,11 +536,33 @@ export default {
|
|||||||
this.$refs.addOrUpdate.init(val.data.id);
|
this.$refs.addOrUpdate.init(val.data.id);
|
||||||
});
|
});
|
||||||
} else if (val.type === "delete") {
|
} else if (val.type === "delete") {
|
||||||
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
|
console.log('啊啊', val)
|
||||||
|
this.deleteHandle(val.data.id, val.data.factory, val.data._pageIndex)
|
||||||
} else {
|
} else {
|
||||||
this.otherMethods(val)
|
this.otherMethods(val)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 删除
|
||||||
|
deleteHandle(id, name, index) {
|
||||||
|
this.$confirm('是否确认删除工厂名称为' + factoryList[name] + '的数据项?', "系统提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
delTarget(id).then(({ data }) => {
|
||||||
|
this.$message({
|
||||||
|
message: "操作成功",
|
||||||
|
type: "success",
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => { });
|
||||||
|
},
|
||||||
otherMethods(val) {
|
otherMethods(val) {
|
||||||
this.detailOrUpdateVisible = true;
|
this.detailOrUpdateVisible = true;
|
||||||
this.addOrEditTitle = "详情";
|
this.addOrEditTitle = "详情";
|
||||||
@ -423,133 +574,34 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
getYear(e) {
|
getYear(e) {
|
||||||
if (this.listQuery.reportTime[0] && e - this.listQuery.reportTime[0] > 10) {
|
if (this.end && e - this.start > 10 * 365*24*60*60*1000) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '年份起止时间不能超过十年',
|
message: '年份起止时间不能超过十年',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
});
|
});
|
||||||
// console.log();
|
// console.log();
|
||||||
|
} else {
|
||||||
|
if (this.end < this.start) {
|
||||||
|
this.$message({
|
||||||
|
message: '结束年份不能小于开始年份',
|
||||||
|
type: 'warning'
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// console.log(e);
|
// console.log(e);
|
||||||
},
|
},
|
||||||
onValueChange(picker, k) { // 选中近k周后触发的操作
|
changeTime() {
|
||||||
if (this.listQuery.reportTime[0] && this.listQuery.reportTime[1]) {
|
|
||||||
console.log(this.listQuery.reportTime[0].getTime() - 24 * 60 * 60 * 1000)
|
|
||||||
this.date1 = moment(this.listQuery.reportTime[0].getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
|
||||||
// this.onValueChange() // 这里为我们希望value改变时触发的方法
|
|
||||||
this.date2 = moment(this.listQuery.reportTime[1].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'
|
|
||||||
});
|
|
||||||
// this.onValueChange()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
changeDayTime() {
|
|
||||||
if (this.listQuery.reportTime) {
|
if (this.listQuery.reportTime) {
|
||||||
// this.createStartDate = moment(new Date(this.listQuery.reportTime[0]), 'yyyy-MM-dd hh:mm:ss');
|
const numDays = this.listQuery.reportTime[1] - this.listQuery.reportTime[0]
|
||||||
// this.createEndDate = moment(new Date(this.listQuery.reportTime[1]), 'yyyy-MM-dd hh:mm:ss');
|
if (numDays > 2*365*24*60*60*1000) {
|
||||||
console.log(this.listQuery.reportTime[1])
|
|
||||||
const numDays = (new Date(this.listQuery.reportTime[1]).getTime() - new Date(this.listQuery.reportTime[0]).getTime()) / (24 * 3600 * 1000); if (numDays > 30) {
|
|
||||||
this.$message({
|
|
||||||
message: '时间范围不能超过30天',
|
|
||||||
type: 'warning'
|
|
||||||
});
|
|
||||||
this.listQuery.reportTime = [];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
changeTime(value) {
|
|
||||||
if (this.listQuery.reportTime) {
|
|
||||||
const timeStamp = this.listQuery.reportTime[1].getMonth(); //标准时间转为时间戳,毫秒级别
|
|
||||||
const fullyear = this.listQuery.reportTime[1].getFullYear()
|
|
||||||
let days = 0
|
|
||||||
switch (timeStamp) {
|
|
||||||
case 0:
|
|
||||||
case 2:
|
|
||||||
case 4:
|
|
||||||
case 6:
|
|
||||||
case 7:
|
|
||||||
case 9:
|
|
||||||
case 11:
|
|
||||||
days = 31
|
|
||||||
break
|
|
||||||
case 3:
|
|
||||||
case 4:
|
|
||||||
case 8:
|
|
||||||
case 10:
|
|
||||||
days = 30
|
|
||||||
break
|
|
||||||
case 1:
|
|
||||||
if ((fullyear % 400 === 0) || (fullyear % 4 === 0 && fullyear % 100 !== 0)) {
|
|
||||||
days = 29
|
|
||||||
} else {
|
|
||||||
days = 28
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
let startTime = moment(new Date(this.listQuery.reportTime[0]).setDate(1, 0, 0, 0)).format('YYYY-MM-DD HH:mm:ss')
|
|
||||||
// this.startTimeStamp = this.timeFun(new Date(fullyear, timeStamp, 1, 7, 0, 1).getTime()); //开始时间
|
|
||||||
let endTime = this.timeFun(new Date(fullyear, timeStamp, days).getTime()) + ' 23:59:59'; //结束时间
|
|
||||||
// console.log(endTimeStamp);
|
|
||||||
// let endTime = moment(this.listQuery.reportTime[1]).month(monthNum - 1).date(1).endOf("month").format("YYYY-MM-DD");
|
|
||||||
// console.log(endTime);
|
|
||||||
// console.log(moment(new Date(this.listQuery.reportTime[1]).setDate(31, 23, 59, 59)).format('YYYY-MM-DD HH:mm:ss'))
|
|
||||||
// console.log(moment(new Date(this.listQuery.reportTime[1]).getTime()).format('YYYY-MM-DD HH:mm:ss'))
|
|
||||||
|
|
||||||
// this.createStartDate = moment(new Date(this.listQuery.reportTime[0]), 'yyyy-MM-dd hh:mm:ss');
|
|
||||||
// this.createEndDate = moment(new Date(this.listQuery.reportTime[1]), 'yyyy-MM-dd hh:mm:ss');
|
|
||||||
const numDays = (new Date(endTime).getTime() - new Date(startTime).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 = [];
|
||||||
} else {
|
|
||||||
this.listQuery.reportTime[0] = startTime
|
|
||||||
this.listQuery.reportTime[1] = endTime
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
console.log(this.listQuery.reportTime[0])
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// handleTime() {
|
|
||||||
// this.$forceUpdate()
|
|
||||||
// // this.$nextTick(() => [
|
|
||||||
|
|
||||||
// // ])
|
|
||||||
// },
|
|
||||||
// getCurrentYearFirst() {
|
|
||||||
// let date = new Date();
|
|
||||||
// date.setDate(1);
|
|
||||||
// date.setMonth(0);
|
|
||||||
// this.reportTime = date;
|
|
||||||
// this.startTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 0, 1, 7, 0, 1).getTime()); //开始时间
|
|
||||||
// this.endTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 11, 31, 7, 0, 0).getTime()); //结束时间
|
|
||||||
// this.listQuery.reportTime[0] = parseTime(new Date(new Date().getFullYear(), 0, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
|
||||||
// this.listQuery.reportTime[1] = parseTime(new Date(new Date().getFullYear(), 11, 31, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 100
|
|
||||||
// },
|
|
||||||
// changeTime(val) {
|
|
||||||
// if (val) {
|
|
||||||
// // let timeStamp = val.getTime(); //标准时间转为时间戳,毫秒级别
|
|
||||||
// // this.endTimeStamp = this.timeFun(new Date(val.getFullYear(), 11, 31, 7, 0, 0).getTime()); //开始时间
|
|
||||||
// // this.startTimeStamp = this.timeFun(new Date(val.getFullYear(), 0, 1, 7, 0, 1).getTime()); //结束时间
|
|
||||||
// // this.listQuery.reportTime[0] = parseTime(new Date(val.getFullYear(), 0, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
|
||||||
// // this.listQuery.reportTime[1] = parseTime(new Date(val.getFullYear(), 11, 31, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
|
||||||
// } else {
|
|
||||||
// this.listQuery.reportTime = []
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
async getDict() {
|
|
||||||
this.$refs.lineChart.initChart()
|
|
||||||
// 产线列表
|
|
||||||
// const res = await getCorePLList();
|
|
||||||
// this.proLineList = res.data;
|
|
||||||
},
|
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
multipliedByHundred(str) {
|
multipliedByHundred(str) {
|
||||||
console.log(str);
|
console.log(str);
|
||||||
@ -574,36 +626,50 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
async getDataList() {
|
async getDataList() {
|
||||||
},
|
if (this.listQuery.date === 3) {
|
||||||
add0(m) {
|
if (this.listQuery.reportTime?.length > 0) {
|
||||||
return m < 10 ? '0' + m : m
|
this.listQuery.beginTime = this.listQuery.reportTime[0] ? this.listQuery.reportTime[0] : undefined
|
||||||
},
|
this.listQuery.endTime = this.listQuery.reportTime[1] ? this.listQuery.reportTime[1] : undefined
|
||||||
format(shijianchuo) {
|
}
|
||||||
//shijianchuo是整数,否则要parseInt转换
|
}
|
||||||
var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss')
|
if (this.listQuery.date === 4) {
|
||||||
// console.log(time)
|
if (this.listQuery.reportTime?.length > 0) {
|
||||||
// var y = time.getFullYear();
|
this.listQuery.beginTime = this.start ? this.start : undefined
|
||||||
// var m = time.getMonth() + 1;
|
this.listQuery.endTime = this.end ? this.end : undefined
|
||||||
// var d = time.getDate();
|
}
|
||||||
// var h = time.getHours();
|
}
|
||||||
// var mm = time.getMinutes();
|
if (this.currentMenu === '碲化镉工厂') {
|
||||||
// var s = time.getSeconds();
|
await prodTargetDiPage(this.listQuery).then(res => {
|
||||||
return time
|
if (res.code === 0) {
|
||||||
},
|
this.tableData = res.data.records
|
||||||
//时间戳转为yy-mm-dd hh:mm:ss
|
this.tableData.forEach(item => {
|
||||||
timeFun(unixtimestamp) {
|
const year = item.targetYear ? item.targetYear + '年' : ''
|
||||||
var unixtimestamp = new Date(unixtimestamp);
|
const month = item.targetMonth ? item.targetMonth + '月' : ''
|
||||||
var year = 1900 + unixtimestamp.getYear();
|
item.tagertTime = year + month
|
||||||
var month = "0" + (unixtimestamp.getMonth() + 1);
|
})
|
||||||
var date = "0" + unixtimestamp.getDate();
|
this.listQuery.total = res.data.total
|
||||||
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
await prodTargetToPage(this.listQuery).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
this.listQuery.reportTime = val.reportTime ? val.reportTime : undefined;
|
this.listQuery.reportTime = val.reportTime ? val.reportTime : undefined;
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.current = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.size = 10;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
@ -615,38 +681,27 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
// 处理查询参数
|
const queryParams = this.listQuery;
|
||||||
// var xlsxParam = { raw: true };
|
queryParams.current = 1
|
||||||
// /* 从表生成工作簿对象 */
|
queryParams.size = 999
|
||||||
// import('xlsx').then(excel => {
|
if (this.facType === 0) {
|
||||||
// var wb = excel.utils.table_to_book(
|
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||||
// document.querySelector("#exportTable"),
|
this.exportLoading = true;
|
||||||
// xlsxParam
|
return exportDiTargetExcel(queryParams);
|
||||||
// );
|
}).then(response => {
|
||||||
// /* 获取二进制字符串作为输出 */
|
this.$download.excel(response, '碲化镉工厂生产目标数据.xls');
|
||||||
// var wbout = excel.write(wb, {
|
this.exportLoading = false;
|
||||||
// bookType: "xlsx",
|
}).catch(() => {});
|
||||||
// bookSST: true,
|
} else {
|
||||||
// type: "array",
|
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||||
// });
|
this.exportLoading = true;
|
||||||
// try {
|
return exportToTargetExcel(queryParams);
|
||||||
// FileSaver.saveAs(
|
}).then(response => {
|
||||||
// //Blob 对象表示一个不可变、原始数据的类文件对象。
|
this.$download.excel(response, '铜铟镓硒工厂生产目标数据.xls');
|
||||||
// //Blob 表示的不一定是JavaScript原生格式的数据。
|
this.exportLoading = false;
|
||||||
// //File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
|
}).catch(() => {});
|
||||||
// //返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
}
|
||||||
// new Blob([wbout], { type: "application/octet-stream" }),
|
}
|
||||||
// //设置导出文件名称
|
|
||||||
// "许昌安彩日原片生产汇总.xlsx"
|
|
||||||
// );
|
|
||||||
// } catch (e) {
|
|
||||||
// if (typeof console !== "undefined") console.log(e, wbout);
|
|
||||||
// }
|
|
||||||
// return wbout;
|
|
||||||
// //do something......
|
|
||||||
// })
|
|
||||||
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -667,7 +722,7 @@ export default {
|
|||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
.app-container {
|
.app-container {
|
||||||
margin: 0 16px 0;
|
margin: 0;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 16px 16px 0;
|
padding: 16px 16px 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user