|
@@ -6,12 +6,12 @@ import ProcessRequest from '../common/util/request/ProcessRequest';
|
|
|
import RequestParamModel from '../viewmodel/RequestParamModel';
|
|
|
import OperationInfo from '../viewmodel/process/OperationInfo';
|
|
|
import { SelectWorkOrderDialog } from '../view/SelectWorkOrderDialog';
|
|
|
-import { SwitchingProductDialog, taskSeqItem } from '../view/SwitchingProductDialog';
|
|
|
+import { SwitchProductDialog, taskSeqItem } from '../view/SwitchProductDialog';
|
|
|
import TaskSeqVO from '../viewmodel/process/TaskSeqInfo';
|
|
|
import promptAction from '@ohos.promptAction';
|
|
|
import { LoginInfoDialog } from '../view/LoginInfoDialog';
|
|
|
-import { SwitchingDeptDialog, SwitchingProductLineDialog, SwitchingStationDialog } from '../view/SwitchingStationViews';
|
|
|
-import { SwitchingUserDialog } from '../view/SwitchingUserDialog';
|
|
|
+import { SwitchDeptDialog, SwitchProductLineDialog, SwitchStationDialog } from '../view/SwitchStationDialog';
|
|
|
+import { SwitchUserDialog } from '../view/SwitchUserDialog';
|
|
|
import OperationComponent from '../viewmodel/process/OperationComponent';
|
|
|
import ProcessInfo from '../viewmodel/process/ProcessInfo';
|
|
|
import { MaterialCollectView } from '../view/process/MaterialCollectView';
|
|
@@ -46,6 +46,7 @@ import TimeUtil from '../common/util/TimeUtil';
|
|
|
import ProcessDeviceDailyCheck from '../viewmodel/process/ProcessDeviceDailyCheck';
|
|
|
import { DeviceCheckView } from '../view/process/DeviceCheckView';
|
|
|
import { ReportWorkHourRateDialog } from '../view/ReportWorkHourRateDialog';
|
|
|
+import { ConfirmDialog } from '../view/ConfirmDialog';
|
|
|
|
|
|
// 声明接受参数的类型
|
|
|
interface Params {
|
|
@@ -115,6 +116,8 @@ struct ProcessIndex {
|
|
|
@State isConnected: boolean = false
|
|
|
// 当前订单扫码流水号数量
|
|
|
@State scanSeqNos: number = 0
|
|
|
+ //所有流水号
|
|
|
+ allTaskSeq: TaskSeqVO[] = []
|
|
|
|
|
|
private scrollerList: Scroller = new Scroller()
|
|
|
|
|
@@ -140,6 +143,8 @@ struct ProcessIndex {
|
|
|
let queryRes = await ProcessRequest.post('/api/v1/plan/workOrder/taskPage2', {
|
|
|
stationId: this.currentStationId,
|
|
|
queryComplete: 0,
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 99999,
|
|
|
} as RequestParamModel) as WorkOrderPage;
|
|
|
this.workOrders = queryRes?.records??[]
|
|
|
if (this.workOrders) {
|
|
@@ -257,11 +262,12 @@ struct ProcessIndex {
|
|
|
this.process = {}
|
|
|
this.opComponents = []
|
|
|
this.taskSeqArray = []
|
|
|
- this.handleAllClick()
|
|
|
+ // this.handleAllClick()
|
|
|
}
|
|
|
|
|
|
handleAllClick():void {
|
|
|
this.onQueryTask([])
|
|
|
+ this.allTaskSeq = this.taskSeqArray
|
|
|
}
|
|
|
|
|
|
handleReportedClick():void{
|
|
@@ -719,19 +725,30 @@ struct ProcessIndex {
|
|
|
}
|
|
|
// 流转卡号是否有效
|
|
|
let seqNoFlag = false
|
|
|
- for (const element of this.taskSeqArray) {
|
|
|
+ for (const element of this.allTaskSeq) {
|
|
|
if (element.seqNo === this.scanCode) {
|
|
|
seqNoFlag = true
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if (!seqNoFlag) {
|
|
|
- promptAction.showToast({
|
|
|
- message: `${this.scanCode}不是有效的流水号`,
|
|
|
- duration: 1500,
|
|
|
- bottom: 100
|
|
|
- })
|
|
|
- this.scanCode = ''
|
|
|
+ let queryRes = await ProcessRequest.post('/api/v1/plan/workOrder/taskPage2', {
|
|
|
+ stationId: this.currentStationId,
|
|
|
+ seqNo: this.scanCode,
|
|
|
+ queryComplete: 0,
|
|
|
+ } as RequestParamModel) as WorkOrderPage;
|
|
|
+ this.workOrders = queryRes?.records ?? []
|
|
|
+ if (this.workOrders && this.workOrders.length > 0) {
|
|
|
+ this.switchWorkOrderController.open()
|
|
|
+ } else {
|
|
|
+ promptAction.showToast({
|
|
|
+ message: `${this.scanCode}不是有效的流水号`,
|
|
|
+ duration: 1500,
|
|
|
+ bottom: 100
|
|
|
+ })
|
|
|
+ this.scanCode = ''
|
|
|
+ return
|
|
|
+ }
|
|
|
return
|
|
|
}
|
|
|
// 查询工序组件
|
|
@@ -1149,9 +1166,9 @@ struct ProcessIndex {
|
|
|
scanState: this.scanState,
|
|
|
opComponents: this.opComponents,
|
|
|
selectComponentType: this.selectComponentType,
|
|
|
- searchDept:()=>{this.SwitchingDeptController.open()},
|
|
|
- searchStation:()=>{this.SwitchingStationController.open()},
|
|
|
- searchProductLine:()=>{this.SwitchingProductLineController.open()},
|
|
|
+ searchDept:()=>{this.SwitchDeptController.open()},
|
|
|
+ searchStation:()=>{this.SwitchStationController.open()},
|
|
|
+ searchProductLine:()=>{this.SwitchProductLineController.open()},
|
|
|
}),
|
|
|
autoCancel: true, // 点击遮罩关闭
|
|
|
customStyle: true,
|
|
@@ -1159,8 +1176,8 @@ struct ProcessIndex {
|
|
|
maskColor: 'rgba(0,0,0,0.8)', // 黑色遮罩
|
|
|
})
|
|
|
//切换部门弹窗控制器
|
|
|
- SwitchingDeptController: CustomDialogController = new CustomDialogController({
|
|
|
- builder: SwitchingDeptDialog({}),
|
|
|
+ SwitchDeptController: CustomDialogController = new CustomDialogController({
|
|
|
+ builder: SwitchDeptDialog({}),
|
|
|
autoCancel: true, // 点击遮罩关闭
|
|
|
customStyle: true,
|
|
|
alignment:DialogAlignment.Center,
|
|
@@ -1328,16 +1345,16 @@ struct ProcessIndex {
|
|
|
maskColor: 'rgba(0,0,0,0.8)',
|
|
|
})
|
|
|
// 切换产线弹窗控制器
|
|
|
- SwitchingProductLineController: CustomDialogController = new CustomDialogController({
|
|
|
- builder: SwitchingProductLineDialog({}),
|
|
|
+ SwitchProductLineController: CustomDialogController = new CustomDialogController({
|
|
|
+ builder: SwitchProductLineDialog({}),
|
|
|
autoCancel: true, // 点击遮罩关闭
|
|
|
customStyle: true,
|
|
|
alignment:DialogAlignment.Center,
|
|
|
maskColor: 'rgba(0,0,0,0.8)', // 黑色遮罩
|
|
|
})
|
|
|
// 切换工位弹窗控制器
|
|
|
- SwitchingStationController: CustomDialogController = new CustomDialogController({
|
|
|
- builder: SwitchingStationDialog({}),
|
|
|
+ SwitchStationController: CustomDialogController = new CustomDialogController({
|
|
|
+ builder: SwitchStationDialog({}),
|
|
|
autoCancel: true, // 点击遮罩关闭
|
|
|
customStyle: true,
|
|
|
alignment:DialogAlignment.Center,
|
|
@@ -1345,15 +1362,37 @@ struct ProcessIndex {
|
|
|
})
|
|
|
//切换用户弹窗控制器
|
|
|
switchingUserController: CustomDialogController = new CustomDialogController({
|
|
|
- builder: SwitchingUserDialog({}),
|
|
|
+ builder: SwitchUserDialog({}),
|
|
|
autoCancel: true, // 点击遮罩关闭
|
|
|
customStyle: true,
|
|
|
alignment:DialogAlignment.Center,
|
|
|
maskColor: 'rgba(0,0,0,0.8)', // 黑色遮罩
|
|
|
})
|
|
|
+ // 产品不属于当前工单时,切换工单确认弹窗控制器
|
|
|
+ switchWorkOrderController: CustomDialogController = new CustomDialogController({
|
|
|
+ builder: ConfirmDialog({
|
|
|
+ title: '切换工单确认',
|
|
|
+ message: '扫描的流水号不属于本工单,是否切换工单?',
|
|
|
+ onConfirm: ()=> {
|
|
|
+ this.selectWorkOder = this.workOrders[0]
|
|
|
+ this.selectOperationId = ''
|
|
|
+ this.seqNo = this.scanCode
|
|
|
+ this.seqList = []
|
|
|
+ this.scanState = 0
|
|
|
+ this.process = {}
|
|
|
+ this.opComponents = []
|
|
|
+ this.taskSeqArray = []
|
|
|
+ this.switchingProductDialogController.close()
|
|
|
+ },
|
|
|
+ }),
|
|
|
+ autoCancel: true,
|
|
|
+ alignment: DialogAlignment.Center,
|
|
|
+ // gridCount: 3,
|
|
|
+ customStyle: true,
|
|
|
+ })
|
|
|
// 切换产品弹窗控制器
|
|
|
switchingProductDialogController: CustomDialogController = new CustomDialogController({
|
|
|
- builder: SwitchingProductDialog({
|
|
|
+ builder: SwitchProductDialog({
|
|
|
scanState: this.scanState,
|
|
|
process: this.process,
|
|
|
scanSeqValue: this.scanCode,
|
|
@@ -1362,6 +1401,10 @@ struct ProcessIndex {
|
|
|
opComponents: this.opComponents,
|
|
|
seqNo: this.seqNo,
|
|
|
scanSeqNos: this.scanSeqNos,
|
|
|
+ workOrders: this.workOrders,
|
|
|
+ switchWorkOrderConfirm: ()=>{
|
|
|
+ this.switchWorkOrderController.open()
|
|
|
+ },
|
|
|
}),
|
|
|
autoCancel: true, // 点击遮罩关闭
|
|
|
customStyle: true,
|