init(projects): 整体修改

master
xushilin 11 months ago
parent 3bd002c96f
commit 622f68e4da

@ -138,7 +138,7 @@ export let option = {
],
series: [
{
name: '拉丝',
name: '投料数量',
type: 'bar',
barWidth: 12,
itemStyle: {
@ -165,7 +165,7 @@ export let option = {
},
},
{
name: '拉丝报工数量',
name: '报工数量',
type: 'bar',
barWidth: 12,
itemStyle: {

@ -1,7 +1,7 @@
<template>
<div id="screen-wrapper" class="screen-wrapper">
<div id="screen" class="screen">
<div class="title">领秀镜智慧工厂</div>
<div class="title">领秀镜智慧工厂</div>
<!-- // -->
<div class="left_area left_top_area">
<div class="left_top_div">
@ -61,14 +61,14 @@
<div v-show="!loading2" class="bar_area">
<div class="left">
<div class="yxz">
<div class="bar_title">本周搬运总数</div>
<div class="bar_title">本周生产总数</div>
<div class="content">
<div class="progress">{{ totalTransport }}</div>
</div>
</div>
</div>
<div class="tips" style="position: absolute; top: 47px; right: 300px; color: #fff; font-size: 12px">
本周搬运
本周生产
</div>
<div class="mid" style="width: 700px; display: flex; justify-content: space-around">
<!-- <div class="area1" v-for="item in productionData.wiredrawingNumWeek">
@ -664,7 +664,7 @@ export default defineComponent({
if (res.code === 200) {
this.loading3 = false;
this.loading1 = false;
this.detectionDayNum = res.data.detectionDayNum || 0;
this.detectionDayNum = res.data.detectionDayNum || 1;
const qcPageResults = res.data.qcPageResults || [];
for (const item of qcPageResults) {
this.leftBotData.seriesData.push(Number(item.goodRate).toFixed(2));

@ -394,13 +394,13 @@ const columns: Ref<DataTableColumns<outWarehouse.TableList>> = ref([
key: 'moldOutboundTime',
align: 'center',
width: 180
},
{
title: '出库位置',
key: 'attr1',
align: 'center',
width: 100
}
// {
// title: '',
// key: 'attr1',
// align: 'center',
// width: 100
// }
]);
function search() {

@ -96,21 +96,57 @@ const columns: Ref<DataTableColumns<drawingProcessCheckRecord.TableList>> = ref(
width: 70,
render: (_row, index) => (searchForm.value.pageNum - 1) * searchForm.value.pageSize + index + 1
},
// {
// title: '',
// key: 'workOrdeType',
// align: 'center',
// width: 100,
// render: row => {
// return row.workOrdeType === '0' ? '' : '';
// }
// },
{
title: '检测项',
key: 'attr1',
align: 'center',
width: 180
},
{
title: '质检人',
key: 'qualityInspector',
align: 'center',
width: 100
},
{
title: '工单类型',
key: 'workOrdeType',
title: '是否合格',
key: 'qualifiedOrNot',
align: 'center',
width: 100,
render: row => (
<n-tag type={row.qualifiedOrNot === '0' ? 'success' : 'error'}>
{row.qualifiedOrNot === '0' ? '合格' : '不合格'}
</n-tag>
)
},
{
title: '缺陷项',
key: '',
align: 'center',
width: 180,
ellipsis: {
tooltip: true
},
render: row => {
return row.workOrdeType === '0' ? '板材' : '金属';
let defectName = '';
if (row.qcDefectList) {
row.qcDefectList.forEach(item => {
defectName += `${item.defectName},`;
});
defectName = defectName.slice(0, -1);
}
return defectName;
}
},
// {
// title: '线',
// key: 'attr1',
// align: 'center',
// width: 100
// },
{
title: '机台',
key: 'deviceName',
@ -134,20 +170,11 @@ const columns: Ref<DataTableColumns<drawingProcessCheckRecord.TableList>> = ref(
tooltip: true
}
},
// {
// title: '',
// key: 'clientName',
// align: 'center',
// width: 140,
// ellipsis: {
// tooltip: true
// }
// },
{
title: '生产工单号',
key: 'generateWorkOrderNumber',
align: 'center',
width: 100,
width: 180,
ellipsis: {
tooltip: true
}
@ -156,14 +183,14 @@ const columns: Ref<DataTableColumns<drawingProcessCheckRecord.TableList>> = ref(
title: '产品规格',
key: 'productSpecifications',
align: 'center',
width: 100
},
{
title: '数量',
key: 'weight',
align: 'center',
width: 100
width: 160
},
// {
// title: '',
// key: 'weight',
// align: 'center',
// width: 100
// },
{
title: '单位',
key: 'measure',
@ -174,49 +201,13 @@ const columns: Ref<DataTableColumns<drawingProcessCheckRecord.TableList>> = ref(
title: '批号',
key: 'batchNumber',
align: 'center',
width: 100
width: 180
},
{
title: '日期',
key: 'createTime',
align: 'center',
width: 180
},
{
title: '质检人',
key: 'qualityInspector',
align: 'center',
width: 100
},
{
title: '是否合格',
key: 'qualifiedOrNot',
align: 'center',
width: 100,
render: row => (
<n-tag type={row.qualifiedOrNot === '0' ? 'success' : 'error'}>
{row.qualifiedOrNot === '0' ? '合格' : '不合格'}
</n-tag>
)
},
{
title: '缺陷项',
key: '',
align: 'center',
width: 180,
ellipsis: {
tooltip: true
},
render: row => {
let defectName = '';
if (row.qcDefectList) {
row.qcDefectList.forEach(item => {
defectName += `${item.defectName}, `;
});
defectName = defectName.slice(0, -1);
}
return defectName;
}
}
]);

@ -147,27 +147,27 @@ const columns: Ref<DataTableColumns<enamellingProcessCheckRecord.TableList>> = r
width: 70,
render: (_row, index) => (searchForm.value.pageNum - 1) * searchForm.value.pageSize + index + 1
},
{
title: '工单类型',
key: 'workOrdeType',
align: 'center',
width: 100,
render: row => {
return row.workOrdeType === '0' ? '金属' : '板材';
}
},
// {
// title: '',
// key: 'workOrdeType',
// align: 'center',
// width: 100,
// render: row => {
// return row.workOrdeType === '0' ? '' : '';
// }
// },
{
title: '机台',
key: 'deviceName',
align: 'center',
width: 100
},
{
title: '轴号',
key: 'axisNumber',
align: 'center',
width: 100
},
// {
// title: '',
// key: 'axisNumber',
// align: 'center',
// width: 100
// },
{
title: '订单类型',
key: 'orderType',
@ -194,20 +194,20 @@ const columns: Ref<DataTableColumns<enamellingProcessCheckRecord.TableList>> = r
tooltip: true
}
},
{
title: '料号',
key: 'partNumber',
align: 'center',
width: 140,
ellipsis: {
tooltip: true
}
},
// {
// title: '',
// key: 'partNumber',
// align: 'center',
// width: 140,
// ellipsis: {
// tooltip: true
// }
// },
{
title: '批号',
key: 'batchNumber',
align: 'center',
width: 140
width: 180
},
{
title: '生产工单号',
@ -222,13 +222,13 @@ const columns: Ref<DataTableColumns<enamellingProcessCheckRecord.TableList>> = r
title: '产品型号',
key: 'productModel',
align: 'center',
width: 100
width: 160
},
{
title: '产品规格',
key: 'productSpecifications',
align: 'center',
width: 100
width: 160
},
{
title: '日期',
@ -238,10 +238,16 @@ const columns: Ref<DataTableColumns<enamellingProcessCheckRecord.TableList>> = r
},
{
title: '质检人',
key: 'qualityInspector',
key: 'createBy',
align: 'center',
width: 100
},
{
title: '检测项',
key: 'attr2',
align: 'center',
width: 180
},
{
title: '是否合格',
key: 'qualifiedOrNot',

@ -61,7 +61,7 @@
:style="{ width: formItemWidth }"
/>
</n-form-item-grid-item>
<n-form-item-grid-item label="缺陷分类" path="defectClassificationId">
<!-- <n-form-item-grid-item label="缺陷分类" path="defectClassificationId">
<n-select
v-model:value="addForm.defectClassificationId"
placeholder="请选择缺陷分类"
@ -69,7 +69,7 @@
:options="defectClassifyList"
:style="{ width: formItemWidth }"
></n-select>
</n-form-item-grid-item>
</n-form-item-grid-item> -->
<n-form-item-grid-item label="缺陷等级" path="defectLevel">
<n-input
v-model:value="addForm.defectLevel"
@ -161,13 +161,13 @@ const columns: Ref<DataTableColumns<qcDefect.TableList>> = ref([
align: 'center',
minWidth: 100
},
{
title: '缺陷分类',
key: '',
align: 'center',
minWidth: 100,
render: row => row.qcDefectClassification.defectClassificationName
},
// {
// title: '',
// key: '',
// align: 'center',
// minWidth: 100,
// render: row => row.qcDefectClassification.defectClassificationName
// },
{
title: '缺陷等级',
key: 'defectLevel',

@ -46,7 +46,7 @@
style="width: 800px"
>
<n-grid x-gap="12" :cols="2">
<n-form-item-grid-item label="分类" path="detectionName">
<!-- <n-form-item-grid-item label="分类" path="detectionName">
<n-select
v-model:value="addForm.itemTypeId"
placeholder="请选择分类"
@ -55,7 +55,7 @@
:options="defectItemClassifyList"
:style="{ width: formItemWidth }"
></n-select>
</n-form-item-grid-item>
</n-form-item-grid-item> -->
<n-form-item-grid-item label="质检检测项编码" path="detectionCode">
<n-input
v-model:value="addForm.detectionCode"
@ -84,14 +84,14 @@
<n-form-item-grid-item label="是否启用">
<n-switch v-model:value="addForm.enable" :checked-value="'Y'" :unchecked-value="'N'" />
</n-form-item-grid-item>
<n-form-item-grid-item label="填写数据设置" path="attr1">
<!-- <n-form-item-grid-item label="填写数据设置" path="attr1">
<n-input
v-model:value="addForm.attr1"
type="text"
placeholder="请输入填写数据设置"
:style="{ width: formItemWidth }"
/>
</n-form-item-grid-item>
</n-form-item-grid-item> -->
</n-grid>
</n-form>
</div>
@ -115,7 +115,7 @@ import {
editQcInspectionItems,
deleteQcInspectionItems
} from '~/src/service/api/quality/qualityInspectionItem/index';
import { getQClassification } from '~/src/service/api/quality/qualityInspectionClassify/index';
// import { getQClassification } from '~/src/service/api/quality/qualityInspectionClassify/index';
const searchForm = ref<qualityInspectionItem.searchForm>({
detectionCode: '',
detectionName: '',
@ -150,7 +150,7 @@ const requiredList = ref<{ label: string; value: string }[]>([
{ label: '是', value: '0' },
{ label: '否', value: '1' }
]);
const defectItemClassifyList = ref<{ label: string; value: string }[]>([]);
// const defectItemClassifyList = ref<{ label: string; value: string }[]>([]);
const rules = {
detectionCode: createRequiredFormRule('请输入质检检测项编码'),
detectionName: createRequiredFormRule('请输入质检检测项名称'),
@ -167,12 +167,12 @@ const columns: Ref<DataTableColumns<qualityInspectionItem.TableList>> = ref([
align: 'center',
render: (_row, index) => (searchForm.value.pageNum - 1) * searchForm.value.pageSize + index + 1
},
{
title: '分类',
key: 'classificationName',
align: 'center',
render: row => row.qcClassification?.classificationName
},
// {
// title: '',
// key: 'classificationName',
// align: 'center',
// render: row => row.qcClassification?.classificationName
// },
{
title: '质检检测项编码',
key: 'detectionCode',
@ -209,12 +209,12 @@ const columns: Ref<DataTableColumns<qualityInspectionItem.TableList>> = ref([
);
}
},
{
title: '数据填写设置',
key: 'attr1',
align: 'center',
width: 140
},
// {
// title: '',
// key: 'attr1',
// align: 'center',
// width: 140
// },
{
title: '操作',
key: 'actions',
@ -363,18 +363,18 @@ function changeStatus(row: qualityInspectionItem.TableList, val: string): void {
});
}
function getList() {
getQClassification({ pageSize: 999 }).then(res => {
if (res.code === 200) {
res.rows.forEach(item => {
defectItemClassifyList.value.push({
label: item.classificationName,
value: item.id
});
});
}
});
}
// function getList() {
// getQClassification({ pageSize: 999 }).then(res => {
// if (res.code === 200) {
// res.rows.forEach(item => {
// defectItemClassifyList.value.push({
// label: item.classificationName,
// value: item.id
// });
// });
// }
// });
// }
function init() {
startLoading();
@ -388,7 +388,7 @@ function init() {
}
onMounted(() => {
init();
getList();
// getList();
});
</script>

@ -39,10 +39,11 @@
<n-grid-item v-for="item in deviceDataList" :key="item.code">
<div class="device-card" :class="getStatus(item.status).className">
<div>设备编码 : {{ item.code }}</div>
<div>设备类型 : 料机</div>
<div>设备类型 : 料机</div>
<div>运行状态 : {{ getStatus(item.status).text }}</div>
<div>产品型号 : {{ item.productModel }}</div>
<div>生产产量 :
<div>
生产产量 :
<count-to
:start-value="1"
:end-value="item.count"
@ -51,8 +52,13 @@
:use-easing="true"
easing-function="cubicOut"
class="animated-number"
/></div>
<div>生产速率 : <span style="color:yellow">{{item.rate}}</span> /</div>
/>
</div>
<div>
生产速率 :
<span style="color: yellow">{{ item.rate }}</span>
/
</div>
<div>结束日期 : {{ item.endTime }}</div>
</div>
</n-grid-item>
@ -62,20 +68,34 @@
</template>
<script setup lang="tsx">
import {ref, onMounted, onUnmounted, reactive} from 'vue';
import { ref, onMounted, onUnmounted, reactive } from 'vue';
import mqtt from 'mqtt';
import {getWorkbenchWiredrawingList} from '@/service/api/md/workbench/wiredrawing';
import {selectAllWorkbenchEnamellingList} from '@/service/api/md/workbench/enamelling';
import {useResetSearch} from '~/src/utils/common/searchReset';
import {useSearchBtn} from '~/src/hooks/common/useBtn';
import {formatDate} from '~/src/utils/form/rule';
import {GradientBg} from './components';
const {searchForm, reset} = useResetSearch({
import { getWorkbenchWiredrawingList } from '@/service/api/md/workbench/wiredrawing';
import { selectAllWorkbenchEnamellingList } from '@/service/api/md/workbench/enamelling';
import { useResetSearch } from '~/src/utils/common/searchReset';
import { useSearchBtn } from '~/src/hooks/common/useBtn';
import { formatDate } from '~/src/utils/form/rule';
import { GradientBg } from './components';
const { searchForm, reset } = useResetSearch({
location: '全部'
});
const productModels = ['LX25-Y39-002金', 'LX30-Y40-005浅蓝', 'LX35-Z25-006蓝灰', 'LX40-B02-002黑', 'LX30-Y40-005蓝', 'LX35-Z5-004白', 'LX25-A08-007黑'
, 'LX-Y39-030黑', 'LX20-Y30-010灰', 'LX35-Z5-006蓝', 'LX40-B01-003黑', 'LX30-Y42-002蓝', 'LX35-Z15-004单蓝', 'LX25-A08-006灰']; //
const productModels = [
'LX25-Y39-002金',
'LX30-Y40-005浅蓝',
'LX35-Z45-006蓝玳瑁',
'XD40-B02-002黑',
'XD30-Y40-005蓝',
'XD35-Z5-004白',
'XD25-A08-007黑',
'WD-Y39-030黑',
'LX20-Y30-010灰',
'LX35-Z45-006蓝玳瑁',
'XD40-B01-003黑',
'XD30-Y42-002蓝',
'XD35-Z5-004蓝',
'XD25-A08-006灰'
]; //
interface CardData {
id: string;
title: string;
@ -97,7 +117,7 @@ type device = {
interval: number;
originalCode: string; //
currentModelIndex: number; //
rate?: String;
rate?: string;
};
const deviceAllList = ref<Array<device>>([]);
@ -133,7 +153,7 @@ const cardData = reactive<CardData[]>([
title: '待机',
value: 9,
unit: '',
colors: ['#56cdf3', '#719de3'],
colors: ['#a4a1a1', '#494848'],
icon: 'carbon:document-download'
},
{
@ -221,17 +241,21 @@ function getStatus(status: number) {
}
async function getList() {
await getWorkbenchWiredrawingList({pageSize: 999999}).then(res => {
await getWorkbenchWiredrawingList({ pageSize: 999999 }).then(res => {
if (res.code === 200) {
res.rows.forEach(item => {
deviceEach(item);
res.rows.forEach((item, index) => {
let status = 1;
if (index < 10) {
status = 0;
}
deviceEach(item, status);
});
}
});
await selectAllWorkbenchEnamellingList({}).then(res => {
if (res.code === 200) {
res.data.forEach(item => {
deviceEach(item);
deviceEach(item, 1);
});
}
});
@ -239,17 +263,33 @@ async function getList() {
init();
}
function deviceEach(item: any) {
function deviceEach(item: any, status: number) {
if (locationList.value.findIndex(ele => ele.value === item.process) === -1) {
locationList.value.push({
label: `${item.process}车间`,
value: item.process
});
}
let interval = Math.floor((16 + Math.random() * 10)) * 1000;
const interval = Math.floor(16 + Math.random() * 10) * 1000;
if (status === 1) {
deviceAllList.value.push({
code: item.equipmentCode,
status: 1,
startTime: '',
count: 0,
endTime: '',
process: item.process,
productModel: productModels[getRandom(1, 4)],
interval: 0,
originalCode: '', //
currentModelIndex: 0, //
rate: '0'
});
return;
}
const newDevice = reactive({
code: item.equipmentCode,
status: 0,
status,
productModel: productModels[getRandom(1, 4)],
startTime: formatDate(
new Date(getRandom(new Date().getTime() - 1000 * 60 * 60 * 48, new Date().getTime())),
@ -263,10 +303,10 @@ function deviceEach(item: any) {
process: item.process,
originalCode: item.equipmentCode,
currentModelIndex: 0,
interval: interval, // 16-24
interval, // 16-24
// count: 0,
timerId: undefined,
rate: (60 * 1000 / interval).toFixed(1)
rate: ((60 * 1000) / interval).toFixed(1)
});
startDeviceTimer(newDevice); //
deviceAllList.value.push(newDevice);
@ -288,12 +328,11 @@ function resetDeviceProduction(device: device) {
device.currentModelIndex = (device.currentModelIndex + 1) % productModels.length;
device.productModel = productModels[device.currentModelIndex];
clearInterval(device.timerId);
device.interval = Math.floor((15 + Math.random() * 10)) * 1000; //
device.rate = (60 * 1000 / device.interval).toFixed(1);
device.interval = Math.floor(15 + Math.random() * 10) * 1000; //
device.rate = ((60 * 1000) / device.interval).toFixed(1);
startDeviceTimer(device);
}
function getRandom(min: number, max: number) {
return Math.floor(Math.random() * (max - min + 1) + min);
}
@ -320,13 +359,12 @@ function init() {
}
//
let intervalId: number;
// let intervalId: number;
// MQTT
onMounted(() => {
connectToMQTT();
init();
getList();
});
// MQTT
@ -354,7 +392,7 @@ onUnmounted(() => {
}
.download-color {
background: linear-gradient(45deg, #56cdf3, #719de3);
background: linear-gradient(45deg, #a4a1a1, #494848);
}
.trade-color {

@ -329,7 +329,10 @@ const columns: DataTableColumns<ApiMaterialStockManagement.materialStock> = [
title: '单位',
key: 'unitOfMeasure',
align: 'center',
width: 120
width: 120,
render: row => {
return getUnitOfMeasure(row);
}
},
// {
// title: '',
@ -474,6 +477,19 @@ const detailColumns: DataTableColumns<ApiMaterialStockManagement.materialStock>
}
];
function getUnitOfMeasure(row: ApiMaterialStockManagement.materialStock) {
switch (row.warehouseName) {
case '车间仓':
return '个';
case '原料仓':
return '个';
case '辅料仓':
return '个';
default:
return '付';
}
}
function handleEdit(row: ApiMaterialStockManagement.materialStock) {
handleEditShow.value = true;
handleEditRow.value = JSON.parse(JSON.stringify(row));

@ -110,12 +110,12 @@ const columns: Ref<DataTableColumns<any>> = ref([
align: 'center',
width: 80
},
{
title: '轴编号',
key: 'axisNumber',
align: 'center',
width: 100
},
// {
// title: '',
// key: 'axisNumber',
// align: 'center',
// width: 100
// },
{
title: '箱毛重',
key: 'boxGrossWeight',

@ -232,12 +232,12 @@ const columns: Ref<DataTableColumns<DataType>> = ref([
align: 'center',
width: 100
},
{
title: '净重',
key: 'weight',
align: 'center',
width: 100
},
// {
// title: '',
// key: 'weight',
// align: 'center',
// width: 100
// },
{
title: '单位',
key: 'unitOfMeasure',

@ -160,12 +160,12 @@ const columns: Ref<DataTableColumns<DataType>> = ref([
width: 100,
key: 'equipmentCode'
},
{
title: '位置',
align: 'center',
width: 100,
key: 'attr1'
},
// {
// title: '',
// align: 'center',
// width: 100,
// key: 'attr1'
// },
{
title: '产品编号',
align: 'center',

Loading…
Cancel
Save