生产管理

This commit is contained in:
helloDy 2024-05-20 14:55:36 +08:00
parent 9e90449d1a
commit 14fa1823f2
9 changed files with 9132 additions and 8684 deletions

View File

@ -1,8 +1,8 @@
###
# @Author: zhp
# @Date: 2024-04-28 13:42:51
# @LastEditTime: 2024-05-08 08:57:33
# @LastEditors: zhp
# @LastEditTime: 2024-05-16 17:05:10
# @LastEditors: DY
# @Description:
###
# 开发环境配置
@ -12,8 +12,8 @@ ENV = 'development'
VUE_APP_TITLE = 芋道管理系统
# 芋道管理系统/开发环境
VUE_APP_BASE_API = 'http://192.168.1.61:48080'
# VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com'
# VUE_APP_BASE_API = 'http://192.168.1.61:48080'
VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -1,15 +1,8 @@
/*
* @Author: zhp
* @Date: 2024-05-07 08:54:59
* @LastEditTime: 2024-05-07 09:34:17
* @LastEditors: zhp
* @Description:
*/
/*
* @Author: zhp
* @Date: 2024-04-26 14:53:45
* @LastEditTime: 2024-05-06 14:53:04
* @LastEditors: zhp
* @LastEditTime: 2024-05-17 17:51:08
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
@ -23,10 +16,91 @@ 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'
})
}

View File

@ -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;

View File

@ -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
}
]
/**
* 代码生成模板类型
*/

View File

@ -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-13 15:43:45
* @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="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() {

View File

@ -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-16 14:15:46
* @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-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" 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" 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,
@ -177,88 +186,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 +218,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',
@ -340,131 +305,78 @@ 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.reportTime[1] - this.listQuery.reportTime[0] > 10*365*24*60*60*1000) {
this.$message({
message: '年份起止时间不能超过十年',
type: 'warning'
});
this.listQuery.reportTime = []
// console.log();
} else {
this.listQuery.beginTime = this.listQuery.reportTime[0]
this.listQuery.endTime = this.listQuery.reportTime[1]
}
// console.log(e);
},
onValueChange(picker, k) { // k
// console.log(this.listQuery.reportTime[0], this.listQuery.reportTime[1])
if (this.listQuery.reportTime[0] && this.listQuery.reportTime[1]) {
console.log(this.listQuery.reportTime[0].getTime() - 24 * 60 * 60 * 1000)
console.log(this.listQuery.reportTime)
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) {
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.reportTime[0].getTime() - 24 * 60 * 60 * 1000
this.listQuery.endTime = this.listQuery.reportTime[1].getTime() + 5 * 24 * 60 * 60 * 1000
}
}
}
},
changeDayTime() {
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) {
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()
// 线
@ -498,6 +410,10 @@ 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
},
add0(m) {
return m < 10 ? '0' + m : m
@ -526,8 +442,8 @@ export default {
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 +455,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 +518,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;

View File

@ -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-17 14:48:57
* @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,57 @@
</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 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-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 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-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 +113,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 +162,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 +217,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 +251,165 @@ 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
},
// 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.dataForm.factoryType = this.ftype
// this.getCurrentTime()
},
methods: {
init() {
formClear() {
if (this.$refs.dataForm !== undefined) {
this.$refs.dataForm.resetFields()
}
},
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.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.visible = true
},
// getCurrentTime() {
// // new Date().Format("yyyy-MM-dd HH:mm:ss")
// this.dataForm.logTime = new Date()
// // this.dataForm.logTime = year + "-" + month + "-" + day;
// console.log(this.dataForm.logTime);
// },
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,
// };
// });
// }
// } 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,
// };
// });
// })
// }
},
},
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>

View File

@ -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-17 17:54:54
* @LastEditors: DY
* @Description:
-->
<template>
<div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 31px)">
<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;">
<ButtonNav :menus="['碲化镉工厂', '铜铟镓硒工厂']" :button-mode="true" @change="currentMenu = $event">
</ButtonNav>
<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,50 @@
</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" @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" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :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">
<!-- <div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
</div> -->
<span>仅允许导入xlsxlsx格式文件</span>
<!-- <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link> -->
</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 +129,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 } from '@/api/produceData';
// import inputTable from './inputTable.vue';
import lineChart from './lineChart';
import moment from 'moment'
@ -110,28 +138,52 @@ 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: '碲化镉工厂',
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 + '/ip/prod-target/di-target-import-excel'
},
tableBtn: [
{
type: 'detail',
@ -142,9 +194,9 @@ export default {
btnName: '修改',
},
{
type: 'delete',
btnName: '删除',
},
type: 'delete',
btnName: '删除',
}
].filter((v) => v),
typeList: [
{
@ -159,27 +211,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,120 +301,106 @@ 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',
prop: 'molybdenumElectrodeInput',
label: '钼电极投入量(片)',
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: {}
};
@ -394,11 +411,60 @@ export default {
},
},
mounted() {
this.getDict()
// this.getDict()
// this.getCurrentYearFirst()
// this.getDataList()
},
methods: {
handleImport() {
this.upload.title = "生产目标导入";
this.upload.open = true;
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
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();
//
// let data = response.data;
// let text = '' + data.createUsernames.length;
// for (const username of data.createUsernames) {
// text += '<br />&nbsp;&nbsp;&nbsp;&nbsp;' + username;
// }
// text += '<br />' + data.updateUsernames.length;
// for (const username of data.updateUsernames) {
// text += '<br />&nbsp;&nbsp;&nbsp;&nbsp;' + username;
// }
// text += '<br />' + Object.keys(data.failureUsernames).length;
// for (const username in data.failureUsernames) {
// text += '<br />&nbsp;&nbsp;&nbsp;&nbsp;' + username + '' + data.failureUsernames[username];
// }
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
this.getDataList()
},
handleClick(val) {
if (val.type === "edit") {
this.addOrUpdateVisible = true;
@ -407,11 +473,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 +511,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 +563,50 @@ export default {
},
async getDataList() {
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
}
})
}
},
add0(m) {
return m < 10 ? '0' + m : m
},
format(shijianchuo) {
//shijianchuoparseInt
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)
},
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 +618,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 +659,7 @@ export default {
margin-top: 8px;
}
.app-container {
margin: 0 16px 0;
margin: 0;
background-color: #fff;
border-radius: 4px;
padding: 16px 16px 0;

16318
yarn.lock

File diff suppressed because it is too large Load Diff