cjb 1 miesiąc temu
rodzic
commit
44625e20be

+ 4 - 0
entry/src/main/ets/common/constants/CommonConstants.ets

@@ -7,12 +7,16 @@ export default class CommonConstants {
   static AUTH_TOKEN: string = ''
   // 附件地址前缀
   static FILE_URL_PREFIX: string = 'http://192.168.1.3:9000'
+  // 图片地址前缀
+  static PICTURE_URL_PREFIX: string = 'http://192.168.1.3:20001'
 
   // 当前登录用户相关信息
   static USER_ID?: number
   static USER_NAME: string = ''
   static USER_AVATAR: string = ''
   static STATION_NANE: string = ''
+  static DEPARTMENT_NANE: string = ''
+  static PRODUCT_NANE: string = ''
   static STATION_ID: number
   static STATION_CODE: string = ''
   static STATION_IP: string = ''

+ 1 - 1
entry/src/main/ets/common/util/request/ProcessRequest.ets

@@ -33,7 +33,7 @@ const ProcessRequest = axios.create(
 ProcessRequest.interceptors.request.use((config: InternalAxiosRequestConfig) => {
 
   // 以后登录之后可以在这里传
-  config.headers.Authorization = CommonConstants.AUTH_TOKEN
+  config.headers.Authorization = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOnsic3RhdGlvbkNvZGUiOiJ6aHVhbmd0aWFvMSIsInN0YXRpb25UeXBlIjoiMTgiLCJkZXB0SWQiOjE3LCJpZCI6MTAwMDAsInN0YXRpb25JcCI6IjE5Mi4xNjguMS4xMSIsInVzZXJOYW1lIjoiYWRtaW4iLCJvcmdJZCI6MTcsInN0YXRpb25JZCI6Njh9LCJkZXZpY2UiOiJhaW8iLCJlZmYiOjE3NDgzMTI4MjM0NDAsInJuU3RyIjoiUzBwekxoRWx6azMySVRFS0FKazZrMTBVQmpYaUYxUEQifQ.9V6ZcUUYb9kDzD4HEsbrK9PhI65biY1fXW0g7e4lmXE"
    //config.headers.Authorization ="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOnsic3RhdGlvbkNvZGUiOiJ6aHVhbmd0aWFvMSIsInN0YXRpb25UeXBlIjoiMTgiLCJkZXB0SWQiOjE3LCJpZCI6MTAwMDAsInN0YXRpb25JcCI6IjE5Mi4xNjguMS4xMSIsInVzZXJOYW1lIjoiYWRtaW4iLCJvcmdJZCI6MTcsInN0YXRpb25JZCI6Njh9LCJkZXZpY2UiOiJhaW8iLCJlZmYiOjE3NDgwNTQ4ODg5MzUsInJuU3RyIjoiMmJ5NnJlOVpMa2JZOE1CcjBHSlBENjlXZTNwSjgyREIifQ.nY0PPEjgjW2-PX1TqI_SGxa5Mu4dGOCwbGDitvN_oqA"
   //config.headers.Authorization ="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOnsiaWQiOjM3LCJsb2dpblR5cGUiOiJhaW8ifSwiZGV2aWNlIjoiYWlvIiwiZWZmIjoxNzE3NTExMjYwODI4LCJyblN0ciI6InRSenNBTGdlZ3lqS0FHeDZTSkdYZTNLbFY3eWh1OG1PIn0.FVAeESiz_PH1NtBFDmGZr0IwtXzubV2d8JTQdGdJnxc"
   printRequest(config)

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

@@ -10,6 +10,9 @@ import image from '@ohos.multimedia.image';
 import { SwitchingProductDialog, taskSeqItem } from '../view/SwitchingProductDialog';
 import TaskSeqVO from '../viewmodel/process/TaskSeqInfo';
 import promptAction from '@ohos.promptAction';
+import { StationInfoDialog } from '../view/StationInfoDialog';
+import { SwitchingDeptDialog, SwitchingProductLineDialog, SwitchingStationDialog } from '../view/SwitchingStationViews';
+import { SwitchingUserDialog } from '../view/SwitchingUserDialog';
 
 @Entry
 @Component
@@ -30,13 +33,78 @@ struct ProcessIndex {
   @State selectedButtonIndex: number = 0
   // 流转卡号信息集合
   @State taskSeqArray: TaskSeqVO[] = []
+  @State currentDept:string = ''
+  @State currentProductLine:string = ''
+  @State currentStation:string = ''
+  @State currentPLCode:string = ''
+  @State currentOrgId:number = 0
+  @State currentStationId:string =''
+  @State currentUserName :string =''
+
+  selectOrderController: CustomDialogController = new CustomDialogController({
+    builder: SelectOrderDialog({}),
+    autoCancel: true, // 点击遮罩关闭
+    customStyle: true,
+    maskColor: 'rgba(0,0,0,0.8)',  // 黑色遮罩
+  })
 
   private scrollerList: Scroller = new Scroller()
   pageNo: number = 1
   pageSize: number = 9
 
-  selectOrderController: CustomDialogController = new CustomDialogController({
-    builder: SelectOrderDialog({}),
+  StationInfoController: CustomDialogController = new CustomDialogController({
+    builder: StationInfoDialog({
+      currentDept:this.currentDept,
+      currentProductLine:this.currentProductLine,
+      currentStation:this.currentStation,
+      currentPLCode:this.currentPLCode,
+      currentUserName:this.currentUserName,
+      searchDept:()=>{this.SwitchingDeptController.open()},
+      searchStation:()=>{this.SwitchingStationController.open()},
+      searchProductLine:()=>{this.SwitchingProductLineController.open()},
+      login:()=>{this.switchingUserController.open()}
+    }),
+    autoCancel: true, // 点击遮罩关闭
+    customStyle: true,
+    maskColor: 'rgba(0,0,0,0.8)',  // 黑色遮罩
+  })
+
+  SwitchingDeptController: CustomDialogController = new CustomDialogController({
+    builder: SwitchingDeptDialog({
+      currentDept:this.currentDept,
+      currentOrgId:this.currentOrgId
+    }),
+    autoCancel: true, // 点击遮罩关闭
+    customStyle: true,
+    maskColor: 'rgba(0,0,0,0.8)',  // 黑色遮罩
+  })
+  SwitchingProductLineController: CustomDialogController = new CustomDialogController({
+    builder: SwitchingProductLineDialog({
+      currentProductLine:this.currentProductLine,
+      currentPLCode:this.currentPLCode
+    }),
+    autoCancel: true, // 点击遮罩关闭
+    customStyle: true,
+    maskColor: 'rgba(0,0,0,0.8)',  // 黑色遮罩
+  })
+  SwitchingStationController: CustomDialogController = new CustomDialogController({
+    builder: SwitchingStationDialog({
+      currentStation:this.currentStation,
+      currentPLCode:this.currentPLCode,
+      currentStationId:this.currentStationId
+    }),
+    autoCancel: true, // 点击遮罩关闭
+    customStyle: true,
+    maskColor: 'rgba(0,0,0,0.8)',  // 黑色遮罩
+  })
+
+  switchingUserController: CustomDialogController = new CustomDialogController({
+    builder: SwitchingUserDialog({
+      currentOrgId:this.currentOrgId,
+      currentPLCode:this.currentPLCode,
+      currentStationId:this.currentStationId,
+      currentUserName:this.currentUserName
+    }),
     autoCancel: true, // 点击遮罩关闭
     customStyle: true,
     maskColor: 'rgba(0,0,0,0.8)',  // 黑色遮罩
@@ -51,6 +119,7 @@ struct ProcessIndex {
     maskColor: 'rgba(0,0,0,0.8)',  // 黑色遮罩
   })
 
+
   handleAllClick():void {
     this.onQueryTask([])
   }

+ 0 - 3
entry/src/main/ets/view/ModifyMaterialNumDialog.ets

@@ -1,9 +1,6 @@
 // 确认框
-import Want from '@ohos.app.ability.Want';
-import common from '@ohos.app.ability.common';
 @CustomDialog
 export struct ModifyMaterialNumDialog {
-  context = getContext(this) as common.UIAbilityContext;
   @Prop currentMaterialName :string = ''
   @Prop currentMaterialNo :string = ''
   @Prop currentBatchNo :string = ''

+ 169 - 0
entry/src/main/ets/view/SerialNoMaterialDialog.ets

@@ -0,0 +1,169 @@
+import TaskSeqVO from '../viewmodel/process/TaskSeqInfo'
+
+@CustomDialog
+export struct SerialNoMaterialDialog {
+  private scrollerMaterial: Scroller = new Scroller()
+  //当前物料名称
+  @State currentMaterialName: string = 'PCBA板'
+  //当前物料型号
+  @State currentMaterialNo: string = '12322221232321222332211233'
+  //当前物料计划数量
+  @State currentPlanNum:number = 100
+  //当前物料完成数量
+  @State currentCompleteNum:number = 10
+  //当前物料单位
+  @State currentMaterialUnit:string = '片'
+  //扫描的工单号
+  @State selectedSerialsIndex:number = -1
+  //
+  @State currentMaterialSerials:TaskSeqVO[]=[{
+    seqNo:"1212122121ewqeqweqw2131231231"
+  },
+    {
+      seqNo:"1212122121ewqeqweqw2131231231"
+    },
+    {
+      seqNo:"1212122121ewqeqweqw2131231231"
+    },
+    {
+      seqNo:"1212122121ewqeqweqw2131231231"
+    },
+    {
+      seqNo:"1212122121ewqeqweqw2131231231"
+    },
+  ]
+  controller: CustomDialogController
+  onConfirm: () => void = () => {
+  }
+
+  aboutToAppear(): void {
+  }
+
+  build() {
+    Column() {
+      Column() {
+        Text("本次扫描物料")
+          .fontColor($r('app.color.FFFFFF'))
+          .fontSize($r('app.float.fontSize_38'))
+      }.height('8%')
+      .width('100%')
+      .justifyContent(FlexAlign.Center)
+
+      Row() {
+        Column({space:5}){
+          Text(`物料名称:${this.currentMaterialName}`)
+            .fontColor($r('app.color.FFFFFF'))
+            .fontSize($r('app.float.fontSize_16'))
+          Text(`型号:${this.currentMaterialNo}`)
+            .fontColor($r('app.color.FFFFFF'))
+            .fontSize($r('app.float.fontSize_16'))
+        }
+        .alignItems(HorizontalAlign.Start)
+        .width('70%')
+        Row(){
+          Text(`${this.currentCompleteNum}/`)
+            .fontColor($r('app.color.FFFFFF'))
+            .fontSize($r('app.float.fontSize_38'))
+          Text(`${this.currentCompleteNum}${this.currentMaterialUnit}`)
+            .fontColor($r('app.color.60FFFFFF'))
+            .fontSize($r('app.float.fontSize_38'))
+        } .width('30%')
+        .justifyContent(FlexAlign.End)
+      }
+      .height('6%')
+      .width('96%')
+      .justifyContent(FlexAlign.End)
+      .margin({left:'2%',right:'2%'})
+
+
+
+      Divider()
+        .vertical(false)
+        .strokeWidth(1)
+        .color($r('app.color.15FFFFFF'))
+        .margin({ top: '1%' ,bottom:'2%',left:'2%',right:'2%'})
+
+      Column() {
+        List({ space: 8,scroller:this.scrollerMaterial }) {
+          ForEach(this.currentMaterialSerials, (item: TaskSeqVO, index) => {
+            ListItem() {
+              Row() {
+                Row(){
+                  Text(`S/N`)
+                    .fontSize($r('app.float.fontSize_30'))
+                    .fontColor($r('app.color.60FFFFFF'))
+                    .margin({left:'2%',right:'2%'})
+                  Text(`${item.seqNo}`)
+                    .fontColor($r('app.color.FFFFFF'))
+                    .fontSize($r('app.float.fontSize_30'))
+                }
+                .width('90%')
+                Row(){
+                  Image($r('app.media.process_delete_seq'))
+                    .width($r('app.float.virtualSize_48'))
+                    .height($r('app.float.virtualSize_48'))
+                    .fillColor($r('app.color.FF453A'))
+                }.width('10%')
+                .justifyContent(FlexAlign.Center)
+                .onClick(()=>{
+                  this.currentMaterialSerials.splice(index, 1);
+                })
+              }
+              .backgroundColor($r('app.color.20FFFFFF')) // 选中状态加深
+              .borderRadius($r('app.float.virtualSize_24'))
+              .padding(13)
+            }
+          })
+        }
+        .width('100%')
+        .flexGrow(1)
+      }
+      .height('68%')
+      .margin({left:'2%',right:'2%'})
+
+      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('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'))
+  }
+}

+ 93 - 37
entry/src/main/ets/view/StationInfoDialog.ets

@@ -1,46 +1,36 @@
 import ProcessRequest from '../common/util/request/ProcessRequest'
 import { MessageInfo, MessagePage } from '../viewmodel/MessageInfo'
+import { WorkstationInfo } from '../viewmodel/process/UserInfo'
 import RequestParamModel from '../viewmodel/RequestParamModel'
+import { SwitchingStationDialog } from './SwitchingStationViews'
 
 @CustomDialog
 export struct StationInfoDialog{
   private scrollerList: Scroller = new Scroller()
   //当前工位
-  @State currentStation:string = ''
+  @Link currentStation:string
+  //当前部门
+  @Link currentDept:string
+  //当前产线
+  @Link currentProductLine:string
+  //当前产线code
+  @Link currentPLCode:string
   //当前用户
-  @State currentUser:string = ''
+  @Link currentUserName:string
   //全部已读按钮缩放
   @State allReadClick:number = 1
   //消息列表
-  @State messages: MessageInfo[] = [
-    {
-      readState: "1", // 未读
-      content: "您有新的工单待处理:WX-20230001",
-      created: "2023-08-15 09:30:25"
-    },
-    {
-      readState: "0", // 已读
-      content: "物料ASF-100已入库成功",
-      created: "2023-08-14 14:15:33"
-    },
-    {
-      readState: "1", // 未读
-      content: "警告:料箱V-1024库存不足",
-      created: "2023-08-14 11:05:47"
-    },
-    {
-      readState: "0", // 已读
-      content: "工序OP-20报工完成",
-      created: "2023-08-13 16:45:12"
-    },
-    {
-      readState: "1", // 未读
-      content: "紧急:设备E-05需要维护",
-      created: "2023-08-13 10:20:18"
-    }
-  ];
+  @State messages: MessageInfo[] = [];
 
   controller: CustomDialogController
+  //查找部门
+  searchDept: () => void = () => {}
+  //查找产线
+  searchProductLine: () => void = () => {}
+  //查找工位
+  searchStation: () => void = () => {}
+  //登录
+  login: () => void = () => {}
   loadStationMessage=async ()=>{
     let res = await ProcessRequest.post('/api/v1/sys/message/stationMessage', {
     } as RequestParamModel) as MessagePage;
@@ -115,14 +105,47 @@ export struct StationInfoDialog{
 
       Row(){
         Column(){
-          Text("当前工位")
+          Text('当前用户')
             .fontColor($r('app.color.FFFFFF'))
             .fontSize($r('app.float.fontSize_16'))
-            .margin({left:'2%',bottom:'2%'})
+            .margin({left:'2%',bottom:'3%',top:'3%'})
             .width('60%')
             .textAlign(TextAlign.Start)
           Row(){
-            Text("1#装配工位")
+            Text(this.currentUserName)
+              .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.Center)
+          .borderRadius($r('app.float.virtualSize_16'))
+          .width('60%')
+          .height('10%')
+          .backgroundColor($r('app.color.20FFFFFF'))
+          .onClick(()=>{
+            this.login()
+          })
+          Divider()
+            .vertical(false)
+            .strokeWidth(1)
+            .color($r('app.color.15FFFFFF'))
+            .width('60%')
+            .margin({bottom:'3%',top:'3%'})
+          Text("部门")
+            .fontColor($r('app.color.FFFFFF'))
+            .fontSize($r('app.float.fontSize_16'))
+            .margin({left:'2%',bottom:'3%'})
+            .width('60%')
+            .textAlign(TextAlign.Start)
+          Row(){
+            Text(this.currentDept)
               .fontColor($r('app.color.FFFFFF'))
               .fontSize($r('app.float.fontSize_24'))
               .margin({left:'8%'})
@@ -139,14 +162,17 @@ export struct StationInfoDialog{
           .width('60%')
           .height('10%')
           .backgroundColor($r('app.color.20FFFFFF'))
-          Text("当前用户")
+          .onClick(()=>{
+            this.searchDept()
+          })
+          Text("产线")
             .fontColor($r('app.color.FFFFFF'))
             .fontSize($r('app.float.fontSize_16'))
-            .margin({left:'2%',bottom:'2%',top:'8%'})
+            .margin({left:'2%',bottom:'3%',top:'3%'})
             .width('60%')
             .textAlign(TextAlign.Start)
           Row(){
-            Text("王德发")
+            Text(this.currentProductLine)
               .fontColor($r('app.color.FFFFFF'))
               .fontSize($r('app.float.fontSize_24'))
               .margin({left:'8%'})
@@ -163,9 +189,39 @@ export struct StationInfoDialog{
           .width('60%')
           .height('10%')
           .backgroundColor($r('app.color.20FFFFFF'))
-          .margin({bottom:'20%'})
+          .onClick(()=>{
+            this.searchProductLine()
+          })
+          Text("工位")
+            .fontColor($r('app.color.FFFFFF'))
+            .fontSize($r('app.float.fontSize_16'))
+            .margin({left:'2%',bottom:'3%',top:'3%'})
+            .width('60%')
+            .textAlign(TextAlign.Start)
+          Row(){
+            Text(this.currentStation)
+              .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.Center)
+          .borderRadius($r('app.float.virtualSize_16'))
+          .width('60%')
+          .height('10%')
+          .backgroundColor($r('app.color.20FFFFFF'))
+          .onClick(()=>{
+             this.searchStation()
+          })
+          //.margin({bottom:'20%'})
         }
-        .justifyContent(FlexAlign.Center)
+        .justifyContent(FlexAlign.Start)
         .alignItems(HorizontalAlign.Center)
         .height('100%')
         .width('46%')

+ 1 - 1
entry/src/main/ets/view/SwitchOrderConfirmDialog.ets

@@ -1,4 +1,4 @@
-// 确认
+// 切换工单确认
 @CustomDialog
 export struct SwitchOrderConfirmDialog {
   controller: CustomDialogController

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

@@ -200,6 +200,7 @@ export struct SwitchingProductDialog{
              .width($r('app.float.virtualSize_32'))
              .height($r('app.float.virtualSize_32'))
              .fillColor($r('app.color.FFFFFF'))
+             .objectFit(ImageFit.Contain)
              .margin({left:'2%'})
            // 扫码输入框
            TextInput({text:this.scanSeqValue, placeholder: '请扫描或录入流水、序列或铭牌号' })

+ 0 - 119
entry/src/main/ets/view/SwitchingStationDialog.ets

@@ -1,119 +0,0 @@
-import ProcessRequest from '../common/util/request/ProcessRequest'
-import { MessageInfo, MessagePage } from '../viewmodel/MessageInfo'
-import TaskSeqVO from '../viewmodel/process/TaskSeqInfo'
-import RequestParamModel from '../viewmodel/RequestParamModel'
-
-@CustomDialog
-export struct StationInfoDialog{
-  private scrollerList: Scroller = new Scroller()
-  //当前工位
-  @State currentStation:string = ''
-  //选择的按钮索引
-  @State selectedButtonIndex: number = 1
-  //扫描的流水号/序列/铭牌号
-  //@State stations:number = 1
-
-
-  controller: CustomDialogController
-
-  build() {
-    Column() {
-      Column() {
-        Text("切换工位")
-          .fontColor($r('app.color.FFFFFF'))
-          .fontSize($r('app.float.fontSize_38'))
-      }
-      .height('8%')
-      .width('100%')
-      .justifyContent(FlexAlign.Center)
-
-      Column(){
-            // List({scroller:this.scrollerList}) {
-            //   ForEach(this.stations, (item:MessageInfo) => {
-            //     ListItem() {
-            //       Row() {
-            //         Column(){
-            //           Text(item.content)
-            //             .fontSize($r('app.float.fontSize_16'))
-            //             .fontColor($r('app.color.FFFFFF'))
-            //             .width('85%')
-            //             .textAlign(TextAlign.Start)
-            //           Text(item.created)
-            //             .fontSize($r('app.float.fontSize_12'))
-            //             .fontColor($r('app.color.FFFFFF'))
-            //             .width('85%')
-            //             .textAlign(TextAlign.Start)
-            //             .margin({top:'1%'})
-            //             .fontWeight(FontWeight.Lighter)
-            //         }
-            //         Row(){
-            //           Text(item.readState=='1'?`已读`:'已读确认')
-            //             .fontSize($r('app.float.fontSize_16'))
-            //             .fontColor(item.readState=='1'?$r('app.color.FFFFFF'):$r('app.color.0A84FF'))
-            //             .width('15%')
-            //             .textAlign(TextAlign.End)
-            //             .onClick(() => this.markAsRead(item))
-            //         }
-            //       }.width('100%').justifyContent(FlexAlign.SpaceEvenly)
-            //       .padding(5)
-            //     }
-            //   })
-            // }
-            // .width('100%')
-            // .height('100%')
-            // .divider({
-            //   strokeWidth: 1,
-            //   color: $r('app.color.20FFFFFF')
-            // })
-          }
-      .justifyContent(FlexAlign.SpaceEvenly)
-      .width('100%')
-      .height('81%')
-      .margin({ top: '2%'})
-
-      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('30%')
-    .backgroundColor($r('app.color.2A2A2A'))
-    .justifyContent(FlexAlign.End)
-    .alignItems(HorizontalAlign.Start)
-    .borderColor($r('app.color.000000'))
-    .borderWidth(1)
-    .borderRadius($r('app.float.virtualSize_16'))
-  }
-}
-
-

+ 346 - 0
entry/src/main/ets/view/SwitchingStationViews.ets

@@ -0,0 +1,346 @@
+import ProcessRequest from '../common/util/request/ProcessRequest'
+import { MessageInfo, MessagePage } from '../viewmodel/MessageInfo'
+import TaskSeqVO from '../viewmodel/process/TaskSeqInfo'
+import { DeptInfo, ProductionLine, WorkstationInfo } from '../viewmodel/process/UserInfo'
+import RequestParamModel from '../viewmodel/RequestParamModel'
+
+@CustomDialog
+export struct SwitchingStationDialog{
+  private scrollerList: Scroller = new Scroller()
+  //当前工位
+  @Link currentStation:string
+  @Link currentPLCode:string
+  @Link currentStationId:string
+  @State selectStationIndex: number = -1
+  //工位列表
+  @State stationsList : WorkstationInfo[]=[]
+  loadStations = async () => {
+    this.stationsList = await ProcessRequest.get(`api/v1/base/station/getStationList/${this.currentPLCode}/0`, {})  as WorkstationInfo[];
+  };
+  controller: CustomDialogController
+  aboutToAppear(): void {
+    this.loadStations();
+  }
+
+  private onSelectStation(index: number) {
+    this.selectStationIndex = index
+  }
+
+  build() {
+    Column() {
+      Column() {
+        Text("切换工位")
+          .fontColor($r('app.color.FFFFFF'))
+          .fontSize($r('app.float.fontSize_38'))
+      }
+      .height('8%')
+      .width('100%')
+      .justifyContent(FlexAlign.Center)
+
+      Column(){
+            List({space:10,scroller:this.scrollerList}) {
+              ForEach(this.stationsList, (item:WorkstationInfo,index) => {
+                ListItem() {
+                    Column(){
+                      Text(item.name)
+                        .fontSize($r('app.float.fontSize_24'))
+                        .fontColor($r('app.color.FFFFFF'))
+                    }  .backgroundColor(index === this.selectStationIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF'))
+                    .borderRadius($r('app.float.virtualSize_16'))
+                    .padding(8)
+                    .width('100%')
+                    .height('12%')
+                    .alignItems(HorizontalAlign.Center)
+                    .justifyContent(FlexAlign.Center)
+                    .border({
+                      width: index === this.selectStationIndex ? 2 : 0,
+                      color: index === this.selectStationIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF')
+                    })
+                    .onClick(() => {
+                      this.onSelectStation(index)
+                    })
+                }
+              })
+            }
+            .width('70%')
+            .height('100%')
+          }
+      .justifyContent(FlexAlign.SpaceEvenly)
+      .width('100%')
+      .height('81%')
+      .margin({ top: '2%'})
+
+      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.currentStation = this.stationsList[this.selectStationIndex].name??""
+            this.currentStationId=this.stationsList[this.selectStationIndex].id??""
+            this.controller.close();
+          })
+        }
+      }
+      .width('100%')
+      .height('8%')
+
+    }
+    .height('71%')
+    .width('30%')
+    .backgroundColor($r('app.color.2A2A2A'))
+    .justifyContent(FlexAlign.End)
+    .alignItems(HorizontalAlign.Start)
+    .borderColor($r('app.color.000000'))
+    .borderWidth(1)
+    .borderRadius($r('app.float.virtualSize_16'))
+  }
+}
+
+@CustomDialog
+export struct SwitchingProductLineDialog{
+  private scrollerList: Scroller = new Scroller()
+  //当前产线
+  @Link currentProductLine:string
+  @Link currentPLCode:string
+
+  @State selectProductLineIndex: number = -1
+  //产线列表
+  @State productLineList : ProductionLine[]=[]
+  loadStations = async () => {
+    this.productLineList = await ProcessRequest.post('api/v1/base/productionLine/list/list', {}as RequestParamModel)  as ProductionLine[];
+  };
+  controller: CustomDialogController
+  aboutToAppear(): void {
+    this.loadStations();
+  }
+
+  private onSelectProductLine(index: number) {
+    this.selectProductLineIndex = index
+  }
+
+  build() {
+    Column() {
+      Column() {
+        Text("切换工位")
+          .fontColor($r('app.color.FFFFFF'))
+          .fontSize($r('app.float.fontSize_38'))
+      }
+      .height('8%')
+      .width('100%')
+      .justifyContent(FlexAlign.Center)
+
+      Column(){
+        List({space:10,scroller:this.scrollerList}) {
+          ForEach(this.productLineList, (item:ProductionLine,index) => {
+            ListItem() {
+              Column(){
+                Text(item.name)
+                  .fontSize($r('app.float.fontSize_24'))
+                  .fontColor($r('app.color.FFFFFF'))
+              }  .backgroundColor(index === this.selectProductLineIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF'))
+              .borderRadius($r('app.float.virtualSize_16'))
+              .padding(8)
+              .width('100%')
+              .height('12%')
+              .alignItems(HorizontalAlign.Center)
+              .justifyContent(FlexAlign.Center)
+              .border({
+                width: index === this.selectProductLineIndex ? 2 : 0,
+                color: index === this.selectProductLineIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF')
+              })
+              .onClick(() => {
+                this.onSelectProductLine(index)
+              })
+            }
+          })
+        }
+        .width('70%')
+        .height('100%')
+      }
+      .justifyContent(FlexAlign.SpaceEvenly)
+      .width('100%')
+      .height('81%')
+      .margin({ top: '2%'})
+
+      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.currentProductLine = this.productLineList[this.selectProductLineIndex].name??""
+            this.currentPLCode =  this.productLineList[this.selectProductLineIndex].code??""
+            this.controller.close();
+          })
+        }
+      }
+      .width('100%')
+      .height('8%')
+
+    }
+    .height('71%')
+    .width('30%')
+    .backgroundColor($r('app.color.2A2A2A'))
+    .justifyContent(FlexAlign.End)
+    .alignItems(HorizontalAlign.Start)
+    .borderColor($r('app.color.000000'))
+    .borderWidth(1)
+    .borderRadius($r('app.float.virtualSize_16'))
+  }
+}
+
+@CustomDialog
+export struct SwitchingDeptDialog{
+  private scrollerList: Scroller = new Scroller()
+  //当前部门
+  @Link currentDept:string
+  @Link currentOrgId:number
+
+  @State selectDeptIndex: number = -1
+  //部门列表
+  @State departmentsList : DeptInfo[]=[]
+  loadStations = async () => {
+    this.departmentsList = await ProcessRequest.get('/api/v1/sys/dept/orgList', {})  as DeptInfo[];
+  };
+  controller: CustomDialogController
+  aboutToAppear(): void {
+    this.loadStations();
+  }
+
+  private onSelectStation(index: number) {
+    this.selectDeptIndex = index
+  }
+
+  build() {
+    Column() {
+      Column() {
+        Text("切换部门")
+          .fontColor($r('app.color.FFFFFF'))
+          .fontSize($r('app.float.fontSize_38'))
+      }
+      .height('8%')
+      .width('100%')
+      .justifyContent(FlexAlign.Center)
+
+      Column(){
+        List({space:10,scroller:this.scrollerList}) {
+          ForEach(this.departmentsList, (item:DeptInfo,index) => {
+            ListItem() {
+              Column(){
+                Text(item.deptName)
+                  .fontSize($r('app.float.fontSize_24'))
+                  .fontColor($r('app.color.FFFFFF'))
+              }  .backgroundColor(index === this.selectDeptIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF'))
+              .borderRadius($r('app.float.virtualSize_16'))
+              .padding(8)
+              .width('100%')
+              .height('12%')
+              .alignItems(HorizontalAlign.Center)
+              .justifyContent(FlexAlign.Center)
+              .border({
+                width: index === this.selectDeptIndex ? 2 : 0,
+                color: index === this.selectDeptIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF')
+              })
+              .onClick(() => {
+                this.onSelectStation(index)
+              })
+            }
+          })
+        }
+        .width('70%')
+        .height('100%')
+      }
+      .justifyContent(FlexAlign.SpaceEvenly)
+      .width('100%')
+      .height('81%')
+      .margin({ top: '2%'})
+
+      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.currentDept = this.departmentsList[this.selectDeptIndex].deptName??""
+            this.currentOrgId = this.departmentsList[this.selectDeptIndex].id??0
+            this.controller.close();
+          })
+        }
+      }
+      .width('100%')
+      .height('8%')
+
+    }
+    .height('71%')
+    .width('30%')
+    .backgroundColor($r('app.color.2A2A2A'))
+    .justifyContent(FlexAlign.End)
+    .alignItems(HorizontalAlign.Start)
+    .borderColor($r('app.color.000000'))
+    .borderWidth(1)
+    .borderRadius($r('app.float.virtualSize_16'))
+  }
+}
+
+

+ 14 - 13
entry/src/main/ets/view/SwitchingUserDialog.ets

@@ -1,17 +1,15 @@
-// 确认框
+// 切换用户
 import CommonConstants from '../common/constants/CommonConstants'
 import ProcessRequest from '../common/util/request/ProcessRequest'
-import { UserInfo } from '../viewmodel/process/UserInfo'
 import RequestParamModel from '../viewmodel/RequestParamModel'
-import promptAction from '@ohos.promptAction'
 
 @CustomDialog
 export struct SwitchingUserDialog {
-  @State username : string = 'admin'
-  @State password : string = '123456'
-  @Prop currentOrgId:number = 17
-  @Prop currentProCode:string = "PL000017"
-  @Prop currentStationId:string = "68"
+  @Link currentUserName : string
+  @State password : string = ''
+  @Prop currentOrgId:number = 0
+  @Prop currentPLCode:string = ''
+  @Prop currentStationId:string = ""
 
 
   controller: CustomDialogController
@@ -20,8 +18,8 @@ export struct SwitchingUserDialog {
     let token:string = await ProcessRequest.post('api/auth/aioLogin', {
       orgId:this.currentOrgId,
       password: this.password,
-      userName: this.username,
-      proCode: this.currentProCode,
+      userName: this.currentUserName,
+      proCode: this.currentPLCode,
       stationId: this.currentStationId
       } as RequestParamModel) ;
     if (!token || token.length == 0)  return
@@ -55,7 +53,7 @@ export struct SwitchingUserDialog {
             .fillColor($r('app.color.FFFFFF'))
             .margin({left:'2%'})
 
-          TextInput({text:this.username,placeholder:"请录入账户"})
+          TextInput({text:this.currentUserName,placeholder:"请录入账户"})
             .width('85%')
             .height('100%')
             .backgroundColor('#000000')
@@ -64,7 +62,7 @@ export struct SwitchingUserDialog {
             .placeholderColor($r('app.color.30FFFFFF'))
             .fontColor($r('app.color.FFFFFF'))
             .onChange((value: string) => {
-              this.username = value;
+              this.currentUserName = value;
 
             })
         }
@@ -121,7 +119,10 @@ export struct SwitchingUserDialog {
           }
           .justifyContent(FlexAlign.Center)
           .width('50%')
-          .onClick(() => this.controller.close())
+          .onClick(() => {
+            this.controller.close()
+            this.currentUserName=''
+          })
           Divider()
             .vertical(true)
             .strokeWidth(1)

+ 123 - 0
entry/src/main/ets/view/WorkInstructionsDialog.ets

@@ -0,0 +1,123 @@
+//作业指导
+import ProcessRequest from '../common/util/request/ProcessRequest'
+import { DrawingInfo } from '../viewmodel/DrawingInfo'
+import RequestParamModel from '../viewmodel/RequestParamModel'
+import CommonConstants from'../common/constants/CommonConstants'
+
+@CustomDialog
+export struct WorkInstructionsDialog {
+  private scrollerMaterial: Scroller = new Scroller()
+  //作业图片列表
+  @State drawingList: DrawingInfo[] = []
+
+  controller: CustomDialogController
+  onConfirm: () => void = () => {
+  }
+
+  //加载所有作业
+  loadWorkInstructions = async () => {
+    this.drawingList = await ProcessRequest.post('/api/v1/base/drawing/list', {
+    } as RequestParamModel) as DrawingInfo[];
+  };
+
+  aboutToAppear(): void {
+    this.loadWorkInstructions();
+  }
+
+  build() {
+    Column() {
+      Column() {
+        Text("作业指导")
+          .fontColor($r('app.color.FFFFFF'))
+          .fontSize($r('app.float.fontSize_38'))
+      }.height('8%')
+      .width('100%')
+      .justifyContent(FlexAlign.Center)
+
+      Column() {
+        Grid(this.scrollerMaterial) {
+          ForEach(this.drawingList, (item: DrawingInfo) => {
+            GridItem() {
+              Column(){
+                Image(CommonConstants.PICTURE_URL_PREFIX+item.drawingPath)
+                  .width('100%')
+                  .height('65%')
+                  .objectFit(ImageFit.Fill)
+                  .borderRadius($r('app.float.virtualSize_24'))
+                Column() {
+                  Text(`文件名称:${item.fileName}`)
+                    .fontSize($r('app.float.fontSize_16'))
+                    .fontColor($r('app.color.FFFFFF'))
+                    .textAlign(TextAlign.Start)
+                    .fontWeight(FontWeight.Lighter)
+                  Text(`文件编号: ${item.drawingCode}`)
+                    .fontColor($r('app.color.FFFFFF'))
+                    .fontSize($r('app.float.fontSize_16'))
+                    .fontWeight(FontWeight.Lighter)
+                    .textAlign(TextAlign.Start)
+                  Text(`版本号: ${item.drawingVersion} `)
+                    .fontColor($r('app.color.FFFFFF'))
+                    .fontSize($r('app.float.fontSize_16'))
+                    .fontWeight(FontWeight.Lighter)
+                    .textAlign(TextAlign.Start)
+                  Text(`上传时间: ${item.updated}`)
+                    .fontColor($r('app.color.FFFFFF'))
+                    .fontSize($r('app.float.fontSize_16'))
+                    .fontWeight(FontWeight.Lighter)
+                    .textAlign(TextAlign.Start)
+                  Text(`编辑人员: ${item.updator}`)
+                    .fontColor($r('app.color.FFFFFF'))
+                    .fontSize($r('app.float.fontSize_16'))
+                    .fontWeight(FontWeight.Lighter)
+                    .textAlign(TextAlign.Start)
+                }
+                .alignItems(HorizontalAlign.Start)
+                .height('35%')
+                .width('96%')
+                .margin({left:'4%',top:"2%"})
+              }
+            }
+            .height('50%')
+            .backgroundColor( $r('app.color.20FFFFFF')) // 选中状态加深
+            .borderRadius($r('app.float.virtualSize_24'))
+            // .onClick(() => {
+            // })
+          })
+        }
+        .columnsTemplate('1fr 1fr 1fr')
+        .columnsGap(10)
+        .rowsGap(10)
+        .width('100%')
+        .height('97%')
+        .padding(10)
+      }
+      .height('81%')
+      .margin({left:'1%',right:'1%'})
+
+      Column() {
+        Divider()
+          .vertical(false)
+          .strokeWidth(1)
+          .color($r('app.color.15FFFFFF'))
+        Row() {
+          Text('关闭')
+            .fontColor($r('app.color.60FFFFFF'))
+            .fontSize($r('app.float.fontSize_30'))
+        }
+        .width('100%')
+        .justifyContent(FlexAlign.Center)
+        .height('8%')
+        .width('50%')
+        .onClick(() => this.controller.close())
+      }
+    }
+    .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'))
+  }
+}

+ 16 - 0
entry/src/main/ets/viewmodel/DrawingInfo.ets

@@ -0,0 +1,16 @@
+export interface DrawingInfo{
+  //图片编号
+  drawingCode?:string
+  //图片标题
+  drawingTitle?:string
+  //版本
+  drawingVersion?:string
+  //上传时间
+  updated?:string
+  //上传人
+  updator?:string
+  //地址
+  drawingPath?:string
+  //文件名称
+  fileName?:string
+}

+ 51 - 0
entry/src/main/ets/viewmodel/process/UserInfo.ets

@@ -48,4 +48,55 @@ export  class UserAuthInfo {
   avatar?: string;
 
   isLogin?:boolean //是否是登录的状态
+}
+
+export class DeptInfo {
+  id?: number
+  // 部门名称
+  deptName?: string
+  // 组织id
+  orgId?: number
+}
+
+export class WorkstationInfo {
+  id?: string
+  // 工位名称
+  name?: string
+  //工位类型
+  stationDictValue?: string
+}
+
+export class ProductionLine {
+  // 产线code
+  code?: string
+  // 创建时间
+  created?: string
+  // 创建人
+  creato?: string
+  // 是否删除
+  deleted?: number
+  // 部门ID
+  deptId?: string
+  // 主键
+  id?: string
+  // 数级结构层级
+  level?: string
+  // 产线管理者
+  manager?: string
+  // 产线名称
+  name?: string
+  // 组织ID
+  orgId?: string
+  // 所属车间code
+  parentCode?: string
+  // 产线位置
+  position?: string
+  // 产线描述
+  remark?: string
+  // 修改时间
+  updated?: string
+  // 上次修改人
+  updator?: string
+  // 所属车间
+  workShopName?: string
 }

Plik diff jest za duży
+ 3 - 0
entry/src/main/resources/base/media/process_delete_seq.svg