This commit is contained in:
hzz 2024-04-13 14:47:57 +08:00
parent 8c55198470
commit 780e762ed6
10 changed files with 106 additions and 17 deletions

View File

@ -38,3 +38,13 @@ export function qualitynewDeviceOutputQuality() {
method: 'get'
})
}
//首页 产量堆叠图
export function getNewestFiveInfo() {
return request({
url: '/casm/quality/getNewestFiveInfo',
method: 'get'
})
}

View File

@ -64,6 +64,7 @@ export default {
"合格": "Pass",
"不合格": "Fail",
"未完成": "Unfinished",
"下载": "Download",
},
"validate": {
"不能为空": "Can not be empty ",
@ -71,7 +72,9 @@ export default {
"长度不正确": "Length is incorrect",
"范围不正确": "Range is incorrect",
"最大值为": "Maximum value is",
"最小值为": "Minimum value is"
"最小值为": "Minimum value is",
"最小针数不能大于最大针数": "Min needle can not be greater than max needle",
"开始时间不能大于结束时间": "Start time can not be greater than end time",
},
"tip": {
"确定删除选中记录?": "Are you sure to delete the selected record?",
@ -166,6 +169,7 @@ export default {
"类型": "Type",
"第几次": "Needle No.",
"步骤": "Step",
"二维码": "QRCode",
},
"produce": {
"产品编码": "ProductCode",

View File

@ -65,6 +65,7 @@ export default {
'合格': '合格',
'不合格': '不合格',
"未完成": "未完成",
"下载": "下载",
},
"validate": {
"不能为空": "不能为空",
@ -73,6 +74,8 @@ export default {
"范围不正确": "范围不正确",
"最大值为": "最大值为",
"最小值为": "最小值为",
"最小针数不能大于最大针数": "最小针数不能大于最大针数",
"开始时间不能大于结束时间": "开始时间不能大于结束时间",
},
"tip": {
"确定删除选中记录?": "确定删除选中记录?",
@ -166,6 +169,7 @@ export default {
"类型": "类型",
"第几针": "第几针",
"步骤": "步骤",
"二维码": "二维码",
},
"produce": {
"产品编码": "产品编码",

View File

@ -153,8 +153,9 @@ function getList() {
});
homeDeviceRate().then(response => {
pie_option.value.series[0].data = [
{ value: response.data.on, name: proxy.tLang('home', '使用中') },
{ value: response.data.off, name: proxy.tLang('home', '停机') }
{ value: response.data.off, name: proxy.tLang('home', '停机') },
{ value: response.data.on, name: proxy.tLang('home', '使用中') }
]
deviceState.on = response.data.on;
deviceState.off = response.data.off;

View File

@ -63,19 +63,42 @@
<v-chart class="chart-class" :option="line_option" />
</div>
<div class="table">
<el-table :data="qualityList" stripe style="width: 100%">
<el-table-column type="index" :label="tLang('common', '序号')" align="center" width="60" />
<el-table-column :label="tLang('quality', '产品序列号')" align="center" prop="serialNumber" />
<el-table-column :label="tLang('quality', '开始时间')" align="center" prop="starttime">
<template #default="scope">
<span>{{ parseTime(scope.row.starttime, '{y}-{m}-{d} {hh}:{mm}:{ss}') }}</span>
</template>
</el-table-column>
<el-table-column :label="tLang('quality', '完成时间')" align="center" prop="endtime">
<template #default="scope">
<span>{{ parseTime(scope.row.endtime, '{y}-{m}-{d} {hh}:{mm}:{ss}') }}</span>
</template>
</el-table-column>
<el-table-column :label="tLang('product', '底线编码')" align="center" prop="bottomlineCode" />
<el-table-column :label="tLang('product', '面线编码')" align="center" prop="surfacelineCode" />
啊啊 1720*828
1680*788
<el-table-column :label="tLang('quality', '状态')" align="center" prop="state">
<template #default="scope">
<div>
<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="error" size="mini" v-else>{{ tLang('common', '未完成') }}</el-tag>
</div>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</template>
<script setup>
import { getBaseInfoNew,qualitynewDeviceOutputQuality } from "@/api/home";
import { getBaseInfoNew, qualitynewDeviceOutputQuality, getNewestFiveInfo } from "@/api/home";
let table_height = ref(382);
let pass = ref([0]);
let noPass = ref([0]);
let bar_option = ref({
@ -192,8 +215,12 @@ let line_option = ref({
}
]
})
let timer = null;
let qualityList = ref([]);
function getData() {
getNewestFiveInfo().then(res => {
qualityList.value = res.data;
});
getBaseInfoNew().then(res => {
console.log(res);
});
@ -208,6 +235,12 @@ function getData() {
}
onMounted(() => {
getData();
timer = setInterval(() => {
getData();
}, 30000);
});
onUnmounted(() => {
clearInterval(timer);
});
</script>

View File

@ -67,6 +67,27 @@ const rules = {
persionCode: [
{ required: true, message: `${proxy.tLang('produce','员工编号')} ` + proxy.tLang('validate','不能为空'), trigger: "blur" }
],
starttime: [
{ required: true, message: `${proxy.tLang('produce','开始时间')} ` + proxy.tLang('validate','不能为空'), trigger: "blur" },
//
{validator: validateStarttime, trigger: 'blur'}
],
endtime: [
{ required: true, message: `${proxy.tLang('produce','结束时间')} ` + proxy.tLang('validate','不能为空'), trigger: "blur" },
//
{validator: validateStarttime, trigger: 'blur'}
],
}
function validateStarttime(rule, value, callback) {
let start = new Date(props.form.starttime).getTime();
let end = new Date(props.form.endtime).getTime();
if (start > end) {
callback(new Error('开始时间不能大于结束时间'));
} else {
callback();
}
}
function close() {
emit("update:modelValue", false);

View File

@ -73,7 +73,7 @@
<el-table-column :label="tLang('produce', '设备编码')" v-if="columns[1].visible" align="center"
prop="deviceCode" />
<el-table-column :label="tLang('produce', '员工编号')" v-if="columns[2].visible" align="center"
prop="persionCode" />
prop="userCode" />
<el-table-column :label="tLang('produce', '目标产量')" v-if="columns[3].visible" align="center"
prop="planOutput" />
<el-table-column :label="tLang('produce', '当前产量')" v-if="columns[4].visible" align="center" prop="output" />
@ -172,7 +172,7 @@ const columns = ref([
{ key: 4, label: proxy.tLang('produce', '当前产量'), visible: true },
{ key: 5, label: proxy.tLang('produce', '开始时间'), visible: true },
{ key: 6, label: proxy.tLang('produce', '结束时间'), visible: true },
{ key: 7, label: proxy.tLang('produce', '批次'), visible: true },
{ key: 7, label: proxy.tLang('produce', '批次'), visible: false },
{ key: 8, label: proxy.tLang('produce', '备注'), visible: false },
]);

View File

@ -45,7 +45,7 @@
<el-table-column :label="tLang('product', '产品编码')" align="center" v-if="columns[2].visible" prop="code" />
<el-table-column :label="tLang('product', '二维码')" align="center" v-if="columns[2].visible" prop="code">
<template #default="scope">
<el-button type="primary" @click="getProductQRCode(scope.row.code)">{{ tLang('product', '下载')
<el-button type="primary" @click="getProductQRCode(scope.row.code)">{{ tLang('common', '下载')
}}</el-button>
</template>
</el-table-column>
@ -235,7 +235,7 @@ function handleInfo(row) {
/** 提交按钮 */
function submitForm(propform) {
if (propform.code != null) {
if (propform.disabled != false && propform.disabled) {
updateProduction(propform).then(response => {
proxy.$modal.msgSuccess(proxy.tLang('common', '修改成功'));
open.value = false;

View File

@ -41,7 +41,21 @@ const { proxy } = getCurrentInstance();
const formRef = ref()
const rules = {
code: [{ required: true, message: `${proxy.tLang('common', '请输入') + proxy.tLang('product', '产品编码')}`, trigger: "blur" }],
min:[
{validator: validateMin, trigger: 'blur'}
],
max:[
{validator: validateMin, trigger: 'blur'}
]
};
function validateMin(rule, value, callback) {
if (props.form.min > props.form.max) {
callback(new Error('最小针数不能大于最大针数'));
} else {
callback();
}
}
const props = defineProps({
modelValue: [String, Object, Array],
title: String,

View File

@ -51,15 +51,15 @@
<el-col :span="2">
<el-statistic :title="tLang('quality', '产品合格率')" :value="qualifiedRate" :precision="1"
:value-style="{ color: 'green' }"
:formatter="(val) => { return ((val / total) * 100).toFixed(1) + '%' }" />
:formatter="(val) => { return totalQuality == 0 ? '0%' :((val / totalQuality) * 100).toFixed(1) + '%' }" />
</el-col>
<el-col :span="2">
<el-statistic :title="tLang('quality', '产品不合格率')" :value="unqualifiedRate" :precision="1"
:value-style="{ color: 'red' }"
:formatter="(val) => { return ((val / total) * 100).toFixed(1) + '%' }" />
:formatter="(val) => { return totalQuality == 0 ? '0%' :((val / totalQuality) * 100).toFixed(1)||0 + '%' }" />
</el-col>
<el-col :span="2">
<el-statistic :title="tLang('quality', '产品完成量')" :value="total" />
<el-statistic :title="tLang('quality', '产品完成量')" :value="totalQuality" />
</el-col>
<!-- <el-col :span="1.5">
<el-button type="warning" plain icon="download" size="mini" @click="handleExport"
@ -178,6 +178,7 @@ const columns = ref([
let qualifiedRate = ref(1)
let unqualifiedRate = ref(1)
let totalQuality = ref(1)
/** 查询设备信息列表 */
function getList() {
loading.value = true;
@ -185,6 +186,7 @@ function getList() {
if (response.code === 200) {
qualifiedRate.value = response.data.on
unqualifiedRate.value = response.data.off
totalQuality.value = response.data.total
}
})
listQuality(queryParams).then(response => {