This commit is contained in:
hzz 2024-04-13 17:39:28 +08:00
parent 780e762ed6
commit 3b664101d7
6 changed files with 59 additions and 40 deletions

View File

@ -125,7 +125,7 @@
<el-form-item :label="tLang('device', '设备编码')" prop="code"> <el-form-item :label="tLang('device', '设备编码')" prop="code">
<el-input v-model="form.code" :placeholder="tLang('common', '请输入') + tLang('device', '设备编码')" /> <el-input v-model="form.code" :placeholder="tLang('common', '请输入') + tLang('device', '设备编码')" />
</el-form-item> </el-form-item>
<el-form-item :label="tLang('device', '设备类型')" prop="code"> <el-form-item :label="tLang('device', '设备类型')" prop="type">
<el-input v-model="form.type" :placeholder="tLang('common', '请输入') + tLang('device', '设备编码')" /> <el-input v-model="form.type" :placeholder="tLang('common', '请输入') + tLang('device', '设备编码')" />
</el-form-item> </el-form-item>
<el-form-item :label="tLang('device', '车间名称')" prop="workShop"> <el-form-item :label="tLang('device', '车间名称')" prop="workShop">
@ -226,12 +226,18 @@ let form = ref({})
const formRef = ref(null) const formRef = ref(null)
// //
let rules = ref({ let rules = ref({
needleNum: [ code: [
{ {
type: 'number',
required: true, required: true,
message: '针数只能为数字', message: proxy.tLang('common', '请输入') + proxy.tLang('device', '设备编码'),
trigger: 'change', trigger: 'blur',
},
],
name: [
{
required: true,
message: proxy.tLang('common', '请输入') + proxy.tLang('device', '设备名称'),
trigger: 'blur',
}, },
], ],
}) })

View File

@ -5,43 +5,44 @@
<div class="device-info"> <div class="device-info">
<div class="info-title"> <div class="info-title">
<i class="iconfont icon-shebeixinxi" style="color: #46B3F8;font-size: 30px;"></i> <i class="iconfont icon-shebeixinxi" style="color: #46B3F8;font-size: 30px;"></i>
设备信息 {{ tLang('device', '设备信息') }}
</div> </div>
<div class="info-content"> <div class="info-content">
<el-row justify="space-evenly"> <el-row justify="space-evenly">
<el-col :span="12">设备编码</el-col> <el-col :span="12">{{ tLang('device', '设备编码') }}</el-col>
<el-col :span="12">11</el-col> <el-col :span="12">{{ info.code }}</el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12">设备名称</el-col> <el-col :span="12">{{ tLang('device', '设备名称') }}</el-col>
<el-col :span="12">11</el-col> <el-col :span="12">{{ info.name }}</el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12">运行时长</el-col> <el-col :span="12">{{ tLang('device', '运行时长') }}</el-col>
<el-col :span="12">11</el-col> <el-col :span="12">{{ info.runTime||0 + tLang('common','分钟') }}</el-col>
</el-row> </el-row>
</div> </div>
</div> </div>
<div class="user-info"> <div class="user-info">
<div class="info-title"> <div class="info-title">
<svg-icon icon-class="renyuanxinxi" style="font-size: 30px;" /> <svg-icon icon-class="renyuanxinxi" style="font-size: 30px;" />
人员信息 {{ tLang('user', '人员信息') }}
</div> </div>
<div class="info-content"> <div class="info-content">
<el-row justify="space-evenly"> <el-row justify="space-evenly">
<el-col :span="12">操作员</el-col> <el-col :span="12">{{ tLang('user', '操作员') }}</el-col>
<el-col :span="12">张一一</el-col> <el-col :span="12">{{ info.userName }}</el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12">人员ID</el-col> <el-col :span="12">{{ tLang('user', '人员ID') }}</el-col>
<el-col :span="12">11</el-col> <el-col :span="12">{{ info.userCode }}</el-col>
</el-row> </el-row>
</div> </div>
</div> </div>
</div> </div>
<div class="produce-info"> <div class="produce-info">
<div class="info-title"> <div class="info-title">
<svg-icon icon-class="shengchanxinxi" style="font-size: 30px;" /> 生产信息 <svg-icon icon-class="shengchanxinxi" style="font-size: 30px;" />
{{ tLang('produce', '生产信息') }}
</div> </div>
<div class="info-content"> <div class="info-content">
<el-row justify="space-evenly"> <el-row justify="space-evenly">
@ -83,7 +84,8 @@
<template #default="scope"> <template #default="scope">
<div> <div>
<el-tag type="success" size="mini" v-if="scope.row.state === '0'">{{ tLang('common', '合格') }}</el-tag> <el-tag type="success" size="mini" v-if="scope.row.state === '0'">{{ tLang('common', '合格') }}</el-tag>
<el-tag type="danger" size="mini" v-else-if="scope.row.state === '1'">{{ tLang('common', '不合格') }}</el-tag> <el-tag type="danger" size="mini" v-else-if="scope.row.state === '1'">{{ tLang('common', '不合格')
}}</el-tag>
<el-tag type="error" size="mini" v-else>{{ tLang('common', '未完成') }}</el-tag> <el-tag type="error" size="mini" v-else>{{ tLang('common', '未完成') }}</el-tag>
</div> </div>
</template> </template>
@ -96,14 +98,15 @@
<script setup> <script setup>
import { getBaseInfoNew, qualitynewDeviceOutputQuality, getNewestFiveInfo } from "@/api/home"; import { getBaseInfoNew, qualitynewDeviceOutputQuality, getNewestFiveInfo } from "@/api/home";
import { getCurrentInstance } from "vue";
let table_height = ref(382); const { proxy } = getCurrentInstance();
let pass = ref([0]); let pass = ref([0]);
let noPass = ref([0]); let noPass = ref([0]);
let bar_option = ref({ let bar_option = ref({
title: { title: {
text: '产量', text: proxy.tLang('home','产量'),
textStyle: { textStyle: {
color: '#797979' color: '#797979'
}, },
@ -115,7 +118,7 @@ let bar_option = ref({
} }
}, },
legend: { legend: {
data: ['合格', '不合格'], data: [proxy.tLang('common','合格'), proxy.tLang('common','不合格')],
textStyle: { textStyle: {
color: '#797979' color: '#797979'
}, },
@ -153,7 +156,7 @@ let bar_option = ref({
], ],
series: [ series: [
{ {
name: '合格', name: proxy.tLang('common','合格'),
type: 'bar', type: 'bar',
stack: 'Ad', stack: 'Ad',
shape: 'circle', shape: 'circle',
@ -166,7 +169,7 @@ let bar_option = ref({
data: [0] data: [0]
}, },
{ {
name: '不合格', name: proxy.tLang('common','不合格'),
type: 'bar', type: 'bar',
stack: 'Ad', stack: 'Ad',
shape: 'circle', shape: 'circle',
@ -192,19 +195,19 @@ let bar_option = ref({
let line_option = ref({ let line_option = ref({
title: { title: {
text: '张力值', text: proxy.tLang('home','张力值'),
left: '0', left: '0',
textStyle: { textStyle: {
color: '#000' color: '#000'
} }
}, },
xAxis: { xAxis: {
name: '针数', name: proxy.tLang('home','针数'),
type: 'category', type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
}, },
yAxis: { yAxis: {
name: '张力', name: proxy.tLang('home','张力'),
type: 'value' type: 'value'
}, },
series: [ series: [
@ -216,13 +219,14 @@ let line_option = ref({
] ]
}) })
let timer = null; let timer = null;
let info = ref({});
let qualityList = ref([]); let qualityList = ref([]);
function getData() { function getData() {
getNewestFiveInfo().then(res => { getNewestFiveInfo().then(res => {
qualityList.value = res.data; qualityList.value = res.data;
}); });
getBaseInfoNew().then(res => { getBaseInfoNew().then(res => {
console.log(res); info.value = res.data;
}); });
qualitynewDeviceOutputQuality().then(res => { qualitynewDeviceOutputQuality().then(res => {
pass.value = res.data.pass; pass.value = res.data.pass;

View File

@ -3,10 +3,15 @@
<el-form ref="formRef" :inline="true" :model="props.form" :rules="rules" class="demo-form-inline" <el-form ref="formRef" :inline="true" :model="props.form" :rules="rules" class="demo-form-inline"
label-width="100px"> label-width="100px">
<el-form-item :label="tLang('product', '产品编码')" prop="code"> <el-form-item :label="tLang('product', '产品编码')" prop="code">
<el-input v-model="form.code" :disabled="Boolean(props.form.id)" :placeholder="tLang('common', '请输入') + tLang('product', '产品编码')" /> <el-input v-model="form.code" :disabled="Boolean(props.form.id)"
:placeholder="tLang('common', '请输入') + tLang('product', '产品编码')" />
</el-form-item> </el-form-item>
<el-form-item :label="tLang('product', '针号')" prop="needleNum"> <el-form-item :label="tLang('product', '针号')" prop="needleNum">
<el-input v-model="form.needleNum" :placeholder="tLang('common', '请输入') + tLang('product', '针号')" /> <!-- <el-input v-model="form.needleNum" :placeholder="tLang('common', '请输入') + tLang('product', '针号')" /> -->
<el-select v-model="form.needleNum" :placeholder="tLang('common','请选择')" size="large" style="width: 220px">
<el-option label="针1" :value="'1'" />
<el-option label="针2" :value="'2'" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item :label="tLang('product', '面线信息')" prop="surfacelineCode"> <el-form-item :label="tLang('product', '面线信息')" prop="surfacelineCode">
<el-input v-model="form.surfacelineCode" :placeholder="tLang('common', '请输入') + tLang('product', '面线信息')" /> <el-input v-model="form.surfacelineCode" :placeholder="tLang('common', '请输入') + tLang('product', '面线信息')" />

View File

@ -50,7 +50,11 @@
<el-table-column type="index" :label="tLang('common', '序号')" width="60" align="center" /> <el-table-column type="index" :label="tLang('common', '序号')" width="60" align="center" />
<!-- <el-table-column :label="主键id" align="center" prop="id" /> --> <!-- <el-table-column :label="主键id" align="center" prop="id" /> -->
<el-table-column :label="tLang('product', '产品编码')" align="center" v-if="columns[0].visible" prop="code" /> <el-table-column :label="tLang('product', '产品编码')" align="center" v-if="columns[0].visible" prop="code" />
<el-table-column :label="tLang('product', '针号')" align="center" v-if="columns[1].visible" prop="needleNum" /> <el-table-column :label="tLang('product', '针号')" align="center" v-if="columns[1].visible" prop="needleNum" >
<template #default="{ row }">
{{ row.needleNum }}
</template>
</el-table-column>
<el-table-column :label="tLang('product', '面线信息')" align="center" v-if="columns[2].visible" prop="surfacelineCode" /> <el-table-column :label="tLang('product', '面线信息')" align="center" v-if="columns[2].visible" prop="surfacelineCode" />
<el-table-column :label="tLang('product', '底线信息')" align="center" v-if="columns[3].visible" <el-table-column :label="tLang('product', '底线信息')" align="center" v-if="columns[3].visible"
prop="bottomlineCode" /> prop="bottomlineCode" />

View File

@ -6,12 +6,12 @@
<el-descriptions-item :label="tLang('product','产品编码')">{{ props.info.code }}</el-descriptions-item> <el-descriptions-item :label="tLang('product','产品编码')">{{ props.info.code }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-descriptions title="" column="3" v-for="(zhen,index) in props.info.zhen" :key="index"> <el-descriptions title="" column="3" v-for="(zhen,index) in props.info.zhen" :key="index">
<el-descriptions-item>{{ zhen.needle_num }}</el-descriptions-item> <el-descriptions-item>{{ zhen.needle_num }}</el-descriptions-item>
<el-descriptions-item :label="tLang('product','底线编码')">{{ zhen.bottomlineCode }}</el-descriptions-item> <el-descriptions-item :label="tLang('product','底线编码')">{{ zhen.bottomlineCode }}</el-descriptions-item>
<el-descriptions-item :label="tLang('product','面线编码')">{{ zhen.surfacelineCode }}</el-descriptions-item> <el-descriptions-item :label="tLang('product','面线编码')">{{ zhen.surfacelineCode }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-descriptions title="" column="3" v-for="(zhen,index) in props.info.zhen" :key="index"> <el-descriptions title="" column="3" v-for="(zhen,index) in props.info.zhen" :key="index">
<el-descriptions-item >{{ zhen.needle_num + "表面张力" }}</el-descriptions-item> <el-descriptions-item >{{ zhen.needle_num + " 表面张力" }}</el-descriptions-item>
<el-descriptions-item :label="tLang('product','最小值')">{{ zhen.min }}</el-descriptions-item> <el-descriptions-item :label="tLang('product','最小值')">{{ zhen.min }}</el-descriptions-item>
<el-descriptions-item :label="tLang('product','最大值')">{{ zhen.max }}</el-descriptions-item> <el-descriptions-item :label="tLang('product','最大值')">{{ zhen.max }}</el-descriptions-item>
</el-descriptions> </el-descriptions>

View File

@ -51,12 +51,12 @@
<el-col :span="2"> <el-col :span="2">
<el-statistic :title="tLang('quality', '产品合格率')" :value="qualifiedRate" :precision="1" <el-statistic :title="tLang('quality', '产品合格率')" :value="qualifiedRate" :precision="1"
:value-style="{ color: 'green' }" :value-style="{ color: 'green' }"
:formatter="(val) => { return totalQuality == 0 ? '0%' :((val / totalQuality) * 100).toFixed(1) + '%' }" /> :formatter="(val) => { return (totalQuality == 0 ? '0' :(((val / totalQuality) * 100).toFixed(1)||0)) + '%' }" />
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<el-statistic :title="tLang('quality', '产品不合格率')" :value="unqualifiedRate" :precision="1" <el-statistic :title="tLang('quality', '产品不合格率')" :value="unqualifiedRate" :precision="1"
:value-style="{ color: 'red' }" :value-style="{ color: 'red' }"
:formatter="(val) => { return totalQuality == 0 ? '0%' :((val / totalQuality) * 100).toFixed(1)||0 + '%' }" /> :formatter="(val) => { return (totalQuality == 0 ? '0' :(((val / totalQuality) * 100).toFixed(1)||0)) + '%' }" />
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<el-statistic :title="tLang('quality', '产品完成量')" :value="totalQuality" /> <el-statistic :title="tLang('quality', '产品完成量')" :value="totalQuality" />
@ -82,15 +82,15 @@
prop="deviceName" /> prop="deviceName" />
<el-table-column :label="tLang('quality', '开始时间')" v-if="columns[5].visible" align="center" prop="startTime" <el-table-column :label="tLang('quality', '开始时间')" v-if="columns[5].visible" align="center" prop="startTime"
width="180"> width="180">
<template #default="scope"> <!-- <template #default="scope">
<span>{{ parseTime(scope.row.starttime, '{y}-{m}-{d} {hh}:{mm}:{ss}') }}</span> <span>{{ parseTime(scope.row.starttime, '{y}-{m}-{d} {hh}:{mm}:{ss}') }}</span>
</template> </template> -->
</el-table-column> </el-table-column>
<el-table-column :label="tLang('quality', '完成时间')" v-if="columns[6].visible" align="center" prop="endTime" <el-table-column :label="tLang('quality', '完成时间')" v-if="columns[6].visible" align="center" prop="endTime"
width="180"> width="180">
<template #default="scope"> <!-- <template #default="scope">
<span>{{ parseTime(scope.row.endtime, '{y}-{m}-{d} {hh}:{mm}:{ss}') }}</span> <span>{{ parseTime(scope.row.endtime, '{y}-{m}-{d} {hh}:{mm}:{ss}') }}</span>
</template> </template> -->
</el-table-column> </el-table-column>
<el-table-column :label="tLang('quality', '状态')" v-if="columns[7].visible" align="center" prop="state"> <el-table-column :label="tLang('quality', '状态')" v-if="columns[7].visible" align="center" prop="state">
<template #default="scope"> <template #default="scope">