|
@@ -47,6 +47,7 @@ import ProcessDeviceDailyCheck from '../viewmodel/process/ProcessDeviceDailyChec
|
|
|
import { DeviceCheckView } from '../view/process/DeviceCheckView';
|
|
|
import { ReportWorkHourRateDialog } from '../view/ReportWorkHourRateDialog';
|
|
|
import { ConfirmDialog } from '../view/ConfirmDialog';
|
|
|
+import VehicleInfo from '../viewmodel/VehicleInfo';
|
|
|
|
|
|
// 声明接受参数的类型
|
|
|
interface Params {
|
|
@@ -116,6 +117,8 @@ struct ProcessIndex {
|
|
|
@State isConnected: boolean = false
|
|
|
// 当前订单扫码流水号数量
|
|
|
@State scanSeqNos: number = 0
|
|
|
+ //工序载具列表
|
|
|
+ @State processVehicleList: VehicleInfo[] = []
|
|
|
//所有流水号
|
|
|
allTaskSeq: TaskSeqVO[] = []
|
|
|
|
|
@@ -267,7 +270,6 @@ struct ProcessIndex {
|
|
|
|
|
|
handleAllClick():void {
|
|
|
this.onQueryTask([])
|
|
|
- this.allTaskSeq = this.taskSeqArray
|
|
|
}
|
|
|
|
|
|
handleReportedClick():void{
|
|
@@ -288,8 +290,20 @@ struct ProcessIndex {
|
|
|
operationId: this.selectOperationId,
|
|
|
stateList: currentStateList
|
|
|
} as RequestParamModel) as TaskSeqVO[];
|
|
|
+ if (currentStateList.length <= 0) {
|
|
|
+ this.allTaskSeq = this.taskSeqArray
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ //加载工序所有载具
|
|
|
+ loadProcessVehicle = async () => {
|
|
|
+ let res = await ProcessRequest.post('/api/v1/process/vehicleOperation/list', {
|
|
|
+ workOrderCode:this.selectWorkOder.workOrderCode!,
|
|
|
+ operationId: this.selectOperationId
|
|
|
+ } as RequestParamModel) as OperationInfo;
|
|
|
+ this.processVehicleList = res.processVehicleList ?? []
|
|
|
+ };
|
|
|
+
|
|
|
connectMQTT = async ()=> {
|
|
|
const clientOptions: MqttClientOptions = {
|
|
|
url: 'mqtt://192.168.1.3:1883', // 替换实际IP
|
|
@@ -914,26 +928,61 @@ struct ProcessIndex {
|
|
|
})
|
|
|
|
|
|
Row().width('1.5%')
|
|
|
- Row({ space: 4 }) {
|
|
|
- Image($r('app.media.process_complete_reception'))
|
|
|
- .width($r('app.float.virtualSize_24'))
|
|
|
- .height($r('app.float.virtualSize_24'))
|
|
|
- .fillColor($r('app.color.0A84FF'))
|
|
|
- Text('齐套接收')
|
|
|
- .fontColor($r('app.color.0A84FF'))
|
|
|
- .fontSize($r('app.float.fontSize_24'))
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
+ Row() {
|
|
|
+ Stack() {
|
|
|
+ Row() {
|
|
|
+ Circle()
|
|
|
+ .width($r('app.float.virtualSize_12'))
|
|
|
+ .height($r('app.float.virtualSize_12'))
|
|
|
+ .fill($r('app.color.FF453A'))
|
|
|
+ .opacity(this.processVehicleList.length > 0 ? 1 : 0)
|
|
|
+ }
|
|
|
+ .width('11.5%')
|
|
|
+ .height('39%')
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
+ .alignItems(VerticalAlign.Bottom)
|
|
|
+
|
|
|
+ Row({ space: 4 }) {
|
|
|
+ Image($r('app.media.process_complete_reception'))
|
|
|
+ .width($r('app.float.virtualSize_24'))
|
|
|
+ .height($r('app.float.virtualSize_24'))
|
|
|
+ .fillColor($r('app.color.0A84FF'))
|
|
|
+ Text('齐套接收')
|
|
|
+ .fontColor($r('app.color.0A84FF'))
|
|
|
+ .fontSize($r('app.float.fontSize_24'))
|
|
|
+ .fontWeight(FontWeight.Medium)
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .height('100%')
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .backgroundColor($r('app.color.20FFFFFF'))
|
|
|
+ .borderRadius($r('app.float.fontSize_16'))
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .height('100%')
|
|
|
+ .alignContent(Alignment.TopEnd)
|
|
|
}
|
|
|
.width('10%')
|
|
|
.height('58.3%')
|
|
|
- .justifyContent(FlexAlign.Center)
|
|
|
- .backgroundColor($r('app.color.20FFFFFF'))
|
|
|
- .borderRadius($r('app.float.fontSize_16'))
|
|
|
- .onClick(() => {
|
|
|
- if (!this.selectWorkOder.workOrderCode) {
|
|
|
+ .onClick(async () => {
|
|
|
+ if (!this.selectWorkOder.workOrderCode || !this.selectOperationId) {
|
|
|
return
|
|
|
}
|
|
|
- this.completeReceiveController.open()
|
|
|
+ this.loadProcessVehicle()
|
|
|
+ if (this.processVehicleList.length > 0) {
|
|
|
+ this.completeReceiveController.open()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 没有齐套物料,则发送叫料消息
|
|
|
+ let result: string = await ProcessRequest.post('/api/v1/process/vehicleOperation/materialOut', {
|
|
|
+ workOrderCode: this.selectWorkOder.workOrderCode!,
|
|
|
+ operationId: this.selectOperationId,
|
|
|
+ stationId: this.currentStationId
|
|
|
+ } as RequestParamModel)
|
|
|
+ promptAction.showToast({
|
|
|
+ message: result,
|
|
|
+ duration: 1500,
|
|
|
+ })
|
|
|
})
|
|
|
|
|
|
Blank()
|
|
@@ -1034,6 +1083,7 @@ struct ProcessIndex {
|
|
|
}
|
|
|
if (this.scanState === 0) {
|
|
|
this.scanState = 1
|
|
|
+ this.loadProcessVehicle()
|
|
|
// this.scanCodeToStartWork()
|
|
|
} else if (this.scanState === 1) {
|
|
|
this.reportTimeBasedController.open()
|
|
@@ -1425,7 +1475,8 @@ struct ProcessIndex {
|
|
|
completeReceiveController: CustomDialogController = new CustomDialogController({
|
|
|
builder: CompleteReceiveDialog({
|
|
|
currentWorkOrderCode: this.selectWorkOder.workOrderCode!,
|
|
|
- currentOperationId: this.selectOperationId
|
|
|
+ currentOperationId: this.selectOperationId,
|
|
|
+ processVehicleList: this.processVehicleList,
|
|
|
}),
|
|
|
autoCancel: true, // 点击遮罩关闭
|
|
|
customStyle: true,
|