|
@@ -1,342 +0,0 @@
|
|
-import { BottomOperateComp } from '../common/component/BottomOperateComp'
|
|
|
|
-import { TaskComp } from '../common/component/TaskComp';
|
|
|
|
-import { TitleStateComp } from '../common/component/TitleStateComp'
|
|
|
|
-import CommonConstants from '../common/constants/CommonConstants';
|
|
|
|
-import OrderInfo from '../model/OrderInfo';
|
|
|
|
-import ProcessData from '../model/ProcessData';
|
|
|
|
-
|
|
|
|
-/*
|
|
|
|
- * 工序操作首页
|
|
|
|
- * */
|
|
|
|
-@Entry
|
|
|
|
-@Component
|
|
|
|
-struct ProcessHome {
|
|
|
|
-
|
|
|
|
- @State orderArray: OrderInfo[] = CommonConstants.ORDER_ARRAY;
|
|
|
|
- @State selectOrderId: number = 0
|
|
|
|
- @State processes: ProcessData[] = CommonConstants.PROCESS_ARRAY;
|
|
|
|
- @State selectProcess: number = 0
|
|
|
|
-
|
|
|
|
- aboutToAppear() {
|
|
|
|
- // todo 查询订单数据
|
|
|
|
- if (this.orderArray && this.orderArray.length > 0) {
|
|
|
|
- this.selectOrderId = this.orderArray[0].id
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- build() {
|
|
|
|
- Column() {
|
|
|
|
- TitleStateComp()
|
|
|
|
- Row() {
|
|
|
|
- // 订单展示
|
|
|
|
- Column() {
|
|
|
|
- Row() {
|
|
|
|
- Text('待完成的订单[' + (this.orderArray ? this.orderArray.length : 0) + ']')
|
|
|
|
- .titleFont()
|
|
|
|
- }
|
|
|
|
- .width('90%')
|
|
|
|
- .height('9%')
|
|
|
|
- .justifyContent(FlexAlign.Start)
|
|
|
|
- List({space: '2%'}) {
|
|
|
|
- ForEach(this.orderArray, (item: OrderInfo)=>{
|
|
|
|
- ListItem() {
|
|
|
|
- Column() {
|
|
|
|
- Row() {
|
|
|
|
- Text(item.orderName)
|
|
|
|
- .fontSize($r('app.float.process_card_middle_font_size'))
|
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
|
- .fontColor(this.selectOrderId === item.id ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
|
|
|
|
- .opacity(this.selectOrderId === item.id ? $r('app.float.card_font_select_opacity') : 1)
|
|
|
|
- }
|
|
|
|
- .width('90%')
|
|
|
|
- .height('15%')
|
|
|
|
- .justifyContent(FlexAlign.Start)
|
|
|
|
- .margin({ top: '2%' })
|
|
|
|
-
|
|
|
|
- Row() {
|
|
|
|
- Text('产品型号 ')
|
|
|
|
- .fontSize($r('app.float.process_card_small_font_size'))
|
|
|
|
- .fontColor(this.selectOrderId === item.id ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
|
|
|
|
- Text(item.productModel)
|
|
|
|
- .fontSize($r('app.float.process_card_small_font_size'))
|
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
|
- .fontColor(this.selectOrderId === item.id ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
|
|
|
|
- }
|
|
|
|
- .width('90%')
|
|
|
|
- .height('12.5%')
|
|
|
|
- .justifyContent(FlexAlign.Start)
|
|
|
|
-
|
|
|
|
- Row() {
|
|
|
|
- Text('计划编号 ')
|
|
|
|
- .fontSize($r('app.float.process_card_small_font_size'))
|
|
|
|
- .fontColor(this.selectOrderId === item.id ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
|
|
|
|
- Text(item.productModel)
|
|
|
|
- .fontSize($r('app.float.process_card_small_font_size'))
|
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
|
- .fontColor(this.selectOrderId === item.id ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
|
|
|
|
- }
|
|
|
|
- .width('90%')
|
|
|
|
- .height('12.5%')
|
|
|
|
- .justifyContent(FlexAlign.Start)
|
|
|
|
-
|
|
|
|
- Row() {
|
|
|
|
- Text('订单编号 ')
|
|
|
|
- .fontSize($r('app.float.process_card_small_font_size'))
|
|
|
|
- .fontColor(this.selectOrderId === item.id ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
|
|
|
|
- Text(item.orderCode)
|
|
|
|
- .fontSize($r('app.float.process_card_small_font_size'))
|
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
|
- .fontColor(this.selectOrderId === item.id ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
|
|
|
|
- }
|
|
|
|
- .width('90%')
|
|
|
|
- .height('12.5%')
|
|
|
|
- .justifyContent(FlexAlign.Start)
|
|
|
|
-
|
|
|
|
- Row() {
|
|
|
|
- Row() {}
|
|
|
|
- .width('5%')
|
|
|
|
- Column() {
|
|
|
|
- Text(item.orderNum.toString())
|
|
|
|
- .fontSize($r('app.float.process_card_large_font_size'))
|
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
|
- .fontColor(this.selectOrderId === item.id ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
|
|
|
|
- .padding({ bottom: '2%' })
|
|
|
|
- Text('订单数量')
|
|
|
|
- .fontSize($r('app.float.process_card_small_font_size'))
|
|
|
|
- .fontColor(this.selectOrderId === item.id ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
|
|
|
|
- }
|
|
|
|
- Row(){}
|
|
|
|
- .width('8%')
|
|
|
|
- Divider()
|
|
|
|
- .vertical(true)
|
|
|
|
- .color(this.selectOrderId === item.id ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
|
|
|
|
- .strokeWidth('1px')
|
|
|
|
- .opacity(this.selectOrderId === item.id ? 0.2 : 1)
|
|
|
|
- .height('60%')
|
|
|
|
- Row(){}
|
|
|
|
- .width('8%')
|
|
|
|
-
|
|
|
|
- Column() {
|
|
|
|
- Text(item.kittingNum.toString())
|
|
|
|
- .fontSize($r('app.float.process_card_large_font_size'))
|
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
|
- .fontColor(this.selectOrderId === item.id ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
|
|
|
|
- .padding({ bottom: '2%' })
|
|
|
|
- Text('主料齐套')
|
|
|
|
- .fontSize($r('app.float.process_card_small_font_size'))
|
|
|
|
- .fontColor(this.selectOrderId === item.id ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
|
|
|
|
- }
|
|
|
|
- Blank()
|
|
|
|
-
|
|
|
|
- Row() {
|
|
|
|
- Text(item.orderState === 1 ? '未开始' : (item.orderState === 2 ? '生产中' : '已完成'))
|
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
|
- .textAlign(TextAlign.Center)
|
|
|
|
- .fontSize($r('app.float.process_card_small_font_size'))
|
|
|
|
- .fontColor($r('app.color.general_font_white_color'))
|
|
|
|
- .borderRadius({topLeft: $r('app.float.general_border_radius'), bottomRight: $r('app.float.general_border_radius')})
|
|
|
|
- .backgroundColor(item.orderState === 1 ? $r('app.color.order_wait_state_background') : (item.orderState === 2 ? $r('app.color.order_producing_state_background') : $r('app.color.order_finished_state_background')))
|
|
|
|
- .width($r('app.float.order_state_width'))
|
|
|
|
- .height($r('app.float.order_state_height'))
|
|
|
|
- }
|
|
|
|
- .height('100%')
|
|
|
|
- .layoutWeight(1)
|
|
|
|
- .alignItems(VerticalAlign.Bottom)
|
|
|
|
- .justifyContent(FlexAlign.End)
|
|
|
|
- }
|
|
|
|
- .width('100%')
|
|
|
|
- .justifyContent(FlexAlign.Start)
|
|
|
|
- .layoutWeight(1)
|
|
|
|
- }
|
|
|
|
- .justifyContent(FlexAlign.Center)
|
|
|
|
- // .alignItems(HorizontalAlign.Center)
|
|
|
|
- .onClick(() => {
|
|
|
|
- this.selectOrderId = item.id
|
|
|
|
- // todo 查询当前工序
|
|
|
|
- })
|
|
|
|
- .width('90%')
|
|
|
|
- .height('26.5%')
|
|
|
|
- .borderRadius($r('app.float.general_border_radius'))
|
|
|
|
- .backgroundColor(this.selectOrderId === item.id ? $r('app.color.order_select_background') : $r('app.color.general_card_background_color'))
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- .alignListItem(ListItemAlign.Center)
|
|
|
|
- }
|
|
|
|
- .width('26%')
|
|
|
|
- .height('100%')
|
|
|
|
-
|
|
|
|
- // 工序
|
|
|
|
- Column() {
|
|
|
|
- Row() {
|
|
|
|
- Text('工序[' + (this.processes && this.processes.length ? this.processes.length : 0) + ']')
|
|
|
|
- .titleFont()
|
|
|
|
- }
|
|
|
|
- .width('100%')
|
|
|
|
- .height('9%')
|
|
|
|
-
|
|
|
|
- List() {
|
|
|
|
- ForEach(this.processes, (item: ProcessData, index: number) => {
|
|
|
|
- ListItem() {
|
|
|
|
- Column() {
|
|
|
|
- Row({ space: 4 }) {
|
|
|
|
- Stack() {
|
|
|
|
- Circle()
|
|
|
|
- .width('100%')
|
|
|
|
- .height('100%')
|
|
|
|
- .fillOpacity(0)
|
|
|
|
- .strokeWidth('3px')
|
|
|
|
- .stroke(this.selectProcess === item.sortNum ? $r('app.color.general_font_white_color') : $r('app.color.process_sort_ring_color'))
|
|
|
|
- Row() {
|
|
|
|
- Text(JSON.stringify(item.sortNum))
|
|
|
|
- .fontSize($r('app.float.process_card_middle_font_size'))
|
|
|
|
- .fontColor(this.selectProcess === item.sortNum ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
|
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
|
- .padding({ right: 3 })
|
|
|
|
- }
|
|
|
|
- .width('100%')
|
|
|
|
- .height('100%')
|
|
|
|
- .alignItems(VerticalAlign.Center)
|
|
|
|
- .justifyContent(FlexAlign.Center)
|
|
|
|
- }
|
|
|
|
- .width('26%')
|
|
|
|
- .height('100%')
|
|
|
|
- .padding({ top: 1})
|
|
|
|
-
|
|
|
|
- Text(item.processName)
|
|
|
|
- .fontSize($r('app.float.process_card_middle_font_size'))
|
|
|
|
- .fontColor(this.selectProcess === item.sortNum ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
|
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
|
- Blank()
|
|
|
|
- Text(item.completedQuantity.toString())
|
|
|
|
- .fontSize($r('app.float.process_card_middle_font_size'))
|
|
|
|
- .fontColor(this.selectProcess === item.sortNum ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
|
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
|
- }
|
|
|
|
- .width('100%')
|
|
|
|
- .height('91%')
|
|
|
|
- .justifyContent(FlexAlign.Start)
|
|
|
|
- .backgroundColor(this.selectProcess === item.sortNum ? $r('app.color.order_select_background') : $r('app.color.general_card_background_color'))
|
|
|
|
- .borderRadius('187px')
|
|
|
|
- .padding({ right: '5%' })
|
|
|
|
- .onClick(() => {
|
|
|
|
- this.selectProcess = item.sortNum
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- if (index < this.processes.length - 1) {
|
|
|
|
- Row() {
|
|
|
|
- Divider()
|
|
|
|
- .vertical(true)
|
|
|
|
- .color($r('app.color.divider_horizontal_color'))
|
|
|
|
- .strokeWidth('3px')
|
|
|
|
- .padding({ right: 3 })
|
|
|
|
- }
|
|
|
|
- .justifyContent(FlexAlign.Center)
|
|
|
|
- .width('19%')
|
|
|
|
- .layoutWeight(1)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- .width('100%')
|
|
|
|
- .height('15%')
|
|
|
|
- .alignItems(HorizontalAlign.Start)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- .width('100%')
|
|
|
|
- .layoutWeight(1)
|
|
|
|
-
|
|
|
|
- Row() {
|
|
|
|
- Button('叫主料', { type: ButtonType.Normal })
|
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
|
- .fontColor($r('app.color.general_font_white_color'))
|
|
|
|
- .fontSize($r('app.float.process_card_middle_font_size'))
|
|
|
|
- .width('100%')
|
|
|
|
- .height('67%')
|
|
|
|
- .borderRadius($r('app.float.robot_set_radius'))
|
|
|
|
- .backgroundColor($r('app.color.order_select_background'))
|
|
|
|
- }
|
|
|
|
- .width('100%')
|
|
|
|
- .height('17%')
|
|
|
|
- .justifyContent(FlexAlign.Center)
|
|
|
|
- }
|
|
|
|
- .width('23%')
|
|
|
|
- .height('100%')
|
|
|
|
-
|
|
|
|
- Column() {
|
|
|
|
- Row() {
|
|
|
|
- Text('任务')
|
|
|
|
- .titleFont()
|
|
|
|
- }
|
|
|
|
- .width('80%')
|
|
|
|
- .height('9%')
|
|
|
|
- Row() {
|
|
|
|
- TaskComp()
|
|
|
|
- }
|
|
|
|
- .width('60%')
|
|
|
|
- .height('36%')
|
|
|
|
- Row() {
|
|
|
|
- Text('扫码')
|
|
|
|
- .titleFont()
|
|
|
|
- }
|
|
|
|
- .width('80%')
|
|
|
|
- .height('9%')
|
|
|
|
-
|
|
|
|
- Row() {
|
|
|
|
- Image($r('app.media.scan_qr'))
|
|
|
|
- .height('60%')
|
|
|
|
- }
|
|
|
|
- .width('80%')
|
|
|
|
- .height('25%')
|
|
|
|
- .justifyContent(FlexAlign.Center)
|
|
|
|
- Row() {
|
|
|
|
- Row() {
|
|
|
|
- Row() {
|
|
|
|
- Image($r('app.media.qr_code'))
|
|
|
|
- .height('31%')
|
|
|
|
- }
|
|
|
|
- .width('8%')
|
|
|
|
- .justifyContent(FlexAlign.End)
|
|
|
|
-
|
|
|
|
- TextInput({ placeholder: '请扫描物料编码' })
|
|
|
|
- .placeholderColor($r('app.color.text_input_placeholder_font_color'))
|
|
|
|
- .placeholderFont({size: $r('app.float.robot_set_font_size'), weight: FontWeight.Medium})
|
|
|
|
- .fontSize($r('app.float.robot_set_font_size'))
|
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
|
- .fontColor($r('app.color.general_font_color'))
|
|
|
|
- .textAlign(TextAlign.Start)
|
|
|
|
- .height('100%')
|
|
|
|
- .layoutWeight(1)
|
|
|
|
- .maxLength(100)
|
|
|
|
- .borderRadius($r('app.float.robot_set_radius'))
|
|
|
|
- .backgroundColor($r('app.color.general_font_white_color'))
|
|
|
|
- }
|
|
|
|
- .borderRadius($r('app.float.robot_set_radius'))
|
|
|
|
- .backgroundColor($r('app.color.general_font_white_color'))
|
|
|
|
- .width('100%')
|
|
|
|
- .height('87%')
|
|
|
|
- }
|
|
|
|
- .width('80%')
|
|
|
|
- .height('10%')
|
|
|
|
- .justifyContent(FlexAlign.Center)
|
|
|
|
- }
|
|
|
|
- .layoutWeight(1)
|
|
|
|
- .height('100%')
|
|
|
|
- }
|
|
|
|
- .backgroundColor($r('app.color.page_general_background'))
|
|
|
|
- .width('100%')
|
|
|
|
- .height('84%')
|
|
|
|
- BottomOperateComp()
|
|
|
|
- }
|
|
|
|
- .height('100%')
|
|
|
|
- .width('100%')
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// 统一的标题文字样式
|
|
|
|
-@Extend(Text) function titleFont(){
|
|
|
|
- .fontSize($r('app.float.title_font_size'))
|
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
|
- .fontColor($r('app.color.general_font_color'))
|
|
|
|
- .opacity($r('app.float.general_font_opacity'))
|
|
|
|
-}
|
|
|