首检完成

This commit is contained in:
qianhao.xu
2024-01-26 16:58:40 +08:00
parent a4942c55c9
commit f5487516cd
7 changed files with 515 additions and 70 deletions

View File

@@ -8,7 +8,7 @@
<div class="title_Line">打磨</div>
<div class="title_Line">报废</div>
</div>
<div style="height: 250px">
<div style="height: 400px">
<div class="title_Line">抛光</div>
<div class="title_Line">打磨</div>
<div class="title_Line">报废</div>
@@ -83,38 +83,60 @@
</div>
</div>
<div class="f">
<div class="f_item">
<div class="f_name">工单id:{{ ProductSituationForm.workorderid }}</div>
</div>
<div class="f_item">
<div class="f_name">产品名称{{ ProductSituationForm.productName }}</div>
</div>
<div class="f_item">
<div class="f_name">左右:{{ ProductSituationForm.direction }}</div>
</div>
<div class="f_item">
<div class="f_name">颜色:{{ ProductSituationForm.color }}</div>
</div>
<el-card class="box-card dataStatistics">
<div slot="header" class="clearfix">
<span class="title">工单号:{{ CurrentWorkorder.clientWorkorder }}</span>
<el-button-group style="float: right">
<el-button type="primary" size="mini" @click="getNext_current_workorder"
>下一个工单<i class="el-icon-arrow-right el-icon--right"></i
></el-button>
<el-button type="primary" icon="el-icon-arrow-left" size="mini" @click="getPrevious_current_workorder">上一个工单</el-button>
</el-button-group>
</div>
<el-button type="danger" size="medium" @click="getNext_current_workorder">本工单完成</el-button>
<table>
<tr>
<td>产品描述</td>
<td>{{ CurrentWorkorder.productDescription }}</td>
<td>零件号</td>
<td>{{ CurrentWorkorder.finishedPartNumber }}</td>
</tr>
<div class="f_item">
<div class="f_name">班组: {{ ProductSituationForm.team }}</div>
</div>
<tr>
<td>规格</td>
<td>{{ CurrentWorkorder.specifications }}</td>
<td>颜色</td>
<td>{{ CurrentWorkorder.colour }}</td>
</tr>
<div class="f_item">
<div class="f_name">投入数:{{ ProductSituationForm.inputNum }}</div>
</div>
<div class="f_item">
<div class="f_name">一次合格数:{{ ProductSituationForm.inputNum }}</div>
</div>
<div class="f_item">
<div class="f_name">一次合格率:{{ ProductSituationForm.inputNum }}</div>
</div>
<div class="f_item">
<div class="f_name">打磨数:{{ ProductSituationForm.inputNum }}</div>
</div>
<div class="f_item">
<div class="f_name">报废数:{{ ProductSituationForm.inputNum }}</div>
</div>
<tr>
<td>班组</td>
<td>
<el-switch v-model="CurrentWorkorder.team" active-text="B" inactive-text="A"> {{ CurrentWorkorder.team }}</el-switch>
</td>
<td>投入数</td>
<td>{{ CurrentWorkorder.previousNumber }}</td>
</tr>
<tr>
<td>一次合格数</td>
<td>{{ calculate_firstPassNumber }}</td>
<td>一次合格率</td>
<td>{{ calculate_firstPassRate }}%</td>
</tr>
<tr>
<td>打磨数</td>
<td>{{ calculate_polisheNumber }}</td>
<td>报废数</td>
<td>{{ calculate_scrapNumber }}</td>
</tr>
<tr>
<td>抛光数</td>
<td>{{ calculate_defectNumber }}</td>
</tr>
</table>
</el-card>
</div>
</div>
</div>
@@ -132,7 +154,12 @@
</template>
<script>
import { GetcheckItemTable } from '@/api/qualityManagement/firstFQC.js'
import {
GetcheckItemTable,
getcurrent_workorder,
get_next_current_workorder,
get_previous_current_workorder,
} from '@/api/qualityManagement/firstFQC.js'
import { mapGetters } from 'vuex'
export default {
name: 'firstFQC',
@@ -144,13 +171,19 @@ export default {
program: [{ inspectionModule: '' }], // 程序
team: [{ inspectionModule: '' }], //班组
ProductSituationForm: {
workorderid: 'VW123456',
productName: 'VW12309',
direction: '左',
color: 'blue',
team: 'A',
inputNum: 7852,
CurrentWorkorder: {
clientWorkorder: '', // 客户工单
productDescription: '', // 产品描述
finishedPartNumber: 0,
specifications: 0,
colour: '',
team: '',
previousNumber: '',
firstPassNumber: 0,
firstPassRate: 0,
polisheNumber: 0,
scrapNumber: 0,
defectNumber: 0,
},
signal: null,
data: null,
@@ -164,6 +197,7 @@ export default {
}
},
watch: {
// 监听工单号
'$store.getters.counterList_v1': {
immediate: true,
deep: true,
@@ -191,11 +225,143 @@ export default {
},
},
},
computed: {
// 计算合格数
calculate_firstPassNumber() {
// 计算缺陷数
let allCount = 0
this.paint.forEach((it) => {
allCount += it.counter
})
this.device.forEach((it) => {
allCount += it.counter
})
this.blank.forEach((it) => {
allCount += it.counter
})
this.program.forEach((it) => {
allCount += it.counter
})
this.team.forEach((it) => {
allCount += it.counter
})
this.CurrentWorkorder.firstPassNumber = this.CurrentWorkorder.previousNumber - allCount
return this.CurrentWorkorder.firstPassNumber
},
// 计算合格率
calculate_firstPassRate() {
this.CurrentWorkorder.firstPassRate = ((this.CurrentWorkorder.firstPassNumber / this.CurrentWorkorder.previousNumber) * 100).toFixed(3)
return this.CurrentWorkorder.firstPassRate
},
//计算打磨数 CurrentWorkorder.polisheNumber
calculate_polisheNumber() {
let allCount = 0
this.paint.forEach((item) => {
if (parseInt(item.id / 10) % 10 === 2) {
allCount += item.counter
}
})
this.device.forEach((item) => {
if (parseInt(item.id / 10) % 10 === 2) {
allCount += item.counter
}
})
this.blank.forEach((item) => {
if (parseInt(item.id / 10) % 10 === 2) {
allCount += item.counter
}
})
this.program.forEach((item) => {
if (parseInt(item.id / 10) % 10 === 2) {
allCount += item.counter
}
})
this.team.forEach((item) => {
if (parseInt(item.id / 10) % 10 === 2) {
allCount += item.counter
}
})
this.CurrentWorkorder.polisheNumber = allCount
return this.CurrentWorkorder.polisheNumber
},
//计算报废数 CurrentWorkorder.scrapNumber
calculate_scrapNumber() {
let allCount = 0
this.paint.forEach((item) => {
if (parseInt(item.id / 10) % 10 === 3) {
allCount += item.counter
}
})
this.device.forEach((item) => {
if (parseInt(item.id / 10) % 10 === 3) {
allCount += item.counter
}
})
this.blank.forEach((item) => {
if (parseInt(item.id / 10) % 10 === 3) {
allCount += item.counter
}
})
this.program.forEach((item) => {
if (parseInt(item.id / 10) % 10 === 3) {
allCount += item.counter
}
})
this.team.forEach((item) => {
if (parseInt(item.id / 10) % 10 === 3) {
allCount += item.counter
}
})
this.CurrentWorkorder.scrapNumber = allCount
return this.CurrentWorkorder.scrapNumber
},
//计算 抛光数 CurrentWorkorder.defectNumber
calculate_defectNumber() {
let allCount = 0
this.paint.forEach((item) => {
if (parseInt(item.id / 10) % 10 === 1) {
allCount += item.counter
}
})
this.device.forEach((item) => {
if (parseInt(item.id / 10) % 10 === 1) {
allCount += item.counter
}
})
this.blank.forEach((item) => {
if (parseInt(item.id / 10) % 10 === 1) {
allCount += item.counter
}
})
this.program.forEach((item) => {
if (parseInt(item.id / 10) % 10 === 1) {
allCount += item.counter
}
})
this.team.forEach((item) => {
if (parseInt(item.id / 10) % 10 === 1) {
allCount += item.counter
}
})
this.CurrentWorkorder.defectNumber = allCount
return this.CurrentWorkorder.defectNumber
},
},
created() {
this.getCheckItemList()
},
mounted() {},
mounted() {
this.getcurrentWorkorder()
},
methods: {
//todo 获取检测项
getCheckItemList() {
@@ -231,29 +397,29 @@ export default {
switch (item.inspectionModule) {
case '油漆':
// 把数据传递到redis
this.signalr.SR.invoke('SaveCacheInformation_v1', this.ProductSituationForm.workorderid, '油漆', item.id + '').catch((err) => {
this.signalr.SR.invoke('SaveCacheInformation_v1', this.CurrentWorkorder.clientWorkorder, '油漆', item.id + '').catch((err) => {
console.log(err)
})
// redis再将数据返回
break
case '设备':
this.signalr.SR.invoke('SaveCacheInformation_v1', this.ProductSituationForm.workorderid, '设备', item.id + '').catch((err) => {
this.signalr.SR.invoke('SaveCacheInformation_v1', this.CurrentWorkorder.clientWorkorder, '设备', item.id + '').catch((err) => {
console.log(err)
})
break
case '毛坯':
this.signalr.SR.invoke('SaveCacheInformation_v1', this.ProductSituationForm.workorderid, '毛坯', item.id + '').catch((err) => {
this.signalr.SR.invoke('SaveCacheInformation_v1', this.CurrentWorkorder.clientWorkorder, '毛坯', item.id + '').catch((err) => {
console.log(err)
})
break
case '程序':
this.signalr.SR.invoke('SaveCacheInformation_v1', this.ProductSituationForm.workorderid, '程序', item.id + '').catch((err) => {
this.signalr.SR.invoke('SaveCacheInformation_v1', this.CurrentWorkorder.clientWorkorder, '程序', item.id + '').catch((err) => {
console.log(err)
})
break
case '班组操作':
this.signalr.SR.invoke('SaveCacheInformation_v1', this.ProductSituationForm.workorderid, '班组操作', item.id + '').catch((err) => {
this.signalr.SR.invoke('SaveCacheInformation_v1', this.CurrentWorkorder.clientWorkorder, '班组操作', item.id + '').catch((err) => {
console.log(err)
})
break
@@ -329,6 +495,51 @@ export default {
// this.signalr.SR.invoke('SendMessage', 'All', 'root', '123456').catch((err) => console.log('err', err))
},*/
//todo 获取当前工单号
getcurrentWorkorder() {
getcurrent_workorder().then((res) => {
if (res.code == 200) {
if (res.data != undefined) {
this.CurrentWorkorder = res.data
this.$message.success('更新今日工单号成功')
}
} else if (res.code == 210) {
this.$notify.warning('没有工单上线')
}
})
},
//todo 获取下一个工单号
getNext_current_workorder() {
get_next_current_workorder().then((res) => {
if (res.code == 200) {
if (res.data != null) {
this.CurrentWorkorder = res.data
this.$message.success('获取工单号成功')
} else {
this.$notify.warning('已经是最后一个工单,没有工单了')
}
} else if (res.code == 210) {
this.$notify.warning('已经是最后一个工单,没有工单了')
}
})
},
//todo 获取上一个工单号
getPrevious_current_workorder() {
get_previous_current_workorder().then((res) => {
if (res.code == 200) {
if (res.data != null) {
this.CurrentWorkorder = res.data
this.$message.success('获取工单号成功')
} else {
this.$notify.warning('没有生产工单')
}
} else if (res.code == 210) {
this.$notify.warning('没有生产工单')
}
})
},
},
}
</script>
@@ -450,17 +661,9 @@ export default {
font-family: Arial, sans-serif;
font-size: 1rem;
text-align: center;
margin-top: 40px;
}
.f_item {
margin-top: 10px;
margin-left: 20px;
}
.f_name {
color: #409eff;
font-family: Arial, sans-serif;
font-size: 1.2rem;
margin-top: 50px;
}
.context {
margin: 0.5em 1em;
font-size: 0.8rem;
@@ -469,11 +672,43 @@ export default {
width: 100%;
height: 100%;
text-align: center;
position: relative;
.number {
font-size: 2rem;
text-align: center;
color: red;
font-weight: bold;
position: absolute;
bottom: 5px;
width: 100%;
}
}
.number {
font-size: 1.2rem;
text-align: center;
color: red;
font-weight: bold;
.dataStatistics {
.title {
font-size: 1.2rem;
font-weight: bold;
color: #303133;
}
table {
border-collapse: collapse;
width: 100%;
}
th,
td {
border: 1px solid #000;
padding: 8px;
text-align: left;
font-size: 0.7rem;
}
th {
background-color: #409eff;
color: #fff;
}
::v-deep .el-button {
float: right;
}
}
</style>