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>
......
...@@ -4,60 +4,37 @@ ...@@ -4,60 +4,37 @@
<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-col :span="24">
<el-form-item label="培训项目" ref="roleid" prop="roleid"> <el-form-item :span="24" label="部门">
<el-input :readonly="readonly" v-model="form.roleid"></el-input> <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-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="电话">
<el-input :readonly="readonly" v-model="form.roleid"></el-input> <el-input :readonly="readonly" v-model="form.phone"></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="邮箱">
<el-input :readonly="readonly" v-model="form.roleid"></el-input> <el-input :readonly="readonly" v-model="form.email"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <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-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>
<div class="min_full" style="width: calc(100% - 200px)">
<!-- 查询条件--> <!-- 查询条件-->
<div class="search" v-condition> <div class="search" v-condition >
<SearchButton :app='app'></SearchButton> <SearchButton :app='app'></SearchButton>
<el-row :gutter="20" class="search-row-1"> <el-row :gutter="20" class="search-row-1">
<el-col :span="8" class="search-col"> <el-col :span="6" class="search-col">
<div class="search-item"> <div class="search-item">
<span class="search-span">日期:</span> <span class="search-span">年份:</span>
<el-date-picker></el-date-picker> <el-input size="small" class="search-input"></el-input>
</div> </div>
</el-col> </el-col>
<el-col :span="8" class="search-col"> <el-col :span="6" class="search-col">
<div class="search-item"> <div class="search-item">
<span class="search-span">部门:</span> <span class="search-span">授课人:</span>
<el-input></el-input> <el-input size="small" class="search-input"></el-input>
</div>
</el-col>
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">培训方式:</span>
<el-input size="small" class="search-input"></el-input>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<!-- 按钮操作--> <!-- 按钮操作-->
<el-row class="tool-bar"> <el-row class="tool-bar">
...@@ -26,42 +38,30 @@ ...@@ -26,42 +38,30 @@
<AddButton ref="add" :app='app'></AddButton> <AddButton ref="add" :app='app'></AddButton>
<CopyButton ref="copy" :app='app'></CopyButton> <CopyButton ref="copy" :app='app'></CopyButton>
<EditButton ref="edit" :app='app'></EditButton> <EditButton ref="edit" :app='app'></EditButton>
<AttachFileButton :app='app' ></AttachFileButton>
<FieldButton :app='app'></FieldButton> <FieldButton :app='app'></FieldButton>
<ExcelButton :app='app'></ExcelButton> <ExcelButton :app='app'></ExcelButton>
<!-- 额外按钮-->
<!-- 表头设置 -->
<!-- 权限-->
</el-row> </el-row>
<!-- 表格--> <!-- 表格-->
<div class="tablePagers"> <div class="tablePagers">
<TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem' <TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem'
@getRow='getRow'> @getRow='getRow'>
<template slot="tabCustom">
<el-table-column label="启用/停用" width="90" header-align="center" >
<template slot-scope="scope">
<el-switch @click.native="setEnable(scope.row.id)" :value='tybz(scope)' style="width: 80px;justify-content: center;"
active-color="#13ce66" inactive-color="#eee">
</el-switch>
</template>
</el-table-column>
</template>
</TablePager> </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: 'whsj', prop: 'username',
label: '计划月份', label: '姓名',
...this.$common('ftDateTime') width: '160'
}, },
{ {
prop: 'whsj', prop: 'bmmc',
label: '培训项目', label: '所属部门',
...this.$common('ftDateTime') width: '160'
}, },
{ {
prop: 'whsj', prop: 'phone',
label: '培训人数', label: '电话',
...this.$common('ftDateTime') width: '160'
}, },
{ {
prop: 'whsj', prop: 'email',
label: '培训目标', label: '邮箱',
...this.$common('ftDateTime') width: '160'
}, },
{ {
prop: 'whsj', prop: 'zt',
label: '培训方式', label: '状态',
...this.$common('ftDateTime') width: '160'
}, },
{ {
prop: 'whsj', prop: 'login',
label: '培训时间', label: '登录用户',
...this.$common('ftDateTime') width: '160',
formatter(row, column, cellValue, index) {
let value=''
if(cellValue=='Y'){
value='登录用户'
}else{
value='非登录用户'
}
return value
},
}, },
{ {
prop: 'whsj', prop: 'tyrq',
label: '培训课时', label: '停用日期',
...this.$common('ftDateTime') width: '120',
...this.$common('ftDate')
}, },
{ {
prop: 'whsj', prop: 'whr',
label: '授课人', label: '维护人',
...this.$common('ftDateTime') width: '100'
}, },
{ {
prop: 'whsj', prop: 'whsj',
label: '培训单位', label: '维护时间',
...this.$common('ftDateTime') ...this.$common('ftDateTime')
}, },
{ {
prop: 'whsj', prop: 'bz',
label: '备注', 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