@ -20,16 +20,25 @@
< el -table -column :prop ="column.field" :align ="column.align" v -for = " ( column , index ) in columns "
: label = "column.title" : width = "column.width" : fixed = "column.fixed" >
< template slot -scope = " scope " >
< div v-if ="column.type=='opt'" >
< Button ghost size = "small" @click ="edit(scope.row)" type = "primary"
< div v-if ="column.type=='opt'" >
< Button v -if = " scope.row [ ' status ' ] = = 1 " ghost size = "small" @click ="show(scope.row)" type = "primary"
style = "margin-left: 10px;" > 查看 < / Button >
< Button v -if = " scope.row [ ' status ' ] = = 0 " ghost size = "small" @click ="edit(scope.row)" type = "primary"
style = "margin-left: 10px;" > 编辑 < / Button >
< Button ghost size = "small" @click ="del(scope.row)" type = "error" style = "margin-left: 10px;" > 删除 < / Button >
< / div >
< div v -else -if = " column.type = = ' format ' " >
< div v-if ="column.field=='admin'||column.field=='department'" >
{ { scope . row [ column . field ] ? scope . row [ column . field ] . name : "" } }
< / div >
< / div >
< div v -else -if = " column.type = = ' status ' " >
< el -tag :type ="scope.row[column.field]==1?'':'warning'" > { { scope . row [ 'statusName' ] } } < / e l - t a g >
< / div >
< div v -else -if = " column.type = = ' format ' " >
< div v-if ="column.field=='admin'||column.field=='department'||column.field=='maintenance_department'" >
{ { scope . row [ column . field ] ? scope . row [ column . field ] . name : "" } }
< / div >
< / div >
< div v -else -if = " column.type = = ' peoples ' " >
< el -tag style = "margin-right:5px" v-for ="item in scope.row[column.field]" > {{ item }} < / el -tag >
< / div >
< div v-else > {{ scope.row [ column.field ] }} < / div >
< / template >
@ -44,84 +53,166 @@
< / div >
< el -dialog title = "科室活动记录 编辑 " :visible.sync ="dialog FormVisible" fullscreen width = "90%" >
< el -dialog title = "科室活动记录 " :visible.sync ="dialog Show FormVisible" fullscreen width = "90%" >
< div class = "dialogConcent" :style ="{height:clientHeight+'px'}" >
< el -scrollbar style = "flex: 1" >
< el -form :model ="form" :rules ="rules" ref = "form" :label-width ="formLabelWidth" >
< el -form :model ="form" ref = "form" :label-width ="formLabelWidth" >
< el -row >
< el -col :span ="24" >
< div class = "form-sub-title" > 基本信息 < / div >
< / e l - c o l >
< el -col :span ="24" >
< el -form -item label = "活动名称" prop = "name" >
<el -input v-model ="form.name" placeholder="请填写活动名称" autocomplete="off" > < / el -input >
< el -form -item label = "活动名称" prop = "name" >
{{ form . name } }
< / e l - f o r m - i t e m >
< / e l - c o l >
< el -col :span =" 8 ">
< el -col :span =" 10 ">
< el -form -item label = "活动日期" prop = "date" >
< el -date -picker type = "datetime" value -format = " yyyy -MM -dd " format = "yyyy-MM-dd"
v - model = "form.date" placeholder = "请填写活动日期" autocomplete = "off" >
< / e l - d a t e - p i c k e r >
{ { form . date } }
< / e l - f o r m - i t e m >
< / e l - c o l >
< el -col :span ="1 6 ">
< el -form -item label = "活动地点" prop = "address" >
<el -input v-model ="form.address" placeholder="请填写活动地点" autocomplete="off" > < / el -input >
< el -col :span ="1 0" :offset ="4 ">
< el -form -item label = "活动地点" prop = "address" >
{{ form . address } }
< / e l - f o r m - i t e m >
< / e l - c o l >
< el -col :span ="24" >
< el -form -item label = "活动内容" prop = "content" >
<el -input v-model ="form.content" placeholder="请填写活动内容" type="textarea" autocomplete="off" > < / el -input >
< el -form -item label = "活动内容" prop = "content" >
{{ form . content } }
< / e l - f o r m - i t e m >
< / e l - c o l >
< el -col :span ="24" >
< el -form -item label = "参与人员" prop = "people_list" >
< el -transfer filterable : titles = "['待选择', '已选择']" : props = "{key: 'id',label: 'name'}"
: filter - method = "filterMethod" : format = "{ noChecked: '${total}',hasChecked: '${checked}/${total}' }"
filter - placeholder = "请选择参与人员" v - model = "form.people_list" : data = "userdata" >
< / e l - t r a n s f e r >
< el -form -item label = "参与人员" prop = "joins_list" >
< el -tag style = "margin-right:5px" v-for ="item in peoplesshow" > {{ item }} < / el -tag >
< / e l - f o r m - i t e m >
< / e l - c o l >
< el -col :span ="24" >
< el -form -item label = "附件" prop = "file_list" label -position = " top " >
< el -upload class = "upload-demo" :on-success ="handlesuccess" :data ="uploadOther"
action = "/api/admin/upload-file" : on - remove = "handleRemove" : before - remove = "beforeRemove"
: on - exceed = "handleExceed" : file - list = "fileList" >
< el -button size = "small" type = "primary" > 点击上传 < / e l - b u t t o n >
< el -form -item label = "附件" prop = "file_list" label -position = " top " >
< el -link type = "primary" v-for ="item in fileList" > {{ item.name }} < / el -link >
< / e l - u p l o a d >
< / e l - f o r m - i t e m >
< / e l - c o l >
< el -col :span ="24" >
< div class = "form-sub-title" > 活动结果 < / div >
< / e l - c o l >
< el -col :span ="24" >
< el -form -item label = "是否办结" prop = "status" label -position = " top " >
< el -tag type = "" v-if ="form.status==1" > 已 办 结 < / el -tag >
< el -tag type = "warning" v-if ="form.status==0" > 未 办 结 < / el -tag >
< / e l - f o r m - i t e m >
< / e l - c o l >
< el -col :span ="24" >
< el -form -item label = "已办结" prop = "end_content" label -position = " top " >
< el -input v-model ="form.end_content" type="textarea" placeholder="请填写培训效果评估" autocomplete="off" > < / el -input >
< el -col :span ="24" v-if ="form.status==1" >
< el -form -item label = "已办结" prop = "end_content" label -position = " top " >
{{ form . end _content } }
< / e l - f o r m - i t e m >
< / e l - c o l >
< el -col :span ="24" >
< el -form -item label = "未办结" prop = "no_end_content" label -position = " top " >
<el -input v-model ="form.no_end_content" type="textarea" placeholder="请填写评估人" autocomplete="off" > < / el -input >
< el -col :span ="24" v-if ="form.status==0" >
< el -form -item label = "未办结" prop = "no_end_content" label -position = " top " >
{{ form . no _end _content } }
< / e l - f o r m - i t e m >
< / e l - c o l >
< / e l - r o w >
< / e l - f o r m >
< / e l - s c r o l l b a r >
< / div >
< div slot = "footer" class = "dialog-footer" >
< el -button @click ="resetForm('form')" > 关 闭 < / el -button >
< / div >
< div slot = "footer" class = "dialog-footer" >
< el -button @click ="resetForm('form')" > 取 消 < / el -button >
< el -button type = "primary" v -preventReClick @click ="submitForm('form')" > 确 定 < / el -button >
< / div >
< / e l - d i a l o g >
< el -dialog title = "科室活动记录编辑" :visible.sync ="dialogFormVisible" fullscreen width = "90%" >
< div class = "dialogConcent" :style ="{height:clientHeight+'px'}" >
< el -scrollbar style = "flex: 1" >
< el -form :model ="form" :rules ="rules" ref = "form" :label-width ="formLabelWidth" >
< el -row >
< el -col :span ="24" >
< div class = "form-sub-title" > 基本信息 < / div >
< / e l - c o l >
< el -col :span ="24" >
< el -form -item label = "活动名称" prop = "name" >
< el -input v-model ="form.name" placeholder="请填写活动名称" autocomplete="off" > < / el -input >
< / e l - f o r m - i t e m >
< / e l - c o l >
< el -col :span ="10" >
< el -form -item label = "活动日期" prop = "date" >
< el -date -picker style = "width:100%" type = "date" value -format = " yyyy -MM -dd " format = "yyyy-MM-dd"
v - model = "form.date" placeholder = "请填写活动日期" autocomplete = "off" >
< / e l - d a t e - p i c k e r >
< / e l - f o r m - i t e m >
< / e l - c o l >
< el -col :span ="10" :offset ="4" >
< el -form -item label = "活动地点" prop = "address" >
< el -input v-model ="form.address" placeholder="请填写活动地点" autocomplete="off" > < / el -input >
< / e l - f o r m - i t e m >
< / e l - c o l >
< el -col :span ="24" >
< el -form -item label = "活动内容" prop = "content" >
< el -input v-model ="form.content" placeholder="请填写活动内容" type="textarea" autocomplete="off" > < / el -input >
< / e l - f o r m - i t e m >
< / e l - c o l >
< el -col :span ="24" >
< el -form -item label = "参与人员" prop = "joins_list" >
< el -transfer filterable : titles = "['待选择', '已选择']" : props = "{key: 'id',label: 'name'}"
: filter - method = "filterMethod" : format = "{ noChecked: '${total}',hasChecked: '${checked}/${total}' }"
filter - placeholder = "请选择参与人员" v - model = "form.joins_list" : data = "userdata" >
< / e l - t r a n s f e r >
< / e l - f o r m - i t e m >
< / e l - c o l >
< el -col :span ="24" >
< el -form -item label = "附件" prop = "file_list" label -position = " top " >
< el -upload class = "upload-demo" :on-success ="handlesuccess" :data ="uploadOther"
action = "/api/admin/upload-file" : on - remove = "handleRemove" : before - remove = "beforeRemove"
: on - exceed = "handleExceed" : file - list = "fileList" >
< el -button size = "small" type = "primary" > 点击上传 < / e l - b u t t o n >
< / e l - u p l o a d >
< / e l - f o r m - i t e m >
< / e l - c o l >
< el -col :span ="24" >
< div class = "form-sub-title" > 活动结果 < / div >
< / e l - c o l >
< el -col :span ="24" >
< el -form -item label = "是否办结" prop = "status" label -position = " top " >
< el -radio -group v-model ="form.status" >
< el -radio :label ="1" > 已办结 < / e l - r a d i o >
< el -radio :label ="0" > 未办结 < / e l - r a d i o >
< / e l - r a d i o - g r o u p >
< / e l - f o r m - i t e m >
< / e l - c o l >
< el -col :span ="24" v-if ="form.status==1" >
< el -form -item label = "已办结" prop = "end_content" label -position = " top " >
< el -input v-model ="form.end_content" type="textarea" placeholder="请填写培训效果评估" autocomplete="off" > < / el -input >
< / e l - f o r m - i t e m >
< / e l - c o l >
< el -col :span ="24" v-if ="form.status==0" >
< el -form -item label = "未办结" prop = "no_end_content" label -position = " top " >
< el -input v-model ="form.no_end_content" type="textarea" placeholder="请填写评估人" autocomplete="off" > < / el -input >
< / e l - f o r m - i t e m >
< / e l - c o l >
< / e l - r o w >
< / e l - f o r m >
< / e l - s c r o l l b a r >
< / div >
< div slot = "footer" class = "dialog-footer" >
< el -button @click ="resetForm('form')" > 取 消 < / el -button >
< el -button type = "primary" v -preventReClick @click ="submitForm('form')" > 确 定 < / el -button >
< / div >
< / e l - d i a l o g >
@ -134,12 +225,12 @@
} from '@/utils/auth' ;
import LxHeader from "@/components/LxHeader/index.vue" ;
import {
list trainlog ,
list even t,
store ,
save ,
get ,
del
} from "../../api/training/ record .js";
} from "../../api/training/ event .js";
import {
listCommondepartment ,
@ -152,19 +243,6 @@
} ,
data ( ) {
return {
evaluateOptions : [ {
id : 1 ,
name : "考试"
} , {
id : 2 ,
name : "课堂评价"
} , {
id : 3 ,
name : "事后检查"
} , {
id : 4 ,
name : "实际操作"
} ] ,
paginations : {
page : 1 ,
page _size : 15 ,
@ -175,10 +253,12 @@
return item . name . indexOf ( query ) > - 1 ;
} ,
tableHeight : 0 ,
dialogFormVisible : false ,
dialogFormVisible : false ,
dialogShowFormVisible : false ,
formLabelWidth : "120px" ,
clientHeight : 0 ,
form : {
form : {
status : 1 ,
name : "" ,
date : "" ,
address : "" ,
@ -186,40 +266,24 @@
end _content : "" ,
no _end _content : "" ,
joins _list : [ ] ,
files _list : [ ] ,
id : ""
file _list : ''
} ,
fileList : [ ] ,
tableData : [ ] ,
rules : {
name : [ {
required : true ,
message : '请填写 培训 名称',
message : '请填写 活动 名称',
trigger : 'blur'
} ] ,
tim e: [ {
da te: [ {
required : true ,
message : '请选择 培训 时间',
message : '请选择 活动 时间',
trigger : 'change'
} ] ,
period : [ {
required : true ,
message : '请输入课时' ,
trigger : 'blur'
} ] ,
address : [ {
required : true ,
message : '请输入培训地点' ,
trigger : 'blur'
} ] ,
unit : [ {
required : true ,
message : '请选择单位科室' ,
trigger : 'change'
} ] ,
teacher : [ {
required : true ,
message : '请输入授课人' ,
message : '请填写活动地点' ,
trigger : 'blur'
} ]
} ,
@ -229,49 +293,58 @@
} ,
columns : [ {
field : "name" ,
title : "培训名称" ,
type : "string"
title : "活动名称" ,
type : "string" ,
width : 240
} ,
{
field : "time" ,
title : "培训时间" ,
type : "string" ,
field : "date" ,
title : "活动时间" ,
type : "string" ,
align : "center" ,
width : 180
} ,
{
field : " unit ",
title : " 科室 ",
field : " address ",
title : " 活动地点 ",
type : "string" ,
width : 18 0
width : 24 0
} ,
{
field : "period" ,
title : "课时" ,
type : "int" ,
width : 80 ,
align : "center"
} ,
{
field : "created_at" ,
title : "创建时间" ,
type : "string" ,
width : 180 ,
align : "center"
} ,
{
field : "admin" ,
title : "创建人" ,
type : "format" ,
width : 180 ,
align : "center"
} ,
{
field : "department" ,
title : "创建人科室" ,
type : "format" ,
width : 180 ,
align : "center"
field : "peoples" ,
title : "参与人员" ,
type : "peoples" ,
width : 300 ,
align : "left"
} ,
{
field : "status" ,
title : "办结状态" ,
type : "status" ,
width : 180 ,
align : "center"
} ,
{
field : "created_at" ,
title : "创建时间" ,
type : "string" ,
width : 180 ,
align : "center"
} ,
{
field : "admin" ,
title : "创建人" ,
type : "format" ,
width : 180 ,
align : "center"
} ,
{
field : "department" ,
title : "创建人科室" ,
type : "format" ,
width : 180 ,
align : "center"
} ,
{
field : "操作" ,
@ -284,7 +357,8 @@
uploadOther : {
token : ""
} ,
deptOptions : [ ]
deptOptions : [ ] ,
peoplesshow : [ ]
}
} ,
created ( ) {
@ -315,20 +389,6 @@
console . log ( error )
} )
} ,
handleCheckAllChange ( val ) {
console . log ( val )
let options = [ ] ;
for ( var m of this . deptOptions ) {
options . push ( m . id ) ;
}
this . form . department _list = val ? options : [ ] ;
this . isIndeterminate = false ;
} ,
handleCheckedDeptChange ( value ) {
let checkedCount = value . length ;
this . checkAll = checkedCount === this . deptOptions . length ;
this . isIndeterminate = checkedCount > 0 && checkedCount < this . deptOptions . length ;
} ,
initLoad ( ) {
var that = this ;
var clientHeight = document . documentElement . clientHeight
@ -348,10 +408,22 @@
this . load ( ) ;
} ,
load ( ) {
list trainlog ( {
list even t( {
page : this . paginations . page ,
page _size : this . paginations . page _size ,
} ) . then ( response => {
page _size : this . paginations . page _size ,
keyword : this . searchFields . KeyWord
} ) . then ( response => {
for ( var m of response . data ) {
let list = [ ]
if ( m . department _activity _joins ) {
for ( var k of m . department _activity _joins ) {
list . push ( k . admin . name )
}
m . peoples = list
}
m . statusName = m . status == 0 ? "未办结" : "已办结"
}
this . tableData = response . data ;
this . paginations . total = response . total ;
} ) . catch ( error => {
@ -380,26 +452,36 @@
} ) ;
}
} ,
show ( obj ) {
this . clientHeight = document . documentElement . clientHeight - 84 - 110 ;
this . dialogViewVisible = true ;
this . info ( obj ) ;
} ,
info ( obj ) {
var that = this ;
get ( obj . id ) . then ( res => {
let result = Object . assign ( that . form , res ) ;
that . form = result ;
for ( var m of res . people ) {
if ( m . admin )
that . form . people _list . push ( m . admin . id )
that . form = result ;
let _files = [ ] ;
for ( var mod of result . department _activity _files ) {
let m = Object . assign ( { } , mod [ "files" ] ) ;
m . name = mod [ "files" ] . original _name ;
m . id = mod [ "files" ] . i ;
_files . push ( m ) ;
}
that . fileList = _files ;
for ( var m of result . department _activity _joins ) {
if ( m . admin )
that . form . joins _list . push ( m . admin . id )
that . peoplesshow . push ( m . admin . name )
}
} ) . catch ( error => {
/ / r e j e c t ( e r r o r )
} )
} ,
show ( obj ) {
this . form = this . $options . data ( ) . form ;
this . clientHeight = document . documentElement . clientHeight - 84 - 110 ;
var that = this ;
that . info ( obj ) ;
this . dialogShowFormVisible = true ;
this . dialogFormVisible = false
} ,
edit ( obj ) {
this . form = this . $options . data ( ) . form ;
@ -408,21 +490,24 @@
var that = this ;
that . info ( obj ) ;
} else { }
this . dialogFormVisible = true ;
this . dialogFormVisible = true ;
this . dialogShowFormVisible = false ;
} ,
submitForm ( formName ) {
var that = this ;
this . $refs [ formName ] . validate ( ( valid ) => {
if ( valid ) {
var arr = [ ] ;
for ( var m of this . form . people _list ) {
var arr = [ ] ;
console . log ( this . form . joins _list )
for ( var m of this . form . joins _list ) {
arr . push ( {
admin _id : m
} )
}
this . form . people _list = arr ;
this . form . joins _list = arr ;
console . log ( that . form )
/ / r e t u r n
if ( that . form . id ) {
that . form . id = that . form . id ;
save ( that . form ) . then ( response => {
@ -430,7 +515,7 @@
this . $Message . success ( '操作成功' ) ;
that . load ( ) ;
that . dialogFormVisible = false ;
that . dialogShowFormVisible = false
} ) . catch ( error => {
/ / r e j e c t ( e r r o r )
} )
@ -487,9 +572,11 @@
} ,
resetForm ( formName ) {
var that = this ;
that . fileList = [ ] ;
that . fileList = [ ] ;
that . peoplesshow = [ ] ;
this . $refs [ formName ] . resetFields ( ) ;
that . dialogFormVisible = false ;
that . dialogFormVisible = false ;
that . dialogShowFormVisible = false
} ,
}
}