|
@@ -1,4 +1,7 @@
|
|
|
+import CommonConstants from '../../common/constants/CommonConstants'
|
|
|
import WmsRequest from '../../common/util/request/WmsRequest'
|
|
|
+import StationOperationInfo from '../../viewmodel/wms/StationOperationInfo'
|
|
|
+import OperationInfo from '../../viewmodel/wms/OperationInfo'
|
|
|
import RequestParamModel from '../../viewmodel/wms/RequestParamModel'
|
|
|
import WorkOrderInfo from '../../viewmodel/wms/WorkOrderInfo'
|
|
|
|
|
@@ -8,18 +11,134 @@ export struct ProcessMaterialKitOneStep {
|
|
|
@Link workOrder: WorkOrderInfo
|
|
|
|
|
|
@State workOrderArray: WorkOrderInfo[] = []
|
|
|
+ @State operationArray: StationOperationInfo[] = [
|
|
|
+ {
|
|
|
+ operationVO: [
|
|
|
+ {
|
|
|
+ id: '588',
|
|
|
+ operationCode: 'XFOP-0052',
|
|
|
+ operationName: '领料',
|
|
|
+ operationOp: '',
|
|
|
+ stanType: '10'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ stanType: '10',
|
|
|
+ stanTypeName: 'tes'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ operationVO: [
|
|
|
+ {
|
|
|
+ id: '536',
|
|
|
+ operationCode: 'XFOP-0015',
|
|
|
+ operationName: '装配',
|
|
|
+ operationOp: '',
|
|
|
+ stanType: '13',
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ stanType: '13'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ operationVO: [
|
|
|
+ {
|
|
|
+ id: '537',
|
|
|
+ operationName: '调试',
|
|
|
+ operationOp: '',
|
|
|
+ stanType: '7',
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ stanType: '7'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ operationVO: [
|
|
|
+ {
|
|
|
+ id: '538',
|
|
|
+ operationCode: 'XFOP-0017',
|
|
|
+ operationName: '装配',
|
|
|
+ operationOp: '',
|
|
|
+ stanType: '13',
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ stanType: '13'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ operationVO: [
|
|
|
+ {
|
|
|
+ id: '540',
|
|
|
+ operationCode: 'XFOP-0019',
|
|
|
+ operationName: '检测',
|
|
|
+ operationOp: '',
|
|
|
+ stanType: '9',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '539',
|
|
|
+ operationCode: 'XFOP-0018',
|
|
|
+ operationName: '调试',
|
|
|
+ operationOp: '',
|
|
|
+ stanType: '9',
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ stanType: '9'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ operationVO: [
|
|
|
+ {
|
|
|
+ id: '541',
|
|
|
+ operationCode: 'XFOP-0020',
|
|
|
+ operationName: '试验',
|
|
|
+ stanType: '7',
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ stanType: '7'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
|
|
|
@State selectWorkOrder: number = 0
|
|
|
+ @State selectOperations: string[] = []
|
|
|
+
|
|
|
+
|
|
|
+ stationType: string = 'station_type'
|
|
|
|
|
|
async aboutToAppear() {
|
|
|
- this.workOrderArray = await WmsRequest.post('/api/v1/plan/workOrder/list', {
|
|
|
+ this.workOrderArray = await WmsRequest.post('/api/v1/wms/workOrder/list', {
|
|
|
//查询未完成的工单
|
|
|
queryComplete: 0,
|
|
|
} as RequestParamModel) as WorkOrderInfo[]
|
|
|
if (this.workOrderArray && this.workOrderArray.length > 0) {
|
|
|
this.workOrder = this.workOrderArray[0]
|
|
|
this.selectWorkOrder = 0
|
|
|
+ console.log('hhtest', '----------' + JSON.stringify(this.workOrderArray[0]))
|
|
|
+ this.operationArray = await WmsRequest.post('/api/v1/wms/operation/list', {
|
|
|
+ //查询未完成的工单
|
|
|
+ processRouteId: this.workOrderArray[0]?.processRouteId,
|
|
|
+ } as RequestParamModel) as StationOperationInfo[]
|
|
|
}
|
|
|
+
|
|
|
+ if (this.operationArray && this.operationArray.length > 0) {
|
|
|
+ // 获取不合格原因的数据字典
|
|
|
+ let dictArray = CommonConstants.DICT_DATA.get(this.stationType);
|
|
|
+ if (!dictArray || dictArray.length <= 0) {
|
|
|
+ dictArray = await WmsRequest.get('/api/v1/sys/dictData/queryByType/' + this.stationType as string, {})
|
|
|
+ }
|
|
|
+ if (!dictArray) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for (const element of this.operationArray) {
|
|
|
+ for (const dict of dictArray) {
|
|
|
+ if (element.stanType === dict.dictValue) {
|
|
|
+ element.stanTypeName = dict.dictLabel
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log('hhtest', '---------------')
|
|
|
+ console.log('hhtest', '---------------')
|
|
|
+ console.log('hhtest', '---------------')
|
|
|
+ console.log('hhtest', '---------------')
|
|
|
+ console.log('hhtest', JSON.stringify(this.operationArray))
|
|
|
+ console.log('hhtest', '---------------')
|
|
|
+ console.log('hhtest', '---------------')
|
|
|
+ console.log('hhtest', '---------------')
|
|
|
}
|
|
|
|
|
|
build() {
|
|
@@ -32,10 +151,10 @@ export struct ProcessMaterialKitOneStep {
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
}
|
|
|
.height('10%')
|
|
|
- .width('29.6%')
|
|
|
+ .width('100%')
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
|
|
|
- List() {
|
|
|
+ List({space: 5}) {
|
|
|
ForEach(this.workOrderArray, (item: WorkOrderInfo, index: number) => {
|
|
|
ListItem() {
|
|
|
Column() {
|
|
@@ -52,12 +171,6 @@ export struct ProcessMaterialKitOneStep {
|
|
|
|
|
|
Column() {
|
|
|
Text('工单编号:' + (item.workOrderCode ? item.workOrderCode : ''))
|
|
|
- .fontSize($r('app.float.fontSize_9_6'))
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- .fontColor($r('app.color.FFFFFF'))
|
|
|
- .maxLines(1)
|
|
|
-
|
|
|
- Text('工单编号:' + (item.workOrderCode ? item.workOrderCode : ''))
|
|
|
.fontSize($r('app.float.fontSize_6_4'))
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
@@ -69,7 +182,7 @@ export struct ProcessMaterialKitOneStep {
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.maxLines(1)
|
|
|
|
|
|
- Text('齐套进度:' + item.kitCompleteProgress)
|
|
|
+ Text('齐套进度:' + (item.kitCompleteProgress ? item.kitCompleteProgress : 0) + '%')
|
|
|
.fontSize($r('app.float.fontSize_6_4'))
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
@@ -77,10 +190,12 @@ export struct ProcessMaterialKitOneStep {
|
|
|
}
|
|
|
.height('48.3%')
|
|
|
.width('91%')
|
|
|
- .justifyContent(FlexAlign.SpaceBetween)
|
|
|
+ .alignItems(HorizontalAlign.Start)
|
|
|
+ .justifyContent(FlexAlign.SpaceAround)
|
|
|
}
|
|
|
.height('15.4%')
|
|
|
.width('92.6%')
|
|
|
+ .borderRadius($r('app.float.virtualSize_6_4'))
|
|
|
.justifyContent(FlexAlign.Start)
|
|
|
.backgroundColor(this.selectWorkOrder === index ? $r('app.color.2030D158') : $r('app.color.20FFFFFF'))
|
|
|
}
|
|
@@ -88,8 +203,151 @@ export struct ProcessMaterialKitOneStep {
|
|
|
}
|
|
|
.width('100%')
|
|
|
.height('90%')
|
|
|
+ .alignListItem(ListItemAlign.Center)
|
|
|
+ }
|
|
|
+ .height('100%')
|
|
|
+ .width('29.6%')
|
|
|
+ .borderRadius($r('app.float.virtualSize_6_4'))
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .backgroundColor($r('app.color.10FFFFFF'))
|
|
|
+
|
|
|
+ Column() {
|
|
|
+ Row() {
|
|
|
+ Text('选择工序')
|
|
|
+ .fontSize($r('app.float.fontSize_12'))
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
+ .fontWeight(FontWeight.Medium)
|
|
|
+ }
|
|
|
+ .height('10%')
|
|
|
+ .width('100%')
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+
|
|
|
+ List() {
|
|
|
+ ForEach(this.operationArray, (item: StationOperationInfo, index: number) => {
|
|
|
+ ListItem() {
|
|
|
+ Column() {
|
|
|
+ Row() {
|
|
|
+ Row() {
|
|
|
+ Text(item.stanTypeName ? item.stanTypeName : (item.stanType ? item.stanType : ''))
|
|
|
+ .fontSize($r('app.float.fontSize_6_4'))
|
|
|
+ .fontWeight(FontWeight.Lighter)
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
+ }
|
|
|
+ .height('100%')
|
|
|
+ .width('40%')
|
|
|
+ .alignItems(VerticalAlign.Center)
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
+
|
|
|
+ Column() {
|
|
|
+ ForEach(item.operationVO, (operation: OperationInfo, index: number) => {
|
|
|
+ Column() {
|
|
|
+ Row().height(6)
|
|
|
+ Row({space: 5}) {
|
|
|
+ Checkbox()
|
|
|
+ .select(this.selectOperations.indexOf(operation.id) > -1 ? true : false)
|
|
|
+ .selectedColor($r('app.color.30D158'))
|
|
|
+ .width($r('app.float.virtualSize_8'))
|
|
|
+ .height($r('app.float.virtualSize_8'))
|
|
|
+ .onChange((value: boolean) => {
|
|
|
+ if (value) {
|
|
|
+ if (!this.selectOperations.includes(operation.id)) {
|
|
|
+ this.selectOperations.push(operation.id)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (this.selectOperations.includes(operation.id)) {
|
|
|
+ this.selectOperations = this.selectOperations.splice(this.selectOperations.indexOf(operation.id), 1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log('hhtest', '---' + JSON.stringify(this.selectOperations))
|
|
|
+ })
|
|
|
+ Text(operation.operationName ? operation.operationName : '')
|
|
|
+ .fontSize($r('app.float.fontSize_9_6'))
|
|
|
+ .fontWeight(FontWeight.Medium)
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .height(48)
|
|
|
+ .padding({left: '6%'})
|
|
|
+ .backgroundColor(this.selectOperations.indexOf(operation.id) > -1 ? $r('app.color.2030D158') : $r('app.color.20FFFFFF'))
|
|
|
+ .borderRadius($r('app.float.virtualSize_6_4'))
|
|
|
+ .onClick(()=>{
|
|
|
+ if (this.selectOperations.includes(operation.id)) {
|
|
|
+ this.selectOperations.splice(this.selectOperations.indexOf(operation.id), 1)
|
|
|
+ } else {
|
|
|
+ this.selectOperations.push(operation.id)
|
|
|
+ }
|
|
|
+ console.log('hhtest', '---' + JSON.stringify(this.selectOperations))
|
|
|
+ })
|
|
|
+ Row().height(6)
|
|
|
+ }
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .width('60%')
|
|
|
+ .height('100%')
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ }
|
|
|
+ Divider().vertical(false)
|
|
|
+ .color($r('app.color.10FFFFFF'))
|
|
|
+ .width('100%')
|
|
|
+ }
|
|
|
+ .width('92.6%')
|
|
|
+ .height(item.operationVO?.length! * 60)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .height('90%')
|
|
|
+ .alignListItem(ListItemAlign.Center)
|
|
|
}
|
|
|
+ .height('100%')
|
|
|
+ .width('29.6%')
|
|
|
+ .borderRadius($r('app.float.virtualSize_6_4'))
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .backgroundColor($r('app.color.10FFFFFF'))
|
|
|
+
|
|
|
+ Column() {
|
|
|
+ Row() {
|
|
|
+ Text('需求物料')
|
|
|
+ .fontSize($r('app.float.fontSize_12'))
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
+ .fontWeight(FontWeight.Medium)
|
|
|
+ }
|
|
|
+ .height('10%')
|
|
|
+ .width('100%')
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+
|
|
|
+ List() {
|
|
|
+ ForEach(this.operationArray, (item: StationOperationInfo, index: number) => {
|
|
|
+ ListItem() {
|
|
|
+ Row() {
|
|
|
+ Row() {
|
|
|
+ Text(item.stanTypeName ? item.stanTypeName : (item.stanType ? item.stanType : ''))
|
|
|
+ .fontSize($r('app.float.fontSize_9_6'))
|
|
|
+ .fontWeight(FontWeight.Medium)
|
|
|
+ .fontColor($r('app.color.FFFFFF'))
|
|
|
+ .maxLines(1)
|
|
|
+ }
|
|
|
+ .height('100%')
|
|
|
+ .width('91%')
|
|
|
+ .alignItems(VerticalAlign.Bottom)
|
|
|
|
|
|
+ }
|
|
|
+ .height(item.operationVO?.length! * 14.5 + '%')
|
|
|
+ .width('92.6%')
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
+ .backgroundColor(this.selectWorkOrder === index ? $r('app.color.2030D158') : $r('app.color.20FFFFFF'))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .height('90%')
|
|
|
+ }
|
|
|
+ .height('100%')
|
|
|
+ .width('29.6%')
|
|
|
+ .borderRadius($r('app.float.virtualSize_6_4'))
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .backgroundColor($r('app.color.10FFFFFF'))
|
|
|
}
|
|
|
.width('100%')
|
|
|
.height('100%')
|