소스 검색

feat:"优化报警消除功能"

soobin 1 년 전
부모
커밋
0bfa4d8285

+ 3 - 0
src/assets/language/en.json

@@ -487,6 +487,9 @@
     "seeMore": "See more",
     "stow": "Pack up",
     "successfullyEliminatedTheAlarm": "Successfully eliminated the alarm",
+    "oneClickClear": "Clear alarm",
+    "isClear": "Do you want to clear the alarm?",
+    "clearAfter": "Alarm cleared. Do you need to restart the burner?",
     "slideSliderToAdjustVolume": "Slide slider to adjust volume",
     "submitModification": "Submit Modification",
     "currentPriceIs": "The current price is",

+ 3 - 0
src/assets/language/ja.json

@@ -488,6 +488,9 @@
         "seeMore": "もっと見る",
         "stow": "隠す",
         "successfullyEliminatedTheAlarm": "アラーム消去完了",
+        "oneClickClear": "警報を消します",
+        "isClear": "是否清除警报?",
+        "clearAfter": "警報は解除されましたが、炉頭を再稼働させますか?",
         "slideSliderToAdjustVolume": "ボリュームを調整",
         "submitModification": "変更を提出",
         "currentPriceIs": "現在の価格",

+ 3 - 0
src/assets/language/zh.json

@@ -494,6 +494,9 @@
     "seeMore": "查看更多",
     "stow": "收起",
     "successfullyEliminatedTheAlarm": "消除报警成功",
+    "oneClickClear": "一键消除报警",
+    "isClear": "是否一键消除报警?",
+    "clearAfter": "报警已消除,是否需要重启炉头?",
     "slideSliderToAdjustVolume": "滑动滑块调节音量",
     "submitModification": "提交修改",
     "currentPriceIs": "当前价格为",

+ 1 - 0
src/components/typeDownMenu/index.vue

@@ -134,6 +134,7 @@ export default {
       { text: t('typeSelectList.whole'), value: '' },
       { text: t('typeSelectList.MG'), value: '0' },
       { text: t('typeSelectList.POP'), value: '1' },
+      { text: t('typeSelectList.ICE'), value: '2' },
     ];
     // 选择设备类型
     const machineTypeChange = (value) => {

+ 1 - 1
src/styles/orderCenter/index.less

@@ -512,7 +512,7 @@
 
     .van-card {
       background-color: #ffff;
-      width: 95%;
+      width: 100%;
       // margin: 0 5px;
       padding: 0 5px;
     }

+ 34 - 17
src/views/device/index.vue

@@ -240,12 +240,16 @@
                       </span>
                       <span>{{ $t("device.alarmContent") }} : {{ itemAlarm.alarmContent }}</span>
                     </div>
-                    <div class="lineCon"></div>
+                    <!-- <div class="lineCon"></div>
                     <div class="alert-actions">
                       <van-button type="primary" color="#07c160" style="margin: 0 10px;"
                         :text="$t('device.eliminateAlarm')"
                         @click="clearAlarm(itemAlarm, item, item.alarmList)"></van-button>
-                    </div>
+                    </div> -->
+                  </div>
+                  <div class="contentWord kBordBott l-flex-center" v-if="item.alarmList">
+                    <van-button type="primary" color="#07c160" style="margin: 0 10px;" :text="$t('device.oneClickClear')"
+                      @click="clearAllAlarm(item.alarmList, item)"></van-button>
                   </div>
                   <div class="editDeviceBtnCon l-flex-center o-mt-10">
                     <!-- 详细信息 -->
@@ -510,6 +514,31 @@ export default {
         showFailToast(data.message);
       }
     };
+    // 一键消除报警
+    const clearAllAlarm =  (e, e1) => {
+      showConfirmDialog({
+        title: t('device.openRemind'),
+        message: t('device.isClear'),
+      }).then(async () => {
+        const { data } = await eliminate(Object.assign({}, {id: e[0].id}));
+        if (data.code) {
+        showSuccessToast(t("device.successfullyEliminatedTheAlarm"));
+        setTimeout(() => {
+          list.value[list.value.findIndex((item) => item.id === e1.id)].alarmList = null;
+          e1.hasTodayAlarm = false;
+          if (e1.machineType == "0" || e1.machineType == null) {
+            restartHead(e1.id, t("device.clearAfter"));
+          }
+        }, 800);
+      } else {
+        showFailToast(data.message);
+      }
+      }).catch((error) => {
+          console.log(error);
+      });
+    };
+
+
     const showDateTime = (date) => {
       if (!date) {
         return "";
@@ -557,19 +586,6 @@ export default {
       }).catch(() => {
         return;
       })
-      // Api_getReplenishment({ equipmentId: row.id }).then((res) => {
-      //   console.log("res >>>", res);
-      //   // Toast(res.data.message);
-      //   showDialog({
-      //     message: t('device.sentSuccessfully'),
-      //   }).then(() => {
-      //     //返回上一页
-      //     router.go(0);
-      //   });
-      //   setTimeout(() => {
-      //     getList();
-      //   }, 500);
-      // });
     };
     // 操作弹窗完成的回调
     const operFinish = () => {
@@ -671,10 +687,10 @@ export default {
     };
 
     // 重启炉头
-    const restartHead = (id) => {
+    const restartHead = (id, msg) => {
       showConfirmDialog({
         title: t('user.tips'),
-        message: t('device.restartFurnaceHeadTips'),
+        message: msg ? msg: t('device.restartFurnaceHeadTips'),
       }).then(async () => {
         const { data } = await setFurnace({
           equipmentId: id,
@@ -731,6 +747,7 @@ export default {
       search,
       deviceSet,
       clearAlarm,
+      clearAllAlarm,
       oprRef,
       deviceOprShow,
       showDateTime,

+ 1 - 1
src/views/orderCenter/index.vue

@@ -249,7 +249,7 @@
       <template #content>
         <div class="refundBox l-flex-RC" style="overflow-y: auto; overflow-x: hidden; max-height: 40vh;">
           <div v-for="(item, index) in orderDetails" :key="index" class="card01">
-            <van-checkbox :disabled="item.price.toFixed(2) <= 0" v-model="isChecked[index]" @change="checkGood(index)" icon-size="0.5rem"></van-checkbox>
+            <van-checkbox :disabled="item.price.toFixed(2) <= 0" v-model="isChecked[index]" @change="checkGood(index)" icon-size="20px" style="width: 25px"></van-checkbox>
             <van-card :price="item.price.toFixed(2)" :title="item.productName" :thumb="showSugarPic(item.productNo)">
               <template #footer>
                 <van-stepper v-if="item.price.toFixed(2) > 0" v-model="refundNum[index]" @plus="plusRefundGood(index)" @minus="minusRefundGood(index)"