Просмотр исходного кода

调整不同流程重新发起权限控制

cyy 3 месяцев назад
Родитель
Сommit
8f484e651f

+ 7 - 5
src/business/platform/bpmn/form/action.js

@@ -260,24 +260,26 @@ export default {
     /**
      * 处理重新发起数据
      */
-    dealReStartData(data, type) {
+    dealReStartData(data, type, loop = 'out') {
+      const { opinionList } = this.formParams.formOpinionData || {}
       if (type === 'obj') {
         for (const key in data) {
           if (key === 'id') {
             data.id = ''
           } else if (key === 'shiFouGuoShen') {
-            data.shiFouGuoShen = ''
+            data.shiFouGuoShen =
+              loop === 'in' ? '' : '已' + opinionList[1].taskName
           } else if (key === 'tenantId') {
             data.tenantId = ''
           } else if (key === 'parentId') {
             data.parentId = ''
           } else if (Array.isArray(data[key]) && data[key].length > 0) {
-            this.dealReStartData(data[key], 'arr')
+            this.dealReStartData(data[key], 'arr', 'in')
           }
         }
       } else if (type === 'arr') {
         data.forEach((e) => {
-          this.dealReStartData(e, 'obj')
+          this.dealReStartData(e, 'obj', 'in')
         })
       }
     },
@@ -294,7 +296,7 @@ export default {
       } = this.getFormEL() || {}
       if (!formData) return
       if (this.reSign && this.reSign === 'reStart') {
-        this.dealReStartData(formData, 'obj')
+        this.dealReStartData(formData, 'obj', 'out')
       }
       // 暂存后直接提交,已有数据ID
       if (this.$utils.isNotEmpty(this.bizKey)) {

+ 21 - 3
src/business/platform/bpmn/form/index.vue

@@ -315,7 +315,8 @@ export default {
       responseData: {},
       formDataBF: '',
       opinionListBF: '',
-      revocationRestart: false
+      revocationRestart: false,
+      isRestart: 0
     }
   },
   watch: {
@@ -420,9 +421,22 @@ export default {
     /**
      * 流程实例 的表单数据
      */
-    getInstanceFormData() {
+    async getInstanceFormData() {
       this.readonly = true
       this.formParams.instanceId = this.instanceId || null
+      let isRestart = await this.$common.request('query', {
+        key: 'hqsfzqbz',
+        params: [this.instanceId]
+      })
+      this.isRestart =
+        isRestart.variables.data &&
+        isRestart.variables.data[0] &&
+        isRestart.variables.data[0].is_restart
+          ? isRestart.variables.data[0].is_restart === null ||
+            isRestart.variables.data[0].is_restart === ''
+            ? '0'
+            : isRestart.variables.data[0].is_restart
+          : '0'
       getInstFormData({
         instId: this.instanceId
       })
@@ -681,7 +695,11 @@ export default {
           name: '撤回'
         })
       }
-      if (this.extraBtn === 'restart' && this.revocationRestart) {
+      if (
+        this.extraBtn === 'restart' &&
+        this.revocationRestart &&
+        this.isRestart === '1'
+      ) {
         toolbars.push({
           alias: 'restart',
           icon: this.timeModification_