init(projects): 整体修改

master
xushilin 11 months ago
parent 3bd002c96f
commit 622f68e4da

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

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

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

@ -96,21 +96,57 @@ const columns: Ref<DataTableColumns<drawingProcessCheckRecord.TableList>> = ref(
width: 70, width: 70,
render: (_row, index) => (searchForm.value.pageNum - 1) * searchForm.value.pageSize + index + 1 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: '工单类型', title: '是否合格',
key: 'workOrdeType', key: 'qualifiedOrNot',
align: 'center', align: 'center',
width: 100, 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 => { 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: '机台', title: '机台',
key: 'deviceName', key: 'deviceName',
@ -134,20 +170,11 @@ const columns: Ref<DataTableColumns<drawingProcessCheckRecord.TableList>> = ref(
tooltip: true tooltip: true
} }
}, },
// {
// title: '',
// key: 'clientName',
// align: 'center',
// width: 140,
// ellipsis: {
// tooltip: true
// }
// },
{ {
title: '生产工单号', title: '生产工单号',
key: 'generateWorkOrderNumber', key: 'generateWorkOrderNumber',
align: 'center', align: 'center',
width: 100, width: 180,
ellipsis: { ellipsis: {
tooltip: true tooltip: true
} }
@ -156,14 +183,14 @@ const columns: Ref<DataTableColumns<drawingProcessCheckRecord.TableList>> = ref(
title: '产品规格', title: '产品规格',
key: 'productSpecifications', key: 'productSpecifications',
align: 'center', align: 'center',
width: 100 width: 160
},
{
title: '数量',
key: 'weight',
align: 'center',
width: 100
}, },
// {
// title: '',
// key: 'weight',
// align: 'center',
// width: 100
// },
{ {
title: '单位', title: '单位',
key: 'measure', key: 'measure',
@ -174,49 +201,13 @@ const columns: Ref<DataTableColumns<drawingProcessCheckRecord.TableList>> = ref(
title: '批号', title: '批号',
key: 'batchNumber', key: 'batchNumber',
align: 'center', align: 'center',
width: 100 width: 180
}, },
{ {
title: '日期', title: '日期',
key: 'createTime', key: 'createTime',
align: 'center', align: 'center',
width: 180 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, width: 70,
render: (_row, index) => (searchForm.value.pageNum - 1) * searchForm.value.pageSize + index + 1 render: (_row, index) => (searchForm.value.pageNum - 1) * searchForm.value.pageSize + index + 1
}, },
{ // {
title: '工单类型', // title: '',
key: 'workOrdeType', // key: 'workOrdeType',
align: 'center', // align: 'center',
width: 100, // width: 100,
render: row => { // render: row => {
return row.workOrdeType === '0' ? '金属' : '板材'; // return row.workOrdeType === '0' ? '' : '';
} // }
}, // },
{ {
title: '机台', title: '机台',
key: 'deviceName', key: 'deviceName',
align: 'center', align: 'center',
width: 100 width: 100
}, },
{ // {
title: '轴号', // title: '',
key: 'axisNumber', // key: 'axisNumber',
align: 'center', // align: 'center',
width: 100 // width: 100
}, // },
{ {
title: '订单类型', title: '订单类型',
key: 'orderType', key: 'orderType',
@ -194,20 +194,20 @@ const columns: Ref<DataTableColumns<enamellingProcessCheckRecord.TableList>> = r
tooltip: true tooltip: true
} }
}, },
{ // {
title: '料号', // title: '',
key: 'partNumber', // key: 'partNumber',
align: 'center', // align: 'center',
width: 140, // width: 140,
ellipsis: { // ellipsis: {
tooltip: true // tooltip: true
} // }
}, // },
{ {
title: '批号', title: '批号',
key: 'batchNumber', key: 'batchNumber',
align: 'center', align: 'center',
width: 140 width: 180
}, },
{ {
title: '生产工单号', title: '生产工单号',
@ -222,13 +222,13 @@ const columns: Ref<DataTableColumns<enamellingProcessCheckRecord.TableList>> = r
title: '产品型号', title: '产品型号',
key: 'productModel', key: 'productModel',
align: 'center', align: 'center',
width: 100 width: 160
}, },
{ {
title: '产品规格', title: '产品规格',
key: 'productSpecifications', key: 'productSpecifications',
align: 'center', align: 'center',
width: 100 width: 160
}, },
{ {
title: '日期', title: '日期',
@ -238,10 +238,16 @@ const columns: Ref<DataTableColumns<enamellingProcessCheckRecord.TableList>> = r
}, },
{ {
title: '质检人', title: '质检人',
key: 'qualityInspector', key: 'createBy',
align: 'center', align: 'center',
width: 100 width: 100
}, },
{
title: '检测项',
key: 'attr2',
align: 'center',
width: 180
},
{ {
title: '是否合格', title: '是否合格',
key: 'qualifiedOrNot', key: 'qualifiedOrNot',

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

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

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

@ -329,7 +329,10 @@ const columns: DataTableColumns<ApiMaterialStockManagement.materialStock> = [
title: '单位', title: '单位',
key: 'unitOfMeasure', key: 'unitOfMeasure',
align: 'center', align: 'center',
width: 120 width: 120,
render: row => {
return getUnitOfMeasure(row);
}
}, },
// { // {
// title: '', // 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) { function handleEdit(row: ApiMaterialStockManagement.materialStock) {
handleEditShow.value = true; handleEditShow.value = true;
handleEditRow.value = JSON.parse(JSON.stringify(row)); handleEditRow.value = JSON.parse(JSON.stringify(row));

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

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

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

Loading…
Cancel
Save