修改报表

master
夜笙歌 7 months ago
parent a376558d35
commit 8db45a9056

@ -12,7 +12,7 @@
</el-form-item>
<el-form-item label="产线" prop="productionLine">
<el-select v-model="form.productionLine" placeholder="选择产线">
<el-option :label="i.label" :value="i.value" v-for="i in option"></el-option>
<el-option :key="i.value" :label="i.label" :value="i.value" v-for="i in option"></el-option>
</el-select>
</el-form-item>
<el-form-item>
@ -29,7 +29,7 @@
label="工序"
width="150">
</el-table-column>
<el-table-column :label="i" v-for="(i,k) in tableHead">
<el-table-column :label="i" v-for="(i,k) in tableHead" :key="i">
<el-table-column
label="不良数"
width="120">
@ -111,7 +111,6 @@ export default {
children: response.data.filter(val => val.PROCESS_NAME === v)
}
})
console.log(data)
this.tableData = data
});
},
@ -125,7 +124,6 @@ export default {
head.push(this.form.year + '-' + v)
head.push((parseFloat(this.form.year) - 1) + '-' + v)
})
console.log(head)
this.tableTimeHead = head
},
}

@ -8,11 +8,11 @@
placeholder="选择年">
</el-date-picker>
</el-form-item>
<el-form-item label="周期" prop="period">
<el-select v-model="form.period" placeholder="选择周期">
<el-option :label="i.label" :value="i.value" v-for="i in option"></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="周期" prop="period">-->
<!-- <el-select v-model="form.period" placeholder="选择周期">-->
<!-- <el-option :label="i.label" :value="i.value" v-for="i in option"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" @click="getList"></el-button>
<el-button @click="resetForm('form')"></el-button>
@ -23,15 +23,19 @@
:data="tableData"
style="width: 100%">
<el-table-column
prop="type"
label="工序"
prop="productLineName"
label="产线"
width="150">
</el-table-column>
<el-table-column
v-for="i in tableHead"
:prop="i.value"
:label="i.label"
v-for="i in 52"
:label="'第'+(i)+'周'"
width="120">
<template slot-scope="scope">
{{
((tableData.find(v => v.productLineName === scope.row.productLineName).children.find(r => r.WEEK_NUMBER === i) || {}).REPAIR_RATE) || '0'
}}%
</template>
</el-table-column>
</el-table>
@ -62,6 +66,7 @@ export default {
return {
total: 100,
form: {
year: new Date().getFullYear().toString(),
pageNum: 1,
pageSize: 10
},
@ -79,62 +84,37 @@ export default {
label: '年'
},
],
tableData: [
{
type: '1',
column1: 1,
},
{
type: '1',
column1: 1,
},
{
type: '1',
column1: 1,
},
{
type: '1',
column1: 1,
},
{
type: '1',
column1: 1,
},
],
tableHead: [
{
label: '第1周',
value: 'column1',
},
{
label: '第2周',
value: 'column1',
},
{
label: '第3周',
value: 'column1',
},
{
label: '第4周',
value: 'column1',
},
{
label: '第5周',
value: 'column1',
},
{
label: '第6周',
value: 'column1',
},
]
tableData: [],
}
}
,
mounted() {
}
,
methods: {
getList() {
weldLeakRateList({year: this.form.year,}).then(response => {
//
let productLineArr = [...new Set(response.data.map(v => v.PRODUCT_LINE_NAME))]
let data = productLineArr.map(v => {
return {
productLineName: v,
children: response.data.filter(val => val.PRODUCT_LINE_NAME === v)
}
})
this.tableData = data
this.$refs.chart1.setData({
tooltip: {
trigger: "axis",
formatter: (v)=>{
console.log(v)
return v[0].axisValueLabel+'<br />'+v.map(e=>{
return `
${e.marker}${e.seriesName} : ${e.data}%\n
`
}).join('')
}
},
legend: {},
grid: {
@ -147,7 +127,7 @@ export default {
},
xAxis: {
type: "category",
data: [100, 200, 20, 30, 60, 89],
data: Array(52).fill('').map((v, k) => '第' + (k + 1) + '周'),
axisLine: {
lineStyle: {
color: "#999",
@ -178,99 +158,28 @@ export default {
show: false,
},
},
series: [
{
name: "冰箱A线",
series: data.map(v => {
return {
name: v.productLineName,
type: "line",
data: [800, 900, 220, 130, 660, 289],
data: v.children.map(r => parseFloat(r.REPAIR_RATE)),
color: "#F58080",
lineStyle: {
normal: {
width: 2,
color: {
type: "linear",
colorStops: [
{
offset: 0,
color: "#FFCAD4", // 0%
},
{
offset: 0.4,
color: "#F58080", // 100%
},
{
offset: 1,
color: "#F58080", // 100%
},
],
globalCoord: false, // false
},
},
},
itemStyle: {
normal: {
color: "#F58080",
// color: "#F58080",
borderWidth: 10,
/*shadowColor: 'rgba(72,216,191, 0.3)',
shadowBlur: 100,*/
borderColor: "#F58080",
// borderColor: "#F58080",
},
},
smooth: true,
},
{
name: "冰箱B线",
type: "line",
data: [123, 568, 111, 222, 123, 56],
lineStyle: {
normal: {
width: 2,
color: {
type: "linear",
colorStops: [
{
offset: 0,
color: "#AAF487", // 0%
},
{
offset: 0.4,
color: "#47D8BE", // 100%
},
{
offset: 1,
color: "#47D8BE", // 100%
},
],
globalCoord: false, // false
},
shadowColor: "rgba(71,216,190, 0.5)",
shadowBlur: 10,
shadowOffsetY: 7,
},
},
itemStyle: {
normal: {
color: "#AAF487",
borderWidth: 10,
/*shadowColor: 'rgba(72,216,191, 0.3)',
shadowBlur: 100,*/
borderColor: "#AAF487",
},
},
smooth: true,
},
],
})
}
,
methods: {
getList() {
weldLeakRateList({ year: '\'2022\'', }).then(response => {
//
console.log(response)
this.loading = false
}),
})
});
}
,

Loading…
Cancel
Save