Jelajahi Sumber

feat:update

钱新宇 15 jam lalu
induk
melakukan
0f71c5ea2c

+ 33 - 37
traceCodePackages/traceabilityReport/pages/blacklist/detail/index.vue

@@ -1,18 +1,11 @@
 <template>
   <Water></Water>
   <view class="nav" :style="{ paddingTop: statusBarHeight + 'px' }">
-    <text
-      class="nav-back"
-      :style="{ top: statusBarHeight + 'px' }"
-      @click="onBack"
-    ></text>
+    <text class="nav-back" :style="{ top: statusBarHeight + 'px' }" @click="onBack"></text>
     <view class="nav-title">{{ title }}</view>
   </view>
   <view class="page">
-    <view
-      class="header-card"
-      :style="{ paddingTop: statusBarHeight + 60 + 'px' }"
-    >
+    <view class="header-card" :style="{ paddingTop: statusBarHeight + 60 + 'px' }">
       <view class="meta">
         <view class="dot"></view>
         <text class="meta-text">客户名称:{{ title }}</text>
@@ -22,10 +15,7 @@
         <text class="meta-text">信用代码:{{ creditCode }}</text>
       </view>
     </view>
-    <view
-      class="list-container"
-      :style="{ paddingTop: statusBarHeight - 30 + 'px' }"
-    >
+    <view class="list-container" :style="{ paddingTop: statusBarHeight - 30 + 'px' }">
       <view v-if="loading" class="empty-row">加载中...</view>
       <view v-else-if="products.length === 0" class="empty-row">暂无数据</view>
       <view v-else v-for="(prd, i) in products" :key="'prd-' + i">
@@ -54,15 +44,10 @@
                   </view>
                 </view>
               </view>
-              <uni-icons
-                type="down"
-                size="22"
-                color="#999"
-                :style="{
-                  transform: c.expanded ? 'rotate(180deg)' : 'rotate(0deg)',
-                  transition: 'transform 0.3s ease-in-out',
-                }"
-              ></uni-icons>
+              <uni-icons type="down" size="22" color="#999" :style="{
+                transform: c.expanded ? 'rotate(180deg)' : 'rotate(0deg)',
+                transition: 'transform 0.3s ease-in-out',
+              }"></uni-icons>
             </view>
             <view class="table-card" v-show="c.expanded">
               <scroll-view scroll-x="true" class="table-scroll">
@@ -71,26 +56,19 @@
                     <view class="th col-region">货源片区</view>
                     <view class="th col-qty">数量</view>
                     <view class="th col-batch">批号</view>
-                    <view class="th col-sample">监管码样本(抽样)</view>
+                    <view class="th col-sample">追溯码(抽样)</view>
                     <view class="th col-terminal">终端到达数量</view>
                   </view>
                   <view class="blk-body">
-                    <view
-                      class="blk-row"
-                      v-for="(row, idx) in c.detailLineDTOList"
-                      :key="'row-' + idx"
-                    >
+                    <view class="blk-row" v-for="(row, idx) in c.detailLineDTOList" :key="'row-' + idx">
                       <view class="td col-region">{{ row.supplyArea }}</view>
                       <view class="td col-qty">{{ row.quantity }}</view>
                       <view class="td col-batch">{{ row.batchNumber }}</view>
-                      <view class="td col-sample">{{ row.supervisionCodeSample }}</view>
+                      <view class="td col-sample copyable-code" @click="copyTraceCode(row.supervisionCodeSample)">{{
+                        row.supervisionCodeSample }}</view>
                       <view class="td col-terminal">{{ row.quantity || '--' }}</view>
                     </view>
-                    <view
-                      v-if="!c.detailLineDTOList || c.detailLineDTOList.length === 0"
-                      class="empty-row"
-                      >暂无数据</view
-                    >
+                    <view v-if="!c.detailLineDTOList || c.detailLineDTOList.length === 0" class="empty-row">暂无数据</view>
                   </view>
                 </view>
               </scroll-view>
@@ -131,10 +109,23 @@ export default {
     this.fetchDetail(this.creditCode, options.dateStr); // 使用固定日期测试,或使用 dateStr
   },
   methods: {
+    copyTraceCode(code) {
+      const text = String(code || "").trim();
+      if (!text) {
+        uni.showToast({ title: "无可复制内容", icon: "none" });
+        return;
+      }
+      uni.setClipboardData({
+        data: text,
+        success: () => {
+          uni.showToast({ title: "追溯码已复制", icon: "none" });
+        },
+      });
+    },
     onBack() {
       try {
         uni.navigateBack();
-      } catch (e) {}
+      } catch (e) { }
     },
     toggleCustomer(i, j) {
       const cur = this.products[i].upstreamDTOList[j];
@@ -193,6 +184,7 @@ export default {
 .meta-text {
   font-size: 32rpx;
 }
+
 .nav {
   position: fixed;
   top: 0;
@@ -355,7 +347,7 @@ export default {
 }
 
 .blk-table {
-  min-width: 1060rpx;
+  min-width: 1080rpx;
   border-top: 1rpx solid #eee;
   border-left: 1rpx solid #eee;
 }
@@ -418,7 +410,11 @@ export default {
 }
 
 .col-sample {
-  width: 300rpx;
+  width: 320rpx;
+}
+
+.copyable-code {
+  color: #2c69ff;
 }
 
 .col-terminal {

+ 2 - 2
traceCodePackages/traceabilityReport/pages/customerScanningRate/detail/index.vue

@@ -10,7 +10,7 @@
         <view class="dot"></view>
         <text class="meta-text">等级:{{
           scanType == 1 ? "VIP" : scanType == 2 ? "二级" : "三级"
-          }}客户</text>
+        }}客户</text>
       </view>
       <view class="meta">
         <view class="dot"></view>
@@ -188,7 +188,7 @@ export default {
         customerName: this.customerInput?.customerName,
         scanType: this.scanType,
         levelType: this.customerLevel,
-        physicName: this.physicName,
+        physicName: this.physicName == '全品种' ? '' : this.physicName,
       };
     },
     tableBodyHeight() {

+ 17 - 7
traceCodePackages/traceabilityReport/pages/customerScanningRate/wigets/ScanRateTable.vue

@@ -10,7 +10,7 @@
           <view class="selector" @click.stop="toggleDropdownRegion">
             <text class="selector-text">{{
               region?.regionCode ? region.regionName : "选择片区"
-            }}</text>
+              }}</text>
             <text class="selector-arrow" :class="{ open: dropdownRegionOpen }"></text>
           </view>
           <view class="dropdown" v-show="dropdownRegionOpen" :style="dropdownDirection === 'top'
@@ -40,7 +40,7 @@
           <view class="selector" @click.stop="toggleDropdown">
             <text class="selector-text">{{
               product?.drugEntBaseInfoId ? product.physicName : "选择品种"
-            }}</text>
+              }}</text>
             <text class="selector-arrow" :class="{ open: dropdownOpen }"></text>
           </view>
           <view class="dropdown" v-show="dropdownOpen" :style="dropdownDirection === 'top'
@@ -415,11 +415,16 @@ export default {
   },
   methods: {
     renderCell(item, col) {
-      if (!item[col.key]) return "--";
+      const raw = item[col.key];
+      if (raw === undefined || raw === null || raw === "") return "--";
+      if (raw === "NA") return "NA";
       const reg = /rate/i;
-      if (reg.test(col.key))
-        return Math.floor(Number(item[col.key])) + (col.unit || "");
-      return item[col.key];
+      if (reg.test(col.key)) {
+        const num = Number(raw);
+        if (!Number.isFinite(num)) return "--";
+        return Math.floor(num) + (col.unit || "");
+      }
+      return raw;
     },
     initRegionList() {
       this.regionList = this.filteredRegions.slice(0, 10);
@@ -448,7 +453,12 @@ export default {
     getUid,
     getSummary(col, ci) {
       if (ci == 0) return "合计";
-      return Math.floor(Number(this.summaryData[ci])) + (col.unit || "");
+      const raw = this.summaryData[ci];
+      if (raw === undefined || raw === null || raw === "") return "--";
+      if (raw === "NA") return "NA";
+      const num = Number(raw);
+      if (!Number.isFinite(num)) return "--";
+      return Math.floor(num) + (col.unit || "");
     },
     closeAllTooltip() {
       this.headerTooltip = {};

+ 22 - 4
traceCodePackages/traceabilityReport/pages/ganmaoling/detail/index.vue

@@ -43,7 +43,7 @@
             <view class="th col-batch">批号</view>
             <view class="th col-source">货源地</view>
             <view class="th col-qty">数量</view>
-            <!-- <view class="th col-chain">链路</view> -->
+            <view class="th col-code">追溯码(抽样)</view>
           </view>
           <view class="flow-body">
             <view class="flow-row" v-for="(item, index) in flowList" :key="index">
@@ -54,6 +54,7 @@
               <view class="td col-batch">{{ item.productBatchNo }}</view>
               <view class="td col-source">{{ item.regionName }}</view>
               <view class="td col-qty">{{ item.fromQty }}</view>
+              <view class="td col-code copyable-code" @click="copyTraceCode(item.traceCode)">{{ item.traceCode }}</view>
               <!-- <view class="td col-chain chain-text">{{ item.batchTraceLink }}</view> -->
             </view>
             <view v-if="flowList.length === 0" class="empty-row">暂无数据</view>
@@ -112,6 +113,19 @@ export default {
         uni.navigateBack();
       } catch (e) { }
     },
+    copyTraceCode(code) {
+      const text = String(code || "").trim();
+      if (!text) {
+        uni.showToast({ title: "无可复制内容", icon: "none" });
+        return;
+      }
+      uni.setClipboardData({
+        data: text,
+        success: () => {
+          uni.showToast({ title: "追溯码已复制", icon: "none" });
+        },
+      });
+    },
     fetchDetail(customerName, updatedTime) {
       this.loading = true;
       uni.showLoading({ title: "加载中..." });
@@ -237,7 +251,7 @@ export default {
 }
 
 .flow-table {
-  min-width: 1410rpx;
+  min-width: 1720rpx;
   border-top: 1rpx solid #ccc;
   border-left: 1rpx solid #ccc;
 }
@@ -309,8 +323,12 @@ export default {
   width: 120rpx;
 }
 
-.col-chain {
-  width: 240rpx;
+.col-code {
+  width: 310rpx;
+}
+
+.copyable-code {
+  color: #2c69ff;
 }
 
 .chain-text {

+ 36 - 7
traceCodePackages/traceabilityReport/pages/reportExport/detail/index.vue

@@ -52,7 +52,9 @@
                           <text class="td-cell col-qty">{{ batch.fromQty }}</text>
                           <text class="td-cell col-qty">{{ batch.toQty }}</text>
                           <text class="td-cell col-time">{{ batch.billTime }}</text>
-                          <text class="td-cell col-code">{{ batch.tracCode }}</text>
+                          <text class="td-cell col-code copyable-code" @click="copyTraceCode(batch.tracCode)">
+                            {{ batch.tracCode }}
+                          </text>
                         </view>
                       </view>
                     </scroll-view>
@@ -112,7 +114,9 @@
                           <text class="td-cell col-qty">{{ batch.fromQty }}</text>
                           <text class="td-cell col-qty">{{ batch.toQty }}</text>
                           <text class="td-cell col-time">{{ batch.billTime }}</text>
-                          <text class="td-cell col-code">{{ batch.tracCode }}</text>
+                          <text class="td-cell col-code copyable-code" @click="copyTraceCode(batch.tracCode)">
+                            {{ batch.tracCode }}
+                          </text>
                         </view>
                       </view>
                     </scroll-view>
@@ -412,6 +416,19 @@ export default {
     toggleSubExpand(item) {
       this.$set(item, "expanded", !item.expanded);
     },
+    copyTraceCode(code) {
+      const text = String(code || "").trim();
+      if (!text) {
+        uni.showToast({ title: "无可复制内容", icon: "none" });
+        return;
+      }
+      uni.setClipboardData({
+        data: text,
+        success: () => {
+          uni.showToast({ title: "追溯码已复制", icon: "none" });
+        },
+      });
+    },
     onTableScrollToLower(e) {
       if (e?.detail?.direction === "right") return;
       // if (this.isLoading) return;
@@ -631,7 +648,7 @@ export default {
 }
 
 .batch-table {
-  min-width: 1300rpx;
+  min-width: 1410rpx;
 }
 
 .batch-header-row {
@@ -686,11 +703,15 @@ export default {
 }
 
 .col-time {
-  width: 280rpx;
+  width: 340rpx;
 }
 
 .col-code {
-  width: 240rpx;
+  width: 280rpx;
+}
+
+.copyable-code {
+  color: #2c69ff;
 }
 
 .loading-row {
@@ -730,11 +751,19 @@ export default {
 .loading-wrap {
   position: absolute;
   left: 0;
-  top: 85rpx;
+  top: 280rpx;
   z-index: 91;
   width: 100%;
-  background-color: #fff;
+  background-color: transparent;
   border-bottom-left-radius: 16rpx;
   border-bottom-right-radius: 16rpx;
 }
+
+.empty-data {
+  top: 280rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  background-color: transparent;
+}
 </style>