| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286 |
- <!-- 历史评论信息 -->
- <template>
- <div v-if="historyProcessInstanceDescriptions != undefined">
- <div
- v-for="historyProcessInstanceDescription, index in historyProcessInstanceDescriptions"
- :key="historyProcessInstanceDescription.id"
- >
- <div class="page-header">
- <h4 style="display: inline-block; margin-right: 2rem;">
- {{ $t("lang.historyApproveComment.title") }}
- </h4>
-
- <a-tag color="warning">
- {{ index + 1 }} / {{ abandonCount == undefined ? "0" : abandonCount }}
- </a-tag>
- <a-tag v-if="historyProcessInstanceDescription.approvalHistory != null" color="processing">
- <template #icon>
- <close-circle-outlined />
- </template>
- {{ historyProcessInstanceDescription.approvalHistory.documentStatusChangeReason }}
- </a-tag>
- <a-tag color="success">
- <template #icon>
- <clock-circle-outlined />
- </template>
- {{ historyProcessInstanceDescription.startTime }}-{{ historyProcessInstanceDescription.endTime }}
- </a-tag>
- </div>
-
- <div>
- <ul
- 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',
- historyProcessInstanceDescription.startUserImageUrl
- )
- "
- class="media-object thumbnail m-image"
- />
- </a>
- </div>
- <div class="media-body">
- <h4 class="media-heading">
- {{ historyProcessInstanceDescription.startUserName }}
- <small class="badge alert-error">
- {{ $t("lang.approveComment.submitUser") }}
- </small>
- </h4>
- <h5 class="m-h5">{{ historyProcessInstanceDescription.startTime }}</h5>
- <p class="comment-text">{{ $t("lang.approveComment.submitApprove") }}</p>
- </div>
- </li>
- <template v-if="historyProcessInstanceDescription.historicTaskInstanceDescriptions != undefined">
- <li
- v-for="historicTaskInstanceDescription in historyProcessInstanceDescription.historicTaskInstanceDescriptions"
- :key="historicTaskInstanceDescription.id"
- class="media"
- >
- <div class="media-left">
- <a>
- <AuthImage
- :auth-src="
- Common.getThumbnailImageSrc(
- 'com.leanwo.prodog.base.model.User',
- historicTaskInstanceDescription.assigneeImageUrl
- )
- "
- class="media-object thumbnail m-image"
- />
- </a>
- </div>
- <div class="media-body">
- <h4 class="media-heading">
- {{ historicTaskInstanceDescription.assigneeName }}
- <small class="badge alert-error">{{ historicTaskInstanceDescription.name }}({{
- getTaskCompleteType(historicTaskInstanceDescription.completeReason)
-
- }})</small>
- </h4>
- <div v-if="historicTaskInstanceDescription.comments != undefined">
- <div
- v-for="commentItem in historicTaskInstanceDescription.comments"
- :key="commentItem.id"
- >
- <h5 class="m-h5">{{ commentItem.time }}</h5>
- <p class="comment-text">{{ commentItem.message }}</p>
- </div>
- </div>
- <ApproveTaskAttachmentView :enable-delete="false" :attachments="historicTaskInstanceDescription.attachments" />
- </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';
- import ApproveTaskAttachmentView from './ApproveTaskAttachmentView.vue';
- import { CheckCircleOutlined, SyncOutlined, ClockCircleOutlined, CloseCircleOutlined } from '@ant-design/icons-vue';
- export default {
- components: {
- AuthImage,
- ApproveTaskAttachmentView,
- CheckCircleOutlined, SyncOutlined, ClockCircleOutlined,
- CloseCircleOutlined,
- },
- 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.refreshDebounce();
- },
- processInstanceId: function (currentValue, oldValue) {
- this.refreshDebounce();
- },
- },
- mounted: function () {
- var _self = this;
- this.refreshDebounce = Common.debounce(() => _self.refresh(), 1000);
- this.refreshDebounce();
- },
- 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);
- },
- getTaskCompleteType: function(completeReason){
- if(completeReason == 'APPROVE'){
- return '审批通过';
- }else if(completeReason == 'REJECT'){
- return '审批不通过';
- }else if(completeReason == 'WITHDRAW'){
- return '撤销';
- }else{
- return '未处理';
- }
- },
- },
- };
- </script>
- <style scoped>
- .m-label {
- margin-left: 10px;
- }
- .m-h5 {
- display: inline;
- }
- .m-image {
- width: 64px;
- height: 64px;
- margin-bottom: 0px;
- }
- .m-image1 {
- display: inline !important;
- width: 64px;
- height: 64px;
- cursor: pointer;
- margin-right: 5px;
- }
- .m-media-list{
- margin-bottom: 0px;
- }
- .comment-text{
- margin-bottom: 0px;
- }
- </style>
|