|
@@ -15,6 +15,9 @@ import WmsRequest from '../common/util/request/WmsRequest'
|
|
|
import promptAction from '@ohos.promptAction'
|
|
|
import RequestParamModel from '../viewmodel/wms/RequestParamModel'
|
|
|
import CommonConstants from '../common/constants/CommonConstants'
|
|
|
+import RobotErrorHandleRequest from '../common/util/request/RobotErrorHandleRequest'
|
|
|
+import { ConfirmDialogParams, RgvInfo } from '../params/RobotsParam'
|
|
|
+import { CommonConfirmDialog, ProcessFlow, RemindDialog } from '../component/OrderMaterialsStorageView'
|
|
|
|
|
|
@Entry
|
|
|
@Component
|
|
@@ -27,9 +30,96 @@ struct OperationMaterialKit {
|
|
|
@State selectOperations: OperationInfo[] = []
|
|
|
// 选中工序需求的物料
|
|
|
@State operationItems: OperationItem[] = []
|
|
|
+ // 抽屉称重(根据重量判断抽屉是否有料箱)
|
|
|
+ @StorageLink('materialBoxWeight') materialBoxWeight: number = 0
|
|
|
+ // 抽屉状态
|
|
|
+ @StorageLink('drawerPositionStatus') drawerPositionStatus: number = 1
|
|
|
+ @State reminds: string = '1'
|
|
|
+ commonDialogController: CustomDialogController | null = null;
|
|
|
+
|
|
|
+ remindController: CustomDialogController = new CustomDialogController({
|
|
|
+ builder: RemindDialog({
|
|
|
+ remind: this.reminds,}
|
|
|
+ ),
|
|
|
+ customStyle: true,
|
|
|
+ maskColor: 'rgba(0,0,0,0.6)',
|
|
|
+ //autoCancel:false
|
|
|
+ })
|
|
|
+
|
|
|
+ private showConfirmDialog(params: ConfirmDialogParams) {
|
|
|
+ if (this.commonDialogController) {
|
|
|
+ this.commonDialogController.close()
|
|
|
+ }
|
|
|
+ this.commonDialogController = new CustomDialogController({
|
|
|
+ builder: CommonConfirmDialog({
|
|
|
+ title: params.title || '提示',
|
|
|
+ message: params.message,
|
|
|
+ confirmText: params.confirmText || '确定',
|
|
|
+ cancelText: params.cancelText || '取消',
|
|
|
+ onConfirm: params.onConfirm
|
|
|
+ }),
|
|
|
+ cancel: () => console.log('用户取消操作'),
|
|
|
+ customStyle: true,
|
|
|
+ autoCancel:false,
|
|
|
+ maskColor: 'rgba(0,0,0,0.6)'
|
|
|
+ });
|
|
|
+ this.commonDialogController.open();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 判断小车状态
|
|
|
+ async queryRgvInfo(): Promise<boolean> {
|
|
|
+ let res: RgvInfo = await RobotErrorHandleRequest.get('/api/v1/wcs/rgv/rgv1', {}) as RgvInfo;
|
|
|
+ if (res) {
|
|
|
+ if (res.status != '0' || res.x != res.rx || res.y != res.ry) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true; // 如果条件不满足,返回 true
|
|
|
+ }
|
|
|
+ return false; // 如果 res 为 null 或 undefined,返回 false
|
|
|
+ }
|
|
|
|
|
|
// 空箱出库的方法
|
|
|
callEmptyBoxFun = async () => {
|
|
|
+ //查询小车的状态
|
|
|
+ const rgvStatusNormal = await this.queryRgvInfo()
|
|
|
+ if(!rgvStatusNormal){
|
|
|
+ this.reminds = "小车状态异常或位置错误,请检查后重试"
|
|
|
+ this.remindController.open()
|
|
|
+ setTimeout(() => {
|
|
|
+ this.remindController.close()
|
|
|
+ }, 2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ console.info("ssss"+this.drawerPositionStatus+"as")
|
|
|
+ if(this.drawerPositionStatus == 0)
|
|
|
+ {
|
|
|
+ this.reminds = "抽屉未缩回,请检查后重试"
|
|
|
+ this.remindController.open()
|
|
|
+ setTimeout(() => {
|
|
|
+ this.remindController.close()
|
|
|
+ }, 2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.materialBoxWeight > 0)
|
|
|
+ {
|
|
|
+ this.reminds = "抽屉已有料箱,请检查后重试"
|
|
|
+ this.remindController.open()
|
|
|
+ setTimeout(() => {
|
|
|
+ this.remindController.close()
|
|
|
+ }, 2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ //查询抽屉的状态
|
|
|
+ // this.showConfirmDialog({
|
|
|
+ // title: '料箱出库',
|
|
|
+ // message: `确定要空箱出库吗?`,
|
|
|
+ // onConfirm: ()=> {
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+
|
|
|
let res: VehicleInfo = await WmsRequest.post('/api/v1/stock/queryEmptyBox')
|
|
|
console.log("hhtest", JSON.stringify(res), res?.vehicleNo)
|
|
|
await WmsRequest.post('/api/v1/wmsOrder/outBox', {
|
|
@@ -51,7 +141,7 @@ struct OperationMaterialKit {
|
|
|
TimeAndTitle()
|
|
|
}
|
|
|
.width('100%')
|
|
|
- .height('3.5%')
|
|
|
+ .height('3.4%')
|
|
|
.alignItems(VerticalAlign.Bottom)
|
|
|
.justifyContent(FlexAlign.End)
|
|
|
|
|
@@ -61,10 +151,6 @@ struct OperationMaterialKit {
|
|
|
.height($r('app.float.virtualSize_22_4'))
|
|
|
.width($r('app.float.virtualSize_22_4'))
|
|
|
.fillColor($r('app.color.FFFFFF'))
|
|
|
- .onClick(()=> {
|
|
|
- router.back()
|
|
|
- })
|
|
|
-
|
|
|
Text('工序齐套')
|
|
|
.fontSize($r('app.float.fontSize_12'))
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
@@ -74,86 +160,20 @@ struct OperationMaterialKit {
|
|
|
.height('5.2%')
|
|
|
.alignItems(VerticalAlign.Center)
|
|
|
.justifyContent(FlexAlign.Start)
|
|
|
+ .onClick(()=> {
|
|
|
+ router.back()
|
|
|
+ })
|
|
|
|
|
|
// 当前齐套步骤和操作栏
|
|
|
Row() {
|
|
|
Row().width('41%')
|
|
|
Row() {
|
|
|
- Column({space: 5}) {
|
|
|
- Stack() {
|
|
|
- Circle()
|
|
|
- .width($r('app.float.virtualSize_19_2'))
|
|
|
- .height($r('app.float.virtualSize_19_2'))
|
|
|
- .fill(this.step === 1 ? $r('app.color.0A84FF') : $r('app.color.10FFFFFF'))
|
|
|
- Text('1')
|
|
|
- .fontSize($r('app.float.fontSize_12'))
|
|
|
- .fontColor(this.step === 1 ? $r('app.color.FFFFFF') : $r('app.color.60FFFFFF'))
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- }
|
|
|
- .width($r('app.float.virtualSize_19_2'))
|
|
|
- .height($r('app.float.virtualSize_19_2'))
|
|
|
- Text('选择工序')
|
|
|
- .fontSize($r('app.float.fontSize_6_4'))
|
|
|
- .fontColor(this.step === 1 ? $r('app.color.FFFFFF') : $r('app.color.60FFFFFF'))
|
|
|
- .fontWeight(FontWeight.Regular)
|
|
|
- }
|
|
|
- Divider()
|
|
|
- .vertical(false)
|
|
|
- .strokeWidth(1)
|
|
|
- .layoutWeight(1)
|
|
|
- .height($r('app.float.virtualSize_19_2'))
|
|
|
- .color($r('app.color.15FFFFFF'))
|
|
|
- .margin({
|
|
|
- left: '-3%',
|
|
|
- right: '-3%',// 向左延伸至圆心
|
|
|
- })
|
|
|
- Column({space: 5}) {
|
|
|
- Stack() {
|
|
|
- Circle()
|
|
|
- .width($r('app.float.virtualSize_19_2'))
|
|
|
- .height($r('app.float.virtualSize_19_2'))
|
|
|
- .fill(this.step === 2 ? $r('app.color.0A84FF') : $r('app.color.10FFFFFF'))
|
|
|
- Text('2')
|
|
|
- .fontSize($r('app.float.fontSize_12'))
|
|
|
- .fontColor(this.step === 2 ? $r('app.color.FFFFFF') : $r('app.color.60FFFFFF'))
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- }
|
|
|
- .width($r('app.float.virtualSize_19_2'))
|
|
|
- .height($r('app.float.virtualSize_19_2'))
|
|
|
- Text('齐套装箱')
|
|
|
- .fontSize($r('app.float.fontSize_6_4'))
|
|
|
- .fontColor(this.step === 2 ? $r('app.color.FFFFFF') : $r('app.color.60FFFFFF'))
|
|
|
- .fontWeight(FontWeight.Regular)
|
|
|
- }
|
|
|
- Divider()
|
|
|
- .vertical(false)
|
|
|
- .strokeWidth(1)
|
|
|
- .layoutWeight(1)
|
|
|
- .height($r('app.float.virtualSize_19_2'))
|
|
|
- .color($r('app.color.15FFFFFF'))
|
|
|
- .margin({
|
|
|
- left: '-3%',
|
|
|
- right: '-3%',// 向左延伸至圆心
|
|
|
- //
|
|
|
- })
|
|
|
- Column({space: 5}) {
|
|
|
- Stack() {
|
|
|
- Circle()
|
|
|
- .width($r('app.float.virtualSize_19_2'))
|
|
|
- .height($r('app.float.virtualSize_19_2'))
|
|
|
- .fill(this.step === 3 ? $r('app.color.0A84FF') : $r('app.color.10FFFFFF'))
|
|
|
- Text('3')
|
|
|
- .fontSize($r('app.float.fontSize_12'))
|
|
|
- .fontColor(this.step === 3 ? $r('app.color.FFFFFF') : $r('app.color.60FFFFFF'))
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- }
|
|
|
- .width($r('app.float.virtualSize_19_2'))
|
|
|
- .height($r('app.float.virtualSize_19_2'))
|
|
|
- Text('齐套入库')
|
|
|
- .fontSize($r('app.float.fontSize_6_4'))
|
|
|
- .fontColor(this.step === 3 ? $r('app.color.FFFFFF') : $r('app.color.60FFFFFF'))
|
|
|
- .fontWeight(FontWeight.Regular)
|
|
|
- }
|
|
|
+ ProcessFlow({
|
|
|
+ currentStep: this.step,
|
|
|
+ firstStepTitle: "选择工单",
|
|
|
+ secondStepTitle: "齐套装箱",
|
|
|
+ thirdStepTitle: "齐套入库",
|
|
|
+ })
|
|
|
}
|
|
|
.height('80%')
|
|
|
.width('18%')
|
|
@@ -161,13 +181,11 @@ struct OperationMaterialKit {
|
|
|
.alignItems(VerticalAlign.Top)
|
|
|
|
|
|
Blank()
|
|
|
- Row() {
|
|
|
- NavigationBar()
|
|
|
- }
|
|
|
- .height('80%')
|
|
|
- .width('30%')
|
|
|
+ NavigationBar()
|
|
|
+ .height('80%')
|
|
|
+ .width('23%')
|
|
|
}
|
|
|
- .height('14.2%')
|
|
|
+ .height('13%')
|
|
|
.width('100%')
|
|
|
// 步骤详情
|
|
|
Column() {
|
|
@@ -201,7 +219,7 @@ struct OperationMaterialKit {
|
|
|
.fontColor($r('app.color.0A84FF'))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
}
|
|
|
- .height('85%')
|
|
|
+ .height('67%')
|
|
|
.width('24.1%')
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
.backgroundColor($r('app.color.20FFFFFF'))
|
|
@@ -217,14 +235,16 @@ struct OperationMaterialKit {
|
|
|
.fontColor($r('app.color.0A84FF'))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
}
|
|
|
- .height('85%')
|
|
|
+ .height('67%')
|
|
|
.width('24.1%')
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
.backgroundColor($r('app.color.20FFFFFF'))
|
|
|
.borderRadius($r('app.float.fontSize_6_4'))
|
|
|
.opacity(this.step > 1 ? 1 : 0.3)
|
|
|
.onClick(()=>{
|
|
|
- this.step -= 1
|
|
|
+ if (this.step > 1) {
|
|
|
+ this.step -= 1
|
|
|
+ }
|
|
|
})
|
|
|
Row().width('1.2%')
|
|
|
Row () {
|
|
@@ -233,7 +253,7 @@ struct OperationMaterialKit {
|
|
|
.fontColor($r('app.color.0A84FF'))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
}
|
|
|
- .height('85%')
|
|
|
+ .height('67%')
|
|
|
.width('24.1%')
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
.backgroundColor($r('app.color.20FFFFFF'))
|
|
@@ -249,18 +269,20 @@ struct OperationMaterialKit {
|
|
|
.fontColor($r('app.color.0A84FF'))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
}
|
|
|
- .height('85%')
|
|
|
+ .height('67%')
|
|
|
.width('24.1%')
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
.backgroundColor($r('app.color.20FFFFFF'))
|
|
|
.borderRadius($r('app.float.fontSize_6_4'))
|
|
|
.opacity(this.step < 3 ? 1 : 0.3)
|
|
|
.onClick(()=>{
|
|
|
- this.step += 1
|
|
|
+ if (this.step < 3) {
|
|
|
+ this.step += 1
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
.width('94.8%')
|
|
|
- .height('6.1%')
|
|
|
+ .height('7.4%')
|
|
|
.alignItems(VerticalAlign.Center)
|
|
|
}
|
|
|
.width('100%')
|