Commit a39f0d54 authored by 李苏's avatar 李苏 💬

1

parent cbf69ff0
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<template slot="tabCustom"> <template slot="tabCustom">
<el-table-column style="border-right: 0px;" fixed="right" label="操作" header-align="center"> <el-table-column style="border-right: 0px;" fixed="right" label="操作" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="true" style="text-align: center;color: #1A94E6;width: 100%;" <el-button v-if="scope.row.ksbz=='Y'" style="text-align: center;color: #1A94E6;width: 100%;"
@click.native.prevent="ksks(scope.row)" type="text" size="small"> @click.native.prevent="ksks(scope.row)" type="text" size="small">
<i class="el-icon-edit"></i>开始考试 <i class="el-icon-edit"></i>开始考试
</el-button> </el-button>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
@click.native.prevent="apiDel(scope.row)" type="text" size="small"> @click.native.prevent="apiDel(scope.row)" type="text" size="small">
<i class="el-icon-warning-outline"></i>已过期 <i class="el-icon-warning-outline"></i>已过期
</el-button> </el-button>
<el-button v-if="false" style="text-align: center;color: #11EE96;width: 100%;" <el-button v-if="scope.row.ksbz=='N'" style="text-align: center;color: #11EE96;width: 100%;"
@click.native.prevent="apiDel(scope.row)" type="text" size="small"> @click.native.prevent="apiDel(scope.row)" type="text" size="small">
<i class="el-icon-circle-check"></i>考试结束 <i class="el-icon-circle-check"></i>考试结束
</el-button> </el-button>
......
<template> <template>
<RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'> <RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<!-- 填写表单内容,slot=form必写--> <!-- 填写表单内容,slot=form必写-->
<el-form slot="form" ref="form" :model="form" label-width="80px" :rules="rules"> <el-form slot="form" ref="form" :model="form" label-width="80px" :rules="rules">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="计划年份" ref="roleid" prop="roleid"> <el-form-item label="用户编码" ref="userid" prop="userid">
<el-input :readonly="readonly" v-model="form.roleid"></el-input> <el-input :readonly="readonly" v-toUpperCase v-model="form.userid"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="计划月份" ref="roleid" prop="roleid"> <el-form-item label="用户名称" ref="username" prop="username">
<el-input :readonly="readonly" v-model="form.roleid"></el-input> <el-input :readonly="readonly" v-model="form.username"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24">
<el-form-item :span="24" label="部门">
<el-select style="width: 100%;" v-model="form.bmid" placeholder="">
<el-option v-for="(item,index) in bmList" :key="item.id" :label="item.bmmc" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="电话">
<el-input :readonly="readonly" v-model="form.phone"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="邮箱">
<el-input :readonly="readonly" v-model="form.email"></el-input>
</el-form-item>
</el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="培训项目" ref="roleid" prop="roleid"> <el-form-item label="备注">
<el-input :readonly="readonly" v-model="form.roleid"></el-input> <el-input :readonly="readonly" v-model="form.bz"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="培训对象" ref="roleid" prop="roleid">
<el-input :readonly="readonly" v-model="form.roleid"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="培训人数" ref="roleid" prop="roleid">
<el-input :readonly="readonly" v-model="form.roleid"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="培训目标" ref="roleid" prop="roleid">
<el-input :readonly="readonly" v-model="form.roleid"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="培训方式" ref="roleid" prop="roleid">
<el-input :readonly="readonly" v-model="form.roleid"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="培训时间" ref="roleid" prop="roleid">
<el-input :readonly="readonly" v-model="form.roleid"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="培训课时" ref="roleid" prop="roleid">
<el-input :readonly="readonly" v-model="form.roleid"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="授课人" ref="roleid" prop="roleid">
<el-input :readonly="readonly" v-model="form.roleid"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="培训单位" ref="roleid" prop="roleid">
<el-input :readonly="readonly" v-model="form.roleid"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -76,6 +53,15 @@ ...@@ -76,6 +53,15 @@
mixins: [editMixin], mixins: [editMixin],
/* 存放index页面传递的额外参数*/ /* 存放index页面传递的额外参数*/
mounted() { mounted() {
this.form.bmid=this.app.queryParams.bmid
if(this.form.bmid=='root'){
this.form.bmid=''
}
this.app.apiTreeQuery({}).then(res=>{
this.bmList=res.data.records
/* 默认选中 */
})
}, },
/* 组件名称*/ /* 组件名称*/
name: 'roleManagementEdit', name: 'roleManagementEdit',
...@@ -85,21 +71,24 @@ ...@@ -85,21 +71,24 @@
return { return {
/* 额外初始化,根据需求*/ /* 额外初始化,根据需求*/
systemType: [], bmList: [],
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/ /* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form: { form: {
roleid: '', bmid:'',
rolename: '', userid: '',
username: '',
phone:'',
email:'',
bz: "", bz: "",
}, },
/* form提交时的规则,具体规则参考官网*/ /* form提交时的规则,具体规则参考官网*/
rules: { rules: {
roleid: [{ userid: [{
required: true, required: true,
trigger: 'blur' trigger: 'blur'
}, ], }, ],
rolename: [{ username: [{
required: true, required: true,
trigger: 'blur' trigger: 'blur'
}, ] }, ]
......
<template> <template>
<div class="min_full"> <div style="display: flex;">
<div class="min_full" style="width: 200px;border-right: 0px;">
<!-- 查询条件--> <TreeBase :app='app' @selected='selectedTree'></TreeBase>
<div class="search" v-condition>
<SearchButton :app='app'></SearchButton>
<el-row :gutter="20" class="search-row-1">
<el-col :span="8" class="search-col">
<div class="search-item">
<span class="search-span">日期:</span>
<el-date-picker></el-date-picker>
</div>
</el-col>
<el-col :span="8" class="search-col">
<div class="search-item">
<span class="search-span">部门:</span>
<el-input></el-input>
</div>
</el-col>
</el-row>
</div> </div>
<!-- 按钮操作--> <div class="min_full" style="width: calc(100% - 200px)">
<el-row class="tool-bar"> <!-- 查询条件-->
<PrintButton :app='app'></PrintButton> <div class="search" v-condition >
<ViewButton ref="view" :app='app'></ViewButton> <SearchButton :app='app'></SearchButton>
<AddButton ref="add" :app='app'></AddButton> <el-row :gutter="20" class="search-row-1">
<CopyButton ref="copy" :app='app'></CopyButton> <el-col :span="6" class="search-col">
<EditButton ref="edit" :app='app'></EditButton> <div class="search-item">
<AttachFileButton :app='app' ></AttachFileButton> <span class="search-span">年份:</span>
<FieldButton :app='app'></FieldButton> <el-input size="small" class="search-input"></el-input>
<ExcelButton :app='app'></ExcelButton> </div>
<!-- 额外按钮--> </el-col>
<!-- 表头设置 --> <el-col :span="6" class="search-col">
<div class="search-item">
<!-- 权限--> <span class="search-span">授课人:</span>
</el-row> <el-input size="small" class="search-input"></el-input>
<!-- 表格--> </div>
<div class="tablePagers"> </el-col>
<TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem' <el-col :span="6" class="search-col">
@getRow='getRow'> <div class="search-item">
<template slot="tabCustom"> <span class="search-span">培训方式:</span>
<el-table-column label="启用/停用" width="90" header-align="center" > <el-input size="small" class="search-input"></el-input>
<template slot-scope="scope"> </div>
<el-switch @click.native="setEnable(scope.row.id)" :value='tybz(scope)' style="width: 80px;justify-content: center;" </el-col>
active-color="#13ce66" inactive-color="#eee"> </el-row>
</el-switch>
</template>
</el-table-column>
</template> </div>
<!-- 按钮操作-->
</TablePager> <el-row class="tool-bar">
<PrintButton :app='app'></PrintButton>
<ViewButton ref="view" :app='app'></ViewButton>
<AddButton ref="add" :app='app'></AddButton>
<CopyButton ref="copy" :app='app'></CopyButton>
<EditButton ref="edit" :app='app'></EditButton>
<FieldButton :app='app'></FieldButton>
<ExcelButton :app='app'></ExcelButton>
</el-row>
<!-- 表格-->
<div class="tablePagers">
<TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem'
@getRow='getRow'>
</TablePager>
</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
/* 引入需要的接口*/ /* 引入需要的接口*/
import { import {
QueryKzzxRole, QueryUser,
QueryApptype, AddUser,
AddKzzxRole, DeleteUser,
DeleteKzzxRole, UpdateUser,
UpdateKzzxRole, QueryBm,
QtKzzxRole
} from "common/src/api/system/dmgSystem.js"; } from "common/src/api/system/dmgSystem.js";
/* edit页面*/ /* edit页面*/
import Edit from './edit' import Edit from './edit'
...@@ -70,11 +70,9 @@ ...@@ -70,11 +70,9 @@
} from 'common' } from 'common'
export default { export default {
mixins: [tableMixin], mixins: [tableMixin],
name: 'appVersion',
/* 初始额外赋值*/ /* 初始额外赋值*/
async mounted() { async mounted() {
this.$refs['TablePager'].pageQuery()
}, },
data() { data() {
return { return {
...@@ -85,117 +83,112 @@ ...@@ -85,117 +83,112 @@
type: '', type: '',
DialogTitle: '', DialogTitle: '',
/* 基础url*/ /* 基础url*/
baseUrl: 'kzzx/role', baseUrl: 'kzzx/user',
/* 查询参数*/ /* 查询参数*/
queryParams: { queryParams: {
ksrq: '',
jsrq: '' },
/* 树的标题 */
treeTitle: '部门列表',
treeDefaultProps: {
children: 'children',
label: 'bmmc'
}, },
/* 表格标题对应参数*/ /* 表格标题对应参数*/
tableTitle: [ tableTitle: [{
{ prop: 'userid',
prop: 'whsj', label: '用户编码',
label: '计划年份', width: '120'
...this.$common('ftDateTime') },
{
prop: 'username',
label: '姓名',
width: '160'
},
{
prop: 'bmmc',
label: '所属部门',
width: '160'
},
{
prop: 'phone',
label: '电话',
width: '160'
},
{
prop: 'email',
label: '邮箱',
width: '160'
},
{
prop: 'zt',
label: '状态',
width: '160'
},
{
prop: 'login',
label: '登录用户',
width: '160',
formatter(row, column, cellValue, index) {
let value=''
if(cellValue=='Y'){
value='登录用户'
}else{
value='非登录用户'
}
return value
},
},
{
prop: 'tyrq',
label: '停用日期',
width: '120',
...this.$common('ftDate')
},
{
prop: 'whr',
label: '维护人',
width: '100'
}, },
{ {
prop: 'whsj', prop: 'whsj',
label: '计划月份', label: '维护时间',
...this.$common('ftDateTime') ...this.$common('ftDateTime')
}, },
{ {
prop: 'whsj', prop: 'bz',
label: '培训项目', label: '备注',
...this.$common('ftDateTime') },
},
{
prop: 'whsj',
label: '培训人数',
...this.$common('ftDateTime')
},
{
prop: 'whsj',
label: '培训目标',
...this.$common('ftDateTime')
},
{
prop: 'whsj',
label: '培训方式',
...this.$common('ftDateTime')
},
{
prop: 'whsj',
label: '培训时间',
...this.$common('ftDateTime')
},
{
prop: 'whsj',
label: '培训课时',
...this.$common('ftDateTime')
},
{
prop: 'whsj',
label: '授课人',
...this.$common('ftDateTime')
},
{
prop: 'whsj',
label: '培训单位',
...this.$common('ftDateTime')
},
{
prop: 'whsj',
label: '备注',
...this.$common('ftDateTime')
}
] ]
} }
}, },
methods: { methods: {
tybz(a) { selectedTree(e){
let nTy = false this.queryParams.bmid=e.id||'root'
nTy = (a.row.tybz == 'N' ? true : false) this.$refs['TablePager'].pageQuery()
return nTy },
},
/* 基础查询*/ /* 基础查询*/
query: QueryKzzxRole, query: QueryUser,
/* 基础增*/ /* 基础增*/
apiAdd: AddKzzxRole, apiAdd: AddUser,
/* 基础更新*/ /* 基础更新*/
apiUpdate: UpdateKzzxRole, apiUpdate: UpdateUser,
/* 删除操作*/ /* 删除操作*/
apiDelete: DeleteKzzxRole, apiDelete: DeleteUser,
/* treeQuery */
apiTreeQuery: QueryBm,
/* 初始化赋值操作*/ /* 初始化赋值操作*/
init() { init() {
}, },
/* 启用停用*/ /* 启用停用*/
setEnable(id) {
this.$confirm('是否启用/停用该角色, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = {
id: id
}
QtKzzxRole(params).then(res => {
if (res.success) {
this.$success('操作成功')
this.app.$refs['TablePager'].reLoad()
} else {
this.$error(res.message || '操作失败')
}
})
})
}
}, },
components: { components:{
Edit, Edit
} }
......
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