소스 검색

资产的展示

seimin 3 년 전
부모
커밋
2751f93162
5개의 변경된 파일83개의 추가작업 그리고 26개의 파일을 삭제
  1. 2 2
      css/index.css
  2. 52 1
      index.html
  3. 3 0
      js/index.js
  4. 26 23
      js/login.js
  5. BIN
      pc-repair.tar

+ 2 - 2
css/index.css

@@ -449,7 +449,7 @@ article > .content .left {
449 449
 }
450 450
 
451 451
 .right .r-list .r-item {
452
-  height: 165px;
452
+  /* height: 165px; */
453 453
   padding: 16px 8px 16px 16px;
454 454
   overflow: hidden;
455 455
   color: #333;
@@ -485,7 +485,7 @@ article > .content .left {
485 485
 
486 486
 .right .r-list .r-item .r-item-content {
487 487
   line-height: 20px;
488
-  height: 40px;
488
+  /* height: 40px; */
489 489
   margin-top: 4px;
490 490
 }
491 491
 

+ 52 - 1
index.html

@@ -384,7 +384,10 @@
384 384
     {{else}} {{each data}}
385 385
     <li class="r-item">
386 386
       <div class="r-item-title">报修单号:<span>{{$value.bxcode}}</span></div>
387
-      <p class="r-item-content twoline">{{$value.description}}</p>
387
+      <p class="r-item-content twoline">报修内容:{{$value.description}}</p>
388
+      {{if $value.wxIncidentWithCmdb == 1}}
389
+      <p class="r-item-content twoline">资产:{{$value.assetId||'无'}}</p>
390
+      {{/if}}
388 391
       <div class="r-item-info clearfix">
389 392
         <strong class="fl">{{$value.createTime | dateFormat}}</strong>
390 393
         <a href="javascript:;" class="r-item-click fr" data-id="{{$value.id}}"
@@ -651,6 +654,12 @@
651 654
             <strong>报修地址:</strong>
652 655
             <span>{{incident.place ? incident.place.area.area + incident.place.place : ''}}{{address}}</span>
653 656
           </li>
657
+          {{if wxIncidentWithCmdb == 1}}
658
+          <li class="pop1-hd__itemList">
659
+            <strong>资产:</strong>
660
+            <span>{{assetId||'无'}}</span>
661
+          </li>
662
+          {{/if}}
654 663
         </ul>
655 664
       </div>
656 665
       <div class="pop1-hd__item">
@@ -753,6 +762,12 @@
753 762
             <strong>报修地址:</strong>
754 763
             <span>{{incident.place ? incident.place.area.area + incident.place.place : ''}}{{address}}</span>
755 764
           </li>
765
+          {{if wxIncidentWithCmdb == 1}}
766
+          <li class="pop1-hd__itemList">
767
+            <strong>资产:</strong>
768
+            <span>{{assetId||'无'}}</span>
769
+          </li>
770
+          {{/if}}
756 771
         </ul>
757 772
       </div>
758 773
       <div class="pop1-hd__item">
@@ -861,6 +876,12 @@
861 876
             <strong>报修地址:</strong>
862 877
             <span>{{incident.place ? incident.place.area.area + incident.place.place : ''}}{{address}}</span>
863 878
           </li>
879
+          {{if wxIncidentWithCmdb == 1}}
880
+          <li class="pop1-hd__itemList">
881
+            <strong>资产:</strong>
882
+            <span>{{assetId||'无'}}</span>
883
+          </li>
884
+          {{/if}}
864 885
         </ul>
865 886
       </div>
866 887
       <div class="pop1-hd__item">
@@ -975,6 +996,12 @@
975 996
             <strong>报修地址:</strong>
976 997
             <span>{{incident.place ? incident.place.area.area + incident.place.place : ''}}{{address}}</span>
977 998
           </li>
999
+          {{if wxIncidentWithCmdb == 1}}
1000
+          <li class="pop1-hd__itemList">
1001
+            <strong>资产:</strong>
1002
+            <span>{{assetId||'无'}}</span>
1003
+          </li>
1004
+          {{/if}}
978 1005
         </ul>
979 1006
       </div>
980 1007
       <div class="pop1-hd__item">
@@ -1095,6 +1122,12 @@
1095 1122
             <strong>报修地址:</strong>
1096 1123
             <span>{{incident.place ? incident.place.area.area + incident.place.place : ''}}{{address}}</span>
1097 1124
           </li>
1125
+          {{if wxIncidentWithCmdb == 1}}
1126
+          <li class="pop1-hd__itemList">
1127
+            <strong>资产:</strong>
1128
+            <span>{{assetId||'无'}}</span>
1129
+          </li>
1130
+          {{/if}}
1098 1131
         </ul>
1099 1132
       </div>
1100 1133
       <div class="pop1-hd__item">
@@ -1213,6 +1246,12 @@
1213 1246
             <strong>报修地址:</strong>
1214 1247
             <span>{{incident.place ? incident.place.area.area + incident.place.place : ''}}{{address}}</span>
1215 1248
           </li>
1249
+          {{if wxIncidentWithCmdb == 1}}
1250
+          <li class="pop1-hd__itemList">
1251
+            <strong>资产:</strong>
1252
+            <span>{{assetId||'无'}}</span>
1253
+          </li>
1254
+          {{/if}}
1216 1255
         </ul>
1217 1256
       </div>
1218 1257
       <div class="pop1-hd__item">
@@ -1331,6 +1370,12 @@
1331 1370
             <strong>报修地址:</strong>
1332 1371
             <span>{{incident.place ? incident.place.area.area + incident.place.place : ''}}{{address}}</span>
1333 1372
           </li>
1373
+          {{if wxIncidentWithCmdb == 1}}
1374
+          <li class="pop1-hd__itemList">
1375
+            <strong>资产:</strong>
1376
+            <span>{{assetId||'无'}}</span>
1377
+          </li>
1378
+          {{/if}}
1334 1379
         </ul>
1335 1380
       </div>
1336 1381
       <div class="pop1-hd__item">
@@ -1523,6 +1568,12 @@
1523 1568
             <strong>报修地址:</strong>
1524 1569
             <span>{{incident.place ? incident.place.area.area + incident.place.place : ''}}{{address}}</span>
1525 1570
           </li>
1571
+          {{if wxIncidentWithCmdb == 1}}
1572
+          <li class="pop1-hd__itemList">
1573
+            <strong>资产:</strong>
1574
+            <span>{{assetId||'无'}}</span>
1575
+          </li>
1576
+          {{/if}}
1526 1577
         </ul>
1527 1578
       </div>
1528 1579
       <div class="pop1-hd__item pop1-evaluate">

+ 3 - 0
js/index.js

@@ -2,6 +2,8 @@ $(function () {
2 2
   var repairMain = JSON.parse(sessionStorage.getItem("repair_main")); //报修主体
3 3
   var reqHasCategory = JSON.parse(sessionStorage.getItem("reqHasCategory")); //自动建单
4 4
   var loginUser = JSON.parse(window.sessionStorage.getItem("loginUser")); //用户信息
5
+  var wxIncidentWithCmdb = JSON.parse(window.sessionStorage.getItem("wxIncidentWithCmdb")); //是否绑定资产
6
+  var incidentWithConsumable = JSON.parse(window.sessionStorage.getItem("incidentWithConsumable")); //是否绑定耗材
5 7
   // demo start
6 8
   $("#demo").html(template("demo_temp", { account: loginUser.account }));
7 9
   // demo end
@@ -1196,6 +1198,7 @@ $(function () {
1196 1198
               res.data[i].time = res.data[i].createTime;
1197 1199
               res.data[i].processInstanceId =
1198 1200
                 res.data[i].incident.processInstanceId;
1201
+                res.data[i].wxIncidentWithCmdb = wxIncidentWithCmdb;//是否展示资产带入模板
1199 1202
             }
1200 1203
             //添加分页数据,汇总
1201 1204
             bx_arr.data = bx_arr.data.concat(res.data);

+ 26 - 23
js/login.js

@@ -47,31 +47,34 @@ $(function () {
47 47
             type: "POST",
48 48
             contentType: "application/json;charset=UTF-8",
49 49
             url: baseUrl + "sysinfo/data/fetchDataList/systemConfiguration",
50
-            data: JSON.stringify({ "idx": 0, "sum": 1000, "systemConfiguration": { "keyconfig": "repairMain" } }),
50
+            data: JSON.stringify({ "idx": 0, "sum": 1000 }),
51 51
             success: function (result) {
52 52
               if (result.status == 200) {
53
-                sessionStorage.setItem("repair_main", JSON.stringify(result.list[0]));
54
-                // --------------
55
-                //判断是否自动建单
56
-                $.ajax({
57
-                  type: "POST",
58
-                  contentType: "application/json;charset=UTF-8",
59
-                  url: baseUrl + "sysinfo/data/fetchDataList/systemConfiguration",
60
-                  data: JSON.stringify({ "idx": 0, "sum": 1000, "systemConfiguration": { "keyconfig": "reqHasCategory" } }),
61
-                  success: function (result) {
62
-                    if (result.status == 200) {
63
-                      sessionStorage.setItem("reqHasCategory", JSON.stringify(result.list[0]));
64
-                      window.location.href = 'index.html';
65
-                    }
66
-                    hasClick = false;
67
-                  },
68
-                  //请求失败,包含具体的错误信息
69
-                  error: function (e) {
70
-                    console.log(e.status);
71
-                    console.log(e.responseText);
72
-                  }
73
-                });
74
-                // --------------
53
+                var list = result.list;
54
+                var repairMain = list.find((v) => v.keyconfig == "repairMain"); //报修主体
55
+                var incidentWithConsumable = list.find(
56
+                  (v) => v.keyconfig == "incidentWithConsumable"
57
+                ); //是否绑定耗材
58
+                var wxIncidentWithCmdb = list.find(
59
+                  (v) => v.keyconfig == "wxIncidentWithCmdb"
60
+                ); //是否绑定资产
61
+                var reqHasCategory = list.find(
62
+                  (v) => v.keyconfig == "reqHasCategory"
63
+                ); //获取是否自动建单
64
+                sessionStorage.setItem(
65
+                  "repair_main",
66
+                  JSON.stringify(repairMain)
67
+                );
68
+                sessionStorage.setItem(
69
+                  "incidentWithConsumable",
70
+                  incidentWithConsumable.valueconfig
71
+                );
72
+                sessionStorage.setItem(
73
+                  "wxIncidentWithCmdb",
74
+                  wxIncidentWithCmdb.valueconfig
75
+                );
76
+                sessionStorage.setItem("reqHasCategory", JSON.stringify(reqHasCategory));
77
+                window.location.href = 'index.html';
75 78
               }
76 79
               hasClick = false;
77 80
             },

BIN
pc-repair.tar