Sfoglia il codice sorgente

fix:“优化物料监控和外循环为按钮开关,修复海外设备报警时间”

soobin 1 anno fa
parent
commit
c9d0ace33e

+ 1 - 0
package.json

@@ -14,6 +14,7 @@
     "@airwallex/payouts-web-sdk": "^1.3.0",
     "@amap/amap-jsapi-loader": "^1.0.1",
     "@vant/area-data": "^1.5.0",
+    "@vant/compat": "^1.0.0",
     "@vant/touch-emulator": "^1.4.0",
     "airwallex-payment-elements": "latest",
     "axios": "^0.20.0",

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

@@ -202,7 +202,7 @@
     "affiliatedMerchants": "Affiliated merchants",
     "equipmentNo": "Equipment No",
     "equipmentName": "Equipment name",
-    "creationTime": "Creation time",
+    "creationTime": "Alarm time",
     "alarmContent": "Alarm content",
     "allDevices": "All devices"
   },
@@ -1345,5 +1345,8 @@
   },
   "Account operation": "Account operation",
   "Discount code": "Discount code",
-  "Alarm history": "Alarm history"
+  "Alarm history": "Alarm history",
+  "Advertising management": "Advertising management",
+  "Order Export": "Order Export",
+  "Apk management": "Apk management"
 }

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

@@ -202,7 +202,7 @@
     "affiliatedMerchants": "所属商家",
     "equipmentNo": "设备编号",
     "equipmentName": "设备名称",
-    "creationTime": "创建时间",
+    "creationTime": "报警时间",
     "alarmContent": "报警内容",
     "allDevices": "所有设备"
   },
@@ -1362,5 +1362,8 @@
   },
   "账户操作": "账户操作",
   "优惠码": "优惠码",
-  "报警历史": "报警历史"
+  "报警历史": "报警历史",
+  "广告管理": "广告管理",
+  "订单导出": "订单导出",
+  "apk管理": "apk管理"
 }

+ 16 - 0
src/styles/paramsSet/index.less

@@ -115,6 +115,22 @@
                 align-items: center;
             }
 
+            .txt3 {
+                display: flex;
+                width: 34%;
+                height: 14px;
+                overflow-wrap: break-word;
+                color: rgba(64, 77, 116, 1);
+                font-size: 14px;
+                text-align: left;
+                white-space: nowrap;
+                line-height: 14px;
+            }
+            
+            .van-field__label {
+                width: 30%;
+            }
+
             .van-field__control {
                 width: 75%;
                 border: 1px solid var(--van-border-color);

+ 9 - 4
src/views/alarmHistory/index.vue

@@ -39,7 +39,7 @@
               </div>
               <div class="itemRow">
                 <span class="itemTitle">{{ $t('alarmHistory.creationTime') }}:&nbsp;</span>{{
-                  showDateTime(item.createDate)
+                  showDateTime(item.occurrenceTime)
                 }}
               </div>
               <div class="itemRow">
@@ -147,9 +147,14 @@ export default {
       }
     };
     const showDateTime = (date) => {
-      return date
-        ? dateUtil.formateDate(new Date(date), "yyyy-MM-dd hh:mm:ss")
-        : "";
+      // return date
+      //   ? dateUtil.formateDate(new Date(date), "yyyy-MM-dd hh:mm:ss")
+      //   : "";
+      if (!date) {
+        return "";
+      }
+      const currentDate = new Date(dateUtil.formateDate(new Date(date), "yyyy-MM-dd hh:mm:ss"));
+      return dateUtil.timeZoneDate(currentDate);
     };
     const showDeviceName = (id) => {
       const device = equipmentSourceList.value.filter((v) => v.id === id);

+ 1 - 0
src/views/device/deviceOper.vue

@@ -175,6 +175,7 @@ import { useI18n } from "vue-i18n";
 import { getLoginUser, styleUrl } from "@/common/js/utils";
 
 export default {
+  emits: ['operfinish'],  
   setup(props, { emit }) {
     // 点击修改价格
     const modifyPriceClk = () => {

+ 1 - 0
src/views/device/index.vue

@@ -288,6 +288,7 @@ export default {
       // adminName: '', // 用户登录名
       current: 1, // 页数
       size: 10, // 页大小
+      todayDate: dateUtil.formateDate(new Date(), "yyyy-MM-dd"), // 当天时间
     });
     // 初始化页面获取列表
     onMounted(() => {

+ 44 - 9
src/views/device/paramsSet/paramsSetInfo.vue

@@ -11,12 +11,19 @@
 
       </div>
       <div class="paramsList" v-for="(item, key) in paramsList" :key="key">
-        <van-field v-model="item.val" name="phone" type="tel" :label="paramName[key]">
+        <van-field v-model="item.val" v-if="item.name != 'M502' && item.name != 'M506'" name="phone" type="tel"
+          :label="paramName[key]">
           <template #button>
-            <van-button size="small" type="primary" class="updataButton"
-                        @click="updateParams(item)">{{ $t('device.submitUpdates') }}</van-button>
+            <van-button size="small" type="primary" class="updataButton" @click="updateParams(item)">{{
+              $t('device.submitUpdates') }}</van-button>
           </template>
         </van-field>
+        <div class="flex-row" v-else>
+          <span class="txt3 o-pl-15 o-mtb-18">{{ paramName[key] }}
+          </span>
+          <van-switch class="o-mt-8" :model-value="checked[key]" @update:model-value="onUpdateValue(item, key)">
+          </van-switch>
+        </div>
       </div>
     </div>
   </div>
@@ -27,7 +34,7 @@ import { onMounted, ref } from "vue";
 import sHeader from "@/components/SimpleHeader";
 import { useRoute } from "vue-router";
 import { getDeviceDetal, getParameters, updateParameters } from "@/service/device";
-import { Toast } from "vant";
+import { Toast, Dialog } from "vant";
 import { useI18n } from 'vue-i18n';
 import { styleUrl } from "../../../common/js/utils";
 
@@ -42,6 +49,7 @@ export default {
     const paramsList = ref([]);
     const comParams = ref([]);
     const paramName = ref([]);
+    const checked = ref([]);
 
     // 初始化页面获取列表
     onMounted(async () => {
@@ -83,13 +91,16 @@ export default {
       if (data.code) {
         paramsList.value = data.data;
         paramsList.value.forEach((paramItem) => {
-          // console.log(paramItem.name);
+          // console.log("paramItem:", paramItem);
           comParams.value.push(paramItem.name);
           paramName.value.push(t("paramNames." + paramItem.name));
-          // paramName.value.push(paramItem.name);
-          // console.log(zh.paramNames[paramItem.name]);
+          if (paramItem.val === '1') {
+            checked.value.push(true);
+          } else {
+            checked.value.push(false);
+          }
         })
-        // console.log(comParams.value);
+        // console.log("checked:", checked.value);
 
       } else {
         Toast.fail(data.message);
@@ -110,13 +121,37 @@ export default {
         Toast.fail(data.message);
       }
     }
+    const onUpdateValue = async (item, key) => {
+      console.log(item);
+      const params = {
+        id: deviceId,
+        name: item.name,
+        val: item.val === '0' ? '1' : '0',
+      };
+      Dialog.confirm({
+        title: '提醒',
+        message: '是否切换开关?',
+      }).then(() => {
+        checked.value[key] = !checked.value[key];
+        const { data } = updateParameters(params);
+        if (data.code) {
+          Toast.success(t('device.modificationSucceeded'));
+        } else {
+          Toast.fail(data.message);
+        }
+      }).catch(() => {
+        // on cancel
+      });
+    };
     return {
       deviceDetal,
       paramsTitle,
       paramsList,
       // getParamName,
       updateParams,
-      paramName
+      paramName,
+      checked,
+      onUpdateValue,
     };
   },
 };

+ 1 - 1
src/views/taskMessage/joinpayMchCheck/info/index.vue

@@ -282,7 +282,7 @@
           </div>
         </div>
       </div>
-      <div v-if="isOper" class="itemRow" style="display: flex; justify-content: center; padding: 0.5rem;">
+      <div v-if="isOper && infoData.status == '1'" class="itemRow" style="display: flex; justify-content: center; padding: 0.5rem;">
         <van-button span="5" round type="primary"
           style="height: 2em; padding: 0 2em; margin: 0 1em; background: rgb(255 0 0 / 20%); color: #ff0000; border-color: #ff0000;"
           @click="changeStatusFun('3')">