Pārlūkot izejas kodu

新增处理日志

seimin 3 gadi atpakaļ
vecāks
revīzija
c142fbab9a

+ 16 - 2
src/components/showModel/showModel.vue

@@ -25,6 +25,9 @@
25 25
             placeholder="请选择指派对象"
26 26
           ></cube-select>
27 27
         </div>
28
+        <div v-if="textName === 'textarea'">
29
+          <cube-textarea autofocus :maxlength="255" v-model="textareaData" placeholder="请填写处理日志" style="border:1px solid #ececec;height:2rem;resize:none;"></cube-textarea>
30
+        </div>
28 31
       </div>
29 32
       <div class="showModel__footer">
30 33
         <div v-if="operate.ok" class="showModel__ok" @click="ok">
@@ -56,7 +59,8 @@ export default {
56 59
       timer: null, //5秒后自动关闭,定时器
57 60
       timerFlag: true, //是否显示取消自动关闭按钮
58 61
       selectData: [], //select数据
59
-      selectUserId: 0 //select选中的数据
62
+      selectUserId: 0, //select选中的数据
63
+      textareaData: '', //textarea的数据
60 64
     };
61 65
   },
62 66
   watch: {
@@ -64,6 +68,9 @@ export default {
64 68
       if (newValue && this.selectName === "user") {
65 69
         this.selectUserId = 0;
66 70
       }
71
+      if (newValue && this.textName === "textarea") {
72
+        this.textareaData = '';
73
+      }
67 74
       if (newValue && this.operate.know == "知道了") {
68 75
         this.time = 5;
69 76
         this.timer = setInterval(() => {
@@ -107,6 +114,11 @@ export default {
107 114
       type: String,
108 115
       default: ""
109 116
     },
117
+    // 文本块(处理日志)
118
+    textName: {
119
+      type: String,
120
+      default: ""
121
+    },
110 122
     // 操作按钮文字
111 123
     operate: {
112 124
       type: Object,
@@ -146,8 +158,10 @@ export default {
146 158
     },
147 159
     // 确定
148 160
     ok() {
149
-      if (this.selectName) {
161
+      if (this.selectName === 'user') {
150 162
         this.$emit("ok", this.selectUserId);
163
+      }else if (this.textName === 'textarea') {
164
+        this.$emit("ok", this.textareaData);
151 165
       } else {
152 166
         this.$emit("ok");
153 167
       }

+ 103 - 7
src/views/incidentList.vue

@@ -84,7 +84,8 @@
84 84
                   >
85 85
                   <span>{{ item.acceptDate | timeFormat("MM-dd HH:mm") }}</span>
86 86
                 </div>
87
-                <cube-form-group
87
+                <div class="btns">
88
+                  <cube-form-group
88 89
                   class="sub-btn"
89 90
                   v-show="
90 91
                     (item.state.id === 1544 || item.state.id === 1543) &&
@@ -94,6 +95,13 @@
94 95
                 >
95 96
                   <cube-button @click.stop="assign(item)">指派</cube-button>
96 97
                 </cube-form-group>
98
+                <cube-form-group
99
+                  class="sub-btn"
100
+                  v-show="item.state.id === 1544"
101
+                >
102
+                  <cube-button @click.stop="addHandlerLog(item)">新增处理日志</cube-button>
103
+                </cube-form-group>
104
+                </div>
97 105
               </div>
98 106
             </div>
99 107
             <template slot="pulldown" slot-scope="props">
@@ -133,7 +141,7 @@
133 141
       </div>
134 142
     </div>
135 143
     <load-ing v-show="loadShow"></load-ing>
136
-    <!-- 弹窗 -->
144
+    <!-- 指派弹窗 -->
137 145
     <showModel
138 146
       :title="models.title"
139 147
       :icon="models.icon"
@@ -143,6 +151,16 @@
143 151
       :operate="models.operate"
144 152
       selectName="user"
145 153
     ></showModel>
154
+    <!-- 新增处理日志弹窗 -->
155
+    <showModel
156
+      :title="models1.title"
157
+      :icon="models1.icon"
158
+      :disjunctor="models1.disjunctor"
159
+      @ok="ok1"
160
+      @cancel="cancel1"
161
+      :operate="models1.operate"
162
+      textName="textarea"
163
+    ></showModel>
146 164
   </div>
147 165
 </template>
148 166
 <script>
@@ -158,10 +176,14 @@ export default {
158 176
   data() {
159 177
     return {
160 178
       modelsData: null, //点击弹窗的那一项数据
179
+      modelsData1: null, //点击弹窗的那一项数据
161 180
       // 弹窗model
162 181
       models: {
163 182
         disjunctor: false
164 183
       },
184
+      models1: {
185
+        disjunctor: false
186
+      },
165 187
       isAssign: false, //是否是事件经理或事件分类管理员
166 188
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
167 189
       valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
@@ -306,6 +328,74 @@ export default {
306 328
         }
307 329
       };
308 330
     },
331
+    //确定
332
+    ok1(text) {
333
+      console.log(text);
334
+      if (!text.trim()) {
335
+        this.$createDialog({
336
+          type: "alert",
337
+          title: "请填写处理日志",
338
+          icon: "cubeic-warn"
339
+        }).show();
340
+        return;
341
+      }
342
+      const toast = this.$createToast({
343
+        txt: "Loading...",
344
+        mask: true
345
+      });
346
+      toast.show();
347
+      this.$http
348
+        .post(
349
+          "service/bpm/data/addData/operationLog",
350
+          {operationLog:{opType:'handlerLog',opValue:text,extra1:this.modelsData1.id}}
351
+        )
352
+        .then((res) => {
353
+          toast.hide();
354
+          this.models1.disjunctor = false;
355
+          if (res.status == 200) {
356
+            this.$createDialog({
357
+              type: "alert",
358
+              title: "操作成功",
359
+              icon: "cubeic-right",
360
+              onConfirm: (e, promptValue) => {
361
+                this.loadShow = true;
362
+                this.items = [];
363
+                this.idx = 0;
364
+                this.getData();
365
+              }
366
+            }).show();
367
+          } else {
368
+            this.$createDialog({
369
+              type: "alert",
370
+              title: "系统错误,请稍后再试!",
371
+              icon: "cubeic-wrong",
372
+              onConfirm: (e, promptValue) => {
373
+                this.loadShow = true;
374
+                this.items = [];
375
+                this.idx = 0;
376
+                this.getData();
377
+              }
378
+            }).show();
379
+          }
380
+        });
381
+    },
382
+    //取消
383
+    cancel1() {
384
+      this.models1.disjunctor = false;
385
+    },
386
+    // 新增处理日志
387
+    addHandlerLog(item){
388
+      this.modelsData1 = item;
389
+      this.models1 = {
390
+        disjunctor: true,
391
+        title: "新增处理日志",
392
+        icon: "warn",
393
+        operate: {
394
+          ok: "确定",
395
+          cancel: "取消"
396
+        }
397
+      };
398
+    },
309 399
     getParamsState() {
310 400
       if (this.$route.params.type) {
311 401
         this.type = this.$route.params.type;
@@ -466,11 +556,17 @@ export default {
466 556
 };
467 557
 </script>
468 558
 <style lang="stylus" rel="stylesheet/stylus" scoped>
469
-.sub-btn {
470
-  background: #ececec;
471
-  .cube-btn {
472
-    background-color: #005395 !important;
473
-    border-radius: 8px
559
+.btns{
560
+  display: flex;
561
+  justify-content: space-between
562
+  .sub-btn {
563
+    margin:0 2px;
564
+    flex:1;
565
+    background: #ececec;
566
+    .cube-btn {
567
+      background-color: #005395 !important;
568
+      border-radius: 8px
569
+    }
474 570
   }
475 571
 }
476 572
 .scroll-list-wrap {

+ 2 - 2
src/views/processing.vue

@@ -365,7 +365,7 @@
365 365
                     :field="fields[9]"
366 366
                     v-if="order == 3"
367 367
                   ></cube-form-item>
368
-                  <cube-form-item
368
+                  <!-- <cube-form-item
369 369
                     :field="fields[16]"
370 370
                     class="incidentTitle"
371 371
                   >
@@ -377,7 +377,7 @@
377 377
                         v-model="handlerLog"
378 378
                       ></textarea>
379 379
                     </div>
380
-                  </cube-form-item>
380
+                  </cube-form-item> -->
381 381
                 </cube-form-group>
382 382
                 <cube-form-group class="sub">
383 383
                   <cube-button type="submit" @click="subVali()"