master
吴普建 11 months ago
parent a34c632c1b
commit f89db4efd2

@ -650,11 +650,11 @@ const columns: Ref<DataTableColumns<Procure.rawProcureList.columns>> = ref([
key: 'createTime',
width: 180
},
{
title: '计划员',
key: 'createBy',
width: 150
},
// {
// title: '',
// key: 'createBy',
// width: 150
// },
{
title: '状态',
key: 'status',
@ -662,7 +662,6 @@ const columns: Ref<DataTableColumns<Procure.rawProcureList.columns>> = ref([
fixed: 'right',
align: 'center',
render: row => {
console.log(row.status);
return <dict-tag options={erp_auxiliary_status.value} value={row.status}></dict-tag>;
}
},

@ -139,7 +139,7 @@ const cardData = reactive<CardData[]>([
{
id: 'visit',
title: '设备总数',
value: 0,
value: 25,
unit: '',
colors: ['#ec4786', '#b955a4'],
icon: 'ant-design:bar-chart-outlined'
@ -147,7 +147,7 @@ const cardData = reactive<CardData[]>([
{
id: 'amount',
title: '运行中',
value: 3,
value: 10,
unit: '$',
colors: ['#865ec0', '#5144b4'],
icon: 'ant-design:money-collect-outlined'
@ -155,7 +155,7 @@ const cardData = reactive<CardData[]>([
{
id: 'download',
title: '待机',
value: 9,
value: 15,
unit: '',
colors: ['#a4a1a1', '#494848'],
icon: 'carbon:document-download'
@ -189,6 +189,158 @@ const options = {
const isConnect = false;
const codes = ref<any>([]);
const initData = ref<any>([
{
code: 'Kailiao001',
status: 1,
startTime: '2023-07-01 00:00:00',
count: 0,
endTime: '2023-07-01 00:00:00',
process: getRandom(65, 75),
productModel: productModels[0],
timerId: undefined,
interval: 0,
pics: getRandom(500, 2000),
originalCode: '', //
currentModelIndex: 0, //
rate: '0'
},
{
code: 'Kailiao002',
status: 1,
startTime: '2023-07-01 00:00:00',
count: 0,
endTime: '2023-07-01 00:00:00',
process: getRandom(65, 75),
productModel: productModels[1],
timerId: undefined,
interval: 0,
pics: getRandom(500, 2000),
originalCode: '', //
currentModelIndex: 1, //
rate: '0'
},
{
code: 'Kailiao003',
status: 1,
startTime: '2023-07-01 00:00:00',
count: 0,
endTime: '2023-07-01 00:00:00',
process: getRandom(65, 75),
productModel: productModels[2],
timerId: undefined,
interval: 0,
pics: getRandom(500, 2000),
originalCode: '', //
currentModelIndex: 2, //
rate: '0'
},
{
code: 'Kailiao004',
status: 1,
startTime: '2023-07-01 00:00:00',
count: 0,
endTime: '2023-07-01 00:00:00',
process: getRandom(65, 75),
productModel: productModels[0],
timerId: undefined,
interval: 0,
pics: getRandom(500, 2000),
originalCode: '', //
currentModelIndex: 0, //
rate: '0'
},
{
code: 'Kailiao005',
status: 1,
startTime: '2023-07-01 00:00:00',
count: 0,
endTime: '2023-07-01 00:00:00',
process: getRandom(65, 75),
productModel: productModels[1],
timerId: undefined,
interval: 0,
pics: getRandom(500, 2000),
originalCode: '', //
currentModelIndex: 1, //
rate: '0'
},
{
code: 'Kailiao006',
status: 1,
startTime: '2023-07-01 00:00:00',
count: 0,
endTime: '2023-07-01 00:00:00',
process: getRandom(65, 75),
productModel: productModels[2],
timerId: undefined,
interval: 0,
pics: getRandom(500, 2000),
originalCode: '', //
currentModelIndex: 2, //
rate: '0'
},
{
code: 'Kailiao007',
status: 1,
startTime: '2023-07-01 00:00:00',
count: 0,
endTime: '2023-07-01 00:00:00',
process: getRandom(65, 75),
productModel: productModels[3],
timerId: undefined,
interval: 0,
pics: getRandom(500, 2000),
originalCode: '', //
currentModelIndex: 3, //
rate: '0'
},
{
code: 'Kailiao008',
status: 1,
startTime: '2023-07-01 00:00:00',
count: 0,
endTime: '2023-07-01 00:00:00',
process: getRandom(65, 75),
productModel: productModels[4],
timerId: undefined,
interval: 0,
pics: getRandom(500, 2000),
originalCode: '', //
currentModelIndex: 4, //
rate: '0'
},
{
code: 'Kailiao009',
status: 1,
startTime: '2023-07-01 00:00:00',
count: 0,
endTime: '2023-07-01 00:00:00',
process: getRandom(65, 75),
productModel: productModels[5],
timerId: undefined,
interval: 0,
pics: getRandom(500, 2000),
originalCode: '', //
currentModelIndex: 5, //
rate: '0'
},
{
code: 'Kailiao010',
status: 1,
startTime: '2023-07-01 00:00:00',
count: 0,
endTime: '2023-07-01 00:00:00',
process: getRandom(65, 75),
productModel: productModels[6],
timerId: undefined,
interval: 0,
pics: getRandom(500, 2000),
originalCode: '', //
currentModelIndex: 6, //
rate: '0'
},
]);
const connectToMQTT = () => {
// MQTT broker
// if (!isConnect) return;
@ -203,7 +355,6 @@ const connectToMQTT = () => {
console.log(`Subscribed to topic: ${topic}`);
}
});
});
//
@ -292,6 +443,7 @@ function getStatus(status: number) {
}
async function getList() {
// await getWorkbenchWiredrawingList({ pageSize: 999999 }).then(res => {
// if (res.code === 200) {
// res.rows.forEach((item, index) => {
@ -303,6 +455,10 @@ async function getList() {
// });
// }
// });
initData.value.forEach((item, index) => {
let status = 0;
deviceEach(item, status);
});
await selectAllWorkbenchEnamellingList({}).then(res => {
if (res.code === 200) {
res.data.forEach(item => {
@ -310,7 +466,6 @@ async function getList() {
});
}
});
cardData[0].value = deviceAllList.value.length;
init();
}
@ -324,8 +479,13 @@ function deviceEach(item: any, status: number) {
}
if (deviceAllList.value.findIndex(ele => ele.code === item.code) !== -1 && codes.value.indexOf(item.code) !== -1) {
// console.log("item.status", item.status)
let device = deviceAllList.value.find(ele => ele.code === item.code)
let pics =localStorage.getItem(`pics_${device?.code}`)
if(device && pics){
device.pics = Number(pics) + getRandom(1, 5);
localStorage.setItem(`pics_${device?.code}`, device.pics.toString());
}
if(device && device.pics){
device.status = item.status
if(item.status == 3){
@ -373,15 +533,13 @@ function deviceEach(item: any, status: number) {
timerId: undefined,
rate: ''
});
deviceAllList.value.forEach(item => {
if (item.code && item.pics) {
localStorage.setItem(`pics_${item.code}`, item.pics.toString());
}
});
if(item.status == 3){
newDevice.status = 3
newDevice.pics = 0
newDevice.process = '0'
}else{
localStorage.setItem(`pics_${newDevice.code}`, newDevice.pics.toString());
}
deviceAllList.value.unshift(newDevice);
}
@ -436,7 +594,7 @@ function init() {
// let intervalId: number;
// MQTT
onMounted(() => {
loading.value = true;
loading.value = false;
connectToMQTT();
init();
getList();

@ -21,9 +21,9 @@
<n-form-item label="入库批次号" path="Item.batchCode" :label-style="labelStyle">
<n-input v-model:value="formValue.batchCode" placeholder="请输入库批次号" />
</n-form-item>
<n-form-item label="仓库名称" path="Item.warehouseName" :label-style="labelStyle">
<n-input v-model:value="formValue.warehouseName" placeholder="请输入仓库名称" />
</n-form-item>
<!-- <n-form-item label="仓库名称" path="Item.warehouseName" :label-style="labelStyle">-->
<!-- <n-input v-model:value="formValue.warehouseName" placeholder="请输入仓库名称" />-->
<!-- </n-form-item>-->
<!-- <n-form-item label="入库日期" path="Item.recptDate" :label-style="labelStyle">
<n-date-picker v-model:value="formValue.recptDate" type="date" :format="format" />
</n-form-item> -->
@ -119,12 +119,11 @@ const formData = ref<any>({
const formValue = ref({
pageNum: 1,
pageSize: 10,
warehouseName :'车间',
total: 0,
attr1: '0',
itemName: '',
itemCode: '',
batchCode: '',
warehouseName: '',
vendorCode: '',
vendorName: '',
recptDate: null
@ -245,7 +244,6 @@ const columns: DataTableColumns<ApiMaterialStockManagement.materialStock> = [
itemCode: row.itemCode,
itemName: row.itemName,
specification: row.specification,
attr1: '0'
}).then(res => {
detailLoading.value = false;
detailData.value = res.rows;
@ -383,7 +381,7 @@ function handleSearchClick() {
}
function handleResetClick() {
formValue.value.attr1 = '0';
formValue.value.warehouseName = '车间';
formValue.value.pageNum = 1;
formValue.value.pageSize = 10;
formValue.value.total = 0;

Loading…
Cancel
Save