|
@@ -53,6 +53,9 @@ export struct RfidAllocation {
|
|
|
@State private newMaterialBin: Array<newMaterialBin> = []
|
|
|
//读取到的rfid信息
|
|
|
@State private httpRfid: RfidClass = {}
|
|
|
+ // 前缀和流水号
|
|
|
+ @State prefix: string = "XF-"
|
|
|
+ @State suffix: string = ""
|
|
|
//获取rfid
|
|
|
@State private recentlyRecordObject: StationInfoModel = {}
|
|
|
RfidHttp = async (): Promise<RfidClass> => {
|
|
@@ -166,6 +169,7 @@ export struct RfidAllocation {
|
|
|
.alignItems(HorizontalAlign.Start)
|
|
|
|
|
|
Row() {
|
|
|
+
|
|
|
Button('新建料箱')
|
|
|
.width(px2vp(292))
|
|
|
.height(px2vp(80))
|
|
@@ -182,7 +186,13 @@ export struct RfidAllocation {
|
|
|
(dateTime.getHours()).toString().padStart(2, '0') + (dateTime.getMinutes() + 1).toString()
|
|
|
.padStart(2, '0')
|
|
|
+ (dateTime.getSeconds()).toString().padStart(2, '0') + (this.newBox < 10 ? 0 : '') + this.newBox
|
|
|
- this.coding = coding
|
|
|
+
|
|
|
+
|
|
|
+ this.coding = this.prefix + this.suffix.padStart(5, "0")
|
|
|
+
|
|
|
+ this.suffix = `${Number(this.suffix) + 1}`
|
|
|
+
|
|
|
+
|
|
|
let data = dateTime.getFullYear() + '-' + (dateTime.getMonth() + 1).toString().padStart(2, '0')
|
|
|
+ '-' + (dateTime.getDate().toString().padStart(2, '0'))
|
|
|
this.MaterialBoxData = data
|
|
@@ -202,40 +212,63 @@ export struct RfidAllocation {
|
|
|
}
|
|
|
this.newMaterialBin.unshift(obj)
|
|
|
})
|
|
|
+
|
|
|
Blank()
|
|
|
- Row() {
|
|
|
- Image($r('app.media.shaoma'))
|
|
|
- .width(px2vp(32))
|
|
|
- .height(px2vp(32))
|
|
|
- .margin({ left: $r('app.float.fontSize_30') })
|
|
|
- TextInput({ text: this.boxCode,
|
|
|
- placeholder: '请点击扫码或者输入物料编码',
|
|
|
- controller: this.textcontroller })
|
|
|
- .width('92%')
|
|
|
- .height('100%')
|
|
|
- .width(px2vp(450))
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- .fontSize($r('app.float.fontSize_24'))
|
|
|
- .backgroundColor("#ffff")
|
|
|
- .borderRadius(21)
|
|
|
- .onSubmit(() => {
|
|
|
|
|
|
- })
|
|
|
- Image($r('app.media.search'))
|
|
|
- .width(px2vp(32))
|
|
|
- .height(px2vp(32))
|
|
|
- .margin({ right: $r('app.float.fontSize_30') })
|
|
|
+ Button('清空')
|
|
|
+ .width(px2vp(192))
|
|
|
+ .height(px2vp(80))
|
|
|
+ .fontSize($r('app.float.fontSize_24'))
|
|
|
+ .fontWeight(FontWeight.Medium)
|
|
|
+ .fontColor($r('app.color.process_divider_white_color'))
|
|
|
+ .onClick(() => {
|
|
|
+ this.newMaterialBin = []
|
|
|
+ })
|
|
|
+
|
|
|
+ Text('前缀: ')
|
|
|
+ .fontSize($r('app.float.fontSize_30'))
|
|
|
+ .fontWeight(FontWeight.Medium)
|
|
|
+ .fontColor($r('app.color.black_90'))
|
|
|
+ .height(px2vp(50))
|
|
|
+ .margin({ right: 5, left: 5 })
|
|
|
+
|
|
|
+ TextInput({ text: this.prefix })
|
|
|
+ .fontSize($r('app.float.fontSize_24'))
|
|
|
+ .fontWeight(FontWeight.Medium)
|
|
|
+ .fontColor($r('app.color.black_90'))
|
|
|
+ .width(100)
|
|
|
+ .height(50)
|
|
|
+ .onChange((value) => {
|
|
|
+ this.prefix = value
|
|
|
+ })
|
|
|
+
|
|
|
+ Blank()
|
|
|
+
|
|
|
+ Text('起始流水号: ')
|
|
|
+ .fontSize($r('app.float.fontSize_30'))
|
|
|
+ .fontWeight(FontWeight.Medium)
|
|
|
+ .fontColor($r('app.color.black_90'))
|
|
|
+ .height(px2vp(50))
|
|
|
+ .margin({ right: 5, left: 5 })
|
|
|
+
|
|
|
+ TextInput({ text: this.suffix })
|
|
|
+ .fontSize($r('app.float.fontSize_24'))
|
|
|
+ .fontWeight(FontWeight.Medium)
|
|
|
+ .fontColor($r('app.color.black_90'))
|
|
|
+ .width(100)
|
|
|
+ .height(50)
|
|
|
+ .onChange((value) => {
|
|
|
+ this.suffix = value
|
|
|
+ })
|
|
|
+
|
|
|
|
|
|
- }
|
|
|
- .width(px2vp(608))
|
|
|
- .height(px2vp(80))
|
|
|
- .borderRadius(px2vp(100))
|
|
|
- .alignItems(VerticalAlign.Center)
|
|
|
- .backgroundColor($r('app.color.process_divider_white_color'))
|
|
|
}
|
|
|
.margin({ right: $r('app.float.Margins_24') })
|
|
|
- .width('100%')
|
|
|
.height(px2vp(80))
|
|
|
+ .width('100%')
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
+ .alignItems(VerticalAlign.Center)
|
|
|
+
|
|
|
}
|
|
|
.width('100%')
|
|
|
.height(px2vp(160))
|
|
@@ -247,12 +280,15 @@ export struct RfidAllocation {
|
|
|
ForEach(this.newMaterialBin, (item: newMaterialBin, index: number) => {
|
|
|
ListItem() {
|
|
|
Column() {
|
|
|
- Text(item.coding)
|
|
|
+ TextInput({ text: item.coding })
|
|
|
.fontSize($r('app.float.fontSize_24'))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor($r('app.color.black_90'))
|
|
|
.width('100%')
|
|
|
- .height('40%')
|
|
|
+ .height('50%')
|
|
|
+ .onChange((value) => {
|
|
|
+ item.coding = value
|
|
|
+ })
|
|
|
|
|
|
Row() {
|
|
|
Text(item.MaterialBoxData + ' ' + item.MaterialBoxTime)
|
|
@@ -260,7 +296,7 @@ export struct RfidAllocation {
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor($r('app.color.black_60'))
|
|
|
.width('100%')
|
|
|
- .height('100%')
|
|
|
+ .layoutWeight(1)
|
|
|
.textAlign(TextAlign.Start)
|
|
|
}
|
|
|
.width('100%')
|
|
@@ -268,9 +304,9 @@ export struct RfidAllocation {
|
|
|
}
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
.width(px2vp(608))
|
|
|
- .height(px2vp(88))
|
|
|
+ .height(px2vp(100))
|
|
|
.margin({ right: $r('app.float.Margins_24'), bottom: $r('app.float.topMargins_20') })
|
|
|
- .padding({ left: $r('app.float.leftMargins_30') })
|
|
|
+ .padding({ left: $r('app.float.leftMargins_30'), top: 5, right: $r("app.float.leftMargins_30") })
|
|
|
.backgroundColor(this.onclick === index ? $r('app.color.blue_100') : $r('app.color.process_divider_white_color'))
|
|
|
.borderRadius(px2vp(16))
|
|
|
.onClick(() => {
|
|
@@ -295,92 +331,95 @@ export struct RfidAllocation {
|
|
|
//.margin({right:$r('app.float.Margins_24')})
|
|
|
|
|
|
Column() {
|
|
|
- Column() {
|
|
|
- Text('条码打印')
|
|
|
- .fontSize($r('app.float.fontSize_30'))
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- .fontColor($r('app.color.black_90'))
|
|
|
- .textAlign(TextAlign.Start)
|
|
|
- .width('100%')
|
|
|
- .height('15%')
|
|
|
- .margin({ left: $r('app.float.leftMargins_30') })
|
|
|
- Column() {
|
|
|
- Row({ space: 10 }) {
|
|
|
- Text('打印机状态')
|
|
|
- .fontSize($r('app.float.fontSize_20'))
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- .fontColor($r('app.color.black_60'))
|
|
|
- .textAlign(TextAlign.End)
|
|
|
- .width('40%')
|
|
|
- .height('100%')
|
|
|
- if (this.onlineStatus === 0) {
|
|
|
- Text().width(px2vp(12))
|
|
|
- .height(px2vp(12))
|
|
|
- .borderRadius(px2vp(50))
|
|
|
- .backgroundColor($r('app.color.green_100'))
|
|
|
- Text('在线')
|
|
|
- .fontSize($r('app.float.fontSize_20'))
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- .fontColor($r('app.color.black_90'))
|
|
|
- .textAlign(TextAlign.Start)
|
|
|
- .width('35%')
|
|
|
- .height('100%')
|
|
|
- } else if (this.onlineStatus === 1) {
|
|
|
-
|
|
|
- Text().width('5%')
|
|
|
- .height('30%')
|
|
|
- .borderRadius(px2vp(50))
|
|
|
- .backgroundColor($r('app.color.grey_100'))
|
|
|
- Text('不在线')
|
|
|
- .fontSize($r('app.float.fontSize_20'))
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- .fontColor($r('app.color.black_90'))
|
|
|
- .textAlign(TextAlign.Start)
|
|
|
- .width('35%')
|
|
|
- .height('100%')
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- .width('100%')
|
|
|
- .height('30%')
|
|
|
-
|
|
|
- Row({ space: 10 }) {
|
|
|
- Text('打印机RFID编号')
|
|
|
- .fontSize($r('app.float.fontSize_20'))
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- .fontColor($r('app.color.black_60'))
|
|
|
- .textAlign(TextAlign.End)
|
|
|
- .width('40%')
|
|
|
- .height('100%')
|
|
|
- Text('6537289495783').width('40%')
|
|
|
- .height('30%')
|
|
|
- .borderRadius(px2vp(50))
|
|
|
- .fontColor($r('app.color.blue_100'))
|
|
|
-
|
|
|
- }
|
|
|
- .width('100%')
|
|
|
- .height('30%')
|
|
|
- }.width('100%')
|
|
|
- .height('60%')
|
|
|
- .justifyContent(FlexAlign.Center)
|
|
|
- .alignItems(HorizontalAlign.Center)
|
|
|
-
|
|
|
- Blank()
|
|
|
- Button('打印条码')
|
|
|
- .fontColor($r('app.color.process_divider_white_color'))
|
|
|
- .fontSize($r('app.float.fontSize_20'))
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- .backgroundColor($r('app.color.blue_100'))
|
|
|
- .width(px2vp(292))
|
|
|
- .height(px2vp(80))
|
|
|
- .margin({ bottom: $r('app.float.topMargins_20') })
|
|
|
-
|
|
|
- }
|
|
|
- .width('100%')
|
|
|
- .height('49%')
|
|
|
- .borderRadius(px2vp(16))
|
|
|
- .backgroundColor($r('app.color.white_E3E5E7'))
|
|
|
- .margin({ bottom: $r('app.float.topMargins_20') })
|
|
|
+ // Column() {
|
|
|
+ // Text('条码打印')
|
|
|
+ // .fontSize($r('app.float.fontSize_30'))
|
|
|
+ // .fontWeight(FontWeight.Medium)
|
|
|
+ // .fontColor($r('app.color.black_90'))
|
|
|
+ // .textAlign(TextAlign.Start)
|
|
|
+ // .width('100%')
|
|
|
+ // .height('15%')
|
|
|
+ // .margin({ left: $r('app.float.leftMargins_30') })
|
|
|
+ // .onClick(() => {
|
|
|
+ // console.log("====", JSON.stringify(this.newMaterialBin))
|
|
|
+ // })
|
|
|
+ // Column() {
|
|
|
+ // Row({ space: 10 }) {
|
|
|
+ // Text('打印机状态')
|
|
|
+ // .fontSize($r('app.float.fontSize_20'))
|
|
|
+ // .fontWeight(FontWeight.Medium)
|
|
|
+ // .fontColor($r('app.color.black_60'))
|
|
|
+ // .textAlign(TextAlign.End)
|
|
|
+ // .width('40%')
|
|
|
+ // .height('100%')
|
|
|
+ // if (this.onlineStatus === 0) {
|
|
|
+ // Text().width(px2vp(12))
|
|
|
+ // .height(px2vp(12))
|
|
|
+ // .borderRadius(px2vp(50))
|
|
|
+ // .backgroundColor($r('app.color.green_100'))
|
|
|
+ // Text('在线')
|
|
|
+ // .fontSize($r('app.float.fontSize_20'))
|
|
|
+ // .fontWeight(FontWeight.Medium)
|
|
|
+ // .fontColor($r('app.color.black_90'))
|
|
|
+ // .textAlign(TextAlign.Start)
|
|
|
+ // .width('35%')
|
|
|
+ // .height('100%')
|
|
|
+ // } else if (this.onlineStatus === 1) {
|
|
|
+ //
|
|
|
+ // Text().width('5%')
|
|
|
+ // .height('30%')
|
|
|
+ // .borderRadius(px2vp(50))
|
|
|
+ // .backgroundColor($r('app.color.grey_100'))
|
|
|
+ // Text('不在线')
|
|
|
+ // .fontSize($r('app.float.fontSize_20'))
|
|
|
+ // .fontWeight(FontWeight.Medium)
|
|
|
+ // .fontColor($r('app.color.black_90'))
|
|
|
+ // .textAlign(TextAlign.Start)
|
|
|
+ // .width('35%')
|
|
|
+ // .height('100%')
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ // .width('100%')
|
|
|
+ // .height('30%')
|
|
|
+ //
|
|
|
+ // Row({ space: 10 }) {
|
|
|
+ // Text('打印机RFID编号')
|
|
|
+ // .fontSize($r('app.float.fontSize_20'))
|
|
|
+ // .fontWeight(FontWeight.Medium)
|
|
|
+ // .fontColor($r('app.color.black_60'))
|
|
|
+ // .textAlign(TextAlign.End)
|
|
|
+ // .width('40%')
|
|
|
+ // .height('100%')
|
|
|
+ // Text('6537289495783').width('40%')
|
|
|
+ // .height('30%')
|
|
|
+ // .borderRadius(px2vp(50))
|
|
|
+ // .fontColor($r('app.color.blue_100'))
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ // .width('100%')
|
|
|
+ // .height('30%')
|
|
|
+ // }.width('100%')
|
|
|
+ // .height('60%')
|
|
|
+ // .justifyContent(FlexAlign.Center)
|
|
|
+ // .alignItems(HorizontalAlign.Center)
|
|
|
+ //
|
|
|
+ // Blank()
|
|
|
+ // Button('打印条码')
|
|
|
+ // .fontColor($r('app.color.process_divider_white_color'))
|
|
|
+ // .fontSize($r('app.float.fontSize_20'))
|
|
|
+ // .fontWeight(FontWeight.Medium)
|
|
|
+ // .backgroundColor($r('app.color.blue_100'))
|
|
|
+ // .width(px2vp(292))
|
|
|
+ // .height(px2vp(80))
|
|
|
+ // .margin({ bottom: $r('app.float.topMargins_20') })
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ // .width('100%')
|
|
|
+ // .height('49%')
|
|
|
+ // .borderRadius(px2vp(16))
|
|
|
+ // .backgroundColor($r('app.color.white_E3E5E7'))
|
|
|
+ // .margin({ bottom: $r('app.float.topMargins_20') })
|
|
|
|
|
|
Column() {
|
|
|
Text('写入RFID')
|