Przeglądaj źródła

订单查询和订单详情手机号增加权限

Alex 10 miesięcy temu
rodzic
commit
364b0e3a7a

+ 7 - 1
src/views/recycleOrder/components/order-customer.vue

@@ -17,7 +17,7 @@
       <el-text>发件人:</el-text>
       <el-text v-if="!row.sendName">暂无信息</el-text>
       <el-text v-else
-        >{{ formatName(row.sendName) }}({{formatPhone(row.sendMobile)}})</el-text
+        >{{ formatName(row.sendName) }}(<span v-if="!isShowPhone">{{formatPhone(row.sendMobile)}}</span><span v-else>{{row.sendMobile}}</span>)</el-text
       >
     </div>
     <div class="common-text">
@@ -41,6 +41,12 @@
 <script setup>
   import { formatName, formatPhone } from '@/utils/common';
   import { computed } from 'vue';
+  import { usePermission } from '@/utils/use-permission';
+
+  const { hasPermission } = usePermission();
+  const isShowPhone = computed(() => {
+    return hasPermission('recycleOrder:search:viewPhone');
+  });
 
   const props = defineProps({
     row: {

+ 9 - 1
src/views/recycleOrder/detail/order-base-info.vue

@@ -64,7 +64,8 @@
         </div>
         <div class="common-text">
           <el-text>电 话:</el-text>
-          <el-text>{{ formatPhone(detail.sendMobile) }}</el-text>
+          <el-text v-if="!isShowPhone">{{ formatPhone(detail.sendMobile) }}</el-text>
+          <el-text v-else>{{ detail.sendMobile }}</el-text>
         </div>
         <div class="common-text">
           <el-text>地 址:</el-text>
@@ -102,6 +103,13 @@
 <script setup>
   import { formatName, formatPhone } from '@/utils/common';
   import { ref, reactive, watch } from 'vue';
+  import { usePermission } from '@/utils/use-permission';
+
+  const { hasPermission } = usePermission();
+  const isShowPhone = computed(() => {
+    return hasPermission('recycleOrder:search:viewPhone');
+  });
+
   const props = defineProps({
     detail: { type: Object, default: () => ({}) }
   });