瀏覽代碼

工作流+自定义表单

姚斌 1 年之前
父節點
當前提交
af4a057097

+ 2 - 0
itdmWeb/package.json

@@ -90,6 +90,8 @@
       "plugin:vue/strongly-recommended",
       "@vue/standard"
     ],
+
+
     "parserOptions": {
       "parser": "babel-eslint"
     },

+ 3 - 1
itdmWeb/src/views/activiti/ActivitiCommonModel.vue

@@ -167,8 +167,10 @@ export default {
       let p = {};
       p.procKey = this.currentKey;
       p.businessKey = '1';
-      p.formData = JSON.stringify(this.editData);
+      p.formData = JSON.stringify(this.jsonData);
+      p.formDataValue = JSON.stringify(this.editData);
       getModelList(this.url.rs, p).then(res => {
+        this.$message.success(res.message);
         this.visiblejson = false;
         //console.log('查询数据', res);
         this.loading = false;

+ 102 - 5
itdmWeb/src/views/activiti/ActivitiDaibanList.vue

@@ -41,6 +41,43 @@
       <activiti-file-model ref="ativitiFileModel" ></activiti-file-model>
       <pic-form1 ref="picForm" @ok="modalFormOk" ></pic-form1>
     </a-card>
+
+    <a-modal
+      title="表单详情"
+      :visible="visible"
+      :confirm-loading="confirmLoading"
+    >
+      <template slot="footer">
+        <a-button @click="handleCancel">驳回</a-button>
+        <a-button type="primary" @click="handleOk">通过</a-button>
+      </template>
+      <template v-for="l in circleData">
+        <div style="pointer-events: none">
+          <fm-generate-form
+            :data="l.formData"
+            :value="l.fillData"
+          >
+          </fm-generate-form>
+        </div>
+      </template>
+
+      <template>
+        <div style="margin-top: 80px">
+          <fm-generate-form
+            @on-change="mychangeValue"
+            :data="myjsonData"
+            :value="myeditData"
+          >
+          </fm-generate-form>
+        </div>
+        <el-input style="margin-bottom: 30px"
+                  type="textarea"
+                  :rows="2"
+                  placeholder="请输入评论"
+                  v-model="mycomment">
+        </el-input>
+      </template>
+    </a-modal>
   </div>
 
 </template>
@@ -129,13 +166,24 @@ import {getAction, deleteAction, banli, postAction} from '@/api/manage'
           convertToModel: '/act/reprocdef/convertToModel',
           updateHandle: '/act/reprocdef/update',
           banli: '/service/completeTask',
-          banlijson: '/service/getTaskInfo'
+          banlijson: '/service/getTaskInfo',
+          countineBl: '/service/act/completeTask',
+          bohui: '/service/act/rejected'
         },
         queryParam: {
           category: '',
           key: '',
           name: ''
-        }
+        },
+        visible: false,
+        confirmLoading: false,
+        jsonData: {},
+        editData: {},
+        myjsonData: {},
+        myeditData: {},
+        mycomment: '',
+        currentRecord: {},
+        circleData: [],
        }
     },
    created() {
@@ -156,12 +204,61 @@ import {getAction, deleteAction, banli, postAction} from '@/api/manage'
        //     this.$message.warning(res.msg);
        //   }
        // })
-       banli(this.url.banlijson+"/"+record.executionId+"/"+record.taskId).then(res => {
-         console.log('转为模型', res)
+       this.currentRecord = record;
+       banli(this.url.banlijson+"/"+record.processInstanceId+"/"+record.taskId).then(res => {
+         //console.log('转为模型', res)
+         if (res.code == 200) {
+           //this.$message.success(res.msg);
+           //console.log('------转为模型', res.result.fromData2)
+           this.circleData = res.result.fromData1;
+           for (let i = 0; i < this.circleData.length; i++) {
+             this.circleData[i].fillData = JSON.parse(this.circleData[i].value.split('###')[1]);
+             this.circleData[i].formData = JSON.parse(this.circleData[i].value.split('###')[0]);
+           }
+           //console.log('----------------转为模型', this.circleData[0].formData)
+           this.myjsonData = JSON.parse(res.result.fromData2);
+
+           this.visible = true;
+         } else {
+           //this.$message.warning(res.msg);
+         }
+       })
+     },
+     mychangeValue(field,value,data){
+       this.myeditData = data;
+     },
+     handleOk(e) {
+       this.visible = false;
+       let p = {};
+       p.taskId = this.currentRecord.taskId;
+       p.comment = this.mycomment;
+       p.formData = this.myjsonData;
+       p.formDataValue = this.myeditData;
+       p.excutionId= this.currentRecord.executionId;
+       banli(this.url.countineBl,p).then(res => {
+         //console.log('转为模型', res);
+         this.searchQuery();
+         if (res.code == 0) {
+           this.$message.success(res.msg);
+           //console.log('------转为模型', res.result.fromData2)
+         } else {
+           //this.$message.warning(res.msg);
+         }
+       })
+     },
+     handleCancel(e) {
+       this.visible = false;
+       let p = {};
+       p.taskId = this.currentRecord.taskId;
+       p.comment = this.mycomment;
+       banli(this.url.bohui,p).then(res => {
+         //console.log('转为模型', res);
+         this.searchQuery();
          if (res.code == 0) {
            this.$message.success(res.msg);
+           //console.log('------转为模型', res.result.fromData2)
          } else {
-           this.$message.warning(res.msg);
+           //this.$message.warning(res.msg);
          }
        })
      },

+ 2 - 2
itdmWeb/src/views/activiti/ActivitiList.vue

@@ -163,8 +163,8 @@
      // 导出
      exportHandle(id) {
        let apiBaseUrl = window._CONFIG['domianURL'] || '/tcore-boot'
-       let url = apiBaseUrl + '/act/remodel/export?id=' + id
-       window.open(url)
+       let url = apiBaseUrl + '/act/remodel/export?modelId=' + id
+       window.open(url);
      },
      openModeler(row) {
           this.$refs.activitiModel.openModel(row)