|
@@ -106,6 +106,15 @@ struct ProcessIndex {
|
|
|
@State seqList: WorkOrderSeq[] = []
|
|
|
// 设备每日点检
|
|
|
@State deviceChecks: ProcessDeviceDailyCheck[] = []
|
|
|
+ // 报工人信息
|
|
|
+ @State reporterList: ReportInfo[] = []
|
|
|
+ @State currentReporterIndex:number =0
|
|
|
+ @State currentReportNumIndex:number =0
|
|
|
+ @State currentDefectIndex:number =0
|
|
|
+ // mqtt是否连接
|
|
|
+ @State isConnected: boolean = false
|
|
|
+ // 当前订单扫码流水号数量
|
|
|
+ @State scanSeqNos: number = 0
|
|
|
|
|
|
private scrollerList: Scroller = new Scroller()
|
|
|
|
|
@@ -120,12 +129,7 @@ struct ProcessIndex {
|
|
|
@Provide('currentUserId') currentUserId: number = 0
|
|
|
// 报工人、报工流水号和不良流水号
|
|
|
@Provide('bindTaskSeq') bindTaskSeq: BindTaskSeq[] = []
|
|
|
- @State reporterList: ReportInfo[] = []
|
|
|
- @State currentReporterIndex:number =0
|
|
|
- @State currentReportNumIndex:number =0
|
|
|
- @State currentDefectIndex:number =0
|
|
|
- // mqtt是否连接
|
|
|
- @State isConnected: boolean = false
|
|
|
+
|
|
|
startWorkTime: string = ''
|
|
|
// 工位发生改变则可能需要重新选择工单
|
|
|
async refreshWorkOrder() {
|
|
@@ -176,6 +180,9 @@ struct ProcessIndex {
|
|
|
workOrderCode: this.selectWorkOder.workOrderCode!,
|
|
|
stationId: this.currentStationId
|
|
|
} as RequestParamModel)
|
|
|
+ if (!this.seqNo) {
|
|
|
+ this.seqNo = this.scanCode
|
|
|
+ }
|
|
|
this.opComponents = []
|
|
|
if (this.process && this.process.id) {
|
|
|
this.opComponents = await ProcessRequest.get(`/api/v1/process/opCompent/get/${this.selectOperationId!}/${this.process?.id!}`)
|
|
@@ -206,6 +213,7 @@ struct ProcessIndex {
|
|
|
}
|
|
|
seqNos.push(this.seqNo)
|
|
|
preferencesUtil.put(CommonConstants.PREFERENCE_INSTANCE_NAME, this.selectWorkOder.workOrderCode!, seqNos)
|
|
|
+ this.scanSeqNos = seqNos.length
|
|
|
if (!this.startWorkTime) {
|
|
|
this.startWorkTime = TimeUtil.getCurrentTime()
|
|
|
}
|
|
@@ -232,16 +240,23 @@ struct ProcessIndex {
|
|
|
sortNum: 0
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+ // 刷新当前工单已扫码流水号数量
|
|
|
+ async refreshScanSeqNos() {
|
|
|
+ let seqNoList: string[] = []
|
|
|
+ seqNoList = await preferencesUtil.get(CommonConstants.PREFERENCE_INSTANCE_NAME, this.selectWorkOder.workOrderCode!, seqNoList)
|
|
|
+ this.scanSeqNos = seqNoList.length
|
|
|
+ }
|
|
|
// 清除选中的相关数据(工单不做处理)
|
|
|
clearSelectData() {
|
|
|
this.selectOperationId = ''
|
|
|
this.seqNo = ''
|
|
|
+ this.scanCode = ''
|
|
|
this.seqList = []
|
|
|
this.scanState = 0
|
|
|
this.process = {}
|
|
|
this.opComponents = []
|
|
|
this.taskSeqArray = []
|
|
|
- preferencesUtil.clear(CommonConstants.PREFERENCE_INSTANCE_NAME)
|
|
|
this.handleAllClick()
|
|
|
}
|
|
|
|
|
@@ -340,6 +355,8 @@ struct ProcessIndex {
|
|
|
// 判断是否选中工单,未选择则选则工单
|
|
|
if (!this.selectWorkOder || !this.selectWorkOder.workOrderCode) {
|
|
|
this.selectOrderController.open()
|
|
|
+ } else {
|
|
|
+ this.refreshScanSeqNos()
|
|
|
}
|
|
|
//判断今日是否进行设备点检,否则先进行点检
|
|
|
this.deviceChecks = await ProcessRequest.post('/api/v1/process/deviceDailyCheck/list', {
|
|
@@ -569,13 +586,12 @@ struct ProcessIndex {
|
|
|
promptAction.showToast({
|
|
|
message: `${item.operationName}需要在${item.stationName}工位上生产`,
|
|
|
duration: 1500,
|
|
|
- bottom: 100
|
|
|
})
|
|
|
if (this.scanCode) {
|
|
|
// 未开工查询工序组件
|
|
|
this.getComponentsForNotStartWork()
|
|
|
}
|
|
|
- } else if (this.scanState === 0 && this.scanCode) {
|
|
|
+ } else if (this.scanState === 0 && this.seqNo) {
|
|
|
// 未开工查询工序组件
|
|
|
this.getComponentsForNotStartWork()
|
|
|
} else if (this.scanState === 1) {
|
|
@@ -729,6 +745,7 @@ struct ProcessIndex {
|
|
|
}
|
|
|
seqNos.push(this.seqNo)
|
|
|
preferencesUtil.put(CommonConstants.PREFERENCE_INSTANCE_NAME, this.selectWorkOder.workOrderCode, seqNos)
|
|
|
+ this.scanSeqNos = seqNos.length
|
|
|
})
|
|
|
}
|
|
|
.width('65%')
|
|
@@ -802,7 +819,7 @@ struct ProcessIndex {
|
|
|
selectOperationId: this.selectOperationId,
|
|
|
process: this.process,
|
|
|
})
|
|
|
- } else if (this.selectComponentType === '3' && this.scanState == 1) {
|
|
|
+ } else if (this.selectComponentType === '3' && this.scanState === 1) {
|
|
|
MultiMediaCollect({
|
|
|
seqNo: this.seqNo,
|
|
|
selectOperationId: this.selectOperationId,
|
|
@@ -908,10 +925,14 @@ struct ProcessIndex {
|
|
|
})
|
|
|
Column({ space: 2 }) {
|
|
|
Row() {
|
|
|
- Text((this.selectWorkOder && this.selectWorkOder.workOrderCode) ? parseInt(this.selectWorkOder.completeNum!) + '/' + parseInt(this.selectWorkOder.planNum) : '')
|
|
|
+ Text(this.scanSeqNos + '/')
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
+ Text((this.selectWorkOder && this.selectWorkOder.workOrderCode) ? parseInt(this.selectWorkOder.planNum).toString() : '')
|
|
|
+ .fontColor($r('app.color.60FFFFFF'))
|
|
|
+ .fontSize($r('app.float.fontSize_16'))
|
|
|
+ .fontWeight(FontWeight.Lighter)
|
|
|
}
|
|
|
.width('100%')
|
|
|
.height('50%')
|
|
@@ -1333,13 +1354,14 @@ struct ProcessIndex {
|
|
|
// 切换产品弹窗控制器
|
|
|
switchingProductDialogController: CustomDialogController = new CustomDialogController({
|
|
|
builder: SwitchingProductDialog({
|
|
|
- scanState:this.scanState,
|
|
|
- process:this.process,
|
|
|
+ scanState: this.scanState,
|
|
|
+ process: this.process,
|
|
|
scanSeqValue: this.scanCode,
|
|
|
- selectWorkOder:this.selectWorkOder,
|
|
|
- currentOperationId:this.selectOperationId,
|
|
|
- opComponents:this.opComponents,
|
|
|
- seqNo:this.seqNo,
|
|
|
+ selectWorkOder: this.selectWorkOder,
|
|
|
+ currentOperationId: this.selectOperationId,
|
|
|
+ opComponents: this.opComponents,
|
|
|
+ seqNo: this.seqNo,
|
|
|
+ scanSeqNos: this.scanSeqNos,
|
|
|
}),
|
|
|
autoCancel: true, // 点击遮罩关闭
|
|
|
customStyle: true,
|