projects/mescc/dy #21

Merged
juzi merged 2 commits from projects/mescc/dy into projects/mescc/develop 2024-05-22 16:52:01 +08:00
9 changed files with 281 additions and 202 deletions

View File

@ -1,7 +1,7 @@
###
# @Author: zhp
# @Date: 2024-04-28 13:42:51
# @LastEditTime: 2024-05-20 14:56:40
# @LastEditTime: 2024-05-22 16:29:35
# @LastEditors: DY
# @Description:
###

View File

@ -1,7 +1,7 @@
/*
* @Author: zhp
* @Date: 2024-05-07 08:54:59
* @LastEditTime: 2024-05-20 14:56:56
* @LastEditTime: 2024-05-22 16:31:08
* @LastEditors: DY
* @Description:
*/
@ -105,6 +105,32 @@ export function delTarget(id) {
})
}
// 导入铜铟镓硒工厂
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',

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2024-05-13 15:43:45
* @LastEditTime: 2024-05-20 18:02:10
* @LastEditors: DY
* @Description:
-->
@ -111,7 +111,7 @@
<!-- <p class="text">{{ dataForm.productName }}</p> -->
</el-col>
<el-col :span="6">
<p class="title">标准组件人均产量</p>
<p class="title">标准组件平均功率</p>
<!-- <p class="text">{{ dataForm.productName }}</p> -->
</el-col>
</el-row>

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-05-16 14:15:46
* @LastEditTime: 2024-05-22 15:25:11
* @LastEditors: DY
* @Description:
-->
@ -15,7 +15,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item v-show="listQuery.date === 0" label="时间范围" prop="reportTime">
<el-form-item v-show="listQuery.date === 0 || listQuery.date === ''" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="datetimerange" range-separator=""
start-placeholder="开始日期" value-format="timestamp" @change="changeDayTime" end-placeholder="结束日期">
</el-date-picker>
@ -38,11 +38,11 @@
</el-date-picker>
</el-form-item>
<el-form-item v-show="listQuery.date === 3" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.start" value-format="timestamp" type="year"
<el-date-picker size="small" clearable v-model="listQuery.start" format="yyyy-MM-dd" value-format="timestamp" type="year"
placeholder="开始时间">
</el-date-picker>
~
<el-date-picker size="small" clearable v-model="listQuery.end" value-format="timestamp" 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>
@ -132,7 +132,9 @@ export default {
// reportType: 2,
beginTime: undefined,
endTime:undefined,
reportTime: []
reportTime: [],
start: undefined,
end: undefined
},
detailOrUpdateVisible:false,
date1: undefined,
@ -283,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) {
@ -309,25 +310,27 @@ export default {
// },
getYear(e) {
if (this.listQuery.reportTime[1] - this.listQuery.reportTime[0] > 10*365*24*60*60*1000) {
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.reportTime[0]
this.listQuery.endTime = this.listQuery.reportTime[1]
this.listQuery.beginTime = this.listQuery.start
this.listQuery.endTime = this.listQuery.end
}
// 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]) {
if (this.listQuery.start && this.listQuery.end) {
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.date2 = moment(this.listQuery.reportTime[1].getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
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)
@ -336,8 +339,8 @@ export default {
type: 'warning'
});
} 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
this.listQuery.beginTime = this.listQuery.start.getTime() - 24 * 60 * 60 * 1000
this.listQuery.endTime = this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000
}
}
},
@ -377,12 +380,11 @@ export default {
console.log(this.listQuery.reportTime[0])
}
},
async getDict() {
this.$refs.lineChart.initChart()
// async getDict() {
// 线
// const res = await getCorePLList();
// this.proLineList = res.data;
},
// },
//
multipliedByHundred(str) {
console.log(str);
@ -411,32 +413,42 @@ export default {
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] + '日' : '--'
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) {
//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)
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;

View File

@ -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)
}
}
}

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-04-17 16:31:51
* @LastEditTime: 2024-05-17 14:48:57
* @LastEditTime: 2024-05-20 18:09:09
* @LastEditors: DY
* @Description:
-->
@ -75,14 +75,20 @@
</el-row>
<el-row :gutter="24" style="padding: 0 32px;">
<el-col :span="6">
<el-form-item label="FTO投入量" prop="ftoInput">
<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="chipCssMarriageRate">
<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="chipOee">
@ -316,7 +322,8 @@ export default {
bipvChipUtilizationRate: undefined,
bipvInsideMaterialCost: undefined,
bipvOeeMaterialCost: undefined,
bipvComprehensiveMaterialCost: undefined
bipvComprehensiveMaterialCost: undefined,
molybdenumElectrodeInput: undefined
},
// materialList: [],
dataRule: {
@ -330,7 +337,6 @@ export default {
};
},
mounted() {
this.dataForm.factoryType = this.ftype
// this.getCurrentTime()
},
methods: {
@ -388,6 +394,7 @@ export default {
},
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 => {

View File

@ -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")

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-05-17 17:54:54
* @LastEditTime: 2024-05-22 16:22:57
* @LastEditors: DY
* @Description:
-->
@ -92,26 +92,38 @@
:total="listQuery.total"
@pagination="getDataList"
/>
<detail-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" @destroy="detailOrUpdateVisible = false" />
<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" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<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">
<!-- <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>
<!-- <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>
@ -130,7 +142,7 @@
<script>
import { parseTime } from '@/utils/ruoyi';
import { prodTargetDiPage, prodTargetToPage, exportDiTargetExcel, exportToTargetExcel, delTarget } from '@/api/produceData';
import { prodTargetDiPage, prodTargetToPage, exportDiTargetExcel, exportToTargetExcel, delTarget, importToTarget, importDiTarget } from '@/api/produceData';
// import inputTable from './inputTable.vue';
import lineChart from './lineChart';
import moment from 'moment'
@ -153,6 +165,7 @@ export default {
dhgfactoryList,
tyjxfactoryList,
currentMenu: '碲化镉工厂',
fileList: [],
start: undefined,
end: undefined,
listQuery: {
@ -182,7 +195,7 @@ export default {
//
headers: getBaseHeader(),
//
url: process.env.VUE_APP_BASE_API + '/ip/prod-target/di-target-import-excel'
url: process.env.VUE_APP_BASE_API + '/admin-api/ip/prod-target/di-target-import-excel'
},
tableBtn: [
{
@ -332,8 +345,8 @@ export default {
showOverflowtooltip: true
},
{
prop: 'molybdenumElectrodeInput',
label: '钼电极投入量(片)',
prop: 'ftoInput',
label: 'FTO投入量(片)',
minWidth: 150,
showOverflowtooltip: true
},
@ -405,26 +418,85 @@ export default {
// 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.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 />&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();
// },
//
handleFileSuccess(response, file, fileList) {
if (response.code !== 0) {
this.$modal.msgError(response.msg)
@ -433,22 +505,8 @@ export default {
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();
this.$message.success('导入成功!')
this.getDataList()
},
//
submitFileForm() {
@ -463,6 +521,11 @@ export default {
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) {

View File

@ -975,20 +975,13 @@
"resolved" "https://registry.npmmirror.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz"
"version" "0.8.0"
"@babel/runtime@^7.11.0", "@babel/runtime@^7.3.1", "@babel/runtime@^7.8.4":
"@babel/runtime@^7.11.0", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4":
"integrity" "sha512-+BIznRzyqBf+2wCTxcKE3wDjfGeCoVE61KSHGpkzqrLi8qxqFwBeUFyId2cxkTmm55fzDGnm0+yCxaxygrLUnQ=="
"resolved" "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.24.1.tgz"
"version" "7.24.1"
dependencies:
"regenerator-runtime" "^0.14.0"
"@babel/runtime@^7.5.5":
version "7.24.5"
resolved "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.24.5.tgz#230946857c053a36ccc66e1dd03b17dd0c4ed02c"
integrity sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==
dependencies:
regenerator-runtime "^0.14.0"
"@babel/template@^7.22.15", "@babel/template@^7.23.9", "@babel/template@^7.24.0":
"integrity" "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA=="
"resolved" "https://registry.npmmirror.com/@babel/template/-/template-7.24.0.tgz"
@ -1082,16 +1075,16 @@
"wrap-ansi-cjs" "npm:wrap-ansi@^7.0.0"
"@jiaminghi/bezier-curve@*":
version "0.0.9"
resolved "https://registry.npmmirror.com/@jiaminghi/bezier-curve/-/bezier-curve-0.0.9.tgz#5196aca93c8b061a612b4c3eabcedf9490cef6ee"
integrity sha512-u9xJPOEl6Dri2E9FfmJoGxYQY7vYJkURNX04Vj64tdi535tPrpkuf9Sm0lNr3QTKdHQh0DdNRsaa62FLQNQEEw==
"integrity" "sha512-u9xJPOEl6Dri2E9FfmJoGxYQY7vYJkURNX04Vj64tdi535tPrpkuf9Sm0lNr3QTKdHQh0DdNRsaa62FLQNQEEw=="
"resolved" "https://registry.npmmirror.com/@jiaminghi/bezier-curve/-/bezier-curve-0.0.9.tgz"
"version" "0.0.9"
dependencies:
"@babel/runtime" "^7.5.5"
"@jiaminghi/c-render@^0.4.3":
version "0.4.3"
resolved "https://registry.npmmirror.com/@jiaminghi/c-render/-/c-render-0.4.3.tgz#982ebd8f71b443bb9507834227834973ebd9b6d8"
integrity sha512-FJfzj5hGj7MLqqqI2D7vEzHKbQ1Ynnn7PJKgzsjXaZpJzTqs2Yw5OSeZnm6l7Qj7jyPAP53lFvEQNH4o4j6s+Q==
"integrity" "sha512-FJfzj5hGj7MLqqqI2D7vEzHKbQ1Ynnn7PJKgzsjXaZpJzTqs2Yw5OSeZnm6l7Qj7jyPAP53lFvEQNH4o4j6s+Q=="
"resolved" "https://registry.npmmirror.com/@jiaminghi/c-render/-/c-render-0.4.3.tgz"
"version" "0.4.3"
dependencies:
"@babel/runtime" "^7.5.5"
"@jiaminghi/bezier-curve" "*"
@ -1099,30 +1092,30 @@
"@jiaminghi/transition" "*"
"@jiaminghi/charts@*":
version "0.2.18"
resolved "https://registry.npmmirror.com/@jiaminghi/charts/-/charts-0.2.18.tgz#63ded95200789fc1a1fd04b7fd9e56f58d22d90f"
integrity sha512-K+HXaOOeWG9OOY1VG6M4mBreeeIAPhb9X+khG651AbnwEwL6G2UtcAQ8GWCq6GzhczcLwwhIhuaHqRygwHC0sA==
"integrity" "sha512-K+HXaOOeWG9OOY1VG6M4mBreeeIAPhb9X+khG651AbnwEwL6G2UtcAQ8GWCq6GzhczcLwwhIhuaHqRygwHC0sA=="
"resolved" "https://registry.npmmirror.com/@jiaminghi/charts/-/charts-0.2.18.tgz"
"version" "0.2.18"
dependencies:
"@babel/runtime" "^7.5.5"
"@jiaminghi/c-render" "^0.4.3"
"@jiaminghi/color@*":
version "1.1.3"
resolved "https://registry.npmmirror.com/@jiaminghi/color/-/color-1.1.3.tgz#a2336750d1266155ffe80375c58c26fdec495611"
integrity sha512-ZY3hdorgODk4OSTbxyXBPxAxHPIVf9rPlKJyK1C1db46a50J0reFKpAvfZG8zMG3lvM60IR7Qawgcu4ZDO3+Hg==
"integrity" "sha512-ZY3hdorgODk4OSTbxyXBPxAxHPIVf9rPlKJyK1C1db46a50J0reFKpAvfZG8zMG3lvM60IR7Qawgcu4ZDO3+Hg=="
"resolved" "https://registry.npmmirror.com/@jiaminghi/color/-/color-1.1.3.tgz"
"version" "1.1.3"
"@jiaminghi/data-view@^2.10.0":
version "2.10.0"
resolved "https://registry.npmmirror.com/@jiaminghi/data-view/-/data-view-2.10.0.tgz#2146d8fc71b9f24be808238ca050ddb7a4c8949f"
integrity sha512-Cud2MTiMcqc5k2KWabR/svuVQmXHANqURo+yj40370/LdI/gyUJ6LG203hWXEnT1nMCeiv/SLVmxv3PXLScCeA==
"integrity" "sha512-Cud2MTiMcqc5k2KWabR/svuVQmXHANqURo+yj40370/LdI/gyUJ6LG203hWXEnT1nMCeiv/SLVmxv3PXLScCeA=="
"resolved" "https://registry.npmmirror.com/@jiaminghi/data-view/-/data-view-2.10.0.tgz"
"version" "2.10.0"
dependencies:
"@babel/runtime" "^7.5.5"
"@jiaminghi/charts" "*"
"@jiaminghi/transition@*":
version "1.1.11"
resolved "https://registry.npmmirror.com/@jiaminghi/transition/-/transition-1.1.11.tgz#576d8af092434b34201eba5eaecc79dd33c8ad8c"
integrity sha512-owBggipoHMikDHHDW5Gc7RZYlVuvxHADiU4bxfjBVkHDAmmck+fCkm46n2JzC3j33hWvP9nSCAeh37t6stgWeg==
"integrity" "sha512-owBggipoHMikDHHDW5Gc7RZYlVuvxHADiU4bxfjBVkHDAmmck+fCkm46n2JzC3j33hWvP9nSCAeh37t6stgWeg=="
"resolved" "https://registry.npmmirror.com/@jiaminghi/transition/-/transition-1.1.11.tgz"
"version" "1.1.11"
dependencies:
"@babel/runtime" "^7.5.5"