Browse Source

首页,入库,出库,底部和头部组件修改

yixiaojun 1 year ago
parent
commit
ee42eb1a2a

+ 1 - 1
entry/src/main/ets/common/component/SmartFactoryCard.ets

@@ -1,4 +1,4 @@
-@Entry
+
 @Component
 export struct SmartFactoryCard{
   build(){

+ 24 - 0
entry/src/main/ets/common/component/TaskComp.ets

@@ -1,3 +1,4 @@
+import router from '@ohos.router'
 import {task, taskclass} from '../util/request/StorageRequestInstance'
 @Component
 export struct TaskComp {
@@ -46,6 +47,11 @@ export struct TaskComp {
       .backgroundImageSize({width:'100%',height:'100%'})
       .height('100%')
       .borderRadius(15)
+      .onClick(()=>{
+        router.pushUrl({
+          url: 'pages/process/ProcessHome'
+        })
+      })
 
 
       //左右column
@@ -113,6 +119,11 @@ export struct TaskComp {
       .height('70%')
       .borderRadius(15)
       .alignItems(HorizontalAlign.End)
+      .onClick(()=>{
+        router.pushUrl({
+          url: 'pages/process/ProcessHome'
+        })
+      })
       Divider().vertical(true)
         .height('60%')
       Column(){
@@ -144,6 +155,11 @@ export struct TaskComp {
 
         }.width('100%')
         .height('50%')
+        .onClick(()=>{
+          router.pushUrl({
+            url: 'pages/process/ProcessHome'
+          })
+        })
         Divider().vertical(false)
           .width('80%')
         Column(){
@@ -173,6 +189,14 @@ export struct TaskComp {
 
         }.width('100%')
         .height('50%')
+        .backgroundColor($r('app.color.robot_set_card_white'))
+        .borderRadius(px2vp(21))
+        .onClick(()=>{
+          router.pushUrl({
+            url:''
+          }
+          )
+        })
 
 
       }.width('30%')

+ 1 - 1
entry/src/main/ets/common/component/TitleStateComp.ets

@@ -20,7 +20,7 @@ export struct TitleStateComp {
           Image($r('app.media.home'))
             .objectFit(ImageFit.Contain)
         }
-        .width('12%')
+        .width('20%')
         .height('90%')
         .alignItems(VerticalAlign.Center)
         .justifyContent(FlexAlign.Center)

+ 270 - 109
entry/src/main/ets/common/component/Workbin.ets

@@ -1,8 +1,72 @@
 import ProcessData from '../../model/ProcessData';
 import StorageRequest from '../util/request/StorageRequest';
-import {Tasklistoutbound,Tasklist,SelectMaterialslist} from '../util/request/StorageRequestInstance'
+import {SelectMaterialslist} from '../util/request/StorageRequestInstance'
+import detailsList from '../../model/DetailsList';
 /////物料位置
+////出库取料箱出库
+export interface  Tasklist {
+
+  //批次号
+  batchCode?: string;
+  ///完成数量
+  completedNum?:number
+
+  //已经占用箱数
+  useNum?:number
+  //空箱数
+  emptyBoxNum?:string
+  //可用箱数
+  canUsedNum?:string
+  //总容量箱数
+  allNum?:number
+  //仓储类型
+  type?:string
+  //批次号
+
+  coordinate?: string
+  //创建时间
+  created?: string
+  //
+  creator?: string
+  //仓库编码
+  houseNo?:string
+  deptId?: string
+  houseType?:string
+  //主键
+  id?:string
+  locationNo?: string
+  //	物料名称
+  materialName?:string
+  //物料编码
+  materialNo?: string
+  //出入库数量
+  num?: number
+  orgId?: string
+  relPlanNo?:string
+  relOrderNo?:string
+  relOutOrderNo?:string
+  progress?:string
+  planNo?: string
+  position?: string
+  //	序列号
+  seqNo?: string
+  // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
+  state?:number
+  //	库存数量
+  stockNum?:string
+  //出入库任务单号
+  taskNo?: string
+  unit?:string
+  updated?: string
+  //任务名称
+  taskName?:string
+  updator?: string
+  vehicleNo?: string
+
+}
 export interface Materialpositionclass {
+  //产品规格
+  spec?:string
   //批次号
   batchCode?: string;
   ///完成数量
@@ -58,9 +122,98 @@ export interface Materialpositionclass {
   pageNo?:number
   pageSize?:number
 }
+export interface  outboundDataclass {
+  detailsList?:detailsList[]
+  taskId?:number
+  index?:number
+  //产品规格
+  spec?:string
+  //	物料名称
+  materialName?:string
+  //物料编码
+  materialNo?: string
+  //	序列号
+  seqNo?: string
+  //储位坐标
+  coordinate?:string
+  //仓库编号
+  houseNo?:string
+  //储位编号
+  locationNo?:string
+  //单位
+  unit?:string
+  //数量
+  num?:number
+  //批次号
+  batchCode?:string
 
+
+}
+export interface  outboundRequestData {
+  index?:number
+  //产品规格
+  spec?:string
+  //	物料名称
+  materialName?:string
+  //物料编码
+  materialNo?: string
+  //	序列号
+  seqNo?: string
+  //储位坐标
+  coordinate?:string
+  //仓库编号
+  houseNo?:string
+  //储位编号
+  locationNo?:string
+  //单位
+  unit?:string
+  //数量
+  num?:number
+  //批次号
+  batchCode?:string
+  //载具编号
+  vehicleCode?:string
+  position?:string
+  housetype?:string
+
+
+
+
+
+}
 @CustomDialog
 struct positionok {
+  // outboundData = async() : Promise<outboundDataclass[]> => {
+  //   let obj:outboundDataclass[] = []
+  //   let res = await StorageRequest.post("/api/v3/wmsOrder/outBox", {
+  //     detailsList:this.outboundRequest,
+  //     taskId:'1'
+  //   })
+  //   console.log('testTag', '********' + JSON.stringify(res))
+  //   obj = JSON.parse(JSON.stringify(res))
+  //   return obj
+  // }
+  //传进来
+  // aboutToAppear(){
+  //   for (let index = 0; index < this.Mposition.length; index++) {
+  //     let details: outboundRequestData = {}
+  //     details.materialName = this.Mposition[index].materialName
+  //     details.num=this.Mposition[index].num
+  //     details.materialNo=this.Mposition[index].materialNo
+  //     details.spec=this.Mposition[index].spec
+  //     details.batchCode=this.Mposition[index].batchCode
+  //     details.housetype='1'
+  //     details.locationNo='1-3-2'
+  //     details.houseNo='1'
+  //     details.coordinate= '3-2'
+  //     details.unit='个'
+  //     details.vehicleCode='XL'+new Date().getTime()
+  //     details.position='1'
+  //     this.Mposition.push(details)
+  //   }
+  // }
+  @State private outboundRequest:Array<outboundRequestData>=[]
+  @Link private Mposition:Array< Materialpositionclass>
   @Link code:string
   @Link textValue: string
   @Link inputValue: string
@@ -68,75 +221,86 @@ struct positionok {
   // 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后
   cancel: () => void
   confirm: () => void
-    build(){
-      Column(){
-          Column({space:10}){
-            Text('取出确认')
-              .width('100%')
-              .fontSize('51px')
-              .textAlign(TextAlign.Center)
-            Row(){
-              Text('是否取出'+this.code+'?')
-                .width('100%')
-                .fontSize('32px')
-            }.width('80%')
-            .height('60%')
-            Row({space:5}){
-              Text('取消')
-                .fontWeight(FontWeight.Medium)
-                .fontSize('32px')
-                .width('48%')
-                .textAlign(TextAlign.Center)
-                .height('100%')
-                .fontColor('#0A59F7')
-                .backgroundColor('#F1F3F5')
-                .borderRadius(21)
-                .onClick(()=>{
-                  this.controller.close()
-                })
-
-
-              Text('确认')
-                .fontWeight(FontWeight.Medium)
-                .fontSize('32px')
-                .borderRadius(21)
-                .textAlign(TextAlign.Center)
-                .height('100%')
-                .width('48%')
-                .fontColor('#0A59F7')
-                .backgroundColor('#F1F3F5')
-                .onClick(()=>{
-                  this.controller.close()
-                })
-            }
-            .justifyContent(FlexAlign.Center)
-            .borderRadius(15)
-            .width('80%')
+  build(){
+    Column(){
+      Column({space:10}){
+        Text('取出确认')
+          .width('100%')
+          .fontSize('51px')
+          .textAlign(TextAlign.Center)
+        Row(){
+          Text('是否取出'+this.code+'?')
+            .width('100%')
+            .fontSize('32px')
+        }.width('80%')
+        .height('60%')
+        Row({space:5}){
+          Text('取消')
+            .fontWeight(FontWeight.Medium)
+            .fontSize('32px')
+            .width('48%')
+            .textAlign(TextAlign.Center)
+            .height('100%')
+            .fontColor('#0A59F7')
+            .backgroundColor('#F1F3F5')
+            .borderRadius(21)
+            .onClick(()=>{
+              this.controller.close()
+            })
+          Text('确认')
+            .fontWeight(FontWeight.Medium)
+            .fontSize('32px')
+            .borderRadius(21)
+            .textAlign(TextAlign.Center)
+            .height('100%')
+            .width('48%')
+            .fontColor('#0A59F7')
+            .backgroundColor('#F1F3F5')
+            .onClick(()=>{
+              // this. outboundData ().then((res : outboundRequestData[]) => {
+              //   console.log('testTag', '入库数据成功'+JSON.stringify(res))
+              //   if (res && res.length > 0) {
+              //     //
+              //     for (let index = 0; index < res.length; index++) {
+              //       console.log('testTag', '-----------index' + index +'-----vehicleNo'+JSON.stringify(res))
+              //       console.log('testTag', '-----------index' + index +'-----list'+JSON.stringify(res))
+              //     }
+              //     this. outboundRequest = res
+              //   }
+              // })
+              // console.log("4632957"+JSON.stringify(this.outboundRequest))
+              // this.controller.close()
+            })
+        }
+        .justifyContent(FlexAlign.Center)
+        .borderRadius(15)
+        .width('80%')
 
-            .height('20%')
+        .height('20%')
 
 
-          }.width('100%')
-          .padding(10)
-          .height('100%')
-          .borderRadius(15)
-          .backgroundColor('#FFFF')
-      }.width("50%")
-      .height("40%")
-      .backgroundColor('#4d000000')
-    }
+      }.width('100%')
+      .padding(10)
+      .height('100%')
+      .borderRadius(15)
+      .backgroundColor('#FFFF')
+    }.width("50%")
+    .height("40%")
+    .backgroundColor('#4d000000')
+  }
 
 }
 @CustomDialog
 struct ChuKUA {
   @State private Mposition:Array<Materialpositionclass>=[]
   @State private SelectMaterial:Array<SelectMaterialslist>=[]
-  @State material:string='物料名称001'
-  @State taskno:string=''
-////确认弹窗
+  @State material:string=''
+  @State taskNo:string=''
+  ////确认弹窗
   @State code:string=''
   dialogController: CustomDialogController = new CustomDialogController({
     builder: positionok({
+      Mposition:this.Mposition,
       code:this.code,
       textValue: $textValue,
       inputValue: $inputValue
@@ -145,10 +309,20 @@ struct ChuKUA {
     alignment: DialogAlignment.Center,
     customStyle: true
   })
+  Tasklistoutbound = async() : Promise<Tasklist[]> => {
+    let obj: Tasklist[] = []
+    let res = await StorageRequest.post("/api/v3/task/list", {
+      type: 2
+    })
+    console.log('testTag', 'Tasklist成功' + JSON.stringify(res))
+    obj = JSON.parse(JSON.stringify(res))
+    console.log('testTag', 'aaaaaaaa' +JSON.stringify(obj));
+    return obj
+  }
   SelectMaterials = async() : Promise<SelectMaterialslist[]> => {
     let res = await StorageRequest.post("/api/v3/task/page", {
       pageNo: 1,
-      taskNo:'CKD240307143155'
+      taskNo:this.taskNo
     })
     console.log('testTag', '********' + JSON.stringify(res))
     let obj = JSON.parse(JSON.stringify(res))
@@ -158,41 +332,45 @@ struct ChuKUA {
   }
   ///位置请求
   Materialposition = async() : Promise< Materialpositionclass[]> => {
-  let obj: Materialpositionclass[] = []
-  let res = await StorageRequest.post("/api/v3/stock/list", {
-     "materialName":this.material
-    // "materialName":"物料名称001"
-  })
-  console.log('testTag', '111111成功' + JSON.stringify(res))
-  obj = JSON.parse(JSON.stringify(res))
-  console.log('testTag', 'aaaaaaaa' +JSON.stringify(obj));
-      this.Mposition=obj
-  return obj
-}
+    let obj: Materialpositionclass[] = []
+    let res = await StorageRequest.post("/api/v3/stock/list", {
+      "materialName":this.material
+      // "materialName":"物料名称001"
+    })
+    console.log('testTag', '111111成功' + JSON.stringify(res))
+    obj = JSON.parse(JSON.stringify(res))
+    console.log('testTag', 'aaaaaaaa' +JSON.stringify(obj));
+    this.Mposition=obj
+    return obj
+  }
   aboutToAppear(){
 
-    this.Materialposition().then((res :Materialpositionclass[]) => {
-      console.log('testTag', 'result cccccc'+JSON.stringify(res))
-      if (res && res.length > 0) {
-        this.Mposition = res
-      }
-    })
-    Tasklistoutbound().then((res : Tasklist[]) => {
-      console.log('testTag', 'result cccccc'+JSON.stringify(res))
-      if (res && res.length > 0) {
-        this.Tasklistoutbound = res
-      }
-    })
-    this.SelectMaterials().then((res : SelectMaterialslist[]) => {
+    this.Tasklistoutbound().then((res : Tasklist[]) => {
       console.log('testTag', 'result cccccc'+JSON.stringify(res))
       if (res && res.length > 0) {
-        this.SelectMaterial = res
+        this.TasklistoutboundData = res
+        this.taskNo=this.TasklistoutboundData[0].taskNo
+        this.SelectMaterials().then((res : SelectMaterialslist[]) => {
+          console.log('testTag', 'result cccccc'+JSON.stringify(res))
+          if (res && res.length > 0) {
+            this.SelectMaterial = res
+            this.material= this.SelectMaterial[0].materialName
+            this.Materialposition().then((res :Materialpositionclass[]) => {
+              console.log('testTag', 'result cccccc'+JSON.stringify(res))
+              if (res && res.length > 0) {
+                this.Mposition = res
+              }
+            })
+          }
+        })
       }
     })
+
+
   }
 
 
-  @State private Tasklistoutbound:Array<Tasklist>=[]
+  @State private TasklistoutboundData:Array<Tasklist>=[]
   @Link CunQuHuo:number
 
   scroller: Scroller = new Scroller()
@@ -241,7 +419,7 @@ struct ChuKUA {
       Row({space:20}){
         Column(){
           Grid(this.scroller) {
-            ForEach(this.Tasklistoutbound, (item:Tasklist ,index:number) => {
+            ForEach(this.TasklistoutboundData, (item:Tasklist ,index:number) => {
               //    ForEach(this.Number, (day: string) => {
               GridItem() {
                 Row(){
@@ -296,7 +474,7 @@ struct ChuKUA {
                   .justifyContent(FlexAlign.Center)
                   .height('100%')
                   .onClick(()=>{
-                    this.taskno=item.taskNo
+                    this.taskNo=item.taskNo
                   })
 
                 }
@@ -366,16 +544,12 @@ struct ChuKUA {
                 .height('30%')
                 .backgroundColor(this.SelectableMarkerOne===index?
                 $r('app.color.robot_set_card_blue'):$r('app.color.robot_set_card_white'))
-
-
               }
               .onClick(()=>{
-               this.material= item.materialName
+                this.material= item.materialName
                 console.log('好了111111'+item.materialName)
-                this.Materialposition()
+                // this.Materialposition()
                 this.SelectableMarkerOne=index
-
-
               })
             })
           }
@@ -422,8 +596,6 @@ struct ChuKUA {
                         .fontWeight(FontWeight.Medium)
                     }
 
-
-
                   }.width('100%')
                   .padding(10)
                   .borderRadius(10)
@@ -431,8 +603,6 @@ struct ChuKUA {
                   .justifyContent(FlexAlign.Center)
                   .height('100%')
 
-
-
                 }
                 .padding(10)
                 .borderRadius(10)
@@ -440,9 +610,11 @@ struct ChuKUA {
                 .backgroundColor(this.SelectableMarkertwo===index?
                 $r('app.color.robot_set_card_blue'):$r('app.color.robot_set_card_white'))
                 .onClick(()=>{
+
                   this.dialogController.open()
+
                   this.SelectableMarkertwo=index
-                 this.code= item.batchCode
+                  this.code= item.batchCode
                 })
 
               }
@@ -461,21 +633,12 @@ struct ChuKUA {
             console.info(first.toString())
           })
           .width('100%')
-
           .height('100%')
-
-
-
         }.width('37%')
         .height('100%')
-
-
       }.width('100%')
       .height('75%')
       .padding(10)
-
-
-
       Row(){
         Image($r('app.media.close'))
 
@@ -483,9 +646,7 @@ struct ChuKUA {
           .height('115px')
           .onClick(()=>{
             this.controller.close()
-
           })
-
       }.width('100%')
       .justifyContent(FlexAlign.Center)
       .height('10%')

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

@@ -2,7 +2,7 @@ import axios, { AxiosError, AxiosResponse, AxiosRequestHeaders,AxiosRequestConfi
 import CommonConstants from '../../constants/CommonConstants';
 import { printError, printRequest, printResponse, handleRes } from './Helps';
 
-const baseUrl = "http://192.168.101.188:8088/"
+const baseUrl = "http://192.168.101.4:8088/"
 const DEBUG = true //
 
 // 创建实例

+ 1 - 1
entry/src/main/ets/model/DetailsList.ets

@@ -1,4 +1,4 @@
-export default class DetailsList{
+export default class detailsList{
   index?:number
   //产品规格
   spec?:string

+ 335 - 62
entry/src/main/ets/pages/Index.ets

@@ -3,9 +3,7 @@ import { BottomOperateComp } from '../common/component/BottomOperateComp';
 import router from '@ohos.router'
 import { TaskComp } from '../common/component/TaskComp'
 import {  Warehousing}from  '../common/component/Warehousing'
-import { SmartFactoryCard}from  '../common/component/SmartFactoryCard'
-import CommonConstants from '../common/constants/CommonConstants';
-
+import { SmartFactoryCard }from  '../common/component/SmartFactoryCard'
 @CustomDialog
 struct login {
   @Link textValue: string
@@ -60,6 +58,105 @@ struct login {
   }
 }
 @CustomDialog
+struct confirmPopup {
+  @Link longPressDelete:number
+  controller: CustomDialogController
+  cancel: () => void
+  confirm: () => void
+  build(){
+    Column(){
+      Column(){
+        Text('卡片服务')
+          .margin(px2vp(5))
+          .width('100%')
+          .fontWeight(FontWeight.Medium)
+          .fontSize(px2vp(38))
+          .height('50%')
+          .textAlign(TextAlign.Start)
+          .onClick(()=>{
+            this.controller.close()
+            this.longPressDelete=0
+          })
+        Divider().width('80%')
+        Text('删除卡片')
+          .height('50%')
+          .margin(px2vp(5))
+          .width('100%')
+          .fontWeight(FontWeight.Medium)
+          .fontSize(px2vp(38))
+          .textAlign(TextAlign.Start)
+          .onClick(()=>{
+            this.longPressDelete=1
+            this.controller.close()
+          })
+
+      }
+      .borderRadius(px2vp(15))
+      .width('100%')
+      .height('40%')
+      .backgroundColor($r('app.color.process_divider_white_color'))
+      Image($r('app.media.gongxu'))
+        .width(px2vp(220))
+        .height(px2vp(220))
+        .borderRadius(15)
+    }
+    .alignItems(HorizontalAlign.Start)
+    .width('10%')
+    .height('30%')
+
+  }
+}
+@CustomDialog
+struct smartWarehouseCard {
+  @Link martWarehouseCardDelete:number
+  controller: CustomDialogController
+  cancel: () => void
+  confirm: () => void
+  build(){
+    Column(){
+      Column(){
+        Text('卡片服务')
+          .margin(px2vp(5))
+          .width('100%')
+          .fontWeight(FontWeight.Medium)
+          .fontSize(px2vp(38))
+          .height('50%')
+          .textAlign(TextAlign.Start)
+          .onClick(()=>{
+            this.controller.close()
+            this.martWarehouseCardDelete=0
+          })
+        Divider().width('80%')
+        Text('删除卡片')
+          .height('50%')
+          .margin(px2vp(5))
+          .width('100%')
+          .fontWeight(FontWeight.Medium)
+          .fontSize(px2vp(38))
+          .textAlign(TextAlign.Start)
+          .onClick(()=>{
+            this.martWarehouseCardDelete=1
+            this.controller.close()
+          })
+
+      }
+      .borderRadius(px2vp(15))
+      .width('100%')
+      .height('40%')
+      .backgroundColor($r('app.color.process_divider_white_color'))
+      Image($r('app.media.storage'))
+        .width(px2vp(220))
+        .height(px2vp(220))
+        .borderRadius(15)
+    }
+    .alignItems(HorizontalAlign.Start)
+    .width('10%')
+    .height('30%')
+
+  }
+}
+
+@CustomDialog
 struct shutdown {
   @Link shutdownTransparency:number
   @Link textValue: string
@@ -89,13 +186,13 @@ struct shutdown {
       }.width('100%')
       .height('50%')
       Row(){
-       Text('重启')
-         .fontWeight(FontWeight.Medium)
-         .fontSize(px2vp(27))
-         .width(px2vp(107))
-         .height(px2vp(107))
-         .textAlign(TextAlign.Center)
-         .fontColor('#FFFFFF')
+        Text('重启')
+          .fontWeight(FontWeight.Medium)
+          .fontSize(px2vp(27))
+          .width(px2vp(107))
+          .height(px2vp(107))
+          .textAlign(TextAlign.Center)
+          .fontColor('#FFFFFF')
 
         Blank()
         Text('关机')
@@ -119,7 +216,15 @@ struct shutdown {
 @Entry
 @Component
 struct Index {
+  @State  SmartFactoryCardDelete:number=0
+  @State SmartFactoryDelete:number=0
+  @State  SmartFactoryCarLongPressDelete:number=0
+  @State storageCardDelete:number=0
+  @State martWarehouseCardDelete:number=0
+  @State smartWarehouseCard:number=0
   @State avatarFrame:boolean=false
+  @State deleteConfirmation:number=0
+  @State longPressDelete:number=0
   scroller: Scroller = new Scroller()
   @State shutdownTransparency:number=0
   @State YanSe: number = 0
@@ -128,14 +233,14 @@ struct Index {
   @State textValue: string = ''
   @State inputValue: string = ''
   loginDialogController: CustomDialogController = new CustomDialogController({
-  builder:login({
-    textValue: $textValue,
-    inputValue: $inputValue,
-  }),
-  alignment: DialogAlignment.Center,
-  autoCancel:false,
-  customStyle:true
-})
+    builder:login({
+      textValue: $textValue,
+      inputValue: $inputValue,
+    }),
+    alignment: DialogAlignment.Center,
+    autoCancel:false,
+    customStyle:true
+  })
   shutdownDialogController: CustomDialogController = new CustomDialogController({
     builder:shutdown({
       textValue: $textValue,
@@ -146,6 +251,27 @@ struct Index {
     autoCancel:false,
     customStyle:true
   })
+  confirmPopupDialogController: CustomDialogController = new CustomDialogController({
+    builder: confirmPopup({
+      longPressDelete:this.longPressDelete,
+    }
+      ),
+    alignment: DialogAlignment.Bottom,
+    autoCancel:true,
+    customStyle:true,
+    offset: { dx: -95, dy: -40 }
+  })
+  smartWarehouseCardDialogController: CustomDialogController = new CustomDialogController({
+    builder:smartWarehouseCard({
+      martWarehouseCardDelete:this.martWarehouseCardDelete
+    }
+    ),
+    alignment: DialogAlignment.Bottom,
+    autoCancel:true,
+    customStyle:true,
+    offset: { dx: -320, dy: -40 }
+  })
+
 
   build() {
     Stack(){
@@ -153,54 +279,188 @@ struct Index {
         Column() {
           TitleStateComp({ isHomePage: this.isHomePage })
             .onClick(()=>{
-               this.avatarFrame=!this.avatarFrame
+              this.avatarFrame=!this.avatarFrame
             })
           Row() {
 
             Flex({ wrap: FlexWrap.Wrap }) {
-              Column(){
-                TaskComp({isHomePage: this.isHomePage})
-                Text('生产操作')
-                  .fontSize(px2vp(27))
-                  .margin({top:5})
-                  .fontWeight(FontWeight.Medium)
-                  .fontColor($r('app.color.robot_set_card_white'))
-              }
-              .height('40%')
-              .width('32%')
+              if (this.longPressDelete===0){
+                Stack(){
+                  Column(){
+                    TaskComp({isHomePage: this.isHomePage})
+                    Text('生产操作')
+                      .fontSize(px2vp(27))
+                      .margin({top:5})
+                      .fontWeight(FontWeight.Medium)
+                      .fontColor($r('app.color.robot_set_card_white'))
+                  }
+                  .height('40%')
+                  .width('32%')
+                  .gesture(
+                    LongPressGesture({ repeat: false })
+                      .onActionEnd(() => {
+                        this.deleteConfirmation=1
+                      })
+                  )
+                  if (this.deleteConfirmation===1){
+                    Row(){
+                      Text('取消')
+                        .fontWeight(FontWeight.Medium)
+                        .fontSize(px2vp(27))
+                        .textAlign(TextAlign.Center)
+                        .width('20%')
+                        .height('20%')
+                        .margin(10)
+                        .borderRadius(px2vp(21))
+                        .fontColor($r('app.color.robot_set_card_blue'))
+                        .backgroundColor($r('app.color.general_font_white_color'))
+                        .onClick(()=>{
+                          this.deleteConfirmation=0
+                        })
+                      Text('删除')
+                        .fontWeight(FontWeight.Medium)
+                        .fontSize(px2vp(27))
+                        .width('20%')
+                        .margin(10)
+                        .fontColor($r('app.color.general_font_white_color'))
+                        .borderRadius(px2vp(21))
+                        .height('20%')
+                        .textAlign(TextAlign.Center)
+                        .backgroundColor(  $r('app.color.robot_set_card_blue'))
+                        .onClick(()=>{
+                          this.deleteConfirmation=0
+                          this.longPressDelete=1
+                        })
+                    }
+                    .justifyContent(FlexAlign.Center)
+                    .height('40%')
+                    .width('32%')
+                  }
+
+                }
 
-              Column(){
-                Warehousing()
-                Text('智能仓储')
-                  .margin({top:5})
-                  .fontSize(px2vp(27))
-                  .fontWeight(FontWeight.Medium)
-                  .fontColor($r('app.color.robot_set_card_white'))
               }
-              .height('40%')
-              .width('32%')
-              .margin({left:10})
-              .onClick(()=>{
-                router.pushUrl({
-                  url:'pages/Storage'
-                })
-              })
-              Column(){
-                SmartFactoryCard()
-                Text('智汇工厂')
-                  .margin({top:5})
-                  .fontSize(px2vp(27))
-                  .fontWeight(FontWeight.Medium)
-                  .fontColor($r('app.color.robot_set_card_white'))
+              if (this.martWarehouseCardDelete===0){
+                Stack(){
+                  Column(){
+                    Warehousing()
+                    Text('智能仓储')
+                      .margin({top:5})
+                      .fontSize(px2vp(27))
+                      .fontWeight(FontWeight.Medium)
+                      .fontColor($r('app.color.robot_set_card_white'))
+                  }
+                  .height('40%')
+                  .width('32%')
+                  .margin({left:10})
+                  .onClick(()=>{
+                    router.pushUrl({
+                      url:'pages/Storage'
+                    })
+                  })
+                  .gesture(
+                    LongPressGesture({ repeat: false })
+                      .onActionEnd(() => {
+                        this. smartWarehouseCard=1
+                      })
+                  )
+                  if (this. smartWarehouseCard===1){
+                    Row(){
+                      Text('取消')
+                        .fontWeight(FontWeight.Medium)
+                        .fontSize(px2vp(27))
+                        .textAlign(TextAlign.Center)
+                        .width('20%')
+                        .height('20%')
+                        .margin(10)
+                        .borderRadius(px2vp(21))
+                        .fontColor($r('app.color.robot_set_card_blue'))
+                        .backgroundColor($r('app.color.general_font_white_color'))
+                        .onClick(()=>{
+                          this.smartWarehouseCard=0
+                        })
+                      Text('删除')
+                        .fontWeight(FontWeight.Medium)
+                        .fontSize(px2vp(27))
+                        .width('20%')
+                        .margin(10)
+                        .fontColor($r('app.color.general_font_white_color'))
+                        .borderRadius(px2vp(21))
+                        .height('20%')
+                        .textAlign(TextAlign.Center)
+                        .backgroundColor(  $r('app.color.robot_set_card_blue'))
+                        .onClick(()=>{
+                          this.smartWarehouseCard=0
+                          this.martWarehouseCardDelete=1
+                        })
+                    }
+                    .justifyContent(FlexAlign.Center)
+                    .height('40%')
+                    .width('32%')
+                  }
+                }
               }
-              .height('40%')
-              .width('32%')
-              .margin({left:10})
-              .onClick(()=>{
-                router.pushUrl({
-                  url:'pages/SmartFactory'
-                })
-              })
+              if (this.SmartFactoryCardDelete===0){
+                Stack(){
+                  Column(){
+                    SmartFactoryCard()
+                    Text('智汇工厂')
+                      .margin({top:5})
+                      .fontSize(px2vp(27))
+                      .fontWeight(FontWeight.Medium)
+                      .fontColor($r('app.color.robot_set_card_white'))
+                  }
+                  .height('40%')
+                  .width('32%')
+                  .margin({left:10})
+                  .onClick(()=>{
+                    router.pushUrl({
+                      url:'pages/SmartFactory'
+                    })
+                  })
+                  .gesture(
+                    LongPressGesture({ repeat: false })
+                      .onActionEnd(() => {
+                        this.SmartFactoryCarLongPressDelete=1
+                      })
+                  )
+                  if (this.SmartFactoryCarLongPressDelete===1){
+                    Row(){
+                      Text('取消')
+                        .fontWeight(FontWeight.Medium)
+                        .fontSize(px2vp(27))
+                        .textAlign(TextAlign.Center)
+                        .width('20%')
+                        .height('20%')
+                        .margin(10)
+                        .borderRadius(px2vp(21))
+                        .fontColor($r('app.color.robot_set_card_blue'))
+                        .backgroundColor($r('app.color.general_font_white_color'))
+                        .onClick(()=>{
+                          this.SmartFactoryCarLongPressDelete=0
+                        })
+                      Text('删除')
+                        .fontWeight(FontWeight.Medium)
+                        .fontSize(px2vp(27))
+                        .width('20%')
+                        .margin(10)
+                        .fontColor($r('app.color.general_font_white_color'))
+                        .borderRadius(px2vp(21))
+                        .height('20%')
+                        .textAlign(TextAlign.Center)
+                        .backgroundColor(  $r('app.color.robot_set_card_blue'))
+                        .onClick(()=>{
+                          this.SmartFactoryCarLongPressDelete=0
+                          this.SmartFactoryCardDelete=1
+                        })
+                    }
+                    .justifyContent(FlexAlign.Center)
+                    .height('40%')
+                    .width('32%')
+                  }
+                }
+              }
+
             }
             .width('100%')
             .height('100%')
@@ -233,7 +493,7 @@ struct Index {
               })
             })
             Column({ space: 10 }) {
-              Image($r('app.media.cangchu'))
+              Image($r("app.media.storage"))
                 .width('60%')
                 .height('60%')
                 .borderRadius(15)
@@ -253,6 +513,12 @@ struct Index {
                 url: 'pages/Storage'
               })
             })
+            .gesture(
+              LongPressGesture({ repeat: false })
+                .onActionEnd(() => {
+                  this.smartWarehouseCardDialogController.open()
+                })
+            )
             Column({ space: 10 }) {
               Image($r('app.media.jiqiren'))
                 .width('60%')
@@ -297,6 +563,12 @@ struct Index {
                 url: 'pages/process/ProcessHome'
               })
             })
+            .gesture(
+              LongPressGesture({ repeat: false })
+                .onActionEnd(() => {
+                 this.confirmPopupDialogController.open()
+                })
+            )
 
             Column({ space: 10 }) {
               Image($r('app.media.baobiao'))
@@ -318,7 +590,8 @@ struct Index {
           }
           .width('100%')
           .height('16%')
-          BottomOperateComp({ isHomePage: this.isHomePage })
+          BottomOperateComp({ isHomePage: this.isHomePage,
+            SmartFactoryCardDelete:this.SmartFactoryCardDelete})
         }
         .backgroundImage($r('app.media.BG'))
         .backgroundImageSize({ width: '100%', height: '100%' })
@@ -341,7 +614,7 @@ struct Index {
             .fontWeight(FontWeight.Medium)
             .fontColor('#e6000000')
             .onClick(()=>{
-             this.loginDialogController.open()
+              this.loginDialogController.open()
             })
           Divider()
           Text('开关/重启')

+ 0 - 75
entry/src/main/ets/pages/uyi.ets

@@ -1,75 +0,0 @@
-@Entry
-@Component
-struct uyi {
-  @State numbers: string[] = []
-  scroller: Scroller = new Scroller()
-  @State text: string = 'drag'
-
-  @Builder pixelMapBuilder() { //拖拽过程样式
-    Column() {
-      Text(this.text)
-        .fontSize(16)
-        .backgroundColor(0xF9CF93)
-        .width(80)
-        .height(80)
-        .textAlign(TextAlign.Center)
-    }
-  }
-
-  aboutToAppear() {
-    for (let i = 1;i <= 15; i++) {
-      this.numbers.push(i + '')
-    }
-  }
-
-  changeIndex(index1:number, index2:number) { //交换数组中的位置
-    const temp = this.numbers[index1];
-    if (index1 > index2) {
-      this.numbers.splice(index2, 0, temp);
-      this.numbers.splice(index1 + 1, 1);
-    } else {
-      this.numbers.splice(index2 + 1, 0, temp);
-      this.numbers.splice(index1, 1);
-    }
-  }
-
-  build() {
-    Column({ space: 5 }) {
-      Grid(this.scroller) {
-        ForEach(this.numbers, (day: string) => {
-          GridItem() {
-            Text(day)
-              .fontSize(16)
-              .backgroundColor(0xF9CF93)
-              .width(80)
-              .height(80)
-              .textAlign(TextAlign.Center)
-          }
-        })
-      }
-      .columnsTemplate('1fr 1fr 1fr')
-      .columnsGap(10)
-      .rowsGap(10)
-      .onScrollIndex((first: number) => {
-        console.info(first.toString())
-      })
-      .width('90%')
-      .backgroundColor(0xFAEEE0)
-      .height(300)
-      .editMode(true) //设置Grid是否进入编辑模式,进入编辑模式可以拖拽Grid组件内部GridItem
-      .supportAnimation(true) //设置Grid是否开启拖拽补位动画
-      .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { //第一次拖拽此事件绑定的组件时,触发回调。
-        this.text = this.numbers[itemIndex]
-        return this.pixelMapBuilder() //设置拖拽过程中显示的图片。
-      })
-      .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { //绑定此事件的组件可作为拖拽释放目标,当在本组件范围内停止拖拽行为时,触发回调。
-        // isSuccess=false时,说明drop的位置在grid外部;insertIndex > length时,说明有新增元素的事件发生
-        if (!isSuccess || insertIndex >= this.numbers.length) {
-          return
-        }
-        console.info('beixiang' + itemIndex + '', insertIndex + '') //itemIndex拖拽起始位置,insertIndex拖拽插入位置
-        this.changeIndex(itemIndex, insertIndex)
-      })
-    }.width('100%').margin({ top: 5 })
-  }
-}

+ 28 - 13
entry/src/main/ets/view/ScanTheStorageCode.ets

@@ -22,8 +22,8 @@ struct batchNumberPopupBox {
   @Link seqNo:string
   //物料规格描述用于窗接收修改
   @Link spec:string
- // @Link value:number=this.num
- // @State private items:Array<ScanStorageCodeClass>=[]
+  // @Link value:number=this.num
+  // @State private items:Array<ScanStorageCodeClass>=[]
   @Link CunQuHuo:number
   scroller: Scroller = new Scroller()
   @State navigation:number=0
@@ -108,10 +108,10 @@ struct batchNumberPopupBox {
               this.ScanStoragelist[this.index]= {
                 materialName: this.ScanStoragelist[this.index].materialName,
                 num:this.num,
-               materialNo:this.ScanStoragelist[this.index].materialNo,
+                materialNo:this.ScanStoragelist[this.index].materialNo,
                 batchCode:this.ScanStoragelist[this.index].batchCode,
                 seqNo:this.ScanStoragelist[this.index].seqNo,
-               spec:this.ScanStoragelist[this.index].spec,
+                spec:this.ScanStoragelist[this.index].spec,
               }
             })
             .onDec(() => {
@@ -415,7 +415,7 @@ struct buffer {
                       Text(item.materialName)
                         .fontSize('32px')
                         .width('100%')
-                      Text(item.materialNo)
+                      Text(item.spec)
                         .fontSize($r('app.float.robot_state_font_size'))
                         .textAlign(TextAlign.Start)
                         .fontColor('#99000000')
@@ -557,6 +557,8 @@ struct buffer {
 
 @Component
 export struct ScanTheStorageCode{
+  @State delete1:number=0
+  @State delete:number=0
   @State index:number=0
   //物料批次号用于传给弹窗修改
   @State batchCode:string=''
@@ -628,6 +630,15 @@ export struct ScanTheStorageCode{
     gridCount: 4,
     customStyle: true,
   })
+  @Builder itemEnd(index:number) {
+    Row () {
+
+      Button("删除").margin("4vp")
+        .onClick(()=>{
+          this.ScanStoragelist.splice(index,1)
+        })
+    }.padding("4vp").justifyContent(FlexAlign.SpaceEvenly)
+  }
   build(){
     Column(){
       Row(){
@@ -663,16 +674,15 @@ export struct ScanTheStorageCode{
       .borderRadius(15)
       ///入库列表
       Column({ space: 5 }) {
-        Grid(this.scroller) {
+        List(){
           ForEach(this.ScanStoragelist, (item:ScanStorageCodeClass,index) => {
-            GridItem() {
+            ListItem() {
               Row(){
                 Column(){
-                  Text(item.batchCode)
                   Text(item.materialName)
                     .fontSize('32px')
-                  Text(item.materialNo)
-                    .fontSize('27px')
+                  Text(item.batchCode)
+                    .fontSize('32px')
                   Row(){
                     Text(item.num.toString())
                       . fontSize('51px')
@@ -686,6 +696,8 @@ export struct ScanTheStorageCode{
                 .justifyContent(FlexAlign.Center)
                 .height('100%')
                 .backgroundColor('#fff')
+
+
                 Column(){
                   Image($r('app.media.subscript'))
                     .width($r('app.float.storage_set_image_effect_height'))
@@ -710,12 +722,15 @@ export struct ScanTheStorageCode{
                 item.batchCode===''?this.OutboundControllertwo.open():this.OutboundController.open()
               })
             }
+            .swipeAction({ end:this.itemEnd(index)})
+            .margin(5)
           })
         }
+
         .padding(10)
-        .columnsTemplate('1fr 1fr ')
-        .columnsGap(10)
-        .rowsGap(10)
+        .lanes(2)
+        //.columnsGap(10)
+        // .rowsGap(10)
         .onScrollIndex((first: number) => {
           console.info(first.toString())
         })

entry/src/main/resources/base/media/cangchu.png → entry/src/main/resources/base/media/storage.png


+ 0 - 1
entry/src/main/resources/base/profile/main_pages.json

@@ -15,7 +15,6 @@
     "pages/process/ProcessDrawingPage",
     "pages/process/StationLoadingPage",
     "pages/processAreaPackage/ProcessArea1",
-    "pages/uyi",
     "pages/LoginPage"
   ]
 }