|
|
@@ -0,0 +1,303 @@
|
|
|
+<!-- 历史评论信息 -->
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <div
|
|
|
+ v-if="historyProcessInstanceDescriptions != undefined"
|
|
|
+ class="panel panel-default"
|
|
|
+ >
|
|
|
+ <div class="panel-heading">
|
|
|
+ {{ $t("lang.historyApproveComment.title") }}
|
|
|
+ <span class="label label-warning m-label">
|
|
|
+ {{ abandonCount == undefined ? "0" : abandonCount }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="panel-body">
|
|
|
+ <ul
|
|
|
+ v-for="item in historyProcessInstanceDescriptions"
|
|
|
+ :key="item.id"
|
|
|
+ class="media-list m-media-list"
|
|
|
+ >
|
|
|
+ <li class="media">
|
|
|
+ <div class="media-left">
|
|
|
+ <a>
|
|
|
+ <AuthImage
|
|
|
+ :auth-src="
|
|
|
+ Common.getThumbnailImageSrc(
|
|
|
+ 'com.leanwo.prodog.base.model.User',
|
|
|
+ item.startUserImage
|
|
|
+ )
|
|
|
+ "
|
|
|
+ class="media-object thumbnail m-image"
|
|
|
+ />
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ <div class="media-body">
|
|
|
+ <h4 class="media-heading">
|
|
|
+ {{ item.startUserName }}
|
|
|
+ <small class="badge alert-error">
|
|
|
+ {{ $t("lang.approveComment.submitUser") }}
|
|
|
+ ({{ item.documentStatusChangeReason }})
|
|
|
+ </small>
|
|
|
+ </h4>
|
|
|
+ <h5 class="m-h5">{{ item.startTime }}</h5>
|
|
|
+ <p>{{ $t("lang.approveComment.submitApprove") }}</p>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+
|
|
|
+ <template v-if="item.taskComments != undefined">
|
|
|
+ <li
|
|
|
+ v-for="taskComment in item.taskComments"
|
|
|
+ :key="taskComment.id"
|
|
|
+ class="media"
|
|
|
+ >
|
|
|
+ <div class="media-left">
|
|
|
+ <a>
|
|
|
+ <AuthImage
|
|
|
+ :auth-src="
|
|
|
+ Common.getThumbnailImageSrc(
|
|
|
+ 'com.leanwo.prodog.base.model.User',
|
|
|
+ taskComment.userImageUrl
|
|
|
+ )
|
|
|
+ "
|
|
|
+ class="media-object thumbnail m-image"
|
|
|
+ />
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ <div class="media-body">
|
|
|
+ <h4 class="media-heading">
|
|
|
+ {{ taskComment.userName }}
|
|
|
+ <small class="badge alert-error">{{ taskComment.taskName }}({{
|
|
|
+ item.documentStatusChangeReason
|
|
|
+ }})</small>
|
|
|
+ </h4>
|
|
|
+
|
|
|
+ <div v-if="taskComment.comments != undefined">
|
|
|
+ <div
|
|
|
+ v-for="commentItem in taskComment.comments"
|
|
|
+ :key="commentItem.id"
|
|
|
+ >
|
|
|
+ <h5 class="m-h5">{{ commentItem.commentDate }}</h5>
|
|
|
+ <p>{{ commentItem.comment }}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-if="taskComment.imageNames != undefined">
|
|
|
+ <AuthImage
|
|
|
+ v-for="(imageName, index) in taskComment.imageNames"
|
|
|
+ :key="index"
|
|
|
+ :auth-src="getCommentImageSrc(imageName)"
|
|
|
+ class="thumbnail m-image1"
|
|
|
+ @click="openImageAttachment(imageName)"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-if="taskComment.attachmentNames != undefined">
|
|
|
+ <a
|
|
|
+ v-for="(
|
|
|
+ attachmentName, index
|
|
|
+ ) in taskComment.attachmentNames"
|
|
|
+ :key="index"
|
|
|
+ :href="getAttachmentsUrl(attachmentName)"
|
|
|
+ target="view_window"
|
|
|
+ class="btn btn-primary btn-sm btn-block"
|
|
|
+ >{{ attachmentName }}</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-for="activeTask in item.taskDescriptions" :key="activeTask.id">
|
|
|
+ <li
|
|
|
+ v-if="item.taskDescriptions != undefined"
|
|
|
+ class="media"
|
|
|
+ >
|
|
|
+ <div class="media-left">
|
|
|
+ <a>
|
|
|
+ <AuthImage
|
|
|
+ :auth-src="
|
|
|
+ Common.getThumbnailImageSrc(
|
|
|
+ 'com.leanwo.prodog.base.model.User',
|
|
|
+ activeTask.assigneeImageUrl
|
|
|
+ )
|
|
|
+ "
|
|
|
+ class="media-object thumbnail m-image"
|
|
|
+ />
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ <div class="media-body">
|
|
|
+ <h4 class="media-heading">
|
|
|
+ {{ activeTask.assignee }}
|
|
|
+ <small class="badge alert-error">{{ activeTask.name }}({{
|
|
|
+ item.documentStatusChangeReason
|
|
|
+ }})</small>
|
|
|
+ </h4>
|
|
|
+ <h5 class="m-h5">{{ activeTask.startTime }}</h5>
|
|
|
+ <p>{{ $t("lang.approveComment.processing") }}</p>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ </template>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <Loading v-if="loading" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import Common from '../common/Common.js';
|
|
|
+import AuthImage from '../widget/AuthImage.vue';
|
|
|
+import { Notify } from 'pc-component-v3';
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ AuthImage,
|
|
|
+ },
|
|
|
+
|
|
|
+ props: {
|
|
|
+ processInstanceId: {
|
|
|
+ type: String,
|
|
|
+ default: null,
|
|
|
+ },
|
|
|
+ recordId: {
|
|
|
+ type: Number,
|
|
|
+ default: null,
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+ emits: ['saveData'],
|
|
|
+
|
|
|
+ data: function () {
|
|
|
+ this.Common = Common;
|
|
|
+ return {
|
|
|
+ historyProcessInstanceDescriptions: null,
|
|
|
+ abandonCount: 0,
|
|
|
+ className: 'WorkFlow',
|
|
|
+ loading: false,
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+ watch: {
|
|
|
+ recordId: function (currentValue, oldValue) {
|
|
|
+ this.refresh();
|
|
|
+ },
|
|
|
+ processInstanceId: function (currentValue, oldValue) {
|
|
|
+ this.refresh();
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+ mounted: function () {
|
|
|
+ var _self = this;
|
|
|
+ this.refresh();
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ /**
|
|
|
+ * 刷新流程信息
|
|
|
+ */
|
|
|
+ refresh: function () {
|
|
|
+ var _self = this;
|
|
|
+
|
|
|
+ _self.historyProcessInstanceDescriptions = null;
|
|
|
+ _self.abandonCount = 0;
|
|
|
+
|
|
|
+ if (_self.recordId == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ _self.loading = true;
|
|
|
+ $.ajax({
|
|
|
+ url: Common.getApiURL(
|
|
|
+ 'WorkflowResource/listAbandonHistoryProcessInstanceDescription',
|
|
|
+ ),
|
|
|
+ type: 'GET',
|
|
|
+ dataType: 'json',
|
|
|
+ data: {
|
|
|
+ excludeProcessInstanceId: _self.processInstanceId,
|
|
|
+ recordId: _self.recordId,
|
|
|
+ },
|
|
|
+ beforeSend: function (request) {
|
|
|
+ Common.addTokenToRequest(request);
|
|
|
+ },
|
|
|
+ success: function (data) {
|
|
|
+ _self.loading = false;
|
|
|
+ if (data.errorCode == 0) {
|
|
|
+ _self.historyProcessInstanceDescriptions = data.datas;
|
|
|
+ _self.abandonCount = data.total;
|
|
|
+ } else {
|
|
|
+ _self.historyProcessInstanceDescriptions = null;
|
|
|
+ _self.abandonCount = 0;
|
|
|
+ Notify.error('历史审批记录查询失败', data.errorMessage, false);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
|
+ _self.loading = false;
|
|
|
+ Common.processException(XMLHttpRequest, textStatus, errorThrown);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取评论的图片
|
|
|
+ * @param {[type]} imageUrl [description]
|
|
|
+ * @return {[type]} [description]
|
|
|
+ */
|
|
|
+ getCommentImageSrc: function (imageUrl) {
|
|
|
+ console.log(imageUrl);
|
|
|
+ var realImageUrl = Common.getImageSrc(
|
|
|
+ this.className,
|
|
|
+ 'thumbnail/' + imageUrl,
|
|
|
+ );
|
|
|
+ return realImageUrl;
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 打开图片附件的功能
|
|
|
+ * @param {[type]} imageName [description]
|
|
|
+ * @return {[type]} [description]
|
|
|
+ */
|
|
|
+ openImageAttachment: function (imageName) {
|
|
|
+ if (imageName == undefined) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var fullPath = Common.getImageSrc(this.className, imageName);
|
|
|
+ window.open(fullPath);
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取附件的URL
|
|
|
+ * @param {[type]} url [description]
|
|
|
+ * @return {[type]} [description]
|
|
|
+ */
|
|
|
+ getAttachmentsUrl: function (url) {
|
|
|
+ console.log(url);
|
|
|
+ return Common.getAttachmentsSrc(this.className, url);
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+.m-label {
|
|
|
+ margin-left: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.m-h5 {
|
|
|
+ display: inline;
|
|
|
+}
|
|
|
+
|
|
|
+.m-image {
|
|
|
+ width: 64px;
|
|
|
+ height: 64px;
|
|
|
+}
|
|
|
+
|
|
|
+.m-image1 {
|
|
|
+ display: inline !important;
|
|
|
+ width: 64px;
|
|
|
+ height: 64px;
|
|
|
+ cursor: pointer;
|
|
|
+ margin-right: 5px;
|
|
|
+}
|
|
|
+
|
|
|
+.m-media-list{
|
|
|
+ border-bottom: 1px solid #c4c3c3;
|
|
|
+}
|
|
|
+</style>
|