lex преди 2 години
родител
ревизия
1ab998c277
променени са 5 файла, в които са добавени 246 реда и са изтрити 62 реда
  1. 43 27
      src/api/process/admin/process.js
  2. 136 1
      src/views/process/admin/process-manager.vue
  3. 20 20
      src/views/process/list/all.vue
  4. 44 12
      src/views/process/list/components/search/index.vue
  5. 3 2
      vue.config.js

+ 43 - 27
src/api/process/admin/process.js

@@ -1,63 +1,79 @@
-import request from '@/utils/request'
+import request from "@/utils/request";
 
 // 创建流程
 export function createProcess(data) {
   return request({
-    url: '/api-oa/api/v1/process',
-    method: 'post',
-    data
-  })
+    url: "/api-oa/api/v1/process",
+    method: "post",
+    data,
+  });
 }
 
 // 流程列表
 export function processList(params) {
   return request({
-    url: '/api-oa/api/v1/process',
-    method: 'get',
-    params
-  })
+    url: "/api-oa/api/v1/process",
+    method: "get",
+    params,
+  });
 }
 
 // 更新流程
 export function updateProcess(data) {
   return request({
-    url: '/api-oa/api/v1/process',
-    method: 'put',
-    data
-  })
+    url: "/api-oa/api/v1/process",
+    method: "put",
+    data,
+  });
 }
 
 // 删除流程
 export function deleteProcess(params) {
   return request({
-    url: '/api-oa/api/v1/process',
-    method: 'delete',
-    params
-  })
+    url: "/api-oa/api/v1/process",
+    method: "delete",
+    params,
+  });
 }
 
 // 流程详情
 export function processDetails(params) {
   return request({
-    url: '/api-oa/api/v1/process/details',
-    method: 'get',
-    params
-  })
+    url: "/api-oa/api/v1/process/details",
+    method: "get",
+    params,
+  });
 }
 
 // 分类流程列表
 export function classifyProcessList(params) {
   return request({
-    url: '/api-oa/api/v1/process/classify',
-    method: 'get',
-    params
-  })
+    url: "/api-oa/api/v1/process/classify",
+    method: "get",
+    params,
+  });
 }
 
 // 克隆流程
 export function cloneProcess(id) {
   return request({
     url: `/api-oa/api/v1/process/clone/${id}`,
-    method: 'post'
-  })
+    method: "post",
+  });
+}
+
+// 流程状态
+export function statusProcess(status, id) {
+  return request({
+    url: `/api-oa/api/v1/process/status?status=${status}&processId=${id}`,
+    method: "put",
+  });
+}
+
+// 排序
+export function sortProcess(sortNo, id) {
+  return request({
+    url: `/api-oa/api/v1/process/sort?sortNo=${sortNo}&processId=${id}`,
+    method: "put",
+  });
 }

+ 136 - 1
src/views/process/admin/process-manager.vue

@@ -17,6 +17,20 @@
             @keyup.enter.native="handleQuery"
           />
         </el-form-item>
+        <el-form-item label="流程状态">
+          <el-select v-model="listQuery.status" clearable>
+            <el-option :label="'启用'" :value="1"></el-option>
+            <el-option :label="'停用'" :value="0"></el-option>
+          </el-select>
+          <!-- <el-input
+            v-model="listQuery.name"
+            placeholder="请输入流程名称"
+            clearable
+            size="small"
+            style="width: 240px"
+            @keyup.enter.native="handleQuery"
+          /> -->
+        </el-form-item>
         <el-form-item>
           <el-button
             type="primary"
@@ -68,7 +82,7 @@
         @selection-change="handleSelectionChange"
       >
         <el-table-column type="selection" width="55" align="center" />
-        <el-table-column label="ID" prop="id" width="120" />
+        <el-table-column label="ID" prop="id" width="60" />
         <el-table-column
           label="名称"
           prop="name"
@@ -93,12 +107,47 @@
           width="180"
         />
         <el-table-column
+          label="排序"
+          align="center"
+          prop="sort_no"
+          width="80"
+        />
+        <el-table-column
+          label="流程状态"
+          align="center"
+          prop="status"
+          width="100"
+        >
+          <template slot-scope="scope">
+            <el-tag type="succes" v-if="scope.row.status">启用</el-tag>
+            <el-tag type="danger" v-else>停用</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column
           label="操作"
           align="center"
           class-name="small-padding fixed-width"
         >
           <template slot-scope="scope">
             <el-button
+              v-permisaction="['process:admin:manager:actionstop']"
+              size="mini"
+              type="text"
+              :icon="
+                scope.row.status ? 'el-icon-video-play' : 'el-icon-video-pause'
+              "
+              @click="handleStatus(scope.row)"
+              >{{ scope.row.status ? "停用" : "启用" }}</el-button
+            >
+            <el-button
+              v-permisaction="['process:admin:manager:sort']"
+              size="mini"
+              type="text"
+              icon="el-icon-sort"
+              @click="handleSort(scope.row)"
+              >排序</el-button
+            >
+            <el-button
               v-permisaction="['process:admin:manager:clone']"
               size="mini"
               type="text"
@@ -275,6 +324,39 @@
           </div>
         </div>
       </el-drawer>
+
+      <el-dialog :title="'排序'" :visible.sync="sortOpen" width="400px">
+        <div class="tpl-create-content">
+          <el-form ref="sortRuleForm" :model="sortRuleForm" label-width="80px">
+            <el-form-item
+              label="排序值"
+              prop="sortNo"
+              :rules="[
+                {
+                  required: true,
+                  message: '请输入排序值',
+                },
+              ]"
+              style="width: 95%"
+            >
+              <!-- <el-input v-model="ruleForm.name" /> -->
+              <el-input-number
+                v-model="sortRuleForm.sortNo"
+                controls-position="right"
+                :min="0"
+                :max="10000"
+                style="width: 100%"
+              ></el-input-number>
+            </el-form-item>
+          </el-form>
+          <div slot="footer" class="dialog-footer" style="text-align: right">
+            <el-button type="primary" @click="handleFormSort('sortRuleForm')"
+              >提交</el-button
+            >
+            <el-button @click="sortOpen = false">取 消</el-button>
+          </div>
+        </div>
+      </el-dialog>
     </el-card>
   </div>
 </template>
@@ -287,6 +369,8 @@ import {
   processDetails,
   deleteProcess,
   cloneProcess,
+  statusProcess,
+  sortProcess,
 } from "@/api/process/admin/process";
 import SaveForm from "@/components/save-form";
 import { classifyList } from "@/api/process/admin/classify";
@@ -334,6 +418,7 @@ export default {
       dialogProcessVisibleName: 1,
       processValueList: [],
       listQuery: {
+        status: null,
         page: 1,
         per_page: 10,
       },
@@ -354,6 +439,11 @@ export default {
           { required: true, message: "请输入流程描述", trigger: "blur" },
         ],
       },
+      sortOpen: false,
+      sortRuleForm: {
+        id: null,
+        sortNo: 0,
+      },
     };
   },
   mounted() {
@@ -505,6 +595,15 @@ export default {
         this.wfdDesignRefresh = true;
       });
     },
+    async handleSort(row) {
+      try {
+        this.sortOpen = true;
+        this.sortRuleForm.id = row.id;
+        this.sortRuleForm.sortNo = row.sort_no;
+      } catch {
+        //
+      }
+    },
     async handleEdit(row) {
       this.dialogProcessVisibleName = 2;
       load.startLoading();
@@ -533,6 +632,25 @@ export default {
       });
       this.open = true;
     },
+    handleFormSort(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          console.log(valid);
+          sortProcess(this.sortRuleForm.sortNo, this.sortRuleForm.id).then(
+            (res) => {
+              if (res.code == 200) {
+                this.sortOpen = false;
+                this.getList();
+                this.$message({
+                  type: "success",
+                  message: "更新成功",
+                });
+              }
+            }
+          );
+        }
+      });
+    },
     handleClose(done) {
       this.$confirm("确认关闭?")
         .then((_) => {
@@ -715,6 +833,23 @@ export default {
         this.ruleForm.form_structure = "";
       }
     },
+    handleStatus(row) {
+      const str = row.status ? "停用" : "启用";
+      this.$confirm(`是否${str}流程 < ${row.name} > ?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "info",
+      }).then(() => {
+        const status = row.status ? 0 : 1;
+        statusProcess(status, row.id).then(() => {
+          this.getList();
+          this.$message({
+            type: "success",
+            message: `流程已${str}!`,
+          });
+        });
+      });
+    },
     handleClone(row) {
       this.$confirm(`确认克隆流程 < ${row.name} > ?`, "提示", {
         confirmButtonText: "确定",

+ 20 - 20
src/views/process/list/all.vue

@@ -181,7 +181,7 @@ import {
   workOrderList,
   unityWorkOrder,
   inversionWorkOrder,
-  deleteWorkOrder
+  deleteWorkOrder,
 } from "@/api/process/work-order";
 import { listUser } from "@/api/system/sysuser";
 import TransferInversion from "./model/transferInversion";
@@ -202,14 +202,14 @@ export default {
       ticketList: [],
       listQuery: {
         page: 1,
-        per_page: 10
+        per_page: 10,
       },
       selectItem: {
         work_order_id: "",
         node_id: null,
         nodeList: [],
-        users: []
-      }
+        users: [],
+      },
     };
   },
   mounted() {
@@ -221,7 +221,7 @@ export default {
       this.listQuery.page = this.queryParams.pageIndex;
       this.listQuery.per_page = this.queryParams.pageSize;
       this.listQuery.classify = 4;
-      workOrderList(this.listQuery).then(response => {
+      workOrderList(this.listQuery).then((response) => {
         this.ticketList = response.data.data;
         this.queryParams.pageIndex = response.data.page;
         this.queryParams.pageSize = response.data.per_page;
@@ -240,7 +240,7 @@ export default {
     handleView(row) {
       this.$router.push({
         name: "ProcessListHandle",
-        query: { workOrderId: row.id, processId: row.process }
+        query: { workOrderId: row.id, processId: row.process },
       });
     },
     handleLookContract(row) {
@@ -254,13 +254,13 @@ export default {
       this.$confirm("此操作将删除该数据, 是否继续?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       })
         .then(() => {
-          deleteWorkOrder(row.id).then(response => {
+          deleteWorkOrder(row.id).then((response) => {
             this.$message({
               type: "success",
-              message: "删除成功!"
+              message: "删除成功!",
             });
             this.getList();
           });
@@ -268,7 +268,7 @@ export default {
         .catch(() => {
           this.$message({
             type: "info",
-            message: "已取消"
+            message: "已取消",
           });
         });
     },
@@ -276,12 +276,12 @@ export default {
       this.$confirm("此操作将会结束该工单, 是否继续?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       })
         .then(() => {
           unityWorkOrder({
-            work_oroder_id: row.id
-          }).then(response => {
+            work_oroder_id: row.id,
+          }).then((response) => {
             if (response.code === 200) {
               this.getList();
             }
@@ -290,7 +290,7 @@ export default {
         .catch(() => {
           this.$message({
             type: "info",
-            message: "已取消"
+            message: "已取消",
           });
         });
     },
@@ -303,8 +303,8 @@ export default {
       if (this.selectItem.users.length <= 0) {
         load.startLoading();
         await listUser({
-          pageSize: 999999
-        }).then(response => {
+          pageSize: 999999,
+        }).then((response) => {
           this.selectItem.users = response.data.list;
         });
         load.endLoading();
@@ -314,9 +314,9 @@ export default {
     },
     handleSelectionChange() {},
     submitForm(formName) {
-      this.$refs[formName].validate(valid => {
+      this.$refs[formName].validate((valid) => {
         if (valid) {
-          inversionWorkOrder(this.ruleForm).then(response => {
+          inversionWorkOrder(this.ruleForm).then((response) => {
             if (response.code === 200) {
               this.getList();
               this.dialogVisible = false;
@@ -324,8 +324,8 @@ export default {
           });
         }
       });
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 44 - 12
src/views/process/list/components/search/index.vue

@@ -34,6 +34,30 @@
     </el-form-item>
     <el-form-item>
       <el-select
+        v-model="listQuery.processId"
+        placeholder="请选择流程"
+        size="small"
+        clearable
+        style="width: 150px"
+        @change="getList"
+      >
+        <el-option-group
+          v-for="group in classifyList"
+          :key="group.id"
+          :label="group.name"
+        >
+          <el-option
+            v-for="item in group.process_list"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          >
+          </el-option>
+        </el-option-group>
+      </el-select>
+    </el-form-item>
+    <el-form-item>
+      <el-select
         v-model="listQuery.priority"
         placeholder="请选择优先级"
         size="small"
@@ -102,6 +126,7 @@
 
 <script>
 import { listUser } from "@/api/system/sysuser";
+import { classifyProcessList } from "@/api/process/admin/process";
 
 import { parseTime } from "@/utils";
 export default {
@@ -112,6 +137,7 @@ export default {
     return {
       loading: false,
       timeValue: "",
+      classifyList: [],
       listQuery: {},
       UserOptions: [],
       pickerOptions: {
@@ -123,7 +149,7 @@ export default {
               const start = new Date();
               start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
               picker.$emit("pick", [start, end]);
-            }
+            },
           },
           {
             text: "最近一个月",
@@ -132,7 +158,7 @@ export default {
               const start = new Date();
               start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
               picker.$emit("pick", [start, end]);
-            }
+            },
           },
           {
             text: "最近三个月",
@@ -141,14 +167,15 @@ export default {
               const start = new Date();
               start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
               picker.$emit("pick", [start, end]);
-            }
-          }
-        ]
-      }
+            },
+          },
+        ],
+      },
     };
   },
   created() {
-    // console.log(this.list, "child component");
+    this.getClassesList();
+    console.log(this.list, "child component");
     this.listQuery = { ...this.list };
     if (this.listQuery.startTime && this.listQuery.endTime) {
       this.timeValue = [this.listQuery.startTime, this.listQuery.endTime];
@@ -174,7 +201,7 @@ export default {
       }
       // 处理显示用户名
       if (this.listQuery.processor) {
-        this.UserOptions.forEach(item => {
+        this.UserOptions.forEach((item) => {
           if (this.listQuery.processor == item.userId) {
             this.listQuery.processorName = item.nickName;
           }
@@ -188,12 +215,17 @@ export default {
     remoteUserList(query) {
       listUser({
         pageSize: 999999,
-        nickName: query
-      }).then(res => {
+        nickName: query,
+      }).then((res) => {
         this.UserOptions = res.data.list;
       });
-    }
-  }
+    },
+    getClassesList() {
+      classifyProcessList().then((res) => {
+        this.classifyList = res.data || [];
+      });
+    },
+  },
 };
 </script>
 

+ 3 - 2
vue.config.js

@@ -16,7 +16,8 @@ const name = defaultSettings.title || "ferry"; // page title
 const port = process.env.port || process.env.npm_config_port || 9527; // dev port
 
 const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
-const target = "https://manonline.dayaedu.com";
+// const target = "https://manonline.dayaedu.com";
+const target = "http://mantest.dayaedu.com";
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
   /**
@@ -50,7 +51,7 @@ module.exports = {
       "/api-auth": {
         target: target,
         // target : target,
-        changeOrigin: true,
+        // changeOrigin: true,
         pathRewrite: {
           "^api-auth": "",
         },