|
@@ -9,7 +9,7 @@
|
|
|
<view v-if="showSelector && tableType === 'variety'" 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?.regionCode ? region.regionName : "选择省"
|
|
|
|
|
|
|
+ region?.regionCode ? region.regionName : "选择片区"
|
|
|
}}</text>
|
|
}}</text>
|
|
|
<text class="selector-arrow" :class="{ open: dropdownRegionOpen }"></text>
|
|
<text class="selector-arrow" :class="{ open: dropdownRegionOpen }"></text>
|
|
|
</view>
|
|
</view>
|
|
@@ -80,7 +80,7 @@
|
|
|
zIndex: 10,
|
|
zIndex: 10,
|
|
|
fontWeight: headerBold ? 'bold' : 'normal',
|
|
fontWeight: headerBold ? 'bold' : 'normal',
|
|
|
}">
|
|
}">
|
|
|
- <view v-for="(col, ci) in columns" :key="getUid()" class="cell" :style="{
|
|
|
|
|
|
|
+ <view v-for="(col, ci) in columnList" :key="getUid()" class="cell" :style="{
|
|
|
...headerCellStyle(ci, col),
|
|
...headerCellStyle(ci, col),
|
|
|
}">
|
|
}">
|
|
|
<view v-if="isPlainTitle(col.title)" :style="{
|
|
<view v-if="isPlainTitle(col.title)" :style="{
|
|
@@ -102,10 +102,9 @@
|
|
|
<view v-if="!loading && list && list.length > 0" class="table-body">
|
|
<view v-if="!loading && list && list.length > 0" class="table-body">
|
|
|
<template>
|
|
<template>
|
|
|
<view class="row" v-for="(item, i) in list" :key="getUid()">
|
|
<view class="row" v-for="(item, i) in list" :key="getUid()">
|
|
|
- <view v-for="(col, ci) in columns" :key="getUid()" class="cell"
|
|
|
|
|
|
|
+ <view v-for="(col, ci) in columnList" :key="getUid()" class="cell"
|
|
|
:class="{ underline: col.underline, striped: striped && (i + 1) % 2 === 0 }"
|
|
:class="{ underline: col.underline, striped: striped && (i + 1) % 2 === 0 }"
|
|
|
- :style="bodyCellStyle(ci, col)" @click="handleClick(item, col)">{{ item[col.key] ? (item[col.key] +
|
|
|
|
|
- (col.unit || '')) : '--' }}</view>
|
|
|
|
|
|
|
+ :style="bodyCellStyle(ci, col)" @click="handleClick(item, col)">{{ renderCell(item, col) }}</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="row loading-row" v-if="hasmore">
|
|
<view class="row loading-row" v-if="hasmore">
|
|
|
<view class="loading-wrapper">
|
|
<view class="loading-wrapper">
|
|
@@ -120,7 +119,7 @@
|
|
|
borderTop: '1rpx solid #eef0f4',
|
|
borderTop: '1rpx solid #eef0f4',
|
|
|
color: summaryFontColor,
|
|
color: summaryFontColor,
|
|
|
}">
|
|
}">
|
|
|
- <view v-for="(col, ci) in columns" :key="getUid()" class="cell" :style="{
|
|
|
|
|
|
|
+ <view v-for="(col, ci) in columnList" :key="getUid()" class="cell" :style="{
|
|
|
...bodyCellStyle(ci, col),
|
|
...bodyCellStyle(ci, col),
|
|
|
fontWeight: summaryBold ? 'bold' : 'normal',
|
|
fontWeight: summaryBold ? 'bold' : 'normal',
|
|
|
}">{{ getSummary(col, ci) }}</view>
|
|
}">{{ getSummary(col, ci) }}</view>
|
|
@@ -307,6 +306,13 @@ export default {
|
|
|
tableBodyHeight() {
|
|
tableBodyHeight() {
|
|
|
return 6 * 80;
|
|
return 6 * 80;
|
|
|
},
|
|
},
|
|
|
|
|
+ columnList() {
|
|
|
|
|
+ if(this.params) {
|
|
|
|
|
+ const type = this.params?.type
|
|
|
|
|
+ if(type === '1' || type === '2') return this.columns.filter(i => i.key !== 'selfExaminationRate');
|
|
|
|
|
+ }
|
|
|
|
|
+ return this.columns
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
dropdownRegionOpen(val) {
|
|
dropdownRegionOpen(val) {
|
|
@@ -373,6 +379,12 @@ export default {
|
|
|
this.fetchList();
|
|
this.fetchList();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ renderCell(item, col) {
|
|
|
|
|
+ if (!item[col.key]) return '--';
|
|
|
|
|
+ const reg = /rate/i;
|
|
|
|
|
+ if(reg.test(col.key)) return (Math.floor(Number(item[col.key])) + (col.unit || ''));
|
|
|
|
|
+ return item[col.key];
|
|
|
|
|
+ },
|
|
|
initRegionList() {
|
|
initRegionList() {
|
|
|
this.regionList = this.filteredRegions.slice(0, 10);
|
|
this.regionList = this.filteredRegions.slice(0, 10);
|
|
|
},
|
|
},
|
|
@@ -400,7 +412,7 @@ export default {
|
|
|
getUid,
|
|
getUid,
|
|
|
getSummary(col, ci) {
|
|
getSummary(col, ci) {
|
|
|
if (ci == 0) return "合计";
|
|
if (ci == 0) return "合计";
|
|
|
- return this.summaryData[ci] + (col.unit || '');
|
|
|
|
|
|
|
+ return Math.floor(Number(this.summaryData[ci])) + (col.unit || '');
|
|
|
},
|
|
},
|
|
|
closeAllTooltip() {
|
|
closeAllTooltip() {
|
|
|
this.headerTooltip = {};
|
|
this.headerTooltip = {};
|
|
@@ -516,10 +528,10 @@ export default {
|
|
|
request(this.api, {
|
|
request(this.api, {
|
|
|
drugEntBaseInfoId: this.product ? (this.product?.drugEntBaseInfoId || '') : '',
|
|
drugEntBaseInfoId: this.product ? (this.product?.drugEntBaseInfoId || '') : '',
|
|
|
regionCode: this.region ? (this.region?.regionCode || '') : '',
|
|
regionCode: this.region ? (this.region?.regionCode || '') : '',
|
|
|
- ...(this.params || {}),
|
|
|
|
|
pageNum: this.tablePage,
|
|
pageNum: this.tablePage,
|
|
|
pageSize: this.tablePageSize,
|
|
pageSize: this.tablePageSize,
|
|
|
path: 'customerScanningRate/wigets/ScanRateTable.vue',
|
|
path: 'customerScanningRate/wigets/ScanRateTable.vue',
|
|
|
|
|
+ ...(this.params || {}),
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
const _data = res.data || {};
|
|
const _data = res.data || {};
|