|
@@ -6,11 +6,11 @@
|
|
|
<view v-if="showHeader" class="section-header">
|
|
<view v-if="showHeader" class="section-header">
|
|
|
<text class="section-title">{{ title }}</text>
|
|
<text class="section-title">{{ title }}</text>
|
|
|
<view :style="{ display: 'flex' }">
|
|
<view :style="{ display: 'flex' }">
|
|
|
- <view v-if="showSelector && tableType === 'variety' && region" class="selector-wrap">
|
|
|
|
|
|
|
+ <view v-if="showSelector && tableType === 'variety'" class="selector-wrap">
|
|
|
<view class="selector" @click.stop="toggleDropdownRegion">
|
|
<view class="selector" @click.stop="toggleDropdownRegion">
|
|
|
<text class="selector-text">{{
|
|
<text class="selector-text">{{
|
|
|
- region?.regionName || region?.name || "-"
|
|
|
|
|
- }}</text>
|
|
|
|
|
|
|
+ region?.regionCode ? region.regionName : "选择省"
|
|
|
|
|
+ }}</text>
|
|
|
<text class="selector-arrow" :class="{ open: dropdownRegionOpen }"></text>
|
|
<text class="selector-arrow" :class="{ open: dropdownRegionOpen }"></text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="dropdown" v-show="dropdownRegionOpen" :style="dropdownDirection === 'top'
|
|
<view class="dropdown" v-show="dropdownRegionOpen" :style="dropdownDirection === 'top'
|
|
@@ -29,15 +29,15 @@
|
|
|
color: '#fff',
|
|
color: '#fff',
|
|
|
}
|
|
}
|
|
|
: {}
|
|
: {}
|
|
|
- " @click.stop="selectProduct('region', p)">{{ p.regionName || p.name || p }}</view>
|
|
|
|
|
|
|
+ " @click.stop="selectProduct('region', p)">{{ p.regionName || p }}</view>
|
|
|
<view v-if="regionList.length === 0" class="dropdown-item" style="text-align: center; color: #999;">暂无数据
|
|
<view v-if="regionList.length === 0" class="dropdown-item" style="text-align: center; color: #999;">暂无数据
|
|
|
</view>
|
|
</view>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view v-if="showSelector && product" class="selector-wrap">
|
|
|
|
|
|
|
+ <view v-if="showSelector" class="selector-wrap">
|
|
|
<view class="selector" @click.stop="toggleDropdown">
|
|
<view class="selector" @click.stop="toggleDropdown">
|
|
|
- <text class="selector-text">{{ product?.physicName }}</text>
|
|
|
|
|
|
|
+ <text class="selector-text">{{ product?.drugEntBaseInfoId ? product.physicName : '选择品种' }}</text>
|
|
|
<text class="selector-arrow" :class="{ open: dropdownOpen }"></text>
|
|
<text class="selector-arrow" :class="{ open: dropdownOpen }"></text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="dropdown" v-show="dropdownOpen" :style="dropdownDirection === 'top'
|
|
<view class="dropdown" v-show="dropdownOpen" :style="dropdownDirection === 'top'
|
|
@@ -53,7 +53,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
<scroll-view scroll-y="true" class="dropdown-scroll-view" lower-threshold="80"
|
|
<scroll-view scroll-y="true" class="dropdown-scroll-view" lower-threshold="80"
|
|
|
@scrolltolower="loadMoreProducts">
|
|
@scrolltolower="loadMoreProducts">
|
|
|
- <view class="dropdown-item" v-for="(p, i) in productList" :key="getUid()" :style="p.drugEntBaseInfoId === product.drugEntBaseInfoId
|
|
|
|
|
|
|
+ <view class="dropdown-item" v-for="(p, i) in productList" :key="getUid()" :style="p.drugEntBaseInfoId === product?.drugEntBaseInfoId
|
|
|
? {
|
|
? {
|
|
|
backgroundColor: '#2c69ff',
|
|
backgroundColor: '#2c69ff',
|
|
|
color: '#fff',
|
|
color: '#fff',
|
|
@@ -139,15 +139,15 @@
|
|
|
</view>
|
|
</view>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
<view v-if="loading" class="no-data" :style="{ height: 'auto', top: cellHeight }">
|
|
<view v-if="loading" class="no-data" :style="{ height: 'auto', top: cellHeight }">
|
|
|
- <view class="row loading-row">
|
|
|
|
|
- <view class="loading-wrapper">
|
|
|
|
|
- <image class="loading-icon" :src="loadingImg" />
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <view class="row loading-row">
|
|
|
|
|
+ <view class="loading-wrapper">
|
|
|
|
|
+ <image class="loading-icon" :src="loadingImg" />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view v-if="!loading && (!list || list.length === 0)" class="no-data" :style="{ top: cellHeight }">
|
|
|
|
|
- <EmptyView />
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view v-if="!loading && (!list || list.length === 0)" class="no-data" :style="{ top: cellHeight }">
|
|
|
|
|
+ <EmptyView />
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
@@ -314,43 +314,23 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
product(val) {
|
|
product(val) {
|
|
|
- if (val && this.params) {
|
|
|
|
|
- if (this.tableType === 'variety') {
|
|
|
|
|
- if (this.region) {
|
|
|
|
|
- this.resetFetch();
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- this.resetFetch();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.resetFetch();
|
|
|
},
|
|
},
|
|
|
region: {
|
|
region: {
|
|
|
handler(val) {
|
|
handler(val) {
|
|
|
- if (val && this.product && this.params) {
|
|
|
|
|
- this.resetFetch();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.resetFetch();
|
|
|
},
|
|
},
|
|
|
deep: true,
|
|
deep: true,
|
|
|
},
|
|
},
|
|
|
params: {
|
|
params: {
|
|
|
handler(newVal, oldVal) {
|
|
handler(newVal, oldVal) {
|
|
|
- if (newVal && this.product) {
|
|
|
|
|
- if (this.tableType === 'variety') {
|
|
|
|
|
- if (this.region) {
|
|
|
|
|
- this.resetFetch();
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- this.resetFetch();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (newVal !== oldVal && JSON.stringify(newVal) === JSON.stringify(oldVal)) return;
|
|
|
|
|
+ this.resetFetch();
|
|
|
},
|
|
},
|
|
|
deep: true,
|
|
deep: true,
|
|
|
},
|
|
},
|
|
|
products: {
|
|
products: {
|
|
|
handler(newVal, oldVal) {
|
|
handler(newVal, oldVal) {
|
|
|
- if (!this.product) {
|
|
|
|
|
- this.product = this.products[0];
|
|
|
|
|
- }
|
|
|
|
|
if (this.dropdownOpen) {
|
|
if (this.dropdownOpen) {
|
|
|
this.initProductList();
|
|
this.initProductList();
|
|
|
}
|
|
}
|
|
@@ -359,9 +339,6 @@ export default {
|
|
|
},
|
|
},
|
|
|
regions: {
|
|
regions: {
|
|
|
handler(newVal, oldVal) {
|
|
handler(newVal, oldVal) {
|
|
|
- if (!this.region) {
|
|
|
|
|
- this.region = this.regions[0];
|
|
|
|
|
- }
|
|
|
|
|
if (this.dropdownRegionOpen) {
|
|
if (this.dropdownRegionOpen) {
|
|
|
this.initRegionList();
|
|
this.initRegionList();
|
|
|
}
|
|
}
|
|
@@ -385,7 +362,7 @@ export default {
|
|
|
// () => { }
|
|
// () => { }
|
|
|
// );
|
|
// );
|
|
|
// }
|
|
// }
|
|
|
- // this.fetchList();
|
|
|
|
|
|
|
+ this.fetchList();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
initRegionList() {
|
|
initRegionList() {
|
|
@@ -529,8 +506,8 @@ export default {
|
|
|
if (this.fetchLoading) return;
|
|
if (this.fetchLoading) return;
|
|
|
this.fetchLoading = true;
|
|
this.fetchLoading = true;
|
|
|
request(this.api, {
|
|
request(this.api, {
|
|
|
- drugEntBaseInfoId: this.product?.drugEntBaseInfoId,
|
|
|
|
|
- regionCode: this.region?.regionCode,
|
|
|
|
|
|
|
+ drugEntBaseInfoId: this.product ? (this.product?.drugEntBaseInfoId || '') : '',
|
|
|
|
|
+ regionCode: this.region ? (this.region?.regionCode || '') : '',
|
|
|
...(this.params || {}),
|
|
...(this.params || {}),
|
|
|
pageNum: this.tablePage,
|
|
pageNum: this.tablePage,
|
|
|
pageSize: this.tablePageSize,
|
|
pageSize: this.tablePageSize,
|
|
@@ -701,6 +678,7 @@ export default {
|
|
|
width: 8rpx;
|
|
width: 8rpx;
|
|
|
height: 50%;
|
|
height: 50%;
|
|
|
background: #2c69ff;
|
|
background: #2c69ff;
|
|
|
|
|
+ border-radius: 10px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.selector-wrap {
|
|
.selector-wrap {
|
|
@@ -886,8 +864,10 @@ export default {
|
|
|
|
|
|
|
|
/* hide scrollbars for H5/App while preserving scroll behavior */
|
|
/* hide scrollbars for H5/App while preserving scroll behavior */
|
|
|
.no-scrollbar {
|
|
.no-scrollbar {
|
|
|
|
|
+ position: relative;
|
|
|
-ms-overflow-style: none;
|
|
-ms-overflow-style: none;
|
|
|
scrollbar-width: none;
|
|
scrollbar-width: none;
|
|
|
|
|
+ z-index: 2;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
::v-deep .no-scrollbar::-webkit-scrollbar {
|
|
::v-deep .no-scrollbar::-webkit-scrollbar {
|
|
@@ -935,5 +915,6 @@ export default {
|
|
|
top: 76rpx;
|
|
top: 76rpx;
|
|
|
left: 0;
|
|
left: 0;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
|
|
+ z-index: 1;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|