1053 lines
32 KiB
Vue
1053 lines
32 KiB
Vue
<template>
|
||
<div class="icons-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-row mb-10">
|
||
<div class="filter-group ">
|
||
<div class="filter-lable">
|
||
搜索:
|
||
</div>
|
||
<div class="filter-width">
|
||
<el-input v-model="KEYWORDS" placeholder="请输入关键字" class="filter-item" />
|
||
</div>
|
||
</div>
|
||
<div class="filter-group">
|
||
<div class="filter-lable">
|
||
排班:
|
||
</div>
|
||
<div class="filter-width">
|
||
<el-select v-model="SHIFTDUTYONE" placeholder="请选择">
|
||
<el-option v-for="item in queryShiftOneList" :key="item.SHIFTWORKRULES_ID" :label="item.NAME" :value="item.SHIFTWORKRULES_ID" />
|
||
</el-select>
|
||
</div>
|
||
<div class="filter-width">
|
||
<el-select v-model="SHIFTDUTYTWO" placeholder="请选择">
|
||
<el-option v-for="item in queryShiftTwoList" :key="item.SHIFTWORKRULES_ID" :label="item.NAME" :value="item.SHIFTWORKRULES_ID" />
|
||
</el-select>
|
||
</div>
|
||
</div>
|
||
<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>
|
||
</div>
|
||
|
||
<div>
|
||
<el-button v-waves class="filter-item" type="info" icon="el-icon-bottom-right" size="mini" plain @click="dialogFormDaoru = true">
|
||
导入
|
||
</el-button>
|
||
</div>
|
||
</div>
|
||
<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="DEPARTMENT_NAME" label="部门" />
|
||
<el-table-column prop="POST_NAME" label="岗位" width="150" show-overflow-tooltip />
|
||
<el-table-column prop="ROLE_NAME" label="角色" />
|
||
<el-table-column label="排班类型" >
|
||
<template slot-scope="{row}">
|
||
<span v-if="row.SHIFTDUTYONENAME && row.SHIFTDUTYTWONAME">{{ row.SHIFTDUTYONENAME }}-{{ row.SHIFTDUTYTWONAME }}</span>
|
||
<span v-else>全班</span>
|
||
</template>
|
||
</el-table-column>
|
||
|
||
<el-table-column label="操作" width="400px">
|
||
<template slot-scope="{row}">
|
||
<el-button v-show="edit" type="success" icon="el-icon-refresh" size="mini" @click="resetPwd(row.USER_ID)">重置密码</el-button>
|
||
<el-button v-show="edit" class="blue-btn" icon="el-icon-message" size="mini" @click="pageShowDate(row,row.USER_ID,row.SHIFTDUTYTWO)">排班表</el-button>
|
||
<el-button v-show="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row.USER_ID)">编辑</el-button>
|
||
<el-button v-show="del && row.ISMAIN=='0'" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.USER_ID, row.NAME)">删除</el-button>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
<div class="page-btn-group">
|
||
<div>
|
||
<el-button v-show="add" 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>
|
||
|
||
<el-dialog v-if="dialogFormEditDate" :visible.sync="dialogFormEditDate" title="日历" width="500px">
|
||
<el-calendar id="calendar">
|
||
<template
|
||
slot="dateCell"
|
||
slot-scope="{data}">
|
||
<div class="date-cell">
|
||
<div class="calendar-day" style="line-height: 15px">
|
||
<span>{{ data.day.split('-').slice(2).join() }}</span>
|
||
<br>
|
||
<span v-for="(i, index) in workDateList" :key="index">
|
||
<template v-if="i.DATE==data.day">
|
||
<span v-if="i.STATE == 1" style="color:blue">上班</span>
|
||
<span v-else-if="i.STATE == 2" style="color:red">休班</span>
|
||
</template>
|
||
</span>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
</el-calendar>
|
||
<div slot="footer" class="dialog-footer">
|
||
<el-button @click="dialogFormEditDate = false">取 消</el-button>
|
||
</div>
|
||
</el-dialog>
|
||
|
||
<el-dialog :visible.sync="dialogFormDaoru" title="导入" width="800px">
|
||
<template>
|
||
<div class="app-container">
|
||
<el-form ref="form" :model="daoruFrom" label-width="110px" class="in-uploader">
|
||
<el-form-item label="上传附件" prop="FIELDS">
|
||
<div class="uploader">
|
||
<el-input v-model="daoruFrom.FFILEName" :disabled="true" />
|
||
<el-upload :before-upload="beforeFileUpload" class="avatar-uploader" action="#">
|
||
<el-button type="primary" icon="el-icon-upload" style="margin-left:10px">上传附件</el-button>
|
||
</el-upload>
|
||
<el-button v-waves type="success" icon="el-icon-right" style="margin-left:10px;width:150px" @click="getExcelModel">
|
||
导出模板
|
||
</el-button>
|
||
</div>
|
||
</el-form-item>
|
||
</el-form>
|
||
</div>
|
||
</template>
|
||
<div slot="footer" class="dialog-footer">
|
||
<el-button @click="dialogFormDaoru = false">取 消</el-button>
|
||
<el-button type="primary" @click="goUpload">确 定</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'
|
||
import { Message } from 'element-ui'
|
||
import { upload } from '@/utils/upload'
|
||
export default {
|
||
components: { Pagination, SelectTree },
|
||
directives: { waves },
|
||
data() {
|
||
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: [],
|
||
dialogFormEditDate: false,
|
||
listLoading: true,
|
||
treeLoading: false,
|
||
add: false,
|
||
del: false,
|
||
edit: false,
|
||
listQuery: {
|
||
page: 1,
|
||
limit: 20
|
||
},
|
||
filterText: '',
|
||
total: 0,
|
||
KEYWORDS: '',
|
||
SHIFTDUTYONE: '',
|
||
SHIFTDUTYTWO: '',
|
||
selectPeriod: [],
|
||
periodList: [],
|
||
DEPARTMENT_ID: '',
|
||
varList: [],
|
||
multipleSelectionAll: [], // 所有选中的数据包含跨页数据
|
||
multipleSelection: [], // 当前页选中的数据
|
||
dialogFormEdit: false,
|
||
dialogType: 'saveUser',
|
||
disabledLCSelect: false,
|
||
displayLCSelect: 'display: block',
|
||
disabledLCInput: true,
|
||
displayLCInput: 'display: none',
|
||
LearnerCategoryList: [],
|
||
rules: {
|
||
NAME: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
|
||
USERNAME: [
|
||
{ 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[0-9])\d{8}$/,
|
||
message: '请输入正确的手机号码'
|
||
},
|
||
{ validator: hasUser, trigger: 'blur' }
|
||
],
|
||
EMAIL: [
|
||
{ required: false, 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: 'change' }],
|
||
DEPARTMENT_ID: [{ required: true, message: '请选择部门', trigger: 'change' }],
|
||
DUTIES_ID: [{ required: true, message: '请选择岗位', trigger: 'change' }],
|
||
SORT: [{ required: true, message: '请输入排序', trigger: 'blur' }],
|
||
NATION: [{ required: true, message: '民族不能为空', trigger: 'blur' }],
|
||
SEX: [{ required: true, message: '性别不能为空', trigger: 'blur' }],
|
||
POLITICAL_OUTLOOK: [{ required: true, message: '政治面貌不能为空', trigger: 'blur' }],
|
||
DATE_OF_BIRTH: [{ required: true, message: '请选择出生年月', trigger: 'blur' }],
|
||
DEGREE_OF_EDUCATION: [{ required: true, message: '文化程度不能为空', trigger: 'blur' }],
|
||
POST: [{ required: true, message: '职务不能为空', trigger: 'blur' }],
|
||
TYPE_OF_WORK: [{ required: true, message: '工种不能为空', trigger: 'blur' }],
|
||
ENTRY_DATE: [{ required: true, message: '请选择入职日期', trigger: 'blur' }],
|
||
WORKING_DATE: [{ required: true, message: '请选择参加工作日期', trigger: 'blur' }],
|
||
INCUMBENCY: [{ required: true, message: '在职情况不能为空', trigger: 'blur' }],
|
||
TITLE: [{ required: true, message: '职称不能为空', trigger: 'blur' }],
|
||
DUTIES: [{ required: true, message: '职务不能为空', trigger: 'blur' }],
|
||
USER_ID_CARD: [{ required: true, message: '身份证号不能为空', trigger: 'blur' }]
|
||
},
|
||
defaultProps: {
|
||
value: 'id',
|
||
children: 'nodes',
|
||
label: 'name'
|
||
},
|
||
treeData: [],
|
||
form: {
|
||
USER_ID: '',
|
||
ROLE_ID: '',
|
||
DEPARTMENT_ID: '',
|
||
POST_ID: '',
|
||
USERNAME: '',
|
||
NAME: '',
|
||
EMAIL: '',
|
||
LEARNERCATEGORY: '',
|
||
LEARNERCATEGORYSTATUS: 'select',
|
||
SORT: '',
|
||
BZ: '',
|
||
PASSWORD: 'Aa@123456789',
|
||
USERAVATARPREFIX: '',
|
||
USERAVATARURL: '',
|
||
USERAVATARURL_CONVERT: '',
|
||
ISSTUDENT: false,
|
||
NATION: '', // 民族
|
||
SEX: '', // 性别
|
||
POLITICAL_OUTLOOK: '', // 政治面貌
|
||
DATE_OF_BIRTH: '', // 出生年月
|
||
DEGREE_OF_EDUCATION: '', // 文化程度
|
||
POST: '', // 职务
|
||
TYPE_OF_WORK: '', // 工种
|
||
ENTRY_DATE: '', // 入职日期
|
||
WORKING_DATE: '', // 参加工作日期
|
||
INCUMBENCY: '', // 在职情况
|
||
CERTIFICATE_INFORMATION: '', // 证书信息
|
||
TITLE: '', // 职称
|
||
DUTIESValue: '',
|
||
DUTIES: '',
|
||
letPostType: 'select',
|
||
letTitleValue: '',
|
||
letTitleId: '',
|
||
letTitleType: 'select',
|
||
letTypeOfWorkValue: '',
|
||
letTypeOfWorkId: '',
|
||
letTypeOfWorkType: 'select',
|
||
USER_ID_CARD: ''
|
||
},
|
||
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,
|
||
roleList: [],
|
||
postList: [],
|
||
oldPostId: '', // 原岗位ID(用于判断岗位是否变化)
|
||
oldDepartId: '', // 原部门ID(用于判断部门是否变化)
|
||
dialogFormDaoru: false,
|
||
daoruFrom: {
|
||
FFILE: '',
|
||
FFILEName: ''
|
||
},
|
||
PARENTID: '0',
|
||
shiftDutyListOne: [],
|
||
shiftDutyListTwo: [],
|
||
queryShiftOneList: [],
|
||
queryShiftTwoList: [],
|
||
datePage: 0,
|
||
workDateList: [],
|
||
USER_ID: ''
|
||
}
|
||
},
|
||
watch: {
|
||
'form.DEPARTMENT_ID': {
|
||
handler(newVal, oldVal) {
|
||
if (this.dialogType == 'saveUser' || (oldVal != null && oldVal != '')) { // 编辑初始化时,不监听
|
||
this.form.POST_ID = ''
|
||
this.getPostList()
|
||
}
|
||
},
|
||
immediate: false
|
||
|
||
},
|
||
'SHIFTDUTYONE': {
|
||
handler(newVal, oldVal) {
|
||
this.SHIFTDUTYTWO = ''
|
||
this.getShiftTwoList(this.SHIFTDUTYONE)
|
||
},
|
||
immediate: false
|
||
|
||
},
|
||
|
||
filterText(val) {
|
||
this.$refs.tree.filter(val)
|
||
}
|
||
},
|
||
created() {
|
||
this.getList()
|
||
this.getRoleList()
|
||
this.hasButton()
|
||
this.getTreeList()
|
||
this.getShiftWorkOne()
|
||
|
||
this.getScheduleAll()
|
||
this.getDict()
|
||
// this.getLearnerCategory() // 学员类型已取消
|
||
},
|
||
methods: {
|
||
getScheduleAll() {
|
||
requestFN(
|
||
'schedule/getData',
|
||
{
|
||
tm: new Date().getTime()
|
||
}
|
||
).then((data) => {
|
||
if (data.result == 'success') {
|
||
for (var i = 0; i < data.varList.length; i++) {
|
||
this.dayTime.push(data.varList[i].date)
|
||
}
|
||
} else if (data.result == 'exception') {
|
||
// showException('系统首页', '数据异常')// 显示异常
|
||
}
|
||
}).catch((e) => {
|
||
this.listLoading = false
|
||
})
|
||
},
|
||
|
||
showDate(SHIFTDUTYTWO) {
|
||
this.datePage = 0
|
||
this.dialogFormEditDate = true
|
||
this.getWorkDate(SHIFTDUTYTWO)
|
||
this.$nextTick(() => {
|
||
// 点击前一个月
|
||
const prevBtn = document.querySelector(
|
||
'.el-calendar__button-group .el-button-group>button:nth-child(1)'
|
||
)
|
||
prevBtn.addEventListener('click', e => {
|
||
this.datePage--
|
||
this.getWorkDate(SHIFTDUTYTWO)
|
||
})
|
||
// 点击今天
|
||
const todayBtn = document.querySelector(
|
||
'.el-calendar__button-group .el-button-group>button:nth-child(2)'
|
||
)
|
||
todayBtn.addEventListener('click', () => {
|
||
this.datePage = 0
|
||
this.getWorkDate(SHIFTDUTYTWO)
|
||
})
|
||
// 点击下一个月
|
||
const nextBtn = document.querySelector(
|
||
'.el-calendar__button-group .el-button-group>button:nth-child(3)'
|
||
)
|
||
nextBtn.addEventListener('click', e => {
|
||
this.datePage++
|
||
this.getWorkDate(SHIFTDUTYTWO)
|
||
})
|
||
|
||
// 点击上个月日期
|
||
var prevDay = document.querySelectorAll(
|
||
'.el-calendar-table__row .prev'
|
||
)
|
||
for (var i = 0; i < prevDay.length; i++) {
|
||
prevDay[i].addEventListener('click', e => {
|
||
this.datePage--
|
||
this.getWorkDate(SHIFTDUTYTWO)
|
||
})
|
||
}
|
||
// 点击下个月日期
|
||
var nextDay = document.querySelectorAll(
|
||
'.el-calendar-table__row .next'
|
||
)
|
||
// eslint-disable-next-line no-redeclare
|
||
for (var i = 0; i < nextDay.length; i++) {
|
||
nextDay[i].addEventListener('click', e => {
|
||
this.datePage++
|
||
this.getWorkDate(SHIFTDUTYTWO)
|
||
})
|
||
}
|
||
})
|
||
},
|
||
|
||
pageShowDate(item, USER_ID, SHIFTDUTYTWO) {
|
||
// debugger
|
||
this.USER_ID = item.USER_ID
|
||
this.selectPeriod = {
|
||
'DURATION': item.DURATION,
|
||
'WORKSTATUS': item.WORKSTATUS,
|
||
'WORKPERIOD': item.WORKPERIOD
|
||
}
|
||
this.showDate(item.SHIFTDUTYTWO)
|
||
},
|
||
detailShowDate() {
|
||
this.showDate(this.form.SHIFTDUTYTWO)
|
||
},
|
||
getRowKey(row) {
|
||
return row.USER_ID
|
||
},
|
||
filterNode(value, data) {
|
||
if (!value) return true
|
||
return data.name.indexOf(value) !== -1
|
||
},
|
||
handleNodeClick(node, data, value) {
|
||
this.form.DEPARTMENT_ID = node.id
|
||
this.getList(node.id)
|
||
},
|
||
getTreeList() {
|
||
this.treeLoading = true
|
||
requestFN(
|
||
'/department/listTree',
|
||
{}
|
||
).then((data) => {
|
||
this.treeLoading = false
|
||
this.treeData = JSON.parse(data.zTreeNodes)
|
||
}).catch((e) => {
|
||
this.treeLoading = false
|
||
})
|
||
},
|
||
getWorkDate(SHIFTWORKRULES_ID) {
|
||
requestFN(
|
||
'/shiftworkperiod/getWorkDate',
|
||
{
|
||
MONTHS: this.datePage,
|
||
SHIFTWORKRULES_ID: SHIFTWORKRULES_ID,
|
||
WORKSTATUS: this.selectPeriod.WORKSTATUS,
|
||
DURATION: this.selectPeriod.DURATION,
|
||
WORKPERIOD: this.selectPeriod.WORKPERIOD
|
||
}
|
||
).then((data) => {
|
||
this.workDateList = data.varList
|
||
}).catch((e) => {
|
||
})
|
||
},
|
||
listPeriods(SHIFTWORKRULES_ID) {
|
||
this.periodList = []
|
||
if (SHIFTWORKRULES_ID) {
|
||
requestFN(
|
||
'/shiftworkperiod/listPeriods',
|
||
{
|
||
SHIFTWORKRULES_ID: SHIFTWORKRULES_ID
|
||
}
|
||
).then((data) => {
|
||
this.periodList = data.varList
|
||
if (this.periodList.length == 1) {
|
||
this.selectPeriod = {
|
||
'DURATION': '1',
|
||
'WORKSTATUS': '1',
|
||
'WORKPERIOD': '1'
|
||
}
|
||
}
|
||
}).catch((e) => {
|
||
})
|
||
}
|
||
},
|
||
getRoleList() {
|
||
requestFN(
|
||
'/user/goAddUser',
|
||
{}
|
||
).then((data) => {
|
||
this.roleList = data.roleList
|
||
}).catch((e) => {
|
||
})
|
||
},
|
||
getPostList() {
|
||
if (this.form.DEPARTMENT_ID != null && this.form.DEPARTMENT_ID != '') {
|
||
requestFN(
|
||
'/post/listAll',
|
||
{ DEPARTMENT_ID: this.form.DEPARTMENT_ID }
|
||
).then((data) => {
|
||
this.postList = data.postList
|
||
}).catch((e) => {
|
||
})
|
||
}
|
||
},
|
||
handleAdd() {
|
||
this.$parent.activeName = 'Edit'
|
||
this.$parent.USER_ID = ''
|
||
},
|
||
handleEdit(USER_ID) {
|
||
this.$parent.USER_ID = USER_ID
|
||
this.$parent.activeName = 'Edit'
|
||
// 他这个跳转了,我那个在同一个页面,那你就在给form赋值的时候给那个属性等于select的还给加上
|
||
},
|
||
getQuery() {
|
||
this.$refs.multipleTable.clearSelection()
|
||
this.getList()
|
||
},
|
||
goKeyReset() {
|
||
this.KEYWORDS = ''
|
||
this.SHIFTDUTYONE = ''
|
||
this.SHIFTDUTYTWO = ''
|
||
this.getList()
|
||
},
|
||
beforeFileUpload(file) {
|
||
this.daoruFrom.FFILE = file
|
||
this.daoruFrom.FFILEName = file.name
|
||
this.$forceUpdate()
|
||
return false
|
||
},
|
||
goUpload() {
|
||
const formData = new FormData()
|
||
Object.keys(this.daoruFrom).map(key => {
|
||
formData.append(key, this.daoruFrom[key])
|
||
})
|
||
upload(
|
||
'/user/readExcel2',
|
||
formData
|
||
).then((data) => {
|
||
if (data.msg) {
|
||
Message({
|
||
message: data.msg,
|
||
type: data.type,
|
||
duration: 5 * 1000
|
||
})
|
||
}
|
||
this.getList()
|
||
this.dialogFormDaoru = false
|
||
}).catch((e) => {
|
||
this.listLoading = false
|
||
})
|
||
},
|
||
getList(DEPARTMENT_ID) {
|
||
this.listLoading = true
|
||
if (DEPARTMENT_ID) {
|
||
this.DEPARTMENT_ID = DEPARTMENT_ID
|
||
}
|
||
requestFN(
|
||
'/user/list?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page,
|
||
{
|
||
KEYWORDS: this.KEYWORDS,
|
||
DEPARTMENT_ID: this.DEPARTMENT_ID,
|
||
SHIFTDUTYONE: this.SHIFTDUTYONE,
|
||
SHIFTDUTYTWO: this.SHIFTDUTYTWO
|
||
}
|
||
).then((data) => {
|
||
this.listLoading = false
|
||
this.varList = data.userList
|
||
this.total = data.page.totalResult
|
||
}).catch((e) => {
|
||
this.listLoading = false
|
||
})
|
||
},
|
||
getExcelModel() {
|
||
this.$confirm('确定要下载excel模板吗?', {
|
||
confirmButtonText: '确定',
|
||
cancelButtonText: '取消',
|
||
type: 'warning'
|
||
}).then(() => {
|
||
this.listLoading = false
|
||
window.location.href = config.httpurl + 'user/excelModel'
|
||
}).catch(() => {
|
||
this.listLoading = false
|
||
})
|
||
this.listLoading = false
|
||
},
|
||
/* 用户头像处理 Begin */
|
||
getFile(file, fileList) {
|
||
const types = ['image/jpeg', 'image/jpg', 'image/png']
|
||
const isImage = types.includes(file.raw.type)
|
||
if (!isImage) {
|
||
this.$message.error('上传图片只能是 JPG、JPEG、PNG 格式!')
|
||
fileList.splice(0, fileList.length)
|
||
} else {
|
||
this.getBase64(file.raw).then(res => {
|
||
this.form.USERAVATARPREFIX = res.substring(0, res.indexOf('base64,') + 7)
|
||
this.form.USERAVATARURL = res.substring(res.indexOf('base64,') + 7)
|
||
})
|
||
}
|
||
},
|
||
getBase64(file) {
|
||
return new Promise(function(resolve, reject) {
|
||
const reader = new FileReader()
|
||
let imgResult = ''
|
||
reader.readAsDataURL(file)
|
||
reader.onload = function() {
|
||
imgResult = reader.result
|
||
}
|
||
reader.onerror = function(error) {
|
||
reject(error)
|
||
}
|
||
reader.onloadend = function() {
|
||
resolve(imgResult)
|
||
}
|
||
})
|
||
},
|
||
/* 用户头像处理 End */
|
||
resetPwd(id, name) {
|
||
this.$confirm('是否重置密码为Aa@123456789?', {
|
||
confirmButtonText: '确定',
|
||
cancelButtonText: '取消',
|
||
type: 'warning'
|
||
}).then(() => {
|
||
this.listLoading = true
|
||
requestFN(
|
||
'/corpinfo/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(() => {
|
||
})
|
||
},
|
||
handleDelete(id, name) {
|
||
this.$confirm('确定要删除[' + name + ']吗?', {
|
||
confirmButtonText: '确定',
|
||
cancelButtonText: '取消',
|
||
type: 'warning'
|
||
}).then(() => {
|
||
this.listLoading = true
|
||
requestFN(
|
||
'/user/deleteUser',
|
||
{
|
||
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(() => {
|
||
})
|
||
},
|
||
getShiftWorkOne() {
|
||
requestFN(
|
||
'/shiftworkrules/listAll',
|
||
{
|
||
PARENTID: this.PARENTID
|
||
}
|
||
).then((data) => {
|
||
this.listLoading = false
|
||
this.shiftDutyListOne = data.varList
|
||
console.log()
|
||
}).catch((e) => {
|
||
this.listLoading = false
|
||
})
|
||
},
|
||
getShiftWorkTwo(id) {
|
||
if (id) {
|
||
requestFN(
|
||
'/shiftworkrules/listAll',
|
||
{
|
||
PARENTID: id
|
||
}
|
||
).then((data) => {
|
||
this.listLoading = false
|
||
this.shiftDutyListTwo = data.varList
|
||
}).catch((e) => {
|
||
this.listLoading = false
|
||
})
|
||
}
|
||
},
|
||
getDict: function() {
|
||
requestFN(
|
||
'/shiftworkrules/listAll',
|
||
{
|
||
PARENTID: '0'
|
||
}
|
||
).then((data) => {
|
||
this.queryShiftOneList = data.varList
|
||
}).catch((e) => {
|
||
this.listLoading = false
|
||
})
|
||
},
|
||
getShiftTwoList: function(PARENTID) {
|
||
requestFN(
|
||
'/shiftworkrules/listAll',
|
||
{
|
||
PARENTID: PARENTID
|
||
}
|
||
).then((data) => {
|
||
this.queryShiftTwoList = data.varList
|
||
}).catch((e) => {
|
||
this.listLoading = false
|
||
})
|
||
},
|
||
getLearnerCategory() {
|
||
requestFN(
|
||
'/dictionaries/getLevels',
|
||
{
|
||
DICTIONARIES_ID: '532282f9c48346b8b646531909c739df'
|
||
}
|
||
).then((data) => {
|
||
this.LearnerCategoryList = data.list
|
||
}).catch((e) => {
|
||
|
||
})
|
||
},
|
||
changeLearnerCategory() {
|
||
this.form.LEARNERCATEGORY = ''
|
||
if (this.form.LEARNERCATEGORYSTATUS === 'select') {
|
||
this.disabledLCInput = false
|
||
this.displayLCInput = 'display: block'
|
||
this.disabledLCSelect = true
|
||
this.displayLCSelect = 'display: none'
|
||
this.form.LEARNERCATEGORYSTATUS = 'input'
|
||
} else {
|
||
this.disabledLCInput = true
|
||
this.displayLCInput = 'display: none'
|
||
this.disabledLCSelect = false
|
||
this.displayLCSelect = 'display: block'
|
||
this.form.LEARNERCATEGORYSTATUS = 'select'
|
||
}
|
||
},
|
||
// 判断按钮权限,用于是否显示按钮
|
||
hasButton() {
|
||
var keys = 'user:add,user:del,user:edit'
|
||
requestFN(
|
||
'/head/hasButton',
|
||
{
|
||
keys: keys
|
||
}
|
||
).then((data) => {
|
||
this.add = data.userfhadminadd
|
||
this.del = data.userfhadmindel
|
||
this.edit = data.userfhadminedit
|
||
}).catch((e) => {
|
||
this.listLoading = false
|
||
})
|
||
},
|
||
ISSTUDENTCK() {
|
||
if (this.form.ISSTUDENT) {
|
||
if (this.uesrInfoDic.minzuList.length == 0) {
|
||
this.getDicListByPID('0a0e406f27f74ee698fe9979d25f62dd', '', 'minzuList')
|
||
}
|
||
if (this.uesrInfoDic.zhengzhimianmaoList.length == 0) {
|
||
this.getDicListByPID('6351efdd12dc4730952e5d195718e252', '', 'zhengzhimianmaoList')
|
||
}
|
||
if (this.uesrInfoDic.wenhuachengduList.length == 0) {
|
||
this.getDicListByPID('d7d80f08d73a4accbccf4fd3d8d1d867', '', 'wenhuachengduList')
|
||
}
|
||
if (this.uesrInfoDic.renyuanleixingList.length == 0) {
|
||
this.getDicListByPID('0b62f92b0b624aab8e89a77304a64d5e', '', 'renyuanleixingList')
|
||
}
|
||
if (this.uesrInfoDic.zaizhiqingkuangList.length == 0) {
|
||
this.getDicListByPID('548764b5d4bf4bd7a18ef88274ef49e4', '', 'zaizhiqingkuangList')
|
||
}
|
||
if (this.uesrInfoDic.xingbieList.length == 0) {
|
||
this.getDicListByPID('21501808bbc344d593fbf9ccfe6c4531', '', 'xingbieList')
|
||
}
|
||
this.getDicListByPID('09e36ac01e9540f8bc84eab1c1a78754', '', 'zhiwuList')
|
||
this.getDicListByPID('945a6b10e59946078b500f0fbafa8679', '', 'zhichengList')
|
||
this.getDicListByPID('55484e491a5e442d839c4595380713ec', '', 'gongzhongList')
|
||
}
|
||
},
|
||
getDicListByPID(pId, id, listName) {
|
||
var url = '/dictionaries/getLevels'
|
||
if (listName == 'zhiwuList' || listName == 'zhichengList' || listName == 'gongzhongList') {
|
||
url = '/dictionariesCorp/getLevels'
|
||
}
|
||
requestFN(url,
|
||
{
|
||
DICTIONARIES_ID: pId
|
||
}
|
||
).then((data) => {
|
||
this.uesrInfoDic[listName] = data.list
|
||
}).catch((e) => {
|
||
|
||
})
|
||
},
|
||
handlePictureCardPreview(file) {
|
||
this.dialogImageUrl = file.url
|
||
this.dialogVisible = true
|
||
},
|
||
beforeFileUploadByZhengshu(file) {
|
||
const types = ['image/jpeg', 'image/jpg', 'image/png']
|
||
const isImage = types.includes(file.type)
|
||
if (!isImage) {
|
||
this.$message.error('上传图片只能是 JPG、JPEG、PNG 格式!')
|
||
return false
|
||
} else {
|
||
this.certificate_files.push(file)
|
||
}
|
||
},
|
||
uploadImgByZhengshu(userId) {
|
||
this.$refs.upload.submit()
|
||
const formData = new FormData()
|
||
for (var i = 0; i < this.certificate_files.length; i++) {
|
||
if (this.certificate_files[i]) {
|
||
formData.append('FFILE', this.certificate_files[i])
|
||
}
|
||
}
|
||
formData.append('FOREIGN_KEY', userId)
|
||
formData.append('TYPE', 18)
|
||
upload(
|
||
'/imgfiles/add',
|
||
formData
|
||
).then((data) => {
|
||
}).catch((e) => {
|
||
})
|
||
}
|
||
}
|
||
}
|
||
</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 #d9d9d9;
|
||
font-size: 28px;
|
||
color: #8c939d;
|
||
width: 178px;
|
||
height: 178px;
|
||
line-height: 178px;
|
||
text-align: center;
|
||
}
|
||
.avatar {
|
||
width: 178px;
|
||
height: 178px;
|
||
display: block;
|
||
}
|
||
|
||
</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: 20px
|
||
height: 20px
|
||
border-radius: 4px
|
||
&>img
|
||
width: 2%
|
||
height: 3%
|
||
|
||
.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>
|