Sfoglia il codice sorgente

22.快速建单的图片没有了 放在报修图片里面

seimin 11 mesi fa
parent
commit
62ff91e76e

+ 4 - 4
assets/js/controllers/incident/incidentDetailCtrl.js

@@ -21,13 +21,13 @@ app.controller('incidentDetailCtrl', ["$scope", "$http", "i18nService", "$rootSc
21 21
         api_simple.fetchData('incident', incidentId).then(res => {
22 22
             if(res.status == 200){
23 23
                 $scope.model = res.data || {};
24
-                if ($scope.model.wxIncidentId) {
25
-                    api_wechatfile.listAttachment("wechatRequesterIncident", $scope.model.wxIncidentId).then( (res) => {
24
+                if ($scope.model.id) {
25
+                    api_wechatfile.listAttachment("wechatRequesterIncident", $scope.model.id).then( (res) => {
26 26
                         $scope.requestImgs = res.data || [];
27 27
                     });
28 28
                 }
29
-                if ($scope.model.processInstanceId) {
30
-                    api_wechatfile.listAttachment("incident", $scope.model.processInstanceId).then( (res) => {
29
+                if ($scope.model.id) {
30
+                    api_wechatfile.listAttachment("incident", $scope.model.id).then( (res) => {
31 31
                         $scope.userImgs = res.data || [];
32 32
                     });
33 33
                 }

+ 33 - 3
assets/js/controllers/mainCtrl.js

@@ -3752,6 +3752,8 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
3752 3752
         ) {
3753 3753
           // -------------------start----------------------
3754 3754
           $scope.modelData = modelData;
3755
+          // 事件报修图片
3756
+          $scope.requestImgs = [];
3755 3757
           // 当前所属院区处理
3756 3758
           console.log(modelData);
3757 3759
           // if(modelData){
@@ -3795,6 +3797,13 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
3795 3797
             //报修生成事件,数据回显
3796 3798
             //来电生成事件,数据回显
3797 3799
             //暂存生成事件,数据回显
3800
+            // 报修图片
3801
+            if (modelData.incident) {
3802
+              api_wechatfile.listAttachment("wechatRequesterIncident", modelData.incident.id).then( (res) => {
3803
+                  $scope.requestImgs = res.data || [];
3804
+              });
3805
+            }
3806
+
3798 3807
             $scope.categorySelect = modelData.incident.category;
3799 3808
             $scope.jry_modelLeft = modelData.incident.category?modelData.incident.category.mutiCategory:'';
3800 3809
             console.log($scope.jry_deptData)
@@ -3820,6 +3829,27 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
3820 3829
             };
3821 3830
           }
3822 3831
           $scope.minYYtime = new Date();
3832
+          // 预览图片
3833
+          $scope.previewNew = function (type, url, idx) {
3834
+            let title = $scope[type][idx].title;
3835
+            $modal.open({
3836
+              backdrop: false,
3837
+              size: "sm",
3838
+              templateUrl: "assets/views/customform/tpl/ui-showimage.html",
3839
+              controller: function ($scope, $rootScope, scope, $modalInstance) {
3840
+                $scope.title = title;
3841
+                $scope.imageurl = $rootScope.attachmentAddressSplicing(url);
3842
+                $scope.cancel = function () {
3843
+                  $modalInstance.dismiss("cancel");
3844
+                };
3845
+              },
3846
+              resolve: {
3847
+                scope: function () {
3848
+                  return $scope;
3849
+                },
3850
+              },
3851
+            });
3852
+        };
3823 3853
           // 建单并派单
3824 3854
           $scope.buildAndAssign = function(){
3825 3855
             if(!$scope.categorySelectId){
@@ -3974,7 +4004,7 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
3974 4004
                   // 有图片
3975 4005
                     $scope.uploader.onBeforeUploadItem = function(item) {
3976 4006
                         angular.extend(item.headers, $rootScope.getSession());
3977
-                        item.url = api_bpm_domain.uploadAttachment(response.id).getRequestedUrl();
4007
+                        item.url = api_bpm_domain.uploadAttachmentJryModel("wechatRequesterIncident", response.data.id).getRequestedUrl();
3978 4008
                         item.formData.push({ 'fileName': item.file.name });
3979 4009
                     };
3980 4010
                     $scope.uploader.uploadAll();
@@ -4059,7 +4089,7 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4059 4089
                   // 有图片
4060 4090
                     $scope.uploader.onBeforeUploadItem = function(item) {
4061 4091
                         angular.extend(item.headers, $rootScope.getSession());
4062
-                        item.url = api_bpm_domain.uploadAttachment(response.id).getRequestedUrl();
4092
+                        item.url = api_bpm_domain.uploadAttachmentJryModel("wechatRequesterIncident", response.data.id).getRequestedUrl();
4063 4093
                         item.formData.push({ 'fileName': item.file.name });
4064 4094
                     };
4065 4095
                     $scope.uploader.uploadAll();
@@ -4471,7 +4501,7 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4471 4501
                         // 有图片
4472 4502
                           scope.uploader.onBeforeUploadItem = function(item) {
4473 4503
                               angular.extend(item.headers, $rootScope.getSession());
4474
-                              item.url = api_bpm_domain.uploadAttachment(resData.id).getRequestedUrl();
4504
+                              item.url = api_bpm_domain.uploadAttachmentJryModel("wechatRequesterIncident", resData.data.id).getRequestedUrl();
4475 4505
                               item.formData.push({ 'fileName': item.file.name });
4476 4506
                           };
4477 4507
                           scope.uploader.uploadAll();

+ 22 - 1
assets/views/newOrderSeimin.html

@@ -252,7 +252,28 @@
252 252
             placeholder="请填写故障描述"
253 253
           ></textarea>
254 254
         </div>
255
-        <div class="c_item clearfix" style="width: 400px; height: 100px">
255
+        <div class="c_item clearfix" style="width: 400px; height: 100px" ng-if="requestImgs.length">
256
+          <div class="col-xs-12 ui-repair-photos">
257
+            <div class="row  fontcolor-two margin-top-15">
258
+              <label><span class="colorRed">&nbsp;&nbsp;</span>图片上传:</label>
259
+              <div class="imgsBox">
260
+                <div class="fileupload pos-rlt" ng-repeat="(idx,img) in requestImgs" style="position: relative;">
261
+                  <img ng-src="{{attachmentAddressSplicing(img.relativeFilePath)}}"  style="max-height:300px;object-fit: contain;"
262
+                      class="pos-rlt" width=100%; height=100%; ng-click="previewNew('requestImgs', img.relativeFilePath, idx)" />
263
+                </div>
264
+              </div>
265
+              <!-- <div class="col-md-12" style="padding:0;">
266
+                  <div class="imgsBox">
267
+                      <div class="fileupload pos-rlt" ng-repeat="(idx,img) in requestImgs" style="position: relative;">
268
+                          <img ng-src="{{attachmentAddressSplicing(img.relativeFilePath)}}"  style="max-height:300px;object-fit: contain;"
269
+                              class="pos-rlt" width=100%; height=100%; ng-click="preview('requestImgs', img.relativeFilePath, idx)" />
270
+                      </div>
271
+                  </div>
272
+              </div> -->
273
+            </div>
274
+        </div>
275
+        </div>
276
+        <div class="c_item clearfix" style="width: 400px; height: 100px" ng-if="!requestImgs.length">
256 277
           <label><span class="colorRed">&nbsp;&nbsp;</span>图片上传:</label>
257 278
           <div class="imgsBox">
258 279
             <div