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