|
@@ -91,32 +91,6 @@
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <div class="task-apply-steps" v-if="flows.length">
|
|
|
|
- <el-steps align-center>
|
|
|
|
- <el-step
|
|
|
|
- v-for="flow in flows"
|
|
|
|
- :key="flow.taskKey"
|
|
|
|
- :title="flow.taskName"
|
|
|
|
- :status="flow.status"
|
|
|
|
- >
|
|
|
|
- <div slot="description">
|
|
|
|
- <div class="step-info" v-if="flow.firstUser">
|
|
|
|
- <span>{{ flow.firstUser }}</span>
|
|
|
|
- <el-popover
|
|
|
|
- v-if="flow.moreUser"
|
|
|
|
- placement="top-start"
|
|
|
|
- width="300"
|
|
|
|
- trigger="hover"
|
|
|
|
- :content="flow.moreUser"
|
|
|
|
- >
|
|
|
|
- <span class="color-primary ml-1" slot="reference">更多</span>
|
|
|
|
- </el-popover>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </el-step>
|
|
|
|
- </el-steps>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
<div class="apply-content task-detail" v-if="modalIsShow">
|
|
<div class="apply-content task-detail" v-if="modalIsShow">
|
|
<div class="task-body">
|
|
<div class="task-body">
|
|
<div class="mb-2 text-right">
|
|
<div class="mb-2 text-right">
|
|
@@ -250,31 +224,22 @@
|
|
placeholder="建议不超过100个字"
|
|
placeholder="建议不超过100个字"
|
|
></el-input>
|
|
></el-input>
|
|
|
|
|
|
- <!-- -->
|
|
|
|
- <div v-if="needSetApproveUser" class="task-audit">
|
|
|
|
- <el-form>
|
|
|
|
- <el-form-item label="指定审批人:">
|
|
|
|
- <el-select
|
|
|
|
- v-model="approveUserIds"
|
|
|
|
- placeholder="请选择"
|
|
|
|
- multiple
|
|
|
|
- filterable
|
|
|
|
- clearable
|
|
|
|
- style="width: 800px"
|
|
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="user in approveUserList"
|
|
|
|
- :key="user.id"
|
|
|
|
- :value="user.id"
|
|
|
|
- :label="`${user.realName}(${user.orgName})`"
|
|
|
|
- >
|
|
|
|
- {{ user.realName }}({{ user.orgName }})
|
|
|
|
- </el-option>
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
|
|
+ <div class="part-box part-box-pad part-box-border">
|
|
|
|
+ <el-timeline>
|
|
|
|
+ <el-timeline-item
|
|
|
|
+ v-for="flow in flowList"
|
|
|
|
+ :key="flow.taskKey"
|
|
|
|
+ :type="flow.type"
|
|
|
|
+ >
|
|
|
|
+ <div class="flow-item">
|
|
|
|
+ <h4 class="flow-item-title">{{ flow.taskName }}</h4>
|
|
|
|
+ <p class="flow-item-desc">{{ flow.approveUserNames }}</p>
|
|
|
|
+ </div>
|
|
|
|
+ </el-timeline-item>
|
|
|
|
+ </el-timeline>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
<div class="task-action">
|
|
<div class="task-action">
|
|
<el-button type="primary" :disabled="isSubmit" @click="submit"
|
|
<el-button type="primary" :disabled="isSubmit" @click="submit"
|
|
>确认提交</el-button
|
|
>确认提交</el-button
|
|
@@ -285,6 +250,7 @@
|
|
<el-button @click="cancel">取消</el-button>
|
|
<el-button @click="cancel">取消</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
<div slot="footer"></div>
|
|
<div slot="footer"></div>
|
|
|
|
|
|
<!-- upload-paper-dialog -->
|
|
<!-- upload-paper-dialog -->
|
|
@@ -312,13 +278,11 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { examRuleDetail } from "../../base/api";
|
|
|
|
|
|
+import { examRuleDetail, flowDetailByType } from "../../base/api";
|
|
import {
|
|
import {
|
|
teacherCreateTaskApply,
|
|
teacherCreateTaskApply,
|
|
teacherCancelTaskApply,
|
|
teacherCancelTaskApply,
|
|
- switchCardCreateMethod,
|
|
|
|
- taskAllApproverPeople,
|
|
|
|
- taskApproverNextPeople
|
|
|
|
|
|
+ switchCardCreateMethod
|
|
} from "../api";
|
|
} from "../api";
|
|
import UploadPaperDialog from "./UploadPaperDialog";
|
|
import UploadPaperDialog from "./UploadPaperDialog";
|
|
import CardOptionDialog from "./CardOptionDialog";
|
|
import CardOptionDialog from "./CardOptionDialog";
|
|
@@ -362,36 +326,11 @@ export default {
|
|
return {
|
|
return {
|
|
modalIsShow: false,
|
|
modalIsShow: false,
|
|
isSubmit: false,
|
|
isSubmit: false,
|
|
|
|
+ flowList: [],
|
|
examTask: {},
|
|
examTask: {},
|
|
needReview: false,
|
|
needReview: false,
|
|
task: {},
|
|
task: {},
|
|
examRule: {},
|
|
examRule: {},
|
|
- flows: [
|
|
|
|
- {
|
|
|
|
- flowId: "160684605807001600",
|
|
|
|
- taskName: "提交试卷",
|
|
|
|
- taskKey: "usertask1",
|
|
|
|
- setup: 1,
|
|
|
|
- status: "process",
|
|
|
|
- desc: "进行中"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- flowId: "160684605807001600",
|
|
|
|
- taskName: "审核试卷",
|
|
|
|
- taskKey: "usertask2",
|
|
|
|
- setup: 2,
|
|
|
|
- status: "wait",
|
|
|
|
- desc: "待进行"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- flowId: "160684605807001600",
|
|
|
|
- taskName: "审核试卷",
|
|
|
|
- taskKey: "usertask3",
|
|
|
|
- setup: 3,
|
|
|
|
- status: "wait",
|
|
|
|
- desc: "待进行"
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
rules: {
|
|
rules: {
|
|
semesterId: [
|
|
semesterId: [
|
|
{
|
|
{
|
|
@@ -438,10 +377,6 @@ export default {
|
|
curUploadType: "paper",
|
|
curUploadType: "paper",
|
|
attachmentLimitCount: 26,
|
|
attachmentLimitCount: 26,
|
|
abc: "abcdefghijklmnopqrstuvwxyz".toUpperCase(),
|
|
abc: "abcdefghijklmnopqrstuvwxyz".toUpperCase(),
|
|
- // 指定审核人,当查询到下一级没有审批人时需要手动指定
|
|
|
|
- needSetApproveUser: false,
|
|
|
|
- approveUserIds: [],
|
|
|
|
- approveUserList: [],
|
|
|
|
// image-preview
|
|
// image-preview
|
|
curImage: {},
|
|
curImage: {},
|
|
curImageIndex: 0
|
|
curImageIndex: 0
|
|
@@ -474,6 +409,7 @@ export default {
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.getExamRule();
|
|
this.getExamRule();
|
|
|
|
+ this.getFlowList();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
async getExamRule() {
|
|
async getExamRule() {
|
|
@@ -481,6 +417,13 @@ export default {
|
|
this.examRule = examRule || {};
|
|
this.examRule = examRule || {};
|
|
this.needReview = examRule && examRule.review;
|
|
this.needReview = examRule && examRule.review;
|
|
},
|
|
},
|
|
|
|
+ async getFlowList() {
|
|
|
|
+ const data = await flowDetailByType();
|
|
|
|
+ this.flowList = data || [];
|
|
|
|
+ if (this.flowList.length) {
|
|
|
|
+ this.flowList[0].type = "success";
|
|
|
|
+ }
|
|
|
|
+ },
|
|
initData() {
|
|
initData() {
|
|
this.examTask = { ...initExamTask };
|
|
this.examTask = { ...initExamTask };
|
|
this.examTaskDetail = { ...initExamTaskDetail };
|
|
this.examTaskDetail = { ...initExamTaskDetail };
|
|
@@ -488,9 +431,6 @@ export default {
|
|
this.examTaskDetail.review = this.examRule.review;
|
|
this.examTaskDetail.review = this.examRule.review;
|
|
this.examTaskDetail.customCard = this.examRule.customCard;
|
|
this.examTaskDetail.customCard = this.examRule.customCard;
|
|
this.paperAttachments = [];
|
|
this.paperAttachments = [];
|
|
- this.needSetApproveUser = false;
|
|
|
|
- this.approveUserIds = [];
|
|
|
|
- this.approveUserList = [];
|
|
|
|
},
|
|
},
|
|
visibleChange() {
|
|
visibleChange() {
|
|
this.initData();
|
|
this.initData();
|
|
@@ -668,47 +608,11 @@ export default {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
this.examTask.courseName = val.name;
|
|
this.examTask.courseName = val.name;
|
|
-
|
|
|
|
- this.needSetApproveUser = false;
|
|
|
|
- this.approveUserList = [];
|
|
|
|
- this.approveUserIds = [];
|
|
|
|
this.clearCard();
|
|
this.clearCard();
|
|
- this.updateApproverPeople();
|
|
|
|
},
|
|
},
|
|
clearCard() {
|
|
clearCard() {
|
|
this.clearMakeMethod();
|
|
this.clearMakeMethod();
|
|
},
|
|
},
|
|
- async updateApproverPeople() {
|
|
|
|
- const data = await taskAllApproverPeople({
|
|
|
|
- courseCode: this.examTask.courseCode
|
|
|
|
- });
|
|
|
|
- let approvePeople = {};
|
|
|
|
- data.approveUserList.forEach(item => {
|
|
|
|
- item.users = item.approveUser.map(
|
|
|
|
- user => `${user.realName}(${user.orgName})`
|
|
|
|
- );
|
|
|
|
- item.firstUser = item.users[0];
|
|
|
|
- item.moreUser = item.users.length > 1 ? item.users.join(",") : null;
|
|
|
|
- approvePeople[item.setup] = item;
|
|
|
|
- });
|
|
|
|
- this.flows = this.flows.map(flow => {
|
|
|
|
- return {
|
|
|
|
- ...flow,
|
|
|
|
- ...approvePeople[flow.setup]
|
|
|
|
- };
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- // 下一节点审批人
|
|
|
|
- const nextFlow = this.flows[1];
|
|
|
|
- if (nextFlow && !nextFlow.approveUser.length) {
|
|
|
|
- this.needSetApproveUser = true;
|
|
|
|
- const data = await taskApproverNextPeople({
|
|
|
|
- courseCode: this.examTask.courseCode
|
|
|
|
- });
|
|
|
|
- this.approveUserList =
|
|
|
|
- data && data.approveUserList && data.approveUserList[0].approveUser;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
getTaskDetailData() {
|
|
getTaskDetailData() {
|
|
let data = { ...this.examTaskDetail };
|
|
let data = { ...this.examTaskDetail };
|
|
data.paperType = this.paperAttachments.map(item => item.name).join(",");
|
|
data.paperType = this.paperAttachments.map(item => item.name).join(",");
|
|
@@ -747,11 +651,6 @@ export default {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- if (this.needSetApproveUser && !this.approveUserIds.length) {
|
|
|
|
- this.$message.error("请指定审批人!");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
return true;
|
|
return true;
|
|
},
|
|
},
|
|
async toSave(silent) {
|
|
async toSave(silent) {
|
|
@@ -765,8 +664,6 @@ export default {
|
|
examTaskDetail: this.examTaskDetail,
|
|
examTaskDetail: this.examTaskDetail,
|
|
examTask: this.examTask
|
|
examTask: this.examTask
|
|
};
|
|
};
|
|
- if (this.needSetApproveUser) datas.approveUserIds = this.approveUserIds;
|
|
|
|
-
|
|
|
|
const data = await teacherCreateTaskApply(datas).catch(() => {});
|
|
const data = await teacherCreateTaskApply(datas).catch(() => {});
|
|
this.isSubmit = false;
|
|
this.isSubmit = false;
|
|
if (!data) return;
|
|
if (!data) return;
|
|
@@ -796,9 +693,6 @@ export default {
|
|
examTaskDetail: this.examTaskDetail,
|
|
examTaskDetail: this.examTaskDetail,
|
|
examTask: this.examTask
|
|
examTask: this.examTask
|
|
};
|
|
};
|
|
- if (this.needSetApproveUser)
|
|
|
|
- datas.approveUserIds = this.approveUserIds;
|
|
|
|
-
|
|
|
|
const data = await teacherCreateTaskApply(datas).catch(() => {});
|
|
const data = await teacherCreateTaskApply(datas).catch(() => {});
|
|
|
|
|
|
if (!data) return;
|
|
if (!data) return;
|