11 changed files with 1558 additions and 76 deletions
-
1package.json
-
44src/api/mdp/sys/userLoginRecord.js
-
12src/router/routes_my_work.js
-
33src/views/login/components/register.vue
-
182src/views/mdp/sys/branch/BranchEdit.vue
-
182src/views/myWork/set/BranchEdit.vue
-
163src/views/myWork/set/ChangeEmailStepOne.vue
-
109src/views/myWork/set/ChangeEmailStepTwo.vue
-
327src/views/myWork/set/UpdateUserInfo.vue
-
185src/views/myWork/set/index.vue
-
396src/views/myWork/userLoginRecord/index.vue
@ -0,0 +1,44 @@ |
|||||
|
import axios from '@/utils/request' |
||||
|
|
||||
|
import { getDicts,initSimpleDicts,initComplexDicts } from '@/api/mdp/meta/item';//字典表
|
||||
|
import config from '@/common/config' |
||||
|
|
||||
|
let base = config.getSysBasePath(); |
||||
|
|
||||
|
/**-------------------------与后端通讯接口------------------请写在下面-------------------------------------------- */ |
||||
|
/** |
||||
|
* 用户登录信息登记 |
||||
|
*1 默认只开放普通查询,所有查询,只要上传 分页参数 {pageNum:当前页码从1开始,pageSize:每页记录数,total:总记录【数如果是0后台会自动计算总记录数非0不会自动计算】},后台都会自动按分页查询 其它 api用到再打开,没用到的api请注释掉, |
||||
|
*2 查询、新增、修改的参数格式 params={id:'主键 主键',userid:'用户编号',shopId:'商户编号',locationId:'门店编号',loginShopid:'登录的商户编号',loginLocationid:'登录的门店编号',branchId:'机构编号',loginType:'1-微信扫门店二维码,2-点击小程序登录,3-账户密码登录,4-手机号码登录',loginTime:'登录时间',loginBranchId:'登录机构号',username:'登录用户名',authId:'授权码',mdpAppid:'mdp平台appid',lockNo:'批处理编号',lockStatus:'批处理状态0-待处理1-处理中2处理完毕',lockTime:'批处理时间',phoneno:'登录手机号',loginIp:'登录ip',userType:'mem-会员端用户,adm-管理端用户',loginDeviceId:'登录设备编号',loginDeviceSn:'设备特征码',userAgent:'请求特征码',reqNo:'请求特征码-方便前端补充回填部分信息',deviceType:'设备类型COMPUTER/MOBILE/TABLET/GAME_CONSOLE/DMR/WEARABLE/UNKNOWN',os:'操作系统Windows/ios/Android',osVersion:'操作系统版本如Android',osName:'操作系统名称如Android',renderingEngine:'浏览器渲染引擎如WEBKIT',deviceManufacturer:'设备生产厂商',browerGroup:'浏览器组',borderName:'浏览器名称',borderVersion:'浏览器版本',longitude:'经度',latitude:'纬度',regionId:'区域编号精确到4级镇、街道',regionName:'定位街道名称',formatAddress:'定位格式化地址名称',districtId:'定位区县编号',memType:'用户类型',loginStatus:'1-登录成功,0-登录失败',loginMsg:'登录成功或者失败的说明',authType:'授权码',grantType:'授权码'} |
||||
|
**/ |
||||
|
|
||||
|
//普通查询 条件之间and关系
|
||||
|
export const listUserLoginRecord = params => { return axios.get(`${base}/mdp/sys/userLoginRecord/list`, { params: params }); }; |
||||
|
|
||||
|
//删除一条用户登录信息登记 params={id:'主键 主键'}
|
||||
|
export const delUserLoginRecord = params => { return axios.post(`${base}/mdp/sys/userLoginRecord/del`,params); }; |
||||
|
|
||||
|
//批量删除用户登录信息登记 params=[{id:'主键 主键'}]
|
||||
|
export const batchDelUserLoginRecord = params => { return axios.post(`${base}/mdp/sys/userLoginRecord/batchDel`, params); }; |
||||
|
|
||||
|
//修改一条用户登录信息登记记录
|
||||
|
export const editUserLoginRecord = params => { return axios.post(`${base}/mdp/sys/userLoginRecord/edit`, params); }; |
||||
|
|
||||
|
//新增一条用户登录信息登记
|
||||
|
export const addUserLoginRecord = params => { return axios.post(`${base}/mdp/sys/userLoginRecord/add`, params); }; |
||||
|
|
||||
|
//批量修改某些字段
|
||||
|
export const editSomeFieldsUserLoginRecord = params => { return axios.post(`${base}/mdp/sys/userLoginRecord/editSomeFields`, params); }; |
||||
|
|
||||
|
|
||||
|
|
||||
|
/**-------------------------前端mng|add|edit界面公共函数---------------请写在下面----------------------------------------------- */ |
||||
|
//初始化页面上的字典
|
||||
|
export const initDicts = (that) => { |
||||
|
var itemCodes=[];//在此添加要加载的字典 如['sex','grade','lvl']
|
||||
|
if(itemCodes.length>0){ |
||||
|
initSimpleDicts('all',itemCodes).then(res=>{ |
||||
|
Object.assign(that.dicts,res.data.data) |
||||
|
}); |
||||
|
} |
||||
|
}; |
||||
@ -0,0 +1,182 @@ |
|||||
|
<template> |
||||
|
<section> |
||||
|
<el-row ref="table"> |
||||
|
<!--编辑界面 Branch 管理端机构表(机构下面若干部门)--> |
||||
|
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editFormRef"> |
||||
|
<el-form-item label="机构编号" prop="id" v-if="opType==='add'"> |
||||
|
<el-input v-model="editForm.id" placeholder="机构编号,如果不填写将后台自动生成" :maxlength="50" :disabled="branch.id"></el-input> |
||||
|
<br><font color="red">机构号将作为该机构的管理员登录账号</font> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="机构名称" prop="branchName"> |
||||
|
<el-input v-model="editForm.branchName" placeholder="机构名称" :maxlength="50"> |
||||
|
<template slot="prepend" v-if="opType==='edit'"> |
||||
|
{{editForm.id}} |
||||
|
</template> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="是否可用" prop="enabled" v-if="opType==='edit'"> |
||||
|
<el-select v-model="editForm.enabled"> |
||||
|
<el-option v-for="(item,index) in dicts['enabled']" :value="item.id" :label="item.name" :key="index"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="行业分类" prop="industryCategory"> |
||||
|
<el-select v-model="editForm.industryCategory"> |
||||
|
<el-option v-for="(item,index) in dicts['industryCategory']" :value="item.id" :label="item.name" :key="index"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建日期" prop="cdate" v-if="opType==='edit'"> |
||||
|
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.cdate" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="联系人姓名" prop="lusername"> |
||||
|
<el-input v-model="editForm.lusername" placeholder="联系人姓名" :maxlength="255"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="联系电话" prop="lphoneNo"> |
||||
|
<el-input v-model="editForm.lphoneNo" placeholder="联系电话" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="联系邮箱" prop="emaill"> |
||||
|
<el-input v-model="editForm.emaill" placeholder="联系邮箱" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="管理员" prop="admUserid"> |
||||
|
|
||||
|
账号: <font style="font-size:10px;">{{editForm.admUserid}}</font> 名称: <font style="font-size:10px;">{{editForm.admUsername}} </font> 登录密码:<font style="font-size:10px;">{{opType==='add'?'888888':'*****'}}</font> |
||||
|
<br><font color="blue">管理员账户具有最高权限,仅作为内部管理权限使用,账户编号与机构号相同,不可修改</font> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="公司地址" prop="address" v-if="opType==='edit'"> |
||||
|
<el-input v-model="editForm.address" placeholder="公司地址" :maxlength="255"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-row> |
||||
|
|
||||
|
<el-row> |
||||
|
<el-button @click.native="handleCancel">取消</el-button> |
||||
|
<el-button v-loading="load.edit" type="primary" @click.native="saveSubmit" :disabled="load.edit==true">提交</el-button> |
||||
|
</el-row> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import config from "@/common/config"; //全局公共库import |
||||
|
import { initDicts, addBranch,editBranch } from '@/api/mdp/sys/branch'; |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
export default { |
||||
|
name:'branchEdit', |
||||
|
components: { |
||||
|
|
||||
|
}, |
||||
|
computed: { |
||||
|
...mapGetters([ 'userInfo' ]), |
||||
|
|
||||
|
}, |
||||
|
props:['branch','visible','opType'], |
||||
|
|
||||
|
watch: { |
||||
|
'branch':function( branch ) { |
||||
|
if(branch){ |
||||
|
this.editForm = {...branch}; |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
'editForm.id':function( val ) { |
||||
|
this.editForm.admUserid =val; |
||||
|
}, |
||||
|
'editForm.branchName':function( val ) { |
||||
|
this.editForm.admUsername =val+'管理员'; |
||||
|
}, |
||||
|
'visible':function(visible) { |
||||
|
if(visible==true){ |
||||
|
this.initData() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
currOpType:'add',//add/edit |
||||
|
load:{ list: false, edit: false, del: false, add: false },//查询中... |
||||
|
dicts:{ |
||||
|
industryCategory:[], |
||||
|
enabled:[], |
||||
|
},//下拉选择框的所有静态数据 params={categoryId:'all',itemCodes:['sex']} 返回结果 {sex: [{id:'1',name:'男'},{id:'2',name:'女'}]} |
||||
|
editFormRules: { |
||||
|
branchName: [ |
||||
|
{ required: true, message: '机构名称不能为空', trigger: 'blur' } |
||||
|
] |
||||
|
}, |
||||
|
editForm: { |
||||
|
id:'',branchName:'',enabled:'',industryCategory:'',cuserid:'',cdate:'',cusername:'',lphoneNo:'',emaill:'',bizProcInstId:'',bizFlowState:'',pbranchId:'',admUserid:'',admUsername:'',lusername:'',luserid:'',address:'' |
||||
|
}, |
||||
|
maxTableHeight:300, |
||||
|
}//end return |
||||
|
},//end data |
||||
|
methods: { |
||||
|
|
||||
|
...util, |
||||
|
|
||||
|
// 取消按钮点击 父组件监听@cancel="editFormVisible=false" 监听 |
||||
|
handleCancel:function(){ |
||||
|
this.$refs['editFormRef'].resetFields(); |
||||
|
this.$emit('cancel'); |
||||
|
}, |
||||
|
//新增、编辑提交Branch 管理端机构表(机构下面若干部门)父组件监听@submit="afterEditSubmit" |
||||
|
saveSubmit: function () { |
||||
|
this.$refs.editFormRef.validate((valid) => { |
||||
|
if (valid) { |
||||
|
this.$confirm('确认提交吗?', '提示', {}).then(() => { |
||||
|
this.load.edit=true |
||||
|
let params = Object.assign({}, this.editForm); |
||||
|
var func=addBranch |
||||
|
if(this.currOpType=='edit'){ |
||||
|
func=editBranch |
||||
|
} |
||||
|
func(params).then((res) => { |
||||
|
this.load.edit=false |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.editForm=res.data.data |
||||
|
this.initData() |
||||
|
this.currOpType="edit"; |
||||
|
this.$emit('submit');// @submit="afterAddSubmit" |
||||
|
} |
||||
|
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}).catch( err =>this.load.edit=false); |
||||
|
}); |
||||
|
}else{ |
||||
|
this.$notify({ showClose:true, message: "表单验证不通过,请修改表单数据再提交", type: 'error' }); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
initData: function(){ |
||||
|
this.currOpType=this.opType |
||||
|
if(this.branch){ |
||||
|
this.editForm = Object.assign({},this.branch); |
||||
|
} |
||||
|
|
||||
|
if(this.opType=='edit'){ |
||||
|
|
||||
|
}else{ |
||||
|
this.editForm.cuserid=this.userInfo.userid |
||||
|
this.editForm.cusername=this.userInfo.username |
||||
|
this.editForm.luserid=this.userInfo.userid |
||||
|
this.editForm.lusername=this.userInfo.username |
||||
|
this.editForm.lphoneNo=this.userInfo.phoneno |
||||
|
this.editForm.email=this.userInfo.email |
||||
|
this.editForm.enabled="0" |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
},//end method |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
initDicts(this); |
||||
|
this.initData() |
||||
|
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el) |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,182 @@ |
|||||
|
<template> |
||||
|
<section> |
||||
|
<el-row ref="table"> |
||||
|
<!--编辑界面 Branch 管理端机构表(机构下面若干部门)--> |
||||
|
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editFormRef"> |
||||
|
<el-form-item label="机构编号" prop="id" v-if="opType==='add'"> |
||||
|
<el-input v-model="editForm.id" placeholder="机构编号,如果不填写将后台自动生成" :maxlength="50" :disabled="branch.id"></el-input> |
||||
|
<br><font color="red">机构号将作为该机构的管理员登录账号</font> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="机构名称" prop="branchName"> |
||||
|
<el-input v-model="editForm.branchName" placeholder="机构名称" :maxlength="50"> |
||||
|
<template slot="prepend" v-if="opType==='edit'"> |
||||
|
{{editForm.id}} |
||||
|
</template> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="是否可用" prop="enabled" v-if="opType==='edit'"> |
||||
|
<el-select v-model="editForm.enabled"> |
||||
|
<el-option v-for="(item,index) in dicts['enabled']" :value="item.id" :label="item.name" :key="index"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="行业分类" prop="industryCategory"> |
||||
|
<el-select v-model="editForm.industryCategory"> |
||||
|
<el-option v-for="(item,index) in dicts['industryCategory']" :value="item.id" :label="item.name" :key="index"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建日期" prop="cdate" v-if="opType==='edit'"> |
||||
|
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.cdate" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="联系人姓名" prop="lusername"> |
||||
|
<el-input v-model="editForm.lusername" placeholder="联系人姓名" :maxlength="255"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="联系电话" prop="lphoneNo"> |
||||
|
<el-input v-model="editForm.lphoneNo" placeholder="联系电话" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="联系邮箱" prop="emaill"> |
||||
|
<el-input v-model="editForm.emaill" placeholder="联系邮箱" :maxlength="50"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="管理员" prop="admUserid"> |
||||
|
|
||||
|
账号: <font style="font-size:10px;">{{editForm.admUserid}}</font> 名称: <font style="font-size:10px;">{{editForm.admUsername}} </font> 登录密码:<font style="font-size:10px;">{{opType==='add'?'888888':'*****'}}</font> |
||||
|
<br><font color="blue">管理员账户具有最高权限,仅作为内部管理权限使用,账户编号与机构号相同,不可修改</font> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="公司地址" prop="address" v-if="opType==='edit'"> |
||||
|
<el-input v-model="editForm.address" placeholder="公司地址" :maxlength="255"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-row> |
||||
|
|
||||
|
<el-row> |
||||
|
<el-button @click.native="handleCancel">取消</el-button> |
||||
|
<el-button v-loading="load.edit" type="primary" @click.native="saveSubmit" :disabled="load.edit==true">提交</el-button> |
||||
|
</el-row> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import config from "@/common/config"; //全局公共库import |
||||
|
import { initDicts, addBranch,editBranch } from '@/api/mdp/sys/branch'; |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
export default { |
||||
|
name:'branchEdit', |
||||
|
components: { |
||||
|
|
||||
|
}, |
||||
|
computed: { |
||||
|
...mapGetters([ 'userInfo' ]), |
||||
|
|
||||
|
}, |
||||
|
props:['branch','visible','opType'], |
||||
|
|
||||
|
watch: { |
||||
|
'branch':function( branch ) { |
||||
|
if(branch){ |
||||
|
this.editForm = {...branch}; |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
'editForm.id':function( val ) { |
||||
|
this.editForm.admUserid =val; |
||||
|
}, |
||||
|
'editForm.branchName':function( val ) { |
||||
|
this.editForm.admUsername =val+'管理员'; |
||||
|
}, |
||||
|
'visible':function(visible) { |
||||
|
if(visible==true){ |
||||
|
this.initData() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
currOpType:'add',//add/edit |
||||
|
load:{ list: false, edit: false, del: false, add: false },//查询中... |
||||
|
dicts:{ |
||||
|
industryCategory:[], |
||||
|
enabled:[], |
||||
|
},//下拉选择框的所有静态数据 params={categoryId:'all',itemCodes:['sex']} 返回结果 {sex: [{id:'1',name:'男'},{id:'2',name:'女'}]} |
||||
|
editFormRules: { |
||||
|
branchName: [ |
||||
|
{ required: true, message: '机构名称不能为空', trigger: 'blur' } |
||||
|
] |
||||
|
}, |
||||
|
editForm: { |
||||
|
id:'',branchName:'',enabled:'',industryCategory:'',cuserid:'',cdate:'',cusername:'',lphoneNo:'',emaill:'',bizProcInstId:'',bizFlowState:'',pbranchId:'',admUserid:'',admUsername:'',lusername:'',luserid:'',address:'' |
||||
|
}, |
||||
|
maxTableHeight:300, |
||||
|
}//end return |
||||
|
},//end data |
||||
|
methods: { |
||||
|
|
||||
|
...util, |
||||
|
|
||||
|
// 取消按钮点击 父组件监听@cancel="editFormVisible=false" 监听 |
||||
|
handleCancel:function(){ |
||||
|
this.$refs['editFormRef'].resetFields(); |
||||
|
this.$emit('cancel'); |
||||
|
}, |
||||
|
//新增、编辑提交Branch 管理端机构表(机构下面若干部门)父组件监听@submit="afterEditSubmit" |
||||
|
saveSubmit: function () { |
||||
|
this.$refs.editFormRef.validate((valid) => { |
||||
|
if (valid) { |
||||
|
this.$confirm('确认提交吗?', '提示', {}).then(() => { |
||||
|
this.load.edit=true |
||||
|
let params = Object.assign({}, this.editForm); |
||||
|
var func=addBranch |
||||
|
if(this.currOpType=='edit'){ |
||||
|
func=editBranch |
||||
|
} |
||||
|
func(params).then((res) => { |
||||
|
this.load.edit=false |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.editForm=res.data.data |
||||
|
this.initData() |
||||
|
this.currOpType="edit"; |
||||
|
this.$emit('submit');// @submit="afterAddSubmit" |
||||
|
} |
||||
|
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}).catch( err =>this.load.edit=false); |
||||
|
}); |
||||
|
}else{ |
||||
|
this.$notify({ showClose:true, message: "表单验证不通过,请修改表单数据再提交", type: 'error' }); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
initData: function(){ |
||||
|
this.currOpType=this.opType |
||||
|
if(this.branch){ |
||||
|
this.editForm = Object.assign({},this.branch); |
||||
|
} |
||||
|
|
||||
|
if(this.opType=='edit'){ |
||||
|
|
||||
|
}else{ |
||||
|
this.editForm.cuserid=this.userInfo.userid |
||||
|
this.editForm.cusername=this.userInfo.username |
||||
|
this.editForm.luserid=this.userInfo.userid |
||||
|
this.editForm.lusername=this.userInfo.username |
||||
|
this.editForm.lphoneNo=this.userInfo.phoneno |
||||
|
this.editForm.email=this.userInfo.email |
||||
|
this.editForm.enabled="0" |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
},//end method |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
initDicts(this); |
||||
|
this.initData() |
||||
|
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el) |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,163 @@ |
|||||
|
<template> |
||||
|
<section> |
||||
|
<el-row class="padding" style="width:700px;"> |
||||
|
<el-form :model="editForm" label-width="120px" ref="editForm"> |
||||
|
<el-form-item label="更换步骤"> |
||||
|
<el-steps :active="2" finish-status="success"> |
||||
|
<el-step title="1 验证原邮箱"></el-step> |
||||
|
<el-step title="2 验证新邮箱"></el-step> |
||||
|
<el-step title="3 更换成功"></el-step> |
||||
|
</el-steps> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="新邮箱" prop="email" :rules="[{required:true,message:'新邮箱不能为空'}]"> |
||||
|
<el-input style="width:400px;" v-model="editForm.email" auto-complete="off"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button type="text" @click.native="doLogin" :loading="editLoading">登录</el-button> <el-button type="primary" @click.native="doChangeEmail" :loading="editLoading">提交</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-row> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import config from '@/common/config';//全局公共库 |
||||
|
import { sendEmail,validEmailCode } from '@/api/login'; |
||||
|
import { mapGetters } from 'vuex' |
||||
|
export default { |
||||
|
|
||||
|
computed: { |
||||
|
...mapGetters([ |
||||
|
'userInfo' |
||||
|
]) |
||||
|
}, |
||||
|
props:['user'], |
||||
|
watch: { |
||||
|
'user':function(data) { |
||||
|
this.editForm=data; |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
data() { |
||||
|
|
||||
|
var validatePhoneno = (rule, value, callback) => { |
||||
|
if (!value) { |
||||
|
callback(); |
||||
|
} else { |
||||
|
if (value) { |
||||
|
if(value.length<11 || value.length>11){ |
||||
|
callback(new Error('手机号码必须11位')); |
||||
|
} |
||||
|
if(!(/^1[3456789]\d{9}$/.test(value))){ |
||||
|
callback(new Error('手机号码格式不正确')); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
callback(); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
var validateEmail = (rule, value, callback) => { |
||||
|
if (value=='') { |
||||
|
callback(); |
||||
|
} else { |
||||
|
if (value !== '') { |
||||
|
var reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/; |
||||
|
if(!reg.test(value)){ |
||||
|
callback(new Error('邮箱格式不正确')); |
||||
|
} |
||||
|
} |
||||
|
callback(); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
var validateIdCardNo = (rule, value, callback) => { |
||||
|
if (value === ''|| value==null) { |
||||
|
//callback(nPhonenoew Error('请输入密码')); |
||||
|
callback(); |
||||
|
}else { |
||||
|
if (value !== '' && value.length>15) { |
||||
|
var reg = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/; |
||||
|
if(!reg.test(value)){ |
||||
|
callback(new Error('身份证号码格式不正确')); |
||||
|
}else{ |
||||
|
callback(); |
||||
|
} |
||||
|
}else if(value !== '' && value.length<15){ |
||||
|
callback(new Error('请输入15位或者18位长度身份证号码')); |
||||
|
}else{ |
||||
|
callback(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
}; |
||||
|
return { |
||||
|
validateEmail:validateEmail, |
||||
|
options:{},//下拉选择框的所有静态数据 |
||||
|
editLoading: false, |
||||
|
editFormRules: { |
||||
|
email: [ |
||||
|
{ validator:validateEmail, trigger: 'blur' } |
||||
|
] |
||||
|
}, |
||||
|
editForm:{ |
||||
|
email:'' |
||||
|
}, |
||||
|
valiCode:'',//验证码 |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
// 取消按钮点击 父组件监听@cancel="editFormVisible=false" 监听 |
||||
|
handleCancel:function(){ |
||||
|
this.$emit('cancel'); |
||||
|
}, |
||||
|
doChangeEmail(){ |
||||
|
this.$refs.editForm.validate((valid) => { |
||||
|
if (valid) { |
||||
|
this.changeEmail(); |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
changeEmail(){ |
||||
|
if(this.editForm.email){ |
||||
|
var curlDomain=window.location.protocol+"//"+window.location.host+"/"+process.env.CONTEXT+"/"+process.env.VERSION; |
||||
|
sendEmail({codeScene:'3',codeEmail:this.editForm.email,userType:'staff',callbackUri:curlDomain+'/#/changeEmailStepTwo'}).then(res=>{ |
||||
|
var tips = res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.$message({ message: "邮件已发送,请到收件箱收取邮件,并点击其链接进行验证新邮箱。", type: 'success' }); |
||||
|
}else{ |
||||
|
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
validEmailCode(){ |
||||
|
validEmailCode({valiCode:this.valiCode,userType:'staff'}).then(res=>{ |
||||
|
var tips = res.data.tips; |
||||
|
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}) |
||||
|
}, |
||||
|
doLogin(){ |
||||
|
this.$router.push({path: '/login' }) |
||||
|
} |
||||
|
}, |
||||
|
components: { |
||||
|
}, |
||||
|
mounted() { |
||||
|
var valiCode=this.$route.query.valiCode; |
||||
|
//var valiCode=util.getQueryStringByName('valiCode'); |
||||
|
if(valiCode){ |
||||
|
this.valiCode=valiCode; |
||||
|
this.validEmailCode(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
</style> |
||||
@ -0,0 +1,109 @@ |
|||||
|
<template> |
||||
|
<section> |
||||
|
<el-row class="padding" style="width:700px;"> |
||||
|
<el-form :model="editForm" label-width="120px" ref="editForm"> |
||||
|
<el-form-item label="更换常用邮箱"> |
||||
|
<el-steps :active="3" finish-status="success"> |
||||
|
<el-step title="1 验证原邮箱"></el-step> |
||||
|
<el-step title="2 验证新邮箱"></el-step> |
||||
|
<el-step title="3 更换成功"></el-step> |
||||
|
</el-steps> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button type="primary" @click.native="doLogin" :loading="editLoading">登录</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-row> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import config from '@/common/config';//全局公共库 |
||||
|
import { validEmailCode } from '@/api/login'; |
||||
|
import { mapGetters } from 'vuex' |
||||
|
export default { |
||||
|
|
||||
|
computed: { |
||||
|
...mapGetters([ |
||||
|
'userInfo' |
||||
|
]) |
||||
|
}, |
||||
|
props:['user'], |
||||
|
watch: { |
||||
|
'user':function(data) { |
||||
|
this.editForm=data; |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
data() { |
||||
|
|
||||
|
var validateEmail = (rule, value, callback) => { |
||||
|
if (value=='') { |
||||
|
callback(); |
||||
|
} else { |
||||
|
if (value !== '') { |
||||
|
var reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/; |
||||
|
if(!reg.test(value)){ |
||||
|
callback(new Error('邮箱格式不正确')); |
||||
|
} |
||||
|
} |
||||
|
callback(); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
return { |
||||
|
validateEmail:validateEmail, |
||||
|
options:{},//下拉选择框的所有静态数据 |
||||
|
editLoading: false, |
||||
|
editFormRules: { |
||||
|
email: [ |
||||
|
{ validator:validateEmail, trigger: 'blur' } |
||||
|
] |
||||
|
}, |
||||
|
editForm:{ |
||||
|
email:'' |
||||
|
}, |
||||
|
valiCode:'',//验证码 |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
// 取消按钮点击 父组件监听@cancel="editFormVisible=false" 监听 |
||||
|
handleCancel:function(){ |
||||
|
this.$emit('cancel'); |
||||
|
}, |
||||
|
doChangeEmail(){ |
||||
|
this.$refs.editForm.validate((valid) => { |
||||
|
if (valid) { |
||||
|
this.changeEmail(); |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
validEmailCode(){ |
||||
|
validEmailCode({valiCode:this.valiCode,userType:'staff'}).then(res=>{ |
||||
|
var tips = res.data.tips; |
||||
|
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}) |
||||
|
}, |
||||
|
doLogin(){ |
||||
|
this.$router.push({path: '/login' }); |
||||
|
} |
||||
|
}, |
||||
|
components: { |
||||
|
}, |
||||
|
mounted() { |
||||
|
var valiCode=this.$route.query.valiCode; |
||||
|
//var valiCode=util.getQueryStringByName('valiCode'); |
||||
|
if(valiCode){ |
||||
|
this.valiCode=valiCode; |
||||
|
this.validEmailCode(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
</style> |
||||
@ -0,0 +1,327 @@ |
|||||
|
<template> |
||||
|
<section> |
||||
|
|
||||
|
<!--工具条1--> |
||||
|
<!--如果有更多工具条,放开此注释 |
||||
|
<el-col :span="24" class="toolbar" style="padding-bottom: 0px;"> |
||||
|
<el-col :span="4"> |
||||
|
</el-col> |
||||
|
</el-col> |
||||
|
--> |
||||
|
|
||||
|
<!--编辑界面 User sys_user--> |
||||
|
<el-row class="padding" v-show="showPanel==='changePassword'" > |
||||
|
<el-form :model="passwordForm" label-width="120px" ref="passwordForm"> |
||||
|
<el-form-item label="" prop="headimgurl"> |
||||
|
<el-avatar :size="100" :src="editForm.headimgurl"></el-avatar> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="原密码" prop="oldPassword" :rules="[{required:true,message:'原密码不能为空'}]"> |
||||
|
<el-input style="width:400px;" type="password" v-model="passwordForm.oldPassword" auto-complete="off"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="新密码" prop="newPassword" :rules="[{required:true,message:'新密码不能为空'}]"> |
||||
|
<el-input style="width:400px;" type="password" v-model="passwordForm.newPassword" auto-complete="off"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button type="primary" @click.native="doChangePassword" :loading="editLoading">保存</el-button> |
||||
|
<el-button @click.native="showPanel='baseInfo'" :loading="editLoading">返回</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-row> |
||||
|
<el-row class="padding" v-show="showPanel==='baseInfo'" > |
||||
|
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm"> |
||||
|
<el-form-item label="" prop="headimgurl"> |
||||
|
<el-avatar :size="100" :src="editForm.headimgurl" @click="showUploadHeadimg"></el-avatar> |
||||
|
<br> |
||||
|
<el-button type="text" @click="showUploadHeadimg">更换头像</el-button> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="" v-show="false" prop="headimgurl"> |
||||
|
<single-shear-upload ref="uploadImg" |
||||
|
:img-width="100" |
||||
|
:img-height="100" |
||||
|
:show-title="true" |
||||
|
v-model="editForm.headimgurl" |
||||
|
:branch-id="userInfo.branchId" |
||||
|
:deptid="userInfo.deptid" |
||||
|
:remark="userInfo.username" |
||||
|
> |
||||
|
<span slot="title">商品高清大图</span> |
||||
|
</single-shear-upload> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="账户性质" prop="memType"> |
||||
|
<el-tag v-if="editForm.memType==='0'" type="primary">个人账户</el-tag> |
||||
|
<el-tag type="warning" v-else-if="editForm.memType=='1'">企业管理员账户</el-tag> |
||||
|
<el-tag type="warning" v-else-if="editForm.memType=='2'">企业员工账户</el-tag> |
||||
|
<el-button v-if="editForm.memType!=='0'" type="text" icon="el-icon-setting" @click="toBranchDetail">{{editForm.branchName}}</el-button> |
||||
|
<el-button v-if="editForm.memType==='0'" type="text" icon="el-icon-top" @click="upgradeToBranchAccount">升级为企业账户</el-button> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="用户名称" prop="username" :rules="[{required:true,message:'用户名称不能为空'}]"> |
||||
|
<el-input style="width:400px;" v-model="editForm.username" auto-complete="off"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="登录账号" prop="displayUserid" :rules="[{required:true,message:'登录账号不能为空'}]"> |
||||
|
<el-input style="width:400px;" v-model="editForm.displayUserid" auto-complete="off"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="邮箱" prop="email" :rules="[{required:true,message:'邮箱不能为空'},{validator:validateEmail}]"> |
||||
|
<el-input style="width:400px;" v-model="editForm.email" auto-complete="off"></el-input> |
||||
|
<el-button type="text" @click="registerEmail" v-if="!userInfo.email">绑定邮箱</el-button> |
||||
|
<el-button type="text" @click="changeEmail" v-if="userInfo.email">更换邮箱</el-button> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button @click.native="showPanel='changePassword'" :loading="editLoading">修改密码</el-button> |
||||
|
<el-button type="primary" @click.native="editSubmit" :loading="editLoading">保存</el-button> |
||||
|
<el-button @click.native="showPanel='bindMainAccount'" :loading="editLoading">绑定主账户</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-row> |
||||
|
|
||||
|
<el-row class="padding" v-show="showPanel==='bindMainAccount'" > |
||||
|
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm"> |
||||
|
<el-form-item label=""> |
||||
|
<font color="blue">主账号指平台统一账户,一般同一个手机号、微信号、邮箱认为是同一个账户</font> |
||||
|
<br> |
||||
|
<font color="blue">绑定主账户后,可以实现微信、app、公众号、小程序等各个应用账户互通</font> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="" > |
||||
|
<vue-qr |
||||
|
ref="qrcode" |
||||
|
:logoSrc="logoSrc" |
||||
|
:text="' https://www.qingqinkj.com/miniapp?page=bindMainAccount&userid='+editForm.userid" |
||||
|
:size="200" |
||||
|
:loadMake="true"/> |
||||
|
<br> |
||||
|
<font color="blue">扫描绑定{{editForm.username}}主账号</font> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button @click.native="showPanel='baseInfo'" :loading="editLoading">返回</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</el-row> |
||||
|
|
||||
|
<!--新增 Branch 管理端机构表(机构下面若干部门)界面--> |
||||
|
<el-dialog |
||||
|
title="新增机构" |
||||
|
:visible.sync="branchAddVisible" |
||||
|
width="50%" |
||||
|
|
||||
|
top="20px" |
||||
|
:close-on-click-modal="false" |
||||
|
> |
||||
|
<branch-add |
||||
|
:branch="{id:userInfo.branchId,branchName:'',admUserid:userInfo.branchId,admUsername:userInfo.username,luserid:userInfo.userid,lusername:userInfo.username}" |
||||
|
op-type="add" |
||||
|
:visible="branchAddVisible" |
||||
|
@cancel="branchAddVisible=false" |
||||
|
@submit="afterAddSubmit" |
||||
|
></branch-add> |
||||
|
</el-dialog> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import config from '@/common/config';//全局公共库 |
||||
|
import { editUser,changePassword } from '@/api/mdp/sys/user'; |
||||
|
import { sendEmail,validEmailCode } from '@/api/login'; |
||||
|
import { mapGetters } from 'vuex' |
||||
|
import SingleShearUpload from "@/components/Image/Single/Index"; |
||||
|
import BranchAdd from "@/views/mdp/sys/branch/BranchEdit"; |
||||
|
import logo1 from "@/assets/image/logo1.png" |
||||
|
import VueQr from 'vue-qr' |
||||
|
export default { |
||||
|
|
||||
|
computed: { |
||||
|
...mapGetters([ |
||||
|
'userInfo' |
||||
|
]) |
||||
|
}, |
||||
|
props:['user'], |
||||
|
watch: { |
||||
|
'user':function(data) { |
||||
|
this.editForm=data; |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
data() { |
||||
|
|
||||
|
var validatePhoneno = (rule, value, callback) => { |
||||
|
if (!value) { |
||||
|
callback(); |
||||
|
} else { |
||||
|
if (value) { |
||||
|
if(value.length<11 || value.length>11){ |
||||
|
callback(new Error('手机号码必须11位')); |
||||
|
} |
||||
|
if(!(/^1[3456789]\d{9}$/.test(value))){ |
||||
|
callback(new Error('手机号码格式不正确')); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
callback(); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
var validateEmail = (rule, value, callback) => { |
||||
|
if (value=='') { |
||||
|
callback(); |
||||
|
} else { |
||||
|
if (value !== '') { |
||||
|
var reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/; |
||||
|
if(!reg.test(value)){ |
||||
|
callback(new Error('邮箱格式不正确')); |
||||
|
} |
||||
|
} |
||||
|
callback(); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
var validateIdCardNo = (rule, value, callback) => { |
||||
|
if (value === ''|| value==null) { |
||||
|
//callback(nPhonenoew Error('请输入密码')); |
||||
|
callback(); |
||||
|
}else { |
||||
|
if (value !== '' && value.length>15) { |
||||
|
var reg = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/; |
||||
|
if(!reg.test(value)){ |
||||
|
callback(new Error('身份证号码格式不正确')); |
||||
|
}else{ |
||||
|
callback(); |
||||
|
} |
||||
|
}else if(value !== '' && value.length<15){ |
||||
|
callback(new Error('请输入15位或者18位长度身份证号码')); |
||||
|
}else{ |
||||
|
callback(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
}; |
||||
|
return { |
||||
|
validateEmail:validateEmail, |
||||
|
uploadHeadimgVisible:false, |
||||
|
showPanel:'baseInfo',//baseInfo-基础信息,changePassword-修改密码,bindMainAccount |
||||
|
options:{},//下拉选择框的所有静态数据 |
||||
|
editLoading: false, |
||||
|
editFormRules: { |
||||
|
displayUserid: [ |
||||
|
{ required: true, message: '账号必填', trigger: 'blur' } |
||||
|
], |
||||
|
username: [ |
||||
|
{ required: true, message: '用户名称必填', trigger: 'blur' } |
||||
|
], |
||||
|
email: [ |
||||
|
{ validator:validateEmail, trigger: 'blur' } |
||||
|
] |
||||
|
}, |
||||
|
//编辑界面数据 User sys_user |
||||
|
editForm: { |
||||
|
unionid:'',displayUserid:'',userid:'',locked:'',startdate:'',nickname:'',username:'',phoneno:'',password:'',salt:'',fingerpassword1:'',fingerpassword2:'',fingerpassword3:'',fingerpassword4:'',pwdtype:'',headimgurl:'',country:'',city:'',province:'',address:'',sex:'',enddate:'',districtId:'',userid:'',userAccount:'',userPwd:'',userName:'',userDesc:'',officePhoneno:'',idCardNo:'',email:'', |
||||
|
memType:'', |
||||
|
}, |
||||
|
passwordForm:{ |
||||
|
newPassword:'',oldPassword:'' |
||||
|
}, |
||||
|
logoSrc:logo1, |
||||
|
branchAddVisible:false, |
||||
|
valiCode:'',//验证码 |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
// 取消按钮点击 父组件监听@cancel="editFormVisible=false" 监听 |
||||
|
handleCancel:function(){ |
||||
|
this.$emit('cancel'); |
||||
|
}, |
||||
|
//编辑提交User sys_user父组件监听@submit="afterEditSubmit" |
||||
|
editSubmit: function () { |
||||
|
this.$refs.editForm.validate((valid) => { |
||||
|
if (valid) { |
||||
|
this.$confirm('确认提交吗?', '提示', {}).then(() => { |
||||
|
this.editLoading = true; |
||||
|
let params = Object.assign({}, this.editForm); |
||||
|
editUser(params).then((res) => { |
||||
|
this.editLoading = false; |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.$emit('submit');// @submit="afterEditSubmit" |
||||
|
} |
||||
|
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}).catch(() => { |
||||
|
this.editLoading = false; |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
doChangePassword(){ |
||||
|
this.$refs.passwordForm.validate((valid) => { |
||||
|
if (valid) { |
||||
|
changePassword({oldPassword:this.passwordForm.oldPassword,newPassword:this.passwordForm.newPassword}).then(res=>{ |
||||
|
var tips = res.data.tips; |
||||
|
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
showUploadHeadimg(){ |
||||
|
this.$refs.uploadImg.showAdd(); |
||||
|
}, |
||||
|
upgradeToBranchAccount(){ |
||||
|
//跳转到购买模块页面 |
||||
|
this.branchAddVisible=true; |
||||
|
}, |
||||
|
toBranchDetail(){ |
||||
|
//跳转到机构明细页面 |
||||
|
}, |
||||
|
registerEmail(){ |
||||
|
if(this.editForm.email){ |
||||
|
sendEmail({codeScene:'1',codeEmail:this.editForm.email,userType:'staff',callbackUri:'http://localhost:8015/#/updateUserInfo'}).then(res=>{ |
||||
|
var tips = res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.$message({ message: "邮件已发送,请到收件箱收取邮件,并点击其链接进行自动验证。", type: 'success' }); |
||||
|
}else{ |
||||
|
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
} |
||||
|
|
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
changeEmail(){ |
||||
|
if(this.editForm.email){ |
||||
|
|
||||
|
var curlDomain=window.location.protocol+"//"+window.location.host+"/"+process.env.CONTEXT+"/"+process.env.VERSION; |
||||
|
sendEmail({codeScene:'2',codeEmail:this.editForm.email,userType:'staff',callbackUri:curlDomain+'/#/changeEmailStepOne'}).then(res=>{ |
||||
|
var tips = res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.$message({ message: "邮件已发送,请到收件箱收取邮件,并点击其链接进行验证原邮箱。", type: 'success' }); |
||||
|
}else{ |
||||
|
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
validEmailCode(){ |
||||
|
validEmailCode({valiCode:this.valiCode,userType:'staff'}).then(res=>{ |
||||
|
var tips = res.data.tips; |
||||
|
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}) |
||||
|
}, |
||||
|
}, |
||||
|
components: { |
||||
|
SingleShearUpload,VueQr,BranchAdd, |
||||
|
}, |
||||
|
mounted() { |
||||
|
debugger; |
||||
|
this.editForm=Object.assign(this.editForm, this.userInfo); |
||||
|
var valiCode=this.$route.query.valiCode; |
||||
|
//var valiCode=util.getQueryStringByName('valiCode'); |
||||
|
if(valiCode){ |
||||
|
this.valiCode=valiCode; |
||||
|
this.validEmailCode(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
</style> |
||||
@ -0,0 +1,396 @@ |
|||||
|
<template> |
||||
|
<section class="page-container border padding"> |
||||
|
<el-row> |
||||
|
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"></el-input> |
||||
|
<el-button v-loading="load.list" :disabled="load.list==true" @click="searchUserLoginRecords" icon="el-icon-search">查询</el-button> |
||||
|
</el-row> |
||||
|
<el-row class="padding-top"> |
||||
|
<!--列表 UserLoginRecord 用户登录信息登记--> |
||||
|
<el-table ref="userLoginRecordTable" :data="userLoginRecords" :height="maxTableHeight" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
||||
|
<el-table-column type="selection" width="55" show-overflow-tooltip fixed="left"></el-table-column> |
||||
|
<el-table-column sortable type="index" width="55" show-overflow-tooltip fixed="left"></el-table-column> |
||||
|
<el-table-column prop="userid" label="用户编号" min-width="80" show-overflow-tooltip fixed="left"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.userid}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="loginType" label="登录方式" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.loginType}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="loginTime" label="登录时间" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.loginTime}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="loginBranchId" label="登录机构号" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.loginBranchId}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="username" label="登录用户名" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.username}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="phoneno" label="登录手机号" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.phoneno}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="loginIp" label="登录ip" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.loginIp}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="userAgent" label="请求特征码" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.userAgent}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<!-- |
||||
|
<el-table-column prop="deviceType" label="设备类型" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.deviceType}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="os" label="操作系统" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.os}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="osVersion" label="操作系统版本如Android" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.osVersion}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="osName" label="系统名称" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.osName}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="deviceManufacturer" label="设备生产厂商" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.deviceManufacturer}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="browerGroup" label="浏览器组" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.browerGroup}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="borderName" label="浏览器名称" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.borderName}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="borderVersion" label="浏览器版本" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.borderVersion}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="longitude" label="经度" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.longitude}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="latitude" label="纬度" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.latitude}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
--> |
||||
|
<el-table-column prop="loginStatus" label="登录状态" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-tag v-if="scope.row.loginStatus=='0'" type="danger"> |
||||
|
失败 |
||||
|
</el-tag> |
||||
|
<el-tag v-else type="success"> |
||||
|
成功 |
||||
|
</el-tag> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="loginMsg" label="登录说明" min-width="80" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<span > |
||||
|
{{scope.row.loginMsg}} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination> |
||||
|
</el-row> |
||||
|
</section> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import util from '@/common/js/util';//全局公共库 |
||||
|
import config from '@/common/config';//全局公共库 |
||||
|
import { initDicts,listUserLoginRecord, delUserLoginRecord, batchDelUserLoginRecord,editSomeFieldsUserLoginRecord } from '@/api/mdp/sys/userLoginRecord'; |
||||
|
import { mapGetters } from 'vuex' |
||||
|
|
||||
|
export default { |
||||
|
name:'userLoginRecordMng', |
||||
|
components: { |
||||
|
}, |
||||
|
props:['visible'], |
||||
|
computed: { |
||||
|
...mapGetters(['userInfo']), |
||||
|
|
||||
|
}, |
||||
|
watch:{ |
||||
|
visible(val){ |
||||
|
if(val==true){ |
||||
|
this.initData(); |
||||
|
this.searchUserLoginRecords() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
filters: { |
||||
|
key: '' |
||||
|
}, |
||||
|
userLoginRecords: [],//查询结果 |
||||
|
pageInfo:{//分页数据 |
||||
|
total:0,//服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算。 |
||||
|
pageSize:10,//每页数据 |
||||
|
count:false,//是否需要重新计算总记录数 |
||||
|
pageNum:1,//当前页码、从1开始计算 |
||||
|
orderFields:[],//排序列 如 ['sex','student_id'],必须为数据库字段 |
||||
|
orderDirs:[]//升序 asc,降序desc 如 性别 升序、学生编号降序 ['asc','desc'] |
||||
|
}, |
||||
|
load:{ list: false, edit: false, del: false, add: false },//查询中... |
||||
|
sels: [],//列表选中数据 |
||||
|
dicts:{ |
||||
|
//sex: [{id:'1',name:'男'},{id:'2',name:'女'}] |
||||
|
},//下拉选择框的所有静态数据 params={categoryId:'all',itemCodes:['sex']} 返回结果 {sex: [{id:'1',name:'男'},{id:'2',name:'女'}]} |
||||
|
addFormVisible: false,//新增userLoginRecord界面是否显示 |
||||
|
addForm: { |
||||
|
userid:'',shopId:'',locationId:'',loginShopid:'',loginLocationid:'',branchId:'',loginType:'',loginTime:'',loginBranchId:'',username:'',authId:'',mdpAppid:'',lockNo:'',lockStatus:'',lockTime:'',phoneno:'',loginIp:'',userType:'',loginDeviceId:'',loginDeviceSn:'',userAgent:'',reqNo:'',deviceType:'',os:'',osVersion:'',osName:'',renderingEngine:'',deviceManufacturer:'',browerGroup:'',borderName:'',borderVersion:'',id:'',longitude:'',latitude:'',regionId:'',regionName:'',formatAddress:'',districtId:'',memType:'',loginStatus:'',loginMsg:'',authType:'',grantType:'' |
||||
|
}, |
||||
|
|
||||
|
editFormVisible: false,//编辑界面是否显示 |
||||
|
editForm: { |
||||
|
userid:'',shopId:'',locationId:'',loginShopid:'',loginLocationid:'',branchId:'',loginType:'',loginTime:'',loginBranchId:'',username:'',authId:'',mdpAppid:'',lockNo:'',lockStatus:'',lockTime:'',phoneno:'',loginIp:'',userType:'',loginDeviceId:'',loginDeviceSn:'',userAgent:'',reqNo:'',deviceType:'',os:'',osVersion:'',osName:'',renderingEngine:'',deviceManufacturer:'',browerGroup:'',borderName:'',borderVersion:'',id:'',longitude:'',latitude:'',regionId:'',regionName:'',formatAddress:'',districtId:'',memType:'',loginStatus:'',loginMsg:'',authType:'',grantType:'' |
||||
|
}, |
||||
|
maxTableHeight:300, |
||||
|
} |
||||
|
},//end data |
||||
|
methods: { |
||||
|
|
||||
|
...util, |
||||
|
|
||||
|
handleSizeChange(pageSize) { |
||||
|
this.pageInfo.pageSize=pageSize; |
||||
|
this.getUserLoginRecords(); |
||||
|
}, |
||||
|
handleCurrentChange(pageNum) { |
||||
|
this.pageInfo.pageNum = pageNum; |
||||
|
this.getUserLoginRecords(); |
||||
|
}, |
||||
|
// 表格排序 obj.order=ascending/descending,需转化为 asc/desc ; obj.prop=表格中的排序字段,字段驼峰命名 |
||||
|
sortChange( obj ){ |
||||
|
if(obj.order==null){ |
||||
|
this.pageInfo.orderFields=[]; |
||||
|
this.pageInfo.orderDirs=[]; |
||||
|
}else{ |
||||
|
var dir='asc'; |
||||
|
if(obj.order=='ascending'){ |
||||
|
dir='asc' |
||||
|
}else{ |
||||
|
dir='desc'; |
||||
|
} |
||||
|
|
||||
|
this.pageInfo.orderFields=[util.toLine(obj.prop)]; |
||||
|
this.pageInfo.orderDirs=[dir]; |
||||
|
} |
||||
|
this.getUserLoginRecords(); |
||||
|
}, |
||||
|
searchUserLoginRecords(){ |
||||
|
this.pageInfo.count=true; |
||||
|
this.getUserLoginRecords(); |
||||
|
}, |
||||
|
//获取列表 UserLoginRecord 用户登录信息登记 |
||||
|
getUserLoginRecords() { |
||||
|
let params = { |
||||
|
pageSize: this.pageInfo.pageSize, |
||||
|
pageNum: this.pageInfo.pageNum, |
||||
|
total: this.pageInfo.total, |
||||
|
count:this.pageInfo.count |
||||
|
}; |
||||
|
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){ |
||||
|
let orderBys=[]; |
||||
|
for(var i=0;i<this.pageInfo.orderFields.length;i++){ |
||||
|
orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i]) |
||||
|
} |
||||
|
params.orderBy= orderBys.join(",") |
||||
|
} |
||||
|
if(this.filters.key){ |
||||
|
params.key=this.filters.key |
||||
|
} |
||||
|
|
||||
|
this.load.list = true; |
||||
|
listUserLoginRecord(params).then((res) => { |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.pageInfo.total = res.data.total; |
||||
|
this.pageInfo.count=false; |
||||
|
this.userLoginRecords = res.data.data; |
||||
|
}else{ |
||||
|
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: 'error' }); |
||||
|
} |
||||
|
this.load.list = false; |
||||
|
}).catch( err => this.load.list = false ); |
||||
|
}, |
||||
|
|
||||
|
//显示编辑界面 UserLoginRecord 用户登录信息登记 |
||||
|
showEdit: function ( row,index ) { |
||||
|
this.editFormVisible = true; |
||||
|
this.editForm = Object.assign({}, row); |
||||
|
}, |
||||
|
//显示新增界面 UserLoginRecord 用户登录信息登记 |
||||
|
showAdd: function () { |
||||
|
this.addFormVisible = true; |
||||
|
//this.addForm=Object.assign({}, this.editForm); |
||||
|
}, |
||||
|
afterAddSubmit(){ |
||||
|
this.addFormVisible=false; |
||||
|
this.pageInfo.count=true; |
||||
|
this.getUserLoginRecords(); |
||||
|
}, |
||||
|
afterEditSubmit(){ |
||||
|
this.editFormVisible=false; |
||||
|
}, |
||||
|
//选择行userLoginRecord |
||||
|
selsChange: function (sels) { |
||||
|
this.sels = sels; |
||||
|
}, |
||||
|
//删除userLoginRecord |
||||
|
handleDel: function (row,index) { |
||||
|
this.$confirm('确认删除该记录吗?', '提示', { |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.load.del=true; |
||||
|
let params = { id:row.id }; |
||||
|
delUserLoginRecord(params).then((res) => { |
||||
|
this.load.del=false; |
||||
|
var tips=res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
this.searchUserLoginRecords(); |
||||
|
} |
||||
|
this.$notify({ position:'bottom-left', showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); |
||||
|
}).catch( err => this.load.del=false ); |
||||
|
}); |
||||
|
}, |
||||
|
//批量删除userLoginRecord |
||||
|
batchDel: function () { |
||||
|
if(this.sels.length<=0){ |
||||
|
return; |
||||
|
} |
||||
|
var params=this.sels.map(i=>{ |
||||
|
return { id:i.id} |
||||
|
}) |
||||
|
this.$confirm('确认删除选中记录吗?', '提示', { |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.load.del=true; |
||||
|
batchDelUserLoginRecord(params).then((res) => { |
||||
|
this.load.del=false; |
||||
|
var tips=res.data.tips; |
||||
|
if( tips.isOk ){ |
||||
|
this.searchUserLoginRecords(); |
||||
|
} |
||||
|
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error'}); |
||||
|
}).catch( err => this.load.del=false ); |
||||
|
}); |
||||
|
}, |
||||
|
editSomeFields(row,fieldName,$event){ |
||||
|
let params={}; |
||||
|
if(this.sels.length>0){ |
||||
|
if(!this.sels.some(k=> k.id==row.id)){ |
||||
|
this.$notify({position:'bottom-left',showClose:true,message:'请编辑选中的行',type:'warning'}) |
||||
|
Object.assign(this.editForm,this.editFormBak) |
||||
|
return; |
||||
|
} |
||||
|
params['ids']=this.sels.map(i=>i.id) |
||||
|
}else{ |
||||
|
params['ids']=[row].map(i=>i.id) |
||||
|
} |
||||
|
params[fieldName]=$event |
||||
|
var func = editSomeFieldsUserLoginRecord |
||||
|
func(params).then(res=>{ |
||||
|
let tips = res.data.tips; |
||||
|
if(tips.isOk){ |
||||
|
if(this.sels.length>0){ |
||||
|
this.searchUserLoginRecords(); |
||||
|
} |
||||
|
this.editFormBak=[...this.editForm] |
||||
|
}else{ |
||||
|
Object.assign(this.editForm,this.editFormBak) |
||||
|
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'}) |
||||
|
} |
||||
|
}).catch((e)=>Object.assign(this.editForm,this.editFormBak)) |
||||
|
}, |
||||
|
rowClick: function(row, event, column){ |
||||
|
this.editForm=row |
||||
|
this.editFormBak={...row}; |
||||
|
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
||||
|
}, |
||||
|
initData: function(){ |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
},//end methods |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
initDicts(this); |
||||
|
this.initData() |
||||
|
this.searchUserLoginRecords(); |
||||
|
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.userLoginRecordTable.$el) |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue