浏览代码

增加房间号

seimin 2 年之前
父节点
当前提交
1e598ef103
共有 2 个文件被更改,包括 271 次插入228 次删除
  1. 31 31
      src/views/Login.vue
  2. 240 197
      src/views/newIncident.vue

+ 31 - 31
src/views/Login.vue

@@ -49,29 +49,29 @@ export default {
49
       this.$http
49
       this.$http
50
         .post("/service/sysinfo/data/fetchDataList/systemConfiguration", {
50
         .post("/service/sysinfo/data/fetchDataList/systemConfiguration", {
51
           idx: 0,
51
           idx: 0,
52
-          sum: 1000,
52
+          sum: 1000
53
         })
53
         })
54
-        .then((res) => {
54
+        .then(res => {
55
           let list = res.data.list;
55
           let list = res.data.list;
56
-          let repairMain = list.find((v) => v.keyconfig == "repairMain"); //报修主体
57
-          let incidentWithConsumable = list.find(
58
-            (v) => v.keyconfig == "incidentWithConsumable"
59
-          ); //是否绑定耗材
60
-          let wxIncidentWithCmdb = list.find(
61
-            (v) => v.keyconfig == "wxIncidentWithCmdb"
62
-          ); //是否绑定资产
63
-          localStorage.setItem(
64
-            "valConfig",
65
-            JSON.stringify(repairMain.valueconfig)
66
-          );
67
-          localStorage.setItem(
68
-            "incidentWithConsumable",
69
-            incidentWithConsumable.valueconfig
70
-          );
71
-          localStorage.setItem(
72
-            "wxIncidentWithCmdb",
73
-            wxIncidentWithCmdb.valueconfig
74
-          );
56
+          list.forEach(v => {
57
+            switch (v.keyconfig) {
58
+              case "repairMain": //报修主体
59
+                localStorage.setItem(
60
+                  "valConfig",
61
+                  JSON.stringify(v.valueconfig)
62
+                );
63
+                break;
64
+              case "incidentWithConsumable": //是否绑定耗材
65
+                localStorage.setItem("incidentWithConsumable", v.valueconfig);
66
+                break;
67
+              case "wxIncidentWithCmdb": //是否绑定资产
68
+                localStorage.setItem("wxIncidentWithCmdb", v.valueconfig);
69
+                break;
70
+              case "ifRoom": //是否增加房间号选择
71
+                localStorage.setItem("ifRoom", v.valueconfig);
72
+                break;
73
+            }
74
+          });
75
           this.$router.push({ path: "/main" });
75
           this.$router.push({ path: "/main" });
76
         });
76
         });
77
     },
77
     },
@@ -134,7 +134,7 @@ export default {
134
     // 登陆
134
     // 登陆
135
     login() {
135
     login() {
136
       var that = this;
136
       var that = this;
137
-      that.$http.post("service/auth/wechatAuth", {}).then((res) => {
137
+      that.$http.post("service/auth/wechatAuth", {}).then(res => {
138
         if (res.data.url) {
138
         if (res.data.url) {
139
           window.location.href = res.data.url;
139
           window.location.href = res.data.url;
140
         } else {
140
         } else {
@@ -160,9 +160,9 @@ export default {
160
         that.login();
160
         that.login();
161
       } else {
161
       } else {
162
         var code = {
162
         var code = {
163
-          code: url[1],
163
+          code: url[1]
164
         };
164
         };
165
-        that.$http.post("service/auth/wechatLoginEncrypt", code).then((res) => {
165
+        that.$http.post("service/auth/wechatLoginEncrypt", code).then(res => {
166
           if (res.data.state == 200) {
166
           if (res.data.state == 200) {
167
             if (res.data.user) {
167
             if (res.data.user) {
168
               localStorage.setItem(
168
               localStorage.setItem(
@@ -197,18 +197,18 @@ export default {
197
     },
197
     },
198
     // 获取查询参数
198
     // 获取查询参数
199
     getQueryString(name) {
199
     getQueryString(name) {
200
-    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
201
-    var r = window.location.search.substr(1).match(reg);
202
-    if (r != null){
200
+      var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
201
+      var r = window.location.search.substr(1).match(reg);
202
+      if (r != null) {
203
         return unescape(r[2]);
203
         return unescape(r[2]);
204
       }
204
       }
205
       return null;
205
       return null;
206
-    },
206
+    }
207
   },
207
   },
208
   created() {
208
   created() {
209
-    if(location.search.length > 0){
210
-      this.isSSo = Boolean(this.getQueryString('t'));
211
-    }else{
209
+    if (location.search.length > 0) {
210
+      this.isSSo = Boolean(this.getQueryString("t"));
211
+    } else {
212
       this.isSSo = false;
212
       this.isSSo = false;
213
     }
213
     }
214
     if (this.isSSo) {
214
     if (this.isSSo) {

文件差异内容过多而无法显示
+ 240 - 197
src/views/newIncident.vue