Quellcode durchsuchen

巡检增加图片

seimin vor 3 Jahren
Ursprung
Commit
e8381a1555
2 geänderte Dateien mit 111 neuen und 0 gelöschten Zeilen
  1. 19 0
      assets/js/controllers/customform/customformCtrl.js
  2. 92 0
      assets/js/main.js

+ 19 - 0
assets/js/controllers/customform/customformCtrl.js

@@ -20296,6 +20296,7 @@ appFormly.controller("CustomformCtrl", [
20296 20296
   "WechatRestangular",
20297 20297
   "api_configure_form",
20298 20298
   "api_bpm_domain",
20299
+  "api_bpm_domain1",
20299 20300
   "api_bpm_data",
20300 20301
   "api_user_data",
20301 20302
   "api_statistic",
@@ -20322,6 +20323,7 @@ appFormly.controller("CustomformCtrl", [
20322 20323
     WechatRestangular,
20323 20324
     api_configure_form,
20324 20325
     api_bpm_domain,
20326
+    api_bpm_domain1,
20325 20327
     api_bpm_data,
20326 20328
     api_user_data,
20327 20329
     api_statistic,
@@ -21437,6 +21439,23 @@ appFormly.controller("CustomformCtrl", [
21437 21439
                                     };
21438 21440
                                   $scope.fileUploader.uploadAll();
21439 21441
                                 } else if (vm.model.change) {
21442
+                                }else if(vm.model.inspectionProcessActual){
21443
+                                  //巡检图片上传yeye
21444
+                                  $scope.fileUploader.onBeforeUploadItem =
21445
+                                    function (item) {
21446
+                                      angular.extend(
21447
+                                        item.headers,
21448
+                                        $rootScope.getSession()
21449
+                                      );
21450
+                                      item.url = api_bpm_domain1
21451
+                                        .uploadAttachment(vm.model.inspectionProcessActual.processInstanceId)
21452
+                                        .getRequestedUrl();
21453
+                                      item.formData.push({
21454
+                                        fileName: item.file.name,
21455
+                                      });
21456
+                                      //console.log();
21457
+                                    };
21458
+                                  $scope.fileUploader.uploadAll();
21440 21459
                                 }
21441 21460
                               }
21442 21461
                               $state.go($scope.formData.cancelUrl);

+ 92 - 0
assets/js/main.js

@@ -797,6 +797,98 @@ app.factory('api_bpm_domain', ['BpmRestangular', 'CommonRestangular', function (
797 797
         },
798 798
     };
799 799
 }]);
800
+app.factory('api_bpm_domain1', ['BpmRestangular', 'CommonRestangular', function (BpmRestangular, CommonRestangular) {
801
+    var bpmService = BpmRestangular.all("bpm");
802
+    var commonService = CommonRestangular.all("common");
803
+    return {
804
+        //指派
805
+        delegateTask: function (pdKey, data) {
806
+            return bpmService.customPOST(data, 'delegateTask/' + pdKey, {});
807
+        },
808
+        fetchtask: function (pdKey, data) {
809
+            return bpmService.customPOST(data, 'fetchTask/' + pdKey, {});
810
+        },
811
+        start: function (pdKey, data) {
812
+            return bpmService.customPOST(data, 'start/' + pdKey, {});
813
+        },
814
+        flowTracing: function (processInstanceId, data) {
815
+            return bpmService.customPOST(data, 'flowTracing/' + processInstanceId, {});
816
+        },
817
+        flowTracingCustom: function (processInstanceId, data) {
818
+            return bpmService.customPOST(data, 'flowTracingCustom/' + processInstanceId, {});
819
+        },
820
+        complete: function (taskId, userId, data) {
821
+            return bpmService.customPOST(data, 'completeTask/' + taskId + '/' + userId, {});
822
+        },
823
+        completeUpgrade: function (data) {
824
+            return bpmService.customPOST(data, 'upgradeIncident', {});
825
+        },
826
+        save: function (taskId, data) {
827
+            return bpmService.customPOST(data, 'saveTaskVar/' + taskId, {});
828
+        },
829
+        claimtask: function (taskId, data) {
830
+            return bpmService.customPOST(data, 'claimTask/' + taskId, {});
831
+        },
832
+        claimAndCompletedTask: function (taskId, data) {
833
+            return bpmService.customPOST(data, 'claimAndCompletedTask/' + taskId, {});
834
+        },
835
+        delegateTask: function (taskId, data) {
836
+            return bpmService.customPOST(data, 'delegateTask/' + taskId, {});
837
+        },
838
+        expectedTime: function (taskId) {
839
+            return bpmService.customGET('expectedTime/' + taskId);
840
+        },
841
+        history: function (processId) {
842
+            return bpmService.customGET('history/' + processId);
843
+        },
844
+        // upgrade: function(processInstanceId, taskId, data) {
845
+        //     return bpmService.customPOST(data, 'upgradeIncident/' + processInstanceId + '/' + taskId, {});
846
+        // },
847
+        listAttachments: function (processId, data) {
848
+            return commonService.customGET('listAttachment/inspection/' + processId, {});
849
+        },
850
+        listAttachment: function (modal, processId) {
851
+            return commonService.customGET('listAttachment/' + modal + '/' + processId);
852
+        },
853
+        saveAttachments: function (processId, taskId, userId, data) {
854
+            return bpmService.one('saveAttachments/' + processId + '/' + taskId + '/' + userId);
855
+        },
856
+        uploadAttachment: function (processId, taskId, userId, data) {
857
+            return commonService.one('uploadAttachment/' + 'inspection/' + processId);
858
+        },
859
+        uploadAttachmentJryModel: function (model, processId, taskId, userId, data) {
860
+            return commonService.one('uploadAttachment/' + model + '/' + processId);
861
+        },
862
+        download: function (attachmentId) {
863
+            return bpmService.one('getAttachmentContent/' + attachmentId);
864
+        },
865
+        // download: function(attachmentId){
866
+        //   return bpmService.customGET('getAttachmentContent/' + attachmentId,{},{'responseType':'arraybuffer'});
867
+        // },
868
+        attachmentsPreviewUrl: function (attachmentId) {
869
+            return bpmService.customGET('attachmentsPreviewUrl/' + attachmentId);
870
+        },
871
+        startformkey: function (pdKey) {
872
+            return bpmService.customGET('startformkey/' + pdKey);
873
+        },
874
+        taskformkey: function (taskId) {
875
+            return bpmService.customGET('taskformkey/' + taskId);
876
+        },
877
+        workernumber: function (type) {
878
+            return bpmService.customGET('restful/' + type);
879
+        },
880
+        getWatchAreaPosition: function (data) {
881
+            return bpmService.customGET('getWatchAreaPosition');
882
+        },
883
+        getWatchAreaData: function (id) {
884
+            return bpmService.customGET('getWatchAreaData/' + id);
885
+        },
886
+        // 业务系统附件上传
887
+        upload: function (type, processId) {
888
+            return commonService.one(type + processId);
889
+        },
890
+    };
891
+}]);
800 892
 // 事件富文本框上传
801 893
 app.factory('api_common_incident', ['BpmRestangular', 'CommonRestangular', function (BpmRestangular, CommonRestangular) {
802 894
     var commonService = CommonRestangular.all("common");