|
@@ -0,0 +1,184 @@
|
|
|
+import StorageRequest from '../util/request/StorageRequest';
|
|
|
+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
|
|
|
+
|
|
|
+}
|
|
|
+@Entry
|
|
|
+@Component
|
|
|
+export struct OutboundTask{
|
|
|
+ @State SelectableMarker:number=0
|
|
|
+ scroller: Scroller = new Scroller()
|
|
|
+ @State taskNo:string=''
|
|
|
+ @State private TasklistoutboundData:Array<Tasklist>=[]
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+build(){
|
|
|
+ Column(){
|
|
|
+ Grid(this.scroller) {
|
|
|
+ ForEach(this.TasklistoutboundData, (item:Tasklist ,index:number) => {
|
|
|
+ GridItem() {
|
|
|
+ Row(){
|
|
|
+ Column(){
|
|
|
+ Text(item.taskName)
|
|
|
+ .fontSize('32px')
|
|
|
+ .width('100%')
|
|
|
+ .height('20%')
|
|
|
+ Row(){
|
|
|
+ Column(){
|
|
|
+ Text('产品型号:'+item.taskNo)
|
|
|
+ .fontSize($r('app.float.robot_state_font_size'))
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
+ .fontColor('#99000000')
|
|
|
+ .width('100%')
|
|
|
+ .height('20%')
|
|
|
+ Text('计划编号:'+item.relPlanNo)
|
|
|
+ .fontSize($r('app.float.robot_state_font_size'))
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
+ .fontColor('#99000000')
|
|
|
+ .width('100%')
|
|
|
+ .height('20%')
|
|
|
+ Text('订单编号:'+item.relOrderNo)
|
|
|
+ .fontSize($r('app.float.robot_state_font_size'))
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
+ .fontColor('#99000000')
|
|
|
+ .width('100%')
|
|
|
+ .height('20%')
|
|
|
+ Text('出库单号:'+item.relOutOrderNo)
|
|
|
+ .fontSize($r('app.float.robot_state_font_size'))
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
+ .fontColor('#99000000')
|
|
|
+ .width('100%')
|
|
|
+ .height('20%')
|
|
|
+ Row(){
|
|
|
+ Text('取料进度:'+item.progress)
|
|
|
+ .fontSize($r('app.float.robot_state_font_size'))
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
+ .fontColor('#99000000')
|
|
|
+ .width('50%')
|
|
|
+ .height('100%')
|
|
|
+ Text(item.updated)
|
|
|
+ .fontSize($r('app.float.robot_state_font_size'))
|
|
|
+ .textAlign(TextAlign.End)
|
|
|
+ .fontColor('#99000000')
|
|
|
+ .width('50%')
|
|
|
+ .height('100%')
|
|
|
+ }.width('100%')
|
|
|
+ .height('20%')
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ .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.SelectableMarker=index
|
|
|
+ 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
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .padding(10)
|
|
|
+ .columnsTemplate('1fr')
|
|
|
+ .columnsGap(10)
|
|
|
+ .rowsGap(10)
|
|
|
+ .onScrollIndex((first: number) => {
|
|
|
+ console.info(first.toString())
|
|
|
+ })
|
|
|
+ .width('100%')
|
|
|
+ .height('100%')
|
|
|
+ }.width('100%')
|
|
|
+ .height('100%')
|
|
|
+}
|
|
|
+}
|