From 45ebc799ec32100a4e3ac80992f7be2a44c84c4d Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Wed, 15 Feb 2023 14:57:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=93=E5=BA=93=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E4=BC=A0=E8=AF=A6=E6=83=85=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=B0=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/warehouse/detail.vue | 27 +++++++-------------------- pages/warehouse/info.vue | 35 +++++++++++------------------------ pages/warehouse/mana.vue | 25 ++++++++++++++++++------- 3 files changed, 36 insertions(+), 51 deletions(-) diff --git a/pages/warehouse/detail.vue b/pages/warehouse/detail.vue index fe21533..43685e4 100644 --- a/pages/warehouse/detail.vue +++ b/pages/warehouse/detail.vue @@ -76,16 +76,16 @@ 仓库位置 {{detail.warehouseAddress}} - 仓库容量 {{detail.warehouseVolume}} + 仓库容量 {{detail.warehouseVolume}}(m²) - 仓库类型 {{detail.warehouseType}} + 仓库类型 {{detail.warehouseType_dictText}} - 仓库管理员 {{detail.warehouseKeeper}} + 仓库管理员 {{detail.contactPeople}} - 库管员电话 {{detail.warehouseKeeperTelephone}} + 库管员电话 {{detail.contactNumber}} @@ -107,24 +107,11 @@ import request from '@/common/request.js' } }, onLoad(options){ - this.getDetail(options.id) + var eventChannel=this.getOpenerEventChannel() + eventChannel.on("detail", e=>this.detail=e) }, methods:{ - async getDetail(warehouseId){ - var res=await request("/api/WarehouseManageApi/querysWarehouseDetails",{ - params:{warehouseId} - }) - if(res.statu){ - this.detail=res.data.upper - this.list=res.data.lower - }else{ - uni.showModal({ - title:"提示", - content:res.msg||"获取仓库详情失败!", - showCancel:false, - }) - } - } + } } diff --git a/pages/warehouse/info.vue b/pages/warehouse/info.vue index f1d9089..271f9fd 100644 --- a/pages/warehouse/info.vue +++ b/pages/warehouse/info.vue @@ -73,12 +73,17 @@ import request from '@/common/request.js' onLoad(options){ this.eventChannel=this.getOpenerEventChannel() this.init() - if(options.id){ - this.getDetail(options.id) - }else if(this.$store.getters['userInfo'].roleCode=="baseAdmin"){ - this.formData.contactPeople=this.$store.getters['userInfo'].realname - this.formData.contactNumber=this.$store.getters['userInfo'].phone - } + this.eventChannel.on("detail", e=>{ + if(e){ + this.formData=e + this.fields.warehousePic.value=e.warehousePic.join(',') + this.fields.warehouseType.value=[e.warehouseType] + this.fields.goodsType.value=[e.goodsType] + }else if(this.$store.getters['userInfo'].roleCode=="baseAdmin"){ + this.formData.contactPeople=this.$store.getters['userInfo'].realname + this.formData.contactNumber=this.$store.getters['userInfo'].phone + } + }) }, methods:{ async init(){ @@ -138,24 +143,6 @@ import request from '@/common/request.js' } }) }, - async getDetail(id){ - var res=await request("/api/WarehouseManageApi/queryById",{ - params:{id} - }) - if(res.statu){ - this.formData=res.data - this.fields.warehousePic.value=res.data.warehousePic - this.formData.warehousePic=res.data.warehousePic?.split?.(",")?.filter?.(v=>v)||[] - this.fields.warehouseType.value=[res.data.warehouseType] - this.fields.goodsType.value=[res.data.goodsType] - }else{ - uni.showModal({ - title:"提示", - content:res.msg||"获取仓库详情失败!", - showCancel:false, - }) - } - }, }, } diff --git a/pages/warehouse/mana.vue b/pages/warehouse/mana.vue index aff7ef1..29993f4 100644 --- a/pages/warehouse/mana.vue +++ b/pages/warehouse/mana.vue @@ -92,7 +92,7 @@ - + @@ -104,10 +104,10 @@ {{v.warehouseName}} {{v.warehouseAddress}} - 库存种类:{{v.inventoryCount||0}}种 {{v.capacity||0}}㎡ + 库存种类:{{v.inventoryCount||0}}种 {{v.warehouseVolume||0}}㎡ - 修改 + 修改 删除 查看库存 @@ -118,7 +118,7 @@