Browse Source

流程管理功能修改

yanliming 4 years ago
parent
commit
b0c3d62d7b

+ 5 - 1
src/api/workflow/processActivity.js

@@ -41,7 +41,11 @@ function batchRemove(idList) {
   });
 }
 
+function moveActivityOrder(formData) {
+  return request.post(constant.serverUrl + "/workflow/processActivity/moveActivityOrder", formData);
+}
+
 
 export default {
-  create, edit, add, update, remove, batchRemove, pageList
+  create, edit, add, update, remove, batchRemove, pageList,moveActivityOrder
 }

+ 1 - 1
src/views/workflow/processActivity-detail.vue

@@ -197,7 +197,7 @@ export default {
             self.loading = true;
 
             self.formModel.processTemplateId = self.processTemplateId;
-
+            
             if (id == null || id.length == 0) {
               return processActivityApi.add(self.formModel);
             } else {

+ 35 - 4
src/views/workflow/processActivity-list.vue

@@ -63,11 +63,14 @@
               <el-link type="danger" @click="handleDelete(row)">删除</el-link>
             </el-col>
             <el-col :span="6">
-              <el-link v-if="row.activityOrder!=1" type="primary" @click="handleDelete(row)">上移</el-link>
-              <el-link v-else type="primary" @click="handleDelete(row)">上移</el-link>
+              <el-link v-if="row.activityOrder!=1" type="primary" @click="handleUp(row)">
+                上移
+              </el-link>
+              <span v-else>上移</span>
             </el-col>
             <el-col :span="6">
-              <el-link type="primary" @click="handleDelete(row)">下移</el-link>
+              <span v-if="tableData.length==row.activityOrder">下移</span>
+              <el-link v-else type="primary" @click="handleDown(row)">下移</el-link>
             </el-col>
           </el-row>
         </template>
@@ -199,12 +202,13 @@ export default {
     handleAdd() {
       this.modalTitle = "新增";
       this.businessKey = "";
+      this.processTemplateId = this.processTemplateId;
       this.showModal = true;
     },
     handleEdit(record) {
       this.modalTitle = "编辑";
       this.businessKey = record.id;
-      this.processTemplateId = 
+      this.processTemplateId = this.processTemplateId;
       this.showModal = true;
     },
     handleDelete(record) {
@@ -268,6 +272,33 @@ export default {
         this.changePage(this.pageIndex);
       }
     },
+    handleUp(row){
+      var formData = new FormData();
+
+      formData.append("id", row.id);
+      formData.append("isUp", true);
+
+      processActivityApi.moveActivityOrder(formData).then(response => {
+        var jsonData = response.data;
+        if (jsonData.result) {
+          this.changePage(this.pageIndex);
+        }
+      });
+
+    },
+    handleDown(row){
+      var formData = new FormData();
+
+      formData.append("id", row.id);
+      formData.append("isUp", false);
+
+      processActivityApi.moveActivityOrder(formData).then(response => {
+        var jsonData = response.data;
+        if (jsonData.result) {
+            this.changePage(this.pageIndex);
+          }
+      });
+    }
   },
   mounted: function() {
     this.processTemplateId = this.$route.query.processTemplateId;