<template>
<div class="process_manage">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>审批流程</span>
<el-button style="float: right; padding: 3px 0" type="text" @click="seach_onoff = !seach_onoff">搜索按钮</el-button>
</div>
<el-row :gutter="10" :class="seach_onoff ? 'lz-seach-animation' : 'lz-seach'">
<!-- <el-col :span="5" class="lz-el-col"><el-input v-model="seach_val" @input="seachValue" placeholder="请输入内容"></el-input></el-col>
<el-col :span="5" class="lz-el-col"><el-button type="primary" size="small" icon="el-icon-search" plain @click="seachValue">搜索</el-button></el-col> -->
</el-row>
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="add_approver">添加审批流程</el-button>
<el-table :data="processData" border highlight-current-row :class="EditOnoff ? 'tb-edit' : 'tb-edit2'" @row-click="handleCurrentChange">
<el-table-column fixed prop="createDate" label="创建日期" width="150" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="流程名称" width="150" :show-overflow-tooltip="true">
<template scope="scope">
<el-input size="small" v-model="EditBefore.name" placeholder="流程名称"></el-input>
<span>{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column label="流程发起人" width="150" :show-overflow-tooltip="true">
<template scope="scope">
<el-input size="small" v-model="EditBefore.userName" placeholder="流程发起人" disabled></el-input>
<span>{{ scope.row.userName }}</span>
</template>
</el-table-column>
<el-table-column label="流程状态" width="150">
<template scope="scope">
<el-switch v-model="EditBefore.status" active-text="启用" inactive-text="禁用" active-value="0" inactive-value="1"></el-switch>
<span>{{ scope.row.status == 1 ? '禁用' : '启用' }}</span>
</template>
</el-table-column>
<el-table-column label="流程简介" :show-overflow-tooltip="true">
<template scope="scope">
<el-input size="small" v-model="EditBefore.remark" placeholder="流程简介"></el-input>
<span>{{ scope.row.remark }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="240">
<template slot-scope="scope">
<el-button type="text" size="small" @click="handleComplete" v-if="scope.row.id == EditBefore.id && EditOnoff">完成</el-button>
<el-button type="text" size="small" @click.stop="EditOnoff = false" v-if="scope.row.id == EditBefore.id && EditOnoff">取消</el-button>
<el-button type="text" size="small" @click="handleEdit(scope.$index, scope.row)" v-else="">编辑</el-button>
<el-button type="text" size="small" @click.stop="handleDelete(scope.$index, scope.row)">删除</el-button>
<el-button type="text" size="small" @click.stop="handleDelete(scope.$index, scope.row)">设置</el-button>
</template>
</el-table-column>
</el-table>
<!-- //分页 -->
<el-pagination
style="margin: 20px 0;float: right;"
@current-change="pageleCurrentChange"
:current-page="currentPage"
:page-sizes="[10]"
:page-size="10"
layout="total, sizes, prev, pager, next, jumper"
:total="count"
></el-pagination>
</el-card>
</div>
</template> <script>
import { mapActions, mapGetters } from 'vuex';
export default {
name: 'process_manage',
computed: {
...mapGetters(['api'])
},
data() {
return {
seach_onoff: false, //搜索显示
seach_val: '', //搜索类容
currentPage: 1, //分页中当前第几页
count: 0, //分页数据总条数
processData: [
//流程数据
{
pmUserName: ''
}
],
//编辑
EditOnoff: false, //是否可编辑
EditBefore: {}, //编辑之前的数据
};
},
mounted() {
//获取登录用户的组织审批流程
this.getProcessData();
},
methods: {
//获取当前公司的所有审批流程
getProcessData() {
let that = this;
let req = {
pageNum: that.currentPage,
isPage: true
};
that.GLOBAL.doPost(that.api.GLOBAL_flow_getByOwner, req, function(res) {
if (res.code == 200) {
that.processData = res.data.list;
that.count = res.data.total;
}
});
},
//点击行
handleCurrentChange(row, event, column) {
let that = this;
console.log(row.id, that.EditBefore.id);
if (row.id == that.EditBefore.id) {
that.EditOnoff = true;
} else {
that.EditOnoff = false;
}
},
//编辑
handleEdit(index, row) {
let that = this;
console.log(row);
that.EditOnoff = true;
//复制编辑前的数据
that.EditBefore = { ...row };
},
//删除
handleDelete(index, row){
this.$confirm('是否删除此‘'+row.name+'’流程', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => { }).catch(() => {
});
},
//完成
handleComplete() {
let that = this;
that.EditOnoff = true;
console.log(that.EditBefore);
that.$confirm('是否完成此次编辑', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
that.GLOBAL.doPost(that.api.GLOBAL_user_update, JSON.stringify(that.EditBefore), function(res) {
console.log(res);
if (res.code == 200) {
that.$message({ message: res.msg, type: 'success' });
that.EditOnoff = false;
//获取人员列表
that.getByOrg();
}
});
})
.catch(() => {});
},
//添加审批人
add_approver() {
this.$router.push({name:'processSetting',path:'/processSetting'})
},
//分页
pageleCurrentChange(val) {
// console.log(`当前页: ${val}`);
let that = this;
that.currentPage = val;
//获取当前公司的所有审批流程
that.getProcessData();
}
}
};
</script> <style scoped="scoped" lang="scss">
.lz-el-col {
width: 200px;
margin-bottom: 10px;
}
.el-table .lz-fontsize-weidth {
font-weight: bold;
}
.el-table .lz-fontsize {
font-weight: normal;
color: #888;
}
//搜索动画显示
.lz-seach {
max-height: 0px;
margin-bottom: 0px;
overflow: hidden;
}
.lz-seach-animation {
animation: lzmover 0.6s ease-in-out forwards;
display: block;
overflow: hidden;
} //表格的可编辑
.tb-edit .el-input {
display: none;
}
.tb-edit .el-select {
display: none;
}
.tb-edit .el-switch {
display: none;
}
.tb-edit .current-row .el-input {
display: block;
}
.tb-edit .current-row .el-select {
display: block;
}
.tb-edit .current-row .el-switch {
display: block;
}
.tb-edit .current-row .el-input + span {
display: none;
}
.tb-edit .current-row .el-switch + span {
display: none;
}
.tb-edit .current-row .el-select + span {
display: none;
}
//取消
.tb-edit2 .current-row .el-input + span {
display: block;
}
.tb-edit2 .el-input {
display: none;
}
.tb-edit2 .el-select {
display: none;
}
.tb-edit2 .el-switch {
display: none;
}
@keyframes lzmover {
0% {
height: 0px;
opacity: 0;
margin-bottom: 0px;
}
100% {
height: 100%;
opacity: 1;
margin-bottom: 10px;
}
} </style>

element 表格行内进行编辑的更多相关文章

  1. AppBoxPro - 细粒度通用权限管理框架(可控制表格行内按钮)源码提供下载

    特别声明: 提供的源代码已经包含了 AppBoxPro 的全部源代码,用 VS2012 打开项目后,直接 Ctrl+F5 可以运行起来(默认使用VS自带的LocalDB数据库). FineUIPro是 ...

  2. 编辑表格输入内容、根据input输入框输入数字动态生成表格行数、编辑表格内容提交传给后台数据处理

    编辑表格输入内容.根据input输入框输入数字动态生成表格行数.编辑表格内容提交传给后台数据处理 记录自己学习做的东西,写的小demo,希望对大家也有帮助! 代码如下: <!DOCTYPE ht ...

  3. datatables表格行内编辑的实现

    Datatables是一款jquery表格插件,它是一个高度灵活的工具,灵活就意味着很多功能需要自己去实现,比如说行内编辑功能. Datatables自己是没有行内编辑功能的,最简单的是通过modal ...

  4. vxe-table 可编辑表格 行内编辑以及验证 element-UI集成

    <vxe-table border show-overflow ref="xTable"  ----------------------------------------- ...

  5. bootstrap-table 数据表格行内修改

    bootstrap-table 数据行内修改js中设置列的属性 editable : { type : 'text',//数据显示在文本框内 emptytext : "--",// ...

  6. VUE+Element UI实现简单的表格行内编辑效果

    原理是通过Css控制绑定的输入控件与显示值,在选中行样式下对控件进行隐藏或显示 <!DOCTYPE html> <html> <head> <meta cha ...

  7. easyui,datagrid表格,行内可编辑

    最近用到easyui,需要表格内编辑,但是我同一个页面有多个表格,把官方的代码修改了一下,如下: HTML代码 <table id="dg" class="easy ...

  8. 推荐一个好用的行内可编辑的table组件 vxe-table

    项目中有一个需要用户点击table单元格可编辑的需求,由于博主用的是elementUI,element组件内实现可编辑,用过的小伙伴都知道,非常麻烦,后来博主在浏览组件的时候发现了 一款非常好用的ta ...

  9. easyui学习笔记3—在展开行内的增删改操作

    这一篇介绍在一个展开行内进行的增删操作,如果一行很长有很多的数据,在一个展开行内进行编辑将更加方便. 1.先看引用的资源 <link rel="stylesheet" hre ...

随机推荐

  1. Linux 【复习巩固】

    目录 一.网络和服务 1.查看ip 2.查看主机名 配置 3.临时服务 1)基本语法(CentOS 6) 2)基本语法(CentOS 7) 3)示例 4.开机自启动服务 1)基本语法(CentOS 6 ...

  2. 大数据学习----day27----hive02------1. 分桶表以及分桶抽样查询 2. 导出数据 3.Hive数据类型 4 逐行运算查询基本语法(group by用法,原理补充) 5.case when(练习题,多表关联)6 排序

    1. 分桶表以及分桶抽样查询 1.1 分桶表 对Hive(Inceptor)表分桶可以将表中记录按分桶键(某个字段对应的的值)的哈希值分散进多个文件中,这些小文件称为桶. 如要按照name属性分为3个 ...

  3. Vue3 父子组件通信

    1.父传子父组件:在子组件上通过 v-bind绑定属性子组件:先定义下基本类型,然后通过setup的第一个参数取获取传过来的值(详细代码见下面)2.子传父父组件:在子组件上绑定一个事件,并定义回调子组 ...

  4. ORACLE 本session产生的redo

    select * from v$statname a ,v$mystat bwhere a.STATISTIC# = b.STATISTIC# and a.name = 'redo size';

  5. 渐进式web应用 (PWA)

    PWA(渐进式 Web 应用)运用现代的 Web API 以及传统的渐进式增强策略来创建跨平台 Web 应用程序. PWA的特点: Discoverable, 内容可以通过搜索引擎发现. Instal ...

  6. Pagination.js + Sqlite web系统分页

    前端使用 jquery pagination.js 插件. 环境准备:jquery.js.pagination.js.pagination.css 附件下载:https://files.cnblogs ...

  7. Go modules基础精进,六大核心概念全解析(上)

    点击一键订阅<云荐大咖>专栏,获取官方推荐精品内容,学技术不迷路! Go 语言做开发时,路径是如何定义的?Go Mudules又为此带来了哪些改变?本文将会全面介绍Go modules六大 ...

  8. Windows下mysql5.6升级到5.7的方法(亲测有效哦!)

    Mysql的升级方式分为两种:原地升级和逻辑升级.这两种升级方式,本质没有什么区别的. 只是在对数据文件的处理上有些区别而已.原地升级是直接将数据文件进行拷贝,而逻辑升级对数据文件的处理方式是通过逻辑 ...

  9. 在写易买网时产生的错误 JSTL标签库中<c:choose></c:choose>不能放JSP页面<!-- -->注释

    最近在使用JSTL标签库的<c:choose>标签时候,发现在该标签体中加了JSP的<!-- -->注释时,总是会显示报错信息.错误的信息如下: org.apache.jasp ...

  10. Mysql资料 查询条件

    目录 一.计算 二.比较 三.逻辑运算符 四.位运算符 五.优先顺序 一.计算 二.比较 三.逻辑运算符 四.位运算符 五.优先顺序 实际上,很少有人能将这些优先级熟练记忆,很多情况下我们都是用&qu ...