update -报表页面

master
yinq 7 months ago
parent 9356a6ec60
commit be5d2051d7

@ -11,8 +11,13 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="产线" prop="productionLine"> <el-form-item label="产线" prop="productionLine">
<el-select v-model="form.productionLine" placeholder="选择产线"> <el-select v-model="form.productionLine" placeholder="请选择产线" clearable>
<el-option :key="i.value" :label="i.label" :value="i.value" v-for="i in option"></el-option> <el-option
v-for="item in productLineList"
:key="item.productLineCode"
:label="item.productLineName"
:value="item.productLineCode"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -84,22 +89,18 @@ export default {
year: new Date().getFullYear().toString(), year: new Date().getFullYear().toString(),
productionLine: 'CX_02' productionLine: 'CX_02'
}, },
option: [
{
value: 'CX_01',
label: '一号线'
},
{
value: 'CX_02',
label: '二号线'
},
],
tableTimeHead: [], tableTimeHead: [],
tableHead: ['今年1月', '去年1月', '今年2月', '去年2月', '今年3月', '去年3月', '今年4月', '去年4月', '今年5月', '去年5月', '今年6月', '去年6月', '今年7月', '去年7月', '今年8月', '去年8月', '今年9月', '去年9月', '今年10月', '去年10月', '今年11月', '去年11月', '今年12月', '去年12月',] tableHead: ['今年1月', '去年1月', '今年2月', '去年2月', '今年3月', '去年3月', '今年4月', '去年4月', '今年5月', '去年5月', '今年6月', '去年6月', '今年7月', '去年7月', '今年8月', '去年8月', '今年9月', '去年9月', '今年10月', '去年10月', '今年11月', '去年11月', '今年12月', '去年12月',],
// 线
productLineList: []
} }
}, },
created() { created() {
this.form.year = new Date().getFullYear().toString() this.form.year = new Date().getFullYear().toString()
findProductLineList({ productLineType: 1 }).then(response => {
this.productLineList = response.data
this.onSubmit();
})
}, },
methods: { methods: {
onSubmit() { onSubmit() {

@ -108,7 +108,7 @@
<dict-tag :options="dict.type.circulation_flag" :value="scope.row.productionUserFlag"/> <dict-tag :options="dict.type.circulation_flag" :value="scope.row.productionUserFlag"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="班组" align="center" prop="teamCode" v-if="columns[3].visible"/> <el-table-column label="班组" align="center" prop="teamName" v-if="columns[3].visible"/>
<el-table-column label="申请原因" align="center" prop="applyReason" v-if="columns[4].visible"/> <el-table-column label="申请原因" align="center" prop="applyReason" v-if="columns[4].visible"/>
<el-table-column label="申请时间" align="center" prop="applyTime" width="180" v-if="columns[5].visible"> <el-table-column label="申请时间" align="center" prop="applyTime" width="180" v-if="columns[5].visible">
<template slot-scope="scope"> <template slot-scope="scope">

@ -1,25 +1,36 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :inline="true" :model="form" ref="form"> <el-form :inline="true" :model="form" ref="form">
<el-form-item label="工厂" prop="factory"> <el-form-item label="工厂名称">
<el-select v-model="form.factory" placeholder="选择工厂"> <el-select v-model="form.FACTORY_CODE" placeholder="请选择工厂名称">
<el-option :label="i.label" :value="i.value" v-for="i in option"></el-option> <el-option
v-for="item in factoryList"
:key="item.factoryCode"
:label="item.factoryName"
:value="item.factoryCode"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="产线" prop="productionLine"> <el-form-item label="产线" prop="productionLine">
<el-select v-model="form.productionLine" placeholder="选择产线"> <el-select v-model="form.productionLine" placeholder="请选择产线" clearable>
<el-option :label="i.label" :value="i.value" v-for="i in option1"></el-option> <el-option
v-for="item in productLineList"
:key="item.productLineCode"
:label="item.productLineName"
:value="item.productLineCode"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="下线时间" prop="date"> <el-form-item label="下线日期" >
<el-date-picker <el-date-picker
v-model="form.date" v-model="form.date"
type="daterange" type="daterange"
format="yyyy-mm-dd" format="yyyy-MM-dd"
value-format="yyyy-mm-dd" value-format="yyyy-MM-dd"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期"> end-placeholder="结束日期"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -29,19 +40,23 @@
</el-form> </el-form>
<el-table <el-table
:data="tableData" :data="tableData"
style="width: 100%"> style="width: 100%"
>
<el-table-column <el-table-column
type="index" type="index"
label="序号" label="序号"
width="180"> width="180"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="material_MODEL" prop="material_MODEL"
label="产品型号"> label="产品型号"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="q_SUM" prop="q_SUM"
label="问题数量"> label="问题数量"
>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
@ -59,50 +74,52 @@
</template> </template>
<script> <script>
import Chart from "@/components/board/Chart"; import Chart from '@/components/board/Chart'
import { highFaultList } from '@//api/report/reportAPI' import { highFaultList } from '@//api/report/reportAPI'
import { findProductLineList } from '@//api/base/productLine'
import { parseTime } from '@//utils/ruoyi'
import { findFactoryList } from '@//api/base/factory'
export default { export default {
name: 'ProductOffLine', name: 'ProductOffLine',
components:{ components: {
Chart, Chart
}, },
data() { data() {
return { return {
total:0, total: 0,
form: { form: {
pageNum:1, pageNum: 1,
pageSize:10, pageSize: 10,
factory:'1301', FACTORY_CODE: '1301',
productionLine:'CX_02', productionLine: 'CX_02',
date:[] date: []
}, },
option: [ tableData: [],
{ //
value: '1301', factoryList: [],
label: '工厂一' // 线
} productLineList: []
],
option1: [
{
value: 'CX_01',
label: '产线一'
},
{
value: 'CX_02',
label: '产线二'
},
],
tableData: []
} }
}, },
mounted() { created() {
const nowDate = parseTime(new Date(), '{y}-{m}-{d}')
this.form.date[0] = nowDate
this.form.date[1] = nowDate
findFactoryList().then(response => {
this.factoryList = response.data
})
findProductLineList({ productLineType: 1 }).then(response => {
this.productLineList = response.data
this.getList() this.getList()
})
}, },
methods: { methods: {
getList(){ getList() {
highFaultList({ beginBeginTime: this.form?.date?.[0], endBeginTime: this.form?.date?.[1] highFaultList({
, FACTORY_CODE: this.form.factory , PRODUCT_LINE_CODE: this.form.productionLine}).then(response => { beginBeginTime: this.form?.date?.[0], endBeginTime: this.form?.date?.[1]
, FACTORY_CODE: this.form.factory, PRODUCT_LINE_CODE: this.form.productionLine
}).then(response => {
// //
console.log(response) console.log(response)
this.total = response?.total || 0 this.total = response?.total || 0
@ -123,31 +140,31 @@ export default {
}, },
xAxis: { xAxis: {
type: 'value', type: 'value',
position:'top', position: 'top',
boundaryGap: [0, 0.01] boundaryGap: [0, 0.01]
}, },
yAxis: { yAxis: {
type: 'category', type: 'category',
data: response.data.map(v=>v.material_MODEL).reverse() data: response.data.map(v => v.material_MODEL).reverse()
}, },
series: [ series: [
{ {
name: '数量', name: '数量',
type: 'bar', type: 'bar',
data: response.data.map(v=>v.q_SUM).reverse() data: response.data.map(v => v.q_SUM).reverse()
}, }
] ]
}) })
}); })
}, },
resetForm(formName) { resetForm(formName) {
this.$refs[formName].resetFields(); this.$refs[formName].resetFields()
} }
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
/deep/ .el-table .cell{ /deep/ .el-table .cell {
text-align: center !important; text-align: center !important;
} }
</style> </style>

@ -56,6 +56,7 @@
<script> <script>
import Chart from "@/components/board/Chart"; import Chart from "@/components/board/Chart";
import {highFaultList, weldLeakRateList} from '@//api/report/reportAPI' import {highFaultList, weldLeakRateList} from '@//api/report/reportAPI'
import { findProductLineList } from '@//api/base/productLine'
export default { export default {
name: 'ProductOffLine', name: 'ProductOffLine',
@ -89,8 +90,10 @@ export default {
} }
, ,
mounted() { mounted() {
} },
, created() {
this.getList();
},
methods: { methods: {
getList() { getList() {
weldLeakRateList({year: this.form.year,}).then(response => { weldLeakRateList({year: this.form.year,}).then(response => {

Loading…
Cancel
Save