Browse Source

已经撤回的单据需要显示审批的信息

YangZhiJie 2 năm trước cách đây
mục cha
commit
89c169de82

+ 2 - 5
src/common/Common.js

@@ -296,13 +296,10 @@ export default {
   getRedirectUrl: function (url) {
     var href = window.location.href;
     if (href.indexOf('pcapp') >= 0) {
-      return this.getRootPath() + '/pcapp/' + url;
+      return this.getHostPageBaseURL() + '/pcapp/' + url;
     } else {
-      return this.getRootPath() + '/' + url;
+      return this.getHostPageBaseURL() + '/' + url;
     }
   },
-
- 
-
 };
 

+ 2 - 2
src/dashboard/Dashboard.vue

@@ -84,13 +84,13 @@ export default defineComponent({
           const componentName = item.componentName;
 
           if (item.cssUrl != null && item.cssUrl != undefined) {
-            CssUtil.dynamicLoadCss(item.cssUrl, componentName);
+            CssUtil.dynamicLoadCss(Common.getHostPageBaseURL() + item.cssUrl, componentName);
           }
 
           let jsUrl = null;
           if (item.jsUrl != null && item.jsUrl != undefined) {
             jsUrl = item.jsUrl;
-            let promise = JsUtil.dynamicLoadJsModule(jsUrl);
+            let promise = JsUtil.dynamicLoadJsModule(Common.getHostPageBaseURL() + jsUrl);
             promise.then(
               remoteComponent => {
                 console.log('remoteComponent:' + remoteComponent.default.name);

+ 3 - 0
src/locales/en-US.json

@@ -197,6 +197,9 @@
           "remove": "Remove", 
           "submit": "Submit"
       }, 
+      "historyApproveComment": {
+        "title": "Historical approval records"
+      },
       "approveComment": {
           "approveStatus": "Approve Status", 
           "processing": "Processing", 

+ 3 - 0
src/locales/zh-CN.json

@@ -201,6 +201,9 @@
       "remove": "删除",
       "submit": "提交审批"
     },
+    "historyApproveComment": {
+      "title": "历史审批记录"
+    },
     "approveComment": {
       "approveStatus": "审批状态",
       "processing": "审批中",

+ 9 - 0
src/window/tabFormView/TabFormEdit.vue

@@ -232,6 +232,13 @@
       </div>
     </div>
 
+    <!-- 历史审批记录 -->
+    <div v-if="modelData != null" class="row clearfix">
+      <div class="col-md-12">
+        <HistoryApproveComment :record-id="modelData.id" :process-instance-id="processInstanceId" />        
+      </div>
+    </div>
+
     <Modal v-model:show="modal1">
       <div>
         {{ $t("lang.tabFormEdit.validateError", { errorCount: errorCount, errorMsg: errorMsg, }) }}
@@ -273,6 +280,7 @@ import AttachmentPanel from '../attachment/AttachmentPanel.vue';
 
 import AttributePanel from '../attribute/AttributePanel.vue';
 import ApproveComment from '../../workflow/ApproveComment.vue';
+import HistoryApproveComment from '../../workflow/HistoryApproveComment.vue';
 
 import DataRecoveryResource from '../../api/base/DataRecoveryResource.js';
 import JsUtil from '../../common/JsUtil.js';
@@ -287,6 +295,7 @@ export default {
     AttachmentPanel,
     AttributePanel,
     ApproveComment,
+    HistoryApproveComment,
   },
 
   /**

+ 10 - 0
src/window/tabFormView/TabFormView.vue

@@ -273,6 +273,14 @@
       </div>
     </div>
 
+    
+    <!-- 历史审批记录 -->
+    <div v-if="modelData != null" class="row clearfix">
+      <div class="col-md-12">
+        <HistoryApproveComment :record-id="modelData.id" :process-instance-id="processInstanceId" />      
+      </div>
+    </div>
+
     <div
       v-if="
         window != null &&
@@ -364,6 +372,7 @@ import { Notify, Uuid } from 'pc-component-v3';
 import TraceComment from './CurdWindowComment.vue';
 import TraceCommentCreate from './CurdWindowCommentCreate.vue';
 import NotificationPanel from '../../customer/NotificationPanel.vue';
+import HistoryApproveComment from '../../workflow/HistoryApproveComment.vue';
 
 export default {
 
@@ -382,6 +391,7 @@ export default {
     TraceComment,
     TraceCommentCreate,
     NotificationPanel,
+    HistoryApproveComment,
   },
 
   data: function () {

+ 1 - 127
src/workflow/ApproveComment.vue

@@ -189,133 +189,7 @@
           </div>
         </div>
 
-        <ul
-          v-for="item in processInstanceDescription.historyProcessInstanceDescriptions"
-          :key="item.id"
-          class="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") }}
-                  ({{ $t("lang.approveComment.abandon") }})
-                </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 }}({{
-                    $t("lang.approveComment.abandon")
-                  }})</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 processInstanceDescription.activeTaskDescriptions" :key="activeTask.id">
-            <li
-            
-              v-if="processInstanceDescription.activeTaskDescriptions != 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 }}({{
-                    $t("lang.approveComment.abandon")
-                  }})</small>
-                </h4>
-                <h5 class="m-h5">{{ activeTask.startTime }}</h5>
-                <p>{{ $t("lang.approveComment.processing") }}</p>
-              </div>
-            </li>
-          </template>
-        </ul>
+        
 
         <ul class="media-list">
           <li class="media">

+ 303 - 0
src/workflow/HistoryApproveComment.vue

@@ -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>

+ 10 - 1
src/workflow/ReportApprove.vue

@@ -146,6 +146,14 @@
       />
     </div>
   </div>
+
+  
+  <!-- 历史审批记录 -->
+  <div v-if="modelData != null" class="row clearfix">
+    <div class="col-md-12">
+      <HistoryApproveComment :record-id="modelData.id" :process-instance-id="processInstanceId" />        
+    </div>
+  </div>
   
 
   <div
@@ -179,12 +187,13 @@ import AttachmentPanel from '../window/attachment/AttachmentPanel.vue';
 import Language from '../common/Language.js';
 import { Notify } from 'pc-component-v3';
 import WorkflowResource from '../api/workflow/WorkflowResource.js';
+import HistoryApproveComment from './HistoryApproveComment.vue';
 
 
 export default {
 
   components: {
-    WorkflowUserDefine, WorkflowSelectUser, ApproveComment,TabFormFieldView,SubTabGridEdit,TabButton,FormFieldDef,AttachmentPanel,
+    WorkflowUserDefine, WorkflowSelectUser, ApproveComment,TabFormFieldView,SubTabGridEdit,TabButton,FormFieldDef,AttachmentPanel,HistoryApproveComment,
   },
 
   data: function(){