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;