|
@@ -5,7 +5,7 @@ import CommonConstants from '../common/constants/CommonConstants';
|
|
|
import ProcessRequest from '../common/util/request/ProcessRequest';
|
|
|
import RequestParamModel from '../viewmodel/RequestParamModel';
|
|
|
import OperationInfo from '../viewmodel/process/OperationInfo';
|
|
|
-import { SelectOrderDialog } from '../view/SelectOrderDialog';
|
|
|
+import { SelectWorkOrderDialog } from '../view/SelectWorkOrderDialog';
|
|
|
import { SwitchingProductDialog, taskSeqItem } from '../view/SwitchingProductDialog';
|
|
|
import TaskSeqVO from '../viewmodel/process/TaskSeqInfo';
|
|
|
import promptAction from '@ohos.promptAction';
|
|
@@ -22,72 +22,21 @@ struct ProcessIndex {
|
|
|
// 工单列表
|
|
|
@State workOrders: WorkOrderInfo[] = []
|
|
|
// 选中工单
|
|
|
- @State selectWorkOder: WorkOrderInfo = {workOrderCode:'32'}
|
|
|
+ @State selectWorkOder: WorkOrderInfo = {}
|
|
|
// 工位通知数量
|
|
|
@State noticeNum: number = 100
|
|
|
// 扫描或手动输入的流水/序列/铭牌号
|
|
|
@State scanCode: string = ''
|
|
|
// 当前流转卡号
|
|
|
- @State seqNo: string = '1'
|
|
|
+ @State seqNo: string = ''
|
|
|
// 选中工序id
|
|
|
- @State selectOperationId: string = '1'
|
|
|
+ @State selectOperationId: string = ''
|
|
|
//选择的按钮索引(默认加载全部)
|
|
|
@State selectedButtonIndex: number = 0
|
|
|
// 流转卡号信息集合
|
|
|
@State taskSeqArray: TaskSeqVO[] = []
|
|
|
// 工序组件(工步)
|
|
|
- @State opComponents: OperationComponent[] = [
|
|
|
- {
|
|
|
- compentName:'物料采集',
|
|
|
- compentType: '1',
|
|
|
- deleted:0,
|
|
|
- id:2415,
|
|
|
- operationId:'679',
|
|
|
- processRouteId:'0',
|
|
|
- remark:'',
|
|
|
- sortNum:0
|
|
|
- },
|
|
|
- {
|
|
|
- compentName:'ESOP',
|
|
|
- compentType:'4',
|
|
|
- deleted:0,
|
|
|
- id:2416,
|
|
|
- operationId:'679',
|
|
|
- processRouteId:'0',
|
|
|
- remark:'',
|
|
|
- sortNum:1
|
|
|
- },
|
|
|
- {
|
|
|
- compentName:'多媒体采集',
|
|
|
- compentType:'3',
|
|
|
- deleted:0,
|
|
|
- id:2417,
|
|
|
- operationId:'679',
|
|
|
- processRouteId:'0',
|
|
|
- remark:'',
|
|
|
- sortNum:2,
|
|
|
- },
|
|
|
- {
|
|
|
- compentName:'记录项',
|
|
|
- compentType:'2',
|
|
|
- deleted:0,
|
|
|
- id:2418,
|
|
|
- operationId:'679',
|
|
|
- processRouteId:'0',
|
|
|
- remark:'',
|
|
|
- sortNum:3,
|
|
|
- },
|
|
|
- {
|
|
|
- compentName:'设备记录',
|
|
|
- compentType:'6',
|
|
|
- deleted:0,
|
|
|
- id:2420,
|
|
|
- operationId:'679',
|
|
|
- processRouteId:'0',
|
|
|
- remark:'',
|
|
|
- sortNum:5
|
|
|
- },
|
|
|
- ]
|
|
|
+ @State opComponents: OperationComponent[] = []
|
|
|
// 选中的工序组件类型
|
|
|
@State selectComponentType: string = ''
|
|
|
// 工序组件状态数组(0:未完成)
|
|
@@ -110,28 +59,27 @@ struct ProcessIndex {
|
|
|
|
|
|
private scrollerList: Scroller = new Scroller()
|
|
|
|
|
|
- @State currentDept:string = ''
|
|
|
- @State currentProductLine:string = ''
|
|
|
- @State currentStation:string = ''
|
|
|
- @State currentPLCode:string = ''
|
|
|
- @State currentOrgId:number = 0
|
|
|
- @State currentStationId:string =''
|
|
|
- @State currentUserName :string =''
|
|
|
+ @Provide('currentDept') currentDept:string = ''
|
|
|
+ @Provide('currentProductLine') currentProductLine:string = ''
|
|
|
+ @Provide('currentStation') currentStation:string = ''
|
|
|
+ @Provide('currentPLCode') currentPLCode:string = ''
|
|
|
+ @Provide('currentOrgId') currentOrgId:number = 0
|
|
|
+ @Provide('currentStationId') currentStationId:string =''
|
|
|
+ @Provide('currentUserName') currentUserName :string =''
|
|
|
|
|
|
+ // 选择工单弹窗控制器
|
|
|
selectOrderController: CustomDialogController = new CustomDialogController({
|
|
|
- builder: SelectOrderDialog({}),
|
|
|
+ builder: SelectWorkOrderDialog({
|
|
|
+ selectWorkOder: this.selectWorkOder
|
|
|
+ }),
|
|
|
autoCancel: true, // 点击遮罩关闭
|
|
|
customStyle: true,
|
|
|
+ // alignment:DialogAlignment.Center,
|
|
|
maskColor: 'rgba(0,0,0,0.8)', // 黑色遮罩
|
|
|
})
|
|
|
-
|
|
|
+ // 选择工位和用户弹窗控制器
|
|
|
StationInfoController: CustomDialogController = new CustomDialogController({
|
|
|
builder: StationInfoDialog({
|
|
|
- currentDept:this.currentDept,
|
|
|
- currentProductLine:this.currentProductLine,
|
|
|
- currentStation:this.currentStation,
|
|
|
- currentPLCode:this.currentPLCode,
|
|
|
- currentUserName:this.currentUserName,
|
|
|
searchDept:()=>{this.SwitchingDeptController.open()},
|
|
|
searchStation:()=>{this.SwitchingStationController.open()},
|
|
|
searchProductLine:()=>{this.SwitchingProductLineController.open()},
|
|
@@ -141,48 +89,35 @@ struct ProcessIndex {
|
|
|
customStyle: true,
|
|
|
maskColor: 'rgba(0,0,0,0.8)', // 黑色遮罩
|
|
|
})
|
|
|
-
|
|
|
+ //切换部门弹窗控制器
|
|
|
SwitchingDeptController: CustomDialogController = new CustomDialogController({
|
|
|
- builder: SwitchingDeptDialog({
|
|
|
- currentDept:this.currentDept,
|
|
|
- currentOrgId:this.currentOrgId
|
|
|
- }),
|
|
|
+ builder: SwitchingDeptDialog({}),
|
|
|
autoCancel: true, // 点击遮罩关闭
|
|
|
customStyle: true,
|
|
|
maskColor: 'rgba(0,0,0,0.8)', // 黑色遮罩
|
|
|
})
|
|
|
+ // 切换产线弹窗控制器
|
|
|
SwitchingProductLineController: CustomDialogController = new CustomDialogController({
|
|
|
- builder: SwitchingProductLineDialog({
|
|
|
- currentProductLine:this.currentProductLine,
|
|
|
- currentPLCode:this.currentPLCode
|
|
|
- }),
|
|
|
+ builder: SwitchingProductLineDialog({}),
|
|
|
autoCancel: true, // 点击遮罩关闭
|
|
|
customStyle: true,
|
|
|
maskColor: 'rgba(0,0,0,0.8)', // 黑色遮罩
|
|
|
})
|
|
|
+ // 切换工位弹窗控制器
|
|
|
SwitchingStationController: CustomDialogController = new CustomDialogController({
|
|
|
- builder: SwitchingStationDialog({
|
|
|
- currentStation:this.currentStation,
|
|
|
- currentPLCode:this.currentPLCode,
|
|
|
- currentStationId:this.currentStationId
|
|
|
- }),
|
|
|
+ builder: SwitchingStationDialog({}),
|
|
|
autoCancel: true, // 点击遮罩关闭
|
|
|
customStyle: true,
|
|
|
maskColor: 'rgba(0,0,0,0.8)', // 黑色遮罩
|
|
|
})
|
|
|
-
|
|
|
+ //切换用户弹窗控制器
|
|
|
switchingUserController: CustomDialogController = new CustomDialogController({
|
|
|
- builder: SwitchingUserDialog({
|
|
|
- currentOrgId:this.currentOrgId,
|
|
|
- currentPLCode:this.currentPLCode,
|
|
|
- currentStationId:this.currentStationId,
|
|
|
- currentUserName:this.currentUserName
|
|
|
- }),
|
|
|
+ builder: SwitchingUserDialog({}),
|
|
|
autoCancel: true, // 点击遮罩关闭
|
|
|
customStyle: true,
|
|
|
maskColor: 'rgba(0,0,0,0.8)', // 黑色遮罩
|
|
|
})
|
|
|
-
|
|
|
+ // 切换产品弹窗控制器
|
|
|
switchingProductDialogController: CustomDialogController = new CustomDialogController({
|
|
|
builder: SwitchingProductDialog({
|
|
|
scanSeqValue: this.scanCode
|
|
@@ -194,14 +129,23 @@ struct ProcessIndex {
|
|
|
|
|
|
|
|
|
handleAllClick():void {
|
|
|
+ if (!this.selectWorkOder.workOrderCode || !this.currentUserName || !this.currentStationId) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.onQueryTask([])
|
|
|
}
|
|
|
|
|
|
handleReportedClick():void{
|
|
|
+ if (!this.selectWorkOder.workOrderCode || !this.currentUserName || !this.currentStationId) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.onQueryTask([2])
|
|
|
}
|
|
|
|
|
|
handleUnreportedClick():void{
|
|
|
+ if (!this.selectWorkOder.workOrderCode || !this.currentUserName || !this.currentStationId) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.onQueryTask([-1,0,1])
|
|
|
}
|
|
|
|
|
@@ -307,11 +251,11 @@ struct ProcessIndex {
|
|
|
Row() {
|
|
|
Row().width('5.6%')
|
|
|
Column() {
|
|
|
- Text(CommonConstants.STATION_NANE)
|
|
|
+ Text(this.currentStation)
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
- Text(CommonConstants.USER_NAME)
|
|
|
+ Text(this.currentUserName)
|
|
|
.fontSize($r('app.float.fontSize_12'))
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
@@ -341,6 +285,9 @@ struct ProcessIndex {
|
|
|
.height('8.1%')
|
|
|
.backgroundColor($r('app.color.20FFFFFF'))
|
|
|
.borderRadius($r('app.float.fontSize_16'))
|
|
|
+ .onClick(()=>{
|
|
|
+ this.StationInfoController.open()
|
|
|
+ })
|
|
|
// 工序
|
|
|
Column({space: 4}) {
|
|
|
Row() {
|
|
@@ -394,6 +341,9 @@ struct ProcessIndex {
|
|
|
.backgroundImage(this.selectOperationId === item.operationId ? $r('app.media.process_select_operation') : $r('app.media.process_no_select_operation'))
|
|
|
.backgroundImageSize(ImageSize.Cover)
|
|
|
.onClick(() => {
|
|
|
+ if (!this.selectWorkOder.workOrderCode || !this.currentUserName || !this.currentStationId) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.selectOperationId = item.operationId!
|
|
|
if (!item.exists) {
|
|
|
promptAction.showToast({
|
|
@@ -433,7 +383,7 @@ struct ProcessIndex {
|
|
|
.height('77.2%')
|
|
|
.backgroundColor($r('app.color.20FFFFFF'))
|
|
|
.borderRadius($r('app.float.fontSize_16'))
|
|
|
- .opacity(!this.seqNo || !CommonConstants.USER_ID || !CommonConstants.STATION_ID ? 0.3 : 1)
|
|
|
+ .opacity(!this.selectWorkOder.workOrderCode || !this.currentUserName || !this.currentStationId ? 0.3 : 1)
|
|
|
}
|
|
|
.height('100%')
|
|
|
.width('19.8%')
|
|
@@ -509,9 +459,15 @@ struct ProcessIndex {
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.enableKeyboardOnFocus(false)
|
|
|
.onChange((value: string) => {
|
|
|
+ if (!this.selectWorkOder.workOrderCode || !this.currentUserName || !this.currentStationId) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.scanCode = value
|
|
|
})
|
|
|
.onSubmit(async () => {
|
|
|
+ if (!this.selectWorkOder.workOrderCode || !this.currentUserName || !this.currentStationId) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.opComponents = await ProcessRequest.get('/api/v1/op/compent/get/' + this.selectOperationId)
|
|
|
})
|
|
|
}
|
|
@@ -533,7 +489,7 @@ struct ProcessIndex {
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
.backgroundColor($r('app.color.20FFFFFF'))
|
|
|
.borderRadius($r('app.float.fontSize_16'))
|
|
|
- .opacity(!this.seqNo || !CommonConstants.USER_ID || !CommonConstants.STATION_ID ? 0.3 : 1)
|
|
|
+ .opacity(!this.selectWorkOder.workOrderCode || !this.currentUserName || !this.currentStationId ? 0.3 : 1)
|
|
|
} else {
|
|
|
Column() {
|
|
|
List ({space: 4}) {
|
|
@@ -699,7 +655,7 @@ struct ProcessIndex {
|
|
|
.backgroundColor($r('app.color.20FFFFFF'))
|
|
|
.borderRadius($r('app.float.fontSize_16'))
|
|
|
.onClick(()=>{
|
|
|
- if (!this.seqNo || !CommonConstants.USER_ID || !CommonConstants.STATION_ID) {
|
|
|
+ if (!this.selectWorkOder.workOrderCode || !this.currentUserName || !this.currentStationId) {
|
|
|
return
|
|
|
}
|
|
|
this.switchingProductDialogController.open()
|
|
@@ -759,7 +715,7 @@ struct ProcessIndex {
|
|
|
.height('90.6%')
|
|
|
.width('100%')
|
|
|
.padding({left: '2.6%', right: '2.6%'})
|
|
|
- .opacity(!this.seqNo || !CommonConstants.USER_ID || !CommonConstants.STATION_ID ? 0.3 : 1)
|
|
|
+ .opacity(!this.selectWorkOder.workOrderCode || !this.currentUserName || !this.currentStationId ? 0.3 : 1)
|
|
|
}
|
|
|
.width('100%')
|
|
|
.height('9.8%')
|