|
@@ -8,7 +8,164 @@ import WorkOrderInfo from '../../viewmodel/WorkOrderInfo'
|
|
|
export struct MaterialCollectView {
|
|
|
@State scanCode: string = ''
|
|
|
// 需要采集的工序物料
|
|
|
- @State itemArray: OperationItem[] = []
|
|
|
+ @State itemArray: OperationItem[] = [
|
|
|
+ {
|
|
|
+ batchNo:'',
|
|
|
+ itemCode:'Y11P-1210ZJ10',
|
|
|
+ itemModel:'Y11P-1210ZJ10',
|
|
|
+ itemName:'控制连接器插座',
|
|
|
+ needNum:6.0,
|
|
|
+ operationId:'679',
|
|
|
+ processId:'',
|
|
|
+ realNum:1.0,
|
|
|
+ workOrderCode:'10.25.0022'
|
|
|
+ },{
|
|
|
+ batchNo:'',
|
|
|
+ itemCode:'Y11P-0804ZJ10-2',
|
|
|
+ itemModel:'Y11P-0804ZJ10-2',
|
|
|
+ itemName:'电源连接器插座',
|
|
|
+ needNum:5.0,
|
|
|
+ operationId:'679',
|
|
|
+ processId:'',
|
|
|
+ workOrderCode:'10.25.0022'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ batchNo:'',
|
|
|
+ itemCode:'Y11P-1210ZJ10',
|
|
|
+ itemModel:'Y11P-1210ZJ10',
|
|
|
+ itemName:'控制连接器插座',
|
|
|
+ needNum:6.0,
|
|
|
+ operationId:'679',
|
|
|
+ processId:'',
|
|
|
+ realNum:1.0,
|
|
|
+ workOrderCode:'10.25.0022'
|
|
|
+ },{
|
|
|
+ batchNo:'',
|
|
|
+ itemCode:'Y11P-0804ZJ10-2',
|
|
|
+ itemModel:'Y11P-0804ZJ10-2',
|
|
|
+ itemName:'电源连接器插座',
|
|
|
+ needNum:5.0,
|
|
|
+ operationId:'679',
|
|
|
+ processId:'',
|
|
|
+ workOrderCode:'10.25.0022'
|
|
|
+ },{
|
|
|
+ batchNo:'',
|
|
|
+ itemCode:'Y11P-1210ZJ10',
|
|
|
+ itemModel:'Y11P-1210ZJ10',
|
|
|
+ itemName:'控制连接器插座',
|
|
|
+ needNum:6.0,
|
|
|
+ operationId:'679',
|
|
|
+ processId:'',
|
|
|
+ realNum:1.0,
|
|
|
+ workOrderCode:'10.25.0022'
|
|
|
+ },{
|
|
|
+ batchNo:'',
|
|
|
+ itemCode:'Y11P-0804ZJ10-2',
|
|
|
+ itemModel:'Y11P-0804ZJ10-2',
|
|
|
+ itemName:'电源连接器插座',
|
|
|
+ needNum:5.0,
|
|
|
+ operationId:'679',
|
|
|
+ processId:'',
|
|
|
+ workOrderCode:'10.25.0022'
|
|
|
+ },{
|
|
|
+ batchNo:'',
|
|
|
+ itemCode:'Y11P-1210ZJ10',
|
|
|
+ itemModel:'Y11P-1210ZJ10',
|
|
|
+ itemName:'控制连接器插座',
|
|
|
+ needNum:6.0,
|
|
|
+ operationId:'679',
|
|
|
+ processId:'',
|
|
|
+ realNum:1.0,
|
|
|
+ workOrderCode:'10.25.0022'
|
|
|
+ },{
|
|
|
+ batchNo:'',
|
|
|
+ itemCode:'Y11P-0804ZJ10-2',
|
|
|
+ itemModel:'Y11P-0804ZJ10-2',
|
|
|
+ itemName:'电源连接器插座',
|
|
|
+ needNum:5.0,
|
|
|
+ operationId:'679',
|
|
|
+ processId:'',
|
|
|
+ workOrderCode:'10.25.0022'
|
|
|
+ },{
|
|
|
+ batchNo:'',
|
|
|
+ itemCode:'Y11P-1210ZJ10',
|
|
|
+ itemModel:'Y11P-1210ZJ10',
|
|
|
+ itemName:'控制连接器插座',
|
|
|
+ needNum:6.0,
|
|
|
+ operationId:'679',
|
|
|
+ processId:'',
|
|
|
+ realNum:1.0,
|
|
|
+ workOrderCode:'10.25.0022'
|
|
|
+ },{
|
|
|
+ batchNo:'',
|
|
|
+ itemCode:'Y11P-0804ZJ10-2',
|
|
|
+ itemModel:'Y11P-0804ZJ10-2',
|
|
|
+ itemName:'电源连接器插座',
|
|
|
+ needNum:5.0,
|
|
|
+ operationId:'679',
|
|
|
+ processId:'',
|
|
|
+ workOrderCode:'10.25.0022'
|
|
|
+ },{
|
|
|
+ batchNo:'',
|
|
|
+ itemCode:'Y11P-1210ZJ10',
|
|
|
+ itemModel:'Y11P-1210ZJ10',
|
|
|
+ itemName:'控制连接器插座',
|
|
|
+ needNum:6.0,
|
|
|
+ operationId:'679',
|
|
|
+ processId:'',
|
|
|
+ realNum:1.0,
|
|
|
+ workOrderCode:'10.25.0022'
|
|
|
+ },{
|
|
|
+ batchNo:'',
|
|
|
+ itemCode:'Y11P-0804ZJ10-2',
|
|
|
+ itemModel:'Y11P-0804ZJ10-2',
|
|
|
+ itemName:'电源连接器插座',
|
|
|
+ needNum:5.0,
|
|
|
+ operationId:'679',
|
|
|
+ processId:'',
|
|
|
+ workOrderCode:'10.25.0022'
|
|
|
+ },{
|
|
|
+ batchNo:'',
|
|
|
+ itemCode:'Y11P-1210ZJ10',
|
|
|
+ itemModel:'Y11P-1210ZJ10',
|
|
|
+ itemName:'控制连接器插座',
|
|
|
+ needNum:6.0,
|
|
|
+ operationId:'679',
|
|
|
+ processId:'',
|
|
|
+ realNum:5.0,
|
|
|
+ workOrderCode:'10.25.0022'
|
|
|
+ },{
|
|
|
+ batchNo:'',
|
|
|
+ itemCode:'Y11P-0804ZJ10-2',
|
|
|
+ itemModel:'Y11P-0804ZJ10-2',
|
|
|
+ itemName:'电源连接器插座',
|
|
|
+ needNum:5.0,
|
|
|
+ realNum:5.0,
|
|
|
+ operationId:'679',
|
|
|
+ processId:'',
|
|
|
+ workOrderCode:'10.25.0022'
|
|
|
+ },{
|
|
|
+ batchNo:'',
|
|
|
+ itemCode:'Y11P-1210ZJ10',
|
|
|
+ itemModel:'Y11P-1210ZJ10',
|
|
|
+ itemName:'控制连接器插座',
|
|
|
+ needNum:6.0,
|
|
|
+ operationId:'679',
|
|
|
+ processId:'',
|
|
|
+ realNum:5.0,
|
|
|
+ workOrderCode:'10.25.0022'
|
|
|
+ },{
|
|
|
+ batchNo:'',
|
|
|
+ itemCode:'Y11P-0804ZJ10-2',
|
|
|
+ itemModel:'Y11P-0804ZJ10-2',
|
|
|
+ itemName:'电源连接器插座',
|
|
|
+ needNum:5.0,
|
|
|
+ realNum:5.0,
|
|
|
+ operationId:'679',
|
|
|
+ processId:'',
|
|
|
+ workOrderCode:'10.25.0022'
|
|
|
+ },
|
|
|
+ ]
|
|
|
// 总需求数
|
|
|
@State needNum: number = 100
|
|
|
// 实际数量(已采集数)
|
|
@@ -40,8 +197,8 @@ export struct MaterialCollectView {
|
|
|
pageSize: 999999} as RequestParamModel)
|
|
|
}
|
|
|
for (const element of this.itemArray) {
|
|
|
- this.needNum += element.needNum!
|
|
|
- this.realNum += element.realNum!
|
|
|
+ this.needNum += element.needNum ? element.needNum : 0
|
|
|
+ this.realNum += element.realNum ? element.needNum : 0
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -81,11 +238,25 @@ export struct MaterialCollectView {
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
- Progress({ value: this.realNum, total: this.needNum, type: ProgressType.Linear })
|
|
|
- .width('100%')
|
|
|
- .color($r('app.color.0A84FF'))
|
|
|
- .backgroundColor($r('app.color.15FFFFFF'))
|
|
|
- .borderRadius($r('app.float.virtualSize_32'))
|
|
|
+ // Progress({ value: this.realNum, total: this.needNum, type: ProgressType.Linear })
|
|
|
+ // .width('100%')
|
|
|
+ // .color($r('app.color.0A84FF'))
|
|
|
+ // .backgroundColor($r('app.color.15FFFFFF'))
|
|
|
+ // .borderRadius($r('app.float.virtualSize_32'))
|
|
|
+ Row() {
|
|
|
+ Row()
|
|
|
+ .width(((this.realNum * 100)/ this.needNum).toFixed(2) + '%')
|
|
|
+ .height('100%')
|
|
|
+ .borderRadius($r('app.float.virtualSize_24'))
|
|
|
+ .linearGradient({
|
|
|
+ angle: 90,
|
|
|
+ colors: [[$r('app.color.1050FF'), 0.0], [$r('app.color.73C3FF'), 1]]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .height('30%')
|
|
|
+ .width('100%')
|
|
|
+ .backgroundColor($r('app.color.10FFFFFF'))
|
|
|
+ .borderRadius($r('app.float.virtualSize_24'))
|
|
|
}
|
|
|
.width('13.1%')
|
|
|
.height('31.3%')
|
|
@@ -97,7 +268,7 @@ export struct MaterialCollectView {
|
|
|
.justifyContent(FlexAlign.SpaceBetween)
|
|
|
// 动态排列容器
|
|
|
Scroll() {
|
|
|
- Flex({ wrap: FlexWrap.Wrap, direction: FlexDirection.Column, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start}) {
|
|
|
+ Flex({ wrap: FlexWrap.Wrap, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start}) {
|
|
|
ForEach(this.itemArray, (item: OperationItem, index: number) => {
|
|
|
Column() {
|
|
|
Row() {
|
|
@@ -106,22 +277,29 @@ export struct MaterialCollectView {
|
|
|
.fontSize($r('app.float.fontSize_24'))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
+ .maxLines(1)
|
|
|
Text(item.itemCode!)
|
|
|
.fontSize($r('app.float.fontSize_12'))
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
+ .maxLines(1)
|
|
|
}
|
|
|
.width('45.5%')
|
|
|
.height('100%')
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
+ .alignItems(HorizontalAlign.Start)
|
|
|
Row() {
|
|
|
- Image($r('app.media.process_complete_test'))
|
|
|
- .height('100%')
|
|
|
- .width('45.5%')
|
|
|
+ if (item.realNum! >= item.needNum!) {
|
|
|
+ Image($r('app.media.process_complete_test'))
|
|
|
+ .height('100%')
|
|
|
+ .width('45.5%')
|
|
|
+ .objectFit(ImageFit.Fill)
|
|
|
+ }
|
|
|
}
|
|
|
.width('50%')
|
|
|
.height('100%')
|
|
|
.alignItems(VerticalAlign.Top)
|
|
|
+ .justifyContent(FlexAlign.End)
|
|
|
}
|
|
|
.height('45.8%')
|
|
|
.width('100%')
|