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