|
@@ -29,7 +29,6 @@ import { MqttClientOptions, MqttConnectOptions } from '@ohos/mqtt';
|
|
|
import MqttManager from '../common/util/mqtt';
|
|
|
import { UnqualifiedReportDialog } from '../view/UnqualifiedReportDialog';
|
|
|
import { SelfInspectView } from '../view/process/SelfInspectView';
|
|
|
-import { SpecialInspectionDialog } from '../view/SpecialInspectionDialog';
|
|
|
import { MultiMediaCollect } from '../view/process/MultiMediaCollect';
|
|
|
import { BarcodeAssociationDialog } from '../view/BarcodeAssociationDialog';
|
|
|
import WorkOrderSeq from '../viewmodel/WorkOrderSeq';
|
|
@@ -41,6 +40,7 @@ import { AuxiliaryOperationView } from '../view/AuxiliaryOperationView';
|
|
|
import { BusinessError } from '@ohos.base';
|
|
|
import window from '@ohos.window';
|
|
|
import { EquipmentInspectionDialog } from '../view/EquipmentInspectionDialog';
|
|
|
+import preferencesUtil from '../common/util/PerferencesUtil';
|
|
|
|
|
|
// 声明接受参数的类型
|
|
|
interface Params {
|
|
@@ -65,6 +65,8 @@ struct ProcessIndex {
|
|
|
@State isAuxiliaryViewOpen:boolean = false
|
|
|
// 选中工序id
|
|
|
@State selectOperationId: string = ''
|
|
|
+ // 选中工序名称
|
|
|
+ selectOperationName: string = ''
|
|
|
//选择的按钮索引(默认加载全部)
|
|
|
@State selectedButtonIndex: number = 0
|
|
|
// 流转卡号信息集合
|
|
@@ -142,7 +144,7 @@ struct ProcessIndex {
|
|
|
console.log('hhtest', '选择工单被清空-----------------')
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ // 扫码开工
|
|
|
async scanCodeToStartWork() {
|
|
|
this.process = await ProcessRequest.post('/api/v1/process/info/scan', {
|
|
|
operationId: this.selectOperationId,
|
|
@@ -172,6 +174,14 @@ struct ProcessIndex {
|
|
|
})
|
|
|
}
|
|
|
this.scanState = 1
|
|
|
+ // 保存此流转卡号到数据库中
|
|
|
+ let seqNos: string[] = []
|
|
|
+ seqNos = await preferencesUtil.get(CommonConstants.PREFERENCE_INSTANCE_NAME, this.selectWorkOder.workOrderCode!, seqNos)
|
|
|
+ if (seqNos.includes(this.seqNo)) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ seqNos.push(this.seqNo)
|
|
|
+ preferencesUtil.put(CommonConstants.PREFERENCE_INSTANCE_NAME, this.selectWorkOder.workOrderCode!, seqNos)
|
|
|
}
|
|
|
|
|
|
handleAllClick():void {
|
|
@@ -314,7 +324,6 @@ struct ProcessIndex {
|
|
|
.justifyContent(FlexAlign.Start)
|
|
|
.onClick(() => {
|
|
|
// router.back()
|
|
|
- const context = getContext(this)
|
|
|
window.getLastWindow(getContext()).then((data) => {
|
|
|
//获取窗口对象
|
|
|
let windowClass = data;
|
|
@@ -485,6 +494,7 @@ struct ProcessIndex {
|
|
|
return
|
|
|
}
|
|
|
this.selectOperationId = item.operationId!
|
|
|
+ this.selectOperationName = item.operationName!
|
|
|
if (!item.exists) {
|
|
|
promptAction.showToast({
|
|
|
message: `${item.operationName}需要在${item.stationName}工位上生产`,
|
|
@@ -632,6 +642,14 @@ struct ProcessIndex {
|
|
|
sortNum: 0
|
|
|
})
|
|
|
this.seqNo = this.scanCode
|
|
|
+ // 保存此流转卡号到数据库中
|
|
|
+ let seqNos: string[] = []
|
|
|
+ seqNos = await preferencesUtil.get(CommonConstants.PREFERENCE_INSTANCE_NAME, this.selectWorkOder.workOrderCode, seqNos)
|
|
|
+ if (seqNos.includes(this.seqNo)) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ seqNos.push(this.seqNo)
|
|
|
+ preferencesUtil.put(CommonConstants.PREFERENCE_INSTANCE_NAME, this.selectWorkOder.workOrderCode, seqNos)
|
|
|
})
|
|
|
}
|
|
|
.width('65%')
|
|
@@ -1017,6 +1035,8 @@ struct ProcessIndex {
|
|
|
ReportWorkNumController: CustomDialogController = new CustomDialogController({
|
|
|
builder: ReportWorkNumDialog({
|
|
|
userName: this.reportList[this.currentReportNumIndex].userName,
|
|
|
+ currentOperationId: this.selectOperationId,
|
|
|
+ currentWorkOrderCode: this.selectWorkOder.workOrderCode!,
|
|
|
onConfirm:(num:number)=>{
|
|
|
const index = this.currentReportNumIndex;
|
|
|
if (this.reportList[index]) {
|
|
@@ -1104,7 +1124,10 @@ struct ProcessIndex {
|
|
|
this.currentUnqualifiedIndex = index
|
|
|
this.UnqualifiedReportController.open()
|
|
|
},
|
|
|
- reportList:this.reportList
|
|
|
+ reportList:this.reportList,
|
|
|
+ selectWorkOder: this.selectWorkOder,
|
|
|
+ selectOperationName: this.selectOperationName,
|
|
|
+ selectOperationId: this.selectOperationId
|
|
|
}),
|
|
|
autoCancel: true,
|
|
|
customStyle: true,
|
|
@@ -1141,10 +1164,10 @@ struct ProcessIndex {
|
|
|
scanState:this.scanState,
|
|
|
process:this.process,
|
|
|
scanSeqValue: this.scanCode,
|
|
|
- currentStationId:this.currentStationId,
|
|
|
selectWorkOder:this.selectWorkOder,
|
|
|
currentOperationId:this.selectOperationId,
|
|
|
- opComponents:this.opComponents
|
|
|
+ opComponents:this.opComponents,
|
|
|
+ seqNo:this.seqNo,
|
|
|
}),
|
|
|
autoCancel: true, // 点击遮罩关闭
|
|
|
customStyle: true,
|