不良统计报表

master
zhaoxiaolin 9 months ago
parent e31ab3b7cf
commit bccf33ea7d

@ -49,3 +49,19 @@ export function getXJChartData(query) {
params: query
});
}
export function getQmsRateTable(query) {
return request({
url: '/quality/staticTable/getQmsRateTable',
method: 'get',
params: query
});
}
export function getCheckTypeList(typeCode) {
return request({
url: '/quality/staticTable/getCheckTypeList/' + typeCode,
method: 'get',
params: query
});
}

@ -0,0 +1,360 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px" class="edit-el-form">
<el-form-item label="订单编码" prop="orderNo">
<el-input
v-model="queryParams.orderNo"
placeholder="请输入订单编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="批次编码" prop="incomeBatchNo">
<el-input
v-model="queryParams.incomeBatchNo"
placeholder="请选择批次编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="产品编号" prop="materialCode">
<el-input
v-model="queryParams.materialCode"
placeholder="请输入产品编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="生产车间" prop="supplierCode">
<el-select v-model="queryParams.supplierCode" clearable placeholder="请选择生产车间" filterable clearable>
<el-option
v-for="dict in workCenterList"
:key="dict.factoryCode"
:label="dict.factoryName"
:value="dict.factoryCode"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检验类型" prop="typeCode">
<el-select v-model="queryParams.typeCode" clearable placeholder="请选择检验类型" @change="getCheckTypeList">
<el-option
v-for="dict in dict.type.check_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检验节点" prop="checkType">
<el-select v-model="queryParams.checkType" clearable placeholder="请选择检验节点">
<el-option
v-for="dict in checkTypeList"
:key="dict.checkType"
:label="dict.checkName"
:value="dict.checkType"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="生产时间" prop="incomeTimeArray">
<el-date-picker
v-model="queryParams.incomeTimeArray"
format="yyyy-MM-dd"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" >搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:prepare:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="车间编码" align="center" prop="supplierCode" width="80">
<template slot-scope="scope">
<el-button
type="text"
@click="handleDetail(scope.row)"
>{{scope.row.supplierCode}}</el-button>
</template>
</el-table-column>
<el-table-column prop="supplierName" label="车间名称" width="100" align="center"/>
<el-table-column prop="orderNo" label="订单编码" width="160" align="center"/>
<el-table-column prop="incomeBatchNo" label="批次" width="220" align="center"/>
<el-table-column prop="materialName" label="产品名称"align="center" width="180" :show-overflow-tooltip="true"/>
<el-table-column prop="materialCode" label="产品编码" width="130" align="center"
:formatter="productCodeFormate"/>
<el-table-column prop="quality" label="数量" width="80" align="center"/>
<el-table-column prop="unit" label="单位" width="80" align="center"/>
<el-table-column prop="sampleQuality" label="抽样数量" width="80" align="center"/>
<el-table-column prop="noOkNums" label="不良数量" width="80" align="center"/>
<el-table-column prop="noOkNumRate" label="不良率(%)" width="80" align="center"/>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { getQmsRateTable,getWorkcenterList,getCheckTypeList} from "@/api/quality/qcTable";
import moment from "moment/moment";
export default {
name: "qcAnalysis",
dicts: ["check_type"],
data() {
return {
newWorkerLoading: false,
refreshNewWorkerTable:true,
//
selectPrepare:[],
//
formRef: 'form',
validateRules: [],
printDialogVisible: false,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
tableList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
checkNo: null,
typeCode:null,
checkType:null,
orderNo: null,
productId: null,
materialCode: null,
prodType: null,
materialName: null,
productSpc: null,
wetDetailPlanId: null,
incomeTime: null,
incomeBatchNo:null,
incomeTimeArray: [],
ymArrayStart:null,
ymArrayEnd:null
},
workCenterList:[],
checkTypeList:[],
//
form: {},
//
rules: {},
openReport : false,
titleReport : "工单报工详情"
};
},
created() {
this.getWorkCenterList();
this.getDate();
this.getList();
},
methods: {
/**获取默认查询时间段**/
getDate() {
let start = this.Fungetdate (0);
let end = this.Fungetdate (1);
this.queryParams.incomeTimeArray.push(start,end);
},
Fungetdate (num) {
var dd = new Date();
dd.setDate(dd.getDate() + num);
var y = dd.getFullYear();
var m = dd.getMonth() + 1;//
var d = dd.getDate();
return y + "-" + m + "-" + d;
},
/**获取车间数据**/
getWorkCenterList(){
getWorkcenterList(this.queryParams).then(response => {
this.workCenterList = response
})
},
getCheckTypeList(val){
getCheckTypeList(val).then(response => {
this.checkTypeList = response
})
},
indexMethod(index){
return index+1 ;
},
/** 查询备料单列表 */
getList() {
this.loading = true;
if(this.queryParams.incomeTimeArray.length>0){
this.queryParams.ymArrayStart = moment(this.queryParams.incomeTimeArray[0]).format('YYYY-MM-DD');
this.queryParams.ymArrayEnd = moment(this.queryParams.incomeTimeArray[1]).format('YYYY-MM-DD');
}
getQmsRateTable(this.queryParams).then(response => {
this.tableList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.openReport = false;
this.reset();
},
//
reset() {
this.form = {
prepareId: null,
checkNo: null,
workorderName: null,
parentOrder: null,
orderId: null,
orderNo: null,
productId: null,
materialCode: null,
prodType: null,
materialName: null,
productSpc: null,
wetDetailPlanId: null,
incomeTime: null,
incomeBatchNo:null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
factoryCode: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.getDate();
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.prepareId)
this.single = selection.length!==1
this.multiple = !selection.length
this.selectPrepare = selection
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加备料单";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const prepareId = row.prepareId || this.ids
getPrepare(prepareId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改备料单";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.prepareId != null) {
updatePrepare(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addPrepare(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
//
productCodeFormate(row, column, cellValue){
return cellValue.slice(7,18); //
},
/** 报工详情按钮操作 */
handleDetail(row) {
this.reset();
let sr = row;
this.queryParams.orderNo = sr.orderNo;
getXJCheckTableDetail(this.queryParams).then(response => {
this.pOrderTableList = response;
this.openReport = true;
this.titleReport = "过程巡检详情";
});
},
/** 导出按钮操作 */
handleExport() {
this.download('mes/prepare/export', {
...this.queryParams
}, `prepare_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<style>
.my-print-head {
margin-top: 20px;
font-weight: bold;
}
.my-print-nav {
margin-top: 15px;
margin-bottom: 15px;
}
.my-print-table {
}
.my-print-foot {
margin-top: 20px;
}
</style>
Loading…
Cancel
Save