|
@@ -177,6 +177,30 @@
|
|
|
<p v-else>暂无</p>
|
|
|
</div>
|
|
|
|
|
|
+ <!-- -->
|
|
|
+ <div v-if="IS_APPLY && 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>
|
|
|
<!-- audit -->
|
|
|
<div v-if="IS_AUDIT" class="task-audit">
|
|
|
<el-form
|
|
@@ -250,6 +274,28 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ v-if="needSetApproveUser && auditModal.approvePass === 'PASS'"
|
|
|
+ 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>
|
|
|
</div>
|
|
@@ -314,7 +360,8 @@ import {
|
|
|
taskAllFlowSetups,
|
|
|
taskAllApproverPeople,
|
|
|
taskAllApproverExchangePeople,
|
|
|
- taskApproverExchange
|
|
|
+ taskApproverExchange,
|
|
|
+ taskApproverNextPeople
|
|
|
} from "../api";
|
|
|
import { attachmentPreview } from "../../login/api";
|
|
|
import SimpleImagePreview from "@/components/SimpleImagePreview";
|
|
@@ -424,6 +471,9 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
approveExchangePeople: [],
|
|
|
+ needSetApproveUser: false,
|
|
|
+ approveUserIds: [],
|
|
|
+ approveUserList: [], //审批人
|
|
|
// image-preview
|
|
|
curImage: {},
|
|
|
curImageIndex: 0
|
|
@@ -553,19 +603,47 @@ export default {
|
|
|
return item;
|
|
|
});
|
|
|
|
|
|
- if (this.flows.length) {
|
|
|
- const curFlow = this.flows.find(item => item.isCurrent);
|
|
|
- if (curFlow)
|
|
|
- this.setups = this.flows
|
|
|
- .filter(item => item.setup < curFlow.setup)
|
|
|
- .map(item => {
|
|
|
- return {
|
|
|
- taskKey: item.taskKey,
|
|
|
- setup: item.setup,
|
|
|
- taskName: item.taskName
|
|
|
- };
|
|
|
- });
|
|
|
+ if (!this.flows.length) {
|
|
|
+ this.$emit("step-change", this.flows);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const curFlow = this.flows.find(item => item.isCurrent);
|
|
|
+ if (curFlow) {
|
|
|
+ this.setups = this.flows
|
|
|
+ .filter(item => item.setup < curFlow.setup)
|
|
|
+ .map(item => {
|
|
|
+ return {
|
|
|
+ taskKey: item.taskKey,
|
|
|
+ setup: item.setup,
|
|
|
+ taskName: item.taskName
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ // 下一节点审批人
|
|
|
+ const nextFlow = this.flows.find(
|
|
|
+ item => item.setup > this.curTaskApply.setup
|
|
|
+ );
|
|
|
+ if (
|
|
|
+ (this.IS_APPLY || this.IS_AUDIT) &&
|
|
|
+ nextFlow &&
|
|
|
+ !nextFlow.approveUser.length
|
|
|
+ ) {
|
|
|
+ // 获取审批人
|
|
|
+ this.needSetApproveUser = true;
|
|
|
+ let datas = {};
|
|
|
+ if (this.IS_APPLY) {
|
|
|
+ datas.courseCode = this.curTaskApply.courseCode;
|
|
|
+ }
|
|
|
+ if (this.IS_AUDIT) {
|
|
|
+ datas.taskId = this.curTaskApply.flowId;
|
|
|
+ }
|
|
|
+ const data = await taskApproverNextPeople(datas);
|
|
|
+ this.approveUserList =
|
|
|
+ data && data.approveUserList && data.approveUserList[0].approveUser;
|
|
|
}
|
|
|
+
|
|
|
this.$emit("step-change", this.flows);
|
|
|
},
|
|
|
async getExchangeApproverPeople() {
|
|
@@ -746,6 +824,7 @@ export default {
|
|
|
data.paperConfirmAttachmentIds = JSON.stringify(
|
|
|
this.paperConfirmAttachments
|
|
|
);
|
|
|
+ if (this.needSetApproveUser) data.approveUserIds = this.approveUserIds;
|
|
|
return data;
|
|
|
},
|
|
|
checkDataValid() {
|
|
@@ -774,6 +853,12 @@ export default {
|
|
|
this.$message.error("请先提交题卡!");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ if (this.needSetApproveUser && !this.approveUserIds.length) {
|
|
|
+ this.$message.error("请指定审批人!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
return true;
|
|
|
},
|
|
|
async toSave() {
|
|
@@ -815,6 +900,15 @@ export default {
|
|
|
const valid = await this.$refs.auditModalComp.validate().catch(() => {});
|
|
|
if (!valid) return;
|
|
|
|
|
|
+ if (
|
|
|
+ this.auditModal.approvePass === "PASS" &&
|
|
|
+ this.needSetApproveUser &&
|
|
|
+ !this.approveUserIds.length
|
|
|
+ ) {
|
|
|
+ this.$message.error("请指定审批人!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
const actionName = this.TASK_AUDIT_RESULT[this.auditModal.approvePass];
|
|
|
const result = await this.$confirm(
|
|
|
`确定${actionName}该申请吗?`,
|
|
@@ -835,6 +929,8 @@ export default {
|
|
|
} else {
|
|
|
let datas = { ...this.auditModal };
|
|
|
datas.taskId = this.curTaskApply.flowTaskId;
|
|
|
+ if (this.auditModal.approvePass === "PASS")
|
|
|
+ datas.approveUserIds = this.approveUserIds;
|
|
|
const data = await updateTaskReview(datas).catch(() => {});
|
|
|
if (!data) return;
|
|
|
}
|