Browse Source

feat:更新

钱新宇 1 month ago
parent
commit
945275e36d

+ 49 - 0
traceCodePackages/traceabilityReport/pages/ganmaoling/history/index.vue

@@ -1,6 +1,7 @@
 <template>
 <template>
   <view class="history-page">
   <view class="history-page">
     <view class="header-section">
     <view class="header-section">
+      <view class="header-title">历史记录</view>
       <view class="filter-tabs">
       <view class="filter-tabs">
         <view
         <view
           class="tab-item"
           class="tab-item"
@@ -43,6 +44,12 @@
             <view class="row">
             <view class="row">
               <text class="label">公司名称:</text>
               <text class="label">公司名称:</text>
               <text class="value">{{ item.receiverName }}</text>
               <text class="value">{{ item.receiverName }}</text>
+              <text
+                class="level-tag"
+                :class="getLevelClass(item.customerLevel)"
+              >
+                {{ item.customerLevel }}
+              </text>
             </view>
             </view>
             <view class="info-grid">
             <view class="info-grid">
               <view class="info-item">
               <view class="info-item">
@@ -53,6 +60,10 @@
                 <text class="label">性质</text>
                 <text class="label">性质</text>
                 <text class="value">{{ item.customerNature }}</text>
                 <text class="value">{{ item.customerNature }}</text>
               </view>
               </view>
+              <view class="info-item">
+                <text class="label">责任人</text>
+                <text class="value">{{ item.responderName }}</text>
+              </view>
             </view>
             </view>
           </view>
           </view>
         </view>
         </view>
@@ -115,6 +126,13 @@ export default {
   methods: {
   methods: {
     formatDate,
     formatDate,
 
 
+    getLevelClass(level) {
+      if (level === "VIP") return "tag-vip";
+      if (level === "二级") return "tag-l2";
+      if (level === "三级") return "tag-l3";
+      return "tag-default";
+    },
+
     switchFilter(value) {
     switchFilter(value) {
       if (this.currentFilter === value) return;
       if (this.currentFilter === value) return;
       this.currentFilter = value;
       this.currentFilter = value;
@@ -147,6 +165,7 @@ export default {
             PROVINCES[Math.floor(Math.random() * PROVINCES.length)],
             PROVINCES[Math.floor(Math.random() * PROVINCES.length)],
           customerNature: Math.random() > 0.5 ? "协议客户" : "非协议客户",
           customerNature: Math.random() > 0.5 ? "协议客户" : "非协议客户",
           alertCount: Math.floor(Math.random() * 5),
           alertCount: Math.floor(Math.random() * 5),
+          customerLevel: ["VIP", "二级", "三级"][Math.floor(Math.random() * 3)],
         });
         });
       }
       }
 
 
@@ -196,6 +215,36 @@ export default {
 </script>
 </script>
 
 
 <style scoped>
 <style scoped>
+.level-tag {
+  font-size: 20rpx;
+  padding: 4rpx 12rpx;
+  border-radius: 8rpx;
+  white-space: nowrap;
+  line-height: 1.2;
+  margin-left: 10rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.header-right {
+  flex-shrink: 0;
+}
+
+.tag-vip {
+  background: linear-gradient(135deg, #e6f7ff, #bae7ff);
+  color: #096dd9;
+}
+
+.tag-l2 {
+  background: linear-gradient(135deg, #f6ffed, #d9f7be);
+  color: #389e0d;
+}
+
+.tag-l3 {
+  background: linear-gradient(135deg, #fff7e6, #ffe7ba);
+  color: #d46b08;
+}
 .history-page {
 .history-page {
   display: flex;
   display: flex;
   flex-direction: column;
   flex-direction: column;

+ 82 - 40
traceCodePackages/traceabilityReport/pages/index.vue

@@ -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>

+ 14 - 4
traceCodePackages/traceabilityReport/pages/reportExport/index.vue

@@ -871,13 +871,14 @@ export default {
   },
   },
   created() {
   created() {
     const userInfo = uni.getStorageSync("userInfo");
     const userInfo = uni.getStorageSync("userInfo");
-    const staffEmail = userInfo?.ldap || "";
-    this.emailForm.email = staffEmail.split("@")[0];
+    // const staffEmail = userInfo?.ldap || "";
+    // this.emailForm.email = staffEmail.split("@")[0];
     console.log("reportExport\index.vue,storage,userInfo", userInfo);
     console.log("reportExport\index.vue,storage,userInfo", userInfo);
     this.initList();
     this.initList();
     this.getProviceList();
     this.getProviceList();
     this.getDrugInfoName();
     this.getDrugInfoName();
     this.fetchList();
     this.fetchList();
+    this.getUserEmail();
     try {
     try {
       uni.onKeyboardHeightChange(({ height }) => {
       uni.onKeyboardHeightChange(({ height }) => {
         this.dropdownUpward = height > 0;
         this.dropdownUpward = height > 0;
@@ -931,6 +932,15 @@ export default {
     },
     },
   },
   },
   methods: {
   methods: {
+    async getUserEmail() {
+      const resp = await request("/report/getEmailAddress", {
+        accessToken: uni.getStorageSync("accessToken"),
+      });
+      if (resp.code == 200) {
+        const mail = resp.data.split("@")[0];
+        this.emailForm.email = mail || "";
+      }
+    },
     getCustomerName(data = {}) {
     getCustomerName(data = {}) {
       const { customerName = "", otherCustomer = "" } = data;
       const { customerName = "", otherCustomer = "" } = data;
       let name = customerName || "";
       let name = customerName || "";
@@ -1614,10 +1624,10 @@ export default {
       uni.showLoading({
       uni.showLoading({
         title: "发送中...",
         title: "发送中...",
       });
       });
-      const url = "/report/sendEmail";
+      const url = "/report/sendemail";
       request(url, {
       request(url, {
         taskId: this.currentItem?.id,
         taskId: this.currentItem?.id,
-        emailAddress: uni.getStorageSync("accessToken") || "", //email + "@999.com.cn",
+        emailAddress: email + "@999.com.cn",
         path: "reportExport/index.vue",
         path: "reportExport/index.vue",
       }).then((res) => {
       }).then((res) => {
         uni.hideLoading();
         uni.hideLoading();