Browse Source

fix: 修改物料监控图标,屏蔽Airwallex入口

Ritchie 1 year ago
parent
commit
1ae41ec854
2 changed files with 32 additions and 20 deletions
  1. 30 18
      src/views/device/deviceOper.vue
  2. 2 2
      src/views/user.vue

+ 30 - 18
src/views/device/deviceOper.vue

@@ -118,12 +118,12 @@
       <!-- 物料监控 -->
       <div class="operItem" @click="materialMonitorClk()" v-if="device.equimentType != 'SI320'">
         <div class="operIcon">
-          <!-- <img v-if="materialIcon === '0'" class="operImg" src="../../assets/device/operIcon/materialMonitor.png" />
-          <img v-else class="operImg" src="../../assets/device/operIcon/materialMonitorOff.png" /> -->
-          <img class="operImg" src="../../assets/device/operIcon/materialMonitor.png" />
+          <img v-if="materialIcon === '0'" class="operImg" src="../../assets/device/operIcon/materialMonitor.png" />
+          <img v-else class="operImg" src="../../assets/device/operIcon/materialMonitorOff.png" />
+          <!-- <img class="operImg" src="../../assets/device/operIcon/materialMonitor.png" /> -->
         </div>
-        <div class="operText">{{ $t("device.materialMonitor") }}</div>
-        <!-- <div class="operText">{{ materialTitle }}</div> -->
+        <!-- <div class="operText">{{ $t("device.materialMonitor") }}</div> -->
+        <div class="operText">{{ materialTitle }}</div>
       </div>
       <!-- 屏蔽/展示商品 -->
       <div class="operItem" @click="showGoodsClk()" v-if="device.equimentType != 'SI320'">
@@ -252,12 +252,14 @@ export default {
     const operCheckShow = ref(false);
     const device = ref({});
     const operType = ref("");
-    // 休眠按钮
+    // 睡眠按钮文字
     const sleepTitle = ref(t("device.turnOnSleep"));
+    // 物料监控按钮文字
+    const materialTitle = ref(t("device.materialMonitorOn"));
     // 睡眠图标
     const sleepIcon = ref('0');
-    // 启用物料监控图标
-    // const materialIcon = ref('0');
+    // 物料监控图标
+    const materialIcon = ref('0');
 
     // 初始化页面获取列表
     onMounted(async () => {
@@ -277,13 +279,14 @@ export default {
         sleepIcon.value = '0';
       }
       // 物料监控
-      // if (device.value.materialMonitor) {
-      //   materialTitle.value = t("device.materialMonitorOn");
-      //   materialIcon.value = '1';
-      // } else {
-      //   materialTitle.value = t("device.materialMonitorOff");
-      //   materialIcon.value = '0';
-      // }
+      // isMaterialUse = "1"时,物料监控已开启
+      if (device.value.isMaterialUse === '1') {
+        materialTitle.value = t("device.materialMonitorOn");
+        materialIcon.value = '0';
+      } else {
+        materialTitle.value = t("device.materialMonitorOff");
+        materialIcon.value = '1';
+      }
     };
     const closeOper = () => {
       show.value = false;
@@ -355,7 +358,7 @@ export default {
         query: { deviceId: device.value.id, clientId: device.value.clientId },
       });
     };
-    // 系统脱机
+    // 系统脱机
     const tuojiEquipmentFun = () => {
       operType.value = 5;
       operCheckShow.value = true;
@@ -459,7 +462,7 @@ export default {
           showFailToast(data.message);
         }
       }
-      // 删除设备
+      // 删除设备
       if (operType.value === 6) {
         const { data } = await delOneDevice({
           equipmentId: device.value.id,
@@ -474,8 +477,15 @@ export default {
       }
       // 启用物料监控
       if (operType.value === 7) {
+        
+        let materialMonitorStatus = 0; // 0默认是未开启
+        // isMaterialUse是1时,物料监控已启用,按钮是关闭功能
+        if (device.value.isMaterialUse === "1") {
+          materialMonitorStatus = 1; // 1代表已开启
+        }
         const { data } = await enableMaterial({
           equipmentId: device.value.id,
+          materialMonitorStatus
         });
         if (data.code === '00000') {
           showSuccessToast(t("device.enableMaterialSucceed"));
@@ -534,13 +544,15 @@ export default {
       showGoodsClk,
       diyFlowerClk,
       sleepTitle,
+      materialTitle,
       viewLogs,
       deleteDevice,
       lockDevice,
       // viewPosiClk,
       changePasswordClk,
       sleepIcon,
-      materialMonitorClk
+      materialIcon,
+      materialMonitorClk,
     };
   },
   components: {},

+ 2 - 2
src/views/user.vue

@@ -198,13 +198,13 @@
           </div> -->
 
           <!-- Airwallex 钱包 -->
-          <div v-if="isAbroad && user.companyType != '1'" class="taskListRow flex-col"
+          <!-- <div v-if="isAbroad && user.companyType != '1'" class="taskListRow flex-col"
             @click="pushPageList('/airwallex')">
             <div class="taskIcon airwallexIcon"></div>
             <div class="taskRight">
               <div class="taskTitle">{{ $t("user.airwallex") }}</div>
             </div>
-          </div>
+          </div> -->
 
           <!-- 公告编辑 -->
           <div v-if="user.type == '0'" class="taskListRow flex-col" @click="pushPageList('/announcement')">