!2457 新增:五金配件增加商品ID,用于支持匹配商品库

pull/2881/head
林三 3 months ago
parent 3be24ef8cd
commit c7edadbcc6

@ -45,7 +45,6 @@ export class DrawDrillingTool extends Singleton
private m_MoveDistList: number[] = []; private m_MoveDistList: number[] = [];
private m_Face: Face; private m_Face: Face;
private m_Option: DrillingOption; private m_Option: DrillingOption;
private backupOption: DrillingOption; /**备选配置 */
private woodPins: CylinderHole[] = []; private woodPins: CylinderHole[] = [];
private drillEnts: Hole[] = []; private drillEnts: Hole[] = [];
//缓存相同碰撞面的配置 //缓存相同碰撞面的配置
@ -117,12 +116,19 @@ export class DrawDrillingTool extends Singleton
let ljgDepth = this.m_Option.wdepth; let ljgDepth = this.m_Option.wdepth;
//大孔半径 //大孔半径
let bigRad = this.m_Option.wbHoleRad; let bigRad = this.m_Option.wbHoleRad;
let goodsId = this.m_Option.woodGoodsId;
let goodsSn = this.m_Option.woodGoodsSn;
let pxlEnt: CylinderHole; let pxlEnt: CylinderHole;
if (bigRad) if (bigRad)
{ {
pxlEnt = CylinderHole.CreateCylHole(bigRad, pxlDepth, GangDrillType.WoodPXL); pxlEnt = CylinderHole.CreateCylHole(bigRad, pxlDepth, GangDrillType.WoodPXL);
pxlEnt.AllowPxl = this.m_Option.allowPxl; pxlEnt.AllowPxl = this.m_Option.allowPxl;
pxlEnt.ColorIndex = 6; pxlEnt.ColorIndex = 6;
pxlEnt.GoodsId = goodsId;
pxlEnt.GoodsSn = goodsSn;
this.woodPins.push(pxlEnt); this.woodPins.push(pxlEnt);
//将三个实体移动到相应的位置 //将三个实体移动到相应的位置
pxlEnt.ApplyMatrix(new Matrix4().makeRotationX(Math.PI / 2)); pxlEnt.ApplyMatrix(new Matrix4().makeRotationX(Math.PI / 2));
@ -130,6 +136,9 @@ export class DrawDrillingTool extends Singleton
let ljgEnt = CylinderHole.CreateCylHole(ljgRad, ljgLength + ljgDepth, GangDrillType.Wood); let ljgEnt = CylinderHole.CreateCylHole(ljgRad, ljgLength + ljgDepth, GangDrillType.Wood);
ljgEnt.ColorIndex = 6; ljgEnt.ColorIndex = 6;
ljgEnt.GoodsId = goodsId;
ljgEnt.GoodsSn = goodsSn;
this.woodPins.push(ljgEnt); this.woodPins.push(ljgEnt);
//如果都是侧面,不要预埋件,多个偏心轮 //如果都是侧面,不要预埋件,多个偏心轮
@ -211,6 +220,9 @@ export class DrawDrillingTool extends Singleton
let ljgLength = safeEval(this.m_Option.ljgLengthExpr, EvalParam); let ljgLength = safeEval(this.m_Option.ljgLengthExpr, EvalParam);
let ymjDepth = safeEval(this.m_Option.ymjDepthExpr, EvalParam); let ymjDepth = safeEval(this.m_Option.ymjDepthExpr, EvalParam);
let goodsId = this.m_Option.goodsId;
let goodsSn = this.m_Option.goodsSn;
let pxlEnt: CylinderHole; let pxlEnt: CylinderHole;
if (this.m_Option.pxlRad && pxlDepth) if (this.m_Option.pxlRad && pxlDepth)
{ {
@ -218,6 +230,8 @@ export class DrawDrillingTool extends Singleton
pxlEnt.AllowPxl = this.m_Option.allowPxl; pxlEnt.AllowPxl = this.m_Option.allowPxl;
this.drillEnts.push(pxlEnt); this.drillEnts.push(pxlEnt);
pxlEnt.GoodsId = goodsId;
pxlEnt.GoodsSn = goodsSn;
//将三个实体移动到相应的位置 //将三个实体移动到相应的位置
pxlEnt.ApplyMatrix(new Matrix4().makeRotationX(Math.PI / 2)); pxlEnt.ApplyMatrix(new Matrix4().makeRotationX(Math.PI / 2));
} }
@ -226,6 +240,8 @@ export class DrawDrillingTool extends Singleton
if (ljgRad && ljgLength) if (ljgRad && ljgLength)
{ {
ljgEnt = CylinderHole.CreateCylHole(ljgRad, ljgLength, GangDrillType.Ljg); ljgEnt = CylinderHole.CreateCylHole(ljgRad, ljgLength, GangDrillType.Ljg);
ljgEnt.GoodsId = goodsId;
ljgEnt.GoodsSn = goodsSn;
this.drillEnts.push(ljgEnt); this.drillEnts.push(ljgEnt);
} }
@ -236,6 +252,8 @@ export class DrawDrillingTool extends Singleton
{ {
let ymjEnt = CylinderHole.CreateCylHole(this.m_Option.ymjRad, ymjDepth, GangDrillType.Ymj); let ymjEnt = CylinderHole.CreateCylHole(this.m_Option.ymjRad, ymjDepth, GangDrillType.Ymj);
ymjEnt.ApplyMatrix(new Matrix4().setPosition(new Vector3(0, 0, ljgLength))); ymjEnt.ApplyMatrix(new Matrix4().setPosition(new Vector3(0, 0, ljgLength)));
ymjEnt.GoodsId = goodsId;
ymjEnt.GoodsSn = goodsSn;
if (this.m_Face.isEqualType) if (this.m_Face.isEqualType)
{ {
@ -291,6 +309,9 @@ export class DrawDrillingTool extends Singleton
{ {
let key = StoreageKeys.DrillTemp + suitableOption.tempId; let key = StoreageKeys.DrillTemp + suitableOption.tempId;
let ens: ExtrudeHole[] = []; let ens: ExtrudeHole[] = [];
let goodsId = this.m_Option.goodsId;
let goodsSn = this.m_Option.goodsSn;
if (appCache.has(key)) if (appCache.has(key))
{ {
ens = appCache.get(key); ens = appCache.get(key);
@ -326,6 +347,9 @@ export class DrawDrillingTool extends Singleton
if (!isNaN(posHeight)) if (!isNaN(posHeight))
d.ApplyMatrix(MoveMatrix(new Vector3(0, isPostive ? this.m_Face.Width - posHeight : posHeight))); d.ApplyMatrix(MoveMatrix(new Vector3(0, isPostive ? this.m_Face.Width - posHeight : posHeight)));
} }
(d as ExtrudeHole).GoodsId = goodsId;
(d as ExtrudeHole).GoodsSn = goodsSn;
} }
return true; return true;
} }

@ -33,6 +33,7 @@ export class OrderDataObject
GroupData: object; GroupData: object;
Size: { L: number, W: number, H: number; }; Size: { L: number, W: number, H: number; };
RemarkList: [string, string][]; RemarkList: [string, string][];
GoodsID: number; //商品编号
} }
export class ProcessGroupObject export class ProcessGroupObject
{ {

@ -222,6 +222,7 @@ export class ErpParseData
baseposition.YVec = `${yVec.x},${yVec.y},${yVec.z}`; baseposition.YVec = `${yVec.x},${yVec.y},${yVec.z}`;
baseposition.ZVec = `${zVec.x},${zVec.y},${zVec.z}`; baseposition.ZVec = `${zVec.x},${zVec.y},${zVec.z}`;
let boardData = Production.GetBoardSplitOrderData(entity); let boardData = Production.GetBoardSplitOrderData(entity);
if (!boardData) if (!boardData)
return;//返回空数据,提示用户修改,结束拆单 return;//返回空数据,提示用户修改,结束拆单
this.UpdateBoardDrillRemark(boardData); this.UpdateBoardDrillRemark(boardData);
@ -761,6 +762,7 @@ export class ErpParseData
{ {
let parts = new OrderDataObject(); let parts = new OrderDataObject();
parts.Name = t.name || '未命名'; parts.Name = t.name || '未命名';
parts.GoodsID = Number(t.goodsId ?? 0);
parts.RoomName = RoomName; parts.RoomName = RoomName;
parts.BoxName = BoxName; parts.BoxName = BoxName;
parts.Num = t.count; parts.Num = t.count;
@ -788,6 +790,7 @@ export class ErpParseData
price = price || 0; price = price || 0;
let parts = new OrderDataObject(); let parts = new OrderDataObject();
parts.ID = id; parts.ID = id;
parts.GoodsID = Number(option.goodsId ?? 0); //商品ID
parts.Name = option.name || '未命名'; parts.Name = option.name || '未命名';
parts.RoomName = option.roomName || '未命名'; parts.RoomName = option.roomName || '未命名';
parts.BoxName = option.cabinetName || '未命名'; parts.BoxName = option.cabinetName || '未命名';
@ -859,10 +862,8 @@ export class ErpParseData
let holes = holeList.filter(t => t.GroupId.Index == g.key); let holes = holeList.filter(t => t.GroupId.Index == g.key);
let mx = holes.find(t => t.Type == GangDrillType.Wood); let mx = holes.find(t => t.Type == GangDrillType.Wood);
if (mx) if (mx)
{
spec += `D2:${mx.Radius * 2} L:${mx.Height}`; spec += `D2:${mx.Radius * 2} L:${mx.Height}`;
else
} else
{ {
let pxl = holes.find(t => t.Type == GangDrillType.Pxl); let pxl = holes.find(t => t.Type == GangDrillType.Pxl);
if (pxl) if (pxl)
@ -870,14 +871,10 @@ export class ErpParseData
spec += `D1:${pxl.Radius * 2}`; spec += `D1:${pxl.Radius * 2}`;
let ymj = holes.find(t => t.Type == GangDrillType.Ymj); let ymj = holes.find(t => t.Type == GangDrillType.Ymj);
if (ymj) if (ymj)
{
spec += ` D2:${ymj.Radius * 2}`; spec += ` D2:${ymj.Radius * 2}`;
}
let ljg = holes.find(t => t.Type == GangDrillType.Ljg); let ljg = holes.find(t => t.Type == GangDrillType.Ljg);
if (ljg && ymj) if (ljg && ymj)
{
spec += ` L:${ljg.Height + ymj.Height}`; spec += ` L:${ljg.Height + ymj.Height}`;
}
} else } else
{ {
@ -887,9 +884,7 @@ export class ErpParseData
spec += `D2:${ljg.Radius * 2}`; spec += `D2:${ljg.Radius * 2}`;
let ymj = holes.find(t => t.Type == GangDrillType.Ymj); let ymj = holes.find(t => t.Type == GangDrillType.Ymj);
if (ymj) if (ymj)
{
spec += ` L:${ljg.Height + ymj.Height}`; spec += ` L:${ljg.Height + ymj.Height}`;
}
} }
} }
} }
@ -901,13 +896,13 @@ export class ErpParseData
}; };
for (const g of groupList) for (const g of groupList)
{ {
let getCount = lookOverBoardInfosTool.GetCount(g.value.map(t => t.board), options); let info = lookOverBoardInfosTool.GetCount(g.value.map(t => t.board), options);
let splitList = g.keyList; let splitList = g.keyList;
let roomName = splitList[0] || '未命名'; let roomName = splitList[0] || '未命名';
let boxName = splitList[1] || '未命名'; let boxName = splitList[1] || '未命名';
objectList.push(...this.GetSealObjects(getCount.sealCount, roomName, boxName, sealMap)); objectList.push(...this.GetSealObjects(info.sealCount, roomName, boxName, sealMap));
sealMap.clear(); sealMap.clear();
objectList.push(...this.GetDrillObjects(getCount.drillCount, roomName, boxName, getSpec)); objectList.push(...this.GetDrillObjects(info.drillCount, roomName, boxName, getSpec));
holeMap.clear(); holeMap.clear();
} }
return objectList; return objectList;

@ -7,6 +7,7 @@ export function parseParts(entity: Entity, spliteData: ISpliteHardwareData, list
let info = spliteData.metalsOption as ICompHardwareOption; let info = spliteData.metalsOption as ICompHardwareOption;
let parts = new OrderDataObject(); let parts = new OrderDataObject();
parts.ID = list.length + 1; parts.ID = list.length + 1;
parts.GoodsID = Number(info.goodsId ?? 0); //商品ID
parts.RoomName = info.roomName || '未命名'; parts.RoomName = info.roomName || '未命名';
parts.BoxName = info.cabinetName || '未命名'; parts.BoxName = info.cabinetName || '未命名';
parts.Brand = info.brand || ''; parts.Brand = info.brand || '';

@ -28,6 +28,8 @@ export interface ICountType<T = IHardwareType>
count2?: number | string; count2?: number | string;
unit?: string; unit?: string;
length?: number; length?: number;
goodsId?: string;
goodsSn?: string;
} }
export type GetCountOption = { sealGruopKey: (key: string, block: Board, size: number) => void; getHoles?: (name: string, hole: CylinderHole) => void; }; export type GetCountOption = { sealGruopKey: (key: string, block: Board, size: number) => void; getHoles?: (name: string, hole: CylinderHole) => void; };
class LookOverBoardInfosTool class LookOverBoardInfosTool
@ -51,11 +53,31 @@ class LookOverBoardInfosTool
{ {
if (v[0] instanceof Hole) if (v[0] instanceof Hole)
if (k === "木销") if (k === "木销")
drillCount.push({ name: k, count: v.length }); {
for (let drill of v)
{
let goodsSn = (drill as CylinderHole).GoodsSn;
let drillGroup = drillCount.find(d => d.name === k && d.goodsSn === goodsSn); //区分排钻商品ID
if (drillGroup)
drillGroup.count += 1;
else
drillCount.push({ name: k, count: 1, goodsSn, goodsId: (drill as CylinderHole).GoodsId });
}
}
else if (k === "层板钉") else if (k === "层板钉")
drillCount.push({ name: k, count: v.length }); drillCount.push({ name: k, count: v.length });
else else
drillCount.push({ name: k, count: v.length }); {
for (let drill of v)
{
let goodsSn = (drill as CylinderHole).GoodsSn;
let drillGroup = drillCount.find(d => d.name === k && d.goodsSn === goodsSn); //区分排钻商品ID
if (drillGroup)
drillGroup.count += 1;
else
drillCount.push({ name: k, count: 1, goodsSn, goodsId: (drill as CylinderHole).GoodsId });
}
}
else else
{ {
this.ParseHardwareCount(k, v as IHardwareType[], hardwareCount); this.ParseHardwareCount(k, v as IHardwareType[], hardwareCount);
@ -107,10 +129,10 @@ class LookOverBoardInfosTool
} }
for (let h of hardwares) for (let h of hardwares)
{ {
let { name, unit, factory, spec, model, brand } = h.HardwareOption; let { name, unit, factory, spec, model, brand, goodsSn } = h.HardwareOption;
let tags = this.ParseProcessingGroupTags(h); let tags = this.ParseProcessingGroupTags(h);
// :230行 代码对关联复合实体又进行一遍分析 需同步修改 // :230行 代码对关联复合实体又进行一遍分析 需同步修改
addDrillToMap(`${name},${unit},${this.ParseSpec(h, factory)},${this.ParseSpec(h, spec)},${this.ParseSpec(h, model)},${this.ParseSpec(h, brand)},${tags.join(",")}`, h); addDrillToMap(`${name},${unit},${this.ParseSpec(h, factory)},${this.ParseSpec(h, spec)},${this.ParseSpec(h, model)},${this.ParseSpec(h, brand)},${goodsSn},${tags.join(",")}`, h);
} }
this.UpdateBoardMap(brsProps); this.UpdateBoardMap(brsProps);
@ -226,10 +248,10 @@ class LookOverBoardInfosTool
let metal = mId?.Object as IHardwareType; let metal = mId?.Object as IHardwareType;
if (metal && !metal.IsErase && metal.HardwareOption) if (metal && !metal.IsErase && metal.HardwareOption)
{ {
let { name, unit, factory, spec, model, brand } = metal.HardwareOption; let { name, unit, factory, spec, model, brand, goodsSn } = metal.HardwareOption;
let tags = this.ParseProcessingGroupTags(metal); let tags = this.ParseProcessingGroupTags(metal);
// :113行 代码对关联复合实体又进行一遍分析 需同步修改 // :113行 代码对关联复合实体又进行一遍分析 需同步修改
addDrillToMap(`${name},${unit},${this.ParseSpec(metal, factory)},${this.ParseSpec(metal, spec)},${this.ParseSpec(metal, model)},${this.ParseSpec(metal, brand)},${tags.join(",")}`, metal); addDrillToMap(`${name},${unit},${this.ParseSpec(metal, factory)},${this.ParseSpec(metal, spec)},${this.ParseSpec(metal, model)},${this.ParseSpec(metal, brand)},${tags.join(",")},${goodsSn}`, metal);
} }
} }

@ -330,6 +330,10 @@ export namespace CheckoutValid
case "tempId": case "tempId":
case "tempDirId": case "tempDirId":
case "tempName": case "tempName":
case "goodsId":
case "goodsSn":
case "woodGoodsId":
case "woodGoodsSn":
return ""; return "";
case "pxlOffset": case "pxlOffset":
case "collsionDist": case "collsionDist":

@ -36,6 +36,9 @@ export class CylinderHole extends Hole
private _Radius: number = 1; private _Radius: number = 1;
//同侧面 常规单头连杆、偏心轮、预埋件三合一排钻(原先是)是双头三合一 //同侧面 常规单头连杆、偏心轮、预埋件三合一排钻(原先是)是双头三合一
private _SameSideHole: boolean = false; private _SameSideHole: boolean = false;
private _GoodsId: string = "";
private _GoodsSn: string = "";
constructor() constructor()
{ {
super(); super();
@ -50,7 +53,6 @@ export class CylinderHole extends Hole
return drill; return drill;
} }
set Radius(r: number) set Radius(r: number)
{ {
if (r !== this._Radius) if (r !== this._Radius)
@ -99,6 +101,32 @@ export class CylinderHole extends Hole
return this.BoundingBoxInOCS.applyMatrix4(this._Matrix); return this.BoundingBoxInOCS.applyMatrix4(this._Matrix);
} }
get GoodsId(): string
{
return this._GoodsId;
}
set GoodsId(value: string)
{
if (this._GoodsId !== value)
{
this.WriteAllObjectRecord();
this._GoodsId = value;
}
}
get GoodsSn(): string
{
return this._GoodsSn;
}
set GoodsSn(value: string)
{
if (this._GoodsSn !== value)
{
this.WriteAllObjectRecord();
this._GoodsSn = value;
}
}
/** /**
* Box * Box
*/ */
@ -235,20 +263,26 @@ export class CylinderHole extends Hole
this.type = file.Read(); this.type = file.Read();
} }
if (ver < 6) if (ver > 5)
this.SameSideHole = false;
else
this.SameSideHole = file.Read(); this.SameSideHole = file.Read();
if (ver > 6)
{
this.GoodsId = file.Read();
this.GoodsSn = file.Read();
}
} }
WriteFile(file: CADFiler) WriteFile(file: CADFiler)
{ {
super.WriteFile(file); super.WriteFile(file);
file.Write(6);//ver file.Write(7);//ver
file.Write(this._Radius); file.Write(this._Radius);
file.Write(this.type); file.Write(this.type);
file.Write(this.SameSideHole); file.Write(this.SameSideHole);
file.Write(this.GoodsId);
file.Write(this.GoodsSn);
} }
} }

@ -33,6 +33,8 @@ export class ExtrudeHole extends Hole
private _contourCurve: ExtrudeContourCurve = new Polyline(); private _contourCurve: ExtrudeContourCurve = new Polyline();
private _EdgeGeometry: BufferGeometry; private _EdgeGeometry: BufferGeometry;
protected _knifeRadius: number = 3; protected _knifeRadius: number = 3;
private _GoodsId: string = "";
private _GoodsSn: string = "";
@AutoRecord isHole = true; @AutoRecord isHole = true;
@AutoRecord isThrough = false; @AutoRecord isThrough = false;
@ -48,6 +50,33 @@ export class ExtrudeHole extends Hole
this._knifeRadius = v; this._knifeRadius = v;
} }
} }
get GoodsId(): string
{
return this._GoodsId;
}
set GoodsId(value: string)
{
if (this._GoodsId !== value)
{
this.WriteAllObjectRecord();
this._GoodsId = value;
}
}
get GoodsSn(): string
{
return this._GoodsSn;
}
set GoodsSn(value: string)
{
if (this._GoodsSn !== value)
{
this.WriteAllObjectRecord();
this._GoodsSn = value;
}
}
Explode() Explode()
{ {
return [this.ContourCurve.Clone().ApplyMatrix(this.OCS)]; return [this.ContourCurve.Clone().ApplyMatrix(this.OCS)];
@ -498,20 +527,30 @@ export class ExtrudeHole extends Hole
file.ReadSoftObjectId(); file.ReadSoftObjectId();
} }
if (ver > 5)
{
this._GoodsId = file.Read();
this._GoodsSn = file.Read();
}
this.Update(); this.Update();
} }
//对象将自身数据写入到文件. //对象将自身数据写入到文件.
WriteFile(file: CADFiler) WriteFile(file: CADFiler)
{ {
super.WriteFile(file); super.WriteFile(file);
file.Write(5); file.Write(6);
file.WriteObject(this._contourCurve); file.WriteObject(this._contourCurve);
file.Write(this._knifeRadius); file.Write(this._knifeRadius);
file.Write(this.isHole); file.Write(this.isHole);
file.Write(this.isThrough); file.Write(this.isThrough);
file.Write(this.type); file.Write(this.type);
//ver= 5 弃用 //ver = 5 弃用
file.Write(0); file.Write(0);
//ver = 6
file.Write(this._GoodsId);
file.Write(this._GoodsSn);
} }
} }

@ -122,13 +122,19 @@ export class HardwareCompositeEntity extends CompositeEntity
this.RelevanceHandle.push(objId); this.RelevanceHandle.push(objId);
} }
} }
if (v > 5)
{
this.HardwareOption.goodsId = file.Read();
this.HardwareOption.goodsSn = file.Read();
}
} }
//对象将自身数据写入到文件. //对象将自身数据写入到文件.
WriteFile(file: CADFiler) WriteFile(file: CADFiler)
{ {
super.WriteFile(file); super.WriteFile(file);
file.Write(5); file.Write(6);
file.Write(this.HardwareOption.type); file.Write(this.HardwareOption.type);
file.Write(this.HardwareOption.isSplite); file.Write(this.HardwareOption.isSplite);
@ -167,5 +173,8 @@ export class HardwareCompositeEntity extends CompositeEntity
file.Write(this.RelevanceHandle.length); file.Write(this.RelevanceHandle.length);
for (let id of this.RelevanceHandle) for (let id of this.RelevanceHandle)
file.WriteSoftObjectId(id); file.WriteSoftObjectId(id);
file.Write(this.HardwareOption.goodsId);
file.Write(this.HardwareOption.goodsSn);
} }
} }

@ -173,11 +173,17 @@ export class HardwareTopline extends SweepSolid
d[1] = file.Read(); d[1] = file.Read();
this.DataList.push(d); this.DataList.push(d);
} }
if (ver > 1)
{
this.HardwareOption.goodsId = file.Read();
this.HardwareOption.goodsSn = file.Read();
}
} }
WriteFile(file: CADFiler) WriteFile(file: CADFiler)
{ {
super.WriteFile(file); super.WriteFile(file);
file.Write(1);//ver file.Write(2);//ver
file.Write(this._contourRotation); file.Write(this._contourRotation);
@ -199,5 +205,8 @@ export class HardwareTopline extends SweepSolid
file.Write(data[0]); file.Write(data[0]);
file.Write(data[1]); file.Write(data[1]);
} }
file.Write(this.HardwareOption.goodsId);
file.Write(this.HardwareOption.goodsSn);
} }
} }

@ -703,7 +703,7 @@ export const DefaultExtruderMetalsOption: IExtMetalsOption = {
}; };
Object.freeze(DefaultExtruderMetalsOption); Object.freeze(DefaultExtruderMetalsOption);
export const DefaultCompositeMetalsOption: ICompHardwareOption = { export const DefaultCompositeMetalsOption: ICompHardwareOption = {
version: 2, version: 3,
type: EMetalsType.Metals, type: EMetalsType.Metals,
isSplite: false, isSplite: false,
isSplitePrice: false, isSplitePrice: false,
@ -722,6 +722,8 @@ export const DefaultCompositeMetalsOption: ICompHardwareOption = {
material: "", material: "",
comments: "", comments: "",
isHole: true, isHole: true,
goodsId: "",
goodsSn: ""
}; };
Object.freeze(DefaultCompositeMetalsOption); Object.freeze(DefaultCompositeMetalsOption);
export const DefaultToplineMetalsOption: IToplineOption = { export const DefaultToplineMetalsOption: IToplineOption = {
@ -739,6 +741,8 @@ export const DefaultToplineMetalsOption: IToplineOption = {
comments: "", comments: "",
addLen: "0", addLen: "0",
isHole: false, isHole: false,
goodsId: "",
goodsSn: ""
}; };
Object.freeze(DefaultToplineMetalsOption); Object.freeze(DefaultToplineMetalsOption);

@ -62,6 +62,7 @@ export interface IDrillingOption
endPt?: Vector3; endPt?: Vector3;
angle?: number; angle?: number;
name: string; name: string;
goodsId?: string;
} }
export interface IBoardHoleInfo export interface IBoardHoleInfo
@ -980,7 +981,8 @@ export namespace Production
depth,//排钻的插入深度 depth,//排钻的插入深度
face,//板在哪个边上 face,//板在哪个边上
angle, angle,
name: GetGroupName(cyHole) name: GetGroupName(cyHole),
goodsId: cyHole.GoodsId, //商品编号
}); });
} }
} }

@ -314,6 +314,7 @@ export class PartsTable extends React.Component<IPartsTableProps, {}>
<td>{data.name === "" ? `[ 空 ]` : data.name}</td> <td>{data.name === "" ? `[ 空 ]` : data.name}</td>
<td>{data.unit === "米" ? FixedNotZero(data.count, 2) : data.count}</td> <td>{data.unit === "米" ? FixedNotZero(data.count, 2) : data.count}</td>
<td>{data.unit ?? ``}</td> <td>{data.unit ?? ``}</td>
<td>{data.goodsSn || ``}</td>
</tr> </tr>
); );
}); });
@ -334,6 +335,7 @@ export class PartsTable extends React.Component<IPartsTableProps, {}>
<td>{entity.HardwareOption.factory ? lookOverBoardInfosTool.ParseSpec(entity, entity.HardwareOption.factory, data.length) : "无"}</td> <td>{entity.HardwareOption.factory ? lookOverBoardInfosTool.ParseSpec(entity, entity.HardwareOption.factory, data.length) : "无"}</td>
<td>{entity.HardwareOption.brand ? lookOverBoardInfosTool.ParseSpec(entity, entity.HardwareOption.brand, data.length) : "无"}</td> <td>{entity.HardwareOption.brand ? lookOverBoardInfosTool.ParseSpec(entity, entity.HardwareOption.brand, data.length) : "无"}</td>
<td>{tags.length ? tags.join(',') : "无"}</td> <td>{tags.length ? tags.join(',') : "无"}</td>
<td>{entity.HardwareOption.goodsSn ? lookOverBoardInfosTool.ParseSpec(entity, entity.HardwareOption.goodsSn, data.length) : "无"}</td>
</tr>; </tr>;
}); });
case PartsType.Area: case PartsType.Area:

@ -78,7 +78,7 @@ interface LookOverBoardInfosModalState
} }
export const ListItemSelectEventEmitter = new ListItemSelectEvent; export const ListItemSelectEventEmitter = new ListItemSelectEvent;
const HardwareTitles = ["配件名称", "个数", "数量", "单位", "型号", "规格", "材质", "颜色", "厂家", "品牌", "加工组"]; const HardwareTitles = ["配件名称", "个数", "数量", "单位", "型号", "规格", "材质", "颜色", "厂家", "品牌", "加工组", "商品编号"];
const AreaTitle = ["板厚", "材料", "颜色", "板材", "个数", "面积"]; const AreaTitle = ["板厚", "材料", "颜色", "板材", "个数", "面积"];
@ -916,11 +916,12 @@ export class LookOverBoardInfosModal extends React.Component<LookOverBoardInfosM
str += data.arr.join(",") + "\n"; str += data.arr.join(",") + "\n";
} }
//配件信息 //配件信息
str += "\n配件类型,数量,单位\n"; str += "\n配件类型,数量,单位,商品编号\n";
for (let d of this.drillCount) for (let d of this.drillCount)
{ {
let unit = d.name.includes("封边条") ? "米" : "个"; let unit = d.name.includes("封边条") ? "米" : "个";
str += `\t${d.name},${FixedNotZero(d.count, 2)},${unit}\n`; let goodsSn = d.goodsSn || "无";
str += `\t${d.name},${FixedNotZero(d.count, 2)},${unit},${goodsSn}\n`;
} }
//封边信息 //封边信息
str += "\n配件类型,宽度,颜色,数量,单位\n"; str += "\n配件类型,宽度,颜色,数量,单位\n";
@ -941,7 +942,9 @@ export class LookOverBoardInfosModal extends React.Component<LookOverBoardInfosM
let factory = option.factory ? lookOverBoardInfosTool.ParseSpec(d.entity, option.factory, d.length) : "无"; let factory = option.factory ? lookOverBoardInfosTool.ParseSpec(d.entity, option.factory, d.length) : "无";
let brand = option.brand ? lookOverBoardInfosTool.ParseSpec(d.entity, option.brand, d.length) : "无"; let brand = option.brand ? lookOverBoardInfosTool.ParseSpec(d.entity, option.brand, d.length) : "无";
let tags = lookOverBoardInfosTool.ParseProcessingGroupTags(d.entity); let tags = lookOverBoardInfosTool.ParseProcessingGroupTags(d.entity);
str += `\t${d.name},${d.count},${d.count2 ?? "无"},${unit},${model},${spec},${option[EBoardKeyList.Mat] ?? "无"},${option[EBoardKeyList.Color] ?? "无"},${factory},${brand},"${tags.length ? tags.join(",") : "无"}"\n`; //商品编号
let goodsSn = option.goodsSn ? lookOverBoardInfosTool.ParseSpec(d.entity, option.goodsSn, d.length) : "无";
str += `\t${d.name},${d.count},${d.count2 ?? "无"},${unit},${model},${spec},${option[EBoardKeyList.Mat] ?? "无"},${option[EBoardKeyList.Color] ?? "无"},${factory},${brand},"${tags.length ? tags.join(",") : "无"}",${goodsSn}\n`;
} }
str += `\n${AreaTitle.join(",")}\n`; str += `\n${AreaTitle.join(",")}\n`;
@ -1027,7 +1030,7 @@ export class LookOverBoardInfosModal extends React.Component<LookOverBoardInfosM
<Divider style={{ position: "absolute", top: -5, height: 1, width: width * 0.99 }} /> <Divider style={{ position: "absolute", top: -5, height: 1, width: width * 0.99 }} />
<div style={{ height: this.dragDivH - 1, width: width, overflow: "auto", paddingLeft: 10, paddingTop: 4, marginTop: 1 }} > <div style={{ height: this.dragDivH - 1, width: width, overflow: "auto", paddingLeft: 10, paddingTop: 4, marginTop: 1 }} >
{/* 配件信息 */} {/* 配件信息 */}
<PartsTable partsCount={this.drillCount} titles={["配件拆单名", "数量", "单位"]} type={PartsType.Hole} isSort={true} /> <PartsTable partsCount={this.drillCount} titles={["配件拆单名", "数量", "单位", "商品编号"]} type={PartsType.Hole} isSort={true} />
<PartsTable partsCount={this.sealCount} titles={["配件拆单名", "宽度", "颜色", "数量", "单位"]} type={PartsType.Edge} isSort={true} /> <PartsTable partsCount={this.sealCount} titles={["配件拆单名", "宽度", "颜色", "数量", "单位"]} type={PartsType.Edge} isSort={true} />
<PartsTable partsCount={this.hardwareCount} titles={HardwareTitles} type={PartsType.Hardware} isSort={true} /> <PartsTable partsCount={this.hardwareCount} titles={HardwareTitles} type={PartsType.Hardware} isSort={true} />
<PartsTable partsCount={this.areaCount} titles={AreaTitle} type={PartsType.Area} /> <PartsTable partsCount={this.areaCount} titles={AreaTitle} type={PartsType.Area} />

@ -34,6 +34,7 @@ export interface ISetItemOption
/**不传将默认属性允许为字符串类型 */ /**不传将默认属性允许为字符串类型 */
uiOption?: IUiOption<AnyObject>; uiOption?: IUiOption<AnyObject>;
isDisabled?: boolean; isDisabled?: boolean;
isReadOnly?: boolean;
placeHolder?: string; placeHolder?: string;
onChange?: (e, ...arg) => void; onChange?: (e, ...arg) => void;
inline?: boolean; inline?: boolean;
@ -58,6 +59,7 @@ interface ISetBlockOption
isInline?: boolean; isInline?: boolean;
onChange?: (e, ...arg) => void; onChange?: (e, ...arg) => void;
disabled?: boolean; disabled?: boolean;
readonly?: boolean;
children?: React.ReactNode; children?: React.ReactNode;
} }
interface TBProps interface TBProps
@ -112,6 +114,7 @@ export const SetBoardDataBlock = observer(
optKey={k} optKey={k}
title={v} title={v}
isDisabled={props.disabled} isDisabled={props.disabled}
isReadOnly={props.readonly}
{...props} {...props}
className="" className=""
/> />

@ -1,4 +1,5 @@
import { Button, Checkbox, Classes, Radio, RadioGroup } from '@blueprintjs/core'; import { Button, Checkbox, Classes, Intent, Radio, RadioGroup } from '@blueprintjs/core';
import { observable } from 'mobx';
import { inject, observer } from 'mobx-react'; import { inject, observer } from 'mobx-react';
import * as React from 'react'; import * as React from 'react';
import * as xaop from 'xaop'; import * as xaop from 'xaop';
@ -8,6 +9,8 @@ import { CommandNames } from '../../../Common/CommandNames';
import { KeyBoard } from '../../../Common/KeyEnum'; import { KeyBoard } from '../../../Common/KeyEnum';
import { safeEval } from '../../../Common/eval'; import { safeEval } from '../../../Common/eval';
import { commandMachine } from '../../../Editor/CommandMachine'; import { commandMachine } from '../../../Editor/CommandMachine';
import { GoodsType, IGoodInfo } from '../../MaterialEditor/GoodsList';
import { GoodsListDiv } from '../../MaterialEditor/GoodsListDiv';
import { DrillStore } from '../../Store/DrillStore'; import { DrillStore } from '../../Store/DrillStore';
import { userConfigStore } from '../../Store/UserConfigStore'; import { userConfigStore } from '../../Store/UserConfigStore';
import { SpacingType } from '../../Store/drillInterface'; import { SpacingType } from '../../Store/drillInterface';
@ -24,6 +27,9 @@ import { Config_ModalType } from './UserConfigComponent';
@inject('store') @inject('store')
@observer @observer
export class DrillModal extends React.Component<{ store?: DrillStore; }, {}> { export class DrillModal extends React.Component<{ store?: DrillStore; }, {}> {
private _ShowShops = observable.box(false);
private _ShopsKey = observable.box("");
private posPars = [["originDist", "起始距离"], ["retDist", "剩余距离"]]; private posPars = [["originDist", "起始距离"], ["retDist", "剩余距离"]];
private posPars2 = [ private posPars2 = [
["pxlOffset", "偏心轮下偏距离"], ["collsionDist", "排钻碰撞偏移距离"], ["pxlOffset", "偏心轮下偏距离"], ["collsionDist", "排钻碰撞偏移距离"],
@ -166,10 +172,46 @@ export class DrillModal extends React.Component<{ store?: DrillStore; }, {}> {
</div> </div>
<div className="flex"> <div className="flex">
<div className={Classes.CARD}> <div className={Classes.CARD}>
<h5 className={Classes.HEADING}></h5>
<div style={{ display: "flex" }}>
<div className='goodsId'>
<SetBoardDataItem
isReadOnly={true}
type={CheckObjectType.DR}
optKey="goodsSn"
option={store.m_Option}
uiOption={store.UIOption}
title="商品编码"
/>
</div>
<Button
text="选择"
intent={Intent.NONE}
style={{ minHeight: 19, height: 19, marginLeft: 5, fontSize: 12 }}
onClick={() =>
{
this._ShopsKey.set("drill");
this._ShowShops.set(true);
}}
/>
<Button
text="清空"
intent={Intent.NONE}
style={{ minHeight: 19, height: 19, marginLeft: 2, fontSize: 12 }}
onClick={() =>
{
store.m_Option.goodsSn = "";
store.m_Option.goodsId = "";
//@ts-ignore
store.UIOption.goodsSn = "";
}}
/>
</div>
<h5 className={Classes.HEADING}></h5> <h5 className={Classes.HEADING}></h5>
<div> <div>
<div className="flexWrap"> <div className="flexWrap">
<ItemName title="拆单名" opt={store.m_Option} className="small-name" /> <ItemName title="拆单名:" opt={store.m_Option} className="small-name" />
<SetBoardDataItem <SetBoardDataItem
type={CheckObjectType.DR} type={CheckObjectType.DR}
optKey="count" optKey="count"
@ -358,6 +400,41 @@ export class DrillModal extends React.Component<{ store?: DrillStore; }, {}> {
store.m_Option.isDrawWood = !store.m_Option.isDrawWood; store.m_Option.isDrawWood = !store.m_Option.isDrawWood;
}} }}
/> />
<div style={{ display: "flex" }}>
<div className='goodsId'>
<SetBoardDataItem
isReadOnly={true}
type={CheckObjectType.DR}
optKey="woodGoodsSn"
option={store.m_Option}
uiOption={store.UIOption}
title="商品编码"
/>
</div>
<Button
text="选择"
intent={Intent.NONE}
style={{ minHeight: 19, height: 19, marginLeft: 5, fontSize: 12 }}
onClick={() =>
{
this._ShopsKey.set("wood");
this._ShowShops.set(true);
}}
/>
<Button
text="清空"
intent={Intent.NONE}
style={{ minHeight: 19, height: 19, marginLeft: 2, fontSize: 12 }}
onClick={() =>
{
store.m_Option.woodGoodsSn = "";
store.m_Option.woodGoodsId = "";
//@ts-ignore
store.UIOption.woodGoodsSn = "";
}}
/>
</div>
<div className="flexWrap"> <div className="flexWrap">
{ {
this.holePars.map(([k, v]) => this.holePars.map(([k, v]) =>
@ -426,6 +503,32 @@ export class DrillModal extends React.Component<{ store?: DrillStore; }, {}> {
<div className={Classes.CARD + " small-input flex flex-col"}> <div className={Classes.CARD + " small-input flex flex-col"}>
<DrillRulesComponent store={store} /> <DrillRulesComponent store={store} />
</div> </div>
{
this._ShowShops.get() && <GoodsListDiv
open={this._ShowShops}
goods_type={GoodsType.metals}
select={(info: IGoodInfo) =>
{
if (this._ShopsKey.get() === "wood")
{
store.m_Option.woodGoodsId = info.goods_id;
store.m_Option.woodGoodsSn = info.goods_sn;
//@ts-ignore
store.UIOption.woodGoodsSn = info.goods_sn;
}
else
{
store.m_Option.goodsId = info.goods_id;
store.m_Option.goodsSn = info.goods_sn;
//@ts-ignore
store.UIOption.goodsSn = info.goods_sn;
}
this._ShopsKey.set("");
this._ShowShops.set(false);
}}
/>
}
</div> </div>
</CommonModal> </CommonModal>
); );

@ -3,7 +3,7 @@
} }
#drillModal .small-name { #drillModal .small-name {
width : 4.55rem; width : 5rem;
margin : 0; margin : 0;
padding : 0; padding : 0;
padding-left: 5px; padding-left: 5px;
@ -179,3 +179,9 @@
background-color: #1a83ad; background-color: #1a83ad;
} }
} }
#drillModal .goodsId {
input{
width: 10rem;
}
}

@ -1,4 +1,4 @@
import { Alert, Button, Classes, Label, Tag } from '@blueprintjs/core'; import { Alert, Button, Classes, Intent, Label, Tag } from '@blueprintjs/core';
import { observable } from 'mobx'; import { observable } from 'mobx';
import { observer } from 'mobx-react'; import { observer } from 'mobx-react';
import * as React from 'react'; import * as React from 'react';
@ -6,7 +6,6 @@ import { Vector3 } from 'three';
import { app } from '../../../ApplicationServices/Application'; import { app } from '../../../ApplicationServices/Application';
import { arrayRemove } from '../../../Common/ArrayExt'; import { arrayRemove } from '../../../Common/ArrayExt';
import { EBoardKeyList } from '../../../Common/BoardKeyList'; import { EBoardKeyList } from '../../../Common/BoardKeyList';
import { CheckObjectType } from '../../../Common/CheckoutVaildValue';
import { CommandNames } from '../../../Common/CommandNames'; import { CommandNames } from '../../../Common/CommandNames';
import { FixedNotZero } from '../../../Common/Utils'; import { FixedNotZero } from '../../../Common/Utils';
import { Board } from '../../../DatabaseServices/Entity/Board'; import { Board } from '../../../DatabaseServices/Entity/Board';
@ -15,12 +14,15 @@ import { HardwareTopline } from '../../../DatabaseServices/Hardware/HardwareTopl
import { ProcessingGroupRecord } from '../../../DatabaseServices/ProcessingGroup/ProcessingGroupRecord'; import { ProcessingGroupRecord } from '../../../DatabaseServices/ProcessingGroup/ProcessingGroupRecord';
import { CommandWrap } from '../../../Editor/CommandMachine'; import { CommandWrap } from '../../../Editor/CommandMachine';
import { PromptStatus } from '../../../Editor/PromptResult'; import { PromptStatus } from '../../../Editor/PromptResult';
import { GoodsType, IGoodInfo } from '../../MaterialEditor/GoodsList';
import { GoodsListDiv } from '../../MaterialEditor/GoodsListDiv';
import { BaseHardwareStore } from '../../Store/RightPanelStore/HardwareStore'; import { BaseHardwareStore } from '../../Store/RightPanelStore/HardwareStore';
import { ToasterInput } from '../Toaster'; import { EMetalsType } from './RightPanelInterface';
export interface ICommonMetalPanelProps export interface ICommonMetalPanelProps
{ {
store: BaseHardwareStore; store: BaseHardwareStore;
compositeType?: EMetalsType;
isTopline?: boolean; isTopline?: boolean;
entity?: Entity;//五金类实体(包括顶线) entity?: Entity;//五金类实体(包括顶线)
} }
@ -33,6 +35,7 @@ export class CommonMetalPanel extends React.Component<ICommonMetalPanelProps>
private showAlert = observable.box(false); private showAlert = observable.box(false);
@observable private tags: string[] = []; @observable private tags: string[] = [];
private _ShowShops = observable.box(false);
private updateTags = () => private updateTags = () =>
{ {
@ -99,6 +102,11 @@ export class CommonMetalPanel extends React.Component<ICommonMetalPanelProps>
app.Editor.ModalManage.ToggleShow(); app.Editor.ModalManage.ToggleShow();
}; };
private handleOpenShopList = () =>
{
this._ShowShops.set(true);
};
componentDidMount(): void componentDidMount(): void
{ {
this.updateTags(); this.updateTags();
@ -156,7 +164,7 @@ export class CommonMetalPanel extends React.Component<ICommonMetalPanelProps>
return ( return (
<> <>
<label className="bp3-label bp3-inline .modifier" style={{ display: "flex" }}> <label className="bp3-label bp3-inline .modifier" style={{ display: "flex" }}>
<span style={{ width: 47 }}>:</span> <span style={{ width: 53 }}>:</span>
<div style={{ display: "inline-flex", flex: 1, minWidth: 120 }}> <div style={{ display: "inline-flex", flex: 1, minWidth: 120 }}>
<input className="bp3-input" title="双击查看详细内容" value={this.tags.length > 0 ? this.tags.join(", ") : ""} readOnly style={{ minWidth: 100, flex: 1 }} onDoubleClick={this.onProcessInputDbClick} /> <input className="bp3-input" title="双击查看详细内容" value={this.tags.length > 0 ? this.tags.join(", ") : ""} readOnly style={{ minWidth: 100, flex: 1 }} onDoubleClick={this.onProcessInputDbClick} />
<Button <Button
@ -166,7 +174,8 @@ export class CommonMetalPanel extends React.Component<ICommonMetalPanelProps>
minHeight: 18, minHeight: 18,
height: 18, height: 18,
padding: 0, padding: 0,
fontSize: 12 fontSize: 12,
marginLeft: 6
}} }}
onClick={() => this.onProcessInputDbClick()} onClick={() => this.onProcessInputDbClick()}
/> />
@ -289,7 +298,7 @@ export class CommonMetalPanel extends React.Component<ICommonMetalPanelProps>
{ {
metalTypeFields.map(([t, k]) => ( metalTypeFields.map(([t, k]) => (
<Label className={`metal-label ${Classes.INLINE}`} key={k}> <Label className={`metal-label ${Classes.INLINE}`} key={k}>
<span >{t}</span> <span>{t}</span>
<input <input
tabIndex={1} tabIndex={1}
type="text" type="text"
@ -301,6 +310,40 @@ export class CommonMetalPanel extends React.Component<ICommonMetalPanelProps>
)) ))
} }
</div> </div>
<div className='room-cabinet-name' style={{ display: "flex", justifyContent: "left" }}>
<Label className={Classes.INLINE + " metal-label"} key={"goods_type"}>
<span>:</span>
<input tabIndex={1} className={Classes.INPUT} value={option.goodsSn} readOnly={true} />
{
this._ShowShops.get() && <GoodsListDiv
open={this._ShowShops}
goods_type={this.props.compositeType === EMetalsType.Metals ? GoodsType.metals : GoodsType.comp}
select={(good: IGoodInfo) =>
{
option.goodsId = good.goods_id;
option.goodsSn = good.goods_sn;
this._ShowShops.set(false);
}}
/>
}
</Label>
<Button
text="选择"
intent={Intent.NONE}
style={{ minHeight: 20, height: 20, marginLeft: 5, minWidth: 31, width: 31, padding: 0, fontSize: 12 }}
onClick={this.handleOpenShopList}
/>
<Button
text="清空"
intent={Intent.NONE}
style={{ minHeight: 20, height: 20, marginLeft: 5, minWidth: 31, width: 31, padding: 0, fontSize: 12 }}
onClick={() =>
{
option.goodsId = "";
option.goodsSn = "";
}}
/>
</div>
{ {
isTopline && ( isTopline && (
<div className="metal-param"> <div className="metal-param">
@ -331,10 +374,21 @@ export class CommonMetalPanel extends React.Component<ICommonMetalPanelProps>
} }
{this.ProcessingGroupAndPrice()} {this.ProcessingGroupAndPrice()}
{this.MetalParam()} {this.MetalParam()}
{!isTopline && <Label className={`metal-label_count ${Classes.INLINE}`}> {
<span>:</span> !isTopline &&
<ToasterInput type={CheckObjectType.None} option={option} optKey="count" /> <div className="metal-param">
</Label>} < Label className={`metal-label ${Classes.INLINE}`}>
<span>:</span>
<input
tabIndex={1}
type="text"
className={Classes.INPUT}
value={option["count"]}
onChange={(e) => (option["count"] = e.target.value)}
/>
</Label>
</div>
}
{!isTopline && !isRightMetalPanel && ( {!isTopline && !isRightMetalPanel && (
<div className="metal-param"> <div className="metal-param">
{ {

@ -54,7 +54,7 @@ export class CompositeMatalPanel extends React.Component<ICompositeMatalPanelPan
<Checkbox label="拆解价格" inline checked={option.isSplitePrice} onChange={() => option.isSplitePrice = !option.isSplitePrice} /> <Checkbox label="拆解价格" inline checked={option.isSplitePrice} onChange={() => option.isSplitePrice = !option.isSplitePrice} />
<Checkbox label="挖孔" inline checked={option.isHole} onChange={() => option.isHole = !option.isHole} /> <Checkbox label="挖孔" inline checked={option.isHole} onChange={() => option.isHole = !option.isHole} />
</div> </div>
<CommonMetalPanel store={store} entity={hardware} /> <CommonMetalPanel store={store} entity={hardware} compositeType={option.type} />
{ {
store.Entity && store.Entity &&
<div className="right"> <div className="right">
@ -126,6 +126,10 @@ export class CompositeMatalPanel extends React.Component<ICompositeMatalPanelPan
const option = this.props.store.option; const option = this.props.store.option;
option.type = type as EMetalsType; option.type = type as EMetalsType;
option.name = type; option.name = type;
//改变类型时 清空商品信息
option.goodsId = "";
option.goodsSn = "";
}; };
private startEditorFrame = async (composite: HardwareCompositeEntity) => private startEditorFrame = async (composite: HardwareCompositeEntity) =>

@ -15,6 +15,8 @@ export interface IHardwareOption extends IBaseOption
spec: string; spec: string;
comments: string; comments: string;
isHole: boolean; isHole: boolean;
goodsId?: string;
goodsSn?: string;
} }
export interface ICylMetalsOption extends IHardwareOption export interface ICylMetalsOption extends IHardwareOption
@ -47,6 +49,8 @@ export interface ICompHardwareOption extends IHardwareOption
color: string; color: string;
[EBoardKeyList.Mat]: string; [EBoardKeyList.Mat]: string;
count: string; count: string;
goodsId: string;
goodsSn: string;
} }
export interface IToplineOption extends IHardwareOption export interface IToplineOption extends IHardwareOption

@ -200,6 +200,7 @@ export class ToasterInput extends React.Component<IToasterInputProps, {}>
className={(this.errorMsg === "" ? "bp3-input " : "bp3-input bp3-intent-danger ") + props.inputClassName ?? ""} className={(this.errorMsg === "" ? "bp3-input " : "bp3-input bp3-intent-danger ") + props.inputClassName ?? ""}
value={this.showData[props.optKey]} value={this.showData[props.optKey]}
disabled={props.isDisabled} disabled={props.isDisabled}
readOnly={props.isReadOnly}
placeholder={props.placeHolder} placeholder={props.placeHolder}
onChange={this.handleChange} onChange={this.handleChange}
onClick={this.handleClick} onClick={this.handleClick}

@ -7,17 +7,26 @@ import { KeyBoard } from '../../Common/KeyEnum';
import { PostJson, RequestStatus } from '../../Common/Request'; import { PostJson, RequestStatus } from '../../Common/Request';
import { Pagination2 } from '../Components/SourceManage/Pagination'; import { Pagination2 } from '../Components/SourceManage/Pagination';
export enum GoodsType
{
board = 1,
comp = 2,
metals = 3
}
export interface IGoodInfo export interface IGoodInfo
{ {
goods_id: string; goods_id: string;
goods_sn: string;
name: string; name: string;
color: string, color: string;
material: string, material: string;
} }
interface IGoodsListProps interface IGoodsListProps
{ {
select: (good: IGoodInfo) => void; select: (good: IGoodInfo) => void;
open: IObservableValue<boolean>; open: IObservableValue<boolean>;
goods_type?: GoodsType;
} }
@observer @observer
@ -102,6 +111,7 @@ export class GoodsList extends React.Component<IGoodsListProps> {
let info = { let info = {
goods_id: v.goods_id, goods_id: v.goods_id,
goods_sn: v.goods_sn,
name: v.goods_name, name: v.goods_name,
color: colorName, color: colorName,
material: matName, material: matName,
@ -159,7 +169,7 @@ export class GoodsList extends React.Component<IGoodsListProps> {
curr_page: page, curr_page: page,
goods_name: this.searchStr, goods_name: this.searchStr,
bind_type: 1, bind_type: 1,
goods_type: 1, goods_type: this.props.goods_type,
page_count: this.info.pageCount, page_count: this.info.pageCount,
}; };
if (order) if (order)

@ -5,7 +5,7 @@ import ReactDOM from 'react-dom';
import { begin } from 'xaop'; import { begin } from 'xaop';
import { app } from '../../ApplicationServices/Application'; import { app } from '../../ApplicationServices/Application';
import { KeyBoard } from '../../Common/KeyEnum'; import { KeyBoard } from '../../Common/KeyEnum';
import { GoodsList, IGoodInfo } from './GoodsList'; import { GoodsList, GoodsType, IGoodInfo } from './GoodsList';
const GOODS_LIST_DIV_ID = "GoodsListDiv"; const GOODS_LIST_DIV_ID = "GoodsListDiv";
@ -13,6 +13,7 @@ interface IGoodsListProps
{ {
select: (good: IGoodInfo) => void; select: (good: IGoodInfo) => void;
open: IObservableValue<boolean>; open: IObservableValue<boolean>;
goods_type?: GoodsType;
} }
@observer @observer
@ -45,6 +46,7 @@ export class GoodsListDiv extends React.Component<IGoodsListProps> {
ReactDOM.render(<GoodsList ReactDOM.render(<GoodsList
open={this.props.open} open={this.props.open}
select={this.props.select} select={this.props.select}
goods_type={this.props.goods_type}
/>, this._StateContainer); />, this._StateContainer);
} }

@ -50,7 +50,7 @@ export class DrillStore extends BoardStore
private GetDefaultOption() private GetDefaultOption()
{ {
let originOption: DrillingOption = { let originOption: DrillingOption = {
version: 8, //排钻模板新版本 version: 9, //排钻模板新版本
startDist: 0, startDist: 0,
endDist: 49, endDist: 49,
//位置参数 //位置参数
@ -97,7 +97,11 @@ export class DrillStore extends BoardStore
tempName: "", tempName: "",
// autoDeviation: false, // autoDeviation: false,
allowPxl: false, allowPxl: false,
useNormalGroup: false useNormalGroup: false,
goodsId: "",
goodsSn: "",
woodGoodsId: "",
woodGoodsSn: ""
}; };
let opt1 = Object.assign({}, originOption); let opt1 = Object.assign({}, originOption);
opt1.count = 2; opt1.count = 2;
@ -368,6 +372,15 @@ export class DrillStore extends BoardStore
conf.useNormalGroup = false; conf.useNormalGroup = false;
} }
if (conf.version < 9)
{
conf.version = 9;
conf.goodsId = "";
conf.goodsSn = "";
conf.woodGoodsId = "";
conf.woodGoodsSn = "";
}
if (conf.useTemp && conf.tempId) if (conf.useTemp && conf.tempId)
{ {
/**缓存自定义排钻,不需要等待 */ /**缓存自定义排钻,不需要等待 */
@ -571,6 +584,14 @@ export class DrillStore extends BoardStore
option.tempName = nameMap.get(option.tempId); option.tempName = nameMap.get(option.tempId);
option.tempId = idMap.get(option.tempId); option.tempId = idMap.get(option.tempId);
} }
if (option.version < 6)
{
option.version = 6;
option.goodsId = "";
option.goodsSn = "";
option.woodGoodsId = "";
option.woodGoodsSn = "";
}
} }
} }
} }

@ -51,6 +51,15 @@ export abstract class BaseHardwareStore implements IConfigStore
UpdateOption(cof: IConfigOption) UpdateOption(cof: IConfigOption)
{ {
const { option, otherOption } = cof.option as any; const { option, otherOption } = cof.option as any;
let v = option.version;
if (v < 3)
{
option.version = 3;
option.goodsId = "";
option.goodsSn = "";
}
Object.assign(this.option, option); Object.assign(this.option, option);
this.Init(); this.Init();
if (otherOption) if (otherOption)

@ -55,4 +55,8 @@ export interface DrillingOption extends IBaseOption
tempName: string; //模板名称 tempName: string; //模板名称
autoDeviation?: boolean;//排钻自动偏移 autoDeviation?: boolean;//排钻自动偏移
allowPxl: boolean; //是否允许大孔在板边缘 allowPxl: boolean; //是否允许大孔在板边缘
goodsId: string;//商品ID
goodsSn: string;//商品编号
woodGoodsId: string;//商品ID
woodGoodsSn: string;//商品编号
} }

Loading…
Cancel
Save