|
|
@ -1,131 +1,65 @@ |
|
|
|
<template> |
|
|
|
<div class="app-container"> |
|
|
|
<div v-show="viewState == 1"> |
|
|
|
<button-bar |
|
|
|
ref="btnbar" |
|
|
|
view-title="员工管理" |
|
|
|
:btndisabled="btndisabled" |
|
|
|
@btnhandle="btnHandle" |
|
|
|
/> |
|
|
|
<button-bar ref="btnbar" view-title="员工管理" :btndisabled="btndisabled" @btnhandle="btnHandle"/> |
|
|
|
<div class="searchcon"> |
|
|
|
<el-button |
|
|
|
size="small" |
|
|
|
class="searchbtn" |
|
|
|
@click="isSearchShow = !isSearchShow" |
|
|
|
> |
|
|
|
{{ isSearchShow ? "隐藏查询条件" : "显示藏查询条件" }} |
|
|
|
</el-button> |
|
|
|
<el-button size="small" class="searchbtn" @click="isSearchShow = !isSearchShow">{{ isSearchShow ? "隐藏查询条件" : "显示藏查询条件" }}</el-button> |
|
|
|
<div v-show="isSearchShow" class="search"> |
|
|
|
<el-form :inline="true" class="tab-header"> |
|
|
|
<el-form-item label="员工姓名" label-width="85px"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.params.name" |
|
|
|
placeholder="请输入员工姓名" |
|
|
|
clearable |
|
|
|
class="filter-item" |
|
|
|
/> |
|
|
|
<el-row> |
|
|
|
<el-form-item label="员工姓名"> |
|
|
|
<el-input v-model="queryParams.params.name" placeholder="请输入员工姓名" clearable class="addinputw"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="员工类型" label-width="85px"> |
|
|
|
<el-select |
|
|
|
v-model="queryParams.params.personType" |
|
|
|
class="addinputw" |
|
|
|
placeholder="请选择员工类型" |
|
|
|
@change="getPersonType" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in personType_list" |
|
|
|
:key="index.dictKey" |
|
|
|
:label="item.dictValue" |
|
|
|
:value="item.dictKey" |
|
|
|
/> |
|
|
|
<el-form-item label="员工类型"> |
|
|
|
<el-select v-model="queryParams.params.personTypeKey" class="addinputw" placeholder="请选择员工类型"> |
|
|
|
<el-option v-for="(item, index) in personType_list" :key="index.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="联系电话" label-width="85px"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.params.mobile" |
|
|
|
placeholder="请输入联系电话" |
|
|
|
clearable |
|
|
|
class="filter-item" |
|
|
|
/> |
|
|
|
<el-form-item label="联系电话"> |
|
|
|
<el-input v-model="queryParams.params.mobile" placeholder="请输入联系电话" clearable class="addinputw"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="所在部门" label-width="85px"> |
|
|
|
<el-cascader |
|
|
|
v-model="orgName_list" |
|
|
|
:props="props" |
|
|
|
:options="options" |
|
|
|
@change="orgNameChange" |
|
|
|
/> |
|
|
|
<el-form-item label="所在部门"> |
|
|
|
<el-cascader v-model="orgName_list" :props="props" :options="options" class="addinputw" style="line-height: 32px" @change="orgNameChange"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="所在岗位" label-width="85px"> |
|
|
|
<el-select |
|
|
|
v-model="queryParams.params.postSid" |
|
|
|
class="addinputw" |
|
|
|
placeholder="请选择岗位" |
|
|
|
@change="getPostSid" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in postSid_list" |
|
|
|
:key="index.postCode" |
|
|
|
:label="item.name" |
|
|
|
:value="item.postCode" |
|
|
|
/> |
|
|
|
<el-form-item label="所在岗位"> |
|
|
|
<el-select v-model="queryParams.params.postSid" class="addinputw" placeholder="请选择岗位"> |
|
|
|
<el-option v-for="(item) in postSid_list" :key="item.sid" :label="item.name" :value="item.sid"/> |
|
|
|
</el-select> |
|
|
|
<!-- <el-input v-model="queryParams.params.postName" placeholder="请输入所在岗位" clearable class="filter-item"/> --> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="入职日期" label-width="85px"> |
|
|
|
<el-date-picker |
|
|
|
v-model="queryParams.params.joinCompnyDateStart" |
|
|
|
type="date" |
|
|
|
placeholder="选择日期" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
/> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-form-item label="入职日期"> |
|
|
|
<!-- <el-date-picker v-model="queryParams.params.joinCompnyDateStart" type="date" class="addinputw" placeholder="选择日期" value-format="yyyy-MM-dd"/>--> |
|
|
|
<div class="block" style="float: left;"> |
|
|
|
<el-date-picker v-model="queryParams.params.joinCompnyDateStart" type="date" value-format="yyyy-MM-dd" placeholder="开始日期"> |
|
|
|
</el-date-picker> |
|
|
|
</div> |
|
|
|
<div style="float: left;margin: 0 5px">至</div> |
|
|
|
<div class="block" style="float: left;"> |
|
|
|
<el-date-picker v-model="queryParams.params.joinCompnyDateEnd" type="date" value-format="yyyy-MM-dd" placeholder="结束日期"> |
|
|
|
</el-date-picker> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-row> |
|
|
|
<el-divider/> |
|
|
|
<div |
|
|
|
style="text-align: center; position: relative; margin-left: -75px" |
|
|
|
> |
|
|
|
<div style="text-align: center; position: relative; margin-left: -75px"> |
|
|
|
<el-button type="primary" @click="dosearch">查询</el-button> |
|
|
|
<el-button type="primary" @click="resetQuery">重置</el-button> |
|
|
|
</div> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!--Start 项目列表头部--> |
|
|
|
<div class="listtop"> |
|
|
|
<div class="tit">员工信息列表</div> |
|
|
|
<pageye |
|
|
|
v-show="dataList.length > 0" |
|
|
|
:total="queryParams.total" |
|
|
|
:page.sync="queryParams.current" |
|
|
|
:limit.sync="queryParams.size" |
|
|
|
class="pagination" |
|
|
|
@pagination="loadList" |
|
|
|
/> |
|
|
|
<pageye v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current" :limit.sync="queryParams.size" class="pagination" @pagination="loadList"/> |
|
|
|
</div> |
|
|
|
<!--End 项目列表头部--> |
|
|
|
|
|
|
|
<!--Start 项目列表--> |
|
|
|
<div class="listcon"> |
|
|
|
<el-table |
|
|
|
v-loading="tableLoading" |
|
|
|
:data="dataList" |
|
|
|
border |
|
|
|
style="width: 100%" |
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
> |
|
|
|
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%" @selection-change="handleSelectionChange"> |
|
|
|
<el-table-column width="50px" type="selection" align="center"/> |
|
|
|
<el-table-column |
|
|
|
width="80px" |
|
|
|
label="序号" |
|
|
|
type="index" |
|
|
|
:index="indexMethod" |
|
|
|
align="center" |
|
|
|
/> |
|
|
|
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center"/> |
|
|
|
<el-table-column prop="jobNumber" label="员工编号" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span class="tablerow-click" @click="toInfo(scope.row)">{{ |
|
|
|
scope.row.jobNumber |
|
|
|
}}</span> |
|
|
|
<span class="tablerow-click" @click="toInfo(scope.row)">{{ scope.row.jobNumber }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="name" label="员工姓名" align="center"/> |
|
|
@ -133,86 +67,28 @@ |
|
|
|
<el-table-column prop="mobile" label="手机号" align="center"/> |
|
|
|
<el-table-column prop="orgName" label="所在部门" align="center"/> |
|
|
|
<el-table-column prop="postName" label="岗位" align="center"/> |
|
|
|
<el-table-column |
|
|
|
prop="joinCompnyDate" |
|
|
|
label="入职日期" |
|
|
|
align="center" |
|
|
|
/> |
|
|
|
<el-table-column prop="joinCompnyDate" label="入职日期" align="center"/> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<!--End 项目列表--> |
|
|
|
<div class="pages"> |
|
|
|
<div class="tit"/> |
|
|
|
<!-- 翻页 --> |
|
|
|
<pagination |
|
|
|
v-show="dataList.length > 0" |
|
|
|
:total="queryParams.total" |
|
|
|
:page.sync="queryParams.current" |
|
|
|
:limit.sync="queryParams.size" |
|
|
|
class="pagination" |
|
|
|
@pagination="loadList" |
|
|
|
/> |
|
|
|
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current" :limit.sync="queryParams.size" class="pagination" @pagination="loadList"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!--End 查询和其列表部分--> |
|
|
|
<yuangong-add |
|
|
|
v-show="viewState == 2 || viewState == 3" |
|
|
|
ref="divadd" |
|
|
|
@doback="resetState" |
|
|
|
@reloadlist="loadList" |
|
|
|
/> |
|
|
|
<yuangong-info |
|
|
|
v-show="viewState == 4" |
|
|
|
ref="divinfo" |
|
|
|
@doback="resetState" |
|
|
|
/> |
|
|
|
|
|
|
|
<el-dialog |
|
|
|
title="客户登记-类型" |
|
|
|
:visible.sync="dialogVisible" |
|
|
|
width="40%" |
|
|
|
top="13%" |
|
|
|
> |
|
|
|
<el-form :model="personTypeForm"> |
|
|
|
<el-form-item label="员工类型" class="diaForm"> |
|
|
|
<el-select |
|
|
|
v-model="personTypeForm.personType" |
|
|
|
class="addinputw" |
|
|
|
placeholder="请选择员工类型" |
|
|
|
@change="getPersonType" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in personType_list" |
|
|
|
:key="index.dictKey" |
|
|
|
:label="item.dictValue" |
|
|
|
:value="item.dictKey" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="离职时间" class="diaForm"> |
|
|
|
<el-date-picker |
|
|
|
v-model="personTypeForm.quitDate" |
|
|
|
type="date" |
|
|
|
placeholder="选择日期" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
/> |
|
|
|
<yuangong-add v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList"/> |
|
|
|
<yuangong-info v-show="viewState == 4" ref="divinfo" @doback="resetState"/> |
|
|
|
<el-dialog title="" :visible.sync="dialogVisible" width="40%" top="13%" center> |
|
|
|
<el-form :model="personTypeForm" label-position="top"> |
|
|
|
<el-form-item label="离职时间"> |
|
|
|
<el-date-picker v-model="personTypeForm.quitDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="离职理由" class="diaForm"> |
|
|
|
<el-input |
|
|
|
v-model="personTypeForm.quitReason" |
|
|
|
maxlength="5" |
|
|
|
placeholder="请输入紧急联系电话" |
|
|
|
class="lizhiliyou" |
|
|
|
clearable |
|
|
|
/> |
|
|
|
<el-form-item label="离职理由"> |
|
|
|
<el-input v-model="personTypeForm.quitReason" maxlength="100" placeholder="" type="textarea" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button |
|
|
|
class="el-button-sure" |
|
|
|
type="primary" |
|
|
|
@click="handleOpen()" |
|
|
|
>确 定</el-button> |
|
|
|
<el-button class="el-button-sure" type="primary" @click="handleOpen()">确 定</el-button> |
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
@ -224,7 +100,6 @@ import req from '@/api/management/yuangongguanli' |
|
|
|
import ButtonBar from '@/components/ButtonBar' |
|
|
|
import Pagination from '@/components/pagination' |
|
|
|
import pageye from '@/components/pagination/pageye' |
|
|
|
import { setuser, getuser } from '@/utils/baocun' |
|
|
|
import yuangongAdd from './yuangongAdd' |
|
|
|
import yuangongInfo from './yuangongInfo' |
|
|
|
|
|
|
@ -239,7 +114,6 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
pageType: 'staff', |
|
|
|
dialogVisible: false, // 弹窗 |
|
|
|
btndisabled: false, |
|
|
|
viewState: 1, // 1、列表 2、添加 3、修改 4、查看 |
|
|
@ -269,8 +143,60 @@ export default { |
|
|
|
current: 1, |
|
|
|
size: 10, |
|
|
|
total: 0, |
|
|
|
params: {} |
|
|
|
params: { |
|
|
|
joinCompnyDateEnd: '', |
|
|
|
joinCompnyDateStart: '', |
|
|
|
mobile: '', |
|
|
|
name: '', |
|
|
|
orgSid: '', |
|
|
|
personTypeKey: '', |
|
|
|
postSid: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
btnList: [ |
|
|
|
{ |
|
|
|
type: 'primary', |
|
|
|
size: 'small', |
|
|
|
icon: 'el-icon-plus', |
|
|
|
btnKey: 'toAdd', |
|
|
|
btnLabel: '新增' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'primary', |
|
|
|
size: 'small', |
|
|
|
icon: 'el-icon-edit', |
|
|
|
btnKey: 'toEdit', |
|
|
|
btnLabel: '编辑' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'primary', |
|
|
|
size: 'small', |
|
|
|
icon: '', |
|
|
|
btnKey: 'doSubmit', |
|
|
|
btnLabel: '提交' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'danger', |
|
|
|
size: 'small', |
|
|
|
icon: '', |
|
|
|
btnKey: 'doQuit', |
|
|
|
btnLabel: '离职' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'success', |
|
|
|
size: 'small', |
|
|
|
icon: '', |
|
|
|
btnKey: 'doImport', |
|
|
|
btnLabel: '导入' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'success', |
|
|
|
size: 'small', |
|
|
|
icon: '', |
|
|
|
btnKey: 'doExport', |
|
|
|
btnLabel: '导出' |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
@ -279,7 +205,7 @@ export default { |
|
|
|
this.getBuMen() |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
// this.$refs["btnbar"].setButtonList(this.btnList); |
|
|
|
this.$refs["btnbar"].setButtonList(this.btnList) |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
@ -343,13 +269,10 @@ export default { |
|
|
|
doSubmit(row) { |
|
|
|
// 提交的代码 |
|
|
|
this.btndisabled = true |
|
|
|
req |
|
|
|
.doSubmit(this.queryParams.params, this.sids) |
|
|
|
.then((resp) => { |
|
|
|
req.doSubmit(this.queryParams.params, this.sids).then((resp) => { |
|
|
|
console.log(resp) |
|
|
|
this.btndisabled = false |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}).catch(() => { |
|
|
|
this.btndisabled = false |
|
|
|
}) |
|
|
|
}, |
|
|
@ -388,18 +311,14 @@ export default { |
|
|
|
}, |
|
|
|
doImport(row) { |
|
|
|
// 导入的代码 |
|
|
|
req |
|
|
|
.importExcel(this.queryParams.params, this.sids) |
|
|
|
.then((resp) => { |
|
|
|
req.importExcel(this.queryParams.params, this.sids).then((resp) => { |
|
|
|
console.log(resp) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
.catch(() => {}) |
|
|
|
}, |
|
|
|
doExport(sids) { |
|
|
|
// 导出的代码 |
|
|
|
req |
|
|
|
.exportExcel(this.queryParams.params, this.sids) |
|
|
|
.then((resp) => { |
|
|
|
req.exportExcel(this.queryParams.params, this.sids).then((resp) => { |
|
|
|
var map = resp.data |
|
|
|
const fileName = map.filename // 导出文件名 |
|
|
|
// // 对于<a>标签,只有 Firefox 和 Chrome(内核) 支持 download 属性 |
|
|
@ -412,8 +331,7 @@ export default { |
|
|
|
link.click() // 执行下载 |
|
|
|
URL.revokeObjectURL(link.href) // 释放url |
|
|
|
document.body.removeChild(link) // 释放标签 |
|
|
|
}) |
|
|
|
.catch(() => {}) |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
dosearch() { |
|
|
|
this.queryParams.current = 1 |
|
|
@ -422,9 +340,7 @@ export default { |
|
|
|
handleOpen() { |
|
|
|
const _this = this |
|
|
|
this.personTypeForm.sid = this.sids[0] |
|
|
|
req |
|
|
|
.delBySids(this.personTypeForm) |
|
|
|
.then((resp) => { |
|
|
|
req.del(this.personTypeForm).then((resp) => { |
|
|
|
loading.close() |
|
|
|
_this.$message({ |
|
|
|
type: 'success', |
|
|
@ -433,8 +349,7 @@ export default { |
|
|
|
}) |
|
|
|
_this.loadList() |
|
|
|
this.dialogVisible = false |
|
|
|
}) |
|
|
|
.catch((e) => { |
|
|
|
}).catch((e) => { |
|
|
|
loading.close() |
|
|
|
}) |
|
|
|
}, |
|
|
@ -444,7 +359,6 @@ export default { |
|
|
|
const aa = [] |
|
|
|
row.forEach((element) => { |
|
|
|
aa.push(element.sid) |
|
|
|
setuser(this.sids) |
|
|
|
}) |
|
|
|
this.sids = aa |
|
|
|
this.row = row |
|
|
@ -454,29 +368,34 @@ export default { |
|
|
|
|
|
|
|
// 重置 |
|
|
|
resetQuery() { |
|
|
|
this.queryParams.params = {} |
|
|
|
this.queryParams.params.sid = '' // sid |
|
|
|
this.queryParams.params.name = '' // 登录名 |
|
|
|
this.queryParams = { |
|
|
|
current: 1, |
|
|
|
size: 10, |
|
|
|
total: 0, |
|
|
|
params: { |
|
|
|
joinCompnyDateEnd: '', |
|
|
|
joinCompnyDateStart: '', |
|
|
|
mobile: '', |
|
|
|
name: '', |
|
|
|
orgSid: '', |
|
|
|
personTypeKey: '', |
|
|
|
postSid: '' |
|
|
|
} |
|
|
|
} |
|
|
|
this.orgName_list = [] |
|
|
|
this.dosearch() |
|
|
|
}, |
|
|
|
// 查询 |
|
|
|
loadList() { |
|
|
|
const _this = this |
|
|
|
this.tableLoading = true |
|
|
|
req |
|
|
|
.listPage(this.queryParams) |
|
|
|
.then((resp) => { |
|
|
|
req.listPage(this.queryParams).then((resp) => { |
|
|
|
console.log('查询列表', resp) |
|
|
|
_this.tableLoading = false |
|
|
|
const data = resp.data |
|
|
|
_this.queryParams.total = data.total |
|
|
|
_this.dataList = data.records |
|
|
|
// for (var i = 0; i < data.records.length; i++) { |
|
|
|
// var timeArr = data.records[i].createTime.split(' '); |
|
|
|
// this.dataList[i].createTime = timeArr[0]; |
|
|
|
// } |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}).catch(() => { |
|
|
|
_this.tableLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
@ -488,11 +407,7 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
getType() { |
|
|
|
req |
|
|
|
.pullDown({ |
|
|
|
type: 'personType' |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
req.pullDown({ type: 'personType' }).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.personType_list = res.data |
|
|
|
console.log('下拉框员工类型', res.data) |
|
|
@ -505,42 +420,6 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
getPersonType(value) { |
|
|
|
console.log('触发下拉框按钮') |
|
|
|
let bb = {} |
|
|
|
this.personType_list.forEach((e) => { |
|
|
|
// eslint-disable-next-line eqeqeq |
|
|
|
if (e.dictKey == value) { |
|
|
|
bb = { |
|
|
|
type: e.dictType, |
|
|
|
name: e.dictValue, |
|
|
|
key: e.dictKey, |
|
|
|
sid: e.sid |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.queryParams.params.personType = bb.name |
|
|
|
console.log('name', this.queryParams.params.personType) |
|
|
|
}, |
|
|
|
getPostSid(value) { |
|
|
|
console.log('触发下拉框按钮', value) |
|
|
|
let bb = {} |
|
|
|
this.postSid_list.forEach((e) => { |
|
|
|
// eslint-disable-next-line eqeqeq |
|
|
|
if (e.postCode == value) { |
|
|
|
bb = { |
|
|
|
name: e.name, |
|
|
|
key: e.postCode, |
|
|
|
sid: e.sid |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.queryParams.params.postSid = bb.sid |
|
|
|
// this.temp.nationalKey = bb.key |
|
|
|
// this.formobj.scmOtherInboundDto.billType = bb.sid |
|
|
|
console.log('name', this.queryParams.params.postSid) |
|
|
|
}, |
|
|
|
// 级联列表 部门 |
|
|
|
getBuMen() { |
|
|
|
req.salesDepName().then((res) => { |
|
|
@ -553,61 +432,45 @@ export default { |
|
|
|
}, |
|
|
|
BuMen0(data) { |
|
|
|
data.forEach((e) => { |
|
|
|
if (e.children.length != 0) { |
|
|
|
if (e.children) { |
|
|
|
if (e.children.length !== 0) { |
|
|
|
this.BuMen0(e.children) |
|
|
|
} else { |
|
|
|
delete e.children |
|
|
|
this.dataArr.push(e) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 部门 |
|
|
|
orgNameChange(e) { |
|
|
|
console.log('选中结果:' + JSON.stringify(e)) |
|
|
|
var result = '' |
|
|
|
var result_Sid = '' |
|
|
|
var sidPath = '' |
|
|
|
var namePath = '' |
|
|
|
if (e.length > 0) { |
|
|
|
// 循环多选项 |
|
|
|
e.forEach((item) => { |
|
|
|
var last_id = item |
|
|
|
// 循环查找名字 |
|
|
|
this.select_temp_Name = '' // 临时遍历,用来保存选中结果(组织名称) |
|
|
|
this.select_temp_Sid = '' // 临时遍历,用来保存选中结果(组织Sid) |
|
|
|
this.select_temp_NamePath = '' // 临时遍历,用来保存选中结果(名称路径) |
|
|
|
this.select_temp_SidPath = '' // 临时遍历,用来保存选中结果(sid路径) |
|
|
|
this.findOrgId(last_id, this.options) |
|
|
|
result = result + this.select_temp_Name + '/' |
|
|
|
result_Sid = result_Sid + this.select_temp_Sid + ',' |
|
|
|
sidPath = this.select_temp_SidPath |
|
|
|
namePath = namePath + this.select_temp_Name + '/' |
|
|
|
}) |
|
|
|
} |
|
|
|
if (result !== '') { |
|
|
|
result = result.substring(0, result.length - 1) |
|
|
|
} |
|
|
|
if (namePath !== '') { |
|
|
|
namePath = namePath.substring(0, result.length - 1) |
|
|
|
} |
|
|
|
if (result_Sid !== '') { |
|
|
|
result_Sid = result_Sid.substring(0, result_Sid.length - 1) |
|
|
|
} |
|
|
|
const orgSidArray = result_Sid.split(',') |
|
|
|
const orgSid = orgSidArray[orgSidArray.length - 1] |
|
|
|
this.queryParams.params.orgName = result |
|
|
|
// this.temp.sysStaffOrgDto.orgSid = orgSid |
|
|
|
// this.temp.sysStaffOrgDto.orgSidPath = sidPath |
|
|
|
// this.temp.sysStaffOrgDto.orgNamePath = namePath |
|
|
|
console.log('选中名称:' + result, orgSid, sidPath, namePath) |
|
|
|
this.queryParams.params.orgSid = orgSid |
|
|
|
console.log('选中名称:' + orgSid) |
|
|
|
}, |
|
|
|
|
|
|
|
// --- 循环查询 |
|
|
|
findOrgId(id, options) { |
|
|
|
console.log('这是部门id', id) |
|
|
|
for (var i = 0; i < options.length; i++) { |
|
|
|
if (id == options[i].sid) { |
|
|
|
if (id === options[i].sid) { |
|
|
|
this.select_temp_Name = options[i].name // 保存找到的内容 |
|
|
|
this.select_temp_Sid = options[i].sid |
|
|
|
this.select_temp_NamePath = options[i].name |
|
|
@ -615,7 +478,7 @@ export default { |
|
|
|
return true |
|
|
|
} else { |
|
|
|
// 判断是否最后一级 |
|
|
|
if (options[i].children !== undefined) { |
|
|
|
if (options[i].children !== undefined && options[i].children !== null) { |
|
|
|
// 不是的话查询下一级 |
|
|
|
if (this.findOrgId(id, options[i].children)) { |
|
|
|
return true |
|
|
@ -651,7 +514,4 @@ export default { |
|
|
|
border: #2cab69 1px solid; |
|
|
|
color: #2cab69; |
|
|
|
} |
|
|
|
.lizhiliyou { |
|
|
|
width: 200px !important; |
|
|
|
} |
|
|
|
</style> |
|
|
|