生产管理修改,新增andon数据分析图片

This commit is contained in:
17630416519 2025-12-23 10:49:01 +08:00
parent 7f74764e9b
commit 615166606b
12 changed files with 171 additions and 39 deletions

BIN
src/assets/image/16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 KiB

BIN
src/assets/image/19.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

BIN
src/assets/image/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
src/assets/image/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 KiB

BIN
src/assets/image/back.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
src/assets/image/left.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
src/assets/image/right.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -165,6 +165,13 @@ export const constantRoutes = [
component: () => import("@/views/deviceManagement/datascreen/index.vue"),
hidden: true,
},
//数据分析大屏
{
name: "dataAnalysisLargeScreen",
path: "/andonManagement/dataAnalysis/dataAnalysisLargeScreen",
component: () => import("@/views/andonManagement/dataAnalysis/largeScreen/index.vue"),
hidden: true,
},
// {
// name: 'Fullscreen2',
// path: '/fullscreen2',

View File

@ -1,3 +1,90 @@
<template>
<div>大屏</div>
</template>
<div class="container">
<div class="goBack" @click="handGoBack">返回首页</div>
<div class="title">
数据分析大屏
</div>
<div class="real-time">
{{ currentTime }}
</div>
<div class="tableContainer">
0
</div>
<el-row>
<el-col :span="12">1</el-col>
<el-col :span="12">2</el-col>
</el-row>
</div>
</template>
<script>
export default {
data() {
return {
currentTime: ''
}
},
created() {
this.getCurrentTime()
},
methods: {
handGoBack() {
this.$router.go(-1)
},
getCurrentTime() {
this.currentTime = this.formatDate(new Date())
},
formatDate(date) {
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate()
}
}
}
</script>
<style scoped lang="scss">
.container {
width: 100%;
height: 100%;
color: #fff;
background: url('~@/assets/image/16.png') no-repeat;
background-size: 100% 100%;
.goBack {
background-color: #4a4c99;
border-color: #6b6dd8;
width: 4vw;
position: absolute;
left: 0.8%;
top: 1%;
display: flex;
justify-content: center;
align-items: center;
padding: 0.2vw;
// padding: 0.5vw;
border-radius: 10px;
font-size: .6vw;
cursor: pointer;
}
.title {
width: 100%;
height: 7%;
background: url('~@/assets/image/19.png') no-repeat;
background-size: 100% 100%;
display: flex;
justify-content: center;
align-items: center;
font-size: 1.5vw;
font-weight: bold;
padding-bottom: 0.5vw;
color: #fff;
}
.tableContainer {
width: 100%;
height: 50%;
}
}
</style>

View File

@ -77,16 +77,21 @@
<el-input disabled v-model="form.receiver4Name" placeholder="请输入接收方" />
</el-form-item>
</el-col>
<!-- <el-col :lg="6">
<el-form-item label="接收方名称">
<el-input disabled v-model="form.receiverName" placeholder="请输入接收方名称" />
</el-form-item>
</el-col> -->
<el-col :lg="6">
<el-form-item label="状态">
<el-input disabled v-model="form.status" placeholder="请输入状态" />
</el-form-item>
</el-col>
<el-col :lg="6">
<el-form-item label="停机持续时间(分钟)">
<el-input-number :step="1" :precision="0" style="width: 100%;"
v-model="form.durationTime" @change="handleChange" :min="0"
label="请输入停机持续时间"></el-input-number>
</el-form-item>
</el-col>
<el-col :lg="6">
<el-form-item label="处理结果">
<el-input v-model="form.handleResult" placeholder="请输入处理结果" />
@ -250,7 +255,9 @@ export default {
processingData: [],
total: 0,
loading: false,
form: {},
form: {
durationTime: '',
},
form1: {},
formAdd: {},
queryVisible: false,
@ -500,7 +507,9 @@ export default {
});
});
},
handleChange(val) {
this.form.durationTime = val
},
//
hanleCompleted() {
let data = {

View File

@ -309,9 +309,9 @@ export default {
for (let item of this.tableAllData) {
list[item.state]++;
}
return list;
}
},
mounted() {
@ -376,7 +376,7 @@ export default {
? Number(item.pQualifiedNum)
: 0,
pQualifiedRate: item.pQualifiedRate !== null && item.pQualifiedRate !== undefined
? parseFloat(item.pQualifiedRate).toFixed(2)
? parseFloat(item.pQualifiedRate * 100).toFixed(2)
: '0.00'
}
})
@ -410,14 +410,29 @@ export default {
this.$message.info('已取消修改');
}
},
//
calculateQualifiedNumFromRate(row) {
this.isEditing = true;
const previousNum = parseFloat(row.previousNumber) || 0;
const qualifiedRate = parseFloat(row.pQualifiedRate) || 0;
//
if (previousNum > 0 && !isNaN(qualifiedRate)) {
const qualifiedNum = (previousNum * qualifiedRate) / 100;
this.$set(row, 'pQualifiedNum', Math.round(qualifiedNum));
} else {
this.$set(row, 'pQualifiedNum', 0);
}
this.addToUpdateQueue(row);
}, //
async handleQualifiedRateChange(row) {
try {
const currentValue = row.pQualifiedRate;
if (currentValue !== '' && !isNaN(currentValue)) {
await this.$modal.confirm(`确定要将合格率修改为 ${parseFloat(currentValue).toFixed(2)}% 吗?`);
this.formatQualifiedRate(row);
//
this.calculateQualifiedNumFromRate(row);
}
} catch (error) {
this.$message.info('已取消修改');
@ -435,7 +450,7 @@ export default {
} else {
this.$set(row, 'pQualifiedRate', '0.00');
}
//
this.addToUpdateQueue(row);
},
@ -445,7 +460,7 @@ export default {
const num = parseFloat(row.pQualifiedNum);
this.$set(row, 'pQualifiedNum', isNaN(num) ? 0 : Math.round(num));
this.isEditing = false;
//
this.calculateQualifiedRate(row);
},
@ -455,7 +470,7 @@ export default {
const rate = parseFloat(row.pQualifiedRate);
this.$set(row, 'pQualifiedRate', isNaN(rate) ? '0.00' : rate.toFixed(2));
this.isEditing = false;
//
this.addToUpdateQueue(row);
},
@ -463,13 +478,13 @@ export default {
//
addToUpdateQueue(row) {
//
this.updateQueue.set(row.id, {...row});
this.updateQueue.set(row.id, { ...row });
//
if (this.updateTimer) {
clearTimeout(this.updateTimer);
}
//
this.updateTimer = setTimeout(() => {
this.processUpdateQueue();
@ -480,17 +495,17 @@ export default {
async processUpdateQueue() {
//
const rowsToUpdate = Array.from(this.updateQueue.values());
//
this.updateQueue.clear();
try {
//
for (const row of rowsToUpdate) {
const updateData = { ...row };
updateData.pQualifiedNum = Number(updateData.pQualifiedNum) || 0;
let rate = Number(updateData.pQualifiedRate);
updateData.pQualifiedRate = isNaN(rate) ? '0.00' : rate.toFixed(2);
let rate = Number(updateData.pQualifiedRate / 100);
updateData.pQualifiedRate = isNaN(rate / 100) ? '0.00' : rate.toFixed(2);
updateData.vehicleNumber = Number(updateData.vehicleNumber) || 0;
updateData.hangNumber = Number(updateData.hangNumber) || 0;
@ -501,7 +516,7 @@ export default {
this.$notify.error(res.msg || '更新失败');
}
}
//
this.$notify.success('更新成功');
this.getList();

View File

@ -128,7 +128,7 @@ export default {
return {
...item,
pQualifiedRate: item.pQualifiedRate !== null && item.pQualifiedRate !== undefined
? parseFloat(item.pQualifiedRate).toFixed(2)
? parseFloat(item.pQualifiedRate*100).toFixed(2)
: '0.00'
}
})
@ -147,19 +147,33 @@ export default {
this.$message.info('已取消修改');
}
},
//
calculateQualifiedNumFromRate(row) {
const previousNumber = parseFloat(row.previousNumber);
const pQualifiedRate = parseFloat(row.pQualifiedRate);
//
async handleQualifiedRateChange(row) {
try {
const currentValue = row.pQualifiedRate;
if (currentValue !== '' && !isNaN(currentValue)) {
await this.$modal.confirm(`确定要将合格率修改为 ${parseFloat(currentValue).toFixed(2)}% 吗?`);
this.formatQualifiedRate(row);
}
} catch (error) {
this.$message.info('已取消修改');
}
},
if (!isNaN(previousNumber) && !isNaN(pQualifiedRate)) {
const qualifiedNum = (previousNumber * pQualifiedRate) / 100;
row.pQualifiedNum = qualifiedNum.toFixed(2);
console.log(row.pQualifiedNum, '根据合格率计算的合格数');
//
this.updateWorkorderData(row);
}
},
//
async handleQualifiedRateChange(row) {
try {
const currentValue = row.pQualifiedRate;
if (currentValue !== '' && !isNaN(currentValue)) {
await this.$modal.confirm(`确定要将合格率修改为 ${parseFloat(currentValue).toFixed(2)}% 吗?`);
this.formatQualifiedRate(row);
this.calculateQualifiedNumFromRate(row);
}
} catch (error) {
this.$message.info('已取消修改');
}
},
calculateQualifiedRate(row) {
const previousNumber = parseFloat(row.previousNumber);
@ -184,7 +198,7 @@ export default {
}
},
//
formatQualifiedRate(row) {
if (row.pQualifiedRate !== '' && !isNaN(row.pQualifiedRate)) {
row.pQualifiedRate = parseFloat(row.pQualifiedRate).toFixed(2);
@ -200,7 +214,7 @@ export default {
let data = {
...row,
pQualifiedRate: !isNaN(Number(row.pQualifiedRate))
? Number(row.pQualifiedRate).toFixed(2)
? Number(row.pQualifiedRate/100).toFixed(2)
: '0.00',
pQualifiedNum: Number(row.pQualifiedNum) || 0,
};