소스 검색

fix:“修复机器报警不显示的问题”

soobin 2 년 전
부모
커밋
c66c22d348
8개의 변경된 파일40개의 추가작업 그리고 25개의 파일을 삭제
  1. 2 1
      src/assets/language/en.json
  2. 2 1
      src/assets/language/zh.json
  3. 3 2
      src/styles/device/index.less
  4. 24 15
      src/views/device/index.vue
  5. 3 3
      src/views/home/index.vue
  6. 1 1
      src/views/login.vue
  7. 4 1
      src/views/popPayment.vue
  8. 1 1
      src/views/user.vue

+ 2 - 1
src/assets/language/en.json

@@ -413,7 +413,8 @@
     "degree": "degree",
     "volume": "volume",
     "alarmContent": "Alarm content",
-    "eliminateAlarm": "Eliminate alarm",
+    "alarmClock":"Device alarm, please handle!",
+    "eliminateAlarm": "Eliminate",
     "editDevice": "Device details",
     "seeMore": "See more",
     "stow": "stow",

+ 2 - 1
src/assets/language/zh.json

@@ -413,7 +413,8 @@
     "degree": "度",
     "volume": "音量",
     "alarmContent": "报警内容",
-    "eliminateAlarm": "消除报警",
+    "alarmClock":"设备报警,请处理!",
+    "eliminateAlarm": "消除",
     "editDevice": "设备详细信息",
     "seeMore": "查看更多",
     "stow": "收起",

+ 3 - 2
src/styles/device/index.less

@@ -179,6 +179,7 @@
             }
 
             .txt1 {
+              width: 100px;
               overflow-wrap: break-word;
               color: rgba(64, 77, 116, 1);
               font-size: 15px;
@@ -211,7 +212,7 @@
 
             .box4 {
               width: 24px;
-              height: 19px;
+              height: 20px;
               background: url("../../assets/device/alarm.png") 100% no-repeat;
             }
           }
@@ -333,7 +334,7 @@
               font-size: 14px;
               text-align: left;
               white-space: nowrap;
-              display: block;
+              // display: block;
             }
 
             .editDeviceBtnCon {

+ 24 - 15
src/views/device/index.vue

@@ -56,13 +56,17 @@
                   <div class="l-flex-RC">
                     <div class="layer1 flex-col"></div>
                     <span class="txt1 c-text-line1">{{ item.name }}</span>
+                    <div v-if="item.hasTodayAlarm" class="l-flex-between">
+                      <div class="box4 flex-col"></div>
+                      <span class="o-pl-2" style="color: #fe5d55">{{ $t("device.alarmClock") }}</span>
+                    </div>
                   </div>
                   <div class="l-flex-RC">
                     <!-- 报警标志 -->
-                    <div v-if="item.hasTodayAlarm" class="box4 flex-col">
-                      <!-- <img class="pic1" src="../../assets/device/alarm.png" /> -->
-                      <!-- <img class="pic1" src="../../assets/home/M15.png" /> -->
-                    </div>
+                    <!-- <div v-if="item.hasTodayAlarm" class="box4 flex-col"> -->
+                    <!-- <img class="pic1" src="../../assets/device/alarm.png" /> -->
+                    <!-- <img class="pic1" src="../../assets/home/M15.png" /> -->
+                    <!-- </div> -->
                     <div class="layer2 flex-col" :class="{
                       deviceOn: item.eqeStatus === 1,
                       layerLeft: item.hasTodayAlarm,
@@ -111,7 +115,8 @@
                     <van-button type="primary">重启</van-button>
                   </span> -->
                   <div class="word4 o-ptb-10">
-                    <span class="word3 o-pr-5" v-if="item.machineType == '0' || item.machineType == null">{{ $t("device.furnHeadStatus") }}: </span>
+                    <span class="word3 o-pr-5" v-if="item.machineType == '0' || item.machineType == null">{{
+                      $t("device.furnHeadStatus") }}: </span>
                     <span class="word3 o-pr-5" v-else>{{ $t("device.deviceStatus") }}: </span>
                     <span>{{ item.eqeStatus === 1 ? $t("device.opened") : $t("device.closed") }}
                     </span>
@@ -133,7 +138,8 @@
                       }}</van-button>
                     </span>
                   </div>
-                  <van-row class="layer5 o-ptb-10 kBordBott" justify="space-between" v-if="(item.machineType == '0' || item.machineType == null) && item.equimentType != 'POP320'">
+                  <van-row class="layer5 o-ptb-10 kBordBott" justify="space-between"
+                    v-if="(item.machineType == '0' || item.machineType == null) && item.equimentType != 'POP320'">
                     <van-col class="word5">{{ $t("device.furnaceHeadTemperature") }}:{{
                       item.furnaceTm
                     }}{{ $t("device.degree") }}</van-col>
@@ -153,7 +159,7 @@
                     <van-col class="word5">{{ $t("device.cupQuantity") }}:{{ item.cupQuantity
                     }}</van-col>
                   </van-row>
-                  <template v-if="item.isMaterialUse === '1' && (item.machineType == '0' || item.machineType == null)" >
+                  <template v-if="item.isMaterialUse === '1' && (item.machineType == '0' || item.machineType == null)">
                     <van-row justify="space-between" class="sugarTxt o-ptb-10 kBordBott">
                       <van-col>
                         {{ $t("device.whiteSugar") }}:{{ $M_FormatCalcuDecial(item.whiteSugar) }}%
@@ -190,13 +196,16 @@
                     showDateTime(item.lastUpdateTime)
                   }}</span>
                   <span class="info2 o-ptb-5 kBordBott">{{ $t("device.volume") }}:{{ item.volume }}</span>
-                  <span class="info3 o-ptb-10 kBordBott">{{ $t("device.alarmContent") }}:{{
-                    item.alarmList && item.alarmList[0]
-                    ? item.alarmList[0].alarmContent
-                    : item.alarmContent
-                  }}
-                    <span v-if="item.alarmList && item.alarmList[0]" style="color: #4d6add"
-                      @click="clearAlarm(item.alarmList[0])">{{ $t("device.eliminateAlarm") }}</span></span>
+                  <div class="l-flex-RC" >
+                    <span class="info3 o-ptb-2 o-pr-10 kBordBott">{{ $t("device.alarmContent") }}:{{
+                      item.alarmList && item.alarmList[0]
+                      ? item.alarmList[0].alarmContent
+                      : item.alarmContent
+                    }}
+                      </span>
+                      <van-button v-if="item.alarmList && item.alarmList[0]" type="primary" size="small" color="#07c160" :text="$t('device.eliminateAlarm')"
+                       @click="clearAlarm(item.alarmList[0])"></van-button>
+                  </div>
                   <div class="editDeviceBtnCon l-flex-center o-mt-10">
                     <div class="l-flex-RC" @click="deviceSet(item)">
                       <span class="c-text-14">{{
@@ -375,7 +384,7 @@ export default {
         timeRuleId: e.timeRuleId,
       };
       const { data } = await eliminate(Object.assign({}, params));
-      if (data.code === "00000") {
+      if (data.code) {
         Toast.success(t("device.successfullyEliminatedTheAlarm"));
         e.alarmList = [];
       } else {

+ 3 - 3
src/views/home/index.vue

@@ -150,7 +150,7 @@ export default {
     // 获取设备情况
     const getMachineNum = () => {
       Api_postMachineNum({ adminId: user.id }).then((res) => {
-        console.log("res", res);
+        // console.log("res", res);
         equipStatus.value = res.data.data || {};
       });
     };
@@ -158,7 +158,7 @@ export default {
     // 获取公告
     const getNotice = () => {
       Api_getNotice({ adminId: user.id }).then((res) => {
-        console.log("res", res);
+        // console.log("res", res);
         noticeContent.value = res.data.data || {};
       });
     };
@@ -175,7 +175,7 @@ export default {
       Api_getUpdateNotice({
         adminId: user.id,
       }).then((res) => {
-        console.log("res", res);
+        // console.log("res", res);
         Toast(res.data.message);
         setTimeout(() => {
           getNotice();

+ 1 - 1
src/views/login.vue

@@ -132,7 +132,7 @@ export default {
       });
       if (data.code === "00000") {
         setLocal("loginUser", JSON.stringify(data.data));
-        console.log('loginUser JSON:', JSON.stringify(data.data));
+        // console.log('loginUser JSON:', JSON.stringify(data.data));
         Toast.success(t('login.loginSucess'));
         // 需要刷新页面,否则 axios.js 文件里的 token 不会被重置
         // window.location.href = '/';

+ 4 - 1
src/views/popPayment.vue

@@ -2,7 +2,7 @@
     <div>
         <van-nav-bar title="订单信息" />
         <van-card class="my-card" v-for="(orderDetail, index) in orderDetails" :key="index" :num="orderDetail.productNumber"
-            :price="orderDetail.price" :title="orderDetail.productName" :thumb="showSugarPhoto(orderDetail.productNo)" />
+            :price="price" :title="orderDetail.productName" :thumb="showSugarPhoto(orderDetail.productNo)" />
         <van-submit-bar :price="amount" button-color="#07c160" button-text="支付"
             @click="wxPay()" />
     </div>
@@ -25,6 +25,7 @@ export default {
         const order = ref(null);
         const orderDetails = ref([]);
         const amount = ref();
+        const price = ref();
 
         onMounted(async () => {
             if (status == 1) {
@@ -52,6 +53,7 @@ export default {
                 console.log("orderDetails", orderDetails.value[0]);
                 amount.value = order.value.price * 100;
                 // console.log(amount.value);
+                price.value = order.value.price.toFixed(2);
             } else { Toast.fail(data.message); }
 
         };
@@ -87,6 +89,7 @@ export default {
             getOrder,
             orderDetails,
             showSugarPhoto,
+            price,
             amount
         };
     }

+ 1 - 1
src/views/user.vue

@@ -472,7 +472,7 @@ export default {
       try {
         const userInfo = localStorage.getItem("loginUser");
         const userIfForeign = JSON.parse(userInfo);
-        console.log("用户的海内外信息" + userIfForeign.ifForeign);
+        // console.log("用户的海内外信息" + userIfForeign.ifForeign);
         // console.log("看下user是什么***" + user.menuCodeList);
         if (userIfForeign.ifForeign === '1') {
           isAbroad.value = true;