1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792 |
- 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 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'
- export interface stat3 {
- statNo?: string
- //料箱编号
- rfid?: string
- //料箱检测的io位,1:有,0:没有
- io?: string
- //0:无锁定,1:锁定,即机器人正在动作,不能进出库动作
- lock?: string
- ts?: string
- }
- @Entry
- @Component
- export struct CompleteSet {
- //任务单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<MaterialInformationModel> = []
- //取出料箱
- @State private outBox: Array<outBoxClass> = []
- //物料位置
- @State private Mposition: Array<Materialpositionclass> = []
- //查询物料存放的所有位置
- @State materialPositionArray: Array<Materialpositionclass> = []
- //选中取出的物料位置
- @State materialPosition: Materialpositionclass = {}
- //暂时固定的料箱编码
- //todo
- @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 materialArray: MaterialInfo[] = []
- // 中间输入框绑定的值
- @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<stat3> = []
- //左边任务单列表
- @State private TasklistoutboundData: Array<Tasklist> = []
- //扫码控制器
- textController: TextInputController = new TextInputController()
- // //硬件出库位置
- // locationRequest = async (): Promise<stat3> => {
- // let res: stat3 = await EquipmentRequest.get("api/v1/wcs/stat/stat3")
- // console.log('testTag1' + '-------------' + JSON.stringify(res))
- // return res
- // }
- // 通过RFID请求读取料箱的信息
- rfidTimer: number = -1
- @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("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<MaterialInformationModel> = []
- 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]
- }
- 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/plan/task/station/' + 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<OrderInfo>;
- }
- // 工序物料分页查询
- 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<MaterialInfo>
- }
- //查询库存信息
- async queryStockList(params: RequestParamModel) {
- // todo 删除
- if (params.materialNo != undefined && params?.materialNo.length > 0) {
- params.materialNo = 'BL00000111188'
- }
- // todo 删除
- if (params.vehicleCode != undefined && params?.vehicleCode.length > 0) {
- params.vehicleCode = 'ZJ-JG016'
- }
- console.log('testTag', JSON.stringify(params))
- return await StorageRequest.post('/api/v1/stock/list', params) as Materialpositionclass[]
- }
- //工序弹窗
- selectProcessController: CustomDialogController = new CustomDialogController({
- builder: SelectProcessDialog({
- selectProcess: this.selectProcess,
- processes: this.processes,
- orderMaterialSwitch: this.orderMaterialSwitch,
- confirm: async () => {
- // 查询工序关联的物料信息
- 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
- }
- }
- }),
- alignment: DialogAlignment.Center,
- customStyle: true,
- autoCancel: true,
- })
- //料箱绑定工序操作
- //后端回库入库操作
- 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)
- promptAction.showToast({
- message: '请求成功,业务处理中。。。',
- duration: 2000,
- bottom: 150
- });
- if (!this.recentlyRecordObject.rfid) {
- // 当盒子被小车吊走了才清空
- this.boxMaterials = []
- }
- return res
- }
- /////请求物料位置
- Materialposition = async (): Promise<Materialpositionclass[]> => {
- let res: Materialpositionclass[] = await StorageRequest.post("/api/v1/stock/list", {
- materialName: this.materialName
- } as RequestParamModel)
- console.log('testTag', 'aaaaaaaa1' + JSON.stringify(res));
- this.Mposition = res
- return res
- }
- //物料位置
- materialLocationController: CustomDialogController = new CustomDialogController({
- builder: MaterialLocationDialog({
- orderId: this.orderId,
- materialGridStatus: this.materialGridStatus,
- outBox: this.outBox,
- boxMaterials: this.boxMaterials,
- Mposition: this.Mposition,
- materialName: this.materialName,
- materialPositionArray: this.materialPositionArray,
- materialPosition: this.materialPosition,
- // confirm: async ()=>{
- // if (this.materialPosition?.vehicleCode && JSON.stringify(this.materialPosition) != '{}') {
- // let params: RequestParamModel = new RequestParamModel()
- // params.vehicleCode = this.materialPosition?.vehicleCode!
- // this.boxMaterials = await this.queryStockList(params)
- // console.log('testTag', JSON.stringify(this.boxMaterials))
- // // todo 需要根据硬件返回数据判断当前出库口的状态
- // this.drawerPositionStatus = 1
- // this.materialGridStatus = 1
- // }
- // }
- }),
- 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<MaterialInformationModel[]> => {
- 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<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
- }
- // 点击齐套料箱的时候需要将右侧的数组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('90%')
- .height('20%')
- .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.materialModel)
- .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('90%')
- .height('16%')
- .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('90%')
- .height('16%')
- .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('90%')
- .height('16%')
- .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('90%')
- .height('16%')
- .justifyContent(FlexAlign.Start)
- }
- .justifyContent(FlexAlign.Center)
- // .alignItems(HorizontalAlign.Center)
- .onClick(async () => {
- // 另外选择了工单,则把工序、选择的工序清空
- // if (this.selectOrder && this.selectOrder != index) {
- // this.selectProcess = {}
- // this.processes = []
- // }
- this.currentWorkOrderCode = item.workOrderCode ?? ""
- this.orderId = item.taskId!
- if (item?.workOrderCode && item.workOrderCode.length > 0) {
- this.processes = await StorageRequest.get("/api/v1/plan/task/station/" + item.workOrderCode, {})
- }
- // else {
- // this.selectProcess = {}
- // this.processes = []
- // }
- this.selectProcessController.open()
- this.selectOrder = index
- })
- .width(px2vp(608))
- .height('20%')
- .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<OrderInfo>
- this.orderArray = this.orderArray?.concat(res.records as OrderInfo[])
- })
- }
- .width(px2vp(608))
- .height(px2vp(900))
- .borderRadius($r('app.float.borderRadius_16'))
- } 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: px2vp(20) })
- Column() {
- List({ space: 5 }) {
- 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%')
- .height('20%')
- Text(item.materialCode)
- .fontWeight(FontWeight.Regular)
- .fontSize($r('app.float.fontSize_20'))
- .fontColor($r('app.color.black_60'))
- .width('100%')
- .height('20%')
- Blank()
- Text(item.completeNum?.toString() + '/' + item.totalMaterial?.toString())
- .fontSize($r('app.float.fontSize_24'))
- .fontColor($r('app.color.black_90'))
- .fontWeight(FontWeight.Bold)
- .width('100%')
- .height('20%')
- Text('已拣/总需')
- .fontSize($r('app.float.fontSize_20'))
- .fontColor($r('app.color.black_60'))
- .width('100%')
- .height('20%')
- }
- .width('70%')
- .padding({ left: 20, right: 20 })
- .borderRadius(px2vp(16))
- .alignItems(HorizontalAlign.Start)
- .justifyContent(FlexAlign.Center)
- .height('100%')
- 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%')
- .height('100%')
- .borderRadius(px2vp(16))
- }
- }
- .padding(10)
- .borderRadius(10)
- .margin(px2vp(8))
- .height('25%')
- .width(px2vp(608))
- .onClick(async () => {
- this.materialName = item.materialName!
- this.Materialposition().then((res: Materialpositionclass[]) => {
- console.log('testTag', 'result cccccc' + JSON.stringify(res))
- if (res && res.length > 0) {
- this.Mposition = res
- }
- })
- let params: RequestParamModel = new RequestParamModel()
- params.materialNo = item.materialCode!
- this.materialPositionArray = await this.queryStockList(params)
- this.materialLocationController.open()
- })
- .backgroundColor(this.onclick === index ?
- $r('app.color.robot_set_card_blue') : $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(px2vp(608))
- .height('91%')
- .borderRadius($r('app.float.borderRadius_16'))
- }.width(px2vp(608))
- .height(px2vp(900))
- .borderRadius($r('app.float.borderRadius_16'))
- }
- 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(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%')
- .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)
- })
- }
- .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() {
- 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(10)
- .height('30%')
- .margin({ top: 5 })
- .onClick(() => {
- })
- .backgroundColor(this.onclick === index ? $r('app.color.robot_set_card_blue') : $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 orderId: string
- @Link materialGridStatus: number
- @Link outBox: outBoxClass[]
- @Link boxMaterials: MaterialInformationModel[]
- @State selectMaterial: number = -1
- @Link Mposition: Materialpositionclass[]
- @Link materialPositionArray: Materialpositionclass[]
- @Link materialPosition: Materialpositionclass
- @Link materialName: string
- @State houseNo: string = ''
- @State vehicleNo: string = ''
- @State private controlList: Array<controlClass> = []
- Controller: CustomDialogController
- scroller: Scroller = new Scroller()
- //后端料箱出库
- RemoveMaterialBox = async (): Promise<outBoxClass[]> => {
- let res: outBoxClass[] = await StorageRequest.post("/api/v1/wmsOrder/outBox", {
- houseNo: this.houseNo,
- vehicleNo: this.vehicleNo
- } as RequestParamModel)
- console.log('testTag', 'aaaaaaaa1' + JSON.stringify(res));
- this.outBox = res
- return res
- }
- //后端控制系统料箱出库
- controlHttp = async (): Promise<controlClass[]> => {
- let res: controlClass[] = await StorageRequest.post("/api/v1/wms/common/receiveResult", {
- orderId: this.orderId,
- state: 1
- } as RequestParamModel)
- console.log('testTag', 'aaaaaaaa1' + JSON.stringify(res));
- this.controlList = res
- return res
- }
- //todo 这里删掉,应该是出库位置自动识别rfid读取料箱里面物料信息
- //查询取出的料箱里面的物料信息
- boxMaterialHttp = async (): Promise<MaterialInformationModel[]> => {
- let res: MaterialInformationModel[] = await StorageRequest.post("/api/v1/stock/list", {
- vehicleCode: this.vehicleNo
- } as RequestParamModel)
- console.log('testTag', 'aaaaaaaa2' + JSON.stringify(res));
- this.boxMaterials = res
- return res
- }
- //硬件请求出库操作
- outboundHttp = async (): Promise<outboundClass> => {
- let res: outboundClass = await StorageRequest.post("/api/v1/wcs/stockout", {
- boxNo: this.vehicleNo,
- position: "stat3"
- } as RequestParamModel)
- console.log('testTag1', '----------' + JSON.stringify(res));
- 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.Mposition, (item: Materialpositionclass, index: number) => {
- GridItem() {
- Row() {
- Column() {
- Text(item?.locationNo && item.locationNo.length > 0 ? getMaterialPositionStr(item.locationNo) : '')
- .fontSize($r('app.float.fontSize_24'))
- .fontWeight(FontWeight.Regular)
- .fontColor($r('app.color.black_90'))
- .height('20%')
- .width('100%')
- Text(item.materialName)
- .fontSize($r('app.float.fontSize_24'))
- .fontWeight(FontWeight.Regular)
- .fontColor($r('app.color.black_60'))
- .height('20%')
- .width('100%')
- Blank()
- 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'))
- }
- .height('50%')
- }
- .width('100%')
- .padding(10)
- .borderRadius(10)
- .alignItems(HorizontalAlign.Start)
- .justifyContent(FlexAlign.Center)
- .height('100%')
- }
- .padding(5)
- .borderRadius(10)
- .height('25%')
- .width('100%')
- .backgroundColor(this.selectMaterial === index ? $r('app.color.robot_set_card_blue') : $r('app.color.robot_set_card_white'))
- .onClick(async () => {
- this.houseNo = item.houseNo!
- this.vehicleNo = item.vehicleCode!
- this.selectMaterial = index
- this.materialPosition = item
- console.log("testTag1" + '----------++' + this.vehicleNo)
- //先查询点击的料箱物流信息用于展示在回库下面
- this.boxMaterialHttp().then((res: MaterialInformationModel[]) => {
- console.log('testTag', 'result cccccc22' + JSON.stringify(res))
- if (res && res.length > 0) {
- this.boxMaterials = res
- }
- })
- //执行硬件出库
- this.outboundHttp().then((res: outboundClass) => {
- console.log('testTag1', '-------result cccccc11' + JSON.stringify(res))
- })
- // todo 打开执行出库操作后端
- // this.RemoveMaterialBox().then((res :outBoxClass[]) => {
- // console.log('testTag', 'result cccccc11'+JSON.stringify(res))
- // if (res && res.length > 0) {
- // this.outBox = res
- // }
- // })
- //控制终端
- this.controlHttp().then((res: controlClass[]) => {
- console.log('testTag1', '-------result cccccc11' + JSON.stringify(res))
- })
- this.Controller?.close()
- })
- }
- .padding({ left: 5 })
- })
- }
- .padding(10)
- .columnsTemplate('1fr 1fr 1fr 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(() => {
- // todo 调用硬件
- 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 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
- }
|