|
@@ -3,13 +3,13 @@ import WorkOrderInfo from '../../viewmodel/wms/WorkOrderInfo'
|
|
import OperationItem from '../../viewmodel/wms/OperationItem'
|
|
import OperationItem from '../../viewmodel/wms/OperationItem'
|
|
import WmsRequest from '../../common/util/request/WmsRequest'
|
|
import WmsRequest from '../../common/util/request/WmsRequest'
|
|
import RequestParamModel from '../../viewmodel/wms/RequestParamModel'
|
|
import RequestParamModel from '../../viewmodel/wms/RequestParamModel'
|
|
-import HouseStock from '../../viewmodel/wms/MaterialBoxInfo'
|
|
|
|
|
|
+import MaterialBoxInfo from '../../viewmodel/wms/MaterialBoxInfo'
|
|
import CommonConstants from '../../common/constants/CommonConstants'
|
|
import CommonConstants from '../../common/constants/CommonConstants'
|
|
import DictInfo from '../../viewmodel/DictInfo'
|
|
import DictInfo from '../../viewmodel/DictInfo'
|
|
import HashMap from '@ohos.util.HashMap'
|
|
import HashMap from '@ohos.util.HashMap'
|
|
import VehicleInfo from '../../viewmodel/wms/VehicleInfo'
|
|
import VehicleInfo from '../../viewmodel/wms/VehicleInfo'
|
|
import { InBoundView } from '../../component/InBoundView'
|
|
import { InBoundView } from '../../component/InBoundView'
|
|
-import HouseStockMaterial from '../../viewmodel/wms/MaterialInfo'
|
|
|
|
|
|
+import MaterialInfo from '../../viewmodel/wms/MaterialInfo'
|
|
import promptAction from '@ohos.promptAction'
|
|
import promptAction from '@ohos.promptAction'
|
|
import OperationMaterial from '../../viewmodel/wms/OperationMaterial'
|
|
import OperationMaterial from '../../viewmodel/wms/OperationMaterial'
|
|
|
|
|
|
@@ -19,14 +19,16 @@ export struct OperationMaterialKitTwoStep {
|
|
@Link workOrder: WorkOrderInfo
|
|
@Link workOrder: WorkOrderInfo
|
|
@Link selectOperations: OperationInfo[]
|
|
@Link selectOperations: OperationInfo[]
|
|
@Link operationItems: OperationItem[]
|
|
@Link operationItems: OperationItem[]
|
|
- @State ScanMaterialList:WorkOrderInfo[] = []
|
|
|
|
|
|
+ // 出库料箱中的库存物料信息
|
|
|
|
+ @Link outMaterialBoxInfos: MaterialInfo[]
|
|
|
|
+ @State scanMaterialList: MaterialInfo[] = []
|
|
selectOperationIds: string[] = []
|
|
selectOperationIds: string[] = []
|
|
// 每个工序需要的物料编码分组
|
|
// 每个工序需要的物料编码分组
|
|
operationItemCodes: HashMap<string, string[]> = new HashMap<string, string[]>()
|
|
operationItemCodes: HashMap<string, string[]> = new HashMap<string, string[]>()
|
|
@State operationNames: string = ''
|
|
@State operationNames: string = ''
|
|
// 选择已有料箱,出库料箱
|
|
// 选择已有料箱,出库料箱
|
|
@State selectVehicleCode: string = ''
|
|
@State selectVehicleCode: string = ''
|
|
- @State houseStocks: HouseStock[] = []
|
|
|
|
|
|
+ @State materialBoxInfos: MaterialBoxInfo[] = []
|
|
@State materialNum: number = 0
|
|
@State materialNum: number = 0
|
|
// 空箱编码
|
|
// 空箱编码
|
|
@State vehicleCode: string = ''
|
|
@State vehicleCode: string = ''
|
|
@@ -34,35 +36,34 @@ export struct OperationMaterialKitTwoStep {
|
|
// 扫描或手动输入的物料编码
|
|
// 扫描或手动输入的物料编码
|
|
@State scanCode: string = ''
|
|
@State scanCode: string = ''
|
|
// 物料全数组(本次扫描物料弹窗中展示)
|
|
// 物料全数组(本次扫描物料弹窗中展示)
|
|
- @State materialArray: HouseStockMaterial[] = []
|
|
|
|
|
|
+ @State materialArray: MaterialInfo[] = []
|
|
// 数量合并的物料数组(在拣选工作台展示)
|
|
// 数量合并的物料数组(在拣选工作台展示)
|
|
- @State materialMergeArray: HouseStockMaterial[] = []
|
|
|
|
|
|
+ @State materialMergeArray: MaterialInfo[] = []
|
|
//齐套料箱扫码后如果物料存在则自动滚动所在列
|
|
//齐套料箱扫码后如果物料存在则自动滚动所在列
|
|
@State scanCodeIndex: number = -1
|
|
@State scanCodeIndex: number = -1
|
|
materialScrollerController: Scroller = new Scroller()
|
|
materialScrollerController: Scroller = new Scroller()
|
|
- // 出库料箱中的库存物料信息(暂时用不上)
|
|
|
|
- outHouseStocks: HouseStock[] = []
|
|
|
|
|
|
|
|
- houseStockDialogController: CustomDialogController = new CustomDialogController({
|
|
|
|
- builder: houseStockDialog({
|
|
|
|
- houseStocks: this.houseStocks,
|
|
|
|
|
|
+ // 选择料箱弹窗控制器
|
|
|
|
+ selectMaterialBoxDialogController: CustomDialogController = new CustomDialogController({
|
|
|
|
+ builder: SelectMaterialBoxDialog({
|
|
|
|
+ MaterialBoxInfos: this.materialBoxInfos,
|
|
selectVehicleCode: this.selectVehicleCode,
|
|
selectVehicleCode: this.selectVehicleCode,
|
|
confirm: async () => {
|
|
confirm: async () => {
|
|
- if (!this.selectVehicleCode || !this.houseStocks || this.houseStocks.length <= 0) {
|
|
|
|
|
|
+ if (!this.selectVehicleCode || !this.materialBoxInfos || this.materialBoxInfos.length <= 0) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
let houseNo = ''
|
|
let houseNo = ''
|
|
- for (const element of this.houseStocks) {
|
|
|
|
|
|
+ for (const element of this.materialBoxInfos) {
|
|
if (this.selectVehicleCode === element.vehicleCode) {
|
|
if (this.selectVehicleCode === element.vehicleCode) {
|
|
houseNo = element.houseNo!
|
|
houseNo = element.houseNo!
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- let res: VehicleInfo = await WmsRequest.post("/api/v1/wmsOrder/outBox", {
|
|
|
|
|
|
+ let res: VehicleInfo = await WmsRequest.post('/api/v1/wmsOrder/outBox', {
|
|
houseNo: houseNo,
|
|
houseNo: houseNo,
|
|
vehicleNo:this.selectVehicleCode,
|
|
vehicleNo:this.selectVehicleCode,
|
|
} as RequestParamModel)
|
|
} as RequestParamModel)
|
|
if (res && res.list) {
|
|
if (res && res.list) {
|
|
- this.outHouseStocks = res.list
|
|
|
|
|
|
+ this.outMaterialBoxInfos = res.list
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -70,9 +71,9 @@ export struct OperationMaterialKitTwoStep {
|
|
autoCancel: true, // 点击遮罩关闭
|
|
autoCancel: true, // 点击遮罩关闭
|
|
customStyle: true,
|
|
customStyle: true,
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+ // 本次扫描物料弹窗控制器
|
|
thisScanDialogController: CustomDialogController = new CustomDialogController({
|
|
thisScanDialogController: CustomDialogController = new CustomDialogController({
|
|
- builder: thisScanDialog({
|
|
|
|
|
|
+ builder: ThisScanDialog({
|
|
materialMergeArray: this.materialMergeArray,
|
|
materialMergeArray: this.materialMergeArray,
|
|
materialArray: this.materialArray,
|
|
materialArray: this.materialArray,
|
|
confirm: async () => {}
|
|
confirm: async () => {}
|
|
@@ -83,9 +84,9 @@ export struct OperationMaterialKitTwoStep {
|
|
|
|
|
|
// 齐套操作-扫描物料
|
|
// 齐套操作-扫描物料
|
|
scanMaterialCode = async (itemCode: string) => {
|
|
scanMaterialCode = async (itemCode: string) => {
|
|
- this.scanCode = ""
|
|
|
|
- let res: HouseStockMaterial = await WmsRequest.post("/api/v1/process/circulation/material", {
|
|
|
|
- label: itemCode //"#gys022#sc022#100#20220929#31"
|
|
|
|
|
|
+ this.scanCode = ''
|
|
|
|
+ let res: MaterialInfo = await WmsRequest.post('/api/v1/process/circulation/material', {
|
|
|
|
+ label: itemCode //'#gys022#sc022#100#20220929#31'
|
|
} as RequestParamModel)
|
|
} as RequestParamModel)
|
|
// 判断扫描完成后返回的物料码是否是当前需要齐套的物料
|
|
// 判断扫描完成后返回的物料码是否是当前需要齐套的物料
|
|
let hasFlag: boolean = false
|
|
let hasFlag: boolean = false
|
|
@@ -97,8 +98,8 @@ export struct OperationMaterialKitTwoStep {
|
|
}
|
|
}
|
|
if (!hasFlag) {
|
|
if (!hasFlag) {
|
|
promptAction.showToast({
|
|
promptAction.showToast({
|
|
- message: "不是当前工序中的物料",
|
|
|
|
- bottom: "50%",
|
|
|
|
|
|
+ message: '不是当前工序中的物料',
|
|
|
|
+ bottom: '50%',
|
|
duration: 2000
|
|
duration: 2000
|
|
})
|
|
})
|
|
return
|
|
return
|
|
@@ -121,6 +122,9 @@ export struct OperationMaterialKitTwoStep {
|
|
// 物料全数组默认都新增在数组头部
|
|
// 物料全数组默认都新增在数组头部
|
|
this.materialArray.unshift(res)
|
|
this.materialArray.unshift(res)
|
|
this.materialScrollerController.scrollToIndex(this.scanCodeIndex)
|
|
this.materialScrollerController.scrollToIndex(this.scanCodeIndex)
|
|
|
|
+ for (const element of this.outMaterialBoxInfos) {
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// 齐套绑定
|
|
// 齐套绑定
|
|
@@ -128,7 +132,7 @@ export struct OperationMaterialKitTwoStep {
|
|
// 接口只支持根据工序去绑定,需要先遍历
|
|
// 接口只支持根据工序去绑定,需要先遍历
|
|
let paramArray: RequestParamModel[] = []
|
|
let paramArray: RequestParamModel[] = []
|
|
this.operationItemCodes.forEach((value: string[], key: string) => {
|
|
this.operationItemCodes.forEach((value: string[], key: string) => {
|
|
- let itemArray: HouseStockMaterial[] = []
|
|
|
|
|
|
+ let itemArray: MaterialInfo[] = []
|
|
for (const material of this.materialMergeArray) {
|
|
for (const material of this.materialMergeArray) {
|
|
if (value.includes(material.materialCode)) {
|
|
if (value.includes(material.materialCode)) {
|
|
itemArray.push(material)
|
|
itemArray.push(material)
|
|
@@ -149,7 +153,7 @@ export struct OperationMaterialKitTwoStep {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
for (const param of paramArray) {
|
|
for (const param of paramArray) {
|
|
- await WmsRequest.post("api/v1/process/vehicleOperation/add", param)
|
|
|
|
|
|
+ await WmsRequest.post('api/v1/process/vehicleOperation/add', param)
|
|
}
|
|
}
|
|
// 重新刷新调取料箱下方物料已齐套数量
|
|
// 重新刷新调取料箱下方物料已齐套数量
|
|
let result: OperationMaterial[] = await WmsRequest.post('/api/v1/wms/operationMaterial/list', {
|
|
let result: OperationMaterial[] = await WmsRequest.post('/api/v1/wms/operationMaterial/list', {
|
|
@@ -263,11 +267,11 @@ export struct OperationMaterialKitTwoStep {
|
|
if (!item.storageNum || item.storageNum! <= 0) {
|
|
if (!item.storageNum || item.storageNum! <= 0) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- this.houseStocks = await WmsRequest.post('/api/v1/process/vehicleOperation/processVehicle', {
|
|
|
|
|
|
+ this.materialBoxInfos = await WmsRequest.post('/api/v1/process/vehicleOperation/processVehicle', {
|
|
label: item.itemCode
|
|
label: item.itemCode
|
|
- } as RequestParamModel) as HouseStock[]
|
|
|
|
- if (this.houseStocks) {
|
|
|
|
- for (const element of this.houseStocks) {
|
|
|
|
|
|
+ } as RequestParamModel) as MaterialBoxInfo[]
|
|
|
|
+ if (this.materialBoxInfos) {
|
|
|
|
+ for (const element of this.materialBoxInfos) {
|
|
if (element.coordinate && element.coordinate.length > 0 && element.coordinate.indexOf('-') > 0) {
|
|
if (element.coordinate && element.coordinate.length > 0 && element.coordinate.indexOf('-') > 0) {
|
|
let coors = element.coordinate.split('-');
|
|
let coors = element.coordinate.split('-');
|
|
element.x = parseInt(coors[0])
|
|
element.x = parseInt(coors[0])
|
|
@@ -275,7 +279,7 @@ export struct OperationMaterialKitTwoStep {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- this.houseStockDialogController.open()
|
|
|
|
|
|
+ this.selectMaterialBoxDialogController.open()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -290,14 +294,14 @@ export struct OperationMaterialKitTwoStep {
|
|
.justifyContent(FlexAlign.Center)
|
|
.justifyContent(FlexAlign.Center)
|
|
.backgroundColor($r('app.color.10FFFFFF'))
|
|
.backgroundColor($r('app.color.10FFFFFF'))
|
|
|
|
|
|
- Image($r("app.media.wms_arrow_right"))
|
|
|
|
|
|
+ Image($r('app.media.wms_arrow_right'))
|
|
.height($r('app.float.virtualSize_48'))
|
|
.height($r('app.float.virtualSize_48'))
|
|
.width($r('app.float.virtualSize_48'))
|
|
.width($r('app.float.virtualSize_48'))
|
|
// 出入库料口操作
|
|
// 出入库料口操作
|
|
Column() {
|
|
Column() {
|
|
InBoundView({
|
|
InBoundView({
|
|
materialNum:this.materialNum,
|
|
materialNum:this.materialNum,
|
|
- boxMaterials:this.ScanMaterialList
|
|
|
|
|
|
+ boxMaterials:this.scanMaterialList
|
|
})
|
|
})
|
|
}
|
|
}
|
|
.height('100%')
|
|
.height('100%')
|
|
@@ -305,7 +309,7 @@ export struct OperationMaterialKitTwoStep {
|
|
.borderRadius($r('app.float.virtualSize_16'))
|
|
.borderRadius($r('app.float.virtualSize_16'))
|
|
.justifyContent(FlexAlign.Center)
|
|
.justifyContent(FlexAlign.Center)
|
|
.backgroundColor($r('app.color.10FFFFFF'))
|
|
.backgroundColor($r('app.color.10FFFFFF'))
|
|
- Image($r("app.media.wms_arrow_right"))
|
|
|
|
|
|
+ Image($r('app.media.wms_arrow_right'))
|
|
.height($r('app.float.virtualSize_48'))
|
|
.height($r('app.float.virtualSize_48'))
|
|
.width($r('app.float.virtualSize_48'))
|
|
.width($r('app.float.virtualSize_48'))
|
|
// 拣选工作台
|
|
// 拣选工作台
|
|
@@ -321,7 +325,7 @@ export struct OperationMaterialKitTwoStep {
|
|
.justifyContent(FlexAlign.Center)
|
|
.justifyContent(FlexAlign.Center)
|
|
|
|
|
|
Stack() {
|
|
Stack() {
|
|
- Image(this.vehicleCode && this.vehicleCode.length > 0 ? $r("app.media.wms_read_vehicle") : $r("app.media.wms_not_read_vehicle"))
|
|
|
|
|
|
+ Image(this.vehicleCode && this.vehicleCode.length > 0 ? $r('app.media.wms_read_vehicle') : $r('app.media.wms_not_read_vehicle'))
|
|
.width('100%')
|
|
.width('100%')
|
|
.height('100%')
|
|
.height('100%')
|
|
.borderRadius($r('app.float.virtualSize_16'))
|
|
.borderRadius($r('app.float.virtualSize_16'))
|
|
@@ -342,7 +346,7 @@ export struct OperationMaterialKitTwoStep {
|
|
.margin({top: $r('app.float.virtualSize_12'), right: $r('app.float.virtualSize_12')})
|
|
.margin({top: $r('app.float.virtualSize_12'), right: $r('app.float.virtualSize_12')})
|
|
Blank()
|
|
Blank()
|
|
Row({space: 3}) {
|
|
Row({space: 3}) {
|
|
- Image($r("app.media.wms_card_reader"))
|
|
|
|
|
|
+ Image($r('app.media.wms_card_reader'))
|
|
.height($r('app.float.virtualSize_24'))
|
|
.height($r('app.float.virtualSize_24'))
|
|
.width($r('app.float.virtualSize_24'))
|
|
.width($r('app.float.virtualSize_24'))
|
|
.fillColor(this.vehicleCode && this.vehicleCode.length > 0 ? $r('app.color.30D158') : $r('app.color.FF453A'))
|
|
.fillColor(this.vehicleCode && this.vehicleCode.length > 0 ? $r('app.color.30D158') : $r('app.color.FF453A'))
|
|
@@ -397,7 +401,7 @@ export struct OperationMaterialKitTwoStep {
|
|
.margin({top: $r('app.float.virtualSize_20'), bottom: $r('app.float.fontSize_12')})
|
|
.margin({top: $r('app.float.virtualSize_20'), bottom: $r('app.float.fontSize_12')})
|
|
// 扫码得到的物料列表
|
|
// 扫码得到的物料列表
|
|
List({ scroller: this.materialScrollerController }) {
|
|
List({ scroller: this.materialScrollerController }) {
|
|
- ForEach(this.materialMergeArray, (item: HouseStockMaterial)=>{
|
|
|
|
|
|
+ ForEach(this.materialMergeArray, (item: MaterialInfo)=>{
|
|
ListItem() {
|
|
ListItem() {
|
|
Column() {
|
|
Column() {
|
|
Row() {
|
|
Row() {
|
|
@@ -488,7 +492,7 @@ export struct OperationMaterialKitTwoStep {
|
|
|
|
|
|
// 库存信息弹窗(选择料箱)
|
|
// 库存信息弹窗(选择料箱)
|
|
@CustomDialog
|
|
@CustomDialog
|
|
-struct houseStockDialog {
|
|
|
|
|
|
+struct SelectMaterialBoxDialog {
|
|
|
|
|
|
// 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后
|
|
// 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后
|
|
controller?: CustomDialogController
|
|
controller?: CustomDialogController
|
|
@@ -498,7 +502,7 @@ struct houseStockDialog {
|
|
}
|
|
}
|
|
vehicleTypeDictType: string = 'vehicle_type'
|
|
vehicleTypeDictType: string = 'vehicle_type'
|
|
vehicleTypeDictMap: HashMap<string, string> = new HashMap<string, string>()
|
|
vehicleTypeDictMap: HashMap<string, string> = new HashMap<string, string>()
|
|
- houseStocks: HouseStock[] = []
|
|
|
|
|
|
+ MaterialBoxInfos: MaterialBoxInfo[] = []
|
|
scroller: Scroller = new Scroller()
|
|
scroller: Scroller = new Scroller()
|
|
@Link selectVehicleCode: string
|
|
@Link selectVehicleCode: string
|
|
|
|
|
|
@@ -539,7 +543,7 @@ struct houseStockDialog {
|
|
// 动态排列容器
|
|
// 动态排列容器
|
|
Scroll() {
|
|
Scroll() {
|
|
Flex({ wrap: FlexWrap.Wrap, justifyContent: FlexAlign.Start }) {
|
|
Flex({ wrap: FlexWrap.Wrap, justifyContent: FlexAlign.Start }) {
|
|
- ForEach(this.houseStocks, (item: HouseStock, index: number) => {
|
|
|
|
|
|
+ ForEach(this.MaterialBoxInfos, (item: MaterialBoxInfo, index: number) => {
|
|
Column({ space: 5 }) {
|
|
Column({ space: 5 }) {
|
|
Row() {
|
|
Row() {
|
|
Text(item.materials?.[0]?.materialName! + '-' + item.materials?.[0]?.materialNo!)
|
|
Text(item.materials?.[0]?.materialName! + '-' + item.materials?.[0]?.materialNo!)
|
|
@@ -650,7 +654,7 @@ struct houseStockDialog {
|
|
|
|
|
|
// 本次扫描物料弹窗
|
|
// 本次扫描物料弹窗
|
|
@CustomDialog
|
|
@CustomDialog
|
|
-struct thisScanDialog {
|
|
|
|
|
|
+struct ThisScanDialog {
|
|
|
|
|
|
// 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后
|
|
// 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在最后
|
|
controller?: CustomDialogController
|
|
controller?: CustomDialogController
|
|
@@ -658,12 +662,12 @@ struct thisScanDialog {
|
|
}
|
|
}
|
|
confirm: () => void = () => {
|
|
confirm: () => void = () => {
|
|
}
|
|
}
|
|
- houseStocks: HouseStock[] = []
|
|
|
|
|
|
+ MaterialBoxInfos: MaterialBoxInfo[] = []
|
|
scroller: Scroller = new Scroller()
|
|
scroller: Scroller = new Scroller()
|
|
- @Link materialArray: HouseStockMaterial[]
|
|
|
|
- @Link materialMergeArray: HouseStockMaterial[]
|
|
|
|
- @State tempArray: HouseStockMaterial[] = []
|
|
|
|
- tempMergeArray: HouseStockMaterial[] = []
|
|
|
|
|
|
+ @Link materialArray: MaterialInfo[]
|
|
|
|
+ @Link materialMergeArray: MaterialInfo[]
|
|
|
|
+ @State tempArray: MaterialInfo[] = []
|
|
|
|
+ tempMergeArray: MaterialInfo[] = []
|
|
|
|
|
|
aboutToAppear(): void {
|
|
aboutToAppear(): void {
|
|
if (this.materialArray && this.materialArray.length > 0) {
|
|
if (this.materialArray && this.materialArray.length > 0) {
|
|
@@ -688,7 +692,7 @@ struct thisScanDialog {
|
|
.justifyContent(FlexAlign.Center)
|
|
.justifyContent(FlexAlign.Center)
|
|
|
|
|
|
List({space: 4, scroller: this.scroller}) {
|
|
List({space: 4, scroller: this.scroller}) {
|
|
- ForEach(this.tempArray, (item: HouseStockMaterial, index: number) => {
|
|
|
|
|
|
+ ForEach(this.tempArray, (item: MaterialInfo, index: number) => {
|
|
ListItem() {
|
|
ListItem() {
|
|
Row() {
|
|
Row() {
|
|
Column({space: 1}) {
|
|
Column({space: 1}) {
|