Browse Source

feat: 更新

贺智杰 1 day ago
parent
commit
fca0a17655

+ 27 - 16
traceCodePackages/traceabilityCodeQuery/pages/index.vue

@@ -4,19 +4,21 @@
     <text class="nav-back" :style="{ top: statusBarHeight + 'px' }" @click="onBack"></text>
     <text class="nav-title">药品追溯码查询</text>
   </view>
-  <view class="page" :style="{
+  <scroll-view class="page" :style="{
     marginTop: statusBarHeight + 44 + 'px',
     height: pageHeight + 'px',
-  }">
+  }" @scrolltolower="onHistoryScrollToLower" scroll-y="true">
     <view class="scan-tip" @click="handleScanTipClick">
       <uni-icons type="help" size="18" color="#2c69ff"></uni-icons>
       <text :style="{ marginLeft: '5rpx', paddingBottom: '5rpx' }">可扫码生产企业及药品</text>
     </view>
     <view class="scan-card" @click="handleScan">
-      <image src="../../static/images/camera.png" mode="scaleToFill" class="scan-icon" />
-      <text class="scan-text">扫码查询</text>
+      <view class="scan-card-content">
+        <image src="../../static/images/camera.png" mode="scaleToFill" class="scan-icon" />
+        <text class="scan-text">扫码查询</text>
+      </view>
     </view>
-    <text class="hint">请扫描药品最小销售包装上的追溯码</text>
+    <view class="hint">请扫描药品最小销售包装上的追溯码</view>
     <view class="input-wrap">
       <input class="input" v-model="traceCode" maxlength="23" @input="onTraceInput" placeholder="请输入 20 位药品追溯码" />
     </view>
@@ -27,8 +29,7 @@
     <text class="tip">若扫码失败,可手动输入追溯码查询</text>
     <view class="section-title">扫码历史</view>
 
-    <scroll-view class="history-list" v-if="history.length != 0 && !loading" :scroll-y="history.length > 4"
-      @scrolltolower="onHistoryScrollToLower">
+    <view class="history-list" v-if="history.length != 0 && !loading">
       <view class="history-item" v-for="item in history" :key="item.code" @click="onTapHistory(item)">
         <view class="history-left">
           <view class="history-title">{{ item.physicName }}</view>
@@ -41,7 +42,7 @@
           <image class="loading-icon" :src="loadingImg" />
         </view>
       </view>
-    </scroll-view>
+    </view>
     <view v-else-if="!loading" style="margin-top: 20rpx;">
       <Empty text="暂无扫码历史" />
     </view>
@@ -49,7 +50,7 @@
       <image class="loading-icon" src="../../static/images/loading.png" mode="scaleToFill"
         :style="{ width: '66rpx', height: '50rpx' }" />
     </view>
-  </view>
+  </scroll-view>
 </template>
 
 <script>
@@ -68,13 +69,20 @@ export default {
       pageHeight: 0,
       traceCode: "",
       history: [],
-      totalCount: 20,
+      totalCount: 0,
       pageNum: 1,
       pageSize: 7,
       loading: true,
       isLoading: false,
     };
   },
+  onShow() {
+    this.history = []
+    this.totalCount = 0
+    this.pageNum = 1
+    this.isLoading = false
+    this.getHistoryData();
+  },
   onLoad() {
     const info = uni.getSystemInfoSync();
     this.statusBarHeight = info.statusBarHeight || 20;
@@ -85,8 +93,6 @@ export default {
     if (winH) {
       this.pageHeight = Math.max(0, winH - navH);
     }
-
-    this.getHistoryData();
   },
   computed: {
     canQuery() {
@@ -198,7 +204,7 @@ export default {
 
 <style>
 .scan-tip {
-  margin-top: -40rpx;
+  margin-top: 30rpx;
   color: #2c69ff;
   font-size: 24rpx;
   width: 100%;
@@ -245,14 +251,20 @@ export default {
   display: flex;
   flex-direction: column;
   align-items: center;
-  padding: 55rpx;
-  padding-bottom: calc(55rpx + env(safe-area-inset-bottom));
+  padding: 0 55rpx;
+  padding-bottom: env(safe-area-inset-bottom);
   background-color: rgb(243, 246, 249);
   overflow-y: auto;
 }
 
 .scan-card {
   flex-shrink: 0;
+  width: 100%;
+  display: flex;
+  justify-content: center;
+}
+
+.scan-card-content {
   width: 320rpx;
   height: 320rpx;
   background-color: #fff;
@@ -342,7 +354,6 @@ export default {
 
 .history-list {
   width: 640rpx;
-  height: 600rpx;
 }
 
 .history-item {

+ 7 - 4
traceCodePackages/traceabilityReport/pages/customerScanningRate/index.vue

@@ -18,13 +18,16 @@
     <view class="scan-rate-content">
       <ScanRateTable ref="scanTableVip" title="VIP客户扫码率" :api="`/bills/getVipScanRate`" :params="{
         type: activeRange + '', pageSize: 40
-      }" scanType="1" :products="products" @dropdown-open="closeDropdown" tableType="VIP" headerFontSize="28rpx" />
+      }" scanType="1" :products="products" @dropdown-open="closeDropdown" tableType="VIP" headerFontSize="28rpx"
+        tableHeightAuto="true" />
       <ScanRateTable ref="scanTableL2" title="二级客户扫码率" :api="`/bills/getSecondCustomerScanRate`" :params="{
         type: activeRange + '', pageSize: 40
-      }" scanType="2" :products="products" @dropdown-open="closeDropdown" tableType="二级" headerFontSize="28rpx" />
+      }" scanType="2" :products="products" @dropdown-open="closeDropdown" tableType="二级" headerFontSize="28rpx"
+        tableHeightAuto="true" />
       <ScanRateTable ref="scanTableL3" title="三级客户扫码率" :api="`/bills/getThreeCustomerScanRate`" :params="{
         type: activeRange + '', pageSize: 40
-      }" scanType="3" :products="products" @dropdown-open="closeDropdown" tableType="三级" headerFontSize="28rpx" />
+      }" scanType="3" :products="products" @dropdown-open="closeDropdown" tableType="三级" headerFontSize="28rpx"
+        tableHeightAuto="true" />
       <ScanRateTable ref="scanTableVariety" title="品种扫码率" :columns="varietyColumns" tableWidth="1200rpx"
         headerFontSize="24rpx" bodyFontColor="#000" :api="`/bills/geVarietyScanRate`" tableType="variety" :params="{
           type: activeRange + '',
@@ -123,7 +126,7 @@ export default {
     //   uni.showToast({ title: "开始导出", icon: "none" });
     // },
     getProviceList() {
-      request('/common/getProviceList', {
+      request('/common/getProviceOfRegionList', {
         path: 'customerScanningRate/wigets/ScanRateTable.vue',
       }).then(res => {
         if (res.code == 200) {

+ 15 - 8
traceCodePackages/traceabilityReport/pages/customerScanningRate/wigets/ScanRateTable.vue

@@ -69,7 +69,8 @@
     </view>
 
     <view class="table-scroll-x" :style="{
-      height: list.length < 7 ? 'auto' : tableBodyHeight + 80 + 'rpx',
+      height: (tableHeightAuto || list.length < 7) ? 'auto' : tableBodyHeight + 80 + 'rpx',
+      maxHeight: tableHeightAuto,
     }">
       <scroll-view class="no-scrollbar" :style="{ height: '100%' }" scroll-x="true" scroll-y="true" enhanced
         :show-scrollbar="false" @scrolltolower="onScrollToLower">
@@ -224,13 +225,17 @@ export default {
     },
     bodyFontColor: {
       type: String,
-      default: "#2c69ff",
+      default: "",
     },
     //若需要横向滚动且左侧固定,则tableWidth需等于columns所有width之和(可以略小于)
     tableWidth: {
       type: String,
       default: "100%",
     },
+    tableHeightAuto: {
+      type: Boolean,
+      default: false,
+    },
     columns: {
       type: Array,
       default: () => [
@@ -307,11 +312,11 @@ export default {
       return 6 * 80;
     },
     columnList() {
-      if(this.params) {
+      if (this.params) {
         const type = this.params?.type
-        if(type === '1' || type === '2') return this.columns.filter(i => i.key !== 'selfExaminationRate');
+        if (type === '1' || type === '2') return this.columns.filter(i => i.key !== 'selfExaminationRate');
       }
-        return this.columns
+      return this.columns
     }
   },
   watch: {
@@ -382,7 +387,7 @@ export default {
     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 || ''));
+      if (reg.test(col.key)) return (Math.floor(Number(item[col.key])) + (col.unit || ''));
       return item[col.key];
     },
     initRegionList() {
@@ -604,7 +609,9 @@ export default {
       // base.lineHeight = this.cellHeight;
       base.padding = '12rpx'
       base.fontSize = this.bodyFontSize;
-      base.color = this.bodyFontColor;
+      if (this.bodyFontColor) {
+        base.color = this.bodyFontColor;
+      }
       if (col.fixed) {
         base.position = "sticky";
         base.left = this.stickyLeft(ci);
@@ -810,7 +817,6 @@ export default {
 
 .card {
   background: #fff;
-  color: #2c69ff;
   font-size: 32rpx;
 }
 
@@ -818,6 +824,7 @@ export default {
   display: flex;
   background: #eaf2ff;
   font-weight: bold;
+  color: #2c69ff;
   border-top-left-radius: 16rpx;
   border-top-right-radius: 16rpx;
 }

+ 1 - 0
traceCodePackages/traceabilityReport/pages/index.vue

@@ -84,6 +84,7 @@ export default {
   },
   methods: {
     closeDropdowns() {
+      if (!this.$refs.scanRate) return
       this.$refs.scanRate.closeDropdown();
     },
     async getFunc() {

+ 35 - 10
traceCodePackages/traceabilityReport/pages/reportExport/index.vue

@@ -83,7 +83,7 @@
       <view class="report-export-create-modal-body" :style="{ paddingBottom: 0 }" @click="closeDropdownAll">
         <scroll-view scroll-y="true" :style="{
           height: '750rpx',
-          paddingBottom: '40rpx',
+          paddingBottom: '20rpx',
         }">
           <view class="report-export-create-modal-row">
             <text class="report-export-create-modal-label">省份</text>
@@ -249,13 +249,27 @@
           </view>
           <view class="report-export-create-modal-row">
             <text class="report-export-create-modal-label">时间</text>
-            <view class="report-export-create-modal-inputwrap">
-              <uni-datetime-picker type="daterange" :border="false" :disabled="modalType === 'read'" v-model="dateRange"
-                @change="onDateChange" />
-              <view class="report-export-input-arrow" v-if="modalType !== 'read'"></view>
+            <view class="report-export-create-modal-inputwrap" @click="openDatePicker">
+              <view class="report-export-create-modal-static report-export-input-simulator"
+                :style="{ color: dateRange && dateRange.length ? '#333' : '#606266' }">
+                <uni-icons type="calendar" size="22" color="#c0c4cc"></uni-icons>
+                <view style="flex: 1; text-align: center;">{{ dateRange && dateRange.length ? dateRange[0] : '开始时间' }}
+                </view>
+                <view>-</view>
+                <view style="flex: 1; text-align: center;">{{ dateRange && dateRange.length ? dateRange[1] : '结束时间' }}
+                </view>
+              </view>
+              <view class="report-export-input-simulator-clear" v-if="dateRange && dateRange.length"
+                @click.stop="dateRange = []">
+                <uni-icons type="clear" size="22" color="#c0c4cc"></uni-icons>
+              </view>
             </view>
           </view>
         </scroll-view>
+        <!-- Hidden Picker for API access -->
+        <view style="position: absolute; left: -10000px; top: 0;">
+          <uni-datetime-picker ref="datePicker" type="daterange" v-model="dateRange" @change="onDateChange" />
+        </view>
       </view>
       <view class="report-export-create-modal-footer" @click="closeDropdownAll">
         <view class="report-export-create-modal-btn" @click.stop="confirmCreate" v-if="modalType !== 'read'">{{
@@ -315,7 +329,7 @@
         </view> -->
         <view class="report-export-create-modal-row">
           <text class="report-export-create-modal-label">时间:</text>
-          <view class="report-export-create-modal-inputwrap">
+          <view class="report-export-create-modal-inputwrap" v-if="filterModalOpen">
             <uni-datetime-picker type="daterange" :border="false" v-model="filterDateRange"
               @change="onFilterDateChange" />
           </view>
@@ -1082,6 +1096,10 @@ export default {
       // }
       return { top: "84rpx" };
     },
+    openDatePicker() {
+      if (this.modalType === 'read') return;
+      this.$refs.datePicker.show();
+    },
     onDateChange() { },
     onStart(item) {
       uni.showModal({
@@ -1521,19 +1539,20 @@ export default {
   position: fixed;
   left: 0;
   right: 0;
-  bottom: 0;
+  bottom: -100%;
   width: 100%;
   background: #fff;
   border-top-left-radius: 45rpx;
   border-top-right-radius: 45rpx;
   z-index: 92;
   box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.12);
-  transform: translateY(100%);
-  transition: transform 0.25s ease-out;
+  /* transform: translateY(100%); */
+  transition: bottom 0.25s ease-out;
 }
 
 .report-export-create-modal--open {
-  transform: translateY(0) !important;
+  /* transform: translateY(0) !important; */
+  bottom: 0 !important;
 }
 
 .report-export-create-modal-title {
@@ -1600,6 +1619,12 @@ export default {
   padding-right: 20rpx;
 }
 
+.report-export-input-simulator {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
 .report-export-create-modal-input {
   flex: 1;
   height: 80rpx;