|
@@ -3,29 +3,59 @@
|
|
|
<view v-if="hasFunction" class="page" @click.stop="closeDropdowns">
|
|
<view v-if="hasFunction" class="page" @click.stop="closeDropdowns">
|
|
|
<view class="tabs-container">
|
|
<view class="tabs-container">
|
|
|
<view class="tabs">
|
|
<view class="tabs">
|
|
|
- <view v-if="hasScanFunction" class="tab" :class="{ active: activeTab === 'scan' }" @click="activeTab = 'scan'">
|
|
|
|
|
- 扫码率</view>
|
|
|
|
|
- <view v-if="hasReportFunction" class="tab" :class="{ active: activeTab === 'export' }"
|
|
|
|
|
- @click="activeTab = 'export'">报表导出</view>
|
|
|
|
|
- <view v-if="hasBlacklistFunction" class="tab" :class="{ active: activeTab === 'blacklist' }"
|
|
|
|
|
- @click="activeTab = 'blacklist'">黑名单汇总</view>
|
|
|
|
|
- <view v-if="hasGanmaolingFunction" class="tab" :class="{ active: activeTab === 'ganmaoling' }"
|
|
|
|
|
- @click="activeTab = 'ganmaoling'">感冒灵大批量</view>
|
|
|
|
|
|
|
+ <view
|
|
|
|
|
+ v-if="hasScanFunction"
|
|
|
|
|
+ class="tab"
|
|
|
|
|
+ :class="{ active: activeTab === 'scan' }"
|
|
|
|
|
+ @click="activeTab = 'scan'"
|
|
|
|
|
+ >
|
|
|
|
|
+ 扫码率</view
|
|
|
|
|
+ >
|
|
|
|
|
+ <view
|
|
|
|
|
+ v-if="hasReportFunction"
|
|
|
|
|
+ class="tab"
|
|
|
|
|
+ :class="{ active: activeTab === 'export' }"
|
|
|
|
|
+ @click="activeTab = 'export'"
|
|
|
|
|
+ >报表导出</view
|
|
|
|
|
+ >
|
|
|
|
|
+ <view
|
|
|
|
|
+ v-if="hasBlacklistFunction"
|
|
|
|
|
+ class="tab"
|
|
|
|
|
+ :class="{ active: activeTab === 'blacklist' }"
|
|
|
|
|
+ @click="activeTab = 'blacklist'"
|
|
|
|
|
+ >黑名单汇总</view
|
|
|
|
|
+ >
|
|
|
|
|
+ <view
|
|
|
|
|
+ v-if="hasGanmaolingFunction"
|
|
|
|
|
+ class="tab"
|
|
|
|
|
+ :class="{ active: activeTab === 'ganmaoling' }"
|
|
|
|
|
+ @click="activeTab = 'ganmaoling'"
|
|
|
|
|
+ >感冒灵大批量</view
|
|
|
|
|
+ >
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="content" v-if="activeTab === 'scan' && hasScanFunction">
|
|
<view class="content" v-if="activeTab === 'scan' && hasScanFunction">
|
|
|
<ScanningRate ref="scanRate" />
|
|
<ScanningRate ref="scanRate" />
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="content" :style="{ padding: '0', marginTop: '85rpx' }"
|
|
|
|
|
- v-if="activeTab === 'export' && hasReportFunction">
|
|
|
|
|
|
|
+ <view
|
|
|
|
|
+ class="content"
|
|
|
|
|
+ :style="{ padding: '0', marginTop: '85rpx' }"
|
|
|
|
|
+ v-if="activeTab === 'export' && hasReportFunction"
|
|
|
|
|
+ >
|
|
|
<ReportExport />
|
|
<ReportExport />
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="content" :style="{ padding: '0', marginTop: '85rpx' }"
|
|
|
|
|
- v-if="activeTab === 'blacklist' && hasBlacklistFunction">
|
|
|
|
|
|
|
+ <view
|
|
|
|
|
+ class="content"
|
|
|
|
|
+ :style="{ padding: '0', marginTop: '85rpx' }"
|
|
|
|
|
+ v-if="activeTab === 'blacklist' && hasBlacklistFunction"
|
|
|
|
|
+ >
|
|
|
<Blacklist />
|
|
<Blacklist />
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="content" :style="{ padding: '0', marginTop: '85rpx' }"
|
|
|
|
|
- v-if="activeTab === 'ganmaoling' && hasGanmaolingFunction">
|
|
|
|
|
|
|
+ <view
|
|
|
|
|
+ class="content"
|
|
|
|
|
+ :style="{ padding: '0', marginTop: '85rpx' }"
|
|
|
|
|
+ v-if="activeTab === 'ganmaoling' && hasGanmaolingFunction"
|
|
|
|
|
+ >
|
|
|
<Ganmaoling />
|
|
<Ganmaoling />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -42,7 +72,7 @@ import Blacklist from "./blacklist/index.vue";
|
|
|
import Ganmaoling from "./ganmaoling/index.vue";
|
|
import Ganmaoling from "./ganmaoling/index.vue";
|
|
|
import Empty from "../../wigets/empty.vue";
|
|
import Empty from "../../wigets/empty.vue";
|
|
|
import Water from "@/components/water/water.vue";
|
|
import Water from "@/components/water/water.vue";
|
|
|
-import { hasFunction } from '../../utils/utils.js'
|
|
|
|
|
|
|
+import { hasFunction } from "../../utils/utils.js";
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
ScanningRate,
|
|
ScanningRate,
|
|
@@ -75,47 +105,59 @@ export default {
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.getFunc()
|
|
|
|
|
|
|
+ this.getFunc();
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
hasFunction() {
|
|
hasFunction() {
|
|
|
- return this.hasScanFunction || this.hasReportFunction || this.hasBlacklistFunction || this.hasGanmaolingFunction
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ return (
|
|
|
|
|
+ this.hasScanFunction ||
|
|
|
|
|
+ this.hasReportFunction ||
|
|
|
|
|
+ this.hasBlacklistFunction ||
|
|
|
|
|
+ this.hasGanmaolingFunction
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
closeDropdowns() {
|
|
closeDropdowns() {
|
|
|
- if (!this.$refs.scanRate) return
|
|
|
|
|
|
|
+ if (!this.$refs.scanRate) return;
|
|
|
this.$refs.scanRate.closeDropdown();
|
|
this.$refs.scanRate.closeDropdown();
|
|
|
},
|
|
},
|
|
|
async getFunc() {
|
|
async getFunc() {
|
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
|
- title: '加载中',
|
|
|
|
|
|
|
+ title: "加载中",
|
|
|
mask: true,
|
|
mask: true,
|
|
|
- })
|
|
|
|
|
- await hasFunction(['scan-rate-list', 'trace-code-task', 'blacklist-customers-list', 'large-medicines-list']).then(res => {
|
|
|
|
|
- this.hasScanFunction = res[0]
|
|
|
|
|
- this.hasReportFunction = res[1]
|
|
|
|
|
- this.hasBlacklistFunction = res[2]
|
|
|
|
|
- this.hasGanmaolingFunction = res[3]
|
|
|
|
|
- }).catch(err => {
|
|
|
|
|
- this.hasScanFunction = false
|
|
|
|
|
- this.hasReportFunction = false
|
|
|
|
|
- this.hasBlacklistFunction = false
|
|
|
|
|
- this.hasGanmaolingFunction = false
|
|
|
|
|
- // uni.hideLoading()
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ await hasFunction([
|
|
|
|
|
+ "scan-rate-list",
|
|
|
|
|
+ "trace-code-task",
|
|
|
|
|
+ "blacklist-customers-list",
|
|
|
|
|
+ "large-medicines-list",
|
|
|
|
|
+ ])
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ this.hasScanFunction = res[0];
|
|
|
|
|
+ this.hasReportFunction = res[1];
|
|
|
|
|
+ this.hasBlacklistFunction = res[2];
|
|
|
|
|
+ this.hasGanmaolingFunction = res[3];
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
|
+ this.hasScanFunction = false;
|
|
|
|
|
+ this.hasReportFunction = false;
|
|
|
|
|
+ this.hasBlacklistFunction = false;
|
|
|
|
|
+ this.hasGanmaolingFunction = false;
|
|
|
|
|
+ // uni.hideLoading()
|
|
|
|
|
+ });
|
|
|
if (this.hasScanFunction) {
|
|
if (this.hasScanFunction) {
|
|
|
- this.active = 'scan'
|
|
|
|
|
|
|
+ this.active = "scan";
|
|
|
} else if (this.hasReportFunction) {
|
|
} else if (this.hasReportFunction) {
|
|
|
- this.activeTab = 'export'
|
|
|
|
|
|
|
+ this.activeTab = "export";
|
|
|
} else if (this.hasBlacklistFunction) {
|
|
} else if (this.hasBlacklistFunction) {
|
|
|
- this.activeTab = 'blacklist'
|
|
|
|
|
|
|
+ this.activeTab = "blacklist";
|
|
|
} else if (this.hasGanmaolingFunction) {
|
|
} else if (this.hasGanmaolingFunction) {
|
|
|
- this.activeTab = 'ganmaoling'
|
|
|
|
|
|
|
+ this.activeTab = "ganmaoling";
|
|
|
}
|
|
}
|
|
|
- this.functionLoading = false
|
|
|
|
|
- uni.hideLoading()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.functionLoading = false;
|
|
|
|
|
+ uni.hideLoading();
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|