From 57a2ed08729eda70ea83e79424556cd74a5c28ab Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 13 Sep 2023 13:38:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=89=A9=E4=B8=9A=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=E7=AB=AF=E9=87=87=E8=B4=AD=E5=B0=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view-resource-store-info-allocation.vue | 12 ++++++++--- .../resource/view-resource-store-info.vue | 21 +++++++++++++------ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/components/resource/view-resource-store-info-allocation.vue b/components/resource/view-resource-store-info-allocation.vue index 7650c9f..5a870b8 100644 --- a/components/resource/view-resource-store-info-allocation.vue +++ b/components/resource/view-resource-store-info-allocation.vue @@ -20,7 +20,7 @@ - {{item.selectedTimesIndex <0?'请选择': item.times[item.selectedTimesIndex].price}} + {{item.selectedTimesIndex <0?'请选择': item.times[item.selectedTimesIndex].price}} > @@ -121,9 +121,15 @@ this.resourceList = list; this.resourceList.forEach((item) => { item.timesId = ''; - item.selectedTimesIndex = 0; + if (item.times && item.times.length > 0) { + item.timesId = item.times[0].timesId; + item.selectedTimesIndex = 1; + item.selectedTimesStock = 1; + } else { + item.selectedTimesIndex = 0; + item.selectedTimesStock = 0; + } item.selectedShzIndex = 0; - item.selectedTimesStock = 0; item.times.unshift({ timesId: '', price: '请选择' diff --git a/components/resource/view-resource-store-info.vue b/components/resource/view-resource-store-info.vue index d61afe3..32892d4 100644 --- a/components/resource/view-resource-store-info.vue +++ b/components/resource/view-resource-store-info.vue @@ -17,10 +17,11 @@ {{_getTimesStock(item)}}{{item.unitCodeName}} - + - {{item.selectedTimesIndex <0?'请选择': item.times[item.selectedTimesIndex].price}} + {{item.selectedTimesIndex <0?'请选择': item.times[item.selectedTimesIndex].price}} > + @@ -74,7 +75,7 @@ }, }, methods: { - _setResourceStore:function(_resourceStores){ + _setResourceStore: function(_resourceStores) { this._getResourceInfo(_resourceStores); }, _openChooseResourceModel: function() { @@ -99,8 +100,14 @@ this.resourceList = list; this.resourceList.forEach((item) => { item.timesId = ''; - item.selectedTimesIndex = 0; - item.selectedTimesStock = 0; + if (item.times && item.times.length > 0) { + item.timesId = item.times[0].timesId; + item.selectedTimesIndex = 1; + item.selectedTimesStock = 1; + } else { + item.selectedTimesIndex = 0; + item.selectedTimesStock = 0; + } item.times.unshift({ timesId: '', price: '请选择' @@ -152,6 +159,7 @@ border-radius: 15rpx; padding: 2rpx 10rpx; } + .resource-header { margin-top: 30upx; padding: 20upx @@ -159,7 +167,8 @@ .resource-item { margin-top: 2upx; - padding:20upx; + padding: 20upx; + .flex-around { display: flex; justify-content: space-between;