|
@@ -1,31 +1,31 @@
|
|
-import {OrderParams,MaterialItem,MaterialBox} from "../params/OrderMaterialsStorageParams"
|
|
|
|
|
|
+import {DemandMaterial,OrderParams,MaterialItem,MaterialBox,EmptyBox} from "../params/OrderMaterialsStorageParams"
|
|
|
|
+import { ON } from '@ohos.UiTest'
|
|
|
|
+
|
|
@Component
|
|
@Component
|
|
export struct ProcessFlow {
|
|
export struct ProcessFlow {
|
|
- @Prop circle1Color : string
|
|
|
|
- @Prop circle2Color : string
|
|
|
|
- @Prop circle3Color : string
|
|
|
|
|
|
+ @Prop currentStep:number =0
|
|
build() {
|
|
build() {
|
|
Row() {
|
|
Row() {
|
|
// 步骤1
|
|
// 步骤1
|
|
FlowStep({
|
|
FlowStep({
|
|
stepNumber: 1,
|
|
stepNumber: 1,
|
|
- title: '选择订单',
|
|
|
|
|
|
+ title: '选择工单',
|
|
showConnector: true,
|
|
showConnector: true,
|
|
- backColor:this.circle1Color
|
|
|
|
|
|
+ isChoose:this.currentStep === 1
|
|
})
|
|
})
|
|
// 步骤2
|
|
// 步骤2
|
|
FlowStep({
|
|
FlowStep({
|
|
stepNumber: 2,
|
|
stepNumber: 2,
|
|
title: '调取料箱',
|
|
title: '调取料箱',
|
|
showConnector: true,
|
|
showConnector: true,
|
|
- backColor:this.circle2Color
|
|
|
|
|
|
+ isChoose:this.currentStep === 2
|
|
})
|
|
})
|
|
// 步骤3
|
|
// 步骤3
|
|
FlowStep({
|
|
FlowStep({
|
|
stepNumber: 3,
|
|
stepNumber: 3,
|
|
title: '绑定入库',
|
|
title: '绑定入库',
|
|
showConnector: false,
|
|
showConnector: false,
|
|
- backColor:this.circle3Color
|
|
|
|
|
|
+ isChoose:this.currentStep === 3
|
|
})
|
|
})
|
|
}
|
|
}
|
|
.justifyContent(FlexAlign.Center)
|
|
.justifyContent(FlexAlign.Center)
|
|
@@ -38,135 +38,121 @@ struct FlowStep {
|
|
@Prop stepNumber: number
|
|
@Prop stepNumber: number
|
|
@Prop title: string
|
|
@Prop title: string
|
|
@Prop showConnector: boolean
|
|
@Prop showConnector: boolean
|
|
- @Prop backColor : string
|
|
|
|
|
|
+ @Prop isChoose : boolean
|
|
build() {
|
|
build() {
|
|
Row() {
|
|
Row() {
|
|
Column() {
|
|
Column() {
|
|
// 步骤圆圈
|
|
// 步骤圆圈
|
|
Column() {
|
|
Column() {
|
|
Text(this.stepNumber.toString())
|
|
Text(this.stepNumber.toString())
|
|
- .fontSize(16)
|
|
|
|
- .fontColor('#FFFFFF') // 深灰数字
|
|
|
|
|
|
+ .fontColor(this.isChoose? $r('app.color.FFFFFF'):$r('app.color.60FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_15_2'))
|
|
}
|
|
}
|
|
- .width(40)
|
|
|
|
- .height(40)
|
|
|
|
|
|
+ .width($r('app.float.virtualSize_23'))
|
|
|
|
+ .height($r('app.float.virtualSize_23'))
|
|
.borderRadius(20) // 圆形
|
|
.borderRadius(20) // 圆形
|
|
- .backgroundColor(this.backColor) // 浅灰背景
|
|
|
|
|
|
+ .backgroundColor(this.isChoose? $r('app.color.0A84FF'):$r('app.color.20FFFFFF'))
|
|
.justifyContent(FlexAlign.Center)
|
|
.justifyContent(FlexAlign.Center)
|
|
.alignItems(HorizontalAlign.Center)
|
|
.alignItems(HorizontalAlign.Center)
|
|
|
|
|
|
// 步骤文字
|
|
// 步骤文字
|
|
Text(this.title)
|
|
Text(this.title)
|
|
- .fontSize(14)
|
|
|
|
|
|
+ .fontColor(this.isChoose? $r('app.color.FFFFFF'):$r('app.color.60FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_9_6'))
|
|
.margin({ top: 8 })
|
|
.margin({ top: 8 })
|
|
- .fontColor('#000000') // 黑色文字
|
|
|
|
|
|
|
|
- // 连接线(最后一个步骤不显示)
|
|
|
|
}
|
|
}
|
|
.justifyContent(FlexAlign.Center)
|
|
.justifyContent(FlexAlign.Center)
|
|
.alignItems(HorizontalAlign.Center)
|
|
.alignItems(HorizontalAlign.Center)
|
|
-
|
|
|
|
if (this.showConnector) {
|
|
if (this.showConnector) {
|
|
Divider()
|
|
Divider()
|
|
.vertical(false)
|
|
.vertical(false)
|
|
.strokeWidth(1)
|
|
.strokeWidth(1)
|
|
- .color('#1890FF')
|
|
|
|
- .margin({ left: 10, right: 10,bottom:15 })
|
|
|
|
- .width('15%')
|
|
|
|
|
|
+ .color($r('app.color.20FFFFFF'))
|
|
|
|
+ .margin({
|
|
|
|
+ left: '-3%',
|
|
|
|
+ right: '-3%',// 向左延伸至圆心
|
|
|
|
+ //
|
|
|
|
+ })
|
|
|
|
+ .width('30%') // 自适
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-// 订单项组件封装
|
|
|
|
-@Component
|
|
|
|
-export struct OrderItemView {
|
|
|
|
- @Prop orderName: string = '默认订单'
|
|
|
|
- @Prop orderNo: string = '000000'
|
|
|
|
- @Prop orderDate: string = '2023/01/01'
|
|
|
|
- @Prop progress: string = '0%'
|
|
|
|
- @Prop isSelected: boolean = false
|
|
|
|
-
|
|
|
|
- private onSelect: (index: number) => void = () => {}
|
|
|
|
- private index: number = 0
|
|
|
|
-
|
|
|
|
- build() {
|
|
|
|
- Column() {
|
|
|
|
- Text(this.orderName)
|
|
|
|
- .fontSize(16)
|
|
|
|
- .fontColor(this.isSelected ? '#FFFFFF' : '#000000')
|
|
|
|
-
|
|
|
|
- Text(`入库单号: ${this.orderNo}`)
|
|
|
|
- .fontSize(14)
|
|
|
|
- .fontColor(this.isSelected ? '#FFFFFF' : '#666666')
|
|
|
|
-
|
|
|
|
- Text(`下发时间: ${this.orderDate}`)
|
|
|
|
- .fontSize(14)
|
|
|
|
- .fontColor(this.isSelected ? '#FFFFFF' : '#666666')
|
|
|
|
- .margin({ top: 8 })
|
|
|
|
-
|
|
|
|
- Text(`入库比例: ${this.progress}`)
|
|
|
|
- .fontSize(14)
|
|
|
|
- .fontColor(this.isSelected ? '#FFFFFF' : '#1890FF')
|
|
|
|
- .margin({ top: 8 })
|
|
|
|
- }
|
|
|
|
- .backgroundColor(this.isSelected ? '#1890FF' : '#DFE5E7')
|
|
|
|
- .onClick(() => {
|
|
|
|
- this.onSelect(this.index) // 点击时调用父组件的选中方法
|
|
|
|
- })
|
|
|
|
- .padding(16)
|
|
|
|
- .border({
|
|
|
|
- width: 1,
|
|
|
|
- color: this.isSelected ? '#1890FF' : '#CCCCCC',
|
|
|
|
- radius: 4
|
|
|
|
- })
|
|
|
|
- .width('100%')
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
|
|
-// 订单列表容器
|
|
|
|
@Component
|
|
@Component
|
|
-export struct OrderListView {
|
|
|
|
|
|
+export struct OrderListComponent {
|
|
private scrollerForList: Scroller = new Scroller()
|
|
private scrollerForList: Scroller = new Scroller()
|
|
@Prop orders: OrderParams[] = []
|
|
@Prop orders: OrderParams[] = []
|
|
@State selectedIndex: number = -1 // 添加选中索引状态
|
|
@State selectedIndex: number = -1 // 添加选中索引状态
|
|
@Link selectedOrderNo: string
|
|
@Link selectedOrderNo: string
|
|
@Link selectedOrderDate: string
|
|
@Link selectedOrderDate: string
|
|
@Link selectedOrderName: string
|
|
@Link selectedOrderName: string
|
|
|
|
+ @Link selectedOrderInRatio:string
|
|
|
|
|
|
- // 处理选中逻辑
|
|
|
|
- private handleSelect(index: number): void {
|
|
|
|
|
|
+ // 选中回调函数
|
|
|
|
+ private onSelect(index: number): void {
|
|
this.selectedIndex = index
|
|
this.selectedIndex = index
|
|
this.selectedOrderNo = this.orders[index].orderNo
|
|
this.selectedOrderNo = this.orders[index].orderNo
|
|
this.selectedOrderDate = this.orders[index].date
|
|
this.selectedOrderDate = this.orders[index].date
|
|
this.selectedOrderName = this.orders[index].orderName
|
|
this.selectedOrderName = this.orders[index].orderName
|
|
|
|
+ this.selectedOrderInRatio = this.orders[index].progress
|
|
}
|
|
}
|
|
|
|
|
|
build() {
|
|
build() {
|
|
- List({ space: 12 ,scroller: this.scrollerForList}) {
|
|
|
|
- ForEach(this.orders, (item:OrderParams, index) => {
|
|
|
|
- ListItem() {
|
|
|
|
- OrderItemView({
|
|
|
|
- orderName: item.orderName,
|
|
|
|
- orderNo: item.orderNo,
|
|
|
|
- orderDate: item.date,
|
|
|
|
- progress: item.progress,
|
|
|
|
- isSelected: index === this.selectedIndex,
|
|
|
|
- onSelect: () => this.handleSelect(index),
|
|
|
|
- index: index
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ Column() { // 订单列表
|
|
|
|
+ List({ space: 8,scroller:this.scrollerForList }) {
|
|
|
|
+ ForEach(this.orders, (item: OrderParams, index) => {
|
|
|
|
+ ListItem() {
|
|
|
|
+ Column() {
|
|
|
|
+ // 订单标题(带订单号)
|
|
|
|
+ Text(`${item.orderName}`)
|
|
|
|
+ .fontSize($r('app.float.fontSize_12'))
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .width('100%')
|
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
|
+
|
|
|
|
+ // 订单详情
|
|
|
|
+ Column({ space: 3 }) {
|
|
|
|
+ Text(`工单编号: ${item.orderNo}`)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+
|
|
|
|
+ Text(`下发时间: ${item.date}`)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+
|
|
|
|
+ Row() {
|
|
|
|
+ Text('入库比例:')
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+
|
|
|
|
+ Text(item.progress)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+ .margin({ left: 4 })
|
|
|
|
+ }
|
|
|
|
+ .width('100%')
|
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
|
+ }
|
|
|
|
+ .margin({ top: 6 })
|
|
|
|
+ .alignItems(HorizontalAlign.Start)
|
|
|
|
+ }.backgroundColor(index === this.selectedIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF')) // 选中状态加深
|
|
|
|
+ .borderRadius($r('app.float.virtualSize_9_6'))
|
|
|
|
+ .padding(13)
|
|
|
|
+ .border({width:2,color:index === this.selectedIndex ? $r('app.color.2030D158'):$r('app.color.20FFFFFF')})
|
|
|
|
+ .onClick(() => {
|
|
|
|
+ this.onSelect(index)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ .width('100%')
|
|
|
|
+ .flexGrow(1)
|
|
}
|
|
}
|
|
.width('100%')
|
|
.width('100%')
|
|
.height('100%')
|
|
.height('100%')
|
|
- .listDirection(Axis.Vertical)
|
|
|
|
- .divider({
|
|
|
|
- strokeWidth: 1,
|
|
|
|
- color: '#F0F0F0',
|
|
|
|
- startMargin: 16,
|
|
|
|
- endMargin: 16
|
|
|
|
- })
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -236,146 +222,191 @@ export struct SingleOrder {
|
|
@Prop selectedOrderNo: string
|
|
@Prop selectedOrderNo: string
|
|
@Prop selectedOrderDate: string
|
|
@Prop selectedOrderDate: string
|
|
@Prop selectedOrderName: string
|
|
@Prop selectedOrderName: string
|
|
|
|
+ @Prop selectedOrderInRatio: string
|
|
build() {
|
|
build() {
|
|
Column() {
|
|
Column() {
|
|
- // 订单标题
|
|
|
|
|
|
+ // 订单标题(带订单号)
|
|
Text(this.selectedOrderName)
|
|
Text(this.selectedOrderName)
|
|
- .fontSize(18)
|
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
|
- .margin({ bottom: 12 })
|
|
|
|
- // 订单详情
|
|
|
|
- Text("入库单号: "+this.selectedOrderNo)
|
|
|
|
- .fontSize(14)
|
|
|
|
- .fontColor('#666666')
|
|
|
|
- .margin({ bottom: 8 })
|
|
|
|
-
|
|
|
|
- Text("下发时间: "+this.selectedOrderDate)
|
|
|
|
- .fontSize(14)
|
|
|
|
- .fontColor('#666666')
|
|
|
|
- }
|
|
|
|
- .padding(16)
|
|
|
|
- .backgroundColor('#F5F5F5') // 浅灰背景
|
|
|
|
- .width('100%') // 占Row的50%
|
|
|
|
- .alignItems(HorizontalAlign.Center)
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-@Component
|
|
|
|
-export struct materialScan {
|
|
|
|
- // @Prop selectedOrderNo: string
|
|
|
|
- // @Prop selectedOrderDate: string
|
|
|
|
- // @Prop selectedOrderName: string
|
|
|
|
- build() {
|
|
|
|
- Column() {
|
|
|
|
- // 扫码标题
|
|
|
|
- Text('物料扫码')
|
|
|
|
- .fontSize(18)
|
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
|
- .margin({ bottom: '5%' })
|
|
|
|
-
|
|
|
|
- // 扫码提示
|
|
|
|
- TextInput({ placeholder: '请扫描物料编码' })
|
|
|
|
- .type(InputType.Normal)
|
|
|
|
- .placeholderFont({ size: 16 })
|
|
|
|
- .fontSize(16)
|
|
|
|
|
|
+ .fontSize($r('app.float.fontSize_12'))
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
.width('100%')
|
|
.width('100%')
|
|
- .height(40)
|
|
|
|
- .margin({ bottom: '5%' })
|
|
|
|
- .border({
|
|
|
|
- width: 1,
|
|
|
|
- color: '#1890FF', // 使用图片中的蓝色边框
|
|
|
|
- radius: 4
|
|
|
|
- })
|
|
|
|
- .backgroundColor('#FFFFFF') // 白色背景
|
|
|
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
|
|
|
- // 操作说明
|
|
|
|
- Text('扫码查询同类物料,选择放入已有物料箱或空箱')
|
|
|
|
- .fontSize(12)
|
|
|
|
- .fontColor('#999999')
|
|
|
|
- .margin({ bottom: '15%' })
|
|
|
|
|
|
+ // 订单详情
|
|
|
|
+ Column({ space: 3 }) {
|
|
|
|
+ Text(`工单编号: ${this.selectedOrderNo}`)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+
|
|
|
|
+ Text(`下发时间: ${this.selectedOrderDate}`)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+
|
|
|
|
+ Row() {
|
|
|
|
+ Text('入库比例:')
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+
|
|
|
|
+ Text(this.selectedOrderInRatio)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+ .margin({ left: 4 })
|
|
|
|
+ }
|
|
.width('100%')
|
|
.width('100%')
|
|
-
|
|
|
|
- // 物料信息展示区
|
|
|
|
- Column() {
|
|
|
|
- Text('物料名称XXXXXXX')
|
|
|
|
- .fontSize(16)
|
|
|
|
- .margin({ bottom: 8 })
|
|
|
|
-
|
|
|
|
- Text('产品型号xxxxxxx')
|
|
|
|
- .fontSize(14)
|
|
|
|
- .fontColor('#666666')
|
|
|
|
- .margin({ bottom: 8 })
|
|
|
|
-
|
|
|
|
- Text('序列号:2131231231')
|
|
|
|
- .fontSize(14)
|
|
|
|
- .margin({ bottom: 8 })
|
|
|
|
-
|
|
|
|
- Text('数量:500个')
|
|
|
|
- .fontSize(14)
|
|
|
|
- .fontColor('#1890FF')
|
|
|
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
}
|
|
}
|
|
- }
|
|
|
|
- .padding(16)
|
|
|
|
- .backgroundColor('#F5F5F5') // 浅灰背景
|
|
|
|
- .width('100%') // 占Row的50%
|
|
|
|
- .alignItems(HorizontalAlign.Center)
|
|
|
|
|
|
+ .margin({ top: 6 })
|
|
|
|
+ .alignItems(HorizontalAlign.Start)
|
|
|
|
+ Divider()
|
|
|
|
+ .strokeWidth(1)
|
|
|
|
+ .color($r('app.color.20FFFFFF'))
|
|
|
|
+ .margin({top:'2%'})
|
|
|
|
+ }//.backgroundColor(index === this.selectedIndex ? $r('app.color.30D158') : $r('app.color.20FFFFFF')) // 选中状态加深
|
|
|
|
+ .borderRadius($r('app.float.virtualSize_9_6'))
|
|
|
|
+ .padding(13)
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-@Component
|
|
|
|
-export struct BoxGrid {
|
|
|
|
- @Prop boxes: MaterialBox[] = [];
|
|
|
|
|
|
|
|
|
|
+@Component
|
|
|
|
+export struct BoxGrid{
|
|
|
|
+ private scrollerForList: Scroller = new Scroller()
|
|
|
|
+ @Prop orders: OrderParams[] = []
|
|
|
|
+ @State selectedIndex: number = -1 // 添加选中索引状态
|
|
|
|
+ // 选中回调函数
|
|
|
|
+ private onSelect(index: number): void {
|
|
|
|
+ this.selectedIndex = index
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+ @Prop materialBoxs: MaterialBox[] = [];
|
|
build() {
|
|
build() {
|
|
- Grid() {
|
|
|
|
- ForEach(this.boxes, (box:MaterialBox) => {
|
|
|
|
- GridItem() {
|
|
|
|
- Column() {
|
|
|
|
- // 顶部标题区
|
|
|
|
- Text(box.name)
|
|
|
|
- .fontSize(16)
|
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
|
|
|
+ Column() {
|
|
|
|
+ Grid(this.scrollerForList) {
|
|
|
|
+ ForEach(this.materialBoxs, (box: MaterialBox, index) => {
|
|
|
|
+ GridItem() {
|
|
|
|
+ Column() {
|
|
|
|
+ // 订单标题(带订单号)
|
|
|
|
+ Text(`${box.name}`)
|
|
|
|
+ .fontSize($r('app.float.fontSize_12'))
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .width('100%')
|
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
|
+ .margin({ bottom: '2%' })
|
|
|
|
+ // 订单详情
|
|
|
|
+ Column({ space: 3 }) {
|
|
|
|
+ Text(`料箱编号: ${box.id}`)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
|
+ Text(`料箱类型: ${box.boxType}`)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
|
+ Text(`所属订单: ${box.order}`)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
|
+ Text(`数量: ${box.boxNumber}`)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
|
+ Text(`位置: ${box.position}`)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
|
+ }
|
|
.width('100%')
|
|
.width('100%')
|
|
- .textAlign(TextAlign.Center)
|
|
|
|
- .margin({ bottom: 8 })
|
|
|
|
- if (box.type === 'empty') {
|
|
|
|
- Text('空箱图片')
|
|
|
|
- .fontSize(14)
|
|
|
|
- .fontColor('#FF0000')// 红色文字
|
|
|
|
- .width('90%')
|
|
|
|
- .height(60)
|
|
|
|
- .backgroundColor('#FFFFFF')
|
|
|
|
- .textAlign(TextAlign.Center)
|
|
|
|
- .margin({ bottom: 8 })
|
|
|
|
- }
|
|
|
|
- BoxInfoRow({ label: '料箱编号', value: box.boxNumber})
|
|
|
|
- BoxInfoRow({ label: '位置', value: box.position })
|
|
|
|
- if (box.type === 'material') {
|
|
|
|
- BoxInfoRow({ label: '料箱类型', value: box.boxType })
|
|
|
|
- BoxInfoRow({ label: '所属订单', value: box.order || '' })
|
|
|
|
- BoxInfoRow({ label: '数量', value: `${box.quantity}` })
|
|
|
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
|
+ .alignItems(HorizontalAlign.Start)
|
|
}
|
|
}
|
|
|
|
+ //.margin({ top: 6 })
|
|
|
|
+ .alignItems(HorizontalAlign.Start)
|
|
|
|
+ }
|
|
|
|
+ .backgroundColor(index === this.selectedIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF')) // 选中状态加深
|
|
|
|
+ .borderRadius($r('app.float.virtualSize_9_6'))
|
|
|
|
+ .padding(13)
|
|
|
|
+ .border({
|
|
|
|
+ width: 2,
|
|
|
|
+ color: index === this.selectedIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF')
|
|
|
|
+ })
|
|
|
|
+ .onClick(() => {
|
|
|
|
+ this.onSelect(index)
|
|
|
|
+ })
|
|
|
|
|
|
- }.width('100%')
|
|
|
|
- .height('40%')
|
|
|
|
- .padding(12)
|
|
|
|
- .backgroundColor('#FFFFFF')
|
|
|
|
- .borderRadius(4)
|
|
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ .columnsTemplate('1fr 1fr 1fr')
|
|
|
|
+ .columnsGap(10) // 移除网格内部列间距
|
|
|
|
+ .rowsGap(10) // 移除网格内部行间距
|
|
|
|
+ .width('100%') // 确保填满父容器
|
|
|
|
+ .height('50%')
|
|
|
|
+ .padding(10)
|
|
|
|
+
|
|
|
|
+ Grid(this.scrollerForList) {
|
|
|
|
+ ForEach(this.materialBoxs, (box: MaterialBox, index) => {
|
|
|
|
+ GridItem() {
|
|
|
|
+ Column() {
|
|
|
|
+ // 订单标题(带订单号)
|
|
|
|
+ Text(`${box.name}`)
|
|
|
|
+ .fontSize($r('app.float.fontSize_12'))
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .width('100%')
|
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
|
+ .margin({ bottom: '2%' })
|
|
|
|
+ // 订单详情
|
|
|
|
+ Column({ space: 3 }) {
|
|
|
|
+ Text(`料箱编号: ${box.id}`)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
|
+ Text(`料箱类型: ${box.boxType}`)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
|
+ Text(`所属订单: ${box.order}`)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
|
+ Text(`数量: ${box.boxNumber}`)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
|
+ Text(`位置: ${box.position}`)
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
|
+ }
|
|
|
|
+ .width('100%')
|
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
|
+ .alignItems(HorizontalAlign.Start)
|
|
|
|
+ }
|
|
|
|
+ //.margin({ top: 6 })
|
|
|
|
+ .alignItems(HorizontalAlign.Start)
|
|
|
|
+ }
|
|
|
|
+ .backgroundColor(index === this.selectedIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF')) // 选中状态加深
|
|
|
|
+ .borderRadius($r('app.float.virtualSize_9_6'))
|
|
|
|
+ .padding(13)
|
|
.border({
|
|
.border({
|
|
- width: 1,
|
|
|
|
- color: '#F0F0F0'
|
|
|
|
|
|
+ width: 2,
|
|
|
|
+ color: index === this.selectedIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF')
|
|
})
|
|
})
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ .onClick(() => {
|
|
|
|
+ this.onSelect(index)
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ .columnsTemplate('1fr 1fr 1fr')
|
|
|
|
+ .columnsGap(10) // 移除网格内部列间距
|
|
|
|
+ .rowsGap(10) // 移除网格内部行间距
|
|
|
|
+ .width('100%') // 确保填满父容器
|
|
|
|
+ .height('50%')
|
|
|
|
+ .padding(10)
|
|
}
|
|
}
|
|
- .columnsTemplate('1fr 1fr 1fr')
|
|
|
|
- .columnsGap(10) // 移除网格内部列间距
|
|
|
|
- .rowsGap(10) // 移除网格内部行间距
|
|
|
|
- .width('100%') // 确保填满父容器
|
|
|
|
- .height('100%')
|
|
|
|
- .padding(10)
|
|
|
|
- .backgroundColor('#F5F5F5') // 背景色与图片一致
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // 背景色与图片一致
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -401,4 +432,54 @@ struct BoxInfoRow {
|
|
.margin({ bottom: 6 })
|
|
.margin({ bottom: 6 })
|
|
.justifyContent(FlexAlign.Start)
|
|
.justifyContent(FlexAlign.Start)
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+@Component
|
|
|
|
+export struct MaterialList {
|
|
|
|
+ private scrollerForList: Scroller = new Scroller()
|
|
|
|
+ @Prop MaterialData: DemandMaterial[] = []
|
|
|
|
+ build() {
|
|
|
|
+ Column() {
|
|
|
|
+ List({scroller:this.scrollerForList}) {
|
|
|
|
+ ForEach(this.MaterialData, (item:DemandMaterial) => {
|
|
|
|
+ ListItem() {
|
|
|
|
+ Column() {
|
|
|
|
+ Row(){
|
|
|
|
+ Text(item.materialName)
|
|
|
|
+ .fontSize($r('app.float.fontSize_12'))
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .width('90%')
|
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
|
+ Text(`${item.inBoundNum}/${item.planNum}`)
|
|
|
|
+ .fontSize($r('app.float.fontSize_12'))
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .width('10%')
|
|
|
|
+ .textAlign(TextAlign.End)
|
|
|
|
+ }.margin({top:'1%'})
|
|
|
|
+ Row(){
|
|
|
|
+ Text(`型号: ${item.materialType}`)
|
|
|
|
+ .fontSize($r('app.float.fontSize_8'))
|
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
|
+ .width('90%')
|
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
|
+ Text('入库/计划数量')
|
|
|
|
+ .fontSize($r('app.float.fontSize_7'))
|
|
|
|
+ .fontColor($r('app.color.60FFFFFF'))
|
|
|
|
+ .width('10%')
|
|
|
|
+ .textAlign(TextAlign.End)
|
|
|
|
+ }.margin({bottom:'1%'})
|
|
|
|
+ }.width('100%').alignItems(HorizontalAlign.Start).justifyContent(FlexAlign.SpaceEvenly).height('12%')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ .width('100%')
|
|
|
|
+ .height('100%')
|
|
|
|
+ .divider({
|
|
|
|
+ strokeWidth: 1,
|
|
|
|
+ color: $r('app.color.20FFFFFF')
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ .height('100%')
|
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
|
+ }
|
|
|
|
+}
|