123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968 |
- import EquipmentRequest from '../common/util/request/EquipmentRequest'
- import StorageRequest from '../common/util/request/StorageRequest'
- import { MaterialInformationModel } from '../model/MaterialInformation'
- import RequestParamModel from '../viewmodel/RequestParamModel'
- import { Materialpositionclass, ScanStorageclass } from './IntelligentWarehousingOutbound'
- import CommonConstants from '../common/constants/CommonConstants'
- import promptAction from '@ohos.promptAction'
- import { EmptyBoxInfoModel, StationInfoModel } from '../model/StorageSpace'
- import { outBoxClass } from './CompleteSet'
- export interface stat2 {
- statNo?: string
- //料箱编号
- rfid?: string
- //料箱检测的io位,1:有,0:没有
- io?: string
- //0:无锁定,1:锁定,即机器人正在动作,不能进出库动作
- lock?: string
- ts?: string
- RFID?: string
- UID?: string
- kg?: number
- }
- @Entry
- @Component
- export struct ManualWarehousing {
- //料箱等级(类型)
- @State vehicleLevel: string = ''
- // 叫空料箱数量
- @State callBoxNum: number = 1
- //取空箱子
- @State emptyBox: number = 0
- //更改的数量
- @State exchangeNumber: number = 0
- //料箱中的物料信息
- @State private boxMaterials: Array<MaterialInformationModel> = []
- //定义物料信息
- @State private MaterialInformation: Array<MaterialInformationModel> = []
- ///料箱状态
- @State materialBox: number = 0
- // 中间输入框绑定的值
- @State scanCodeValue: string = ""
- @State materialNo: string = ''
- //1:抽屉在料格内 0:抽屉在料格外
- @State drawerPositionStatus: number = 1
- //入库口料格状态(1:有料箱 0:无料箱)
- @State materialGridStatus: number = 0
- //选中取出的物料位置
- @State materialPosition: Materialpositionclass = {}
- //需要展示和更改的物料信息
- @State index: number = 0
- @State batchCode: string = ''
- @State materialName: string = ''
- //齐套料箱状态不可以点击:0,可以点击:1
- @State completeSetMaterialState: number = 0
- @State num: number = 0
- //点击颜色
- @State onclick: number = -1
- @State seqNo: string = ''
- //物料编码
- @State materialCode: string = ''
- @State spec: string = ''
- //扫码控制器
- textController: TextInputController = new TextInputController()
- //齐套料箱重量
- @State BoxWeight: number = 20
- @State private recentlyRecordObject: StationInfoModel = {}
- currentTimer: number = -1;
- //扫码请求
- ScanStorageCode = async (itemCode: string) => {
- 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))
- // 扫码完成之后,如果数组中有对应的值,就添加数量否则就push
- let toPushArray: MaterialInformationModel[] = [...this.MaterialInformation]
- let has = false
- for (let i = 0; i < toPushArray.length; i++) {
- let box = toPushArray[i]
- if (obj.materialCode == box.materialCode) {
- let number = obj.num! + box.num!
- box.num = number
- has = true
- }
- }
- if (!has) {
- toPushArray.push(JSON.parse(JSON.stringify(obj)))
- }
- this.MaterialInformation = [...toPushArray]
- }
- //RFID卡读取失败弹窗
- RfidCarController: CustomDialogController = new CustomDialogController({
- builder: RfidCar({}),
- alignment: DialogAlignment.Center,
- gridCount: 4,
- customStyle: true,
- })
- //物料详情弹窗
- materialDetailsController: CustomDialogController = new CustomDialogController({
- builder: materialDetails({
- exchangeNumber: this.exchangeNumber,
- MaterialInformation: this.MaterialInformation,
- index: this.index,
- batchCode: this.batchCode,
- materialName: this.materialName,
- num: this.num,
- seqNo: this.seqNo,
- spec: this.spec,
- materialNo: this.materialNo
- }),
- alignment: DialogAlignment.Bottom,
- gridCount: 4,
- customStyle: true,
- })
- locationRequest = async (): Promise<StationInfoModel> => {
- let res: StationInfoModel = await StorageRequest.post("api/v1/wms/common/queryStationInfo", {
- stanCode: CommonConstants.STATION_CODE
- } as RequestParamModel)
- this.recentlyRecordObject = res
- this.materialGridStatus = 0
- if (this.recentlyRecordObject && this.recentlyRecordObject.rfid) {
- this.materialGridStatus = 1
- this.BoxWeight = Number(this.recentlyRecordObject.weight)
- this.recentlyRecordObject.weight = this.recentlyRecordObject.weight + 'Kg'
- }
- // 有数据 {"code":200,"message":"ok","data":{"RFID":"2024080613602207","UID":"992fa202530104e0","errCode":"0","ts":"1722568500"}}
- // 无数据 {"code":200,"message":"ok","data":{"RFID":"","UID":"0000000000000000","errCode":"0","ts":"1722568502"}}
- return this.recentlyRecordObject
- }
- //后端入库操作
- Warehousing = async (): Promise<MaterialInformationModel[]> => {
- let res: MaterialInformationModel[] = await StorageRequest.post("/api/v1/wmsOrder/inBox", {
- houseNo: '1',
- stanCode: CommonConstants.STATION_CODE,
- vehicleCode: this.recentlyRecordObject.rfid,
- detailsList: this.boxMaterials
- } as RequestParamModel)
- console.log('testTag', 'aaaaaaaa1' + JSON.stringify(res));
- promptAction.showToast({
- message: '请求成功,业务处理中。。。',
- duration: 2000,
- bottom: 150
- });
- this.boxMaterials = []
- return res
- }
- //硬件请求入库操作
- warehousingHttp = async (): Promise<MaterialInformationModel> => {
- let res: MaterialInformationModel = await StorageRequest.post("/api/v1/wcs/stockin", {
- boxNo: this.recentlyRecordObject.rfid,
- position: CommonConstants.STATION_CODE,
- mtype: this.vehicleLevel
- } as RequestParamModel)
- console.log('testTag1', '----------' + JSON.stringify(res));
- return res
- }
- //查询取出料箱里面的物料信息
- boxMaterialHttp = async (): Promise<MaterialInformationModel[]> => {
- let res: MaterialInformationModel[] = await StorageRequest.post("/api/v1/stock/list", {
- //读取RFId的料箱编码,要根据硬件读到的改
- vehicleCode: this.materialNo
- } as RequestParamModel)
- console.log('testTag', 'aaaaaaaa2' + JSON.stringify(res));
- this.MaterialInformation = res
- return res
- }
- callEmptyBoxFun = async () => {
- this.emptyBox = 1 //表明正在取的进度
- let res: EmptyBoxInfoModel = await StorageRequest.post("/api/v1/stock/queryEmptyBox")
- console.log("QQQ", JSON.stringify(res), res?.vehicleNo)
- let outRes: outBoxClass = await StorageRequest.post("/api/v1/wmsOrder/outBox", {
- stanCode: CommonConstants.STATION_CODE,
- vehicleNo: res!.vehicleNo,
- houseNo: res!.houseNo
- } as RequestParamModel)
- promptAction.showToast({
- message: "箱子正在运行中....",
- duration: 1800,
- bottom: '50%'
- })
- console.log("QQQ", JSON.stringify(outRes), outRes?.orderId)
- }
- // 获取二楼绑定料箱信息
- getUpstairsData = async () => {
- // 如果没有rfid就不调用
- if (!this.recentlyRecordObject.rfid) {
- return
- }
- let res: MaterialInformationModel = await StorageRequest.get(`/web/wcs/bindInfo/${this.recentlyRecordObject.rfid}` as MaterialInformationModel)
- // TODO
- // let obj: MaterialInformationModel = JSON.parse(JSON.stringify(res))
- //将返回的数据解析后,如果数组不为空 就赋值到下面的数组里面
- // this.MaterialInformation = []
- }
- // 清空的按钮调用这个方法
- clearData = () => {
- this.MaterialInformation = []
- }
- //打开页面0.5s请求一次硬件,当io(有无料箱)和weight(重量)发送变化时执行改变数据,同时通过RFID请求读取料箱里面物料信息
- async aboutToAppear() {
- this.currentTimer = setInterval(async () => {
- this.locationRequest()
- }, 1000);
- }
- aboutToDisappear(): void {
- clearInterval(this.currentTimer)
- }
- //删除操作
- @Builder
- itemEnd(index: number) {
- Row() {
- Button("删除").margin("4vp")
- .onClick(() => {
- this.MaterialInformation.splice(index, 1)
- })
- }.padding("4vp").justifyContent(FlexAlign.SpaceEvenly)
- }
- build() {
- Row() {
- Column() {
- Row() {
- 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))
- // RFID的信息
- 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'))
- .focusable(true)
- .defaultFocus(true)
- // Text(this.BoxWeight.toString() + 'Kg')
- 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))
- // 扫码之后在左边rfid下面的列表
- Column() {
- List() {
- ForEach(this.boxMaterials, (item: MaterialInformationModel, index: number) => {
- ListItem() {
- Row() {
- Column() {
- Column() {
- Row().height('23%')
- 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.spec)
- .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)
- .lineHeight(25)
- .margin({ left: 2 })
- }
- .width('90%')
- .margin({ top: 5 })
- 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(10)
- .height('30%')
- .onClick(() => {
- })
- .margin({ top: 3 })
- .backgroundColor(this.onclick === index ? $r('app.color.robot_set_card_blue') : $r('app.color.robot_set_card_white'))
- }
- })
- }
- .width(px2vp(608))
- .height(px2vp(540))
- .margin({ bottom: px2vp(20), top: px2vp(20) })
- }
- .width(px2vp(608))
- .height(px2vp(450))
- .borderRadius($r('app.float.borderRadius_16'))
- }
- .width(px2vp(608))
- .height(px2vp(800))
- .borderRadius($r('app.float.borderRadius_16'))
- // ================= 中间一列扫码
- Column() {
- // Blank()
- Row() {
- Image($r('app.media.shaoma'))
- .width(px2vp(32))
- .height(px2vp(32))
- Row() {
- TextInput({ text: this.scanCodeValue,
- placeholder: '请点击扫码或者输入物料编码',
- controller: this.textController })
- .width('92%')
- .placeholderFont({ size: $r('app.float.fontSize_24') })
- .height('100%')
- .defaultFocus(false)
- .fontWeight(FontWeight.Medium)
- .fontSize($r('app.float.fontSize_24'))
- .backgroundColor("#ffff")
- .borderRadius(21)
- .defaultFocus(false)
- .onSubmit(() => {
- this.materialBox = 1
- this.ScanStorageCode(this.scanCodeValue)
- })
- .onChange((value: string) => {
- this.scanCodeValue = value
- })
- }.width('80%')
- .padding({ left: 10 })
- Image($r('app.media.search'))
- .width(px2vp(32))
- .height(px2vp(32))
- .onClick(async () => {
- this.materialBox = 1
- this.ScanStorageCode(this.scanCodeValue)
- })
- }
- .border({ width: 0.1 })
- .borderRadius(40)
- .width(px2vp(608))
- .height(px2vp(80))
- .backgroundColor('#fff')
- .justifyContent(FlexAlign.Center)
- Column() {
- List() {
- ForEach(this.MaterialInformation, (item: MaterialInformationModel, index: number) => {
- // ForEach(this.exchange,(exchangeItem:exchangeClass,exchangeIndex:number)=>{
- ListItem() {
- Row() {
- Column() {
- Text(item.materialName)
- .fontWeight(FontWeight.Medium)// Text(item.materialCode)
- .fontSize($r('app.float.fontSize_24'))
- Text(item.spec)
- .fontColor("#666666")
- .fontWeight(FontWeight.Regular)
- .fontSize($r('app.float.fontSize_20'))
- Text(item.type)
- .fontColor("#666666")
- .fontWeight(FontWeight.Regular)
- .fontSize($r('app.float.fontSize_20'))
- Row() {
- Text(item.num?.toString())
- .fontWeight(FontWeight.Bold)
- .fontSize($r('app.float.fontSize_38'))
- Text(item.unitDictLabel)
- .fontColor("#666666")
- .fontWeight(FontWeight.Medium)
- .fontSize($r('app.float.fontSize_24'))
- }
- }
- .width('70%')
- .padding({ left: px2vp(30) })
- .borderRadius(10)
- .alignItems(HorizontalAlign.Start)
- .justifyContent(FlexAlign.Center)
- .height('100%')
- .backgroundColor('#fff')
- if (item.exchangeNumber !== undefined) {
- Row() {
- Image((item.exchangeNumber!) >= 0 ? $r('app.media.plus') : $r('app.media.reduce'))
- .width(px2vp(30))
- .height((item.exchangeNumber!) >= 0 ? px2vp(30) : px2vp(8))
- Text((item.exchangeNumber!) >= 0 ? item.exchangeNumber?.toString() : (-(item.exchangeNumber!))?.toString())// .backgroundColor(item.exchangeNumber>0?$r('app.color.green_100'):item?.exchangeNumber===0?'':$r('app.color.brown_100'))
- .fontSize($r('app.float.fontSize_38'))
- .fontWeight(FontWeight.Bold)
- .fontColor((item.exchangeNumber!) >= 0 ? $r('app.color.green_100') : $r('app.color.brown_100'))
- }.width('20%')
- .justifyContent(FlexAlign.Center)
- .alignItems(VerticalAlign.Center)
- .height('100%')
- } else {
- Column() {
- }.width('20%')
- .justifyContent(FlexAlign.Center)
- .alignItems(HorizontalAlign.Center)
- .height('100%')
- }
- Column() {
- Image($r('app.media.subscript_space'))
- .width($r('app.float.storage_set_image_effect_height'))
- .height($r('app.float.storage_set_image_effect_height'))
- }.width('10%')
- .justifyContent(FlexAlign.End)
- .alignItems(HorizontalAlign.End)
- .height('100%')
- }
- .width(px2vp(608))
- .height(px2vp(210))
- .borderRadius($r('app.float.borderRadius_16'))
- .backgroundColor('#fff')
- .onClick(() => {
- // this.exchangeIndex=exchangeIndex!
- this.index = index
- this.batchCode = item.batchCode!
- this.materialName = item.materialName!
- this.materialNo = item.materialCode!
- this.num = item.num!
- this.seqNo = item.seqNo!
- this.spec = item.spec!
- //if (item.exchangeNumber===null){
- // this.MaterialInformation[index].exchangeNumber=0
- // if (this.exchangeNumber!==0) {
- // this.MaterialInformation[index]= {
- // taskId: this.MaterialInformation[index].taskId,
- // materialName: this.MaterialInformation[index].materialName,
- // exchangeNumber:0,
- // num:this.MaterialInformation[index].num,
- // materialNo: this.MaterialInformation[index].materialNo,
- // batchCode: this.MaterialInformation[index].batchCode,
- // seqNo: this.MaterialInformation[index].seqNo,
- // spec: this.MaterialInformation[index].spec,
- // }
- // }
- // }else if (item.exchangeNumber!==0){
- // item.exchangeNumber=0
- // }
- // this.exchangeNumber=item.exchangeNumber!
- // this.scanStorageList[index]= {
- // taskId: item.taskId!,
- // materialName: item.materialName!,
- // num: item.num!,
- // exchangeNumber:this.exchangeNumber!,
- // materialNo: item.materialNo!,
- // batchCode: item.batchCode!,
- // seqNo: item.seqNo!,
- // spec: item.spec!,
- // }
- this.materialDetailsController.open()
- })
- }
- .swipeAction({ end: this.itemEnd(index) })
- .margin({ right: px2vp(12), top: px2vp(10) })
- // })
- })
- }
- // .lanes(2)
- .onScrollIndex((first: number) => {
- console.info(first.toString())
- })
- .width('100%')
- .height('100%')
- }.width(px2vp(610))
- .height(px2vp(640))
- .margin({ right: px2vp(24), bottom: px2vp(8), top: px2vp(8) })
- }.width(px2vp(610))
- .height(px2vp(800))
- .alignItems(HorizontalAlign.Start)
- .margin({ left: $r('app.float.Margins_24') })
- }.width(px2vp(1260))
- .height(px2vp(800))
- Column() {
- if (this.MaterialInformation.length === 0) {
- Button('绑定料箱')
- .fontSize($r('app.float.fontSize_24'))
- .fontColor($r('app.color.general_font_white_color'))
- .width(px2vp(608))
- .height(px2vp(80))
- .backgroundColor($r('app.color.blue_20'))
- } else {
- Button('绑定料箱')
- .fontSize($r('app.float.fontSize_24'))
- .fontColor($r('app.color.general_font_white_color'))
- .width(px2vp(608))
- .height(px2vp(80))
- .backgroundColor($r('app.color.blue_100'))
- .onClick(() => {
- // 把中间的数据push到左边的数组,如果xx一样就数量相加
- 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 = []
- })
- }
- }.width(px2vp(1260))
- .height(px2vp(100))
- .justifyContent(FlexAlign.Center)
- }.width(px2vp(1260))
- .height(px2vp(900))
- Column() {
- Stack() {
- Image(this.drawerPositionStatus === 1 && this.materialGridStatus === 0 ? $r('app.media.drawer_inside') : (this.drawerPositionStatus === 2 && this.materialGridStatus === 0 ? $r('app.media.drawer_outside') :
- (this.drawerPositionStatus === 1 && this.materialGridStatus === 1 ? $r('app.media.D_W_inside') : $r('app.media.D_W_outside'))))
- .width(px2vp(608))
- .height('100%')
- .borderRadius($r('app.float.borderRadius_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('100%')
- .height('100%')
- .padding({ right: $r('app.float.borderRadius_16') })
- .alignItems(HorizontalAlign.End)
- .borderRadius($r('app.float.borderRadius_16'))
- }.width(px2vp(608))
- .height('30%')
- .borderRadius($r('app.float.borderRadius_16'))
- Button(this.materialGridStatus === 1 ? '入库' : '取空箱')
- .fontSize($r('app.float.fontSize_24'))
- .fontColor($r('app.color.general_font_white_color'))
- .width('100%')
- .height('10%')
- .margin({ top: $r('app.float.topMargins_20') })
- .backgroundColor(this.drawerPositionStatus === 1 && this.materialGridStatus === 1 ? $r('app.color.green_100') : (this.drawerPositionStatus === 2 && this.materialGridStatus === 1 ? $r('app.color.Green_20') :
- (this.drawerPositionStatus === 1 && this.materialGridStatus === 0 ? $r('app.color.blue_100') : $r('app.color.blue_20'))))
- .onClick(() => {
- if (this.materialGridStatus === 0) {
- this.callEmptyBoxFun()
- }
- if (this.materialGridStatus === 1) {
- this.Warehousing()
- }
- })
- // if (this.emptyBox === 1) {
- //
- // Column() {
- // Text('正在取空箱,当前进度1/' + this.callBoxNum + '...')
- // .textAlign(TextAlign.Center)
- // .borderRadius(px2vp(16))
- // .width('100%')
- // .height('25%')
- // .fontWeight(FontWeight.Bold)
- // .fontSize($r('app.float.fontSize_24'))
- // .fontColor($r('app.color.black_90'))
- // Text(this.materialGridStatus === 1 ? '请取出料箱' : this.drawerPositionStatus === 2 && this.materialGridStatus === 0 ? '请将料格推入' : '')
- // .textAlign(TextAlign.Center)
- // .borderRadius(px2vp(16))
- // .width('100%')
- // .height('25%')
- // .fontWeight(FontWeight.Bold)
- // .fontSize($r('app.float.fontSize_24'))
- // .fontColor($r('app.color.black_90'))
- //
- // }
- // .width('100%')
- // .height('60%')
- // .justifyContent(FlexAlign.Center)
- //
- // }
- }.width(px2vp(608))
- .height('100%')
- .focusable(true)
- .defaultFocus(false)
- }
- .width('100%')
- .height('92%')
- .padding({
- left: px2vp(24),
- right: px2vp(24),
- top: $r('app.float.fontSize_20'),
- bottom: $r('app.float.fontSize_20')
- })
- .focusable(true)
- .defaultFocus(false)
- }
- }
- @CustomDialog
- ///无批次号物料详情弹窗
- struct materialDetails {
- @Link exchangeNumber: number
- @Link index: number
- @Link batchCode: string
- @Link materialName: string
- @Link num: number
- @Link seqNo: string
- @Link spec: string
- @Link materialNo: string
- @Link private MaterialInformation: Array<MaterialInformationModel>
- scroller: Scroller = new Scroller()
- @State navigation: number = 0
- controller: CustomDialogController
- // 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后
- build() {
- Column() {
- Column() {
- }.width('100%')
- .height('20%')
- .onClick(() => {
- this.exchangeNumber = 0
- this.controller.close()
- })
- Row() {
- Row() {
- }.width('25%')
- .height('100%')
- .onClick(() => {
- this.exchangeNumber = 0
- this.controller.close()
- })
- Column({ space: 20 }) {
- Text('物料详情')
- .textAlign(TextAlign.Center)
- .width('100%')
- .height('20%')
- .fontSize('51px')
- .focusable(true)
- .defaultFocus(true)
- Column({ space: 10 }) {
- Text(this.materialName)
- .fontSize('32px')
- .width('100%')
- Text('物料编码:' + this.materialNo)
- .fontSize($r('app.float.robot_state_font_size'))
- .textAlign(TextAlign.Start)
- .fontColor('#99000000')
- .width('100%')
- Text('规格描述' + this.spec)
- .fontSize($r('app.float.robot_state_font_size'))
- .textAlign(TextAlign.Start)
- .fontColor('#99000000')
- .width('100%')
- Text('批次号:' + this.batchCode)
- .fontSize($r('app.float.robot_state_font_size'))
- .textAlign(TextAlign.Start)
- .fontColor('#99000000')
- .width('100%')
- .textOverflow({ overflow: TextOverflow.Ellipsis })
- }.width('80%')
- .height('30%')
- Divider().vertical(false)
- .width('60%')
- Column() {
- // Text('录入数量')
- // .fontSize($r('app.float.robot_state_font_size'))
- // .textAlign(TextAlign.Start)
- // .fontColor('#99000000')
- // .width('40%')
- 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(() => {
- this.num--
- this.exchangeNumber--
- this.MaterialInformation[this.index] = {
- taskId: this.MaterialInformation[this.index].taskId,
- materialName: this.MaterialInformation[this.index].materialName,
- // exchangeNumber:this.MaterialInformation[this.index].exchangeNumber,
- exchangeNumber: this.exchangeNumber,
- num: this.num,
- materialCode: this.MaterialInformation[this.index].materialCode,
- batchCode: this.MaterialInformation[this.index].batchCode,
- seqNo: this.MaterialInformation[this.index].seqNo,
- spec: this.MaterialInformation[this.index].spec,
- }
- })
- TextInput({ text: this.num?.toString() })
- .fontSize($r('app.float.title_font_size'))
- .fontWeight(FontWeight.Bold)
- .fontColor($r('app.color.general_font_color'))// .opacity($r('app.float.general_font_opacity'))
- .height('85%')
- .width('60%')
- .type(InputType.Number)
- .textAlign(TextAlign.Center)
- .backgroundColor($r('app.color.general_card_background_color'))
- .borderRadius(0)
- .border({ width: 0.8 })
- .onChange(() => {
- this.MaterialInformation[this.index] = {
- taskId: this.MaterialInformation[this.index].taskId!,
- materialName: this.MaterialInformation[this.index].materialName!,
- // exchangeNumber:this.MaterialInformation[this.index].exchangeNumber!,
- exchangeNumber: this.exchangeNumber,
- num: this.num,
- materialCode: this.MaterialInformation[this.index].materialCode!,
- batchCode: this.MaterialInformation[this.index].batchCode!,
- seqNo: this.MaterialInformation[this.index].seqNo!,
- spec: this.MaterialInformation[this.index].spec!,
- }
- })
- 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.exchangeNumber++
- this.num++
- this.MaterialInformation[this.index] = {
- taskId: this.MaterialInformation[this.index].taskId,
- materialName: this.MaterialInformation[this.index].materialName,
- //exchangeNumber:this.MaterialInformation[this.index].exchangeNumber,
- exchangeNumber: this.exchangeNumber,
- num: this.num,
- materialCode: this.MaterialInformation[this.index].materialCode,
- batchCode: this.MaterialInformation[this.index].batchCode,
- seqNo: this.MaterialInformation[this.index].seqNo,
- spec: this.MaterialInformation[this.index].spec,
- }
- // this.exchange[this.exchangeIndex]={
- // exchangeNumber:this.exchange[this.exchangeIndex].exchangeNumber
- // }
- })
- }
- .width('60%')
- .height('20%')
- }
- }.width('50%')
- .height('100%')
- .backgroundColor('#F1F3F5')
- .borderRadius(20)
- Row() {
- }.width('25%')
- .height('100%')
- .onClick(() => {
- this.exchangeNumber = 0
- 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)
- .focusable(true)
- .defaultFocus(false)
- // dialog默认的borderRadius为24vp,如果需要使用border属性,请和borderRadius属性一起使用。
- }
- }
- //RFID读取失败弹窗
- @CustomDialog
- struct RfidCar {
- controller: CustomDialogController
- build() {
- Column() {
- Text('RFID读取失败')
- .fontWeight(FontWeight.Medium)
- .fontSize($r('app.float.fontSize_50'))
- Blank()
- Text('请检查RFID读卡器或料箱底部识别卡片是否正常!')
- .fontWeight(FontWeight.Medium)
- .fontSize($r('app.float.fontSize_38'))
- Blank()
- Button('取消', { type: ButtonType.Normal, stateEffect: true })
- .width(px2vp(252))
- .height(px2vp(70))
- .borderRadius(px2vp(75))
- .fontSize($r('app.float.fontSize_20'))
- .onClick(() => {
- this.controller.close()
- })
- }
- .width(px2vp(924))
- .height(px2vp(536))
- .padding({ top: px2vp(60), bottom: px2vp(60) })
- .borderRadius($r('app.float.borderRadius_16'))
- .backgroundColor($r('app.color.white_100'))
- }
- }
- // 自定义键盘
- @Builder
- function CustomKeyboardBuilderEmpty() {
- Column() {
- }
- .width(0)
- .height(0)
- }
|