|
@@ -3,6 +3,7 @@ import JGRequest from '../common/util/request/Request'
|
|
|
import StorageRequest from '../common/util/request/StorageRequest'
|
|
|
import OrderInfo from '../model/OrderInfo'
|
|
|
import { Materialpositionclass, Tasklist } from './IntelligentWarehousingOutbound'
|
|
|
+import { Materialpositionclass1} from '../common/util/request/StorageRequestInstance'
|
|
|
import MaterialInfo from '../viewmodel/MaterialInfo'
|
|
|
import PageModel from '../viewmodel/PageModel'
|
|
|
import ProcessData from '../viewmodel/ProcessData'
|
|
@@ -13,7 +14,7 @@ import { MaterialInformationModel } from '../model/MaterialInformation'
|
|
|
import promptAction from '@ohos.promptAction'
|
|
|
import CommonConstants from '../common/constants/CommonConstants'
|
|
|
import { StationInfoModel } from '../model/StorageSpace'
|
|
|
-
|
|
|
+import { SureToDoDialog } from '../common/component/SureToDoDialog'
|
|
|
|
|
|
export interface stat3 {
|
|
|
statNo?: string
|
|
@@ -29,6 +30,98 @@ export interface stat3 {
|
|
|
@Entry
|
|
|
@Component
|
|
|
export struct CompleteSet {
|
|
|
+ @State private MaterialInfoArray: Array<Materialpositionclass1> = []
|
|
|
+ @State materialInfoName: string = 'aaa'
|
|
|
+ @State private positionInfoList: Array<MaterialInformationModel> = []
|
|
|
+ currentBoxStationModel: Materialpositionclass1 = {}
|
|
|
+
|
|
|
+ goingToLookDetail = async (m: Materialpositionclass1) => {
|
|
|
+ console.log('dyy',JSON.stringify(m))
|
|
|
+ this.currentBoxStationModel = m
|
|
|
+ this.positionInfoList = m?.materials ?? []
|
|
|
+ this.infoListController.open()
|
|
|
+ }
|
|
|
+ goingToOut = (m: Materialpositionclass1) => {
|
|
|
+ this.currentBoxStationModel = m
|
|
|
+ this.infoDialogController.open()
|
|
|
+ }
|
|
|
+ materialInfoController: CustomDialogController = new CustomDialogController({
|
|
|
+ builder: MaterailInfoDialog({
|
|
|
+ Materialposition: this.MaterialInfoArray,
|
|
|
+ materialName:this.materialInfoName,
|
|
|
+ lookDetail: this.goingToLookDetail,
|
|
|
+ goToOut: this.goingToOut,
|
|
|
+ }),
|
|
|
+ alignment: DialogAlignment.Center,
|
|
|
+ customStyle: true,
|
|
|
+ autoCancel: false,
|
|
|
+ })
|
|
|
+ dialogCancel = () => {
|
|
|
+ this.currentBoxStationModel = {}
|
|
|
+ this.infoDialogController.close()
|
|
|
+ this.infoListController.close()
|
|
|
+ }
|
|
|
+ dialogSure = async () => {
|
|
|
+ // let res: outBoxClass = await StorageRequest.post("/api/v1/wmsOrder/outBox", {
|
|
|
+ // houseNo: this.currentBoxStationModel?.houseNo ?? "",
|
|
|
+ // vehicleNo: this.currentBoxStationModel?.vehicleNo ?? this.currentBoxStationModel.vehicleCode ?? "",
|
|
|
+ // stanCode: CommonConstants.STATION_CODE
|
|
|
+ // } as RequestParamModel)
|
|
|
+
|
|
|
+ // this.outBox = res
|
|
|
+
|
|
|
+ promptAction.showToast({
|
|
|
+ message: "任务进行中,请等待....",
|
|
|
+ duration: 1800,
|
|
|
+ bottom: '50%'
|
|
|
+ })
|
|
|
+ this.infoDialogController.close()
|
|
|
+ this.materialLocationController.close()
|
|
|
+
|
|
|
+ }
|
|
|
+ infoDialogController: CustomDialogController = new CustomDialogController({
|
|
|
+ builder: SureToDoDialog(
|
|
|
+ {
|
|
|
+ cancel: this.dialogCancel,
|
|
|
+ confirm: this.dialogSure,
|
|
|
+ title: "出库确认",
|
|
|
+ info: '确认出库当前料箱吗?'
|
|
|
+ }
|
|
|
+ ),
|
|
|
+ alignment: DialogAlignment.Center,
|
|
|
+ customStyle: true,
|
|
|
+ autoCancel: false,
|
|
|
+ })
|
|
|
+ infoListController: CustomDialogController = new CustomDialogController({
|
|
|
+ builder: LocationInfoListDialog(
|
|
|
+ {
|
|
|
+ closeDialog: this.dialogCancel,
|
|
|
+ materials: this.positionInfoList
|
|
|
+ }
|
|
|
+ ),
|
|
|
+ alignment: DialogAlignment.Center,
|
|
|
+ customStyle: true,
|
|
|
+ autoCancel: false,
|
|
|
+ })
|
|
|
+
|
|
|
+ //请求物料位置
|
|
|
+ MaterialpositionHttp = async (code :string,name:string) => {
|
|
|
+ let res: Materialpositionclass1[] = await StorageRequest.post("/api/v1/process/vehicleOperation/stockMaterials", {
|
|
|
+ label: code,
|
|
|
+ } as RequestParamModel)
|
|
|
+ this.MaterialInfoArray = res
|
|
|
+ if(this.MaterialInfoArray.length>0){
|
|
|
+ this.materialInfoName = name
|
|
|
+ this.materialInfoController.open()
|
|
|
+ }else{
|
|
|
+ promptAction.showToast({
|
|
|
+ message: "无库存",
|
|
|
+ duration: 1800,
|
|
|
+ bottom: '50%'
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
//任务单id
|
|
|
@State orderId: string = ''
|
|
|
//齐套料箱重量
|
|
@@ -647,6 +740,15 @@ export struct CompleteSet {
|
|
|
.alignItems(HorizontalAlign.Start)
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
|
|
|
+ Column(){
|
|
|
+ Button("库存详情").margin("4vp")
|
|
|
+ .onClick(() => {
|
|
|
+ this.MaterialpositionHttp(item.materialCode,item.materialName)
|
|
|
+ })
|
|
|
+ }.width('20%')
|
|
|
+ .height('100')
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .alignItems(HorizontalAlign.Center)
|
|
|
|
|
|
// if (item.completeNum! === item.totalMaterial!) {
|
|
|
// Column() {
|
|
@@ -1418,6 +1520,224 @@ struct scanningMaterialBox {
|
|
|
.backgroundColor($r('app.color.process_divider_white_color'))
|
|
|
}
|
|
|
}
|
|
|
+// 物料位置(物料在哪些料箱里面)
|
|
|
+@CustomDialog
|
|
|
+struct LocationInfoListDialog {
|
|
|
+ @Link materials: MaterialInformationModel[]
|
|
|
+ scroller: Scroller = new Scroller()
|
|
|
+ Controller: CustomDialogController
|
|
|
+ closeDialog: () => void = () => {
|
|
|
+ }
|
|
|
+
|
|
|
+ build() {
|
|
|
+ Stack() {
|
|
|
+ Column() {
|
|
|
+ Grid(this.scroller) {
|
|
|
+ ForEach(this.materials, (item: MaterialInformationModel, index: number) => {
|
|
|
+ GridItem() {
|
|
|
+ Column() {
|
|
|
+ Row() {
|
|
|
+ Text(item?.materialName)
|
|
|
+ .fontSize($r('app.float.fontSize_24'))
|
|
|
+ .fontWeight(FontWeight.Regular)
|
|
|
+ .fontColor($r('app.color.black_90'))
|
|
|
+ .margin({ right: 15 })
|
|
|
+ Row() {
|
|
|
+ Text(item.num?.toString())
|
|
|
+ .fontSize($r('app.float.fontSize_38'))
|
|
|
+ .fontWeight(FontWeight.Bold)
|
|
|
+ .fontColor($r('app.color.black_90'))
|
|
|
+ Text(item.unit)
|
|
|
+ .fontSize($r('app.float.fontSize_24'))
|
|
|
+ .fontWeight(FontWeight.Regular)
|
|
|
+ .fontColor($r('app.color.black_60'))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
+ .width('100%')
|
|
|
+
|
|
|
+ Text(item.materialNo)
|
|
|
+ .fontSize($r('app.float.fontSize_24'))
|
|
|
+ .fontWeight(FontWeight.Regular)
|
|
|
+ .fontColor($r('app.color.black_60'))
|
|
|
+ .width('100%')
|
|
|
+ Text(item.spec)
|
|
|
+ .fontSize($r('app.float.fontSize_24'))
|
|
|
+ .fontWeight(FontWeight.Regular)
|
|
|
+ .fontColor($r('app.color.black_60'))
|
|
|
+ .width('100%')
|
|
|
+
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .alignItems(HorizontalAlign.Start)
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .padding({ left: 8, right: 10 })
|
|
|
+ .height('60')
|
|
|
+
|
|
|
+ }
|
|
|
+ .padding({ left: 5, bottom: 8 })
|
|
|
+ .borderRadius(5)
|
|
|
+ .border({ width: 2, color: Color.Gray })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .padding(10)
|
|
|
+ .columnsTemplate('1fr')
|
|
|
+ .columnsGap(10)
|
|
|
+ .rowsGap(10)
|
|
|
+ .width('100%')
|
|
|
+ .height('100%')
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .height('100%')
|
|
|
+ }
|
|
|
+ .width('60%')
|
|
|
+ .height('80%')
|
|
|
+ .backgroundColor($r('app.color.page_general_background'))
|
|
|
+ .borderRadius(20)
|
|
|
+ .onClick(() => {
|
|
|
+ this.closeDialog()
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+//库存详情弹窗
|
|
|
+@CustomDialog
|
|
|
+struct MaterailInfoDialog {
|
|
|
+ @Link Materialposition: Materialpositionclass1[]
|
|
|
+ scroller: Scroller = new Scroller()
|
|
|
+ @Link materialName: string
|
|
|
+ Controller: CustomDialogController
|
|
|
+ lookDetail: (m: Materialpositionclass1) => void = () => {
|
|
|
+ }
|
|
|
+ goToOut: (m: Materialpositionclass1) => void = () => {
|
|
|
+ }
|
|
|
+ build() {
|
|
|
+ Stack() {
|
|
|
+ Column() {
|
|
|
+
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .height('100%')
|
|
|
+ .blur(30)
|
|
|
+ .backgroundColor('#4d000000')
|
|
|
+
|
|
|
+ Column() {
|
|
|
+ Row() {
|
|
|
+ Row() {
|
|
|
+ Image($r('app.media.back_white'))
|
|
|
+ .width(px2vp(64))
|
|
|
+ .height(px2vp(64))
|
|
|
+ .onClick(() => {
|
|
|
+ this.Controller?.close()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .width('5%')
|
|
|
+ .padding({ left: 10 })
|
|
|
+
|
|
|
+ Row() {
|
|
|
+ Text(this.materialName && this.materialName.length > 0 ? this.materialName : '')
|
|
|
+ .fontSize($r('app.float.fontSize_38'))
|
|
|
+ .fontWeight(FontWeight.Medium)
|
|
|
+ .fontColor($r('app.color.process_divider_white_color'))
|
|
|
+ .width('100%')
|
|
|
+ .height('100%')
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ }
|
|
|
+ .width('90%')
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+
|
|
|
+ Row() {
|
|
|
+ }.width('5%')
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .height('15%')
|
|
|
+ .padding({ top: 8 })
|
|
|
+
|
|
|
+ Grid(this.scroller) {
|
|
|
+ ForEach(this.Materialposition, (item: Materialpositionclass1, index: number) => {
|
|
|
+ GridItem() {
|
|
|
+ Row() {
|
|
|
+ Column() {
|
|
|
+ Text(item.vehicleCode)
|
|
|
+ .fontSize($r('app.float.fontSize_24'))
|
|
|
+ .fontWeight(FontWeight.Regular)
|
|
|
+ .fontColor($r('app.color.black_60'))
|
|
|
+ .width('100%')
|
|
|
+
|
|
|
+ Text("坐标: " + item?.coordinate)
|
|
|
+ .fontSize($r('app.float.fontSize_24'))
|
|
|
+ .fontWeight(FontWeight.Regular)
|
|
|
+ .fontColor($r('app.color.black_90'))
|
|
|
+ .margin({ right: 15 })
|
|
|
+
|
|
|
+ Text("层数: " + item.position)
|
|
|
+ .fontSize($r('app.float.fontSize_24'))
|
|
|
+ .fontWeight(FontWeight.Regular)
|
|
|
+ .fontColor($r('app.color.black_90'))
|
|
|
+ .margin({ right: 15 })
|
|
|
+ }
|
|
|
+ .width('60%')
|
|
|
+ .alignItems(HorizontalAlign.Start)
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .height('100%')
|
|
|
+
|
|
|
+ Row() {
|
|
|
+ Text("详情")
|
|
|
+ .fontSize($r('app.float.fontSize_24'))
|
|
|
+ .fontWeight(FontWeight.Regular)
|
|
|
+ .fontColor($r('app.color.white_100'))
|
|
|
+ .backgroundColor($r('app.color.blue_100'))
|
|
|
+ .height(40)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .borderRadius(10)
|
|
|
+ .width(60)
|
|
|
+ .onClick(() => {
|
|
|
+ this.lookDetail(item)
|
|
|
+ })
|
|
|
+
|
|
|
+ // Text("出库")
|
|
|
+ // .fontSize($r('app.float.fontSize_24'))
|
|
|
+ // .fontWeight(FontWeight.Regular)
|
|
|
+ // .fontColor($r('app.color.white_100'))
|
|
|
+ // .margin({ left: 15 })
|
|
|
+ // .backgroundColor($r('app.color.warn_1'))
|
|
|
+ // .height(40)
|
|
|
+ // .textAlign(TextAlign.Center)
|
|
|
+ // .borderRadius(10)
|
|
|
+ // .width(60)
|
|
|
+ // .onClick(() => {
|
|
|
+ // this.goToOut(item)
|
|
|
+ // })
|
|
|
+ }
|
|
|
+ .width('40%')
|
|
|
+ .justifyContent(FlexAlign.End)
|
|
|
+ .height('100%')
|
|
|
+ }
|
|
|
+ .padding(5)
|
|
|
+ .borderRadius(10)
|
|
|
+ .height('12%')
|
|
|
+ .width('100%')
|
|
|
+ .backgroundColor($r('app.color.robot_set_card_white'))
|
|
|
+ }
|
|
|
+ .padding({ left: 5 })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .padding(10)
|
|
|
+ .columnsTemplate('1fr 1fr 1fr')
|
|
|
+ .columnsGap(10)
|
|
|
+ .rowsGap(10)
|
|
|
+ .width('100%')
|
|
|
+ .height('85%')
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .height('100%')
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .height('100%')
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
// 物料详情弹窗(序列号)
|
|
|
@CustomDialog
|