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

1

parent cbf69ff0
......@@ -19,7 +19,7 @@
<template slot="tabCustom">
<el-table-column style="border-right: 0px;" fixed="right" label="操作" header-align="center">
<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">
<i class="el-icon-edit"></i>开始考试
</el-button>
......@@ -27,7 +27,7 @@
@click.native.prevent="apiDel(scope.row)" type="text" size="small">
<i class="el-icon-warning-outline"></i>已过期
</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">
<i class="el-icon-circle-check"></i>考试结束
</el-button>
......
<template>
<RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<!-- 填写表单内容,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-col :span="12">
<el-form-item label="计划年份" ref="roleid" prop="roleid">
<el-input :readonly="readonly" v-model="form.roleid"></el-input>
<el-form-item label="用户编码" ref="userid" prop="userid">
<el-input :readonly="readonly" v-toUpperCase v-model="form.userid"></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 label="用户名称" ref="username" prop="username">
<el-input :readonly="readonly" v-model="form.username"></el-input>
</el-form-item>
</el-col>
</el-row>
<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-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-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 label="备注">
<el-input :readonly="readonly" v-model="form.bz"></el-input>
</el-form-item>
</el-col>
</el-row>
......@@ -76,6 +53,15 @@
mixins: [editMixin],
/* 存放index页面传递的额外参数*/
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',
......@@ -85,21 +71,24 @@
return {
/* 额外初始化,根据需求*/
systemType: [],
bmList: [],
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form: {
roleid: '',
rolename: '',
bmid:'',
userid: '',
username: '',
phone:'',
email:'',
bz: "",
},
/* form提交时的规则,具体规则参考官网*/
rules: {
roleid: [{
userid: [{
required: true,
trigger: 'blur'
}, ],
rolename: [{
username: [{
required: true,
trigger: 'blur'
}, ]
......
<template>
<div class="min_full">
<!-- 查询条件-->
<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 style="display: flex;">
<div class="min_full" style="width: 200px;border-right: 0px;">
<TreeBase :app='app' @selected='selectedTree'></TreeBase>
</div>
<!-- 按钮操作-->
<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>
<AttachFileButton :app='app' ></AttachFileButton>
<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'>
<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>
<div class="min_full" style="width: calc(100% - 200px)">
<!-- 查询条件-->
<div class="search" v-condition >
<SearchButton :app='app'></SearchButton>
<el-row :gutter="20" class="search-row-1">
<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>
</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>
</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>
</el-col>
</el-row>
</div>
<!-- 按钮操作-->
<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>
</template>
<script>
/* 引入需要的接口*/
import {
QueryKzzxRole,
QueryApptype,
AddKzzxRole,
DeleteKzzxRole,
UpdateKzzxRole,
QtKzzxRole
QueryUser,
AddUser,
DeleteUser,
UpdateUser,
QueryBm,
} from "common/src/api/system/dmgSystem.js";
/* edit页面*/
import Edit from './edit'
......@@ -70,11 +70,9 @@
} from 'common'
export default {
mixins: [tableMixin],
name: 'appVersion',
/* 初始额外赋值*/
async mounted() {
this.$refs['TablePager'].pageQuery()
},
data() {
return {
......@@ -85,117 +83,112 @@
type: '',
DialogTitle: '',
/* 基础url*/
baseUrl: 'kzzx/role',
baseUrl: 'kzzx/user',
/* 查询参数*/
queryParams: {
ksrq: '',
jsrq: ''
},
/* 树的标题 */
treeTitle: '部门列表',
treeDefaultProps: {
children: 'children',
label: 'bmmc'
},
/* 表格标题对应参数*/
tableTitle: [
{
prop: 'whsj',
label: '计划年份',
...this.$common('ftDateTime')
tableTitle: [{
prop: 'userid',
label: '用户编码',
width: '120'
},
{
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',
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')
},
{
prop: 'whsj',
label: '备注',
...this.$common('ftDateTime')
}
{
prop: 'bz',
label: '备注',
},
]
}
},
methods: {
tybz(a) {
let nTy = false
nTy = (a.row.tybz == 'N' ? true : false)
return nTy
},
selectedTree(e){
this.queryParams.bmid=e.id||'root'
this.$refs['TablePager'].pageQuery()
},
/* 基础查询*/
query: QueryKzzxRole,
query: QueryUser,
/* 基础增*/
apiAdd: AddKzzxRole,
apiAdd: AddUser,
/* 基础更新*/
apiUpdate: UpdateKzzxRole,
apiUpdate: UpdateUser,
/* 删除操作*/
apiDelete: DeleteKzzxRole,
apiDelete: DeleteUser,
/* treeQuery */
apiTreeQuery: QueryBm,
/* 初始化赋值操作*/
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: {
Edit,
components:{
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