123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737 |
- 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<MaterialInformationModel> = []
- //查询物料存放的所有位置
- @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 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 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
- // 清空回库下面的数组逻辑
- 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) => {
- this.scanCodeValue = "BM51264341413217;SL9;PHthi5558;"
- 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 = 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/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>
- }
- //查询库存信息
- 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 ?? 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.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)
- // 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.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%')
- .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 ?? "个")
- .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(() => {
- // 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
- }
|