Merge branch 'xuyifeng-0724-人员中台对接-dev' into pet

liujun-2024-09-04-九公司人员定位
water_xu 2024-08-15 16:40:14 +08:00
commit 87a1841da1
8 changed files with 3414 additions and 16 deletions
src/views
corpInfo/centercorpinfouser
system/group
centerUserInfo
userCenter
xgf/allPeopleList/components

View File

@ -0,0 +1,757 @@
<template>
<div>
<div style="padding:10px 20px 20px 20px">
<div class="title_super">
<div>{{ this.$parent.USER_ID == '' ? '新增用户' : '查看用户' }}</div>
</div>
<el-form ref="form" :rules="rules" :model="form" label-width="140px">
<el-row :gutter="20">
<el-col :span="12">
<div class="left_super">
<el-form-item label="用户名" prop="USERNAME">
<el-input v-model="form.USERNAME" placeholder="默认用户手机号码..."/>
</el-form-item>
<el-form-item label="姓名" prop="NAME">
<el-input v-model="form.NAME" placeholder="这里输入姓名..."/>
</el-form-item>
<el-form-item label="邮箱" prop="EMAIL">
<el-input v-model="form.EMAIL" placeholder=""/>
</el-form-item>
<el-form-item label="部门" prop="ORG_PATH">
<el-input v-model="form.ORG_PATH" placeholder=""/>
</el-form-item>
<el-form-item label="身份证号" prop="CARD_NO">
<el-input v-model="form.CARD_NO" placeholder=""/>
</el-form-item>
<el-form-item label="民族" prop="NATION">
<el-input v-model="form.NATION" placeholder=""/>
</el-form-item>
<el-form-item label="性别" prop="SEX">
<el-input v-model="form.SEX" placeholder=""/>
</el-form-item>
</div>
</el-col>
<el-col :span="12">
<div class="left_border_super">
<template v-if="form.ISSTUDENT">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="民族" prop="NATION">
<el-select v-model="form.NATION_NAME" placeholder="请选择">
<el-option
v-for="item in uesrInfoDic.minzuList"
:key="item.DICTIONARIES_ID"
:label="item.NAME"
:value="item.DICTIONARIES_ID"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="政治面貌" prop="POLITICAL_OUTLOOK">
<el-select v-model="form.POLITICAL_OUTLOOK_NAME" placeholder="请选择">
<el-option
v-for="item in uesrInfoDic.zhengzhimianmaoList"
:key="item.DICTIONARIES_ID"
:label="item.NAME"
:value="item.DICTIONARIES_ID"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="出生年月" prop="DATE_OF_BIRTH">
<el-date-picker
v-model="form.DATE_OF_BIRTH"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="文化程度" prop="DEGREE_OF_EDUCATION">
<el-select v-model="form.DEGREE_OF_EDUCATION_NAME" placeholder="请选择">
<el-option
v-for="item in uesrInfoDic.wenhuachengduList"
:key="item.DICTIONARIES_ID"
:label="item.NAME"
:value="item.DICTIONARIES_ID"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="人员类型" prop="PERSONNEL_TYPE">
<el-select v-model="form.PERSONNEL_TYPE_NAME" placeholder="请选择">
<el-option
v-for="item in uesrInfoDic.renyuanleixingList"
:key="item.DICTIONARIES_ID"
:label="item.NAME"
:value="item.DICTIONARIES_ID"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="职务" prop="DUTIES">
<div class="uo-flex">
<el-select
v-if="form.letDutiesType =='select'"
id="leaPostSel"
v-model="form.DUTIESNAME"
placeholder="请选择"
class="filter-item"
@change="forceUpdate">
<el-option
v-for="(item,index) in uesrInfoDic.zhiwuList"
:key="item.DICTIONARIES_ID"
:label="item.NAME"
:value="item.DICTIONARIES_ID">
<span style="float: left">{{ item.NAME }}</span>
<div style="float: right;" @click.stop="removeDuties(index,'POSITION')"><i
class="el-icon-circle-close"/></div>
</el-option>
</el-select>
<el-input
v-if="form.letDutiesType =='value'"
id="leaPostVal"
:disabled="form.letDutiesType =='select'"
v-model="form.DUTIESValue"
placeholder="这里输入新的职务名称..."/>
<el-button
class="ml5"
@click="form.letDutiesType = (form.letDutiesType =='select') ? 'value' : 'select'">
{{ form.letDutiesType === 'select' ? '输入' : '选择' }}
</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="职称" prop="TITLE">
<div class="uo-flex">
<el-select
v-if="form.letTitleType =='select'"
id="letTitleSel"
v-model="form.TITLE_NAME"
placeholder="请选择"
class="filter-item"
@change="forceUpdate">
<el-option
v-for="(item,index) in uesrInfoDic.zhichengList"
:key="item.DICTIONARIES_ID"
:label="item.NAME"
:value="item.DICTIONARIES_ID">
<span style="float: left">{{ item.NAME }}</span>
<div style="float: right;" @click.stop="removeDuties(index,'JOB_TITLE')"><i
class="el-icon-circle-close"/></div>
</el-option>
</el-select>
<el-input
v-show="form.letTitleType =='value'"
id="letTitleVal"
v-model="form.letTitleValue"
placeholder="这里输入新的职称名称..."/>
<el-button
class="ml5"
@click="form.letTitleType = (form.letTitleType =='select') ? 'value' : 'select'">
{{ form.letTitleType === 'select' ? '输入' : '选择' }}
</el-button>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="工种" prop="TYPE_OF_WORK">
<div class="uo-flex">
<el-select
v-if="form.letTypeOfWorkType =='select'"
id="letTypeOfWorkSel"
v-model="form.TYPE_OF_WORKNAME"
placeholder="请选择"
class="filter-item"
@change="forceUpdate">
<el-option
v-for="(item,index) in uesrInfoDic.gongzhongList"
:key="item.DICTIONARIES_ID"
:label="item.NAME"
:value="item.DICTIONARIES_ID">
<span style="float: left">{{ item.NAME }}</span>
<div style="float: right;" @click.stop="removeDuties(index,'WORK_TYPE')"><i
class="el-icon-circle-close"/></div>
</el-option>
</el-select>
<el-input
v-show="form.letTypeOfWorkType =='value'"
id="letTypeOfWorkVal"
v-model="form.letTypeOfWorkValue"
placeholder="这里输入新的工种名称..."/>
<el-button
class="ml5"
@click="form.letTypeOfWorkType = (form.letTypeOfWorkType =='select') ? 'value' : 'select'">
{{ form.letTypeOfWorkType === 'select' ? '输入' : '选择' }}
</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="入职日期" prop="ENTRY_DATE">
<el-date-picker
v-model="form.ENTRY_DATE"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="参加工作日期" prop="WORKING_DATE">
<el-date-picker
v-model="form.WORKING_DATE"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="在职情况" prop="INCUMBENCY">
<el-select v-model="form.INCUMBENCY_NAME" placeholder="请选择">
<el-option
v-for="item in uesrInfoDic.zaizhiqingkuangList"
:key="item.DICTIONARIES_ID"
:label="item.NAME"
:value="item.DICTIONARIES_ID"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item v-if="form.userCerList.length > 0" label="已上传证书">
<div class="slideshow">
<div class="disContent">
<div v-for="(item, index) in form.userCerList" :key="index" class="img-div">
<img :src="config.fileUrl + item.FILEPATH" alt="">
<div class="disContent-hide">
<el-tooltip class="item" effect="dark" content="预览" placement="top">
<span class="el-icon-zoom-in yuLan">
<viewer :images="form.userCerLis">
<img :src="config.fileUrl + item.FILEPATH" alt="" class="yuLanImg">
</viewer>
</span>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<span class="Delete" @click="deleteCertificate(index)"><i class="el-icon-delete"/></span>
</el-tooltip>
</div>
</div>
</div>
</div>
</el-form-item>
</template>
</div>
</el-col>
</el-row>
</el-form>
</div>
<div class="ui-height"/>
<div class="ui-foot">
<!-- <el-button type="success" @click="confirm"> </el-button>-->
<el-button plain type="info" @click="goBack"> </el-button>
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
// eslint-disable-next-line no-unused-vars
var hasUser = (rule, value, callback) => {
requestFN(
'/user/hasUser',
{
USERNAME: value,
VERIFYUSER_ID: this.form.USER_ID
}
).then((data) => {
if (data.result == 'success') {
if (data.pd.USER_ID) {
callback(new Error('用户名重复'))
}
callback()
}
}).catch((e) => {
callback()
})
}
var hasEmail = (rule, value, callback) => {
if (value) {
requestFN(
'/user/hasEmail',
{
EMAIL: value,
USERNAME: this.form.USERNAME
}
).then((data) => {
if (data.result == 'success') {
callback()
} else {
callback(new Error('邮箱重复'))
}
}).catch((e) => {
})
} else {
callback()
}
}
return {
dayTime: [],
LevelsData: [],
dialogFormEditDate: false,
dialogFormLicenseInformation: false,
listLoading: true,
treeLoading: false,
add: false,
del: false,
edit: false,
KEYWORDS: '',
SHIFTDUTYONE: '',
SHIFTDUTYTWO: '',
selectPeriod: [],
tzzyry: '',
periodList: [],
DEPARTMENT_ID: '',
varList: [],
multipleSelectionAll: [], //
multipleSelection: [], //
dialogFormEdit: false,
dialogType: 'saveUser',
disabledLCSelect: false,
displayLCSelect: 'display: block',
disabledLCInput: true,
displayLCInput: 'display: none',
LearnerCategoryList: [],
certificatenamearr: [
{ value: '主要负责人证', label: '主要负责人证' },
{ value: '安全管理人员证', label: '安全管理人员证' },
{ value: '特种作业人员证', label: '特种作业人员证' }
], rules: {
NAME: [{ required: true, message: '姓名不能为空', trigger: 'blur' }]
}, defaultProps: {
value: 'id',
children: 'odes',
label: 'name'
},
treeData: [],
form: {
CORPINFO_NAME: "",
CARD_NO: null,
OPERATTIME: "",
ISDELETE: "",
DEPARTMENT_NAME: "",
ORG_PATH: "",
DEPARTMENT_ID: "",
CARD_TYPE_NAME: "",
SEX: "",
USER_ID: "",
CARD_TYPE: "",
CORPINFO_ID: "",
EMAIL: "",
NAME: "",
NATION: "",
OPERATOR: "",
USER_TYPE: "",
CREATOR: "",
USERNAME: "",
CREATTIME: ""
},
uesrInfoDic: {
minzuList: [], // 0a0e406f27f74ee698fe9979d25f62dd
zhengzhimianmaoList: [], // 6351efdd12dc4730952e5d195718e252
wenhuachengduList: [], // d7d80f08d73a4accbccf4fd3d8d1d867
renyuanleixingList: [], // 0b62f92b0b624aab8e89a77304a64d5e
zhiwuList: [], // 09e36ac01e9540f8bc84eab1c1a78754
gongzhongList: [], // 55484e491a5e442d839c4595380713ec
zaizhiqingkuangList: [], // 548764b5d4bf4bd7a18ef88274ef49e4
xingbieList: [], // 21501808bbc344d593fbf9ccfe6c4531
zhichengList: []// 945a6b10e59946078b500f0fbafa8679
},
certificate_files: [],
config: config,
dialogImageUrl: [],
dialogVisible: false,
SchedulingFrom: false,
roleList: [],
roleList1: [],
roleList_z: [],
role1List: [],
postList: [],
oldPostId: '', // ID
oldDepartId: '', // ID
dialogFormDaoru: false,
daoruFrom: {
FFILE: '',
FFILEName: ''
},
PARENTID: '0',
shiftDutyListOne: [],
shiftDutyListTwo: [],
queryShiftOneList: [],
queryShiftTwoList: [],
datePage: 0,
workDateList: [],
USER_ID: ''
}
},
created() {
this.handleEdit(this.$parent.USER_ID)
},
methods: {
goBack() {
this.$parent.activeName = 'IndexView'
},
handleEdit(USER_ID) {
this.shiftDutyListTwo = []
this.periodList = []
this.USER_ID = ''
this.dialogType = 'editUser'
requestFN(
'/core/corpinfo/getCorpUser',
{
USER_ID: USER_ID
}
).then((data) => {
this.form = data.varList[0]
}).catch((e) => {
this.listLoading = false
})
},
confirm() {
// debugger
// this.uploadImgByZhengshu(this.form.USER_ID) //
this.$refs.form.validate(valid => {
if (this.form.SHIFTDUTYONE) {
// var
if (!this.form.SHIFTDUTYTWO || this.selectPeriod.DURATION == undefined) {
this.$message({
message: '请选择完整的排班类型',
type: 'error'
})
return false
}
}
// if (this.form.USERAVATARURL == '') {
// this.$message({
// message: '',
// type: 'warning'
// })
// return false
// }
if (valid) {
console.log(this.selectPeriod.WORKSTATUS)
console.log(this.form.WORKSTATUS)
this.form.WORKSTATUS = this.selectPeriod.WORKSTATUS
this.form.DURATION = this.selectPeriod.DURATION
this.form.WORKPERIOD = this.selectPeriod.WORKPERIOD
if (this.dialogType == 'saveUser') {
this.form.ROLE_ID = this.form.ROLE_ID.join(',')
this.listLoading = true
requestFN(
'/user/' + this.dialogType,
this.form
).then((data) => {
this.listLoading = false
if (this.form.ISSTUDENT) {
this.uploadImgByZhengshu(data.USER_ID)
} else {
this.$message({
message: '操作成功',
type: 'success'
})
this.$parent.activeName = 'List'
}
}).catch((e) => {
this.listLoading = false
this.form.ROLE_ID = ''
this.form.USERNAME = ''
})
} else {
if (this.oldDepartId != this.form.DEPARTMENT_ID || this.oldPostId != this.form.POST_ID) {
this.$confirm('如变更了部门或岗位,保存后将删除该用户所有清单,是否确定?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.form.ROLE_ID = this.form.ROLE_ID.join(',')
this.listLoading = true
requestFN(
'/user/' + this.dialogType,
this.form
).then((data) => {
this.listLoading = false
if (this.form.ISSTUDENT) {
this.uploadImgByZhengshu(this.form.USER_ID)
} else {
this.$message({
message: '操作成功',
type: 'success'
})
this.$parent.activeName = 'List'
}
}).catch((e) => {
this.listLoading = false
})
})
} else {
this.form.ROLE_ID = this.form.ROLE_ID.join(',')
this.listLoading = true
requestFN(
'/user/' + this.dialogType,
this.form
).then((data) => {
this.listLoading = false
if (this.form.ISSTUDENT) {
this.uploadImgByZhengshu(this.form.USER_ID)
} else {
this.$message({
message: '操作成功',
type: 'success'
})
this.$parent.activeName = 'List'
}
}).catch((e) => {
this.listLoading = false
})
}
}
} else {
return false
}
})
},
}
}
</script>
<style lang="scss" scoped>
.el-dialog__body {
padding: 0;
background: red;
}
.mark_up {
margin-bottom: 20px;
margin-left: 110px;
}
.icons-container {
margin: 0;
overflow: hidden;
.grid {
position: relative;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}
.icon-item {
margin-bottom: 10px;
height: 70px;
text-align: center;
width: 100px;
float: left;
font-size: 24px;
color: #24292e;
cursor: pointer;
span {
display: block;
font-size: 14px;
margin-top: 10px;
}
}
.disabled {
pointer-events: none;
}
}
.filter-btn-group {
position: relative;
}
.filter-flot {
position: absolute;
right: 0;
top: 0;
}
.uploader {
width: 570px;
display: flex;
align-items: center;
}
.el-form-item__content {
line-height: 1;
}
.uo-flex {
display: flex;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
border: 1px dashed #c0ccda;
font-size: 28px;
color: #8c939d;
width: 110px;
height: 110px;
line-height: 110px;
border-radius: 6px;
text-align: center;
background-color: #fbfdff;
}
.avatar-uploader-icon:hover,
.avatar-uploader-icon:focus {
border-color: #1890ff;
color: #1890ff;
}
.avatar {
width: 110px;
height: 110px;
display: block;
border: 1px dashed #c0ccda;
}
</style>
<style lang="sass" scoped>
.el-row
margin-bottom: 16px
&:last-child
margin-bottom: 0
.form-group
display: flex
align-items: center
margin-right: 20px
.form-label
padding: 9px 15px
font-size: 14px
width: 240px
font-weight: 400
line-height: 20px
text-align: right
margin-bottom: 0
.star
color: red
padding-right: 4px
.input-block
flex: 1
min-height: 36px
position: relative
.disContent
padding: 0 20px
display: flex
align-items: center
flex-wrap: wrap
.img-div
position: relative
margin: auto 10px 10px 10px
width: 120px
height: 120px
border-radius: 4px
& > img
width: 100%
height: 100%
.disContent-hide
position: absolute
width: 100%
height: 100%
border-radius: 4px
background-color: rgba(48, 48, 48, 0.59)
display: none
top: 0
left: 0
.Delete
position: absolute
bottom: 14px
right: 10px
font-size: 16px
color: white
cursor: pointer
.editCss
.Delete
font-size: 16px
right: 90px
.yuLan
position: absolute
bottom: 23px
right: 50px
font-size: 16px
color: white
cursor: pointer
.yuLanImg
position: absolute
bottom: 0
right: 0
width: 100%
height: 100%
opacity: 0
.img-div:hover .disContent-hide
display: block
.pitchCss
border: 1px solid #202e78
transition: all linear 0.1s
width: 116px
height: 116px
</style>

View File

@ -0,0 +1,280 @@
<template>
<div class="app-container">
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="CORP_NAME" label="分公司名称" />
<el-table-column label="操作" align="left" width="110">
<template slot-scope="{row}">
<el-button type="success" icon="el-icon-view" size="mini" @click="handleEdit(row.CORPINFO_ID)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
</div>
<!-- <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" /> -->
</div>
<el-dialog :visible.sync="dialogFormEdit" title="查看公司组织架构" width="600px">
<el-tree :data="treeData" :props="defaultProps"/>
</el-dialog>
</div>
</template>
<script>
import SelectTree from '@/components/SelectTree'
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
listLoading: true,
add: true,
del: true,
edit: true,
listQuery: {
page: 1,
limit: 20
},
searchForm: {
CORP_NAME: '',
PROVINCE: '',
CITY: '',
CORP_STATE: '',
CREATTIME: ''
},
total: 0,
varList: [],
qyztList: [],
options: [{
value: '0',
label: '启用'
}, {
value: '1',
label: '禁用'
}],
STATE: [],
industryList: [],
countryList: [],
villageList: [],
treeData: [],
CITY_CODE: '',
COUNTRY: '',
VILLAGE: '',
config: config,
dialogFormEdit: false,
rules: {
CORP_NAME: [{ required: true, message: '分公司名称不能为空', trigger: 'blur' }],
NEWCORP_NAME: [{ required: true, message: '新分公司名称不能为空', trigger: 'blur' }],
PASSWORD: [{ required: true, message: '分公司密码不能为空', trigger: 'blur' }]
},
updateBranchNameForm: {
CORPINFO_ID: '',
CORP_NAME: '',
NEWCORP_NAME: '',
PASSWORD: ''
},
defaultProps: {
children: 'nodes',
label: 'name'
}
}
},
created() {
this.getList()
// this.getDicList('qyztList', '07c2674470c1498ba1ebd74906b3b518')
// this.getDicList('industryList', 'f2598ba72e864eadabf0ca4b664d26b9')
},
methods: {
getRowKey(row) {
return row.CORPINFO_ID
},
//
getQuery() {
this.getList()
},
//
getList() {
this.listLoading = true
requestFN(
'/core/corpinfo/listRetrieval'
).then((data) => {
this.listLoading = false
this.varList = data.varList
// this.getCountryList()
}).catch((e) => {
this.listLoading = false
})
},
getCountryList() {
requestFN(
'/dictionaries/getLevels',
{
DICTIONARIES_ID: this.CITY_CODE
}
).then((data) => {
this.countryList = data.list
}).catch((e) => {
})
},
getVillageList(value, id) {
this.COUNTRY = value
requestFN(
'/dictionaries/getLevels',
{
DICTIONARIES_ID: id
}
).then((data) => {
this.villageList = data.list
}).catch((e) => {
})
},
changeVillage(village) {
this.VILLAGE = village
},
//
handleEdit(ID) {
this.$parent.activeName = 'IndexView'
this.$parent.indexVal = ID
},
enableORDisable(ISUSE, CORPINFO_ID) {
this.$confirm(ISUSE === '0' ? '确定要启用该账户吗?' : '确定要禁用该账户吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/corpinfo/editisuse',
{
CORPINFO_ID,
ISUSE
}
).then(() => {
this.$message({
message: ISUSE === '0' ? '启用成功' : '禁用成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {})
},
//
hasButton: function() {
var keys = 'corpinfo:add,corpinfo:del,corpinfo:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.corpinfofhadminadd //
this.del = data.corpinfofhadmindel //
this.edit = data.corpinfofhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
goKeyReset() {
this.searchForm = {
CORP_NAME: '',
PROVINCE: '',
CITY: '',
CORP_STATE: '',
CREATTIME: ''
}
this.getList()
},
resetPwd(id) {
this.$confirm('确定要重置选中的密码吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/corpinfo/resetPwd',
{
CORPINFO_ID: id
}
).then(() => {
this.$message({
message: '重置成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
//
getDicList(list, DICTIONARIES_ID) {
requestFN(
'/dictionaries/getLevels',
{
DICTIONARIES_ID
}
).then((data) => {
this[list] = data.list
}).catch((e) => {
})
},
translate(list, id) {
for (let i = 0; i < list.length; i++) {
if (list[i].BIANMA === id || list[i].DICTIONARIES_ID === id) {
return list[i].NAME
}
}
},
showBranchName(CORPINFO_ID, CORP_NAME) {
this.$refs.form && this.$refs.form.resetFields()
this.dialogFormEdit = true
this.updateBranchNameForm.CORPINFO_ID = CORPINFO_ID
this.updateBranchNameForm.CORP_NAME = CORP_NAME
},
updateBranchName(ID) {
requestFN(
'/department/listTreeCorpInfo',
{
CORPINFO_ID: ID
}
).then((data) => {
this.treeData = JSON.parse(data.varList)
}).catch((e) => {
})
}
}
}
</script>

View File

@ -0,0 +1,281 @@
<template>
<div class="icons-container">
<el-container>
<el-aside width="200px" style="background-color:#fff">
<div class="filter-btn-group">
<!-- <el-input-->
<!-- v-model="filterText"-->
<!-- placeholder="输入关键字进行过滤"-->
<!-- style="margin:10px 0"/>-->
<el-tree
v-loading="treeLoading"
ref="tree"
:data="treeData"
:props="defaultProps"
:filter-node-method="filterNode"
class="filter-tree"
@node-click="handleNodeClick"/>
</div>
</el-aside>
<el-main>
<el-form label-width="60px">
</el-form>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="USERNAME" label="用户名" />
<el-table-column prop="NAME" label="姓名" />
<el-table-column prop="ORG_PATH" label="部门"/>
<el-table-column label="操作" align="left" width="150">
<template slot-scope="{row}">
<el-button type="success" icon="el-icon-view" size="mini" @click="handleEdit(row.USER_ID)"></el-button>
<!-- <template v-if="row.ISMAIN==0">-->
<!-- <el-button type="primary" icon="el-icon-edit" size="mini" @click="handleDelete(row.USER_ID,row.NAME)"></el-button>-->
<!-- </template>-->
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<!--
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
-->
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
</el-main>
</el-container>
<div class="heightt"/>
<div class="subdy-foot">
<el-row style="text-align: center">
<el-button @click="goBack"></el-button>
</el-row>
</div>
</div>
</template>
<script>
import SelectTree from '@/components/SelectTree'
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
treeLoading: false,
listLoading: true,
add: true,
del: true,
edit: true,
readonly: true,
listQuery: {
page: 1,
limit: 20
},
searchForm: {
DEPARTMENT_ID: '',
CORP_NAME: '',
PROVINCE: '',
CITY: '',
CORP_STATE: '',
CREATTIME: '',
USERNAME: '',
NAME: '',
DEPTNAME: ''
},
userForm: {
PARENT_ID: '',
USER_ID: '',
DEPARTMENT_ID: '',
DEPTNAME: '',
USERNAME: '',
NAME: ''
},
DEPARTMENT_ID: '',
total: 0,
PARENT_ID: '0', // ID
varList: [],
qyztList: [],
options: [{
value: '0',
label: '启用'
}, {
value: '1',
label: '禁用'
}],
STATE: [],
industryList: [],
countryList: [],
villageList: [],
treeData: [],
CITY_CODE: '',
COUNTRY: '',
VILLAGE: '',
config: config,
dialogFormEdit: false,
defaultProps: {
id:'DEPARTMENT_ID',
value: 'DEPARTMENT_ID',
children: 'SUB_DEPT',
label: 'NAME'
}
}
},
created() {
this.updateBranchName(this.$parent.indexVal)
this.getList()
// this.getDicList('qyztList', '07c2674470c1498ba1ebd74906b3b518')
// this.getDicList('industryList', 'f2598ba72e864eadabf0ca4b664d26b9')
},
methods: {
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
handleNodeClick(node, data, value) {
this.searchForm.DEPARTMENT_ID = node.DEPARTMENT_ID
this.getList(node.DEPARTMENT_ID)
},
//
getList(DEPARTMENT_ID) {
this.listLoading = true
if (DEPARTMENT_ID) {
this.DEPARTMENT_ID = DEPARTMENT_ID
}
requestFN(
'/core/corpinfo/findByCorpInfo?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
CORPINFO_ID: this.$parent.indexVal,
DEPARTMENT_ID: this.searchForm.DEPARTMENT_ID,
DEPTNAME: this.searchForm.DEPTNAME,
NAME: this.searchForm.NAME,
USERNAME: this.searchForm.USERNAME
}
).then((data) => {
this.listLoading = false
this.varList = data.userList
this.total = data.page.totalResult
this.hasButton()
this.CITY_CODE = data.CITY_CODE
this.getCountryList()
}).catch((e) => {
this.listLoading = false
})
},
getDeptList(DEPARTMENT_ID) {
this.listLoading = true
this.varList = []
this.DEPARTMENT_ID = DEPARTMENT_ID
requestFN(
'/department/findByDeptId?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
DEPARTMENT_ID: this.searchForm.DEPARTMENT_ID,
KEYWORDS: this.searchForm.KEYWORDS
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.form.PARENT_ID = data.PARENT_ID
this.total = data.page.totalResult
this.hasButton()
}).catch((e) => {
this.listLoading = false
})
},
getRowKey(row) {
return row.CORPINFO_ID
},
goReturn() {
this.$parent.activeName = 'IndexList'
},
//
getQuery() {
this.getList()
},
getTreeList() {
this.treeLoading = true
requestFN(
'/department/listTree',
{}
).then((data) => {
this.treeLoading = false
// this.treeData = JSON.parse(data.zTreeNodes)
console.infot(this.treeData)
}).catch((e) => {
this.treeLoading = false
})
},
changeVillage(village) {
this.VILLAGE = village
},
//
handleEdit(ID) {
this.$parent.USER_ID = ID
this.$parent.activeName = 'Detail'
},
goBack() {
this.$parent.activeName = 'IndexList'
},
goKeyReset() {
this.searchForm = {
CORP_NAME: '',
PROVINCE: '',
CITY: '',
CORP_STATE: '',
CREATTIME: ''
}
this.getList()
},
translate(list, id) {
for (let i = 0; i < list.length; i++) {
if (list[i].BIANMA === id || list[i].DICTIONARIES_ID === id) {
return list[i].NAME
}
}
},
showBranchName(CORPINFO_ID, CORP_NAME) {
this.$refs.form && this.$refs.form.resetFields()
this.dialogFormEdit = true
this.updateBranchNameForm.CORPINFO_ID = CORPINFO_ID
this.updateBranchNameForm.CORP_NAME = CORP_NAME
},
updateBranchName(ID) {
requestFN(
'/core/corpinfo/listTreeCorpInfo',
{
CORPINFO_ID: ID
}
).then((data) => {
this.treeData = data.varList
}).catch((e) => {
})
}
}
}
</script>

View File

@ -0,0 +1,37 @@
<template>
<!-- <div class="">-->
<!-- <transition name="fade" mode="out-in">-->
<!-- <component :is="activeName"/>-->
<!-- </transition>-->
<!-- </div>-->
<div>
<IndexList v-show="activeName=='IndexList'" ref="list" />
<IndexView v-if="activeName=='IndexView'" />
<Detail v-if="activeName=='Detail'" />
</div>
</template>
<script>
import IndexList from './components/indexList'
import IndexView from './components/index_view'
import Detail from './components/detail'
export default {
components: { IndexList, IndexView, Detail },
data() {
return { // src/views/corpInfo/examine/index.vue
activeName: 'IndexList'
}
},
watch: {
activeName(val) {
if (val == 'IndexList') {
this.$refs.list.getList()
}
}
},
methods: {
}
}
</script>

View File

@ -0,0 +1,973 @@
<template>
<div class="app-container">
<el-container>
<!-- <el-aside width="300px" style="background-color:#fff">
<el-input
v-model="filterText"
placeholder="输入关键字进行过滤"
style="margin:10px 0"/>
<el-tree
v-loading="treeLoading"
ref="tree"
:data="treeData"
:props="defaultProps"
:filter-node-method="filterNode"
class="filter-tree"
@node-click="handleNodeClick"/>
</el-aside>-->
<el-main>
<div class="filter-container">
<div class="filter-lable w80">用户名称</div>
<el-input v-model="keyUserName" clearable placeholder="搜索用户名" class="filter-item" style="width: 200px;"/>
<div class="filter-lable w80">人员类型</div>
<el-select ref="refDeptLeven" v-model="keyJobLeven" clearable placeholder="请选择人员类型" class="filter-item"
style="width: 200px;">
<el-option v-for="item in userType" :key="item.id" :label="item.name"
:value="item.id"/>
</el-select>
<!-- <div class="filter-lable w80">行政区域</div>-->
<!-- <el-cascader ref="shudi" v-model="keyShudi" :props="areaprops" clearable placeholder="请选择行政区域" style="width: 200px" />-->
<!-- <div class="filter-lable w80">单位类型</div>-->
<!-- <el-select ref="refDeptType" v-model="keyDeptType" clearable placeholder="请选择单位类型" class="filter-item">-->
<!-- <el-option v-for="item in unitTypeList" :key="item.DICTIONARIES_ID" :label="item.NAME" :value="item.DICTIONARIES_ID" />-->
<!-- </el-select>-->
<div class="filter-lable w80">部门名称</div>
<el-input v-model="keyDepeName" clearable placeholder="搜索部门名称" class="filter-item"
style="width: 200px;"/>
<!-- <div class="filter-lable w80">职务级别</div>-->
<!-- <el-select ref="refJobLeven" v-model="keyJobLeven" clearable placeholder="请选择" class="filter-item">-->
<!-- <el-option v-for="item in jobTypeAllList" :key="item.DICTIONARIES_ID" :label="item.NAME" :value="item.DICTIONARIES_ID" />-->
<!-- </el-select>-->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
<!-- <el-button v-waves v-if="LOGIN_USER === '1'" class="filter-item" type="warning" icon="el-icon-warning"
size="mini" plain @click="resetPassword">
一键密码重置
</el-button>-->
</div>
<el-table
ref="multipleTable"
:data="varList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center"/>
<el-table-column prop="USERNAME" label="用户名" align="center"/>
<el-table-column prop="NAME" label="姓名" align="center"/>
<el-table-column prop="USER_TYPE" label="用户类型" align="center">
<template slot-scope="{row}">
<span v-if="row.USER_TYPE =='0'"></span>
<span v-else-if="row.USER_TYPE =='1'">分公司</span>
<span v-else></span>
</template>
</el-table-column>
<!-- <el-table-column prop="SEX" label="性别"/>-->
<el-table-column prop="ORG_PATH" label="部门" align="center"/>
<el-table-column prop="CORPINFO_NAME" label="企业" align="center"/>
<el-table-column label="操作" align="center" width="120">
<template slot-scope="{row}">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleRecord(row.USER_ID)">
</el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div/>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList"/>
</div>
</el-main>
</el-container>
<el-dialog v-loading="editloading" :visible.sync="dialogFormRecord"
:title="dialogType === 'record'?'查看记录':'修改'" width="1800px">
<el-table
ref="multipleTable"
:data="recordList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column type="index" label="序号" width="50" align="center"/>
<el-table-column prop="NAME" label="用户名" align="center"/>
<el-table-column prop="CREATTIME" label="新增时间" align="center"/>
<el-table-column prop="CREATORNAME" label="新增人" align="center">
<template slot-scope="{row}">
<span>{{row.CREATORNAME ? row.CREATORNAME : row.NAMEX ? row.NAMEX : row.NAMER}}</span>
</template>
</el-table-column>
<el-table-column prop="REMARKS" label="记录" align="center"/>
</el-table>
</el-dialog>
<el-dialog v-loading="editloading" :visible.sync="dialogFormEdit" :title="dialogType==='editUser'?'修改':'新增'"
width="600px">
<el-form ref="form" :rules="rules" :model="pd" label-width="110px" style="width: 500px;">
<el-form-item label="角色" prop="ROLE_ID">
<el-select v-model="pd.ROLE_ID" multiple placeholder="请选择角色">
<el-option v-for="item in roleList" :key="item.role_ID" :label="item.role_NAME" :value="item.role_ID"/>
</el-select>
</el-form-item>
<el-form-item label="用户名" prop="USERNAME">
<el-input v-model="pd.USERNAME" :disabled="dialogType == 'editUser'" placeholder="这里输入用户名..."
@blur="goCheck()"/>
</el-form-item>
<el-form-item label="姓名" prop="NAME">
<el-input v-model="pd.NAME" placeholder="这里输入姓名..."/>
</el-form-item>
<el-form-item v-if="dialogType != 'editUser'" label="密码" prop="PASSWORD">
<el-input v-model="pd.userPASSWORD" show-password placeholder="这里输入密码..."/>
</el-form-item>
<el-form-item label="身份证号" prop="USER_ID_CARD">
<el-input v-model="pd.USER_ID_CARD" placeholder="这里输入身份证号..." @blur="goCheck()"/>
</el-form-item>
<el-form-item label="性别" prop="SEX">
<el-radio v-model="pd.SEX" :label="'0'"></el-radio>
<el-radio v-model="pd.SEX" :label="'1'"></el-radio>
</el-form-item>
<el-form-item label="手机号" prop="PHONE">
<el-input v-model="pd.PHONE" placeholder="这里输入手机号..."/>
</el-form-item>
<!-- <el-form-item label="部门级别" prop="deptTypeID"> &lt;!&ndash;目的是选择部门到这个级别 &ndash;&gt;-->
<!-- <el-select v-model="pd.deptTypeID" placeholder="请选择" class="filter-item" >-->
<!-- <el-option v-for="item in deptTypeLevenAllList" :key="item.BIANMA" :label="item.NAME" :value="item.DICTIONARIES_ID" />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="单位部门" prop="DEPARTMENT_ID">
<SelectTree
v-if="dialogFormEdit"
ref="deptTree"
:clearable="false"
:options="deptTreeData"
:props="deptDefaultProps"
v-model="pd.DEPARTMENT_ID"
placeholder="请选择部门"
/>
</el-form-item>
<el-form-item label="行政区域" prop="shudi"> <!--河北省的就可以 -->
<el-cascader v-if="dialogFormEdit" id="shudi" ref="shudi" v-model="pd.shudi" :props="areaprops"
placeholder="请选择省市县" style="width: 100%"/>
</el-form-item>
<el-form-item label="职务级别" prop="JOB_LEVEL">
<el-select ref="refJobLevel" v-model="pd.JOB_LEVEL" placeholder="请选择" class="filter-item">
<el-option v-for="item in deptTypeLevenAllList" :key="item.BIANMA" :label="item.NAME"
:value="item.DICTIONARIES_ID"/>
</el-select>
</el-form-item>
<el-form-item label="民族" prop="NATION">
<el-select v-model="pd.NATION" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in uesrInfoDic.minzuList"
:key="item.DICTIONARIES_ID"
:label="item.NAME"
:value="item.DICTIONARIES_ID"/>
</el-select>
</el-form-item>
<!-- 相关方的业务需求,是否为审核人员.如果为是的情况,就是可以在入场培训中选择 -->
<el-form-item label="是否审核人员" prop="ISASSESS">
<el-radio v-model="pd.ISASSESS" :label="'1'"></el-radio>
<el-radio v-model="pd.ISASSESS" :label="'0'"></el-radio>
</el-form-item>
<el-form-item label="职务" prop="JOB">
<el-input v-model="pd.JOB" placeholder="这里输入职务..."/>
</el-form-item>
<el-form-item label="邮箱" prop="EMAIL">
<el-input v-model="pd.EMAIL" placeholder="这里输入邮箱..."/>
</el-form-item>
<el-form-item label="排序" prop="SORT">
<el-input v-model.number="pd.SORT" placeholder="这里输入排序..."/>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="pd.BZ" type="textarea" placeholder="这里输入备注说明..."/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormEdit = false"> </el-button>
<el-button v-show="ISCHECK || dialogType === 'editUser'" type="primary" @click="confirm"> </el-button>
<el-button v-show="!ISCHECK && dialogType !== 'editUser'" type="primary" @click="goCheck"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import {requestFN} from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: {Pagination, SelectTree},
directives: {waves},
data() {
var hasUser = (rule, value, callback) => {
if (this.dialogType != 'editUser') {
requestFN(
'/user/hasUser',
{
USERNAME: value,
tm: new Date().getTime()
}
).then((data) => {
if (data.result == 'success') {
callback()
} else {
callback(new Error('用户名重复'))
}
}).catch((e) => {
})
} else {
callback()
}
}
var hasEmail = (rule, value, callback) => {
if (value) {
requestFN(
'/user/hasEmail',
{
EMAIL: value,
USERNAME: this.pd.USERNAME
}
).then((data) => {
if (data.result == 'success') {
callback()
} else {
callback(new Error('邮箱重复'))
}
}).catch((e) => {
})
} else {
callback()
}
}
return {
LOGIN_USER: JSON.parse(sessionStorage.getItem('user')).USER_ID,
treeLoading: false,
treeData: [],
userType: [
{ id: '0', name: '股份' },
{ id: '1', name: '分公司' },
{ id: '2', name: '相关方' }
],
defaultProps: {
children: 'nodes',
label: 'name'
},
listQuery: {
page: 1,
limit: 20
},
total: 0,
varList: [],
recordList: [],
filterText: '',
keyUserName: '',
keyDeptLeven: '',
keyShudi: '',
keyDeptType: '',
keyDepeName: '',
keyJobLeven: '',
ISCHECK: false,
dialogFormEdit: false,
dialogFormRecord: false,
editloading: false,
dialogType: 'add',
USER_ID: '',
TYPE: '',
loading: true,
rules: {
EMAIL: [
{required: true, message: '请输入邮箱', trigger: 'blur'},
{
pattern: /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/,
message: '请输入正确的邮箱'
},
{validator: hasEmail, trigger: 'blur'}
],
ROLE_ID: [
{required: true, message: '角色不能为空', trigger: 'blur'}
],
USERNAME: [
{required: true, message: '用户名不能为空', 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: '用户名需使用手机号码格式'
},
{validator: hasUser, trigger: 'blur'}
],
NAME: [
{required: true, message: '姓名不能为空', trigger: 'blur'},
{min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur'}
],
SEX: [
{required: true, message: '请选择性别', trigger: 'blur'}
],
NATION: [
{required: true, message: '请选择民族', trigger: 'blur'}
],
PHONE: [
{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: '请输入正确的手机号码'
}
],
deptTypeID: [
{required: true, message: '请选择部门级别', trigger: 'blur'}
],
shudi: [
{required: true, message: '请选择属地', trigger: 'blur'}
],
JOB_LEVEL: [
{required: true, message: '请选择职务级别', trigger: 'blur'}
],
DEPARTMENT_ID: [
{required: true, message: '请选择单位部门', trigger: 'blur'}
],
ISASSESS: [
{required: true, message: '请选择是否审核人员', trigger: 'blur'}
],
USER_ID_CARD: [{required: true, message: '身份证号不能为空', trigger: 'blur'},
{
pattern: /^\d{6}(18|19|20)?\d{2}(0[1-9]|1[0-2])(([0-2][1-9])|10|20|30|31)\d{3}(\d|X|x)$/,
message: '请输入正确的身份证号'
}
]
},
uesrInfoDic: {
minzuList: [], // 0a0e406f27f74ee698fe9979d25f62dd
xingbieList: [], // 21501808bbc344d593fbf9ccfe6c4531
},
pd: {
ROLE_ID: [], // ID
USERNAME: '', //
NAME: '', //
userPASSWORD: 'Aa@123456789', //
SEX: '', // 01
PHONE: '', //
deptTypeID: '', //
DEPARTMENT_ID: '', //
shudi: '',
BZ: '', //
EMAIL: '', //
SORT: '', //
PROVINCE: '', //
CITY: '', //
COUNTRY: '', //
VILLAGE: '', //
JOB_LEVEL: '', //
ISASSESS: '',
JOB: '', //
USER_ID_CARD: '', //
NATION: '' //
},
roleList: [],
multipleSelectionAll: [], //
multipleSelection: [], //
fromExcel: false, // excel
toExcel: false, // excel
add: false, //
del: false, //
edit: false, //
record: false, //
hasUserRet: false,
deptTypeLevenAllList: [], //
jobTypeAllList: [], //
deptTreeData: [], // ,
userRecordInfo: {},
recordInfo: {},
deptDefaultProps: {
value: 'id',
children: 'nodes',
label: 'name'
},
unitTypeList: [],
areaprops: {
lazy: true,
lazyLoad(node, resolve) {
setTimeout(() => {
const areaLeven = node.level
var areaParID = ''
if (areaLeven == '0') {
areaParID = 'e725d2a91b8248f4b8f49889038df7de'
} else {
areaParID = node.data.id
}
requestFN(
'dictionaries/getLevels',
{DICTIONARIES_ID: areaParID}
).then((data) => {
const nodes = data.list.map(item => ({
value: item.DICTIONARIES_ID,
label: item.NAME.toString(),
id: item.DICTIONARIES_ID.toString(),
leaf: areaLeven > 2
}))
resolve(nodes) // resolve
}).catch((e) => {
this.editloading = false
this.listLoading = false
})
}, 500)
}
}
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.getList(this.USER_ID)
this.hasButton()
this.getDict2('0a0e406f27f74ee698fe9979d25f62dd', 'minzuList')
this.getDict2('21501808bbc344d593fbf9ccfe6c4531', 'xingbieList')
this.getDict('3e057d284c294a48af32948d58e92e3d', 'deptTypeLevenAllList')
this.getDict('3f3a6ac41247438e91df2830765068ba', 'unitTypeList')
this.getDepartTreeList()
this.getDict('f1fbdf9a286342ae98e6a56bf823f221', 'jobTypeAllList')
this.goAddUser()
this.getTreeList()
},
methods: {
goPush(row) {
requestFN(
'user/goPush',
{
STATUS: row.STATUS,
BZ: row.BZ,
SKIN: row.SKIN,
PHONE: row.PHONE,
NUMBER: row.NUMBER,
ISMAIN: row.ISMAIN,
OPENID: row.APPID,
SORT: row.SORT,
LEARNERCATEGORY: row.LEARNERCATEGORY,
USERAVATARPREFIX: row.USERAVATARPREFIX,
USERAVATARURL: row.USERAVATARURL,
SHIFTDUTYONE: row.SHIFTDUTYONE,
SHIFTDUTYTWO: row.SHIFTDUTYTWO,
DURATION: row.DURATION,
WORKSTATUS: row.WORKSTATUS,
WORKPERIOD: row.WORKPERIOD,
PERSONNEL_TYPE: row.PERSONNEL_TYPE,
TITLE: row.TITLE,
ISSTATE: row.ISSTATE,
INCUMBENCY: row.INCUMBENCY,
WORKING_DATE: row.WORKING_DATE,
ENTRY_DATE: row.ENTRY_DATE,
TYPE_OF_WORK: row.TYPE_OF_WORK,
DUTIES: row.DUTIES,
DEGREE_OF_EDUCATION: row.DEGREE_OF_EDUCATION,
DATE_OF_BIRTH: row.DATE_OF_BIRTH,
POLITICAL_OUTLOOK: row.POLITICAL_OUTLOOK,
PROVINCE: row.PROVINCE,
CITY: row.CITY,
COUNTRY: row.COUNTRY,
VILLAGE: row.VILLAGE,
USER_ID: row.USER_ID,
CARD_NO: row.USER_ID_CARD,
USERNAME: row.USERNAME,
NAME: row.NAME,
CORPINFO_ID: row.CORPINFO_ID,
CORPINFO_NAME: row.CORPINFO_NAME || '',
DEPARTMENT_ID: row.DEPARTMENT_ID,
DEPARTMENT_NAME: row.DEPARTMENT_NAME,
EMAIL: row.EMAIL || '',
CARD_TYPE: '111',
CARD_TYPE_NAME: '身份证',
NATION: row.NATION_NAME || '',
SEX: row.SEX === '0' ? '男' : '女',
USER_TYPE: '1',
ISDELETE: row.ISDELETE
}
).then((data) => {
if (data.result === 'success') {
this.$message.success('推送成功')
this.getList()
} else {
this.$message.error('推送失败,' + data.msg)
}
}).catch((e) => {
this.listLoading = false
})
},
goCheck() {
if (this.pd.USER_ID_CARD && this.pd.USERNAME) {
const phoneJudge = /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[0-9])\d{8}$/
const phoneResult = phoneJudge.test(this.pd.USERNAME)
const cardJudge = /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
const cardResult = cardJudge.test(this.pd.USER_ID_CARD)
if (phoneResult && cardResult) {
console.log('格式校验通过')
requestFN(
'user/goCheck',
{
CARD_NO: this.pd.USER_ID_CARD,
USERNAME: this.pd.USERNAME
}
).then((data) => {
if (data.result === 'success') {
this.$message.success('验证通过')
this.ISCHECK = true
} else {
this.$message.error('验证失败,请确认身份证号与手机号是否正确')
this.ISCHECK = false
}
}).catch((e) => {
this.listLoading = false
this.ISCHECK = false
})
} else {
this.ISCHECK = false
}
} else {
this.ISCHECK = false
}
},
getList() {
this.listLoading = true
requestFN(
'/user/centerUserList?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
keyUserName: this.keyUserName,
keyDeptLeven: this.keyDeptLeven,
keyShudi: this.keyShudi,
keyDeptType: this.keyDeptType,
keyDepeName: this.keyDepeName,
keyJobLeven: this.keyJobLeven,
DEPARTMENT_ID: this.DEPARTMENT_ID,
PROVINCE: this.keyShudi[0] || '',
CITY: this.keyShudi[1] || '',
COUNTRY: this.keyShudi[2] || '',
VILLAGE: this.keyShudi[3] || '',
ISPUSH: '0'
}
).then((data) => {
this.listLoading = false
this.varList = data.userList
this.total = data.page.totalResult
})
.catch((e) => {
this.listLoading = false
})
},
goKeyReset() {
this.keyUserName = ''
this.keyDeptLeven = ''
this.keyShudi = ''
this.keyDeptType = ''
this.keyDepeName = ''
this.keyJobLeven = ''
this.getList()
if (this.$refs.refDeptLeven) {
this.$refs.refDeptLeven.clearHandle()
}
if (this.$refs.shudi) {
this.$refs.shudi.clearHandle()
}
if (this.$refs.refDeptType) {
this.$refs.refDeptType.clearHandle()
}
if (this.$refs.refJobLeven) {
this.$refs.refJobLeven.clearHandle()
}
},
goAddUser() { //
requestFN(
'/user/goAddUser',
{}
).then((data) => {
this.roleList = data.roleList
})
.catch((e) => {
})
},
unLockUser(id, name) {
this.$confirm('确定要解锁 [ 帐号:' + name + ' ] 吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/user/unLockUser',
{
USER_ID: id
}
).then(() => {
this.$message({
message: '解锁成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
handleAdd() {
this.dialogFormEdit = true
this.ISCHECK = false
this.pd = {}
this.dialogType = 'saveUser'
this.pd.PASSWORD = 'Aa@123456789'
},
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
this.listLoading = true
if (this.pd.ROLE_ID) {
var roleIDs = ''
this.pd.ROLE_ID.forEach((item) => {
roleIDs += item + ';'
})
this.pd.roleIDs = roleIDs
}
if (this.pd.shudi) {
this.pd.PROVINCE = this.pd.shudi[0]
this.pd.CITY = this.pd.shudi[1]
this.pd.COUNTRY = this.pd.shudi[2] || ''
this.pd.VILLAGE = this.pd.shudi[3] || ''
}
requestFN(
'/user/' + this.dialogType,
this.pd
).then((data) => {
this.listLoading = false
this.dialogFormEdit = false
this.varList = []
this.$refs.deptTree.clearHandle()
this.listQuery.page = 1
this.goPush(data.pd)
this.getList()
}).catch((e) => {
this.listLoading = false
})
} else {
return false
}
})
},
handleDelete(row) {
this.$confirm('确定要删除[' + row.USERNAME + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/user/deleteUser',
{
USER_ID: row.USER_ID,
ISPUSH: row.ISPUSH
}
).then((data) => {
if (data.result == 'success') {
this.listLoading = false
this.getList()
}
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
makeAll(msg) {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const ids = _selectData.map((item, index) => {
return item.USER_ID
}).join(',')
var tishi = ''
if (msg == '0') {
tishi = '确定要删除选中的数据吗?'
} else if (msg == '1') {
tishi = '确定要给选中的用户发送站内信吗?'
} else {
this.$message({
message: '请选择操作类型...',
type: 'error'
})
return false
}
this.$confirm(tishi, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (msg == '0') {
this.listLoading = true
requestFN(
'/user/deleteAllUser',
{
USER_IDS: ids
}
).then(() => {
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}
}).catch(() => {
})
},
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
handleRecord(USER_ID) {
this.dialogType = 'record'
this.dialogFormRecord = true
requestFN(
'/user/getUserRecord',
{
USER_ID: USER_ID
}
).then((data) => {
if (data.result == 'success') {
this.recordList = data.varList
}
})
.catch((e) => {
this.listLoading = false
})
},
async handleEdit(row) {
this.dialogType = 'editUser'
this.pd = JSON.parse(JSON.stringify(row))
const areaRefID = []
if (this.pd.PROVINCE) {
areaRefID.push(this.pd.PROVINCE)
}
if (this.pd.CITY) {
areaRefID.push(this.pd.CITY)
}
if (this.pd.COUNTRY) {
areaRefID.push(this.pd.COUNTRY)
}
if (this.pd.VILLAGE) {
areaRefID.push(this.pd.VILLAGE)
}
this.$set(this.pd, 'shudi', areaRefID)
const refDeptLevelVal = {}
refDeptLevelVal.id = this.pd.deptLevenlID
const deptRefsValue = {}
deptRefsValue.id = this.pd.DEPARTMENT_ID
var arrString = []
if (this.pd.ROLE_ID != null && this.pd.ROLE_ID != '') {
arrString.push(this.pd.ROLE_ID)
}
if (this.pd.ROLE_IDS != null && this.pd.ROLE_IDS != '' && this.pd.ROLE_IDS != undefined && this.pd.ROLE_IDS != 'undefined') {
//
this.pd.ROLE_IDS = this.pd.ROLE_IDS.substring(0, this.pd.ROLE_IDS.length - 1)
var arrList = this.pd.ROLE_IDS && this.pd.ROLE_IDS != '' ? this.pd.ROLE_IDS.split(';') : ''
// eslint-disable-next-line no-unused-vars
for (const item1 of arrList) { // ID
arrString.push(item1)
}
}
this.pd.ROLE_ID = arrString
this.dialogFormEdit = true
await this.$nextTick()
},
handleEditStatus(row, type) {
const typeName = type == '1' ? '禁用' : '启用'
this.$confirm('确定要' + typeName + '[' + row.USERNAME + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/user/updateUserStatus',
{
USER_ID: row.USER_ID,
status: type
}
).then((data) => {
if (data.result == 'success') {
this.listLoading = false
this.goPush(row)
this.getList()
}
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
hasButton: function () {
var keys = 'user:add,user:del,user:edit,fhSms,email,fromExcel,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys, tm: new Date().getTime()
}
).then((data) => {
if (data.result == 'success') {
this.add = data.userfhadminadd //
this.del = data.userfhadmindel //
this.edit = data.userfhadminedit //
this.fromExcel = data.fromExcel // excel
this.toExcel = data.toExcel // excel
} else if (data.result == 'exception') {
// showException('', data.exception)//
}
})
.catch((e) => {
this.listLoading = false
})
},
//
getDict(dicID, listName) {
requestFN(
'dictionaries/getLevels',
{DICTIONARIES_ID: dicID}
).then((data) => {
this[listName] = data.list
}).catch((e) => {
this.listLoading = false
})
},
//
getDict2(dicID, listName) {
requestFN(
'dictionaries/getLevels',
{DICTIONARIES_ID: dicID}
).then((data) => {
this.uesrInfoDic[listName] = data.list
}).catch((e) => {
this.listLoading = false
})
},
getDepartTreeList() {
this.pd.DEPARTMENT_ID = ''
if (this.$refs.deptTree) {
this.$refs.deptTree.clearHandle()
}
return new Promise((resolve) => {
requestFN(
'/department/listTreeByType'
).then((data) => {
this.deptTreeData = JSON.parse(data.zTreeNodes)
resolve()
}).catch((e) => {
})
})
},
resetPwd(id, name) {
this.$confirm('是否重置密码为Aa@123456789?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/user/resetPwd',
{
USER_ID: id
}
).then(() => {
this.$message({
message: '重置成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
handleNodeClick(node, data, value) {
this.DEPARTMENT_ID = node.id
this.getList()
},
/*resetPassword() {
this.$confirm('一键重置密码,会将所有未修改过密码的用户进行密码重置重置,是否继续?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/user/resetPwdAll',
{}
).then(() => {
this.$message({
message: '重置成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},*/
getTreeList() {
this.treeLoading = true
requestFN(
'/department/listTree',
{}
).then((data) => {
this.treeLoading = false
this.treeData = JSON.parse(data.zTreeNodes)
}).catch((e) => {
this.treeLoading = false
})
},
}
}
</script>

View File

@ -78,7 +78,7 @@
<span v-if="row.STATUS =='1'"></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="400">
<el-table-column label="操作" align="center" width="500">
<template slot-scope="{row}">
<el-button v-show="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)"></el-button>
<el-button v-show="edit" type="success" icon="el-icon-view" size="mini" @click="resetPwd(row.USER_ID)"></el-button>
@ -86,6 +86,7 @@
<el-button v-show="row.STATUS== 0" type="primary" icon="el-icon-edit" size="mini" @click="handleEditStatus(row,'1', row.USER_ID)"></el-button>
<el-button v-show="row.STATUS== 1" type="primary" icon="el-icon-edit" size="mini" @click="handleEditStatus(row,'0', row.USER_ID)"></el-button>
<el-button v-show="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.USER_ID,row.USERNAME)"></el-button>
<el-button v-if="row.ISPUSH == '0'" type="primary" icon="el-icon-position" size="mini" @click="goPush(row)"></el-button>
</template>
</el-table-column>
</el-table>
@ -108,13 +109,16 @@
</el-select>
</el-form-item>
<el-form-item label="用户名" prop="USERNAME">
<el-input v-model="pd.USERNAME" :disabled="dialogType == 'editUser'" placeholder="这里输入用户名..." />
<el-input v-model="pd.USERNAME" :disabled="dialogType == 'editUser'" placeholder="这里输入用户名..." @blur="goCheck()"/>
</el-form-item>
<el-form-item label="姓名" prop="NAME">
<el-input v-model="pd.NAME" placeholder="这里输入姓名..." />
</el-form-item>
<el-form-item v-if="dialogType != 'editUser'" label="密码" prop="PASSWORD">
<el-input v-model="pd.userPASSWORD" show-password placeholder="这里输入密码..." />
<!-- <el-form-item v-if="dialogType != 'editUser'" label="密码" prop="PASSWORD">-->
<!-- <el-input v-model="pd.userPASSWORD" show-password placeholder="这里输入密码..." />-->
<!-- </el-form-item>-->
<el-form-item label="身份证号" prop="USER_ID_CARD">
<el-input v-model="pd.USER_ID_CARD" placeholder="这里输入身份证号..." @blur="goCheck()"/>
</el-form-item>
<el-form-item label="性别" prop="SEX">
<el-radio v-model="pd.SEX" :label="'0'"></el-radio>
@ -147,6 +151,15 @@
<el-option v-for="item in deptTypeLevenAllList" :key="item.BIANMA" :label="item.NAME" :value="item.DICTIONARIES_ID" />
</el-select>
</el-form-item>
<el-form-item label="民族" prop="NATION">
<el-select v-model="pd.NATION" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in uesrInfoDic.minzuList"
:key="item.DICTIONARIES_ID"
:label="item.NAME"
:value="item.DICTIONARIES_ID"/>
</el-select>
</el-form-item>
<!-- 相关方的业务需求,是否为审核人员.如果为是的情况,就是可以在入场培训中选择 -->
<el-form-item label="是否审核人员" prop="ISASSESS">
<el-radio v-model="pd.ISASSESS" :label="'1'"></el-radio>
@ -167,7 +180,8 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormEdit = false"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
<el-button v-show="ISCHECK" type="primary" @click="confirm"> </el-button>
<el-button v-show="!ISCHECK" type="primary" @click="goCheck"> </el-button>
</div>
</el-dialog>
</div>
@ -245,12 +259,13 @@ export default {
keyDeptType: '',
keyDepeName: '',
keyJobLeven: '',
ISCHECK: false,
dialogFormEdit: false,
editloading: false,
dialogType: 'add',
rules: {
EMAIL: [
{ required: false, message: '请输入邮箱', trigger: 'blur' },
{ required: true, message: '请输入邮箱', trigger: 'blur' },
{
pattern: /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/,
message: '请输入正确的邮箱'
@ -260,11 +275,7 @@ export default {
ROLE_ID: [
{ required: true, message: '角色不能为空', trigger: 'blur' }
],
USERNAME: [
{ required: true, message: '用户名不能为空', trigger: 'blur' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' },
{ validator: hasUser, trigger: 'blur' }
],
NAME: [
{ required: true, message: '姓名不能为空', trigger: 'blur' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
@ -272,6 +283,9 @@ export default {
SEX: [
{ required: true, message: '请选择性别', trigger: 'blur' }
],
NATION: [
{ required: true, message: '请选择民族', trigger: 'blur' }
],
PHONE: [
{ required: true, message: '手机号不能为空', trigger: 'blur' },
{ min: 11, max: 11, message: '请输入11位手机号码', trigger: 'blur' },
@ -294,9 +308,20 @@ export default {
],
ISASSESS: [
{ required: true, message: '请选择是否审核人员', trigger: 'blur' }
],
USER_ID_CARD: [{ required: true, message: '身份证号不能为空', trigger: 'blur' },
{
pattern: /^\d{6}(18|19|20)?\d{2}(0[1-9]|1[0-2])(([0-2][1-9])|10|20|30|31)\d{3}(\d|X|x)$/,
message: '请输入正确的身份证号'
}
]
},
uesrInfoDic: {
minzuList: [], // 0a0e406f27f74ee698fe9979d25f62dd
xingbieList: [], // 21501808bbc344d593fbf9ccfe6c4531
},
pd: {
USER_ID: '',
ROLE_ID: [], // ID
USERNAME: '', //
NAME: '', //
@ -315,7 +340,9 @@ export default {
VILLAGE: '', //
JOB_LEVEL: '', //
ISASSESS: '',
JOB: ''//
JOB: '', //
USER_ID_CARD: '', //
NATION: '' //
},
roleList: [],
multipleSelectionAll: [], //
@ -374,6 +401,8 @@ export default {
created() {
this.getList()
this.hasButton()
this.getDict2('0a0e406f27f74ee698fe9979d25f62dd', 'minzuList')
this.getDict2('21501808bbc344d593fbf9ccfe6c4531', 'xingbieList')
this.getDict('3e057d284c294a48af32948d58e92e3d', 'deptTypeLevenAllList')
this.getDict('3f3a6ac41247438e91df2830765068ba', 'unitTypeList')
this.getDepartTreeList()
@ -382,6 +411,103 @@ export default {
this.getTreeList()
},
methods: {
goPush(row) {
requestFN(
'user/goPush',
{
STATUS: row.STATUS,
BZ: row.BZ,
SKIN: row.SKIN,
PHONE: row.PHONE,
NUMBER: row.NUMBER,
ISMAIN: row.ISMAIN,
OPENID: row.APPID,
SORT: row.SORT,
LEARNERCATEGORY: row.LEARNERCATEGORY,
USERAVATARPREFIX: row.USERAVATARPREFIX,
USERAVATARURL: row.USERAVATARURL,
SHIFTDUTYONE: row.SHIFTDUTYONE,
SHIFTDUTYTWO: row.SHIFTDUTYTWO,
DURATION: row.DURATION,
WORKSTATUS: row.WORKSTATUS,
WORKPERIOD: row.WORKPERIOD,
PERSONNEL_TYPE: row.PERSONNEL_TYPE,
TITLE: row.TITLE,
ISSTATE: row.ISSTATE,
INCUMBENCY: row.INCUMBENCY,
WORKING_DATE: row.WORKING_DATE,
ENTRY_DATE: row.ENTRY_DATE,
TYPE_OF_WORK: row.TYPE_OF_WORK,
DUTIES: row.DUTIES,
DEGREE_OF_EDUCATION: row.DEGREE_OF_EDUCATION,
DATE_OF_BIRTH: row.DATE_OF_BIRTH,
POLITICAL_OUTLOOK: row.POLITICAL_OUTLOOK,
PROVINCE: row.PROVINCE,
CITY: row.CITY,
COUNTRY: row.COUNTRY,
VILLAGE: row.VILLAGE,
USER_ID: row.USER_ID,
CARD_NO: row.USER_ID_CARD,
USERNAME: row.USERNAME,
NAME: row.NAME,
CORPINFO_ID: row.CORPINFO_ID,
CORPINFO_NAME: row.CORPINFO_NAME || '',
DEPARTMENT_ID: row.DEPARTMENT_ID,
DEPARTMENT_NAME: row.DEPARTMENT_NAME,
EMAIL: row.EMAIL || '',
CARD_TYPE: '111',
CARD_TYPE_NAME: '身份证',
NATION: row.NATION_NAME || '',
SEX: row.SEX === '0' ? '男' : '女',
USER_TYPE: '1',
ISDELETE: row.ISDELETE
}
).then((data) => {
if (data.result === 'success') {
this.$message.success('推送成功')
this.getList()
} else {
this.$message.error('推送失败,' + data.msg)
this.getList()
}
}).catch((e) => {
this.listLoading = false
})
},
goCheck() {
if (this.pd.USER_ID_CARD && this.pd.PHONE) {
const phoneJudge = /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[0-9])\d{8}$/
const phoneResult = phoneJudge.test(this.pd.PHONE)
const cardJudge = /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
const cardResult = cardJudge.test(this.pd.USER_ID_CARD)
if (phoneResult && cardResult) {
console.log('格式校验通过')
requestFN(
'user/goCheck',
{
CARD_NO: this.pd.USER_ID_CARD,
USERNAME: this.pd.PHONE,
USER_ID: this.pd.USER_ID || ''
}
).then((data) => {
if (data.result === 'success') {
this.$message.success('验证通过')
this.ISCHECK = true
} else {
this.$message.error('验证失败,请确认身份证号与手机号是否正确')
this.ISCHECK = false
}
}).catch((e) => {
this.listLoading = false
this.ISCHECK = false
})
} else {
this.ISCHECK = false
}
} else {
this.ISCHECK = false
}
},
getList() {
this.listLoading = true
requestFN(
@ -397,7 +523,8 @@ export default {
PROVINCE: this.keyShudi[0] || '',
CITY: this.keyShudi[1] || '',
COUNTRY: this.keyShudi[2] || '',
VILLAGE: this.keyShudi[3] || ''
VILLAGE: this.keyShudi[3] || '',
ISPUSH: '1'
}
).then((data) => {
this.listLoading = false
@ -471,6 +598,7 @@ export default {
},
handleAdd() {
this.dialogFormEdit = true
this.ISCHECK = false
this.pd = {}
this.dialogType = 'saveUser'
this.pd.PASSWORD = 'Aa@123456789'
@ -501,7 +629,7 @@ export default {
this.varList = []
this.$refs.deptTree.clearHandle()
this.listQuery.page = 1
this.getList()
this.goPush(data.pd)
}).catch((e) => {
this.listLoading = false
})
@ -643,6 +771,7 @@ export default {
).then((data) => {
if (data.result == 'success') {
this.listLoading = false
this.goPush(row)
this.getList()
}
}).catch((e) => {
@ -684,6 +813,17 @@ export default {
this.listLoading = false
})
},
//
getDict2(dicID, listName) {
requestFN(
'dictionaries/getLevels',
{ DICTIONARIES_ID: dicID }
).then((data) => {
this.uesrInfoDic[listName] = data.list
}).catch((e) => {
this.listLoading = false
})
},
getDepartTreeList() {
this.pd.DEPARTMENT_ID = ''
if (this.$refs.deptTree) {

View File

@ -0,0 +1,930 @@
<template>
<div class="app-container">
<el-container>
<el-aside width="300px" style="background-color:#fff">
<el-input
v-model="filterText"
placeholder="输入关键字进行过滤"
style="margin:10px 0"/>
<el-tree
v-loading="treeLoading"
ref="tree"
:data="treeData"
:props="defaultProps"
:filter-node-method="filterNode"
class="filter-tree"
@node-click="handleNodeClick"/>
</el-aside>
<el-main>
<div class="filter-container">
<div class="filter-lable w80">用户名称</div>
<el-input v-model="keyUserName" clearable placeholder="搜索用户名" class="filter-item" style="width: 200px;"/>
<div class="filter-lable w80">职务级别</div>
<el-select ref="refDeptLeven" v-model="keyJobLeven" clearable placeholder="请选择部门级别" class="filter-item" style="width: 200px;" >
<el-option v-for="item in deptTypeLevenAllList" :key="item.BIANMA" :label="item.NAME" :value="item.DICTIONARIES_ID" />
</el-select>
<!-- <div class="filter-lable w80">行政区域</div>-->
<!-- <el-cascader ref="shudi" v-model="keyShudi" :props="areaprops" clearable placeholder="请选择行政区域" style="width: 200px" />-->
<!-- <div class="filter-lable w80">单位类型</div>-->
<!-- <el-select ref="refDeptType" v-model="keyDeptType" clearable placeholder="请选择单位类型" class="filter-item">-->
<!-- <el-option v-for="item in unitTypeList" :key="item.DICTIONARIES_ID" :label="item.NAME" :value="item.DICTIONARIES_ID" />-->
<!-- </el-select>-->
<div class="filter-lable w80">部门名称</div>
<el-input v-model="keyDepeName" clearable placeholder="搜索部门名称" class="filter-item" style="width: 200px;"/>
<!-- <div class="filter-lable w80">职务级别</div>-->
<!-- <el-select ref="refJobLeven" v-model="keyJobLeven" clearable placeholder="请选择" class="filter-item">-->
<!-- <el-option v-for="item in jobTypeAllList" :key="item.DICTIONARIES_ID" :label="item.NAME" :value="item.DICTIONARIES_ID" />-->
<!-- </el-select>-->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
<el-button v-waves v-if="LOGIN_USER === '1'" class="filter-item" type="warning" icon="el-icon-warning" size="mini" plain @click="resetPassword">
一键密码重置
</el-button>
</div>
<el-table
ref="multipleTable"
:data="varList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="USERNAME" label="用户名" />
<el-table-column prop="NAME" label="姓名" />
<el-table-column prop="SEX" label="性别">
<template slot-scope="{row}">
<span v-if="row.SEX =='0'"></span>
<span v-if="row.SEX =='1'"></span>
</template>
</el-table-column>
<el-table-column prop="DEPARTMENT_NAME" label="部门" />
<el-table-column prop="jobLevenName" label="职务级别" />
<el-table-column prop="STATUS" label="状态" >
<template slot-scope="{row}">
<span v-if="row.STATUS =='0'"></span>
<span v-if="row.STATUS =='1'"></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="500">
<template slot-scope="{row}">
<el-button v-show="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)"></el-button>
<el-button v-show="edit" type="success" icon="el-icon-view" size="mini" @click="resetPwd(row.USER_ID)"></el-button>
<el-button v-show="edit && row.STATUS === '99'" type="warning" icon="el-icon-unlock" size="mini" @click="unLockUser(row.USER_ID, row.NAME)"></el-button>
<el-button v-show="row.STATUS== 0" type="primary" icon="el-icon-edit" size="mini" @click="handleEditStatus(row,'1', row.USER_ID)"></el-button>
<el-button v-show="row.STATUS== 1" type="primary" icon="el-icon-edit" size="mini" @click="handleEditStatus(row,'0', row.USER_ID)"></el-button>
<el-button v-show="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row)"></el-button>
<el-button v-if="row.ISPUSH != '1'" type="primary" icon="el-icon-position" size="mini" @click="goPush(row)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<template >
<el-button v-show="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<el-button v-show="del" type="danger" icon="el-icon-delete" plain @click="makeAll('0')"></el-button>
</template>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
</el-main>
</el-container>
<el-dialog v-loading="editloading" :visible.sync="dialogFormEdit" :title="dialogType==='editUser'?'修改':'新增'" width="600px">
<el-form ref="form" :rules="rules" :model="pd" label-width="110px" style="width: 500px;">
<el-form-item label="角色" prop="ROLE_ID">
<el-select v-model="pd.ROLE_ID" multiple placeholder="请选择角色">
<el-option v-for="item in roleList" :key="item.role_ID" :label="item.role_NAME" :value="item.role_ID" />
</el-select>
</el-form-item>
<el-form-item label="用户名" prop="USERNAME">
<el-input v-model="pd.USERNAME" :disabled="dialogType == 'editUser'" placeholder="这里输入用户名..." @blur="goCheck()"/>
</el-form-item>
<el-form-item label="姓名" prop="NAME">
<el-input v-model="pd.NAME" placeholder="这里输入姓名..." />
</el-form-item>
<el-form-item v-if="dialogType != 'editUser'" label="密码" prop="PASSWORD">
<el-input v-model="pd.userPASSWORD" show-password placeholder="这里输入密码..." />
</el-form-item>
<el-form-item label="身份证号" prop="USER_ID_CARD">
<el-input v-model="pd.USER_ID_CARD" placeholder="这里输入身份证号..." @blur="goCheck()"/>
</el-form-item>
<el-form-item label="性别" prop="SEX">
<el-radio v-model="pd.SEX" :label="'0'"></el-radio>
<el-radio v-model="pd.SEX" :label="'1'"></el-radio>
</el-form-item>
<el-form-item label="手机号" prop="PHONE">
<el-input v-model="pd.PHONE" placeholder="这里输入手机号..." />
</el-form-item>
<!-- <el-form-item label="部门级别" prop="deptTypeID"> &lt;!&ndash;目的是选择部门到这个级别 &ndash;&gt;-->
<!-- <el-select v-model="pd.deptTypeID" placeholder="请选择" class="filter-item" >-->
<!-- <el-option v-for="item in deptTypeLevenAllList" :key="item.BIANMA" :label="item.NAME" :value="item.DICTIONARIES_ID" />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="单位部门" prop="DEPARTMENT_ID">
<SelectTree
v-if="dialogFormEdit"
ref="deptTree"
:clearable="false"
:options="deptTreeData"
:props="deptDefaultProps"
v-model="pd.DEPARTMENT_ID"
placeholder="请选择部门"
/>
</el-form-item>
<el-form-item label="行政区域" prop="shudi"> <!--河北省的就可以 -->
<el-cascader v-if="dialogFormEdit" id="shudi" ref="shudi" v-model="pd.shudi" :props="areaprops" placeholder="请选择省市县" style="width: 100%" />
</el-form-item>
<el-form-item label="职务级别" prop="JOB_LEVEL">
<el-select ref="refJobLevel" v-model="pd.JOB_LEVEL" placeholder="请选择" class="filter-item">
<el-option v-for="item in deptTypeLevenAllList" :key="item.BIANMA" :label="item.NAME" :value="item.DICTIONARIES_ID" />
</el-select>
</el-form-item>
<el-form-item label="民族" prop="NATION">
<el-select v-model="pd.NATION" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in uesrInfoDic.minzuList"
:key="item.DICTIONARIES_ID"
:label="item.NAME"
:value="item.DICTIONARIES_ID"/>
</el-select>
</el-form-item>
<!-- 相关方的业务需求,是否为审核人员.如果为是的情况,就是可以在入场培训中选择 -->
<el-form-item label="是否审核人员" prop="ISASSESS">
<el-radio v-model="pd.ISASSESS" :label="'1'"></el-radio>
<el-radio v-model="pd.ISASSESS" :label="'0'"></el-radio>
</el-form-item>
<el-form-item label="职务" prop="JOB">
<el-input v-model="pd.JOB" placeholder="这里输入职务..." />
</el-form-item>
<el-form-item label="邮箱" prop="EMAIL">
<el-input v-model="pd.EMAIL" placeholder="这里输入邮箱..." />
</el-form-item>
<el-form-item label="排序" prop="SORT">
<el-input v-model.number="pd.SORT" placeholder="这里输入排序..." />
</el-form-item>
<el-form-item label="备注">
<el-input v-model="pd.BZ" type="textarea" placeholder="这里输入备注说明..." />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormEdit = false"> </el-button>
<el-button v-show="ISCHECK" type="primary" @click="confirm"> </el-button>
<el-button v-show="!ISCHECK" type="primary" @click="goCheck"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
var hasUser = (rule, value, callback) => {
if (this.dialogType != 'editUser') {
requestFN(
'/user/hasUser',
{
USERNAME: value,
tm: new Date().getTime()
}
).then((data) => {
if (data.result == 'success') {
callback()
} else {
callback(new Error('用户名重复'))
}
}).catch((e) => {
})
} else {
callback()
}
}
var hasEmail = (rule, value, callback) => {
if (value) {
requestFN(
'/user/hasEmail',
{
EMAIL: value,
USERNAME: this.pd.USERNAME
}
).then((data) => {
if (data.result == 'success') {
callback()
} else {
callback(new Error('邮箱重复'))
}
}).catch((e) => {
})
} else {
callback()
}
}
return {
LOGIN_USER: JSON.parse(sessionStorage.getItem('user')).USER_ID,
treeLoading: false,
treeData: [],
defaultProps: {
children: 'nodes',
label: 'name'
},
listQuery: {
page: 1,
limit: 20
},
total: 0,
varList: [],
filterText: '',
keyUserName: '',
keyDeptLeven: '',
keyShudi: '',
keyDeptType: '',
keyDepeName: '',
keyJobLeven: '',
ISCHECK: false,
dialogFormEdit: false,
editloading: false,
dialogType: 'add',
rules: {
EMAIL: [
{ required: true, message: '请输入邮箱', trigger: 'blur' },
{
pattern: /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/,
message: '请输入正确的邮箱'
},
{ validator: hasEmail, trigger: 'blur' }
],
ROLE_ID: [
{ required: true, message: '角色不能为空', trigger: 'blur' }
],
USERNAME: [
{ required: true, message: '用户名不能为空', 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: '用户名需使用手机号码格式'
},
{ validator: hasUser, trigger: 'blur' }
],
NAME: [
{ required: true, message: '姓名不能为空', trigger: 'blur' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
],
SEX: [
{ required: true, message: '请选择性别', trigger: 'blur' }
],
NATION: [
{ required: true, message: '请选择民族', trigger: 'blur' }
],
PHONE: [
{ 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: '请输入正确的手机号码'
}
],
deptTypeID: [
{ required: true, message: '请选择部门级别', trigger: 'blur' }
],
shudi: [
{ required: true, message: '请选择属地', trigger: 'blur' }
],
JOB_LEVEL: [
{ required: true, message: '请选择职务级别', trigger: 'blur' }
],
DEPARTMENT_ID: [
{ required: true, message: '请选择单位部门', trigger: 'blur' }
],
ISASSESS: [
{ required: true, message: '请选择是否审核人员', trigger: 'blur' }
],
USER_ID_CARD: [{ required: true, message: '身份证号不能为空', trigger: 'blur' },
{
pattern: /^\d{6}(18|19|20)?\d{2}(0[1-9]|1[0-2])(([0-2][1-9])|10|20|30|31)\d{3}(\d|X|x)$/,
message: '请输入正确的身份证号'
}
]
},
uesrInfoDic: {
minzuList: [], // 0a0e406f27f74ee698fe9979d25f62dd
xingbieList: [], // 21501808bbc344d593fbf9ccfe6c4531
},
pd: {
ROLE_ID: [], // ID
USERNAME: '', //
NAME: '', //
userPASSWORD: 'Aa@123456789', //
SEX: '', // 01
PHONE: '', //
deptTypeID: '', //
DEPARTMENT_ID: '', //
shudi: '',
BZ: '', //
EMAIL: '', //
SORT: '', //
PROVINCE: '', //
CITY: '', //
COUNTRY: '', //
VILLAGE: '', //
JOB_LEVEL: '', //
ISASSESS: '',
JOB: '', //
USER_ID_CARD: '', //
NATION: '' //
},
roleList: [],
multipleSelectionAll: [], //
multipleSelection: [], //
fromExcel: false, // excel
toExcel: false, // excel
add: false, //
del: false, //
edit: false, //
hasUserRet: false,
deptTypeLevenAllList: [], //
jobTypeAllList: [], //
deptTreeData: [], // ,
deptDefaultProps: {
value: 'id',
children: 'nodes',
label: 'name'
},
unitTypeList: [],
areaprops: {
lazy: true,
lazyLoad(node, resolve) {
setTimeout(() => {
const areaLeven = node.level
var areaParID = ''
if (areaLeven == '0') {
areaParID = 'e725d2a91b8248f4b8f49889038df7de'
} else {
areaParID = node.data.id
}
requestFN(
'dictionaries/getLevels',
{ DICTIONARIES_ID: areaParID }
).then((data) => {
const nodes = data.list.map(item => ({
value: item.DICTIONARIES_ID,
label: item.NAME.toString(),
id: item.DICTIONARIES_ID.toString(),
leaf: areaLeven > 2
}))
resolve(nodes) // resolve
}).catch((e) => {
this.editloading = false
this.listLoading = false
})
}, 500)
}
}
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.getList()
this.hasButton()
this.getDict2('0a0e406f27f74ee698fe9979d25f62dd', 'minzuList')
this.getDict2('21501808bbc344d593fbf9ccfe6c4531', 'xingbieList')
this.getDict('3e057d284c294a48af32948d58e92e3d', 'deptTypeLevenAllList')
this.getDict('3f3a6ac41247438e91df2830765068ba', 'unitTypeList')
this.getDepartTreeList()
this.getDict('f1fbdf9a286342ae98e6a56bf823f221', 'jobTypeAllList')
this.goAddUser()
this.getTreeList()
},
methods: {
goPush(row) {
requestFN(
'user/goPush',
{
STATUS: row.STATUS,
BZ: row.BZ,
SKIN: row.SKIN,
PHONE: row.PHONE,
NUMBER: row.NUMBER,
ISMAIN: row.ISMAIN,
OPENID: row.APPID,
SORT: row.SORT,
LEARNERCATEGORY: row.LEARNERCATEGORY,
USERAVATARPREFIX: row.USERAVATARPREFIX,
USERAVATARURL: row.USERAVATARURL,
SHIFTDUTYONE: row.SHIFTDUTYONE,
SHIFTDUTYTWO: row.SHIFTDUTYTWO,
DURATION: row.DURATION,
WORKSTATUS: row.WORKSTATUS,
WORKPERIOD: row.WORKPERIOD,
PERSONNEL_TYPE: row.PERSONNEL_TYPE,
TITLE: row.TITLE,
ISSTATE: row.ISSTATE,
INCUMBENCY: row.INCUMBENCY,
WORKING_DATE: row.WORKING_DATE,
ENTRY_DATE: row.ENTRY_DATE,
TYPE_OF_WORK: row.TYPE_OF_WORK,
DUTIES: row.DUTIES,
DEGREE_OF_EDUCATION: row.DEGREE_OF_EDUCATION,
DATE_OF_BIRTH: row.DATE_OF_BIRTH,
POLITICAL_OUTLOOK: row.POLITICAL_OUTLOOK,
PROVINCE: row.PROVINCE,
CITY: row.CITY,
COUNTRY: row.COUNTRY,
VILLAGE: row.VILLAGE,
USER_ID: row.USER_ID,
CARD_NO: row.USER_ID_CARD,
USERNAME: row.USERNAME,
NAME: row.NAME,
CORPINFO_ID: row.CORPINFO_ID,
CORPINFO_NAME: row.CORPINFO_NAME || '',
DEPARTMENT_ID: row.DEPARTMENT_ID,
DEPARTMENT_NAME: row.DEPARTMENT_NAME,
EMAIL: row.EMAIL || '',
CARD_TYPE: '111',
CARD_TYPE_NAME: '身份证',
NATION: row.NATION_NAME || '',
SEX: row.SEX === '0' ? '男' : '女',
USER_TYPE: '1',
ISDELETE: row.ISDELETE != null ? row.ISDELETE : "0"
}
).then((data) => {
if (data.result === 'success') {
this.$message.success('推送成功')
this.getList()
} else {
this.$message.error('推送失败,' + data.msg)
}
}).catch((e) => {
this.listLoading = false
})
},
goCheck() {
if (this.pd.USER_ID_CARD && this.pd.PHONE) {
const phoneJudge = /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[0-9])\d{8}$/
const phoneResult = phoneJudge.test(this.pd.PHONE)
const cardJudge = /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
const cardResult = cardJudge.test(this.pd.USER_ID_CARD)
// alert(this.pd.PHONE)
// alert(phoneResult)
// alert(this.pd.USER_ID_CARD)
// alert(cardResult)
if (phoneResult && cardResult) {
console.log('格式校验通过')
requestFN(
'user/goCheck',
{
CARD_NO: this.pd.USER_ID_CARD,
USERNAME: this.pd.PHONE,
USER_ID: this.pd.USER_ID
}
).then((data) => {
if (data.result === 'success') {
this.$message.success('验证通过')
this.ISCHECK = true
} else {
this.$message.error('验证失败,请确认身份证号与手机号是否正确')
this.ISCHECK = false
}
}).catch((e) => {
this.listLoading = false
this.ISCHECK = false
})
} else {
this.ISCHECK = false
}
} else {
this.ISCHECK = false
}
},
getList() {
this.listLoading = true
requestFN(
'/user/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
keyUserName: this.keyUserName,
keyDeptLeven: this.keyDeptLeven,
keyShudi: this.keyShudi,
keyDeptType: this.keyDeptType,
keyDepeName: this.keyDepeName,
keyJobLeven: this.keyJobLeven,
DEPARTMENT_ID: this.DEPARTMENT_ID,
PROVINCE: this.keyShudi[0] || '',
CITY: this.keyShudi[1] || '',
COUNTRY: this.keyShudi[2] || '',
VILLAGE: this.keyShudi[3] || '',
ISPUSH: '0'
}
).then((data) => {
this.listLoading = false
this.varList = data.userList
this.total = data.page.totalResult
})
.catch((e) => {
this.listLoading = false
})
},
goKeyReset() {
this.keyUserName = ''
this.keyDeptLeven = ''
this.keyShudi = ''
this.keyDeptType = ''
this.keyDepeName = ''
this.keyJobLeven = ''
this.getList()
if (this.$refs.refDeptLeven) {
this.$refs.refDeptLeven.clearHandle()
}
if (this.$refs.shudi) {
this.$refs.shudi.clearHandle()
}
if (this.$refs.refDeptType) {
this.$refs.refDeptType.clearHandle()
}
if (this.$refs.refJobLeven) {
this.$refs.refJobLeven.clearHandle()
}
},
goAddUser() { //
requestFN(
'/user/goAddUser',
{
}
).then((data) => {
this.roleList = data.roleList
})
.catch((e) => {
})
},
unLockUser(id, name) {
this.$confirm('确定要解锁 [ 帐号:' + name + ' ] 吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/user/unLockUser',
{
USER_ID: id
}
).then(() => {
this.$message({
message: '解锁成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
handleAdd() {
this.dialogFormEdit = true
this.ISCHECK = false
this.pd = {}
this.dialogType = 'saveUser'
this.pd.PASSWORD = 'Aa@123456789'
},
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
this.listLoading = true
if (this.pd.ROLE_ID) {
var roleIDs = ''
this.pd.ROLE_ID.forEach((item) => {
roleIDs += item + ';'
})
this.pd.roleIDs = roleIDs
}
if (this.pd.shudi) {
this.pd.PROVINCE = this.pd.shudi[0]
this.pd.CITY = this.pd.shudi[1]
this.pd.COUNTRY = this.pd.shudi[2] || ''
this.pd.VILLAGE = this.pd.shudi[3] || ''
}
requestFN(
'/user/' + this.dialogType,
this.pd
).then((data) => {
this.listLoading = false
this.dialogFormEdit = false
this.varList = []
this.$refs.deptTree.clearHandle()
this.listQuery.page = 1
console.log(data.pd)
this.goPush(data.pd)
this.getList()
}).catch((e) => {
this.listLoading = false
})
} else {
return false
}
})
},
handleDelete(row) {
this.$confirm('确定要删除[' + row.USERNAME + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/user/deleteUser',
{
USER_ID: row.USER_ID,
ISPUSH: row.ISPUSH
}
).then((data) => {
if (data.result == 'success') {
this.listLoading = false
this.getList()
}
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
makeAll(msg) {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const ids = _selectData.map((item, index) => {
return item.USER_ID
}).join(',')
var tishi = ''
if (msg == '0') {
tishi = '确定要删除选中的数据吗?'
} else if (msg == '1') {
tishi = '确定要给选中的用户发送站内信吗?'
} else {
this.$message({
message: '请选择操作类型...',
type: 'error'
})
return false
}
this.$confirm(tishi, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (msg == '0') {
this.listLoading = true
requestFN(
'/user/deleteAllUser',
{
USER_IDS: ids
}
).then(() => {
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}
}).catch(() => {
})
},
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
async handleEdit(row) {
console.log(row)
this.dialogType = 'editUser'
this.pd = JSON.parse(JSON.stringify(row))
const areaRefID = []
if (this.pd.PROVINCE) {
areaRefID.push(this.pd.PROVINCE)
}
if (this.pd.CITY) {
areaRefID.push(this.pd.CITY)
}
if (this.pd.COUNTRY) {
areaRefID.push(this.pd.COUNTRY)
}
if (this.pd.VILLAGE) {
areaRefID.push(this.pd.VILLAGE)
}
this.$set(this.pd, 'shudi', areaRefID)
const refDeptLevelVal = {}
refDeptLevelVal.id = this.pd.deptLevenlID
const deptRefsValue = {}
deptRefsValue.id = this.pd.DEPARTMENT_ID
var arrString = []
if (this.pd.ROLE_ID != null && this.pd.ROLE_ID != '') {
arrString.push(this.pd.ROLE_ID)
}
if (this.pd.ROLE_IDS != null && this.pd.ROLE_IDS != '' && this.pd.ROLE_IDS != undefined && this.pd.ROLE_IDS != 'undefined') {
//
this.pd.ROLE_IDS = this.pd.ROLE_IDS.substring(0, this.pd.ROLE_IDS.length - 1)
var arrList = this.pd.ROLE_IDS && this.pd.ROLE_IDS != '' ? this.pd.ROLE_IDS.split(';') : ''
// eslint-disable-next-line no-unused-vars
for (const item1 of arrList) { // ID
arrString.push(item1)
}
}
this.pd.ROLE_ID = arrString
this.dialogFormEdit = true
await this.$nextTick()
},
handleEditStatus(row, type) {
const typeName = type == '1' ? '禁用' : '启用'
this.$confirm('确定要' + typeName + '[' + row.USERNAME + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/user/updateUserStatus',
{
USER_ID: row.USER_ID,
status: type
}
).then((data) => {
if (data.result == 'success') {
this.listLoading = false
this.goPush(row)
this.getList()
}
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
hasButton: function() {
var keys = 'user:add,user:del,user:edit,fhSms,email,fromExcel,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys, tm: new Date().getTime()
}
).then((data) => {
if (data.result == 'success') {
this.add = data.userfhadminadd //
this.del = data.userfhadmindel //
this.edit = data.userfhadminedit //
this.fromExcel = data.fromExcel // excel
this.toExcel = data.toExcel // excel
} else if (data.result == 'exception') {
// showException('', data.exception)//
}
})
.catch((e) => {
this.listLoading = false
})
},
//
getDict(dicID, listName) {
requestFN(
'dictionaries/getLevels',
{ DICTIONARIES_ID: dicID }
).then((data) => {
this[listName] = data.list
}).catch((e) => {
this.listLoading = false
})
},
//
getDict2(dicID, listName) {
requestFN(
'dictionaries/getLevels',
{ DICTIONARIES_ID: dicID }
).then((data) => {
this.uesrInfoDic[listName] = data.list
}).catch((e) => {
this.listLoading = false
})
},
getDepartTreeList() {
this.pd.DEPARTMENT_ID = ''
if (this.$refs.deptTree) {
this.$refs.deptTree.clearHandle()
}
return new Promise((resolve) => {
requestFN(
'/department/listTreeByType'
).then((data) => {
this.deptTreeData = JSON.parse(data.zTreeNodes)
resolve()
}).catch((e) => {
})
})
},
resetPwd(id, name) {
this.$confirm('是否重置密码为Aa@123456789?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/user/resetPwd',
{
USER_ID: id
}
).then(() => {
this.$message({
message: '重置成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
handleNodeClick(node, data, value) {
this.DEPARTMENT_ID = node.id
this.getList()
},
resetPassword() {
this.$confirm('一键重置密码,会将所有未修改过密码的用户进行密码重置重置,是否继续?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/user/resetPwdAll',
{}
).then(() => {
this.$message({
message: '重置成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
getTreeList() {
this.treeLoading = true
requestFN(
'/department/listTree',
{}
).then((data) => {
this.treeLoading = false
this.treeData = JSON.parse(data.zTreeNodes)
}).catch((e) => {
this.treeLoading = false
})
}
}
}
</script>

View File

@ -206,7 +206,7 @@ export default {
this.form.FLOWS_TYPE = '2'
if (this.form.TYPE !== '2') {
this.loading = true
requestFN('/xgf/user/approveMax', this.form)
requestFN('/xgf/user/repeatPush', this.form)
.then((data) => {
if (data.code === '0') {
this.$message.success('推送成功')
@ -234,7 +234,7 @@ export default {
}
}
this.loading = true
upload('/xgf/user/approveMax', formData)
upload('/xgf/user/repeatPush', formData)
.then((data) => {
this.$message.success('推送成功')
this.visible = false