|
@@ -0,0 +1,263 @@
|
|
|
+import ProcessRequest from '../common/util/request/ProcessRequest'
|
|
|
+import RequestParamModel from '../viewmodel/RequestParamModel'
|
|
|
+import WorkOrderInfo from '../viewmodel/WorkOrderInfo'
|
|
|
+import { WorkOrderPage } from '../viewmodel/WorkOrderPage'
|
|
|
+
|
|
|
+@CustomDialog
|
|
|
+export struct SwitchingProductDialog{
|
|
|
+ private scrollerMaterial: Scroller = new Scroller()
|
|
|
+ //工单列表
|
|
|
+ @State workOrderList: WorkOrderInfo[] = []
|
|
|
+ //选择的工单索引
|
|
|
+ @State selectedOrderIndex: number = -1
|
|
|
+ //扫描的工单号
|
|
|
+ @State scanOrderValue:string = ''
|
|
|
+ controller: CustomDialogController
|
|
|
+ onConfirm: () => void = () => {
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private onSelectOrder(index: number) {
|
|
|
+ this.selectedOrderIndex = index
|
|
|
+ }
|
|
|
+
|
|
|
+ aboutToAppear(): void {
|
|
|
+ }
|
|
|
+
|
|
|
+ build() {
|
|
|
+ Column() {
|
|
|
+ Column() {
|
|
|
+ Text("切换产品")
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
+ .fontSize($r('app.float.fontSize_38'))
|
|
|
+ }
|
|
|
+ .height('8%')
|
|
|
+ .width('100%')
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+
|
|
|
+ Row(){
|
|
|
+ Column(){
|
|
|
+ Row(){
|
|
|
+ Column({space:3}){
|
|
|
+ Text("卫星通导模块")
|
|
|
+ .fontSize($r('app.float.fontSize_24'))
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
+ Text("ASF-ASFA-ASD-FAS")
|
|
|
+ .fontSize($r('app.float.fontSize_12'))
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
+ .fontWeight(FontWeight.Lighter)
|
|
|
+ Row(){
|
|
|
+ Text("工单")
|
|
|
+ .fontSize($r('app.float.fontSize_16'))
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
+ .fontWeight(FontWeight.Lighter)
|
|
|
+ Text("123456789123456789")
|
|
|
+ .fontSize($r('app.float.fontSize_16'))
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .height('100%')
|
|
|
+ .width('70%')
|
|
|
+ .justifyContent(FlexAlign.End)
|
|
|
+ .alignItems(HorizontalAlign.Start)
|
|
|
+ Column(){
|
|
|
+ Row(){
|
|
|
+ Text('10/')
|
|
|
+ .fontSize($r('app.float.fontSize_38'))
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
+ Text('100')
|
|
|
+ .fontSize($r('app.float.fontSize_38'))
|
|
|
+ .fontColor($r('app.color.60FFFFFF'))
|
|
|
+ Text('片')
|
|
|
+ .fontSize($r('app.float.fontSize_16'))
|
|
|
+ .fontColor($r('app.color.60FFFFFF'))
|
|
|
+ .fontWeight(FontWeight.Lighter)
|
|
|
+ }
|
|
|
+ Text('当前工序已报工/计划')
|
|
|
+ .fontSize($r('app.float.fontSize_12'))
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
+ .fontWeight(FontWeight.Lighter)
|
|
|
+
|
|
|
+ }
|
|
|
+ .height('100%')
|
|
|
+ .width('30%')
|
|
|
+ .justifyContent(FlexAlign.End)
|
|
|
+ .alignItems(HorizontalAlign.End)
|
|
|
+ }
|
|
|
+ .height('10%')
|
|
|
+ .width('100%')
|
|
|
+ Row(){
|
|
|
+ CallOrderRadioButton()
|
|
|
+ }
|
|
|
+ .height('10%')
|
|
|
+ .width('80%')
|
|
|
+ .margin({right:'20%'})
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
+ Column(){
|
|
|
+
|
|
|
+ }
|
|
|
+ .height('80%')
|
|
|
+ .width('100%')
|
|
|
+
|
|
|
+ }
|
|
|
+ .height('100%')
|
|
|
+ .width('46%')
|
|
|
+ Divider()
|
|
|
+ .vertical(true)
|
|
|
+ .strokeWidth(1)
|
|
|
+ .color($r('app.color.15FFFFFF'))
|
|
|
+ .margin({ bottom: '2%'})
|
|
|
+ Column(){
|
|
|
+
|
|
|
+ }
|
|
|
+ .width('46%')
|
|
|
+ .height('100%')
|
|
|
+ }
|
|
|
+ .justifyContent(FlexAlign.SpaceEvenly)
|
|
|
+ .width('100%')
|
|
|
+ .height('81%')
|
|
|
+ .margin({ top: '2%'})
|
|
|
+
|
|
|
+ Column() {
|
|
|
+ Divider()
|
|
|
+ .vertical(false)
|
|
|
+ .strokeWidth(1)
|
|
|
+ .color($r('app.color.15FFFFFF'))
|
|
|
+ Row() {
|
|
|
+ Row() {
|
|
|
+ Text('取消')
|
|
|
+ .fontColor($r('app.color.60FFFFFF'))
|
|
|
+ .fontSize($r('app.float.fontSize_30'))
|
|
|
+ }
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .width('50%')
|
|
|
+ .onClick(() => this.controller.close())
|
|
|
+
|
|
|
+ Divider()
|
|
|
+ .vertical(true)
|
|
|
+ .strokeWidth(1)
|
|
|
+ .color($r('app.color.15FFFFFF'))
|
|
|
+ Row() {
|
|
|
+ Text('确定')
|
|
|
+ .fontColor($r('app.color.007AFF'))
|
|
|
+ .fontSize($r('app.float.fontSize_30'))
|
|
|
+ }
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .width('50%')
|
|
|
+ .onClick(() => {
|
|
|
+ if(this.selectedOrderIndex==-1) return
|
|
|
+ this.onConfirm();
|
|
|
+ this.controller.close();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .height('8%')
|
|
|
+
|
|
|
+ }
|
|
|
+ .height('71%')
|
|
|
+ .width('62%')
|
|
|
+ .backgroundColor($r('app.color.2A2A2A'))
|
|
|
+ .justifyContent(FlexAlign.End)
|
|
|
+ .alignItems(HorizontalAlign.Start)
|
|
|
+ .borderColor($r('app.color.000000'))
|
|
|
+ .borderWidth(1)
|
|
|
+ .borderRadius($r('app.float.virtualSize_16'))
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+@Component
|
|
|
+struct CallOrderButton{
|
|
|
+
|
|
|
+ @State isSelected: boolean = false
|
|
|
+ @Prop name:string = ''
|
|
|
+
|
|
|
+ build() {
|
|
|
+ Row(){
|
|
|
+ if(this.isSelected)
|
|
|
+ {
|
|
|
+ Circle()
|
|
|
+ .width($r('app.float.virtualSize_24'))
|
|
|
+ .height($r('app.float.virtualSize_24'))
|
|
|
+ .fillOpacity(0)
|
|
|
+ .strokeWidth(1)
|
|
|
+ .stroke($r('app.color.0A84FF'))
|
|
|
+ }else{
|
|
|
+ Circle()
|
|
|
+ .width($r('app.float.virtualSize_24'))
|
|
|
+ .height($r('app.float.virtualSize_24'))
|
|
|
+ .fillOpacity(0)
|
|
|
+ .strokeWidth(1)
|
|
|
+ .stroke($r('app.color.FFFFFF'))
|
|
|
+ }
|
|
|
+ Row(){}.width('10%')
|
|
|
+ Text(this.name)
|
|
|
+ .fontSize($r('app.float.fontSize_16'))
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
+
|
|
|
+ }
|
|
|
+ .backgroundColor(this.isSelected?$r('app.color.0A84FF'):$r('app.color.20FFFFFF'))
|
|
|
+ .width('100%')
|
|
|
+ .height('100%')
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .alignItems(VerticalAlign.Center)
|
|
|
+ .borderRadius($r('app.float.virtualSize_16'))
|
|
|
+ .onClick(() => {
|
|
|
+ this.isSelected = !this.isSelected
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+@Component
|
|
|
+struct CallOrderRadioButton {
|
|
|
+ @State selectedIndex: number = -1 // 初始未选中
|
|
|
+
|
|
|
+ build() {
|
|
|
+ Row() {
|
|
|
+ // 三个按钮(31%宽度 + 3%间距)
|
|
|
+ this.buildButton(0, '选项1')
|
|
|
+ this.buildButton(1, '选项2')
|
|
|
+ this.buildButton(2, '选项3')
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .height('55%')
|
|
|
+ }
|
|
|
+
|
|
|
+ @Builder
|
|
|
+ buildButton(index: number, text: string) {
|
|
|
+ Button() {
|
|
|
+ Row(){
|
|
|
+ if(this.selectedIndex === index)
|
|
|
+ {
|
|
|
+ Circle()
|
|
|
+ .width($r('app.float.virtualSize_24'))
|
|
|
+ .height($r('app.float.virtualSize_24'))
|
|
|
+ .fillOpacity(0)
|
|
|
+ .strokeWidth(1)
|
|
|
+ .stroke($r('app.color.0A84FF'))
|
|
|
+ }else{
|
|
|
+ Circle()
|
|
|
+ .width($r('app.float.virtualSize_24'))
|
|
|
+ .height($r('app.float.virtualSize_24'))
|
|
|
+ .fillOpacity(0)
|
|
|
+ .strokeWidth(1)
|
|
|
+ .stroke($r('app.color.FFFFFF'))
|
|
|
+ }
|
|
|
+ Row(){}.width('10%')
|
|
|
+ Text(text)
|
|
|
+ .fontSize($r('app.float.fontSize_16'))
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
+ }
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ }
|
|
|
+ .width('31%')
|
|
|
+ .backgroundColor(this.selectedIndex === index ? $r('app.color.0A84FF') : $r('app.color.20FFFFFF')) // 选中蓝/未选中灰
|
|
|
+ .borderRadius(16)
|
|
|
+ .margin({ right: index < 2 ? '3%' : 0 }) // 最后一个按钮不加右边距
|
|
|
+ .onClick(() => {
|
|
|
+ this.selectedIndex = index // 更新选中状态
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|