|
@@ -1,90 +1,95 @@
|
|
|
import { ScanStorageclass } from './IntelligentWarehousingOutbound'
|
|
|
import { AddAndSubtractComp } from '../common/component/AddAndSubtractComp';
|
|
|
import StorageRequest from '../common/util/request/StorageRequest';
|
|
|
-import { MaterialInformationList } from '../model/MaterialInformation';
|
|
|
+import { MaterialInformationModel } from '../model/MaterialInformation';
|
|
|
import RequestParamModel from '../viewmodel/RequestParamModel';
|
|
|
import EquipmentRequest from '../common/util/request/EquipmentRequest';
|
|
|
import { boxMaterialClass } from './CompleteSet';
|
|
|
|
|
|
-export interface exchangeClass{
|
|
|
- exchangeNumber?:number
|
|
|
+export interface exchangeClass {
|
|
|
+ exchangeNumber?: number
|
|
|
}
|
|
|
-export interface stat1{
|
|
|
- statNo?:string
|
|
|
+
|
|
|
+export interface stat1 {
|
|
|
+ statNo?: string
|
|
|
//料箱编号
|
|
|
rfid?: string
|
|
|
//料箱检测的io位,1:有,0:没有
|
|
|
io?: string
|
|
|
//重量
|
|
|
weight?: string
|
|
|
- ts?:string
|
|
|
+ ts?: string
|
|
|
}
|
|
|
+
|
|
|
@Component
|
|
|
-export struct IntelligentWarehousingGo{
|
|
|
- @Link entranceWaiting:Array<stat1>
|
|
|
+export struct IntelligentWarehousingGo {
|
|
|
+ @Link entranceWaiting: Array<stat1>
|
|
|
//暂时固定的料箱编码
|
|
|
- @Link binCode:string
|
|
|
+ @Link binCode: string
|
|
|
//定义物料信息
|
|
|
- @Link MaterialInformation:Array<MaterialInformationList>
|
|
|
- @State private exchange:Array<exchangeClass>=[]
|
|
|
+ @Link MaterialInformation: Array<MaterialInformationModel>
|
|
|
+ @State private exchange: Array<exchangeClass> = []
|
|
|
//更改数量的list的index
|
|
|
- @State exchangeIndex:number=0
|
|
|
+ @State exchangeIndex: number = 0
|
|
|
//更改的数量
|
|
|
- @State exchangeNumber:number=0
|
|
|
+ @State exchangeNumber: number = 0
|
|
|
//需要展示和更改的物料信息
|
|
|
- @State index:number=0
|
|
|
- @State batchCode:string=''
|
|
|
- @State materialName:string=''
|
|
|
- @State num:number=0
|
|
|
- @State seqNo:string=''
|
|
|
- @State spec:string=''
|
|
|
- @State materialNo:string='2010100002301'
|
|
|
+ @State index: number = 0
|
|
|
+ @State batchCode: string = ''
|
|
|
+ @State materialName: string = ''
|
|
|
+ @State num: number = 0
|
|
|
+ @State seqNo: string = ''
|
|
|
+ @State spec: string = ''
|
|
|
+ @State materialNo: string = '2010100002301'
|
|
|
//有无违禁品
|
|
|
- @Link contraband:number
|
|
|
+ @Link contraband: number
|
|
|
//料箱等级(类型)
|
|
|
- @Link vehicleLevel:string
|
|
|
+ @Link vehicleLevel: string
|
|
|
//自动入库开关
|
|
|
- @Link automaticWarehousing:number
|
|
|
+ @Link automaticWarehousing: number
|
|
|
///料箱状态
|
|
|
- @Link materialBox:number
|
|
|
+ @Link materialBox: number
|
|
|
//料箱id
|
|
|
- @State materialBoxId:string='5817389208-2'
|
|
|
+ @State materialBoxId: string = '5817389208-2'
|
|
|
//任务单id
|
|
|
- @State taskSheetId:string='652704381920-2435'
|
|
|
+ @State taskSheetId: string = '652704381920-2435'
|
|
|
//重量
|
|
|
- @Link weight:number
|
|
|
+ @Link weight: number
|
|
|
//正在存料
|
|
|
- @State storingMaterials:number=0
|
|
|
+ @State storingMaterials: number = 0
|
|
|
//料箱里的物料
|
|
|
- @Link private scanStorageList:Array<ScanStorageclass>
|
|
|
+ @Link private scanStorageList: Array<ScanStorageclass>
|
|
|
//扫码控制器
|
|
|
textcontroller: TextInputController = new TextInputController()
|
|
|
//取料箱中物料信息
|
|
|
@Link private boxMaterials: Array<boxMaterialClass>
|
|
|
+
|
|
|
//删除操作
|
|
|
- @Builder itemEnd(index:number) {
|
|
|
- Row () {
|
|
|
+ @Builder
|
|
|
+ itemEnd(index: number) {
|
|
|
+ Row() {
|
|
|
|
|
|
Button("删除").margin("4vp")
|
|
|
- .onClick(()=>{
|
|
|
- this.MaterialInformation.splice(index,1)
|
|
|
+ .onClick(() => {
|
|
|
+ this.MaterialInformation.splice(index, 1)
|
|
|
})
|
|
|
}.padding("4vp").justifyContent(FlexAlign.SpaceEvenly)
|
|
|
}
|
|
|
+
|
|
|
//物料详情弹窗
|
|
|
materialDetailsController: CustomDialogController = new CustomDialogController({
|
|
|
- builder:materialDetails({
|
|
|
- exchange:this.exchange,
|
|
|
- exchangeIndex:this.exchangeIndex,
|
|
|
- exchangeNumber:this.exchangeNumber,
|
|
|
- MaterialInformation:this.MaterialInformation,
|
|
|
- index:this.index,
|
|
|
- batchCode:this.batchCode,
|
|
|
- materialName:this.materialName,
|
|
|
- num:this.num,
|
|
|
- seqNo:this.seqNo,
|
|
|
- spec:this.spec,
|
|
|
- materialNo:this.materialNo
|
|
|
+ builder: materialDetails({
|
|
|
+ exchange: this.exchange,
|
|
|
+ exchangeIndex: this.exchangeIndex,
|
|
|
+ exchangeNumber: this.exchangeNumber,
|
|
|
+ MaterialInformation: this.MaterialInformation,
|
|
|
+ index: this.index,
|
|
|
+ batchCode: this.batchCode,
|
|
|
+ materialName: this.materialName,
|
|
|
+ num: this.num,
|
|
|
+ seqNo: this.seqNo,
|
|
|
+ spec: this.spec,
|
|
|
+ materialNo: this.materialNo
|
|
|
|
|
|
|
|
|
}),
|
|
@@ -92,15 +97,14 @@ export struct IntelligentWarehousingGo{
|
|
|
gridCount: 4,
|
|
|
customStyle: true,
|
|
|
})
|
|
|
-
|
|
|
//扫码请求
|
|
|
- ScanStorageCode= async(itemCode:string) : Promise<ScanStorageclass> => {
|
|
|
- console.log('9999'+this.materialNo)
|
|
|
+ ScanStorageCode = async (itemCode: string): Promise<ScanStorageclass> => {
|
|
|
+ console.log('9999' + this.materialNo)
|
|
|
let obj: ScanStorageclass
|
|
|
- let res:ScanStorageclass = await StorageRequest.post("/api/v1/process/circulation/material",{
|
|
|
- label:this.materialNo+"#gys022#sc022#100#20220929#31"
|
|
|
- }as ScanStorageclass)
|
|
|
- console.log('testAge1'+'请求参数'+this.materialNo)
|
|
|
+ let res: ScanStorageclass = await StorageRequest.post("/api/v1/process/circulation/material", {
|
|
|
+ label: this.materialNo + "#gys022#sc022#100#20220929#31"
|
|
|
+ } as ScanStorageclass)
|
|
|
+ console.log('testAge1' + '请求参数' + this.materialNo)
|
|
|
//let res = await StorageRequest.get("/api/v3/stock/selectSafeList/1")
|
|
|
console.log('testTag', '扫码成功1!' + JSON.stringify(res))
|
|
|
obj = JSON.parse(JSON.stringify(res))
|
|
@@ -108,23 +112,24 @@ export struct IntelligentWarehousingGo{
|
|
|
console.log('testTag', '扫码成功1!' + obj.batchCode)
|
|
|
return obj
|
|
|
}
|
|
|
+
|
|
|
build() {
|
|
|
- Row(){
|
|
|
- Column(){
|
|
|
- Row(){
|
|
|
- if (this.materialBox===0){
|
|
|
+ Row() {
|
|
|
+ Column() {
|
|
|
+ Row() {
|
|
|
+ if (this.materialBox === 0) {
|
|
|
Image($r('app.media.no_boxes'))
|
|
|
.width('100%')
|
|
|
.height("100%")
|
|
|
- .borderRadius({ topLeft:px2vp(8),topRight:px2vp(8) })
|
|
|
+ .borderRadius({ topLeft: px2vp(8), topRight: px2vp(8) })
|
|
|
|
|
|
- }else if (this.materialBox===1&&this.weight<=15){
|
|
|
+ } else if (this.materialBox === 1 && this.weight <= 15) {
|
|
|
Image($r('app.media.normal_material_box'))
|
|
|
.width('100%')
|
|
|
.height("100%")
|
|
|
.borderRadius(px2vp(16))
|
|
|
|
|
|
- }else if (this.materialBox===1&&this.weight>=15){
|
|
|
+ } else if (this.materialBox === 1 && this.weight >= 15) {
|
|
|
Image($r('app.media.overweight_material_box'))
|
|
|
.width('100%')
|
|
|
.height("100%")
|
|
@@ -134,11 +139,12 @@ export struct IntelligentWarehousingGo{
|
|
|
}.width('100%')
|
|
|
.height('40%')
|
|
|
.borderRadius(px2vp(16))
|
|
|
- Column(){
|
|
|
- Row(){
|
|
|
- Text(this.contraband===1?'违禁品':this.weight===0?'等待':this.weight<=15?'正常':this.weight>=15?'超重':'',)
|
|
|
+
|
|
|
+ Column() {
|
|
|
+ Row() {
|
|
|
+ Text(this.contraband === 1 ? '违禁品' : this.weight === 0 ? '等待' : this.weight <= 15 ? '正常' : this.weight >= 15 ? '超重' : '',)
|
|
|
.borderRadius(px2vp(8))
|
|
|
- .backgroundColor(this.contraband===1?$r('app.color.brown_100'):this.weight===0?$r('app.color.grey_100'):this.weight<=15?$r('app.color.green_100'):this.weight>=15?$r('app.color.brown_100'):'')
|
|
|
+ .backgroundColor(this.contraband === 1 ? $r('app.color.brown_100') : this.weight === 0 ? $r('app.color.grey_100') : this.weight <= 15 ? $r('app.color.green_100') : this.weight >= 15 ? $r('app.color.brown_100') : '')
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
.fontColor($r('app.color.black_90'))
|
|
|
.textAlign(TextAlign.Center)
|
|
@@ -147,13 +153,13 @@ export struct IntelligentWarehousingGo{
|
|
|
.height(px2vp(56))
|
|
|
|
|
|
Blank()
|
|
|
- Column(){
|
|
|
+ Column() {
|
|
|
Text('料箱ID')
|
|
|
.height('50%')
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
.fontSize($r('app.float.fontSize_20'))
|
|
|
.fontColor($r('app.color.black_60'))
|
|
|
- Text(this.materialBox===1||this.materialBox===2?this.materialBoxId:'-')
|
|
|
+ Text(this.materialBox === 1 || this.materialBox === 2 ? this.materialBoxId : '-')
|
|
|
.height('50%')
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
.fontSize($r('app.float.fontSize_20'))
|
|
@@ -162,21 +168,20 @@ export struct IntelligentWarehousingGo{
|
|
|
|
|
|
}.width('60%')
|
|
|
.height('100%')
|
|
|
- .padding({right:px2vp(30)})
|
|
|
+ .padding({ right: px2vp(30) })
|
|
|
.alignItems(HorizontalAlign.End)
|
|
|
|
|
|
-
|
|
|
-
|
|
|
}.width('100%')
|
|
|
.height('30%')
|
|
|
- .padding({left:px2vp(30)})
|
|
|
- Column(){
|
|
|
+ .padding({ left: px2vp(30) })
|
|
|
+
|
|
|
+ Column() {
|
|
|
Text('入库任务单')
|
|
|
.height('50%')
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
.fontSize($r('app.float.fontSize_20'))
|
|
|
.fontColor($r('app.color.black_60'))
|
|
|
- Text(this.materialBox===1||this.materialBox===2?this.taskSheetId:'-')
|
|
|
+ Text(this.materialBox === 1 || this.materialBox === 2 ? this.taskSheetId : '-')
|
|
|
.height('50%')
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
.fontSize($r('app.float.fontSize_20'))
|
|
@@ -184,252 +189,261 @@ export struct IntelligentWarehousingGo{
|
|
|
}
|
|
|
.width('100%')
|
|
|
.height('30%')
|
|
|
- .padding({right:px2vp(30)})
|
|
|
+ .padding({ right: px2vp(30) })
|
|
|
.alignItems(HorizontalAlign.End)
|
|
|
+
|
|
|
Blank()
|
|
|
- Row(){
|
|
|
- Text('限载'+'[≤'+"15"+'Kg]')
|
|
|
+ Row() {
|
|
|
+ Text('限载' + '[≤' + "15" + 'Kg]')
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
.fontSize($r('app.float.fontSize_20'))
|
|
|
.fontColor($r('app.color.black_60'))
|
|
|
Blank()
|
|
|
- Text(this.materialBox===1||this.materialBox===2?this.weight.toString():'-')
|
|
|
+ Text(this.materialBox === 1 || this.materialBox === 2 ? this.weight.toString() : '-')
|
|
|
.fontSize(px2vp(48))
|
|
|
.fontWeight(FontWeight.Bold)
|
|
|
- .fontColor(this.weight>=15?$r('app.color.brown_100'):$r('app.color.green_100'))
|
|
|
+ .fontColor(this.weight >= 15 ? $r('app.color.brown_100') : $r('app.color.green_100'))
|
|
|
Text('Kg')
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
.fontSize($r('app.float.fontSize_20'))
|
|
|
.fontColor($r('app.color.black_60'))
|
|
|
}
|
|
|
- .padding({right:px2vp(50),left:px2vp(30)})
|
|
|
+ .padding({ right: px2vp(50), left: px2vp(30) })
|
|
|
.width('100%')
|
|
|
.height('30%')
|
|
|
}.width('100%')
|
|
|
.height('35%')
|
|
|
- .borderRadius({ bottomLeft:px2vp(8),bottomRight:px2vp(8) })
|
|
|
+ .borderRadius({ bottomLeft: px2vp(8), bottomRight: px2vp(8) })
|
|
|
.backgroundColor($r('app.color.process_divider_white_color'))
|
|
|
+
|
|
|
Blank()
|
|
|
- Row(){
|
|
|
- if (this.weight!==0){
|
|
|
+ Row() {
|
|
|
+ if (this.weight !== 0) {
|
|
|
LoadingProgress()
|
|
|
.color(Color.Blue)
|
|
|
.width('10%')
|
|
|
}
|
|
|
- Text(this.weight===0?'':this.weight>15?'操作料箱':"自动入库中")
|
|
|
- .fontWeight(FontWeight.Regular)
|
|
|
- .fontSize($r('app.float.fontSize_20'))
|
|
|
- .fontColor($r('app.color.black_60'))
|
|
|
+ Text(this.weight === 0 ? '' : this.weight > 15 ? '操作料箱' : "自动入库中")
|
|
|
+ .fontWeight(FontWeight.Regular)
|
|
|
+ .fontSize($r('app.float.fontSize_20'))
|
|
|
+ .fontColor($r('app.color.black_60'))
|
|
|
}.width('100%')
|
|
|
- .height('5%')
|
|
|
+ .height('5%')
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
- Row(){
|
|
|
- if (this.weight!==0&&this.weight<=15){
|
|
|
- Button('停止自动入库', { type: ButtonType.Normal, stateEffect: true })
|
|
|
- .width('100%')
|
|
|
- .height('90%')
|
|
|
- .borderRadius(px2vp(50))
|
|
|
- .backgroundColor($r('app.color.brown_100'))
|
|
|
- .onClick(()=>{
|
|
|
- this.automaticWarehousing=1
|
|
|
-
|
|
|
- })
|
|
|
- }else if (this.weight==0||this.weight>15||this.contraband===1){
|
|
|
- Button('启动自动入库', { type: ButtonType.Normal, stateEffect: true })
|
|
|
- .width('100%')
|
|
|
- .height('90%')
|
|
|
- .borderRadius(px2vp(50))
|
|
|
- .opacity(0.2)
|
|
|
- .backgroundColor($r('app.color.blue_100'))
|
|
|
- .onClick(()=>{
|
|
|
- this.automaticWarehousing=0
|
|
|
|
|
|
- })
|
|
|
- }
|
|
|
- // else if (this.weight!==0&&this.weight<=15){
|
|
|
- // Button('启动自动入库', { type: ButtonType.Normal, stateEffect: true })
|
|
|
- // .width('100%')
|
|
|
- // .height('90%')
|
|
|
- // .borderRadius(px2vp(50))
|
|
|
- // .backgroundColor($r('app.color.blue_100'))
|
|
|
- //
|
|
|
- // }
|
|
|
+ Row() {
|
|
|
+ if (this.weight !== 0 && this.weight <= 15) {
|
|
|
+ Button('停止自动入库', { type: ButtonType.Normal, stateEffect: true })
|
|
|
+ .width('100%')
|
|
|
+ .height('90%')
|
|
|
+ .borderRadius(px2vp(50))
|
|
|
+ .backgroundColor($r('app.color.brown_100'))
|
|
|
+ .onClick(() => {
|
|
|
+ this.automaticWarehousing = 1
|
|
|
|
|
|
+ })
|
|
|
+ } else if (this.weight == 0 || this.weight > 15 || this.contraband === 1) {
|
|
|
+ Button('启动自动入库', { type: ButtonType.Normal, stateEffect: true })
|
|
|
+ .width('100%')
|
|
|
+ .height('90%')
|
|
|
+ .borderRadius(px2vp(50))
|
|
|
+ .opacity(0.2)
|
|
|
+ .backgroundColor($r('app.color.blue_100'))
|
|
|
+ .onClick(() => {
|
|
|
+ this.automaticWarehousing = 0
|
|
|
|
|
|
+ })
|
|
|
}
|
|
|
- .width('100%')
|
|
|
- .height('10%')
|
|
|
-
|
|
|
+ // else if (this.weight!==0&&this.weight<=15){
|
|
|
+ // Button('启动自动入库', { type: ButtonType.Normal, stateEffect: true })
|
|
|
+ // .width('100%')
|
|
|
+ // .height('90%')
|
|
|
+ // .borderRadius(px2vp(50))
|
|
|
+ // .backgroundColor($r('app.color.blue_100'))
|
|
|
+ //
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .height('10%')
|
|
|
+
|
|
|
}.width(px2vp(608))
|
|
|
.height('100%')
|
|
|
- .margin({right:px2vp(24)})
|
|
|
- Column(){
|
|
|
- Row(){
|
|
|
+ .margin({ right: px2vp(24) })
|
|
|
+
|
|
|
+ Column() {
|
|
|
+ Row() {
|
|
|
Image($r('app.media.shaoma'))
|
|
|
.width(px2vp(32))
|
|
|
.height(px2vp(32))
|
|
|
- Row(){
|
|
|
- TextInput({ text:this.materialNo,
|
|
|
+ Row() {
|
|
|
+ TextInput({ text: this.materialNo,
|
|
|
placeholder: '请点击扫码或者输入物料编码',
|
|
|
- controller: this.textcontroller }).width('92%')
|
|
|
- .placeholderFont({size:$r('app.float.fontSize_24')})
|
|
|
+ controller: this.textcontroller })
|
|
|
+ .width('92%')
|
|
|
+ .placeholderFont({ size: $r('app.float.fontSize_24') })
|
|
|
.height('100%')
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontSize($r('app.float.fontSize_24'))
|
|
|
.backgroundColor("#ffff")
|
|
|
.borderRadius(21)
|
|
|
.onSubmit(() => {
|
|
|
- //执行什么操作
|
|
|
- if (this.automaticWarehousing===1) {
|
|
|
- this.materialBox=1
|
|
|
- console.log('testAge'+'请求参数'+this.materialNo)
|
|
|
- this.ScanStorageCode(this.materialNo).then((obj : MaterialInformationList)=>{
|
|
|
+ //执行什么操作
|
|
|
+ if (this.automaticWarehousing === 1) {
|
|
|
+ this.materialBox = 1
|
|
|
+ console.log('testAge' + '请求参数' + this.materialNo)
|
|
|
+ this.ScanStorageCode(this.materialNo).then((obj: MaterialInformationModel) => {
|
|
|
this.MaterialInformation.push(obj)
|
|
|
})
|
|
|
}
|
|
|
|
|
|
})
|
|
|
- .onChange((value:string)=>{
|
|
|
- // this.itemCode=value
|
|
|
+ .onChange((value: string) => {
|
|
|
+ // this.itemCode=value
|
|
|
})
|
|
|
}.width('80%')
|
|
|
- .padding({left:10})
|
|
|
+ .padding({ left: 10 })
|
|
|
+
|
|
|
Image($r('app.media.search'))
|
|
|
.width(px2vp(32))
|
|
|
.height(px2vp(32))
|
|
|
- .onClick(async ()=>{
|
|
|
- if (this.automaticWarehousing===1) {
|
|
|
- this.materialBox=1
|
|
|
- console.log('testAge'+'请求参数'+this.materialNo)
|
|
|
- this.ScanStorageCode(this.materialNo).then((obj : MaterialInformationList)=>{
|
|
|
+ .onClick(async () => {
|
|
|
+ if (this.automaticWarehousing === 1) {
|
|
|
+ this.materialBox = 1
|
|
|
+ console.log('testAge' + '请求参数' + this.materialNo)
|
|
|
+ this.ScanStorageCode(this.materialNo).then((obj: MaterialInformationModel) => {
|
|
|
this.MaterialInformation.push(obj)
|
|
|
})
|
|
|
}
|
|
|
|
|
|
})
|
|
|
}
|
|
|
- .border({width:0.1})
|
|
|
+ .border({ width: 0.1 })
|
|
|
.borderRadius(40)
|
|
|
.width(px2vp(608))
|
|
|
.height(px2vp(80))
|
|
|
.backgroundColor('#fff')
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
- Column(){
|
|
|
+
|
|
|
+ Column() {
|
|
|
List() {
|
|
|
- ForEach(this.MaterialInformation, (item:MaterialInformationList,index:number) => {
|
|
|
- // ForEach(this.exchange,(exchangeItem:exchangeClass,exchangeIndex:number)=>{
|
|
|
- ListItem() {
|
|
|
- Row(){
|
|
|
- Column(){
|
|
|
- Text(item.materialName)
|
|
|
+ ForEach(this.MaterialInformation, (item: MaterialInformationModel, index: number) => {
|
|
|
+ // ForEach(this.exchange,(exchangeItem:exchangeClass,exchangeIndex:number)=>{
|
|
|
+ ListItem() {
|
|
|
+ Row() {
|
|
|
+ Column() {
|
|
|
+ Text(item.materialName)
|
|
|
+ .fontWeight(FontWeight.Medium)// Text(item.materialCode)
|
|
|
+ .fontSize($r('app.float.fontSize_24'))
|
|
|
+ Text(item.materialNo)
|
|
|
+ .fontColor("#666666")
|
|
|
+ .fontWeight(FontWeight.Regular)
|
|
|
+ .fontSize($r('app.float.fontSize_20'))
|
|
|
+ Text(item.type)
|
|
|
+ .fontColor("#666666")
|
|
|
+ .fontWeight(FontWeight.Regular)
|
|
|
+ .fontSize($r('app.float.fontSize_20'))
|
|
|
+ Row() {
|
|
|
+ Text(item.num?.toString())
|
|
|
+ .fontWeight(FontWeight.Bold)
|
|
|
+ .fontSize($r('app.float.fontSize_38'))
|
|
|
+ Text('个')
|
|
|
+ .fontColor("#666666")
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
- // Text(item.materialCode)
|
|
|
.fontSize($r('app.float.fontSize_24'))
|
|
|
- Text(item.materialNo)
|
|
|
- .fontColor("#666666")
|
|
|
- .fontWeight(FontWeight.Regular)
|
|
|
- .fontSize($r('app.float.fontSize_20'))
|
|
|
- Text(item.type)
|
|
|
- .fontColor("#666666")
|
|
|
- .fontWeight(FontWeight.Regular)
|
|
|
- .fontSize($r('app.float.fontSize_20'))
|
|
|
- Row(){
|
|
|
- Text(item.num?.toString())
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
- . fontSize($r('app.float.fontSize_38'))
|
|
|
- Text('个')
|
|
|
- .fontColor("#666666")
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- .fontSize($r('app.float.fontSize_24'))
|
|
|
- }
|
|
|
- }.width('70%')
|
|
|
- .padding({left:px2vp(30)})
|
|
|
- .borderRadius(10)
|
|
|
- .alignItems(HorizontalAlign.Start)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .width('70%')
|
|
|
+ .padding({ left: px2vp(30) })
|
|
|
+ .borderRadius(10)
|
|
|
+ .alignItems(HorizontalAlign.Start)
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .height('100%')
|
|
|
+ .backgroundColor(item.materialNo === "42944402000591" ? $r('app.color.brown_100') : '#fff')
|
|
|
+
|
|
|
+ if (item.exchangeNumber !== undefined) {
|
|
|
+ Row() {
|
|
|
+ Image((item.exchangeNumber!) >= 0 ? $r('app.media.plus') : $r('app.media.reduce'))
|
|
|
+ .width(px2vp(30))
|
|
|
+ .height((item.exchangeNumber!) >= 0 ? px2vp(30) : px2vp(8))
|
|
|
+ Text((item.exchangeNumber!) >= 0 ? item.exchangeNumber?.toString() : (-(item.exchangeNumber!))?.toString())// .backgroundColor(item.exchangeNumber>0?$r('app.color.green_100'):item?.exchangeNumber===0?'':$r('app.color.brown_100'))
|
|
|
+ .fontSize($r('app.float.fontSize_38'))
|
|
|
+ .fontWeight(FontWeight.Bold)
|
|
|
+ .fontColor((item.exchangeNumber!) >= 0 ? $r('app.color.green_100') : $r('app.color.brown_100'))
|
|
|
+ }.width('20%')
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
+ .alignItems(VerticalAlign.Center)
|
|
|
.height('100%')
|
|
|
- .backgroundColor(item.materialNo==="42944402000591"?$r('app.color.brown_100'):'#fff')
|
|
|
- if (item.exchangeNumber!==undefined){
|
|
|
- Row(){
|
|
|
- Image((item.exchangeNumber!)>=0?$r('app.media.plus'):$r('app.media.reduce'))
|
|
|
- .width(px2vp(30))
|
|
|
- .height((item.exchangeNumber!)>=0?px2vp(30):px2vp(8))
|
|
|
- Text((item.exchangeNumber!)>=0?item.exchangeNumber?.toString():(-(item.exchangeNumber!))?.toString())
|
|
|
- // .backgroundColor(item.exchangeNumber>0?$r('app.color.green_100'):item?.exchangeNumber===0?'':$r('app.color.brown_100'))
|
|
|
- . fontSize($r('app.float.fontSize_38'))
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
- .fontColor((item.exchangeNumber!)>=0?$r('app.color.green_100'):$r('app.color.brown_100'))
|
|
|
- }.width('20%')
|
|
|
- .justifyContent(FlexAlign.Center)
|
|
|
- .alignItems(VerticalAlign.Center)
|
|
|
- .height('100%')
|
|
|
- }else {
|
|
|
- Column(){
|
|
|
- }.width('20%')
|
|
|
- .justifyContent(FlexAlign.Center)
|
|
|
- .alignItems(HorizontalAlign.Center)
|
|
|
- .height('100%')
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ Column() {
|
|
|
+ }.width('20%')
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .alignItems(HorizontalAlign.Center)
|
|
|
+ .height('100%')
|
|
|
+ }
|
|
|
|
|
|
- Column(){
|
|
|
- Image($r('app.media.subscript_space'))
|
|
|
- .width($r('app.float.storage_set_image_effect_height'))
|
|
|
- .height($r('app.float.storage_set_image_effect_height'))
|
|
|
+ Column() {
|
|
|
+ Image($r('app.media.subscript_space'))
|
|
|
+ .width($r('app.float.storage_set_image_effect_height'))
|
|
|
+ .height($r('app.float.storage_set_image_effect_height'))
|
|
|
|
|
|
- }.width('10%')
|
|
|
- .justifyContent(FlexAlign.End)
|
|
|
- .alignItems(HorizontalAlign.End)
|
|
|
- .height('100%')
|
|
|
+ }.width('10%')
|
|
|
+ .justifyContent(FlexAlign.End)
|
|
|
+ .alignItems(HorizontalAlign.End)
|
|
|
+ .height('100%')
|
|
|
|
|
|
- }.width(px2vp(608))
|
|
|
- .height(px2vp(210))
|
|
|
- .borderRadius($r('app.float.borderRadius_16'))
|
|
|
- .backgroundColor('#fff')
|
|
|
- .onClick(()=>{
|
|
|
- // this.exchangeIndex=exchangeIndex!
|
|
|
- this.index=index
|
|
|
- this.batchCode=item.batchCode!
|
|
|
- this.materialName=item.materialName!
|
|
|
- this.materialNo=item.materialNo!
|
|
|
- this.num=item.num!
|
|
|
- this.seqNo=item.seqNo!
|
|
|
- this.spec=item.spec!
|
|
|
- //if (item.exchangeNumber===null){
|
|
|
- // this.MaterialInformation[index].exchangeNumber=0
|
|
|
-
|
|
|
- // if (this.exchangeNumber!==0) {
|
|
|
- // this.MaterialInformation[index]= {
|
|
|
- // taskId: this.MaterialInformation[index].taskId,
|
|
|
- // materialName: this.MaterialInformation[index].materialName,
|
|
|
- // exchangeNumber:0,
|
|
|
- // num:this.MaterialInformation[index].num,
|
|
|
- // materialNo: this.MaterialInformation[index].materialNo,
|
|
|
- // batchCode: this.MaterialInformation[index].batchCode,
|
|
|
- // seqNo: this.MaterialInformation[index].seqNo,
|
|
|
- // spec: this.MaterialInformation[index].spec,
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }else if (item.exchangeNumber!==0){
|
|
|
- // item.exchangeNumber=0
|
|
|
- // }
|
|
|
-
|
|
|
- // this.exchangeNumber=item.exchangeNumber!
|
|
|
- // this.scanStorageList[index]= {
|
|
|
- // taskId: item.taskId!,
|
|
|
- // materialName: item.materialName!,
|
|
|
- // num: item.num!,
|
|
|
- // exchangeNumber:this.exchangeNumber!,
|
|
|
- // materialNo: item.materialNo!,
|
|
|
- // batchCode: item.batchCode!,
|
|
|
- // seqNo: item.seqNo!,
|
|
|
- // spec: item.spec!,
|
|
|
- // }
|
|
|
- this.materialDetailsController.open()
|
|
|
- })
|
|
|
}
|
|
|
- .swipeAction({ end:this.itemEnd(index)})
|
|
|
- .margin({right:px2vp(12),top:px2vp(24),bottom:px2vp(24)})
|
|
|
- // })
|
|
|
+ .width(px2vp(608))
|
|
|
+ .height(px2vp(210))
|
|
|
+ .borderRadius($r('app.float.borderRadius_16'))
|
|
|
+ .backgroundColor('#fff')
|
|
|
+ .onClick(() => {
|
|
|
+ // this.exchangeIndex=exchangeIndex!
|
|
|
+ this.index = index
|
|
|
+ this.batchCode = item.batchCode!
|
|
|
+ this.materialName = item.materialName!
|
|
|
+ this.materialNo = item.materialNo!
|
|
|
+ this.num = item.num!
|
|
|
+ this.seqNo = item.seqNo!
|
|
|
+ this.spec = item.spec!
|
|
|
+ //if (item.exchangeNumber===null){
|
|
|
+ // this.MaterialInformation[index].exchangeNumber=0
|
|
|
+
|
|
|
+ // if (this.exchangeNumber!==0) {
|
|
|
+ // this.MaterialInformation[index]= {
|
|
|
+ // taskId: this.MaterialInformation[index].taskId,
|
|
|
+ // materialName: this.MaterialInformation[index].materialName,
|
|
|
+ // exchangeNumber:0,
|
|
|
+ // num:this.MaterialInformation[index].num,
|
|
|
+ // materialNo: this.MaterialInformation[index].materialNo,
|
|
|
+ // batchCode: this.MaterialInformation[index].batchCode,
|
|
|
+ // seqNo: this.MaterialInformation[index].seqNo,
|
|
|
+ // spec: this.MaterialInformation[index].spec,
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }else if (item.exchangeNumber!==0){
|
|
|
+ // item.exchangeNumber=0
|
|
|
+ // }
|
|
|
+
|
|
|
+ // this.exchangeNumber=item.exchangeNumber!
|
|
|
+ // this.scanStorageList[index]= {
|
|
|
+ // taskId: item.taskId!,
|
|
|
+ // materialName: item.materialName!,
|
|
|
+ // num: item.num!,
|
|
|
+ // exchangeNumber:this.exchangeNumber!,
|
|
|
+ // materialNo: item.materialNo!,
|
|
|
+ // batchCode: item.batchCode!,
|
|
|
+ // seqNo: item.seqNo!,
|
|
|
+ // spec: item.spec!,
|
|
|
+ // }
|
|
|
+ this.materialDetailsController.open()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .swipeAction({ end: this.itemEnd(index) })
|
|
|
+ .margin({ right: px2vp(12), top: px2vp(24), bottom: px2vp(24) })
|
|
|
+
|
|
|
+ // })
|
|
|
})
|
|
|
}
|
|
|
.lanes(2)
|
|
@@ -441,114 +455,122 @@ export struct IntelligentWarehousingGo{
|
|
|
|
|
|
}.width(px2vp(1260))
|
|
|
.height('92%')
|
|
|
- .margin({right:px2vp(24)})
|
|
|
+ .margin({ right: px2vp(24) })
|
|
|
}.width(px2vp(1260))
|
|
|
.height('100%')
|
|
|
.alignItems(HorizontalAlign.Start)
|
|
|
}.width('100%')
|
|
|
.height('92%')
|
|
|
- .padding({left:px2vp(24),right:px2vp(24),top:$r('app.float.fontSize_20'),bottom:$r('app.float.fontSize_20')})
|
|
|
- }
|
|
|
+ .padding({
|
|
|
+ left: px2vp(24),
|
|
|
+ right: px2vp(24),
|
|
|
+ top: $r('app.float.fontSize_20'),
|
|
|
+ bottom: $r('app.float.fontSize_20')
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
@CustomDialog
|
|
|
///无批次号物料详情弹窗
|
|
|
struct materialDetails {
|
|
|
- @Link exchangeNumber:number
|
|
|
- @Link index:number
|
|
|
- @Link batchCode:string
|
|
|
- @Link materialName:string
|
|
|
- @Link exchangeIndex:number
|
|
|
+ @Link exchangeNumber: number
|
|
|
+ @Link index: number
|
|
|
+ @Link batchCode: string
|
|
|
+ @Link materialName: string
|
|
|
+ @Link exchangeIndex: number
|
|
|
// @State materialNo:string=''
|
|
|
- @Link num:number
|
|
|
- @Link seqNo:string
|
|
|
- @Link spec:string
|
|
|
- @Link materialNo:string
|
|
|
- @Link private exchange:Array<exchangeClass>
|
|
|
- @Link private MaterialInformation:Array<MaterialInformationList>
|
|
|
+ @Link num: number
|
|
|
+ @Link seqNo: string
|
|
|
+ @Link spec: string
|
|
|
+ @Link materialNo: string
|
|
|
+ @Link private exchange: Array<exchangeClass>
|
|
|
+ @Link private MaterialInformation: Array<MaterialInformationModel>
|
|
|
scroller: Scroller = new Scroller()
|
|
|
- @State navigation:number=0
|
|
|
+ @State navigation: number = 0
|
|
|
controller: CustomDialogController
|
|
|
+
|
|
|
// 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后
|
|
|
build() {
|
|
|
Column() {
|
|
|
- Column(){
|
|
|
+ Column() {
|
|
|
|
|
|
}.width('100%')
|
|
|
.height('20%')
|
|
|
- .onClick(()=>{
|
|
|
- this.exchangeNumber=0
|
|
|
+ .onClick(() => {
|
|
|
+ this.exchangeNumber = 0
|
|
|
this.controller.close()
|
|
|
})
|
|
|
- Row(){
|
|
|
- Row(){
|
|
|
+
|
|
|
+ Row() {
|
|
|
+ Row() {
|
|
|
|
|
|
}.width('25%')
|
|
|
.height('100%')
|
|
|
- .onClick(()=>{
|
|
|
- this.exchangeNumber=0
|
|
|
+ .onClick(() => {
|
|
|
+ this.exchangeNumber = 0
|
|
|
this.controller.close()
|
|
|
})
|
|
|
- Column({space:20}){
|
|
|
+
|
|
|
+ Column({ space: 20 }) {
|
|
|
Text('物料详情')
|
|
|
.textAlign(TextAlign.Center)
|
|
|
.width('100%')
|
|
|
.height('20%')
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontSize($r('app.float.fontSize_38'))
|
|
|
- Column({space:10}){
|
|
|
+ Column({ space: 10 }) {
|
|
|
Text(this.materialName)
|
|
|
.fontSize($r('app.float.fontSize_24'))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.width('100%')
|
|
|
- Text('物料编码:'+this.materialNo)
|
|
|
+ Text('物料编码:' + this.materialNo)
|
|
|
.fontSize($r('app.float.fontSize_20'))
|
|
|
.textAlign(TextAlign.Start)
|
|
|
.fontColor('#99000000')
|
|
|
.width('100%')
|
|
|
- Text('规格描述'+this.spec)
|
|
|
+ Text('规格描述' + this.spec)
|
|
|
.fontSize($r('app.float.fontSize_20'))
|
|
|
.textAlign(TextAlign.Start)
|
|
|
.fontColor('#99000000')
|
|
|
.width('100%')
|
|
|
- Text('批次号:'+this.batchCode)
|
|
|
+ Text('批次号:' + this.batchCode)
|
|
|
.fontSize($r('app.float.fontSize_20'))
|
|
|
.textAlign(TextAlign.Start)
|
|
|
.fontColor('#99000000')
|
|
|
.width('100%')
|
|
|
- .textOverflow({overflow:TextOverflow.Ellipsis})
|
|
|
- Text('序列号:'+this.seqNo)
|
|
|
+ .textOverflow({ overflow: TextOverflow.Ellipsis })
|
|
|
+ Text('序列号:' + this.seqNo)
|
|
|
.fontSize($r('app.float.fontSize_20'))
|
|
|
.textAlign(TextAlign.Start)
|
|
|
.fontColor('#99000000')
|
|
|
.width('100%')
|
|
|
|
|
|
|
|
|
-
|
|
|
}.width('40%')
|
|
|
.height('30%')
|
|
|
|
|
|
Divider().vertical(false)
|
|
|
.width('60%')
|
|
|
- Column(){
|
|
|
+ Column() {
|
|
|
Text('录入数量')
|
|
|
.fontSize($r('app.float.fontSize_20'))
|
|
|
.textAlign(TextAlign.Start)
|
|
|
.fontColor('#99000000')
|
|
|
.width('40%')
|
|
|
- Row(){
|
|
|
+ Row() {
|
|
|
Image($r('app.media.subtract_disabled'))
|
|
|
.width(px2vp(80))
|
|
|
.height(px2vp(80))
|
|
|
- .border({width:0.8})
|
|
|
- .borderRadius({ topLeft:px2vp(16),bottomLeft:px2vp(16) })
|
|
|
- .onClick(()=>{
|
|
|
+ .border({ width: 0.8 })
|
|
|
+ .borderRadius({ topLeft: px2vp(16), bottomLeft: px2vp(16) })
|
|
|
+ .onClick(() => {
|
|
|
this.num--
|
|
|
this.exchangeNumber--
|
|
|
- this.MaterialInformation[this.index]= {
|
|
|
+ this.MaterialInformation[this.index] = {
|
|
|
taskId: this.MaterialInformation[this.index].taskId,
|
|
|
materialName: this.MaterialInformation[this.index].materialName,
|
|
|
- // exchangeNumber:this.MaterialInformation[this.index].exchangeNumber,
|
|
|
- exchangeNumber:this.exchangeNumber,
|
|
|
+ // exchangeNumber:this.MaterialInformation[this.index].exchangeNumber,
|
|
|
+ exchangeNumber: this.exchangeNumber,
|
|
|
num: this.num,
|
|
|
materialNo: this.MaterialInformation[this.index].materialNo,
|
|
|
batchCode: this.MaterialInformation[this.index].batchCode,
|
|
@@ -556,24 +578,23 @@ struct materialDetails {
|
|
|
spec: this.MaterialInformation[this.index].spec,
|
|
|
}
|
|
|
})
|
|
|
- TextInput({text: this.num?.toString()})
|
|
|
+ TextInput({ text: this.num?.toString() })
|
|
|
.fontSize($r('app.float.fontSize_38'))
|
|
|
.fontWeight(FontWeight.Bold)
|
|
|
- .fontColor($r('app.color.general_font_color'))
|
|
|
- // .opacity($r('app.float.general_font_opacity'))
|
|
|
+ .fontColor($r('app.color.general_font_color'))// .opacity($r('app.float.general_font_opacity'))
|
|
|
.height(px2vp(80))
|
|
|
.width(px2vp(154))
|
|
|
.type(InputType.Number)
|
|
|
.textAlign(TextAlign.Center)
|
|
|
.backgroundColor($r('app.color.general_card_background_color'))
|
|
|
.borderRadius(0)
|
|
|
- .border({width:0.8})
|
|
|
- .onChange(()=>{
|
|
|
- this.MaterialInformation[this.index]= {
|
|
|
+ .border({ width: 0.8 })
|
|
|
+ .onChange(() => {
|
|
|
+ this.MaterialInformation[this.index] = {
|
|
|
taskId: this.MaterialInformation[this.index].taskId!,
|
|
|
materialName: this.MaterialInformation[this.index].materialName!,
|
|
|
- // exchangeNumber:this.MaterialInformation[this.index].exchangeNumber!,
|
|
|
- exchangeNumber:this.exchangeNumber,
|
|
|
+ // exchangeNumber:this.MaterialInformation[this.index].exchangeNumber!,
|
|
|
+ exchangeNumber: this.exchangeNumber,
|
|
|
num: this.num,
|
|
|
materialNo: this.MaterialInformation[this.index].materialNo!,
|
|
|
batchCode: this.MaterialInformation[this.index].batchCode!,
|
|
@@ -585,17 +606,17 @@ struct materialDetails {
|
|
|
Image($r('app.media.add_disabled'))
|
|
|
.width(px2vp(80))
|
|
|
.height(px2vp(80))
|
|
|
- .border({width:0.8})
|
|
|
- .borderRadius({topRight:px2vp(16),bottomRight:px2vp(16)})
|
|
|
+ .border({ width: 0.8 })
|
|
|
+ .borderRadius({ topRight: px2vp(16), bottomRight: px2vp(16) })
|
|
|
|
|
|
- .onClick(()=>{
|
|
|
+ .onClick(() => {
|
|
|
this.exchangeNumber++
|
|
|
this.num++
|
|
|
- this.MaterialInformation[this.index]= {
|
|
|
+ this.MaterialInformation[this.index] = {
|
|
|
taskId: this.MaterialInformation[this.index].taskId,
|
|
|
materialName: this.MaterialInformation[this.index].materialName,
|
|
|
//exchangeNumber:this.MaterialInformation[this.index].exchangeNumber,
|
|
|
- exchangeNumber:this.exchangeNumber,
|
|
|
+ exchangeNumber: this.exchangeNumber,
|
|
|
num: this.num,
|
|
|
materialNo: this.MaterialInformation[this.index].materialNo,
|
|
|
batchCode: this.MaterialInformation[this.index].batchCode,
|
|
@@ -617,22 +638,23 @@ struct materialDetails {
|
|
|
.height(px2vp(670))
|
|
|
.backgroundColor('#F1F3F5')
|
|
|
.borderRadius(20)
|
|
|
- Row(){
|
|
|
+
|
|
|
+ Row() {
|
|
|
|
|
|
}.width('25%')
|
|
|
.height('100%')
|
|
|
- .onClick(()=>{
|
|
|
- this.exchangeNumber=0
|
|
|
+ .onClick(() => {
|
|
|
+ this.exchangeNumber = 0
|
|
|
this.controller.close()
|
|
|
})
|
|
|
}.width('100%')
|
|
|
.height('60%')
|
|
|
|
|
|
- Column(){
|
|
|
+ Column() {
|
|
|
|
|
|
}.width('100%')
|
|
|
.height('20%')
|
|
|
- .onClick(()=>{
|
|
|
+ .onClick(() => {
|
|
|
this.controller.close()
|
|
|
})
|
|
|
|