|
@@ -1,4 +1,4 @@
|
|
|
-import {DemandMaterial,OrderParams,MaterialItem,MaterialBox,EmptyBox} from "../params/OrderMaterialsStorageParams"
|
|
|
+import {MaterialBox,EmptyBox} from "../params/OrderMaterialsStorageParams"
|
|
|
import WorkOrderInfo from '../viewmodel/wms/WorkOrderInfo'
|
|
|
import WorkOrderMaterialInfo from "../viewmodel/wms/WorkOrderMaterialInfo"
|
|
|
import WmsRequest from '../common/util/request/WmsRequest'
|
|
@@ -8,9 +8,13 @@ import MaterialInfo from '../viewmodel/wms/MaterialInfo'
|
|
|
|
|
|
@Component
|
|
|
export struct ProcessFlow {
|
|
|
+ //当前步骤
|
|
|
@Prop currentStep: number =0
|
|
|
+ //第一步标题
|
|
|
@Prop firstStepTitle: string = ''
|
|
|
+ //第二步标题
|
|
|
@Prop secondStepTitle: string = ''
|
|
|
+ //第三步标题
|
|
|
@Prop thirdStepTitle: string = ''
|
|
|
build() {
|
|
|
Row() {
|
|
@@ -102,10 +106,14 @@ export struct ProcessFlow {
|
|
|
@Component
|
|
|
export struct OrderListComponent {
|
|
|
private scrollerForList: Scroller = new Scroller()
|
|
|
+ //工单
|
|
|
@Prop workOrders: WorkOrderInfo[] = []
|
|
|
+ //当前选择的工单
|
|
|
@Link selectWorkOrder: WorkOrderInfo
|
|
|
+ //当前工单对应的物料清单
|
|
|
@Link materialData:WorkOrderMaterialInfo[]
|
|
|
- @State selectedIndex: number = -1 // 添加选中索引状态
|
|
|
+ // 添加选中索引
|
|
|
+ @State selectedIndex: number = -1
|
|
|
|
|
|
queryDemandMaterial=async(workOrderCode:string)=>{
|
|
|
this.materialData = await WmsRequest.post('/api/v1/wms/workOrderMaterial/list', {
|
|
@@ -180,7 +188,7 @@ export struct OrderListComponent {
|
|
|
|
|
|
@Component
|
|
|
export struct SingleOrder {
|
|
|
-
|
|
|
+ //选中的工单
|
|
|
@Prop selectWorkOrder: WorkOrderInfo = {}
|
|
|
build() {
|
|
|
Column() {
|
|
@@ -241,25 +249,27 @@ export struct BoxGrid {
|
|
|
// 拆分两个独立的状态变量
|
|
|
@State selectedMaterialIndex: number = -1 // 物料箱选中索引
|
|
|
@State selectedEmptyIndex: number = -1 // 空箱选中索引
|
|
|
- @Link isQueryMaterial : boolean
|
|
|
- @Link selectedMaterialBox : MaterialBoxInfo
|
|
|
- @Prop isQueryEmpty:boolean =true
|
|
|
+ @Link isQueryMaterial : boolean //是否查询物料
|
|
|
+ @Link selectedMaterialBox : MaterialBoxInfo //选中的料箱
|
|
|
+ @Prop isQueryEmpty:boolean =true //是否查询空箱
|
|
|
|
|
|
- // 独立的选择回调
|
|
|
+ //选择料箱
|
|
|
private onSelectMaterial(index: number) {
|
|
|
this.selectedMaterialIndex =
|
|
|
(this.selectedMaterialIndex === index) ? -1 : index
|
|
|
this.selectedEmptyIndex = -1
|
|
|
}
|
|
|
|
|
|
+ //选择空箱
|
|
|
private onSelectEmpty(index: number) {
|
|
|
this.selectedEmptyIndex =
|
|
|
(this.selectedEmptyIndex === index) ? -1 : index
|
|
|
this.selectedMaterialIndex = -1
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ //查询到的所有物料箱
|
|
|
@Link materialBoxes: MaterialBoxInfo[] ;
|
|
|
+ //查询到的所有空箱
|
|
|
@Link emptyBoxes: MaterialBoxInfo[]
|
|
|
build() {
|
|
|
Column() {
|
|
@@ -313,7 +323,6 @@ export struct BoxGrid {
|
|
|
.justifyContent(FlexAlign.Start)
|
|
|
.alignItems(HorizontalAlign.Start)
|
|
|
}
|
|
|
- //.margin({ top: 6 })
|
|
|
.alignItems(HorizontalAlign.Start)
|
|
|
}
|
|
|
.backgroundColor(index === this.selectedMaterialIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF')) // 选中状态加深
|
|
@@ -327,16 +336,14 @@ export struct BoxGrid {
|
|
|
.onClick(() => {
|
|
|
this.onSelectMaterial(index)
|
|
|
this.selectedMaterialBox = box
|
|
|
- //this.selectedMaterialBox = box.id
|
|
|
})
|
|
|
|
|
|
})
|
|
|
}
|
|
|
.columnsTemplate('1fr 1fr 1fr')
|
|
|
- // .rowsTemplate('1fr 1fr')
|
|
|
- .columnsGap(10) // 移除网格内部列间距
|
|
|
- .rowsGap(10) // 移除网格内部行间距
|
|
|
- .width('100%') // 确保填满父容器
|
|
|
+ .columnsGap(10)
|
|
|
+ .rowsGap(10)
|
|
|
+ .width('100%')
|
|
|
.height(this.isQueryEmpty?'48%':'96%')
|
|
|
.padding(10)
|
|
|
|
|
@@ -344,8 +351,6 @@ export struct BoxGrid {
|
|
|
.strokeWidth(1)
|
|
|
.color($r('app.color.15FFFFFF'))
|
|
|
.margin({top:'1%'})
|
|
|
- //.margin({top:'2%'})
|
|
|
-
|
|
|
}
|
|
|
Grid(this.scrollerEmpty) {
|
|
|
ForEach(this.emptyBoxes, (box: MaterialBoxInfo, index) => {
|
|
@@ -385,8 +390,6 @@ export struct BoxGrid {
|
|
|
.objectFit(ImageFit.Contain)
|
|
|
}.width('60%')
|
|
|
}
|
|
|
- //.margin({ top: 6 })
|
|
|
-
|
|
|
}
|
|
|
.backgroundColor(index === this.selectedEmptyIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF')) // 选中状态加深
|
|
|
.borderRadius($r('app.float.virtualSize_24'))
|
|
@@ -405,108 +408,20 @@ export struct BoxGrid {
|
|
|
}
|
|
|
.columnsTemplate('1fr 1fr 1fr')
|
|
|
|
|
|
- .columnsGap(10) // 移除网格内部列间距
|
|
|
- .rowsGap(10) // 移除网格内部行间距
|
|
|
- .width('100%') // 确保填满父容器
|
|
|
+ .columnsGap(10)
|
|
|
+ .rowsGap(10)
|
|
|
+ .width('100%')
|
|
|
.height(this.isQueryMaterial?'48%':'96%')
|
|
|
.padding(10)
|
|
|
.margin({top:'1%'})
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-@Component
|
|
|
-export struct MaterialBoxGrid {
|
|
|
- private scrollerMaterial: Scroller = new Scroller()
|
|
|
-
|
|
|
- @State selectedMaterialIndex: number = -1 // 物料箱选中索引
|
|
|
-
|
|
|
- private onSelectMaterial(index: number) {
|
|
|
- this.selectedMaterialIndex = index
|
|
|
- }
|
|
|
-
|
|
|
- @Prop materialBoxes: MaterialBox[] = [];
|
|
|
- @Prop emptyBoxes: EmptyBox[] = [];
|
|
|
- build() {
|
|
|
- Column() {
|
|
|
- Grid(this.scrollerMaterial) {
|
|
|
- ForEach(this.materialBoxes, (box: MaterialBox, index) => {
|
|
|
- GridItem() {
|
|
|
- Column() {
|
|
|
- // 订单标题(带订单号)
|
|
|
- Text(`${box.name}`)
|
|
|
- .fontSize($r('app.float.fontSize_30'))
|
|
|
- .fontColor($r('app.color.FFFFFF'))
|
|
|
- .width('100%')
|
|
|
- .textAlign(TextAlign.Start)
|
|
|
- .margin({ bottom: '2%',left:'2%' })
|
|
|
- // 订单详情
|
|
|
- Column({ space: 3 }) {
|
|
|
- Text(`料箱编号: ${box.id}`)
|
|
|
- .fontColor($r('app.color.FFFFFF'))
|
|
|
- .fontWeight(FontWeight.Lighter)
|
|
|
- .fontSize($r('app.float.fontSize_16'))
|
|
|
- .textAlign(TextAlign.Start)
|
|
|
- Text(`料箱类型: ${box.boxType}`)
|
|
|
- .fontColor($r('app.color.FFFFFF'))
|
|
|
- .fontSize($r('app.float.fontSize_16'))
|
|
|
- .fontWeight(FontWeight.Lighter)
|
|
|
- .textAlign(TextAlign.Start)
|
|
|
- Text(`所属订单: ${box.order}`)
|
|
|
- .fontColor($r('app.color.FFFFFF'))
|
|
|
- .fontWeight(FontWeight.Lighter)
|
|
|
- .fontSize($r('app.float.fontSize_16'))
|
|
|
- .textAlign(TextAlign.Start)
|
|
|
- Text(`数量: ${box.boxNumber}`)
|
|
|
- .fontColor($r('app.color.FFFFFF'))
|
|
|
- .fontSize($r('app.float.fontSize_16'))
|
|
|
- .fontWeight(FontWeight.Lighter)
|
|
|
- .textAlign(TextAlign.Start)
|
|
|
- Text(`位置: ${box.position}`)
|
|
|
- .fontColor($r('app.color.FFFFFF'))
|
|
|
- .fontSize($r('app.float.fontSize_16'))
|
|
|
- .textAlign(TextAlign.Start)
|
|
|
- .fontWeight(FontWeight.Lighter)
|
|
|
- }
|
|
|
- .width('100%')
|
|
|
- .margin({left:'2%'})
|
|
|
- .justifyContent(FlexAlign.Start)
|
|
|
- .alignItems(HorizontalAlign.Start)
|
|
|
- }
|
|
|
- //.margin({ top: 6 })
|
|
|
- .alignItems(HorizontalAlign.Start)
|
|
|
- }
|
|
|
- .backgroundColor(index === this.selectedMaterialIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF')) // 选中状态加深
|
|
|
- .borderRadius($r('app.float.virtualSize_24'))
|
|
|
- .padding(8)
|
|
|
- .border({
|
|
|
- width: 2,
|
|
|
- color: index === this.selectedMaterialIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF')
|
|
|
- })
|
|
|
- .onClick(() => {
|
|
|
- this.onSelectMaterial(index)
|
|
|
- })
|
|
|
-
|
|
|
- })
|
|
|
- }
|
|
|
- .columnsTemplate('1fr 1fr 1fr')
|
|
|
- // .rowsTemplate('1fr 1fr')
|
|
|
- .columnsGap(10) // 移除网格内部列间距
|
|
|
- .rowsGap(10) // 移除网格内部行间距
|
|
|
- .width('100%') // 确保填满父容器
|
|
|
- .height('97%')
|
|
|
- .padding(10)
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Component
|
|
|
export struct MaterialList {
|
|
|
private scrollerForList: Scroller = new Scroller()
|
|
|
+ //物料列表
|
|
|
@Prop MaterialData: WorkOrderMaterialInfo[] = []
|
|
|
build() {
|
|
|
Column() {
|
|
@@ -556,29 +471,24 @@ export struct MaterialList {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+//根据扫码输入查询的物料表
|
|
|
@Component
|
|
|
export struct MaterialListComponent {
|
|
|
private scrollerForList: Scroller = new Scroller()
|
|
|
- @Link scanMaterialList: MaterialInfo[]
|
|
|
- @Link materialNum :number
|
|
|
-
|
|
|
- // 选中回调函数
|
|
|
-
|
|
|
+ @Link scanMaterialList: MaterialInfo[] //扫码物料表
|
|
|
+ @Link materialNum :number //物料数量
|
|
|
build() {
|
|
|
- Column() { // 订单列表
|
|
|
+ Column() {
|
|
|
List({ space: 8,scroller:this.scrollerForList }) {
|
|
|
ForEach(this.scanMaterialList, (item: MaterialInfo, index) => {
|
|
|
ListItem() {
|
|
|
Row() {
|
|
|
Column(){
|
|
|
- // 订单标题(带订单号)
|
|
|
Text(`${item.materialName}`)
|
|
|
.fontSize($r('app.float.fontSize_30'))
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.width('100%')
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- // 订单详情
|
|
|
Column({ space: 3 }) {
|
|
|
Text(`型号: ${item.materialCode}`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
@@ -592,12 +502,6 @@ export struct MaterialListComponent {
|
|
|
.width('100%')
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- // Text(`所属订单: ${item.date}`)
|
|
|
- // .fontColor($r('app.color.FFFFFF'))
|
|
|
- // .fontSize($r('app.float.fontSize_16'))
|
|
|
- // .width('100%')
|
|
|
- // .fontWeight(FontWeight.Lighter)
|
|
|
- // .textAlign(TextAlign.Start)
|
|
|
Text(`数量: ${item.num}${item.unitDictLabel}`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
@@ -622,7 +526,6 @@ export struct MaterialListComponent {
|
|
|
.backgroundColor($r('app.color.20FFFFFF')) // 选中状态加深
|
|
|
.borderRadius($r('app.float.virtualSize_24'))
|
|
|
.padding(13)
|
|
|
- //.border({width:2,color:index === this.selectedIndex ? $r('app.color.2030D158'):$r('app.color.20FFFFFF')})
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -634,42 +537,7 @@ export struct MaterialListComponent {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-@Component
|
|
|
-export struct MaterialButton {
|
|
|
- @State scaleValue : number = 1
|
|
|
- @Prop icon: Resource = $r('app.media.rgv_turn_off')
|
|
|
- onButtonClick: () => void = () => {}
|
|
|
- build() {
|
|
|
- Row() {
|
|
|
- Button({ type: ButtonType.Normal }) {
|
|
|
- Image(this.icon)
|
|
|
- .width('50%')
|
|
|
- .height('50%')
|
|
|
- .objectFit(ImageFit.Contain)
|
|
|
- .fillColor($r('app.color.FFFFFF'))
|
|
|
- }
|
|
|
- .width('100%')
|
|
|
- .height('100%')
|
|
|
- .backgroundColor($r('app.color.20FFFFFF'))
|
|
|
- .borderRadius($r('app.float.virtualSize_16'))
|
|
|
- .scale({ x: this.scaleValue, y: this.scaleValue })
|
|
|
- .animation({
|
|
|
- duration: 200,
|
|
|
- curve: Curve.Linear // 弹性曲线更生动
|
|
|
- })
|
|
|
- .onClick(() => {
|
|
|
- this.scaleValue = 0.9; // 点击时缩小
|
|
|
- setTimeout(() => {
|
|
|
- this.scaleValue = 1; // 0.2秒后恢复
|
|
|
- }, 200);
|
|
|
- if (this.onButtonClick) {
|
|
|
- this.onButtonClick()
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
+//提示框
|
|
|
@CustomDialog
|
|
|
export struct RemindDialog {
|
|
|
controller: CustomDialogController
|
|
@@ -688,7 +556,7 @@ export struct RemindDialog {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+//确认框
|
|
|
@CustomDialog
|
|
|
export struct CommonConfirmDialog {
|
|
|
@State title: string = '提示'
|