cjb 2 روز پیش
والد
کامیت
1352d54e60

+ 13 - 15
entry/src/main/ets/view/ConfirmDialog.ets

@@ -1,13 +1,10 @@
-//确认
+// 切换工单确认
 @CustomDialog
-export struct CommonConfirmDialog {
-  @State title: string = '提示'
-  @State message: string = '确定要执行此操作吗?'
-  @State confirmText: string = '确定'
-  @State cancelText: string = '取消'
-
+export struct ConfirmDialog {
   controller: CustomDialogController
   onConfirm: () => void = () => {}
+  @Prop title:string = ''
+  @Prop message:string = ''
 
   build() {
     Column() {
@@ -16,14 +13,15 @@ export struct CommonConfirmDialog {
         Text(this.title)
           .fontColor($r('app.color.FFFFFF'))
           .fontSize($r('app.float.fontSize_30'))
-      }.height('30%')
+      }.height('25%')
       .justifyContent(FlexAlign.Center)
       Column(){
         Text(this.message)
-          .fontColor($r('app.color.30FFFFFF'))
-          .fontSize($r('app.float.fontSize_30'))
-      }.height('40%')
+          .fontColor($r('app.color.FFFFFF'))
+          .fontSize($r('app.float.fontSize_24'))
+      }.height('50%')
       .justifyContent(FlexAlign.Center)
+      .margin({bottom:'5%'})
 
       Column(){
         Divider()
@@ -57,12 +55,12 @@ export struct CommonConfirmDialog {
         }
       }
       .width('100%')
-      .height('30%')
+      .height('16%')
     }
-    .height(200)
-    .width(400)
+    .height('34%')
+    .width('30%')
     .backgroundColor($r('app.color.2A2A2A'))
     .justifyContent(FlexAlign.End)
-    .borderRadius(16)
+    .borderRadius($r('app.float.virtualSize_16'))
   }
 }

+ 327 - 0
entry/src/main/ets/view/ProcessReportingDialog.ets

@@ -0,0 +1,327 @@
+//切换产品
+import ProcessRequest from '../common/util/request/ProcessRequest'
+import TaskSeqVO from '../viewmodel/process/TaskSeqInfo'
+import ReportInfo from '../viewmodel/ReportInfo'
+import RequestParamModel from '../viewmodel/RequestParamModel'
+
+@CustomDialog
+export struct ProcessReportingDialog{
+  private scrollerList: Scroller = new Scroller()
+  //查询报工
+  @State reportList: ReportInfo[] = []
+  //当前工单号
+  @State currentWorkOrderCode:string = ''
+  //当前工序号
+  @State currentOperationId:string = ''
+  //当前工位
+  @State currentStationId:string = ''
+  //选择的按钮索引(默认加载全部)
+  @State addReportingClick: number = 1
+  //扫描的流水号/序列/铭牌号
+  @State scanSeqValue: string = ''
+  @State userName:string = '王德发'
+
+  controller: CustomDialogController
+  onConfirm: () => void = () => {}
+  //选择报工人
+  onSelectReporter: () => void = () => {}
+  //选择报工人
+  onSelectReportNum: () => void = () => {}
+  onSelectUnqualified: () => void = () => {}
+
+  loadFirstReport=async ()=>{
+    const firstReporter:ReportInfo= {}
+    firstReporter.userName = this.userName
+    this.reportList.push(firstReporter)
+  }
+
+  aboutToAppear(): void {
+    this.loadFirstReport()
+  }
+
+
+  build() {
+    Column() {
+      Column() {
+        Text("工序报工")
+          .fontColor($r('app.color.FFFFFF'))
+          .fontSize($r('app.float.fontSize_30'))
+      }
+      .height('8%')
+      .width('100%')
+      .justifyContent(FlexAlign.Center)
+
+
+      Column(){
+          Row(){
+            Column({space:3}){
+              Text("卫星通导模块")
+                .fontSize($r('app.float.fontSize_24'))
+                .fontColor($r('app.color.FFFFFF'))
+              Text("ASF-ASFA-ASD-FAS")
+                .fontSize($r('app.float.fontSize_12'))
+                .fontColor($r('app.color.FFFFFF'))
+                .fontWeight(FontWeight.Lighter)
+              Row(){
+                Text("工单 ")
+                  .fontSize($r('app.float.fontSize_16'))
+                  .fontColor($r('app.color.FFFFFF'))
+                  .fontWeight(FontWeight.Lighter)
+                Text("123456789123456789")
+                  .fontSize($r('app.float.fontSize_16'))
+                  .fontColor($r('app.color.FFFFFF'))
+              }
+            }
+            .height('100%')
+            .width('30%')
+            .justifyContent(FlexAlign.End)
+            .alignItems(HorizontalAlign.Start)
+            Row(){
+              Text('工序')
+                .fontSize($r('app.float.fontSize_16'))
+                .fontColor($r('app.color.FFFFFF'))
+                .fontWeight(FontWeight.Lighter)
+              Text('正面三防')
+                .fontSize($r('app.float.fontSize_16'))
+                .fontColor($r('app.color.FFFFFF'))
+            }
+            .height('100%')
+            .width('40%')
+            .justifyContent(FlexAlign.Center)
+            .alignItems(VerticalAlign.Bottom)
+            Column(){
+              Row(){
+                Text('10/')
+                  .fontSize($r('app.float.fontSize_38'))
+                  .fontColor($r('app.color.FFFFFF'))
+                Text('100')
+                  .fontSize($r('app.float.fontSize_38'))
+                  .fontColor($r('app.color.60FFFFFF'))
+                Text('片')
+                  .fontSize($r('app.float.fontSize_16'))
+                  .fontColor($r('app.color.60FFFFFF'))
+                  .fontWeight(FontWeight.Lighter)
+              }
+              Text('当前工序已报工/计划')
+                .fontSize($r('app.float.fontSize_12'))
+                .fontColor($r('app.color.FFFFFF'))
+                .fontWeight(FontWeight.Lighter)
+
+            }
+            .height('100%')
+            .width('30%')
+            .justifyContent(FlexAlign.End)
+            .alignItems(HorizontalAlign.End)
+          }
+          .height('10%')
+          .width('96%')
+          .margin({left:'2%',right:'2%'})
+          Row(){
+            Image($r('app.media.process_reporting_add'))
+              .width($r('app.float.virtualSize_24'))
+              .height($r('app.float.virtualSize_24'))
+              .fillColor($r('app.color.0A84FF'))
+            Text('添加报工人')
+              .fontColor($r('app.color.0A84FF'))
+              .fontSize($r('app.float.fontSize_24'))
+              .margin({left:'4%'})
+          }
+          .height('8%')
+          .width('14%')
+          .margin({left:'2%',top:'1.5%',bottom:'1.5%'})
+          .justifyContent(FlexAlign.Center)
+          .backgroundColor($r('app.color.20FFFFFF'))
+          .borderRadius($r('app.float.virtualSize_16'))
+          .scale({ x: this.addReportingClick, y: this.addReportingClick })
+          .animation({
+            duration: 200,
+            curve: Curve.Linear
+          })
+          .onClick(() => {
+            this.addReportingClick = 0.9;
+            setTimeout(() => {
+              this.addReportingClick = 1;
+              const newReporter:ReportInfo= {}
+              this.reportList.push(newReporter)
+            }, 200);
+          })
+          Column(){
+            List({space: 8, scroller:this.scrollerList}) {
+              ForEach(this.reportList, (item:ReportInfo,index) => {
+                ListItem() {
+                  Row(){
+                    Column(){
+                      Text(`报工人${index}`)
+                        .fontColor($r('app.color.FFFFFF'))
+                        .fontSize($r('app.float.fontSize_16'))
+                        .fontWeight(FontWeight.Regular)
+                        .height('30%')
+                        .margin({left:'2%'})
+                      Row(){
+                        Text(item.userName)
+                          .fontColor($r('app.color.FFFFFF'))
+                          .fontSize($r('app.float.fontSize_24'))
+                          .margin({left:'8%'})
+                          .width('82%')
+                          .textAlign(TextAlign.Start)
+                        Text(">")
+                          .fontColor($r('app.color.FFFFFF'))
+                          .fontSize($r('app.float.fontSize_24'))
+                          .textAlign(TextAlign.Start)
+                          .width('10%')
+                      }
+                      .justifyContent(FlexAlign.Start)
+                      .borderRadius($r('app.float.virtualSize_16'))
+                      .height('70%')
+                      .enabled(index!=0)
+                      .backgroundColor($r('app.color.20FFFFFF'))
+                      .onClick(()=>{
+                        this.onSelectReporter()
+                      })
+                    }
+                    .width('29%')
+                    .height('100%')
+                    .alignItems(HorizontalAlign.Start)
+                    Column(){
+                      Text(`报工数量`)
+                        .fontColor($r('app.color.FFFFFF'))
+                        .fontSize($r('app.float.fontSize_16'))
+                        .fontWeight(FontWeight.Regular)
+                        .height('30%')
+                        .margin({left:'2%'})
+                      Row(){
+                        Text(item.reportNum)
+                          .fontColor($r('app.color.FFFFFF'))
+                          .fontSize($r('app.float.fontSize_24'))
+                          .margin({left:'8%'})
+                          .width('82%')
+                          .textAlign(TextAlign.Start)
+                        Text(">")
+                          .fontColor($r('app.color.FFFFFF'))
+                          .fontSize($r('app.float.fontSize_24'))
+                          .textAlign(TextAlign.Start)
+                          .width('10%')
+                      }
+                      .justifyContent(FlexAlign.Start)
+                      .borderRadius($r('app.float.virtualSize_16'))
+                      .height('70%')
+                      .backgroundColor($r('app.color.20FFFFFF'))
+                      .onClick(()=>{
+                        this.onSelectReportNum()
+                      })
+                    }
+                    .width('29%')
+                    .height('100%')
+                    .alignItems(HorizontalAlign.Start)
+                    .margin({left:'2%',right:'2%'})
+                    Column(){
+                      Text(`不良品数量`)
+                        .fontColor($r('app.color.FFFFFF'))
+                        .fontSize($r('app.float.fontSize_16'))
+                        .fontWeight(FontWeight.Regular)
+                        .height('30%')
+                        .margin({left:'2%'})
+                      Row(){
+                        Text(item.unqualifiedNum)
+                          .fontColor($r('app.color.FFFFFF'))
+                          .fontSize($r('app.float.fontSize_24'))
+                          .margin({left:'8%'})
+                          .width('82%')
+                          .textAlign(TextAlign.Start)
+                        Text(">")
+                          .fontColor($r('app.color.FFFFFF'))
+                          .fontSize($r('app.float.fontSize_24'))
+                          .textAlign(TextAlign.Start)
+                          .width('10%')
+                      }
+                      .justifyContent(FlexAlign.Start)
+                      .borderRadius($r('app.float.virtualSize_16'))
+                      .backgroundColor($r('app.color.20FFFFFF'))
+                      .height('70%')
+                      .onClick(()=>{
+                        this.onSelectUnqualified()
+                      })
+                    }
+                    .width('29%')
+                    .alignItems(HorizontalAlign.Start)
+                    .height('100%')
+                    if(index>0)
+                    {
+                      Column(){
+                        Image($r('app.media.process_delete_seq'))
+                          .width($r('app.float.virtualSize_48'))
+                          .height($r('app.float.virtualSize_48'))
+                          .fillColor($r('app.color.FF453A'))
+                          .margin({top:'35%'})
+                          .onClick(()=>{
+                            this.reportList.splice(index,1)
+                          })
+                      }
+                      .width('9%')
+                      .alignItems(HorizontalAlign.Center)
+                      .height('100%')
+                    }
+                  }
+                  .height('100%')
+                }.height('20%')
+              })
+            }
+            .width('98%')
+            .height('100%')
+            .margin({left:'2%'})
+          }
+          .height('74%')
+          .width('100%')
+
+        }
+      .justifyContent(FlexAlign.Start)
+      .alignItems(HorizontalAlign.Start)
+      .width('100%')
+      .height('84%')
+
+      Column() {
+        Divider()
+          .vertical(false)
+          .strokeWidth(1)
+          .color($r('app.color.15FFFFFF'))
+        Row() {
+          Row() {
+            Text('取消')
+              .fontColor($r('app.color.60FFFFFF'))
+              .fontSize($r('app.float.fontSize_30'))
+          }
+          .justifyContent(FlexAlign.Center)
+          .width('50%')
+          .onClick(() => this.controller.close())
+          Divider()
+            .vertical(true)
+            .strokeWidth(1)
+            .color($r('app.color.15FFFFFF'))
+          Row() {
+            Text('确定')
+              .fontColor($r('app.color.007AFF'))
+              .fontSize($r('app.float.fontSize_30'))
+          }
+          .justifyContent(FlexAlign.Center)
+          .width('50%')
+          .onClick(() => {
+            this.controller.close();
+          })
+        }
+      }
+      .width('100%')
+      .height('8%')
+
+    }
+    .height('71%')
+    .width('62%')
+    .backgroundColor($r('app.color.2A2A2A'))
+    .justifyContent(FlexAlign.End)
+    .alignItems(HorizontalAlign.Start)
+    .borderColor($r('app.color.000000'))
+    .borderWidth(1)
+    .borderRadius($r('app.float.virtualSize_16'))
+  }
+}
+
+

+ 0 - 64
entry/src/main/ets/view/SwitchOrderConfirmDialog.ets

@@ -1,64 +0,0 @@
-// 切换工单确认
-@CustomDialog
-export struct SwitchOrderConfirmDialog {
-  controller: CustomDialogController
-  onConfirm: () => void = () => {}
-
-  build() {
-    Column() {
-      // 标题
-      Column(){
-        Text("切换工单确认")
-          .fontColor($r('app.color.FFFFFF'))
-          .fontSize($r('app.float.fontSize_30'))
-      }.height('25%')
-      .justifyContent(FlexAlign.Center)
-      Column(){
-        Text("扫描的流水号不属于本工单,是否切换工单?")
-          .fontColor($r('app.color.FFFFFF'))
-          .fontSize($r('app.float.fontSize_24'))
-      }.height('50%')
-      .justifyContent(FlexAlign.Center)
-      .margin({bottom:'5%'})
-
-      Column(){
-        Divider()
-          .vertical(false)
-          .strokeWidth(1)
-          .color($r('app.color.15FFFFFF'))
-        Row(){
-          Row(){
-            Text('取消')
-              .fontColor($r('app.color.60FFFFFF'))
-              .fontSize($r('app.float.fontSize_30'))
-          }
-          .justifyContent(FlexAlign.Center)
-          .width('50%')
-          .onClick(() => this.controller.close())
-          Divider()
-            .vertical(true)
-            .strokeWidth(1)
-            .color($r('app.color.15FFFFFF'))
-          Row(){
-            Text('确认')
-              .fontColor($r('app.color.007AFF'))
-              .fontSize($r('app.float.fontSize_30'))
-          }
-          .justifyContent(FlexAlign.Center)
-          .width('50%')
-          .onClick(() => {
-            this.onConfirm();
-            this.controller.close();
-          })
-        }
-      }
-      .width('100%')
-      .height('16%')
-    }
-    .height('34%')
-    .width('30%')
-    .backgroundColor($r('app.color.2A2A2A'))
-    .justifyContent(FlexAlign.End)
-    .borderRadius($r('app.float.virtualSize_16'))
-  }
-}

+ 2 - 4
entry/src/main/ets/view/process/MultiMediaCollect.ets

@@ -8,7 +8,7 @@ import CommonConstants from '../../common/constants/CommonConstants';
 import ProcessRequest from '../../common/util/request/ProcessRequest';
 import RequestParamModel from '../../viewmodel/RequestParamModel';
 import { ConfirmDialogParams } from '../../viewmodel/ConfirmDialogParam';
-import { CommonConfirmDialog } from '../ConfirmDialog';
+import { ConfirmDialog } from '../ConfirmDialog';
 import promptAction from '@ohos.promptAction';
 
 const TAG = "Process camera upload"
@@ -66,11 +66,9 @@ export struct MultiMediaCollect {
     }
 
     this.commonDialogController = new CustomDialogController({
-      builder: CommonConfirmDialog({
+      builder: ConfirmDialog({
         title: params.title || '提示',
         message: params.message,
-        confirmText: params.confirmText || '确定',
-        cancelText: params.cancelText || '取消',
         onConfirm: params.onConfirm
       }),
       cancel: () => console.log('用户取消操作'),

+ 8 - 0
entry/src/main/ets/viewmodel/ReportInfo.ets

@@ -0,0 +1,8 @@
+export default class ReportInfo {
+  // 报工人
+  userName?: string
+  // 报工数量
+  reportNum?: string
+  //不合格数量
+  unqualifiedNum?: string
+}

+ 3 - 0
entry/src/main/resources/base/media/process_reporting_add.svg

@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
+  <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1Zm0 1.5a9.5 9.5 0 1 0 0 19 9.5 9.5 0 0 0 0-19Zm.75 14.75a.75.75 0 0 1-1.5 0v-4.501l-4.5.001a.75.75 0 0 1 0-1.5l4.5-.001V6.75a.75.75 0 0 1 1.5 0v10.5Zm4.5-6a.75.75 0 0 1 0 1.5h-3.5v-1.5h3.5Z"/>
+</svg>