|
@@ -21,13 +21,14 @@ import { CompleteReceiveDialog } from '../view/CompleteReceiveDialog';
|
|
import { WorkInstructionsDialog } from '../view/WorkInstructionsDialog';
|
|
import { WorkInstructionsDialog } from '../view/WorkInstructionsDialog';
|
|
import connection from '@ohos.net.connection';
|
|
import connection from '@ohos.net.connection';
|
|
import { ReportWorkNumDialog } from '../view/ReportWorkNumDialog';
|
|
import { ReportWorkNumDialog } from '../view/ReportWorkNumDialog';
|
|
-import { ProcessReportingDialog } from '../view/ProcessReportingDialog';
|
|
|
|
|
|
+import { ReportPieceworkDialog } from '../view/ReportPieceworkDialog';
|
|
|
|
+import { ReportTimeBasedDialog } from '../view/ReportTimeBasedDialog';
|
|
import { JoinPersonNameDialog } from '../view/JoinPersonNameDialog';
|
|
import { JoinPersonNameDialog } from '../view/JoinPersonNameDialog';
|
|
-import ReportInfo from '../viewmodel/ReportInfo';
|
|
|
|
-import { BindTaskSeqVO } from '../viewmodel/process/BindTaskSeqVO';
|
|
|
|
|
|
+import ReportInfo from '../viewmodel/process/ReporterInfo';
|
|
|
|
+import { BindTaskSeq } from '../viewmodel/process/BindTaskSeq';
|
|
import { MqttClientOptions, MqttConnectOptions } from '@ohos/mqtt';
|
|
import { MqttClientOptions, MqttConnectOptions } from '@ohos/mqtt';
|
|
import MqttManager from '../common/util/mqtt';
|
|
import MqttManager from '../common/util/mqtt';
|
|
-import { DefectNumReportDialog } from '../view/DefectNumReportDialog';
|
|
|
|
|
|
+import { ReportDefectNumDialog } from '../view/ReportDefectNumDialog';
|
|
import { SelfInspectView } from '../view/process/SelfInspectView';
|
|
import { SelfInspectView } from '../view/process/SelfInspectView';
|
|
import { MultiMediaCollect } from '../view/process/MultiMediaCollect';
|
|
import { MultiMediaCollect } from '../view/process/MultiMediaCollect';
|
|
import { BarcodeAssociationDialog } from '../view/BarcodeAssociationDialog';
|
|
import { BarcodeAssociationDialog } from '../view/BarcodeAssociationDialog';
|
|
@@ -44,6 +45,7 @@ import preferencesUtil from '../common/util/PerferencesUtil';
|
|
import TimeUtil from '../common/util/TimeUtil';
|
|
import TimeUtil from '../common/util/TimeUtil';
|
|
import ProcessDeviceDailyCheck from '../viewmodel/process/ProcessDeviceDailyCheck';
|
|
import ProcessDeviceDailyCheck from '../viewmodel/process/ProcessDeviceDailyCheck';
|
|
import { DeviceCheckView } from '../view/process/DeviceCheckView';
|
|
import { DeviceCheckView } from '../view/process/DeviceCheckView';
|
|
|
|
+import { ReportWorkHourRateDialog } from '../view/ReportWorkHourRateDialog';
|
|
|
|
|
|
// 声明接受参数的类型
|
|
// 声明接受参数的类型
|
|
interface Params {
|
|
interface Params {
|
|
@@ -65,7 +67,7 @@ struct ProcessIndex {
|
|
// 当前流转卡号
|
|
// 当前流转卡号
|
|
@State seqNo: string = ''
|
|
@State seqNo: string = ''
|
|
//是否打开底部抽屉
|
|
//是否打开底部抽屉
|
|
- @State isAuxiliaryViewOpen:boolean = false
|
|
|
|
|
|
+ @State isAuxiliaryViewOpen: boolean = false
|
|
// 选中工序id
|
|
// 选中工序id
|
|
@State selectOperationId: string = ''
|
|
@State selectOperationId: string = ''
|
|
// 绩效模式(0:计时 1:计件)
|
|
// 绩效模式(0:计时 1:计件)
|
|
@@ -117,13 +119,14 @@ struct ProcessIndex {
|
|
@Provide('currentUserName') currentUserName: string =''
|
|
@Provide('currentUserName') currentUserName: string =''
|
|
@Provide('currentUserId') currentUserId: number = 0
|
|
@Provide('currentUserId') currentUserId: number = 0
|
|
// 报工人、报工流水号和不良流水号
|
|
// 报工人、报工流水号和不良流水号
|
|
- @Provide('bindTaskSeq') bindTaskSeq: BindTaskSeqVO[] = []
|
|
|
|
- @State reportList: ReportInfo[] = []
|
|
|
|
|
|
+ @Provide('bindTaskSeq') bindTaskSeq: BindTaskSeq[] = []
|
|
|
|
+ @State reporterList: ReportInfo[] = []
|
|
@State currentReporterIndex:number =0
|
|
@State currentReporterIndex:number =0
|
|
@State currentReportNumIndex:number =0
|
|
@State currentReportNumIndex:number =0
|
|
@State currentDefectIndex:number =0
|
|
@State currentDefectIndex:number =0
|
|
// mqtt是否连接
|
|
// mqtt是否连接
|
|
@State isConnected: boolean = false
|
|
@State isConnected: boolean = false
|
|
|
|
+ startWorkTime: string = ''
|
|
// 工位发生改变则可能需要重新选择工单
|
|
// 工位发生改变则可能需要重新选择工单
|
|
async refreshWorkOrder() {
|
|
async refreshWorkOrder() {
|
|
if (!this.selectWorkOder || !this.selectWorkOder.workOrderCode) {
|
|
if (!this.selectWorkOder || !this.selectWorkOder.workOrderCode) {
|
|
@@ -203,6 +206,9 @@ struct ProcessIndex {
|
|
}
|
|
}
|
|
seqNos.push(this.seqNo)
|
|
seqNos.push(this.seqNo)
|
|
preferencesUtil.put(CommonConstants.PREFERENCE_INSTANCE_NAME, this.selectWorkOder.workOrderCode!, seqNos)
|
|
preferencesUtil.put(CommonConstants.PREFERENCE_INSTANCE_NAME, this.selectWorkOder.workOrderCode!, seqNos)
|
|
|
|
+ if (!this.startWorkTime) {
|
|
|
|
+ this.startWorkTime = TimeUtil.getCurrentTime()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// 未开工查询工序组件(工步)
|
|
// 未开工查询工序组件(工步)
|
|
async getComponentsForNotStartWork() {
|
|
async getComponentsForNotStartWork() {
|
|
@@ -235,6 +241,7 @@ struct ProcessIndex {
|
|
this.process = {}
|
|
this.process = {}
|
|
this.opComponents = []
|
|
this.opComponents = []
|
|
this.taskSeqArray = []
|
|
this.taskSeqArray = []
|
|
|
|
+ preferencesUtil.clear(CommonConstants.PREFERENCE_INSTANCE_NAME)
|
|
this.handleAllClick()
|
|
this.handleAllClick()
|
|
}
|
|
}
|
|
|
|
|
|
@@ -299,7 +306,6 @@ struct ProcessIndex {
|
|
}
|
|
}
|
|
|
|
|
|
onPageShow() {
|
|
onPageShow() {
|
|
- console.log('hhtest', '------------------------------')
|
|
|
|
const params = router.getParams() as Params; // 获取传递过来的参数对象
|
|
const params = router.getParams() as Params; // 获取传递过来的参数对象
|
|
if (params && params.auxiliaryOperationFlag) {
|
|
if (params && params.auxiliaryOperationFlag) {
|
|
this.isAuxiliaryViewOpen = true
|
|
this.isAuxiliaryViewOpen = true
|
|
@@ -992,7 +998,7 @@ struct ProcessIndex {
|
|
this.scanState = 1
|
|
this.scanState = 1
|
|
// this.scanCodeToStartWork()
|
|
// this.scanCodeToStartWork()
|
|
} else if (this.scanState === 1) {
|
|
} else if (this.scanState === 1) {
|
|
- this.processReportingController.open()
|
|
|
|
|
|
+ this.reportTimeBasedController.open()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -1142,14 +1148,14 @@ struct ProcessIndex {
|
|
// 工序报工-报工数量弹窗
|
|
// 工序报工-报工数量弹窗
|
|
ReportWorkNumController: CustomDialogController = new CustomDialogController({
|
|
ReportWorkNumController: CustomDialogController = new CustomDialogController({
|
|
builder: ReportWorkNumDialog({
|
|
builder: ReportWorkNumDialog({
|
|
- userName: this.reportList[this.currentReportNumIndex].userName,
|
|
|
|
|
|
+ userName: this.reporterList[this.currentReportNumIndex].userName,
|
|
currentOperationId: this.selectOperationId,
|
|
currentOperationId: this.selectOperationId,
|
|
currentWorkOrderCode: this.selectWorkOder.workOrderCode!,
|
|
currentWorkOrderCode: this.selectWorkOder.workOrderCode!,
|
|
onConfirm:(num:number)=>{
|
|
onConfirm:(num:number)=>{
|
|
const index = this.currentReportNumIndex;
|
|
const index = this.currentReportNumIndex;
|
|
- if (this.reportList[index]) {
|
|
|
|
- this.reportList[index].reportNum = String(num);
|
|
|
|
- this.reportList = [...this.reportList];
|
|
|
|
|
|
+ if (this.reporterList[index]) {
|
|
|
|
+ this.reporterList[index].reportNum = String(num);
|
|
|
|
+ this.reporterList = [...this.reporterList];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}),
|
|
}),
|
|
@@ -1160,13 +1166,13 @@ struct ProcessIndex {
|
|
})
|
|
})
|
|
// 工序报工-不良品报工弹窗
|
|
// 工序报工-不良品报工弹窗
|
|
defectNumReportController: CustomDialogController = new CustomDialogController({
|
|
defectNumReportController: CustomDialogController = new CustomDialogController({
|
|
- builder: DefectNumReportDialog({
|
|
|
|
- userName: this.reportList[this.currentDefectIndex].userName,
|
|
|
|
|
|
+ builder: ReportDefectNumDialog({
|
|
|
|
+ userName: this.reporterList[this.currentDefectIndex].userName,
|
|
onConfirm:(num:number)=>{
|
|
onConfirm:(num:number)=>{
|
|
const index = this.currentDefectIndex;
|
|
const index = this.currentDefectIndex;
|
|
- if (this.reportList[index]) {
|
|
|
|
- this.reportList[index].defectNum = String(num);
|
|
|
|
- this.reportList = [...this.reportList];
|
|
|
|
|
|
+ if (this.reporterList[index]) {
|
|
|
|
+ this.reporterList[index].defectNum = String(num);
|
|
|
|
+ this.reporterList = [...this.reporterList];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}),
|
|
}),
|
|
@@ -1175,10 +1181,26 @@ struct ProcessIndex {
|
|
alignment:DialogAlignment.Center,
|
|
alignment:DialogAlignment.Center,
|
|
maskColor: 'rgba(0,0,0,0.8)',
|
|
maskColor: 'rgba(0,0,0,0.8)',
|
|
})
|
|
})
|
|
|
|
+ // 工序报工-用户用时占比
|
|
|
|
+ reportWorkHourRateController: CustomDialogController = new CustomDialogController({
|
|
|
|
+ builder: ReportWorkHourRateDialog({
|
|
|
|
+ onConfirm:(rateNum: number)=>{
|
|
|
|
+ const index = this.currentDefectIndex;
|
|
|
|
+ if (this.reporterList[index]) {
|
|
|
|
+ this.reporterList[index].workingHoursRate = rateNum / 100;
|
|
|
|
+ this.reporterList = [...this.reporterList];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }),
|
|
|
|
+ autoCancel: true,
|
|
|
|
+ customStyle: true,
|
|
|
|
+ alignment: DialogAlignment.Center,
|
|
|
|
+ maskColor: 'rgba(0,0,0,0.8)',
|
|
|
|
+ })
|
|
// 工序报工-添加参与人员
|
|
// 工序报工-添加参与人员
|
|
JoinPersonNameController: CustomDialogController = new CustomDialogController({
|
|
JoinPersonNameController: CustomDialogController = new CustomDialogController({
|
|
builder: JoinPersonNameDialog({
|
|
builder: JoinPersonNameDialog({
|
|
- reportList:this.reportList,
|
|
|
|
|
|
+ reporterList:this.reporterList,
|
|
currentReporterIndex:this.currentReporterIndex,
|
|
currentReporterIndex:this.currentReporterIndex,
|
|
}),
|
|
}),
|
|
autoCancel: true,
|
|
autoCancel: true,
|
|
@@ -1186,15 +1208,15 @@ struct ProcessIndex {
|
|
alignment:DialogAlignment.Center,
|
|
alignment:DialogAlignment.Center,
|
|
maskColor: 'rgba(0,0,0,0.8)',
|
|
maskColor: 'rgba(0,0,0,0.8)',
|
|
})
|
|
})
|
|
- // 工序报工弹窗
|
|
|
|
- processReportingController: CustomDialogController = new CustomDialogController({
|
|
|
|
- builder: ProcessReportingDialog({
|
|
|
|
|
|
+ // 工序报工(计件)弹窗
|
|
|
|
+ reportPieceworkController: CustomDialogController = new CustomDialogController({
|
|
|
|
+ builder: ReportPieceworkDialog({
|
|
onSelectReporter:(index:number)=>{
|
|
onSelectReporter:(index:number)=>{
|
|
this.currentReporterIndex = index;
|
|
this.currentReporterIndex = index;
|
|
this.JoinPersonNameController.open();
|
|
this.JoinPersonNameController.open();
|
|
},
|
|
},
|
|
onSelectReportNum:(index:number)=>{
|
|
onSelectReportNum:(index:number)=>{
|
|
- if (!this.reportList[index]?.userName?.trim()) {
|
|
|
|
|
|
+ if (!this.reporterList[index]?.userName?.trim()) {
|
|
promptAction.showToast({
|
|
promptAction.showToast({
|
|
message: '请先添加用户',
|
|
message: '请先添加用户',
|
|
duration: 2000
|
|
duration: 2000
|
|
@@ -1205,7 +1227,7 @@ struct ProcessIndex {
|
|
this.ReportWorkNumController.open()
|
|
this.ReportWorkNumController.open()
|
|
},
|
|
},
|
|
onSelectDefectNum:(index:number)=>{
|
|
onSelectDefectNum:(index:number)=>{
|
|
- if (!this.reportList[index]?.userName?.trim()) {
|
|
|
|
|
|
+ if (!this.reporterList[index]?.userName?.trim()) {
|
|
promptAction.showToast({
|
|
promptAction.showToast({
|
|
message: '请先添加用户',
|
|
message: '请先添加用户',
|
|
duration: 2000
|
|
duration: 2000
|
|
@@ -1218,7 +1240,7 @@ struct ProcessIndex {
|
|
clearSelectData:()=>{
|
|
clearSelectData:()=>{
|
|
this.clearSelectData()
|
|
this.clearSelectData()
|
|
},
|
|
},
|
|
- reportList:this.reportList,
|
|
|
|
|
|
+ reporterList:this.reporterList,
|
|
selectWorkOder: this.selectWorkOder,
|
|
selectWorkOder: this.selectWorkOder,
|
|
selectOperationName: this.selectOperationName,
|
|
selectOperationName: this.selectOperationName,
|
|
selectOperationId: this.selectOperationId,
|
|
selectOperationId: this.selectOperationId,
|
|
@@ -1230,6 +1252,60 @@ struct ProcessIndex {
|
|
alignment:DialogAlignment.Center,
|
|
alignment:DialogAlignment.Center,
|
|
maskColor: 'rgba(0,0,0,0.8)',
|
|
maskColor: 'rgba(0,0,0,0.8)',
|
|
})
|
|
})
|
|
|
|
+ // 工序报工(计时)弹窗
|
|
|
|
+ reportTimeBasedController: CustomDialogController = new CustomDialogController({
|
|
|
|
+ builder: ReportTimeBasedDialog({
|
|
|
|
+ onSelectReporter:(index: number)=>{
|
|
|
|
+ this.currentReporterIndex = index;
|
|
|
|
+ this.JoinPersonNameController.open();
|
|
|
|
+ },
|
|
|
|
+ onSelectReportNum:(index: number)=>{
|
|
|
|
+ if (!this.reporterList[index]?.userName?.trim()) {
|
|
|
|
+ promptAction.showToast({
|
|
|
|
+ message: '请先添加用户',
|
|
|
|
+ duration: 2000
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.currentReportNumIndex = index
|
|
|
|
+ this.ReportWorkNumController.open()
|
|
|
|
+ },
|
|
|
|
+ onSelectDefectNum:(index: number)=>{
|
|
|
|
+ if (!this.reporterList[index]?.userName?.trim()) {
|
|
|
|
+ promptAction.showToast({
|
|
|
|
+ message: '请先添加用户',
|
|
|
|
+ duration: 2000
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.currentDefectIndex = index
|
|
|
|
+ this.defectNumReportController.open()
|
|
|
|
+ },
|
|
|
|
+ onSelectWorkHourRate:(index: number)=>{
|
|
|
|
+ if (!this.reporterList[index]?.userName?.trim()) {
|
|
|
|
+ promptAction.showToast({
|
|
|
|
+ message: '请先添加用户',
|
|
|
|
+ duration: 2000
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.currentDefectIndex = index
|
|
|
|
+ this.reportWorkHourRateController.open()
|
|
|
|
+ },
|
|
|
|
+ clearSelectData:()=>{
|
|
|
|
+ this.clearSelectData()
|
|
|
|
+ },
|
|
|
|
+ reporterList:this.reporterList,
|
|
|
|
+ selectWorkOder: this.selectWorkOder,
|
|
|
|
+ selectOperationName: this.selectOperationName,
|
|
|
|
+ selectOperationId: this.selectOperationId,
|
|
|
|
+ process: this.process,
|
|
|
|
+ }),
|
|
|
|
+ autoCancel: true,
|
|
|
|
+ customStyle: true,
|
|
|
|
+ alignment:DialogAlignment.Center,
|
|
|
|
+ maskColor: 'rgba(0,0,0,0.8)',
|
|
|
|
+ })
|
|
// 切换产线弹窗控制器
|
|
// 切换产线弹窗控制器
|
|
SwitchingProductLineController: CustomDialogController = new CustomDialogController({
|
|
SwitchingProductLineController: CustomDialogController = new CustomDialogController({
|
|
builder: SwitchingProductLineDialog({}),
|
|
builder: SwitchingProductLineDialog({}),
|