瀏覽代碼

外部表单再次提交调整

fenghaifu 2 年之前
父節點
當前提交
e984adeadf
共有 1 個文件被更改,包括 27 次插入8 次删除
  1. 27 8
      src/views/activiti/applyList.vue

+ 27 - 8
src/views/activiti/applyList.vue

@@ -332,7 +332,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
 import { filterObj } from '@/utils/util'
 import JEllipsis from '@/components/jeecg/JEllipsis'
-import { deleteAction, getAction, downFile } from '@/api/manage'
+import { deleteAction, getAction, downFile, postAction } from '@/api/manage'
 import pick from 'lodash.pick'
 import JTreeSelect from '@/components/jeecg/JTreeSelect'
 import { initDictOptions, filterDictText } from '@/components/dict/JDictSelectUtil'
@@ -544,10 +544,15 @@ export default {
         this.$message.error('流程定义为空')
         return
       }
-      this.form.id = v.id
-      this.form.procDefId = v.procDefId
-      this.form.title = v.title
-      this.form.routeName = v.routeName;
+      //this.form.id = v.id
+      //this.form.procDefId = v.procDefId
+      //this.form.title = v.title
+      //this.form.routeName = v.routeName;
+      this.form = Object.assign({
+        priority: 0,
+        assignees: [],
+        sendMessage: true
+      }, v);
       // 加载审批人
       this.getAction(this.url.getFirstNode, { procDefId: v.procDefId }).then(res => {
         if (res.success) {
@@ -599,9 +604,21 @@ export default {
       params.assignees = params.assignees.join(',')
       var requestUrl = this.url.applyBusiness;
       if (this.form.routeName != null && this.form.routeName.indexOf("外部表单")>-1){
-        requestUrl = this.url.applyOuterBusiness;
-      }
-      this.postFormAction(requestUrl, params)
+        postAction(this.url.applyOuterBusiness, params)
+            .then(res => {
+              if (res.success) {
+                this.$message.success('操作成功')
+                this.loadData()
+                this.modalVisible = false
+                
+              } else {
+                this.$message.error(res.message)
+                
+              }
+            })
+            .finally(() => (this.submitLoading = false))
+      }else{
+        this.postFormAction(this.url.applyBusiness, params)
         .then(res => {
           if (res.success) {
             this.$message.success('操作成功')
@@ -612,6 +629,8 @@ export default {
           }
         })
         .finally(() => (this.submitLoading = false))
+      }
+      
     },
     edit(r, isView) {
       if (!r.routeName) {