Forráskód Böngészése

图纸资料逻辑

hh 1 hete
szülő
commit
4f1b8e4e4e

+ 42 - 2
entry/src/main/ets/pages/ProcessIndex.ets

@@ -35,6 +35,9 @@ import { MultiMediaCollect } from '../view/process/MultiMediaCollect';
 import { BarcodeAssociationDialog } from '../view/BarcodeAssociationDialog';
 import WorkOrderSeq from '../viewmodel/WorkOrderSeq';
 import { USBDeviceManager } from '../common/util/UsbDevice';
+import { InAndOutBoundDialog } from '../view/InAndOutBoundDialog';
+import { LittleMaterialRequestDialog } from '../view/LittleMaterialRequestDialog';
+import { PictureDrawingDialog } from '../view/PictureDrawingDialog';
 
 @Entry
 @Component
@@ -90,7 +93,7 @@ struct ProcessIndex {
   @Provide('currentStationId') @Watch('refreshWorkOrder') currentStationId: string = ''
   @Provide('currentUserName') currentUserName: string =''
   @Provide('currentUserId') currentUserId: number = 0
-  @Provide('bindTaskSeq')bindTaskSeq: BindTaskSeqVO[]=[]
+  @Provide('bindTaskSeq') bindTaskSeq: BindTaskSeqVO[]=[]
   @State reportList:ReportInfo[]=[]
   @State currentReporterIndex:number =0
   @State currentReportNumIndex:number =0
@@ -322,6 +325,24 @@ struct ProcessIndex {
     maskColor: 'rgba(0,0,0,0.8)',  // 黑色遮罩
   })
 
+  // 零星叫料弹窗控制器
+  littleMaterialRequestController: CustomDialogController = new CustomDialogController({
+    builder: LittleMaterialRequestDialog({
+    }),
+    autoCancel: true, // 点击遮罩关闭
+    customStyle: true,
+    alignment:DialogAlignment.Center,
+    maskColor: 'rgba(0,0,0,0.8)',  // 黑色遮罩
+  })
+  // 仓储操作弹窗控制器
+  inAndOutBoundController: CustomDialogController = new CustomDialogController({
+    builder: InAndOutBoundDialog({
+    }),
+    autoCancel: true, // 点击遮罩关闭
+    customStyle: true,
+    alignment:DialogAlignment.Center,
+    maskColor: 'rgba(0,0,0,0.8)',  // 黑色遮罩
+  })
   // 条码关联弹窗控制器
   barcodeAssociationController: CustomDialogController = new CustomDialogController({
     builder: BarcodeAssociationDialog({
@@ -333,15 +354,32 @@ struct ProcessIndex {
     alignment:DialogAlignment.Center,
     maskColor: 'rgba(0,0,0,0.8)',  // 黑色遮罩
   })
+  // 图纸资料弹窗控制器
+  pictureDrawingController: CustomDialogController = new CustomDialogController({
+    builder: PictureDrawingDialog({
+      materialCode: this.selectWorkOder?.materialCode!
+    }),
+    autoCancel: true, // 点击遮罩关闭
+    customStyle: true,
+    alignment:DialogAlignment.Center,
+    maskColor: 'rgba(0,0,0,0.8)',  // 黑色遮罩
+  })
 
   // 辅助功能弹窗控制器
   auxiliaryOperationController: CustomDialogController = new CustomDialogController({
     builder: AuxiliaryOperationDialog({
       workOrderCode: this.selectWorkOder?.workOrderCode!,
       seqList: this.seqList,
+      process: this.process,
+      openLittleMaterialRequestDialog: ()=>{
+        this.littleMaterialRequestController.open()
+      },
       openBarcodeAssociationDialog: ()=>{
         this.barcodeAssociationController.open()
-      }
+      },
+      openInAndOutBoundDialog: ()=>{
+        this.inAndOutBoundController.open()
+      },
     }),
     autoCancel: true, // 点击遮罩关闭
     customStyle: true,
@@ -406,9 +444,11 @@ struct ProcessIndex {
       console.error('hhtest', `MQTT error: ${JSON.stringify(err)}`);
     }
   }
+
   connectUsbDevice=async()=>{
     return USBDeviceManager.getInstance();
   }
+
   async aboutToAppear() {
     // todo 删除
     let token:string = await ProcessRequest.post('api/auth/aioLogin', {

+ 99 - 5
entry/src/main/ets/view/AuxiliaryOperationDialog.ets

@@ -1,14 +1,16 @@
 import ProcessRequest from '../common/util/request/ProcessRequest'
 import RequestParamModel from '../viewmodel/RequestParamModel'
 import WorkOrderSeq from '../viewmodel/WorkOrderSeq'
-import { BarcodeAssociationDialog } from './BarcodeAssociationDialog'
 import promptAction from '@ohos.promptAction'
+import ProcessInfo from '../viewmodel/process/ProcessInfo'
 
 @CustomDialog
 export struct AuxiliaryOperationDialog {
   // 工单编号
   workOrderCode: string = ''
   @Link @Watch('getBarcodeStatistics') seqList: WorkOrderSeq[]
+  // 扫码开工后的生产过程信息
+  @Link process: ProcessInfo
   controller: CustomDialogController
 
   // 提前下线数量
@@ -17,8 +19,18 @@ export struct AuxiliaryOperationDialog {
   @State outsourcedAuditNum: number = 120
   // 条码关联中的统计
   @State barcodeStatistics: string = ''
+
+  //当前用户id
+  @Consume('currentUserId') currentUserId: number
+
+  // 打开零星叫料弹窗
+  openLittleMaterialRequestDialog?: () => void = () => {}
+  // 打开仓储操作弹窗
+  openInAndOutBoundDialog?: () => void = () => {}
   // 打开条码关联弹窗
   openBarcodeAssociationDialog?: () => void = () => {}
+  // 打开图纸资料弹窗
+  openPictureDrawingDialog?: () => void = () => {}
 
   // 获取条码关联中的统计
   getBarcodeStatistics() {
@@ -71,6 +83,7 @@ export struct AuxiliaryOperationDialog {
         Row({space: 12}) {
           // 左侧常用功能 和 流程相关操作
           Column() {
+            // 注释说明
             Column({space: 3}) {
               Text('常用功能')
                 .fontColor($r('app.color.FFFFFF'))
@@ -108,6 +121,19 @@ export struct AuxiliaryOperationDialog {
               .height('100%')
               .width('19.3%')
               .alignContent(Alignment.Top)
+              .opacity(this.process.id ? 1 : 0.3)
+              .onClick(()=>{
+                if (!this.process.id) {
+                  promptAction.showToast({
+                    message: '请先选择工序开工!',
+                    duration: 2000
+                  });
+                  return;
+                }
+                if (this.openLittleMaterialRequestDialog) {
+                  this.openLittleMaterialRequestDialog()
+                }
+              })
               // 仓储操作
               Stack() {
                 Image($r("app.media.process_storage_operation"))
@@ -130,6 +156,12 @@ export struct AuxiliaryOperationDialog {
               .height('100%')
               .width('19.3%')
               .alignContent(Alignment.Top)
+              .onClick(()=>{
+                if (this.openInAndOutBoundDialog) {
+                  this.openInAndOutBoundDialog()
+                }
+              })
+
               // 条码关联
               Stack() {
                 Image($r("app.media.process_barcode_linkage"))
@@ -167,10 +199,11 @@ export struct AuxiliaryOperationDialog {
               .height('100%')
               .width('19.3%')
               .alignContent(Alignment.Top)
+              .opacity(this.workOrderCode ? 1 : 0.3)
               .onClick(()=>{
                 if (!this.workOrderCode) {
                   promptAction.showToast({
-                    message: '请选择工单!',
+                    message: '请选择工单!',
                     duration: 2000
                   });
                   return;
@@ -179,6 +212,7 @@ export struct AuxiliaryOperationDialog {
                   this.openBarcodeAssociationDialog()
                 }
               })
+
               // 图纸资料
               Stack() {
                 Image($r("app.media.process_drawing"))
@@ -216,6 +250,20 @@ export struct AuxiliaryOperationDialog {
               .height('100%')
               .width('19.3%')
               .alignContent(Alignment.Top)
+              .opacity(this.workOrderCode ? 1 : 0.3)
+              .onClick(()=>{
+                if (!this.workOrderCode) {
+                  promptAction.showToast({
+                    message: '请先选择工单!',
+                    duration: 2000
+                  });
+                  return;
+                }
+                // if (this.openBarcodeAssociationDialog) {
+                //   this.openBarcodeAssociationDialog()
+                // }
+              })
+
               // 撤销报工
               Stack() {
                 Image($r("app.media.process_drawing"))
@@ -238,6 +286,19 @@ export struct AuxiliaryOperationDialog {
               .height('100%')
               .width('19.3%')
               .alignContent(Alignment.Top)
+              .opacity(this.workOrderCode ? 1 : 0.3)
+              .onClick(()=>{
+                if (!this.workOrderCode) {
+                  promptAction.showToast({
+                    message: '请先选择工单!',
+                    duration: 2000
+                  });
+                  return;
+                }
+                // if (this.openBarcodeAssociationDialog) {
+                //   this.openBarcodeAssociationDialog()
+                // }
+              })
             }
             .height('33.6%')
             .width('100%')
@@ -275,8 +336,16 @@ export struct AuxiliaryOperationDialog {
                 .justifyContent(FlexAlign.Center)
                 .backgroundColor($r('app.color.20FFFFFF'))
                 .borderRadius($r('app.float.fontSize_16'))
+                .opacity(this.currentUserId <= 0 ? 0.3 : 1)
                 .onClick(()=>{
-
+                  if (this.currentUserId <= 0) {
+                    promptAction.showToast({
+                      message: `请先登录!`,
+                      duration: 1500,
+                      bottom: 100
+                    })
+                    return
+                  }
                 })
               }
               .height('13.4%')
@@ -298,8 +367,16 @@ export struct AuxiliaryOperationDialog {
                 .justifyContent(FlexAlign.Center)
                 .backgroundColor($r('app.color.20FFFFFF'))
                 .borderRadius($r('app.float.fontSize_16'))
+                .opacity(this.currentUserId <= 0 ? 0.3 : 1)
                 .onClick(()=>{
-
+                  if (this.currentUserId <= 0) {
+                    promptAction.showToast({
+                      message: `请先登录!`,
+                      duration: 1500,
+                      bottom: 100
+                    })
+                    return
+                  }
                 })
                 // 提前下线
                 Row() {
@@ -330,7 +407,16 @@ export struct AuxiliaryOperationDialog {
                 .backgroundColor($r('app.color.20FFFFFF'))
                 .borderRadius($r('app.float.fontSize_16'))
                 .margin({left: '3.8%'})
+                .opacity(this.currentUserId <= 0 ? 0.3 : 1)
                 .onClick(()=>{
+                  if (this.currentUserId <= 0) {
+                    promptAction.showToast({
+                      message: `请先登录!`,
+                      duration: 1500,
+                      bottom: 100
+                    })
+                    return
+                  }
                 })
                 // 委外审核
                 Row() {
@@ -361,7 +447,16 @@ export struct AuxiliaryOperationDialog {
                 .backgroundColor($r('app.color.20FFFFFF'))
                 .borderRadius($r('app.float.fontSize_16'))
                 .margin({left: '3.8%'})
+                .opacity(this.currentUserId <= 0 ? 0.3 : 1)
                 .onClick(()=>{
+                  if (this.currentUserId <= 0) {
+                    promptAction.showToast({
+                      message: `请先登录!`,
+                      duration: 1500,
+                      bottom: 100
+                    })
+                    return
+                  }
                 })
               }
               .width('95%')
@@ -430,7 +525,6 @@ export struct AuxiliaryOperationDialog {
       }
       .width('100%')
       .height('100%')
-
     }
     .width('100%')
     .height('93.5%')

+ 0 - 1
entry/src/main/ets/view/InBoundView.ets

@@ -20,7 +20,6 @@ export struct InAndOutBoundDialog {
 
   build() {
     Column() {
-
       InBoundView({
         materialNum:this.materialNum,
         boxMaterials:this.scanMaterialList

+ 4 - 2
entry/src/main/ets/view/PictureDrawingDialog.ets

@@ -9,14 +9,16 @@ export struct PictureDrawingDialog {
   private scrollerMaterial: Scroller = new Scroller()
   //作业图片列表
   @State drawingList: DrawingInfo[] = []
+  materialCode: string = ''
 
   controller: CustomDialogController
-  onConfirm: () => void = () => {
-  }
+  onConfirm: () => void = () => {}
 
   //加载所有作业
   loadWorkInstructions = async () => {
     this.drawingList = await ProcessRequest.post('/api/v1/base/drawing/list', {
+      materialCode: this.materialCode,
+      notDrawingDictValue: 'esop'
     } as RequestParamModel) as DrawingInfo[];
   };
 

+ 2 - 0
entry/src/main/ets/viewmodel/RequestParamModel.ets

@@ -96,4 +96,6 @@ export default class RequestParamModel {
   checkType?:string
   //操作结果
   result?:string
+  //不查询的图纸资料类型
+  notDrawingDictValue?:string
 }