|
@@ -22,18 +22,18 @@ import { ProcessTitleComp } from '../../common/component/ProcessTitleComp';
|
|
|
import JGRequest from '../../common/util/request/Request';
|
|
|
import StartWorkInfo from '../../viewmodel/StartWorkInfo';
|
|
|
|
|
|
-// const params = router.getParams(); // 获取传递过来的参数对象
|
|
|
-// const startWorkInfo = params['startWorkInfo']; // 获取开工信息
|
|
|
-// const processInfo = params['processInfo']; // 获取当前工序信息
|
|
|
+const params = router.getParams(); // 获取传递过来的参数对象
|
|
|
+const startWorkInfo = params['startWorkInfo']; // 获取开工信息
|
|
|
+const processInfo = params['processInfo']; // 获取当前工序信息
|
|
|
|
|
|
@Entry
|
|
|
@Component
|
|
|
struct ProcessStepPage {
|
|
|
- // todo 根据homePage传过来的值
|
|
|
- startWorkInfo: StartWorkInfo = {materialCode: 'BL000001', materialName:'数据链处理机板硬件(国产化)', seqNo: '20240402000054'}
|
|
|
- @State process: ProcessData = {operationId: 129, completeNum:'101',operationCode:'32434', operationSort:1, operationName: '物流采集'}
|
|
|
|
|
|
- @State productSteps: ProcessStep[] = []
|
|
|
+ startWorkInfo: StartWorkInfo = startWorkInfo
|
|
|
+ @State process: ProcessData = processInfo
|
|
|
+
|
|
|
+ @State processSteps: ProcessStep[] = []
|
|
|
|
|
|
private stepImages: Resource[] = CommonConstants.STEP_IMAGES
|
|
|
private stepSelectImages: Resource[] = CommonConstants.STEP_SELECT_IMAGES
|
|
@@ -61,8 +61,9 @@ struct ProcessStepPage {
|
|
|
})
|
|
|
|
|
|
async aboutToAppear() {
|
|
|
- this.productSteps = await JGRequest.get("/api/v1/process/opCompent/get/" + this.process.operationId, {})
|
|
|
- if (this.productSteps && this.productSteps.length > 0) {
|
|
|
+ let res: ProcessStep[] = await JGRequest.get("/api/v1/process/opCompent/get/" + 129, {})
|
|
|
+ if (res && res.length > 0) {
|
|
|
+ this.processSteps = res
|
|
|
this.selectStep = 0
|
|
|
}
|
|
|
}
|
|
@@ -180,7 +181,7 @@ struct ProcessStepPage {
|
|
|
Column() {
|
|
|
// 当前工序的工步列表
|
|
|
List({space: 6}) {
|
|
|
- ForEach(this.productSteps, (item: ProcessStep, index: number)=> {
|
|
|
+ ForEach(this.processSteps, (item: ProcessStep, index: number)=> {
|
|
|
ListItem() {
|
|
|
Column() {
|
|
|
Image(this.selectStep === index ? this.stepSelectImages[item.compentType - 1] : this.stepImages[item.compentType - 1])
|
|
@@ -209,29 +210,29 @@ struct ProcessStepPage {
|
|
|
.margin({left: '2%'})
|
|
|
|
|
|
Column() {
|
|
|
- if (this.productSteps[this.selectStep].compentType === 1) {
|
|
|
+ if (this.processSteps && this.processSteps.length > 0 && this.processSteps[this.selectStep].compentType === 1) {
|
|
|
MaterialCollectView({
|
|
|
mainMaterial: this.startWorkInfo.materialCode,
|
|
|
process: $process,
|
|
|
})
|
|
|
- } else if (this.productSteps[this.selectStep].compentType === 2) {
|
|
|
+ } else if (this.processSteps && this.processSteps.length > 0 && this.processSteps[this.selectStep].compentType === 2) {
|
|
|
RecordItemView({
|
|
|
operationId: this.process.operationId,
|
|
|
processId: this.startWorkInfo.id
|
|
|
})
|
|
|
- } else if (this.productSteps[this.selectStep].compentType === 3) {
|
|
|
+ } else if (this.processSteps && this.processSteps.length > 0 && this.processSteps[this.selectStep].compentType === 3) {
|
|
|
MultimediaCollectView()
|
|
|
- } else if (this.productSteps[this.selectStep].compentType === 4) {
|
|
|
+ } else if (this.processSteps && this.processSteps.length > 0 && this.processSteps[this.selectStep].compentType === 4) {
|
|
|
EsopView()
|
|
|
- } else if (this.productSteps[this.selectStep].compentType === 5) {
|
|
|
+ } else if (this.processSteps && this.processSteps.length > 0 && this.processSteps[this.selectStep].compentType === 5) {
|
|
|
SpotCheckView()
|
|
|
- } else if (this.productSteps[this.selectStep].compentType === 6) {
|
|
|
+ } else if (this.processSteps && this.processSteps.length > 0 && this.processSteps[this.selectStep].compentType === 6) {
|
|
|
EquipRecordView()
|
|
|
- } else if (this.productSteps[this.selectStep].compentType === 7) {
|
|
|
+ } else if (this.processSteps && this.processSteps.length > 0 && this.processSteps[this.selectStep].compentType === 7) {
|
|
|
FixtureView()
|
|
|
- } else if (this.productSteps[this.selectStep].compentType === 8) {
|
|
|
+ } else if (this.processSteps && this.processSteps.length > 0 && this.processSteps[this.selectStep].compentType === 8) {
|
|
|
DebugPairView()
|
|
|
- } else if (this.productSteps[this.selectStep].compentType === 9) {
|
|
|
+ } else if (this.processSteps && this.processSteps.length > 0 && this.processSteps[this.selectStep].compentType === 9) {
|
|
|
NameplateBindView({mainMaterial: this.startWorkInfo.materialCode})
|
|
|
}
|
|
|
}
|