|
@@ -3,9 +3,11 @@ import { ProcessTitleComp } from '../../common/component/ProcessTitleComp'
|
|
|
import CommonConstants from '../../common/constants/CommonConstants'
|
|
|
import JGRequest from '../../common/util/request/Request'
|
|
|
import StorageRequest from '../../common/util/request/StorageRequest'
|
|
|
+import { MaterialInformationList } from '../../model/MaterialInformation'
|
|
|
import { StationInfoModel } from '../../model/StorageSpace'
|
|
|
import MaterialInfo from '../../viewmodel/MaterialInfo'
|
|
|
import RequestParamModel from '../../viewmodel/RequestParamModel'
|
|
|
+import promptAction from '@ohos.promptAction'
|
|
|
|
|
|
|
|
|
/*
|
|
@@ -16,7 +18,7 @@ import RequestParamModel from '../../viewmodel/RequestParamModel'
|
|
|
export struct MaterialCirculationPage {
|
|
|
@State materialCode: string = ''
|
|
|
// 扫码后展示的物料
|
|
|
- @State materialArray: MaterialInfo[] = [{}, {}, {}, {}, {}, {}, {}, {}, {}]
|
|
|
+ @State materialArray: MaterialInformationList[] = []
|
|
|
// 料箱号
|
|
|
@State materialBoxCode: string = ''
|
|
|
@State materialBox: MaterialBox = {}
|
|
@@ -49,7 +51,7 @@ export struct MaterialCirculationPage {
|
|
|
|
|
|
// 查询物料信息(type: 1有仓库 0没有仓库)
|
|
|
async queryAndDisplayMaterial(materialCode: string) {
|
|
|
- let result: MaterialInfo = await JGRequest.post("/api/v1/process/circulation/material", {
|
|
|
+ let result: MaterialInformationList = await JGRequest.post("/api/v1/process/circulation/material", {
|
|
|
label: this.materialCode
|
|
|
} as RequestParamModel)
|
|
|
if (result) {
|
|
@@ -145,7 +147,6 @@ export struct MaterialCirculationPage {
|
|
|
}
|
|
|
.width(px2vp(608))
|
|
|
.height('100%')
|
|
|
- .border({ width: 2, color: Color.Yellow })
|
|
|
|
|
|
Row() {
|
|
|
}.width('2%')
|
|
@@ -188,7 +189,6 @@ export struct MaterialCirculationPage {
|
|
|
.width('100%')
|
|
|
.justifyContent(FlexAlign.Start)
|
|
|
.alignItems(VerticalAlign.Top)
|
|
|
- .border({ width: 2, color: Color.Blue })
|
|
|
|
|
|
List({ space: 8 }) {
|
|
|
ForEach(this.materialArray, (item: MaterialInfo, index: number) => {
|
|
@@ -200,7 +200,7 @@ export struct MaterialCirculationPage {
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor($r('app.color.general_font_color'))
|
|
|
.opacity($r('app.float.general_font_opacity'))
|
|
|
- Text(item.materialCode && item.materialCode.length > 0 ? item.materialCode : item.batchCode)
|
|
|
+ Text(item.materialCode)
|
|
|
.fontSize($r('app.float.fontSize_24'))
|
|
|
.fontColor($r('app.color.general_font_color'))
|
|
|
.opacity($r('app.float.process_step_font_opacity'))
|
|
@@ -217,7 +217,7 @@ export struct MaterialCirculationPage {
|
|
|
.fontColor($r('app.color.general_font_color'))
|
|
|
.opacity($r('app.float.general_font_opacity'))
|
|
|
.fontWeight(FontWeight.Bold)
|
|
|
- Text('个')
|
|
|
+ Text(item.unitDictLabel)
|
|
|
.fontSize($r('app.float.fontSize_24'))
|
|
|
.fontColor($r('app.color.general_font_color'))
|
|
|
.opacity($r('app.float.process_step_font_opacity'))
|
|
@@ -251,11 +251,9 @@ export struct MaterialCirculationPage {
|
|
|
.width('100%')
|
|
|
.padding({ top: 10 })
|
|
|
.layoutWeight(1)
|
|
|
- .border({ width: 2, color: Color.Black })
|
|
|
}
|
|
|
.width('67.5%')
|
|
|
.justifyContent(FlexAlign.Start)
|
|
|
- .border({ width: 2, color: Color.Red })
|
|
|
|
|
|
Column() {
|
|
|
Row() {
|
|
@@ -314,7 +312,7 @@ export struct MaterialCirculationPage {
|
|
|
.borderRadius($r('app.float.robot_set_radius'))
|
|
|
.backgroundColor($r('app.color.robot_set_coord_card_grey'))
|
|
|
.onClick(() => {
|
|
|
-
|
|
|
+ this.materialArray = []
|
|
|
})
|
|
|
Row()
|
|
|
.width('1.25%')
|
|
@@ -332,15 +330,23 @@ export struct MaterialCirculationPage {
|
|
|
// }
|
|
|
|
|
|
// 添加流转
|
|
|
- // await JGRequest.post('/api/v1/process/circulation/add', {
|
|
|
- // circulationDetail: this.materialArray,
|
|
|
- // houseNo: this.destinationArray[this.selectDestination].houseNo,
|
|
|
- // stationId: CommonConstants.STATION_ID,
|
|
|
- // targetType: this.destinationArray[this.selectDestination].targetType,
|
|
|
- // vehicleCode: this.materialBox.code,
|
|
|
- // vehicleId: Number.parseInt(this.materialBox.id),
|
|
|
- // vehicleName: this.materialBox.name
|
|
|
- // } as RequestParamModel)
|
|
|
+ await JGRequest.post('/api/v1/process/circulation/add', {
|
|
|
+ circulationDetail: this.materialArray,
|
|
|
+ houseNo: "1",
|
|
|
+ stationId: this.destinationArray[this.selectDestination].id,
|
|
|
+ targetType: this.destinationArray[this.selectDestination].targetType,
|
|
|
+ vehicleCode: this.recentlyRecordObject.rfid,
|
|
|
+ // vehicleId:this.recentlyRecordObject.i ,
|
|
|
+ // vehicleName: this.materialBox.name
|
|
|
+ } as RequestParamModel)
|
|
|
+
|
|
|
+ this.materialArray = []
|
|
|
+
|
|
|
+ promptAction.showToast({
|
|
|
+ message: "请求成功,任务正在进行中...",
|
|
|
+ duration: 1800,
|
|
|
+ bottom: "50%"
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
.justifyContent(FlexAlign.Center)
|