@ -0,0 +1,40 @@ |
|||||
|
.person_body { |
||||
|
border: 1px solid #f5f5f5; |
||||
|
height: 500px; |
||||
|
} |
||||
|
.tree_nav span { |
||||
|
display: inline-block; |
||||
|
padding-right: 10px; |
||||
|
margin-right: 5px; |
||||
|
max-width: 6em; |
||||
|
color: #38adff; |
||||
|
font-size: 12px; |
||||
|
cursor: pointer; |
||||
|
background: url(~@/assets/images/jiaojiao.png) no-repeat right center; |
||||
|
} |
||||
|
.tree_nav span:last-of-type { |
||||
|
background: none; |
||||
|
} |
||||
|
.person_tree { |
||||
|
padding: 10px 12px 0 8px; |
||||
|
width: 280px; |
||||
|
height: 100%; |
||||
|
border-right: 1px solid #f5f5f5; |
||||
|
} |
||||
|
.person_tree input { |
||||
|
padding-left: 22px; |
||||
|
width: 210px; |
||||
|
height: 30px; |
||||
|
font-size: 12px; |
||||
|
border-radius: 2px; |
||||
|
border: 1px solid #d5dadf; |
||||
|
background: url(~@/assets/images/list_search.png) no-repeat 10px center; |
||||
|
background-size: 14px 14px; |
||||
|
margin-bottom: 14px; |
||||
|
} |
||||
|
|
||||
|
.person_tree img { |
||||
|
width: 14px; |
||||
|
vertical-align: middle; |
||||
|
margin-right: 5px; |
||||
|
} |
||||
@ -0,0 +1,112 @@ |
|||||
|
.el-drawer__header button.el-drawer__close-btn { |
||||
|
display: none; |
||||
|
} |
||||
|
|
||||
|
.el-drawer__header { |
||||
|
margin-bottom: 0; |
||||
|
padding: 14px 0 14px 20px; |
||||
|
/* border-bottom: 1px solid #f2f2f2; */ |
||||
|
color: #323232; |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
|
||||
|
.demo-drawer__content { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
height: 100%; |
||||
|
} |
||||
|
|
||||
|
.drawer_content { |
||||
|
flex: 1; |
||||
|
} |
||||
|
|
||||
|
.demo-drawer__content>div { |
||||
|
border-top: 1px solid #F2F2F2; |
||||
|
} |
||||
|
|
||||
|
.el-button { |
||||
|
min-width: 79px; |
||||
|
padding: 8px 12px; |
||||
|
font-size: 12px; |
||||
|
border-radius: 2px; |
||||
|
background: #46A6FE; |
||||
|
} |
||||
|
|
||||
|
.el-button.el-button--default { |
||||
|
color: #323232; |
||||
|
background: #f2f2f2; |
||||
|
} |
||||
|
|
||||
|
.demo-drawer__footer { |
||||
|
padding: 10px 30px; |
||||
|
border-top: 1px solid #F2F2F2; |
||||
|
} |
||||
|
|
||||
|
.demo-drawer__footer .el-button { |
||||
|
float: right; |
||||
|
margin-right: 10px; |
||||
|
} |
||||
|
|
||||
|
.el-dialog { |
||||
|
width: 520px; |
||||
|
border: 1px solid #DDE1E5; |
||||
|
border-radius: 3px; |
||||
|
} |
||||
|
|
||||
|
.el-dialog__header { |
||||
|
padding: 0 0 0 20px; |
||||
|
line-height: 50px; |
||||
|
height: 50px; |
||||
|
background: #fff; |
||||
|
border-bottom: 1px solid #F2F2F2; |
||||
|
} |
||||
|
|
||||
|
.el-dialog__header .el-dialog__title { |
||||
|
font-size: 16px; |
||||
|
line-height: 50px; |
||||
|
color: #333333; |
||||
|
} |
||||
|
|
||||
|
.el-dialog__header .el-dialog__headerbtn { |
||||
|
height: 12px; |
||||
|
width: 12px; |
||||
|
} |
||||
|
|
||||
|
.el-dialog__header .el-icon-close { |
||||
|
width: 12px; |
||||
|
height: 12px; |
||||
|
float: left; |
||||
|
} |
||||
|
|
||||
|
.el-dialog__header .el-icon-close::before { |
||||
|
display: block; |
||||
|
width: 12px; |
||||
|
height: 12px; |
||||
|
background: url(~@/assets/images/add-close.png) no-repeat center; |
||||
|
background-size: 100% 100%; |
||||
|
content: ""; |
||||
|
} |
||||
|
|
||||
|
.el-dialog__footer { |
||||
|
border-top: 1px solid #F2F2F2; |
||||
|
padding-bottom: 10px; |
||||
|
} |
||||
|
|
||||
|
.el-checkbox, |
||||
|
.el-checkbox__input.is-checked+.el-checkbox__label, |
||||
|
.el-radio, |
||||
|
.el-radio__input.is-checked+.el-radio__label, |
||||
|
.el-dialog__body, |
||||
|
.el-tree { |
||||
|
color: #333; |
||||
|
} |
||||
|
|
||||
|
.el-radio__label, .el-checkbox__label { |
||||
|
font-size: 12px; |
||||
|
} |
||||
|
.my-el-custom-spinner { |
||||
|
display: inline-block; |
||||
|
width: 80px; |
||||
|
height: 80px; |
||||
|
background: url(~@/assets/images/loading.gif) no-repeat center; |
||||
|
} |
||||
|
After Width: | Height: | Size: 466 B |
|
After Width: | Height: | Size: 223 B |
|
After Width: | Height: | Size: 549 B |
|
After Width: | Height: | Size: 325 B |
|
After Width: | Height: | Size: 209 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 245 B |
|
After Width: | Height: | Size: 266 B |
@ -0,0 +1,42 @@ |
|||||
|
<template> |
||||
|
<el-dialog :close-on-click-modal="false" :visible.sync="addPlanPage" :before-close="closeAddPlanDialog" title="创建方案" width="60%"> |
||||
|
|
||||
|
<template #footer class="el_dialog__footer"> |
||||
|
<div class="dialog-footer "> |
||||
|
<el-button size="small" type="primary" @click="addContsubmit" :loading="addBoxIsTrue">确 定</el-button> |
||||
|
<el-button size="small" @click="closeAddPlanDialog">取 消</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
<script> |
||||
|
export default { |
||||
|
name: "addPlanPage", |
||||
|
props:['addPlanPage',"orgId"], |
||||
|
data() { |
||||
|
return { |
||||
|
addBoxIsTrue:false, |
||||
|
} |
||||
|
}, |
||||
|
created(){ |
||||
|
console.log("addPlanPage变化1",this.addPlanPage,this.orgId) |
||||
|
}, |
||||
|
// 监听数据 |
||||
|
watch: { |
||||
|
addPlanPage(){ |
||||
|
console.log("addPlanPage变化",this.addPlanPage,"orgId") |
||||
|
}, |
||||
|
}, |
||||
|
methods:{ |
||||
|
//关闭创建方案窗口 |
||||
|
closeAddPlanDialog(){ |
||||
|
this.$emit('addPlanSub', false) |
||||
|
}, |
||||
|
//提交方案 |
||||
|
async addContsubmit(){}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,213 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchVersion"> |
||||
|
<el-form-item label="版本号码"> |
||||
|
<el-input v-model="searchVersion.version"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度"> |
||||
|
<el-date-picker |
||||
|
v-model="serachTime" |
||||
|
type="year" |
||||
|
placeholder="选择年" |
||||
|
@change="setTimeYear"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmitSearch">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onResetSearch">重置</el-button> |
||||
|
|
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-col> |
||||
|
<el-col :span="24"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-setting" @click="showIndex()">生成部门考核方案</el-button> |
||||
|
</el-col> |
||||
|
<el-col style="margin-top:10px" :span="24"> |
||||
|
|
||||
|
<template> |
||||
|
<el-table |
||||
|
max-height="100%" |
||||
|
:data="tableData" |
||||
|
border |
||||
|
style="width: 100%"> |
||||
|
<el-table-column |
||||
|
fixed |
||||
|
label="行政组织" |
||||
|
width="250"> |
||||
|
<template slot-scope="scope"> |
||||
|
{{ scope.row.groupname }}{{ scope.row.deaprtname }} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
align="center" |
||||
|
prop="year" |
||||
|
label="年度" |
||||
|
width="80"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="key" |
||||
|
align="center" |
||||
|
label="版本号" |
||||
|
min-width="250"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="time" |
||||
|
align="center" |
||||
|
label="时间" |
||||
|
min-width="200"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="状态" |
||||
|
align="center" |
||||
|
width="200"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-switch |
||||
|
style="display: block" |
||||
|
v-model="scope.row.states" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
active-text="启用" |
||||
|
inactive-text="禁止" |
||||
|
@change="editDepgraState($event,scope.row.key)"> |
||||
|
</el-switch> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column |
||||
|
align="center" |
||||
|
fixed="right" |
||||
|
label="操作" |
||||
|
width="200"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-view" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showDetails(scope.row)" |
||||
|
>查看详情</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-document-checked" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="copyShow(scope.row)" |
||||
|
>复制</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</template> |
||||
|
|
||||
|
|
||||
|
</el-col> |
||||
|
<el-col :span="24"> |
||||
|
<div class="footliebiao"></div> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
|
||||
|
<!--方案创建窗口--> |
||||
|
<addplanpage v-if="addPlanPage" v-on:addPlanSub="addPlanSub" :addPlanPage="addPlanPage" :orgId="orgId"></addplanpage> |
||||
|
|
||||
|
|
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { departmentProgramme,editDepartPrograState } from "@/api/systemaccredit/systemapi" |
||||
|
import addplanpage from "@/views/assessmentProgram/newcont/addplanpage.vue" |
||||
|
export default { |
||||
|
components: { |
||||
|
addplanpage |
||||
|
}, |
||||
|
name: "departprogramme", |
||||
|
props:['departmentId'], |
||||
|
data() { |
||||
|
return { |
||||
|
searchVersion:{ |
||||
|
|
||||
|
}, |
||||
|
serachTime:"", |
||||
|
tableData:[], //列表数据 |
||||
|
addPlanPage:false, //方案创建 |
||||
|
orgId:this.departmentId |
||||
|
} |
||||
|
}, |
||||
|
created(){ |
||||
|
this.getList() |
||||
|
}, |
||||
|
// 监听数据 |
||||
|
watch: { |
||||
|
departmentId(){ |
||||
|
console.log("departmentId变化",this.departmentId) |
||||
|
if(this.departmentId != 0 || this.departmentId != ""){ |
||||
|
this.searchVersion.orgid = this.departmentId.toString(); |
||||
|
this.orgId = this.departmentId.toString(); |
||||
|
} |
||||
|
this.getList() |
||||
|
}, |
||||
|
}, |
||||
|
methods:{ |
||||
|
//添加方案返回值 |
||||
|
addPlanSub(val){ |
||||
|
this.addPlanPage = val |
||||
|
}, |
||||
|
//处理时间 |
||||
|
setTimeYear(){ |
||||
|
if(this.serachTime && this.serachTime != null){ |
||||
|
let yearVal = this.serachTime.getFullYear(); |
||||
|
this.searchVersion.year= yearVal.toString() |
||||
|
} |
||||
|
}, |
||||
|
//获取方案列表 |
||||
|
async getList(){ |
||||
|
let res = await departmentProgramme(this.searchVersion); |
||||
|
this.tableData = res.data; |
||||
|
}, |
||||
|
//查询 |
||||
|
onSubmitSearch(){ |
||||
|
// console.log("搜索--->",this.searchVersion,this.serachTime) |
||||
|
this.getList() |
||||
|
}, |
||||
|
//重置查询条件 |
||||
|
onResetSearch(){ |
||||
|
this.searchVersion={} |
||||
|
this.getList() |
||||
|
}, |
||||
|
//编辑方案状态 |
||||
|
async editDepgraState(val,id){ |
||||
|
console.log("编辑方案状态--->",val,id) |
||||
|
let isTrue = 2; |
||||
|
if(val){ |
||||
|
isTrue = 1 |
||||
|
}else{ |
||||
|
isTrue = 2 |
||||
|
} |
||||
|
console.log("编辑方案状态--1->",val,id,isTrue) |
||||
|
let sendData = { |
||||
|
id:id, |
||||
|
state:isTrue, |
||||
|
istrue:2 |
||||
|
} |
||||
|
console.log("编辑方案状态--2->",val,id,isTrue,sendData) |
||||
|
let res = await editDepartPrograState(sendData) |
||||
|
this.getList() |
||||
|
}, |
||||
|
//弹出生成方案页面 |
||||
|
showIndex(){ |
||||
|
this.addPlanPage = true |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
.footliebiao { |
||||
|
height: 30px; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,123 @@ |
|||||
|
<template> |
||||
|
<!-- 指标外层布局矿建 --> |
||||
|
<el-container> |
||||
|
<!-- 行政组织级 --> |
||||
|
<el-aside width="220px"> |
||||
|
<el-scrollbar > |
||||
|
<el-tree |
||||
|
:data="groThreeList" |
||||
|
:props="threeStruct" |
||||
|
@node-click="handleNodeClick" |
||||
|
></el-tree> |
||||
|
</el-scrollbar> |
||||
|
</el-aside> |
||||
|
<el-aside v-show="postList.length > 0" |
||||
|
width="200px" |
||||
|
> |
||||
|
<el-tree |
||||
|
:data="postList" |
||||
|
:props="threeStruct" |
||||
|
@node-click="nodePostClick" |
||||
|
></el-tree> |
||||
|
</el-aside> |
||||
|
<el-main> |
||||
|
<el-scrollbar > |
||||
|
<template v-if="pageNum==1"> |
||||
|
<!--部门级方案--> |
||||
|
<departprogramme :departmentId="departmentId"></departprogramme> |
||||
|
</template> |
||||
|
<template v-if="pageNum==2"> |
||||
|
<!--岗位级方案--> |
||||
|
</template> |
||||
|
</el-scrollbar> |
||||
|
</el-main> |
||||
|
|
||||
|
</el-container> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { govthree, positionlist } from "@/api/personnel/post"; |
||||
|
|
||||
|
import departprogramme from "@/views/assessmentProgram/newcont/departprogramme.vue" |
||||
|
export default { |
||||
|
components: { |
||||
|
departprogramme |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
groThreeList: [], //行政组织 |
||||
|
threeStruct: { |
||||
|
children: "child", |
||||
|
label: "name", |
||||
|
}, |
||||
|
postList: [], //岗位 |
||||
|
pageNum:1, //展示页面, |
||||
|
departmentId:0, |
||||
|
postId:0, |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
created(){ |
||||
|
this.getOrgThreeList() |
||||
|
}, |
||||
|
methods:{ |
||||
|
// 获取行政组织二级树 |
||||
|
async getOrgThreeList() { |
||||
|
const res = await govthree(); |
||||
|
this.groThreeList = res.data |
||||
|
// console.log("this.GovthreeList2===>",res.data); |
||||
|
}, |
||||
|
//控制节点单机操作 |
||||
|
handleNodeClick(val){ |
||||
|
// console.log('控制节点单机操作---------->',val) |
||||
|
this.getPost(val.id); |
||||
|
this.pageNum = 1; |
||||
|
this.departmentId= val.id |
||||
|
}, |
||||
|
//岗位节点点击操作 |
||||
|
nodePostClick(val){ |
||||
|
this.pageNum = 2; |
||||
|
this.postId= val.id |
||||
|
}, |
||||
|
// 获取岗位 |
||||
|
async getPost(val) { |
||||
|
const from = { |
||||
|
organization: val.toString(), |
||||
|
page: 1, |
||||
|
pagesize: 10, |
||||
|
}; |
||||
|
const res = await positionlist(from); |
||||
|
this.postList = res.data.list; |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
.el-aside { |
||||
|
text-align: center; |
||||
|
height: calc(103% - 2px); |
||||
|
overflow: hidden; |
||||
|
overflow-y: auto; |
||||
|
overflow-x: hidden; |
||||
|
border-right: 1px solid rgb(220, 223, 230); |
||||
|
margin: 2px 0 0 0; |
||||
|
padding-bottom: 10px; |
||||
|
} |
||||
|
.el-main{ |
||||
|
height: 105%; |
||||
|
} |
||||
|
.el-container { |
||||
|
height:calc(100% - 50px); |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
.el-scrollbar { |
||||
|
height: 100%; |
||||
|
} |
||||
|
.el-scrollbar__wrap { |
||||
|
overflow: hidden; |
||||
|
overflow-y: auto; |
||||
|
overflow: scroll; |
||||
|
} |
||||
|
.el-tree-node.is-current>.el-tree-node__content { |
||||
|
color:#2E89DE!important |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,19 @@ |
|||||
|
<template> |
||||
|
|
||||
|
</template> |
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return {} |
||||
|
}, |
||||
|
created(){ |
||||
|
|
||||
|
}, |
||||
|
methods:{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,357 @@ |
|||||
|
<template> |
||||
|
<!--添加--> |
||||
|
<el-dialog :close-on-click-modal="false" :visible.sync="showBoxCont.addBox" title="编辑信息" :before-close="closeAddDialog" width="40%"> |
||||
|
<el-form ref="addForm" :model="addContEditInset" label-width="120px" class="demo-ruleForm"> |
||||
|
<el-form ref="addForm" :model="addContEditInset" :rules="addRules" label-width="120px" class="demo-ruleForm"> |
||||
|
<el-form-item label="调动类型" prop="changetype"> |
||||
|
<el-select filterable v-model="addContEditInset.changetype" clearable placeholder="请选择" @change="qianzhiShuaxin"> |
||||
|
<el-option |
||||
|
|
||||
|
v-for="item in postChangeType" |
||||
|
:key="item.id" |
||||
|
:label="item.title" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="任职开始日期" prop="startTimes"> |
||||
|
|
||||
|
<el-date-picker |
||||
|
clearable |
||||
|
format="yyyy-MM-dd" |
||||
|
@change="startTimeChange" |
||||
|
v-model="addContEditInset.startTimes" |
||||
|
type="date" |
||||
|
placeholder="选择入任职开始日期"> |
||||
|
</el-date-picker> |
||||
|
<span class="tisp_title">此处为必填项!</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="任职结束日期" > |
||||
|
<el-date-picker |
||||
|
clearable |
||||
|
format="yyyy 年 MM 月 dd 日" |
||||
|
@change="endTimeChange" |
||||
|
v-model="addContEditInset.endTimes" |
||||
|
type="date" |
||||
|
placeholder="还在任职中,请留空!"> |
||||
|
</el-date-picker> |
||||
|
<span class="tisp_title">若还在任职中,请留空!</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="归属组织" prop="orglist"> |
||||
|
<el-cascader clearable v-model="addContEditInset.orglist" :options="grouplist" @change="orgChange" :props="propsdepart" style="width:100%"></el-cascader> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="岗位"> |
||||
|
|
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-select filterable v-model="addContEditInset.position" clearable placeholder="请选择" @change="qianzhiShuaxin"> |
||||
|
<el-option |
||||
|
v-for="item in postListAdd" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-select filterable v-model="addContEditInset.assigntype" placeholder="请选择主职、兼职" @change="qianzhiShuaxin"> |
||||
|
<el-option |
||||
|
v-for="item in mainAndPartTimeJobs" |
||||
|
:key="item.id" |
||||
|
:label="item.title" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="职务" prop="jobid"> |
||||
|
|
||||
|
<el-select filterable v-model="addContEditInset.jobid" clearable placeholder="请选择" @change="qianzhiShuaxin"> |
||||
|
<el-option |
||||
|
v-for="item in dutieslist" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
|
||||
|
</el-form-item> |
||||
|
<el-form-item label="职务等级"> |
||||
|
<el-select filterable v-model="addContEditInset.gradepositions" placeholder="请选择" @change="qianzhiShuaxin"> |
||||
|
<el-option |
||||
|
v-for="item in positiongrade" |
||||
|
:key="item.id" |
||||
|
:label="item.tittle" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="班组" prop="team"> |
||||
|
<el-select filterable v-model="addContEditInset.team" clearable placeholder="请选择" @change="qianzhiShuaxin"> |
||||
|
<el-option |
||||
|
v-for="item in teamcontlist" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
</el-form> |
||||
|
</el-form> |
||||
|
<template #footer class="el_dialog__footer"> |
||||
|
<div class="dialog-footer "> |
||||
|
<el-button size="small" type="primary" @click="editContsubmit" :loading="showBoxCont.addBoxIsTrue">确 定</el-button> |
||||
|
<el-button size="small" @click="closeAddDialog">取 消</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { teamcontlist,positionlistIsMe,dutieslist } from "@/api/personnel/post"; |
||||
|
import { peopleMethod,judgeArray } from "@/api/people/peopledata" |
||||
|
import { getgroupdepartmap } from '@/api/duty/group' //组织建构 |
||||
|
import { eidtinsidehistoryworkcont } from "@/api/systemaccredit/systemhrapi" |
||||
|
export default { |
||||
|
name:"editinsidework", |
||||
|
props:['userKey',"getInsideWorkList","inWorkCont"], |
||||
|
data() { |
||||
|
return { |
||||
|
grouplist:[], //部门列表 |
||||
|
dutieslist:[], //职务 |
||||
|
postListAdd: [], //岗位 |
||||
|
teamcontlist:[], //班组 |
||||
|
positiongrade:peopleMethod.positiongrade, //入职等级 |
||||
|
mainAndPartTimeJobs:peopleMethod.mainAndPartTimeJobs, //主职与兼职 |
||||
|
postChangeType:peopleMethod.postChangeType, //变动类型 |
||||
|
propsdepart: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "children", |
||||
|
}, //关联部门 |
||||
|
startTime:"", |
||||
|
endTime:"", |
||||
|
showBoxCont:{ |
||||
|
addBox:true, |
||||
|
addBoxIsTrue:false, |
||||
|
}, |
||||
|
addContEditInset:{ |
||||
|
id:this.inWorkCont.id.toString(), |
||||
|
|
||||
|
}, //添加数据 |
||||
|
addRules:{ |
||||
|
orglist: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
changetype: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
team: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
// position: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
jobid: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
startTimes: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
}, //添加验证 |
||||
|
} |
||||
|
}, |
||||
|
created(){ |
||||
|
this.getGrouplist(); |
||||
|
this.getTeam(); |
||||
|
this.getDutieslist(); |
||||
|
console.log("this.inWorkCont--->",this.inWorkCont); |
||||
|
|
||||
|
|
||||
|
this.addContEditInset.id=this.inWorkCont.id.toString(); |
||||
|
this.addContEditInset.changetype=this.inWorkCont.changetype; //调动类型 |
||||
|
this.addContEditInset.startTimes=this.inWorkCont.starttimg; //任职开始日期 |
||||
|
this.addContEditInset.starttime=this.inWorkCont.starttimg; //任职开始日期 |
||||
|
if(this.inWorkCont.endtimg != "至今"){ |
||||
|
this.addContEditInset.endTimes=this.inWorkCont.endtimg; //任职结束日期 |
||||
|
this.addContEditInset.endtime=this.inWorkCont.endtimg; |
||||
|
}else{ |
||||
|
this.addContEditInset.endtime= "" |
||||
|
} |
||||
|
if(this.inWorkCont.orgid != 0){ |
||||
|
this.addContEditInset.orglist=this.inWorkCont.orgid; //归属组织 |
||||
|
this.getPostAdd(this.inWorkCont.orgid); |
||||
|
} |
||||
|
if(this.inWorkCont.postid != 0){ |
||||
|
this.addContEditInset.position=this.inWorkCont.postid; //岗位 |
||||
|
} |
||||
|
if(this.inWorkCont.assigntype == 0) this.inWorkCont.assigntype = 2; |
||||
|
this.addContEditInset.assigntype=this.inWorkCont.assigntype; //请选择主职、兼职 |
||||
|
if(this.inWorkCont.jobid != 0){ |
||||
|
this.addContEditInset.jobid=this.inWorkCont.jobid; //职务 |
||||
|
} |
||||
|
if(this.inWorkCont.postnlevel == 0) this.inWorkCont.postnlevel = 3; |
||||
|
this.addContEditInset.gradepositions=this.inWorkCont.postnlevel; //职务等级 |
||||
|
if(this.inWorkCont.teamid != 0){ |
||||
|
this.addContEditInset.team=this.inWorkCont.teamid; //班组 |
||||
|
} |
||||
|
console.log("this.addContEditInset--->",this.addContEditInset); |
||||
|
}, |
||||
|
methods:{ |
||||
|
// 获取部门 |
||||
|
async getGrouplist(){ |
||||
|
let sendData = { |
||||
|
id:313, |
||||
|
all:1 |
||||
|
}; |
||||
|
const res = await getgroupdepartmap(sendData) |
||||
|
this.grouplist=res.data |
||||
|
}, |
||||
|
//选择行政组织 |
||||
|
orgChange(val){ |
||||
|
if(val){ |
||||
|
if(judgeArray(val) && val.length > 0){ |
||||
|
let postId = val[val.length-1]; |
||||
|
this.getPostAdd(postId); |
||||
|
}else{ |
||||
|
this.postListAdd = []; |
||||
|
} |
||||
|
}else{ |
||||
|
this.postListAdd = []; |
||||
|
} |
||||
|
// |
||||
|
// this.addContEditInset.position = null |
||||
|
console.log("选择行政组织---------------->",val) |
||||
|
}, |
||||
|
//获取刚问列表 |
||||
|
async getPostAdd(val) { |
||||
|
const from = { |
||||
|
organization: val.toString(), |
||||
|
page: 1, |
||||
|
pagesize: 500, |
||||
|
}; |
||||
|
const res = await positionlistIsMe(from); |
||||
|
this.postListAdd = res.data.list; |
||||
|
console.log("获取刚问列表---------------->",res) |
||||
|
}, |
||||
|
//获取职务 |
||||
|
async getDutieslist(){ |
||||
|
let res = await dutieslist(); |
||||
|
this.dutieslist = res.data.list |
||||
|
console.log("班组---------------->",res,res.list) |
||||
|
}, |
||||
|
//获取班组 |
||||
|
async getTeam(){ |
||||
|
|
||||
|
let res = await teamcontlist(); |
||||
|
this.teamcontlist = res.data.list |
||||
|
console.log("班组---------------->",res) |
||||
|
}, |
||||
|
//处理开始日期 |
||||
|
startTimeChange(){ |
||||
|
if(this.addContEditInset.startTimes && this.addContEditInset.startTimes != null){ |
||||
|
let yearVal = this.addContEditInset.startTimes.getFullYear(); |
||||
|
let monthVal = this.addContEditInset.startTimes.getMonth()+1; |
||||
|
let dayVal = this.addContEditInset.startTimes.getDate(); |
||||
|
if(monthVal < 10) monthVal = "0"+monthVal; |
||||
|
if(dayVal < 10) dayVal = "0"+dayVal; |
||||
|
this.addContEditInset.starttime= yearVal + "-" + monthVal + "-" + dayVal |
||||
|
} |
||||
|
}, |
||||
|
endTimeChange(){ |
||||
|
if(this.addContEditInset.endTimes && this.addContEditInset.endTimes != null){ |
||||
|
let yearVal = this.addContEditInset.endTimes.getFullYear(); |
||||
|
let monthVal = this.addContEditInset.endTimes.getMonth()+1; |
||||
|
let dayVal = this.addContEditInset.endTimes.getDate(); |
||||
|
if(monthVal < 10) monthVal = "0"+monthVal; |
||||
|
if(dayVal < 10) dayVal = "0"+dayVal; |
||||
|
this.addContEditInset.endtime= yearVal + "-" + monthVal + "-" + dayVal |
||||
|
} |
||||
|
}, |
||||
|
//关闭新增窗口 |
||||
|
closeAddDialog(){ |
||||
|
this.showBoxCont.addBox = false; |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
this.$emit('childByValue', 0) |
||||
|
}, |
||||
|
//修改数据 |
||||
|
async editContsubmit(){ |
||||
|
this.showBoxCont.addBoxIsTrue = true; |
||||
|
console.log("添加正式提交数据------------->",this.addContEditInset) |
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
if(this.addContEditInset.id == ""){ |
||||
|
this.tispOrgBox('参数错误!不可提交!请刷新页面!','error'); |
||||
|
return |
||||
|
} |
||||
|
if(this.addContEditInset.orglist){ |
||||
|
if(judgeArray(this.addContEditInset.orglist) && this.addContEditInset.orglist.length > 0){ |
||||
|
let orgAry = this.addContEditInset.orglist |
||||
|
console.log("编辑行政组织----223----->",orgAry.length) |
||||
|
let postId = orgAry[orgAry.length-1]; |
||||
|
this.addContEditInset.orgid = postId |
||||
|
}else{ |
||||
|
if(this.addContEditInset.orglist == 0 || this.addContEditInset.orglist == "" || this.addContEditInset.orglist == null){ |
||||
|
this.tispOrgBox('请选择归属行政组1织!','error'); |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
}else{ |
||||
|
this.tispOrgBox('请选择归属行政组织!','error'); |
||||
|
return |
||||
|
} |
||||
|
let sendData = { |
||||
|
id:this.addContEditInset.id, |
||||
|
orgid:(this.addContEditInset.orgid*1).toString(), |
||||
|
position:(this.addContEditInset.position*1).toString(), |
||||
|
jobid:(this.addContEditInset.jobid*1).toString(), |
||||
|
gradepositions:this.addContEditInset.gradepositions, |
||||
|
starttime:this.addContEditInset.starttime, |
||||
|
endtime:this.addContEditInset.endtime, |
||||
|
changetype:this.addContEditInset.changetype, |
||||
|
assigntype:this.addContEditInset.assigntype, |
||||
|
team:(this.addContEditInset.team*1).toString(), |
||||
|
} |
||||
|
const respon = await eidtinsidehistoryworkcont(sendData) |
||||
|
if (respon.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: respon.msg |
||||
|
}) |
||||
|
this.showBoxCont.addBoxIsTrue = true; |
||||
|
|
||||
|
this.getInsideWorkList(); |
||||
|
this.$forceUpdate(); |
||||
|
this.closeAddDialog(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
}else { |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
return false; |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
}, |
||||
|
//提示 |
||||
|
tispOrgBox(msg,typeClass){ |
||||
|
console.log("添加正式提交数据------"+typeClass+"-------->",msg) |
||||
|
this.$message({ |
||||
|
showClose: true, |
||||
|
message: msg, |
||||
|
type: typeClass, |
||||
|
duration:2000, |
||||
|
onClose:this.openOrgButton |
||||
|
}); |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
}, |
||||
|
//强制刷新 |
||||
|
qianzhiShuaxin(){ |
||||
|
this.$forceUpdate() |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,184 @@ |
|||||
|
<template> |
||||
|
<!--添加--> |
||||
|
<el-dialog :close-on-click-modal="false" :visible.sync="showBoxCont.addBox" title="添加信息" :before-close="closeAddDialog" width="40%"> |
||||
|
|
||||
|
<el-form ref="addForm" :model="addCont" :rules="addRules" label-width="120px" class="demo-ruleForm"> |
||||
|
|
||||
|
<el-form-item label="任职开始日期" prop="startTime"> |
||||
|
<el-date-picker |
||||
|
clearable |
||||
|
format="yyyy-MM-dd" |
||||
|
@change="startTimeChange" |
||||
|
v-model="addCont.startTime" |
||||
|
type="date" |
||||
|
placeholder="选择入任职开始日期"> |
||||
|
</el-date-picker> |
||||
|
<span class="tisp_title">此处为必填项!</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="任职结束日期" prop="endTime"> |
||||
|
<el-date-picker |
||||
|
clearable |
||||
|
format="yyyy-MM-dd" |
||||
|
v-model="addCont.endTime" |
||||
|
type="date" |
||||
|
placeholder="还在任职中,请留空!"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="入职公司" prop="company"> |
||||
|
<el-input v-model="addCont.company" placeholder="入职公司"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="入职部门" prop="department"> |
||||
|
<el-input v-model="addCont.department" placeholder="入职部门"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="入职职务" prop="position"> |
||||
|
<el-input v-model="addCont.position" placeholder="入职职务"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="证明人" prop="witness"> |
||||
|
<el-input v-model="addCont.witness" placeholder="证明人"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="证明人电话" prop="witnesstel"> |
||||
|
<el-input v-model="addCont.witnesstel" placeholder="证明人电话"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="备注"> |
||||
|
<el-input v-model="addCont.remarks" placeholder="备注"></el-input> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
</el-form> |
||||
|
<template #footer class="el_dialog__footer"> |
||||
|
<div class="dialog-footer "> |
||||
|
<el-button size="small" type="primary" @click="addContsubmitWai" :loading="showBoxCont.addBoxIsTrue">确 定</el-button> |
||||
|
<el-button size="small" @click="closeAddDialog">取 消</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { addWorkHistoryCont } from "@/api/systemaccredit/systemhrapi" |
||||
|
export default { |
||||
|
name:"externalwork", |
||||
|
props:['userKey',"getExtWorkList"], |
||||
|
data() { |
||||
|
return { |
||||
|
showBoxCont:{ |
||||
|
addBox:true, |
||||
|
addBoxIsTrue:false, |
||||
|
}, |
||||
|
addCont:{ |
||||
|
// id:this.userKey, |
||||
|
}, |
||||
|
startTime:"", |
||||
|
endTime:"", |
||||
|
addRules:{ |
||||
|
company: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
department: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
position: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
witness: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
witnesstel: [ |
||||
|
{ required: true, message: '必填', trigger: 'blur' }, |
||||
|
{ min: 11, max: 11, message: "请输入11位手机号码", trigger: "blur" }, |
||||
|
{ |
||||
|
pattern: /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/, |
||||
|
message: "请输入正确的手机号码", |
||||
|
trigger: "blur" |
||||
|
}, |
||||
|
], |
||||
|
startTime: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
endTime: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
}, //添加验证 |
||||
|
} |
||||
|
}, |
||||
|
created(){ |
||||
|
|
||||
|
}, |
||||
|
methods:{ |
||||
|
//关闭新增窗口 |
||||
|
closeAddDialog(){ |
||||
|
this.showBoxCont.addBox = false; |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
this.initData(); |
||||
|
this.$emit('childByValue', 0) |
||||
|
|
||||
|
}, |
||||
|
//初始化添加数据 |
||||
|
initData(){ |
||||
|
this.$refs.addForm.resetFields(); |
||||
|
this.addCont={ |
||||
|
// id:this.userKey, |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
//处理开始日期 |
||||
|
startTimeChange(){ |
||||
|
if(this.addCont.startTime && this.addCont.startTime != null){ |
||||
|
let yearVal = this.addCont.startTime.getFullYear(); |
||||
|
let monthVal = this.addCont.startTime.getMonth()+1; |
||||
|
let dayVal = this.addCont.startTime.getDate(); |
||||
|
if(monthVal < 10) monthVal = "0"+monthVal; |
||||
|
if(dayVal < 10) dayVal = "0"+dayVal; |
||||
|
this.addCont.entrytime= yearVal + "-" + monthVal + "-" + dayVal |
||||
|
} |
||||
|
}, |
||||
|
endTimeChange(){ |
||||
|
|
||||
|
if(this.addCont.endTime && this.addCont.endTime != null){ |
||||
|
let yearVal = this.addCont.endTime.getFullYear(); |
||||
|
let monthVal = this.addCont.endTime.getMonth()+1; |
||||
|
let dayVal = this.addCont.endTime.getDate(); |
||||
|
if(monthVal < 10) monthVal = "0"+monthVal; |
||||
|
if(dayVal < 10) dayVal = "0"+dayVal; |
||||
|
this.addCont.leavedate= yearVal + "-" + monthVal + "-" + dayVal |
||||
|
} |
||||
|
}, |
||||
|
//提交数据 |
||||
|
async addContsubmitWai(){ |
||||
|
console.log("添加正式提交数据-------------->",this.addCont) |
||||
|
// this.showBoxCont.addBoxIsTrue = true; |
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
if(!this.userKey){ |
||||
|
this.tispOrgBox('参数错误!不可提交!请刷新页面!','error'); |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
|
||||
|
let sendData = { |
||||
|
id:this.userKey, |
||||
|
list:[ |
||||
|
this.addCont |
||||
|
] |
||||
|
} |
||||
|
console.log("添加正式提交数据-------------->",sendData) |
||||
|
let res = await addWorkHistoryCont(sendData) |
||||
|
if(res.code == 0){ |
||||
|
this.$confirm('新增成功!是否继续添加?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
this.initData(); |
||||
|
this.getExtWorkList(); |
||||
|
this.$forceUpdate() |
||||
|
}).catch(() => { |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
this.getExtWorkList(); |
||||
|
this.$forceUpdate(); |
||||
|
this.closeAddDialog(); |
||||
|
}); |
||||
|
}else{ |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
} |
||||
|
}else{ |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
return false; |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,175 @@ |
|||||
|
<template> |
||||
|
<!--添加--> |
||||
|
<el-dialog :close-on-click-modal="false" :visible.sync="showBoxCont.addBox" title="添加信息" :before-close="closeAddDialog" width="40%"> |
||||
|
|
||||
|
<el-form ref="addForm" :model="addCont" :rules="addRules" label-width="120px" class="demo-ruleForm"> |
||||
|
|
||||
|
<el-form-item label="任职开始日期" prop="startTime"> |
||||
|
<el-date-picker |
||||
|
clearable |
||||
|
format="yyyy-MM-dd" |
||||
|
@change="startTimeChange" |
||||
|
v-model="addCont.startTime" |
||||
|
type="date" |
||||
|
placeholder="选择入任职开始日期"> |
||||
|
</el-date-picker> |
||||
|
<span class="tisp_title">此处为必填项!</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="任职结束日期" prop="endTime"> |
||||
|
<el-date-picker |
||||
|
clearable |
||||
|
format="yyyy-MM-dd" |
||||
|
v-model="addCont.endTime" |
||||
|
type="date" |
||||
|
placeholder="还在任职中,请留空!"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="入职公司" prop="company"> |
||||
|
<el-input v-model="addCont.company" placeholder="入职公司"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="入职部门" prop="department"> |
||||
|
<el-input v-model="addCont.department" placeholder="入职部门"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="入职职务" prop="position"> |
||||
|
<el-input v-model="addCont.position" placeholder="入职职务"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="证明人" prop="witness"> |
||||
|
<el-input v-model="addCont.witness" placeholder="证明人"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="证明人电话" prop="witnesstel"> |
||||
|
<el-input v-model="addCont.witnesstel" placeholder="证明人电话"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="备注"> |
||||
|
<el-input v-model="addCont.remarks" placeholder="备注"></el-input> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
</el-form> |
||||
|
<template #footer class="el_dialog__footer"> |
||||
|
<div class="dialog-footer "> |
||||
|
<el-button size="small" type="primary" @click="addContsubmitWai" :loading="showBoxCont.addBoxIsTrue">确 定</el-button> |
||||
|
<el-button size="small" @click="closeAddDialog">取 消</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { editWorkHistoryCont } from "@/api/systemaccredit/systemhrapi" |
||||
|
export default { |
||||
|
name:"externalworkoyt", |
||||
|
props:['userKey',"getExtWorkList","outWorkCont"], |
||||
|
data() { |
||||
|
return { |
||||
|
showBoxCont:{ |
||||
|
addBox:true, |
||||
|
addBoxIsTrue:false, |
||||
|
}, |
||||
|
addCont:{ |
||||
|
id:this.outWorkCont.id.toString(), |
||||
|
}, |
||||
|
startTime:"", |
||||
|
endTime:"", |
||||
|
addRules:{ |
||||
|
company: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
department: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
position: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
witness: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
witnesstel: [ |
||||
|
{ required: true, message: '必填', trigger: 'blur' }, |
||||
|
{ min: 11, max: 11, message: "请输入11位手机号码", trigger: "blur" }, |
||||
|
{ |
||||
|
pattern: /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/, |
||||
|
message: "请输入正确的手机号码", |
||||
|
trigger: "blur" |
||||
|
}, |
||||
|
], |
||||
|
startTime: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
endTime: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
}, //添加验证 |
||||
|
} |
||||
|
}, |
||||
|
created(){ |
||||
|
this.addCont={ |
||||
|
id:this.outWorkCont.id.toString(), |
||||
|
startTime:this.outWorkCont.starttimg, |
||||
|
endTime:this.outWorkCont.endtimg, |
||||
|
company:this.outWorkCont.company, |
||||
|
department:this.outWorkCont.deparment, |
||||
|
position:this.outWorkCont.job, |
||||
|
witness:this.outWorkCont.witness, |
||||
|
witnesstel:this.outWorkCont.witnesstel, |
||||
|
remarks:this.outWorkCont.remarks, |
||||
|
entrytime:this.outWorkCont.starttimg, |
||||
|
leavedate:this.outWorkCont.endtimg, |
||||
|
} |
||||
|
console.log("修改集团外-------------->",this.outWorkCont,this.addCont) |
||||
|
}, |
||||
|
methods:{ |
||||
|
//关闭新增窗口 |
||||
|
closeAddDialog(){ |
||||
|
this.showBoxCont.addBox = false; |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
this.initData(); |
||||
|
this.$emit('childByValue', 0) |
||||
|
|
||||
|
}, |
||||
|
//初始化添加数据 |
||||
|
initData(){ |
||||
|
this.$refs.addForm.resetFields(); |
||||
|
this.addCont={ |
||||
|
id:this.outWorkCont.id.toString(), |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
//处理开始日期 |
||||
|
startTimeChange(){ |
||||
|
if(this.addCont.startTime && this.addCont.startTime != null){ |
||||
|
let yearVal = this.addCont.startTime.getFullYear(); |
||||
|
let monthVal = this.addCont.startTime.getMonth()+1; |
||||
|
let dayVal = this.addCont.startTime.getDate(); |
||||
|
if(monthVal < 10) monthVal = "0"+monthVal; |
||||
|
if(dayVal < 10) dayVal = "0"+dayVal; |
||||
|
this.addCont.entrytime= yearVal + "-" + monthVal + "-" + dayVal |
||||
|
} |
||||
|
}, |
||||
|
endTimeChange(){ |
||||
|
|
||||
|
if(this.addCont.endTime && this.addCont.endTime != null){ |
||||
|
let yearVal = this.addCont.endTime.getFullYear(); |
||||
|
let monthVal = this.addCont.endTime.getMonth()+1; |
||||
|
let dayVal = this.addCont.endTime.getDate(); |
||||
|
if(monthVal < 10) monthVal = "0"+monthVal; |
||||
|
if(dayVal < 10) dayVal = "0"+dayVal; |
||||
|
this.addCont.leavedate= yearVal + "-" + monthVal + "-" + dayVal |
||||
|
} |
||||
|
}, |
||||
|
//提交数据 |
||||
|
async addContsubmitWai(){ |
||||
|
console.log("添加正式提交数据-------------->",this.addCont) |
||||
|
// this.showBoxCont.addBoxIsTrue = true; |
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const respon = await editWorkHistoryCont(this.addCont) |
||||
|
if (respon.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: respon.msg |
||||
|
}) |
||||
|
this.showBoxCont.addBoxIsTrue = true; |
||||
|
this.getExtWorkList(); |
||||
|
this.$forceUpdate(); |
||||
|
this.closeAddDialog(); |
||||
|
} |
||||
|
}else{ |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
return false; |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,392 @@ |
|||||
|
<template> |
||||
|
<!--添加--> |
||||
|
<el-dialog :close-on-click-modal="false" :visible.sync="showBoxCont.addBox" title="添加信息" :before-close="closeAddDialog" width="40%"> |
||||
|
|
||||
|
<el-form ref="addForm" :model="addCont" :rules="addRules" label-width="120px" class="demo-ruleForm"> |
||||
|
<el-form-item label="调动类型" prop="changetype"> |
||||
|
<el-select filterable v-model="addCont.changetype" clearable placeholder="请选择"> |
||||
|
<el-option |
||||
|
v-for="item in postChangeType" |
||||
|
:key="item.id" |
||||
|
:label="item.title" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="任职开始日期" > |
||||
|
|
||||
|
<el-date-picker |
||||
|
clearable |
||||
|
format="yyyy 年 MM 月 dd 日" |
||||
|
@change="startTimeChange" |
||||
|
v-model="startTime" |
||||
|
type="date" |
||||
|
placeholder="选择入任职开始日期"> |
||||
|
</el-date-picker> |
||||
|
<span class="tisp_title">此处为必填项!</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="任职结束日期" > |
||||
|
<el-date-picker |
||||
|
clearable |
||||
|
format="yyyy 年 MM 月 dd 日" |
||||
|
@change="endTimeChange" |
||||
|
v-model="endTime" |
||||
|
type="date" |
||||
|
placeholder="还在任职中,请留空!"> |
||||
|
</el-date-picker> |
||||
|
<span class="tisp_title">若还在任职中,请留空!</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="归属组织" prop="orglist"> |
||||
|
<el-cascader clearable v-model="addCont.orglist" :options="grouplist" @change="orgChange" :props="propsdepart" style="width:100%"></el-cascader> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="岗位"> |
||||
|
|
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-select filterable v-model="addCont.position" clearable placeholder="请选择" > |
||||
|
<el-option |
||||
|
v-for="item in postListAdd" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-select filterable v-model="addCont.assigntype" placeholder="请选择主职、兼职"> |
||||
|
<el-option |
||||
|
v-for="item in mainAndPartTimeJobs" |
||||
|
:key="item.id" |
||||
|
:label="item.title" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="职务" prop="jobid"> |
||||
|
|
||||
|
<el-select filterable v-model="addCont.jobid" clearable placeholder="请选择"> |
||||
|
<el-option |
||||
|
v-for="item in dutieslist" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
|
||||
|
</el-form-item> |
||||
|
<el-form-item label="职务等级"> |
||||
|
<el-select filterable v-model="addCont.gradepositions" placeholder="请选择"> |
||||
|
<el-option |
||||
|
v-for="item in positiongrade" |
||||
|
:key="item.id" |
||||
|
:label="item.tittle" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="班组" prop="team"> |
||||
|
<el-select filterable v-model="addCont.team" clearable placeholder="请选择"> |
||||
|
<el-option |
||||
|
v-for="item in teamcontlist" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
</el-form> |
||||
|
<template #footer class="el_dialog__footer"> |
||||
|
<div class="dialog-footer "> |
||||
|
<el-button size="small" type="primary" @click="addContsubmit" :loading="showBoxCont.addBoxIsTrue">确 定</el-button> |
||||
|
<el-button size="small" @click="closeAddDialog">取 消</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { teamcontlist,positionlistIsMe,dutieslist } from "@/api/personnel/post"; |
||||
|
import { peopleMethod,judgeArray } from "@/api/people/peopledata" |
||||
|
import { getgroupdepartmap } from '@/api/duty/group' //组织建构 |
||||
|
import { judgePrinPosition,addInsideHistory } from "@/api/systemaccredit/systemhrapi" |
||||
|
export default { |
||||
|
name:"insidework", |
||||
|
props:['userKey',"getInsideWorkList"], |
||||
|
data() { |
||||
|
return { |
||||
|
grouplist:[], //部门列表 |
||||
|
dutieslist:[], //职务 |
||||
|
postListAdd: [], //岗位 |
||||
|
teamcontlist:[], //班组 |
||||
|
positiongrade:peopleMethod.positiongrade, //入职等级 |
||||
|
mainAndPartTimeJobs:peopleMethod.mainAndPartTimeJobs, //主职与兼职 |
||||
|
postChangeType:peopleMethod.postChangeType, //变动类型 |
||||
|
propsdepart: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "children", |
||||
|
}, //关联部门 |
||||
|
startTime:"", |
||||
|
endTime:"", |
||||
|
showBoxCont:{ |
||||
|
addBox:true, |
||||
|
addBoxIsTrue:false, |
||||
|
}, |
||||
|
addCont:{ |
||||
|
id:this.userKey, |
||||
|
orgid:"", |
||||
|
position:"", |
||||
|
jobid:"", |
||||
|
gradepositions:3, |
||||
|
starttime:"", |
||||
|
endtime:"", |
||||
|
changetype:1, |
||||
|
assigntype:2, |
||||
|
team:"", |
||||
|
}, //添加数据 |
||||
|
addRules:{ |
||||
|
orglist: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
changetype: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
team: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
// position: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
jobid: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
}, //添加验证 |
||||
|
} |
||||
|
}, |
||||
|
created(){ |
||||
|
this.getGrouplist(); |
||||
|
this.getTeam(); |
||||
|
this.getDutieslist(); |
||||
|
}, |
||||
|
methods:{ |
||||
|
// 获取部门 |
||||
|
async getGrouplist(){ |
||||
|
let sendData = { |
||||
|
id:313, |
||||
|
all:1 |
||||
|
}; |
||||
|
const res = await getgroupdepartmap(sendData) |
||||
|
this.grouplist=res.data |
||||
|
}, |
||||
|
//选择行政组织 |
||||
|
orgChange(val){ |
||||
|
if(val){ |
||||
|
if(judgeArray(val) && val.length > 0){ |
||||
|
let postId = val[val.length-1]; |
||||
|
this.getPostAdd(postId); |
||||
|
}else{ |
||||
|
this.postListAdd = []; |
||||
|
} |
||||
|
}else{ |
||||
|
this.postListAdd = []; |
||||
|
} |
||||
|
// |
||||
|
// this.addCont.position = null |
||||
|
console.log("选择行政组织---------------->",val) |
||||
|
}, |
||||
|
//获取刚问列表 |
||||
|
async getPostAdd(val) { |
||||
|
const from = { |
||||
|
organization: val.toString(), |
||||
|
page: 1, |
||||
|
pagesize: 500, |
||||
|
}; |
||||
|
const res = await positionlistIsMe(from); |
||||
|
this.postListAdd = res.data.list; |
||||
|
console.log("获取刚问列表---------------->",res) |
||||
|
}, |
||||
|
//获取职务 |
||||
|
async getDutieslist(){ |
||||
|
let res = await dutieslist(); |
||||
|
this.dutieslist = res.data.list |
||||
|
console.log("班组---------------->",res,res.list) |
||||
|
}, |
||||
|
//获取班组 |
||||
|
async getTeam(){ |
||||
|
|
||||
|
let res = await teamcontlist(); |
||||
|
this.teamcontlist = res.data.list |
||||
|
console.log("班组---------------->",res) |
||||
|
}, |
||||
|
//处理开始日期 |
||||
|
startTimeChange(){ |
||||
|
if(this.startTime && this.startTime != null){ |
||||
|
let yearVal = this.startTime.getFullYear(); |
||||
|
let monthVal = this.startTime.getMonth()+1; |
||||
|
let dayVal = this.startTime.getDate(); |
||||
|
if(monthVal < 10) monthVal = "0"+monthVal; |
||||
|
if(dayVal < 10) dayVal = "0"+dayVal; |
||||
|
this.addCont.starttime= yearVal + "-" + monthVal + "-" + dayVal |
||||
|
} |
||||
|
}, |
||||
|
endTimeChange(){ |
||||
|
if(this.endTime && this.endTime != null){ |
||||
|
let yearVal = this.endTime.getFullYear(); |
||||
|
let monthVal = this.endTime.getMonth()+1; |
||||
|
let dayVal = this.endTime.getDate(); |
||||
|
if(monthVal < 10) monthVal = "0"+monthVal; |
||||
|
if(dayVal < 10) dayVal = "0"+dayVal; |
||||
|
this.addCont.endtime= yearVal + "-" + monthVal + "-" + dayVal |
||||
|
} |
||||
|
}, |
||||
|
//关闭新增窗口 |
||||
|
closeAddDialog(){ |
||||
|
this.showBoxCont.addBox = false; |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
this.initData(); |
||||
|
this.$emit('childByValue', 0) |
||||
|
|
||||
|
}, |
||||
|
//初始化添加数据 |
||||
|
initData(){ |
||||
|
this.$refs.addForm.resetFields(); |
||||
|
this.addCont={ |
||||
|
id:this.userKey, |
||||
|
orgid:"", |
||||
|
position:"", |
||||
|
jobid:"", |
||||
|
gradepositions:3, |
||||
|
starttime:"", |
||||
|
endtime:"", |
||||
|
changetype:1, |
||||
|
assigntype:2, |
||||
|
team:"", |
||||
|
} |
||||
|
}, |
||||
|
//新增数据处理 |
||||
|
async addContsubmit(){ |
||||
|
console.log("新增数据处理---------------->",this.addCont) |
||||
|
this.showBoxCont.addBoxIsTrue = true; |
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
console.log("新增数据处理-------12231--------->",valid) |
||||
|
if (valid) { |
||||
|
if(this.addCont.id == ""){ |
||||
|
this.tispOrgBox('参数错误!不可提交!请刷新页面!','error'); |
||||
|
return |
||||
|
} |
||||
|
if(this.addCont.orglist){ |
||||
|
if(judgeArray(this.addCont.orglist) && this.addCont.orglist.length > 0){ |
||||
|
let orgAry = this.addCont.orglist |
||||
|
console.log("编辑行政组织----223----->",orgAry.length) |
||||
|
let postId = orgAry[orgAry.length-1]; |
||||
|
this.addCont.orgid = postId |
||||
|
}else{ |
||||
|
this.tispOrgBox('请选择归属行政组织!','error'); |
||||
|
return |
||||
|
} |
||||
|
}else{ |
||||
|
this.tispOrgBox('请选择归属行政组织!','error'); |
||||
|
return |
||||
|
} |
||||
|
// if(this.addCont.position){ |
||||
|
// if(this.addCont.position == 0 || this.addCont.position == "" || this.addCont.position == null){ |
||||
|
// this.tispOrgBox('请选择职务!','error'); |
||||
|
// return |
||||
|
// } |
||||
|
// }else{ |
||||
|
// this.tispOrgBox('请选择职务!','error'); |
||||
|
// return |
||||
|
// } |
||||
|
if(this.addCont.team){ |
||||
|
if(this.addCont.team == 0 || this.addCont.team == "" || this.addCont.team == null){ |
||||
|
this.tispOrgBox('请选择班组!','error'); |
||||
|
return |
||||
|
} |
||||
|
}else{ |
||||
|
this.tispOrgBox('请选择班组!','error'); |
||||
|
return |
||||
|
} |
||||
|
if(this.addCont.gradepositions){ |
||||
|
if(this.addCont.gradepositions == 0 || this.addCont.gradepositions == "" || this.addCont.gradepositions == null){ |
||||
|
this.tispOrgBox('职务等级!','error'); |
||||
|
return |
||||
|
} |
||||
|
}else{ |
||||
|
this.tispOrgBox('职务等级!','error'); |
||||
|
|
||||
|
return |
||||
|
} |
||||
|
console.log("编辑行政组织----256----->",this.addCont) |
||||
|
if(this.addCont.assigntype){ |
||||
|
if(this.addCont.assigntype == 1){ |
||||
|
let sendJudgeData = { |
||||
|
userkey:this.addCont.id |
||||
|
} |
||||
|
let judgeRes = await judgePrinPosition(sendJudgeData) |
||||
|
if(judgeRes.code != 0){ |
||||
|
this.$confirm(judgeRes.msg, '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
// console.log("新增数据处理------5674---------->",this.addCont) |
||||
|
this.addSendData(1) |
||||
|
}).catch(() => { |
||||
|
this.addCont.assigntype=2 |
||||
|
|
||||
|
this.addSendData(2) |
||||
|
}); |
||||
|
}else{ |
||||
|
this.addSendData(5) |
||||
|
} |
||||
|
}else{ |
||||
|
this.addSendData(3) |
||||
|
} |
||||
|
}else{ |
||||
|
this.addSendData(4) |
||||
|
} |
||||
|
|
||||
|
}else { |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
return false; |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
//添加正式提交数据 |
||||
|
async addSendData(id){ |
||||
|
console.log("添加正式提交数据------"+id+"-------->",this.addCont) |
||||
|
let res = await addInsideHistory(this.addCont) |
||||
|
if(res.code == 0){ |
||||
|
this.$confirm('新增成功!是否继续添加?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
this.initData(); |
||||
|
this.getInsideWorkList(); |
||||
|
this.$forceUpdate() |
||||
|
}).catch(() => { |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
this.getInsideWorkList(); |
||||
|
this.$forceUpdate(); |
||||
|
this.closeAddDialog(); |
||||
|
}); |
||||
|
}else{ |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
} |
||||
|
}, |
||||
|
//提示 |
||||
|
tispOrgBox(msg,typeClass){ |
||||
|
console.log("添加正式提交数据------"+typeClass+"-------->",msg) |
||||
|
this.$message({ |
||||
|
showClose: true, |
||||
|
message: msg, |
||||
|
type: typeClass, |
||||
|
duration:2000, |
||||
|
onClose:this.openOrgButton |
||||
|
}); |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
.tisp_title{ |
||||
|
color: #FF0000; |
||||
|
margin-left: 10px; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,161 @@ |
|||||
|
<template> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-form ref="searform" :model="searchData" label-width="80px" :inline="true" class="demo-form-inline"> |
||||
|
<el-form-item label="行政组织" > |
||||
|
<el-cascader style="width:100%" |
||||
|
filterable |
||||
|
:show-all-levels="true" |
||||
|
v-model="organization" |
||||
|
:options="orgThree" |
||||
|
:props="propsdepart" |
||||
|
clearable |
||||
|
placeholder="查询行政组织" |
||||
|
@change="orgSet" |
||||
|
> |
||||
|
</el-cascader> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="姓名/工号"> |
||||
|
<el-input v-model="searchData.nameorname" placeholder="查询姓名或工号"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="时间"> |
||||
|
<el-date-picker |
||||
|
@change="dayTime" |
||||
|
v-model="yearandmonth" |
||||
|
type="month" |
||||
|
placeholder="选择月"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button type="primary" icon="el-icon-search" @click="searchSubmit">查询</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-col> |
||||
|
<el-col :span="24" class="rostering"> |
||||
|
{{ tableHeadTitle }} |
||||
|
</el-col> |
||||
|
<el-col :span="24"> |
||||
|
<el-table |
||||
|
size="small" |
||||
|
stripe |
||||
|
border |
||||
|
:data="tableData" |
||||
|
style="width: 100%"> |
||||
|
|
||||
|
<el-table-column |
||||
|
v-for="(item, index) in columnData" |
||||
|
:key="index" |
||||
|
:prop="item.name" |
||||
|
:label="item.label" |
||||
|
:align="index==0?'left':'center'" |
||||
|
:fixed="index==0" |
||||
|
:width="index==0?'':52" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
<el-col :span="24"></el-col> |
||||
|
</el-row> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { judgeArray } from "@/api/people/peopledata" |
||||
|
import { govthree } from '@/api/personnel/post' |
||||
|
import { getSchedule } from "@/api/systemaccredit/systemhrapi" |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
columnData: [{name: "name", label: "姓名"},{name: "age", label: "年龄"}, {name: "sex", label: "性别"}], |
||||
|
tableData:[ |
||||
|
{name: "张三", sex: "男",age:1}, |
||||
|
{name: "李四", sex: "女",age:2} |
||||
|
], |
||||
|
organization:"", |
||||
|
yearandmonth:"", |
||||
|
searchData:{ |
||||
|
page:1, |
||||
|
pagesize:10, |
||||
|
total:1, |
||||
|
}, //搜索条件 |
||||
|
tableHeadTitle:"", //排班名称 |
||||
|
orgThree:[], //行政组织树 |
||||
|
propsdepart: { |
||||
|
value: "id", |
||||
|
label: "name", |
||||
|
children: "child", |
||||
|
checkStrictly:true |
||||
|
}, //关联部门 |
||||
|
} |
||||
|
}, |
||||
|
created(){ |
||||
|
this.getOrgThree(); |
||||
|
this.getSchedule(); |
||||
|
}, |
||||
|
methods:{ |
||||
|
//行政组织处理 |
||||
|
orgSet(val){ |
||||
|
// console.log("行政组织处理",val) |
||||
|
if(val){ |
||||
|
if(judgeArray(val) && val.length > 0){ |
||||
|
this.searchData.organization= val[val.length-1]; |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
//处理时间 |
||||
|
dayTime(val){ |
||||
|
if(this.yearandmonth && this.yearandmonth != null){ |
||||
|
let yearVal = this.yearandmonth.getFullYear(); |
||||
|
let monthVal = this.yearandmonth.getMonth()+1; |
||||
|
// let dayVal = this.yearandmonth.getDate(); |
||||
|
if(monthVal < 10) monthVal = "0"+monthVal; |
||||
|
// if(dayVal < 10) dayVal = "0"+dayVal; |
||||
|
// this.searchData.yearandmonth= yearVal + "-" + monthVal + "-" + dayVal |
||||
|
this.searchData.yearandmonth= yearVal + "-" + monthVal |
||||
|
} |
||||
|
}, |
||||
|
//获取行政组织 |
||||
|
async getOrgThree(){ |
||||
|
let sendData = { |
||||
|
id:313, |
||||
|
all:1 |
||||
|
} |
||||
|
const res = await govthree(sendData) |
||||
|
this.orgThree = res.data |
||||
|
}, |
||||
|
//查询按钮 |
||||
|
searchSubmit(){ |
||||
|
console.log("searchData",this.searchData) |
||||
|
}, |
||||
|
//获取排班表 |
||||
|
async getSchedule(){ |
||||
|
let res = await getSchedule(this.searchData) |
||||
|
console.log("获取排班表",res.data) |
||||
|
this.columnData = res.data.headList |
||||
|
this.tableData = res.data.dataList |
||||
|
this.tableHeadTitle=res.data.title |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
.demo-form-inline{ |
||||
|
margin: 10px 0 0 0; |
||||
|
} |
||||
|
.rostering{ |
||||
|
text-align: center; |
||||
|
font-size: 25px; |
||||
|
margin-bottom: 10px; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,86 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<el-table |
||||
|
class="no_table_tr_td_first" |
||||
|
:data="dataList" |
||||
|
:header-cell-style="{ background: '#FAFAFA' }" |
||||
|
> |
||||
|
<el-table-column |
||||
|
v-for="(item, index) in tabelColumns" |
||||
|
:key="index" |
||||
|
:prop="item.prop" |
||||
|
:label="item.label" |
||||
|
v-bind="item.other" |
||||
|
> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="item.prop === 'name'"> |
||||
|
<span class="primary-text" @click="handleDetail(scope.row)">{{scope.row.name}}</span> |
||||
|
</span> |
||||
|
<span v-else>{{ scope.row[item.prop] }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column v-for="(i, index) in [...list]" :key="i.prop" v-bind="i"> |
||||
|
<template slot-scope="{ row }">{{ row.list[index] || '无数据' }}</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
</el-table> |
||||
|
|
||||
|
<div v-bind="{ id: someProp, 'other-attr': otherProp }">123</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data () { |
||||
|
return { |
||||
|
aaa: '123', |
||||
|
someProp: 'someProp', |
||||
|
otherProp: 'otherProp', |
||||
|
list: [], |
||||
|
tabelColumns: [{ |
||||
|
index: 0, |
||||
|
prop: 'number', |
||||
|
label: '号码', |
||||
|
minWidth: '120' |
||||
|
}, { |
||||
|
index: 1, |
||||
|
prop: 'name', |
||||
|
label: '名字', |
||||
|
minWidth: '120' |
||||
|
}, { |
||||
|
index: 2, |
||||
|
prop: 'id', |
||||
|
label: 'ID', |
||||
|
minWidth: '120' |
||||
|
}, { |
||||
|
index: 4, |
||||
|
prop: 'total', |
||||
|
label: '合计', |
||||
|
minWidth: '120' |
||||
|
} |
||||
|
], |
||||
|
dataList: [ |
||||
|
{ |
||||
|
number: 1, |
||||
|
name: 'yibo', |
||||
|
id: '1112333', |
||||
|
total: 10000, |
||||
|
list: ['100', '200', '300'], |
||||
|
col: ['2022-1', '2022-2', '2022-3'] |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
}, |
||||
|
mounted () { |
||||
|
this.list = this.dataList[0].col.map((label, i) => ({ label, prop: `list.${i}` })) |
||||
|
console.log(this.list) |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.primary-text { |
||||
|
color: blue; |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,885 @@ |
|||||
|
<template> |
||||
|
<div class="dashboard-container"> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-row> |
||||
|
<el-col :span="24" class="top_bianjie"> |
||||
|
<el-form ref="searchForm" :model="searchData" label-width="80px" :inline="true" class="demo-form-inline"> |
||||
|
<el-form-item label="名称"> |
||||
|
<el-input v-model="searchData.name"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button type="primary" icon="el-icon-search" @click="searchSubmit">查询</el-button> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button type="warning" icon="el-icon-plus" @click="addNewCont">新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-col> |
||||
|
<el-col :span="24"> |
||||
|
|
||||
|
<template> |
||||
|
<el-table |
||||
|
:data="tableData" |
||||
|
style="width: 100%"> |
||||
|
<el-table-column |
||||
|
prop="name" |
||||
|
label="名称" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="rulename" |
||||
|
label="轮询规则" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="工作时段安排" |
||||
|
> |
||||
|
<template #default="scope"> |
||||
|
<el-row v-for="item in scope.row.list" :key="item.title"> |
||||
|
<el-col :span="24">{{ item.title }} 工作时间:{{ item.startTime }} - {{ item.endTime }}</el-col> |
||||
|
</el-row> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column |
||||
|
label="状态" |
||||
|
> |
||||
|
<template #default="scope"> |
||||
|
<el-switch |
||||
|
@change="switchChange($event,scope.row.id)" |
||||
|
style="display: block" |
||||
|
v-model="scope.row.states" |
||||
|
active-color="#13ce66" |
||||
|
inactive-color="#ff4949" |
||||
|
active-text="启用" |
||||
|
inactive-text="禁用"> |
||||
|
</el-switch> |
||||
|
|
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column align="center" fixed="right" label="操作" width="200" header-align="center"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-setting" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="setOrigin(scope.row)" |
||||
|
>设置源点</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="showEdit(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteOperate(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</template> |
||||
|
|
||||
|
|
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
|
||||
|
<!--添加--> |
||||
|
<el-dialog :close-on-click-modal="false" :visible.sync="showBoxCont.addBox" title="添加信息" :before-close="closeAddDialog" width="60%"> |
||||
|
<el-form ref="addForm" :model="addCont" :rules="addRules" label-width="120px" class="demo-ruleForm"> |
||||
|
<el-form-item label="名称" prop="name"> |
||||
|
<el-input v-model="addCont.name" placeholder="请输入名称"></el-input> |
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
<el-form-item label="工作时间段安排" prop="rule"> |
||||
|
|
||||
|
<template> |
||||
|
<el-table |
||||
|
:data="worktimeList" |
||||
|
border |
||||
|
style="width: 100%"> |
||||
|
<el-table-column |
||||
|
align="center" |
||||
|
prop="title" |
||||
|
label="时段名称" |
||||
|
width="180"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.title" placeholder="请输入名称"></el-input> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
align="center" |
||||
|
label="开始与结束时间" |
||||
|
> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-time-select |
||||
|
style="width: 120px" |
||||
|
placeholder="起始时间" |
||||
|
v-model="scope.row.startTime" |
||||
|
:picker-options="{ |
||||
|
start: '00:00', |
||||
|
step: '01:00', |
||||
|
end: '24:00' |
||||
|
}"> |
||||
|
</el-time-select> |
||||
|
至 |
||||
|
<el-time-select |
||||
|
style="width: 120px" |
||||
|
placeholder="结束时间" |
||||
|
v-model="scope.row.endTime" |
||||
|
:picker-options="{ |
||||
|
start: '00:00', |
||||
|
step: '01:00', |
||||
|
end: '24:00', |
||||
|
minTime: scope.row.startTime |
||||
|
}"> |
||||
|
</el-time-select> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column |
||||
|
align="center" |
||||
|
width="100"> |
||||
|
<template slot="header"> |
||||
|
<el-button type="primary" size="mini" icon="el-icon-plus" @click="addTimeSet()">新增</el-button> |
||||
|
</template> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button type="danger" size="mini" icon="el-icon-delete" @click="delTimeSet(scope)">删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</template> |
||||
|
|
||||
|
</el-form-item> |
||||
|
|
||||
|
|
||||
|
<el-form-item label="轮询规则" prop="rule"> |
||||
|
<template> |
||||
|
<el-table |
||||
|
:data="ruleList" |
||||
|
border |
||||
|
style="width: 100%"> |
||||
|
<el-table-column |
||||
|
align="center" |
||||
|
prop="sort" |
||||
|
label="排序" |
||||
|
width="180"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.sort" placeholder="请输入序号" disabled></el-input> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
align="center" |
||||
|
prop="name" |
||||
|
label="班组" |
||||
|
> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-select v-model="scope.row.teamid" clearable placeholder="请选择"> |
||||
|
<el-option |
||||
|
v-for="item in teamcontlist" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column |
||||
|
align="center" |
||||
|
width="100"> |
||||
|
<template slot="header"> |
||||
|
<el-button type="primary" size="mini" icon="el-icon-plus" @click="addTimeRuleSet()">新增</el-button> |
||||
|
</template> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button type="danger" size="mini" icon="el-icon-delete" @click="delTimeRuleSet(scope)">删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</template> |
||||
|
</el-form-item> |
||||
|
|
||||
|
</el-form> |
||||
|
|
||||
|
|
||||
|
<template #footer class="el_dialog__footer"> |
||||
|
<div class="dialog-footer "> |
||||
|
<el-button size="small" type="primary" @click="addContsubmit" :loading="showBoxCont.addBoxIsTrue">确 定</el-button> |
||||
|
<el-button size="small" @click="closeAddDialog">取 消</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
|
||||
|
|
||||
|
<!--编辑--> |
||||
|
<el-dialog :close-on-click-modal="false" :visible.sync="showBoxCont.editBox" title="编辑信息" :before-close="closeEditDialog" width="60%"> |
||||
|
<el-form ref="editForm" :model="editCont" :rules="addRules" label-width="120px" class="demo-ruleForm"> |
||||
|
<el-form-item label="名称" prop="name"> |
||||
|
<el-input v-model="editCont.name" placeholder="请输入名称"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="工作时间段安排" prop="rule"> |
||||
|
|
||||
|
<template> |
||||
|
<el-table |
||||
|
:data="worktimeList" |
||||
|
border |
||||
|
style="width: 100%"> |
||||
|
<el-table-column |
||||
|
align="center" |
||||
|
prop="title" |
||||
|
label="时段名称" |
||||
|
width="180"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.title" placeholder="请输入名称"></el-input> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
align="center" |
||||
|
label="开始与结束时间" |
||||
|
> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-time-select |
||||
|
style="width: 120px" |
||||
|
placeholder="起始时间" |
||||
|
v-model="scope.row.startTime" |
||||
|
:picker-options="{ |
||||
|
start: '00:00', |
||||
|
step: '01:00', |
||||
|
end: '24:00' |
||||
|
}"> |
||||
|
</el-time-select> |
||||
|
至 |
||||
|
<el-time-select |
||||
|
style="width: 120px" |
||||
|
placeholder="结束时间" |
||||
|
v-model="scope.row.endTime" |
||||
|
:picker-options="{ |
||||
|
start: '00:00', |
||||
|
step: '01:00', |
||||
|
end: '24:00', |
||||
|
minTime: scope.row.startTime |
||||
|
}"> |
||||
|
</el-time-select> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column |
||||
|
align="center" |
||||
|
width="100"> |
||||
|
<template slot="header"> |
||||
|
<el-button type="primary" size="mini" icon="el-icon-plus" @click="addTimeSet()">新增</el-button> |
||||
|
</template> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button type="danger" size="mini" icon="el-icon-delete" @click="delTimeSet(scope)">删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</template> |
||||
|
|
||||
|
</el-form-item> |
||||
|
<el-form-item label="轮询规则" prop="rule"> |
||||
|
<template> |
||||
|
<el-table |
||||
|
:data="ruleList" |
||||
|
border |
||||
|
style="width: 100%"> |
||||
|
<el-table-column |
||||
|
align="center" |
||||
|
prop="sort" |
||||
|
label="排序" |
||||
|
width="180"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.sort" placeholder="请输入序号" disabled></el-input> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
align="center" |
||||
|
prop="name" |
||||
|
label="班组" |
||||
|
> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-select v-model="scope.row.teamid" clearable placeholder="请选择"> |
||||
|
<el-option |
||||
|
v-for="item in teamcontlist" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column |
||||
|
align="center" |
||||
|
width="100"> |
||||
|
<template slot="header"> |
||||
|
<el-button type="primary" size="mini" icon="el-icon-plus" @click="addTimeRuleSet()">新增</el-button> |
||||
|
</template> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button type="danger" size="mini" icon="el-icon-delete" @click="delTimeRuleSet(scope)">删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</template> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
|
||||
|
<template #footer class="el_dialog__footer"> |
||||
|
<div class="dialog-footer "> |
||||
|
<el-button size="small" type="primary" @click="editContsubmit" :loading="showBoxCont.editBoxIsTrue">确 定</el-button> |
||||
|
<el-button size="small" @click="closeEditDialog">取 消</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<!--设置源点--> |
||||
|
<el-dialog :close-on-click-modal="false" :visible.sync="showBoxCont.setOrigin" title="设置源点" :before-close="closeOriginDialog" width="40%"> |
||||
|
|
||||
|
<el-form ref="editOriginForm" :model="editOriginCont" :rules="addOriginRules" label-width="120px" class="demo-ruleForm"> |
||||
|
<el-form-item label="源点日期" prop="starttimestr"> |
||||
|
<el-date-picker |
||||
|
v-model="editOriginCont.starttimestr" |
||||
|
format="yyyy 年 MM 月 dd 日" |
||||
|
@change="setOriginTime" |
||||
|
type="date" |
||||
|
placeholder="选择日期"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="源点工作时段" prop="shifttime"> |
||||
|
<el-select v-model="editOriginCont.shifttime" clearable placeholder="请选择"> |
||||
|
<el-option |
||||
|
v-for="item in periodList" |
||||
|
:key="item.id" |
||||
|
:label="item.title" |
||||
|
:value="item.id"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="轮询点" prop="rule"> |
||||
|
<el-select v-model="editOriginCont.rule" clearable placeholder="请选择"> |
||||
|
<el-option |
||||
|
v-for="item in rulesList" |
||||
|
:key="item.id" |
||||
|
:label="item.teamname" |
||||
|
:value="item.id"> |
||||
|
<span style="float: left">{{ item.teamname }}</span> |
||||
|
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.sort }}</span> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<template #footer class="el_dialog__footer"> |
||||
|
<div class="dialog-footer "> |
||||
|
<el-button size="small" type="primary" @click="setOriginContsubmit" :loading="showBoxCont.setOriginIsTrue">确 定</el-button> |
||||
|
<el-button size="small" @click="closeOriginDialog">取 消</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { teamTimeList,addTeamTime,editWorkTimeState,editWorkTimeCont,getPeriodAndRuleList,setOirginCont } from "@/api/systemaccredit/systemhrapi" |
||||
|
import { teamcontlist } from "@/api/personnel/post" |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
startTime:"", |
||||
|
endTime:"", |
||||
|
showBoxCont:{ |
||||
|
addBox:false, |
||||
|
addBoxIsTrue:false, |
||||
|
editBox:false, |
||||
|
editBoxIsTrue:false, |
||||
|
setOrigin:false, |
||||
|
setOriginIsTrue:false, |
||||
|
}, |
||||
|
worktimeList:[ |
||||
|
{ |
||||
|
title:"", |
||||
|
startTime:"", |
||||
|
endTime:"" |
||||
|
}, |
||||
|
], |
||||
|
searchData:{}, |
||||
|
tableData:[], |
||||
|
addCont:{ |
||||
|
name:"", |
||||
|
}, //添加信息 |
||||
|
editCont:{ |
||||
|
name:"", |
||||
|
}, //编辑信息 |
||||
|
addRules:{}, //验证信息 |
||||
|
teamcontlist:[], //班组 |
||||
|
ruleList:[ |
||||
|
{ |
||||
|
sort:1, |
||||
|
teamid:"" |
||||
|
} |
||||
|
], //轮询规则 |
||||
|
editOriginCont:{}, //源点数据 |
||||
|
addOriginRules:{ |
||||
|
starttimestr: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
shifttime: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
rule: [{ required: true, message: '必填', trigger: 'blur' }], |
||||
|
}, //源点验证规则 |
||||
|
periodList:[], //工作时段 |
||||
|
rulesList:[], //轮询规则 |
||||
|
} |
||||
|
}, |
||||
|
created(){ |
||||
|
this.getList() |
||||
|
this.getTeam() |
||||
|
}, |
||||
|
methods:{ |
||||
|
//获取班组 |
||||
|
async getTeam(){ |
||||
|
let res = await teamcontlist(); |
||||
|
this.teamcontlist = res.data.list |
||||
|
console.log("班组---------------->",res,res.list) |
||||
|
}, |
||||
|
//数据列表 |
||||
|
async getList(){ |
||||
|
let res = await teamTimeList(this.searchData) |
||||
|
// console.log("数据列表",res.data) |
||||
|
if(res.code == 0){ |
||||
|
this.tableData = res.data |
||||
|
} |
||||
|
}, |
||||
|
//查询 |
||||
|
async searchSubmit(){ |
||||
|
this.getList() |
||||
|
}, |
||||
|
//删除时间段 |
||||
|
delTimeSet(val){ |
||||
|
// console.log("删除时间段",val) |
||||
|
this.worktimeList.splice(val.$index,1); |
||||
|
}, |
||||
|
//删除轮询规则 |
||||
|
delTimeRuleSet(val){ |
||||
|
this.ruleList.splice(val.$index,1); |
||||
|
this.ruleList.forEach((item,index)=>{ |
||||
|
item.sort = index+1 |
||||
|
}) |
||||
|
}, |
||||
|
//新增 |
||||
|
addNewCont(){ |
||||
|
this.showBoxCont.addBox = true; |
||||
|
}, |
||||
|
//添加数据提交 |
||||
|
async addContsubmit(){ |
||||
|
this.showBoxCont.addBoxIsTrue = true; |
||||
|
if(!this.addCont.name){ |
||||
|
this.$message.error('请输入名称'); |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
return; |
||||
|
}else{ |
||||
|
if(this.addCont.name == "" || this.addCont.name == null){ |
||||
|
this.$message.error('请输入名称'); |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
return; |
||||
|
} |
||||
|
} |
||||
|
if(this.ruleList.length < 1){ |
||||
|
this.$message.error('请输入轮询规则!'); |
||||
|
this.showBoxCont.editBoxIsTrue = false; |
||||
|
return; |
||||
|
} |
||||
|
if(this.worktimeList.length < 1){ |
||||
|
this.$message.error('请输入工作时间安排!'); |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
return; |
||||
|
} |
||||
|
let adopt = true; |
||||
|
let sendList = new Array() |
||||
|
this.worktimeList.forEach(item=>{ |
||||
|
if(item.title == "" || item.title == null || item.startTime == "" || item.startTime == null || item.endTime == "" || item.endTime == null){ |
||||
|
adopt = false; |
||||
|
} |
||||
|
let sendCont = { |
||||
|
title: item.title, |
||||
|
startTime: item.startTime, |
||||
|
endTime: item.endTime |
||||
|
} |
||||
|
sendList.push(sendCont) |
||||
|
}) |
||||
|
if(!adopt){ |
||||
|
this.$message.error('时间安排有不符合要求的!请慎重检查!'); |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
return; |
||||
|
} |
||||
|
let ruleIstrue = true; |
||||
|
let ruleAry = new Array() |
||||
|
this.ruleList.forEach(itemRule=>{ |
||||
|
if(itemRule.sort == 0 || itemRule.sort == "" || itemRule.sort == null || itemRule.teamid == 0 || itemRule.teamid == "" || itemRule.teamid == null){ |
||||
|
ruleIstrue = false; |
||||
|
} |
||||
|
let sendRuleCont = { |
||||
|
sort: itemRule.sort, |
||||
|
teamid: itemRule.teamid.toString(), |
||||
|
} |
||||
|
ruleAry.push(sendRuleCont) |
||||
|
}) |
||||
|
if(!ruleIstrue){ |
||||
|
this.$message.error('轮询规则有不符合要求的!请慎重检查!'); |
||||
|
this.showBoxCont.editBoxIsTrue = false; |
||||
|
return; |
||||
|
} |
||||
|
// console.log("新增",this.addCont,this.worktimeList) |
||||
|
|
||||
|
var sendData = { |
||||
|
name: this.addCont.name, |
||||
|
rule: ruleAry, |
||||
|
list:sendList, |
||||
|
} |
||||
|
|
||||
|
let res = await addTeamTime(sendData) |
||||
|
if(res.code == 0){ |
||||
|
this.$confirm('新增成功!是否继续添加?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
this.initData(); |
||||
|
this.getList() |
||||
|
this.$forceUpdate() |
||||
|
}).catch(() => { |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
this.getList() |
||||
|
this.$forceUpdate(); |
||||
|
this.closeAddDialog(); |
||||
|
}); |
||||
|
}else{ |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
} |
||||
|
}, |
||||
|
//关闭添加弹窗 |
||||
|
closeAddDialog(){ |
||||
|
this.showBoxCont.addBox = false; |
||||
|
this.showBoxCont.addBoxIsTrue = false; |
||||
|
this.initData(); |
||||
|
}, |
||||
|
//编辑 |
||||
|
showEdit(val){ |
||||
|
console.log("编辑",val) |
||||
|
if(val.list && val.list.length > 0){ |
||||
|
let tiemAry = new Array |
||||
|
val.list.forEach(item=>{ |
||||
|
let timelCont = { |
||||
|
id:item.id, |
||||
|
title:item.title, |
||||
|
startTime:item.startTime, |
||||
|
endTime:item.endTime, |
||||
|
} |
||||
|
tiemAry.push(timelCont) |
||||
|
}); |
||||
|
this.worktimeList = tiemAry |
||||
|
} |
||||
|
|
||||
|
|
||||
|
if(val.rule && val.rule.length > 0){ |
||||
|
let ruleAry = new Array |
||||
|
val.rule.forEach(items=>{ |
||||
|
let timelContRule = { |
||||
|
id:items.id, |
||||
|
sort:items.sort, |
||||
|
teamid:items.teamid*1 |
||||
|
} |
||||
|
ruleAry.push(timelContRule) |
||||
|
}) |
||||
|
this.ruleList = ruleAry |
||||
|
} |
||||
|
|
||||
|
|
||||
|
this.editCont = { |
||||
|
id:val.id, |
||||
|
name:val.name, |
||||
|
// list:tiemAry |
||||
|
} |
||||
|
console.log("编辑--------->",this.editCont,this.ruleList,this.worktimeList) |
||||
|
this.showBoxCont.editBox = true; |
||||
|
}, |
||||
|
//编辑数据提交 |
||||
|
async editContsubmit(){ |
||||
|
this.showBoxCont.editBoxIsTrue = true; |
||||
|
if(!this.editCont.name){ |
||||
|
this.$message.error('请输入名称'); |
||||
|
this.showBoxCont.editBoxIsTrue = false; |
||||
|
return; |
||||
|
}else{ |
||||
|
if(this.editCont.name == "" || this.editCont.name == null){ |
||||
|
this.$message.error('请输入名称'); |
||||
|
this.showBoxCont.editBoxIsTrue = false; |
||||
|
return; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if(this.worktimeList.length < 1){ |
||||
|
this.$message.error('请输入工作时间安排!'); |
||||
|
this.showBoxCont.editBoxIsTrue = false; |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
if(this.ruleList.length < 1){ |
||||
|
this.$message.error('请输入轮询规则!'); |
||||
|
this.showBoxCont.editBoxIsTrue = false; |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
let adopt = true; |
||||
|
let sendList = new Array() |
||||
|
this.worktimeList.forEach(item=>{ |
||||
|
if(item.title == "" || item.title == null || item.startTime == "" || item.startTime == null || item.endTime == "" || item.endTime == null){ |
||||
|
adopt = false; |
||||
|
} |
||||
|
let sendCont = { |
||||
|
id:item.id, |
||||
|
title: item.title, |
||||
|
startTime: item.startTime, |
||||
|
endTime: item.endTime |
||||
|
} |
||||
|
sendList.push(sendCont) |
||||
|
}) |
||||
|
if(!adopt){ |
||||
|
this.$message.error('时间安排有不符合要求的!请慎重检查!'); |
||||
|
this.showBoxCont.editBoxIsTrue = false; |
||||
|
return; |
||||
|
} |
||||
|
let ruleIstrue = true; |
||||
|
let ruleAry = new Array() |
||||
|
this.ruleList.forEach(itemRule=>{ |
||||
|
if(itemRule.sort == 0 || itemRule.sort == "" || itemRule.sort == null || itemRule.teamid == 0 || itemRule.teamid == "" || itemRule.teamid == null){ |
||||
|
ruleIstrue = false; |
||||
|
} |
||||
|
let sendRuleCont = { |
||||
|
id:itemRule.id, |
||||
|
sort: itemRule.sort, |
||||
|
teamid: itemRule.teamid.toString(), |
||||
|
} |
||||
|
ruleAry.push(sendRuleCont) |
||||
|
}) |
||||
|
if(!ruleIstrue){ |
||||
|
this.$message.error('轮询规则有不符合要求的!请慎重检查!'); |
||||
|
this.showBoxCont.editBoxIsTrue = false; |
||||
|
return; |
||||
|
} |
||||
|
var sendData = { |
||||
|
id:this.editCont.id, |
||||
|
name: this.editCont.name, |
||||
|
rule: ruleAry, |
||||
|
list:sendList |
||||
|
} |
||||
|
console.log("班组---------sendData------->",sendData) |
||||
|
let res = await editWorkTimeCont(sendData) |
||||
|
if(res.code == 0){ |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getList() |
||||
|
this.closeEditDialog() |
||||
|
this.showBoxCont.editBoxIsTrue = false; |
||||
|
}, |
||||
|
//关闭编辑弹窗 |
||||
|
closeEditDialog(){ |
||||
|
this.showBoxCont.editBox = false; |
||||
|
this.initData(); |
||||
|
}, |
||||
|
//删除 |
||||
|
async deleteOperate(val){ |
||||
|
|
||||
|
|
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '是否删除?', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(async() => { |
||||
|
let sendData = { |
||||
|
id:val.id, |
||||
|
state:3, |
||||
|
constrain:2 |
||||
|
} |
||||
|
const respon = await editWorkTimeState(sendData) |
||||
|
if (respon.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getList() |
||||
|
} |
||||
|
|
||||
|
}) |
||||
|
}, |
||||
|
//新增工作时间段 |
||||
|
addTimeSet(){ |
||||
|
this.worktimeList.push({ |
||||
|
id:"", |
||||
|
title:"", |
||||
|
startTime:"", |
||||
|
endTime:"" |
||||
|
}) |
||||
|
}, |
||||
|
//新增工作轮询规则 |
||||
|
addTimeRuleSet(){ |
||||
|
let countNum = this.ruleList.length |
||||
|
this.ruleList.push( |
||||
|
{ |
||||
|
id:"", |
||||
|
sort:countNum+1, |
||||
|
teamid:"" |
||||
|
} |
||||
|
) |
||||
|
}, |
||||
|
//数据初始化 |
||||
|
initData(){ |
||||
|
this.worktimeList =[ |
||||
|
{ |
||||
|
title:"", |
||||
|
startTime:"", |
||||
|
endTime:"" |
||||
|
}, |
||||
|
]; |
||||
|
this.ruleList=[ |
||||
|
{ |
||||
|
sort:1, |
||||
|
teamid:"" |
||||
|
} |
||||
|
]; |
||||
|
this.addCont = {}; |
||||
|
this.editCont = {}; |
||||
|
}, |
||||
|
//状态改变 |
||||
|
async switchChange(val,id){ |
||||
|
console.log("状态改变",val,id) |
||||
|
let setState = 2; |
||||
|
if(val) setState = 1; |
||||
|
let sendData = { |
||||
|
id:id, |
||||
|
state:setState, |
||||
|
constrain:2 |
||||
|
} |
||||
|
const respon = await editWorkTimeState(sendData) |
||||
|
this.getList() |
||||
|
}, |
||||
|
//设置源点 |
||||
|
async setOrigin(val){ |
||||
|
this.editOriginCont.id = val.id |
||||
|
console.log("设置源点",val) |
||||
|
let sendData = { |
||||
|
id:val.id |
||||
|
} |
||||
|
let res = await getPeriodAndRuleList(sendData) |
||||
|
console.log("设置源点------------->",val,res) |
||||
|
this.periodList = res.data.list //工作时段 |
||||
|
this.rulesList = res.data.rule //轮询规则 |
||||
|
this.showBoxCont.setOrigin = true; |
||||
|
if(res.code == 0){ |
||||
|
this.editOriginCont = { |
||||
|
id:val.id, |
||||
|
starttime:res.data.time, |
||||
|
starttimestr:res.data.time, |
||||
|
shifttime:res.data.teamid, |
||||
|
rule:res.data.ruleid |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
//关闭设置源点页面 |
||||
|
closeOriginDialog(){ |
||||
|
this.showBoxCont.setOrigin = false; |
||||
|
this.showBoxCont.setOriginIsTrue = false; |
||||
|
|
||||
|
this.initOrigin() |
||||
|
}, |
||||
|
//提交源点数据设置 |
||||
|
setOriginContsubmit(){ |
||||
|
this.showBoxCont.setOriginIsTrue = true; |
||||
|
console.log("提交源点数据设置------------->",this.editOriginCont) |
||||
|
this.$refs.editOriginForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
// this.showBoxCont.setOriginIsTrue = false; |
||||
|
let res = await setOirginCont(this.editOriginCont) |
||||
|
this.getList() |
||||
|
this.closeOriginDialog() |
||||
|
}else{ |
||||
|
this.showBoxCont.setOriginIsTrue = false; |
||||
|
} |
||||
|
}); |
||||
|
this.showBoxCont.setOriginIsTrue = false; |
||||
|
}, |
||||
|
//初始化源点设置数据 |
||||
|
initOrigin(){ |
||||
|
this.periodList=[] //工作时段 |
||||
|
this.rulesList=[] //轮询规则 |
||||
|
this.editOriginCont = { |
||||
|
id:"", |
||||
|
starttime:"", |
||||
|
starttimestr:"", |
||||
|
shifttime:"", |
||||
|
rule:"" |
||||
|
} |
||||
|
}, |
||||
|
//设置时间 |
||||
|
setOriginTime(){ |
||||
|
if(this.editOriginCont.starttimestr && this.editOriginCont.starttimestr != null){ |
||||
|
let yearVal = this.editOriginCont.starttimestr.getFullYear(); |
||||
|
let monthVal = this.editOriginCont.starttimestr.getMonth()+1; |
||||
|
let dayVal = this.editOriginCont.starttimestr.getDate(); |
||||
|
if(monthVal < 10) monthVal = "0"+monthVal; |
||||
|
if(dayVal < 10) dayVal = "0"+dayVal; |
||||
|
this.editOriginCont.starttime= yearVal + "-" + monthVal + "-" + dayVal |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
|
||||
|
</style> |
||||
|
<style lang="scss" scoped> |
||||
|
.dashboard { |
||||
|
&-container { |
||||
|
margin: 30px; |
||||
|
} |
||||
|
&-text { |
||||
|
font-size: 30px; |
||||
|
line-height: 46px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,89 @@ |
|||||
|
<template> |
||||
|
<el-main > |
||||
|
<workflow |
||||
|
:data="data" |
||||
|
@ok="ok" |
||||
|
/> |
||||
|
</el-main> |
||||
|
</template> |
||||
|
<script> |
||||
|
import workflow from 'workflow-ui/src/components/Generator' |
||||
|
import 'workflow-ui/lib/workflow-ui.css' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
workflow |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
data:{}, |
||||
|
title: '请假', |
||||
|
node: { |
||||
|
name: '发起人', |
||||
|
type: 'start', |
||||
|
nodeId: 'sid-startevent', |
||||
|
childNode: {} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
created(){ |
||||
|
|
||||
|
}, |
||||
|
computed:{ |
||||
|
// selectedNode(){ |
||||
|
// return this.$store.state.selectedNode |
||||
|
// } |
||||
|
}, |
||||
|
methods:{ |
||||
|
ok (data) { |
||||
|
console.log("ok------>",data) |
||||
|
}, |
||||
|
toReturn() { |
||||
|
//window.location.href = "" |
||||
|
}, |
||||
|
async saveData() { |
||||
|
console.log("发布流程") |
||||
|
}, |
||||
|
validate(){ |
||||
|
return this.$refs["process-tree"].validateProcess() |
||||
|
}, |
||||
|
nodeSelected(node){ |
||||
|
console.log('配置节点', node) |
||||
|
this.showConfig = true |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
|
||||
|
</style> |
||||
|
<style lang="less" scoped> |
||||
|
.design { |
||||
|
margin-top: 100px; |
||||
|
display: flex; |
||||
|
transform-origin: 50% 0px 0px; |
||||
|
} |
||||
|
|
||||
|
.scale { |
||||
|
z-index: 999; |
||||
|
position: fixed; |
||||
|
top: 80px; |
||||
|
right: 40px; |
||||
|
|
||||
|
span { |
||||
|
margin: 0 10px; |
||||
|
font-size: 15px; |
||||
|
color: #7a7a7a; |
||||
|
width: 50px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.node-config-content{ |
||||
|
padding: 0 20px 20px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .el-drawer__body{ |
||||
|
overflow-y: auto; |
||||
|
} |
||||
|
</style> |
||||