Explorar o código

Merge branch 'master' of http://139.196.39.194:9021/chenc/cd-work-flow-web

jbb %!s(int64=2) %!d(string=hai) anos
pai
achega
085a7bb0f4

+ 30 - 5
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'
@@ -361,6 +361,7 @@ export default {
         applyBusiness: '/actBusiness/apply',
         cancelApply: '/actBusiness/cancel',
         outformViewUrl:"/actBusiness/external/getViewUrl",
+        applyOuterBusiness: '/actBusiness/external/apply',
       },
       // 查询条件
       queryParam: {
@@ -543,9 +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.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) {
@@ -595,7 +602,23 @@ export default {
       this.submitLoading = true
       var params = Object.assign({}, this.form)
       params.assignees = params.assignees.join(',')
-      this.postFormAction(this.url.applyBusiness, params)
+      var requestUrl = this.url.applyBusiness;
+      if (this.form.routeName != null && this.form.routeName.indexOf("外部表单")>-1){
+        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('操作成功')
@@ -606,6 +629,8 @@ export default {
           }
         })
         .finally(() => (this.submitLoading = false))
+      }
+      
     },
     edit(r, isView) {
       if (!r.routeName) {

+ 6 - 1
src/views/process-center/applyListOuter.vue

@@ -25,7 +25,12 @@ export default {
         
     },
     mounted(){
-        window.startApply = this.startApply;
+        //window.startApply = this.startApply;
+        window.addEventListener('message',({data})=>{
+            if (data.msg == "startApply"){
+                this.startApply(data.data);
+            }
+        })
     },
     methods:{
         loadSrc(){

+ 0 - 6
src/views/system/RoleUserList.vue

@@ -79,9 +79,6 @@
                     <a>删除</a>
                   </a-popconfirm>
                 </a-menu-item>
-                <a-menu-item>
-                  <a @click="handleApply(record)">发起审批</a>
-                </a-menu-item>
               </a-menu>
             </a-dropdown>
         </span>
@@ -534,9 +531,6 @@
       handlePerssion(roleId){
         this.$refs.modalUserRole.show(roleId);
       },
-      handleApply(record){
-        window.parent.startApply({type:"角色申请",id:record.id});
-      },
     }
   }
 </script>