Commit 609464c7 by cwq0219

Merge branch 'master' of http://192.168.3.233:8090/glsx-web/tFIMS

2 parents 093c22f7 54405b62
import request from './request'
import RequestMethods from './request.methods'
const path = 'fims.'
export function searchReportLog (data) {
data.method = `${path}reportlog.search`
return request(data)
}
export function searchDepot (data) {
data.method = `fims.configuration.from.conftype`
return request(data)
}
\ No newline at end of file
......@@ -2,9 +2,9 @@ import request from './request'
import RequestMethods from './request.methods'
const path = 'fims.user.'
export function Modify (data) {
data.method = `${path}modify`
return request(data, RequestMethods.POST)
export function ModifyPassword (data) {
data.method = `${path}password.modify`
return request(data, RequestMethods.GET)
}
export function getLoginlogs (data) {
......
......@@ -26,6 +26,9 @@ export default {
components: {
PersonalPanel
},
mounted () {
this.$event.$on('e-password-dialog',res=>this.passVisible =res)
},
computed: {
...mapState('d2admin/user', ['info'])
},
......
......@@ -50,14 +50,14 @@
type="primary"
@click="savePassword('info')"
>保 存</el-button>
<el-button @click="passwordDialogVisible = false">取 消</el-button>
<el-button @click="handleClose">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { Modify } from '@api/userManage'
import { ModifyPassword } from '@api/userManage'
export default {
name: 'PasswordDialog',
components: {
......@@ -112,8 +112,7 @@ export default {
},
props: {
passwordDialogVisible: {
type: Boolean,
default: false
type: Boolean
}
// info: {
// type: Object,
......@@ -123,24 +122,16 @@ export default {
// }
},
methods: {
// getPersonalType() {
// const params = {}
// params.method = ctMethods.GetPersonalType
// request
// .req(params)
// .then(res => {
// this.sendObjList = res.merchantDictList
// })
// .catch(err => {
// console.log(err)
// })
// },
// 修改密码
savePassword (formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
alert('submit!')
const params = {}
params.userId = ''
params.oldPassword = this.info.oldPassword
params.newPassword = this.info.newPassword
this.mergePassWord(params)
} else {
console.log('error submit!!')
return false
......@@ -148,16 +139,21 @@ export default {
})
},
handleClose () {
this.passwordDialogVisible = false
}
// mergePassWord (params) {
// Modify(params)
// .then(res => {
this.$event.$emit('e-password-dialog',false)
// this.passwordDialogVisible = false
},
// })
// .catch(err => console.log(err))
// }
mergePassWord (params) {
ModifyPassword(params)
.then(res => {
this.$message({
message: '密码修改成功',
type: 'success'
});
//this.passwordDialogVisible = false
})
.catch(err => console.log(err))
}
}
}
......
......@@ -67,7 +67,7 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="personDialogVisible = false">确 定</el-button>
<el-button type="primary" @click="handleClose">确 定</el-button>
</div>
</el-dialog>
</div>
......@@ -94,8 +94,7 @@ export default {
},
props: {
personDialogVisible: {
type: Boolean,
default: false
type: Boolean
}
// detail: {
// type: Object,
......@@ -136,7 +135,7 @@ export default {
// })
// },
handleClose () {
this.personDialogVisible = false
this.$emit('detailClose')
}
}
}
......
......@@ -22,10 +22,10 @@ util.title = function (titleText) {
* @description 打开新页面
* @param {String} url 地址
*/
util.open = function (url) {
util.open = function (url,target) {
var a = document.createElement('a')
a.setAttribute('href', url)
a.setAttribute('target', '_blank')
a.setAttribute('target', target||'_blank')
a.setAttribute('id', 'd2admin-link-temp')
document.body.appendChild(a)
a.click()
......
......@@ -275,7 +275,7 @@ export const resources = {
authId: '1070101',
parentId: '10701',
label: '审核',
handle: 'handleOperation'
handle: 'handleVerify'
}, { //
authId: '1070102',
parentId: '10701',
......
......@@ -110,10 +110,6 @@ export default {
this.$refs.roleForm.validate(vaild => {
if (vaild) {
const authIds = this.$refs.roleTree.getCheckedNodes()
if (authIds.length === 0) {
this.$message.error('请选择权限!')
return
}
var __p = { ...this.roleForm, authIds }
const fMethod = __p.roleId ? RoleModify : RoleReg
fMethod(__p).then(res => {
......
<template>
<el-dialog
:title="regForm.id?'编辑用户':'创建用户'"
:title="title"
:visible.sync="dialogVisible"
:before-close="handleClose"
width="720px"
......@@ -88,7 +88,6 @@
</el-dialog>
</template>
<script>
import { Reg, AccountModify } from '@/api/sys.account'
import { mapActions } from 'vuex'
import notice from '@/common/notice'
import { RegistType } from '@/common/constants'
......@@ -103,12 +102,21 @@ export default {
editData: {
type: Object,
default: {}
},
verify: {
type: Function,
default: null
}
},
watch: {
editData: {
handler: function (value) {
this.title = value && value.userId ? '编辑用户信息' : '创建用户'
if(!value || !value.data) return
const { data } = value
const {title,submit} = data
this.title = title
this.submitFunction = submit
delete value.data
Object.assign(this.regForm, value)
},
immediate: true
......@@ -136,6 +144,7 @@ export default {
roleId: ''
},
title: '',
submitFunction:null,
rules: Object.freeze({
loginName: [
{ required: true, message: '用户名不能为空', trigger: ['blur'] }
......@@ -174,21 +183,20 @@ export default {
methods: {
...mapActions('d2admin/base', ['load']),
handleClose (done) {
this.$event.$emit('e-reg-dialog', false)
this.$event.$emit('e-reg-dialog-close')
},
// 提交注册数据
// 提交注册或审核数据
submit () {
this.$refs.regForm.validate(vaild => {
if (vaild) {
var __p = this.regForm
__p.createType = RegistType.BY_ADMIN
const fMethod = __p.userId ? AccountModify : Reg
fMethod(__p).then(res => {
this.submitFunction(__p).then(res => {
const { operateStatus } = res
if (operateStatus) {
notice.okTips(`${this.title}成功!`)
this.$refs.regForm.resetFields()
this.$event.$emit('e-reg-dialog', false)
this.$event.$emit('e-reg-dialog-close')
} else {
notice.errorTips(`${this.title}失败!`)
}
......
......@@ -97,7 +97,7 @@
:total="page.totalCount"
layout="sizes,total,->,prev,pager,next,jumper"
></el-pagination>
<dialog-reg :isVisible="registerDialogVisible" :editData="editData" />
<dialog-reg :isVisible="registerDialogVisible" :editData="editData"/>
</d2-container>
</template>
......@@ -109,7 +109,8 @@ import {
AccountIncrease,
AccountForbidden,
AccountValidate,
AccountActived
AccountActived,
Reg
} from '@/api/sys.account'
import notice from '@/common/notice'
import { mapActions } from 'vuex'
......@@ -137,8 +138,6 @@ export default {
'重置密码': PassWordReset,
'延期': AccountIncrease,
'禁用': AccountForbidden,
'审核': AccountValidate,
'编辑': AccountModify,
'激活': AccountActived
}),
// 新增/编辑弹窗
......@@ -182,7 +181,7 @@ export default {
mounted () {
this.fetchData()
this.$event.$on('e-reg-dialog', res => (this.registerDialogVisible = res))
this.$event.$on('e-reg-dialog-close', res =>(this.registerDialogVisible = false))
},
methods: {
......@@ -235,7 +234,13 @@ export default {
return row.status === value
},
handleRegister () {
this.registerDialogVisible = true
const row ={
data: {
title:'用户创建',
submit:Reg
}
}
this.openDialog(row)
},
handleSearch () {
this.loadUserList()
......@@ -250,10 +255,25 @@ export default {
this.loadUserList()
},
handleEdit (row) {
row=util.deepClone(row)
row.data = {
title:'用户编辑',
submit:AccountModify
}
this.openDialog (row)
},
openDialog(row) {
this.registerDialogVisible = true
this.editData = util.deepClone(row)
this.editData = row
},
handleVerify(row){
row=util.deepClone(row)
row.data = {
title:'用户审核',
submit:AccountValidate
}
this.openDialog (row)
},
// ------------
// 列表各种操作
async handleOperation (row, e) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!