Ver Fonte

feat:“同步”

soobin há 1 ano atrás
pai
commit
ec0d94263e

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

@@ -40,7 +40,10 @@
     "sz": "Sunzee",
     "sc": "Sevencloud",
     "MG": "Marshmallow",
-    "POP": "Popcorn"
+    "POP": "Popcorn",
+    "ifForeignes": "Account type",
+    "mainland": "Chinese mainland",
+    "overseas": "Hong Kong, Macao, Taiwan and overseas"
   },
   "navBar": {
     "homePage": "home page",

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

@@ -40,7 +40,10 @@
     "sz": "申泽",
     "sc": "七云",
     "MG": "棉花糖",
-    "POP": "爆米花"
+    "POP": "爆米花",
+    "ifForeignes": "账号类型",
+    "mainland": "大陆",
+    "overseas": "港澳台及海外"
   },
   "navBar": {
     "homePage": "首页",

+ 39 - 28
src/components/SimpleHeader.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="block">
-    <header class="simple-header van-hairline--bottom" :style="{position:isFixed?'fixed':'relative'}">
+    <header class="simple-header van-hairline--bottom" :style="{ position: isFixed ? 'fixed' : 'relative' }">
       <i v-if="!isback" class="nbicon nbfanhui" @click="goBack"></i>
       <!-- <i v-else>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</i> -->
       <i v-else></i>
@@ -28,9 +28,14 @@ export default {
       default: false
     },
     // 是否固定在顶部
-    isFixed:{
+    isFixed: {
       type: Boolean,
       default: true
+    },
+    // 锁定要跳转的页面路径
+    targetPath: {
+      type: String,
+      default: ''
     }
   },
   emits: ['callback'],
@@ -38,7 +43,9 @@ export default {
     const isback = ref(props.noback)
     const router = useRouter()
     const goBack = () => {
-      if (!props.back) {
+      if (props.targetPath) {
+        router.replace({ path: props.targetPath })
+      } else if (!props.back) {
         router.go(-1)
       } else {
         router.push({ path: props.back })
@@ -54,30 +61,34 @@ export default {
 </script>
 
 <style lang="less" scoped>
-  @import '../common/style/mixin';
-  .simple-header {
-    // position: fixed;
-    top: 0;
-    left: 0;
-    z-index: 999;
-    .fj();
-    .wh(100%, 44px);
-    line-height: 44px;
-    padding: 0 10px;
-    .boxSizing();
-    color: #404d74;
-    background: #fff;
-    .simple-header-name {
-      white-space: nowrap;
-      font-size: 16px;
-      font-weight: 600;
-    }
-  }
-  .block {
-    width: 100%;
-    height: 44px;
-  }
-  .moreIcon {
-    visibility: hidden;
+@import '../common/style/mixin';
+
+.simple-header {
+  // position: fixed;
+  top: 0;
+  left: 0;
+  z-index: 999;
+  .fj();
+  .wh(100%, 44px);
+  line-height: 44px;
+  padding: 0 10px;
+  .boxSizing();
+  color: #404d74;
+  background: #fff;
+
+  .simple-header-name {
+    white-space: nowrap;
+    font-size: 16px;
+    font-weight: 600;
   }
+}
+
+.block {
+  width: 100%;
+  height: 44px;
+}
+
+.moreIcon {
+  visibility: hidden;
+}
 </style>

+ 39 - 1
src/components/typeSelectList/index.vue

@@ -21,6 +21,15 @@
         <van-picker :title="$t('typeSelectList.companies')" :columns="companyList" @confirm="companyConfirm"
           @cancel="companyCancel" />
       </van-popup>
+      <div v-if="isShowAdminAndCompany()" class="selectIconBox" @click="foreignShow()">
+        <div class="section3 flex-col"></div>
+        <span class="txt4">{{ ifForeignes }}</span>
+        <div class="layer1 flex-col"></div>
+      </div>
+      <van-popup v-model:show="ifForeign" position="bottom">
+        <van-picker :title="$t('typeSelectList.ifForeignes')" :columns="foreignList" @confirm="foreignConfirm"
+          @cancel="foreignCancel" />
+      </van-popup>
       <div class="selectIconBox" @click="payShow()">
         <div class="section3 flex-col"></div>
         <span class="txt4">{{ paymentMethod }}</span>
@@ -95,6 +104,8 @@ export default {
     const { t } = useI18n();
     // 支付方式
     const paymentMethod = ref(t('typeSelectList.paymentMethod'));
+    // 账号地区
+    const ifForeignes = ref(t('typeSelectList.ifForeignes'));
     // 公司平台
     const companies = ref(t('typeSelectList.companies'));
     // 公司平台
@@ -112,7 +123,8 @@ export default {
       productNo: '',
       equipmentId: '',
       companyType: '',
-      machineType: ''
+      machineType: '',
+      ifForeign: '',
     });
     // 商户选择
     const adminTypeShow = ref(false);
@@ -136,6 +148,25 @@ export default {
         adminList.value.unshift(t('typeSelectList.allSuboUsers'));
       }
     }
+    // 账号地区选择
+    const ifForeign = ref(false);
+    const foreignShow = () => { ifForeign.value = true; };
+    const foreignSouerList = [
+      { text: t('typeSelectList.mainland'), values: '0' },
+      { text: t('typeSelectList.overseas'), values: '1' },
+    ];
+    const foreignList = ref([
+      t('typeSelectList.mainland'),
+      t('typeSelectList.overseas'),
+    ]);
+    const foreignConfirm = (currentValue) => {
+      ifForeignes.value = currentValue;
+      const selectPay = foreignSouerList.filter(i => i.text === currentValue);
+      if (selectPay && selectPay.length > 0) { searchParams.ifForeign = selectPay[0].values; }
+      ifForeign.value = false;
+      outputDate();
+    }
+    const foreignCancel = () => { ifForeign.value = false; }
     // 公司平台选择
     const companyType = ref(false);
     const companyShow = () => { companyType.value = true; };
@@ -282,6 +313,8 @@ export default {
     const isShowAdmin = () => { return (user && user.type === 2); }
     // 是否管理员
     const isShowCompany = () => { return (user && user.type === 0); }
+    // 是否管理员和公司人员
+    const isShowAdminAndCompany = () => { return (user && user.type < 2); }
     // 是否商户及子账户
     const isShowDevice = () => { return (user && (user.type === 2 || user.type === 3)); }
     // 返回参数
@@ -326,12 +359,16 @@ export default {
       isShowCompany,
       // 是否商户及子账户
       isShowDevice,
+      // 是否管理员和公司人员
+      isShowAdminAndCompany,
       // 商家选择
       adminTypeShow, adminList, adminShow, adminConfirm, adminCancel,
       // 支付方式选择
       payType, payList, payShow, payConfirm, payCancel,
       // 公司平台选择
       companyType, companyList, companyShow, companyConfirm, companyCancel,
+      // 国内和海外选择
+      ifForeign, foreignList, foreignShow, foreignConfirm, foreignCancel,
       // 设备类型选择
       machineType, machineList, machineShow, machineConfirm, machineCancel,
       // 设备选择
@@ -341,6 +378,7 @@ export default {
       // 订单状态
       orderStatusShow, orderStatus, orderStatusList, orderStatusConfirm, orderStatusCancel,
       paymentMethod,
+      ifForeignes,
       companies,
       machines,
       allDevices,

+ 11 - 0
src/router/index.js

@@ -509,6 +509,17 @@ const router = createRouter({
 });
 // 路由守卫处理
 router.beforeEach((to, from, next) => {
+  // 从账户操作页面回到home页面
+  if (from.name === "accountOperation" && to.name === "home") {
+    // router.push("/home");
+    location.reload();
+    // 阻止重定向回 账户操作页
+    if (to.path === '/accountOperation') {
+      next(false);
+    } else {
+      next();
+    }
+  }
   // 页面带有不需要识别登录状态的跳过登录验证
   if (to.meta.noLogin) {
     next();

+ 18 - 0
src/utils/dateUtil.js

@@ -43,6 +43,24 @@ const dateUtil = {
     }
     return format;
   },
+  // 根据时区转换时间
+  timeZoneDate(currentDate) {
+    // 获取设备的时区偏移量(分钟)
+    const deviceTimezoneOffset = new Date().getTimezoneOffset();
+    // 获取北京时间的时区偏移量(分钟)
+    const beijingTimezoneOffset = -480; // -480分钟为北京时区偏移量
+    // 计算设备时区与北京时区的偏移量差
+    const offsetDifference = deviceTimezoneOffset - beijingTimezoneOffset;
+    // 将设备的时区偏移量转换为毫秒数
+    const offsetMilliseconds = offsetDifference * 60 * 1000;
+    // 将北京时间的毫秒数加上设备的时区偏移量的毫秒数(仅对非北京时间进行调整)
+    const adjustedMilliseconds = offsetMilliseconds !== 0 ? currentDate.getTime() + offsetMilliseconds : currentDate.getTime();
+    // 使用调整后的时间创建一个新的Date对象
+    const adjustedDate = new Date(adjustedMilliseconds);
+    // 格式化调整后的时间
+    const formattedDate = dateUtil.formateDate(adjustedDate, 'yyyy-MM-dd hh:mm:ss');
+    return formattedDate;
+  },
   // isSameWeek(old,now){
   //   var oneDayTime = 1000*60*60*24;  
   //   var old_count =parseInt(old.getTime()/oneDayTime);  

+ 8 - 4
src/views/accountPer/add.vue

@@ -9,7 +9,9 @@
             { required: true, message: $t('accountPer.usernamePlaceholder') },
           ]" />
         <van-field v-model="password" name="password" type="password" :label="$t('accountPer.passwordLabel')"
-          :placeholder="$t('accountPer.passwordPlaceholder')" />
+          :placeholder="$t('accountPer.passwordPlaceholder')" :rules="[
+            { required: true, message: $t('accountPer.passwordPlaceholder') },
+          ]" />
         <van-field v-model="name" name="name" :label="$t('accountPer.nameLabel')"
           :placeholder="$t('accountPer.namePlaceholder')" :rules="[
             { required: true, message: $t('accountPer.namePlaceholder') },
@@ -179,11 +181,12 @@ export default {
       //   params.equipmentIds= [params.equipmentIds];
       // }
       if (pageTitle.value === t("accountPer.modifyAccount")) {
-        delete params.password;
+        // delete params.password;
         const { data } = await updataLoginUser(params);
         if (data.code === "00000") {
           Toast.success(t("accountPer.successfullyModifiedTheAccount"));
-          router.push("/accountPer");
+          // router.push("/accountPer");
+          router.replace("/accountPer");
         } else {
           Toast.fail(t("accountPer.failedToModifyTheAccount"), data.message);
         }
@@ -207,7 +210,8 @@ export default {
       const { data } = await deleteLoginUser(params);
       if (data.code === "00000") {
         Toast.success(t("accountPer.successfullyDeletedTheAccount"));
-        router.push("/accountPer");
+        // router.push("/accountPer");
+        router.replace("/accountPer");
       } else {
         Toast.fail(t("accountPer.failedToDeleteTheAccount"), data.message);
       }

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

@@ -399,21 +399,7 @@ export default {
         return "";
       }
       const currentDate = new Date(dateUtil.formateDate(new Date(date), "yyyy-MM-dd hh:mm:ss"));
-      // 获取设备的时区偏移量(分钟)
-      const deviceTimezoneOffset = new Date().getTimezoneOffset();
-      // 获取北京时间的时区偏移量(分钟)
-      const beijingTimezoneOffset = -480; // -480分钟为北京时区偏移量
-      // 计算设备时区与北京时区的偏移量差
-      const offsetDifference = deviceTimezoneOffset - beijingTimezoneOffset;
-      // 将设备的时区偏移量转换为毫秒数
-      const offsetMilliseconds = offsetDifference * 60 * 1000;
-      // 将北京时间的毫秒数加上设备的时区偏移量的毫秒数(仅对非北京时间进行调整)
-      const adjustedMilliseconds = offsetMilliseconds !== 0 ? currentDate.getTime() + offsetMilliseconds : currentDate.getTime();
-      // 使用调整后的时间创建一个新的Date对象
-      const adjustedDate = new Date(adjustedMilliseconds);
-      // 格式化调整后的时间
-      const formattedDate = dateUtil.formateDate(adjustedDate, 'yyyy-MM-dd hh:mm:ss');
-      return formattedDate;
+      return dateUtil.timeZoneDate(currentDate);
     };
 
     // 点击查看定位
@@ -526,4 +512,5 @@ export default {
 
 <style lang="less" scoped>
 @import "../../common/style/common";
+@import "../../styles/device/index";
 </style>

+ 7 - 4
src/views/device/showGoods/index.vue

@@ -9,13 +9,17 @@
       </div>
     </div>
   </div>
+  <div class="l-flex-between o-m-10">
+    <div>{{ $t('device.modifyPricePage.total') }}{{ tableData.length }}{{ $t('device.modifyPricePage.goods') }}
+    </div>
+  </div>
   <van-row class="goods o-mlr-8" wrap="true">
     <van-col v-for="(item, index) in tableData" :key="index" class="goodsCon o-mr-14" span="11">
       <div class="l-flex-RC">
         <van-image width="60" height="60" fit="contain" :src="showSugerPhoto(item)" />
-        <span class="o-ml-10" style="word-wrap: break-word; width: 50px;" >{{ item.productName }}</span>
+        <span class="o-ml-10" style="word-wrap: break-word; width: 50px;">{{ item.productName }}</span>
         <van-switch class="o-ml-1" v-model="switchStates[index]" size="20px" active-color="#4dc294"
-                    @change="handleChange(index)" />
+          @change="handleChange(index)" />
       </div>
       <van-divider :style="{ color: '#1baeae', borderColor: '#1baeae', fontSize: '20px', fontWeight: 500 }" />
     </van-col>
@@ -175,5 +179,4 @@ export default {
 };
 </script>
 
-<style lang="less" scoped>
-</style>
+<style lang="less" scoped></style>

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

@@ -213,7 +213,7 @@ export default {
         ...dateSelect.value,
         // ...typeSelectData,
         adminId: user.id,
-        ifForeign: user.ifForeign,
+        ifForeign: typeSelectData.ifForeign === '' ? user.ifForeign :  typeSelectData.ifForeign,
         payType: typeSelectData.payType,
         clientId: typeSelectData.clientId,
         username: typeSelectData.userName, // 商家

+ 13 - 21
src/views/orderCenter/index.vue

@@ -226,20 +226,6 @@
     <kDialog :isCloseForConfirm="false" :dialogTitle="$t('orderCenter.refundTip')"
       :confirmBtnTxt="$t('orderCenter.refundSubmit')" ref="kDialogRef" @confirmclk="confirmClk">
       <template #content>
-        <!-- <van-field colon required type="number" clearable v-model="cofficentForm.price" class="inputAmount"
-          :placeholder="$t('orderCenter.refundAmountPlace')" :label="$t('orderCenter.refundAmount')">
-          <template #extra>
-            {{ $t('orderCenter.most') }}¥{{ cofficentForm.maxPrice }}
-          </template>
-        </van-field>
-        <div class="van-cell l-flex-RC">
-          <div class="van-field__label van-field__label--required">
-            <span>{{ $t('orderCenter.refundQuantity') }}: </span>
-          </div>
-          <van-stepper v-model="cofficentForm.productNumber" theme="round" button-size="22"
-            :max="cofficentForm.maxNumber" disable-input />
-          <span class="o-pl-10">{{ $t('orderCenter.most') + cofficentForm.maxNumber + $t('orderCenter.at') }}</span>
-        </div> -->
         <div class="cust_vantBorder l-flex-RC">
           <div v-for="(item, index) in orderDetails" :key="index" class="card01">
             <van-checkbox v-model="isChecked[index]" @change="checkGood(index)" icon-size="20px"></van-checkbox>
@@ -504,6 +490,7 @@ export default {
       status: "",//支付状态
       companyType: "", // 公司平台
       machineType: "", // 设备类型
+      ifForeign: "",
     });
 
     let chartType = "day";
@@ -586,6 +573,7 @@ export default {
     const update = (uDate) => {
       chartType = uDate.chartType;
       searchParams = Object.assign(searchParams, uDate);
+      searchParams.type = searchParams.ifForeign;
       search();
     };
     // 商户、支付方式、设备、商品选择回调
@@ -593,6 +581,7 @@ export default {
       // console.log('uSData', uSData)
       searchParams = Object.assign(searchParams, uSData);
       // console.log('searchParams', searchParams)
+      searchParams.type = searchParams.ifForeign;
       search();
     };
     // 初始化页面获取列表
@@ -627,7 +616,9 @@ export default {
         onLoad();
         addEventListener('load', onLoad);
         // 获取账户详情
-        getAccountDetail(user.id);
+        if (user.ifForeign === '0') {
+          getAccountDetail(user.id);
+        }
       }
     });
 
@@ -676,15 +667,15 @@ export default {
       if (idx === 1) {
         switch (item.status) {
           case 1:
-            return dateUtil.formateDate(new Date(item.payDate), "yyyy-MM-dd hh:mm:ss");
+            return dateUtil.timeZoneDate(new Date(dateUtil.formateDate(new Date(item.payDate), "yyyy-MM-dd hh:mm:ss")));
           case 3:
-            return dateUtil.formateDate(new Date(item.refundDate), "yyyy-MM-dd hh:mm:ss");
+            return dateUtil.timeZoneDate(new Date(dateUtil.formateDate(new Date(item.refundDate), "yyyy-MM-dd hh:mm:ss")));
           default:
-            return dateUtil.formateDate(new Date(item.createDate), "yyyy-MM-dd hh:mm:ss");
+            return dateUtil.timeZoneDate(new Date(dateUtil.formateDate(new Date(item.createDate), "yyyy-MM-dd hh:mm:ss")));
         }
       } else {
         return item && item.createDate
-          ? dateUtil.formateDate(new Date(item.createDate), "yyyy-MM-dd hh:mm:ss")
+          ? dateUtil.timeZoneDate(new Date(dateUtil.formateDate(new Date(item.createDate), "yyyy-MM-dd hh:mm:ss")))
           : "";
       }
     };
@@ -766,13 +757,13 @@ export default {
         adminId: user.id,
         chartType: chartType,
         endDate: searchParams.endDate,
-        ifForeign: user.ifForeign,
+        ifForeign: searchParams.ifForeign == '' ? user.ifForeign : searchParams.ifForeign,
         startDate: searchParams.startDate,
         userName: searchParams.userName,
         clientId:
           searchParams.clientId === "" ? null : searchParams.clientId,
         equipmentId:
-          searchParams.equipmentId === "" ? null : searchParams.equipmentId,
+          searchParams.equipmentId === "" ? null : searchParams.equipmentId, 
         payType:
           searchParams.payType === "" ? null : searchParams.payType,
         companyType: searchParams.companyType,
@@ -848,4 +839,5 @@ export default {
 </script>
 <style lang="less" scoped>
 @import "../../common/style/common.less";
+@import "../../styles/orderCenter/index.less";
 </style>

+ 4 - 2
src/views/role/add.vue

@@ -173,7 +173,8 @@ export default {
       const { data } = await addSysRole(params);
       if (data.code === "00000") {
         Toast.success(t("role.roleAddedSuccessfully"));
-        router.push("/role");
+        // router.push("/role");
+        router.replace("/role");
       } else {
         Toast.fail(`${t("role.failedToAddRole")} ${data.message}`);
       }
@@ -189,7 +190,8 @@ export default {
       const { data } = await updateSysRole(params);
       if (data.code === "00000") {
         Toast.success(t("role.successfullyModifiedRole"));
-        router.go(-1);
+        // router.go(-1);
+        router.replace("/role");
       } else {
         Toast.fail(`${t("role.failedToModifyRole")} ${data.message}`);
       }