|
@@ -177,30 +177,42 @@
|
|
<p v-else>暂无</p>
|
|
<p v-else>暂无</p>
|
|
</div>
|
|
</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: 700px"
|
|
|
|
- >
|
|
|
|
- <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>
|
|
|
|
|
|
+ <!-- audit history -->
|
|
|
|
+ <div
|
|
|
|
+ v-if="flowHistoryList.length"
|
|
|
|
+ class="task-audit-history flow-timeline"
|
|
|
|
+ >
|
|
|
|
+ <h4 class="mb-4">审核记录:</h4>
|
|
|
|
+ <el-timeline>
|
|
|
|
+ <el-timeline-item
|
|
|
|
+ v-for="flow in flowHistoryList"
|
|
|
|
+ :key="flow.stepKey"
|
|
|
|
+ :type="flow.type"
|
|
|
|
+ hide-timestamp
|
|
|
|
+ size="large"
|
|
|
|
+ placement="top"
|
|
|
|
+ >
|
|
|
|
+ <div class="flow-item">
|
|
|
|
+ <p v-if="flow.createTime" class="flow-item-time">
|
|
|
|
+ {{ flow.createTime | timestampFilter }}
|
|
|
|
+ </p>
|
|
|
|
+ <h4 class="flow-item-title">{{ flow.approveUserName }}</h4>
|
|
|
|
+ <p class="flow-item-desc">
|
|
|
|
+ <span
|
|
|
|
+ :class="{
|
|
|
|
+ 'color-danger': flow.approveOperation === 'REJECT'
|
|
|
|
+ }"
|
|
|
|
+ >{{
|
|
|
|
+ flow.approveOperation | flowApproveOperationTypeFilter
|
|
|
|
+ }}</span
|
|
|
|
+ >
|
|
|
|
+ <span>{{ flow.approveRemark }}</span>
|
|
|
|
+ </p>
|
|
|
|
+ </div>
|
|
|
|
+ </el-timeline-item>
|
|
|
|
+ </el-timeline>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
<!-- audit -->
|
|
<!-- audit -->
|
|
<div v-if="IS_AUDIT" class="task-audit">
|
|
<div v-if="IS_AUDIT" class="task-audit">
|
|
<el-form
|
|
<el-form
|
|
@@ -233,7 +245,7 @@
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
- v-for="item in setups"
|
|
|
|
|
|
+ v-for="item in rejectSetupList"
|
|
:key="item.taskKey"
|
|
:key="item.taskKey"
|
|
:value="item.setup"
|
|
:value="item.setup"
|
|
:label="item.taskName"
|
|
:label="item.taskName"
|
|
@@ -265,61 +277,26 @@
|
|
prop="userId"
|
|
prop="userId"
|
|
label="审批人:"
|
|
label="审批人:"
|
|
>
|
|
>
|
|
- <el-select
|
|
|
|
- v-model="auditModal.userId"
|
|
|
|
- filterable
|
|
|
|
- placeholder="请选择"
|
|
|
|
|
|
+ <el-tag
|
|
|
|
+ v-for="user in exchangeUsers"
|
|
|
|
+ :key="user.id"
|
|
|
|
+ :disable-transitions="false"
|
|
|
|
+ size="medium"
|
|
>
|
|
>
|
|
- <el-option
|
|
|
|
- v-for="user in approveExchangePeople"
|
|
|
|
- :key="user.id"
|
|
|
|
- :value="user.id"
|
|
|
|
- :label="user.realName"
|
|
|
|
- ></el-option>
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item
|
|
|
|
- v-if="needSetApproveUser && auditModal.approvePass === 'PASS'"
|
|
|
|
- key="approveUserIds"
|
|
|
|
- label="指定审批人:"
|
|
|
|
- >
|
|
|
|
- <el-select
|
|
|
|
- v-model="approveUserIds"
|
|
|
|
- placeholder="请选择"
|
|
|
|
- multiple
|
|
|
|
- filterable
|
|
|
|
- clearable
|
|
|
|
- style="width: 700px"
|
|
|
|
|
|
+ {{ user.name }}
|
|
|
|
+ </el-tag>
|
|
|
|
+ <el-button
|
|
|
|
+ class="ml-2"
|
|
|
|
+ size="mini"
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="toSelectExchangeUser"
|
|
|
|
+ >选择用户</el-button
|
|
>
|
|
>
|
|
- <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-item>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <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 class="task-action">
|
|
<div class="task-action">
|
|
<el-button
|
|
<el-button
|
|
v-if="IS_APPLY"
|
|
v-if="IS_APPLY"
|
|
@@ -374,6 +351,13 @@
|
|
@on-next="toNextImage"
|
|
@on-next="toNextImage"
|
|
ref="SimpleImagePreview"
|
|
ref="SimpleImagePreview"
|
|
></simple-image-preview>
|
|
></simple-image-preview>
|
|
|
|
+ <!-- select-user-dialog -->
|
|
|
|
+ <select-user-dialog
|
|
|
|
+ ref="SelectUserDialog"
|
|
|
|
+ :user-limit-count="1"
|
|
|
|
+ :users="exchangeUsers"
|
|
|
|
+ @modified="exchangeUserSelected"
|
|
|
|
+ ></select-user-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -383,18 +367,24 @@ import CardOptionDialog from "./CardOptionDialog";
|
|
import {
|
|
import {
|
|
taskApplyDetail,
|
|
taskApplyDetail,
|
|
updateTaskApply,
|
|
updateTaskApply,
|
|
- updateTaskReview,
|
|
|
|
|
|
+ // updateTaskReview,
|
|
taskAuditApply,
|
|
taskAuditApply,
|
|
- switchCardCreateMethod,
|
|
|
|
|
|
+ switchCardCreateMethod
|
|
// taskAllFlowSetups,
|
|
// taskAllFlowSetups,
|
|
// taskAllApproverPeople,
|
|
// taskAllApproverPeople,
|
|
- taskAllApproverExchangePeople,
|
|
|
|
- taskApproverExchange
|
|
|
|
|
|
+ // taskAllApproverExchangePeople,
|
|
// taskApproverNextPeople
|
|
// taskApproverNextPeople
|
|
} from "../api";
|
|
} from "../api";
|
|
import { attachmentPreview } from "../../login/api";
|
|
import { attachmentPreview } from "../../login/api";
|
|
import SimpleImagePreview from "@/components/SimpleImagePreview";
|
|
import SimpleImagePreview from "@/components/SimpleImagePreview";
|
|
|
|
+import SelectUserDialog from "../../base/components/SelectUserDialog";
|
|
import { CARD_SOURCE_TYPE, TASK_AUDIT_RESULT } from "@/constants/enumerate";
|
|
import { CARD_SOURCE_TYPE, TASK_AUDIT_RESULT } from "@/constants/enumerate";
|
|
|
|
+import {
|
|
|
|
+ taskFlowDetail,
|
|
|
|
+ taskFlowApproverExchange,
|
|
|
|
+ taskFlowNodeInfo,
|
|
|
|
+ taskFlowApprover
|
|
|
|
+} from "../../base/api";
|
|
|
|
|
|
const initTaskApply = {
|
|
const initTaskApply = {
|
|
examTaskId: "",
|
|
examTaskId: "",
|
|
@@ -426,7 +416,12 @@ const initTaskApply = {
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "apply-content",
|
|
name: "apply-content",
|
|
- components: { UploadPaperDialog, CardOptionDialog, SimpleImagePreview },
|
|
|
|
|
|
+ components: {
|
|
|
|
+ UploadPaperDialog,
|
|
|
|
+ CardOptionDialog,
|
|
|
|
+ SimpleImagePreview,
|
|
|
|
+ SelectUserDialog
|
|
|
|
+ },
|
|
props: {
|
|
props: {
|
|
examTask: {
|
|
examTask: {
|
|
type: Object,
|
|
type: Object,
|
|
@@ -455,11 +450,11 @@ export default {
|
|
TASK_AUDIT_RESULT: { ...TASK_AUDIT_RESULT, EXCHANGE: "转他人审批" },
|
|
TASK_AUDIT_RESULT: { ...TASK_AUDIT_RESULT, EXCHANGE: "转他人审批" },
|
|
// audit
|
|
// audit
|
|
flows: [],
|
|
flows: [],
|
|
- setups: [],
|
|
|
|
auditModal: {
|
|
auditModal: {
|
|
approvePass: "PASS",
|
|
approvePass: "PASS",
|
|
setup: "",
|
|
setup: "",
|
|
- remark: ""
|
|
|
|
|
|
+ remark: "",
|
|
|
|
+ userId: ""
|
|
},
|
|
},
|
|
auditRules: {
|
|
auditRules: {
|
|
approvePass: [
|
|
approvePass: [
|
|
@@ -501,8 +496,9 @@ export default {
|
|
}
|
|
}
|
|
]
|
|
]
|
|
},
|
|
},
|
|
- approveExchangePeople: [],
|
|
|
|
- flowList: [],
|
|
|
|
|
|
+ flowHistoryList: [],
|
|
|
|
+ rejectSetupList: [],
|
|
|
|
+ exchangeUsers: [],
|
|
// image-preview
|
|
// image-preview
|
|
curImage: {},
|
|
curImage: {},
|
|
curImageIndex: 0
|
|
curImageIndex: 0
|
|
@@ -569,6 +565,7 @@ export default {
|
|
this.examTask.source
|
|
this.examTask.source
|
|
);
|
|
);
|
|
this.curTaskApply = this.$objAssign(initTaskApply, data || {});
|
|
this.curTaskApply = this.$objAssign(initTaskApply, data || {});
|
|
|
|
+ this.curTaskApply.examId = this.examTask.examId;
|
|
this.curTaskApply.examTaskId = this.examTask.id;
|
|
this.curTaskApply.examTaskId = this.examTask.id;
|
|
this.curTaskApply.courseCode = this.examTask.courseCode;
|
|
this.curTaskApply.courseCode = this.examTask.courseCode;
|
|
this.curTaskApply.courseName = this.examTask.courseName;
|
|
this.curTaskApply.courseName = this.examTask.courseName;
|
|
@@ -594,35 +591,48 @@ export default {
|
|
? JSON.parse(this.curTaskApply.paperConfirmAttachmentIds)
|
|
? JSON.parse(this.curTaskApply.paperConfirmAttachmentIds)
|
|
: [];
|
|
: [];
|
|
|
|
|
|
- this.buildSteps();
|
|
|
|
|
|
+ this.getFlowHistory();
|
|
|
|
|
|
- if (this.IS_AUDIT) this.getExchangeApproverPeople();
|
|
|
|
|
|
+ if (this.IS_AUDIT) this.getRejectSetupList();
|
|
},
|
|
},
|
|
- async buildSteps() {
|
|
|
|
|
|
+ async getFlowHistory() {
|
|
if (
|
|
if (
|
|
!this.curTaskApply.flowId ||
|
|
!this.curTaskApply.flowId ||
|
|
(this.curTaskApply.setup !== null && this.curTaskApply.setup <= 0)
|
|
(this.curTaskApply.setup !== null && this.curTaskApply.setup <= 0)
|
|
) {
|
|
) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ const data = await taskFlowDetail(
|
|
|
|
+ this.curTaskApply.flowId
|
|
|
|
+ ).catch(() => {});
|
|
|
|
+ if (!data) return;
|
|
|
|
|
|
- // TODO:获取流程节点
|
|
|
|
- },
|
|
|
|
- async getExchangeApproverPeople() {
|
|
|
|
- const data = await taskAllApproverExchangePeople({
|
|
|
|
- taskId: this.curTaskApply.flowTaskId
|
|
|
|
- });
|
|
|
|
|
|
+ const FLOW_STATUS = {
|
|
|
|
+ SUBMIT: "success",
|
|
|
|
+ APPROVE: "success",
|
|
|
|
+ EXCHANGE: "success",
|
|
|
|
+ REJECT: "danger",
|
|
|
|
+ END: "success"
|
|
|
|
+ };
|
|
|
|
|
|
- this.approveExchangePeople =
|
|
|
|
- (data &&
|
|
|
|
- data.approveUserList &&
|
|
|
|
- data.approveUserList[0] &&
|
|
|
|
- data.approveUserList[0].approveUser) ||
|
|
|
|
- [];
|
|
|
|
- const userId = this.$ls.get("user", { id: "" }).id;
|
|
|
|
- this.approveExchangePeople = this.approveExchangePeople.filter(
|
|
|
|
- user => user.id !== userId
|
|
|
|
- );
|
|
|
|
|
|
+ this.flowHistoryList = data.tfFlowViewLogResultList.map(item => {
|
|
|
|
+ item.type = FLOW_STATUS[item.approveOperation];
|
|
|
|
+ return item;
|
|
|
|
+ });
|
|
|
|
+ const flowIsEnd = data.currFlowTaskResult.taskKey === "end";
|
|
|
|
+ this.flowHistoryList.push({
|
|
|
|
+ type: flowIsEnd ? "success" : null,
|
|
|
|
+ stepKey: this.$randomCode(),
|
|
|
|
+ approveSetup: data.currFlowTaskResult.setup, //审批人节点
|
|
|
|
+ approveRemark: data.currFlowTaskResult.taskName, //审批信息
|
|
|
|
+ approveOperation: flowIsEnd ? "END" : "",
|
|
|
|
+ approveUserName: data.currFlowTaskResult.approveUserNames, //审批人
|
|
|
|
+ createTime: null
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ async getRejectSetupList() {
|
|
|
|
+ const data = await taskFlowNodeInfo(this.curTaskApply.flowTaskId);
|
|
|
|
+ this.rejectSetupList = (data && data.rejectSetupList) || [];
|
|
},
|
|
},
|
|
approvePassChange() {
|
|
approvePassChange() {
|
|
this.auditRules.remark[0].required =
|
|
this.auditRules.remark[0].required =
|
|
@@ -779,6 +789,14 @@ export default {
|
|
this.curTaskApply.makeMethod = "";
|
|
this.curTaskApply.makeMethod = "";
|
|
this.curTaskApply.cardId = "";
|
|
this.curTaskApply.cardId = "";
|
|
},
|
|
},
|
|
|
|
+ toSelectExchangeUser() {
|
|
|
|
+ this.$refs.SelectUserDialog.open();
|
|
|
|
+ },
|
|
|
|
+ exchangeUserSelected(users) {
|
|
|
|
+ console.log(users);
|
|
|
|
+ this.exchangeUsers = users;
|
|
|
|
+ this.auditModal.userId = users[0].id;
|
|
|
|
+ },
|
|
getTaskData() {
|
|
getTaskData() {
|
|
let data = { ...this.curTaskApply };
|
|
let data = { ...this.curTaskApply };
|
|
data.paperType = this.paperAttachments.map(item => item.name).join(",");
|
|
data.paperType = this.paperAttachments.map(item => item.name).join(",");
|
|
@@ -788,7 +806,6 @@ export default {
|
|
data.paperConfirmAttachmentIds = JSON.stringify(
|
|
data.paperConfirmAttachmentIds = JSON.stringify(
|
|
this.paperConfirmAttachments
|
|
this.paperConfirmAttachments
|
|
);
|
|
);
|
|
- if (this.needSetApproveUser) data.approveUserIds = this.approveUserIds;
|
|
|
|
return data;
|
|
return data;
|
|
},
|
|
},
|
|
checkDataValid() {
|
|
checkDataValid() {
|
|
@@ -818,11 +835,6 @@ export default {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- if (this.needSetApproveUser && !this.approveUserIds.length) {
|
|
|
|
- this.$message.error("请指定审批人!");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
return true;
|
|
return true;
|
|
},
|
|
},
|
|
async toSave() {
|
|
async toSave() {
|
|
@@ -864,15 +876,6 @@ export default {
|
|
const valid = await this.$refs.auditModalComp.validate().catch(() => {});
|
|
const valid = await this.$refs.auditModalComp.validate().catch(() => {});
|
|
if (!valid) return;
|
|
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 actionName = this.TASK_AUDIT_RESULT[this.auditModal.approvePass];
|
|
const result = await this.$confirm(
|
|
const result = await this.$confirm(
|
|
`确定${actionName}该申请吗?`,
|
|
`确定${actionName}该申请吗?`,
|
|
@@ -888,14 +891,14 @@ export default {
|
|
taskId: this.curTaskApply.flowTaskId,
|
|
taskId: this.curTaskApply.flowTaskId,
|
|
userId: this.auditModal.userId
|
|
userId: this.auditModal.userId
|
|
};
|
|
};
|
|
- const data = await taskApproverExchange(datas).catch(() => {});
|
|
|
|
|
|
+ const data = await taskFlowApproverExchange(datas).catch(() => {});
|
|
if (!data) return;
|
|
if (!data) return;
|
|
} else {
|
|
} else {
|
|
let datas = { ...this.auditModal };
|
|
let datas = { ...this.auditModal };
|
|
datas.taskId = this.curTaskApply.flowTaskId;
|
|
datas.taskId = this.curTaskApply.flowTaskId;
|
|
if (this.auditModal.approvePass === "PASS")
|
|
if (this.auditModal.approvePass === "PASS")
|
|
datas.approveUserIds = this.approveUserIds;
|
|
datas.approveUserIds = this.approveUserIds;
|
|
- const data = await updateTaskReview(datas).catch(() => {});
|
|
|
|
|
|
+ const data = await taskFlowApprover(datas).catch(() => {});
|
|
if (!data) return;
|
|
if (!data) return;
|
|
}
|
|
}
|
|
|
|
|