factory_web/src/views/statistics/process_check_gx.vue

150 lines
4.2 KiB
Vue

<template>
<el-container>
<el-header>
<div class="right-panel">
<el-select v-model="query.process_name"
style="width: 200px"
placeholder="请选择工序">
<el-option
v-for="item in options"
:key="item.name"
:label="item.name"
:value="item.name"
>
</el-option>
</el-select>
<el-date-picker
v-model="query.start_date"
type="date"
placeholder="查询日期"
value-format="YYYY-MM-DD"
style="width: 200px"
>
</el-date-picker>
<el-input v-model="query.m_s"
placeholder="物料名称" clearable style="width:200px"></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
<el-button @click="handleExport" type="primary">导出</el-button>
</el-header>
<el-main>
<scTable
:data="tableData"
id="exportDiv"
stripe
hideDo
hidePagination>
<el-table-column type="index" width="50" />
<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 label="工序" prop="工序"> </el-table-column>
<el-table-column label="检验时间">
<template #default="scope">
{{ scope.row.年 }}-{{ scope.row.月 }}-{{ scope.row.日 }}
</template>
</el-table-column>
<el-table-column label="检验数" prop="检验数"></el-table-column>
<el-table-column label="合格数" prop="合格数"></el-table-column>
<el-table-column label="不合格数" align="center">
<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 label="崩边" prop="崩边"></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 label="线痕" prop="线痕"></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>
</scTable>
</el-main>
</el-container>
</template>
<script>
export default {
name: "chart",
data() {
return {
query:{
m_s:'',
fw_type:'process',
end_date:'',
start_date:'',
process_name:'',
group_by_dept: ", dept.id",
group_by_user: ", suser.id",
group_by_shift: ", shift.id",
select_col_dept: ", dept.name as 部门",
select_col_user: ", suser.name as 检验人",
select_col_shift: ", shift.name as 班次"
},
currentDate: "",
tableData: [],
options:[],
};
},
mounted() {
let that = this;
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
month = month < 10 ? "0" + month : month;
day = day < 10 ? "0" + day : day;
let queryDate = year + "-" + month + "-" + day;
that.query.start_date = that.query.end_date = that.currentDate = queryDate;
this.getProcess();
this.getData();
},
methods: {
getProcess(){
let that = this;
that.$API.mtm.process.list.req({ page: 0}).then((res) => {
that.options = res;
});
},
getData() {
let that = this;
let obj = {};
obj.query = that.query;
that.tableData =[];
that.$API.bi.dataset.exec.req('ftestDay', obj).then((res) => {
that.tableData = res.data2.ds0;
console.log(that.tableData);
});
},
handleQuery() {
if(this.query.start_date){
this.query.end_date = this.query.start_date;
}else{
this.query.start_date = this.query.end_date = this.currentDate;
}
this.getData();
},
handleExport() {
this.exportLoading = true;
this.$XLSX("#exportDiv", "过程检验统计");
this.exportLoading = false;
},
},
};
</script>
<style scoped>
.tables {
position: absolute;
top: 4px;
right: 6px;
z-index: 10;
}
</style>