1
0
فهرست منبع

齐套修改。

jiaxiaoqiang 8 ماه پیش
والد
کامیت
aea8184417
3فایلهای تغییر یافته به همراه194 افزوده شده و 146 حذف شده
  1. 14 14
      entry/src/main/ets/pages/OutboundStation.ets
  2. 159 120
      entry/src/main/ets/pages/RfidAllocation.ets
  3. 21 12
      entry/src/main/ets/view/CompleteSet.ets

+ 14 - 14
entry/src/main/ets/pages/OutboundStation.ets

@@ -82,19 +82,19 @@ struct OutboundStation {
                 this.inboundButton = 1
               })
 
-            Text('物料流转')
-              .textAlign(TextAlign.Center)
-              .borderRadius(px2vp(16))
-              .width(px2vp(292))
-              .height(px2vp(80))
-              .fontWeight(FontWeight.Medium)
-              .fontSize(px2vp(24))
-              .fontColor(this.inboundButton === 4 ? $r('app.color.black_90') : $r('app.color.black_60'))
-              .backgroundColor(this.inboundButton === 4 ? $r('app.color.process_divider_white_color') : '')
-              .onClick(() => {
-                this.Button = 1
-                this.inboundButton = 4
-              })
+            // Text('物料流转')
+            //   .textAlign(TextAlign.Center)
+            //   .borderRadius(px2vp(16))
+            //   .width(px2vp(292))
+            //   .height(px2vp(80))
+            //   .fontWeight(FontWeight.Medium)
+            //   .fontSize(px2vp(24))
+            //   .fontColor(this.inboundButton === 4 ? $r('app.color.black_90') : $r('app.color.black_60'))
+            //   .backgroundColor(this.inboundButton === 4 ? $r('app.color.process_divider_white_color') : '')
+            //   .onClick(() => {
+            //     this.Button = 1
+            //     this.inboundButton = 4
+            //   })
             Text('调仓')
               .textAlign(TextAlign.Center)
               .borderRadius(px2vp(16))
@@ -120,7 +120,7 @@ struct OutboundStation {
                 this.inboundButton = 3
               })
 
-          }.width(px2vp(1240))
+          }.width(px2vp(1240 - 292))
           .borderRadius(px2vp(16))
           .height(px2vp(80))
           .backgroundColor($r('app.color.black_10'))

+ 159 - 120
entry/src/main/ets/pages/RfidAllocation.ets

@@ -53,6 +53,9 @@ export struct RfidAllocation {
   @State private newMaterialBin: Array<newMaterialBin> = []
   //读取到的rfid信息
   @State private httpRfid: RfidClass = {}
+  // 前缀和流水号
+  @State prefix: string = "XF-"
+  @State suffix: string = ""
   //获取rfid
   @State private recentlyRecordObject: StationInfoModel = {}
   RfidHttp = async (): Promise<RfidClass> => {
@@ -166,6 +169,7 @@ export struct RfidAllocation {
             .alignItems(HorizontalAlign.Start)
 
             Row() {
+
               Button('新建料箱')
                 .width(px2vp(292))
                 .height(px2vp(80))
@@ -182,7 +186,13 @@ export struct RfidAllocation {
                   (dateTime.getHours()).toString().padStart(2, '0') + (dateTime.getMinutes() + 1).toString()
                     .padStart(2, '0')
                     + (dateTime.getSeconds()).toString().padStart(2, '0') + (this.newBox < 10 ? 0 : '') + this.newBox
-                  this.coding = coding
+
+
+                  this.coding = this.prefix + this.suffix.padStart(5, "0")
+
+                  this.suffix = `${Number(this.suffix) + 1}`
+
+
                   let data = dateTime.getFullYear() + '-' + (dateTime.getMonth() + 1).toString().padStart(2, '0')
                     + '-' + (dateTime.getDate().toString().padStart(2, '0'))
                   this.MaterialBoxData = data
@@ -202,40 +212,63 @@ export struct RfidAllocation {
                   }
                   this.newMaterialBin.unshift(obj)
                 })
+
               Blank()
-              Row() {
-                Image($r('app.media.shaoma'))
-                  .width(px2vp(32))
-                  .height(px2vp(32))
-                  .margin({ left: $r('app.float.fontSize_30') })
-                TextInput({ text: this.boxCode,
-                  placeholder: '请点击扫码或者输入物料编码',
-                  controller: this.textcontroller })
-                  .width('92%')
-                  .height('100%')
-                  .width(px2vp(450))
-                  .fontWeight(FontWeight.Medium)
-                  .fontSize($r('app.float.fontSize_24'))
-                  .backgroundColor("#ffff")
-                  .borderRadius(21)
-                  .onSubmit(() => {
 
-                  })
-                Image($r('app.media.search'))
-                  .width(px2vp(32))
-                  .height(px2vp(32))
-                  .margin({ right: $r('app.float.fontSize_30') })
+              Button('清空')
+                .width(px2vp(192))
+                .height(px2vp(80))
+                .fontSize($r('app.float.fontSize_24'))
+                .fontWeight(FontWeight.Medium)
+                .fontColor($r('app.color.process_divider_white_color'))
+                .onClick(() => {
+                  this.newMaterialBin = []
+                })
+
+              Text('前缀: ')
+                .fontSize($r('app.float.fontSize_30'))
+                .fontWeight(FontWeight.Medium)
+                .fontColor($r('app.color.black_90'))
+                .height(px2vp(50))
+                .margin({ right: 5, left: 5 })
+
+              TextInput({ text: this.prefix })
+                .fontSize($r('app.float.fontSize_24'))
+                .fontWeight(FontWeight.Medium)
+                .fontColor($r('app.color.black_90'))
+                .width(100)
+                .height(50)
+                .onChange((value) => {
+                  this.prefix = value
+                })
+
+              Blank()
+
+              Text('起始流水号: ')
+                .fontSize($r('app.float.fontSize_30'))
+                .fontWeight(FontWeight.Medium)
+                .fontColor($r('app.color.black_90'))
+                .height(px2vp(50))
+                .margin({ right: 5, left: 5 })
+
+              TextInput({ text: this.suffix })
+                .fontSize($r('app.float.fontSize_24'))
+                .fontWeight(FontWeight.Medium)
+                .fontColor($r('app.color.black_90'))
+                .width(100)
+                .height(50)
+                .onChange((value) => {
+                  this.suffix = value
+                })
+
 
-              }
-              .width(px2vp(608))
-              .height(px2vp(80))
-              .borderRadius(px2vp(100))
-              .alignItems(VerticalAlign.Center)
-              .backgroundColor($r('app.color.process_divider_white_color'))
             }
             .margin({ right: $r('app.float.Margins_24') })
-            .width('100%')
             .height(px2vp(80))
+            .width('100%')
+            .justifyContent(FlexAlign.Start)
+            .alignItems(VerticalAlign.Center)
+
           }
           .width('100%')
           .height(px2vp(160))
@@ -247,12 +280,15 @@ export struct RfidAllocation {
               ForEach(this.newMaterialBin, (item: newMaterialBin, index: number) => {
                 ListItem() {
                   Column() {
-                    Text(item.coding)
+                    TextInput({ text: item.coding })
                       .fontSize($r('app.float.fontSize_24'))
                       .fontWeight(FontWeight.Medium)
                       .fontColor($r('app.color.black_90'))
                       .width('100%')
-                      .height('40%')
+                      .height('50%')
+                      .onChange((value) => {
+                        item.coding = value
+                      })
 
                     Row() {
                       Text(item.MaterialBoxData + '  ' + item.MaterialBoxTime)
@@ -260,7 +296,7 @@ export struct RfidAllocation {
                         .fontWeight(FontWeight.Medium)
                         .fontColor($r('app.color.black_60'))
                         .width('100%')
-                        .height('100%')
+                        .layoutWeight(1)
                         .textAlign(TextAlign.Start)
                     }
                     .width('100%')
@@ -268,9 +304,9 @@ export struct RfidAllocation {
                   }
                   .justifyContent(FlexAlign.Center)
                   .width(px2vp(608))
-                  .height(px2vp(88))
+                  .height(px2vp(100))
                   .margin({ right: $r('app.float.Margins_24'), bottom: $r('app.float.topMargins_20') })
-                  .padding({ left: $r('app.float.leftMargins_30') })
+                  .padding({ left: $r('app.float.leftMargins_30'), top: 5, right: $r("app.float.leftMargins_30") })
                   .backgroundColor(this.onclick === index ? $r('app.color.blue_100') : $r('app.color.process_divider_white_color'))
                   .borderRadius(px2vp(16))
                   .onClick(() => {
@@ -295,92 +331,95 @@ export struct RfidAllocation {
         //.margin({right:$r('app.float.Margins_24')})
 
         Column() {
-          Column() {
-            Text('条码打印')
-              .fontSize($r('app.float.fontSize_30'))
-              .fontWeight(FontWeight.Medium)
-              .fontColor($r('app.color.black_90'))
-              .textAlign(TextAlign.Start)
-              .width('100%')
-              .height('15%')
-              .margin({ left: $r('app.float.leftMargins_30') })
-            Column() {
-              Row({ space: 10 }) {
-                Text('打印机状态')
-                  .fontSize($r('app.float.fontSize_20'))
-                  .fontWeight(FontWeight.Medium)
-                  .fontColor($r('app.color.black_60'))
-                  .textAlign(TextAlign.End)
-                  .width('40%')
-                  .height('100%')
-                if (this.onlineStatus === 0) {
-                  Text().width(px2vp(12))
-                    .height(px2vp(12))
-                    .borderRadius(px2vp(50))
-                    .backgroundColor($r('app.color.green_100'))
-                  Text('在线')
-                    .fontSize($r('app.float.fontSize_20'))
-                    .fontWeight(FontWeight.Medium)
-                    .fontColor($r('app.color.black_90'))
-                    .textAlign(TextAlign.Start)
-                    .width('35%')
-                    .height('100%')
-                } else if (this.onlineStatus === 1) {
-
-                  Text().width('5%')
-                    .height('30%')
-                    .borderRadius(px2vp(50))
-                    .backgroundColor($r('app.color.grey_100'))
-                  Text('不在线')
-                    .fontSize($r('app.float.fontSize_20'))
-                    .fontWeight(FontWeight.Medium)
-                    .fontColor($r('app.color.black_90'))
-                    .textAlign(TextAlign.Start)
-                    .width('35%')
-                    .height('100%')
-                }
-
-              }
-              .width('100%')
-              .height('30%')
-
-              Row({ space: 10 }) {
-                Text('打印机RFID编号')
-                  .fontSize($r('app.float.fontSize_20'))
-                  .fontWeight(FontWeight.Medium)
-                  .fontColor($r('app.color.black_60'))
-                  .textAlign(TextAlign.End)
-                  .width('40%')
-                  .height('100%')
-                Text('6537289495783').width('40%')
-                  .height('30%')
-                  .borderRadius(px2vp(50))
-                  .fontColor($r('app.color.blue_100'))
-
-              }
-              .width('100%')
-              .height('30%')
-            }.width('100%')
-            .height('60%')
-            .justifyContent(FlexAlign.Center)
-            .alignItems(HorizontalAlign.Center)
-
-            Blank()
-            Button('打印条码')
-              .fontColor($r('app.color.process_divider_white_color'))
-              .fontSize($r('app.float.fontSize_20'))
-              .fontWeight(FontWeight.Medium)
-              .backgroundColor($r('app.color.blue_100'))
-              .width(px2vp(292))
-              .height(px2vp(80))
-              .margin({ bottom: $r('app.float.topMargins_20') })
-
-          }
-          .width('100%')
-          .height('49%')
-          .borderRadius(px2vp(16))
-          .backgroundColor($r('app.color.white_E3E5E7'))
-          .margin({ bottom: $r('app.float.topMargins_20') })
+          // Column() {
+          //   Text('条码打印')
+          //     .fontSize($r('app.float.fontSize_30'))
+          //     .fontWeight(FontWeight.Medium)
+          //     .fontColor($r('app.color.black_90'))
+          //     .textAlign(TextAlign.Start)
+          //     .width('100%')
+          //     .height('15%')
+          //     .margin({ left: $r('app.float.leftMargins_30') })
+          //     .onClick(() => {
+          //       console.log("====", JSON.stringify(this.newMaterialBin))
+          //     })
+          //   Column() {
+          //     Row({ space: 10 }) {
+          //       Text('打印机状态')
+          //         .fontSize($r('app.float.fontSize_20'))
+          //         .fontWeight(FontWeight.Medium)
+          //         .fontColor($r('app.color.black_60'))
+          //         .textAlign(TextAlign.End)
+          //         .width('40%')
+          //         .height('100%')
+          //       if (this.onlineStatus === 0) {
+          //         Text().width(px2vp(12))
+          //           .height(px2vp(12))
+          //           .borderRadius(px2vp(50))
+          //           .backgroundColor($r('app.color.green_100'))
+          //         Text('在线')
+          //           .fontSize($r('app.float.fontSize_20'))
+          //           .fontWeight(FontWeight.Medium)
+          //           .fontColor($r('app.color.black_90'))
+          //           .textAlign(TextAlign.Start)
+          //           .width('35%')
+          //           .height('100%')
+          //       } else if (this.onlineStatus === 1) {
+          //
+          //         Text().width('5%')
+          //           .height('30%')
+          //           .borderRadius(px2vp(50))
+          //           .backgroundColor($r('app.color.grey_100'))
+          //         Text('不在线')
+          //           .fontSize($r('app.float.fontSize_20'))
+          //           .fontWeight(FontWeight.Medium)
+          //           .fontColor($r('app.color.black_90'))
+          //           .textAlign(TextAlign.Start)
+          //           .width('35%')
+          //           .height('100%')
+          //       }
+          //
+          //     }
+          //     .width('100%')
+          //     .height('30%')
+          //
+          //     Row({ space: 10 }) {
+          //       Text('打印机RFID编号')
+          //         .fontSize($r('app.float.fontSize_20'))
+          //         .fontWeight(FontWeight.Medium)
+          //         .fontColor($r('app.color.black_60'))
+          //         .textAlign(TextAlign.End)
+          //         .width('40%')
+          //         .height('100%')
+          //       Text('6537289495783').width('40%')
+          //         .height('30%')
+          //         .borderRadius(px2vp(50))
+          //         .fontColor($r('app.color.blue_100'))
+          //
+          //     }
+          //     .width('100%')
+          //     .height('30%')
+          //   }.width('100%')
+          //   .height('60%')
+          //   .justifyContent(FlexAlign.Center)
+          //   .alignItems(HorizontalAlign.Center)
+          //
+          //   Blank()
+          //   Button('打印条码')
+          //     .fontColor($r('app.color.process_divider_white_color'))
+          //     .fontSize($r('app.float.fontSize_20'))
+          //     .fontWeight(FontWeight.Medium)
+          //     .backgroundColor($r('app.color.blue_100'))
+          //     .width(px2vp(292))
+          //     .height(px2vp(80))
+          //     .margin({ bottom: $r('app.float.topMargins_20') })
+          //
+          // }
+          // .width('100%')
+          // .height('49%')
+          // .borderRadius(px2vp(16))
+          // .backgroundColor($r('app.color.white_E3E5E7'))
+          // .margin({ bottom: $r('app.float.topMargins_20') })
 
           Column() {
             Text('写入RFID')

+ 21 - 12
entry/src/main/ets/view/CompleteSet.ets

@@ -117,6 +117,7 @@ export struct CompleteSet {
   // }
   // 通过RFID请求读取料箱的信息
   rfidTimer: number = -1
+  @State preRfid: string = "" //记录上一次的rfid,如果变化了 就清空回库下面的列表
   @State private recentlyRecordObject: StationInfoModel = {}
   rfidInfoIntervalFun = async () => {
     let res: StationInfoModel = await StorageRequest.post("api/v1/wms/common/queryStationInfo", {
@@ -124,15 +125,21 @@ export struct CompleteSet {
     } as RequestParamModel)
     this.recentlyRecordObject = res
 
+    // 清空回库下面的数组逻辑
+    if (this.preRfid && this.preRfid != this.recentlyRecordObject.rfid) {
+      this.boxMaterials = []
+    }
+    this.preRfid = this.recentlyRecordObject.rfid ?? ""
 
-    console.log("jjjj", JSON.stringify(this.recentlyRecordObject))
 
+    // console.log("jjjj", JSON.stringify(this.recentlyRecordObject))
+
+    // 是否有料箱逻辑
     this.materialGridStatus = 0
     if (this.recentlyRecordObject && this.recentlyRecordObject.rfid) {
       this.materialGridStatus = 1
       this.BoxWeight = Number(res.weight)
       this.recentlyRecordObject.weight = this.recentlyRecordObject.weight + 'Kg'
-
     }
   }
   //扫码请求
@@ -189,7 +196,7 @@ export struct CompleteSet {
     if (this.orderArray && this.orderArray.length > 0) {
       this.selectOrder = -1
       if (this.orderArray[0]?.workOrderCode) {
-        this.processes = await JGRequest.get('/api/v1/plan/task/station/' + this.orderArray[0]?.workOrderCode, {
+        this.processes = await JGRequest.get('/api/v1/process/vehicleOperation/operation/' + this.orderArray[0]?.workOrderCode, {
         }) as ProcessData[]
       }
     }
@@ -241,14 +248,15 @@ export struct CompleteSet {
       confirm: async () => {
         // 查询工序关联的物料信息
         let res = await this.queryMaterialPage()
-        if (res.totalCount === undefined || res.totalCount <= 0 || res.totalPages === undefined || res.totalPages <= 0) {
-          return
-        }
-        this.totalCount = res.totalCount
-        this.totalPages = res.totalPages
-        if (res.records) {
-          this.materialArray = res.records
-        }
+        // if (res.totalCount === undefined || res.totalCount <= 0 || res.totalPages === undefined || res.totalPages <= 0) {
+        //   return
+        // }
+        this.totalCount = res.totalCount ?? 0
+        this.totalPages = res.totalPages ?? 0
+        // if (res.records) {
+        //
+        // }
+        this.materialArray = res.records ?? []
       }
     }),
     alignment: DialogAlignment.Center,
@@ -500,7 +508,8 @@ export struct CompleteSet {
                   this.currentWorkOrderCode = item.workOrderCode ?? ""
                   this.orderId = item.taskId!
                   if (item?.workOrderCode && item.workOrderCode.length > 0) {
-                    this.processes = await StorageRequest.get("/api/v1/plan/task/station/" + item.workOrderCode, {})
+                    this.processes = await StorageRequest.get("/api/v1/process/vehicleOperation/operation/" + item.workOrderCode, {
+                    })
                   }
                   // else {
                   //   this.selectProcess = {}