123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772 |
- import ProcessData from '../../model/ProcessData';
- import StorageRequest from '../util/request/StorageRequest';
- import {SelectMaterialslist} from '../util/request/StorageRequestInstance'
- import detailsList from '../../model/DetailsList';
- /////物料位置
- ////出库取料箱出库
- export interface Tasklist {
- //批次号
- batchCode?: string;
- ///完成数量
- completedNum?:number
- //已经占用箱数
- useNum?:number
- //空箱数
- emptyBoxNum?:string
- //可用箱数
- canUsedNum?:string
- //总容量箱数
- allNum?:number
- //仓储类型
- type?:string
- //批次号
- coordinate?: string
- //创建时间
- created?: string
- //
- creator?: string
- //仓库编码
- houseNo?:string
- deptId?: string
- houseType?:string
- //主键
- id?:string
- locationNo?: string
- // 物料名称
- materialName?:string
- //物料编码
- materialNo?: string
- //出入库数量
- num?: number
- orgId?: string
- relPlanNo?:string
- relOrderNo?:string
- relOutOrderNo?:string
- progress?:string
- planNo?: string
- position?: string
- // 序列号
- seqNo?: string
- // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
- state?:number
- // 库存数量
- stockNum?:string
- //出入库任务单号
- taskNo?: string
- unit?:string
- updated?: string
- //任务名称
- taskName?:string
- updator?: string
- vehicleNo?: string
- }
- export interface Materialpositionclass {
- //产品规格
- spec?:string
- //批次号
- batchCode?: string;
- ///完成数量
- completedNum?:number
- //已经占用箱数
- useNum?:number
- //空箱数
- emptyBoxNum?:string
- //可用箱数
- canUsedNum?:string
- //总容量箱数
- allNum?:number
- //仓储类型
- type?:string
- //批次号
- coordinate?: string
- //创建时间
- created?: string
- //
- creator?: string
- //仓库编码
- houseNo?:string
- deptId?: string
- houseType?:string
- //主键
- id?:string
- locationNo?: string
- // 物料名称
- materialName?:string
- //物料编码
- materialNo?: string
- //出入库数量
- num?: number
- orgId?: string
- planNo?: string
- position?: string
- // 序列号
- seqNo?: string
- // 状态;1-待处理;2-处理中;3-处理异常;4-已完成
- state?:number
- // 库存数量
- stockNum?:string
- //出入库任务单号
- taskNo?: string
- unit?:string
- updated?: string
- //任务名称
- taskName?:string
- updator?: string
- vehicleNo?: string
- pageNo?:number
- pageSize?:number
- }
- export interface outboundDataclass {
- detailsList?:detailsList[]
- taskId?:number
- index?:number
- //产品规格
- spec?:string
- // 物料名称
- materialName?:string
- //物料编码
- materialNo?: string
- // 序列号
- seqNo?: string
- //储位坐标
- coordinate?:string
- //仓库编号
- houseNo?:string
- //储位编号
- locationNo?:string
- //单位
- unit?:string
- //数量
- num?:number
- //批次号
- batchCode?:string
- }
- export interface outboundRequestData {
- index?:number
- //产品规格
- spec?:string
- // 物料名称
- materialName?:string
- //物料编码
- materialNo?: string
- // 序列号
- seqNo?: string
- //储位坐标
- coordinate?:string
- //仓库编号
- houseNo?:string
- //储位编号
- locationNo?:string
- //单位
- unit?:string
- //数量
- num?:number
- //批次号
- batchCode?:string
- //载具编号
- vehicleCode?:string
- position?:string
- housetype?:string
- }
- @CustomDialog
- struct positionok {
- // outboundData = async() : Promise<outboundDataclass[]> => {
- // let obj:outboundDataclass[] = []
- // let res = await StorageRequest.post("/api/v3/wmsOrder/outBox", {
- // detailsList:this.outboundRequest,
- // taskId:'1'
- // })
- // console.log('testTag', '********' + JSON.stringify(res))
- // obj = JSON.parse(JSON.stringify(res))
- // return obj
- // }
- //传进来
- // aboutToAppear(){
- // for (let index = 0; index < this.Mposition.length; index++) {
- // let details: outboundRequestData = {}
- // details.materialName = this.Mposition[index].materialName
- // details.num=this.Mposition[index].num
- // details.materialNo=this.Mposition[index].materialNo
- // details.spec=this.Mposition[index].spec
- // details.batchCode=this.Mposition[index].batchCode
- // details.housetype='1'
- // details.locationNo='1-3-2'
- // details.houseNo='1'
- // details.coordinate= '3-2'
- // details.unit='个'
- // details.vehicleCode='XL'+new Date().getTime()
- // details.position='1'
- // this.Mposition.push(details)
- // }
- // }
- @State private outboundRequest:Array<outboundRequestData>=[]
- @Link private Mposition:Array< Materialpositionclass>
- @Link code:string
- @Link textValue: string
- @Link inputValue: string
- controller: CustomDialogController
- // 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后
- cancel: () => void
- confirm: () => void
- build(){
- Column(){
- Column({space:10}){
- Text('取出确认')
- .width('100%')
- .fontSize('51px')
- .textAlign(TextAlign.Center)
- Row(){
- Text('是否取出'+this.code+'?')
- .width('100%')
- .fontSize('32px')
- }.width('80%')
- .height('60%')
- Row({space:5}){
- Text('取消')
- .fontWeight(FontWeight.Medium)
- .fontSize('32px')
- .width('48%')
- .textAlign(TextAlign.Center)
- .height('100%')
- .fontColor('#0A59F7')
- .backgroundColor('#F1F3F5')
- .borderRadius(21)
- .onClick(()=>{
- this.controller.close()
- })
- Text('确认')
- .fontWeight(FontWeight.Medium)
- .fontSize('32px')
- .borderRadius(21)
- .textAlign(TextAlign.Center)
- .height('100%')
- .width('48%')
- .fontColor('#0A59F7')
- .backgroundColor('#F1F3F5')
- .onClick(()=>{
- // this. outboundData ().then((res : outboundRequestData[]) => {
- // console.log('testTag', '入库数据成功'+JSON.stringify(res))
- // if (res && res.length > 0) {
- // //
- // for (let index = 0; index < res.length; index++) {
- // console.log('testTag', '-----------index' + index +'-----vehicleNo'+JSON.stringify(res))
- // console.log('testTag', '-----------index' + index +'-----list'+JSON.stringify(res))
- // }
- // this. outboundRequest = res
- // }
- // })
- // console.log("4632957"+JSON.stringify(this.outboundRequest))
- // this.controller.close()
- })
- }
- .justifyContent(FlexAlign.Center)
- .borderRadius(15)
- .width('80%')
- .height('20%')
- }.width('100%')
- .padding(10)
- .height('100%')
- .borderRadius(15)
- .backgroundColor('#FFFF')
- }.width("50%")
- .height("40%")
- .backgroundColor('#4d000000')
- }
- }
- @CustomDialog
- struct ChuKUA {
- @State private Mposition:Array<Materialpositionclass>=[]
- @State private SelectMaterial:Array<SelectMaterialslist>=[]
- @State material:string=''
- @State taskNo:string=''
- ////确认弹窗
- @State code:string=''
- dialogController: CustomDialogController = new CustomDialogController({
- builder: positionok({
- Mposition:this.Mposition,
- code:this.code,
- textValue: $textValue,
- inputValue: $inputValue
- }),
- autoCancel: true,
- alignment: DialogAlignment.Center,
- customStyle: true
- })
- Tasklistoutbound = async() : Promise<Tasklist[]> => {
- let obj: Tasklist[] = []
- let res = await StorageRequest.post("/api/v3/task/list", {
- type: 2
- })
- console.log('testTag', 'Tasklist成功' + JSON.stringify(res))
- obj = JSON.parse(JSON.stringify(res))
- console.log('testTag', 'aaaaaaaa' +JSON.stringify(obj));
- return obj
- }
- SelectMaterials = async() : Promise<SelectMaterialslist[]> => {
- let res = await StorageRequest.post("/api/v3/task/page", {
- pageNo: 1,
- taskNo:this.taskNo
- })
- console.log('testTag', '********' + JSON.stringify(res))
- let obj = JSON.parse(JSON.stringify(res))
- console.log('testTag', 'aaaaaaaa' +JSON.stringify(obj.records));
- this.SelectMaterial=obj
- return obj.records
- }
- ///位置请求
- Materialposition = async() : Promise< Materialpositionclass[]> => {
- let obj: Materialpositionclass[] = []
- let res = await StorageRequest.post("/api/v3/stock/list", {
- "materialName":this.material
- // "materialName":"物料名称001"
- })
- console.log('testTag', '111111成功' + JSON.stringify(res))
- obj = JSON.parse(JSON.stringify(res))
- console.log('testTag', 'aaaaaaaa' +JSON.stringify(obj));
- this.Mposition=obj
- return obj
- }
- aboutToAppear(){
- this.Tasklistoutbound().then((res : Tasklist[]) => {
- console.log('testTag', 'result cccccc'+JSON.stringify(res))
- if (res && res.length > 0) {
- this.TasklistoutboundData = res
- this.taskNo=this.TasklistoutboundData[0].taskNo
- this.SelectMaterials().then((res : SelectMaterialslist[]) => {
- console.log('testTag', 'result cccccc'+JSON.stringify(res))
- if (res && res.length > 0) {
- this.SelectMaterial = res
- this.material= this.SelectMaterial[0].materialName
- this.Materialposition().then((res :Materialpositionclass[]) => {
- console.log('testTag', 'result cccccc'+JSON.stringify(res))
- if (res && res.length > 0) {
- this.Mposition = res
- }
- })
- }
- })
- }
- })
- }
- @State private TasklistoutboundData:Array<Tasklist>=[]
- @Link CunQuHuo:number
- scroller: Scroller = new Scroller()
- @State SelectableMarker:number=0
- @State SelectableMarkerOne:number=0
- @State SelectableMarkertwo:number=0
- @Link textValue: string
- @Link inputValue: string
- controller: CustomDialogController
- // 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后
- cancel: () => void
- confirm: () => void
- build() {
- Column() {
- Column(){
- Text('取物料')
- .fontWeight(FontWeight.Medium)
- .textAlign(TextAlign.Center)
- .fontColor('#ffff')
- .fontSize('51px')
- }.width('100%')
- .justifyContent(FlexAlign.Center)
- .height('10%')
- .padding(10)
- Row(){
- Text('出库')
- .fontSize('40px')
- .width('30%')
- .padding(10)
- .fontColor('#ffff')
- Text('选择物料')
- .fontSize('40px')
- .width('30%')
- .padding(10)
- .fontColor('#ffff')
- Text('取出位置')
- .fontSize('40px')
- .width('30%')
- .padding(10)
- .fontColor('#ffff')
- }.width('100%')
- .height('5%')
- .padding({left:10})
- Row({space:20}){
- Column(){
- Grid(this.scroller) {
- ForEach(this.TasklistoutboundData, (item:Tasklist ,index:number) => {
- // ForEach(this.Number, (day: string) => {
- GridItem() {
- Row(){
- Column(){
- Text(item.taskName)
- .fontSize('32px')
- .width('100%')
- .height('20%')
- Row(){
- Column({space:10}){
- Text('产品型号:'+item.taskNo)
- .fontSize($r('app.float.robot_state_font_size'))
- .textAlign(TextAlign.Start)
- .fontColor('#99000000')
- .width('100%')
- Text('计划编号:'+item.relPlanNo)
- .fontSize($r('app.float.robot_state_font_size'))
- .textAlign(TextAlign.Start)
- .fontColor('#99000000')
- .width('100%')
- Text('订单编号:'+item.relOrderNo)
- .fontSize($r('app.float.robot_state_font_size'))
- .textAlign(TextAlign.Start)
- .fontColor('#99000000')
- .width('100%')
- Text('出库单号:'+item.relOutOrderNo)
- .fontSize($r('app.float.robot_state_font_size'))
- .textAlign(TextAlign.Start)
- .fontColor('#99000000')
- .width('100%')
- Text('取料进度:'+item.progress)
- .fontSize($r('app.float.robot_state_font_size'))
- .textAlign(TextAlign.Start)
- .fontColor('#99000000')
- .width('100%')
- }
- .justifyContent(FlexAlign.Center)
- .width('100%')
- .height('100%')
- } .width('100%')
- .height('80%')
- }.width('100%')
- .padding({left:20,right:20})
- .borderRadius(10)
- .alignItems(HorizontalAlign.Start)
- .justifyContent(FlexAlign.Center)
- .height('100%')
- .onClick(()=>{
- this.taskNo=item.taskNo
- })
- }
- .padding(10)
- .borderRadius(10)
- .height('30%')
- .backgroundColor(this.SelectableMarker===index?
- $r('app.color.robot_set_card_blue'):$r('app.color.robot_set_card_white'))
- }
- .onClick(()=>{
- this.SelectableMarker=index
- })
- })
- }
- .onClick(()=>{
- this.CunQuHuo=1
- })
- .padding(10)
- .columnsTemplate('1fr')
- .columnsGap(10)
- .rowsGap(10)
- .onScrollIndex((first: number) => {
- console.info(first.toString())
- })
- .width('100%')
- .height('100%')
- }.width('25%')
- .height('100%')
- Divider().vertical(true)
- .color('#ffff')
- .width('1%')
- .height('100%')
- ////选择物料
- Column(){
- Grid(this.scroller) {
- ForEach(this.SelectMaterial, (item:SelectMaterialslist,index:number) => {
- // ForEach(this.Number, (day: string) => {
- GridItem() {
- Row(){
- Column(){
- Blank()
- Text(item.materialName)
- .fontSize('32px')
- .fontWeight(FontWeight.Medium)
- Text(item.materialNo)
- .fontSize('27px')
- Blank()
- Text(item.completedNum.toString()+'/'+item.num.toString())
- .fontWeight(FontWeight.Bold)
- . fontSize('32px')
- .fontColor('#e6000000')
- Text(item.state===0||1?"待处理":item.state===2?"处理中":item.state===3?"处理异常":"已完成")
- .fontSize('32px')
- Blank()
- }.width('100%')
- .padding(10)
- .borderRadius(10)
- .alignItems(HorizontalAlign.Start)
- .justifyContent(FlexAlign.Center)
- .height('100%')
- }
- .padding(10)
- .borderRadius(10)
- .height('30%')
- .backgroundColor(this.SelectableMarkerOne===index?
- $r('app.color.robot_set_card_blue'):$r('app.color.robot_set_card_white'))
- }
- .onClick(()=>{
- this.material= item.materialName
- console.log('好了111111'+item.materialName)
- // this.Materialposition()
- this.SelectableMarkerOne=index
- })
- })
- }
- .onClick(()=>{
- this.CunQuHuo=1
- })
- .padding(10)
- .columnsTemplate('1fr')
- .columnsGap(10)
- .rowsGap(10)
- .onScrollIndex((first: number) => {
- console.info(first.toString())
- })
- .width('100%')
- .height('100%')
- }.width('25%')
- .height('100%')
- Divider().vertical(true)
- .color('#ffff')
- .width('1%')
- .height('100%')
- //物料位置
- Column(){
- Grid(this.scroller) {
- ForEach(this.Mposition, (item:Materialpositionclass,index:number) => {
- GridItem() {
- Row(){
- Column(){
- Text(item.locationNo)
- .fontSize('32px')
- .fontWeight(FontWeight.Medium)
- Text(item.batchCode)
- .fontSize('32px')
- .fontWeight(FontWeight.Medium)
- Blank()
- Row(){
- Text(item.num.toString())
- .fontSize('51px')
- .fontWeight(FontWeight.Bold)
- Text('个')
- .fontSize('32px')
- .fontWeight(FontWeight.Medium)
- }
- }.width('100%')
- .padding(10)
- .borderRadius(10)
- .alignItems(HorizontalAlign.Start)
- .justifyContent(FlexAlign.Center)
- .height('100%')
- }
- .padding(10)
- .borderRadius(10)
- .height('30%')
- .backgroundColor(this.SelectableMarkertwo===index?
- $r('app.color.robot_set_card_blue'):$r('app.color.robot_set_card_white'))
- .onClick(()=>{
- this.dialogController.open()
- this.SelectableMarkertwo=index
- this.code= item.batchCode
- })
- }
- .padding({left:20})
- })
- }
- .onClick(()=>{
- this.CunQuHuo=1
- })
- .padding(10)
- .columnsTemplate('1fr 1fr')
- .columnsGap(10)
- .rowsGap(10)
- .onScrollIndex((first: number) => {
- console.info(first.toString())
- })
- .width('100%')
- .height('100%')
- }.width('37%')
- .height('100%')
- }.width('100%')
- .height('75%')
- .padding(10)
- Row(){
- Image($r('app.media.close'))
- .width('115px')
- .height('115px')
- .onClick(()=>{
- this.controller.close()
- })
- }.width('100%')
- .justifyContent(FlexAlign.Center)
- .height('10%')
- }.width('100%')
- .backgroundColor('#99000000')
- .height('100%')
- // dialog默认的borderRadius为24vp,如果需要使用border属性,请和borderRadius属性一起使用。
- }
- }
- @CustomDialog
- @Entry
- @Component
- export struct Workbin{
- @State textValue: string = ''
- @State inputValue: string = ''
- scroller: Scroller = new Scroller()
- onCancel() {
- console.info('onCancel')
- }
- onAccept() {
- console.info(' onAccept')
- }
- existApp() {
- console.info(' existApp')
- }
- @State ZhuangTai:number=0
- @State CunQuHuo:number=0
- MaterialRetrievalController: CustomDialogController = new CustomDialogController({
- builder: ChuKUA({
- CunQuHuo:this.CunQuHuo,
- cancel: this.onCancel,
- confirm: this.onAccept,
- textValue: $textValue,
- inputValue: $inputValue,
- }),
- // gridCount: 3,
- cancel: this.existApp,
- //autoCancel: true,
- alignment: DialogAlignment.Bottom,
- //offset: { dx: 0, dy: -20 },
- gridCount: 4,
- customStyle: true,
- })
- build(){
- Row({space:15}){
- Row(){
- Column(){
- Text('取物料')
- .fontSize('32px')
- .fontWeight(FontWeight.Medium)
- Text('查找物料')
- .fontSize('27px')
- }.width('90%')
- .borderRadius(15)
- .backgroundColor('#ffff')
- .alignItems(HorizontalAlign.Start)
- .justifyContent(FlexAlign.Center)
- .height('100%')
- .onClick(()=>{
- this. MaterialRetrievalController.open()
- })
- Column(){
- Image($r('app.media.jiaobiao'))
- .width('27px')
- .height('27px')
- }.width('10%')
- .justifyContent(FlexAlign.End)
- .height('100%')
- .backgroundColor('#ffff')
- }
- .backgroundColor('#ffff')
- .padding(10)
- .width('45%')
- .borderRadius(15)
- .height('100%')
- Row(){
- Column(){
- Text('返回料箱')
- .fontSize('32px')
- .fontWeight(FontWeight.Medium)
- Text('LX1524742389')
- .fontSize('27px')
- }.width('90%')
- .borderRadius(15)
- .backgroundColor('#ffff')
- .alignItems(HorizontalAlign.Start)
- .justifyContent(FlexAlign.Center)
- .height('100%')
- Column(){
- Image($r('app.media.jiaobiao'))
- .width('27px')
- .height('27px')
- }.width('10%')
- .justifyContent(FlexAlign.End)
- .height('100%')
- }
- .padding(10)
- // .onClick(()=>{
- // this.bufferhopperController.open()
- // })
- .backgroundColor('#ffff')
- .width('45%')
- .borderRadius(15)
- .height('100%')
- }.width('100%')
- .padding({left:10})
- .height('100%')
- }
- }
|