生产管理修改,新增andon数据分析图片
BIN
src/assets/image/16.png
Normal file
|
After Width: | Height: | Size: 406 KiB |
BIN
src/assets/image/19.png
Normal file
|
After Width: | Height: | Size: 99 KiB |
BIN
src/assets/image/2.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/assets/image/4.png
Normal file
|
After Width: | Height: | Size: 440 KiB |
BIN
src/assets/image/back.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
src/assets/image/left.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
src/assets/image/right.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
@ -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',
|
||||
|
||||
@ -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>
|
||||
@ -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 = {
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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,
|
||||
};
|
||||
|
||||