seimin před 11 měsíci
rodič
revize
549f3a5043

+ 23 - 12
assets/js/controllers/incident/incidentCtrl.js

@@ -1232,13 +1232,16 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
1232 1232
 
1233 1233
     //修改
1234 1234
     $scope.changeClick = function (data) {
1235
-        $state.go('app.incident.detail', {
1236
-            formKey: 'incident_change',
1237
-            pdKey: 'incident',
1238
-            dataId: data.id,
1239
-            taskId: data.taskId,
1240
-            processInstanceId: data.processInstanceId
1241
-        });
1235
+        // $state.go('app.incident.detail', {
1236
+        //     formKey: 'incident_change',
1237
+        //     pdKey: 'incident',
1238
+        //     dataId: data.id,
1239
+        //     taskId: data.taskId,
1240
+        //     processInstanceId: data.processInstanceId
1241
+        // });
1242
+        $rootScope.newOrder({
1243
+            incident: data,
1244
+        },'edit')
1242 1245
     };
1243 1246
     //回访
1244 1247
     $scope.visit = function (model) {
@@ -2322,6 +2325,7 @@ app.controller('IncidentOperCtrl', ['$rootScope', '$scope', '$state', function (
2322 2325
     var loginUser = $rootScope.user;
2323 2326
     $scope.user = $rootScope.user;
2324 2327
     $scope.chuli = false;
2328
+    $scope.allFlag = false;
2325 2329
     $scope.qiangdan = false;
2326 2330
     $scope.huifang = false;
2327 2331
     $scope.delFlag = false;
@@ -2332,6 +2336,9 @@ app.controller('IncidentOperCtrl', ['$rootScope', '$scope', '$state', function (
2332 2336
     $scope.shijianliebiao_duty = false;//设置责任科室
2333 2337
 
2334 2338
     for (var i = 0; i < loginUser.menu.length; i++) {
2339
+        if (loginUser.menu[i].link == "shijianliebiao_all") {
2340
+            $scope.allFlag = true
2341
+        }
2335 2342
         if (loginUser.menu[i].link == "shijianliebiao_chuli") {
2336 2343
             $scope.chuli = true
2337 2344
         }
@@ -2386,10 +2393,14 @@ app.controller('IncidentOperCtrl', ['$rootScope', '$scope', '$state', function (
2386 2393
     })
2387 2394
 
2388 2395
     //修改页面显示判断
2389
-    $scope.jry_modify = function (item) {
2390
-        var arrFlag = ['pending','handler'];
2391
-        var stateFlag = arrFlag.includes(item.state.value)
2392
-        return stateFlag && $scope.editFlag;
2396
+    $scope.jry_modify = function (item, user) {
2397
+        // 待接单的时候,处理人或处理组
2398
+        let flag1 = item.state && item.state.value == 'pending' && ((item.currentLog && item.currentLog.workerId == user.id) || item.tiquPower);
2399
+        // 处理中的时候,处理人或处理组
2400
+        let flag2 = item.state && item.state.value == 'handler' && item.handlingPersonnelUser && item.handlingPersonnelUser.id == user.id;
2401
+        // 已关闭,且不是已删除
2402
+        let flag3 = item.deleteFlag !== 1 && item.state.value !== 'close';
2403
+        return flag3 && (($scope.editFlag && $scope.allFlag) || flag1 || flag2 || (item.acceptUser ? item.acceptUser.id == user.id : false));
2393 2404
     }
2394 2405
     // 回访操作权限
2395 2406
     for (var obj in $rootScope.user.role) {
@@ -2466,7 +2477,7 @@ app.directive('incidentoperator', function () {
2466 2477
         controller: 'IncidentOperCtrl',
2467 2478
         template: '<div><div class="cl-effect-1 ui-grid-cell-contents pull-left" style="text-align:left;">' +
2468 2479
             '<a ng-click="toDetail(item)" class="bianjifont" >查看</a>' +
2469
-            // '<a ng-click="changeCenter()"  ng-show="jry_modify(item)"  class="luyinfont">编辑</a>' +
2480
+            '<a ng-click="changeCenter()" ng-show="jry_modify(item, user)" class="luyinfont">编辑</a>' +
2470 2481
             '<a ng-click="delSj()" ng-show="{{delFlag && item.deleteFlag !== 1}}" class="assign" >删除</a>' +
2471 2482
             '<a ng-click="storageSj()" ng-show="{{storageFlag && item.state.value === \'storage\' && item.deleteFlag !== 1}}" class="assign" >继续创建</a><br>' +
2472 2483
             '<a ng-click="edit()"  ng-show="{{item.state.value == \'handler\' && item.handlingPersonnelUser && item.handlingPersonnelUser.id == user.id && chuli && item.deleteFlag !== 1}}"  class="bianjifont">处理</a>' +

+ 120 - 1
assets/js/controllers/mainCtrl.js

@@ -3763,6 +3763,7 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
3763 3763
     // 快速建单
3764 3764
     $rootScope.newOrder = function (model1, type = '') {
3765 3765
       $rootScope.newOrderShowOpen = true;
3766
+      $rootScope.newOrderType = type;
3766 3767
       //进入弹窗,强制示忙
3767 3768
       if (localStorage.getItem('fenjiNumber')) {
3768 3769
         setTimeout(()=>{
@@ -3887,7 +3888,125 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
3887 3888
                 },
3888 3889
               },
3889 3890
             });
3890
-        };
3891
+          };
3892
+          // 编辑后保存
3893
+          $scope.editSave = function(){
3894
+            if(!$scope.categorySelectId){
3895
+              SweetAlert.swal({
3896
+                  title: "提示",
3897
+                  text: "请选择故障现象!",
3898
+                  type: "error",
3899
+                  confirmButtonColor: "#DD6B55"
3900
+              });
3901
+              return;
3902
+            }
3903
+            if(!$scope.selectedDuty){
3904
+              SweetAlert.swal({
3905
+                  title: "提示",
3906
+                  text: "故障现象【"+ $scope.categorySelect.category +"】没有设置责任科室!",
3907
+                  type: "error",
3908
+                  confirmButtonColor: "#DD6B55"
3909
+              });
3910
+              return;
3911
+            }
3912
+            if(!$scope.incidentModel.department){
3913
+              SweetAlert.swal({
3914
+                  title: "提示",
3915
+                  text: "请选择报修科室!",
3916
+                  type: "error",
3917
+                  confirmButtonColor: "#DD6B55"
3918
+              });
3919
+              return;
3920
+            }
3921
+            if(!$scope.incidentModel.contactsInformation){
3922
+              SweetAlert.swal({
3923
+                  title: "提示",
3924
+                  text: "请填写联系电话!",
3925
+                  type: "error",
3926
+                  confirmButtonColor: "#DD6B55"
3927
+              });
3928
+              return;
3929
+            }
3930
+            if(!$scope.incidentModel.priority){
3931
+              SweetAlert.swal({
3932
+                  title: "提示",
3933
+                  text: "请选择优先级!",
3934
+                  type: "error",
3935
+                  confirmButtonColor: "#DD6B55"
3936
+              });
3937
+              return;
3938
+            }
3939
+            if(!$scope.incidentModel.description){
3940
+              SweetAlert.swal({
3941
+                  title: "提示",
3942
+                  text: "请选择故障描述!",
3943
+                  type: "error",
3944
+                  confirmButtonColor: "#DD6B55"
3945
+              });
3946
+              return;
3947
+            }
3948
+            $rootScope.isMask = true;
3949
+            var repair_main = JSON.parse(sessionStorage.getItem('repair_main'));
3950
+            var postData = {
3951
+              "incident": {
3952
+                "id": $scope.incidentModel.id || undefined,
3953
+                "deleteFlag": 0,
3954
+                "duty":$scope.selectedDuty?$scope.selectedDuty:undefined,
3955
+                "department": $scope.incidentModel.department||undefined,
3956
+                "contactsInformation": $scope.incidentModel.contactsInformation,
3957
+                "contacts": $scope.incidentModel.contacts,
3958
+                "branch": $scope.incidentModel.branch?$scope.incidentModel.branch.id:undefined,
3959
+                "area": $scope.incidentModel.area||undefined,
3960
+                "place": $scope.incidentModel.place||undefined,
3961
+                "houseNumber": $scope.incidentModel.address,
3962
+                "category": $scope.categorySelect||undefined,
3963
+                "priority": $scope.incidentModel.priority||undefined,
3964
+                "source": $scope.incidentModel.source||undefined,
3965
+                "title": $scope.categorySelect.category,
3966
+                "description": $scope.incidentModel.description,
3967
+                "yyTime": $scope.incidentModel.yyTime ? moment($scope.incidentModel.yyTime).format('YYYY-MM-DD HH:mm:ss') : undefined,
3968
+                "repairType": repair_main?repair_main.valueconfig:undefined,
3969
+                "requester":$scope.incidentModel.requester||undefined,
3970
+                "acceptUser": $rootScope.user||undefined,
3971
+                "callID": $scope.incidentModel.callID||undefined,
3972
+                "incomingPhone": $scope.incidentModel.incomingPhone||undefined,
3973
+              }
3974
+            };
3975
+            $scope.modelData && (postData.incident = Object.assign({}, $scope.modelData.incident, postData.incident));
3976
+            api_flow.accept("edit", postData).then(function (response) {
3977
+              // if ($scope.uploader != null) {
3978
+              //   // 有图片
3979
+              //     $scope.uploader.onBeforeUploadItem = function(item) {
3980
+              //         angular.extend(item.headers, $rootScope.getSession());
3981
+              //         item.url = api_bpm_domain.uploadAttachmentJryModel("wechatRequesterIncident", response.data.id).getRequestedUrl();
3982
+              //         item.formData.push({ 'fileName': item.file.name });
3983
+              //     };
3984
+              //     $scope.uploader.uploadAll();
3985
+              // }
3986
+              $rootScope.isMask = false;
3987
+              SweetAlert.swal(
3988
+                {
3989
+                  title: "保存成功!",
3990
+                  type: "success",
3991
+                  confirmButtonColor: "#007AFF",
3992
+                },
3993
+                function (isConfirm) {
3994
+                  if(isConfirm){
3995
+                    if (localStorage.getItem('fenjiNumber')) {
3996
+                      $rootScope.jry_shixian();
3997
+                    }
3998
+                    $modalInstance.dismiss("cancel");
3999
+                    $rootScope.newOrderShowOpen = false;
4000
+                    if($state.current.name === 'app.incident.list'){
4001
+                      $state.reload();
4002
+                    }else{
4003
+                      $state.go("app.incident.list");
4004
+                    }
4005
+                  }
4006
+                }
4007
+              );
4008
+            });
4009
+          }
3891 4010
           // 建单并派单
3892 4011
           $scope.buildAndAssign = function(){
3893 4012
             if(!$scope.categorySelectId){

+ 144 - 137
assets/views/newOrderSeimin.html

@@ -252,153 +252,155 @@
252 252
             placeholder="请填写故障描述"
253 253
           ></textarea>
254 254
         </div>
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)" />
255
+        <ng-container ng-if="newOrderType !== 'edit'">
256
+          <div class="c_item clearfix" style="width: 400px; height: 100px" ng-if="requestImgs.length">
257
+            <div class="col-xs-12 ui-repair-photos">
258
+              <div class="row  fontcolor-two margin-top-15">
259
+                <label><span class="colorRed">&nbsp;&nbsp;</span>图片上传:</label>
260
+                <div class="imgsBox">
261
+                  <div class="fileupload pos-rlt" ng-repeat="(idx,img) in requestImgs" style="position: relative;">
262
+                    <img ng-src="{{attachmentAddressSplicing(img.relativeFilePath)}}"  style="max-height:300px;object-fit: contain;"
263
+                        class="pos-rlt" width=100%; height=100%; ng-click="previewNew('requestImgs', img.relativeFilePath, idx)" />
264
+                  </div>
263 265
                 </div>
266
+                <!-- <div class="col-md-12" style="padding:0;">
267
+                    <div class="imgsBox">
268
+                        <div class="fileupload pos-rlt" ng-repeat="(idx,img) in requestImgs" style="position: relative;">
269
+                            <img ng-src="{{attachmentAddressSplicing(img.relativeFilePath)}}"  style="max-height:300px;object-fit: contain;"
270
+                                class="pos-rlt" width=100%; height=100%; ng-click="preview('requestImgs', img.relativeFilePath, idx)" />
271
+                        </div>
272
+                    </div>
273
+                </div> -->
264 274
               </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">
277
-          <label><span class="colorRed">&nbsp;&nbsp;</span>图片上传:</label>
278
-          <div class="imgsBox">
279
-            <div
280
-              class="fileupload pos-rlt"
281
-              ng-repeat="(idx,imageSrc) in imgshows"
282
-              style="position: relative"
283
-            >
275
+          </div>
276
+          </div>
277
+          <div class="c_item clearfix" style="width: 400px; height: 100px" ng-if="!requestImgs.length">
278
+            <label><span class="colorRed">&nbsp;&nbsp;</span>图片上传:</label>
279
+            <div class="imgsBox">
284 280
               <div
285
-                style="
286
-                  border-radius: 5px;
287
-                  overflow: hidden;
288
-                  width: 100%;
289
-                  height: 100%;
290
-                "
281
+                class="fileupload pos-rlt"
282
+                ng-repeat="(idx,imageSrc) in imgshows"
283
+                style="position: relative"
291 284
               >
292
-                <img
293
-                  ng-src="{{imageSrc}}"
285
+                <div
294 286
                   style="
295
-                    max-width: 200px;
296
-                    max-height: 300px;
297
-                    margin: 0 auto;
298
-                    display: block;
287
+                    border-radius: 5px;
288
+                    overflow: hidden;
289
+                    width: 100%;
290
+                    height: 100%;
299 291
                   "
300
-                  class="pos-rlt"
301
-                  width="100%;"
302
-                  height="100%;"
303
-                  ng-click="preview(imageSrc,idx)"
304
-                />
292
+                >
293
+                  <img
294
+                    ng-src="{{imageSrc}}"
295
+                    style="
296
+                      max-width: 200px;
297
+                      max-height: 300px;
298
+                      margin: 0 auto;
299
+                      display: block;
300
+                    "
301
+                    class="pos-rlt"
302
+                    width="100%;"
303
+                    height="100%;"
304
+                    ng-click="preview(imageSrc,idx)"
305
+                  />
306
+                </div>
307
+                <i class="icon close" ng-click="uploadimg_del($index, imgshows)"
308
+                  >×</i
309
+                >
305 310
               </div>
306
-              <i class="icon close" ng-click="uploadimg_del($index, imgshows)"
307
-                >×</i
311
+              <div
312
+                id="upupgogo"
313
+                class="fileupload pos-rlt clear"
314
+                style="position: relative"
308 315
               >
316
+                <span class="icon ion-plus-round fileupload-icon">+</span>
317
+                <input
318
+                  type="file"
319
+                  onchange="angular.element(this).scope().change(this)"
320
+                  style="
321
+                    display: inline-block;
322
+                    width: 100%;
323
+                    height: 100%;
324
+                    opacity: 0;
325
+                  "
326
+                  class="upinp"
327
+                  uploader="uploader"
328
+                  accept="image/png,image/gif,image/jpeg,image/jpg"
329
+                  name="uploadedFile"
330
+                  nv-file-select=""
331
+                />
332
+              </div>
309 333
             </div>
310
-            <div
311
-              id="upupgogo"
312
-              class="fileupload pos-rlt clear"
313
-              style="position: relative"
314
-            >
315
-              <span class="icon ion-plus-round fileupload-icon">+</span>
334
+          </div>
335
+          <div class="c_item" style="width: 100%">
336
+            <label style="margin-right: 8px; cursor: pointer">
316 337
               <input
317
-                type="file"
318
-                onchange="angular.element(this).scope().change(this)"
319
-                style="
320
-                  display: inline-block;
321
-                  width: 100%;
322
-                  height: 100%;
323
-                  opacity: 0;
324
-                "
325
-                class="upinp"
326
-                uploader="uploader"
327
-                accept="image/png,image/gif,image/jpeg,image/jpg"
328
-                name="uploadedFile"
329
-                nv-file-select=""
338
+                type="radio"
339
+                name="assign"
340
+                ng-value="1"
341
+                ng-model="incidentModel.assign"
342
+                ng-change="assginChange()"
330 343
               />
331
-            </div>
344
+              派单给人
345
+            </label>
346
+            <label>
347
+              <input
348
+                type="radio"
349
+                name="assign"
350
+                ng-value="2"
351
+                ng-model="incidentModel.assign"
352
+                ng-change="assginChange()"
353
+              />
354
+              派单给组
355
+            </label>
332 356
           </div>
333
-        </div>
334
-        <div class="c_item" style="width: 100%">
335
-          <label style="margin-right: 8px; cursor: pointer">
336
-            <input
337
-              type="radio"
338
-              name="assign"
339
-              ng-value="1"
340
-              ng-model="incidentModel.assign"
341
-              ng-change="assginChange()"
342
-            />
343
-            派单给人
344
-          </label>
345
-          <label>
346
-            <input
347
-              type="radio"
348
-              name="assign"
349
-              ng-value="2"
350
-              ng-model="incidentModel.assign"
351
-              ng-change="assginChange()"
352
-            />
353
-            派单给组
354
-          </label>
355
-        </div>
356
-        <div class="c_item clearfix" ng-show="incidentModel.assign==1">
357
-          <label><span class="colorRed">*</span>处理人:</label>
358
-          <ui-select
359
-            class="c_item_value"
360
-            style="min-width: 300px"
361
-            ng-model="incidentModel.user"
362
-            theme="bootstrap"
363
-            ng-required="true"
364
-            reset-search-input="false"
365
-          >
366
-            <ui-select-match placeholder="请选择处理人">
367
-              <span ng-bind="$select.selected.name"></span>
368
-            </ui-select-match>
369
-            <ui-select-choices
370
-              repeat="item in jry_userData| filter:{$:$select.search}"
371
-              refresh="jry_userSearch($select.search)"
357
+          <div class="c_item clearfix" ng-show="incidentModel.assign==1">
358
+            <label><span class="colorRed">*</span>处理人:</label>
359
+            <ui-select
360
+              class="c_item_value"
361
+              style="min-width: 300px"
362
+              ng-model="incidentModel.user"
363
+              theme="bootstrap"
364
+              ng-required="true"
365
+              reset-search-input="false"
372 366
             >
373
-              <div
374
-                ng-bind-html="item.name | highlight: $select.search"
375
-              ></div>
376
-            </ui-select-choices>
377
-          </ui-select>
378
-        </div>
379
-        <div class="c_item clearfix" ng-show="incidentModel.assign==2">
380
-          <label><span class="colorRed">*</span>处理组:</label>
381
-          <ui-select
382
-            class="c_item_value"
383
-            style="min-width: 300px"
384
-            ng-model="incidentModel.group"
385
-            theme="bootstrap"
386
-            ng-required="true"
387
-            reset-search-input="false"
388
-          >
389
-            <ui-select-match placeholder="处理组">
390
-              <span ng-bind="$select.selected.groupName"></span>
391
-            </ui-select-match>
392
-            <ui-select-choices
393
-              repeat="item in jry_groupData| filter:{$:$select.search}"
394
-              refresh="jry_groupSearch($select.search)"
367
+              <ui-select-match placeholder="请选择处理人">
368
+                <span ng-bind="$select.selected.name"></span>
369
+              </ui-select-match>
370
+              <ui-select-choices
371
+                repeat="item in jry_userData| filter:{$:$select.search}"
372
+                refresh="jry_userSearch($select.search)"
373
+              >
374
+                <div
375
+                  ng-bind-html="item.name | highlight: $select.search"
376
+                ></div>
377
+              </ui-select-choices>
378
+            </ui-select>
379
+          </div>
380
+          <div class="c_item clearfix" ng-show="incidentModel.assign==2">
381
+            <label><span class="colorRed">*</span>处理组:</label>
382
+            <ui-select
383
+              class="c_item_value"
384
+              style="min-width: 300px"
385
+              ng-model="incidentModel.group"
386
+              theme="bootstrap"
387
+              ng-required="true"
388
+              reset-search-input="false"
395 389
             >
396
-              <div
397
-                ng-bind-html="item.groupName | highlight: $select.search"
398
-              ></div>
399
-            </ui-select-choices>
400
-          </ui-select>
401
-        </div>
390
+              <ui-select-match placeholder="处理组">
391
+                <span ng-bind="$select.selected.groupName"></span>
392
+              </ui-select-match>
393
+              <ui-select-choices
394
+                repeat="item in jry_groupData| filter:{$:$select.search}"
395
+                refresh="jry_groupSearch($select.search)"
396
+              >
397
+                <div
398
+                  ng-bind-html="item.groupName | highlight: $select.search"
399
+                ></div>
400
+              </ui-select-choices>
401
+            </ui-select>
402
+          </div>
403
+        </ng-container>
402 404
       </div>
403 405
     </div>
404 406
     <div class="rightList">
@@ -508,10 +510,15 @@
508 510
     </div>
509 511
   </div>
510 512
   <div class="modal-footer">
511
-    <label style="display: inline-flex;align-items:center;cursor: pointer;position: relative;top: 3px;right: 16px;"><input style="margin:0;" type="checkbox" ng-model="isBuildOrderAgagin">是否连续建单</label>
512
-    <button class="btn btn-primary" ng-click="build()">直接解决</button>
513
-    <button class="btn btn-primary" ng-click="buildAndAssign()">建单并派单</button>
514
-    <button class="btn btn-primary" ng-click="temporaryStorage()">暂存</button>
513
+    <ng-container ng-if="newOrderType !== 'edit'">
514
+      <label style="display: inline-flex;align-items:center;cursor: pointer;position: relative;top: 3px;right: 16px;"><input style="margin:0;" type="checkbox" ng-model="isBuildOrderAgagin">是否连续建单</label>
515
+      <button class="btn btn-primary" ng-click="build()">直接解决</button>
516
+      <button class="btn btn-primary" ng-click="buildAndAssign()">建单并派单</button>
517
+      <button class="btn btn-primary" ng-click="temporaryStorage()">暂存</button>
518
+    </ng-container>
519
+    <ng-container ng-if="newOrderType === 'edit'">
520
+      <button class="btn btn-primary" ng-click="editSave()">保存</button>
521
+    </ng-container>
515 522
     <button class="btn btn-primary btn-o" ng-click="cancel()">取消</button>
516 523
   </div>
517 524
 </div>