|
@@ -0,0 +1,252 @@
|
|
|
+<!--
|
|
|
+ * @Author: zwy
|
|
|
+ * @Date: 2021-01-30 16:14:28
|
|
|
+ * @LastEditors: zwy
|
|
|
+ * @LastEditTime: 2021-04-27 11:09:07
|
|
|
+ * @Descripttion: 工作流管理
|
|
|
+-->
|
|
|
+<template>
|
|
|
+ <div class="workflow">
|
|
|
+ <div class="flow-content">
|
|
|
+ <div class="search">
|
|
|
+ <el-input placeholder="请输入流程名称" class="search-input" v-model.trim="mixins_query.name"></el-input>
|
|
|
+ <el-button type="primary" placeholder="状态" class="search-btn" @click="mixins_search" icon="el-icon-search"
|
|
|
+ >查询
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ <div class="search-icon">
|
|
|
+ <el-tooltip class="item" effect="light" placement="bottom" content="新增">
|
|
|
+ <i class="iconfont" @click="addOrEdit('add')"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <zz-table
|
|
|
+ :cols="cols"
|
|
|
+ :settings="{ showIndex: true }"
|
|
|
+ :pageset="mixins_pageset"
|
|
|
+ @page-change="pageChange"
|
|
|
+ :data="mixins_list"
|
|
|
+ :loading="mixins_onQuery"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope" slot="status">
|
|
|
+ <p v-if="scope.row.processStatus == 2">启用</p>
|
|
|
+ <p v-else style="color: #d8d8d8">未启用</p>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope" slot="opt">
|
|
|
+ <div class="opt">
|
|
|
+ <el-tooltip effect="light" placement="bottom" content="设计">
|
|
|
+ <i class="zoniot_font zoniot-icon-liucheng1" @click="workflowSetting(scope.index)"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip effect="light" placement="bottom" content="部署">
|
|
|
+ <i class="zoniot_font zoniot-icon-fabu1" @click="dispose(scope.row.id)"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip effect="light" placement="bottom" content="编辑">
|
|
|
+ <i class="zoniot_font zoniot-icon-bianji" @click="addOrEdit('edit', scope.index)"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip effect="light" placement="bottom" content="删除">
|
|
|
+ <i class="zoniot_font zoniot-icon-shanchu redText" @click="deleteOne(scope.row.id)"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </zz-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+var taskTypeList = [];
|
|
|
+import list from '@utils/list.js';
|
|
|
+export default {
|
|
|
+ mixins: [list],
|
|
|
+ name: 'flowManagement',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ currentId: '',
|
|
|
+ cols: [
|
|
|
+ {
|
|
|
+ label: '名称',
|
|
|
+ prop: 'processName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '描述',
|
|
|
+ prop: 'processDesc'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '业务类型',
|
|
|
+ prop: 'businessType',
|
|
|
+ format(val) {
|
|
|
+ let arr = ['', '安保巡更', '设备巡检', '运维工单'];
|
|
|
+ return arr[val];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '任务类型',
|
|
|
+ prop: 'taskType',
|
|
|
+ format(val) {
|
|
|
+ let typeName = '',
|
|
|
+ isObj = taskTypeList.filter((item) => item.dictCode == val)[0];
|
|
|
+ if (!!isObj) {
|
|
|
+ typeName = isObj.dictValue;
|
|
|
+ }
|
|
|
+ return typeName;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '创建时间',
|
|
|
+ prop: 'dateCreate'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '状态',
|
|
|
+ slot: 'status'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '操作',
|
|
|
+ width: 200,
|
|
|
+ slot: 'opt'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 流程设计
|
|
|
+ workflowSetting(index) {
|
|
|
+ new Promise((resolve) => {
|
|
|
+ let row;
|
|
|
+ row = this.mixins_list[index] || {};
|
|
|
+ this.$store.dispatch('openModal', {
|
|
|
+ url: '/flow/popups/workflowsetting.vue',
|
|
|
+ title: row.processName,
|
|
|
+ width: '1500px',
|
|
|
+ height: '806px',
|
|
|
+ notip: true,
|
|
|
+ props: {
|
|
|
+ data: row,
|
|
|
+ // todo: todo,
|
|
|
+ callback: resolve
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }).then(() => {
|
|
|
+ this.mixins_search();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ currentOrganId(data) {
|
|
|
+ this.currentId = data || '';
|
|
|
+ },
|
|
|
+ addOrEdit(todo, index) {
|
|
|
+ new Promise((resolve) => {
|
|
|
+ let row,
|
|
|
+ title = '编辑流程';
|
|
|
+ if ('add' == todo) {
|
|
|
+ title = '新增流程';
|
|
|
+ } else {
|
|
|
+ row = this.mixins_list[index] || {};
|
|
|
+ row = JSON.parse(JSON.stringify(row));
|
|
|
+ }
|
|
|
+ this.$store.dispatch('openModal', {
|
|
|
+ url: '/flow/popups/AddOrEdit.vue',
|
|
|
+ title: title,
|
|
|
+ width: todo == 'add' ? '800px' : '500px',
|
|
|
+ height: '480px',
|
|
|
+ props: {
|
|
|
+ data: row,
|
|
|
+ todo: todo,
|
|
|
+ callback: resolve
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }).then(() => {
|
|
|
+ this.mixins_search();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ deleteOne(id) {
|
|
|
+ this.$msgBox(`刪除流程`, '删除后将无法恢复,请问是否继续?')
|
|
|
+ .then(() => {
|
|
|
+ this.$http.delete('/sc-community/workflow/process/delete', { id }).then(({ msg, status, data }) => {
|
|
|
+ if (status == 0) {
|
|
|
+ this.$message.success(msg);
|
|
|
+ this.mixins_search();
|
|
|
+ } else {
|
|
|
+ this.$message.error(msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ dispose(id) {
|
|
|
+ this.$http.get('/sc-community/workflow/process/deploy', { id }).then(({ msg, status, data }) => {
|
|
|
+ if (status == 0) {
|
|
|
+ this.$message.success(msg);
|
|
|
+ this.mixins_search();
|
|
|
+ } else {
|
|
|
+ this.$message.error(msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取工单,任务类型
|
|
|
+ getWorkList() {
|
|
|
+ this.$api.common.getDictionaryData('SC_SECURITY_PATROL ').then(({ msg, status, data }) => {
|
|
|
+ if (status == 0) {
|
|
|
+ let item = data;
|
|
|
+ this.$api.common.getDictionaryData('SC_EQUIPMENT_INSPECTION').then(({ msg, status, data }) => {
|
|
|
+ if (status == 0) {
|
|
|
+ taskTypeList = item.concat(data);
|
|
|
+ this.$api.common.getDictionaryData('SC_WORK_ORDER_TYPE').then(({ msg, status, data }) => {
|
|
|
+ if (status == 0) {
|
|
|
+ taskTypeList = taskTypeList.concat(data);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ currentId(newValue, oldValue) {
|
|
|
+ this.mixins_query.comunityId = newValue;
|
|
|
+ this.mixins_search();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getWorkList();
|
|
|
+ this.mixins_dataUrl = '/sc-community/workflow/process/getPage';
|
|
|
+ this.mixins_post = 'get';
|
|
|
+ this.mixins_query = {
|
|
|
+ name: '',
|
|
|
+ comunityId: ''
|
|
|
+ };
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.workflow {
|
|
|
+ // display: flex;
|
|
|
+ height: 100%;
|
|
|
+ .flow-content {
|
|
|
+ margin-left: 20px;
|
|
|
+ width: calc(100% - 280px);
|
|
|
+ float: left;
|
|
|
+ .search {
|
|
|
+ background: #ffffff;
|
|
|
+ height: 60px;
|
|
|
+ padding: 16px 20px 14px 20px;
|
|
|
+ .search-icon {
|
|
|
+ vertical-align: top;
|
|
|
+ float: right;
|
|
|
+ .fr-fs-fc {
|
|
|
+ color: #2787f1;
|
|
|
+ font-size: 30px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .search-btn {
|
|
|
+ height: 30px;
|
|
|
+ background: #2787f1;
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 9px 8px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ // line-height: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|