|
@@ -83,7 +83,7 @@
|
|
|
<el-dialog :title="detailForm.taskName" :visible.sync="auditOpen" width="900px" class="i-audit-dialog"
|
|
|
append-to-body
|
|
|
:close-on-click-modal="false">
|
|
|
- <el-carousel trigger="click" height="630px" :autoplay="false"
|
|
|
+ <el-carousel ref="auditCarousel" trigger="click" height="630px" :autoplay="false" indicator-position="none"
|
|
|
@change="auditTaskChange">
|
|
|
<el-carousel-item v-for="item in carouselNum" :key="item">
|
|
|
<task-detail :detail-form="detailForm"></task-detail>
|
|
@@ -155,6 +155,7 @@ export default {
|
|
|
enforceRemindCount: 0,
|
|
|
|
|
|
carouselNum: 0,
|
|
|
+ currentCarouselIndex: 0,
|
|
|
detailForm: {},
|
|
|
auditForm: {},
|
|
|
auditOpen: false,
|
|
@@ -261,7 +262,7 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
this.carouselNum = this.auditTasks.length
|
|
|
- let auditTask = this.auditTasks[0];
|
|
|
+ let auditTask = this.auditTasks[this.currentCarouselIndex];
|
|
|
getTask(auditTask.id).then(res => {
|
|
|
this.detailForm = res.data;
|
|
|
this.auditForm = {
|
|
@@ -287,6 +288,13 @@ export default {
|
|
|
refs[key].resetFields()
|
|
|
refs[key].clearValidate()
|
|
|
}
|
|
|
+
|
|
|
+ let abs = Math.abs(currIndex - oldIndex);
|
|
|
+ if (abs != 1 && abs != this.auditTasks.length) {
|
|
|
+ this.$refs.auditCarousel.setActiveItem(this.currentCarouselIndex)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
let auditTask = this.auditTasks[currIndex];
|
|
|
getTask(auditTask.id).then(res => {
|
|
|
this.detailForm = res.data;
|
|
@@ -307,6 +315,11 @@ export default {
|
|
|
auditTask(this.auditForm).then(res => {
|
|
|
this.$message.success("操作成功");
|
|
|
this.auditTasks.splice(index - 1, 1)
|
|
|
+ this.currentCarouselIndex = index - 1
|
|
|
+ if (index - 1 === this.auditTasks.length) {
|
|
|
+ this.currentCarouselIndex = 0
|
|
|
+ }
|
|
|
+ this.$refs.auditCarousel.setActiveItem(this.currentCarouselIndex)
|
|
|
this.handleAudit();
|
|
|
})
|
|
|
}
|
|
@@ -316,6 +329,7 @@ export default {
|
|
|
// 取消按钮(详情/审核)
|
|
|
auditCancel() {
|
|
|
// this.detailForm = {};
|
|
|
+ this.currentCarouselIndex = 0
|
|
|
this.auditForm = {
|
|
|
taskId: undefined,
|
|
|
auditResult: undefined,
|