Commit cf94bfe5 by 胡悦

修复bug

1 parent cb6fcda2
...@@ -220,10 +220,12 @@ export default { ...@@ -220,10 +220,12 @@ export default {
let api = addDictData let api = addDictData
if (params.id) { if (params.id) {
api = editDictData api = editDictData
delete params.delFlag
delete params.disabled
} }
api(params).then(res => { api(params).then(res => {
console.log(res) console.log(res)
if (res.code = 200) { if (res.code == 200) {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '操作成功!' message: '操作成功!'
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
ref="dictManage" ref="dictManage"
:tableParams="tableParams" :tableParams="tableParams"
:getListApi="getListApi" :getListApi="getListApi"
:beforeSearchFn="beforeSearchFn"
:searchForm="searchForm" :searchForm="searchForm"
:hasNum="false" :hasNum="false"
> >
...@@ -85,6 +86,7 @@ export default { ...@@ -85,6 +86,7 @@ export default {
return { return {
DICTSTATUS: this.$Constants.DICT_STATUS, DICTSTATUS: this.$Constants.DICT_STATUS,
searchForm: {}, searchForm: {},
searchDataForm: {},
dictionaryFormList: [ dictionaryFormList: [
{ {
type: 'input', type: 'input',
...@@ -111,6 +113,10 @@ export default { ...@@ -111,6 +113,10 @@ export default {
value: 2 value: 2
} }
] ]
},
{
type: 'daterange',
prop: 'daterange'
} }
], ],
tableParams: { tableParams: {
...@@ -185,6 +191,20 @@ export default { ...@@ -185,6 +191,20 @@ export default {
// 重置搜索条件 // 重置搜索条件
refresh() { refresh() {
this.searchForm = {} this.searchForm = {}
this.searchDataForm = {}
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
console.log(this.searchForm)
if (this.searchForm.daterange) {
this.searchForm.sDate = this.searchForm.daterange[0]
this.searchForm.eDate = this.searchForm.daterange[1]
delete this.searchForm.daterange
} else {
if (this.searchForm.sDate) delete this.searchForm.sDate && delete this.searchForm.eDate
}
resolve()
})
}, },
// 确定 // 确定
handleConfirm() { handleConfirm() {
......
...@@ -142,7 +142,7 @@ export default { ...@@ -142,7 +142,7 @@ export default {
{ prop: 'departmentName', label: '组织名称' }, { prop: 'departmentName', label: '组织名称' },
{ prop: 'orderNum', label: '排序' }, { prop: 'orderNum', label: '排序' },
{ prop: 'enableStatus', label: '状态' }, { prop: 'enableStatus', label: '状态' },
{ prop: 'createDate', label: '创建时间' } { prop: 'createdDate', label: '创建时间' }
], ],
page: { page: {
pageSize: 10, pageSize: 10,
......
...@@ -141,11 +141,11 @@ export default { ...@@ -141,11 +141,11 @@ export default {
label: '角色名称', label: '角色名称',
prop: 'roleName' prop: 'roleName'
}, { }, {
label: '创建时间',
prop: 'createdDate'
}, {
label: '备注', label: '备注',
prop: 'remark' prop: 'remark'
}, {
label: '创建时间',
prop: 'createdDate'
} }
], ],
tableOption: { tableOption: {
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
node-key="id" node-key="id"
@node-click="handleNodeClick" @node-click="handleNodeClick"
:render-content="renderContent" :render-content="renderContent"
default-expand-all
> >
</el-tree> </el-tree>
</div> </div>
...@@ -215,7 +214,7 @@ export default { ...@@ -215,7 +214,7 @@ export default {
userVisible: false, userVisible: false,
userForm: { userForm: {
account: '', account: '',
gender: 2, gender: '2',
departmentName: '', departmentName: '',
superiorName: '', superiorName: '',
enableStatus: true enableStatus: true
...@@ -230,7 +229,7 @@ export default { ...@@ -230,7 +229,7 @@ export default {
{ label: '角色:', prop: 'roleId', type: 'select', options: [], key: 'roleName', value: 'roleId', filterable: true }, { label: '角色:', prop: 'roleId', type: 'select', options: [], key: 'roleName', value: 'roleId', filterable: true },
{ label: '邮箱:', prop: 'email', type: 'input' }, { label: '邮箱:', prop: 'email', type: 'input' },
{ label: '手机:', prop: 'phoneNumber', type: 'input' }, { label: '手机:', prop: 'phoneNumber', type: 'input' },
{ label: '性别:', prop: 'gender', type: 'select', options: [{ label: '未知', value: 2 }, { label: '男', value: 0 }, { label: '女', value: 1 }] }, { label: '性别:', prop: 'gender', type: 'select', options: [], key: 'dictLabel', value: 'dictValue' },
{ label: '状态:', prop: 'enableStatus', type: 'switch' }, { label: '状态:', prop: 'enableStatus', type: 'switch' },
{ label: '岗位:', prop: 'position', type: 'select', options: [], key: 'dictLabel', value: 'dictValue' } { label: '岗位:', prop: 'position', type: 'select', options: [], key: 'dictLabel', value: 'dictValue' }
], ],
...@@ -259,6 +258,7 @@ export default { ...@@ -259,6 +258,7 @@ export default {
this.getTreeOrg() this.getTreeOrg()
this.getRoleList() this.getRoleList()
this.getPosti() this.getPosti()
this.getSex()
}, },
methods: { methods: {
emptyData(params) { emptyData(params) {
...@@ -318,7 +318,6 @@ export default { ...@@ -318,7 +318,6 @@ export default {
}, },
// 树节点内容区的渲染 // 树节点内容区的渲染
renderContent(h, { node, data, store }) { renderContent(h, { node, data, store }) {
console.log(h, { node, data, store }, '----------')
const text = node.data.userNumber === 0 ? `${node.label}` : `${node.label}(${node.data.userNumber}人)` const text = node.data.userNumber === 0 ? `${node.label}` : `${node.label}(${node.data.userNumber}人)`
return ( return (
<span>{text}</span> <span>{text}</span>
...@@ -330,9 +329,9 @@ export default { ...@@ -330,9 +329,9 @@ export default {
switch (pType) { switch (pType) {
case 'create': case 'create':
this.userDialogTitle = '新增用户' this.userDialogTitle = '新增用户'
this.userRules.password = this.addRule this.$set(this.userRules, 'password', this.addRule)
this.userForm = { this.userForm = {
gender: 2, gender: '2',
departmentName: '', departmentName: '',
superiorName: '', superiorName: '',
enableStatus: true enableStatus: true
...@@ -342,7 +341,9 @@ export default { ...@@ -342,7 +341,9 @@ export default {
break break
case 'edit': case 'edit':
this.userDialogTitle = '编辑用户' this.userDialogTitle = '编辑用户'
if (this.userRules.password) delete this.userRules.password if (this.userRules.password) {
this.$set(this.userRules, 'password', null)
}
this.editEvent(scope) this.editEvent(scope)
break break
case 'delete': case 'delete':
...@@ -357,6 +358,7 @@ export default { ...@@ -357,6 +358,7 @@ export default {
this.userDialogTitle = '编辑用户' this.userDialogTitle = '编辑用户'
this.userForm = JSON.parse(JSON.stringify(res.data)) this.userForm = JSON.parse(JSON.stringify(res.data))
this.userForm.enableStatus = res.data.enableStatus == 1 ? true : false this.userForm.enableStatus = res.data.enableStatus == 1 ? true : false
this.userForm.gender = this.userForm.gender + ''
console.log(this.userForm) console.log(this.userForm)
this.handleClose(res.data) this.handleClose(res.data)
}) })
...@@ -405,7 +407,6 @@ export default { ...@@ -405,7 +407,6 @@ export default {
this.filterVisible = !this.filterVisible this.filterVisible = !this.filterVisible
}, },
filterConfirm() { filterConfirm() {
console.log(this.$refs.tree.getCheckedKeys(false, true), this.$refs.tree.getCurrentNode())
if (this.filterDialogTitle == '选择直接上级') { if (this.filterDialogTitle == '选择直接上级') {
this.userForm.superiorId = this.$refs.tree.getCurrentNode().id this.userForm.superiorId = this.$refs.tree.getCurrentNode().id
this.userForm.superiorName = this.$refs.tree.getCurrentNode().label this.userForm.superiorName = this.$refs.tree.getCurrentNode().label
...@@ -417,28 +418,24 @@ export default { ...@@ -417,28 +418,24 @@ export default {
this.closeFilter() this.closeFilter()
}, },
filterNode(value, data) { filterNode(value, data) {
console.log(value, data)
if (!value) return true if (!value) return true
return data.label.indexOf(value) !== -1 return data.label.indexOf(value) !== -1
}, },
// 获取上级树 // 获取上级树
getSuperUser(params) { getSuperUser(params) {
getSuperUser(params).then(res => { getSuperUser(params).then(res => {
console.log(res)
this.filterTextData = res.data this.filterTextData = res.data
}) })
}, },
// 获取组织树 // 获取组织树
getSimpleList() { getSimpleList() {
getTreeOrg().then(res => { getTreeOrg().then(res => {
console.log(res)
this.filterTextData = res.data this.filterTextData = res.data
}) })
}, },
// 获取组织架构 // 获取组织架构
getTreeOrg(params) { getTreeOrg(params) {
getTreeOrg(params).then(res => { getTreeOrg(params).then(res => {
console.log(res)
// this.searchForm.departmentId = res.data.id // this.searchForm.departmentId = res.data.id
this.treedata = res.data this.treedata = res.data
}) })
...@@ -448,7 +445,6 @@ export default { ...@@ -448,7 +445,6 @@ export default {
roleList().then(res => { roleList().then(res => {
this.roleList = res.data this.roleList = res.data
this.userData[5].options = res.data this.userData[5].options = res.data
console.log(this.roleList)
}) })
}, },
// 组织架构搜索 // 组织架构搜索
...@@ -463,8 +459,24 @@ export default { ...@@ -463,8 +459,24 @@ export default {
// 岗位列表 // 岗位列表
getPosti(value) { getPosti(value) {
dictInfo('sys_position').then(res => { dictInfo('sys_position').then(res => {
console.log(res) const arr = []
this.userData[this.userData.length - 1].options = res.data res.data.map(item => {
if (!item.disabled) arr.push(item)
})
this.userData[this.userData.length - 1].options = arr
})
},
getSex() {
dictInfo('sys_user_sex').then(res => {
const arr = []
res.data.map(item => {
if (!item.disabled) arr.push(item)
})
this.userData.map(item => {
if (item.prop == 'gender') {
item.options = arr
}
})
}) })
} }
} }
......
...@@ -54,8 +54,7 @@ export default { ...@@ -54,8 +54,7 @@ export default {
worklogFormList: [ worklogFormList: [
{ {
type: 'daterange', type: 'daterange',
prop: 'daterange', prop: 'daterange'
placeholder: '请输入字典名称'
} }
], ],
tableParams: { tableParams: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!