Commit bce0edfd authored by 杨硕's avatar 杨硕

Merge branch 'newprotect' of http://gitlab.91isoft.com:90/yangshuo/template_vue into newprotect

parents 881091ae 91b869eb
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
<span>{{ scope.row.operTime | transformDateByFormat('yyyy-MM-DD HH:mm:ss') }}</span> <span>{{ scope.row.operTime | transformDateByFormat('yyyy-MM-DD HH:mm:ss') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
......
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
<span>{{ parseTime(scope.row.loginTime) | transformDateByFormat('YYYY-MM-DD HH:mm:ss') }}</span> <span>{{ parseTime(scope.row.loginTime) | transformDateByFormat('YYYY-MM-DD HH:mm:ss') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作" width="100px">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <coolbutton :type="textPrimary" :name="deleteName" :size="deleteSize" @btn-click="handleDelete(scope.row.businessId)" />--> <!-- <coolbutton :type="textPrimary" :name="deleteName" :size="deleteSize" @btn-click="handleDelete(scope.row.businessId)" />-->
<el-button <el-button
......
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
<span>{{ scope.row.operTime | transformDateByFormat('YYYY-MM') }}</span> <span>{{ scope.row.operTime | transformDateByFormat('YYYY-MM') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
......
<template>
<div class="app-container">
<!-- TODO: 基础工序管理-->
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form-item label="工序名称" prop="roleName">
<el-input
v-model="queryParams.processName"
placeholder="请输入工序名称"
clearable
:maxlength="30"
size="small"
style="width: 150px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="生产车间" prop="roleKey">
<el-input
v-model="queryParams.workshop"
placeholder="请输入生产车间"
clearable
size="small"
style="width: 150px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="生产状态" prop="flag">
<el-select
v-model="queryParams.flag"
placeholder="请选择生产状态"
clearable
size="small"
style="width: 150px"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" icon="el-icon-search" @click="handleQuery">查询</el-button>
</el-form-item>
<div style="float: right">
<el-form-item>
<coolbutton style="padding: 8px 7px;" :type="typePrimary" :name="addName" :size="smallSize" :icon="addIcon" :haspermi="addHaspermi" @btn-click="handleAdd" />
<!-- TODO:导入 -->
<coolbutton style="padding: 8px 7px;" :type="typeSuccess" :name="channelName" :size="smallSize" :icon="exportIcon" :haspermi="exportHaspermi" @btn-click="handleExport" />
<!-- 导出 -->
<coolbutton style="padding: 8px 7px;" :type="typeSuccess" :name="exportName" :size="smallSize" :icon="exportIcon" :haspermi="exportHaspermi" @btn-click="handleExport" />
</el-form-item>
</div>
</el-form>
<div class="placeholder" />
<!-- TODO: 中间的分隔符号 -->
<div style="padding:5px 10px">
<!-- TODO: 以下为基础工序管理列表 -->
<div class="mb12 font-small-bold">基础工序管理列表</div>
<el-table v-loading="loading" border :data="roleList" @selection-change="handleSelectionChange">
<el-table-column type="index" label="序号" width="50" />
<el-table-column label="工序名称" prop="processName" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.processName || '-' }}
</template>
</el-table-column>
<el-table-column label="生产车间" prop="workshop">
<template slot-scope="scope">
{{ scope.row.workshop || '-' }}
</template>
</el-table-column>
<el-table-column label="状态" align="center" width="100">
<template slot-scope="scope">
<el-switch
v-model="scope.row.flag"
active-value="1"
inactive-value="0"
@change="handleStatusChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column label="创建时间" :show-overflow-tooltip="true" align="center" prop="createTime">
<template slot-scope="scope">
<span>{{ scope.row.createTime | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template>
</el-table-column>
<el-table-column label="修改时间" :show-overflow-tooltip="true" align="center" prop="updataTime">
<template slot-scope="scope">
<span>{{ scope.row.createTime | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template>
</el-table-column>
<el-table-column label="创建人" prop="createBy">
<template slot-scope="scope">
{{ scope.row.createBy || '-' }}
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="240px">
<template slot-scope="scope">
<coolbutton style="color: #49cec9" :type="typeParent" :name="updataName" :size="size" :haspermi="updateHaspermi" @btn-click="handleUpdate(scope.row)" />
<el-button
size="mini"
type="text"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- TODO: 添加或修改工序配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="名称" prop="roleName">
<el-input v-model.trim="form.processName" show-word-limit :maxlength="30" placeholder="请输入工序名称" />
</el-form-item>
<el-form-item label="工厂车间" prop="roleKey">
<el-input v-model.trim="form.workshop" show-word-limit :maxlength="30" placeholder="请输入工厂车间" />
</el-form-item>
<el-form-item label="状态">
<el-radio v-model="form.flag" label="1">启用</el-radio>
<el-radio v-model="form.flag" label="0">停用</el-radio>
</el-form-item>
<el-form-item label="备注">
<el-input v-model.trim="form.remark" maxlength="200" show-word-limit type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel">取 消</el-button>
<el-button type="primary" @click="submitForm(form)">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Coolbutton from '@/components/coolbutton'
export default {
name: 'Role',
components: { Coolbutton },
data() {
return {
typeParent: 'text',
typePrimary: 'primary',
typeSuccess: 'success',
nameParent: '删除',
resetName: '重置',
addName: '新增',
channelName: '导入',
exportName: '导出',
updataName: '修改',
size: 'mini',
smallSize: 'small',
delicon: 'el-icon-delete',
addIcon: 'el-icon-plus',
exportIcon: 'el-icon-download',
resetIcon: '',
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 总条数
total: 0,
// 角色表格数据
roleList: [],
// 弹出层标题
title: '',
// 是否显示弹出层
open: false,
// 是否显示弹出层(数据权限)
openDataScope: false,
// 日期范围
// dateRange: [],
// 菜单表格数据
menuList: [],
menuExpand: false,
menuNodeAll: false,
deptExpand: true,
deptNodeAll: false,
// 状态数据字典
statusOptions: [
{
dictLabel: '启用',
dictValue: '1'
},
{
dictLabel: '停用',
dictValue: '0'
}
],
// 数据范围选项
dataScopeOptions: [
{
value: '1',
label: '全部数据权限'
},
{
value: '2',
label: '自定数据权限'
},
{
value: '3',
label: '本部门数据权限'
},
{
value: '4',
label: '本部门及以下数据权限'
},
{
value: '5',
label: '仅本人数据权限'
}
],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
processName: undefined,
workshop: undefined,
flag: undefined
},
formReset: {
processName: '',
workshop: '',
flag: 0,
createTime: new Date(),
updataTime: new Date(),
createBy: ''
},
// 表单参数
form: {
processName: '',
workshop: '',
flag: 0,
createTime: new Date(),
updataTime: new Date(),
createBy: ''
},
defaultProps: {
children: 'children',
label: 'label'
},
// 表单校验
rules: {},
deptOptions: [],
// TODO: 模拟测试数据
simulateProcessList: [{ processName: '打磨', workshop: '车间1', flag: 1, createTime: new Date(), updataTime: new Date(), createBy: '张三' }, { processName: '焊接', workshop: '车间2', flag: 2, createTime: new Date(), updataTime: new Date(), createBy: '李四' }]
}
},
/** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) {
this.$store.dispatch('searchSave/searchParamsSet', {
path: this.$route.path,
param: {
...this.queryParams
}
})
next()
},
created() {
if (this.$store.getters.searchParams[this.$route.path]) {
const { searchParams } = this.$store.getters; const { path } = this.$route
const param = JSON.parse(searchParams[path]) // 保留着的查询条件
this.queryParams = { ...param }
}
this.getList()
},
methods: {
/** 查询角色列表 */
getList() {
this.loading = true
this.roleList = this.simulateProcessList
console.log(this.roleList)
this.loading = false
},
// 角色状态修改
handleStatusChange(row) {},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = this.formReset
},
/** TODO: 查询按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {},
// 多选框选中数据
handleSelectionChange(selection) {},
/** 新增按钮操作 */
handleAdd() {
this.open = !this.open
},
/** 修改按钮操作 */
handleUpdate(row) {},
/** 提交按钮 */
submitForm: function(form) {
if (form !== undefined && form !== null) {
this.roleList.push(form)
this.getList()
this.reset()
this.open = !this.open
}
},
/** 提交按钮 */
submitDataScope: function() {},
/** 删除按钮操作 */
handleDelete(row) {},
/** 导出按钮操作 */
handleExport() {}
}
}
</script>
<style lang="scss" scoped>
.app-container {
font-size: 18px;
padding: 0;
.placeholder {
height: 1.3vh;
background-color: #F4F4F4;
margin-bottom: 10px
}
.table-drop {
vertical-align: 2px;
line-height: 20px;
margin-left: 15px
}
.el-switch {
margin-left: 15px;
}
}
.el-divider--vertical{
height: 12em;
width: 4px;
}
</style>
...@@ -61,8 +61,8 @@ ...@@ -61,8 +61,8 @@
<!-- {{ scope.row.businessId }}--> <!-- {{ scope.row.businessId }}-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column :show-overflow-tooltip="true" prop="deptName" label="部门名称" width="260" /> <el-table-column :show-overflow-tooltip="true" prop="deptName" label="部门名称" />
<el-table-column :show-overflow-tooltip="true" prop="orderNum" label="排序" width="200" /> <el-table-column :show-overflow-tooltip="true" prop="orderNum" label="排序" />
<el-table-column label="状态" align="center" width="100"> <el-table-column label="状态" align="center" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
...@@ -73,14 +73,14 @@ ...@@ -73,14 +73,14 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :show-overflow-tooltip="true" prop="leader" label="负责人" width="200" /> <el-table-column :show-overflow-tooltip="true" prop="leader" label="负责人" />
<el-table-column :show-overflow-tooltip="true" prop="phone" label="联系电话" width="200" /> <el-table-column :show-overflow-tooltip="true" prop="phone" label="联系电话" />
<el-table-column :show-overflow-tooltip="true" label="创建时间" align="center" prop="createDate" width="200"> <el-table-column :show-overflow-tooltip="true" label="创建时间" align="center" prop="createDate">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180px">
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
<!-- <el-button--> <!-- <el-button-->
<!-- v-hasPermi="['system:dept:edit']"--> <!-- v-hasPermi="['system:dept:edit']"-->
......
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width"> <el-table-column label="操作" class-name="small-padding fixed-width" width="180px">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button--> <!-- <el-button-->
<!-- v-hasPermi="['sys:dictConfig:edit']"--> <!-- v-hasPermi="['sys:dictConfig:edit']"-->
......
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width"> <el-table-column label="操作" class-name="small-padding fixed-width" width="180px">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button--> <!-- <el-button-->
<!-- v-hasPermi="['sys:dict:edit']"--> <!-- v-hasPermi="['sys:dict:edit']"-->
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180px">
<!--<template slot-scope="scope"> <!--<template slot-scope="scope">
<el-button <el-button
v-hasPermi="['system:menu:edit']" v-hasPermi="['system:menu:edit']"
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="240px"> <el-table-column label="操作" class-name="small-padding fixed-width" width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment