Ver código fonte

事件绑定的耗材展示

seimin 3 anos atrás
pai
commit
51de9ec1ca

+ 22 - 1
assets/js/controllers/customform/customformCtrl.js

@@ -13046,7 +13046,28 @@ appFormly.config(function config(formlyConfigProvider) {
13046 13046
       "api_bpm_data",
13047 13047
       "Restangular",
13048 13048
       function ($scope, api_bpm_data, Restangular) {
13049
-        console.log($scope,11111111111111111111111111)
13049
+        console.log($scope,'ui-handlerLog')
13050
+      },
13051
+    ],
13052
+  });
13053
+  //绑定的耗材
13054
+  formlyConfigProvider.setType({
13055
+    name: "ui-hc",
13056
+    templateUrl: "assets/views/customform/tpl/ui-hc.html",
13057
+    controller: [
13058
+      "$scope",
13059
+      "api_cmdb2",
13060
+      "Restangular",
13061
+      function ($scope, api_cmdb2, Restangular) {
13062
+        console.log($scope,'ui-hc')
13063
+        $scope.list = [];
13064
+        var sjId = $scope.model.incident.id;
13065
+        api_cmdb2.getHc(sjId).then(function (response) {
13066
+          console.log(response)
13067
+          if(response.status == 200){
13068
+            $scope.list = response.data;
13069
+          }
13070
+        })
13050 13071
       },
13051 13072
     ],
13052 13073
   });

+ 13 - 1
assets/js/main.js

@@ -15,7 +15,13 @@ var inspectIp = protocolName + "//" + domainName + "/service";
15 15
 var imgBaseUrl = protocolName + "//" + domainName;
16 16
 var callIp = protocolName + "//192.168.3.122:29005";
17 17
 // var seiminCallIp = '192.168.3.233';//本地
18
-var seiminCallIp = '10.175.205.159';//财大
18
+// var seiminCallIp = '10.175.205.159';//财大
19
+var seiminCallIp = '';
20
+if(document.domain === 'itsm.zuel.edu.cn'){
21
+    seiminCallIp = '10.175.205.159';//财大
22
+}else{
23
+    seiminCallIp = '192.168.3.233';//本地
24
+}
19 25
 // 信用社
20 26
 // var serverIp = "http://192.168.2.63:80/service"; //跟其他有关
21 27
 // var reportIp = "http://192.168.2.63:80/service"; //跟报表有关
@@ -1340,6 +1346,12 @@ app.factory('api_cmdb2', ['CMDBRestangular2', function (CMDBRestangular) {
1340 1346
     var ywxtService = CMDBRestangular.all("operationSystem");
1341 1347
     var ywxtService1 = CMDBRestangular.all("");
1342 1348
     return {
1349
+        // 获取绑定到事件上的耗材
1350
+        getHc:function(sourceId){
1351
+            return ywxtService1.customPOST({
1352
+                data: { type: 2, source: "1627", sourceId: sourceId },
1353
+            }, 'storeList');
1354
+        },
1343 1355
         // 导入模板
1344 1356
         importDataTpl: function (type, data) {
1345 1357
             return ywxtService1.one(type, data, {});

+ 1 - 1
assets/views/customform/tpl/ui-handlerLog.html

@@ -6,7 +6,7 @@
6 6
                 <table class="table table-striped table-hover" style="table-layout:fixed">
7 7
                     <thead>
8 8
                         <tr>
9
-                            <th class="center" style="width:50px">序号</th>
9
+                            <th class="center" style="width:10px">#</th>
10 10
                             <th class="center" style="width:100px">处理人</th>
11 11
                             <th class="center" style="width:200px">时间</th>
12 12
                             <th class="center">内容</th>

+ 30 - 0
assets/views/customform/tpl/ui-hc.html

@@ -0,0 +1,30 @@
1
+<div class="row padding-sm no-padding-vr bordered no-border-hr ">
2
+    <div class="col-md-12">
3
+        <div style="color: #333;">耗材:</div>
4
+        <div class="panel panel-white">
5
+            <div class="panel-body">
6
+                <table class="table table-striped table-hover" style="table-layout:fixed">
7
+                    <thead>
8
+                        <tr>
9
+                            <th class="center" style="width:10px">#</th>
10
+                            <th class="center" style="width:100px">耗材名称</th>
11
+                            <th class="center" style="width:100px">价格</th>
12
+                            <th class="center" style="width:100px">数量</th>
13
+                        </tr>
14
+                    </thead>
15
+                    <tbody>
16
+                        <tr ng-repeat="item in list">
17
+                            <td class="center">{{$index + 1}}</td>
18
+                            <td class="center">{{item.consumable.name}}</td>
19
+                            <td class="center">{{item.extra1}}</td>
20
+                            <td class="center">{{item.consumablesSum}}</td>
21
+                        </tr>
22
+                    </tbody>
23
+                </table>
24
+            </div>
25
+        </div>
26
+    </div>
27
+</div>
28
+<style>
29
+    .center{text-align: center!important;}
30
+</style>

+ 3 - 1
index.html

@@ -41,7 +41,9 @@
41 41
     <!-- Clip-Two Theme -->
42 42
     <link rel="stylesheet" data-ng-href="assets/css/themes/{{ app.layout.theme }}.css" />
43 43
     <script>
44
-        window.console.log = function(){};
44
+        if(document.domain === 'itsm.zuel.edu.cn'){
45
+            window.console.log = function(){};//财大
46
+        }
45 47
     </script>
46 48
 </head>
47 49