!2123 分享看图 修复五金表达式没解析,五金列表汇总合并

pull/2113/head
cf-erp 2 years ago committed by ChenX
parent 12c7b6e3af
commit c417555f23

@ -264,6 +264,8 @@ async function LoadData()
let data = JSON.parse(await res.text());
if (data.err_code === RequestStatus.Ok)
{
// userConfig.uese = data.fileInfo.uese;
let file = JSON.parse(inflateBase64(data.fileInfo.file));
document.title = data.fileInfo.name;
return new CADFiler(file);

@ -135,6 +135,8 @@ export function GetBoxItemInfo(entites: Entity[])
let boardList: Board[] = [];
let hardwareCompositeList: ICompHardwareOption[] = [];
let hardwareToplineList: IToplineOption[] = [];
let hardWareGroup: { [key: string]: ICompHardwareOption; } = {};
for (const entity of entites)
{
if (entity instanceof Board)
@ -142,12 +144,27 @@ export function GetBoxItemInfo(entites: Entity[])
boardList.push(entity);
} else if (entity instanceof HardwareCompositeEntity)
{
hardwareCompositeList.push(entity.HardwareOption);
var option = Production.GetHardwareCompositeData(entity).metalsOption;
var key = [option.roomName, option.cabinetName, option.name, option.spec, option.unit].join('_');
if (hardWareGroup[key])
{
hardWareGroup[key].count = (Number(hardWareGroup[key].count) + Number(entity.HardwareOption.count)).toString();
} else
{
hardWareGroup[key] = Object.assign({}, option as ICompHardwareOption);
}
// hardwareCompositeList.push(hardWareOption);
} else if (entity instanceof HardwareTopline)
{
hardwareToplineList.push(entity.HardwareOption);
}
}
for (const key in hardWareGroup)
{
hardwareCompositeList.push(hardWareGroup[key]);
}
return { boardList, hardwareCompositeList, hardwareToplineList };
}

@ -2,7 +2,7 @@ import { Icon } from "@blueprintjs/core";
import { useObserver } from "mobx-react";
import React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
import { Board } from "../../../DatabaseServices/Entity/Board";
import { ICompHardwareOption, IToplineOption } from "../../../UI/Components/RightPanel/RightPanelInterface";
import { ICompHardwareOption, IHardwareOption, IToplineOption } from "../../../UI/Components/RightPanel/RightPanelInterface";
import { shareViewApp } from "../Service";
import { BoxStore } from "../Store";
import { GetBoxItemInfo, MaterialDetailScrollTo, SPGetSpiteSize } from "../Util";
@ -19,7 +19,7 @@ const MaterialBottomSheet: React.FC<IProps> = forwardRef((props, ref) =>
{
const [visible, setVisible] = useState(false);
const [list, setList] = useState<{
boardList: Board[], hardwareCompositeList: ICompHardwareOption[], hardwareToplineList: IToplineOption[],
boardList: Board[], hardwareCompositeList: IHardwareOption[], hardwareToplineList: IToplineOption[],
cabinetName: string;
}[]>([]);
const startDragRef = useRef<boolean>(false);
@ -244,6 +244,7 @@ const MaterialBottomSheet: React.FC<IProps> = forwardRef((props, ref) =>
<tr>
<th style={{ width: 44 }}></th>
<th></th>
<th></th>
<th className="st-td-number" style={{ width: 60 }}></th>
<th style={{ width: 60 }}></th>
</tr>
@ -257,8 +258,9 @@ const MaterialBottomSheet: React.FC<IProps> = forwardRef((props, ref) =>
>
<td>{i + 1}</td>
<td>{item.name}</td>
<td className="st-td-number">{item.count}</td>
<td>{item.spec}</td>
<td className="st-td-number">{item.count}</td>
<td>{item.unit}</td>
</tr>
);
})}

Loading…
Cancel
Save