Browse Source

表单编辑器

chenc 3 years ago
parent
commit
b2e52f8e2d
2 changed files with 35 additions and 21 deletions
  1. 27 18
      src/views/activiti/ProcessModelList.vue
  2. 8 3
      src/views/activiti/form/demoForm2.vue

+ 27 - 18
src/views/activiti/ProcessModelList.vue

@@ -651,25 +651,34 @@ export default {
             _this.$message.error('操作失败')
           }
         });
-        return;
-      }
-      
-      if (this.spryTypes.length == 0) {
-        _this.$message.error('必须选择审批人!')
-        return
+      }else{
+        //修改关联表单信息
+        // let where={id:this.spry.tbTableInfoId,isInitial:"1"}
+        // updateTbTableInfo(where).then((res)=>{
+        //   if(res.success){
+        //     _this.$message.success('操作成功')
+        //   }else{
+        //     _this.$message.error('操作失败')
+        //     return;
+        //   }
+        // });
+        if (this.spryTypes.length == 0) {
+          _this.$message.error('必须选择审批人!')
+          return
+        }
+        _this.confirmLoading = true
+        this.spry.nodeId = this.editNode.id
+        this.postFormAction(_this.url.editNodeUser, this.spry)
+          .then(res => {
+            if (res.success) {
+              _this.$message.success('操作成功')
+              // _this.getData();
+            } else {
+              _this.$message.error(res.message)
+            }
+          })
+          .finally(() => (_this.confirmLoading = false))
       }
-      _this.confirmLoading = true
-      this.spry.nodeId = this.editNode.id
-      this.postFormAction(_this.url.editNodeUser, this.spry)
-        .then(res => {
-          if (res.success) {
-            _this.$message.success('操作成功')
-            // _this.getData();
-          } else {
-            _this.$message.error(res.message)
-          }
-        })
-        .finally(() => (_this.confirmLoading = false))
     },
     getNodeData(row) {
       //查询节点关联表单下拉数据

+ 8 - 3
src/views/activiti/form/demoForm2.vue

@@ -30,7 +30,7 @@
         :disabled="disabled||btndisabled"
         @click="handleSubmit"
       >保存</a-button>
-      <a-button style="margin-left: 8px;" :disabled="disabled" @click="close">取消</a-button>
+      <a-button style="margin-left: 8px;" :disabled="disabled||disabled2" @click="close">取消</a-button>
       </div>
     </a-card>
   </div>
@@ -61,6 +61,7 @@ export default {
   },
   data() {
     return {
+      disabled2:false,//用来取决于表单时不同流程节点填写不同表单信息使用
       jsonData: {},
       url: {
         getForm: '/actBusiness/getForm',
@@ -91,13 +92,16 @@ export default {
     if (!this.processData.businessTable) {
       this.processData.businessTable = this.processData.tableName
     }
-    this.getAction('/tbTableInfo/query', { businessTable: this.processData.businessTable }).then(res => {
+    this.getAction('/tbTableInfo/query', { businessTable: this.processData.businessTable ,taskNodeId:this.processData.key}).then(res => {
       this.jsonData = res.result.jsonContent
       // this.$refs.KFB.setData({aaa:null,bbb:null,name:"123"})
       // this.$refs.KFB.getData().then(res => {
       //   console.log('aaa',res)
       // })
-
+      if(res.result.isSave){
+        this.disabled=false;
+        this.btndisabled=false;
+      }
       if (!this.isNew) {
         this.init()
       }
@@ -258,6 +262,7 @@ export default {
               if (res.success) {
                 this.$message.success('保存成功!')
                 this.$emit('afterSubmit', formData)
+                this.$emit('close')
               } else {
                 this.$message.error(res.message)
               }