12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028 |
- import EquipmentRequest from '../common/util/request/EquipmentRequest'
- import StorageRequest from '../common/util/request/StorageRequest'
- import { Materialpositionclass, StorageStatusList, testPost } from '../common/util/request/StorageRequestInstance'
- import { boxMaterialClass, outboundClass, outBoxClass, stat3 } from './CompleteSet'
- import RequestParamModel from '../viewmodel/RequestParamModel'
- import promptAction from '@ohos.promptAction'
- import CommonConstants from '../common/constants/CommonConstants'
- import { stat2 } from './ManualWarehousing'
- import { MaterialInformationModel } from '../model/MaterialInformation'
- import { StationInfoModel } from '../model/StorageSpace'
- import { SureToDoDialog } from '../common/component/SureToDoDialog'
- @Entry
- @Component
- export struct ManualOutbound {
- //取出料箱
- @State @Watch('outBoxChanged') private outBox: outBoxClass = {}
- @State private outboundMaterials: Array<MaterialInformationModel> = []
- //物料位置
- @State private Materialposition: Array<Materialpositionclass> = []
- //物料信息表
- @State private materialList: Array<MaterialInformationModel> = []
- // 料箱位置的查看详情数据
- @State private positionInfoList: Array<MaterialInformationModel> = []
- //物料编码
- @State materialCode: string = ''
- //料箱编号
- @State vehicleNo: string = ''
- // 左侧扫描的值
- @State scanCodeValue: string = ""
- //1:抽屉在料格内 2:抽屉在料格外
- @State drawerPositionStatus: number = 1
- //出库口料格状态(1:有料箱 0:无料箱)
- @State materialGridStatus: number = 0
- //点击颜色
- @State onclick: number = -1
- @State materialName: string = ''
- scroller: Scroller = new Scroller()
- //料箱等级(类型)
- @State vehicleLevel: string = ''
- //料箱编码
- @State materiaNo: string = ''
- //取料箱中物料信息
- @State private boxMaterials: Array<MaterialInformationModel> = []
- // 打开物料位置弹窗之后的操作
- currentBoxStationModel: Materialpositionclass = {}
- goingToLookDetail = async (m: Materialpositionclass) => {
- this.currentBoxStationModel = m
- this.positionInfoList = m?.materials ?? []
- this.infoListController.open()
- }
- goingToOut = (m: Materialpositionclass) => {
- this.currentBoxStationModel = m
- this.infoDialogController.open()
- }
- 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,
- })
- //物料位置
- materialLocationController: CustomDialogController = new CustomDialogController({
- builder: MaterialLocationDialog({
- outBox: this.outBox,
- materialName: this.materialName,
- Materialposition: this.Materialposition,
- boxMaterials: this.boxMaterials,
- lookDetail: this.goingToLookDetail,
- goToOut: this.goingToOut,
- }),
- alignment: DialogAlignment.Center,
- customStyle: true,
- autoCancel: false,
- })
- //请求物料位置
- MaterialpositionHttp = async (item: MaterialInformationModel) => {
- let res: Materialpositionclass[] = await StorageRequest.post("/api/v1/stock/groupList", {
- materialNo: item.materialNo,
- materialCode: item.materialCode,
- } as RequestParamModel)
- this.Materialposition = res
- }
- //回库操作
- Warehousing = async () => {
- let res: boxMaterialClass[] = await StorageRequest.post("/api/v1/wmsOrder/inBox", {
- houseNo: '1',
- vehicleCode: this.recentlyRecordObject.rfid,
- detailsList: this.boxMaterials
- } as RequestParamModel)
- promptAction.showToast({
- message: "正在回库中...",
- bottom: '50%'
- })
- this.boxMaterials = []
- }
- //硬件出库位置
- locationRequest = async () => {
- let res: StationInfoModel = await StorageRequest.post("api/v1/wms/common/queryStationInfo", {
- stanCode: CommonConstants.STATION_CODE
- } as RequestParamModel)
- this.recentlyRecordObject = res
- // 当有料箱之后,根据出库时候的outBox获取物料信息列表。
- this.materialGridStatus = 0
- if (this.recentlyRecordObject && this.recentlyRecordObject.rfid) {
- this.materialGridStatus = 1
- clearInterval(this.currentTimer)
- // 重新获取左侧库存列表
- this.getStoreList()
- let result: Record<string, string | MaterialInformationModel[]> = await StorageRequest.post("/api/v1/wms/order/get", {
- id: this.outBox.orderId ?? ""
- } as RequestParamModel)
- console.log("ppp", JSON.stringify(result))
- // {"coordinate":"6-6","created":"2024-08-12 11:00:13","creator":"JGtest-32","deptId":"1","detailsList":[{"batchCode":"BMBL00000111108;SL3","coordinate":"","created":"2024-08-12 11:00:12","creator":"admin","deleted":0,"deptId":"0","houseNo":"","id":"58","locationNo":"","materialCode":"","materialName":"测试物料8","materialNo":"","num":3,"orderId":"57","orgId":"0","position":null,"seqNo":"","spec":"","unit":"","unitDictLabel":"","unitDictValue":"","updated":"2024-08-12 11:00:12","updator":"sys","vehicleCode":""}],"houseNo":"1","id":"57","locationNo":"1-6-6","orgId":"1","position":4,"state":4,"taskId":"","taskNo":"","type":2,"updated":"2024-08-12 11:00:13","updator":"sys","vehicleCode":"ZJ-JG025","vehicleId":"25","vehicleName":"晶格箱子25"}
- this.boxMaterials = result.detailsList as MaterialInformationModel[]
- // 最右侧也进行赋值 深拷贝
- this.outboundMaterials = JSON.parse(JSON.stringify(this.boxMaterials))
- this.outboundMaterials.forEach((m) => {
- m.useNum = m.num
- })
- }
- }
- //查询取出的料箱里面的物料信息
- boxMaterialHttp = async () => {
- let res: MaterialInformationModel[] = await StorageRequest.post("/api/v1/stock/list", {
- vehicleCode: this.recentlyRecordObject.rfid
- } as RequestParamModel)
- this.boxMaterials = res
- }
- // 点击左侧库存表之后,弹出物料信息,点击出库后,开始轮询获取中间料箱的信息
- currentTimer: number = -1;
- @State private recentlyRecordObject: StationInfoModel = {}
- // 当点击了出库后
- outBoxChanged(): void {
- this.currentTimer = setInterval(async () => {
- this.locationRequest()
- }, 1300);
- }
- aboutToAppear(): void {
- this.getStoreList()
- }
- aboutToDisappear(): void {
- clearInterval(this.currentTimer)
- }
- //硬件请求回库操作
- warehousingHttp = async (): Promise<boxMaterialClass> => {
- 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
- }
- //扫码控制器
- textController: TextInputController = new TextInputController()
- // 获取左侧库存列表信息
- getStoreList = async () => {
- let res: MaterialInformationModel[] = await StorageRequest.post("/api/v1/stock/mergeList", {
- houseType: 1,
- materialNo: this.scanCodeValue,
- } as RequestParamModel)
- this.scanCodeValue = ''
- console.log('qqqq' + '列表' + JSON.stringify(res))
- if (res && res.length > 0) {
- this.materialList = res
- }
- }
- //扫码 从中间的列表里面找对应的数据挪过来,
- @State rightScanValue: string = ""
- getMaterialByCodeFromMiddleList = async (materialCode: string) => {
- // 从中间列表里面筛选数据
- let obj: MaterialInformationModel = {}
- for (let i = 0; i < this.boxMaterials.length; i++) {
- let box = this.boxMaterials[i]
- if (materialCode == box.materialCode) {
- obj = JSON.parse(JSON.stringify(box))
- break
- }
- }
- if (obj && obj.materialCode) {
- // 扫码完成之后,如果数组中有对应的值,就添加数量否则就push
- let toPushArray: MaterialInformationModel[] = [...this.outboundMaterials]
- let has = false
- for (let i = 0; i < toPushArray.length; i++) {
- let box = toPushArray[i]
- if (obj.materialCode == box.materialCode) {
- box.num = obj.num! //以左边的数据为准
- has = true
- }
- }
- if (!has) {
- toPushArray.push(JSON.parse(JSON.stringify(obj)))
- }
- this.outboundMaterials = [...toPushArray]
- }
- this.rightScanValue = ""
- }
- // 点击物料出库
- @State outEnable: boolean = true
- sureToOutFun = () => {
- this.outEnable = false
- let toChangeArray: MaterialInformationModel[] = [...this.boxMaterials]
- this.outboundMaterials.forEach((outM) => {
- // 首先将num的值换成useNum的值,是出库的具体数量,但是后端要求的字段是num
- let max = outM.num ?? 0
- let useNum = outM?.useNum ?? 0
- outM.num = useNum <= max ? useNum : max
- // 中间列表遍历,将同一个数据的num进行运算
- for (let i = 0; i < toChangeArray.length; i++) {
- let box = toChangeArray[i]
- if (outM.materialCode == box.materialCode) {
- let value = box.num! - outM.num!
- box.num = value >= 0 ? value : 0
- continue
- }
- }
- })
- this.boxMaterials = [...toChangeArray]
- this.boxMaterials = this.boxMaterials.filter((m) => {
- return m.num! > 0
- })
- this.outEnable = true
- this.outboundMaterials = []
- }
- tooutCancel = () => {
- this.toOUTController.close()
- }
- toOUTController: CustomDialogController = new CustomDialogController({
- builder: SureToDoDialog(
- {
- cancel: this.dialogCancel,
- confirm: this.sureToOutFun,
- title: "提示",
- info: '确认出库吗?'
- }
- ),
- alignment: DialogAlignment.Center,
- customStyle: true,
- autoCancel: false,
- })
- build() {
- Row({ space: px2vp(24) }) {
- Column() {
- Row() {
- Image($r('app.media.search'))
- .width(px2vp(32))
- .height(px2vp(32))
- .focusable(true)
- .defaultFocus(false)
- .onClick(async () => {
- this.getStoreList()
- })
- TextInput({ text: this.scanCodeValue,
- placeholder: '请扫码物料序号用于筛选',
- controller: this.textController })
- .width('92%')
- .height('100%')
- .defaultFocus(false)
- .width('80%')
- .enableKeyboardOnFocus(false)
- .fontWeight(FontWeight.Medium)
- .fontSize('32px')
- .backgroundColor("#ffff")
- .borderRadius(21)
- .onSubmit(() => {
- this.getStoreList()
- })
- .onChange((value: string) => {
- this.scanCodeValue = value
- })
- }
- .width(px2vp(608))
- .height(px2vp(80))
- .borderRadius(px2vp(100))
- .justifyContent(FlexAlign.Center)
- .alignItems(VerticalAlign.Center)
- .backgroundColor($r('app.color.process_divider_white_color'))
- .margin({ bottom: px2vp(20) })
- Column() {
- Grid(this.scroller) {
- ForEach(this.materialList, (item: MaterialInformationModel, index: number) => {
- GridItem() {
- 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.materialNo ? item.materialNo : '')
- .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.unit)
- .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(px2vp(608))
- .height(px2vp(201))
- .borderRadius(px2vp(16))
- .alignItems(HorizontalAlign.Center)
- .justifyContent(FlexAlign.Center)
- .backgroundColor(this.onclick === index ? $r('app.color.blue_100') : "#ffff")
- .onClick(() => {
- this.materialLocationController.open()
- this.onclick = index
- this.materialName = item.materialName!
- this.MaterialpositionHttp(item)
- })
- }
- })
- }
- .scrollBar(BarState.Off)
- .columnsTemplate('1fr')
- .rowsGap(px2vp(20))
- .width(px2vp(608))
- .height(px2vp(770))
- }.width(px2vp(608))
- .height(px2vp(800))
- }.width(px2vp(608))
- .height(px2vp(900))
- Column({ space: 5 }) {
- 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(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) })
- .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($r('app.color.robot_set_card_white'))
- }
- })
- }
- .width(px2vp(608))
- .height(px2vp(520))
- }
- .width(px2vp(608))
- .height(px2vp(900))
- .borderRadius($r('app.float.borderRadius_16'))
- Column() {
- Row() {
- Image($r('app.media.shaoma'))
- .width(px2vp(32))
- .height(px2vp(32))
- TextInput({ text: this.rightScanValue,
- placeholder: '点击扫码添加物料出库',
- controller: this.textController })
- .width('92%')
- .height('100%')
- .width('80%')
- .fontWeight(FontWeight.Medium)
- .fontSize('32px')
- .backgroundColor("#ffff")
- .borderRadius(21)
- .onSubmit(() => {
- this.getMaterialByCodeFromMiddleList(this.rightScanValue)
- })
- .onChange((value: string) => {
- this.rightScanValue = value
- })
- Image($r('app.media.search'))
- .width(px2vp(32))
- .height(px2vp(32))
- .onClick(async () => {
- this.getMaterialByCodeFromMiddleList(this.rightScanValue)
- })
- }
- .width(px2vp(608))
- .height(px2vp(80))
- .borderRadius(px2vp(100))
- .justifyContent(FlexAlign.Center)
- .alignItems(VerticalAlign.Center)
- .backgroundColor($r('app.color.process_divider_white_color'))
- .margin({ bottom: px2vp(20) })
- List({ space: '2%' }) {
- ForEach(this.outboundMaterials, (item: MaterialInformationModel, index: number) => {
- ListItem() {
- Row() {
- Column() {
- Column() {
- Row().height('23%')
- Text(item.materialName + `总数量:${item.num}`)
- .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)
- .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('出库数量:')
- .fontSize($r('app.float.fontSize_20'))
- .fontColor($r('app.color.process_nameplate_grey_color'))
- .fontWeight(FontWeight.Medium)
- 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('60%')
- .width(150)
- .type(InputType.Number)
- .textAlign(TextAlign.Start)
- .backgroundColor($r('app.color.general_card_background_color'))
- .borderRadius(0)
- .border({ width: 0.4 })
- .onChange((value) => {
- item.useNum = Number(value) <= item.num! ? Number(value) : item.num!
- console.log("iii", JSON.stringify(this.outboundMaterials))
- // 这里先不用响应式处理,调接口的时候直接将num的值换成useNum的值就可以了。
- // this.outboundMaterials[index] = {
- // materialName: item.materialName!,
- // num: Number(value),
- // materialCode: item.materialCode!,
- // batchCode: item.batchCode!,
- // seqNo: item.seqNo!,
- // spec: item.spec!,
- // }
- })
- Text(item.unitDictLabel)
- .fontSize($r('app.float.fontSize_20'))
- .fontColor($r('app.color.process_nameplate_grey_color'))
- .fontWeight(FontWeight.Medium)
- .margin({ left: 5 })
- }
- .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(10)
- .height('30%')
- .backgroundColor($r('app.color.robot_set_card_white'))
- }
- })
- }
- .width(px2vp(608))
- .height(px2vp(670))
- .margin({ bottom: px2vp(20) })
- if (this.outboundMaterials.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 if (this.outboundMaterials.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_100'))
- .enabled(this.outEnable)
- .onClick(() => {
- this.sureToOutFun()
- })
- }
- }.width(px2vp(608))
- .height(px2vp(900))
- }.width(px2vp(1920))
- .height(px2vp(900))
- .padding({ left: px2vp(24), right: px2vp(24) })
- }
- }
- // 物料位置(物料在哪些料箱里面)
- @CustomDialog
- struct MaterialLocationDialog {
- @Link outBox: outBoxClass
- @Link boxMaterials: MaterialInformationModel[]
- @State selectMaterial: number = -1
- @Link Materialposition: Materialpositionclass[]
- scroller: Scroller = new Scroller()
- @Link materialName: string
- @State vehicleNo: string = ''
- @State houseNo: string = ''
- Controller: CustomDialogController
- lookDetail: (m: Materialpositionclass) => void = () => {
- }
- goToOut: (m: Materialpositionclass) => void = () => {
- }
- //后端料箱出库
- RemoveMaterialBox = async () => {
- let res: outBoxClass = await StorageRequest.post("/api/v1/wmsOrder/outBox", {
- houseNo: this.houseNo,
- vehicleNo: this.vehicleNo,
- stanCode: CommonConstants.STATION_CODE
- } as RequestParamModel)
- this.outBox = res
- promptAction.showToast({
- message: "任务进行中,请等待....",
- duration: 1800,
- bottom: '50%'
- })
- this.Controller?.close()
- }
- //硬件出库
- outboundHttp = async (): Promise<outboundClass> => {
- let res: outboundClass = await StorageRequest.post("/api/v1/wcs/stockout", {
- boxNo: this.vehicleNo,
- position: "stat3"
- } as RequestParamModel)
- return res
- }
- 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: Materialpositionclass, 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(this.selectMaterial === index ? $r('app.color.robot_set_card_blue') : $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 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()
- })
- }
- }
- export class outboundMaterialsClass {
- //批次号
- batchCode?: string;
- ///完成数量
- completedNum?: number
- //已经占用箱数
- useNum?: number
- //空箱数
- emptyBoxNum?: string
- //可用箱数
- canUsedNum?: string
- //总容量箱数
- allNum?: number
- //仓储类型
- type?: string
- //批次号
- coordinate?: string
- //创建时间
- created?: string
- //
- creator?: string
- //仓库编码
- houseNo?: string
- deptId?: string
- houseType?: string
- //主键
- id?: string
- locationNo?: string
- // 物料名称
- materialName?: string
- //物料编码
- materialNo?: string
- //出入库数量
- num?: number
- orgId?: string
- relPlanNo?: string
- relOrderNo?: string
- relOutOrderNo?: string
- progress?: string
- planNo?: string
- position?: string
- // 序列号
- seqNo?: string
- // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
- state?: number
- // 库存数量
- stockNum?: string
- //出入库任务单号
- taskNo?: string
- unit?: string
- updated?: string
- //任务名称
- taskName?: string
- updator?: string
- vehicleNo?: string
- materialCode?: string
- spec?: string
- }
|