下面编写检验模块

This commit is contained in:
qianhao.xu
2023-11-29 16:40:45 +08:00
parent 808ff9a082
commit c42f5256e0
8 changed files with 169 additions and 15 deletions

View File

@@ -8,4 +8,13 @@ export function getStatisticslist(query) {
params: query,
})
}
export function UpdateStatisticsTable(query) {
return request({
url: '/mes/qc/IQC/updateStatisticsTable',
method: 'get',
params: query,
})
}

View File

@@ -0,0 +1,11 @@
import request from '@/utils/request'
export function GetinspectionItemList(query) {
return request({
url: '/mes/qc/IQC/getinspectionItemList',
method: 'get',
params: query,
})
}

View File

@@ -28,25 +28,39 @@
:limit.sync="pagination.pageSize"
@pagination="GetInspectionStatisticsList"
/>
<vxe-table :data="IQCList" stripe >
<vxe-table :data="IQCList" stripe :edit-config="{ trigger: 'click', mode: 'row' }" @edit-closed="editClosedEvent" ref="xTable" keep-source>
<vxe-column type="seq" width="60"></vxe-column>
<vxe-column field="year" title="年"></vxe-column>
<vxe-column field="week" title="周"></vxe-column>
<vxe-column field="date" title="日"></vxe-column>
<vxe-column field="id" title="流水号"></vxe-column>
<vxe-column field="FkMaterialrequisitionId" title="领料单id"></vxe-column>
<vxe-column field="Workblankpartnumber" title="毛坯零件号"></vxe-column>
<vxe-column field="requirenum" title="需要的数量"></vxe-column>
<vxe-column field="RequireNum" title="应到数量"></vxe-column>
<vxe-column field="ActualNumber" title="实际到达数量"></vxe-column>
<vxe-column field="RandomRate" title="抽检比例% "></vxe-column>
<vxe-column field="Oks" title="合格数"></vxe-column>
<vxe-column field="Ngs" title="不合格数"></vxe-column>
<vxe-column field="OksRatio" title="合格率"></vxe-column>
<vxe-column field="fkMaterialrequisitionId" title="领料单id"></vxe-column>
<vxe-column field="workblankpartnumber" title="毛坯零件号"></vxe-column>
<vxe-column field="requireNum" title="应到数量"></vxe-column>
<vxe-column field="actualNumber" title="实际到达数量" :edit-render="{}">
<template #edit="{ row }">
<vxe-input v-model="row.actualNumber" placeholder="请输入实际到达数量" type="number"></vxe-input>
</template>
</vxe-column>
<vxe-column field="randomRate" title="抽检比例%" :edit-render="{}">
<template #edit="{ row }">
<vxe-input v-model="row.randomRate" placeholder="请输入抽检比例" type="number"></vxe-input>
</template>
</vxe-column>
<vxe-column field="ngs" title="不合格数" :edit-render="{}">
<template #edit="{ row }">
<vxe-input v-model="row.ngs" placeholder="请输入不合格数" type="number"></vxe-input>
</template>
</vxe-column>
<vxe-column field="oksRatio" title="合格率">
<template #default="{ row }">
<span>{{ CalculateQualificationRate(row) }}</span>
</template>
</vxe-column>
<vxe-column title="是否合格" fixed="right">
<template>
<el-tag type="success">合格</el-tag>
<el-tag type="danger">不合格</el-tag>
<template #default="{ row }">
<vxe-button v-if="row.Isqualified == 1" content="合格" status="success" round></vxe-button>
<vxe-button v-if="row.Isqualified == 0" content="不合格,退料" status="danger" round></vxe-button>
</template>
</vxe-column>
</vxe-table>
@@ -54,7 +68,7 @@
</template>
<script>
import { getStatisticslist } from '@/api/qualityManagement/IQC.js'
import { getStatisticslist, UpdateStatisticsTable } from '@/api/qualityManagement/IQC.js'
export default {
name: 'materials_requisition',
data() {
@@ -75,6 +89,7 @@ export default {
mounted() {
this.GetInspectionStatisticsList()
},
computed: {},
methods: {
//todo 获取检验统计表
GetInspectionStatisticsList() {
@@ -88,7 +103,58 @@ export default {
},
searchDate(item) {
this.search.date = item
this.getMaterialRequisitionList()
this.GetInspectionStatisticsList()
},
// todo 计算合格率
CalculateQualificationRate(row) {
if (row.actualNumber == undefined || row.actualNumber == '') {
return ''
}
if (row.ngs == undefined || row.ngs == '') {
return ''
}
let rate = (((row.actualNumber - row.ngs) / row.actualNumber) * 100).toFixed(4)
row.oksRatio = rate
this.IQCList.filter((it) => it.id == row.id).forEach((item, index) => {
item.oksRatio = rate
item.oks = row.actualNumber - row.ngs
if (rate >= 90) item.Isqualified = 1
else if (rate > 0 && rate < 90) item.Isqualified = 0
else item.Isqualified = -1
})
return rate
},
//todo 实时保存
editClosedEvent({ row, column }) {
const $table = this.$refs.xTable
const field = column.property
const cellValue = row[field]
// 判断单元格值是否被修改
if ($table.isUpdateByRow(row, field)) {
//todo 更新统计表
const query = {
id: row.id,
actualNumber: row.actualNumber,
randomRate: row.randomRate,
ngs: row.ngs,
oks: row.oks,
oksRatio: row.oksRatio,
Isqualified:row.Isqualified
}
console.log('query', query)
UpdateStatisticsTable(query).then((res) => {
if ((res.code == 200) & (res.data == 1)) {
this.$notify.success('更新成功')
} else {
this.$notify.error('异常错误')
}
// 局部更新单元格为已保存状态
$table.reloadRow(row, null, field)
})
}
},
},
}

View File

@@ -0,0 +1,68 @@
<template>
<div class="app-container">
<el-form :inline="true" :model="search" class="demo-form-inline">
<el-form-item label="检测模块">
<el-select v-model="search.inspectionModule" placeholder="请选择检测模块">
<el-option label="" value=""> </el-option>
<el-option label="油漆" value="油漆"> </el-option>
<el-option label="设备" value="设备"> </el-option>
<el-option label="毛坯" value="毛坯"> </el-option>
<el-option label="程序" value="程序"> </el-option>
<el-option label="班组操作" value="班组操作"> </el-option>
</el-select>
</el-form-item>
<el-form-item label="检测类型">
<el-select v-model="search.inspectionType" placeholder="请选择检测类型">
<el-option label="" value=""> </el-option>
<el-option label="抛光" value="抛光"> </el-option>
<el-option label="打磨" value="打磨"> </el-option>
<el-option label="报废" value="报废"> </el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">查询</el-button>
</el-form-item>
</el-form>
<vxe-table :data="checkItemList">
<vxe-column type="seq" width="60"></vxe-column>
<vxe-column field="inspectionCode" title="编号"></vxe-column>
<vxe-column field="inspectionName" title="名称"></vxe-column>
<vxe-column field="inspectionModule" title="检测模块"></vxe-column>
<vxe-column field="inspectionType" title="检测类型"></vxe-column>
</vxe-table>
</div>
</template>
<script>
import { GetinspectionItemList } from '@/api/qualityManagement/checkItem.js'
export default {
name: 'checkItem',
data() {
return {
checkItemList: [],
search: {
inspectionModule: '',
inspectionType: '',
},
}
},
mounted() {
this.getTable()
},
methods: {
getTable() {
GetinspectionItemList(this.search).then((res) => {
if (res.code == 200) {
this.checkItemList = res.data
}
})
},
onSubmit() {
this.getTable()
},
},
}
</script>
<style></style>