feat:光子成品检验

This commit is contained in:
shijing 2024-08-26 10:57:47 +08:00
parent d21dc253e4
commit fabfe94738
2 changed files with 206 additions and 0 deletions

View File

@ -0,0 +1,103 @@
<template>
<el-container>
<el-header>
<div class="right-panel">
<el-date-picker
v-model="query.start_date"
type="date"
placeholder="查询日期"
value-format="YYYY-MM-DD"
style="width: 160px"
>
</el-date-picker>
<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 style="background: #ffffff">
<scTable :data="tableData" id="exportDiv">
<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="不合格数" prop="不合格数"></el-table-column>
</scTable>
</el-main>
</el-container>
</template>
<script>
export default {
name: "chart",
data() {
return {
query:{
start_date:'',
end_date:'',
fw_type:'prod'
},
currentDate: "",
tableData: [],
};
},
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.getData();
},
methods: {
getData() {
let that = this;
let obj = {};
obj.query = that.query;
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>

View File

@ -0,0 +1,103 @@
<template>
<el-container>
<el-header>
<div class="right-panel">
<el-date-picker
v-model="query.start_date"
type="date"
placeholder="查询日期"
value-format="YYYY-MM-DD"
style="width: 160px"
>
</el-date-picker>
<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 style="background: #ffffff">
<scTable :data="tableData" id="exportDiv">
<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="不合格数" prop="不合格数"></el-table-column>
</scTable>
</el-main>
</el-container>
</template>
<script>
export default {
name: "chart",
data() {
return {
query:{
start_date:'',
end_date:'',
fw_type:'process'
},
currentDate: "",
tableData: [],
};
},
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.getData();
},
methods: {
getData() {
let that = this;
let obj = {};
obj.query = that.query;
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>