|
@@ -17,7 +17,7 @@
|
17
|
17
|
@pulling-down="onPullingDown"
|
18
|
18
|
@pulling-up="onPullingUp"
|
19
|
19
|
>
|
20
|
|
- <div class="conentBox">
|
|
20
|
+ <div class="conentBox" v-if="!loadShow && items.length">
|
21
|
21
|
<div
|
22
|
22
|
class="conent"
|
23
|
23
|
v-for="item in items"
|
|
@@ -84,18 +84,21 @@
|
84
|
84
|
>
|
85
|
85
|
<span>{{ item.acceptDate | timeFormat("MM-dd HH:mm") }}</span>
|
86
|
86
|
</div>
|
87
|
|
- <cube-form-group class="sub">
|
88
|
|
- <cube-button @click="assign(item)">指派</cube-button>
|
|
87
|
+ <cube-form-group
|
|
88
|
+ class="sub-btn"
|
|
89
|
+ v-show="
|
|
90
|
+ (item.state.id === 1544 || item.state.id === 1543) &&
|
|
91
|
+ isAssign &&
|
|
92
|
+ item.assignee
|
|
93
|
+ "
|
|
94
|
+ >
|
|
95
|
+ <cube-button @click.stop="assign(item)">指派</cube-button>
|
89
|
96
|
</cube-form-group>
|
90
|
97
|
</div>
|
91
|
|
- <div class="wushuju" v-show="wushuju">
|
92
|
|
- <img src="./../../static/images/wushuju.svg" alt />
|
93
|
|
- <p>暂无事件</p>
|
94
|
|
- </div>
|
95
|
98
|
</div>
|
96
|
|
- <template v-if="customPullDown" slot="pulldown" slot-scope="props">
|
|
99
|
+ <template slot="pulldown" slot-scope="props">
|
97
|
100
|
<div
|
98
|
|
- v-if="props.pullDownRefresh"
|
|
101
|
+ v-if="props.pullDownRefreshObj"
|
99
|
102
|
class="cube-pulldown-wrapper"
|
100
|
103
|
:style="props.pullDownStyle"
|
101
|
104
|
>
|
|
@@ -121,15 +124,30 @@
|
121
|
124
|
</div>
|
122
|
125
|
</div>
|
123
|
126
|
</template>
|
|
127
|
+ <div class="wushuju" v-if="!loadShow && items.length === 0">
|
|
128
|
+ <img src="./../../static/images/wushuju.svg" alt />
|
|
129
|
+ <p>暂无事件</p>
|
|
130
|
+ </div>
|
124
|
131
|
</cube-scroll>
|
125
|
132
|
</div>
|
126
|
133
|
</div>
|
127
|
134
|
</div>
|
128
|
|
- <load-ing v-show="!items.length && !wushuju"></load-ing>
|
|
135
|
+ <load-ing v-show="loadShow"></load-ing>
|
|
136
|
+ <!-- 弹窗 -->
|
|
137
|
+ <showModel
|
|
138
|
+ :title="models.title"
|
|
139
|
+ :icon="models.icon"
|
|
140
|
+ :disjunctor="models.disjunctor"
|
|
141
|
+ @ok="ok"
|
|
142
|
+ @cancel="cancel"
|
|
143
|
+ :operate="models.operate"
|
|
144
|
+ selectName="user"
|
|
145
|
+ ></showModel>
|
129
|
146
|
</div>
|
130
|
147
|
</template>
|
131
|
148
|
<script>
|
132
|
149
|
import Vue from "vue";
|
|
150
|
+import showModel from "../components/showModel/showModel.vue";
|
133
|
151
|
import CubePage from "../components/cube-page.vue";
|
134
|
152
|
import SwitchOption from "../components/switch-option";
|
135
|
153
|
import InputOption from "../components/input-option";
|
|
@@ -139,20 +157,24 @@ import LoadIng from "./../views/loading.vue";
|
139
|
157
|
export default {
|
140
|
158
|
data() {
|
141
|
159
|
return {
|
142
|
|
- // items: _foods,
|
|
160
|
+ modelsData: null, //点击弹窗的那一项数据
|
|
161
|
+ // 弹窗model
|
|
162
|
+ models: {
|
|
163
|
+ disjunctor: false
|
|
164
|
+ },
|
|
165
|
+ isAssign: false, //是否是事件经理或事件分类管理员
|
143
|
166
|
loginUser: JSON.parse(localStorage.getItem("loginUser")),
|
144
|
167
|
valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
|
145
|
168
|
items: [],
|
146
|
169
|
pullDownRefresh: true,
|
147
|
170
|
pullDownRefreshThreshold: 60,
|
148
|
171
|
pullDownRefreshStop: 40,
|
149
|
|
- pullDownRefreshTxt: "Refresh success",
|
|
172
|
+ pullDownRefreshTxt: "更新成功",
|
150
|
173
|
pullUpLoad: true,
|
151
|
174
|
pullUpLoadThreshold: 0,
|
152
|
175
|
pullUpLoadMoreTxt: "加载更多",
|
153
|
176
|
pullUpLoadNoMoreTxt: "没有更多数据",
|
154
|
177
|
customPullDown: true,
|
155
|
|
- wushuju: false,
|
156
|
178
|
candidateGroups: "",
|
157
|
179
|
searchsType: [
|
158
|
180
|
{
|
|
@@ -185,7 +207,8 @@ export default {
|
185
|
207
|
SwitchOption,
|
186
|
208
|
InputOption,
|
187
|
209
|
SelectOption,
|
188
|
|
- LoadIng
|
|
210
|
+ LoadIng,
|
|
211
|
+ showModel
|
189
|
212
|
},
|
190
|
213
|
computed: {
|
191
|
214
|
options() {
|
|
@@ -216,6 +239,73 @@ export default {
|
216
|
239
|
}
|
217
|
240
|
},
|
218
|
241
|
methods: {
|
|
242
|
+ //确定
|
|
243
|
+ ok(selectUserId) {
|
|
244
|
+ console.log(selectUserId);
|
|
245
|
+ if (!selectUserId) {
|
|
246
|
+ this.$createDialog({
|
|
247
|
+ type: "alert",
|
|
248
|
+ title: "请选择指派对象",
|
|
249
|
+ icon: "cubeic-warn"
|
|
250
|
+ }).show();
|
|
251
|
+ return;
|
|
252
|
+ }
|
|
253
|
+ const toast = this.$createToast({
|
|
254
|
+ txt: "Loading...",
|
|
255
|
+ mask: true
|
|
256
|
+ });
|
|
257
|
+ toast.show();
|
|
258
|
+ this.$http
|
|
259
|
+ .post("service/bpm/bpm/delegateTask/" + this.modelsData.taskId, {
|
|
260
|
+ assginee: selectUserId
|
|
261
|
+ })
|
|
262
|
+ .then(res => {
|
|
263
|
+ toast.hide();
|
|
264
|
+ this.models.disjunctor = false;
|
|
265
|
+ if (res.status == 200) {
|
|
266
|
+ this.$createDialog({
|
|
267
|
+ type: "alert",
|
|
268
|
+ title: "操作成功",
|
|
269
|
+ icon: "cubeic-right",
|
|
270
|
+ onConfirm: (e, promptValue) => {
|
|
271
|
+ this.loadShow = true;
|
|
272
|
+ this.items = [];
|
|
273
|
+ this.idx = 0;
|
|
274
|
+ this.getData();
|
|
275
|
+ }
|
|
276
|
+ }).show();
|
|
277
|
+ } else {
|
|
278
|
+ this.$createDialog({
|
|
279
|
+ type: "alert",
|
|
280
|
+ title: "系统错误,请稍后再试!",
|
|
281
|
+ icon: "cubeic-wrong",
|
|
282
|
+ onConfirm: (e, promptValue) => {
|
|
283
|
+ this.loadShow = true;
|
|
284
|
+ this.items = [];
|
|
285
|
+ this.idx = 0;
|
|
286
|
+ this.getData();
|
|
287
|
+ }
|
|
288
|
+ }).show();
|
|
289
|
+ }
|
|
290
|
+ });
|
|
291
|
+ },
|
|
292
|
+ //取消
|
|
293
|
+ cancel() {
|
|
294
|
+ this.models.disjunctor = false;
|
|
295
|
+ },
|
|
296
|
+ // 指派
|
|
297
|
+ assign(item) {
|
|
298
|
+ this.modelsData = item;
|
|
299
|
+ this.models = {
|
|
300
|
+ disjunctor: true,
|
|
301
|
+ title: "指派对象",
|
|
302
|
+ icon: "warn",
|
|
303
|
+ operate: {
|
|
304
|
+ ok: "确定",
|
|
305
|
+ cancel: "取消"
|
|
306
|
+ }
|
|
307
|
+ };
|
|
308
|
+ },
|
219
|
309
|
getParamsState() {
|
220
|
310
|
if (this.$route.params.type) {
|
221
|
311
|
this.type = this.$route.params.type;
|
|
@@ -284,16 +374,19 @@ export default {
|
284
|
374
|
.post("service/bpm/bpm/fetchTask/bpm_incident", postData)
|
285
|
375
|
.then(function(res) {
|
286
|
376
|
if (res.data.data.length > 0) {
|
287
|
|
- that.wushuju = false;
|
288
|
377
|
for (var i = 0; i < res.data.data.length; i++) {
|
289
|
378
|
res.data.data[i].createTime = formatDate(
|
290
|
379
|
new Date(res.data.data[i].createTime),
|
291
|
380
|
"yyyy-MM-dd hh:mm"
|
292
|
381
|
);
|
293
|
382
|
}
|
294
|
|
- that.items = that.items.concat(res.data.data);
|
295
|
|
- } else if (res.data.data.length <= 0) {
|
296
|
|
- that.wushuju = true;
|
|
383
|
+ if (that.idx) {
|
|
384
|
+ that.items = that.items.concat(res.data.data);
|
|
385
|
+ } else {
|
|
386
|
+ that.items = res.data.data;
|
|
387
|
+ }
|
|
388
|
+ } else {
|
|
389
|
+ that.pullUpLoad = false;
|
297
|
390
|
}
|
298
|
391
|
that.loadShow = false;
|
299
|
392
|
});
|
|
@@ -302,7 +395,6 @@ export default {
|
302
|
395
|
var that = this;
|
303
|
396
|
that.idx = 0;
|
304
|
397
|
that.sum = 10;
|
305
|
|
- that.items = [];
|
306
|
398
|
setTimeout(() => {
|
307
|
399
|
that.getData();
|
308
|
400
|
}, 1000);
|
|
@@ -345,6 +437,13 @@ export default {
|
345
|
437
|
},
|
346
|
438
|
created() {
|
347
|
439
|
var that = this;
|
|
440
|
+ if (this.loginUser.role.length) {
|
|
441
|
+ this.isAssign = this.loginUser.role.some(
|
|
442
|
+ v =>
|
|
443
|
+ v.rolecode === "incident-category-manager" ||
|
|
444
|
+ v.rolecode === "incident manager"
|
|
445
|
+ );
|
|
446
|
+ }
|
348
|
447
|
that.loginUser.group.forEach(element => {
|
349
|
448
|
that.candidateGroups += element.id + ",";
|
350
|
449
|
});
|
|
@@ -353,6 +452,7 @@ export default {
|
353
|
452
|
that.candidateGroups.length - 1
|
354
|
453
|
);
|
355
|
454
|
this.getParamsState();
|
|
455
|
+ this.loadShow = true;
|
356
|
456
|
this.getData();
|
357
|
457
|
|
358
|
458
|
localStorage.removeItem("modelData");
|
|
@@ -366,16 +466,15 @@ export default {
|
366
|
466
|
};
|
367
|
467
|
</script>
|
368
|
468
|
<style lang="stylus" rel="stylesheet/stylus" scoped>
|
369
|
|
-.sub {
|
|
469
|
+.sub-btn {
|
370
|
470
|
background: #ececec;
|
371
|
471
|
.cube-btn {
|
372
|
472
|
background-color: #005395 !important;
|
|
473
|
+ border-radius: 8px
|
373
|
474
|
}
|
374
|
475
|
}
|
375
|
476
|
.scroll-list-wrap {
|
376
|
|
- /* height: 350px */
|
377
|
|
- height: 85vh;
|
378
|
|
- /* border: 1px solid rgba(0, 0, 0, 0.1) */
|
|
477
|
+ height: calc(100vh - 2.72rem);
|
379
|
478
|
border-radius: 5px;
|
380
|
479
|
transform: rotate(0deg); // fix 子元素超出边框圆角部分不隐藏的问题
|
381
|
480
|
overflow: hidden;
|