|
@@ -3,10 +3,9 @@
|
|
* */
|
|
* */
|
|
import { BottomOperateComp } from '../../common/component/BottomOperateComp'
|
|
import { BottomOperateComp } from '../../common/component/BottomOperateComp'
|
|
import router from '@ohos.router';
|
|
import router from '@ohos.router';
|
|
-import ProcessData from '../../model/ProcessData';
|
|
|
|
|
|
+import ProcessData from '../../viewmodel/ProcessData';
|
|
import CommonConstants from '../../common/constants/CommonConstants';
|
|
import CommonConstants from '../../common/constants/CommonConstants';
|
|
-import ProductInfo from '../../model/processmodel/ProductInfo';
|
|
|
|
-import ProcessStep from '../../model/processmodel/ProcessStep'
|
|
|
|
|
|
+import ProcessStep from '../../viewmodel/ProcessStep'
|
|
import MaterialInfo from '../../model/MaterialInfo';
|
|
import MaterialInfo from '../../model/MaterialInfo';
|
|
import { MaterialCollectView } from '../../view/processview/MaterialCollectView';
|
|
import { MaterialCollectView } from '../../view/processview/MaterialCollectView';
|
|
import { RecordItemView } from '../../view/processview/RecordItemView';
|
|
import { RecordItemView } from '../../view/processview/RecordItemView';
|
|
@@ -20,19 +19,22 @@ import { NameplateBindView } from '../../view/processview/NameplateBindView';
|
|
import { pinyin } from 'pinyin-pro';
|
|
import { pinyin } from 'pinyin-pro';
|
|
import HashMap from '@ohos.util.HashMap';
|
|
import HashMap from '@ohos.util.HashMap';
|
|
import { ProcessTitleComp } from '../../common/component/ProcessTitleComp';
|
|
import { ProcessTitleComp } from '../../common/component/ProcessTitleComp';
|
|
|
|
+import JGRequest from '../../common/util/request/Request';
|
|
|
|
+import StartWorkInfo from '../../viewmodel/StartWorkInfo';
|
|
|
|
|
|
// const params = router.getParams(); // 获取传递过来的参数对象
|
|
// const params = router.getParams(); // 获取传递过来的参数对象
|
|
-// const mainMaterial = params['mainMaterial']; // 获取主料号
|
|
|
|
|
|
+// const startWorkInfo = params['startWorkInfo']; // 获取开工信息
|
|
// const processInfo = params['processInfo']; // 获取当前工序信息
|
|
// const processInfo = params['processInfo']; // 获取当前工序信息
|
|
|
|
|
|
@Entry
|
|
@Entry
|
|
@Component
|
|
@Component
|
|
struct ProcessStepPage {
|
|
struct ProcessStepPage {
|
|
- @State mainMaterial: string = '23'
|
|
|
|
- @State process: ProcessData = {completeNum:'101',operationCode:'32434', operationSort:1, operationName: '物流采集'}
|
|
|
|
|
|
+ // todo 根据homePage传过来的值
|
|
|
|
+ startWorkInfo: StartWorkInfo = {materialCode: 'BL000001', materialName:'数据链处理机板硬件(国产化)', seqNo: '20240402000054'}
|
|
|
|
+ @State process: ProcessData = {operationId: 129, completeNum:'101',operationCode:'32434', operationSort:1, operationName: '物流采集'}
|
|
|
|
|
|
- @State product: ProductInfo = CommonConstants.PRODUCT_DATA
|
|
|
|
- @State productSteps: ProcessStep[] = CommonConstants.PROCESS_STEP_ARRAY
|
|
|
|
|
|
+ // @State product: ProductInfo = CommonConstants.PRODUCT_DATA
|
|
|
|
+ @State productSteps: ProcessStep[] = []
|
|
|
|
|
|
private stepImages: Resource[] = CommonConstants.STEP_IMAGES
|
|
private stepImages: Resource[] = CommonConstants.STEP_IMAGES
|
|
private stepSelectImages: Resource[] = CommonConstants.STEP_SELECT_IMAGES
|
|
private stepSelectImages: Resource[] = CommonConstants.STEP_SELECT_IMAGES
|
|
@@ -59,11 +61,11 @@ struct ProcessStepPage {
|
|
customStyle: true,
|
|
customStyle: true,
|
|
})
|
|
})
|
|
|
|
|
|
- aboutToAppear() {
|
|
|
|
|
|
+ async aboutToAppear() {
|
|
|
|
+ this.productSteps = await JGRequest.get("/api/v1/process/opCompent/get/" + this.process.operationId, {})
|
|
if (this.productSteps && this.productSteps.length > 0) {
|
|
if (this.productSteps && this.productSteps.length > 0) {
|
|
- this.selectStep = 1
|
|
|
|
|
|
+ this.selectStep = 0
|
|
}
|
|
}
|
|
- // todo 查询产品数据,查询当前工序的工步
|
|
|
|
}
|
|
}
|
|
|
|
|
|
build() {
|
|
build() {
|
|
@@ -75,13 +77,13 @@ struct ProcessStepPage {
|
|
// 信息栏(产品、工序、主料)
|
|
// 信息栏(产品、工序、主料)
|
|
Column() {
|
|
Column() {
|
|
Column() {
|
|
Column() {
|
|
- Text(this.product.productName)
|
|
|
|
|
|
+ Text(this.startWorkInfo.materialName)
|
|
.fontSize($r('app.float.card_title_font_size'))
|
|
.fontSize($r('app.float.card_title_font_size'))
|
|
.fontWeight(FontWeight.Medium)
|
|
.fontWeight(FontWeight.Medium)
|
|
.fontColor($r('app.color.general_font_color'))
|
|
.fontColor($r('app.color.general_font_color'))
|
|
.opacity($r('app.float.general_font_opacity'))
|
|
.opacity($r('app.float.general_font_opacity'))
|
|
.maxLines(1)
|
|
.maxLines(1)
|
|
- Text(this.product.productCode)
|
|
|
|
|
|
+ Text(this.startWorkInfo.materialCode)
|
|
.fontSize($r('app.float.card_info_font_size'))
|
|
.fontSize($r('app.float.card_info_font_size'))
|
|
.fontColor($r('app.color.general_font_color'))
|
|
.fontColor($r('app.color.general_font_color'))
|
|
.fontWeight(FontWeight.Regular)
|
|
.fontWeight(FontWeight.Regular)
|
|
@@ -97,7 +99,7 @@ struct ProcessStepPage {
|
|
.fontWeight(FontWeight.Regular)
|
|
.fontWeight(FontWeight.Regular)
|
|
.fontColor($r('app.color.general_font_color'))
|
|
.fontColor($r('app.color.general_font_color'))
|
|
.opacity($r('app.float.card_font_default_opacity'))
|
|
.opacity($r('app.float.card_font_default_opacity'))
|
|
- Text(this.mainMaterial)
|
|
|
|
|
|
+ Text(this.startWorkInfo.seqNo)
|
|
.fontSize($r('app.float.card_info_font_size'))
|
|
.fontSize($r('app.float.card_info_font_size'))
|
|
.fontColor($r('app.color.general_font_color'))
|
|
.fontColor($r('app.color.general_font_color'))
|
|
.fontWeight(FontWeight.Medium)
|
|
.fontWeight(FontWeight.Medium)
|
|
@@ -158,7 +160,9 @@ struct ProcessStepPage {
|
|
OperateCard({operateName: '图纸', operateImage:$r('app.media.drawing'), clickEvent: ()=>{
|
|
OperateCard({operateName: '图纸', operateImage:$r('app.media.drawing'), clickEvent: ()=>{
|
|
router.pushUrl({
|
|
router.pushUrl({
|
|
url: 'pages/process/ProcessDrawingPage',
|
|
url: 'pages/process/ProcessDrawingPage',
|
|
- // params: {}
|
|
|
|
|
|
+ params: {
|
|
|
|
+ mainMaterial: this.startWorkInfo.materialCode
|
|
|
|
+ }
|
|
})
|
|
})
|
|
}})
|
|
}})
|
|
OperateCard({operateName: '报故', operateImage:$r('app.media.report_fault'), clickEvent: ()=>{
|
|
OperateCard({operateName: '报故', operateImage:$r('app.media.report_fault'), clickEvent: ()=>{
|
|
@@ -180,10 +184,10 @@ struct ProcessStepPage {
|
|
ForEach(this.productSteps, (item: ProcessStep, index: number)=> {
|
|
ForEach(this.productSteps, (item: ProcessStep, index: number)=> {
|
|
ListItem() {
|
|
ListItem() {
|
|
Column() {
|
|
Column() {
|
|
- Image(this.selectStep === index ? this.stepSelectImages[item.stepType - 1] : this.stepImages[item.stepType - 1])
|
|
|
|
|
|
+ Image(this.selectStep === index ? this.stepSelectImages[item.compentType - 1] : this.stepImages[item.compentType - 1])
|
|
.width($r('app.float.card_image_size'))
|
|
.width($r('app.float.card_image_size'))
|
|
.height($r('app.float.card_image_size'))
|
|
.height($r('app.float.card_image_size'))
|
|
- Text(item.stepName)
|
|
|
|
|
|
+ Text(item.compentName)
|
|
.fontSize($r('app.float.card_info_font_size'))
|
|
.fontSize($r('app.float.card_info_font_size'))
|
|
.fontWeight(FontWeight.Medium)
|
|
.fontWeight(FontWeight.Medium)
|
|
.fontColor(this.selectStep === index ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
|
|
.fontColor(this.selectStep === index ? $r('app.color.general_font_white_color') : $r('app.color.general_font_color'))
|
|
@@ -206,27 +210,27 @@ struct ProcessStepPage {
|
|
.margin({left: '2%'})
|
|
.margin({left: '2%'})
|
|
|
|
|
|
Column() {
|
|
Column() {
|
|
- if (this.productSteps[this.selectStep].stepType === 1) {
|
|
|
|
|
|
+ if (this.productSteps[this.selectStep].compentType === 1) {
|
|
MaterialCollectView({
|
|
MaterialCollectView({
|
|
- mainMaterial: this.mainMaterial,
|
|
|
|
|
|
+ mainMaterial: this.startWorkInfo.materialCode,
|
|
process: $process,
|
|
process: $process,
|
|
})
|
|
})
|
|
- } else if (this.productSteps[this.selectStep].stepType === 2) {
|
|
|
|
|
|
+ } else if (this.productSteps[this.selectStep].compentType === 2) {
|
|
RecordItemView()
|
|
RecordItemView()
|
|
- } else if (this.productSteps[this.selectStep].stepType === 3) {
|
|
|
|
|
|
+ } else if (this.productSteps[this.selectStep].compentType === 3) {
|
|
MultimediaCollectView()
|
|
MultimediaCollectView()
|
|
- } else if (this.productSteps[this.selectStep].stepType === 4) {
|
|
|
|
|
|
+ } else if (this.productSteps[this.selectStep].compentType === 4) {
|
|
EsopView()
|
|
EsopView()
|
|
- } else if (this.productSteps[this.selectStep].stepType === 5) {
|
|
|
|
|
|
+ } else if (this.productSteps[this.selectStep].compentType === 5) {
|
|
SpotCheckView()
|
|
SpotCheckView()
|
|
- } else if (this.productSteps[this.selectStep].stepType === 6) {
|
|
|
|
|
|
+ } else if (this.productSteps[this.selectStep].compentType === 6) {
|
|
EquipRecordView()
|
|
EquipRecordView()
|
|
- } else if (this.productSteps[this.selectStep].stepType === 7) {
|
|
|
|
|
|
+ } else if (this.productSteps[this.selectStep].compentType === 7) {
|
|
FixtureView()
|
|
FixtureView()
|
|
- } else if (this.productSteps[this.selectStep].stepType === 8) {
|
|
|
|
|
|
+ } else if (this.productSteps[this.selectStep].compentType === 8) {
|
|
DebugPairView()
|
|
DebugPairView()
|
|
- } else if (this.productSteps[this.selectStep].stepType === 9) {
|
|
|
|
- NameplateBindView({mainMaterial: this.mainMaterial})
|
|
|
|
|
|
+ } else if (this.productSteps[this.selectStep].compentType === 9) {
|
|
|
|
+ NameplateBindView({mainMaterial: this.startWorkInfo.materialCode})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.width('100%')
|
|
.width('100%')
|