Browse Source

完善rfid。

jiaxiaoqiang 8 months ago
parent
commit
389de6675e

+ 87 - 81
entry/src/main/ets/common/component/TitleStateComp.ets

@@ -12,41 +12,38 @@ import NoticeInfo from '../../model/NoticeInfo'
  * */
 @Component
 export struct TitleStateComp {
-  @State shutdownTransparency:number=0
-  @State bugNum:number | undefined=0
-  @State completeNum:number | undefined=0
-  @State kittingNum:number | undefined=0
-  @State planNum:number | undefined=0
+  @State shutdownTransparency: number = 0
+  @State bugNum: number | undefined = 0
+  @State completeNum: number | undefined = 0
+  @State kittingNum: number | undefined = 0
+  @State planNum: number | undefined = 0
   private isHomePage?: boolean = false
-  @State isClick:boolean = false
-
-  RfidController:CustomDialogController = new CustomDialogController({
+  @State isClick: boolean = false
+  RfidController: CustomDialogController = new CustomDialogController({
     builder: RfidAllocation({}),
     alignment: DialogAlignment.Center,
-    customStyle:true,
-    cancel:()=>{
-      this.isClick =! this.isClick
+    customStyle: true,
+    cancel: () => {
+      this.isClick = !this.isClick
     }
   })
   controller: TextClockController = new TextClockController()
-
   AvatarController: CustomDialogController = new CustomDialogController({
     builder: AvatarClick({}),
     alignment: DialogAlignment.TopEnd,
-    customStyle:true,
+    customStyle: true,
     offset: { dx: 0, dy: -25 },
-    cancel:()=>{
-      this.isClick =! this.isClick
+    cancel: () => {
+      this.isClick = !this.isClick
     }
   })
-
   // 消息弹窗控制器
-  noticeDialogController: CustomDialogController= new CustomDialogController({
+  noticeDialogController: CustomDialogController = new CustomDialogController({
     builder: NoticeDialog({}),
     alignment: DialogAlignment.Center,
-    customStyle:true,
-    cancel:()=>{
-      this.isClick =! this.isClick
+    customStyle: true,
+    cancel: () => {
+      this.isClick = !this.isClick
     }
   })
 
@@ -85,7 +82,7 @@ export struct TitleStateComp {
         .height('90%')
         .alignItems(VerticalAlign.Center)
         .justifyContent(FlexAlign.Start)
-        .padding({ left:px2vp(24)})
+        .padding({ left: px2vp(24) })
 
         Column() {
           Text(TimeUtil.getCurrentDate())
@@ -103,21 +100,21 @@ export struct TitleStateComp {
         .justifyContent(FlexAlign.Center)
 
         Row() {
-          Row(){
+          Row() {
             Image($r("app.media.hongDa_black"))
               .height(px2vp(48))
-              .width(px2vp(48))
-             // .backgroundColor(Color.Green)
+              .width(px2vp(48))// .backgroundColor(Color.Green)
               .onClick(() => {
                 router.pushUrl({
-                  url:'pages/SmartFactory'
+                  url: 'pages/SmartFactory'
                 })
               })
           }
           .height('100%')
           .width('7.2%')
           .justifyContent(FlexAlign.Center)
-          Row(){
+
+          Row() {
             Image($r('app.media.notice'))
               .height(px2vp(48))
               .width(px2vp(48))
@@ -125,13 +122,14 @@ export struct TitleStateComp {
           .height('100%')
           .width('7.2%')
           .justifyContent(FlexAlign.Center)
-          .onClick(()=>{
+          .onClick(() => {
             // router.pushUrl({
             //  // url:"pages/OutboundStation"
             // })
             this.noticeDialogController.open()
           })
-          Row(){
+
+          Row() {
             Image($r('app.media.box_edit'))
               .height(px2vp(48))
               .width(px2vp(48))
@@ -139,14 +137,15 @@ export struct TitleStateComp {
           .height('100%')
           .width('7.2%')
           .justifyContent(FlexAlign.Center)
-          .onClick(()=>{
+          .onClick(() => {
             router.pushUrl({
-             // url:'pages/Storage'
-              url:'pages/RfidAllocation'
+              // url:'pages/Storage'
+              url: 'pages/RfidAllocation'
             })
           })
-          Row({space: 2}) {
-            Column(){
+
+          Row({ space: 2 }) {
+            Column() {
               Text(CommonConstants.USER_NAME)
                 .fontSize($r('app.float.fontSize_20'))
                 .fontColor($r('app.color.general_font_color'))
@@ -154,11 +153,11 @@ export struct TitleStateComp {
                 .fontWeight(FontWeight.Medium)
                 .width('95%')
                 .maxLines(1)
-              Progress({value:this.completeNum!, total:this.planNum!, type: ProgressType.Linear})
+              Progress({ value: this.completeNum!, total: this.planNum!, type: ProgressType.Linear })
                 .width('95%')
                 .backgroundColor($r('app.color.grey_100'))
-                .style({strokeWidth:5})
-              Text('任务进度:'+ ((this.completeNum!) / (this.planNum!)) * 100 + '%')
+                .style({ strokeWidth: 5 })
+              Text('任务进度:' + ((this.completeNum!) / (this.planNum!)) * 100 + '%')
                 .fontSize($r('app.float.fontSize_14'))
                 .fontColor($r('app.color.general_font_color'))
                 .opacity($r('app.float.card_font_default_opacity'))
@@ -174,7 +173,7 @@ export struct TitleStateComp {
                 .width(px2vp(48))
                 .height(px2vp(48))
                 .borderRadius(px2vp(100))
-                .onClick(()=>{
+                .onClick(() => {
                   this.AvatarController.open()
                 })
             }
@@ -184,7 +183,7 @@ export struct TitleStateComp {
           .height('90%')
           .alignItems(VerticalAlign.Center)
           .justifyContent(FlexAlign.SpaceEvenly)
-          .onClick(()=>{
+          .onClick(() => {
             this.AvatarController.open()
           })
         }
@@ -202,10 +201,10 @@ export struct TitleStateComp {
     .height('8%')
   }
 }
+
 //登录退出
 @CustomDialog
 struct login {
-
   @Link textValue: string
   @Link inputValue: string
   controller: CustomDialogController
@@ -223,7 +222,7 @@ struct login {
         .textAlign(TextAlign.Center)
         .width('100%')
         .height('30%')
-      Row({space:10}){
+      Row({ space: 10 }) {
         Text('取消')
           .width('40%')
           .borderRadius(21)
@@ -231,7 +230,7 @@ struct login {
           .textAlign(TextAlign.Center)
           .backgroundColor('#0f000000')
           .fontColor('#0A59F7')
-          .onClick(()=>{
+          .onClick(() => {
             this.controller.close()
           })
         Text('确认')
@@ -241,11 +240,11 @@ struct login {
           .backgroundColor('#0A59F7')
           .textAlign(TextAlign.Center)
           .fontColor('#ffff')
-          .onClick(()=>{
+          .onClick(() => {
             this.controller.close()
             CommonConstants.LOGIN_OUT = true
-            router.pushUrl({
-              url:'pages/LoginPage'
+            router.replaceUrl({
+              url: 'pages/LoginPage'
             })
 
           })
@@ -254,7 +253,6 @@ struct login {
       .justifyContent(FlexAlign.Center)
       .height('30%')
 
-
     }.width('25%')
     .height('20%')
     .borderRadius(15)
@@ -265,43 +263,44 @@ struct login {
 //头像点击弹窗
 @CustomDialog
 struct AvatarClick {
-  @State shutdownTransparency:number=0
-  private cardType:number=0
-  @State cardSorting:number=0
-  @State cardServices: UniversalCard[]=[{}]
-  @State x:number=0
-  @State y:number=0
+  @State shutdownTransparency: number = 0
+  private cardType: number = 0
+  @State cardSorting: number = 0
+  @State cardServices: UniversalCard[] = [{}]
+  @State x: number = 0
+  @State y: number = 0
   @State textValue: string = ''
   @State inputValue: string = ''
-  @State avatarFrame:boolean=false
+  @State avatarFrame: boolean = false
   loginDialogController: CustomDialogController = new CustomDialogController({
-    builder:login({
+    builder: login({
       textValue: $textValue,
       inputValue: $inputValue,
     }),
     alignment: DialogAlignment.Center,
-    autoCancel:false,
-    customStyle:true
+    autoCancel: false,
+    customStyle: true
   })
   shutdownDialogController: CustomDialogController = new CustomDialogController({
-    builder:shutdown({
+    builder: shutdown({
       textValue: $textValue,
       inputValue: $inputValue,
-      shutdownTransparency:this.shutdownTransparency
+      shutdownTransparency: this.shutdownTransparency
     }),
     alignment: DialogAlignment.Center,
-    autoCancel:false,
-    customStyle:true
+    autoCancel: false,
+    customStyle: true
   })
   controller: CustomDialogController
+
   build() {
-    Column(){
+    Column() {
       Text('个人设置')
         .height('33%')
         .fontSize(px2vp(32))
         .fontWeight(FontWeight.Medium)
         .fontColor('#e6000000')
-        .onClick(()=>{
+        .onClick(() => {
           router.pushUrl({
             url: 'pages/SetPage'
           })
@@ -312,7 +311,7 @@ struct AvatarClick {
         .fontSize(px2vp(32))
         .fontWeight(FontWeight.Medium)
         .fontColor('#e6000000')
-        .onClick(()=>{
+        .onClick(() => {
           this.loginDialogController.open()
           this.controller.close()
         })
@@ -322,52 +321,56 @@ struct AvatarClick {
         .fontSize(px2vp(32))
         .fontWeight(FontWeight.Medium)
         .fontColor('#e6000000')
-        .onClick(()=>{
+        .onClick(() => {
           this.controller.close()
-          this.shutdownTransparency=1
+          this.shutdownTransparency = 1
           this.shutdownDialogController.open()
-          this.avatarFrame=!this.avatarFrame
+          this.avatarFrame = !this.avatarFrame
         })
 
-    }.width('15%')
+    }
+    .width('15%')
     .height('25%')
     .backgroundColor('#ffff')
-    .margin({top:'4%',right:'1%'})
+    .margin({ top: '4%', right: '1%' })
     .borderRadius(21)
   }
 }
+
 //开关重启
 @CustomDialog
 struct shutdown {
-  @Link shutdownTransparency:number
+  @Link shutdownTransparency: number
   @Link textValue: string
   @Link inputValue: string
   controller: CustomDialogController
+
   build() {
     Column() {
-      Row(){
+      Row() {
         Image($r('app.media.restart'))
           .width(px2vp(107))
           .height(px2vp(107))
-          .onClick(()=>{
-            this.shutdownTransparency=0
+          .onClick(() => {
+            this.shutdownTransparency = 0
             this.controller.close()
           })
         Blank()
         Image($r('app.media.shutdown'))
           .width(px2vp(107))
           .height(px2vp(107))
-          .onClick(()=>{
+          .onClick(() => {
             let pro = new process.ProcessManager();
             pro.exit(0);
-            this.shutdownTransparency=0
+            this.shutdownTransparency = 0
 
 
           })
 
       }.width('30%')
       .height('20%')
-      Row(){
+
+      Row() {
         Text('重启')
           .fontWeight(FontWeight.Medium)
           .fontSize(px2vp(27))
@@ -393,7 +396,8 @@ struct shutdown {
 
       }.width('30%')
       .height('20%')
-    }.width('100%')
+    }
+    .width('100%')
     .height('100%')
     .borderRadius(15)
     .backgroundColor('#cc000000')
@@ -408,8 +412,9 @@ struct shutdown {
 struct NoticeDialog {
   controller: CustomDialogController
   Notices: NoticeInfo[] = []
+
   build() {
-    Column({space: 10}) {
+    Column({ space: 10 }) {
       Row() {
         Text('通知')
           .fontSize($r('app.float.fontSize_38'))
@@ -417,11 +422,12 @@ struct NoticeDialog {
           .fontColor($r('app.color.general_font_color'))
           .opacity($r('app.float.general_font_opacity'))
       }
-      Row(){
-        List(){
-          ForEach(this.Notices, (item:NoticeInfo) => {
-            ListItem(){
-              Row(){
+
+      Row() {
+        List() {
+          ForEach(this.Notices, (item: NoticeInfo) => {
+            ListItem() {
+              Row() {
                 Text(item.Notice)
                   .fontSize($r('app.float.fontSize_38'))
                   .fontColor($r('app.color.general_font_color'))

+ 49 - 46
entry/src/main/ets/pages/Outbound.ets

@@ -3,18 +3,19 @@ import { CompleteSet } from '../view/CompleteSet'
 
 @Entry
 @Component
-struct Outbound{
+struct Outbound {
   //齐套按钮:0、手动出库:1、调仓:2.统计:3
-  @State inboundButton:number=0
+  @State inboundButton: number = 0
   //仓储和其他仓储点击按钮变色
-  @State warehouseButton:number=0
-  @State isHomePage:boolean=false
+  @State warehouseButton: number = 0
+  @State isHomePage: boolean = false
+
   build() {
-    Column(){
-      TitleStateComp({ isHomePage: this.isHomePage,})
-      Column(){
-        Row({space:10}){
-          Row(){
+    Column() {
+      TitleStateComp({ isHomePage: this.isHomePage, })
+      Column() {
+        Row({ space: 10 }) {
+          Row() {
             Text('智能仓储')
               .textAlign(TextAlign.Center)
               .borderRadius(px2vp(16))
@@ -22,31 +23,32 @@ struct Outbound{
               .height('100%')
               .fontWeight(FontWeight.Medium)
               .fontSize(px2vp(24))
-              .fontColor(this.warehouseButton===0?$r('app.color.black_90'):$r('app.color.black_60'))
-              .backgroundColor(this.warehouseButton===0?$r('app.color.process_divider_white_color'):'')
-              .onClick(()=>{
-                this.warehouseButton=0
+              .fontColor(this.warehouseButton === 0 ? $r('app.color.black_90') : $r('app.color.black_60'))
+              .backgroundColor(this.warehouseButton === 0 ? $r('app.color.process_divider_white_color') : '')
+              .onClick(() => {
+                this.warehouseButton = 0
               })
             Blank()
-            Text('其他仓储')
-              .textAlign(TextAlign.Center)
-              .borderRadius(px2vp(16))
-              .width('48%')
-              .height('100%')
-              .fontWeight(FontWeight.Medium)
-              .fontSize(px2vp(24))
-              .fontColor(this.warehouseButton===1?$r('app.color.black_90'):$r('app.color.black_60'))
-              .backgroundColor(this.warehouseButton===1?$r('app.color.process_divider_white_color'):'')
-              .onClick(()=>{
-                this.warehouseButton=1
-              })
+            // Text('其他仓储')
+            //   .textAlign(TextAlign.Center)
+            //   .borderRadius(px2vp(16))
+            //   .width('48%')
+            //   .height('100%')
+            //   .fontWeight(FontWeight.Medium)
+            //   .fontSize(px2vp(24))
+            //   .fontColor(this.warehouseButton===1?$r('app.color.black_90'):$r('app.color.black_60'))
+            //   .backgroundColor(this.warehouseButton===1?$r('app.color.process_divider_white_color'):'')
+            //   .onClick(()=>{
+            //     this.warehouseButton=1
+            //   })
 
 
           }.width('33%')
           .borderRadius(px2vp(15))
           .height('100%')
           .backgroundColor($r('app.color.black_10'))
-          Row(){
+
+          Row() {
             Text('齐套')
               .textAlign(TextAlign.Center)
               .borderRadius(px2vp(16))
@@ -54,10 +56,10 @@ struct Outbound{
               .height('100%')
               .fontWeight(FontWeight.Medium)
               .fontSize(px2vp(24))
-              .fontColor(this.inboundButton===0?$r('app.color.black_90'):$r('app.color.black_60'))
-              .backgroundColor(this.inboundButton===0?$r('app.color.process_divider_white_color'):'')
-              .onClick(()=>{
-                this.inboundButton=0
+              .fontColor(this.inboundButton === 0 ? $r('app.color.black_90') : $r('app.color.black_60'))
+              .backgroundColor(this.inboundButton === 0 ? $r('app.color.process_divider_white_color') : '')
+              .onClick(() => {
+                this.inboundButton = 0
               })
             Text('手动出库')
               .textAlign(TextAlign.Center)
@@ -66,10 +68,10 @@ struct Outbound{
               .height('100%')
               .fontWeight(FontWeight.Medium)
               .fontSize(px2vp(24))
-              .fontColor(this.inboundButton===1?$r('app.color.black_90'):$r('app.color.black_60'))
-              .backgroundColor(this.inboundButton===1?$r('app.color.process_divider_white_color'):'')
-              .onClick(()=>{
-                this.inboundButton=1
+              .fontColor(this.inboundButton === 1 ? $r('app.color.black_90') : $r('app.color.black_60'))
+              .backgroundColor(this.inboundButton === 1 ? $r('app.color.process_divider_white_color') : '')
+              .onClick(() => {
+                this.inboundButton = 1
               })
             Text('调仓')
               .textAlign(TextAlign.Center)
@@ -78,10 +80,10 @@ struct Outbound{
               .height('100%')
               .fontWeight(FontWeight.Medium)
               .fontSize(px2vp(24))
-              .fontColor(this.inboundButton===2?$r('app.color.black_90'):$r('app.color.black_60'))
-              .backgroundColor(this.inboundButton===2?$r('app.color.process_divider_white_color'):'')
-              .onClick(()=>{
-                this.inboundButton=2
+              .fontColor(this.inboundButton === 2 ? $r('app.color.black_90') : $r('app.color.black_60'))
+              .backgroundColor(this.inboundButton === 2 ? $r('app.color.process_divider_white_color') : '')
+              .onClick(() => {
+                this.inboundButton = 2
               })
             Text('统计')
               .textAlign(TextAlign.Center)
@@ -90,10 +92,10 @@ struct Outbound{
               .height('100%')
               .fontWeight(FontWeight.Medium)
               .fontSize(px2vp(24))
-              .fontColor(this.inboundButton===3?$r('app.color.black_90'):$r('app.color.black_60'))
-              .backgroundColor(this.inboundButton===3?$r('app.color.process_divider_white_color'):'')
-              .onClick(()=>{
-                this.inboundButton=3
+              .fontColor(this.inboundButton === 3 ? $r('app.color.black_90') : $r('app.color.black_60'))
+              .backgroundColor(this.inboundButton === 3 ? $r('app.color.process_divider_white_color') : '')
+              .onClick(() => {
+                this.inboundButton = 3
               })
           }.width('67%')
           .borderRadius(px2vp(15))
@@ -101,17 +103,18 @@ struct Outbound{
           .backgroundColor($r('app.color.black_10'))
         }.width('100%')
         .height('8%')
-        if (this.warehouseButton===0&&this.inboundButton===0){
-          Column(){
+
+        if (this.warehouseButton === 0 && this.inboundButton === 0) {
+          Column() {
             CompleteSet()
           }.width('100%')
-            .height('92%')
+          .height('92%')
 
         }
 
       }.width('100%')
       .height('92%')
-      .padding({left:px2vp(50),right:px2vp(50)})
+      .padding({ left: px2vp(50), right: px2vp(50) })
       .backgroundColor($r('app.color.white_f1f3f5'))
     }.width('100%')
     .height('100%')

+ 6 - 1
entry/src/main/ets/pages/RfidAllocation.ets

@@ -83,9 +83,10 @@ export struct RfidAllocation {
     );
     return res
   }
+  currentTimer: number = -1
 
   aboutToAppear(): void {
-    setInterval(async () => {
+    this.currentTimer = setInterval(async () => {
       this.RfidHttp().then((res: RfidClass) => {
 
         console.log('textTag', '-------rfid获取信息' + JSON.stringify(res))
@@ -95,6 +96,10 @@ export struct RfidAllocation {
 
   }
 
+  aboutToDisappear(): void {
+    clearInterval(this.currentTimer)
+  }
+
   //后端料箱绑定
   newMaterialBox = async (): Promise<newMaterialBoxList> => {
     let obj: newMaterialBoxList = {}

File diff suppressed because it is too large
+ 447 - 383
entry/src/main/ets/pages/SmartFactory.ets


+ 33 - 30
entry/src/main/ets/pages/WarehouseMap.ets

@@ -39,7 +39,7 @@ export struct WarehouseMap {
   @State carYCoordinate: number = 10
   @State carXCoordinate: number = 10
   @State carYCoordinate1: number = 8
-  @State carXCoordinate1: number = 8
+  @State carXCoordinate1: number = 9
   //调入xy坐标
   @State YCoordinateIn: number = 0
   @State XCoordinateIn: number = 0
@@ -121,6 +121,8 @@ export struct WarehouseMap {
       this.carXCoordinate = res.data.x!
     }
     console.log('textTag', '----------' + JSON.stringify(res));
+    console.log('textTag', '----------' + JSON.stringify(this.carYCoordinate));
+    console.log('textTag', '----------' + JSON.stringify(this.carXCoordinate));
     return res
   }
   // 获取仓库坐标信息,x和y轴的信息
@@ -134,6 +136,7 @@ export struct WarehouseMap {
 
   aboutToAppear(): void {
     this.getStorageXYData()
+
     this.CarPositionHttp().then((res: carPositionClass) => {
 
       console.log('textTag', '-------car现在的位置执行情况结果 cccccc11' + JSON.stringify(res))
@@ -144,16 +147,16 @@ export struct WarehouseMap {
   build() {
     Row() {
       Column() {
-        Button(this.JobHopping == 0 ? '启动调仓' : '停止调仓', { type: ButtonType.Normal, stateEffect: true })
+        Button(this.JobHopping === 0 ? '启动调仓' : '停止调仓', { type: ButtonType.Normal, stateEffect: true })
           .borderRadius(8)
           .borderRadius(px2vp(76))
-          .backgroundColor(this.JobHopping == 0 ? $r('app.color.blue_100') : $r('app.color.red_100'))
+          .backgroundColor(this.JobHopping === 0 ? $r('app.color.blue_100') : $r('app.color.red_100'))
           .width(px2vp(292))
           .height(px2vp(80))
           .onClick(() => {
-            if (this.JobHopping == 0) {
+            if (this.JobHopping === 0) {
               this.promptsController.open()
-            } else if (this.JobHopping == 1) {
+            } else if (this.JobHopping === 1) {
               this.JobHopping = 0
             }
           })
@@ -174,7 +177,7 @@ export struct WarehouseMap {
                   .fontColor($r('app.color.black_100'))
                   .textAlign(TextAlign.Center)
                   .border({ width: px2vp(1) })
-                  .backgroundColor((index == (this.selectStorey - 1)) ? $r('app.color.red_100') : index >= (6 - this.storeyNumber) ? $r('app.color.green_100') : $r('app.color.white_f1f3f5'))
+                  .backgroundColor((index === (this.selectStorey - 1)) ? $r('app.color.red_100') : index >= (6 - this.storeyNumber) ? $r('app.color.green_100') : $r('app.color.white_f1f3f5'))
                   .borderRadius(px2vp(16))
                   .onClick(() => {
                     if (index >= (6 - this.storeyNumber)) {
@@ -256,7 +259,7 @@ export struct WarehouseMap {
           }
           .listDirection(Axis.Horizontal)
           .scrollBar(BarState.Off)
-          .width(px2vp(1620))
+          .width(px2vp(2000))
           .height(px2vp(55))
 
           List({ space: px2vp(1) }) {
@@ -267,32 +270,32 @@ export struct WarehouseMap {
                     ListItem() {
                       if (x >= 0) {
                         Stack() {
-                          Text(x == 999 ? '' : x.toString())
+                          Text(x === 0 ? '' : x.toString())
                             .width(px2vp(55))
                             .height(px2vp(55))
                             .fontColor($r('app.color.blue_100'))
                             .textAlign(TextAlign.Center)
                             .border({ width: px2vp(1), color: '#7DC8EA' })
-                            .backgroundColor(x == 999 ? '#E84026 ' : x == 0 ? $r('app.color.white_f1f3f5') : (this.SelectOut == 1 || this.SelectEnter == 1) ? $r('app.color.green_100') : '')
-                          if (this.routeIndexSwitch == 1) {
+                            .backgroundColor(x == 999 ? '#E84026 ' : x === 0 ? $r('app.color.white_f1f3f5') : (this.SelectOut === 1 || this.SelectEnter === 1) ? $r('app.color.green_100') : '')
+                          if (this.routeIndexSwitch === 1) {
                             //for (let num = 0; num < this.route.length; num++) {
                             Text()
                               .width(px2vp(55))
                               .height(px2vp(55))
                               .fontColor($r('app.color.black_100'))
                               .textAlign(TextAlign.Center)
-                            //  .backgroundColor((index1==this.route[this.routeIndex].YRoute&&index2==this.route[this.routeIndex].xRoute)?$r('app.color.green_100'):'')
+                            //  .backgroundColor((index1===this.route[this.routeIndex].YRoute&&index2===this.route[this.routeIndex].xRoute)?$r('app.color.green_100'):'')
                             // }
 
                           }
 
                           Row() {
-                            Image((index1 == this.carYCoordinate && index2 == this.carXCoordinate) ? $r('app.media.robot_top') : (index1 == this.carYCoordinate && index2 == this.carXCoordinate + 1) ? $r("app.media.robot_arm") : (index1 == this.carYCoordinate1 && index2 == this.carXCoordinate1) ? $r('app.media.car_top') : (index1 == this.carYCoordinate1 && index2 == this.carXCoordinate1 - 1) ? $r('app.media.car_bottom') : '')
+                            Image((index1 === this.carYCoordinate && index2 === this.carXCoordinate) ? $r('app.media.robot_top') : (index1 === this.carYCoordinate && index2 === this.carXCoordinate + 1) ? $r("app.media.robot_arm") : (index1 === this.carYCoordinate1 && index2 === this.carXCoordinate1) ? $r('app.media.car_top') : (index1 === this.carYCoordinate1 && index2 === this.carXCoordinate1 - 1) ? $r('app.media.car_bottom') : '')
                               .width(px2vp(55))
                               .height(px2vp(55))
                               .margin({ right: px2vp(55) })
                               .onClick(() => {
-                                if (x != -1 && this.SelectOut == 1) {
+                                if (x !== -1 && this.SelectOut === 1) {
                                   this.YCoordinate = index1
                                   this.XCoordinate = index2
                                   this.SelectOut = 2
@@ -307,12 +310,12 @@ export struct WarehouseMap {
                           .width(px2vp(55))
                           .height(px2vp(55))
 
-                          if ((this.outSvg == 1)) {
-                            Image(((index1 == this.YCoordinate && index2 == this.XCoordinate)) ? $r('app.media.Retrieve_grid') : '')
+                          if ((this.outSvg === 1)) {
+                            Image(((index1 === this.YCoordinate && index2 === this.XCoordinate)) ? $r('app.media.Retrieve_grid') : '')
                               .width(px2vp(55))
                               .height(px2vp(55))
                               .onClick(() => {
-                                if (x !== -1 && this.SelectEnter == 1 && this.SelectOut == 2) {
+                                if (x !== -1 && this.SelectEnter === 1 && this.SelectOut === 2) {
                                   this.YCoordinateIn = index1
                                   this.XCoordinateIn = index2
                                   this.SelectEnter = 2
@@ -321,8 +324,8 @@ export struct WarehouseMap {
                                 }
                               })
                           }
-                          if (this.enterSvg == 1) {
-                            Image((((index1 == this.YCoordinateIn && index2 == this.XCoordinateIn))) ? $r('app.media.Transfer_grid') : '')
+                          if (this.enterSvg === 1) {
+                            Image((((index1 === this.YCoordinateIn && index2 === this.XCoordinateIn))) ? $r('app.media.Transfer_grid') : '')
                               .width(px2vp(55))
                               .height(px2vp(55))
 
@@ -344,14 +347,14 @@ export struct WarehouseMap {
             })
           }
           .scrollBar(BarState.Off)
-        }.width(px2vp(1620))
+        }.width(px2vp(2000))
         .height(px2vp(800))
 
       }
-      .width(px2vp(1620))
+      .width(px2vp(1020))
       .height(px2vp(800))
       .scrollable(ScrollDirection.Horizontal) // 滚动方向纵向
-      if (this.JobHopping == 1) {
+      if (this.JobHopping === 1) {
         Column() {
           Column() {
             Row() {
@@ -364,14 +367,14 @@ export struct WarehouseMap {
             }
 
             Blank()
-            Button(this.SelectOut == 2 ? '取消选择' : '选调出料格', { type: ButtonType.Normal, stateEffect: true })
+            Button(this.SelectOut === 2 ? '取消选择' : '选调出料格', { type: ButtonType.Normal, stateEffect: true })
               .borderRadius(8)
-              .backgroundColor(this.SelectOut == 2 ? $r('app.color.red_100') : $r('app.color.blue_100'))
+              .backgroundColor(this.SelectOut === 2 ? $r('app.color.red_100') : $r('app.color.blue_100'))
               .width(px2vp(292))
               .borderRadius(px2vp(76))
               .height(px2vp(80))
               .onClick(() => {
-                if (this.SelectOut == 0 || this.SelectOut == 2) {
+                if (this.SelectOut === 0 || this.SelectOut === 2) {
                   this.SelectOut = 1
                   this.YCoordinate = 0
                   this.XCoordinate = 0
@@ -399,17 +402,17 @@ export struct WarehouseMap {
               .width(px2vp(410))
               .textAlign(TextAlign.Start)
             Blank()
-            Button(this.SelectEnter == 2 ? '取消选择' : '选调入料格', { type: ButtonType.Normal, stateEffect: true })
+            Button(this.SelectEnter === 2 ? '取消选择' : '选调入料格', { type: ButtonType.Normal, stateEffect: true })
               .borderRadius(8)
-              .backgroundColor(this.SelectEnter == 3 ? $r('app.color.blue_100') : this.SelectEnter == 2 ? $r('app.color.red_100') : $r('app.color.blue_20'))
+              .backgroundColor(this.SelectEnter === 3 ? $r('app.color.blue_100') : this.SelectEnter === 2 ? $r('app.color.red_100') : $r('app.color.blue_20'))
               .width(px2vp(292))
               .height(px2vp(80))
               .borderRadius(px2vp(76))
               .onClick(() => {
-                if (this.SelectEnter == 3) {
+                if (this.SelectEnter === 3) {
                   this.SelectEnter = 1
                   console.log('textTag' + '-----' + this.SelectEnter)
-                } else if (this.SelectEnter == 2) {
+                } else if (this.SelectEnter === 2) {
                   this.SelectEnter = 1
                   //this.outSvg=0
                   this.enterSvg = 0
@@ -495,7 +498,7 @@ export struct WarehouseMap {
 
           Button('确认调仓', { type: ButtonType.Normal, stateEffect: true })
             .borderRadius(8)
-            .backgroundColor(this.SelectEnter == 2 ? $r('app.color.blue_100') : $r('app.color.blue_20'))
+            .backgroundColor(this.SelectEnter === 2 ? $r('app.color.blue_100') : $r('app.color.blue_20'))
             .width(px2vp(292))
             .height(px2vp(80))
             .borderRadius(px2vp(76))
@@ -523,7 +526,7 @@ export struct WarehouseMap {
         }.width(px2vp(450))
         .height(px2vp(800))
         .margin({ left: px2vp(24) })
-      } else if (this.JobHopping == 1) {
+      } else if (this.JobHopping === 1) {
 
       }
 

+ 6 - 35
entry/src/main/ets/view/CompleteSet.ets

@@ -166,34 +166,6 @@ export struct CompleteSet {
     this.rfidTimer = setInterval(() => {
       this.rfidInfoIntervalFun()
     }, 1000)
-    //todo 自动入库,打开可能要实际情况调整一下
-    //打开页面0.5s请求一次硬件,当io(有无料箱)和weight(重量)发送变化时执行改变数据,同时通过RFID请求读取料箱里面物料信息
-    // setInterval(async () => {
-    // // this.locationRequest().then((res:stat3)=>{
-    // //      this.entranceWaiting.push(res)
-    // //   console.log('testTag1'+'-------------'+JSON.stringify(res))
-    // //   })
-    //   //测试
-    //  // this.materialGridStatus=1
-    //   if (Number(this.entranceWaiting[0].io!)!==this.materialGridStatus) {
-    //
-    //     this.materialGridStatus=Number(this.entranceWaiting[0].io!)
-    // //todo 测试ZJ-JG015
-    //    // this.vehicleNo="ZJ-JG015"
-    //     this.vehicleNo=this.entranceWaiting[0].rfid!
-    //     //先查询点击的料箱物流信息用于展示在回库下面
-    //     this.boxMaterialHttp().then((res :boxMaterialClass[]) => {
-    //       console.log('testTag', 'result cccccc22'+JSON.stringify(res))
-    //       if (res && res.length > 0) {
-    //         this.boxMaterials = res
-    //         this.vehicleLevel=res[0].vehicleLevel!
-    //       }
-    //     })
-    //
-    //   }
-    //
-    //
-    // }, 500);
 
     // 查询订单数据
     let res = await this.queryOrderPage()
@@ -295,7 +267,11 @@ export struct CompleteSet {
       bottom: 150
     });
 
-    this.boxMaterials = []
+    if (!this.recentlyRecordObject.rfid) {
+      // 当盒子被小车吊走了才清空
+      this.boxMaterials = []
+    }
+
 
     return res
 
@@ -756,12 +732,7 @@ export struct CompleteSet {
           .margin({ bottom: px2vp(20) })
           .backgroundColor(this.materialGridStatus === 1 ? $r('app.color.green_100') : this.materialGridStatus === 0 ? $r('app.color.Green_20') : '')
           .onClick(() => {
-            if (this.materialGridStatus === 1) {
-              //执行硬件入库
-              // this.warehousingHttp().then((res: boxMaterialClass) => {
-              //   console.log('testTag1', '-------result cccccc11' + JSON.stringify(res))
-              //
-              // })
+            if (this.materialGridStatus === 1 && this.boxMaterials.length > 0) {
               //执行后端入库操作
               this.Warehousing()
             }

File diff suppressed because it is too large
+ 12 - 12
entry/src/main/ets/view/ManualOutbound.ets


+ 67 - 49
entry/src/main/ets/view/UserInfoSetView.ets

@@ -13,24 +13,25 @@ struct About {
   @Link textValue: string
   @Link inputValue: string
   controller: CustomDialogController
+
   // 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后
-  build(){
-    Column(){
+  build() {
+    Column() {
       Text().width("100%")
         .height('13%')
-        .onClick(()=>{
+        .onClick(() => {
           this.controller.close()
 
         })
-      Row(){
+      Row() {
         Text().width('25%')
           .height('100%')
-          .onClick(()=>{
+          .onClick(() => {
             this.controller.close()
 
           })
         Blank()
-        Column({space:10}){
+        Column({ space: 10 }) {
           Text('关于')
             .fontSize($r('app.float.fontSize_38'))
             .fontColor('#e6000000')
@@ -41,49 +42,53 @@ struct About {
             .height(px2vp(197))
             .borderRadius(15)
 
-          Column({space:1}){
-            Row(){
+          Column({ space: 1 }) {
+            Row() {
               Text('型号名称')
               Blank()
               Text('JG Industrial Pad')
 
             }
-            .padding({left:10,right:10})
+            .padding({ left: 10, right: 10 })
             .width('100%')
             .height('22%')
+
             Divider()
               .width('95%')
-            Row(){
+            Row() {
               Text('型号代码')
               Blank()
               Text('JG-W2024')
 
             }
-            .padding({left:10,right:10})
+            .padding({ left: 10, right: 10 })
             .width('100%')
             .height('22%')
+
             Divider()
               .width('95%')
-            Row(){
+            Row() {
               Text('OpenHarmonyOS版本')
               Blank()
               Text('4.0.0')
 
             }
-            .padding({left:10,right:10})
+            .padding({ left: 10, right: 10 })
             .width('100%')
             .height('22%')
+
             Divider()
               .width('95%')
-            Row(){
+            Row() {
               Text('序列号')
               Blank()
               Text('5JB0224111001129')
 
             }
-            .padding({left:10,right:10})
+            .padding({ left: 10, right: 10 })
             .width('100%')
             .height('22%')
+
             Divider().width('95%')
           }
           .width(px2vp(883))
@@ -91,8 +96,9 @@ struct About {
           .backgroundColor('#ffff')
 
           .borderRadius(15)
-          Column(){
-            Row(){
+
+          Column() {
+            Row() {
               Text('运行内存')
                 .fontSize('32px')
               Blank()
@@ -102,10 +108,11 @@ struct About {
 
             }.width('100%')
             .height('40%')
-            .padding({left:10,right:10})
+            .padding({ left: 10, right: 10 })
+
             Divider()
               .width('95%')
-            Row(){
+            Row() {
               Row() {
                 Text('存储')
                   .height('100%')
@@ -115,7 +122,7 @@ struct About {
               .justifyContent(FlexAlign.Center)
 
               Blank()
-              Column(){
+              Column() {
                 Text('可用空间:222.5GB')
                   .fontSize('27px')
                 Text('总内存:256GB')
@@ -130,21 +137,23 @@ struct About {
             .justifyContent(FlexAlign.Center)
             .width('100%')
             .height('60%')
-            .padding({left:10,right:10})
+            .padding({ left: 10, right: 10 })
           }
           .width(px2vp(883))
           .height(px2vp(154))
           .borderRadius($r('app.float.general_border_radius'))
           .backgroundColor('#ffff')
-        }.width(px2vp(924))
+        }
+        .width(px2vp(924))
         .padding(10)
         .height(px2vp(804))
         .borderRadius(15)
         .backgroundColor('#F1F3F5')
+
         Blank()
         Text().width('25%')
           .height('100%')
-          .onClick(()=>{
+          .onClick(() => {
             this.controller.close()
 
           })
@@ -154,7 +163,7 @@ struct About {
 
       Text().width("100%")
         .height('13%')
-        .onClick(()=>{
+        .onClick(() => {
           this.controller.close()
         })
     }.width("100%")
@@ -169,15 +178,19 @@ export struct UserInfoSetView {
   @State mediaBean: MediaBean = new MediaBean();
   @State textValue: string = ''
   @State inputValue: string = ''
+
   onCancel() {
     console.info('onCancel')
   }
+
   onAccept() {
     console.info(' onAccept')
   }
+
   existApp() {
     console.info(' existApp')
   }
+
   //关于弹窗控制器
   AboutDialogController: CustomDialogController = new CustomDialogController({
     builder: About({
@@ -193,11 +206,11 @@ export struct UserInfoSetView {
     gridCount: 4,
     customStyle: true,
   })
+  @State SetUp: number = 0
 
-  @State SetUp:number=0
-  build(){
-    Row(){
-      Column({space:10}){
+  build() {
+    Row() {
+      Column({ space: 10 }) {
         Text()
           .height('15%')
         Image(CommonConstants.USER_AVATAR && CommonConstants.USER_AVATAR.length > 0 ? CommonConstants.FILE_URL_PREFIX + CommonConstants.USER_AVATAR : this.mediaBean.localUrl)
@@ -218,12 +231,12 @@ export struct UserInfoSetView {
           .borderRadius($r('app.float.robot_set_radius'))
           .textAlign(TextAlign.Center)
           .backgroundColor('#0f000000')
-          .onClick(()=> {
+          .onClick(() => {
             CommonConstants.AUTH_TOKEN = ''
             CommonConstants.USER_ID = 0
             CommonConstants.LOGIN_OUT = true
-            router.pushUrl({
-              url:'pages/LoginPage'
+            router.replaceUrl({
+              url: 'pages/LoginPage'
             })
           })
         Blank()
@@ -231,7 +244,7 @@ export struct UserInfoSetView {
       .width('34%')
       .height('100%')
 
-      Column(){
+      Column() {
         Text('用户')
           .fontColor('#e6000000')
           .width('100%')
@@ -241,8 +254,8 @@ export struct UserInfoSetView {
           .fontWeight(FontWeight.Medium)
           .opacity($r('app.float.general_font_opacity'))
 
-        Row(){
-          Column({space: 5}){
+        Row() {
+          Column({ space: 5 }) {
             Text('保持登录')
               .fontSize($r('app.float.fontSize_24'))
               .fontColor($r('app.color.general_font_color'))
@@ -258,13 +271,14 @@ export struct UserInfoSetView {
           .justifyContent(FlexAlign.Center)
           .height('100%')
           .width('80%')
+
           Row() {
-            Toggle({ type: ToggleType.Switch,isOn: true })
+            Toggle({ type: ToggleType.Switch, isOn: true })
               .width('96px')
               .height('53px')
               .onChange(async (isOn: boolean) => {
                 let userInfo = await UserAuthModel.getLast()
-                if (userInfo===undefined) {
+                if (userInfo === undefined) {
                   return
                 }
                 if (isOn) {
@@ -279,16 +293,17 @@ export struct UserInfoSetView {
           .height('100%')
           .width('20%')
           .justifyContent(FlexAlign.End)
-          .padding({right: 5})
-        }.width('100%')
+          .padding({ right: 5 })
+        }
+        .width('100%')
         .height('16.3%')
         .margin(5)
         .backgroundColor($r('app.color.general_card_background_color'))
         .borderRadius($r('app.float.general_border_radius'))
-        .padding({left:10})
+        .padding({ left: 10 })
 
-        Row(){
-          Column({space: 5}){
+        Row() {
+          Column({ space: 5 }) {
             Text('技能')
               .fontSize($r('app.float.fontSize_24'))
               .fontColor($r('app.color.general_font_color'))
@@ -304,6 +319,7 @@ export struct UserInfoSetView {
           .justifyContent(FlexAlign.Center)
           .height('100%')
           .width('80%')
+
           Row() {
             Image($r('app.media.subscript_space'))
               .height($r('app.float.card_subscript_new_size'))
@@ -313,20 +329,21 @@ export struct UserInfoSetView {
           .justifyContent(FlexAlign.End)
           .height('100%')
           .width('20%')
-        }.width('100%')
+        }
+        .width('100%')
         .height('16.3%')
         .margin(5)
         .backgroundColor($r('app.color.general_card_background_color'))
         .borderRadius($r('app.float.general_border_radius'))
-        .padding({left:10})
+        .padding({ left: 10 })
 
         Text('其他')
           .width('100%')
           .fontSize($r('app.float.fontSize_30'))
           .fontColor($r('app.color.general_font_color'))
           .opacity($r('app.float.general_font_opacity'))
-        Row(){
-          Column(){
+        Row() {
+          Column() {
             Text('关于')
               .fontSize($r('app.float.fontSize_24'))
               .fontColor($r('app.color.general_font_color'))
@@ -337,6 +354,7 @@ export struct UserInfoSetView {
           .justifyContent(FlexAlign.Center)
           .height('100%')
           .width('80%')
+
           Row() {
             Image($r('app.media.subscript_space'))
               .height($r('app.float.card_subscript_new_size'))
@@ -346,13 +364,14 @@ export struct UserInfoSetView {
           .justifyContent(FlexAlign.End)
           .height('100%')
           .width('20%')
-        }.width('100%')
+        }
+        .width('100%')
         .height('16.3%')
         .margin(5)
         .backgroundColor($r('app.color.general_card_background_color'))
         .borderRadius($r('app.float.general_border_radius'))
-        .padding({left:10})
-        .onClick(()=>{
+        .padding({ left: 10 })
+        .onClick(() => {
           this.AboutDialogController.open()
         })
 
@@ -365,6 +384,5 @@ export struct UserInfoSetView {
     .height('100%')
     .backgroundColor('#F1F3F5')
   }
-
 }