hh 1 هفته پیش
والد
کامیت
b9d33fa54c

+ 1 - 1
entry/src/main/ets/common/constants/CommonConstants.ets

@@ -46,7 +46,7 @@ export default class CommonConstants {
     ['duomeiticaiji', '3'],
     ['ESOP', '4'],
     ['dianjian', '5'],
-    ['shebeijilu', '6'],
+    ['shebeiqueren', '6'],
     ['jingu', '7'],
     // ['tiaoshipipei', '8'],
     ['mingpaibangding', '9'],

+ 12 - 12
entry/src/main/ets/common/util/PerferencesUtil.ets

@@ -18,9 +18,9 @@ class PreferencesUtil {
     try {
       const pref = await preferences.getPreferences(context, name);
       this.prefMap.set(name, pref);
-      console.log(`[PreferencesUtil] 加载文件 "${name}" 成功`);
+      console.log('hhtest', `[PreferencesUtil] 加载文件 "${name}" 成功`);
     } catch (err) {
-      console.error(`[PreferencesUtil] 加载失败: ${JSON.stringify(err)}`);
+      console.error('hhtest', `[PreferencesUtil] 加载失败: ${JSON.stringify(err)}`);
     }
   }
 
@@ -33,16 +33,16 @@ class PreferencesUtil {
   async put(fileName: string, key: string, value: ValueType): Promise<void> {
     const pref = this.prefMap.get(fileName);
     if (!pref) {
-      console.warn(`[PreferencesUtil] 文件未加载: ${fileName}`);
+      console.warn('hhtest', `[PreferencesUtil] 文件未加载: ${fileName}`);
       return;
     }
 
     try {
       await pref.put(key, value);
       await pref.flush(); // 立即持久化
-      console.log(`[PreferencesUtil] 保存 ${fileName}.${key} = ${value}`);
+      console.log('hhtest', `[PreferencesUtil] 保存 ${fileName}.${key} = ${value}`);
     } catch (err) {
-      console.error(`[PreferencesUtil] 写入失败: ${JSON.stringify(err)}`);
+      console.error('hhtest', `[PreferencesUtil] 写入失败: ${JSON.stringify(err)}`);
     }
   }
 
@@ -60,16 +60,16 @@ class PreferencesUtil {
   ): Promise<T> {
     const pref = this.prefMap.get(fileName);
     if (!pref) {
-      console.warn(`[PreferencesUtil] 文件未加载: ${fileName}`);
+      console.warn('hhtest', `[PreferencesUtil] 文件未加载: ${fileName}`);
       return defaultValue;
     }
 
     try {
       const value = await pref.get(key, defaultValue);
-      console.log(`[PreferencesUtil] 读取 ${fileName}.${key} = ${value}`);
+      console.log('hhtest', `[PreferencesUtil] 读取 ${fileName}.${key} = ${value}`);
       return value as T; // 泛型类型断言
     } catch (err) {
-      console.error(`[PreferencesUtil] 读取失败: ${JSON.stringify(err)}`);
+      console.error('hhtest', `[PreferencesUtil] 读取失败: ${JSON.stringify(err)}`);
       return defaultValue;
     }
   }
@@ -86,9 +86,9 @@ class PreferencesUtil {
     try {
       await pref.delete(key);
       await pref.flush();
-      console.log(`[PreferencesUtil] 删除键值: ${fileName}.${key}`);
+      console.log('hhtest', `[PreferencesUtil] 删除键值: ${fileName}.${key}`);
     } catch (err) {
-      console.error(`[PreferencesUtil] 删除失败: ${JSON.stringify(err)}`);
+      console.error('hhtest', `[PreferencesUtil] 删除失败: ${JSON.stringify(err)}`);
     }
   }
 
@@ -103,9 +103,9 @@ class PreferencesUtil {
     try {
       await pref.clear();
       await pref.flush();
-      console.log(`[PreferencesUtil] 已清空文件: ${fileName}`);
+      console.log('hhtest', `[PreferencesUtil] 已清空文件: ${fileName}`);
     } catch (err) {
-      console.error(`[PreferencesUtil] 清空失败: ${JSON.stringify(err)}`);
+      console.error('hhtest', `[PreferencesUtil] 清空失败: ${JSON.stringify(err)}`);
     }
   }
 }

+ 2 - 2
entry/src/main/ets/common/util/request/ProcessRequest.ets

@@ -11,8 +11,8 @@ import { printError, printRequest, printResponse, handleRes } from './Helps';
 
 
 // jiaxiaoqiang:这里要改
- const baseUrl = "http://192.168.1.3:30010"//huajing
-// const baseUrl = "http://192.168.1.246:30010" // huhao本地
+//  const baseUrl = "http://192.168.1.3:30010"//huajing
+const baseUrl = "http://192.168.1.246:30010" // huhao本地
 const DEBUG = true //
 
 // 创建实例

+ 3 - 3
entry/src/main/ets/model/ElectricScrewdriverPresetModel.ets

@@ -41,14 +41,14 @@ class ElectricScrewdriverPresetModel {
     // 3.获取rdb
     relationalStore.getRdbStore(context, config, (err, rdbStore) => {
       if(err){
-        console.log('testTag', '获取rdbStore失败!')
+        console.log('hhtest',  '获取rdbStore失败!')
         return
       }
       // 执行Sql
       rdbStore.executeSql(sql).then(()=>{
-        console.log('testTag', '创建电动螺丝刀预设表成功!')
+        console.log('hhtest',  '创建电动螺丝刀预设表成功!')
       }).catch((err: object)=>{
-        console.log('testTag', '创建失败')
+        console.log('hhtest',  '创建失败')
       })
       // 保存rdbStore
       this.rdbStore = rdbStore

+ 4 - 4
entry/src/main/ets/model/ElectricSolderingIronPresetModel.ets

@@ -23,7 +23,7 @@ class ElectricSolderingIronPresetModel {
       // 获取数据库存储对象
       this.rdbStore = await relationalStore.getRdbStore(context, config);
     } catch (err) {
-      console.info('testTag', `getRdbStore err ${JSON.stringify(err)}`);
+      console.info('hhtest', `getRdbStore err ${JSON.stringify(err)}`);
     }
     // 2.初始化SQL语句
     const sql = `CREATE TABLE IF NOT EXISTS ElectricSolderingIronPreset (
@@ -35,14 +35,14 @@ class ElectricSolderingIronPresetModel {
     // 3.获取rdb
     relationalStore.getRdbStore(context, config, (err, rdbStore) => {
       if(err){
-        console.log('testTag', '获取rdbStore失败!')
+        console.log('hhtest', '获取rdbStore失败!')
         return
       }
       // 执行Sql
       rdbStore.executeSql(sql).then(()=>{
-        console.log('testTag', '创建电烙铁预设表成功!')
+        console.log('hhtest', '创建电烙铁预设表成功!')
       }).catch((err: object)=>{
-        console.log('testTag', '创建失败')
+        console.log('hhtest', '创建失败')
       })
       // 保存rdbStore
       this.rdbStore = rdbStore

+ 7 - 5
entry/src/main/ets/pages/ProcessIndex.ets

@@ -43,6 +43,7 @@ import { DeviceInspectionDialog } from '../view/DeviceInspectionDialog';
 import preferencesUtil from '../common/util/PerferencesUtil';
 import TimeUtil from '../common/util/TimeUtil';
 import ProcessDeviceDailyCheck from '../viewmodel/process/ProcessDeviceDailyCheck';
+import { DeviceCheckView } from '../view/process/DeviceCheckView';
 
 // 声明接受参数的类型
 interface Params {
@@ -159,8 +160,8 @@ struct ProcessIndex {
       workOrderCode: this.selectWorkOder.workOrderCode!,
       stationId: this.currentStationId
     } as RequestParamModel)
+    this.opComponents = []
     if (this.process && this.process.id) {
-      this.scanState = 1
       this.opComponents = await ProcessRequest.get(`/api/v1/process/opCompent/get/${this.selectOperationId!}/${this.process?.id!}`)
       if (this.opComponents) {
         for (const element of this.opComponents) {
@@ -322,7 +323,7 @@ struct ProcessIndex {
       this.selectOrderController.open()
     }
     //判断今日是否进行设备点检,否则先进行点检
-    this.deviceChecks = await ProcessRequest.post('/api/v1/process/equipDailyCheck/list', {
+    this.deviceChecks = await ProcessRequest.post('/api/v1/process/deviceDailyCheck/list', {
       stationIp: this.stationIp,
       createDate: TimeUtil.getCurrentDate()
     } as RequestParamModel)
@@ -340,8 +341,8 @@ struct ProcessIndex {
     }
     this.currentProductLine = '配件产线01'
     this.currentPLCode = 'PL000018'
-    this.currentStationId = '71'
-    this.currentStation = '装工位1'
+    this.currentStationId = '66'
+    this.currentStation = '装工位'
     let res:UserInfo = await ProcessRequest.get('/api/auth') ;
     this.currentUserId = res.id!
     // ---------------删除以上内容------------------
@@ -778,7 +779,8 @@ struct ProcessIndex {
                     process: this.process,
                   })
                 } else if (this.selectComponentType === '6') {
-                  SelfInspectView({
+                  DeviceCheckView({
+                    deviceChecks: this.deviceChecks,
                     scanState: this.scanState,
                     seqNo: this.seqNo,
                     selectOperationId: this.selectOperationId,

+ 26 - 9
entry/src/main/ets/view/DeviceInspectionDialog.ets

@@ -4,13 +4,15 @@ import ProcessDeviceDailyCheck from '../viewmodel/process/ProcessDeviceDailyChec
 import DictValue from '../viewmodel/DictValue'
 import promptAction from '@ohos.promptAction'
 import HashMap from '@ohos.util.HashMap'
+import RequestParamModel from '../viewmodel/RequestParamModel'
+import TimeUtil from '../common/util/TimeUtil'
 
 
 @CustomDialog
 export struct DeviceInspectionDialog {
   private scrollerDevice: Scroller = new Scroller()
   //查找设备编码
-  @State queryDeviceNo: string = 'KLA-METRO01'
+  @State queryDeviceNo: string = 'test000'
   //当前日期
   @State currentDate: string = ''
   // 设备点检列表
@@ -19,6 +21,7 @@ export struct DeviceInspectionDialog {
   @State selectDeviceIndex: number=-1
   // 设备类型(key为数据字典值,value为数据字典标签)
   @State deviceTypes: HashMap<string, string> = new HashMap()
+  deleteIds: string[] = []
   @Consume('stationIp') stationIp: string
   controller: CustomDialogController
   onConfirm: () => void = () => {}
@@ -26,6 +29,7 @@ export struct DeviceInspectionDialog {
   deviceTypeDictCode: string = 'device_type'
 
   async aboutToAppear() {
+    this.deleteIds = []
     let deviceDicts: DictValue[] = await ProcessRequest.get(`/api/v1/sys/dictData/queryByType/${this.deviceTypeDictCode}`)
     if (deviceDicts) {
       for (const dict of deviceDicts) {
@@ -33,6 +37,10 @@ export struct DeviceInspectionDialog {
         this.deviceTypes.set(dict.dictValue!, dict.dictLabel!);
       }
     }
+    this.deviceChecks = await ProcessRequest.post('/api/v1/process/deviceDailyCheck/list', {
+      stationIp: this.stationIp,
+      createDate: TimeUtil.getCurrentDate()
+    } as RequestParamModel)
   }
 
   build() {
@@ -80,7 +88,7 @@ export struct DeviceInspectionDialog {
                     }
                   }
                 }
-                let check: ProcessDeviceDailyCheck = await ProcessRequest.get(`/api/v1/process/equipDailyCheck/getServiceLifeByDeviceNo/${this.queryDeviceNo}`)
+                let check: ProcessDeviceDailyCheck = await ProcessRequest.get(`/api/v1/process/deviceDailyCheck/getServiceLifeByDeviceNo/${this.queryDeviceNo}`)
                 this.deviceChecks.unshift(check)
               })
               .onChange((value: string) => {
@@ -105,15 +113,15 @@ export struct DeviceInspectionDialog {
               ListItem() {
                 Row() {
                   Column(){
-                    Text(`${item.deviceName!}`)
+                    Text(this.deviceTypes && item.deviceType && this.deviceTypes.hasKey(item.deviceType) ? this.deviceTypes.get(item.deviceType) : '')
                       .fontSize($r('app.float.fontSize_24'))
                       .fontColor($r('app.color.FFFFFF'))
-                    Text('型号:' + (this.deviceTypes && item.deviceType && this.deviceTypes.hasKey(item.deviceType) ? this.deviceTypes.get(item.deviceType) : ''))
+                    Text(`名称:${item.deviceName!}`)
                       .fontSize($r('app.float.fontSize_16'))
                       .fontColor($r('app.color.FFFFFF'))
                       .fontWeight(FontWeight.Lighter)
                       .margin({top:'2%',bottom:'1%'})
-                    Text(`设备编码:${item.deviceNo!}`)
+                    Text(`编码:${item.deviceNo!}`)
                       .fontSize($r('app.float.fontSize_16'))
                       .fontColor($r('app.color.FFFFFF'))
                       .fontWeight(FontWeight.Lighter)
@@ -179,13 +187,15 @@ export struct DeviceInspectionDialog {
                      .height($r('app.float.virtualSize_48'))
                      .fillColor($r('app.color.FF453A'))
                      .onClick(()=>{
-                       this.deviceChecks.splice(index, 1);
+                       let deleteCheck: ProcessDeviceDailyCheck = this.deviceChecks.splice(index, 1)[0];
+                       if (deleteCheck.id) {
+                         this.deleteIds.push(deleteCheck.id)
+                       }
                      })
                   }
                   .width('10%')
                   .height('100%')
                   .justifyContent(FlexAlign.Center)
-
                 }
                 .height('90%')
                 .width('95%')
@@ -232,13 +242,20 @@ export struct DeviceInspectionDialog {
           .justifyContent(FlexAlign.Center)
           .width('50%')
           .onClick(async () => {
+            if (this.deleteIds && this.deleteIds.length > 0) {
+              await ProcessRequest.post('/api/v1/process/deviceDailyCheck/batchDel', {
+                ids: this.deleteIds
+              } as RequestParamModel)
+              this.deleteIds = []
+            }
             if (!this.deviceChecks || this.deviceChecks.length <= 0) {
-               return
+              this.controller.close();
+              return
             }
             for (const check of this.deviceChecks) {
               check.stationIp = this.stationIp
             }
-            await ProcessRequest.post('/api/v1/process/equipDailyCheck/batchSave', this.deviceChecks)
+            await ProcessRequest.post('/api/v1/process/deviceDailyCheck/batchSave', this.deviceChecks)
             this.controller.close();
           })
         }

+ 6 - 8
entry/src/main/ets/view/SelectWorkOrderDialog.ets

@@ -90,15 +90,15 @@ export struct SelectWorkOrderDialog {
           ForEach(this.workOrderList, (order: WorkOrderInfo, index) => {
             GridItem() {
               Row(){
-                Column() {
+                Column({space: 1}) {
                   // 订单标题(带订单号)
-                  Text(`${order.orderName}`)
-                    .fontSize($r('app.float.fontSize_30'))
+                  Text(`${order.materialName}`)
+                    .fontSize($r('app.float.fontSize_24'))
                     .fontColor($r('app.color.FFFFFF'))
                     .width('100%')
                     .textAlign(TextAlign.Start)
-                    .margin({ bottom: '2%',left:'2%' })
-                  Column({ space: 3 }) {
+                    .margin({left:'2%' })
+                  Column() {
                     Text(`产品编号: ${order.materialCode}`)
                       .fontColor($r('app.color.FFFFFF'))
                       .fontSize($r('app.float.fontSize_16'))
@@ -150,7 +150,7 @@ export struct SelectWorkOrderDialog {
                 .height('100%')
               }
             }
-            .height('27%')
+            .height('27.6%')
             .backgroundColor(index === this.selectedOrderIndex ? $r('app.color.2030D158') : $r('app.color.20FFFFFF'))
             .borderRadius($r('app.float.virtualSize_24'))
             .border({
@@ -201,8 +201,6 @@ export struct SelectWorkOrderDialog {
           .width('50%')
           .onClick(() => {
             if(this.selectedOrderIndex==-1) return
-            console.log('hhtest', 'yixuanz ----------' + JSON.stringify(this.selectWorkOder))
-            console.log('hhtest', 'yixuanz ----------' + JSON.stringify(this.workOrderList[this.selectedOrderIndex]))
             // 重新选中的工单就是之前的工单,则不做任何操作
             if (this.selectWorkOder && this.selectWorkOder.workOrderCode && this.workOrderList[this.selectedOrderIndex].workOrderCode! === this.selectWorkOder.workOrderCode!) {
               this.controller.close();

+ 17 - 5
entry/src/main/ets/view/SwitchingProductDialog.ets

@@ -53,14 +53,27 @@ export struct SwitchingProductDialog{
     if (!this.selectWorkOder.workOrderCode || !this.currentStationId) {
       return
     }
+    this.opComponents = []
     this.opComponents = await ProcessRequest.get('/api/v1/op/compent/get/' + this.currentOperationId)
     if (this.opComponents) {
       for (const element of this.opComponents) {
-        if (CommonConstants.OPERATION_COMPONENT_TYPE.has(element.compentType??'')) {
-          element.compentType = CommonConstants.OPERATION_COMPONENT_TYPE.get(element.compentType??'')
+        if (CommonConstants.OPERATION_COMPONENT_TYPE.has(element.compentType!)) {
+          element.compentType = CommonConstants.OPERATION_COMPONENT_TYPE.get(element.compentType!)
         }
       }
     }
+    // 过滤掉点检工步
+    this.opComponents = this.opComponents.filter(item => item.compentType !== '5');
+    this.opComponents.unshift({
+      compentName: '自检',
+      compentType: '5',
+      deleted: 0,
+      operationId: this.currentOperationId,
+      processRouteId: '0',
+      remark: '',
+      sortNum: 0
+    })
+    console.log('hhtest', '工步----' + JSON.stringify(this.opComponents))
   }
 
   handleAllClick():void {
@@ -316,6 +329,8 @@ export struct SwitchingProductDialog{
             }
             this.scanState = 0
             this.seqNo = this.scanSeqValue
+            this.process = {}
+            this.onSwitchProduct();
             // 保存此流转卡号到数据库中
             let seqNos: string[] = []
             seqNos = await preferencesUtil.get(CommonConstants.PREFERENCE_INSTANCE_NAME, this.selectWorkOder.workOrderCode!, seqNos)
@@ -325,9 +340,6 @@ export struct SwitchingProductDialog{
             }
             seqNos.push(this.seqNo)
             preferencesUtil.put(CommonConstants.PREFERENCE_INSTANCE_NAME, this.selectWorkOder.workOrderCode!, seqNos)
-
-            this.process = {}
-            this.onSwitchProduct();
             this.controller.close();
           })
         }

+ 187 - 3
entry/src/main/ets/view/process/DeviceCheckView.ets

@@ -8,6 +8,8 @@ import { AddUnqualifiedRecordDialog } from '../AddUnqualifiedRecordDialog'
 import DictValue from '../../viewmodel/DictValue'
 import ProcessEscalationFault from '../../viewmodel/process/ProcessEscalationFault'
 import ProcessDeviceDailyCheck from '../../viewmodel/process/ProcessDeviceDailyCheck'
+import HashMap from '@ohos.util.HashMap'
+import TimeUtil from '../../common/util/TimeUtil'
 
 // 设备点检工序
 @Component
@@ -15,21 +17,203 @@ export struct DeviceCheckView {
   // 设备每日点检
   @Link deviceChecks: ProcessDeviceDailyCheck[]
   // 扫码开工状态(0:未开工 1:已开工)
-  // @Link @Watch('queryByScanState') scanState: number
+  @Link @Watch('queryDeviceCheckByScanState') scanState: number
   // 当前流转卡号
   @Link seqNo: string
   // 选中工序id
   @Link selectOperationId: string
   // 扫码开工后的生产过程信息
   @Link process: ProcessInfo
+  //查找设备编码
+  @State queryDeviceNo: string = 'test000'
+  // 设备类型(key为数据字典值,value为数据字典标签)
+  @State deviceTypes: HashMap<string, string> = new HashMap()
+  // 当前工位IP
+  @Consume('stationIp') stationIp: string
+  deviceTypeDictCode: string = 'device_type'
+  private scrollerDevice: Scroller = new Scroller()
 
+  // 根据开工状态查询 工序设备点检/工序设备点检历史操作
+  async queryDeviceCheckByScanState() {
+    if (this.scanState === 1) {
+      this.deviceChecks = await ProcessRequest.post('/api/v1/process/deviceCheck/queryAndSave', {
+        stationIp: this.stationIp,
+        processId: this.process.id!,
+      } as RequestParamModel)
+    } else {
+      let result = await ProcessRequest.post('/api/v1/operation/device/page', {
+        operationId: this.selectOperationId,
+        pageNo: 1,
+        pageSize: 99999
+      } as RequestParamModel) as PageInfo;
+      this.deviceChecks = result.records as ProcessCheck[] || []
+    }
+  }
 
   async aboutToAppear() {
-
+    let deviceDicts: DictValue[] = await ProcessRequest.get(`/api/v1/sys/dictData/queryByType/${this.deviceTypeDictCode}`)
+    if (deviceDicts) {
+      for (const dict of deviceDicts) {
+        this.deviceTypes.set(dict.dictValue!, dict.dictLabel!);
+      }
+    }
+    this.queryDeviceCheckByScanState()
   }
 
   build() {
-    Column()
+    Column() {
+      Text("扫描设备 ")
+        .fontColor($r('app.color.FFFFFF'))
+        .fontSize($r('app.float.fontSize_24'))
+        .height('7.9%')
+        .width('97.2%')
+      Row(){
+        Row() {
+          // 左侧二维码图标
+          Image($r('app.media.material_qr_code'))
+            .width($r('app.float.virtualSize_32'))
+            .height($r('app.float.virtualSize_32'))
+            .fillColor($r('app.color.FFFFFF'))
+            .objectFit(ImageFit.Contain)
+            .margin({left:'0.7%'})
+          // 扫码输入框
+          TextInput({text:this.queryDeviceNo, placeholder: '请扫描设备编码' })
+            .type(InputType.Normal)
+            .placeholderFont({ size: $r('app.float.fontSize_16') })
+            .placeholderColor($r('app.color.30FFFFFF'))
+            .fontSize($r('app.float.fontSize_16'))
+            .fontColor($r('app.color.FFFFFF'))
+            .enableKeyboardOnFocus(false)
+            .onSubmit(async () => {
+              if (this.deviceChecks) {
+                for (const element of this.deviceChecks) {
+                  if (element.deviceNo === this.queryDeviceNo) {
+                    promptAction.showToast({
+                      message: `设备今日已点检,无需重复点检!`,
+                      duration: 1500,
+                      bottom: 100
+                    })
+                    return
+                  }
+                }
+              }
+              let check: ProcessDeviceDailyCheck = await ProcessRequest.get(`/api/v1/process/deviceDailyCheck/getServiceLifeByDeviceNo/${this.queryDeviceNo}`)
+              this.deviceChecks.unshift(check)
+            })
+            .onChange((value: string) => {
+              this.queryDeviceNo = value;
+            })
+        }
+        .height('100%')
+        .width('27.2%')
+        .borderRadius($r('app.float.virtualSize_16'))
+        .backgroundColor($r('app.color.000000'))
+        Text(TimeUtil.getCurrentDate())
+          .fontColor($r('app.color.FFFFFF'))
+          .fontSize($r('app.float.fontSize_16'))
+          .margin({left:'3%'})
+      }
+      .height('7.1%')
+      .width('97.2%')
+
+      Column() {
+        List({scroller: this.scrollerDevice }) {
+          ForEach(this.deviceChecks, (item: ProcessDeviceDailyCheck, index) => {
+            ListItem() {
+              Row() {
+                Column(){
+                  Text(this.deviceTypes && item.deviceType && this.deviceTypes.hasKey(item.deviceType) ? this.deviceTypes.get(item.deviceType) : '')
+                    .fontSize($r('app.float.fontSize_24'))
+                    .fontColor($r('app.color.FFFFFF'))
+                  Text(`名称:${item.deviceName!}`)
+                    .fontSize($r('app.float.fontSize_16'))
+                    .fontColor($r('app.color.FFFFFF'))
+                    .fontWeight(FontWeight.Lighter)
+                    .margin({top:'2%',bottom:'1%'})
+                  Text(`编码:${item.deviceNo!}`)
+                    .fontSize($r('app.float.fontSize_16'))
+                    .fontColor($r('app.color.FFFFFF'))
+                    .fontWeight(FontWeight.Lighter)
+                }
+                .width('30%')
+                .height('100%')
+                .justifyContent(FlexAlign.Center)
+                .alignItems(HorizontalAlign.Start)
+                .margin({right:'16%'})
+
+                Column({space:5}){
+                  Text(`计量有效期:`)
+                    .fontSize($r('app.float.fontSize_16'))
+                    .fontColor($r('app.color.FFFFFF'))
+                    .fontWeight(FontWeight.Lighter)
+                  if (this.scanState === 1) {
+                    Row(){
+                      Image(item.meteringState! === 1 ? $r('app.media.device_normal') : $r('app.media.device_expire'))
+                        .width($r('app.float.virtualSize_24'))
+                        .height($r('app.float.virtualSize_24'))
+                        .margin({left:'2%'})
+                      Text(item.meteringDate ? `${item.meteringDate}` : '长期有效')
+                        .fontSize($r('app.float.fontSize_16'))
+                        .fontColor(item.meteringState! === 1 ? $r('app.color.30D158') : $r('app.color.FF453A'))
+                        .margin({left:'2%'})
+                    }
+                    .width('65%')
+                    .borderRadius($r('app.float.virtualSize_16'))
+                    .backgroundColor($r('app.color.000000'))
+                    .height('25%')
+                    .alignItems(VerticalAlign.Center)
+                  }
+                }
+                .width('22%')
+                .height('100%')
+                .justifyContent(FlexAlign.Center)
+                .alignItems(HorizontalAlign.Start)
+                Column({space:5}){
+                  Text(`维保有效期:`)
+                    .fontSize($r('app.float.fontSize_16'))
+                    .fontColor($r('app.color.FFFFFF'))
+                    .fontWeight(FontWeight.Lighter)
+                  if (this.scanState === 1) {
+                    Row() {
+                      Image(item.warrantyState! === 1 ? $r('app.media.device_normal') : $r('app.media.device_expire'))
+                        .width($r('app.float.virtualSize_24'))
+                        .height($r('app.float.virtualSize_24'))
+                        .margin({ left: '2%' })
+                      Text(item.warrantyPeriod ? `${item.warrantyPeriod}` : '长期有效')
+                        .fontSize($r('app.float.fontSize_16'))
+                        .fontColor(item.warrantyState! === 1 ? $r('app.color.30D158') : $r('app.color.FF453A'))
+                        .margin({ left: '2%' })
+                    }
+                    .width('65%')
+                    .borderRadius($r('app.float.virtualSize_16'))
+                    .backgroundColor($r('app.color.000000'))
+                    .height('25%')
+                    .alignItems(VerticalAlign.Center)
+                  }
+                }
+                .width('22%')
+                .height('100%')
+                .justifyContent(FlexAlign.Center)
+                .alignItems(HorizontalAlign.Start)
+              }
+              .height('90%')
+              .width('97%')
+              .justifyContent(FlexAlign.Start)
+            }
+            .height('17%')
+            .width('100%')
+            .margin({ bottom: 8})
+            .borderRadius($r('app.float.virtualSize_16'))
+            .backgroundColor($r('app.color.10FFFFFF'))
+          })
+        }
+        .height('94%')
+        .width('100%')
+      }
+      .justifyContent(FlexAlign.Center)
+      .height('85%')
+      .width('97.2%')
+    }
     .width('100%')
     .height('100%')
   }

+ 1 - 1
entry/src/main/ets/view/process/SelfInspectView.ets

@@ -206,7 +206,7 @@ export struct SelfInspectView {
           ForEach(this.defectRecords, (item: ProcessEscalationFault, index: number) => {
             ListItem() {
               Column() {
-                Text(item.reasonList ? item.reasonList[0].bugTypeLabel! + '(' + item.reasonList[0].bugName! + ')' : '')
+                Text(item.reasonList && item.reasonList[0] && item.reasonList[0].bugTypeLabel ? item.reasonList[0].bugTypeLabel! + '(' + item.reasonList[0].bugName! + ')' : '')
                   .fontColor($r('app.color.FFFFFF'))
                   .fontSize($r('app.float.fontSize_16'))
                   .fontWeight(FontWeight.Bold)

+ 1 - 1
entry/src/main/ets/viewmodel/RequestParamModel.ets

@@ -74,7 +74,7 @@ export default class RequestParamModel {
   stateList?:Array<number>
   //开工二维码
   qrCode?:string
-  //消息id集合
+  //id集合
   ids?:string[]
   //载具绑定工序id
   vehicleOperationId?:string