|
@@ -1,6 +1,9 @@
|
|
|
import {DemandMaterial,OrderParams,MaterialItem,MaterialBox,EmptyBox} from "../params/OrderMaterialsStorageParams"
|
|
|
import WorkOrderInfo from '../viewmodel/wms/WorkOrderInfo'
|
|
|
+import WorkOrderMaterialInfo from "../viewmodel/wms/WorkOrderMaterialInfo"
|
|
|
import {MaterialBoxInfo} from '../params/MaterialInformationParam'
|
|
|
+import WmsRequest from '../common/util/request/WmsRequest'
|
|
|
+import RequestParamModel from '../viewmodel/wms/RequestParamModel'
|
|
|
@Component
|
|
|
export struct ProcessFlow {
|
|
|
@Prop currentStep:number =0
|
|
@@ -92,9 +95,14 @@ export struct OrderListComponent {
|
|
|
private scrollerForList: Scroller = new Scroller()
|
|
|
@Prop workOrders: WorkOrderInfo[] = []
|
|
|
@Link selectWorkOrder: WorkOrderInfo
|
|
|
+ @Link materialData:WorkOrderMaterialInfo[]
|
|
|
@State selectedIndex: number = -1 // 添加选中索引状态
|
|
|
|
|
|
-
|
|
|
+ queryDemandMaterial=async(workOrderCode:string)=>{
|
|
|
+ this.materialData = await WmsRequest.post('/api/v1/wms/workOrderMaterial/list', {
|
|
|
+ workOrderCode: workOrderCode,
|
|
|
+ } as RequestParamModel) as WorkOrderMaterialInfo[]
|
|
|
+ }
|
|
|
// 选中回调函数
|
|
|
private onSelect(index: number): void {
|
|
|
this.selectedIndex = index
|
|
@@ -148,6 +156,7 @@ export struct OrderListComponent {
|
|
|
.border({width:2,color:index === this.selectedIndex ? $r('app.color.2030D158'):$r('app.color.20FFFFFF')})
|
|
|
.onClick(() => {
|
|
|
this.onSelect(index)
|
|
|
+ this.queryDemandMaterial(this.selectWorkOrder.workOrderCode)
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -239,17 +248,18 @@ export struct BoxGrid {
|
|
|
this.selectedMaterialIndex = -1
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Link materialBoxes: MaterialBoxInfo[] ;
|
|
|
@Link emptyBoxes: MaterialBoxInfo[]
|
|
|
build() {
|
|
|
Column() {
|
|
|
if(this.isQueryMaterial){
|
|
|
Grid(this.scrollerMaterial) {
|
|
|
- ForEach(this.materialBoxes, (box: MaterialBox, index) => {
|
|
|
+ ForEach(this.materialBoxes, (box: MaterialBoxInfo, index) => {
|
|
|
GridItem() {
|
|
|
Column() {
|
|
|
// 订单标题(带订单号)
|
|
|
- Text(`${box.name}`)
|
|
|
+ Text(`${box.materials?box.materials[0].materialName:''}`)
|
|
|
.fontSize($r('app.float.fontSize_12'))
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.width('100%')
|
|
@@ -257,27 +267,32 @@ export struct BoxGrid {
|
|
|
.margin({ bottom: '2%',left:'2%' })
|
|
|
// 订单详情
|
|
|
Column({ space: 3 }) {
|
|
|
- Text(`料箱编号: ${box.id}`)
|
|
|
+ Text(`料箱编号: ${box.vehicleCode}`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_8'))
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- Text(`料箱类型: ${box.boxType}`)
|
|
|
+ // Text(`料箱类型: ${box.materials?box.materials[0].materialNo:''}`)
|
|
|
+ // .fontColor($r('app.color.FFFFFF'))
|
|
|
+ // .fontSize($r('app.float.fontSize_8'))
|
|
|
+ // .fontWeight(FontWeight.Lighter)
|
|
|
+ // .textAlign(TextAlign.Start)
|
|
|
+ Text(`所属订单: ${box.taskNo}`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_8'))
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- Text(`所属订单: ${box.order}`)
|
|
|
+ Text(`数量: ${box.materials?box.materials[0].num:''}${box.materials?box.materials[0].unit:''}`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_8'))
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- Text(`数量: ${box.boxNumber}`)
|
|
|
+ Text(`层数: ${box.position}`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_8'))
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- Text(`位置: ${box.position}`)
|
|
|
+ Text(`坐标: ${box.locationNo}`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_8'))
|
|
|
.textAlign(TextAlign.Start)
|
|
@@ -300,6 +315,7 @@ export struct BoxGrid {
|
|
|
})
|
|
|
.onClick(() => {
|
|
|
this.onSelectMaterial(index)
|
|
|
+ this.selectedMaterialBox = box
|
|
|
//this.selectedMaterialBox = box.id
|
|
|
})
|
|
|
|
|
@@ -480,27 +496,27 @@ export struct MaterialBoxGrid {
|
|
|
@Component
|
|
|
export struct MaterialList {
|
|
|
private scrollerForList: Scroller = new Scroller()
|
|
|
- @Prop MaterialData: DemandMaterial[] = []
|
|
|
+ @Prop MaterialData: WorkOrderMaterialInfo[] = []
|
|
|
build() {
|
|
|
Column() {
|
|
|
List({scroller:this.scrollerForList}) {
|
|
|
- ForEach(this.MaterialData, (item:DemandMaterial) => {
|
|
|
+ ForEach(this.MaterialData, (item:WorkOrderMaterialInfo) => {
|
|
|
ListItem() {
|
|
|
Column() {
|
|
|
Row(){
|
|
|
- Text(item.materialName)
|
|
|
+ Text(item.itemName)
|
|
|
.fontSize($r('app.float.fontSize_12'))
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.width('90%')
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- Text(`${item.inBoundNum}/${item.planNum}`)
|
|
|
+ Text(`${item.storageNum}/${item.num}`)
|
|
|
.fontSize($r('app.float.fontSize_12'))
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.width('10%')
|
|
|
.textAlign(TextAlign.End)
|
|
|
}.margin({top:'1%'})
|
|
|
Row(){
|
|
|
- Text(`型号: ${item.materialType}`)
|
|
|
+ Text(`型号: ${item.itemCode}`)
|
|
|
.fontSize($r('app.float.fontSize_8'))
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.width('90%')
|
|
@@ -533,47 +549,45 @@ export struct MaterialList {
|
|
|
@Component
|
|
|
export struct MaterialListComponent {
|
|
|
private scrollerForList: Scroller = new Scroller()
|
|
|
- @Link orders: OrderParams[]
|
|
|
- @State selectedIndex: number = -1 // 添加选中索引状
|
|
|
+ @Link ScanMaterialList: WorkOrderInfo[]
|
|
|
+ @Link materialNum :number
|
|
|
+
|
|
|
// 选中回调函数
|
|
|
- private onSelect(index: number): void {
|
|
|
- this.selectedIndex = index
|
|
|
- }
|
|
|
|
|
|
build() {
|
|
|
Column() { // 订单列表
|
|
|
List({ space: 8,scroller:this.scrollerForList }) {
|
|
|
- ForEach(this.orders, (item: OrderParams, index) => {
|
|
|
+ ForEach(this.ScanMaterialList, (item: WorkOrderInfo, index) => {
|
|
|
ListItem() {
|
|
|
Row() {
|
|
|
Column(){
|
|
|
// 订单标题(带订单号)
|
|
|
- Text(`${item.orderName}`)
|
|
|
+ Text(`${item.materialName}`)
|
|
|
.fontSize($r('app.float.fontSize_12'))
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.width('100%')
|
|
|
.textAlign(TextAlign.Start)
|
|
|
// 订单详情
|
|
|
Column({ space: 3 }) {
|
|
|
- Text(`型号: ${item.orderNo}`)
|
|
|
+ Text(`型号: ${item.materialCode}`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_8'))
|
|
|
.width('100%')
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- Text(`序列号: ${item.date}`)
|
|
|
+ Text(`序列号: ${item.batchNo}`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_8'))
|
|
|
.width('100%')
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- Text(`所属订单: ${item.date}`)
|
|
|
- .fontColor($r('app.color.FFFFFF'))
|
|
|
- .fontSize($r('app.float.fontSize_8'))
|
|
|
- .width('100%')
|
|
|
- .fontWeight(FontWeight.Lighter)
|
|
|
- .textAlign(TextAlign.Start)
|
|
|
- Text(`数量: ${item.date}`)
|
|
|
+ // Text(`所属订单: ${item.date}`)
|
|
|
+ // .fontColor($r('app.color.FFFFFF'))
|
|
|
+ // .fontSize($r('app.float.fontSize_8'))
|
|
|
+ // .width('100%')
|
|
|
+ // .fontWeight(FontWeight.Lighter)
|
|
|
+ // .textAlign(TextAlign.Start)
|
|
|
+ Text(`数量: ${item.num}`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_8'))
|
|
|
.width('100%')
|
|
@@ -589,8 +603,8 @@ export struct MaterialListComponent {
|
|
|
.height($r('app.float.virtualSize_23'))
|
|
|
.fillColor($r('app.color.FF453A'))
|
|
|
.onClick(()=>{
|
|
|
- this.orders.splice(index, 1);
|
|
|
-
|
|
|
+ this.ScanMaterialList.splice(index, 1);
|
|
|
+ this.materialNum--
|
|
|
})
|
|
|
}.width('10%')
|
|
|
}
|