|
@@ -45,8 +45,8 @@ export struct CompleteSet {
|
|
|
@State private boxMaterials: Array<MaterialInformationModel> = []
|
|
|
//取出料箱
|
|
|
@State private outBox: Array<outBoxClass> = []
|
|
|
- //物料位置
|
|
|
- @State private Mposition: Array<Materialpositionclass> = []
|
|
|
+ //齐套物料信息
|
|
|
+ @State private Mposition: Array<MaterialInformationModel> = []
|
|
|
//查询物料存放的所有位置
|
|
|
@State materialPositionArray: Array<Materialpositionclass> = []
|
|
|
//选中取出的物料位置
|
|
@@ -251,6 +251,7 @@ export struct CompleteSet {
|
|
|
//
|
|
|
// }
|
|
|
this.materialArray = res.records ?? []
|
|
|
+ this.textController.stopEditing()
|
|
|
}
|
|
|
}),
|
|
|
alignment: DialogAlignment.Center,
|
|
@@ -284,38 +285,23 @@ export struct CompleteSet {
|
|
|
return res
|
|
|
|
|
|
}
|
|
|
- /////请求物料位置
|
|
|
- Materialposition = async (): Promise<Materialpositionclass[]> => {
|
|
|
-
|
|
|
- let res: Materialpositionclass[] = await StorageRequest.post("/api/v1/stock/list", {
|
|
|
- materialName: this.materialName
|
|
|
+ /////请求齐套物料信息
|
|
|
+ Materialposition = async (item: MaterialInfo) => {
|
|
|
+ let res: MaterialInformationModel[] = await StorageRequest.post("/api/v1/process/vehicleMaterial/list", {
|
|
|
+ materialName: item.materialName,
|
|
|
+ materialCode: item.materialCode,
|
|
|
+ operationId: this.selectProcess.operationId
|
|
|
} as RequestParamModel)
|
|
|
- console.log('testTag', 'aaaaaaaa1' + JSON.stringify(res));
|
|
|
+ this.materialName = item?.materialName ?? ""
|
|
|
+ console.log("xxxxxxxxxxxxxxxxxx", JSON.stringify(item), JSON.stringify(res))
|
|
|
this.Mposition = res
|
|
|
- return res
|
|
|
+ this.materialLocationController.open()
|
|
|
}
|
|
|
- //物料位置
|
|
|
+ //齐套的物料信息
|
|
|
materialLocationController: CustomDialogController = new CustomDialogController({
|
|
|
builder: MaterialLocationDialog({
|
|
|
- orderId: this.orderId,
|
|
|
- materialGridStatus: this.materialGridStatus,
|
|
|
- outBox: this.outBox,
|
|
|
- boxMaterials: this.boxMaterials,
|
|
|
- Mposition: this.Mposition,
|
|
|
materialName: this.materialName,
|
|
|
- materialPositionArray: this.materialPositionArray,
|
|
|
- materialPosition: this.materialPosition,
|
|
|
- // confirm: async ()=>{
|
|
|
- // if (this.materialPosition?.vehicleCode && JSON.stringify(this.materialPosition) != '{}') {
|
|
|
- // let params: RequestParamModel = new RequestParamModel()
|
|
|
- // params.vehicleCode = this.materialPosition?.vehicleCode!
|
|
|
- // this.boxMaterials = await this.queryStockList(params)
|
|
|
- // console.log('testTag', JSON.stringify(this.boxMaterials))
|
|
|
- // // todo 需要根据硬件返回数据判断当前出库口的状态
|
|
|
- // this.drawerPositionStatus = 1
|
|
|
- // this.materialGridStatus = 1
|
|
|
- // }
|
|
|
- // }
|
|
|
+ boxMaterials: this.Mposition,
|
|
|
}),
|
|
|
alignment: DialogAlignment.Center,
|
|
|
customStyle: true,
|
|
@@ -537,7 +523,9 @@ export struct CompleteSet {
|
|
|
.width(px2vp(608))
|
|
|
.height(px2vp(900))
|
|
|
.borderRadius($r('app.float.borderRadius_16'))
|
|
|
- } else if (this.orderMaterialSwitch === 2) {
|
|
|
+ }
|
|
|
+ // 已经选择了工序后 展示的列表和上面的title
|
|
|
+ else if (this.orderMaterialSwitch === 2) {
|
|
|
Column() {
|
|
|
Row() {
|
|
|
Image($r('app.media.circular_return'))
|
|
@@ -644,20 +632,14 @@ export struct CompleteSet {
|
|
|
.height('25%')
|
|
|
.width(px2vp(608))
|
|
|
.onClick(async () => {
|
|
|
- this.materialName = item.materialName!
|
|
|
- this.Materialposition().then((res: Materialpositionclass[]) => {
|
|
|
- console.log('testTag', 'result cccccc' + JSON.stringify(res))
|
|
|
- if (res && res.length > 0) {
|
|
|
- this.Mposition = res
|
|
|
- }
|
|
|
- })
|
|
|
- let params: RequestParamModel = new RequestParamModel()
|
|
|
- params.materialNo = item.materialCode!
|
|
|
- this.materialPositionArray = await this.queryStockList(params)
|
|
|
- this.materialLocationController.open()
|
|
|
+
|
|
|
+
|
|
|
+ this.Materialposition(item)
|
|
|
+
|
|
|
+
|
|
|
})
|
|
|
- .backgroundColor(this.onclick === index ?
|
|
|
- $r('app.color.robot_set_card_blue') : $r('app.color.robot_set_card_white'))
|
|
|
+ .backgroundColor(item.completeNum! >= item.totalMaterial! ?
|
|
|
+ $r('app.color.green_100') : $r('app.color.robot_set_card_white'))
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -683,6 +665,8 @@ export struct CompleteSet {
|
|
|
.height(px2vp(900))
|
|
|
.borderRadius($r('app.float.borderRadius_16'))
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
Column() {
|
|
|
Stack() {
|
|
|
Image(this.drawerPositionStatus === 1 && this.materialGridStatus === 0 ? $r('app.media.drawer_inside') : (this.drawerPositionStatus === 2 && this.materialGridStatus === 0 ? $r('app.media.drawer_outside') :
|
|
@@ -914,12 +898,20 @@ export struct CompleteSet {
|
|
|
Column() {
|
|
|
Column() {
|
|
|
Row().height('23%')
|
|
|
- Text(item.materialName ? item.materialName! : '')
|
|
|
+ Text(item.materialName)
|
|
|
.fontSize($r('app.float.fontSize_24'))
|
|
|
.fontColor($r('app.color.general_font_color'))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.opacity($r('app.float.general_font_opacity'))
|
|
|
- Text(item.materialCode ? item.materialCode : '')
|
|
|
+ Text(item.batchNo)
|
|
|
+ .fontSize($r('app.float.fontSize_20'))
|
|
|
+ .fontColor($r('app.color.process_nameplate_grey_color'))
|
|
|
+ .fontWeight(FontWeight.Medium)
|
|
|
+ Text(item.materialCode)
|
|
|
+ .fontSize($r('app.float.fontSize_20'))
|
|
|
+ .fontColor($r('app.color.process_nameplate_grey_color'))
|
|
|
+ .fontWeight(FontWeight.Medium)
|
|
|
+ Text(item.spec)
|
|
|
.fontSize($r('app.float.fontSize_20'))
|
|
|
.fontColor($r('app.color.process_nameplate_grey_color'))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
@@ -936,8 +928,9 @@ export struct CompleteSet {
|
|
|
.fontWeight(FontWeight.Bold)
|
|
|
.fontColor($r('app.color.general_font_color'))// .opacity($r('app.float.general_font_opacity'))
|
|
|
.height(30)
|
|
|
- .width(150)
|
|
|
+ .width(120)
|
|
|
.type(InputType.Number)
|
|
|
+ .defaultFocus(false)
|
|
|
.textAlign(TextAlign.Start)
|
|
|
.borderRadius(0)
|
|
|
.border({ width: 0.4 })
|
|
@@ -950,13 +943,14 @@ export struct CompleteSet {
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
}
|
|
|
.width('90%')
|
|
|
+ .justifyContent(FlexAlign.End)
|
|
|
|
|
|
- Blank()
|
|
|
- Row() {
|
|
|
- Image($r('app.media.subscript_space'))
|
|
|
- .height($r('app.float.card_subscript_new_size'))
|
|
|
- .width($r('app.float.card_subscript_new_size'))
|
|
|
- }
|
|
|
+ // Blank()
|
|
|
+ // Row() {
|
|
|
+ // Image($r('app.media.subscript_space'))
|
|
|
+ // .height($r('app.float.card_subscript_new_size'))
|
|
|
+ // .width($r('app.float.card_subscript_new_size'))
|
|
|
+ // }
|
|
|
.alignItems(VerticalAlign.Bottom)
|
|
|
.justifyContent(FlexAlign.End)
|
|
|
.width('100%')
|
|
@@ -971,7 +965,7 @@ export struct CompleteSet {
|
|
|
}
|
|
|
.width(30)
|
|
|
.height(30)
|
|
|
- .position({ x: '90%', y: 8 })
|
|
|
+ .position({ x: '90%', y: 5 })
|
|
|
.alignItems(VerticalAlign.Center)
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
.onClick(() => {
|
|
@@ -1114,59 +1108,10 @@ struct SelectProcessDialog {
|
|
|
// 物料位置(物料在哪些料箱里面)
|
|
|
@CustomDialog
|
|
|
struct MaterialLocationDialog {
|
|
|
- @Link orderId: string
|
|
|
- @Link materialGridStatus: number
|
|
|
- @Link outBox: outBoxClass[]
|
|
|
- @Link boxMaterials: MaterialInformationModel[]
|
|
|
- @State selectMaterial: number = -1
|
|
|
- @Link Mposition: Materialpositionclass[]
|
|
|
- @Link materialPositionArray: Materialpositionclass[]
|
|
|
- @Link materialPosition: Materialpositionclass
|
|
|
@Link materialName: string
|
|
|
- @State houseNo: string = ''
|
|
|
- @State vehicleNo: string = ''
|
|
|
- @State private controlList: Array<controlClass> = []
|
|
|
+ @Link boxMaterials: MaterialInformationModel[]
|
|
|
Controller: CustomDialogController
|
|
|
scroller: Scroller = new Scroller()
|
|
|
- //后端料箱出库
|
|
|
- RemoveMaterialBox = async (): Promise<outBoxClass[]> => {
|
|
|
- let res: outBoxClass[] = await StorageRequest.post("/api/v1/wmsOrder/outBox", {
|
|
|
- houseNo: this.houseNo,
|
|
|
- vehicleNo: this.vehicleNo
|
|
|
- } as RequestParamModel)
|
|
|
- console.log('testTag', 'aaaaaaaa1' + JSON.stringify(res));
|
|
|
- this.outBox = res
|
|
|
- return res
|
|
|
- }
|
|
|
- //后端控制系统料箱出库
|
|
|
- controlHttp = async (): Promise<controlClass[]> => {
|
|
|
- let res: controlClass[] = await StorageRequest.post("/api/v1/wms/common/receiveResult", {
|
|
|
- orderId: this.orderId,
|
|
|
- state: 1
|
|
|
- } as RequestParamModel)
|
|
|
- console.log('testTag', 'aaaaaaaa1' + JSON.stringify(res));
|
|
|
- this.controlList = res
|
|
|
- return res
|
|
|
- }
|
|
|
- //todo 这里删掉,应该是出库位置自动识别rfid读取料箱里面物料信息
|
|
|
- //查询取出的料箱里面的物料信息
|
|
|
- boxMaterialHttp = async (): Promise<MaterialInformationModel[]> => {
|
|
|
- let res: MaterialInformationModel[] = await StorageRequest.post("/api/v1/stock/list", {
|
|
|
- vehicleCode: this.vehicleNo
|
|
|
- } as RequestParamModel)
|
|
|
- console.log('testTag', 'aaaaaaaa2' + JSON.stringify(res));
|
|
|
- this.boxMaterials = res
|
|
|
- return res
|
|
|
- }
|
|
|
- //硬件请求出库操作
|
|
|
- outboundHttp = async (): Promise<outboundClass> => {
|
|
|
- let res: outboundClass = await StorageRequest.post("/api/v1/wcs/stockout", {
|
|
|
- boxNo: this.vehicleNo,
|
|
|
- position: "stat3"
|
|
|
- } as RequestParamModel)
|
|
|
- console.log('testTag1', '----------' + JSON.stringify(res));
|
|
|
- return res
|
|
|
- }
|
|
|
|
|
|
build() {
|
|
|
Stack() {
|
|
@@ -1210,34 +1155,46 @@ struct MaterialLocationDialog {
|
|
|
.padding({ top: 8 })
|
|
|
|
|
|
Grid(this.scroller) {
|
|
|
- ForEach(this.Mposition, (item: Materialpositionclass, index: number) => {
|
|
|
+ ForEach(this.boxMaterials, (item: MaterialInformationModel, index: number) => {
|
|
|
GridItem() {
|
|
|
Row() {
|
|
|
Column() {
|
|
|
- Text(item?.locationNo && item.locationNo.length > 0 ? getMaterialPositionStr(item.locationNo) : '')
|
|
|
+ Text(item.materialName)
|
|
|
.fontSize($r('app.float.fontSize_24'))
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
- .fontColor($r('app.color.black_90'))
|
|
|
+ .fontColor($r('app.color.black_60'))
|
|
|
.height('20%')
|
|
|
.width('100%')
|
|
|
- Text(item.materialName)
|
|
|
+ Text(item.materialCode)
|
|
|
+ .fontSize($r('app.float.fontSize_24'))
|
|
|
+ .fontWeight(FontWeight.Regular)
|
|
|
+ .fontColor($r('app.color.black_60'))
|
|
|
+ .height('20%')
|
|
|
+ .width('100%')
|
|
|
+ Text(item.spec)
|
|
|
+ .fontSize($r('app.float.fontSize_24'))
|
|
|
+ .fontWeight(FontWeight.Regular)
|
|
|
+ .fontColor($r('app.color.black_60'))
|
|
|
+ .height('20%')
|
|
|
+ .width('100%')
|
|
|
+ Text(item.batchNo)
|
|
|
.fontSize($r('app.float.fontSize_24'))
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
.fontColor($r('app.color.black_60'))
|
|
|
.height('20%')
|
|
|
.width('100%')
|
|
|
- Blank()
|
|
|
Row() {
|
|
|
Text(item.num?.toString())
|
|
|
.fontSize($r('app.float.fontSize_38'))
|
|
|
.fontWeight(FontWeight.Bold)
|
|
|
.fontColor($r('app.color.black_90'))
|
|
|
- Text(item.unit)
|
|
|
+ Text(item.unit ?? item.unitDictLabel)
|
|
|
.fontSize($r('app.float.fontSize_24'))
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
.fontColor($r('app.color.black_60'))
|
|
|
}
|
|
|
- .height('50%')
|
|
|
+ .margin({ top: 5 })
|
|
|
+
|
|
|
}
|
|
|
.width('100%')
|
|
|
.padding(10)
|
|
@@ -1250,47 +1207,14 @@ struct MaterialLocationDialog {
|
|
|
.borderRadius(10)
|
|
|
.height('25%')
|
|
|
.width('100%')
|
|
|
- .backgroundColor(this.selectMaterial === index ? $r('app.color.robot_set_card_blue') : $r('app.color.robot_set_card_white'))
|
|
|
- .onClick(async () => {
|
|
|
- this.houseNo = item.houseNo!
|
|
|
- this.vehicleNo = item.vehicleCode!
|
|
|
- this.selectMaterial = index
|
|
|
- this.materialPosition = item
|
|
|
- console.log("testTag1" + '----------++' + this.vehicleNo)
|
|
|
- //先查询点击的料箱物流信息用于展示在回库下面
|
|
|
- this.boxMaterialHttp().then((res: MaterialInformationModel[]) => {
|
|
|
- console.log('testTag', 'result cccccc22' + JSON.stringify(res))
|
|
|
- if (res && res.length > 0) {
|
|
|
- this.boxMaterials = res
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- //执行硬件出库
|
|
|
- this.outboundHttp().then((res: outboundClass) => {
|
|
|
- console.log('testTag1', '-------result cccccc11' + JSON.stringify(res))
|
|
|
-
|
|
|
- })
|
|
|
+ .backgroundColor(Color.White)
|
|
|
|
|
|
- // todo 打开执行出库操作后端
|
|
|
- // this.RemoveMaterialBox().then((res :outBoxClass[]) => {
|
|
|
- // console.log('testTag', 'result cccccc11'+JSON.stringify(res))
|
|
|
- // if (res && res.length > 0) {
|
|
|
- // this.outBox = res
|
|
|
- // }
|
|
|
- // })
|
|
|
- //控制终端
|
|
|
- this.controlHttp().then((res: controlClass[]) => {
|
|
|
- console.log('testTag1', '-------result cccccc11' + JSON.stringify(res))
|
|
|
- })
|
|
|
-
|
|
|
- this.Controller?.close()
|
|
|
- })
|
|
|
}
|
|
|
.padding({ left: 5 })
|
|
|
})
|
|
|
}
|
|
|
.padding(10)
|
|
|
- .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr')
|
|
|
+ .columnsTemplate('1fr 1fr 1fr')
|
|
|
.columnsGap(10)
|
|
|
.rowsGap(10)
|
|
|
.width('100%')
|