projects/mescc/develop #24
4
.env.dev
4
.env.dev
@ -1,8 +1,8 @@
|
||||
###
|
||||
# @Author: zhp
|
||||
# @Date: 2024-04-28 13:42:51
|
||||
# @LastEditTime: 2024-05-20 08:31:10
|
||||
# @LastEditors: zhp
|
||||
# @LastEditTime: 2024-05-22 16:29:35
|
||||
# @LastEditors: DY
|
||||
# @Description:
|
||||
###
|
||||
# 开发环境配置
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2024-05-07 08:54:59
|
||||
* @LastEditTime: 2024-05-14 15:43:50
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-05-22 16:31:08
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
@ -16,14 +16,121 @@ export function getProduceDataPage(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getProduceDataDetail(data){
|
||||
export function getProduceDataDetail(id){
|
||||
return request({
|
||||
url: '/ip/prod-output/get=' + id,
|
||||
method: 'get',
|
||||
query: data
|
||||
url: '/ip/prod-output/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出生产数据
|
||||
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) {
|
||||
return request({
|
||||
url: '/ip/prod-output/cockpitDataMonitor',
|
||||
|
@ -82,6 +82,8 @@ export default {
|
||||
border: none;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
border-bottom-left-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
padding: 20px;
|
||||
color: #888;
|
||||
letter-spacing: 2px;
|
||||
|
@ -71,6 +71,45 @@ export const SystemDataScopeEnum = {
|
||||
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
|
||||
* @Date: 2023-11-06 15:15:30
|
||||
* @LastEditTime: 2024-05-07 09:31:54
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-05-20 18:02:10
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
<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>
|
||||
@ -14,15 +14,15 @@
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<p class="title">工厂名称</p>
|
||||
<p class="text">{{ }}</p>
|
||||
<p class="text">{{ dataForm.factory }}</p>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<p class="title">时间维度</p>
|
||||
<p class="text">{{ dataForm.code }}</p>
|
||||
<p class="text">{{ date }}</p>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<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-row>
|
||||
<el-divider></el-divider>
|
||||
@ -36,43 +36,43 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">芯片良率</p>
|
||||
<p class="text">{{ dataForm.code }}</p>
|
||||
<p class="text">{{ dataForm.yieldRate }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">芯片良率</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<p class="title">芯片BOM</p>
|
||||
<p class="text">{{ dataForm.bom }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">芯片总功率</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<p class="text">{{ dataForm.totalPower }}</p>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="6">
|
||||
<p class="title">FTO投入量</p>
|
||||
<p class="text">{{ }}</p>
|
||||
<p class="text">{{ dataForm.chipInput }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">CSS稼动率</p>
|
||||
<p class="text">{{ dataForm.code }}</p>
|
||||
<p class="text">{{ dataForm.marriageRate }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">芯片段OEE</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<p class="text">{{ dataForm.oee }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">芯片平均功率</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<p class="text">{{ dataForm.averagePower }}</p>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="6">
|
||||
<p class="title">芯片人均产量</p>
|
||||
<p class="text">{{ }}</p>
|
||||
<p class="text">{{ dataForm.annualAverageProduction }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">芯片产能利用率</p>
|
||||
<p class="text">{{ dataForm.code }}</p>
|
||||
<p class="text">{{ dataForm.capacityUtilizationRate }}</p>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
||||
@ -81,19 +81,20 @@
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="6">
|
||||
<p class="title">封装BOM</p>
|
||||
<p class="text">{{ }}</p>
|
||||
<!-- 没参数 -->
|
||||
<!-- <p class="text">{{ dataForm.bom }}</p> -->
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">封装线OEE</p>
|
||||
<p class="text">{{ dataForm.code }}</p>
|
||||
<!-- <p class="text">{{ dataForm.code }}</p> -->
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">标准组件良率</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<!-- <p class="text">{{ dataForm.productName }}</p> -->
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">标准组件产量</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<!-- <p class="text">{{ dataForm.productName }}</p> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
@ -103,15 +104,15 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">封装产能利用率</p>
|
||||
<p class="text">{{ dataForm.code }}</p>
|
||||
<!-- <p class="text">{{ dataForm.code }}</p> -->
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">标准组件人均产量</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<!-- <p class="text">{{ dataForm.productName }}</p> -->
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">标准组件人均产量</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<p class="title">标准组件平均功率</p>
|
||||
<!-- <p class="text">{{ dataForm.productName }}</p> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
||||
@ -166,6 +167,12 @@ export default {
|
||||
SmallTitle,
|
||||
},
|
||||
// mixins: [basicAdd],
|
||||
props: {
|
||||
date: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
@ -224,8 +231,12 @@ export default {
|
||||
methods: {
|
||||
init(id) {
|
||||
this.visible = true
|
||||
console.log('打印', id)
|
||||
if (id) {
|
||||
getProduceDataDetail()
|
||||
getProduceDataDetail(id).then(res => {
|
||||
this.dataForm = res.data
|
||||
console.log('你好', res.data)
|
||||
})
|
||||
}
|
||||
},
|
||||
// getCurrentTime() {
|
||||
|
@ -1,53 +1,53 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-04-15 10:49:13
|
||||
* @LastEditTime: 2024-05-07 09:18:01
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-05-22 15:25:11
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<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;">
|
||||
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
|
||||
<el-form-item label="时间维度" prop="reportTime">
|
||||
<el-select clearable v-model="listQuery.date" placeholder="请选择">
|
||||
<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>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="listQuery.date === 0" label="时间范围" prop="reportTime">
|
||||
<el-date-picker clearable v-model="listQuery.reportTime" type="datetimerange" range-separator="至"
|
||||
start-placeholder="开始日期" value-format="yyyy-MM-dd HH:mm:ss" @change="changeDayTime" end-placeholder="结束日期">
|
||||
<el-form-item v-show="listQuery.date === 0 || listQuery.date === ''" label="时间范围" prop="reportTime">
|
||||
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="datetimerange" range-separator="至"
|
||||
start-placeholder="开始日期" value-format="timestamp" @change="changeDayTime" end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<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">
|
||||
</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">
|
||||
</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 }} 周
|
||||
</span>
|
||||
</el-form-item>
|
||||
<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">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<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="开始时间">
|
||||
</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">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<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>
|
||||
</el-select>
|
||||
@ -59,7 +59,7 @@
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<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>
|
||||
</el-select>
|
||||
@ -69,23 +69,32 @@
|
||||
<el-button type="primary" size="small" plain @click="handleExport">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="app-container" style="margin-top: 8px;padding: 16px; height: auto; flex-grow: 1;">
|
||||
<!-- <el-row :gutter="24"> -->
|
||||
<!-- <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>
|
||||
<!-- </el-col> -->
|
||||
<!-- <el-col :span="12">
|
||||
<line-chart :id=" 'second' " class="yearChart" ref="lineChart" style="height: 40vh;width: 100%"></line-chart>
|
||||
</el-col> -->
|
||||
</div>
|
||||
<div class="app-container" style="margin-top: 18px;flex-grow: 1; height: auto; padding: 16px;">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
|
||||
<div class="app-container" style="margin-top: 8px;flex-grow: 1; height: auto; padding: 16px;">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" style="margin-bottom: 0" />
|
||||
<base-table :table-props="tableProps" :page="listQuery.current" :limit="listQuery.size"
|
||||
:table-data="tableData">
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right"
|
||||
:method-list="tableBtn" @clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.size"
|
||||
:page.sync="listQuery.current"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
</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"
|
||||
:type="listQuery.reportType" @refreshDataList="getDataList" /> -->
|
||||
<!-- <pagination
|
||||
@ -98,7 +107,7 @@
|
||||
|
||||
<script>
|
||||
// import { parseTime } from '../../core/mixins/code-filter';
|
||||
import { getProduceDataPage } from '@/api/produceData';
|
||||
import { getProduceDataPage, exportOutPutExcel } from '@/api/produceData';
|
||||
// import inputTable from './inputTable.vue';
|
||||
import lineChart from './lineChart';
|
||||
import moment from 'moment'
|
||||
@ -114,7 +123,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
listQuery: {
|
||||
size: 10,
|
||||
size: 20,
|
||||
current: 1,
|
||||
factorys: [],
|
||||
total: 0,
|
||||
@ -123,7 +132,9 @@ export default {
|
||||
// reportType: 2,
|
||||
beginTime: undefined,
|
||||
endTime:undefined,
|
||||
reportTime: []
|
||||
reportTime: [],
|
||||
start: undefined,
|
||||
end: undefined
|
||||
},
|
||||
detailOrUpdateVisible:false,
|
||||
date1: undefined,
|
||||
@ -177,88 +188,16 @@ export default {
|
||||
// getDataListURL: getGlassPage,
|
||||
// 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: [
|
||||
{
|
||||
type: 'title',
|
||||
label: '生产数据管理',
|
||||
label: '工厂信息',
|
||||
},
|
||||
],
|
||||
formConfig1: [
|
||||
{
|
||||
type: 'title',
|
||||
label: '良品数量',
|
||||
},
|
||||
],
|
||||
timeList: [
|
||||
@ -281,24 +220,52 @@ export default {
|
||||
],
|
||||
factoryList: [
|
||||
{
|
||||
name: '测试',
|
||||
id:1
|
||||
name: '瑞昌中建材光电材料有限公司',
|
||||
id: 0
|
||||
},
|
||||
{
|
||||
name: '邯郸中建材光电材料有限公司',
|
||||
id: 1
|
||||
},
|
||||
{
|
||||
name: '中建材株洲光电材料有限公司',
|
||||
id: 2
|
||||
},
|
||||
{
|
||||
name: '佳木斯中建材光电材料有限公司',
|
||||
id: 3
|
||||
},
|
||||
{
|
||||
name: '成都中建材光电材料有限公司',
|
||||
id: 4
|
||||
},
|
||||
{
|
||||
name: '凯盛光伏材料有限公司',
|
||||
id: 5
|
||||
},
|
||||
{
|
||||
name: '蚌埠兴科玻璃有限公司',
|
||||
id: 6
|
||||
}
|
||||
],
|
||||
tableProps: [
|
||||
{
|
||||
prop: 'createTime',
|
||||
prop: 'tableTime',
|
||||
label: '日期',
|
||||
minWidth: 100,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'factory',
|
||||
label: '工厂名称',
|
||||
filter: (val) => ['瑞昌中建材光电材料有限公司', '邯郸中建材光电材料有限公司', '中建材株洲光电材料有限公司', '佳木斯中建材光电材料有限公司', '成都中建材光电材料有限公司', '凯盛光伏材料有限公司', '蚌埠兴科玻璃有限公司'][val]
|
||||
filter: (val) => ['瑞昌中建材光电材料有限公司', '邯郸中建材光电材料有限公司', '中建材株洲光电材料有限公司', '佳木斯中建材光电材料有限公司', '成都中建材光电材料有限公司', '凯盛光伏材料有限公司', '蚌埠兴科玻璃有限公司'][val],
|
||||
minWidth: 200,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'glassType',
|
||||
label: '玻璃类型',
|
||||
filter: (val) => ['玻璃芯片', '标准组件', 'BIPV'][val]
|
||||
filter: (val) => ['玻璃芯片', '标准组件', 'BIPV', '定制组件'][val]
|
||||
},
|
||||
{
|
||||
prop: 'inputNumber',
|
||||
@ -318,19 +285,18 @@ export default {
|
||||
},
|
||||
],
|
||||
tableData: [],
|
||||
xAxis: []
|
||||
// proLineList: [],
|
||||
// all: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
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() {
|
||||
this.getDict()
|
||||
// this.getCurrentYearFirst()
|
||||
// this.getDataList()
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
otherMethods(val) {
|
||||
@ -340,32 +306,41 @@ export default {
|
||||
this.$refs.detailOrUpdate.init(val.data.id);
|
||||
});
|
||||
},
|
||||
buttonClick() {
|
||||
// buttonClick() {
|
||||
|
||||
},
|
||||
// },
|
||||
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({
|
||||
message: '年份起止时间不能超过十年',
|
||||
type: 'warning'
|
||||
});
|
||||
this.listQuery.reportTime = []
|
||||
this.listQuery.start = undefined
|
||||
this.listQuery.end = undefined
|
||||
// console.log();
|
||||
} else {
|
||||
this.listQuery.beginTime = this.listQuery.start
|
||||
this.listQuery.endTime = this.listQuery.end
|
||||
}
|
||||
// console.log(e);
|
||||
},
|
||||
onValueChange(picker, k) { // 选中近k周后触发的操作
|
||||
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(this.listQuery.reportTime[0], this.listQuery.reportTime[1])
|
||||
if (this.listQuery.start && this.listQuery.end) {
|
||||
console.log(this.listQuery.reportTime)
|
||||
this.date1 = moment(this.listQuery.start.getTime() - 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) {
|
||||
console.log(numDays)
|
||||
this.$message({
|
||||
message: '周范围不能超过24周',
|
||||
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.createEndDate = moment(new Date(this.listQuery.reportTime[1]), 'yyyy-MM-dd hh:mm:ss');
|
||||
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({
|
||||
message: '时间范围不能超过30天',
|
||||
type: 'warning'
|
||||
});
|
||||
this.listQuery.reportTime = [];
|
||||
} else {
|
||||
this.listQuery.beginTime = this.listQuery.reportTime[0]
|
||||
this.listQuery.endTime = this.listQuery.reportTime[1]
|
||||
}
|
||||
} 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) {
|
||||
const numDays = this.listQuery.reportTime[1] - this.listQuery.reportTime[0];
|
||||
if (numDays > 2*365*24*60*60*1000) {
|
||||
this.$message({
|
||||
message: '时间范围不能超过24个月',
|
||||
type: 'warning'
|
||||
});
|
||||
this.listQuery.reportTime = [];
|
||||
} else {
|
||||
this.listQuery.reportTime[0] = startTime
|
||||
this.listQuery.reportTime[1] = endTime
|
||||
this.listQuery.beginTime = this.listQuery.reportTime[0]
|
||||
this.listQuery.endTime = this.listQuery.reportTime[1]
|
||||
}
|
||||
} 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()
|
||||
// async getDict() {
|
||||
// 产线列表
|
||||
// const res = await getCorePLList();
|
||||
// this.proLineList = res.data;
|
||||
},
|
||||
// },
|
||||
// 获取数据列表
|
||||
multipliedByHundred(str) {
|
||||
console.log(str);
|
||||
@ -498,36 +412,50 @@ export default {
|
||||
const res = await getProduceDataPage(this.listQuery)
|
||||
console.log(res)
|
||||
this.tableData = res.data.records
|
||||
this.tableData.forEach(item => {
|
||||
item.tableTime = item?.reportDate?.length > 0 ? item.reportDate[0] + '-' + item.reportDate[1] + '-' + item.reportDate[2] : '--'
|
||||
})
|
||||
this.listQuery.total = res.data.total
|
||||
this.buildChart(this.tableData)
|
||||
},
|
||||
add0(m) {
|
||||
return m < 10 ? '0' + m : m
|
||||
buildChart(list) {
|
||||
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) {
|
||||
//shijianchuo是整数,否则要parseInt转换
|
||||
var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss')
|
||||
// console.log(time)
|
||||
// var y = time.getFullYear();
|
||||
// var m = time.getMonth() + 1;
|
||||
// var d = time.getDate();
|
||||
// var h = time.getHours();
|
||||
// var mm = time.getMinutes();
|
||||
// var s = time.getSeconds();
|
||||
return time
|
||||
},
|
||||
//时间戳转为yy-mm-dd hh:mm:ss
|
||||
timeFun(unixtimestamp) {
|
||||
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)
|
||||
data: Array(this.xAxis.length).fill(0)
|
||||
}
|
||||
for (const a in chartList) {
|
||||
for (const z of chartList[a]) {
|
||||
this.xAxis.forEach((item, index) => {
|
||||
if (z.factory === y.id && a === item) {
|
||||
seriesItem.data[index] = z.goodNumber
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
this.seriesList.push(seriesItem)
|
||||
}
|
||||
this.$refs.lineChart.initChart(this.xAxis, this.seriesList)
|
||||
},
|
||||
buttonClick(val) {
|
||||
this.listQuery.reportTime = val.reportTime ? val.reportTime : undefined;
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.current = 1;
|
||||
this.listQuery.size = 20;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'export':
|
||||
@ -539,6 +467,17 @@ export default {
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
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 };
|
||||
// /* 从表生成工作簿对象 */
|
||||
@ -591,7 +530,7 @@ export default {
|
||||
margin-top: 8px;
|
||||
}
|
||||
.app-container {
|
||||
margin: 0 16px 0;
|
||||
margin: 0 0px 0;
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
padding: 16px 16px 0;
|
||||
|
@ -1,8 +1,8 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2022-01-21 14:43:06
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-04-17 10:03:39
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-05-22 13:48:58
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -58,11 +58,11 @@ export default {
|
||||
chart: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.initChart()
|
||||
})
|
||||
},
|
||||
// mounted() {
|
||||
// this.$nextTick(() => {
|
||||
// this.initChart()
|
||||
// })
|
||||
// },
|
||||
beforeDestroy() {
|
||||
if (!this.chart) {
|
||||
return
|
||||
@ -71,8 +71,7 @@ export default {
|
||||
this.chart = null
|
||||
},
|
||||
methods: {
|
||||
initChart() {
|
||||
console.log(1111)
|
||||
initChart(xAxis, seriesList) {
|
||||
this.chart = echarts.init(document.getElementById(this.id))
|
||||
console.log(this.$parent);
|
||||
this.chart.setOption({
|
||||
@ -85,7 +84,7 @@ export default {
|
||||
},
|
||||
grid: { top: 100, right: 90, bottom: 10, left: 10, containLabel: true },
|
||||
legend: {
|
||||
data: ['工厂1', '工厂2'],
|
||||
// data: ['工厂1', '工厂2'],
|
||||
right: '90px',
|
||||
top: '0%',
|
||||
icon: 'rect',
|
||||
@ -107,7 +106,7 @@ export default {
|
||||
{
|
||||
type: 'category',
|
||||
// prettier-ignore
|
||||
data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
||||
data: xAxis
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
@ -122,39 +121,8 @@ export default {
|
||||
bottom: "1%",
|
||||
containLabel: true
|
||||
},
|
||||
series: [
|
||||
{
|
||||
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
|
||||
],
|
||||
},
|
||||
]
|
||||
})
|
||||
series: seriesList
|
||||
}, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,40 +1,49 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-04-17 16:31:51
|
||||
* @LastEditTime: 2024-04-17 17:01:14
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-05-20 18:09:09
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
<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">
|
||||
{{ '新增' }}
|
||||
{{ dataForm.id ? '编辑' : '新增' }}
|
||||
</small-title>
|
||||
<div class="detailBox">
|
||||
<el-form ref="form" :model="dataForm" label-width="80px" label-position="top">
|
||||
<el-row :gutter="24" style="padding: 0 32px;">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工厂名称" prop="factoryId">
|
||||
<el-select v-model="dataForm.factoryId" placeholder="请选择工厂名称" multiple="true" clearable>
|
||||
<el-option v-for="item in factoryList" :key="item.id" :label="item.name" :value="item.id">
|
||||
<el-form-item v-if="ftype === 0" label="工厂名称" prop="factory">
|
||||
<el-select v-model="dataForm.factory" placeholder="请选择工厂名称" clearable>
|
||||
<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-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工厂名称" prop="factoryId">
|
||||
<el-select v-model="dataForm.factoryId" placeholder="请选择工厂名称" multiple="true" clearable>
|
||||
<el-option v-for="item in factoryList" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
<el-form-item label="时间维度" prop="targetType">
|
||||
<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 label="月" :value="0" />
|
||||
<el-option label="年" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工厂名称" prop="factoryId">
|
||||
<el-select v-model="dataForm.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 v-show="dataForm.targetType !== 1" label="时间" prop="reportTime">
|
||||
<el-date-picker v-model="dataForm.reportTime" value-format="yyyy-MM" type="month" placeholder="选择月份">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<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-col>
|
||||
</el-row>
|
||||
@ -44,59 +53,63 @@
|
||||
</small-title>
|
||||
<el-row :gutter="24" style="padding: 0 32px;">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="芯片产量" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片产量"></el-input>
|
||||
<el-form-item label="芯片产量" prop="chipYield">
|
||||
<el-input-number v-model="dataForm.chipYield" :precision="0" controls-position="right" placeholder="请输入芯片产量" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="芯片良率" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片良率"></el-input>
|
||||
|
||||
<el-form-item label="芯片良率" prop="chipYieldRate">
|
||||
<el-input-number v-model="dataForm.chipYieldRate" :precision="2" :max="100" controls-position="right" placeholder="请输入芯片良率" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="芯片BOM" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片BOM"></el-input>
|
||||
<el-form-item label="芯片BOM" prop="chipBom">
|
||||
<el-input-number v-model="dataForm.chipBom" :precision="2" controls-position="right" placeholder="请输入芯片BOM" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="芯片总功率" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片总功率"></el-input>
|
||||
<el-form-item label="芯片总功率" prop="chipTotalPower">
|
||||
<el-input-number v-model="dataForm.chipTotalPower" :precision="2" controls-position="right" placeholder="请输入芯片总功率" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24" style="padding: 0 32px;">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="FTO投入量" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入FTO投入量"></el-input>
|
||||
<el-form-item v-if="ftype === 0" label="FTO投入量" prop="ftoInput">
|
||||
<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-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="CSS稼动率" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入CSS稼动率"></el-input>
|
||||
|
||||
<el-form-item v-if="ftype === 0" label="CSS稼动率" prop="chipCssMarriageRate">
|
||||
<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-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="芯片段OEE" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片段OEE"></el-input>
|
||||
<el-form-item label="芯片段OEE" prop="chipOee">
|
||||
<el-input-number v-model="dataForm.chipOee" :precision="2" controls-position="right" placeholder="请输入芯片段OEE" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="芯片平均功率" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片平均功率"></el-input>
|
||||
<el-form-item label="芯片平均功率" prop="chipAveragePower">
|
||||
<el-input-number v-model="dataForm.chipAveragePower" :precision="2" controls-position="right" placeholder="请输入芯片平均功率" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24" style="padding: 0 32px;">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="芯片人均产量" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片人均产量"></el-input>
|
||||
<el-form-item label="芯片人均产量" prop="chipAnnualAverageProduction">
|
||||
<el-input-number v-model="dataForm.chipAnnualAverageProduction" :precision="2" controls-position="right" placeholder="请输入芯片人均产量" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="芯片人均产量" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片人均产量"></el-input>
|
||||
<el-form-item label="芯片产能利用率" prop="chipCapacityUtilizationRate">
|
||||
<el-input-number v-model="dataForm.chipCapacityUtilizationRate" :precision="2" controls-position="right" placeholder="请输入芯片产能利用率" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -106,45 +119,45 @@
|
||||
</small-title>
|
||||
<el-row :gutter="24" style="padding: 0 32px;">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="封装BOM" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入封装BOM"></el-input>
|
||||
<el-form-item label="封装BOM" prop="componentBom">
|
||||
<el-input-number v-model="dataForm.componentBom" :precision="2" controls-position="right" placeholder="请输入封装BOM" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="封装线OEE" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入封装线OEE"></el-input>
|
||||
<el-form-item label="封装线OEE" prop="componentOee">
|
||||
<el-input-number v-model="dataForm.componentOee" :precision="2" controls-position="right" placeholder="请输入封装线OEE" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="标准组件良率" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入标准组件良率"></el-input>
|
||||
<el-form-item label="标准组件良率" prop="componentYieldRate">
|
||||
<el-input-number v-model="dataForm.componentYieldRate" :precision="2" controls-position="right" placeholder="请输入标准组件良率" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="标准组件良率" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入标准组件良率"></el-input>
|
||||
<el-form-item label="标准组件产量" prop="componentYield">
|
||||
<el-input-number v-model="dataForm.componentYield" :precision="0" controls-position="right" placeholder="请输入标准组件产量" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24" style="padding: 0 32px;">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="标准组件总功率" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入标准组件总功率"></el-input>
|
||||
<el-form-item label="标准组件总功率" prop="componentTotalPower">
|
||||
<el-input-number v-model="dataForm.componentTotalPower" :precision="2" controls-position="right" placeholder="请输入标准组件总功率" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="标准组件总功率" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入标准组件总功率"></el-input>
|
||||
<el-form-item label="封装产能利用率" prop="componentCapacityUtilizationRate">
|
||||
<el-input-number v-model="dataForm.componentCapacityUtilizationRate" :precision="2" controls-position="right" placeholder="请输入封装产能利用率" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="标准组件人均产量" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入标准组件人均产量"></el-input>
|
||||
<el-form-item label="标准组件人均产量" prop="componentAnnualAverageProduction">
|
||||
<el-input-number v-model="dataForm.componentAnnualAverageProduction" :precision="2" controls-position="right" placeholder="请输入标准组件人均产量" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="标准组件平均功率" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入标准组件平均功率"></el-input>
|
||||
<el-form-item label="标准组件平均功率" prop="componentAveragePower">
|
||||
<el-input-number v-model="dataForm.componentAveragePower" :precision="2" controls-position="right" placeholder="请输入标准组件平均功率" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -155,47 +168,47 @@
|
||||
</small-title>
|
||||
<el-row :gutter="24" style="padding: 0 32px;">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="产品产量" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入产品产量"></el-input>
|
||||
<el-form-item label="产品产量" prop="bipvProductOutput">
|
||||
<el-input-number v-model="dataForm.bipvProductOutput" :precision="0" controls-position="right" placeholder="请输入产品产量" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="人均产量" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入人均产量"></el-input>
|
||||
<el-form-item label="人均产量" prop="bipvAnnualAverageProduction">
|
||||
<el-input-number v-model="dataForm.bipvAnnualAverageProduction" :precision="2" controls-position="right" placeholder="请输入人均产量" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="芯片使用量" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片使用量"></el-input>
|
||||
<el-form-item label="芯片使用量" prop="bipvChipUsage">
|
||||
<el-input-number v-model="dataForm.bipvChipUsage" :precision="0" controls-position="right" placeholder="请输入芯片使用量" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="芯片利用率" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入芯片利用率"></el-input>
|
||||
<el-form-item label="芯片利用率" prop="bipvChipUtilizationRate">
|
||||
<el-input-number v-model="dataForm.bipvChipUtilizationRate" :precision="2" controls-position="right" placeholder="请输入芯片利用率" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24" style="padding: 0 32px;">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="内部材料成本" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入内部材料成本"></el-input>
|
||||
<el-form-item label="内部材料成本" prop="bipvInsideMaterialCost">
|
||||
<el-input-number v-model="dataForm.bipvInsideMaterialCost" :precision="2" controls-position="right" placeholder="请输入内部材料成本" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="OEM及委外材料成本" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入OEM及委外材料成本"></el-input>
|
||||
<el-form-item label="OEM及委外材料成本" prop="bipvOeeMaterialCost">
|
||||
<el-input-number v-model="dataForm.bipvOeeMaterialCost" :precision="2" controls-position="right" placeholder="请输入OEM及委外材料成本" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="综合材料成本" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="请输入综合材料成本"></el-input>
|
||||
<el-form-item label="综合材料成本" prop="bipvComprehensiveMaterialCost">
|
||||
<el-input-number v-model="dataForm.bipvComprehensiveMaterialCost" :precision="2" controls-position="right" placeholder="请输入综合材料成本" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<el-button @click="cancelForm">取 消</el-button>
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleClose()">确 定</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
@ -210,20 +223,25 @@
|
||||
// } from "@/api/base/qualityScrapLog";
|
||||
// import { getList, } from "@/api/base/qualityScrapType";
|
||||
import SmallTitle from './SmallTitle';
|
||||
import { createProduce, getProduceTargetDetail, updateProduceTarget } from '@/api/produceData';
|
||||
import { factoryList, tyjxfactoryList, dhgfactoryList } from "@/utils/constants";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
SmallTitle,
|
||||
},
|
||||
// mixins: [basicAdd],
|
||||
props: {
|
||||
ftype: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
isGetCode: false,
|
||||
// codeURL: getCode,
|
||||
// createURL: createQualityScrapLog,
|
||||
// updateURL: updateQualityScrapLog,
|
||||
// infoURL: getQualityScrapLog,
|
||||
},
|
||||
factoryList,
|
||||
dhgfactoryList,
|
||||
tyjxfactoryList,
|
||||
lineList: [],
|
||||
typeList: [],
|
||||
workOrderList: [],
|
||||
@ -239,138 +257,166 @@ export default {
|
||||
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: [],
|
||||
visible: false,
|
||||
dataForm: {
|
||||
factoryType: 0,
|
||||
id: undefined,
|
||||
logTime: undefined,
|
||||
source: 1,
|
||||
detId: undefined,
|
||||
workOrderId: null,
|
||||
teamId: undefined,
|
||||
num: undefined,
|
||||
lineId: undefined,
|
||||
description: undefined,
|
||||
// description: undefined,
|
||||
remark: undefined,
|
||||
reportTime: undefined, // 月时间
|
||||
factory: undefined,
|
||||
targetType: undefined,
|
||||
targetYear: undefined,
|
||||
showYear: undefined,
|
||||
targetMonth: undefined,
|
||||
chipYield: undefined,
|
||||
chipYieldRate: undefined,
|
||||
chipBom: 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: [],
|
||||
dataRule: {
|
||||
// materialId: [{ required: true, message: "", trigger: "blur" }],
|
||||
workOrderId: [{ required: true, message: "工单号不能为空", trigger: "change" }],
|
||||
num: [{ required: true, message: "数量不能为空", trigger: "blur" }],
|
||||
detId: [{ required: true, message: "报废原因不能为空", trigger: "change" }],
|
||||
// workOrderId: [{ required: true, message: "工单号不能为空", trigger: "change" }],
|
||||
// num: [{ required: true, message: "数量不能为空", trigger: "blur" }],
|
||||
// detId: [{ required: true, message: "报废原因不能为空", trigger: "change" }],
|
||||
|
||||
logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }],
|
||||
// logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }],
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getDict()
|
||||
console.log('我看看', this.dataForm)
|
||||
// this.getCurrentTime()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.visible = true
|
||||
formClear() {
|
||||
if (this.$refs.dataForm !== undefined) {
|
||||
this.$refs.dataForm.resetFields()
|
||||
}
|
||||
},
|
||||
// getCurrentTime() {
|
||||
// // new Date().Format("yyyy-MM-dd HH:mm:ss")
|
||||
// this.dataForm.logTime = new Date()
|
||||
// // this.dataForm.logTime = year + "-" + month + "-" + day;
|
||||
// console.log(this.dataForm.logTime);
|
||||
// },
|
||||
async getDict() {
|
||||
// // 物料列表
|
||||
// const res = await getList()
|
||||
// this.typeList = res.data
|
||||
// getWorkOrderList().then((res) => {
|
||||
// console.log(res);
|
||||
// // console.log(response);
|
||||
// this.workOrderList = res.data.map((item) => {
|
||||
// return {
|
||||
// name: item.name,
|
||||
// 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,
|
||||
// };
|
||||
// });
|
||||
// }
|
||||
clearTime() {
|
||||
this.dataForm.targetYear = undefined
|
||||
this.dataForm.targetMonth = undefined
|
||||
},
|
||||
handleClose() {
|
||||
// 新增
|
||||
if (this.dataForm.targetType === 0) {
|
||||
const timeArray = this.dataForm.reportTime.split('-')
|
||||
this.dataForm.targetYear = Number(timeArray[0])
|
||||
this.dataForm.targetMonth = Number(timeArray[1])
|
||||
}
|
||||
if (this.dataForm.targetType === 1) {
|
||||
this.dataForm.targetYear = Number(this.dataForm.showYear)
|
||||
}
|
||||
// if (this.dataForm.factory === 5) {
|
||||
// this.dataForm.factoryType = 1
|
||||
// } else {
|
||||
// this.$axios({
|
||||
// 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,
|
||||
// };
|
||||
// });
|
||||
// })
|
||||
// this.dataForm.factoryType = 0
|
||||
// }
|
||||
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>
|
||||
<style scoped>
|
||||
|
@ -1,28 +1,28 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-11-06 15:15:30
|
||||
* @LastEditTime: 2024-04-17 16:40:01
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-05-22 15:29:18
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
<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">
|
||||
{{ '碲化镉工厂生产数据详情' }}
|
||||
{{ ftype === 0 ? '碲化镉工厂生产数据详情' : '铜铟镓硒工厂生产数据详情' }}
|
||||
</small-title>
|
||||
<div class="detailBox">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<p class="title">工厂名称</p>
|
||||
<p class="text">{{ }}</p>
|
||||
<p class="text">{{ factoryList[dataForm.factory] }}</p>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<p class="title">时间维度</p>
|
||||
<p class="text">{{ dataForm.code }}</p>
|
||||
<p class="text">{{ dataForm.targetType === 0 ? '月' : '年' }}</p>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<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-row>
|
||||
<el-divider></el-divider>
|
||||
@ -32,47 +32,47 @@
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="6">
|
||||
<p class="title">芯片产量</p>
|
||||
<p class="text">{{ }}</p>
|
||||
<p class="text">{{ dataForm.chipYield }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">芯片良率</p>
|
||||
<p class="text">{{ dataForm.code }}</p>
|
||||
<p class="text">{{ dataForm.chipYieldRate }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">芯片良率</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<p class="title">芯片BOM</p>
|
||||
<p class="text">{{ dataForm.chipBom }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">芯片总功率</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<p class="text">{{ dataForm.chipTotalPower }}</p>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="6">
|
||||
<p class="title">FTO投入量</p>
|
||||
<p class="text">{{ }}</p>
|
||||
<p class="title">{{ ftype === 0 ? 'FTO投入量' : '钼电极投入量' }}</p>
|
||||
<p class="text">{{ ftype === 0 ? dataForm.ftoInput : dataForm.molybdenumElectrodeInput }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">CSS稼动率</p>
|
||||
<p class="text">{{ dataForm.code }}</p>
|
||||
<p class="title">{{ ftype === 0 ? 'CSS稼动率' : 'PID6稼动率' }}</p>
|
||||
<p class="text">{{ dataForm.chipCssMarriageRate }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">芯片段OEE</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<p class="text">{{ dataForm.chipOee }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">芯片平均功率</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<p class="text">{{ dataForm.chipAveragePower }}</p>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="6">
|
||||
<p class="title">芯片人均产量</p>
|
||||
<p class="text">{{ }}</p>
|
||||
<p class="text">{{ dataForm.chipAnnualAverageProduction }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">芯片产能利用率</p>
|
||||
<p class="text">{{ dataForm.code }}</p>
|
||||
<p class="text">{{ dataForm.chipCapacityUtilizationRate }}</p>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
||||
@ -81,37 +81,37 @@
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="6">
|
||||
<p class="title">封装BOM</p>
|
||||
<p class="text">{{ }}</p>
|
||||
<p class="text">{{ dataForm.componentBom }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">封装线OEE</p>
|
||||
<p class="text">{{ dataForm.code }}</p>
|
||||
<p class="text">{{ dataForm.componentOee }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">标准组件良率</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<p class="text">{{ dataForm.componentYieldRate }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">标准组件产量</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<p class="text">{{ dataForm.componentYield }}</p>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="6">
|
||||
<p class="title">标准组件总功率</p>
|
||||
<p class="text">{{ }}</p>
|
||||
<p class="text">{{ dataForm.componentTotalPower }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">封装产能利用率</p>
|
||||
<p class="text">{{ dataForm.code }}</p>
|
||||
<p class="text">{{ dataForm.componentCapacityUtilizationRate }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">标准组件人均产量</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<p class="text">{{ dataForm.componentAnnualAverageProduction }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">标准组件人均产量</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<p class="title">标准组件平均功率</p>
|
||||
<p class="text">{{ dataForm.componentAveragePower }}</p>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
||||
@ -120,33 +120,33 @@
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="6">
|
||||
<p class="title">产品产量</p>
|
||||
<p class="text">{{ }}</p>
|
||||
<p class="text">{{ dataForm.bipvProductOutput }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">人均产量</p>
|
||||
<p class="text">{{ dataForm.code }}</p>
|
||||
<p class="text">{{ dataForm.bipvAnnualAverageProduction }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">芯片使用量</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<p class="text">{{ dataForm.bipvChipUsage }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">芯片使用量</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<p class="title">芯片利用率</p>
|
||||
<p class="text">{{ dataForm.bipvChipUtilizationRate }}</p>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="6">
|
||||
<p class="title">内部材料成本</p>
|
||||
<p class="text">{{ }}</p>
|
||||
<p class="text">{{ dataForm.bipvInsideMaterialCost }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">内部材料成本</p>
|
||||
<p class="text">{{ dataForm.code }}</p>
|
||||
<p class="title">OEM及委外材料成本</p>
|
||||
<p class="text">{{ dataForm.bipvOeeMaterialCost }}</p>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<p class="title">内部材料成本</p>
|
||||
<p class="text">{{ dataForm.productName }}</p>
|
||||
<p class="title">综合材料成本</p>
|
||||
<p class="text">{{ dataForm.bipvComprehensiveMaterialCost }}</p>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
@ -155,20 +155,24 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import basicAdd from './basic-add';
|
||||
// import {
|
||||
// createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList,
|
||||
// getTeamList, getDetList, getLineList
|
||||
// } from "@/api/base/qualityScrapLog";
|
||||
// import { getList, } from "@/api/base/qualityScrapType";
|
||||
import { getProduceTargetDetail } from '@/api/produceData';
|
||||
import SmallTitle from './SmallTitle';
|
||||
import { factoryList } from "@/utils/constants";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
SmallTitle,
|
||||
},
|
||||
props: {
|
||||
ftype: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
// mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
factoryList,
|
||||
urlOptions: {
|
||||
isGetCode: false,
|
||||
// codeURL: getCode,
|
||||
@ -223,8 +227,14 @@ export default {
|
||||
// this.getCurrentTime()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
init(id) {
|
||||
this.visible = true
|
||||
console.log('打印', id)
|
||||
if (id) {
|
||||
getProduceTargetDetail(id).then(res => {
|
||||
this.dataForm = res.data
|
||||
})
|
||||
}
|
||||
},
|
||||
// getCurrentTime() {
|
||||
// // new Date().Format("yyyy-MM-dd HH:mm:ss")
|
||||
|
@ -1,18 +1,30 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-04-15 10:49:13
|
||||
* @LastEditTime: 2024-04-17 16:37:35
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-05-22 16:22:57
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<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="currentMenu = $event">
|
||||
<ButtonNav :menus="['碲化镉工厂', '铜铟镓硒工厂']" :button-mode="true" @change="changeFactory" style="margin-top: -10px">
|
||||
</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-item label="时间维度" prop="reportTime">
|
||||
<el-select clearable v-model="timeSelect" placeholder="请选择">
|
||||
<el-form-item v-if="facType === 0" label="工厂名称" prop="factorys">
|
||||
<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>
|
||||
</el-select>
|
||||
@ -34,26 +46,20 @@
|
||||
{{ date1 }} 至 {{ date2 }},共 {{ weekNum }} 周
|
||||
</span>
|
||||
</el-form-item> -->
|
||||
<el-form-item v-show="timeSelect === 'month'" label="时间范围" prop="reportTime">
|
||||
<el-date-picker v-model="listQuery.reportTime" type="monthrange" range-separator="至" start-placeholder="开始月份"
|
||||
<el-form-item v-show="listQuery.date !== 4" label="时间值" prop="reportTime">
|
||||
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange" value-format="timestamp" range-separator="至" start-placeholder="开始月份"
|
||||
end-placeholder="结束月份" @change="changeTime">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="timeSelect === 'year'" label="时间范围" prop="reportTime">
|
||||
<el-date-picker clearable v-model="listQuery.reportTime[0]" value-format="yyyy" type="year"
|
||||
<el-form-item v-show="listQuery.date === 4" label="时间值" prop="reportTime">
|
||||
<el-date-picker size="small" clearable v-model="start" value-format="timestamp" type="year"
|
||||
placeholder="开始时间">
|
||||
</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">
|
||||
</el-date-picker>
|
||||
</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-select v-model="listQuery.type" placeholder="请选择玻璃类型">
|
||||
<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-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="success" size="small" plain @click="addFactory">新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- <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">
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right"
|
||||
:method-list="tableBtn" @clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<detail-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" @refreshDataList="successSubmit" />
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="successSubmit" />
|
||||
|
||||
<!-- <el-row :gutter="24"> -->
|
||||
<!-- <el-col :span="12" v-for="item in dataList" :key="item.id"> -->
|
||||
<!-- <line-chart class="yearChart" ref="lineChart" style="height: 40vh;width: 100%"></line-chart> -->
|
||||
<!-- </el-col> -->
|
||||
<!-- <el-col :span="12">
|
||||
<line-chart :id=" 'second' " class="yearChart" ref="lineChart" style="height: 40vh;width: 100%"></line-chart>
|
||||
</el-col> -->
|
||||
<pagination
|
||||
:limit.sync="listQuery.size"
|
||||
:page.sync="listQuery.current"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
<detail-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" :ftype="facType" @destroy="detailOrUpdateVisible = false" />
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :ftype="facType" @refreshDataList="getDataList" @destroy="addOrUpdateVisible = false" />
|
||||
|
||||
</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"
|
||||
:type="listQuery.reportType" @refreshDataList="getDataList" /> -->
|
||||
<!-- <pagination
|
||||
@ -101,8 +141,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { parseTime } from '../../core/mixins/code-filter';
|
||||
// import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import { prodTargetDiPage, prodTargetToPage, exportDiTargetExcel, exportToTargetExcel, delTarget, importToTarget, importDiTarget } from '@/api/produceData';
|
||||
// import inputTable from './inputTable.vue';
|
||||
import lineChart from './lineChart';
|
||||
import moment from 'moment'
|
||||
@ -110,28 +150,53 @@ import ButtonNav from '@/components/ButtonNav'
|
||||
import basicPage from '@/mixins/basic-page'
|
||||
import detailOrUpdate from './detail-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 * as XLSX from 'xlsx'
|
||||
export default {
|
||||
components: { lineChart, ButtonNav, detailOrUpdate,addOrUpdate },
|
||||
components: { lineChart, ButtonNav, detailOrUpdate, addOrUpdate },
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
factoryList,
|
||||
dhgfactoryList,
|
||||
tyjxfactoryList,
|
||||
currentMenu: '碲化镉工厂',
|
||||
fileList: [],
|
||||
start: undefined,
|
||||
end: undefined,
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
factoryId: null,
|
||||
size: 10,
|
||||
current: 1,
|
||||
factorys: null,
|
||||
total: 0,
|
||||
type: null,
|
||||
// reportType: 2,
|
||||
date: undefined,
|
||||
beginTime: undefined,
|
||||
endTime: undefined,
|
||||
reportTime: []
|
||||
},
|
||||
detailOrUpdateVisible: false,
|
||||
addOrUpdateVisible:false,
|
||||
date1: 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: [
|
||||
{
|
||||
type: 'detail',
|
||||
@ -144,7 +209,7 @@ export default {
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},
|
||||
}
|
||||
].filter((v) => v),
|
||||
typeList: [
|
||||
{
|
||||
@ -159,27 +224,6 @@ export default {
|
||||
name: 'BIPV产品',
|
||||
id: 2,
|
||||
},
|
||||
],
|
||||
// weekNum: undefined,
|
||||
dataList: [
|
||||
{
|
||||
id:'first',
|
||||
},
|
||||
{
|
||||
id: 'second',
|
||||
},
|
||||
{
|
||||
id: 'third',
|
||||
},
|
||||
{
|
||||
id: 'fourth',
|
||||
},
|
||||
{
|
||||
id: 'fifth',
|
||||
},
|
||||
{
|
||||
id: 'sixth',
|
||||
},
|
||||
],
|
||||
urlOptions: {
|
||||
// getDataListURL: getGlassPage,
|
||||
@ -270,135 +314,220 @@ export default {
|
||||
},
|
||||
],
|
||||
timeList: [
|
||||
// {
|
||||
// value: 'day',
|
||||
// label: '日'
|
||||
// },
|
||||
// {
|
||||
// value: 'week',
|
||||
// label: '周'
|
||||
// },
|
||||
{
|
||||
value: 'month',
|
||||
value: 3,
|
||||
label:'月'
|
||||
},
|
||||
{
|
||||
value: 'year',
|
||||
value: 4,
|
||||
label: '年'
|
||||
}
|
||||
],
|
||||
factoryList: [
|
||||
{
|
||||
name: '测试',
|
||||
id:1
|
||||
},
|
||||
{
|
||||
name: '测试2',
|
||||
id: 2
|
||||
}
|
||||
],
|
||||
tableProps: [
|
||||
// {
|
||||
// prop: 'createTime',
|
||||
// label: '添加时间',
|
||||
// fixed: true,
|
||||
// width: 180,
|
||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
// },
|
||||
|
||||
{
|
||||
prop: 'nickName',
|
||||
prop: 'factory',
|
||||
label: '工厂名称',
|
||||
filter: (val) => factoryList[val],
|
||||
minWidth: 200,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'userName',
|
||||
prop: 'tagertTime',
|
||||
label: '目标时间',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
prop: 'createTime',
|
||||
label: '提交时间',
|
||||
filter: parseTime,
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'inNum',
|
||||
label: '钼电极投入量(片)',
|
||||
prop: 'ftoInput',
|
||||
label: 'FTO投入量(片)',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'putNum',
|
||||
prop: 'chipYield',
|
||||
label: '芯片产量(片)',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'goodNum',
|
||||
prop: 'chipAveragePower',
|
||||
label: '芯片平均功率(W)',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'goodYelid',
|
||||
prop: 'chipYieldRate',
|
||||
label: '芯片良率(%)',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'goodYelid',
|
||||
prop: 'chipTotalPower',
|
||||
label: '芯片总功率(KW)',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'goodYelid',
|
||||
label: 'PID6稼动率(%)',
|
||||
prop: 'chipCssMarriageRate',
|
||||
label: 'CSS稼动率(%)',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'goodYelid',
|
||||
prop: 'chipOee',
|
||||
label: '芯片段OEE(%)',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'goodYelid',
|
||||
prop: 'chipCapacityUtilizationRate',
|
||||
label: '芯片产能利用率(%)',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'goodYelid',
|
||||
prop: 'chipAnnualAverageProduction',
|
||||
label: '芯片人均产量(片/人)',
|
||||
minWidth: 180,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'goodYelid',
|
||||
prop: 'chipBom',
|
||||
label: '芯片BOM',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
],
|
||||
timeSelect:'month',
|
||||
// timeSelect:'month',
|
||||
startTimeStamp:null, //开始时间
|
||||
endTimeStamp:null, //结束时间
|
||||
// date:'凯盛玻璃控股成员企业2024生产数据',
|
||||
// reportTime: '',
|
||||
startTimeStamp: '',
|
||||
endTimeStamp: '',
|
||||
tableData: [
|
||||
{
|
||||
userName: 'userName',
|
||||
nickName: '用户名',
|
||||
datas:'111111'
|
||||
},
|
||||
{
|
||||
userName: 'userName',
|
||||
nickName: '用户名',
|
||||
datas: '111111'
|
||||
},
|
||||
{
|
||||
userName: 'userName',
|
||||
nickName: '用户名',
|
||||
datas: '111111'
|
||||
// subcomponent: row
|
||||
}
|
||||
],
|
||||
tableData: [],
|
||||
facType: 0
|
||||
// proLineList: [],
|
||||
// all: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
weekNum() {
|
||||
return Math.round((this.listQuery.reportTime[1] - this.listQuery.reportTime[0]) / (24 * 60 * 60 * 1000 * 7)) + 1
|
||||
},
|
||||
// computed: {
|
||||
// weekNum() {
|
||||
// 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() {
|
||||
this.getDict()
|
||||
// this.getDict()
|
||||
// this.getCurrentYearFirst()
|
||||
// this.getDataList()
|
||||
this.getDataList()
|
||||
},
|
||||
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) {
|
||||
if (val.type === "edit") {
|
||||
this.addOrUpdateVisible = true;
|
||||
@ -407,11 +536,33 @@ export default {
|
||||
this.$refs.addOrUpdate.init(val.data.id);
|
||||
});
|
||||
} 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 {
|
||||
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) {
|
||||
this.detailOrUpdateVisible = true;
|
||||
this.addOrEditTitle = "详情";
|
||||
@ -423,133 +574,34 @@ export default {
|
||||
|
||||
},
|
||||
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({
|
||||
message: '年份起止时间不能超过十年',
|
||||
type: 'warning'
|
||||
});
|
||||
// console.log();
|
||||
} else {
|
||||
if (this.end < this.start) {
|
||||
this.$message({
|
||||
message: '结束年份不能小于开始年份',
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
}
|
||||
// console.log(e);
|
||||
},
|
||||
onValueChange(picker, k) { // 选中近k周后触发的操作
|
||||
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() {
|
||||
changeTime() {
|
||||
if (this.listQuery.reportTime) {
|
||||
// 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');
|
||||
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) {
|
||||
const numDays = this.listQuery.reportTime[1] - this.listQuery.reportTime[0]
|
||||
if (numDays > 2*365*24*60*60*1000) {
|
||||
this.$message({
|
||||
message: '时间范围不能超过24个月',
|
||||
type: 'warning'
|
||||
});
|
||||
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) {
|
||||
console.log(str);
|
||||
@ -574,36 +626,50 @@ export default {
|
||||
|
||||
},
|
||||
async getDataList() {
|
||||
},
|
||||
add0(m) {
|
||||
return m < 10 ? '0' + m : m
|
||||
},
|
||||
format(shijianchuo) {
|
||||
//shijianchuo是整数,否则要parseInt转换
|
||||
var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss')
|
||||
// console.log(time)
|
||||
// var y = time.getFullYear();
|
||||
// var m = time.getMonth() + 1;
|
||||
// var d = time.getDate();
|
||||
// var h = time.getHours();
|
||||
// var mm = time.getMinutes();
|
||||
// var s = time.getSeconds();
|
||||
return time
|
||||
},
|
||||
//时间戳转为yy-mm-dd hh:mm:ss
|
||||
timeFun(unixtimestamp) {
|
||||
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)
|
||||
if (this.listQuery.date === 3) {
|
||||
if (this.listQuery.reportTime?.length > 0) {
|
||||
this.listQuery.beginTime = this.listQuery.reportTime[0] ? this.listQuery.reportTime[0] : undefined
|
||||
this.listQuery.endTime = this.listQuery.reportTime[1] ? this.listQuery.reportTime[1] : undefined
|
||||
}
|
||||
}
|
||||
if (this.listQuery.date === 4) {
|
||||
if (this.listQuery.reportTime?.length > 0) {
|
||||
this.listQuery.beginTime = this.start ? this.start : undefined
|
||||
this.listQuery.endTime = this.end ? this.end : undefined
|
||||
}
|
||||
}
|
||||
if (this.currentMenu === '碲化镉工厂') {
|
||||
await prodTargetDiPage(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
|
||||
}
|
||||
})
|
||||
} 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) {
|
||||
this.listQuery.reportTime = val.reportTime ? val.reportTime : undefined;
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.current = 1;
|
||||
this.listQuery.size = 10;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'export':
|
||||
@ -615,38 +681,27 @@ export default {
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
// var xlsxParam = { raw: true };
|
||||
// /* 从表生成工作簿对象 */
|
||||
// import('xlsx').then(excel => {
|
||||
// var wb = excel.utils.table_to_book(
|
||||
// document.querySelector("#exportTable"),
|
||||
// xlsxParam
|
||||
// );
|
||||
// /* 获取二进制字符串作为输出 */
|
||||
// var wbout = excel.write(wb, {
|
||||
// bookType: "xlsx",
|
||||
// bookSST: true,
|
||||
// type: "array",
|
||||
// });
|
||||
// try {
|
||||
// FileSaver.saveAs(
|
||||
// //Blob 对象表示一个不可变、原始数据的类文件对象。
|
||||
// //Blob 表示的不一定是JavaScript原生格式的数据。
|
||||
// //File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
|
||||
// //返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
||||
// new Blob([wbout], { type: "application/octet-stream" }),
|
||||
// //设置导出文件名称
|
||||
// "许昌安彩日原片生产汇总.xlsx"
|
||||
// );
|
||||
// } catch (e) {
|
||||
// if (typeof console !== "undefined") console.log(e, wbout);
|
||||
// }
|
||||
// return wbout;
|
||||
// //do something......
|
||||
// })
|
||||
|
||||
},
|
||||
const queryParams = this.listQuery;
|
||||
queryParams.current = 1
|
||||
queryParams.size = 999
|
||||
if (this.facType === 0) {
|
||||
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportDiTargetExcel(queryParams);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '碲化镉工厂生产目标数据.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
} else {
|
||||
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportToTargetExcel(queryParams);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '铜铟镓硒工厂生产目标数据.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@ -667,7 +722,7 @@ export default {
|
||||
margin-top: 8px;
|
||||
}
|
||||
.app-container {
|
||||
margin: 0 16px 0;
|
||||
margin: 0;
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
padding: 16px 16px 0;
|
||||
|
Loading…
Reference in New Issue
Block a user