lmc 2 éve
szülő
commit
7660b4cdcd

+ 1 - 3
src/App.vue

@@ -1,7 +1,5 @@
 <template>
-  <transition name="el-fade-in-linear">
-    <router-view v-if="loading"> </router-view>
-  </transition>
+  <router-view v-if="loading"> </router-view>
   <!-- 开启底部安全区适配 -->
   <van-number-keyboard safe-area-inset-bottom />
 </template>

+ 1 - 1
src/router/index.js

@@ -160,7 +160,7 @@ const routes = [
   {
     name: 'remoteControl',
     path: '/remoteControl',
-    component: () => import('../views/remoteControl'),
+    component: () => import('../views/control/list.vue'),
     meta: {
       title: '远程管控',
     },

+ 2 - 2
src/utils/request.js

@@ -59,9 +59,9 @@ service.interceptors.request.use(
 service.interceptors.response.use((response) => {
   const res = response.data;
   // 判断token 失效
-  if (res.code == 10021 || res.code == 10004) {
+  if (res.code == 10021) {
     localStorage.clear()
-    this.$router.push({ path: "/login" });
+    router.push({ path: "/login" })
     Notify({ type: "danger", message: res.msg });
   }
   if (res.code == 500) {

+ 26 - 21
src/views/bill/detail.vue

@@ -103,21 +103,24 @@
                             }`
                           }}:</van-col
                         >
-                        <van-col
-                          style="
-                            font-weight: 600;
-                            color: #fa5555;
-                            position: relative;
-                          "
-                          >¥{{
-                            (parseInt(item.amount * 100) / 100).toFixed(2)
-                          }}
+                        <van-row style="position: relative">
+                          <van-col
+                            style="font-weight: 600; color: #fa5555"
+                            ref="attrMoney"
+                          >
+                            ¥{{
+                              (parseInt(item.amount * 100) / 100).toFixed(2)
+                            }}
+                          </van-col>
                           <van-col
                             class="pay_status"
                             :class="{
                               pay: item.status != 1 && item.status != 2,
                               unPay: item.status == 1 || item.status == 2,
                             }"
+                            :style="{
+                              left: attr_width,
+                            }"
                             >{{
                               `${
                                 dict_filter(item.status, "payStatusList")[
@@ -126,7 +129,7 @@
                               }`
                             }}</van-col
                           >
-                        </van-col>
+                        </van-row>
                       </van-row>
                     </template>
                     <div class="collapse_info">
@@ -307,6 +310,7 @@ export default {
   },
   data() {
     return {
+      attr_width: "",
       currentDate: new Date(),
       maxDate: new Date(),
       showPayPopup: false,
@@ -327,7 +331,7 @@ export default {
       activeTab: "",
       activeTabBar: 0,
       activeCollapse: "",
-      typeTitle: "扣缴类型",
+      typeTitle: "全部",
       payStatusList: [],
       payTypeList: [],
       dataForm: {
@@ -397,6 +401,12 @@ export default {
     this.getPropertyTypeList();
   },
 
+  mounted() {
+    // 获取 DOM 元素
+    setTimeout(() => {
+      this.attr_width = this.$refs.attrMoney[0].$el.offsetWidth + "px";
+    }, 1000);
+  },
   methods: {
     checkTime(val) {
       let year = new Date(val).getFullYear();
@@ -411,16 +421,11 @@ export default {
     },
 
     getPayTypeList() {
-      if (this.activeTab == "bill") {
-        this.payTypeList = getDictDataList("PayType");
-      }
-      if (this.activeTab == "record") {
-        this.payTypeList = getDictDataList("PayType"); //暂时改成这个,后台有数据为物业水电费用的,影响会报错
-        this.payTypeList.forEach((item) => {
-          item.text = item.dictLabel;
-          item.value = item.dictValue == "all" ? "" : item.dictValue;
-        });
-      }
+      this.payTypeList = getDictDataList("PayType");
+      this.payTypeList.forEach((item) => {
+        item.text = item.dictLabel;
+        item.value = item.dictValue == "all" ? "" : item.dictValue;
+      });
     },
 
     getPropertyTypeList() {

+ 5 - 3
src/views/bill/list.vue

@@ -200,7 +200,7 @@ export default {
         children: "childrenList",
       },
       showRepairPositionPicker: false,
-      statusTitle: "是否结清",
+      statusTitle: "全部",
       isFinishedList: [],
       dataForm: {
         projectId: "",
@@ -289,10 +289,12 @@ export default {
     },
 
     getIsFinishedList() {
-      this.isFinishedList = getDictDataList("isFinished");
+      this.isFinishedList = JSON.parse(
+        JSON.stringify(getDictDataList("isFinished"))
+      );
       this.isFinishedList.forEach((item) => {
         item.text = item.dictLabel;
-        item.value = item.dictValue;
+        item.value = item.dictValue == "all" ? "" : item.dictValue;
       });
     },
 

+ 5 - 0
src/views/control/index.vue

@@ -0,0 +1,5 @@
+<template >
+  <keep-alive>
+    <router-view></router-view>
+  </keep-alive>
+</template>

+ 31 - 37
src/views/remoteControl.vue

@@ -223,10 +223,9 @@
   </template>
 </template>
 <script>
-import Api from "../utils/api";
+import Api from "@/utils/api";
 import { isEmpty, getDictDataList, getUrlKey } from "@/utils/index";
-import VCountUp from "./CountUp";
-import { Notify, Dialog } from "vant";
+import VCountUp from "../CountUp";
 export default {
   components: {
     "v-count-up": VCountUp,
@@ -252,9 +251,10 @@ export default {
       deviceType: "AirConditioner",
       deviceStatus: "",
       deviceTypeTitle: "空调",
-      deviceStatusTitle: "设备状态",
+      deviceStatusTitle: "全部",
       deviceTypeList: [],
       deviceStatusList: [
+        { text: "全部", value: "" },
         { text: "开启", value: 1 },
         { text: "关闭", value: 0 },
       ],
@@ -312,7 +312,9 @@ export default {
     },
 
     getDeviceTypeList() {
-      this.deviceTypeList = getDictDataList("DeviceCategory");
+      this.deviceTypeList = JSON.parse(
+        JSON.stringify(getDictDataList("DeviceCategory"))
+      );
       this.deviceTypeList.forEach((item) => {
         item.text = item.dictLabel;
         item.value = item.dictValue;
@@ -476,10 +478,8 @@ export default {
           this.$toast.loading({
             message: "请稍后...",
             forbidClick: true,
-            duration: 5000,
           });
           if (type == "AirConditioner") {
-            this.dataList[index].attributeList[3].value = val;
             Api.setControl({
               keyword: "setPower",
               param: val,
@@ -487,6 +487,7 @@ export default {
             }).then((res) => {
               this.$toast.clear();
               if (res.code == 0) {
+                this.dataList[index].attributeList[3].value = val;
                 this.$toast.success("操作成功");
               } else {
                 this.$toast.fail("操作失败");
@@ -501,6 +502,7 @@ export default {
             }).then((res) => {
               this.$toast.clear();
               if (res.code == 0) {
+                this.dataList[index].status = val;
                 this.$toast.success("操作成功");
               } else {
                 this.$toast.fail("操作失败");
@@ -514,18 +516,14 @@ export default {
       let deviceCommandDTO = {};
       switch (this.module) {
         case "modeTypeList":
-          this.checkedMode[0] = data.value;
-          this.dataList[this.currModeIndex].attributeList[2].value = data.value;
           this.showControl = false;
           deviceCommandDTO = {
             keyword: "setMode",
-            param: data.value,
+            param: data.dictValue,
             deviceId: this.deviceId,
           };
           break;
         case "temperatureList":
-          this.checkedMode[0] = data;
-          this.dataList[this.currModeIndex].attributeList[5].value = data;
           this.showControl = false;
           deviceCommandDTO = {
             keyword: "setTemp",
@@ -534,19 +532,36 @@ export default {
           };
           break;
         case "speedTypeList":
-          this.checkedMode[0] = data.value;
-          this.dataList[this.currModeIndex].attributeList[0].value = data.value;
           this.showControl = false;
           deviceCommandDTO = {
             keyword: "setFan",
-            param: data.value,
+            param: data.dictValue,
             deviceId: this.deviceId,
           };
           break;
       }
+      this.$toast.loading({
+        message: "请稍后...",
+        forbidClick: true,
+      });
       Api.setControl(deviceCommandDTO).then((res) => {
+        this.$toast.clear();
         if (res.code == 0) {
-          Notify({ type: "success", message: "操作成功" });
+          this.$toast.success("操作成功");
+          if (this.module == "modeTypeList") {
+            this.checkedMode[0] = data.dictValue;
+            this.dataList[this.currModeIndex].attributeList[2].value =
+              data.dictValue;
+          }
+          if (this.module == "temperatureList") {
+            this.checkedMode[0] = data;
+            this.dataList[this.currModeIndex].attributeList[5].value = data;
+          }
+          if (this.module == "speedTypeList") {
+            this.checkedMode[0] = data.dictValue;
+            this.dataList[this.currModeIndex].attributeList[0].value =
+              data.dictValue;
+          }
         }
       });
     },
@@ -559,27 +574,6 @@ export default {
       this.module = name;
     },
 
-    elecControl(id, state) {
-      Dialog.confirm({
-        title: "标题",
-        message: "确定执行该操作?",
-      })
-        .then(() => {
-          Api.elecControl({
-            keyword: "setRelay",
-            deviceId: id,
-            param: state ? "1" : "0",
-          }).then((res) => {
-            if (res.code == 0) {
-              this.getElec();
-            }
-          });
-        })
-        .catch(() => {
-          // on cancel
-        });
-    },
-
     // change事件可以拿到的是value
     handelChange(type, val) {
       if (type == "deviceType") {

+ 3 - 0
src/views/home.vue

@@ -444,6 +444,9 @@ export default {
           //工单代办数据
           for (let k in res.data.workOrder) {
             this.workList[k - 1].count = res.data.workOrder[k];
+            if(this.role=='Tenant'||this.role=='Inspection'){
+              this.workList[1].count = this.workList[0].count
+            }
           }
           //设备异常数据
           let deviceArr = [];

+ 11 - 5
src/views/pay/fee.vue

@@ -114,8 +114,8 @@ export default {
     return {
       currentDate: new Date(),
       maxDate: new Date(),
-      billTypeTitle: "欠费类型",
-      arrearDayTitle: "欠费天数",
+      billTypeTitle: "全部",
+      arrearDayTitle: "全部",
       billTypeList: [],
       arrearDayList: [],
       isExpeditList: [],
@@ -162,15 +162,21 @@ export default {
       this.arrearDayList = getDictDataList("ArrearageDay");
       this.arrearDayList.forEach((item) => {
         item.text = item.dictLabel;
-        item.value = item.dictValue;
+        item.value = item.dictValue == "all" ? "" : item.dictValue;
       });
     },
 
     getBillTypeList() {
-      this.billTypeList = getDictDataList("PayType");
+      this.billTypeList = getDictDataList("PayType").filter(
+        (item) =>
+          item.dictValue != "PreStorage" &&
+          item.dictValue != "Subsidy" &&
+          item.dictValue != "CancelSubsidy" &&
+          item.dictValue != "Refund"
+      );
       this.billTypeList.forEach((item) => {
         item.text = item.dictLabel;
-        item.value = item.dictValue;
+        item.value = item.dictValue == "all" ? "" : item.dictValue;
       });
     },
 

+ 2 - 2
src/views/pay/record.vue

@@ -138,7 +138,7 @@ export default {
         children: "childrenList",
       },
       showRepairPositionPicker: false,
-      typeTitle: "扣缴类型",
+      typeTitle: "全部",
       payTypeList: [],
       dataForm: {
         projectId: "",
@@ -208,7 +208,7 @@ export default {
     },
 
     getPayTypeList() {
-      this.payTypeList = getDictDataList("PayType");
+      this.payTypeList = getDictDataList("PayType")
       this.payTypeList.forEach((item) => {
         item.text = item.dictLabel;
         item.value = item.dictValue == "all" ? "" : item.dictValue;

+ 11 - 4
src/views/repair/create.vue

@@ -98,16 +98,20 @@
           required
           placeholder="请输入联系人"
           clearable
+          maxlength="50"
           :rules="[{ required: true, message: '请输入联系人' }]"
         />
         <van-field
           v-model="dataForm.contactPhone"
+          name="pattern"
           label="联系电话"
           required
-          maxlength="11"
           placeholder="请输入联系电话"
           clearable
-          :rules="[{ required: true, message: '请输入联系电话' }]"
+          :rules="[
+            { required: true, message: '请输入联系电话' },
+            { pattern, message: '请输入正确的联系电话' },
+          ]"
         />
         <van-field
           v-model="dataForm.faultDes"
@@ -128,7 +132,7 @@
               v-model="fileList"
               multiple
               :upload-icon="require('@/assets/camera.svg')"
-              :max-size="500 * 1024"
+              :max-size="10 * 1024 * 1024"
               :max-count="10"
               accept="image/jpeg,image/jpg,image/png"
               :before-read="beforeRead"
@@ -173,6 +177,8 @@ export default {
       showRepairTypePicker: false,
       repairRegionList: [],
       repairTypeList: [],
+      pattern:
+        /((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/,
       dataForm: {
         id: "",
         buildingId: "",
@@ -230,7 +236,7 @@ export default {
     },
 
     onOversize() {
-      this.$toast("单个文件大小不能超过 500kb");
+      this.$toast("单个文件大小不能超过 10Mb");
     },
 
     beforeRead(file) {
@@ -320,6 +326,7 @@ export default {
         this.$toast.clear();
         if (res.code == 0) {
           this.$toast.success("保存成功");
+          this.$router.push({ path: "/home" });
         } else {
           this.$toast.fail("保存失败");
         }

+ 1 - 0
src/views/user/password.vue

@@ -18,6 +18,7 @@
         <van-field
           v-model="dataForm.password"
           :type="showType"
+          disabled
           label="原密码"
           required
         >