生产检验统计表加名称规格型号列
This commit is contained in:
parent
6c795c0127
commit
fa87c5fdce
|
|
@ -3,30 +3,14 @@
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<el-select v-model="queryType" clearable @change="queryTypeChange">
|
<el-select v-model="queryType" clearable @change="queryTypeChange">
|
||||||
<el-option v-for="item in typeOptions"
|
<el-option v-for="item in typeOptions" :key="item" :label="item" :value="item">
|
||||||
:key="item"
|
|
||||||
:label="item"
|
|
||||||
:value="item"
|
|
||||||
>
|
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-date-picker
|
<el-date-picker v-if="queryType == '月'" v-model="queryDate" type="month" placeholder="查询月期"
|
||||||
v-if="queryType=='月'"
|
value-format="YYYY-MM" style="width:100%">
|
||||||
v-model="queryDate"
|
|
||||||
type="month"
|
|
||||||
placeholder="查询月期"
|
|
||||||
value-format="YYYY-MM"
|
|
||||||
style="width:100%"
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
<el-date-picker
|
<el-date-picker v-if="queryType == '年'" v-model="queryDate" type="year" placeholder="查询年份"
|
||||||
v-if="queryType=='年'"
|
value-format="YYYY" style="width:100%">
|
||||||
v-model="queryDate"
|
|
||||||
type="year"
|
|
||||||
placeholder="查询年份"
|
|
||||||
value-format="YYYY"
|
|
||||||
style="width:100%"
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -39,9 +23,15 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="16">
|
<el-col :lg="16">
|
||||||
<el-table :data="tableData7">
|
<el-table :data="tableData7">
|
||||||
<el-table-column label="年" prop="年" v-if="queryType=='年'">
|
<el-table-column label="年" prop="年" v-if="queryType == '年'" width="60">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="月" prop="月" v-else>
|
<el-table-column label="月" prop="月" v-else width="60">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物料名" prop="物料名">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="型号" prop="型号">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="规格" prop="规格">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="出料数" prop="出料数">
|
<el-table-column label="出料数" prop="出料数">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -77,9 +67,15 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="16">
|
<el-col :lg="16">
|
||||||
<el-table :data="tableData10">
|
<el-table :data="tableData10">
|
||||||
<el-table-column label="年" prop="年" v-if="queryType=='年'">
|
<el-table-column label="年" prop="年" v-if="queryType == '年'" width="60">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="月" prop="月" v-else>
|
<el-table-column label="月" prop="月" v-else width="60">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物料名" prop="物料名">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="型号" prop="型号">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="规格" prop="规格">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="出料数" prop="生产数">
|
<el-table-column label="出料数" prop="生产数">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -119,9 +115,15 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="16">
|
<el-col :lg="16">
|
||||||
<el-table :data="tableData8">
|
<el-table :data="tableData8">
|
||||||
<el-table-column label="年" prop="年" v-if="queryType=='年'">
|
<el-table-column label="年" prop="年" v-if="queryType == '年'" width="60">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="月" prop="月" v-else>
|
<el-table-column label="月" prop="月" v-else width="60">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物料名" prop="物料名">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="型号" prop="型号">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="规格" prop="规格">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="出料数" prop=" 生产数">
|
<el-table-column label="出料数" prop=" 生产数">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -159,216 +161,215 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import scEcharts from '@/components/scEcharts';
|
import scEcharts from '@/components/scEcharts';
|
||||||
export default {
|
export default {
|
||||||
name: 'chart',
|
name: 'chart',
|
||||||
components: {
|
components: {
|
||||||
scEcharts
|
scEcharts
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
queryType: '月',
|
||||||
|
queryDate: '',
|
||||||
|
start_date: '',
|
||||||
|
end_date: '',
|
||||||
|
currentYear: '',
|
||||||
|
currentMonth: '',
|
||||||
|
typeOptions: ['月', '年'],
|
||||||
|
option1: {
|
||||||
|
title: {
|
||||||
|
text: '7车间',
|
||||||
|
// subtext: '',
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'item'
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
name: '7车间预制棒',
|
||||||
|
type: 'pie',
|
||||||
|
radius: ['40%', '70%'],
|
||||||
|
center: ['50%', '60%'],
|
||||||
|
label: false,
|
||||||
|
data: [
|
||||||
|
{ value: 0, name: '合格数' },
|
||||||
|
{ value: 0, name: '炸纹' },
|
||||||
|
{ value: 0, name: '条纹' },
|
||||||
|
{ value: 0, name: '气泡' },
|
||||||
|
{ value: 0, name: '弯曲' },
|
||||||
|
{ value: 0, name: '其他' },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
option2: {
|
||||||
|
title: {
|
||||||
|
text: '10车间',
|
||||||
|
// subtext: '',
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'item'
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
name: '10车间预制管',
|
||||||
|
type: 'pie',
|
||||||
|
radius: ['40%', '70%'],
|
||||||
|
center: ['50%', '60%'],
|
||||||
|
label: false,
|
||||||
|
data: [
|
||||||
|
{ value: 0, name: '合格数' },
|
||||||
|
{ value: 0, name: '条纹' },
|
||||||
|
{ value: 0, name: '断裂' },
|
||||||
|
{ value: 0, name: '偏壁' },
|
||||||
|
{ value: 0, name: '大小头' },
|
||||||
|
{ value: 0, name: '结石' },
|
||||||
|
{ value: 0, name: '气线' },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
option3: {
|
||||||
|
title: {
|
||||||
|
text: '退火',
|
||||||
|
// subtext: '',
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'item'
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
name: '退火预制管',
|
||||||
|
type: 'pie',
|
||||||
|
radius: ['40%', '70%'],
|
||||||
|
center: ['50%', '60%'],
|
||||||
|
label: false,
|
||||||
|
data: [
|
||||||
|
{ value: 0, name: '合格数' },
|
||||||
|
{ value: 0, name: '椭圆/弯曲' },
|
||||||
|
{ value: 0, name: '条纹' },
|
||||||
|
{ value: 0, name: '断裂' },
|
||||||
|
{ value: 0, name: '偏壁' },
|
||||||
|
{ value: 0, name: '大小头' },
|
||||||
|
{ value: 0, name: '结石' },
|
||||||
|
{ value: 0, name: '气线' },
|
||||||
|
{ value: 0, name: '箱中破' },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tableData7: [],
|
||||||
|
tableData10: [],
|
||||||
|
tableData8: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
let date = new Date();
|
||||||
|
let year = date.getFullYear();
|
||||||
|
let month = date.getMonth() + 1;
|
||||||
|
let days = new Date(year, month, 0).getDate();
|
||||||
|
console.log(year, month, days)
|
||||||
|
this.currentYear = year;
|
||||||
|
this.currentMonth = month;
|
||||||
|
this.start_date = year + '-' + month + '-01';
|
||||||
|
this.end_date = year + '-' + month + '-' + new Date(year, month, 0).getDate();
|
||||||
|
this.getData();
|
||||||
|
this.getData7();
|
||||||
|
this.getData10();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
queryTypeChange(value) {
|
||||||
|
console.log(value)
|
||||||
|
this.queryDate = '';
|
||||||
},
|
},
|
||||||
data() {
|
getData() {
|
||||||
return {
|
let that = this;
|
||||||
queryType:'月',
|
that.tableData8 = [];
|
||||||
queryDate:'',
|
let exec = that.queryType == '月' ? 'lineMonth' : 'lineYear';
|
||||||
start_date:'',
|
let obj = {
|
||||||
end_date:'',
|
query: { start_date: this.start_date, end_date: this.end_date, dept_name: "8车间" },
|
||||||
currentYear:'',
|
};
|
||||||
currentMonth:'',
|
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
|
||||||
typeOptions:['月','年'],
|
console.log('退火车间统计:', res);
|
||||||
option1: {
|
let data = res.data2.ds0;
|
||||||
title: {
|
if (data.length > 0) {
|
||||||
text: '7车间',
|
that.tableData8 = data;
|
||||||
// subtext: '',
|
that.option1.series.data[0].value = data[0].合格数;
|
||||||
},
|
that.option1.series.data[1].value = data[0].弯曲;
|
||||||
tooltip: {
|
that.option1.series.data[2].value = data[0].条纹;
|
||||||
trigger: 'item'
|
that.option1.series.data[3].value = data[0].断裂;
|
||||||
},
|
that.option1.series.data[4].value = data[0].偏壁;
|
||||||
series: {
|
that.option1.series.data[5].value = data[0].大小头;
|
||||||
name: '7车间预制棒',
|
that.option1.series.data[6].value = data[0].结石;
|
||||||
type: 'pie',
|
that.option1.series.data[7].value = data[0].气线;
|
||||||
radius: ['40%', '70%'],
|
that.option1.series.data[8].value = data[0].箱中破;
|
||||||
center: ['50%', '60%'],
|
}
|
||||||
label: false,
|
// debugger;
|
||||||
data: [
|
});
|
||||||
{value: 0, name: '合格数'},
|
},
|
||||||
{value: 0, name: '炸纹'},
|
getData7() {
|
||||||
{value: 0, name: '条纹'},
|
let that = this;
|
||||||
{value: 0, name: '气泡'},
|
that.tableData7 = [];
|
||||||
{value: 0, name: '弯曲'},
|
let obj = {
|
||||||
{value: 0, name: '其他'},
|
query: { start_date: this.start_date, end_date: this.end_date, dept_name: "7车间" },
|
||||||
]
|
};
|
||||||
}
|
let exec = that.queryType == '月' ? 'lineMonth' : 'lineYear';
|
||||||
},
|
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
|
||||||
option2: {
|
console.log('7生产车间统计:', res);
|
||||||
title: {
|
let data = res.data2.ds0;
|
||||||
text: '10车间',
|
if (data.length > 0) {
|
||||||
// subtext: '',
|
that.tableData7 = data;
|
||||||
},
|
that.option1.series.data[0].value = data[0].合格数;
|
||||||
tooltip: {
|
that.option1.series.data[1].value = data[0].炸纹;
|
||||||
trigger: 'item'
|
that.option1.series.data[2].value = data[0].条纹;
|
||||||
},
|
that.option1.series.data[3].value = data[0].气泡;
|
||||||
series: {
|
that.option1.series.data[4].value = data[0].弯曲;
|
||||||
name: '10车间预制管',
|
that.option1.series.data[5].value = data[0].其他;
|
||||||
type: 'pie',
|
}
|
||||||
radius: ['40%', '70%'],
|
});
|
||||||
center: ['50%', '60%'],
|
},
|
||||||
label: false,
|
getData10() {
|
||||||
data: [
|
let that = this;
|
||||||
{value: 0, name: '合格数'},
|
that.tableData10 = [];
|
||||||
{value: 0, name: '条纹'},
|
let obj = {
|
||||||
{value: 0, name: '断裂'},
|
query: { start_date: this.start_date, end_date: this.end_date, dept_name: "10车间" },
|
||||||
{value: 0, name: '偏壁'},
|
};
|
||||||
{value: 0, name: '大小头'},
|
let exec = that.queryType == '月' ? 'lineMonth' : 'lineYear';
|
||||||
{value: 0, name: '结石'},
|
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
|
||||||
{value: 0, name: '气线'},
|
console.log('10生产车间统计:', res);
|
||||||
]
|
let data = res.data2.ds0;
|
||||||
}
|
if (data.length > 0) {
|
||||||
},
|
that.tableData10 = data;
|
||||||
option3: {
|
that.option2.series.data[0].value = data[0].合格数;
|
||||||
title: {
|
that.option2.series.data[1].value = data[0].断裂;
|
||||||
text: '退火',
|
that.option2.series.data[2].value = data[0].条纹;
|
||||||
// subtext: '',
|
that.option2.series.data[3].value = data[0].偏壁;
|
||||||
},
|
that.option2.series.data[4].value = data[0].大小头;
|
||||||
tooltip: {
|
that.option2.series.data[5].value = data[0].结石;
|
||||||
trigger: 'item'
|
that.option2.series.data[6].value = data[0].气线;
|
||||||
},
|
}
|
||||||
series: {
|
});
|
||||||
name: '退火预制管',
|
},
|
||||||
type: 'pie',
|
handleQuery() {
|
||||||
radius: ['40%', '70%'],
|
let that = this;
|
||||||
center: ['50%', '60%'],
|
if (this.queryType == '月') {
|
||||||
label: false,
|
if (this.queryDate !== '' && this.queryDate !== null) {
|
||||||
data: [
|
this.start_date = this.queryDate + '-01';
|
||||||
{value: 0, name: '合格数'},
|
let arr = this.queryDate.split('-');
|
||||||
{value: 0, name: '椭圆/弯曲'},
|
this.end_date = this.queryDate + '-' + new Date(arr[0], arr[1], 0).getDate();
|
||||||
{value: 0, name: '条纹'},
|
} else {
|
||||||
{value: 0, name: '断裂'},
|
this.start_date = this.currentYear + '-' + this.currentMonth + '-01';
|
||||||
{value: 0, name: '偏壁'},
|
this.end_date = this.currentYear + '-' + this.currentMonth + '-' + new Date(this.currentYear, this.currentMonth, 0).getDate();
|
||||||
{value: 0, name: '大小头'},
|
}
|
||||||
{value: 0, name: '结石'},
|
} else {
|
||||||
{value: 0, name: '气线'},
|
if (this.queryDate !== '' && this.queryDate !== null) {
|
||||||
{value: 0, name: '箱中破'},
|
this.start_date = this.queryDate + '-01-01';
|
||||||
]
|
this.end_date = this.queryDate + '-12-31';
|
||||||
}
|
} else {
|
||||||
},
|
this.start_date = this.currentYear + '-01-01';
|
||||||
tableData7:[],
|
this.end_date = this.currentYear + '-12-31';
|
||||||
tableData10:[],
|
}
|
||||||
tableData8:[],
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
mounted(){
|
|
||||||
let date = new Date();
|
|
||||||
let year = date.getFullYear();
|
|
||||||
let month = date.getMonth()+1;
|
|
||||||
let days = new Date(year, month, 0).getDate();
|
|
||||||
console.log(year,month,days)
|
|
||||||
this.currentYear = year;
|
|
||||||
this.currentMonth = month;
|
|
||||||
this.start_date =year+'-'+month+'-01';
|
|
||||||
this.end_date = year+'-'+month+'-'+new Date(year, month, 0).getDate();
|
|
||||||
this.getData();
|
this.getData();
|
||||||
this.getData7();
|
this.getData7();
|
||||||
this.getData10();
|
this.getData10();
|
||||||
},
|
},
|
||||||
methods:{
|
},
|
||||||
queryTypeChange(value){
|
}
|
||||||
console.log(value)
|
|
||||||
this.queryDate = '';
|
|
||||||
},
|
|
||||||
getData(){
|
|
||||||
let that = this;
|
|
||||||
that.tableData8 = [];
|
|
||||||
let exec = that.queryType=='月'?'lineMonth':'lineYear';
|
|
||||||
let obj = {
|
|
||||||
query: { start_date: this.start_date, end_date: this.end_date, dept_name: "8车间" },
|
|
||||||
};
|
|
||||||
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
|
|
||||||
console.log('退火车间统计:',res);
|
|
||||||
let data = res.data2.ds0;
|
|
||||||
if(data.length>0){
|
|
||||||
that.tableData8 = data;
|
|
||||||
that.option1.series.data[0].value = data[0].合格数;
|
|
||||||
that.option1.series.data[1].value = data[0].弯曲;
|
|
||||||
that.option1.series.data[2].value = data[0].条纹;
|
|
||||||
that.option1.series.data[3].value = data[0].断裂;
|
|
||||||
that.option1.series.data[4].value = data[0].偏壁;
|
|
||||||
that.option1.series.data[5].value = data[0].大小头;
|
|
||||||
that.option1.series.data[6].value = data[0].结石;
|
|
||||||
that.option1.series.data[7].value = data[0].气线;
|
|
||||||
that.option1.series.data[8].value = data[0].箱中破;
|
|
||||||
}
|
|
||||||
// debugger;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getData7(){
|
|
||||||
let that = this;
|
|
||||||
that.tableData7 = [];
|
|
||||||
let obj = {
|
|
||||||
query: { start_date: this.start_date, end_date: this.end_date, dept_name: "7车间" },
|
|
||||||
};
|
|
||||||
let exec = that.queryType=='月'?'lineMonth':'lineYear';
|
|
||||||
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
|
|
||||||
console.log('7生产车间统计:',res);
|
|
||||||
let data = res.data2.ds0;
|
|
||||||
if(data.length>0){
|
|
||||||
that.tableData7 = data;
|
|
||||||
that.option1.series.data[0].value = data[0].合格数;
|
|
||||||
that.option1.series.data[1].value = data[0].炸纹;
|
|
||||||
that.option1.series.data[2].value = data[0].条纹;
|
|
||||||
that.option1.series.data[3].value = data[0].气泡;
|
|
||||||
that.option1.series.data[4].value = data[0].弯曲;
|
|
||||||
that.option1.series.data[5].value = data[0].其他;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getData10(){
|
|
||||||
let that = this;
|
|
||||||
that.tableData10 = [];
|
|
||||||
let obj = {
|
|
||||||
query: { start_date: this.start_date, end_date: this.end_date, dept_name: "10车间" },
|
|
||||||
};
|
|
||||||
let exec = that.queryType=='月'?'lineMonth':'lineYear';
|
|
||||||
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
|
|
||||||
console.log('10生产车间统计:',res);
|
|
||||||
let data = res.data2.ds0;
|
|
||||||
if(data.length>0){
|
|
||||||
that.tableData10 = data;
|
|
||||||
that.option2.series.data[0].value = data[0].合格数;
|
|
||||||
that.option2.series.data[1].value = data[0].断裂;
|
|
||||||
that.option2.series.data[2].value = data[0].条纹;
|
|
||||||
that.option2.series.data[3].value = data[0].偏壁;
|
|
||||||
that.option2.series.data[4].value = data[0].大小头;
|
|
||||||
that.option2.series.data[5].value = data[0].结石;
|
|
||||||
that.option2.series.data[6].value = data[0].气线;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleQuery(){
|
|
||||||
let that = this;
|
|
||||||
if(this.queryType=='月'){
|
|
||||||
if(this.queryDate!==''&&this.queryDate!==null){
|
|
||||||
this.start_date =this.queryDate+'-01';
|
|
||||||
let arr = this.queryDate.split('-');
|
|
||||||
this.end_date = this.queryDate+'-'+new Date(arr[0], arr[1], 0).getDate();
|
|
||||||
}else{
|
|
||||||
this.start_date =this.currentYear+'-'+this.currentMonth+'-01';
|
|
||||||
this.end_date = this.currentYear+'-'+this.currentMonth+'-'+new Date(this.currentYear, this.currentMonth, 0).getDate();
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
if(this.queryDate!==''&&this.queryDate!==null){
|
|
||||||
this.start_date = this.queryDate+'-01-01';
|
|
||||||
this.end_date = this.queryDate+'-12-31';
|
|
||||||
}else{
|
|
||||||
this.start_date = this.currentYear+'-01-01';
|
|
||||||
this.end_date = this.currentYear+'-12-31';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.getData();
|
|
||||||
this.getData7();
|
|
||||||
this.getData10();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style></style>
|
||||||
</style>
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue