yixiaojun il y a 1 an
Parent
commit
935ee41338

+ 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.4:8088/"
+const baseUrl = "http://192.168.101.188:8088/"
 const DEBUG = true //
 
 // 创建实例

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

@@ -150,7 +150,7 @@ const task = async () : Promise<taskclass> => {
 export interface  WarehousingBufferHopperList {
   //料箱已存物料信息
   list?: WorkBinInfo[];
-  ///料箱编号
+  ///料箱编号-*+9
   vehicleNo?:string
 }
 const Warehousing = async() : Promise<WarehousingBufferHopperList[]> => {

+ 119 - 8
entry/src/main/ets/view/IntelligentStorageWarehousing.ets

@@ -1,12 +1,47 @@
 import {Warehousing,BufferHopper, WarehousingBufferHopperList,BufferHopperclass}from '../common/util/request/StorageRequestInstance'
 import { ScanTheStorageCode }from '../view/ScanTheStorageCode'
+import detailsList from '../model/detailsList';
+import StorageRequest from '../common/util/request/StorageRequest'
+import { formToJSON } from '@ohos/axios';
+
+// 入库取料箱数据
+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 ScanStorageCodeClass {
+  detailsList?:detailsList[]
   //批次号
+  index?:number
   //已经占用箱数
   useNum?:number
   //空箱数
   emptyBoxNum?:string
+  //产品规格
+  spec?:string
   //可用箱数
   canUsedNum?:string
   //总容量箱数
@@ -51,9 +86,74 @@ export interface ScanStorageCodeClass {
   vehicleNo?: string
   batchCode?:string
 }
+export interface  detailsListvlass {
+  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 bufferf {
+   @State index:number=0
+  outboundData = async() : Promise<outboundDataclass[]> => {
+    let obj:outboundDataclass[] = []
+    let res = await StorageRequest.post("/api/v3/wmsOrder/inBox", {
+      detailsList:this.ScanStoragecode,
+      taskId:'1'
+    })
+    console.log('testTag', '********' + JSON.stringify(res))
+    obj = JSON.parse(JSON.stringify(res))
+    return obj
+  }
+ // @State private ScanStoragecode:Array<outboundDataclass>=[]
+  @State private ScanStoragecode:Array<detailsListvlass>=[]
+  aboutToAppear(){
+    for (let index = 0,vehicleCode=0; index < this.ScanStoragecodelist.length; index++) {
+      let details: detailsListvlass = {}
+      details.materialName = this.ScanStoragecodelist[index].materialName
+      details.num=this.ScanStoragecodelist[index].num
+      details.materialNo=this.ScanStoragecodelist[index].materialNo
+      details.spec=this.ScanStoragecodelist[index].spec
+      details.batchCode=this.ScanStoragecodelist[index].batchCode
+      details.housetype='1'
+      details.locationNo='1-3-2'
+      details.houseNo='1'
+      details.coordinate= '3-2'
+      details.unit='个'
+      details.vehicleCode='ZJ005'
+      details.position='1'
+      this.ScanStoragecode.push(details)
+    }
+
+  }
+   @State private outboundDataList:Array<outboundDataclass>=[]
    @Link private ScanStoragecodelist:Array<ScanStorageCodeClass>
   @Link CunQuHuo:number
   scroller: Scroller = new Scroller()
@@ -80,8 +180,7 @@ struct bufferf {
           .fontColor('#99000000')
         Column(){
           Grid(this.scroller) {
-            ForEach(this.ScanStoragecodelist, (item:ScanStorageCodeClass) => {
-              //    ForEach(this.Number, (day: string) => {
+            ForEach(this.ScanStoragecodelist, (item:ScanStorageCodeClass,index) => {
               GridItem() {
                 Row(){
                   Column(){
@@ -109,6 +208,9 @@ struct bufferf {
                 .backgroundColor('#fff')
 
               }
+
+
+
             })
           }
           .padding(10)
@@ -149,7 +251,19 @@ struct bufferf {
             .backgroundColor('#0A59F7')
             .onClick(()=>{
               this.controller.close()
-              this.CunQuHuo=3
+              this.CunQuHuo=2
+              this. outboundData ().then((res : outboundDataclass[]) => {
+                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. outboundDataList = res
+                }
+              })
+              console.log("4632957"+JSON.stringify(this.outboundDataList))
             })
         }.width('100%')
         .height('15%')
@@ -272,15 +386,12 @@ struct ChuKU {
                   .borderRadius(10)
                   .height('25%')
                   .backgroundColor('#fff')
-                
-
               }
             })
           }
-          .onClick(()=>{
+          .onClick( ()=>{
             this.controller.close()
             this.CunQuHuo=1
-
           })
           .padding(10)
           .columnsTemplate('1fr 1fr 1fr ')
@@ -428,7 +539,7 @@ export struct IntelligentStorageWarehousing{
             LoadingProgress()
               .color(Color.Blue)
               .width('10%')
-            Text('正在出货')
+            Text('正在入库')
               .width('20%')
               .fontSize('27px')
               .height('100%')

+ 99 - 43
entry/src/main/ets/view/ScanTheStorageCode.ets

@@ -1,23 +1,29 @@
 import StorageRequest from '../common/util/request/StorageRequest';
 import { ScanStorageCodeClass } from './IntelligentStorageWarehousing';
 
-class Item{
-  name:string
-  id:string
-  text:string
-  type:string
-  constructor(  name:string,id:string,text:string,type:string) {
-    this.name=name
-    this.type=type
-    this.id=id
-    this.text=text
-  }
-}
+
+
 @CustomDialog
   ///无批次号物料详情弹窗
-struct Outbound {
-  @Link value:number
-  @State private items:Array<ScanStorageCodeClass>=[]
+struct batchNumberPopupBox {
+
+
+
+
+  @Link private ScanStoragelist:Array<ScanStorageCodeClass>
+  @Link index:number
+  //物料批次号用于弹窗接收修改
+  @Link batchCode:string
+  //物料名称用于窗接收修改
+  @Link materialName:string
+  @Link materialNo:string
+  @Link num:number
+  //物料序列号用于窗接收修改
+  @Link seqNo:string
+  //物料规格描述用于窗接收修改
+  @Link spec:string
+ // @Link value:number=this.num
+ // @State private items:Array<ScanStorageCodeClass>=[]
   @Link CunQuHuo:number
   scroller: Scroller = new Scroller()
   @State navigation:number=0
@@ -51,15 +57,15 @@ struct Outbound {
             .height('20%')
             .fontSize('51px')
           Column({space:10}){
-            Text('PCBA-ASSSD电路板')
+            Text(this.materialName)
               .fontSize('32px')
               .width('100%')
-            Text('100*200')
+            Text(this.spec)
               .fontSize($r('app.float.robot_state_font_size'))
               .textAlign(TextAlign.Start)
               .fontColor('#99000000')
               .width('100%')
-            Text('批次号:'+'1223341232123124121')
+            Text('批次号:'+this.batchCode)
               .fontSize($r('app.float.robot_state_font_size'))
               .textAlign(TextAlign.Start)
               .fontColor('#99000000')
@@ -92,16 +98,32 @@ struct Outbound {
               .fontColor('#99000000')
               .width('40%')
             Counter() {
-              Text(this.value.toString())
+              Text(this.num.toString())
 
             }
             .width('417px')
             .height('107px')
             .onInc(() => {
-              this.value++
+              this.num++
+              this.ScanStoragelist[this.index]= {
+                materialName: this.ScanStoragelist[this.index].materialName,
+                num:this.num,
+               materialNo:this.ScanStoragelist[this.index].materialNo,
+                batchCode:this.ScanStoragelist[this.index].batchCode,
+                seqNo:this.ScanStoragelist[this.index].seqNo,
+               spec:this.ScanStoragelist[this.index].spec,
+              }
             })
             .onDec(() => {
-              this.value--
+              this.num--
+              this.ScanStoragelist[this.index]= {
+                materialName: this.ScanStoragelist[this.index].materialName,
+                num:this.num,
+                materialNo:this.ScanStoragelist[this.index].materialNo,
+                batchCode:this.ScanStoragelist[this.index].batchCode,
+                seqNo:this.ScanStoragelist[this.index].seqNo,
+                spec:this.ScanStoragelist[this.index].spec,
+              }
             })
           }
 
@@ -137,18 +159,20 @@ struct Outbound {
 }
 @CustomDialog
   ///物料详情弹窗
-struct Outboundtwo {
-  private items:Array<Item>=[
-    new Item('大号螺丝','100*200','50','1'),
-    new Item('PCPA板','PCPA-ADSA-2344','5',''),
-    new Item('大号螺丝','100*200','50','1'),
-    new Item('大号螺丝','100*200','50','1'),
-    new Item('PCPA板','PCPA-ADSA-2344','5',''),
-    new Item('PCPA板','PCPA-ADSA-2344','5',''),
-    new Item('PCPA板','PCPA-ADSA-2344','5',''),
-    new Item('大号螺丝','100*200','50','1'),
-    new Item('大号螺丝','100*200','50','1'),
-  ]
+struct materialDetails {
+  @Link private ScanStoragelist:Array<ScanStorageCodeClass>
+
+  //物料批次号用于弹窗接收修改
+  @Link batchCode:string
+  //物料名称用于窗接收修改
+  @Link materialName:string
+  @Link materialNo:string
+  @Link num:number
+  //物料序列号用于窗接收修改
+  @Link seqNo:string
+  //物料规格描述用于窗接收修改
+  @Link spec:string
+
   @Link CunQuHuo:number
   scroller: Scroller = new Scroller()
   @State navigation:number=0
@@ -234,7 +258,7 @@ struct Outboundtwo {
           .height('20%')
           Column(){
             Grid(this.scroller) {
-              ForEach(this.items, (item:Item) => {
+              ForEach(this.ScanStoragelist, (item:ScanStorageCodeClass) => {
                 //    ForEach(this.Number, (day: string) => {
                 GridItem() {
                   Row(){
@@ -533,15 +557,33 @@ struct buffer {
 
 @Component
 export struct ScanTheStorageCode{
+  @State index:number=0
+  //物料批次号用于传给弹窗修改
+  @State batchCode:string=''
+  //物料名称用于传给弹窗修改
+  @State materialName:string=''
+  @State materialNo:string=''
+  @State num:number=0
+  //物料序列号用于传给弹窗修改
+  @State seqNo:string=''
+  //物料规格描述用于传给弹窗修改
+  @State spec:string=''
+
   @State textValue: string = ''
   @State inputValue: string = ''
   @State value:number=0
   @State ZhuangTai:number=0
   @State CunQuHuo:number=0
   OutboundControllertwo: CustomDialogController = new CustomDialogController({
-    builder:Outboundtwo({
+    builder:materialDetails({
+      ScanStoragelist:this.ScanStoragelist,
       CunQuHuo:this.CunQuHuo,
-
+      spec:this.spec,
+      materialNo:this.materialNo,
+      materialName:this.materialName,
+      num:this.num,
+      seqNo:this.seqNo,
+      batchCode:this.batchCode,
       textValue: $textValue,
       inputValue: $inputValue,
     }),
@@ -552,8 +594,16 @@ export struct ScanTheStorageCode{
   })
   //////物料详情弹窗控制器
   OutboundController: CustomDialogController = new CustomDialogController({
-    builder:Outbound({
-      value:this.value,
+    builder:batchNumberPopupBox({
+      index:this.index,
+      ScanStoragelist:this.ScanStoragelist,
+      spec:this.spec,
+      materialNo:this.materialNo,
+      materialName:this.materialName,
+      num:this.num,
+      seqNo:this.seqNo,
+      batchCode:this.batchCode,
+      //value:this.value,
       CunQuHuo:this.CunQuHuo,
       textValue: $textValue,
       inputValue: $inputValue,
@@ -614,8 +664,7 @@ export struct ScanTheStorageCode{
       ///入库列表
       Column({ space: 5 }) {
         Grid(this.scroller) {
-          ForEach(this.ScanStoragelist, (item:ScanStorageCodeClass) => {
-            //    ForEach(this.Number, (day: string) => {
+          ForEach(this.ScanStoragelist, (item:ScanStorageCodeClass,index) => {
             GridItem() {
               Row(){
                 Column(){
@@ -638,9 +687,9 @@ export struct ScanTheStorageCode{
                 .height('100%')
                 .backgroundColor('#fff')
                 Column(){
-                  Image($r('app.media.jiaobiao'))
-                    .width('27px')
-                    .height('27px')
+                  Image($r('app.media.subscript'))
+                    .width($r('app.float.storage_set_image_effect_height'))
+                    .height($r('app.float.storage_set_image_effect_height'))
 
                 }.width('10%')
                 .justifyContent(FlexAlign.End)
@@ -651,6 +700,13 @@ export struct ScanTheStorageCode{
               .borderRadius(10)
               .backgroundColor('#fff')
               .onClick(()=>{
+                this.index=index
+                this.batchCode=item.batchCode
+                this.materialName=item.materialName
+                this.materialNo=item.materialNo
+                this.num=item.num
+                this.seqNo=item.seqNo
+                this.spec=item.spec
                 item.batchCode===''?this.OutboundControllertwo.open():this.OutboundController.open()
               })
             }

+ 8 - 1
entry/src/main/resources/base/media/subscript.svg

@@ -1,3 +1,10 @@
-<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
+<svg width="38" height="38" viewBox="0 0 38 38" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_150_424)">
 <path d="M18 16V2.82843C18 1.04662 15.8457 0.154282 14.5858 1.41421L1.41421 14.5858C0.154284 15.8457 1.04662 18 2.82843 18H16C17.1046 18 18 17.1046 18 16Z" fill="black" fill-opacity="0.1"/>
+</g>
+<defs>
+<clipPath id="clip0_150_424">
+<rect width="38" height="38" fill="white"/>
+</clipPath>
+</defs>
 </svg>