import EquipmentRequest from '../common/util/request/EquipmentRequest' 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' import RequestParamModel from '../viewmodel/RequestParamModel' import RequestParamModel2 from '../viewmodel/RequestParamModel2' import { stat2 } from './ManualWarehousing' 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 //料箱编号 rfid?: string //料箱检测的io位,1:有,0:没有 io?: string //0:无锁定,1:锁定,即机器人正在动作,不能进出库动作 lock?: string ts?: string } @Entry @Component export struct CompleteSet { @State private MaterialInfoArray: Array = [] @State materialInfoName: string = 'aaa' @State private positionInfoList: Array = [] 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 = '' //齐套料箱重量 @State BoxWeight: number = 20 // 暂时的料箱编码 @State vehicleCode: string = '' //物料名称 @State materialName: string = '' //工序id @State operationId: string = '' //扫描料箱获得料箱编码绑定料箱为齐套料箱 @State boxInfo: BoxInfo = {} //取料箱中物料信息 @State private boxMaterials: Array = [] //取出料箱 @State private outBox: Array = [] //齐套物料信息 @State private Mposition: Array = [] //查询物料存放的所有位置 @State materialPositionArray: Array = [] //选中取出的物料位置 @State materialPosition: Materialpositionclass = {} //暂时固定的料箱编码 @State binCode: string = 'ZJ-JG031' //点击任务单 @State selectOrder: number = -2 //任务单列表 @State orderArray: OrderInfo[] = []; //任务单工单单号 @State taskOrderNumber: string = '' //工单物料切换(1:显示工单列表 2:显示工序下的物料列表) @State orderMaterialSwitch: number = 1 //任务单id @State primaryKeyId: string = '' //齐套料箱状态不可以点击:0,可以点击:1 @State completeSetMaterialState: number = 0 //物料编码 @State materialCode: string = '' //1:抽屉在料格内 2:抽屉在料格外 @State drawerPositionStatus: number = 1 //出库口料格状态(1:有料箱 0:无料箱) @State materialGridStatus: number = 0 //是否取空箱子(1:是 2:否) @State isTakeOutBox: number = 0 // 叫空料箱数量 @State callBoxNum: number = 1 //点击选择任务单变颜色 @State onclick: number = -1 //点击扫描料箱切换成齐套料箱编码 @State clickScan: number = 0 //物料列表 @State scanCodeMIndex: number = 2 //齐套料箱扫码后对应的最左侧的index @State materialArray: MaterialInfo[] = [] materialController: Scroller = new Scroller() // 中间输入框绑定的值 @State scanCodeValue: string = "" //工单分页查询相关参数 private orderPageNo: number = 1 private orderPageSize: number = 10 orderTotalCount?: number = 0 private orderTotalPages: number = 0 //料箱等级(类型) @State vehicleLevel: string = '' //料箱编号 @State vehicleNo: string = '' //工序列表 @State processes: ProcessData[] = []; @State currentWorkOrderCode: string = "" // 选择工序 @State selectProcess: ProcessData = {} // 工序关联物料分页查询相关参数 private pageNo: number = 1 private pageSize: number = 10 totalCount?: number = 0 private totalPages: number = 0 //硬件数据 @State private entranceWaiting: Array = [] //左边任务单列表 @State private TasklistoutboundData: Array = [] //扫码控制器 textController: TextInputController = new TextInputController() // 通过RFID请求读取料箱的信息 rfidTimer: number = -1 @State preRfid: string = "" //记录上一次的rfid,如果变化了 就清空回库下面的列表 @State imgSrc:Resource = $r('app.media.drawer_inside') //设置img图片路径 setImgSrc = ()=>{ if(this.drawerPositionStatus == 1 && this.materialGridStatus == 0){ this.imgSrc = $r('app.media.drawer_inside') }else if(this.drawerPositionStatus == 0 && this.materialGridStatus == 0){ this.imgSrc = $r('app.media.drawer_outside') } else if(this.drawerPositionStatus === 1 && this.materialGridStatus === 1){ this.imgSrc = $r('app.media.D_W_inside') } else if(this.drawerPositionStatus === 0 && this.materialGridStatus === 1) { this.imgSrc = $r('app.media.D_W_outside') } } @State private recentlyRecordObject: StationInfoModel = {} rfidInfoIntervalFun = async () => { let res: StationInfoModel = await StorageRequest.post("api/v1/wms/common/queryStationInfo", { stanCode: CommonConstants.STATION_CODE } as RequestParamModel) this.recentlyRecordObject = res console.log('dyyinfo',JSON.stringify(res)) this.drawerPositionStatus = res.lock==null? 1: Number(res.lock) this.setImgSrc() // 清空回库下面的数组逻辑 if (this.preRfid && this.preRfid != this.recentlyRecordObject.rfid) { this.boxMaterials = [] } this.preRfid = this.recentlyRecordObject.rfid ?? "" // 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' } } //扫码请求 @State private MaterialInformation: Array = [] ScanStorageCode = async (itemCode: string) => { // BM51264341413217;SL9;PHthi5558; this.scanCodeValue = "" let res: MaterialInformationModel = await StorageRequest.post("/api/v1/process/circulation/material", { label: itemCode //"#gys022#sc022#100#20220929#31" } as MaterialInformationModel) //let res = await StorageRequest.get("/api/v3/stock/selectSafeList/1") // {"batchCode":"BM47111400130447;SL5","codeType":"BATCH","materialCode":"47111400130447","materialName":"穿心电容","num":5,"spec":"G CT52-4-1-2C1-63V-103-M","unitDictLabel":"个","unitDictValue":"个"} let obj: MaterialInformationModel = JSON.parse(JSON.stringify(res)) // 判断扫描完成后返回的物料码是否是当前需要齐套的物料 let hasCode: boolean = false for (let i = 0; i < this.materialArray.length; i++) { if (obj.materialCode == this.materialArray[i].materialCode) { hasCode = true this.scanCodeMIndex = i break } } if (!hasCode) { promptAction.showToast({ message: "不是当前工序中的物料", bottom: "50%", duration: 2000 }) return } this.materialController.scrollToIndex(this.scanCodeMIndex) // 扫码完成之后,如果数组中有对应的值,就添加数量否则就push let toPushArray: MaterialInformationModel[] = [...this.MaterialInformation] let has = false for (let i = 0; i < toPushArray.length; i++) { let box: MaterialInformationModel = toPushArray[i] if (obj.materialCode == box.materialCode && obj.batchCode == box.batchCode && obj.batchNo == box.batchNo) { let number = obj.num! + box.num! box.num = number has = true } } if (!has) { toPushArray.unshift(JSON.parse(JSON.stringify(obj))) } this.MaterialInformation = [...toPushArray] } async aboutToAppear() { this.rfidTimer = setInterval(() => { this.rfidInfoIntervalFun() }, 1500) // 查询订单数据 let res = await this.queryOrderPage() if (res.totalCount === undefined || res.totalCount <= 0 || res.totalPages === undefined || res.totalPages <= 0) { return } this.orderTotalCount = res.totalCount this.orderTotalPages = res.totalPages if (res.records) { this.orderArray = res.records } // 设置默认值 if (this.orderArray && this.orderArray.length > 0) { this.selectOrder = -1 if (this.orderArray[0]?.workOrderCode) { this.processes = await JGRequest.get('/api/v1/process/vehicleOperation/operation/' + this.orderArray[0]?.workOrderCode, { }) as ProcessData[] } } } aboutToDisappear(): void { clearInterval(this.rfidTimer) } // 未齐套订单分页查询 private async queryOrderPage() { return await JGRequest.post('/api/v1/plan/workOrder/page', { pageNo: this.orderPageNo, pageSize: this.orderPageSize, itemAllotState: '0' } as RequestParamModel2) as PageModel; } // 工序物料分页查询 private async queryMaterialPage() { return await StorageRequest.post('/api/v1/process/vehicleOperation/operationMaterial', { operationId: this.selectProcess?.operationId!, pageNo: this.pageNo, pageSize: this.pageSize, workOrderCode: this.orderArray[this.selectOrder]?.workOrderCode! } as RequestParamModel2) as PageModel } //工序弹窗 selectProcessController: CustomDialogController = new CustomDialogController({ builder: SelectProcessDialog({ selectProcess: this.selectProcess, processes: this.processes, orderMaterialSwitch: this.orderMaterialSwitch, confirm: async () => { this.materialArray = [] //重置pageNo this.pageNo = 1 // 查询工序关联的物料信息 let res = await this.queryMaterialPage() // 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.scanCodeMIndex = -1 this.materialArray = res.records ?? [] this.textController.stopEditing() } }), alignment: DialogAlignment.Center, customStyle: true, autoCancel: true, }) //料箱绑定工序操作 //后端回库入库操作 Warehousing = async (): Promise => { let res: MaterialInformationModel[] = await StorageRequest.post("/api/v1/wmsOrder/inBox", { houseNo: '1', stanCode: CommonConstants.STATION_CODE, vehicleCode: this.recentlyRecordObject.rfid, detailsList: this.boxMaterials, wcsType: "kitting", } as RequestParamModel) promptAction.showToast({ message: '请求成功,业务处理中。。。', duration: 2000, bottom: 150 }); if (!this.recentlyRecordObject.rfid) { // 当盒子被小车吊走了才清空 this.boxMaterials = [] } return res } /////请求齐套物料信息 Materialposition = async (item: MaterialInfo) => { let res: MaterialInformationModel[] = await StorageRequest.post("/api/v1/process/vehicleMaterial/list", { materialName: item.materialName, materialCode: item.materialCode, operationId: this.selectProcess.operationId } as RequestParamModel) this.materialName = item?.materialName ?? "" console.log("xxxxxxxxxxxxxxxxxx", JSON.stringify(item), JSON.stringify(res)) this.Mposition = res this.materialLocationController.open() } //齐套的物料信息 materialLocationController: CustomDialogController = new CustomDialogController({ builder: MaterialLocationDialog({ materialName: this.materialName, boxMaterials: this.Mposition, }), alignment: DialogAlignment.Center, customStyle: true, autoCancel: false, }) //取空箱子弹窗 emptyBoxController: CustomDialogController = new CustomDialogController({ builder: EmptyBoxDialog({ callBoxNum: this.callBoxNum, isTakeOutBox: this.isTakeOutBox, }), alignment: DialogAlignment.Center, customStyle: true, autoCancel: true, }) //扫描料箱弹窗 scanningMaterialBoxController: CustomDialogController = new CustomDialogController({ builder: scanningMaterialBox({ binCode: this.binCode, boxInfo: this.boxInfo, clickScan: this.clickScan, vehicleCode: this.vehicleCode, selectOrder: this.selectOrder, orderArray: this.orderArray, materialCode: this.materialCode }), alignment: DialogAlignment.Center, customStyle: true, autoCancel: true, }) // async materialBoxHTTP(vehicleCode: string) { // return await StorageRequest.post('/api/v1/process/vehicleOperation/vehicleDetail', { // workOrderCode: this.orderArray[this.selectOrder]?.workOrderCode!, // operationId: Number.parseInt(this.selectProcess?.operationId!), // vehicleCode: vehicleCode, // } as RequestParamModel) as BoxInfo // } //查询取出的料箱里面的物料信息 boxMaterialHttp = async (): Promise => { let res: MaterialInformationModel[] = await StorageRequest.post("/api/v1/stock/list", { vehicleCode: this.entranceWaiting[0].rfid! } as RequestParamModel) console.log('testTag', 'aaaaaaaa2' + JSON.stringify(res)); this.boxMaterials = res return res } //硬件请求回库操作 warehousingHttp = async (): Promise => { let res: boxMaterialClass = await StorageRequest.post("/api/v1/wcs/stockin", { boxNo: this.vehicleNo, position: "stat3", mtype: this.vehicleLevel } as RequestParamModel) console.log('testTag1', '----------' + JSON.stringify(res)); return res } // 点击齐套料箱的时候需要将右侧的数组push到左侧,但是需要先提前掉一个接口 toCompleteSuitFun = async () => { let result: boxMaterialClass = await StorageRequest.post("api/v1/process/vehicleOperation/add", { operationId: this.selectProcess.operationId, workOrderCode: this.currentWorkOrderCode, vehicleCode: this.recentlyRecordObject.rfid, processVehicleMaterialList: this.MaterialInformation } as RequestParamModel) // ===================== let toPushArray: MaterialInformationModel[] = [...this.boxMaterials] this.MaterialInformation.forEach((middleBox) => { let has = false for (let i = 0; i < toPushArray.length; i++) { let box = toPushArray[i] if (middleBox.materialCode == box.materialCode) { let number = middleBox.num! + box.num! box.num = number has = true } } if (!has) { toPushArray.push(JSON.parse(JSON.stringify(middleBox))) } }) this.boxMaterials = [...toPushArray] this.MaterialInformation = [] // ===================== // 添加完成之后需要更新最左侧已经选择的工序下边的物料列表 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 } } build() { Row({ space: px2vp(24) }) { if (this.orderMaterialSwitch === 1) { Column() { List({ space: px2vp(20) }) { ForEach(this.orderArray, (item: OrderInfo, index: number) => { ListItem() { Column() { Row() { Text(item.orderName) .fontSize($r('app.float.fontSize_24')) .fontWeight(FontWeight.Medium) .fontColor(this.selectOrder === index ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color')) .opacity(this.selectOrder === index ? $r('app.float.card_font_select_opacity') : 1) } .width('100%') .justifyContent(FlexAlign.Start) Row() { Text('产品型号: ' + item?.materialModel ?? "") .fontWeight(FontWeight.Regular) .fontSize($r('app.float.fontSize_20')) .fontColor(this.selectOrder === index ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color')) } .width('100%') .justifyContent(FlexAlign.Start) Row() { Text('计划编号: ') .fontWeight(FontWeight.Regular) .fontSize($r('app.float.fontSize_20')) .fontColor(this.selectOrder === index ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color')) Text(item.workOrderCode) .fontSize($r('app.float.fontSize_20')) .fontWeight(FontWeight.Medium) .fontColor(this.selectOrder === index ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color')) } .width('100%') .justifyContent(FlexAlign.Start) Row() { Text('订单编号: ') .fontWeight(FontWeight.Regular) .fontSize($r('app.float.fontSize_20')) .fontColor(this.selectOrder === index ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color')) Text(item.orderCode) .fontSize($r('app.float.fontSize_20')) .fontWeight(FontWeight.Medium) .fontColor(this.selectOrder === index ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color')) } .width('100%') .justifyContent(FlexAlign.Start) Row() { Text('下发时间: ') .fontSize($r('app.float.fontSize_20')) .fontWeight(FontWeight.Regular) .fontColor(this.selectOrder === index ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color')) Text(item?.planStartWhen && item.planStartWhen.length > 0 ? item.planStartWhen.split(' ')[0] : '') .fontSize($r('app.float.fontSize_20')) .fontWeight(FontWeight.Medium) .fontColor(this.selectOrder === index ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color')) } .width('100%') .justifyContent(FlexAlign.Start) } .justifyContent(FlexAlign.Center) // .alignItems(HorizontalAlign.Center) .onClick(async () => { // 另外选择了工单,则把工序、选择的工序清空 // if (this.selectOrder && this.selectOrder != index) { // this.selectProcess = {} // this.processes = [] // } this.processes = [] this.currentWorkOrderCode = item.workOrderCode ?? "" this.orderId = item.taskId! if (item?.workOrderCode && item.workOrderCode.length > 0) { this.selectProcessController.open() this.selectOrder = index this.processes = await StorageRequest.get("/api/v1/process/vehicleOperation/operation/" + item.workOrderCode, { }) } // else { // this.selectProcess = {} // this.processes = [] // } }) .width(px2vp(608)) .padding(8) .borderRadius($r('app.float.general_border_radius')) .backgroundColor(this.selectOrder === index ? $r('app.color.order_select_background') : $r('app.color.general_card_background_color')) } }) } .width(px2vp(608)) .height(px2vp(870)) // 未完成订单大于10条,触底再去查询 .onReachEnd(async () => { if (!this.orderTotalPages || this.orderTotalPages <= 1) { return } if (this.orderPageNo >= this.orderTotalPages) { return } this.orderPageNo++ let res = await this.queryOrderPage() as PageModel this.orderArray = this.orderArray?.concat(res.records as OrderInfo[]) }) } .width(px2vp(608)) .height(px2vp(900)) .borderRadius($r('app.float.borderRadius_16')) } // 已经选择了工序后 展示的列表和上面的title else if (this.orderMaterialSwitch === 2) { Column() { Row() { Image($r('app.media.circular_return')) .width(px2vp(80)) .height(px2vp(80)) .onClick(() => { this.orderMaterialSwitch = 1 }) Blank() Row() { Column({ space: 10 }) { Text(this.selectProcess?.operationName && this.selectProcess.operationName.length > 0 ? this.selectProcess.operationName! : '') .fontWeight(FontWeight.Medium) .fontSize($r('app.float.fontSize_20')) .fontColor($r('app.color.blue_100')) .opacity($r('app.float.general_font_opacity')) Text(this.orderArray[this.selectOrder]?.orderName && (this.orderArray[this.selectOrder]?.orderName?.length!) > 0 ? this.orderArray[this.selectOrder]?.orderName! : '') .fontSize($r('app.float.fontSize_20')) .fontWeight(FontWeight.Regular) .fontColor($r('app.color.blue_100')) .opacity($r('app.float.general_font_opacity')) } .margin({ left: 10 }) .width('80%') .height('100%') .padding({ left: 10 }) .borderRadius(px2vp(15)) .alignItems(HorizontalAlign.Start) .justifyContent(FlexAlign.Center) Blank() Image($r('app.media.subscript')) .width(px2vp(20)) .height(px2vp(20)) } .alignItems(VerticalAlign.Bottom) .width('80%') .borderRadius(px2vp(15)) .backgroundColor('#0f000000') .height('100%') .onClick(() => { this.selectProcessController.open() }) } .width('100%') .height('10%') .margin({ bottom: "2%" }) Column() { List({ space: 3, scroller: this.materialController }) { ForEach(this.materialArray, (item: MaterialInfo, index: number) => { ListItem() { Row() { Column() { Text(item.materialName) .fontSize($r('app.float.fontSize_24')) .fontWeight(FontWeight.Medium) .fontColor($r('app.color.black_90')) .width('100%') Text(item.materialCode) .fontWeight(FontWeight.Regular) .fontSize($r('app.float.fontSize_20')) .fontColor($r('app.color.black_60')) .width('100%') Text(item.completeNum?.toString() + '/' + item.totalMaterial?.toString()) .fontSize($r('app.float.fontSize_24')) .fontColor($r('app.color.black_90')) .fontWeight(FontWeight.Bold) .width('100%') .margin({ top: 8 }) Text('已拣/总需') .fontSize($r('app.float.fontSize_20')) .fontColor($r('app.color.black_60')) .width('100%') } .width('70%') .padding({ left: 20, right: 20 }) .borderRadius(px2vp(16)) .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() { // Image($r('app.media.collect_completed')) // .width(px2vp(80)) // .height(px2vp(80)) // .borderRadius(px2vp(16)) // } // .justifyContent(FlexAlign.Start) // .width('30%') // // .borderRadius(px2vp(16)) // } } .border({ width: this.scanCodeMIndex === index ? 3 : 0, color: $r("app.color.warn_1") }) .padding(8) .borderRadius(10) .margin(px2vp(8)) .width('98%') .onClick(async () => { this.Materialposition(item) }) .backgroundColor(item.completeNum! >= item.totalMaterial! ? $r('app.color.green_100') : $r('app.color.robot_set_card_white')) } }) } .width('100%') .height('100%') .onReachEnd(async () => { if (!this.totalPages || this.totalPages <= 1) { return } if (this.pageNo >= this.totalPages) { return } this.pageNo++ // 查询工序关联的物料信息 let res = await this.queryMaterialPage() this.materialArray = this.materialArray?.concat(res.records as MaterialInfo[]) }) } .width('100%') .height('88%') .borderRadius($r('app.float.borderRadius_16')) } .width(px2vp(608)) .height(px2vp(900)) .borderRadius($r('app.float.borderRadius_16')) } Column() { Stack() { Image(this.imgSrc) .width(px2vp(608)) .height(px2vp(220)) .borderRadius(px2vp(16)) Column() { Text('抽屉状态') .textAlign(TextAlign.End) .width('48%') .height('20%') .fontWeight(FontWeight.Regular) .fontSize($r('app.float.fontSize_20')) .fontColor($r('app.color.process_nameplate_grey_color')) Text(this.recentlyRecordObject.lockStr) .textAlign(TextAlign.End) .width('48%') .height('25%') .fontWeight(FontWeight.Regular) .fontSize($r('app.float.fontSize_24')) .fontColor($r('app.color.black_90')) Blank() Text('料箱ID') .textAlign(TextAlign.End) .width('48%') .height('20%') .fontWeight(FontWeight.Regular) .fontSize($r('app.float.fontSize_20')) .fontColor($r('app.color.process_nameplate_grey_color')) Text(this.recentlyRecordObject.rfid ?? "") .textAlign(TextAlign.End) .width('100%') .height('25%') .fontWeight(FontWeight.Regular) .fontSize($r('app.float.fontSize_24')) .fontColor($r('app.color.black_90')) } .width(px2vp(608)) .height(px2vp(220)) .borderRadius(px2vp(16)) .padding({ right: $r('app.float.borderRadius_16') }) .alignItems(HorizontalAlign.End) } .width(px2vp(608)) .height(px2vp(220)) .borderRadius(px2vp(16)) .margin({ bottom: px2vp(20) }) Button('回库') .fontSize($r('app.float.fontSize_24')) .fontColor($r('app.color.general_font_white_color')) .width(px2vp(608)) .height(px2vp(80)) .margin({ bottom: px2vp(20) }) .focusable(false) .backgroundColor(this.materialGridStatus === 1 ? $r('app.color.green_100') : this.materialGridStatus === 0 ? $r('app.color.Green_20') : '') .onClick(() => { if (this.materialGridStatus === 1) { //执行后端入库操作 this.Warehousing() } }) List({ space: '2%' }) { ForEach(this.boxMaterials, (item: MaterialInformationModel, index: number) => { ListItem() { Row() { Column() { Column() { Row().height('23%') Text(item.materialName ? item.materialName! : '') .fontSize($r('app.float.fontSize_24')) .fontColor($r('app.color.general_font_color')) .fontWeight(FontWeight.Medium) .opacity($r('app.float.general_font_opacity')) Text(item.materialCode ? item.materialCode : '') .fontSize($r('app.float.fontSize_20')) .fontColor($r('app.color.process_nameplate_grey_color')) .fontWeight(FontWeight.Medium) } .height('50%') .width('90%') .alignItems(HorizontalAlign.Start) Column() { Row() { Text(item.num?.toString()) .fontSize($r('app.float.fontSize_38')) .fontColor($r('app.color.general_font_color')) .fontWeight(FontWeight.Bold) Text(item.unitDictLabel ?? "个") .fontSize($r('app.float.fontSize_20')) .fontColor($r('app.color.process_nameplate_grey_color')) .fontWeight(FontWeight.Medium) } .width('90%') Blank() Row() { Image($r('app.media.subscript_space')) .height($r('app.float.card_subscript_new_size')) .width($r('app.float.card_subscript_new_size')) } .alignItems(VerticalAlign.Bottom) .justifyContent(FlexAlign.End) .width('100%') } .height('50%') .width('100%') } .width('100%') .borderRadius($r('app.float.general_border_radius')) .alignItems(HorizontalAlign.Center) .justifyContent(FlexAlign.Center) .height('100%') } .borderRadius(px2vp(16)) .height('30%') .onClick(() => { }) .backgroundColor(this.onclick === index ? $r('app.color.robot_set_card_blue') : $r('app.color.robot_set_card_white')) } }) } .width(px2vp(608)) .height(px2vp(525)) } .width(px2vp(608)) .height(px2vp(900)) .borderRadius($r('app.float.borderRadius_16')) Column() { Stack() { Image(this.BoxWeight === 0 ? $r('app.media.no_material_box') : this.BoxWeight <= 15 && this.BoxWeight !== 0 ? $r('app.media.normal_box') : $r('app.media.overweight_box')) .width(px2vp(608)) .height(px2vp(220)) .borderRadius(px2vp(16)) Column() { Text('料箱重量') .textAlign(TextAlign.End) .width('48%') .height('20%') .fontWeight(FontWeight.Regular) .fontSize($r('app.float.fontSize_20')) .fontColor($r('app.color.process_nameplate_grey_color')) Text(this.recentlyRecordObject.weight) .textAlign(TextAlign.End) .width('48%') .height('25%') .fontWeight(FontWeight.Regular) .fontSize($r('app.float.fontSize_24')) .fontColor(this.BoxWeight <= 15 ? $r('app.color.black_90') : $r('app.color.brown_100')) Blank() Text('料箱ID') .textAlign(TextAlign.End) .width('48%') .height('20%') .fontWeight(FontWeight.Regular) .fontSize($r('app.float.fontSize_20')) .fontColor($r('app.color.process_nameplate_grey_color')) .focusable(true) .defaultFocus(false) Text(this.recentlyRecordObject.rfid) .textAlign(TextAlign.End) .width('100%') .height('25%') .fontWeight(FontWeight.Regular) .fontSize($r('app.float.fontSize_24')) .fontColor($r('app.color.black_90')) } .width(px2vp(608)) .height(px2vp(220)) .borderRadius(px2vp(16)) .padding({ right: $r('app.float.borderRadius_16') }) .alignItems(HorizontalAlign.End) } .width(px2vp(608)) .height(px2vp(220)) Row() { Image($r('app.media.shaoma')) .width(px2vp(25)) .height(px2vp(25)) .focusable(true) .defaultFocus(false) TextInput({ text: this.scanCodeValue, placeholder: '点击扫码添加物料', controller: this.textController }) .width('92%') .height('100%') .width('80%') .defaultFocus(false) .fontWeight(FontWeight.Medium) .fontSize('32px') .backgroundColor("#ffff") .borderRadius(21) .onChange((value: string) => { this.scanCodeValue = value }) .onSubmit(() => { this.ScanStorageCode(this.scanCodeValue) }) Image($r('app.media.search')) .width(px2vp(32)) .height(px2vp(32)) .onClick(async () => { this.ScanStorageCode(this.scanCodeValue) this.textController.stopEditing() }) } .width(px2vp(608)) .height(px2vp(80)) .justifyContent(FlexAlign.Center) .borderRadius(px2vp(100)) .alignItems(VerticalAlign.Center) .backgroundColor($r('app.color.process_divider_white_color')) .margin({ top: px2vp(20) }) Column() { List() { ForEach(this.MaterialInformation, (item: MaterialInformationModel, index: number) => { ListItem() { Row() { Column() { Text(item.materialName) .fontSize($r('app.float.fontSize_24')) .fontColor($r('app.color.general_font_color')) .fontWeight(FontWeight.Medium) .opacity($r('app.float.general_font_opacity')) Text(item.batchNo) .fontSize($r('app.float.fontSize_20')) .fontColor($r('app.color.process_nameplate_grey_color')) .fontWeight(FontWeight.Medium) Text(item.materialCode) .fontSize($r('app.float.fontSize_20')) .fontColor($r('app.color.process_nameplate_grey_color')) .fontWeight(FontWeight.Medium) Text(item.spec) .fontSize($r('app.float.fontSize_20')) .fontColor($r('app.color.process_nameplate_grey_color')) .fontWeight(FontWeight.Medium) Row() { // 可以更改数量的输入框 TextInput({ text: item.num?.toString() }) .fontSize(14) .fontWeight(FontWeight.Bold) .fontColor($r('app.color.general_font_color'))// .opacity($r('app.float.general_font_opacity')) .height(30) .width(120) .type(InputType.Number) .defaultFocus(false) .textAlign(TextAlign.Start) .borderRadius(0) .border({ width: 0.4 }) .onChange((value) => { item.num = Number(value) }) Text(item.unitDictLabel ?? item.unit ?? "个") .fontSize($r('app.float.fontSize_20')) .fontColor($r('app.color.process_nameplate_grey_color')) .fontWeight(FontWeight.Medium) } .justifyContent(FlexAlign.End) .width("100%") } .width("100%") .alignItems(HorizontalAlign.Start) // 删除按钮 Row() { Image($r("app.media.reduce")).width(25).height(5) } .width(30) .height(30) .position({ x: '90%', y: 3 }) .alignItems(VerticalAlign.Center) .justifyContent(FlexAlign.Center) .onClick(() => { this.MaterialInformation.splice(index, 1) }) } .width("100%") .borderRadius(10) .margin({ top: 5 }) .padding(8) .backgroundColor($r('app.color.robot_set_card_white')) } }) } .width(px2vp(608)) .height(px2vp(450)) .margin({ bottom: px2vp(20) }) Button('齐套料箱') .fontSize($r('app.float.fontSize_24')) .fontColor($r('app.color.general_font_white_color')) .width(px2vp(608)) .height(px2vp(80)) .backgroundColor(this.selectProcess.operationId && this.MaterialInformation.length > 0 ? $r('app.color.blue_100') : $r('app.color.blue_20')) .onClick(() => { if (this.selectProcess.operationId) { if (this.MaterialInformation.length > 0) { // 把中间的数据push到左边的数组,如果xx一样就数量相加 this.toCompleteSuitFun() } } else { promptAction.showToast({ message: '请先选择工单和工序!', duration: 1700, bottom: 150 }); } }) } .width(px2vp(608)) .height(px2vp(520)) .borderRadius($r('app.float.borderRadius_16')) } .width(px2vp(608)) .height(px2vp(900)) .borderRadius($r('app.float.borderRadius_16')) } .width(px2vp(1920)) .height(px2vp(900)) .padding({ left: px2vp(24), right: px2vp(24) }) } } // 选择工序 @CustomDialog struct SelectProcessDialog { @Link selectProcess: ProcessData @Link processes: ProcessData[] @Link orderMaterialSwitch: number controller?: CustomDialogController cancel: () => void = () => { } confirm: () => void = () => { } build() { Column() { Row() { Text('选择工序') .fontSize($r('app.float.fontSize_38')) .fontWeight(FontWeight.Medium) .fontColor($r('app.color.general_font_color')) .opacity($r('app.float.general_font_opacity')) } .height('15%') .alignItems(VerticalAlign.Center) List({ space: px2vp(20), initialIndex: 0 }) { ForEach(this.processes, (item: ProcessData) => { ListItem() { Row() { Text(item.operationName) .fontSize($r('app.float.fontSize_24')) .fontWeight(FontWeight.Medium) .fontColor(JSON.stringify(this.selectProcess) != '{}' && item.operationId === this.selectProcess?.operationId ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color')) .textAlign(TextAlign.Center) .width('71%') .height('12.5%') .borderRadius($r('app.float.general_border_radius')) .onClick(() => { this.selectProcess = item this.orderMaterialSwitch = 2 this.confirm() this.controller?.close() }) if (item.state === 2) { Image($r('app.media.collect_completed')) .width(px2vp(80)) .height(px2vp(80)) .borderRadius($r('app.float.general_border_radius')) } Text() { } .width(px2vp(80)) .height(px2vp(80)) .borderRadius($r('app.float.general_border_radius')) } .borderRadius($r('app.float.general_border_radius')) .backgroundColor(JSON.stringify(this.selectProcess) != '{}' && item.operationId === this.selectProcess?.operationId ? $r('app.color.robot_set_card_blue') : $r('app.color.robot_set_card_white')) } }) } .listDirection(Axis.Vertical) // 排列方向 // .edgeEffect(EdgeEffect.Spring) // 滑动到边缘无效果 .height('80%') .width('100%') .alignListItem(ListItemAlign.Center) } .width('48%') .height('74%') .backgroundColor($r('app.color.page_general_background')) .justifyContent(FlexAlign.SpaceEvenly) .borderRadius($r('app.float.general_border_radius')) } } // 物料位置(物料在哪些料箱里面) @CustomDialog struct MaterialLocationDialog { @Link materialName: string @Link boxMaterials: MaterialInformationModel[] Controller: CustomDialogController scroller: Scroller = new Scroller() 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.boxMaterials, (item: MaterialInformationModel, index: number) => { GridItem() { Row() { Column() { Text(item.materialName) .fontSize($r('app.float.fontSize_24')) .fontWeight(FontWeight.Regular) .fontColor($r('app.color.black_60')) .height('20%') .width('100%') Text(item.materialCode) .fontSize($r('app.float.fontSize_24')) .fontWeight(FontWeight.Regular) .fontColor($r('app.color.black_60')) .height('20%') .width('100%') Text(item.spec) .fontSize($r('app.float.fontSize_24')) .fontWeight(FontWeight.Regular) .fontColor($r('app.color.black_60')) .height('20%') .width('100%') Text(item.batchNo) .fontSize($r('app.float.fontSize_24')) .fontWeight(FontWeight.Regular) .fontColor($r('app.color.black_60')) .height('20%') .width('100%') Row() { Text(item.num?.toString()) .fontSize($r('app.float.fontSize_38')) .fontWeight(FontWeight.Bold) .fontColor($r('app.color.black_90')) Text(item.unit ?? item.unitDictLabel) .fontSize($r('app.float.fontSize_24')) .fontWeight(FontWeight.Regular) .fontColor($r('app.color.black_60')) } .margin({ top: 5 }) } .width('100%') .padding(10) .borderRadius(10) .alignItems(HorizontalAlign.Start) .justifyContent(FlexAlign.Center) .height('100%') } .padding(5) .borderRadius(10) .height('25%') .width('100%') .backgroundColor(Color.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 struct EmptyBoxDialog { @Link callBoxNum: number @Link isTakeOutBox: number controller?: CustomDialogController cancel: () => void = () => { } confirm: () => void = () => { } build() { Column({ space: 10 }) { Text('取空箱数量') .textAlign(TextAlign.Center) .width('80%') .height('30%') .fontWeight(FontWeight.Regular) .fontSize($r('app.float.fontSize_24')) .fontColor($r('app.color.black_90')) Row() { Image($r('app.media.subtract_disabled')) .width(px2vp(120)) .height(px2vp(120)) .border({ width: 0.8 }) .borderRadius({ topLeft: px2vp(16), bottomLeft: px2vp(16) }) .onClick(() => { if (this.callBoxNum <= 1) { return } this.callBoxNum-- }) TextInput({ text: this.callBoxNum.toString() }) .fontSize($r('app.float.title_font_size')) .fontWeight(FontWeight.Bold) .fontColor($r('app.color.general_font_color')) .height(px2vp(120))// .opacity($r('app.float.general_font_opacity')) //.height('40%') .width('50%') .type(InputType.Number) .textAlign(TextAlign.Center) .borderRadius(0) .backgroundColor($r('app.color.general_card_background_color')) .border({ width: 0.8 }) .onChange((value: string) => { if (!value || value.length === 0) { this.callBoxNum = 0 return } let num: number = Number.parseInt(value) if (num < 1) { this.callBoxNum = 1 } }) Image($r('app.media.add_disabled')) .width(px2vp(120)) .height(px2vp(120)) .border({ width: 0.8 }) .borderRadius({ topRight: px2vp(16), bottomRight: px2vp(16) }) .onClick(() => { this.callBoxNum++ }) } .width('60%') .height('40%') .justifyContent(FlexAlign.Center) Row() { Button('取消') .fontSize($r('app.float.fontSize_24')) .fontColor($r('app.color.blue_100')) .width('50%') .height('100%') .backgroundColor($r('app.color.black_6')) .onClick(() => { this.isTakeOutBox = 2 this.callBoxNum = 1 this.controller?.close() }) Button('确认') .fontSize($r('app.float.fontSize_24')) .fontColor($r('app.color.general_font_white_color')) .width('50%') .height('100%') .backgroundColor($r('app.color.blue_100')) .onClick(() => { this.isTakeOutBox = 1 this.controller?.close() }) } .width('60%') .height('15%') }.width('60%') .height('50%') .borderRadius($r('app.float.borderRadius_16')) .backgroundColor($r('app.color.process_divider_white_color')) } } // 扫描齐套料箱弹窗 @CustomDialog struct scanningMaterialBox { @Link binCode: string @Link boxInfo: BoxInfo @Link clickScan: number @Link selectOrder: number @Link vehicleCode: string @Link orderArray: OrderInfo[] async materialBoxHTTP(vehicleCode: string) { return await StorageRequest.post('/api/v1/process/vehicleOperation/vehicleDetail', { workOrderCode: this.orderArray[this.selectOrder]?.workOrderCode!, vehicleCode: vehicleCode, } as RequestParamModel) as BoxInfo } @Link materialCode: string //扫码控制器 textController: TextInputController = new TextInputController() controller: CustomDialogController build() { Column() { Text('扫描料箱') .fontSize($r('app.float.fontSize_38')) .fontWeight(FontWeight.Medium) .width('100%') .height('40%') .textAlign(TextAlign.Center) Blank() Row() { Image($r('app.media.shaoma')) .width('60px') .height('60px') TextInput({ text: this.materialCode, placeholder: '点击扫码添加编码', controller: this.textController }) .width('92%') .height('100%') .width('80%') .fontWeight(FontWeight.Medium) .fontSize('32px') .backgroundColor("#ffff") .borderRadius(21) .onSubmit(() => { this.binCode = this.materialCode this.clickScan = 1 this.controller.close() //this.boxInfo = await this.materialBoxHTTP(this.binCode) }) Image($r('app.media.search')) .width('60px') .height('60px') .onClick(async () => { this.controller.close() this.clickScan = 1 this.boxInfo = await this.materialBoxHTTP(this.binCode) }) } .width('60%') .height('30%') .border({ width: 0.4 }) .borderRadius(px2vp(100)) .alignItems(VerticalAlign.Center) .backgroundColor($r('app.color.process_divider_white_color')) Blank() } .width('50%') .height('40%') .padding(10) .alignItems(HorizontalAlign.Center) .borderRadius($r('app.float.borderRadius_16')) .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 struct MaterialDetailOneDialog { @Link material: Materialpositionclass scroller: Scroller = new Scroller() controller: CustomDialogController // 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后 build() { Column() { Row() { Text('物料详情') .textAlign(TextAlign.Center) .width('100%') .height('20%') .fontSize($r('app.float.fontSize_24')) } .height('25%') Column({ space: 20 }) { Column({ space: 10 }) { Text(this.material?.materialName && this.material?.materialName.length > 0 ? this.material.materialName! : '') .fontSize($r('app.float.fontSize_20')) .fontColor($r('app.color.general_font_white_color')) .opacity($r('app.float.card_font_default_opacity')) .width('100%') Text('100*200') .fontSize($r('app.float.robot_state_font_size')) .textAlign(TextAlign.Start) .fontColor('#99000000') .width('100%') Text('批次号:' + '1223341232123124121') .fontSize($r('app.float.robot_state_font_size')) .textAlign(TextAlign.Start) .fontColor('#99000000') .width('100%') Text('计划编号:' + '1231231231233') .fontSize($r('app.float.robot_state_font_size')) .textAlign(TextAlign.Start) .fontColor('#99000000') .width('100%') Text('订单编号:' + '1231231231233') .fontSize($r('app.float.robot_state_font_size')) .textAlign(TextAlign.Start) .fontColor('#99000000') .width('100%') Text('出库单号:' + '1231231231233') .fontSize($r('app.float.robot_state_font_size')) .textAlign(TextAlign.Start) .fontColor('#99000000') .width('100%') }.width('40%') .height('30%') Divider().vertical(false) .width('60%') Column() { Text('录入数量') .fontSize($r('app.float.robot_state_font_size')) .textAlign(TextAlign.Start) .fontColor('#99000000') .width('40%') Counter() { } .width('417px') .height('107px') .onInc(() => { }) .onDec(() => { }) } } .width('50%') .height('100%') .backgroundColor('#F1F3F5') .borderRadius(20) Row() { }.width('25%') .height('100%') .onClick(() => { this.controller.close() }) } .width('48%') .height('74%') .backgroundColor($r('app.color.white_f1f3f5')) .height('100%') .justifyContent(FlexAlign.Center) } } // 物料详情弹窗(批次号) @CustomDialog struct MaterialDetailTwoDialog { @Link value: number @Link CunQuHuo: number scroller: Scroller = new Scroller() @State navigation: number = 0 @Link textValue: string @Link inputValue: string controller: CustomDialogController // 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后 build() { Column() { Column() { } .width('100%') .height('20%') .onClick(() => { this.controller.close() }) Row() { Row() { } .width('25%') .height('100%') .onClick(() => { this.controller.close() }) Column({ space: 20 }) { Text('物料详情') .textAlign(TextAlign.Center) .width('100%') .height('20%') .fontSize('51px') Column({ space: 10 }) { Text('PCBA-ASSSD电路板') .fontSize('32px') .width('100%') Text('100*200') .fontSize($r('app.float.robot_state_font_size')) .textAlign(TextAlign.Start) .fontColor('#99000000') .width('100%') Text('批次号:' + '1223341232123124121') .fontSize($r('app.float.robot_state_font_size')) .textAlign(TextAlign.Start) .fontColor('#99000000') .width('100%') Text('计划编号:' + '1231231231233') .fontSize($r('app.float.robot_state_font_size')) .textAlign(TextAlign.Start) .fontColor('#99000000') .width('100%') Text('订单编号:' + '1231231231233') .fontSize($r('app.float.robot_state_font_size')) .textAlign(TextAlign.Start) .fontColor('#99000000') .width('100%') Text('出库单号:' + '1231231231233') .fontSize($r('app.float.robot_state_font_size')) .textAlign(TextAlign.Start) .fontColor('#99000000') .width('100%') }.width('40%') .height('30%') Divider().vertical(false) .width('60%') Column() { Text('录入数量') .fontSize($r('app.float.robot_state_font_size')) .textAlign(TextAlign.Start) .fontColor('#99000000') .width('40%') Counter() { Text(this.value.toString()) } .width('417px') .height('107px') .onInc(() => { this.value++ }) .onDec(() => { this.value-- }) } }.width('50%') .height('100%') .backgroundColor('#F1F3F5') .borderRadius(20) Row() { }.width('25%') .height('100%') .onClick(() => { this.controller.close() }) }.width('100%') .height('60%') Column() { }.width('100%') .height('20%') .onClick(() => { this.controller.close() }) }.width('100%') .backgroundColor('#4d000000') .height('100%') .justifyContent(FlexAlign.Center) // dialog默认的borderRadius为24vp,如果需要使用border属性,请和borderRadius属性一起使用。 } } function getMaterialPositionStr(locationNo: string): string { if (!locationNo || locationNo.length <= 0 || locationNo.split('-').length != 3) { return '' } let resultStr: string = 'X:' let strArray: string[] = locationNo.split('-') resultStr += strArray[0] resultStr += ' Y:' + strArray[1] resultStr += ' ' + strArray[2] + '层' return resultStr } class BoxInfo { // 是否可绑定0-否 1-是 isEnable?: number // 物料信息 list?: MaterialInfo[] // 料箱id vehicleId?: string // 料箱名称 vehicleName?: string // 料箱编号 vehicleNo?: string } export interface boxMaterialClass { //料箱等级 vehicleLevel?: string materialCode?: string //载具编号 vehicleCode?: string //产品规格 spec?: string //批次号 batchCode?: string; ///完成数量 completedNum?: number //已经占用箱数 useNum?: number //空箱数 emptyBoxNum?: string //可用箱数 canUsedNum?: string //总容量箱数 allNum?: number //仓储类型 type?: string //储位坐标 coordinate?: string //储位位置 position?: string //创建时间 created?: string // creator?: string //仓库编码 houseNo?: string deptId?: string houseType?: string //主键 id?: string locationNo?: string // 物料名称 materialName?: string //物料编码 materialNo?: string //出入库数量 num?: number orgId?: string planNo?: string // 序列号 seqNo?: string // 状态;1-待处理;2-处理中;3-处理异常;4-已完成 state?: number // 库存数量 stockNum?: string //出入库任务单号 taskNo?: string unit?: string updated?: string //任务名称 taskName?: string updator?: string vehicleNo?: string pageNo?: number pageSize?: number } export interface outBoxClass { orderId?: string orderType?: string } export interface outboundClass { cmdId?: string code?: string msg?: string } export class controlClass { houseNo?: string orderId?: string type?: number vehicleNo?: string }